From 2104817a500f4a61509e6dd14bccd5315e9f39f5 Mon Sep 17 00:00:00 2001 From: Wang Tsu-Han Date: Wed, 24 Oct 2018 16:07:21 +0200 Subject: [PATCH 01/31] name changing for L1 --- nfapi/oai_integration/nfapi_pnf.c | 8 +- nfapi/oai_integration/nfapi_vnf.c | 26 ++-- openair1/PHY/TOOLS/lte_phy_scope.c | 2 +- openair1/PHY/defs_eNB.h | 21 +-- openair1/SCHED/fapi_l1.c | 2 +- targets/RT/USER/lte-enb.c | 221 ++++++++++++++--------------- targets/RT/USER/lte-ru.c | 8 +- 7 files changed, 146 insertions(+), 142 deletions(-) diff --git a/nfapi/oai_integration/nfapi_pnf.c b/nfapi/oai_integration/nfapi_pnf.c index e741692214..684668f086 100644 --- a/nfapi/oai_integration/nfapi_pnf.c +++ b/nfapi/oai_integration/nfapi_pnf.c @@ -741,7 +741,7 @@ int pnf_phy_hi_dci0_req(nfapi_pnf_p7_config_t* pnf_p7, nfapi_hi_dci0_request_t* //phy_info* phy = (phy_info*)(pnf_p7->user_data); struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0]; - eNB_rxtx_proc_t *proc = &eNB->proc.proc_rxtx[0]; + eNB_rxtx_proc_t *proc = &eNB->proc.L1_proc; for (int i=0; ihi_dci0_request_body.number_of_dci + req->hi_dci0_request_body.number_of_hi; i++) { @@ -798,7 +798,7 @@ int pnf_phy_dl_config_req(nfapi_pnf_p7_config_t* pnf_p7, nfapi_dl_config_request int sf = NFAPI_SFNSF2SF(req->sfn_sf); struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0]; - eNB_rxtx_proc_t *proc = &eNB->proc.proc_rxtx[0]; + eNB_rxtx_proc_t *proc = &eNB->proc.L1_proc; nfapi_dl_config_request_pdu_t* dl_config_pdu_list = req->dl_config_request_body.dl_config_pdu_list; LTE_eNB_PDCCH *pdcch_vars = &eNB->pdcch_vars[sf&1]; @@ -869,7 +869,7 @@ int pnf_phy_dl_config_req(nfapi_pnf_p7_config_t* pnf_p7, nfapi_dl_config_request //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() DLSCH:pdu_index:%d handle_nfapi_dlsch_pdu(eNB, proc_rxtx, dlsch_pdu, transport_blocks:%d sdu:%p) eNB->pdcch_vars[proc->subframe_tx & 1].num_pdcch_symbols:%d\n", __FUNCTION__, rel8_pdu->pdu_index, rel8_pdu->transport_blocks, dlsch_sdu, eNB->pdcch_vars[proc->subframe_tx & 1].num_pdcch_symbols); - handle_nfapi_dlsch_pdu( eNB, sfn,sf, &eNB->proc.proc_rxtx[0], &dl_config_pdu_list[i], rel8_pdu->transport_blocks-1, dlsch_sdu); + handle_nfapi_dlsch_pdu( eNB, sfn,sf, &eNB->proc.L1_proc, &dl_config_pdu_list[i], rel8_pdu->transport_blocks-1, dlsch_sdu); } else { @@ -945,7 +945,7 @@ int pnf_phy_ul_config_req(nfapi_pnf_p7_config_t* pnf_p7, nfapi_ul_config_request uint16_t curr_sf = NFAPI_SFNSF2SF(req->sfn_sf); struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0]; - eNB_rxtx_proc_t *proc = &eNB->proc.proc_rxtx[0]; + eNB_rxtx_proc_t *proc = &eNB->proc.L1_proc; nfapi_ul_config_request_pdu_t* ul_config_pdu_list = req->ul_config_request_body.ul_config_pdu_list; for (int i=0;iul_config_request_body.number_of_pdus;i++) { diff --git a/nfapi/oai_integration/nfapi_vnf.c b/nfapi/oai_integration/nfapi_vnf.c index 8022bc53f4..e9d0ad35a3 100644 --- a/nfapi/oai_integration/nfapi_vnf.c +++ b/nfapi/oai_integration/nfapi_vnf.c @@ -345,7 +345,7 @@ int wake_eNB_rxtx(PHY_VARS_eNB *eNB, uint16_t sfn, uint16_t sf) { eNB_proc_t *proc=&eNB->proc; - eNB_rxtx_proc_t *proc_rxtx=&proc->proc_rxtx[sf&1]; + eNB_rxtx_proc_t *L1_proc= (sf&1)? &proc->L1_proc : &proc->L1_proc_tx; LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms; @@ -359,8 +359,8 @@ int wake_eNB_rxtx(PHY_VARS_eNB *eNB, uint16_t sfn, uint16_t sf) { // wake up TX for subframe n+sf_ahead // lock the TX mutex and make sure the thread is ready - if (pthread_mutex_timedlock(&proc_rxtx->mutex_rxtx,&wait) != 0) { - LOG_E( PHY, "[eNB] ERROR pthread_mutex_lock for eNB RXTX thread %d (IC %d)\n", proc_rxtx->subframe_rx&1,proc_rxtx->instance_cnt_rxtx ); + if (pthread_mutex_timedlock(&L1_proc->mutex,&wait) != 0) { + LOG_E( PHY, "[eNB] ERROR pthread_mutex_lock for eNB RXTX thread %d (IC %d)\n", L1_proc->subframe_rx&1,L1_proc->instance_cnt ); exit_fun( "error locking mutex_rxtx" ); return(-1); } @@ -379,9 +379,9 @@ int wake_eNB_rxtx(PHY_VARS_eNB *eNB, uint16_t sfn, uint16_t sf) { if (old_sf == 0 && old_sfn % 100==0) LOG_W( PHY,"[eNB] sfn/sf:%d%d old_sfn/sf:%d%d proc[rx:%d%d]\n", sfn, sf, old_sfn, old_sf, proc->frame_rx, proc->subframe_rx); } - ++proc_rxtx->instance_cnt_rxtx; + ++L1_proc->instance_cnt; - //LOG_D( PHY,"[VNF-subframe_ind] sfn/sf:%d:%d proc[frame_rx:%d subframe_rx:%d] proc_rxtx->instance_cnt_rxtx:%d \n", sfn, sf, proc->frame_rx, proc->subframe_rx, proc_rxtx->instance_cnt_rxtx); + //LOG_D( PHY,"[VNF-subframe_ind] sfn/sf:%d:%d proc[frame_rx:%d subframe_rx:%d] L1_proc->instance_cnt_rxtx:%d \n", sfn, sf, proc->frame_rx, proc->subframe_rx, L1_proc->instance_cnt_rxtx); // We have just received and processed the common part of a subframe, say n. // TS_rx is the last received timestamp (start of 1st slot), TS_tx is the desired @@ -389,23 +389,23 @@ int wake_eNB_rxtx(PHY_VARS_eNB *eNB, uint16_t sfn, uint16_t sf) { // The last (TS_rx mod samples_per_frame) was n*samples_per_tti, // we want to generate subframe (n+N), so TS_tx = TX_rx+N*samples_per_tti, // and proc->subframe_tx = proc->subframe_rx+sf_ahead - proc_rxtx->timestamp_tx = proc->timestamp_rx + (sf_ahead*fp->samples_per_tti); - proc_rxtx->frame_rx = proc->frame_rx; - proc_rxtx->subframe_rx = proc->subframe_rx; - proc_rxtx->frame_tx = (proc_rxtx->subframe_rx > (9-sf_ahead)) ? (proc_rxtx->frame_rx+1)&1023 : proc_rxtx->frame_rx; - proc_rxtx->subframe_tx = (proc_rxtx->subframe_rx + sf_ahead)%10; + L1_proc->timestamp_tx = proc->timestamp_rx + (sf_ahead*fp->samples_per_tti); + L1_proc->frame_rx = proc->frame_rx; + L1_proc->subframe_rx = proc->subframe_rx; + L1_proc->frame_tx = (L1_proc->subframe_rx > (9-sf_ahead)) ? (L1_proc->frame_rx+1)&1023 : L1_proc->frame_rx; + L1_proc->subframe_tx = (L1_proc->subframe_rx + sf_ahead)%10; - //LOG_D(PHY, "sfn/sf:%d%d proc[rx:%d%d] proc_rxtx[instance_cnt_rxtx:%d rx:%d%d] About to wake rxtx thread\n\n", sfn, sf, proc->frame_rx, proc->subframe_rx, proc_rxtx->instance_cnt_rxtx, proc_rxtx->frame_rx, proc_rxtx->subframe_rx); + //LOG_D(PHY, "sfn/sf:%d%d proc[rx:%d%d] L1_proc[instance_cnt_rxtx:%d rx:%d%d] About to wake rxtx thread\n\n", sfn, sf, proc->frame_rx, proc->subframe_rx, L1_proc->instance_cnt_rxtx, L1_proc->frame_rx, L1_proc->subframe_rx); // the thread can now be woken up - if (pthread_cond_signal(&proc_rxtx->cond_rxtx) != 0) { + if (pthread_cond_signal(&L1_proc->cond) != 0) { LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB RXn-TXnp4 thread\n"); exit_fun( "ERROR pthread_cond_signal" ); return(-1); } //LOG_D(PHY,"%s() About to attempt pthread_mutex_unlock\n", __FUNCTION__); - pthread_mutex_unlock( &proc_rxtx->mutex_rxtx ); + pthread_mutex_unlock( &L1_proc->mutex ); //LOG_D(PHY,"%s() UNLOCKED pthread_mutex_unlock\n", __FUNCTION__); return(0); diff --git a/openair1/PHY/TOOLS/lte_phy_scope.c b/openair1/PHY/TOOLS/lte_phy_scope.c index 9f2ec54744..000eb48615 100644 --- a/openair1/PHY/TOOLS/lte_phy_scope.c +++ b/openair1/PHY/TOOLS/lte_phy_scope.c @@ -178,7 +178,7 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form, float time[FRAME_LENGTH_COMPLEX_SAMPLES]; float time2[2048]; float freq[nsymb_ce*nb_antennas_rx*nb_antennas_tx]; - int frame = phy_vars_enb->proc.proc_rxtx[0].frame_tx; + int frame = phy_vars_enb->proc.L1_proc.frame_tx; uint32_t total_dlsch_bitrate = phy_vars_enb->total_dlsch_bitrate; int coded_bits_per_codeword = 0; uint8_t harq_pid; // in TDD config 3 it is sf-2, i.e., can be 0,1,2 diff --git a/openair1/PHY/defs_eNB.h b/openair1/PHY/defs_eNB.h index f23485cad8..d9b8f9b319 100644 --- a/openair1/PHY/defs_eNB.h +++ b/openair1/PHY/defs_eNB.h @@ -648,19 +648,24 @@ typedef struct { int frame_rx; /// \brief Instance count for RXn-TXnp4 processing thread. /// \internal This variable is protected by \ref mutex_rxtx. - int instance_cnt_rxtx; + int instance_cnt; /// pthread structure for RXn-TXnp4 processing thread - pthread_t pthread_rxtx; + pthread_t pthread; /// pthread attributes for RXn-TXnp4 processing thread - pthread_attr_t attr_rxtx; + pthread_attr_t attr; /// condition variable for tx processing thread - pthread_cond_t cond_rxtx; + pthread_cond_t cond; /// mutex for RXn-TXnp4 processing thread - pthread_mutex_t mutex_rxtx; + pthread_mutex_t mutex; /// scheduling parameters for RXn-TXnp4 thread struct sched_param sched_param_rxtx; - /// pipeline ready state - int pipe_ready; + + /// \internal This variable is protected by \ref mutex_RUs. + int instance_cnt_RUs; + /// condition variable for tx processing thread + pthread_cond_t cond_RUs; + /// mutex for RXn-TXnp4 processing thread + pthread_mutex_t mutex_RUs; } eNB_rxtx_proc_t; typedef struct { @@ -821,7 +826,7 @@ typedef struct eNB_proc_t_s { /// parameters for turbo-encoding worker thread te_params tep[3]; /// set of scheduling variables RXn-TXnp4 threads - eNB_rxtx_proc_t proc_rxtx[2]; + eNB_rxtx_proc_t L1_proc,L1_proc_tx; /// stats thread pthread descriptor pthread_t process_stats_thread; /// for waking up tx procedure diff --git a/openair1/SCHED/fapi_l1.c b/openair1/SCHED/fapi_l1.c index ad72c3d9f5..3aafc0059b 100644 --- a/openair1/SCHED/fapi_l1.c +++ b/openair1/SCHED/fapi_l1.c @@ -670,7 +670,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) eNB = RC.eNB[Mod_id][CC_id]; fp = &eNB->frame_parms; - proc = &eNB->proc.proc_rxtx[0]; + proc = &eNB->proc.L1_proc; /* TODO: check that following line is correct - in the meantime it is disabled */ //if ((fp->frame_type == TDD) && (subframe_select(fp,subframe)==SF_UL)) return; diff --git a/targets/RT/USER/lte-enb.c b/targets/RT/USER/lte-enb.c index e2415e1156..46c595e3f1 100644 --- a/targets/RT/USER/lte-enb.c +++ b/targets/RT/USER/lte-enb.c @@ -162,6 +162,7 @@ extern void add_subframe(uint16_t *frameP, uint16_t *subframeP, int offset); static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_name) { start_meas(&softmodem_stats_rxtx_sf); + eNB_rxtx_proc_t *L1_proc_tx = &eNB->proc.L1_proc_tx; // ******************************************************************* @@ -222,12 +223,13 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam } VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER , 1 ); +//#TODO if(get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT){ - if(wait_on_condition(&proc[1].mutex_rxtx,&proc[1].cond_rxtx,&proc[1].pipe_ready,"wakeup_tx")<0) { - LOG_E(PHY,"Frame %d, subframe %d: TX1 not ready\n",proc[1].frame_rx,proc[1].subframe_rx); + if(wait_on_condition(&L1_proc_tx->mutex,&L1_proc_tx->cond,&L1_proc_tx->instance_cnt,"wakeup_tx")<0) { + LOG_E(PHY,"Frame %d, subframe %d: TX1 not ready\n",L1_proc_tx->frame_rx,L1_proc_tx->subframe_rx); return(-1); } - if (release_thread(&proc[1].mutex_rxtx,&proc[1].pipe_ready,"wakeup_tx")<0) return(-1); + if (release_thread(&L1_proc_tx->mutex,&L1_proc_tx->instance_cnt,"wakeup_tx")<0) return(-1); } pthread_mutex_lock(&eNB->UL_INFO_mutex); @@ -301,14 +303,14 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam } -static void* tx_thread(void* param) { +static void* L1_thread_tx(void* param) { eNB_proc_t *eNB_proc = (eNB_proc_t*)param; - eNB_rxtx_proc_t *proc = &eNB_proc->proc_rxtx[1]; + eNB_rxtx_proc_t *proc = &eNB_proc->L1_proc_tx; PHY_VARS_eNB *eNB = RC.eNB[0][proc->CC_id]; char thread_name[100]; - sprintf(thread_name,"TXnp4_%d\n",&eNB->proc.proc_rxtx[0] == proc ? 0 : 1); + sprintf(thread_name,"TXnp4_%d\n",&eNB->proc.L1_proc == proc ? 0 : 1); thread_top_init(thread_name,1,470000,500000,500000); //wait_sync("tx_thread"); @@ -316,7 +318,7 @@ static void* tx_thread(void* param) { while (!oai_exit) { - if (wait_on_condition(&proc->mutex_rxtx,&proc->cond_rxtx,&proc->instance_cnt_rxtx,thread_name)<0) break; + if (wait_on_condition(&proc->mutex,&proc->cond,&proc->instance_cnt,thread_name)<0) break; if (oai_exit) break; // ***************************************** // TX processing for subframe n+4 @@ -329,16 +331,17 @@ static void* tx_thread(void* param) { VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX1_ENB,proc->frame_rx); phy_procedures_eNB_TX(eNB, proc, 1); - if (release_thread(&proc->mutex_rxtx,&proc->instance_cnt_rxtx,thread_name)<0) break; + if (release_thread(&proc->mutex,&proc->instance_cnt,thread_name)<0) break; - pthread_mutex_lock( &proc->mutex_rxtx ); - proc->pipe_ready++; +//#TODO + pthread_mutex_lock( &proc->mutex ); + proc->instance_cnt++; // the thread can now be woken up - if (pthread_cond_signal(&proc->cond_rxtx) != 0) { + if (pthread_cond_signal(&proc->cond) != 0) { LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread\n"); exit_fun( "ERROR pthread_cond_signal" ); } - pthread_mutex_unlock( &proc->mutex_rxtx ); + pthread_mutex_unlock( &proc->mutex ); wakeup_txfh(proc,eNB_proc->ru_proc); } @@ -351,7 +354,7 @@ static void* tx_thread(void* param) { * \returns a pointer to an int. The storage is not on the heap and must not be freed. */ -static void* eNB_thread_rxtx( void* param ) { +static void* L1_thread( void* param ) { static int eNB_thread_rxtx_status; //eNB_proc_t *eNB_proc = (eNB_proc_t*)param; @@ -363,7 +366,7 @@ static void* eNB_thread_rxtx( void* param ) { } else{ eNB_proc_t *eNB_proc = (eNB_proc_t*)param; - proc = &eNB_proc->proc_rxtx[0]; + proc = &eNB_proc->L1_proc; } @@ -379,7 +382,7 @@ static void* eNB_thread_rxtx( void* param ) { eNB_thread_rxtx_status = 0; - sprintf(thread_name,"RXn_TXnp4_%d\n",&eNB->proc.proc_rxtx[0] == proc ? 0 : 1); + sprintf(thread_name,"RXn_TXnp4_%d\n",&eNB->proc.L1_proc == proc ? 0 : 1); thread_top_init(thread_name,1,470000,500000,500000); pthread_setname_np( pthread_self(),"rxtx processing"); LOG_I(PHY,"thread rxtx created id=%ld\n", syscall(__NR_gettid)); @@ -392,7 +395,7 @@ static void* eNB_thread_rxtx( void* param ) { VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 0 ); T(T_ENB_MASTER_TICK, T_INT(0), T_INT(proc->frame_rx), T_INT(proc->subframe_rx)); - if (wait_on_condition(&proc->mutex_rxtx,&proc->cond_rxtx,&proc->instance_cnt_rxtx,thread_name)<0) break; + if (wait_on_condition(&proc->mutex,&proc->cond,&proc->instance_cnt,thread_name)<0) break; VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_CPUID_ENB_THREAD_RXTX,sched_getcpu()); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 1 ); @@ -410,15 +413,15 @@ static void* eNB_thread_rxtx( void* param ) { if (rxtx(eNB,proc,thread_name) < 0) break; } - if (release_thread(&proc->mutex_rxtx,&proc->instance_cnt_rxtx,thread_name)<0) break; - pthread_mutex_lock( &proc->mutex_rxtx ); - proc->pipe_ready++; + if (release_thread(&proc->mutex,&proc->instance_cnt,thread_name)<0) break; + pthread_mutex_lock( &proc->mutex); + proc->instance_cnt++; // the thread can now be woken up - if (pthread_cond_signal(&proc->cond_rxtx) != 0) { + if (pthread_cond_signal(&proc->cond) != 0) { LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread\n"); exit_fun( "ERROR pthread_cond_signal" ); } - pthread_mutex_unlock( &proc->mutex_rxtx ); + pthread_mutex_unlock( &proc->mutex ); if (nfapi_mode!=2){ if(get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) wakeup_tx(eNB,eNB->proc.ru_proc); else if(get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT) @@ -441,7 +444,7 @@ static void* eNB_thread_rxtx( void* param ) { void eNB_top(PHY_VARS_eNB *eNB, int frame_rx, int subframe_rx, char *string,RU_t *ru) { eNB_proc_t *proc = &eNB->proc; - eNB_rxtx_proc_t *proc_rxtx = &proc->proc_rxtx[0]; + eNB_rxtx_proc_t *L1_proc = &proc->L1_proc; LTE_DL_FRAME_PARMS *fp = &ru->frame_parms; RU_proc_t *ru_proc=&ru->proc; @@ -451,16 +454,16 @@ void eNB_top(PHY_VARS_eNB *eNB, int frame_rx, int subframe_rx, char *string,RU_t if (!oai_exit) { T(T_ENB_MASTER_TICK, T_INT(0), T_INT(proc->frame_rx), T_INT(proc->subframe_rx)); - proc_rxtx->timestamp_tx = ru_proc->timestamp_rx + (sf_ahead*fp->samples_per_tti); - proc_rxtx->frame_rx = ru_proc->frame_rx; - proc_rxtx->subframe_rx = ru_proc->subframe_rx; - proc_rxtx->frame_tx = (proc_rxtx->subframe_rx > (9-sf_ahead)) ? (proc_rxtx->frame_rx+1)&1023 : proc_rxtx->frame_rx; - proc_rxtx->subframe_tx = (proc_rxtx->subframe_rx + sf_ahead)%10; + L1_proc->timestamp_tx = ru_proc->timestamp_rx + (sf_ahead*fp->samples_per_tti); + L1_proc->frame_rx = ru_proc->frame_rx; + L1_proc->subframe_rx = ru_proc->subframe_rx; + L1_proc->frame_tx = (L1_proc->subframe_rx > (9-sf_ahead)) ? (L1_proc->frame_rx+1)&1023 : L1_proc->frame_rx; + L1_proc->subframe_tx = (L1_proc->subframe_rx + sf_ahead)%10; - if (rxtx(eNB,proc_rxtx,string) < 0) LOG_E(PHY,"eNB %d CC_id %d failed during execution\n",eNB->Mod_id,eNB->CC_id); - ru_proc->timestamp_tx = proc_rxtx->timestamp_tx; - ru_proc->subframe_tx = proc_rxtx->subframe_tx; - ru_proc->frame_tx = proc_rxtx->frame_tx; + if (rxtx(eNB,L1_proc,string) < 0) LOG_E(PHY,"eNB %d CC_id %d failed during execution\n",eNB->Mod_id,eNB->CC_id); + ru_proc->timestamp_tx = L1_proc->timestamp_tx; + ru_proc->subframe_tx = L1_proc->subframe_tx; + ru_proc->frame_tx = L1_proc->frame_tx; } } @@ -510,8 +513,8 @@ int wakeup_tx(PHY_VARS_eNB *eNB,RU_proc_t *ru_proc) { eNB_proc_t *proc=&eNB->proc; - eNB_rxtx_proc_t *proc_rxtx1=&proc->proc_rxtx[1];//*proc_rxtx=&proc->proc_rxtx[proc->frame_rx&1]; - eNB_rxtx_proc_t *proc_rxtx0=&proc->proc_rxtx[0]; + eNB_rxtx_proc_t *L1_proc_tx = &proc->L1_proc_tx; + eNB_rxtx_proc_t *L1_proc = &proc->L1_proc; struct timespec wait; @@ -520,34 +523,34 @@ int wakeup_tx(PHY_VARS_eNB *eNB,RU_proc_t *ru_proc) { - if (proc_rxtx1->instance_cnt_rxtx == 0) { - LOG_E(PHY,"Frame %d, subframe %d: TX1 thread busy, dropping\n",proc_rxtx1->frame_rx,proc_rxtx1->subframe_rx); + if (L1_proc_tx->instance_cnt == 0) { + LOG_E(PHY,"Frame %d, subframe %d: TX1 thread busy, dropping\n",L1_proc_tx->frame_rx,L1_proc_tx->subframe_rx); return(-1); } - if (pthread_mutex_timedlock(&proc_rxtx1->mutex_rxtx,&wait) != 0) { - LOG_E( PHY, "[eNB] ERROR pthread_mutex_lock for eNB TX1 thread %d (IC %d)\n", proc_rxtx1->subframe_rx&1,proc_rxtx1->instance_cnt_rxtx ); + if (pthread_mutex_timedlock(&L1_proc_tx->mutex,&wait) != 0) { + LOG_E( PHY, "[eNB] ERROR pthread_mutex_lock for eNB TX1 thread %d (IC %d)\n", L1_proc_tx->subframe_rx&1,L1_proc_tx->instance_cnt ); exit_fun( "error locking mutex_tx" ); return(-1); } - ++proc_rxtx1->instance_cnt_rxtx; + ++L1_proc_tx->instance_cnt; - proc_rxtx1->subframe_rx = proc_rxtx0->subframe_rx; - proc_rxtx1->frame_rx = proc_rxtx0->frame_rx; - proc_rxtx1->subframe_tx = proc_rxtx0->subframe_tx; - proc_rxtx1->frame_tx = proc_rxtx0->frame_tx; - proc_rxtx1->timestamp_tx = proc_rxtx0->timestamp_tx; + L1_proc_tx->subframe_rx = L1_proc->subframe_rx; + L1_proc_tx->frame_rx = L1_proc->frame_rx; + L1_proc_tx->subframe_tx = L1_proc->subframe_tx; + L1_proc_tx->frame_tx = L1_proc->frame_tx; + L1_proc_tx->timestamp_tx = L1_proc->timestamp_tx; // the thread can now be woken up - if (pthread_cond_signal(&proc_rxtx1->cond_rxtx) != 0) { + if (pthread_cond_signal(&L1_proc_tx->cond) != 0) { LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread\n"); exit_fun( "ERROR pthread_cond_signal" ); return(-1); } - pthread_mutex_unlock( &proc_rxtx1->mutex_rxtx ); + pthread_mutex_unlock( &L1_proc_tx->mutex); return(0); } @@ -557,8 +560,7 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) { eNB_proc_t *proc=&eNB->proc; RU_proc_t *ru_proc=&ru->proc; - eNB_rxtx_proc_t *proc_rxtx0=&proc->proc_rxtx[0]; - //eNB_rxtx_proc_t *proc_rxtx1=&proc->proc_rxtx[1]; + eNB_rxtx_proc_t *L1_proc=&proc->L1_proc; LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms; @@ -591,28 +593,22 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) { wait.tv_sec=0; wait.tv_nsec=5000000L; - - if(wait_on_condition(&proc_rxtx0->mutex_rxtx,&proc_rxtx0->cond_rxtx,&proc_rxtx0->pipe_ready,"wakeup_rxtx")<0) { - LOG_E(PHY,"Frame %d, subframe %d: RXTX0 not ready\n",proc_rxtx0->frame_rx,proc_rxtx0->subframe_rx); - return(-1); - } - if (release_thread(&proc_rxtx0->mutex_rxtx,&proc_rxtx0->pipe_ready,"wakeup_rxtx")<0) return(-1); - - if (proc_rxtx0->instance_cnt_rxtx == 0) { - LOG_E(PHY,"Frame %d, subframe %d: RXTX0 thread busy, dropping\n",proc_rxtx0->frame_rx,proc_rxtx0->subframe_rx); + + if (L1_proc->instance_cnt == 0) { + LOG_E(PHY,"Frame %d, subframe %d: RXTX0 thread busy, dropping\n",L1_proc->frame_rx,L1_proc->subframe_rx); return(-1); } // wake up TX for subframe n+sf_ahead // lock the TX mutex and make sure the thread is ready - if (pthread_mutex_timedlock(&proc_rxtx0->mutex_rxtx,&wait) != 0) { - LOG_E( PHY, "[eNB] ERROR pthread_mutex_lock for eNB RXTX thread %d (IC %d)\n", proc_rxtx0->subframe_rx&1,proc_rxtx0->instance_cnt_rxtx ); + if (pthread_mutex_timedlock(&L1_proc->mutex,&wait) != 0) { + LOG_E( PHY, "[eNB] ERROR pthread_mutex_lock for eNB RXTX thread %d (IC %d)\n", L1_proc->subframe_rx&1,L1_proc->instance_cnt ); exit_fun( "error locking mutex_rxtx" ); return(-1); } - ++proc_rxtx0->instance_cnt_rxtx; + ++L1_proc->instance_cnt; // We have just received and processed the common part of a subframe, say n. // TS_rx is the last received timestamp (start of 1st slot), TS_tx is the desired @@ -620,20 +616,20 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) { // The last (TS_rx mod samples_per_frame) was n*samples_per_tti, // we want to generate subframe (n+sf_ahead), so TS_tx = TX_rx+sf_ahead*samples_per_tti, // and proc->subframe_tx = proc->subframe_rx+sf_ahead - proc_rxtx0->timestamp_tx = ru_proc->timestamp_rx + (sf_ahead*fp->samples_per_tti); - proc_rxtx0->frame_rx = ru_proc->frame_rx; - proc_rxtx0->subframe_rx = ru_proc->subframe_rx; - proc_rxtx0->frame_tx = (proc_rxtx0->subframe_rx > (9-sf_ahead)) ? (proc_rxtx0->frame_rx+1)&1023 : proc_rxtx0->frame_rx; - proc_rxtx0->subframe_tx = (proc_rxtx0->subframe_rx + sf_ahead)%10; + L1_proc->timestamp_tx = ru_proc->timestamp_rx + (sf_ahead*fp->samples_per_tti); + L1_proc->frame_rx = ru_proc->frame_rx; + L1_proc->subframe_rx = ru_proc->subframe_rx; + L1_proc->frame_tx = (L1_proc->subframe_rx > (9-sf_ahead)) ? (L1_proc->frame_rx+1)&1023 : L1_proc->frame_rx; + L1_proc->subframe_tx = (L1_proc->subframe_rx + sf_ahead)%10; // the thread can now be woken up - if (pthread_cond_signal(&proc_rxtx0->cond_rxtx) != 0) { + if (pthread_cond_signal(&L1_proc->cond) != 0) { LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB RXn-TXnp4 thread\n"); exit_fun( "ERROR pthread_cond_signal" ); return(-1); } - pthread_mutex_unlock( &proc_rxtx0->mutex_rxtx ); + pthread_mutex_unlock( &L1_proc->mutex); return(0); } @@ -884,7 +880,7 @@ void init_eNB_proc(int inst) { int CC_id; PHY_VARS_eNB *eNB; eNB_proc_t *proc; - eNB_rxtx_proc_t *proc_rxtx; + eNB_rxtx_proc_t *L1_proc, *L1_proc_tx; pthread_attr_t *attr0=NULL,*attr1=NULL,*attr_prach=NULL; #if (RRC_VERSION >= MAKE_VERSION(14, 0, 0)) pthread_attr_t *attr_prach_br=NULL; @@ -899,26 +895,25 @@ void init_eNB_proc(int inst) { #endif proc = &eNB->proc; - proc_rxtx = proc->proc_rxtx; - proc_rxtx[0].instance_cnt_rxtx = -1; - proc_rxtx[1].instance_cnt_rxtx = -1; - proc_rxtx[0].pipe_ready = 0; - proc_rxtx[1].pipe_ready = 0; + L1_proc = &proc->L1_proc; + L1_proc_tx = &proc->L1_proc_tx; + L1_proc->instance_cnt = -1; + L1_proc_tx->instance_cnt = -1; proc->instance_cnt_prach = -1; proc->instance_cnt_asynch_rxtx = -1; proc->instance_cnt_synch = -1; proc->CC_id = CC_id; - proc->first_rx=1; - proc->first_tx=1; - proc->RU_mask=0; - proc->RU_mask_prach=0; + proc->first_rx =1; + proc->first_tx =1; + proc->RU_mask =0; + proc->RU_mask_prach =0; pthread_mutex_init( &eNB->UL_INFO_mutex, NULL); - pthread_mutex_init( &proc_rxtx[0].mutex_rxtx, NULL); - pthread_mutex_init( &proc_rxtx[1].mutex_rxtx, NULL); - pthread_cond_init( &proc_rxtx[0].cond_rxtx, NULL); - pthread_cond_init( &proc_rxtx[1].cond_rxtx, NULL); + pthread_mutex_init( &L1_proc->mutex, NULL); + pthread_mutex_init( &L1_proc_tx->mutex, NULL); + pthread_cond_init( &L1_proc->cond, NULL); + pthread_cond_init( &L1_proc_tx->cond, NULL); pthread_mutex_init( &proc->mutex_prach, NULL); pthread_mutex_init( &proc->mutex_asynch_rxtx, NULL); @@ -930,8 +925,8 @@ void init_eNB_proc(int inst) { pthread_attr_init( &proc->attr_prach); pthread_attr_init( &proc->attr_asynch_rxtx); - pthread_attr_init( &proc_rxtx[0].attr_rxtx); - pthread_attr_init( &proc_rxtx[1].attr_rxtx); + pthread_attr_init( &L1_proc->attr); + pthread_attr_init( &L1_proc_tx->attr); #if (RRC_VERSION >= MAKE_VERSION(14, 0, 0)) proc->instance_cnt_prach_br = -1; proc->RU_mask_prach_br=0; @@ -941,8 +936,8 @@ void init_eNB_proc(int inst) { pthread_attr_init( &proc->attr_prach_br); #endif #ifndef DEADLINE_SCHEDULER - attr0 = &proc_rxtx[0].attr_rxtx; - attr1 = &proc_rxtx[1].attr_rxtx; + attr0 = &L1_proc->attr; + attr1 = &L1_proc_tx->attr; attr_prach = &proc->attr_prach; #if (RRC_VERSION >= MAKE_VERSION(14, 0, 0)) attr_prach_br = &proc->attr_prach_br; @@ -962,20 +957,13 @@ void init_eNB_proc(int inst) { LOG_I(PHY,"eNB->single_thread_flag:%d\n", eNB->single_thread_flag); if ((get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT || get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) && nfapi_mode!=2) { - pthread_create( &proc_rxtx[0].pthread_rxtx, attr0, eNB_thread_rxtx, proc ); - pthread_create( &proc_rxtx[1].pthread_rxtx, attr1, tx_thread, proc); + pthread_create( &L1_proc->pthread, attr0, L1_thread, proc ); + pthread_create( &L1_proc_tx->pthread, attr1, L1_thread_tx, proc); } pthread_create( &proc->pthread_prach, attr_prach, eNB_thread_prach, eNB ); #if (RRC_VERSION >= MAKE_VERSION(14, 0, 0)) pthread_create( &proc->pthread_prach_br, attr_prach_br, eNB_thread_prach_br, eNB ); #endif - /*char name[16]; - if (eNB->single_thread_flag==0) { - snprintf( name, sizeof(name), "RXTX0 %d", i ); - pthread_setname_np( proc_rxtx[0].pthread_rxtx, name ); - snprintf( name, sizeof(name), "RXTX1 %d", i ); - pthread_setname_np( proc_rxtx[1].pthread_rxtx, name ); - }*/ AssertFatal(proc->instance_cnt_prach == -1,"instance_cnt_prach = %d\n",proc->instance_cnt_prach); @@ -1020,26 +1008,31 @@ void kill_eNB_proc(int inst) { int *status; PHY_VARS_eNB *eNB; eNB_proc_t *proc; - eNB_rxtx_proc_t *proc_rxtx; + eNB_rxtx_proc_t *L1_proc, *L1_proc_tx; int i; for (int CC_id=0; CC_idproc; - proc_rxtx = &proc->proc_rxtx[0]; + proc = &eNB->proc; + L1_proc = &proc->L1_proc; + L1_proc_tx = &proc->L1_proc_tx; if(get_thread_worker_conf() == WORKER_ENABLE) { kill_td_thread(eNB); kill_te_thread(eNB); } LOG_I(PHY, "Killing TX CC_id %d inst %d\n", CC_id, inst ); - for (i=0; i<2; i++) { - pthread_mutex_lock(&proc_rxtx[i].mutex_rxtx); - proc_rxtx[i].instance_cnt_rxtx = 0; - proc_rxtx[i].pipe_ready = 0; - pthread_cond_signal(&proc_rxtx[i].cond_rxtx); - pthread_mutex_unlock(&proc_rxtx[i].mutex_rxtx); - } + + pthread_mutex_lock(&L1_proc->mutex); + L1_proc->instance_cnt = 0; + pthread_cond_signal(&L1_proc->cond); + pthread_mutex_unlock(&L1_proc->mutex); + + pthread_mutex_lock(&L1_proc_tx->mutex); + L1_proc_tx->instance_cnt = 0; + pthread_cond_signal(&L1_proc_tx->cond); + pthread_mutex_unlock(&L1_proc_tx->mutex); + pthread_mutex_lock(&proc->mutex_prach); proc->instance_cnt_prach = 0; pthread_cond_signal( &proc->cond_prach ); @@ -1063,18 +1056,24 @@ void kill_eNB_proc(int inst) { #endif LOG_I(PHY, "Destroying UL_INFO mutex\n"); pthread_mutex_destroy(&eNB->UL_INFO_mutex); - for (i=0;i<2;i++) { - LOG_I(PHY, "Joining rxtx[%d] mutex/cond\n",i); - pthread_join( proc_rxtx[i].pthread_rxtx, (void**)&status ); - LOG_I(PHY, "Destroying rxtx[%d] mutex/cond\n",i); - pthread_mutex_destroy( &proc_rxtx[i].mutex_rxtx ); - pthread_cond_destroy( &proc_rxtx[i].cond_rxtx ); + + if ((get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT || get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) && nfapi_mode!=2) { + LOG_I(PHY, "Joining L1_proc mutex/cond\n"); + pthread_join( L1_proc->pthread, (void**)&status ); + LOG_I(PHY, "Joining L1_proc_tx mutex/cond\n"); + pthread_join( L1_proc_tx->pthread, (void**)&status ); } + LOG_I(PHY, "Destroying L1_proc mutex/cond\n"); + pthread_mutex_destroy( &L1_proc->mutex ); + pthread_cond_destroy( &L1_proc->cond ); + LOG_I(PHY, "Destroying L1_proc_tx mutex/cond\n"); + pthread_mutex_destroy( &L1_proc_tx->mutex ); + pthread_cond_destroy( &L1_proc_tx->cond ); pthread_attr_destroy(&proc->attr_prach); pthread_attr_destroy(&proc->attr_asynch_rxtx); - pthread_attr_destroy(&proc_rxtx[0].attr_rxtx); - pthread_attr_destroy(&proc_rxtx[1].attr_rxtx); + pthread_attr_destroy(&L1_proc->attr); + pthread_attr_destroy(&L1_proc_tx->attr); #ifdef Rel14 pthread_mutex_destroy(&proc->mutex_RU_PRACH_br); pthread_attr_destroy(&proc->attr_prach_br); diff --git a/targets/RT/USER/lte-ru.c b/targets/RT/USER/lte-ru.c index 7002bc4ebd..1b92517f57 100644 --- a/targets/RT/USER/lte-ru.c +++ b/targets/RT/USER/lte-ru.c @@ -1974,7 +1974,7 @@ static void* eNB_thread_phy_tx( void* param ) { RU_proc_t *proc = &ru->proc; PHY_VARS_eNB **eNB_list = ru->eNB_list; - eNB_rxtx_proc_t proc_rxtx; + eNB_rxtx_proc_t L1_proc; // set default return value eNB_thread_phy_tx_status = 0; @@ -1991,9 +1991,9 @@ static void* eNB_thread_phy_tx( void* param ) { LOG_D(PHY,"Running eNB phy tx procedures\n"); if(ru->num_eNB == 1){ - proc_rxtx.subframe_tx = proc->subframe_phy_tx; - proc_rxtx.frame_tx = proc->frame_phy_tx; - phy_procedures_eNB_TX(eNB_list[0], &proc_rxtx, 1); + L1_proc.subframe_tx = proc->subframe_phy_tx; + L1_proc.frame_tx = proc->frame_phy_tx; + phy_procedures_eNB_TX(eNB_list[0], &L1_proc, 1); phy_tx_txdataF_end = 1; if(pthread_mutex_lock(&ru->proc.mutex_rf_tx) != 0){ LOG_E( PHY, "[RU] ERROR pthread_mutex_lock for rf tx thread (IC %d)\n", ru->proc.instance_cnt_rf_tx); From de32c38987a670e55b2835c90fec7c33ec62856c Mon Sep 17 00:00:00 2001 From: Wang Tsu-Han Date: Thu, 25 Oct 2018 17:48:07 +0200 Subject: [PATCH 02/31] applying new mechanism for communication between threads --- targets/RT/USER/lte-enb.c | 79 ++++++++++++++++++++++----------------- targets/RT/USER/lte-ru.c | 38 ++++++++++++------- 2 files changed, 70 insertions(+), 47 deletions(-) diff --git a/targets/RT/USER/lte-enb.c b/targets/RT/USER/lte-enb.c index 46c595e3f1..f8d5a351be 100644 --- a/targets/RT/USER/lte-enb.c +++ b/targets/RT/USER/lte-enb.c @@ -162,7 +162,7 @@ extern void add_subframe(uint16_t *frameP, uint16_t *subframeP, int offset); static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_name) { start_meas(&softmodem_stats_rxtx_sf); - eNB_rxtx_proc_t *L1_proc_tx = &eNB->proc.L1_proc_tx; + //eNB_rxtx_proc_t *L1_proc_tx = &eNB->proc.L1_proc_tx; // ******************************************************************* @@ -223,14 +223,30 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam } VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER , 1 ); -//#TODO - if(get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT){ - if(wait_on_condition(&L1_proc_tx->mutex,&L1_proc_tx->cond,&L1_proc_tx->instance_cnt,"wakeup_tx")<0) { - LOG_E(PHY,"Frame %d, subframe %d: TX1 not ready\n",L1_proc_tx->frame_rx,L1_proc_tx->subframe_rx); +/*//#TODO + if(get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) + { + if (pthread_mutex_lock(mutex) != 0) { + LOG_E(PHY, "[SCHED][eNB] ERROR locking mutex for eNB L1_thread_tx\n"); + exit_fun("ERROR pthread_lock"); return(-1); } - if (release_thread(&L1_proc_tx->mutex,&L1_proc_tx->instance_cnt,"wakeup_tx")<0) return(-1); - } + while(L1_proc_tx->instance_cnt == 0){ + pthread_cond_wait(L1_proc_tx->cond,L1_proc_tx->mutex); + } + L1_proc_tx->instance_cnt = 0; + if (pthread_cond_signal(&L1_proc_tx->cond) != 0) { + LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB L1_thread_tx\n"); + exit_fun( "ERROR pthread_cond_signal" ); + return(-1); + } + if (pthread_mutex_unlock(mutex) != 0) { + LOG_E(PHY,"[SCHED][eNB] error unlocking mutex for %s\n",name); + exit_fun("ERROR pthread_unlock"); + return(-1); + } + }*/ + pthread_mutex_lock(&eNB->UL_INFO_mutex); @@ -331,18 +347,16 @@ static void* L1_thread_tx(void* param) { VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX1_ENB,proc->frame_rx); phy_procedures_eNB_TX(eNB, proc, 1); - if (release_thread(&proc->mutex,&proc->instance_cnt,thread_name)<0) break; - -//#TODO + pthread_mutex_lock( &proc->mutex ); - proc->instance_cnt++; + proc->instance_cnt = -1; // the thread can now be woken up if (pthread_cond_signal(&proc->cond) != 0) { LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread\n"); exit_fun( "ERROR pthread_cond_signal" ); } pthread_mutex_unlock( &proc->mutex ); - wakeup_txfh(proc,eNB_proc->ru_proc); + wakeup_txfh(proc,eNB->proc.ru_proc); } return 0; @@ -414,14 +428,6 @@ static void* L1_thread( void* param ) { } if (release_thread(&proc->mutex,&proc->instance_cnt,thread_name)<0) break; - pthread_mutex_lock( &proc->mutex); - proc->instance_cnt++; - // the thread can now be woken up - if (pthread_cond_signal(&proc->cond) != 0) { - LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread\n"); - exit_fun( "ERROR pthread_cond_signal" ); - } - pthread_mutex_unlock( &proc->mutex ); if (nfapi_mode!=2){ if(get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) wakeup_tx(eNB,eNB->proc.ru_proc); else if(get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT) @@ -474,13 +480,13 @@ int wakeup_txfh(eNB_rxtx_proc_t *proc,RU_proc_t *ru_proc) { struct timespec wait; wait.tv_sec=0; wait.tv_nsec=5000000L; +printf("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~inside wakeup_txfh %d.%d IC_RU = %d\n", proc->frame_tx, proc->subframe_tx, proc->instance_cnt_RUs); - - if(wait_on_condition(&ru_proc->mutex_eNBs,&ru_proc->cond_eNBs,&ru_proc->ru_tx_ready,"wakeup_txfh")<0) { + if(wait_on_condition(&proc->mutex_RUs,&proc->cond_RUs,&proc->instance_cnt_RUs,"wakeup_txfh")<0) { LOG_E(PHY,"Frame %d, subframe %d: TX FH not ready\n", ru_proc->frame_tx, ru_proc->subframe_tx); return(-1); } - if (release_thread(&ru_proc->mutex_eNBs,&ru_proc->ru_tx_ready,"wakeup_txfh")<0) return(-1); + if (release_thread(&proc->mutex_RUs,&proc->instance_cnt_RUs,"wakeup_txfh")<0) return(-1); if (ru_proc->instance_cnt_eNBs == 0) { LOG_E(PHY,"Frame %d, subframe %d: TX FH thread busy, dropping Frame %d, subframe %d\n", ru_proc->frame_tx, ru_proc->subframe_tx, proc->frame_rx, proc->subframe_rx); @@ -492,10 +498,12 @@ int wakeup_txfh(eNB_rxtx_proc_t *proc,RU_proc_t *ru_proc) { return(-1); } - ++ru_proc->instance_cnt_eNBs; + //for(num_RUs) + ru_proc->instance_cnt_eNBs = 0; ru_proc->timestamp_tx = proc->timestamp_tx; ru_proc->subframe_tx = proc->subframe_tx; ru_proc->frame_tx = proc->frame_tx; + // the thread can now be woken up if (pthread_cond_signal(&ru_proc->cond_eNBs) != 0) { @@ -522,19 +530,16 @@ int wakeup_tx(PHY_VARS_eNB *eNB,RU_proc_t *ru_proc) { wait.tv_nsec=5000000L; - - if (L1_proc_tx->instance_cnt == 0) { - LOG_E(PHY,"Frame %d, subframe %d: TX1 thread busy, dropping\n",L1_proc_tx->frame_rx,L1_proc_tx->subframe_rx); + if (pthread_mutex_timedlock(&L1_proc_tx->mutex,&wait) != 0) { + LOG_E(PHY, "[SCHED][eNB] ERROR locking mutex for eNB L1_thread_tx\n"); + exit_fun("ERROR pthread_lock"); return(-1); } - - if (pthread_mutex_timedlock(&L1_proc_tx->mutex,&wait) != 0) { - LOG_E( PHY, "[eNB] ERROR pthread_mutex_lock for eNB TX1 thread %d (IC %d)\n", L1_proc_tx->subframe_rx&1,L1_proc_tx->instance_cnt ); - exit_fun( "error locking mutex_tx" ); - return(-1); + while(L1_proc_tx->instance_cnt == 0){ + pthread_cond_wait(&L1_proc_tx->cond,&L1_proc_tx->mutex); } - ++L1_proc_tx->instance_cnt; + L1_proc_tx->instance_cnt = 0; L1_proc_tx->subframe_rx = L1_proc->subframe_rx; @@ -899,6 +904,8 @@ void init_eNB_proc(int inst) { L1_proc_tx = &proc->L1_proc_tx; L1_proc->instance_cnt = -1; L1_proc_tx->instance_cnt = -1; + L1_proc->instance_cnt_RUs = 0; + L1_proc_tx->instance_cnt_RUs = 0; proc->instance_cnt_prach = -1; proc->instance_cnt_asynch_rxtx = -1; proc->instance_cnt_synch = -1; @@ -914,6 +921,10 @@ void init_eNB_proc(int inst) { pthread_mutex_init( &L1_proc_tx->mutex, NULL); pthread_cond_init( &L1_proc->cond, NULL); pthread_cond_init( &L1_proc_tx->cond, NULL); + pthread_mutex_init( &L1_proc->mutex_RUs, NULL); + pthread_mutex_init( &L1_proc_tx->mutex_RUs, NULL); + pthread_cond_init( &L1_proc->cond_RUs, NULL); + pthread_cond_init( &L1_proc_tx->cond_RUs, NULL); pthread_mutex_init( &proc->mutex_prach, NULL); pthread_mutex_init( &proc->mutex_asynch_rxtx, NULL); @@ -1009,7 +1020,7 @@ void kill_eNB_proc(int inst) { PHY_VARS_eNB *eNB; eNB_proc_t *proc; eNB_rxtx_proc_t *L1_proc, *L1_proc_tx; - int i; + for (int CC_id=0; CC_ideNB_list; - LOG_D(PHY,"wakeup_eNBs (num %d) for RU %d ru->eNB_top:%p\n",ru->num_eNB,ru->idx, ru->eNB_top); + LOG_D(PHY,"wakeup_L1s (num %d) for RU %d ru->eNB_top:%p\n",ru->num_eNB,ru->idx, ru->eNB_top); if (ru->num_eNB==1 && ru->eNB_top!=0 && get_thread_parallel_conf() == PARALLEL_SINGLE_THREAD) { @@ -1529,8 +1529,12 @@ volatile int16_t phy_tx_end; #endif static void* ru_thread_tx( void* param ) { - RU_t *ru = (RU_t*)param; - RU_proc_t *proc = &ru->proc; + RU_t *ru = (RU_t*)param; + RU_proc_t *proc = &ru->proc; + PHY_VARS_eNB *eNB; + eNB_proc_t *eNB_proc; + eNB_rxtx_proc_t *L1_proc; + cpu_set_t cpuset; CPU_ZERO(&cpuset); @@ -1555,6 +1559,7 @@ static void* ru_thread_tx( void* param ) { // wait until eNBs are finished subframe RX n and TX n+4 wait_on_condition(&proc->mutex_eNBs,&proc->cond_eNBs,&proc->instance_cnt_eNBs,"ru_thread_tx"); if (oai_exit) break; +printf("~~~~~~~~~~~~~~~~~~~~~~~~~~~~ru_thread_tx is waken up %d.%d having L1 %d\n", proc->frame_tx, proc->subframe_tx, ru->num_eNB); // do TX front-end processing if needed (precoding and/or IDFTs) if (ru->feptx_prec) ru->feptx_prec(ru); @@ -1568,15 +1573,22 @@ static void* ru_thread_tx( void* param ) { if (ru->fh_north_out) ru->fh_north_out(ru); } release_thread(&proc->mutex_eNBs,&proc->instance_cnt_eNBs,"ru_thread_tx"); - - pthread_mutex_lock( &proc->mutex_eNBs ); - proc->ru_tx_ready++; - // the thread can now be woken up - if (pthread_cond_signal(&proc->cond_eNBs) != 0) { - LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread\n"); - exit_fun( "ERROR pthread_cond_signal" ); + for(int i = 0; inum_eNB; i++) + { + eNB = ru->eNB_list[i]; + eNB_proc = &eNB->proc; + L1_proc = (get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT)? &eNB_proc->L1_proc_tx : &eNB_proc->L1_proc; +char *L1_proc_name = (get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT)? "L1_proc_tx" : "L1_proc"; +printf("~~~~~~~~~~~~~~~~~~~~~~~~~~~~ru_thread_tx signaling to eNB_list[%d] with %s IC_RU %d\n", i, L1_proc_name, L1_proc->instance_cnt_RUs); + pthread_mutex_lock( &L1_proc->mutex_RUs ); + L1_proc->instance_cnt_RUs = 0; + // the thread can now be woken up + if (pthread_cond_signal(&L1_proc->cond_RUs) != 0) { + LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread\n"); + exit_fun( "ERROR pthread_cond_signal" ); + } + pthread_mutex_unlock( &L1_proc->mutex_RUs ); } - pthread_mutex_unlock( &proc->mutex_eNBs ); } release_thread(&proc->mutex_FH1,&proc->instance_cnt_FH1,"ru_thread_tx"); return 0; @@ -1785,7 +1797,7 @@ static void* ru_thread( void* param ) { #endif // wakeup all eNB processes waiting for this RU - if (ru->num_eNB>0) wakeup_eNBs(ru); + if (ru->num_eNB>0) wakeup_L1s(ru); #ifndef PHY_TX_THREAD if(get_thread_parallel_conf() == PARALLEL_SINGLE_THREAD || ru->num_eNB==0){ From 265f11069165ec8eab01013729839e302387e3cb Mon Sep 17 00:00:00 2001 From: Wang Tsu-Han Date: Fri, 26 Oct 2018 16:49:50 +0200 Subject: [PATCH 03/31] using mask for ru_thread_tx --- openair1/PHY/defs_eNB.h | 6 +- .../CONF/enb.band7.tm1.100PRB.usrpx310.conf | 6 +- targets/RT/USER/lte-enb.c | 70 +++++++++++-------- targets/RT/USER/lte-ru.c | 38 +++++++--- 4 files changed, 75 insertions(+), 45 deletions(-) diff --git a/openair1/PHY/defs_eNB.h b/openair1/PHY/defs_eNB.h index d9b8f9b319..a8c0ab8506 100644 --- a/openair1/PHY/defs_eNB.h +++ b/openair1/PHY/defs_eNB.h @@ -809,12 +809,16 @@ typedef struct eNB_proc_t_s { pthread_mutex_t mutex_asynch_rxtx; /// mutex for RU access to eNB processing (PDSCH/PUSCH) pthread_mutex_t mutex_RU; + /// mutex for eNB processing to access RU TX (PDSCH/PUSCH) + pthread_mutex_t mutex_RU_tx; /// mutex for RU access to eNB processing (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) int RU_mask; + /// mask for RUs serving eNB (PDSCH/PUSCH) + int RU_mask_tx; /// mask for RUs serving eNB (PRACH) int RU_mask_prach; #if (RRC_VERSION >= MAKE_VERSION(14, 0, 0)) @@ -829,8 +833,6 @@ typedef struct eNB_proc_t_s { eNB_rxtx_proc_t L1_proc,L1_proc_tx; /// stats thread pthread descriptor pthread_t process_stats_thread; - /// for waking up tx procedure - RU_proc_t *ru_proc; } eNB_proc_t; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf index 60b47c5c49..728492ee83 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf @@ -15,7 +15,7 @@ eNBs = // Tracking area code, 0x0000 and 0xfffe are reserved values tracking_area_code = 1; - plmn_list = ( { mcc = 208; mnc = 93; mnc_length = 2; } ); + plmn_list = ( { mcc = 208; mnc = 92; mnc_length = 2; } ); tr_s_preference = "local_mac" @@ -138,7 +138,7 @@ eNBs = ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.26"; + mme_ip_address = ( { ipv4 = "192.168.12.148"; ipv6 = "192:168:30::17"; active = "yes"; preference = "ipv4"; @@ -187,7 +187,7 @@ RUs = ( max_pdschReferenceSignalPower = -27; max_rxgain = 116; eNB_instances = [0]; - + sdr_addrs = "type=x300"; } ); diff --git a/targets/RT/USER/lte-enb.c b/targets/RT/USER/lte-enb.c index f8d5a351be..271572060c 100644 --- a/targets/RT/USER/lte-enb.c +++ b/targets/RT/USER/lte-enb.c @@ -143,8 +143,8 @@ extern double cpuf; void init_eNB(int,int); void stop_eNB(int nb_inst); -int wakeup_tx(PHY_VARS_eNB *eNB,RU_proc_t *ru_proc); -int wakeup_txfh(eNB_rxtx_proc_t *proc,RU_proc_t *ru_proc); +int wakeup_tx(PHY_VARS_eNB *eNB); +int wakeup_txfh(eNB_rxtx_proc_t *proc,PHY_VARS_eNB *eNB); void wakeup_prach_eNB(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe); #if (RRC_VERSION >= MAKE_VERSION(14, 0, 0)) void wakeup_prach_eNB_br(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe); @@ -356,7 +356,7 @@ static void* L1_thread_tx(void* param) { exit_fun( "ERROR pthread_cond_signal" ); } pthread_mutex_unlock( &proc->mutex ); - wakeup_txfh(proc,eNB->proc.ru_proc); + wakeup_txfh(proc,eNB); } return 0; @@ -429,11 +429,11 @@ static void* L1_thread( void* param ) { if (release_thread(&proc->mutex,&proc->instance_cnt,thread_name)<0) break; if (nfapi_mode!=2){ - if(get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) wakeup_tx(eNB,eNB->proc.ru_proc); + if(get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) wakeup_tx(eNB); else if(get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT) { phy_procedures_eNB_TX(eNB, proc, 1); - wakeup_txfh(proc,eNB->proc.ru_proc); + wakeup_txfh(proc,eNB); } } @@ -473,51 +473,61 @@ void eNB_top(PHY_VARS_eNB *eNB, int frame_rx, int subframe_rx, char *string,RU_t } } -int wakeup_txfh(eNB_rxtx_proc_t *proc,RU_proc_t *ru_proc) { - - if(ru_proc == NULL) - return(0); +int wakeup_txfh(eNB_rxtx_proc_t *proc,PHY_VARS_eNB *eNB) { + + RU_t *ru; + RU_proc_t *ru_proc; + int i; + + struct timespec wait; wait.tv_sec=0; wait.tv_nsec=5000000L; -printf("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~inside wakeup_txfh %d.%d IC_RU = %d\n", proc->frame_tx, proc->subframe_tx, proc->instance_cnt_RUs); +//printf("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~inside wakeup_txfh %d.%d IC_RU = %d\n", proc->frame_tx, proc->subframe_tx, proc->instance_cnt_RUs); if(wait_on_condition(&proc->mutex_RUs,&proc->cond_RUs,&proc->instance_cnt_RUs,"wakeup_txfh")<0) { LOG_E(PHY,"Frame %d, subframe %d: TX FH not ready\n", ru_proc->frame_tx, ru_proc->subframe_tx); return(-1); } + pthread_mutex_lock(&eNB->proc.mutex_RU_tx); + eNB->proc.RU_mask_tx = 0; + pthread_mutex_unlock(&eNB->proc.mutex_RU_tx); if (release_thread(&proc->mutex_RUs,&proc->instance_cnt_RUs,"wakeup_txfh")<0) return(-1); - - if (ru_proc->instance_cnt_eNBs == 0) { - LOG_E(PHY,"Frame %d, subframe %d: TX FH thread busy, dropping Frame %d, subframe %d\n", ru_proc->frame_tx, ru_proc->subframe_tx, proc->frame_rx, proc->subframe_rx); - return(-1); - } - if (pthread_mutex_timedlock(&ru_proc->mutex_eNBs,&wait) != 0) { - LOG_E( PHY, "[eNB] ERROR pthread_mutex_lock for eNB TX1 thread %d (IC %d)\n", ru_proc->subframe_rx&1,ru_proc->instance_cnt_eNBs ); - exit_fun( "error locking mutex_eNB" ); - return(-1); - } - //for(num_RUs) + for(int i=0; inum_RU; i++) + { + ru = eNB->RU_list[i]; + ru_proc = &ru->proc; + if (ru_proc->instance_cnt_eNBs == 0) { + LOG_E(PHY,"Frame %d, subframe %d: TX FH thread busy, dropping Frame %d, subframe %d\n", ru_proc->frame_tx, ru_proc->subframe_tx, proc->frame_rx, proc->subframe_rx); + return(-1); + } + if (pthread_mutex_timedlock(&ru_proc->mutex_eNBs,&wait) != 0) { + LOG_E( PHY, "[eNB] ERROR pthread_mutex_lock for eNB TX1 thread %d (IC %d)\n", ru_proc->subframe_rx&1,ru_proc->instance_cnt_eNBs ); + exit_fun( "error locking mutex_eNB" ); + return(-1); + } + ru_proc->instance_cnt_eNBs = 0; ru_proc->timestamp_tx = proc->timestamp_tx; ru_proc->subframe_tx = proc->subframe_tx; ru_proc->frame_tx = proc->frame_tx; - // the thread can now be woken up - if (pthread_cond_signal(&ru_proc->cond_eNBs) != 0) { - LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread\n"); - exit_fun( "ERROR pthread_cond_signal" ); - return(-1); - } + // the thread can now be woken up + if (pthread_cond_signal(&ru_proc->cond_eNBs) != 0) { + LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread\n"); + exit_fun( "ERROR pthread_cond_signal" ); + return(-1); + } - pthread_mutex_unlock( &ru_proc->mutex_eNBs ); + pthread_mutex_unlock( &ru_proc->mutex_eNBs ); + } return(0); } -int wakeup_tx(PHY_VARS_eNB *eNB,RU_proc_t *ru_proc) { +int wakeup_tx(PHY_VARS_eNB *eNB) { eNB_proc_t *proc=&eNB->proc; @@ -913,6 +923,7 @@ void init_eNB_proc(int inst) { proc->first_rx =1; proc->first_tx =1; + proc->RU_mask_tx = (1<num_RU)-1; proc->RU_mask =0; proc->RU_mask_prach =0; @@ -929,6 +940,7 @@ void init_eNB_proc(int inst) { pthread_mutex_init( &proc->mutex_prach, NULL); pthread_mutex_init( &proc->mutex_asynch_rxtx, NULL); pthread_mutex_init( &proc->mutex_RU,NULL); + pthread_mutex_init( &proc->mutex_RU_tx,NULL); pthread_mutex_init( &proc->mutex_RU_PRACH,NULL); pthread_cond_init( &proc->cond_prach, NULL); diff --git a/targets/RT/USER/lte-ru.c b/targets/RT/USER/lte-ru.c index 4bf6fd6cd4..42d71cfbf4 100644 --- a/targets/RT/USER/lte-ru.c +++ b/targets/RT/USER/lte-ru.c @@ -1273,7 +1273,6 @@ void wakeup_L1s(RU_t *ru) { for (i=0;inum_eNB;i++) { LOG_D(PHY,"ru->wakeup_rxtx:%p\n", ru->wakeup_rxtx); - eNB_list[i]->proc.ru_proc = &ru->proc; if (ru->wakeup_rxtx!=0 && ru->wakeup_rxtx(eNB_list[i],ru) < 0) { LOG_E(PHY,"could not wakeup eNB rxtx process for subframe %d\n", ru->proc.subframe_rx); @@ -1559,7 +1558,7 @@ static void* ru_thread_tx( void* param ) { // wait until eNBs are finished subframe RX n and TX n+4 wait_on_condition(&proc->mutex_eNBs,&proc->cond_eNBs,&proc->instance_cnt_eNBs,"ru_thread_tx"); if (oai_exit) break; -printf("~~~~~~~~~~~~~~~~~~~~~~~~~~~~ru_thread_tx is waken up %d.%d having L1 %d\n", proc->frame_tx, proc->subframe_tx, ru->num_eNB); +//printf("~~~~~~~~~~~~~~~~~~~~~~~~~~~~ru_thread_tx is waken up %d.%d having L1 %d\n", proc->frame_tx, proc->subframe_tx, ru->num_eNB); // do TX front-end processing if needed (precoding and/or IDFTs) if (ru->feptx_prec) ru->feptx_prec(ru); @@ -1578,16 +1577,33 @@ printf("~~~~~~~~~~~~~~~~~~~~~~~~~~~~ru_thread_tx is waken up %d.%d having L1 %d\ eNB = ru->eNB_list[i]; eNB_proc = &eNB->proc; L1_proc = (get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT)? &eNB_proc->L1_proc_tx : &eNB_proc->L1_proc; -char *L1_proc_name = (get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT)? "L1_proc_tx" : "L1_proc"; -printf("~~~~~~~~~~~~~~~~~~~~~~~~~~~~ru_thread_tx signaling to eNB_list[%d] with %s IC_RU %d\n", i, L1_proc_name, L1_proc->instance_cnt_RUs); - pthread_mutex_lock( &L1_proc->mutex_RUs ); - L1_proc->instance_cnt_RUs = 0; - // the thread can now be woken up - if (pthread_cond_signal(&L1_proc->cond_RUs) != 0) { - LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread\n"); - exit_fun( "ERROR pthread_cond_signal" ); + pthread_mutex_lock(&eNB_proc->mutex_RU_tx); + for (int j=0;jnum_RU;j++) { + if (ru == eNB->RU_list[j]) { + if ((eNB_proc->RU_mask_tx&(1< 0) + LOG_E(PHY,"eNB %d frame %d, subframe %d : previous information from RU tx %d (num_RU %d,mask %x) has not been served yet!\n", + eNB->Mod_id,eNB_proc->frame_rx,eNB_proc->subframe_rx,ru->idx,eNB->num_RU,eNB_proc->RU_mask_tx); + eNB_proc->RU_mask_tx |= (1<RU_mask_tx != (1<num_RU)-1) { // not all RUs have provided their information so return + LOG_E(PHY,"Not all RUs TX are finished\n"); + pthread_mutex_unlock(&eNB_proc->mutex_RU_tx); + continue; + } + else { // all RUs TX are finished so send the ready signal to eNB processing + eNB_proc->RU_mask_tx = 0; + pthread_mutex_unlock(&eNB_proc->mutex_RU_tx); + + pthread_mutex_lock( &L1_proc->mutex_RUs); + L1_proc->instance_cnt_RUs = 0; + // the thread can now be woken up + if (pthread_cond_signal(&L1_proc->cond_RUs) != 0) { + LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread\n"); + exit_fun( "ERROR pthread_cond_signal" ); + } + pthread_mutex_unlock( &L1_proc->mutex_RUs ); } - pthread_mutex_unlock( &L1_proc->mutex_RUs ); } } release_thread(&proc->mutex_FH1,&proc->instance_cnt_FH1,"ru_thread_tx"); From 1d24208370e86894f1a3d99f625b3712f74a13d8 Mon Sep 17 00:00:00 2001 From: Wang Tsu-Han Date: Fri, 26 Oct 2018 17:33:46 +0200 Subject: [PATCH 04/31] bug fix for RU_mask_tx --- .../CONF/enb.band7.tm1.100PRB.usrpx310.conf | 12 ++++++++++++ targets/RT/USER/lte-enb.c | 5 ++--- targets/RT/USER/lte-ru.c | 11 ++++++----- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf index 728492ee83..f48357c13c 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf @@ -188,6 +188,18 @@ RUs = ( max_rxgain = 116; eNB_instances = [0]; sdr_addrs = "type=x300"; + }, + { + local_rf = "yes" + nb_tx = 1 + nb_rx = 1 + att_tx = 0 + att_rx = 0; + bands = [7]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 116; + eNB_instances = [0]; + sdr_addrs = "type=x300"; } ); diff --git a/targets/RT/USER/lte-enb.c b/targets/RT/USER/lte-enb.c index 271572060c..70317983f6 100644 --- a/targets/RT/USER/lte-enb.c +++ b/targets/RT/USER/lte-enb.c @@ -385,7 +385,6 @@ static void* L1_thread( void* param ) { PHY_VARS_eNB *eNB = RC.eNB[0][proc->CC_id]; - //RU_proc_t *ru_proc = NULL; char thread_name[100]; @@ -477,7 +476,6 @@ int wakeup_txfh(eNB_rxtx_proc_t *proc,PHY_VARS_eNB *eNB) { RU_t *ru; RU_proc_t *ru_proc; - int i; struct timespec wait; @@ -486,7 +484,7 @@ int wakeup_txfh(eNB_rxtx_proc_t *proc,PHY_VARS_eNB *eNB) { //printf("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~inside wakeup_txfh %d.%d IC_RU = %d\n", proc->frame_tx, proc->subframe_tx, proc->instance_cnt_RUs); if(wait_on_condition(&proc->mutex_RUs,&proc->cond_RUs,&proc->instance_cnt_RUs,"wakeup_txfh")<0) { - LOG_E(PHY,"Frame %d, subframe %d: TX FH not ready\n", ru_proc->frame_tx, ru_proc->subframe_tx); + LOG_E(PHY,"Frame %d, subframe %d: TX FH not ready\n", proc->frame_tx, proc->subframe_tx); return(-1); } pthread_mutex_lock(&eNB->proc.mutex_RU_tx); @@ -924,6 +922,7 @@ void init_eNB_proc(int inst) { proc->first_rx =1; proc->first_tx =1; proc->RU_mask_tx = (1<num_RU)-1; +printf("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~proc->RU_mask_tx = %d\n", proc->RU_mask_tx); proc->RU_mask =0; proc->RU_mask_prach =0; diff --git a/targets/RT/USER/lte-ru.c b/targets/RT/USER/lte-ru.c index 42d71cfbf4..fdd364d574 100644 --- a/targets/RT/USER/lte-ru.c +++ b/targets/RT/USER/lte-ru.c @@ -1554,7 +1554,7 @@ static void* ru_thread_tx( void* param ) { if (oai_exit) break; - LOG_D(PHY,"ru_thread_tx: Waiting for TX processing\n"); + LOG_I(PHY,"ru_thread_tx: Waiting for TX processing\n"); // wait until eNBs are finished subframe RX n and TX n+4 wait_on_condition(&proc->mutex_eNBs,&proc->cond_eNBs,&proc->instance_cnt_eNBs,"ru_thread_tx"); if (oai_exit) break; @@ -1580,23 +1580,24 @@ static void* ru_thread_tx( void* param ) { pthread_mutex_lock(&eNB_proc->mutex_RU_tx); for (int j=0;jnum_RU;j++) { if (ru == eNB->RU_list[j]) { - if ((eNB_proc->RU_mask_tx&(1< 0) + if ((eNB_proc->RU_mask_tx&(1< 0) LOG_E(PHY,"eNB %d frame %d, subframe %d : previous information from RU tx %d (num_RU %d,mask %x) has not been served yet!\n", eNB->Mod_id,eNB_proc->frame_rx,eNB_proc->subframe_rx,ru->idx,eNB->num_RU,eNB_proc->RU_mask_tx); - eNB_proc->RU_mask_tx |= (1<RU_mask_tx |= (1<RU_mask_tx != (1<num_RU)-1) { // not all RUs have provided their information so return - LOG_E(PHY,"Not all RUs TX are finished\n"); +printf("~~~~~~~~~~~~~~~~~~~~~~(mask = %d)\n", eNB_proc->RU_mask_tx); pthread_mutex_unlock(&eNB_proc->mutex_RU_tx); - continue; } else { // all RUs TX are finished so send the ready signal to eNB processing +printf("~~~~~~~~~~~~~~~~~~~~~~ready to send wakeup signal\n"); eNB_proc->RU_mask_tx = 0; pthread_mutex_unlock(&eNB_proc->mutex_RU_tx); pthread_mutex_lock( &L1_proc->mutex_RUs); L1_proc->instance_cnt_RUs = 0; +printf("~~~~~~~~~~~~~~~~~~~~~~ru_thread_tx send signal to L1_thread_tx with (mask = %d)\n", eNB_proc->RU_mask_tx); // the thread can now be woken up if (pthread_cond_signal(&L1_proc->cond_RUs) != 0) { LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread\n"); From 29c5908731c93b1da106ba526d1b4d0745c44fbb Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Sun, 28 Oct 2018 19:24:19 +0100 Subject: [PATCH 05/31] fixed dlsim/ulsim for L1-renaming --- openair1/SIMULATION/LTE_PHY/dlsim.c | 2 +- openair1/SIMULATION/LTE_PHY/ulsim.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openair1/SIMULATION/LTE_PHY/dlsim.c b/openair1/SIMULATION/LTE_PHY/dlsim.c index 3583c0f25e..3cb6223278 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim.c @@ -1443,7 +1443,7 @@ int main(int argc, char **argv) eNB->UE_stats[1].DL_pmi_single = 0; } - eNB_rxtx_proc_t *proc_eNB = &eNB->proc.proc_rxtx[0];//UE->current_thread_id[subframe]]; + eNB_rxtx_proc_t *proc_eNB = &eNB->proc.L1_proc; if (input_fd==NULL) { diff --git a/openair1/SIMULATION/LTE_PHY/ulsim.c b/openair1/SIMULATION/LTE_PHY/ulsim.c index 8c09da1daf..7c956a833a 100644 --- a/openair1/SIMULATION/LTE_PHY/ulsim.c +++ b/openair1/SIMULATION/LTE_PHY/ulsim.c @@ -922,7 +922,7 @@ int main(int argc, char **argv) { UE->frame_parms.pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH = 0; eNB->frame_parms.pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH = 0; UE->mac_enabled=0; - eNB_rxtx_proc_t *proc_rxtx = &eNB->proc.proc_rxtx[subframe&1]; + eNB_rxtx_proc_t *proc_rxtx = &eNB->proc.L1_proc; UE_rxtx_proc_t *proc_rxtx_ue = &UE->proc.proc_rxtx[subframe&1]; proc_rxtx->frame_rx=1; proc_rxtx->subframe_rx=subframe; From c8e686396f7cd53c42925a91ba134b7759420210 Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Sun, 28 Oct 2018 19:33:51 +0100 Subject: [PATCH 06/31] renaming of eNB_proc_t -> L1_proc_t --- openair1/PHY/LTE_TRANSPORT/dlsch_coding.c | 2 +- openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c | 4 ++-- openair1/PHY/defs_eNB.h | 6 +++--- openair1/SCHED/phy_procedures_lte_eNb.c | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c b/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c index 30c106b16b..6ca2fdc429 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c @@ -393,7 +393,7 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB, //start_meas(&eNB->dlsch_turbo_encoding_preperation_stats); LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms; - eNB_proc_t *proc = &eNB->proc; + L1_proc_t *proc = &eNB->proc; unsigned int G; unsigned int crc=1; diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c index 046e456916..cf3f412fda 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c @@ -382,7 +382,7 @@ int ulsch_decoding_data_2thread0(td_params* tdp) { extern int oai_exit; void *td_thread(void *param) { PHY_VARS_eNB *eNB = ((td_params*)param)->eNB; - eNB_proc_t *proc = &eNB->proc; + L1_proc_t *proc = &eNB->proc; cpu_set_t cpuset; CPU_ZERO(&cpuset); @@ -412,7 +412,7 @@ void *td_thread(void *param) { int ulsch_decoding_data_2thread(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag) { - eNB_proc_t *proc = &eNB->proc; + L1_proc_t *proc = &eNB->proc; unsigned int r,r_offset=0,Kr,Kr_bytes; uint8_t crc_type; int offset = 0; diff --git a/openair1/PHY/defs_eNB.h b/openair1/PHY/defs_eNB.h index a8c0ab8506..39f61c7fcf 100644 --- a/openair1/PHY/defs_eNB.h +++ b/openair1/PHY/defs_eNB.h @@ -698,7 +698,7 @@ typedef struct { } te_params; /// Context data structure for eNB subframe processing -typedef struct eNB_proc_t_s { +typedef struct L1_proc_t_s { /// Component Carrier index uint8_t CC_id; /// thread index @@ -833,7 +833,7 @@ typedef struct eNB_proc_t_s { eNB_rxtx_proc_t L1_proc,L1_proc_tx; /// stats thread pthread descriptor pthread_t process_stats_thread; -} eNB_proc_t; +} L1_proc_t; @@ -901,7 +901,7 @@ typedef struct PHY_VARS_eNB_s { module_id_t Mod_id; uint8_t CC_id; uint8_t configured; - eNB_proc_t proc; + L1_proc_t proc; int single_thread_flag; int abstraction_flag; int num_RU; diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 276006ec3b..d0ec95f80c 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -1468,7 +1468,7 @@ extern void *td_thread(void*); void init_td_thread(PHY_VARS_eNB *eNB) { - eNB_proc_t *proc = &eNB->proc; + L1_proc_t *proc = &eNB->proc; proc->tdp.eNB = eNB; proc->instance_cnt_td = -1; @@ -1482,7 +1482,7 @@ void init_td_thread(PHY_VARS_eNB *eNB) { } void kill_td_thread(PHY_VARS_eNB *eNB) { - eNB_proc_t *proc = &eNB->proc; + L1_proc_t *proc = &eNB->proc; proc->instance_cnt_td = 0; pthread_cond_signal(&proc->cond_td); @@ -1495,7 +1495,7 @@ extern void *te_thread(void*); void init_te_thread(PHY_VARS_eNB *eNB) { - eNB_proc_t *proc = &eNB->proc; + L1_proc_t *proc = &eNB->proc; for(int i=0; i<3 ;i++){ proc->tep[i].eNB = eNB; @@ -1511,7 +1511,7 @@ void init_te_thread(PHY_VARS_eNB *eNB) { } void kill_te_thread(PHY_VARS_eNB *eNB) { - eNB_proc_t *proc = &eNB->proc; + L1_proc_t *proc = &eNB->proc; for(int i=0; i<3 ;i++){ proc->tep[i].instance_cnt_te = 0; From 49d6f3333525db19675c45b6ffe0bdb71988626f Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Sun, 28 Oct 2018 20:19:39 +0100 Subject: [PATCH 07/31] renaming eNB_rxtx_proc_t -> L1_rxtx_proc_t --- openair1/PHY/LTE_ESTIMATION/lte_estimation.h | 2 +- .../LTE_ESTIMATION/lte_ul_channel_estimation.c | 2 +- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 8 ++++---- openair1/PHY/LTE_TRANSPORT/phich.c | 2 +- openair1/PHY/LTE_TRANSPORT/pilots_mbsfn.c | 2 +- openair1/PHY/LTE_TRANSPORT/pmch.c | 2 +- openair1/PHY/LTE_TRANSPORT/transport_proto.h | 18 +++++++++--------- openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c | 2 +- .../PHY/LTE_TRANSPORT/ulsch_demodulation.c | 4 ++-- openair1/PHY/defs_eNB.h | 4 ++-- openair1/SCHED/fapi_l1.c | 16 ++++++++-------- openair1/SCHED/fapi_l1.h | 12 ++++++------ openair1/SCHED/phy_procedures_lte_eNb.c | 14 +++++++------- openair1/SCHED/sched_common.h | 6 +++--- openair1/SCHED/sched_eNB.h | 10 +++++----- openair1/SIMULATION/LTE_PHY/dlsim.c | 2 +- 16 files changed, 53 insertions(+), 53 deletions(-) diff --git a/openair1/PHY/LTE_ESTIMATION/lte_estimation.h b/openair1/PHY/LTE_ESTIMATION/lte_estimation.h index 4512fc0d9b..9cdc2f4bf7 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_estimation.h +++ b/openair1/PHY/LTE_ESTIMATION/lte_estimation.h @@ -203,7 +203,7 @@ void phy_adjust_gain (PHY_VARS_UE *phy_vars_ue, unsigned char eNB_id); int lte_ul_channel_estimation(PHY_VARS_eNB *phy_vars_eNB, - eNB_rxtx_proc_t *proc, + L1_rxtx_proc_t *proc, module_id_t UE_id, uint8_t l, uint8_t Ns); diff --git a/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c b/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c index a8d73cfdea..206ba8b15f 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c @@ -35,7 +35,7 @@ static int16_t ru_90c[2*128] = {32767, 0,32766, -402,32758, -804,32746, -1206,32 #define SCALE 0x3FFF int32_t lte_ul_channel_estimation(PHY_VARS_eNB *eNB, - eNB_rxtx_proc_t *proc, + L1_rxtx_proc_t *proc, module_id_t UE_id, unsigned char l, unsigned char Ns) { diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index c33d9efe63..f003b7f36a 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -90,7 +90,7 @@ int16_t find_ulsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type) -void fill_pdcch_order(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc,nfapi_dl_config_dci_dl_pdu *pdu) +void fill_pdcch_order(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc,nfapi_dl_config_dci_dl_pdu *pdu) { LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms; uint8_t *dci_pdu = &dci_alloc->dci_pdu[0]; @@ -224,7 +224,7 @@ void fill_pdcch_order(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_a proc->frame_tx, proc->subframe_tx, rel8->rnti); } -void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc,nfapi_dl_config_dci_dl_pdu *pdu) +void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc,nfapi_dl_config_dci_dl_pdu *pdu) { LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms; uint8_t *dci_pdu = &dci_alloc->dci_pdu[0]; @@ -1497,7 +1497,7 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t } -void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,mDCI_ALLOC_t *dci_alloc,nfapi_dl_config_mpdcch_pdu *pdu) { +void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc,mDCI_ALLOC_t *dci_alloc,nfapi_dl_config_mpdcch_pdu *pdu) { LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms; @@ -1770,7 +1770,7 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,mDCI_ALLOC_t *d } -void fill_dci0(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t *proc, +void fill_dci0(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_proc_t *proc, DCI_ALLOC_t *dci_alloc,nfapi_hi_dci0_dci_pdu *pdu) { LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms; diff --git a/openair1/PHY/LTE_TRANSPORT/phich.c b/openair1/PHY/LTE_TRANSPORT/phich.c index cc466ce3e2..dd82699fe9 100644 --- a/openair1/PHY/LTE_TRANSPORT/phich.c +++ b/openair1/PHY/LTE_TRANSPORT/phich.c @@ -705,7 +705,7 @@ void generate_phich(LTE_DL_FRAME_PARMS *frame_parms, void generate_phich_top(PHY_VARS_eNB *eNB, - eNB_rxtx_proc_t *proc, + L1_rxtx_proc_t *proc, int16_t amp) { diff --git a/openair1/PHY/LTE_TRANSPORT/pilots_mbsfn.c b/openair1/PHY/LTE_TRANSPORT/pilots_mbsfn.c index fddc29b524..475102b57c 100644 --- a/openair1/PHY/LTE_TRANSPORT/pilots_mbsfn.c +++ b/openair1/PHY/LTE_TRANSPORT/pilots_mbsfn.c @@ -34,7 +34,7 @@ #include "PHY/LTE_REFSIG/lte_refsig.h" int generate_mbsfn_pilot(PHY_VARS_eNB *eNB, - eNB_rxtx_proc_t *proc, + L1_rxtx_proc_t *proc, int32_t **txdataF, int16_t amp) diff --git a/openair1/PHY/LTE_TRANSPORT/pmch.c b/openair1/PHY/LTE_TRANSPORT/pmch.c index 23bc07f174..6fab3dc59b 100644 --- a/openair1/PHY/LTE_TRANSPORT/pmch.c +++ b/openair1/PHY/LTE_TRANSPORT/pmch.c @@ -83,7 +83,7 @@ void fill_eNB_dlsch_MCH(PHY_VARS_eNB *eNB,int mcs,int ndi,int rvidx) } -void generate_mch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,uint8_t *a) +void generate_mch(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc,uint8_t *a) { int G; diff --git a/openair1/PHY/LTE_TRANSPORT/transport_proto.h b/openair1/PHY/LTE_TRANSPORT/transport_proto.h index 37ac335d02..c51ce5e1d0 100644 --- a/openair1/PHY/LTE_TRANSPORT/transport_proto.h +++ b/openair1/PHY/LTE_TRANSPORT/transport_proto.h @@ -273,7 +273,7 @@ int mch_modulation(int32_t **txdataF, @param abstraction_flag */ -void generate_mch(PHY_VARS_eNB *phy_vars_eNB,eNB_rxtx_proc_t *proc,uint8_t *a); +void generate_mch(PHY_VARS_eNB *phy_vars_eNB,L1_rxtx_proc_t *proc,uint8_t *a); /** \brief This function generates the frequency-domain pilots (cell-specific downlink reference signals) @param phy_vars_eNB Pointer to eNB variables @@ -317,7 +317,7 @@ int32_t generate_pilots_slot(PHY_VARS_eNB *phy_vars_eNB, int first_pilot_only); int32_t generate_mbsfn_pilot(PHY_VARS_eNB *phy_vars_eNB, - eNB_rxtx_proc_t *proc, + L1_rxtx_proc_t *proc, int32_t **txdataF, int16_t amp); @@ -410,13 +410,13 @@ void ulsch_extract_rbs_single(int32_t **rxdataF, void fill_dci_and_dlsch(PHY_VARS_eNB *eNB, int frame, int subframe, - eNB_rxtx_proc_t *proc, + L1_rxtx_proc_t *proc, DCI_ALLOC_t *dci_alloc, nfapi_dl_config_dci_dl_pdu *pdu); -void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,mDCI_ALLOC_t *dci_alloc,nfapi_dl_config_mpdcch_pdu *pdu); +void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc,mDCI_ALLOC_t *dci_alloc,nfapi_dl_config_mpdcch_pdu *pdu); -void fill_dci0(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc, +void fill_dci0(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc, nfapi_hi_dci0_dci_pdu *pdu); void fill_ulsch(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame,int subframe); @@ -427,7 +427,7 @@ int generate_eNB_ulsch_params_from_rar(PHY_VARS_eNB *eNB, unsigned char subframe); int generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB *PHY_vars_eNB, - eNB_rxtx_proc_t *proc, + L1_rxtx_proc_t *proc, void *dci_pdu, rnti_t rnti, DCI_format_t dci_format, @@ -466,7 +466,7 @@ void init_transport_channels(uint8_t); void rx_ulsch(PHY_VARS_eNB *eNB, - eNB_rxtx_proc_t *proc, + L1_rxtx_proc_t *proc, uint8_t UE_id); @@ -487,7 +487,7 @@ int ulsch_decoding_data_all(PHY_VARS_eNB *eNB, @returns 0 on success */ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, - eNB_rxtx_proc_t *proc, + L1_rxtx_proc_t *proc, uint8_t UE_id, uint8_t control_only_flag, uint8_t Nbundled, @@ -520,7 +520,7 @@ int ulsch_decoding_data(PHY_VARS_eNB *eNB, int llr8_flag); void generate_phich_top(PHY_VARS_eNB *phy_vars_eNB, - eNB_rxtx_proc_t *proc, + L1_rxtx_proc_t *proc, int16_t amp); diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c index cf3f412fda..3264b76a1a 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c @@ -762,7 +762,7 @@ static inline unsigned int lte_gold_unscram(unsigned int *x1, unsigned int *x2, } -unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, +unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, uint8_t UE_id, uint8_t control_only_flag, uint8_t Nbundled, diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c b/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c index 61076f2aae..f4137697cf 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c @@ -1104,7 +1104,7 @@ void init_ulsch_power_LUT(void) { } void rx_ulsch(PHY_VARS_eNB *eNB, - eNB_rxtx_proc_t *proc, + L1_rxtx_proc_t *proc, uint8_t UE_id) { @@ -1305,7 +1305,7 @@ void rx_ulsch(PHY_VARS_eNB *eNB, } void rx_ulsch_emul(PHY_VARS_eNB *eNB, - eNB_rxtx_proc_t *proc, + L1_rxtx_proc_t *proc, uint8_t UE_index) { LOG_I(PHY,"[PHY] EMUL eNB %d rx_ulsch_emul : subframe %d, UE_index %d\n",eNB->Mod_id,proc->subframe_rx,UE_index); diff --git a/openair1/PHY/defs_eNB.h b/openair1/PHY/defs_eNB.h index 39f61c7fcf..44d8b6ab9b 100644 --- a/openair1/PHY/defs_eNB.h +++ b/openair1/PHY/defs_eNB.h @@ -666,7 +666,7 @@ typedef struct { pthread_cond_t cond_RUs; /// mutex for RXn-TXnp4 processing thread pthread_mutex_t mutex_RUs; -} eNB_rxtx_proc_t; +} L1_rxtx_proc_t; typedef struct { struct PHY_VARS_eNB_s *eNB; @@ -830,7 +830,7 @@ typedef struct L1_proc_t_s { /// parameters for turbo-encoding worker thread te_params tep[3]; /// set of scheduling variables RXn-TXnp4 threads - eNB_rxtx_proc_t L1_proc,L1_proc_tx; + L1_rxtx_proc_t L1_proc,L1_proc_tx; /// stats thread pthread descriptor pthread_t process_stats_thread; } L1_proc_t; diff --git a/openair1/SCHED/fapi_l1.c b/openair1/SCHED/fapi_l1.c index 3aafc0059b..1956446654 100644 --- a/openair1/SCHED/fapi_l1.c +++ b/openair1/SCHED/fapi_l1.c @@ -48,7 +48,7 @@ extern uint8_t nfapi_mode; void handle_nfapi_dci_dl_pdu(PHY_VARS_eNB *eNB, int frame, int subframe, - eNB_rxtx_proc_t *proc, + L1_rxtx_proc_t *proc, nfapi_dl_config_request_pdu_t *dl_config_pdu) { int idx = subframe&1; @@ -66,7 +66,7 @@ void handle_nfapi_dci_dl_pdu(PHY_VARS_eNB *eNB, #if (RRC_VERSION >= MAKE_VERSION(14, 0, 0)) void handle_nfapi_mpdcch_pdu(PHY_VARS_eNB *eNB, - eNB_rxtx_proc_t *proc, + L1_rxtx_proc_t *proc, nfapi_dl_config_request_pdu_t *dl_config_pdu) { int idx = proc->subframe_tx&1; @@ -81,7 +81,7 @@ void handle_nfapi_mpdcch_pdu(PHY_VARS_eNB *eNB, #endif -void handle_nfapi_hi_dci0_dci_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t *proc, +void handle_nfapi_hi_dci0_dci_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_proc_t *proc, nfapi_hi_dci0_request_pdu_t *hi_dci0_config_pdu) { int idx = subframe&1; @@ -93,7 +93,7 @@ void handle_nfapi_hi_dci0_dci_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_r fill_dci0(eNB,frame,subframe,proc,&pdcch_vars->dci_alloc[pdcch_vars->num_dci], &hi_dci0_config_pdu->dci_pdu); } -void handle_nfapi_hi_dci0_hi_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t *proc, +void handle_nfapi_hi_dci0_hi_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_proc_t *proc, nfapi_hi_dci0_request_pdu_t *hi_dci0_config_pdu) { LTE_eNB_PHICH *phich = &eNB->phich_vars[subframe&1]; @@ -112,7 +112,7 @@ void handle_nfapi_hi_dci0_hi_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rx AssertFatal(phich->num_hi<32,"Maximum number of phich reached in subframe\n"); } -void handle_nfapi_bch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, +void handle_nfapi_bch_pdu(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, nfapi_dl_config_request_pdu_t *dl_config_pdu, uint8_t *sdu) { @@ -139,7 +139,7 @@ extern uint32_t localRIV2alloc_LUT100_2[6000]; extern uint32_t localRIV2alloc_LUT100_3[6000]; #endif -void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t *proc, +void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_proc_t *proc, nfapi_dl_config_request_pdu_t *dl_config_pdu, uint8_t codeword_index, uint8_t *sdu) @@ -569,7 +569,7 @@ void handle_srs_pdu(PHY_VARS_eNB *eNB,nfapi_ul_config_request_pdu_t *ul_config_p AssertFatal(imodule_id; uint8_t CC_id = Sched_INFO->CC_id; diff --git a/openair1/SCHED/fapi_l1.h b/openair1/SCHED/fapi_l1.h index efb028f464..3bd469b685 100644 --- a/openair1/SCHED/fapi_l1.h +++ b/openair1/SCHED/fapi_l1.h @@ -43,17 +43,17 @@ void fill_ulsch_cqi_indication(PHY_VARS_eNB *eNB,uint16_t frame,uint8_t subframe void fill_sr_indication(PHY_VARS_eNB *eNB,uint16_t rnti,int frame,int subframe,uint32_t stat); void fill_rx_indication(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe); void fill_crc_indication(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe,uint8_t crc_flag); -void handle_nfapi_dci_dl_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t *proc,nfapi_dl_config_request_pdu_t *dl_config_pdu); -void handle_nfapi_mpdcch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,nfapi_dl_config_request_pdu_t *dl_config_pdu); -void handle_nfapi_hi_dci0_dci_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t *proc, +void handle_nfapi_dci_dl_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_proc_t *proc,nfapi_dl_config_request_pdu_t *dl_config_pdu); +void handle_nfapi_mpdcch_pdu(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc,nfapi_dl_config_request_pdu_t *dl_config_pdu); +void handle_nfapi_hi_dci0_dci_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_proc_t *proc, nfapi_hi_dci0_request_pdu_t *hi_dci0_config_pdu); -void handle_nfapi_hi_dci0_hi_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t *proc, +void handle_nfapi_hi_dci0_hi_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_proc_t *proc, nfapi_hi_dci0_request_pdu_t *hi_dci0_config_pdu); -void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t *proc, +void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_proc_t *proc, nfapi_dl_config_request_pdu_t *dl_config_pdu, uint8_t codeword_index, uint8_t *sdu); -void handle_nfapi_ul_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, +void handle_nfapi_ul_pdu(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, nfapi_ul_config_request_pdu_t *ul_config_pdu, uint16_t frame,uint8_t subframe,uint8_t srs_present); diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index d0ec95f80c..10c11eda63 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -133,7 +133,7 @@ lte_subframe_t get_subframe_direction(uint8_t Mod_id,uint8_t CC_id,uint8_t subfr } -void pmch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) { +void pmch_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc) { #if (RRC_VERSION >= MAKE_VERSION(10, 0, 0)) @@ -312,7 +312,7 @@ void common_signal_procedures (PHY_VARS_eNB *eNB,int frame, int subframe) { void pdsch_procedures(PHY_VARS_eNB *eNB, - eNB_rxtx_proc_t *proc, + L1_rxtx_proc_t *proc, int harq_pid, LTE_eNB_DLSCH_t *dlsch, LTE_eNB_DLSCH_t *dlsch1, @@ -463,7 +463,7 @@ void pdsch_procedures(PHY_VARS_eNB *eNB, void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, - eNB_rxtx_proc_t *proc, + L1_rxtx_proc_t *proc, int do_meas) { int frame=proc->frame_tx; @@ -650,7 +650,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, } -void srs_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) { +void srs_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc) { LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms; const int subframe = proc->subframe_rx; @@ -713,7 +713,7 @@ void fill_sr_indication(PHY_VARS_eNB *eNB,uint16_t rnti,int frame,int subframe,u pthread_mutex_unlock(&eNB->UL_INFO_mutex); } -void uci_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) +void uci_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc) { LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms; uint8_t SR_payload = 0,pucch_b0b1[4][2]= {{0,0},{0,0},{0,0},{0,0}},harq_ack[4]={0,0,0,0}; @@ -1247,7 +1247,7 @@ void uci_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) } } -void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) +void pusch_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc) { uint32_t ret=0,i; uint32_t harq_pid; @@ -2027,7 +2027,7 @@ void fill_crc_indication(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe,uint pthread_mutex_unlock(&eNB->UL_INFO_mutex); } -void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) +void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc) { //RX processing for ue-specific resources (i LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms; diff --git a/openair1/SCHED/sched_common.h b/openair1/SCHED/sched_common.h index e579110a78..5a4a5d5275 100644 --- a/openair1/SCHED/sched_common.h +++ b/openair1/SCHED/sched_common.h @@ -180,7 +180,7 @@ uint8_t is_SR_TXOp(PHY_VARS_UE *phy_vars_ue,UE_rxtx_proc_t *proc,uint8_t eNB_id) @param UE_id ID of UE which may be issuing the SR @returns 1 if TXOp is active. */ -uint8_t is_SR_subframe(PHY_VARS_eNB *phy_vars_eNB,eNB_rxtx_proc_t *proc,uint8_t UE_id); +uint8_t is_SR_subframe(PHY_VARS_eNB *phy_vars_eNB,L1_rxtx_proc_t *proc,uint8_t UE_id); /*! \brief Gives the UL subframe corresponding to a PDDCH order in subframe n @param frame_parms Pointer to DL frame parameters @@ -247,7 +247,7 @@ TDD, this routine computes the procedure described in Section 10.1 of 36.213 (th @param n1_pucch3 Pointer to n1_pucch3 */ void get_n1_pucch_eNB(PHY_VARS_eNB *phy_vars_eNB, - eNB_rxtx_proc_t *proc, + L1_rxtx_proc_t *proc, uint8_t UE_id, int16_t *n1_pucch0, int16_t *n1_pucch1, @@ -266,7 +266,7 @@ void get_n1_pucch_eNB(PHY_VARS_eNB *phy_vars_eNB, */ void process_HARQ_feedback(uint8_t UE_id, PHY_VARS_eNB *phy_vars_eNB, - eNB_rxtx_proc_t *proc, + L1_rxtx_proc_t *proc, uint8_t pusch_flag, uint8_t *pucch_payload, uint8_t pucch_sel, diff --git a/openair1/SCHED/sched_eNB.h b/openair1/SCHED/sched_eNB.h index cf6c5815f2..e54e4afd3b 100644 --- a/openair1/SCHED/sched_eNB.h +++ b/openair1/SCHED/sched_eNB.h @@ -92,13 +92,13 @@ enum openair_HARQ_TYPE { @param abstraction_flag Indicator of PHY abstraction @param do_meas Do inline timing measurement */ -void phy_procedures_eNB_TX(PHY_VARS_eNB *phy_vars_eNB,eNB_rxtx_proc_t *proc,int do_meas); +void phy_procedures_eNB_TX(PHY_VARS_eNB *phy_vars_eNB,L1_rxtx_proc_t *proc,int do_meas); /*! \brief Scheduling for eNB RX UE-specific procedures in normal subframes. @param phy_vars_eNB Pointer to eNB variables on which to act @param proc Pointer to RXn-TXnp4 proc information */ -void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *phy_vars_eNB,eNB_rxtx_proc_t *proc); +void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *phy_vars_eNB,L1_rxtx_proc_t *proc); /*! \brief Scheduling for eNB TX procedures in TDD S-subframes. @param phy_vars_eNB Pointer to eNB variables on which to act @@ -110,7 +110,7 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *phy_vars_eNB,eNB_rxtx_proc_t *pr @param phy_vars_eNB Pointer to eNB variables on which to act @param abstraction_flag Indicator of PHY abstraction */ -void phy_procedures_eNB_common_RX(PHY_VARS_eNB *phy_vars_eNB,eNB_rxtx_proc_t *proc); +void phy_procedures_eNB_common_RX(PHY_VARS_eNB *phy_vars_eNB,L1_rxtx_proc_t *proc); /*! \brief Scheduling for eNB TX procedures in TDD S-subframes. @param phy_vars_eNB Pointer to eNB variables on which to act @@ -121,7 +121,7 @@ void phy_procedures_eNB_S_TX(PHY_VARS_eNB *phy_vars_eNB); /*! \brief Scheduling for eNB RX procedures in TDD S-subframes. @param phy_vars_eNB Pointer to eNB variables on which to act */ -void phy_procedures_eNB_S_RX(PHY_VARS_eNB *phy_vars_eNB,eNB_rxtx_proc_t *proc); +void phy_procedures_eNB_S_RX(PHY_VARS_eNB *phy_vars_eNB,L1_rxtx_proc_t *proc); /*! \brief Scheduling for eNB PRACH RX procedures @param phy_vars_eNB Pointer to eNB variables on which to act @@ -186,7 +186,7 @@ void ra_failed(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index); @param UE_id ID of UE which may be issuing the SR @returns 1 if TXOp is active. */ -uint8_t is_SR_subframe(PHY_VARS_eNB *phy_vars_eNB,eNB_rxtx_proc_t *proc,uint8_t UE_id); +uint8_t is_SR_subframe(PHY_VARS_eNB *phy_vars_eNB,L1_rxtx_proc_t *proc,uint8_t UE_id); int8_t find_ue_dlsch(uint16_t rnti, PHY_VARS_eNB *phy_vars_eNB); int8_t find_ue_ulsch(uint16_t rnti, PHY_VARS_eNB *phy_vars_eNB); diff --git a/openair1/SIMULATION/LTE_PHY/dlsim.c b/openair1/SIMULATION/LTE_PHY/dlsim.c index 3cb6223278..383b2d75eb 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim.c @@ -1443,7 +1443,7 @@ int main(int argc, char **argv) eNB->UE_stats[1].DL_pmi_single = 0; } - eNB_rxtx_proc_t *proc_eNB = &eNB->proc.L1_proc; + L1_rxtx_proc_t *proc_eNB = &eNB->proc.L1_proc; if (input_fd==NULL) { From 12b81a5b77cef7e72c8c936c7bef06c9b0fe0065 Mon Sep 17 00:00:00 2001 From: Wang Tsu-Han Date: Tue, 30 Oct 2018 17:29:20 +0100 Subject: [PATCH 08/31] fixes after the raneming of eNB_proc_t and eNB_rxtx_proc_t --- nfapi/oai_integration/nfapi_pnf.c | 18 +++++----- nfapi/oai_integration/nfapi_vnf.c | 4 +-- targets/RT/USER/lte-enb.c | 58 +++++++++++++++---------------- targets/RT/USER/lte-ru.c | 10 +++--- 4 files changed, 45 insertions(+), 45 deletions(-) diff --git a/nfapi/oai_integration/nfapi_pnf.c b/nfapi/oai_integration/nfapi_pnf.c index 684668f086..78c058ad00 100644 --- a/nfapi/oai_integration/nfapi_pnf.c +++ b/nfapi/oai_integration/nfapi_pnf.c @@ -69,12 +69,12 @@ char uecap_xer_in; extern void init_eNB_afterRU(void); extern void init_UE_stub(int nb_inst,int,int); -extern void handle_nfapi_dci_dl_pdu(PHY_VARS_eNB *eNB, int frame, int subframe, eNB_rxtx_proc_t *proc, nfapi_dl_config_request_pdu_t *dl_config_pdu); -extern void handle_nfapi_ul_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, nfapi_ul_config_request_pdu_t *ul_config_pdu, uint16_t frame,uint8_t subframe,uint8_t srs_present); -extern void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame, int subframe, eNB_rxtx_proc_t *proc, nfapi_dl_config_request_pdu_t *dl_config_pdu, uint8_t codeword_index, uint8_t *sdu); -extern void handle_nfapi_hi_dci0_dci_pdu(PHY_VARS_eNB *eNB,int frame, int subframe, eNB_rxtx_proc_t *proc, nfapi_hi_dci0_request_pdu_t *hi_dci0_config_pdu); -extern void handle_nfapi_hi_dci0_hi_pdu(PHY_VARS_eNB *eNB,int frame, int subframe, eNB_rxtx_proc_t *proc, nfapi_hi_dci0_request_pdu_t *hi_dci0_config_pdu); -extern void handle_nfapi_bch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, nfapi_dl_config_request_pdu_t *dl_config_pdu, uint8_t *sdu); +extern void handle_nfapi_dci_dl_pdu(PHY_VARS_eNB *eNB, int frame, int subframe, L1_rxtx_proc_t *proc, nfapi_dl_config_request_pdu_t *dl_config_pdu); +extern void handle_nfapi_ul_pdu(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, nfapi_ul_config_request_pdu_t *ul_config_pdu, uint16_t frame,uint8_t subframe,uint8_t srs_present); +extern void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame, int subframe, L1_rxtx_proc_t *proc, nfapi_dl_config_request_pdu_t *dl_config_pdu, uint8_t codeword_index, uint8_t *sdu); +extern void handle_nfapi_hi_dci0_dci_pdu(PHY_VARS_eNB *eNB,int frame, int subframe, L1_rxtx_proc_t *proc, nfapi_hi_dci0_request_pdu_t *hi_dci0_config_pdu); +extern void handle_nfapi_hi_dci0_hi_pdu(PHY_VARS_eNB *eNB,int frame, int subframe, L1_rxtx_proc_t *proc, nfapi_hi_dci0_request_pdu_t *hi_dci0_config_pdu); +extern void handle_nfapi_bch_pdu(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, nfapi_dl_config_request_pdu_t *dl_config_pdu, uint8_t *sdu); extern uint8_t nfapi_mode; @@ -741,7 +741,7 @@ int pnf_phy_hi_dci0_req(nfapi_pnf_p7_config_t* pnf_p7, nfapi_hi_dci0_request_t* //phy_info* phy = (phy_info*)(pnf_p7->user_data); struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0]; - eNB_rxtx_proc_t *proc = &eNB->proc.L1_proc; + L1_rxtx_proc_t *proc = &eNB->proc.L1_proc; for (int i=0; ihi_dci0_request_body.number_of_dci + req->hi_dci0_request_body.number_of_hi; i++) { @@ -798,7 +798,7 @@ int pnf_phy_dl_config_req(nfapi_pnf_p7_config_t* pnf_p7, nfapi_dl_config_request int sf = NFAPI_SFNSF2SF(req->sfn_sf); struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0]; - eNB_rxtx_proc_t *proc = &eNB->proc.L1_proc; + L1_rxtx_proc_t *proc = &eNB->proc.L1_proc; nfapi_dl_config_request_pdu_t* dl_config_pdu_list = req->dl_config_request_body.dl_config_pdu_list; LTE_eNB_PDCCH *pdcch_vars = &eNB->pdcch_vars[sf&1]; @@ -945,7 +945,7 @@ int pnf_phy_ul_config_req(nfapi_pnf_p7_config_t* pnf_p7, nfapi_ul_config_request uint16_t curr_sf = NFAPI_SFNSF2SF(req->sfn_sf); struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0]; - eNB_rxtx_proc_t *proc = &eNB->proc.L1_proc; + L1_rxtx_proc_t *proc = &eNB->proc.L1_proc; nfapi_ul_config_request_pdu_t* ul_config_pdu_list = req->ul_config_request_body.ul_config_pdu_list; for (int i=0;iul_config_request_body.number_of_pdus;i++) { diff --git a/nfapi/oai_integration/nfapi_vnf.c b/nfapi/oai_integration/nfapi_vnf.c index e9d0ad35a3..51ff501666 100644 --- a/nfapi/oai_integration/nfapi_vnf.c +++ b/nfapi/oai_integration/nfapi_vnf.c @@ -343,9 +343,9 @@ int pnf_config_resp_cb(nfapi_vnf_config_t* config, int p5_idx, nfapi_pnf_config_ int wake_eNB_rxtx(PHY_VARS_eNB *eNB, uint16_t sfn, uint16_t sf) { - eNB_proc_t *proc=&eNB->proc; + L1_proc_t *proc=&eNB->proc; - eNB_rxtx_proc_t *L1_proc= (sf&1)? &proc->L1_proc : &proc->L1_proc_tx; + L1_rxtx_proc_t *L1_proc= (sf&1)? &proc->L1_proc : &proc->L1_proc_tx; LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms; diff --git a/targets/RT/USER/lte-enb.c b/targets/RT/USER/lte-enb.c index 70317983f6..4439609104 100644 --- a/targets/RT/USER/lte-enb.c +++ b/targets/RT/USER/lte-enb.c @@ -144,7 +144,7 @@ void init_eNB(int,int); void stop_eNB(int nb_inst); int wakeup_tx(PHY_VARS_eNB *eNB); -int wakeup_txfh(eNB_rxtx_proc_t *proc,PHY_VARS_eNB *eNB); +int wakeup_txfh(L1_rxtx_proc_t *proc,PHY_VARS_eNB *eNB); void wakeup_prach_eNB(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe); #if (RRC_VERSION >= MAKE_VERSION(14, 0, 0)) void wakeup_prach_eNB_br(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe); @@ -160,9 +160,9 @@ extern void add_subframe(uint16_t *frameP, uint16_t *subframeP, int offset); #define TICK_TO_US(ts) (ts.trials==0?0:ts.diff/ts.trials) -static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_name) { +static inline int rxtx(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, char *thread_name) { start_meas(&softmodem_stats_rxtx_sf); - //eNB_rxtx_proc_t *L1_proc_tx = &eNB->proc.L1_proc_tx; + //L1_rxtx_proc_t *L1_proc_tx = &eNB->proc.L1_proc_tx; // ******************************************************************* @@ -321,8 +321,8 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam static void* L1_thread_tx(void* param) { - eNB_proc_t *eNB_proc = (eNB_proc_t*)param; - eNB_rxtx_proc_t *proc = &eNB_proc->L1_proc_tx; + L1_proc_t *eNB_proc = (L1_proc_t*)param; + L1_rxtx_proc_t *proc = &eNB_proc->L1_proc_tx; PHY_VARS_eNB *eNB = RC.eNB[0][proc->CC_id]; char thread_name[100]; @@ -364,22 +364,22 @@ static void* L1_thread_tx(void* param) { /*! * \brief The RX UE-specific and TX thread of eNB. - * \param param is a \ref eNB_proc_t structure which contains the info what to process. + * \param param is a \ref L1_proc_t structure which contains the info what to process. * \returns a pointer to an int. The storage is not on the heap and must not be freed. */ static void* L1_thread( void* param ) { static int eNB_thread_rxtx_status; - //eNB_proc_t *eNB_proc = (eNB_proc_t*)param; - eNB_rxtx_proc_t *proc; + //L1_proc_t *eNB_proc = (L1_proc_t*)param; + L1_rxtx_proc_t *proc; // Working if(nfapi_mode ==2){ - proc = (eNB_rxtx_proc_t*)param; + proc = (L1_rxtx_proc_t*)param; } else{ - eNB_proc_t *eNB_proc = (eNB_proc_t*)param; + L1_proc_t *eNB_proc = (L1_proc_t*)param; proc = &eNB_proc->L1_proc; } @@ -448,8 +448,8 @@ static void* L1_thread( void* param ) { void eNB_top(PHY_VARS_eNB *eNB, int frame_rx, int subframe_rx, char *string,RU_t *ru) { - eNB_proc_t *proc = &eNB->proc; - eNB_rxtx_proc_t *L1_proc = &proc->L1_proc; + L1_proc_t *proc = &eNB->proc; + L1_rxtx_proc_t *L1_proc = &proc->L1_proc; LTE_DL_FRAME_PARMS *fp = &ru->frame_parms; RU_proc_t *ru_proc=&ru->proc; @@ -472,7 +472,7 @@ void eNB_top(PHY_VARS_eNB *eNB, int frame_rx, int subframe_rx, char *string,RU_t } } -int wakeup_txfh(eNB_rxtx_proc_t *proc,PHY_VARS_eNB *eNB) { +int wakeup_txfh(L1_rxtx_proc_t *proc,PHY_VARS_eNB *eNB) { RU_t *ru; RU_proc_t *ru_proc; @@ -527,10 +527,10 @@ int wakeup_txfh(eNB_rxtx_proc_t *proc,PHY_VARS_eNB *eNB) { int wakeup_tx(PHY_VARS_eNB *eNB) { - eNB_proc_t *proc=&eNB->proc; + L1_proc_t *proc=&eNB->proc; - eNB_rxtx_proc_t *L1_proc_tx = &proc->L1_proc_tx; - eNB_rxtx_proc_t *L1_proc = &proc->L1_proc; + L1_rxtx_proc_t *L1_proc_tx = &proc->L1_proc_tx; + L1_rxtx_proc_t *L1_proc = &proc->L1_proc; struct timespec wait; @@ -570,10 +570,10 @@ int wakeup_tx(PHY_VARS_eNB *eNB) { int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) { - eNB_proc_t *proc=&eNB->proc; + L1_proc_t *proc=&eNB->proc; RU_proc_t *ru_proc=&ru->proc; - eNB_rxtx_proc_t *L1_proc=&proc->L1_proc; + L1_rxtx_proc_t *L1_proc=&proc->L1_proc; LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms; @@ -649,7 +649,7 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) { void wakeup_prach_eNB(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe) { - eNB_proc_t *proc = &eNB->proc; + L1_proc_t *proc = &eNB->proc; LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms; int i; @@ -709,7 +709,7 @@ void wakeup_prach_eNB(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe) { #if (RRC_VERSION >= MAKE_VERSION(14, 0, 0)) void wakeup_prach_eNB_br(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe) { - eNB_proc_t *proc = &eNB->proc; + L1_proc_t *proc = &eNB->proc; LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms; int i; @@ -770,7 +770,7 @@ void wakeup_prach_eNB_br(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe) { /*! * \brief The prach receive thread of eNB. - * \param param is a \ref eNB_proc_t structure which contains the info what to process. + * \param param is a \ref L1_proc_t structure which contains the info what to process. * \returns a pointer to an int. The storage is not on the heap and must not be freed. */ static void* eNB_thread_prach( void* param ) { @@ -778,7 +778,7 @@ static void* eNB_thread_prach( void* param ) { PHY_VARS_eNB *eNB= (PHY_VARS_eNB *)param; - eNB_proc_t *proc = &eNB->proc; + L1_proc_t *proc = &eNB->proc; // set default return value eNB_thread_prach_status = 0; @@ -813,7 +813,7 @@ static void* eNB_thread_prach( void* param ) { #if (RRC_VERSION >= MAKE_VERSION(14, 0, 0)) /*! * \brief The prach receive thread of eNB for BL/CE UEs. - * \param param is a \ref eNB_proc_t structure which contains the info what to process. + * \param param is a \ref L1_proc_t structure which contains the info what to process. * \returns a pointer to an int. The storage is not on the heap and must not be freed. */ static void* eNB_thread_prach_br( void* param ) { @@ -821,7 +821,7 @@ static void* eNB_thread_prach_br( void* param ) { PHY_VARS_eNB *eNB= (PHY_VARS_eNB *)param; - eNB_proc_t *proc = &eNB->proc; + L1_proc_t *proc = &eNB->proc; // set default return value eNB_thread_prach_status = 0; @@ -892,8 +892,8 @@ void init_eNB_proc(int inst) { /*int i=0;*/ int CC_id; PHY_VARS_eNB *eNB; - eNB_proc_t *proc; - eNB_rxtx_proc_t *L1_proc, *L1_proc_tx; + L1_proc_t *proc; + L1_rxtx_proc_t *L1_proc, *L1_proc_tx; pthread_attr_t *attr0=NULL,*attr1=NULL,*attr_prach=NULL; #if (RRC_VERSION >= MAKE_VERSION(14, 0, 0)) pthread_attr_t *attr_prach_br=NULL; @@ -1002,7 +1002,7 @@ printf("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~proc->RU_mask_tx = %d\n", proc if (eNB->node_timing == synch_to_ext_device) { //master eNB->proc.num_slaves = MAX_NUM_CCs-1; - eNB->proc.slave_proc = (eNB_proc_t**)malloc(eNB->proc.num_slaves*sizeof(eNB_proc_t*)); + eNB->proc.slave_proc = (L1_proc_t**)malloc(eNB->proc.num_slaves*sizeof(L1_proc_t*)); for (i=0; i< eNB->proc.num_slaves; i++) { if (i < CC_id) eNB->proc.slave_proc[i] = &(PHY_vars_eNB_g[inst][i]->proc); @@ -1029,8 +1029,8 @@ void kill_eNB_proc(int inst) { int *status; PHY_VARS_eNB *eNB; - eNB_proc_t *proc; - eNB_rxtx_proc_t *L1_proc, *L1_proc_tx; + L1_proc_t *proc; + L1_rxtx_proc_t *L1_proc, *L1_proc_tx; for (int CC_id=0; CC_idproc; PHY_VARS_eNB *eNB; - eNB_proc_t *eNB_proc; - eNB_rxtx_proc_t *L1_proc; + L1_proc_t *eNB_proc; + L1_rxtx_proc_t *L1_proc; cpu_set_t cpuset; CPU_ZERO(&cpuset); @@ -1992,7 +1992,7 @@ void* pre_scd_thread( void* param ){ #ifdef PHY_TX_THREAD /*! * \brief The phy tx thread of eNB. - * \param param is a \ref eNB_proc_t structure which contains the info what to process. + * \param param is a \ref L1_proc_t structure which contains the info what to process. * \returns a pointer to an int. The storage is not on the heap and must not be freed. */ static void* eNB_thread_phy_tx( void* param ) { @@ -2003,7 +2003,7 @@ static void* eNB_thread_phy_tx( void* param ) { RU_proc_t *proc = &ru->proc; PHY_VARS_eNB **eNB_list = ru->eNB_list; - eNB_rxtx_proc_t L1_proc; + L1_rxtx_proc_t L1_proc; // set default return value eNB_thread_phy_tx_status = 0; From 2c5e5c7a0c9aef79b9853a1fa61427dddaa34af4 Mon Sep 17 00:00:00 2001 From: Wang Tsu-Han Date: Mon, 5 Nov 2018 18:41:04 +0100 Subject: [PATCH 09/31] print removel and config file chenge back to one RU --- .../CONF/enb.band7.tm1.100PRB.usrpx310.conf | 12 ------- targets/RT/USER/lte-enb.c | 31 ++++++++++--------- targets/RT/USER/lte-ru.c | 4 --- 3 files changed, 16 insertions(+), 31 deletions(-) diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf index f48357c13c..728492ee83 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf @@ -188,18 +188,6 @@ RUs = ( max_rxgain = 116; eNB_instances = [0]; sdr_addrs = "type=x300"; - }, - { - local_rf = "yes" - nb_tx = 1 - nb_rx = 1 - att_tx = 0 - att_rx = 0; - bands = [7]; - max_pdschReferenceSignalPower = -27; - max_rxgain = 116; - eNB_instances = [0]; - sdr_addrs = "type=x300"; } ); diff --git a/targets/RT/USER/lte-enb.c b/targets/RT/USER/lte-enb.c index 4439609104..f2b01dbc8b 100644 --- a/targets/RT/USER/lte-enb.c +++ b/targets/RT/USER/lte-enb.c @@ -426,14 +426,11 @@ static void* L1_thread( void* param ) { if (rxtx(eNB,proc,thread_name) < 0) break; } + if(get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT) phy_procedures_eNB_TX(eNB, proc, 1); if (release_thread(&proc->mutex,&proc->instance_cnt,thread_name)<0) break; if (nfapi_mode!=2){ if(get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) wakeup_tx(eNB); - else if(get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT) - { - phy_procedures_eNB_TX(eNB, proc, 1); - wakeup_txfh(proc,eNB); - } + else if(get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT) wakeup_txfh(proc,eNB); } } // while !oai_exit @@ -481,7 +478,6 @@ int wakeup_txfh(L1_rxtx_proc_t *proc,PHY_VARS_eNB *eNB) { struct timespec wait; wait.tv_sec=0; wait.tv_nsec=5000000L; -//printf("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~inside wakeup_txfh %d.%d IC_RU = %d\n", proc->frame_tx, proc->subframe_tx, proc->instance_cnt_RUs); if(wait_on_condition(&proc->mutex_RUs,&proc->cond_RUs,&proc->instance_cnt_RUs,"wakeup_txfh")<0) { LOG_E(PHY,"Frame %d, subframe %d: TX FH not ready\n", proc->frame_tx, proc->subframe_tx); @@ -922,7 +918,6 @@ void init_eNB_proc(int inst) { proc->first_rx =1; proc->first_tx =1; proc->RU_mask_tx = (1<num_RU)-1; -printf("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~proc->RU_mask_tx = %d\n", proc->RU_mask_tx); proc->RU_mask =0; proc->RU_mask_prach =0; @@ -1045,15 +1040,17 @@ void kill_eNB_proc(int inst) { } LOG_I(PHY, "Killing TX CC_id %d inst %d\n", CC_id, inst ); - pthread_mutex_lock(&L1_proc->mutex); - L1_proc->instance_cnt = 0; - pthread_cond_signal(&L1_proc->cond); - pthread_mutex_unlock(&L1_proc->mutex); + if ((get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT || get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) && nfapi_mode!=2) { + pthread_mutex_lock(&L1_proc->mutex); + L1_proc->instance_cnt = 0; + pthread_cond_signal(&L1_proc->cond); + pthread_mutex_unlock(&L1_proc->mutex); - pthread_mutex_lock(&L1_proc_tx->mutex); - L1_proc_tx->instance_cnt = 0; - pthread_cond_signal(&L1_proc_tx->cond); - pthread_mutex_unlock(&L1_proc_tx->mutex); + pthread_mutex_lock(&L1_proc_tx->mutex); + L1_proc_tx->instance_cnt = 0; + pthread_cond_signal(&L1_proc_tx->cond); + pthread_mutex_unlock(&L1_proc_tx->mutex); + } pthread_mutex_lock(&proc->mutex_prach); proc->instance_cnt_prach = 0; @@ -1088,9 +1085,13 @@ void kill_eNB_proc(int inst) { LOG_I(PHY, "Destroying L1_proc mutex/cond\n"); pthread_mutex_destroy( &L1_proc->mutex ); pthread_cond_destroy( &L1_proc->cond ); + pthread_mutex_destroy( &L1_proc->mutex_RUs ); + pthread_cond_destroy( &L1_proc->cond_RUs ); LOG_I(PHY, "Destroying L1_proc_tx mutex/cond\n"); pthread_mutex_destroy( &L1_proc_tx->mutex ); pthread_cond_destroy( &L1_proc_tx->cond ); + pthread_mutex_destroy( &L1_proc_tx->mutex_RUs ); + pthread_cond_destroy( &L1_proc_tx->cond_RUs ); pthread_attr_destroy(&proc->attr_prach); pthread_attr_destroy(&proc->attr_asynch_rxtx); diff --git a/targets/RT/USER/lte-ru.c b/targets/RT/USER/lte-ru.c index e819233448..3fbb1e983d 100644 --- a/targets/RT/USER/lte-ru.c +++ b/targets/RT/USER/lte-ru.c @@ -1558,7 +1558,6 @@ static void* ru_thread_tx( void* param ) { // wait until eNBs are finished subframe RX n and TX n+4 wait_on_condition(&proc->mutex_eNBs,&proc->cond_eNBs,&proc->instance_cnt_eNBs,"ru_thread_tx"); if (oai_exit) break; -//printf("~~~~~~~~~~~~~~~~~~~~~~~~~~~~ru_thread_tx is waken up %d.%d having L1 %d\n", proc->frame_tx, proc->subframe_tx, ru->num_eNB); // do TX front-end processing if needed (precoding and/or IDFTs) if (ru->feptx_prec) ru->feptx_prec(ru); @@ -1587,17 +1586,14 @@ static void* ru_thread_tx( void* param ) { } } if (eNB_proc->RU_mask_tx != (1<num_RU)-1) { // not all RUs have provided their information so return -printf("~~~~~~~~~~~~~~~~~~~~~~(mask = %d)\n", eNB_proc->RU_mask_tx); pthread_mutex_unlock(&eNB_proc->mutex_RU_tx); } else { // all RUs TX are finished so send the ready signal to eNB processing -printf("~~~~~~~~~~~~~~~~~~~~~~ready to send wakeup signal\n"); eNB_proc->RU_mask_tx = 0; pthread_mutex_unlock(&eNB_proc->mutex_RU_tx); pthread_mutex_lock( &L1_proc->mutex_RUs); L1_proc->instance_cnt_RUs = 0; -printf("~~~~~~~~~~~~~~~~~~~~~~ru_thread_tx send signal to L1_thread_tx with (mask = %d)\n", eNB_proc->RU_mask_tx); // the thread can now be woken up if (pthread_cond_signal(&L1_proc->cond_RUs) != 0) { LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread\n"); From 045f2bfd314a08a1764064fc9baa071de28bde99 Mon Sep 17 00:00:00 2001 From: Wang Tsu-Han Date: Thu, 8 Nov 2018 11:42:44 +0100 Subject: [PATCH 10/31] unused veriable remove --- openair1/PHY/defs_eNB.h | 3 --- targets/RT/USER/lte-enb.c | 25 ------------------------- targets/RT/USER/lte-ru.c | 3 --- 3 files changed, 31 deletions(-) diff --git a/openair1/PHY/defs_eNB.h b/openair1/PHY/defs_eNB.h index 44d8b6ab9b..fe93b8b6e5 100644 --- a/openair1/PHY/defs_eNB.h +++ b/openair1/PHY/defs_eNB.h @@ -257,9 +257,6 @@ typedef struct RU_proc_t_s { pthread_mutex_t mutex_pre_scd; int instance_pre_scd; #endif - /// pipeline ready state - int ru_rx_ready; - int ru_tx_ready; int emulate_rf_busy; } RU_proc_t; diff --git a/targets/RT/USER/lte-enb.c b/targets/RT/USER/lte-enb.c index f2b01dbc8b..5578fb6e76 100644 --- a/targets/RT/USER/lte-enb.c +++ b/targets/RT/USER/lte-enb.c @@ -223,31 +223,6 @@ static inline int rxtx(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, char *thread_name } VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER , 1 ); -/*//#TODO - if(get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) - { - if (pthread_mutex_lock(mutex) != 0) { - LOG_E(PHY, "[SCHED][eNB] ERROR locking mutex for eNB L1_thread_tx\n"); - exit_fun("ERROR pthread_lock"); - return(-1); - } - while(L1_proc_tx->instance_cnt == 0){ - pthread_cond_wait(L1_proc_tx->cond,L1_proc_tx->mutex); - } - L1_proc_tx->instance_cnt = 0; - if (pthread_cond_signal(&L1_proc_tx->cond) != 0) { - LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB L1_thread_tx\n"); - exit_fun( "ERROR pthread_cond_signal" ); - return(-1); - } - if (pthread_mutex_unlock(mutex) != 0) { - LOG_E(PHY,"[SCHED][eNB] error unlocking mutex for %s\n",name); - exit_fun("ERROR pthread_unlock"); - return(-1); - } - }*/ - - pthread_mutex_lock(&eNB->UL_INFO_mutex); eNB->UL_INFO.frame = proc->frame_rx; diff --git a/targets/RT/USER/lte-ru.c b/targets/RT/USER/lte-ru.c index 3fbb1e983d..06b019055a 100644 --- a/targets/RT/USER/lte-ru.c +++ b/targets/RT/USER/lte-ru.c @@ -2150,8 +2150,6 @@ void init_RU_proc(RU_t *ru) { proc->frame_offset = 0; proc->num_slaves = 0; proc->frame_tx_unwrap = 0; - proc->ru_rx_ready = 0; - proc->ru_tx_ready = 0; for (i=0;i<10;i++) proc->symbol_mask[i]=0; @@ -2326,7 +2324,6 @@ void kill_RU_proc(RU_t *ru) pthread_mutex_unlock(&proc->mutex_synch); pthread_mutex_lock(&proc->mutex_eNBs); - proc->ru_tx_ready = 0; proc->instance_cnt_eNBs = 1; // cond_eNBs is used by both ru_thread and ru_thread_tx, so we need to send // a broadcast to wake up both threads From 17bb5db352f6840ea930b32d160a39983e6a0d7f Mon Sep 17 00:00:00 2001 From: Wang Tsu-Han Date: Mon, 12 Nov 2018 14:48:18 +0100 Subject: [PATCH 11/31] renaming change for UE and simulation --- openair1/SCHED/phy_mac_stub.c | 2 +- openair1/SIMULATION/LTE_PHY/pdcchsim.c | 2 +- openair1/SIMULATION/LTE_PHY/ulsim.c | 6 +++--- openair2/PHY_INTERFACE/phy_stub_UE.c | 14 +++++++------- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/openair1/SCHED/phy_mac_stub.c b/openair1/SCHED/phy_mac_stub.c index 664791f7c4..986d1518ba 100644 --- a/openair1/SCHED/phy_mac_stub.c +++ b/openair1/SCHED/phy_mac_stub.c @@ -40,7 +40,7 @@ uint8_t dci_ndi_toggle_even[8] = {0, 0, 0, 0, 0, 0, 0, 0}; uint8_t dci_ndi_toggle_odd[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -void fill_dci(DCI_PDU *DCI_pdu,PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) +void fill_dci(DCI_PDU *DCI_pdu,PHY_VARS_eNB *eNB,L1_proc_t *proc) { /* SYRTEM */ uint8_t *dci_ndi_toggle_tmp = NULL; diff --git a/openair1/SIMULATION/LTE_PHY/pdcchsim.c b/openair1/SIMULATION/LTE_PHY/pdcchsim.c index ac442ae5e9..039fef2e96 100644 --- a/openair1/SIMULATION/LTE_PHY/pdcchsim.c +++ b/openair1/SIMULATION/LTE_PHY/pdcchsim.c @@ -750,7 +750,7 @@ int main(int argc, char **argv) 0, 0); - eNB_rxtx_proc_t *proc_rxtx = &eNB->proc.proc_rxtx[subframe&1]; + L1_proc_t *proc_rxtx = (subframe == 0)? &eNB->proc.L1_proc: &eNB->proc.L1_proc_tx; eNB->ulsch[0] = new_eNB_ulsch(MAX_TURBO_ITERATIONS,N_RB_DL,0); UE->ulsch[0] = new_ue_ulsch(N_RB_DL,0); diff --git a/openair1/SIMULATION/LTE_PHY/ulsim.c b/openair1/SIMULATION/LTE_PHY/ulsim.c index 35e4b84475..dbb98a6da2 100644 --- a/openair1/SIMULATION/LTE_PHY/ulsim.c +++ b/openair1/SIMULATION/LTE_PHY/ulsim.c @@ -85,8 +85,8 @@ int nfapi_mode = 0; extern void fep_full(RU_t *ru); extern void ru_fep_full_2thread(RU_t *ru); -extern void eNB_fep_full(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc); -extern void eNB_fep_full_2thread(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc); +extern void eNB_fep_full(PHY_VARS_eNB *eNB,L1_proc_t *proc); +extern void eNB_fep_full_2thread(PHY_VARS_eNB *eNB,L1_proc_t *proc); nfapi_dl_config_request_t DL_req; nfapi_ul_config_request_t UL_req; @@ -818,7 +818,7 @@ int main(int argc, char **argv) { UE->frame_parms.pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH = 0; eNB->frame_parms.pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH = 0; UE->mac_enabled=0; - eNB_rxtx_proc_t *proc_rxtx = &eNB->proc.L1_proc; + L1_proc_t *proc_rxtx = &eNB->proc.L1_proc; UE_rxtx_proc_t *proc_rxtx_ue = &UE->proc.proc_rxtx[subframe&1]; proc_rxtx->frame_rx=1; proc_rxtx->subframe_rx=subframe; diff --git a/openair2/PHY_INTERFACE/phy_stub_UE.c b/openair2/PHY_INTERFACE/phy_stub_UE.c index 166616c368..246b29a5e7 100644 --- a/openair2/PHY_INTERFACE/phy_stub_UE.c +++ b/openair2/PHY_INTERFACE/phy_stub_UE.c @@ -590,7 +590,7 @@ int dl_config_req_UE_MAC(nfapi_dl_config_request_t* req, module_id_t Mod_id) //, //Mod_id = 0; // Currently static (only for one UE) but this should change. /*struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0]; - eNB_rxtx_proc_t *proc = &eNB->proc.proc_rxtx[0];*/ + L1_proc_t *proc = &eNB->proc.L1_proc;*/ nfapi_dl_config_request_pdu_t* dl_config_pdu_list = req->dl_config_request_body.dl_config_pdu_list; nfapi_dl_config_request_pdu_t *dl_config_pdu_tmp; @@ -941,14 +941,14 @@ void UE_config_stub_pnf(void) { /* Dummy functions*/ -void handle_nfapi_hi_dci0_dci_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t *proc, +void handle_nfapi_hi_dci0_dci_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_proc_t *proc, nfapi_hi_dci0_request_pdu_t *hi_dci0_config_pdu) { } -void handle_nfapi_hi_dci0_hi_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t *proc, +void handle_nfapi_hi_dci0_hi_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_proc_t *proc, nfapi_hi_dci0_request_pdu_t *hi_dci0_config_pdu) { @@ -957,14 +957,14 @@ void handle_nfapi_hi_dci0_hi_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rx void handle_nfapi_dci_dl_pdu(PHY_VARS_eNB *eNB, int frame, int subframe, - eNB_rxtx_proc_t *proc, + L1_proc_t *proc, nfapi_dl_config_request_pdu_t *dl_config_pdu) { } -void handle_nfapi_bch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, +void handle_nfapi_bch_pdu(PHY_VARS_eNB *eNB,L1_proc_t *proc, nfapi_dl_config_request_pdu_t *dl_config_pdu, uint8_t *sdu) { @@ -972,7 +972,7 @@ void handle_nfapi_bch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, } -void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t *proc, +void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_proc_t *proc, nfapi_dl_config_request_pdu_t *dl_config_pdu, uint8_t codeword_index, uint8_t *sdu) @@ -981,7 +981,7 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_pr } -void handle_nfapi_ul_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, +void handle_nfapi_ul_pdu(PHY_VARS_eNB *eNB,L1_proc_t *proc, nfapi_ul_config_request_pdu_t *ul_config_pdu, uint16_t frame,uint8_t subframe,uint8_t srs_present) { From c9ab59fc4d9e7968628d298b6b8d5933e6719b65 Mon Sep 17 00:00:00 2001 From: Wang Tsu-Han Date: Mon, 12 Nov 2018 15:58:56 +0100 Subject: [PATCH 12/31] fixes for misplacing L1_rxtx_proc_t with L1_proc_t --- openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c | 2 +- openair1/SCHED/phy_mac_stub.c | 2 +- openair1/SIMULATION/LTE_PHY/pdcchsim.c | 2 +- openair1/SIMULATION/LTE_PHY/ulsim.c | 6 +++--- openair2/PHY_INTERFACE/phy_stub_UE.c | 14 +++++++------- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c b/openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c index 76176d346e..c31bc587a7 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c @@ -4222,7 +4222,7 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu, /* int generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB *eNB, - eNB_rxtx_proc_t *proc, + L1_rxtx_proc_t *proc, void *dci_pdu, uint16_t rnti, DCI_format_t dci_format, diff --git a/openair1/SCHED/phy_mac_stub.c b/openair1/SCHED/phy_mac_stub.c index 986d1518ba..55149f8d2e 100644 --- a/openair1/SCHED/phy_mac_stub.c +++ b/openair1/SCHED/phy_mac_stub.c @@ -40,7 +40,7 @@ uint8_t dci_ndi_toggle_even[8] = {0, 0, 0, 0, 0, 0, 0, 0}; uint8_t dci_ndi_toggle_odd[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -void fill_dci(DCI_PDU *DCI_pdu,PHY_VARS_eNB *eNB,L1_proc_t *proc) +void fill_dci(DCI_PDU *DCI_pdu,PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc) { /* SYRTEM */ uint8_t *dci_ndi_toggle_tmp = NULL; diff --git a/openair1/SIMULATION/LTE_PHY/pdcchsim.c b/openair1/SIMULATION/LTE_PHY/pdcchsim.c index 039fef2e96..569d2226de 100644 --- a/openair1/SIMULATION/LTE_PHY/pdcchsim.c +++ b/openair1/SIMULATION/LTE_PHY/pdcchsim.c @@ -750,7 +750,7 @@ int main(int argc, char **argv) 0, 0); - L1_proc_t *proc_rxtx = (subframe == 0)? &eNB->proc.L1_proc: &eNB->proc.L1_proc_tx; + L1_rxtx_proc_t *proc_rxtx = (subframe == 0)? &eNB->proc.L1_proc: &eNB->proc.L1_proc_tx; eNB->ulsch[0] = new_eNB_ulsch(MAX_TURBO_ITERATIONS,N_RB_DL,0); UE->ulsch[0] = new_ue_ulsch(N_RB_DL,0); diff --git a/openair1/SIMULATION/LTE_PHY/ulsim.c b/openair1/SIMULATION/LTE_PHY/ulsim.c index dbb98a6da2..f246c0cdad 100644 --- a/openair1/SIMULATION/LTE_PHY/ulsim.c +++ b/openair1/SIMULATION/LTE_PHY/ulsim.c @@ -85,8 +85,8 @@ int nfapi_mode = 0; extern void fep_full(RU_t *ru); extern void ru_fep_full_2thread(RU_t *ru); -extern void eNB_fep_full(PHY_VARS_eNB *eNB,L1_proc_t *proc); -extern void eNB_fep_full_2thread(PHY_VARS_eNB *eNB,L1_proc_t *proc); +extern void eNB_fep_full(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc); +extern void eNB_fep_full_2thread(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc); nfapi_dl_config_request_t DL_req; nfapi_ul_config_request_t UL_req; @@ -818,7 +818,7 @@ int main(int argc, char **argv) { UE->frame_parms.pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH = 0; eNB->frame_parms.pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH = 0; UE->mac_enabled=0; - L1_proc_t *proc_rxtx = &eNB->proc.L1_proc; + L1_rxtx_proc_t *proc_rxtx = &eNB->proc.L1_proc; UE_rxtx_proc_t *proc_rxtx_ue = &UE->proc.proc_rxtx[subframe&1]; proc_rxtx->frame_rx=1; proc_rxtx->subframe_rx=subframe; diff --git a/openair2/PHY_INTERFACE/phy_stub_UE.c b/openair2/PHY_INTERFACE/phy_stub_UE.c index 246b29a5e7..18e2fa4cb7 100644 --- a/openair2/PHY_INTERFACE/phy_stub_UE.c +++ b/openair2/PHY_INTERFACE/phy_stub_UE.c @@ -590,7 +590,7 @@ int dl_config_req_UE_MAC(nfapi_dl_config_request_t* req, module_id_t Mod_id) //, //Mod_id = 0; // Currently static (only for one UE) but this should change. /*struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0]; - L1_proc_t *proc = &eNB->proc.L1_proc;*/ + L1_rxtx_proc_t *proc = &eNB->proc.L1_proc;*/ nfapi_dl_config_request_pdu_t* dl_config_pdu_list = req->dl_config_request_body.dl_config_pdu_list; nfapi_dl_config_request_pdu_t *dl_config_pdu_tmp; @@ -941,14 +941,14 @@ void UE_config_stub_pnf(void) { /* Dummy functions*/ -void handle_nfapi_hi_dci0_dci_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_proc_t *proc, +void handle_nfapi_hi_dci0_dci_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_proc_t *proc, nfapi_hi_dci0_request_pdu_t *hi_dci0_config_pdu) { } -void handle_nfapi_hi_dci0_hi_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_proc_t *proc, +void handle_nfapi_hi_dci0_hi_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_proc_t *proc, nfapi_hi_dci0_request_pdu_t *hi_dci0_config_pdu) { @@ -957,14 +957,14 @@ void handle_nfapi_hi_dci0_hi_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_pro void handle_nfapi_dci_dl_pdu(PHY_VARS_eNB *eNB, int frame, int subframe, - L1_proc_t *proc, + L1_rxtx_proc_t *proc, nfapi_dl_config_request_pdu_t *dl_config_pdu) { } -void handle_nfapi_bch_pdu(PHY_VARS_eNB *eNB,L1_proc_t *proc, +void handle_nfapi_bch_pdu(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, nfapi_dl_config_request_pdu_t *dl_config_pdu, uint8_t *sdu) { @@ -972,7 +972,7 @@ void handle_nfapi_bch_pdu(PHY_VARS_eNB *eNB,L1_proc_t *proc, } -void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_proc_t *proc, +void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_proc_t *proc, nfapi_dl_config_request_pdu_t *dl_config_pdu, uint8_t codeword_index, uint8_t *sdu) @@ -981,7 +981,7 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_proc_t * } -void handle_nfapi_ul_pdu(PHY_VARS_eNB *eNB,L1_proc_t *proc, +void handle_nfapi_ul_pdu(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, nfapi_ul_config_request_pdu_t *ul_config_pdu, uint16_t frame,uint8_t subframe,uint8_t srs_present) { From 5bf45e014a01a8d27a88703f1436858dfb7510fa Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Sun, 25 Nov 2018 18:34:48 +0100 Subject: [PATCH 13/31] addition of testing procedures for format 1A transmission in dlsim (nb RB > 2 or 3 which is used for TBS calculation). bugfix in UE receiver (leftover nb_antennas_tx => nb_antenna_ports_eNB) --- openair1/PHY/LTE_TRANSPORT/dlsch_scrambling.c | 1 - openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c | 11 +++- .../PHY/LTE_UE_TRANSPORT/dlsch_decoding.c | 1 - .../PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c | 2 +- .../LTE_UE_TRANSPORT/dlsch_llr_computation.c | 18 +++---- openair1/SIMULATION/LTE_PHY/dlsim.c | 52 +++++++++---------- 6 files changed, 45 insertions(+), 40 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_scrambling.c b/openair1/PHY/LTE_TRANSPORT/dlsch_scrambling.c index 1a83508cee..20ab151f50 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_scrambling.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_scrambling.c @@ -169,7 +169,6 @@ void dlsch_scrambling(LTE_DL_FRAME_PARMS *frame_parms, - s = lte_gold_generic(&x1, &x2, 0); e += 32; } diff --git a/openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c b/openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c index 76176d346e..0f77f69f41 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c @@ -51,7 +51,14 @@ #include "transport_proto_ue.h" #include "../LTE_TRANSPORT/transport_common_proto.h" #include "SCHED/sched_common.h" - + +/* +#undef LOG_D +#define LOG_D(A,B...) printf(B) +#undef LOG_I +#define LOG_I(A,B...) printf(B) +*/ + extern uint16_t beta_cqi[16]; extern uint16_t beta_ri[16]; extern uint16_t beta_ack[16]; @@ -1274,7 +1281,7 @@ void compute_llr_offset(LTE_DL_FRAME_PARMS *frame_parms, symbol_mod = (symbol >= (7-frame_parms->Ncp))? (symbol-(7-frame_parms->Ncp)) : symbol; if((symbol_mod == 0) || symbol_mod == (4-frame_parms->Ncp)) { - if (frame_parms->nb_antennas_tx == 2) + if (frame_parms->nb_antenna_ports_eNB == 2) crs_re = 4; else crs_re = 2; diff --git a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_decoding.c b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_decoding.c index afbd19329d..3c88b1aa5b 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_decoding.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_decoding.c @@ -40,7 +40,6 @@ //#define DEBUG_DLSCH_DECODING #define UE_DEBUG_TRACE 1 - void free_ue_dlsch(LTE_UE_DLSCH_t *dlsch) { diff --git a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c index e8f20c85de..11146d0144 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c @@ -4335,7 +4335,7 @@ void dlsch_channel_aver_band(int **dl_ch_estimates_ext, else nre=12; - for (aatx=0; aatxnb_antennas_tx; aatx++){ + for (aatx=0; aatxnb_antenna_ports_eNB; aatx++){ for (aarx=0; aarxnb_antennas_rx; aarx++) { dl_ch128=(__m128i *)&dl_ch_estimates_ext[aatx*frame_parms->nb_antennas_rx + aarx][symbol*frame_parms->N_RB_DL*12]; avg128D = _mm_setzero_si128(); diff --git a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_llr_computation.c b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_llr_computation.c index ea3f100504..55407d8e2d 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_llr_computation.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_llr_computation.c @@ -672,15 +672,15 @@ int dlsch_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms, len = (nb_rb*12) - pbch_pss_sss_adjust; } - - /* - LOG_I(PHY,"dlsch_qpsk_llr: [symb %d / FirstSym %d / Length %d]: @LLR Buff %x, @LLR Buff(symb) %x \n", - symbol, - first_symbol_flag, - len, - dlsch_llr, - llr32); - */ + + LOG_D(PHY,"[p %d : symb %d / FirstSym %d / Length %d]: @LLR Buff %p, @LLR Buff(symb) %p \n", + frame_parms->nb_antenna_ports_eNB, + symbol, + first_symbol_flag, + len, + dlsch_llr, + llr32); + qpsk_llr((short *)rxF, (short *)llr32, diff --git a/openair1/SIMULATION/LTE_PHY/dlsim.c b/openair1/SIMULATION/LTE_PHY/dlsim.c index 0f4655eb2c..0043e0a029 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim.c @@ -372,6 +372,7 @@ fill_dlsch_config(nfapi_dl_config_request_body_t * dl_req, dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_mode = transmission_mode; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_prb_per_subband = num_bf_prb_per_subband; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_vector = num_bf_vector; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.initial_transmission_sf_io = 0xFFFF; dl_req->number_pdu++; } @@ -402,6 +403,7 @@ void fill_DCI(PHY_VARS_eNB *eNB, nfapi_dl_config_request_body_t *dl_req=&sched_resp->DL_req->dl_config_request_body; nfapi_dl_config_request_pdu_t *dl_config_pdu; nfapi_tx_request_body_t *TX_req=&sched_resp->TX_req->tx_request_body; + int NB_RB4TBS = common_flag == 0 ? NB_RB : (2+TPC); dl_req->number_dci=0; dl_req->number_pdu=0; @@ -414,26 +416,24 @@ void fill_DCI(PHY_VARS_eNB *eNB, case 2: case 7: - if (common_flag == 0) { - dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu]; memset((void *) dl_config_pdu, 0, sizeof(nfapi_dl_config_request_pdu_t)); dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE; dl_config_pdu->pdu_size = (uint8_t) (2 + sizeof(nfapi_dl_config_dci_dl_pdu)); - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.dci_format = NFAPI_DL_DCI_FORMAT_1; + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.dci_format = (common_flag == 0) ? NFAPI_DL_DCI_FORMAT_1 : NFAPI_DL_DCI_FORMAT_1A; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level = 4; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL8_TAG; - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti = n_rnti+k; - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type = 1; // CRNTI : see Table 4-10 from SCF082 - nFAPI specifications + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti = (common_flag == 0) ? n_rnti+k : SI_RNTI; + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type = (common_flag ==0 ) ? 1: 2; // CRNTI : see Table 4-10 from SCF082 - nFAPI specifications dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.transmission_power = 6000; // equal to RS power dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.harq_process = 0; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tpc = TPC; // dont adjust power when retransmitting - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.new_data_indicator_1 = ndi; + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.new_data_indicator_1 = (common_flag == 0) ? ndi : 0; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = mcs1; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.redundancy_version_1 = rv; - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding = DLSCH_RB_ALLOC; + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding = (common_flag == 0) ? DLSCH_RB_ALLOC : computeRIV(eNB->frame_parms.N_RB_DL,0,NB_RB); //deactivate second codeword dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_2 = 0; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.redundancy_version_2 = 1; @@ -445,11 +445,12 @@ void fill_DCI(PHY_VARS_eNB *eNB, dl_req->number_pdu++; dl_req->tl.tag = NFAPI_DL_CONFIG_REQUEST_BODY_TAG; + AssertFatal(TPC>=0 && TPC<2, "TPC should be 0 or 1\n"); fill_dlsch_config(dl_req, - get_TBS_DL(mcs1,NB_RB), + get_TBS_DL(mcs1,NB_RB4TBS), (retrans > 0) ? -1 : 0, /* retransmission, no pdu_index */ - n_rnti, + (common_flag == 0) ? n_rnti : SI_RNTI, 0, // type 0 allocation from 7.1.6 in 36.213 0, // virtual_resource_block_assignment_flag, unused here DLSCH_RB_ALLOC, // resource_block_coding, @@ -472,13 +473,10 @@ void fill_DCI(PHY_VARS_eNB *eNB, ); fill_tx_req(TX_req, (frame * 10) + subframe, - get_TBS_DL(mcs1,NB_RB), + get_TBS_DL(mcs1,NB_RB4TBS), 0, input_buffer[k]); - } - else { - - } + break; @@ -589,8 +587,7 @@ int main(int argc, char **argv) int eNB_id = 0; unsigned char round; unsigned char i_mod = 2; - unsigned short NB_RB; - + int NB_RB; SCM_t channel_model=Rayleigh1; // unsigned char *input_data,*decoded_output; @@ -1000,30 +997,33 @@ int main(int argc, char **argv) // alternatively you can disable ITTI completely in CMakeLists.txt //itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info, messages_definition_xml, NULL); - if (common_flag == 0) { switch (N_RB_DL) { case 6: if (rballocset==0) DLSCH_RB_ALLOC = 0x3f; num_pdcch_symbols = 3; break; - + case 25: if (rballocset==0) DLSCH_RB_ALLOC = 0x1fff; break; - + case 50: if (rballocset==0) DLSCH_RB_ALLOC = 0x1ffff; break; - + case 100: if (rballocset==0) DLSCH_RB_ALLOC = 0x1ffffff; break; } - - NB_RB=conv_nprb(0,DLSCH_RB_ALLOC,N_RB_DL); - } else - NB_RB = 4; + + NB_RB = conv_nprb(0,DLSCH_RB_ALLOC,N_RB_DL); + } + else { + if (rballocset==0) NB_RB = 8; + else NB_RB = DLSCH_RB_ALLOC; + AssertFatal(NB_RB <= N_RB_DL,"illegal NB_RB %d\n",NB_RB); + } if (xforms==1) { fl_initialize (&argc, argv, NULL, 0, 0); @@ -1524,7 +1524,7 @@ int main(int argc, char **argv) // Simulate HARQ procedures!!! memset(CCE_table,0,800*sizeof(int)); - if (common_flag == 0) { + if (/*common_flag == 0*/ 1) { num_dci=0; num_common_dci=0; @@ -1656,7 +1656,7 @@ int main(int argc, char **argv) if (generate_ue_dlsch_params_from_dci(proc->frame_rx, proc->subframe_rx, (void *)&dci_alloc[0].dci_pdu, - n_rnti, + common_flag == 0 ? n_rnti : SI_RNTI, dci_alloc[0].format, UE->pdcch_vars[UE->current_thread_id[proc->subframe_rx]][eNB_id], UE->pdsch_vars[UE->current_thread_id[proc->subframe_rx]][eNB_id], From 131986282ac0774cd332ae5f5b1102fca19a0113 Mon Sep 17 00:00:00 2001 From: nepes Date: Sun, 25 Nov 2018 21:22:02 +0100 Subject: [PATCH 14/31] removed some logging in UE and tested TM2 reception on Band 20 cells. --- openair1/PHY/LTE_UE_TRANSPORT/dlsch_decoding.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_decoding.c b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_decoding.c index 3c88b1aa5b..1b4ca3ed2f 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_decoding.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_decoding.c @@ -38,7 +38,7 @@ #include "common/utils/LOG/vcd_signal_dumper.h" #include "PHY/LTE_UE_TRANSPORT/transport_proto_ue.h" //#define DEBUG_DLSCH_DECODING -#define UE_DEBUG_TRACE 1 +//#define UE_DEBUG_TRACE 1 void free_ue_dlsch(LTE_UE_DLSCH_t *dlsch) { @@ -625,7 +625,7 @@ decoder_if_t *tc; if (err_flag == 1) { #if UE_DEBUG_TRACE - LOG_I(PHY,"[UE %d] DLSCH: Setting NAK for SFN/SF %d/%d (pid %d, status %d, round %d, TBS %d, mcs %d) Kr %d r %d harq_process->round %d\n", + LOG_D(PHY,"[UE %d] DLSCH: Setting NAK for SFN/SF %d/%d (pid %d, status %d, round %d, TBS %d, mcs %d) Kr %d r %d harq_process->round %d\n", phy_vars_ue->Mod_id, frame, subframe, harq_pid,harq_process->status, harq_process->round,harq_process->TBS,harq_process->mcs,Kr,r,harq_process->round); #endif dlsch->harq_ack[subframe].ack = 0; @@ -649,7 +649,7 @@ decoder_if_t *tc; return((1+dlsch->max_turbo_iterations)); } else { #if UE_DEBUG_TRACE - LOG_I(PHY,"[UE %d] DLSCH: Setting ACK for subframe %d TBS %d mcs %d nb_rb %d\n", + LOG_D(PHY,"[UE %d] DLSCH: Setting ACK for subframe %d TBS %d mcs %d nb_rb %d\n", phy_vars_ue->Mod_id,subframe,harq_process->TBS,harq_process->mcs,harq_process->nb_rb); #endif From e7f0701aa7640ac717e48d3573506a0dc4a8204c Mon Sep 17 00:00:00 2001 From: Wang Tsu-Han Date: Thu, 29 Nov 2018 16:03:07 +0100 Subject: [PATCH 15/31] fixes for getting config by command line --- openair2/ENB_APP/enb_config.c | 32 +++++++++++++++----------- targets/RT/USER/lte-softmodem-common.c | 4 ++-- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index 9cbfb8741e..71adb2b811 100644 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -67,6 +67,8 @@ extern PARALLEL_CONF_t get_thread_parallel_conf(void); extern WORKER_CONF_t get_thread_worker_conf(void); extern uint32_t to_earfcn_DL(int eutra_bandP, uint32_t dl_CarrierFreq, uint32_t bw); extern uint32_t to_earfcn_UL(int eutra_bandP, uint32_t ul_CarrierFreq, uint32_t bw); +extern char *parallel_config; +extern char *worker_config; void RCconfig_flexran() { uint16_t i; @@ -2494,29 +2496,33 @@ int RCconfig_X2(MessageDef *msg_p, uint32_t i) { int RCconfig_parallel(void) { char *parallel_conf = NULL; char *worker_conf = NULL; + paramdef_t ThreadParams[] = THREAD_CONF_DESC; paramlist_def_t THREADParamList = {THREAD_CONFIG_STRING_THREAD_STRUCT,NULL,0}; config_getlist( &THREADParamList,NULL,0,NULL); - if(THREADParamList.numelt>0) { - config_getlist( &THREADParamList,ThreadParams,sizeof(ThreadParams)/sizeof(paramdef_t),NULL); - parallel_conf = strdup(*(THREADParamList.paramarray[0][THREAD_PARALLEL_IDX].strptr)); - } else { - parallel_conf = strdup("PARALLEL_RU_L1_TRX_SPLIT"); + if(parallel_config == NULL){ + if(THREADParamList.numelt>0) { + config_getlist( &THREADParamList,ThreadParams,sizeof(ThreadParams)/sizeof(paramdef_t),NULL); + parallel_conf = strdup(*(THREADParamList.paramarray[0][THREAD_PARALLEL_IDX].strptr)); + } else { + parallel_conf = strdup("PARALLEL_RU_L1_TRX_SPLIT"); + } + set_parallel_conf(parallel_conf); } - if(THREADParamList.numelt>0) { - config_getlist( &THREADParamList,ThreadParams,sizeof(ThreadParams)/sizeof(paramdef_t),NULL); - worker_conf = strdup(*(THREADParamList.paramarray[0][THREAD_WORKER_IDX].strptr)); - } else { - worker_conf = strdup("WORKER_ENABLE"); + if(worker_config == NULL){ + if(THREADParamList.numelt>0) { + config_getlist( &THREADParamList,ThreadParams,sizeof(ThreadParams)/sizeof(paramdef_t),NULL); + worker_conf = strdup(*(THREADParamList.paramarray[0][THREAD_WORKER_IDX].strptr)); + } else { + worker_conf = strdup("WORKER_ENABLE"); + } + set_worker_conf(worker_conf); } - set_parallel_conf(parallel_conf); - set_worker_conf(worker_conf); - return 0; } diff --git a/targets/RT/USER/lte-softmodem-common.c b/targets/RT/USER/lte-softmodem-common.c index 94a5dd0a6b..7e1235b310 100644 --- a/targets/RT/USER/lte-softmodem-common.c +++ b/targets/RT/USER/lte-softmodem-common.c @@ -35,6 +35,8 @@ #include "common/config/config_userapi.h" #include "common/utils/load_module_shlib.h" static softmodem_params_t softmodem_params; +char *parallel_config=NULL; +char *worker_config=NULL; uint64_t get_softmodem_optmask(void) { return softmodem_params.optmask; @@ -51,8 +53,6 @@ softmodem_params_t* get_softmodem_params(void) { void get_common_options(void) { -char *parallel_config=NULL; -char *worker_config=NULL; uint32_t online_log_messages; From 5832204fe13935a2d94c7ed6379e736d8cf982f8 Mon Sep 17 00:00:00 2001 From: Clayton Shepard Date: Wed, 5 Dec 2018 02:21:03 -0600 Subject: [PATCH 16/31] Added Iris hardware support. Signed-off-by: Rahman Doost --- cmake_targets/CMakeLists.txt | 18 + cmake_targets/build_oai | 26 +- cmake_targets/tools/build_helper | 68 ++ targets/ARCH/COMMON/common_lib.c | 5 +- targets/ARCH/COMMON/common_lib.h | 2 + targets/ARCH/IRIS/USERSPACE/LIB/Makefile.inc | 4 + targets/ARCH/IRIS/USERSPACE/LIB/iris_lib.cpp | 847 ++++++++++++++++++ .../CONF/enb.band38.tm1.25PRB.iris030.conf | 264 ++++++ .../CONF/enb.band7.tm1.25PRB.iris030.conf | 264 ++++++ targets/RT/USER/lte-ru.c | 4 +- 10 files changed, 1496 insertions(+), 6 deletions(-) create mode 100644 targets/ARCH/IRIS/USERSPACE/LIB/Makefile.inc create mode 100644 targets/ARCH/IRIS/USERSPACE/LIB/iris_lib.cpp create mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.25PRB.iris030.conf create mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.iris030.conf diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index f205e3f5fa..8e4d1afe3d 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -551,6 +551,15 @@ set(TPLIB_ETHERNET_SOURCE ) add_library(oai_eth_transpro MODULE ${TPLIB_ETHERNET_SOURCE} ) +include_directories("${OPENAIR_TARGETS}/ARCH/IRIS/USERSPACE/LIB/") +set(option_HWIRISLIB_lib "-l SoapySDR") +set(HWLIB_IRIS_SOURCE + ${OPENAIR_TARGETS}/ARCH/IRIS/USERSPACE/LIB/iris_lib.cpp + ) +add_library(oai_irisdevif MODULE ${HWLIB_IRIS_SOURCE}) +target_include_directories(oai_irisdevif PRIVATE /usr/local/lib/SoapySDR/modules0.6/) +target_link_libraries(oai_irisdevif SoapySDR) + include_directories("${OPENAIR_TARGETS}/ARCH/mobipass/") set(TPLIB_MOBIPASS_SOURCE ${OPENAIR_TARGETS}/ARCH/mobipass/interface.c @@ -1787,6 +1796,15 @@ include_directories(${CRYPTO_INCLUDE_DIRS}) if (${RF_BOARD} STREQUAL "OAI_USRP") find_package(Boost REQUIRED) include_directories(${LIBBOOST_INCLUDE_DIR}) + +elseif (${RF_BOARD} STREQUAL "OAI_IRIS") + include_directories("${OPENAIR_TARGETS}/ARCH/IRIS/USERSPACE/LIB/") + include_directories("/usr/local/include/") + set(HW_SOURCE ${HW_SOURCE} + ${OPENAIR_TARGETS}/ARCH/IRIS/USERSPACE/LIB/iris_lib.cpp) + LINK_DIRECTORIES("/usr/local/lib") + set(option_HW_lib "-lSoapySDR -rdynamic -ldl") + endif (${RF_BOARD} STREQUAL "OAI_USRP") pkg_search_module(OPENPGM openpgm-5.1 openpgm-5.2) diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index 3954827c09..5cd1cc2631 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -107,7 +107,7 @@ Options Rel8 limits the implementation to 3GPP Release 8 version Rel10 limits the implementation to 3GPP Release 10 version -w | --hardware - EXMIMO, USRP, BLADERF, ETHERNET, LMSSDR, None (Default) + EXMIMO, USRP, BLADERF, ETHERNET, LMSSDR, IRIS, None (Default) Adds this RF board support (in external packages installation and in compilation) -t | --transport protocol ETHERNET , None @@ -231,7 +231,7 @@ function main() { -w | --hardware) HW="$2" #"${i#*=}" # Use OAI_USRP as the key word USRP is used inside UHD driver - if [ "$HW" != "BLADERF" -a "$HW" != "USRP" -a "$HW" != "LMSSDR" -a "$HW" != "None" -a "$HW" != "EXMIMO" ] ; then + if [ "$HW" != "BLADERF" -a "$HW" != "USRP" -a "$HW" != "LMSSDR" -a "$HW" != "None" -a "$HW" != "EXMIMO" -a "$HW" != "IRIS" ] ; then echo_fatal "Unknown HW type $HW will exit..." else if [ "$HW" == "USRP" ] ; then @@ -243,6 +243,9 @@ function main() { if [ "$HW" == "LMSSDR" ] ; then HW="OAI_LMSSDR" fi + if [ "$HW" == "IRIS" ] ; then + HW="OAI_IRIS" + fi echo_info "Setting hardware to: $HW" fi shift 2;; @@ -414,7 +417,9 @@ function main() { DEADLINE_SCHEDULER_FLAG_USER="False" elif [ "$HW" = "OAI_BLADERF" ] ; then DEADLINE_SCHEDULER_FLAG_USER="False" - elif [ "$HW" = "OAI_LMSSDR" ] ; then + elif [ "$HW" = "OAI_LMSSDR" ] ; then + DEADLINE_SCHEDULER_FLAG_USER="False" + elif [ "$HW" = "OAI_IRIS" ] ; then DEADLINE_SCHEDULER_FLAG_USER="False" elif [ "$HW" = "None" ] ; then DEADLINE_SCHEDULER_FLAG_USER="False" @@ -484,6 +489,13 @@ function main() { flash_firmware_bladerf fi fi + if [ "$HW" == "OAI_IRIS" ] ; then + echo_info "installing packages for IRIS support" + check_install_soapy + #if [ ! "$DISABLE_HARDWARE_DEPENDENCY" == "True" ]; then + # flash_firmware_iris + #fi + fi echo_info "installing protobuf/protobuf-c for flexran agent support" install_protobuf_from_source install_protobuf_c_from_source @@ -756,6 +768,14 @@ function main() { ln -sf liboai_lmssdrdevif.so liboai_device.so ln -sf $dbin/liboai_lmssdrdevif.so.$REL $dbin/liboai_device.so echo_info "liboai_device.so is linked to LMSSDR device library" + elif [ "$HW" == "OAI_IRIS" ] ; then + compilations \ + $build_dir oai_irisdevif \ + liboai_irisdevif.so $dbin/liboai_irisdevif.so.$REL + + ln -s liboai_irisdevif.so liboai_device.so + ln -s $dbin/liboai_irisdevif.so.$REL $dbin/liboai_device.so + echo_info "liboai_device.so is linked to IRIS device library" else echo_info "liboai_device.so is not linked to any device library" fi diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index 551fc13593..658844531e 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -379,6 +379,74 @@ check_install_lmssdr_driver(){ } +install_soapy_from_source(){ + soapy_install_log=$OPENAIR_DIR/cmake_targets/log/soapy_install_log.txt + echo_info "\nInstalling Soapy EcoSystem from source. The log file for Soapy installation is here: $soapy_install_log " + ( + cd /tmp + echo "Downloading SoapySDR" + rm -rf /tmp/soapysdr + git clone https://github.com/pothosware/SoapySDR.git + cd soapysdr + #git checkout tags/release_003_010_001_001 + mkdir -p build + cd build + $CMAKE ../ + echo "Compiling SoapySDR" + make -j`nproc` + $SUDO make install + $SUDO ldconfig + cd /tmp + echo "Downloading SoapyRemote" + rm -rf /tmp/soapyremote + git clone https://github.com/pothosware/SoapyRemote.git + cd soapyremote + #git checkout tags/release_003_010_001_001 + mkdir -p build + cd build + cmake ../ + echo "Compiling SoapyRemote" + make -j`nproc` + $SUDO make install + $SUDO ldconfig + ) >& $soapy_install_log +} + +install_soapy_iris_from_source(){ + iris_install_log=$OPENAIR_DIR/cmake_targets/log/iris_install_log.txt + echo_info "\nInstalling Iris driver from source. The log file for Iris driver installation is here: $iris_install_log " + ( + cd /tmp + echo "Downloading SoapyIris" + rm -rf /tmp/sklk-soapyiris + git clone https://github.com/skylarkwireless/sklk-soapyiris.git + cd sklk-soapyiris + mkdir -p build + cd build + cmake ../ + echo "Compiling SoapyIris" + make -j`nproc` + $SUDO make install + $SUDO ldconfig + ) >& $iris_install_log +} + +check_install_soapy () { + #if [[ "$OS_DISTRO" == "ubuntu" ]]; then + #first we remove old installation + $SUDO apt-get remove -y soapysdr soapysdr-server libsoapysdr-dev python-soapysdr python3-soapysdr soapysdr-module-remote || true + $SUDO add-apt-repository -y ppa:myriadrf/drivers + $SUDO apt-get update + $SUDO apt-get install -y soapysdr soapysdr-server libsoapysdr-dev python-soapysdr python3-soapysdr soapysdr-module-remote + + #elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then + # $SUDO $INSTALLER -y install software-properties-common python3-software-properties python-software-properties subversion git python3 python-numpy python3-numpy cmake swig python-dev + # install_soapy_from_source + #fi + install_soapy_iris_from_source + +} + check_install_additional_tools (){ $SUDO $INSTALLER update -y if [[ "$OS_DISTRO" == "ubuntu" ]]; then diff --git a/targets/ARCH/COMMON/common_lib.c b/targets/ARCH/COMMON/common_lib.c index d25826e82e..b62eb9d2df 100644 --- a/targets/ARCH/COMMON/common_lib.c +++ b/targets/ARCH/COMMON/common_lib.c @@ -48,7 +48,7 @@ int set_device(openair0_device *device) { case USRP_B200_DEV: printf("[%s] has loaded USRP B200 device.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU")); break; -case USRP_X300_DEV: + case USRP_X300_DEV: printf("[%s] has loaded USRP X300 device.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU")); break; case BLADERF_DEV: @@ -57,6 +57,9 @@ case USRP_X300_DEV: case LMSSDR_DEV: printf("[%s] has loaded LMSSDR device.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU")); break; + case IRIS_DEV: + printf("[%s] has loaded Iris device.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU")); + break; case NONE_DEV: printf("[%s] has not loaded a HW device.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU")); break; diff --git a/targets/ARCH/COMMON/common_lib.h b/targets/ARCH/COMMON/common_lib.h index 0ef3cd233f..084ef9fcd9 100644 --- a/targets/ARCH/COMMON/common_lib.h +++ b/targets/ARCH/COMMON/common_lib.h @@ -95,6 +95,8 @@ typedef enum { BLADERF_DEV, /*!\brief device is LMSSDR (SoDeRa)*/ LMSSDR_DEV, + /*!\brief device is Iris */ + IRIS_DEV, /*!\brief device is NONE*/ NONE_DEV, MAX_RF_DEV_TYPE diff --git a/targets/ARCH/IRIS/USERSPACE/LIB/Makefile.inc b/targets/ARCH/IRIS/USERSPACE/LIB/Makefile.inc new file mode 100644 index 0000000000..79d0a5b7a8 --- /dev/null +++ b/targets/ARCH/IRIS/USERSPACE/LIB/Makefile.inc @@ -0,0 +1,4 @@ +IRIS_OBJ += $(OPENAIR_TARGETS)/ARCH/IRIS/USERSPACE/LIB/iris_lib.o +IRIS_FILE_OBJ += $(OPENAIR_TARGETS)/ARCH/IRIS/USERSPACE/LIB/iris_lib.cpp +IRIS_CFLAGS += -I$(OPENAIR_TARGETS)/ARCH/COMMON -I$(OPENAIR_TARGETS)/ARCH/IRIS/USERSPACE/LIB/ -I$(OPENAIR_TARGETS)/COMMON + diff --git a/targets/ARCH/IRIS/USERSPACE/LIB/iris_lib.cpp b/targets/ARCH/IRIS/USERSPACE/LIB/iris_lib.cpp new file mode 100644 index 0000000000..3133742cd4 --- /dev/null +++ b/targets/ARCH/IRIS/USERSPACE/LIB/iris_lib.cpp @@ -0,0 +1,847 @@ + +/** iris_lib.cpp + * + * \author: Rahman Doost-Mohammady : doost@rice.edu + */ + +#include +#include +#include +#include +#include +#include +#include +//#include +#include +#include +#include +#include +#include +#include +#include "common/utils/LOG/log_extern.h" +#include "common_lib.h" +#include + +#ifdef __SSE4_1__ +# include +#endif + +#ifdef __AVX2__ +# include +#endif + +#define SAMPLE_RATE_DOWN 1 + +/*! \brief Iris Configuration */ +typedef struct { + + // -------------------------------- + // variables for Iris configuration + // -------------------------------- + //! Iris device pointer + std::vector iris; + int device_num; + int rx_num_channels; + int tx_num_channels; + //create a send streamer and a receive streamer + //! Iris TX Stream + std::vector txStream; + //! Iris RX Stream + std::vector rxStream; + + //! Sampling rate + double sample_rate; + + //! time offset between transmiter timestamp and receiver timestamp; + double tdiff; + + //! TX forward samples. + int tx_forward_nsamps; //166 for 20Mhz + + + // -------------------------------- + // Debug and output control + // -------------------------------- + //! Number of underflows + int num_underflows; + //! Number of overflows + int num_overflows; + + //! Number of sequential errors + int num_seq_errors; + //! tx count + int64_t tx_count; + //! rx count + int64_t rx_count; + //! timestamp of RX packet + openair0_timestamp rx_timestamp; + +} iris_state_t; + +/*! \brief Called to start the Iris lime transceiver. Return 0 if OK, < 0 if error + @param device pointer to the device structure specific to the RF hardware target +*/ +static int trx_iris_start(openair0_device *device) { + iris_state_t *s = (iris_state_t *) device->priv; + + long long timeNs = s->iris[0]->getHardwareTime("") + 500000; + int flags = 0; + //flags |= SOAPY_SDR_HAS_TIME; + int r; + for (r = 0; r < s->device_num; r++) { + int ret = s->iris[r]->activateStream(s->rxStream[r], flags, timeNs, 0); + int ret2 = s->iris[r]->activateStream(s->txStream[r]); + if (ret < 0 | ret2 < 0) + return -1; + } + return 0; +} + +/*! \brief Stop Iris + * \param card refers to the hardware index to use + */ +int trx_iris_stop(openair0_device *device) { + iris_state_t *s = (iris_state_t *) device->priv; + int r; + for (r = 0; r < s->device_num; r++) { + s->iris[r]->deactivateStream(s->txStream[r]); + s->iris[r]->deactivateStream(s->rxStream[r]); + } + return (0); +} + +/*! \brief Terminate operation of the Iris lime transceiver -- free all associated resources + * \param device the hardware to use + */ +static void trx_iris_end(openair0_device *device) { + LOG_I(HW, "Closing Iris device.\n"); + trx_iris_stop(device); + iris_state_t *s = (iris_state_t *) device->priv; + int r; + for (r = 0; r < s->device_num; r++) { + s->iris[r]->closeStream(s->txStream[r]); + s->iris[r]->closeStream(s->rxStream[r]); + SoapySDR::Device::unmake(s->iris[r]); + } +} + +/*! \brief Called to send samples to the Iris RF target + @param device pointer to the device structure specific to the RF hardware target + @param timestamp The timestamp at whicch the first sample MUST be sent + @param buff Buffer which holds the samples + @param nsamps number of samples to be sent + @param antenna_id index of the antenna if the device has multiple anteannas + @param flags flags must be set to TRUE if timestamp parameter needs to be applied +*/ + + +static int +trx_iris_write(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps, int cc, int flags) { + using namespace std::chrono; + static long long int loop = 0; + static long time_min = 0, time_max = 0, time_avg = 0; + struct timespec tp_start, tp_end; + long time_diff; + + int ret = 0, ret_i = 0; + int flag = 0; + + iris_state_t *s = (iris_state_t *) device->priv; + int nsamps2; // aligned to upper 32 or 16 byte boundary +#if defined(__x86_64) || defined(__i386__) +#ifdef __AVX2__ + nsamps2 = (nsamps+7)>>3; + __m256i buff_tx[2][nsamps2]; +#else + nsamps2 = (nsamps+3)>>2; + __m128i buff_tx[2][nsamps2]; +#endif +#endif + + // bring RX data into 12 LSBs for softmodem RX + for (int i=0; iiris[0]->getHardwareTime(""); + return nsamps; + } + + if (flags == 2 || flags == 1) { // start of burst + + } else if (flags == 3 | flags == 4) { + flag |= SOAPY_SDR_END_BURST; + } + + + long long timeNs = SoapySDR::ticksToTimeNs(timestamp, s->sample_rate / SAMPLE_RATE_DOWN); + uint32_t *samps[2]; //= (uint32_t **)buff; + int r; + int m = s->tx_num_channels; + for (r = 0; r < s->device_num; r++) { + int samples_sent = 0; + samps[0] = (uint32_t *) buff_tx[m * r]; + + if (cc % 2 == 0) + samps[1] = (uint32_t *) buff_tx[m * r + 1]; //cws: it seems another thread can clobber these, so we need to save them locally. +#ifdef IRIS_DEBUG + int i; + for (i = 200; i < 216; i++) + printf("%d, ",((int16_t)(samps[0][i]>>16))>>4); + printf("\n"); + //printf("\nHardware time before write: %lld, tx_time_stamp: %lld\n", s->iris[0]->getHardwareTime(""), timeNs); +#endif + ret = s->iris[r]->writeStream(s->txStream[r], (void **) samps, (size_t)(nsamps), flag, timeNs, 1000000); + + if (ret < 0) + printf("Unable to write stream!\n"); + else + samples_sent = ret; + + + if (samples_sent != nsamps) + printf("[xmit] tx samples %d != %d\n", samples_sent, nsamps); + + } + + return nsamps; +} + +/*! \brief Receive samples from hardware. + * Read \ref nsamps samples from each channel to buffers. buff[0] is the array for + * the first channel. *ptimestamp is the time at which the first sample + * was received. + * \param device the hardware to use + * \param[out] ptimestamp the time at which the first sample was received. + * \param[out] buff An array of pointers to buffers for received samples. The buffers must be large enough to hold the number of samples \ref nsamps. + * \param nsamps Number of samples. One sample is 2 byte I + 2 byte Q => 4 byte. + * \param antenna_id Index of antenna for which to receive samples + * \returns the number of sample read +*/ +static int trx_iris_read(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps, int cc) { + int ret = 0; + static long long nextTime; + static bool nextTimeValid = false; + iris_state_t *s = (iris_state_t *) device->priv; + bool time_set = false; + long long timeNs = 0; + int flags; + int samples_received; + uint32_t *samps[2]; //= (uint32_t **)buff; + + int r; + int m = s->rx_num_channels; + int nsamps2; // aligned to upper 32 or 16 byte boundary +#if defined(__x86_64) || defined(__i386__) +#ifdef __AVX2__ + nsamps2 = (nsamps+7)>>3; + __m256i buff_tmp[2][nsamps2]; +#else + nsamps2 = (nsamps+3)>>2; + __m128i buff_tmp[2][nsamps2]; +#endif +#endif + + for (r = 0; r < s->device_num; r++) { + flags = 0; + samples_received = 0; + samps[0] = (uint32_t *) buff_tmp[m * r]; + if (cc % 2 == 0) + samps[1] = (uint32_t *) buff_tmp[m * r + 1]; + + flags = 0; + ret = s->iris[r]->readStream(s->rxStream[r], (void **) samps, (size_t)(nsamps), flags, + timeNs, 1000000); + if (ret < 0) { + if (ret == SOAPY_SDR_TIME_ERROR) + printf("[recv] Time Error in tx stream!\n"); + else if (ret == SOAPY_SDR_OVERFLOW | (flags & SOAPY_SDR_END_ABRUPT)) + printf("[recv] Overflow occured!\n"); + else if (ret == SOAPY_SDR_TIMEOUT) + printf("[recv] Timeout occured!\n"); + else if (ret == SOAPY_SDR_STREAM_ERROR) + printf("[recv] Stream (tx) error occured!\n"); + else if (ret == SOAPY_SDR_CORRUPTION) + printf("[recv] Bad packet occured!\n"); + break; + } else + samples_received = ret; + + + if (r == 0) { + if (samples_received == ret) // first batch + { + if (flags & SOAPY_SDR_HAS_TIME) { + s->rx_timestamp = SoapySDR::timeNsToTicks(timeNs, s->sample_rate / SAMPLE_RATE_DOWN); + *ptimestamp = s->rx_timestamp; + nextTime = timeNs; + nextTimeValid = true; + time_set = true; + //printf("1) time set %llu \n", *ptimestamp); + } + } + } + + if (r == 0) { + if (samples_received == nsamps) { + + if (flags & SOAPY_SDR_HAS_TIME) { + s->rx_timestamp = SoapySDR::timeNsToTicks(nextTime, s->sample_rate / SAMPLE_RATE_DOWN); + *ptimestamp = s->rx_timestamp; + nextTime = timeNs; + nextTimeValid = true; + time_set = true; + } + } else if (samples_received < nsamps) + printf("[recv] received %d samples out of %d\n", samples_received, nsamps); + + s->rx_count += samples_received; + + if (s->sample_rate != 0 && nextTimeValid) { + if (!time_set) { + s->rx_timestamp = SoapySDR::timeNsToTicks(nextTime, s->sample_rate / SAMPLE_RATE_DOWN); + *ptimestamp = s->rx_timestamp; + //printf("2) time set %llu, nextTime will be %llu \n", *ptimestamp, nextTime); + } + nextTime += SoapySDR::ticksToTimeNs(samples_received, s->sample_rate / SAMPLE_RATE_DOWN); + } + } + + // bring RX data into 12 LSBs for softmodem RX + for (int i=0; ipriv; + return SoapySDR::timeNsToTicks(s->iris[0]->getHardwareTime(""), s->sample_rate); +} + +/*! \brief Compares two variables within precision + * \param a first variable + * \param b second variable +*/ +static bool is_equal(double a, double b) { + return std::fabs(a - b) < std::numeric_limits::epsilon(); +} + +void *set_freq_thread(void *arg) { + + openair0_device *device = (openair0_device *) arg; + iris_state_t *s = (iris_state_t *) device->priv; + int r, i; + printf("Setting Iris TX Freq %f, RX Freq %f\n", device->openair0_cfg[0].tx_freq[0], + device->openair0_cfg[0].rx_freq[0]); + // add check for the number of channels in the cfg + for (r = 0; r < s->device_num; r++) { + for (i = 0; i < s->iris[r]->getNumChannels(SOAPY_SDR_RX); i++) { + if (i < s->rx_num_channels) + s->iris[r]->setFrequency(SOAPY_SDR_RX, i, "RF", device->openair0_cfg[0].rx_freq[i]); + } + for (i = 0; i < s->iris[r]->getNumChannels(SOAPY_SDR_TX); i++) { + if (i < s->tx_num_channels) + s->iris[r]->setFrequency(SOAPY_SDR_TX, i, "RF", device->openair0_cfg[0].tx_freq[i]); + } + } +} + +/*! \brief Set frequencies (TX/RX) + * \param device the hardware to use + * \param openair0_cfg RF frontend parameters set by application + * \param dummy dummy variable not used + * \returns 0 in success + */ +int trx_iris_set_freq(openair0_device *device, openair0_config_t *openair0_cfg, int dont_block) { + iris_state_t *s = (iris_state_t *) device->priv; + pthread_t f_thread; + if (dont_block) + pthread_create(&f_thread, NULL, set_freq_thread, (void *) device); + else { + int r, i; + for (r = 0; r < s->device_num; r++) { + printf("Setting Iris TX Freq %f, RX Freq %f\n", openair0_cfg[0].tx_freq[0], openair0_cfg[0].rx_freq[0]); + for (i = 0; i < s->iris[r]->getNumChannels(SOAPY_SDR_RX); i++) { + if (i < s->rx_num_channels) { + s->iris[r]->setFrequency(SOAPY_SDR_RX, i, "RF", openair0_cfg[0].rx_freq[i]); + } + } + for (i = 0; i < s->iris[r]->getNumChannels(SOAPY_SDR_TX); i++) { + if (i < s->tx_num_channels) { + s->iris[r]->setFrequency(SOAPY_SDR_TX, i, "RF", openair0_cfg[0].tx_freq[i]); + } + } + } + } + return (0); +} + + +/*! \brief Set Gains (TX/RX) + * \param device the hardware to use + * \param openair0_cfg RF frontend parameters set by application + * \returns 0 in success + */ +int trx_iris_set_gains(openair0_device *device, + openair0_config_t *openair0_cfg) { + iris_state_t *s = (iris_state_t *) device->priv; + int r; + for (r = 0; r < s->device_num; r++) { + s->iris[r]->setGain(SOAPY_SDR_RX, 0, openair0_cfg[0].rx_gain[0]); + s->iris[r]->setGain(SOAPY_SDR_TX, 0, openair0_cfg[0].tx_gain[0]); + s->iris[r]->setGain(SOAPY_SDR_RX, 1, openair0_cfg[0].rx_gain[1]); + s->iris[r]->setGain(SOAPY_SDR_TX, 1, openair0_cfg[0].tx_gain[1]); + } + return (0); +} + +/*! \brief Iris RX calibration table */ +rx_gain_calib_table_t calib_table_iris[] = { + {3500000000.0, 83}, + {2660000000.0, 83}, + {2580000000.0, 83}, + {2300000000.0, 83}, + {1880000000.0, 83}, + {816000000.0, 83}, + {-1, 0}}; + + +/*! \brief Set RX gain offset + * \param openair0_cfg RF frontend parameters set by application + * \param chain_index RF chain to apply settings to + * \returns 0 in success + */ +void set_rx_gain_offset(openair0_config_t *openair0_cfg, int chain_index, int bw_gain_adjust) { + + int i = 0; + // loop through calibration table to find best adjustment factor for RX frequency + double min_diff = 6e9, diff, gain_adj = 0.0; + if (bw_gain_adjust == 1) { + switch ((int) openair0_cfg[0].sample_rate) { + case 30720000: + break; + case 23040000: + gain_adj = 1.25; + break; + case 15360000: + gain_adj = 3.0; + break; + case 7680000: + gain_adj = 6.0; + break; + case 3840000: + gain_adj = 9.0; + break; + case 1920000: + gain_adj = 12.0; + break; + default: + printf("unknown sampling rate %d\n", (int) openair0_cfg[0].sample_rate); + exit(-1); + break; + } + } + + while (openair0_cfg->rx_gain_calib_table[i].freq > 0) { + diff = fabs(openair0_cfg->rx_freq[chain_index] - openair0_cfg->rx_gain_calib_table[i].freq); + printf("cal %d: freq %f, offset %f, diff %f\n", + i, + openair0_cfg->rx_gain_calib_table[i].freq, + openair0_cfg->rx_gain_calib_table[i].offset, diff); + if (min_diff > diff) { + min_diff = diff; + openair0_cfg->rx_gain_offset[chain_index] = openair0_cfg->rx_gain_calib_table[i].offset + gain_adj; + } + i++; + } + +} + +/*! \brief print the Iris statistics +* \param device the hardware to use +* \returns 0 on success +*/ +int trx_iris_get_stats(openair0_device *device) { + + return (0); + +} + +/*! \brief Reset the Iris statistics +* \param device the hardware to use +* \returns 0 on success +*/ +int trx_iris_reset_stats(openair0_device *device) { + + return (0); + +} + + +extern "C" { +/*! \brief Initialize Openair Iris target. It returns 0 if OK +* \param device the hardware to use +* \param openair0_cfg RF frontend parameters set by application +*/ +int device_init(openair0_device *device, openair0_config_t *openair0_cfg) { + + size_t i, r, card; + int bw_gain_adjust = 0; + openair0_cfg[0].rx_gain_calib_table = calib_table_iris; + iris_state_t *s = (iris_state_t *) malloc(sizeof(iris_state_t)); + memset(s, 0, sizeof(iris_state_t)); + + std::string devFE("DEV"); + std::string cbrsFE("CBRS"); + std::string wireFormat("WIRE"); + + // Initialize Iris device + device->openair0_cfg = openair0_cfg; + SoapySDR::Kwargs args; + args["driver"] = "iris"; + char *iris_addrs = device->openair0_cfg[0].sdr_addrs; + if (iris_addrs == NULL) + { + s->iris.push_back(SoapySDR::Device::make(args)); + } + else + { + char *serial = strtok(iris_addrs, ","); + while (serial != NULL) { + LOG_I(HW, "Attempting to open Iris device %s\n", serial); + args["serial"] = serial; + s->iris.push_back(SoapySDR::Device::make(args)); + serial = strtok(NULL, ","); + } + } + + s->device_num = s->iris.size(); + device->type = IRIS_DEV; + + + switch ((int) openair0_cfg[0].sample_rate) { + case 30720000: + //openair0_cfg[0].samples_per_packet = 1024; + openair0_cfg[0].tx_sample_advance = 115; + openair0_cfg[0].tx_bw = 20e6; + openair0_cfg[0].rx_bw = 20e6; + break; + case 23040000: + //openair0_cfg[0].samples_per_packet = 1024; + openair0_cfg[0].tx_sample_advance = 113; + openair0_cfg[0].tx_bw = 15e6; + openair0_cfg[0].rx_bw = 15e6; + break; + case 15360000: + //openair0_cfg[0].samples_per_packet = 1024; + openair0_cfg[0].tx_sample_advance = 60; + openair0_cfg[0].tx_bw = 10e6; + openair0_cfg[0].rx_bw = 10e6; + break; + case 7680000: + //openair0_cfg[0].samples_per_packet = 1024; + openair0_cfg[0].tx_sample_advance = 30; + openair0_cfg[0].tx_bw = 5e6; + openair0_cfg[0].rx_bw = 5e6; + break; + case 1920000: + //openair0_cfg[0].samples_per_packet = 1024; + openair0_cfg[0].tx_sample_advance = 20; + openair0_cfg[0].tx_bw = 1.4e6; + openair0_cfg[0].rx_bw = 1.4e6; + break; + default: + printf("Error: unknown sampling rate %f\n", openair0_cfg[0].sample_rate); + exit(-1); + break; + } + + printf("tx_sample_advance %d\n", openair0_cfg[0].tx_sample_advance); + s->rx_num_channels = openair0_cfg[0].rx_num_channels; + s->tx_num_channels = openair0_cfg[0].tx_num_channels; + if ((s->rx_num_channels == 1 || s->rx_num_channels == 2) && (s->tx_num_channels == 1 || s->tx_num_channels == 2)) + printf("Enabling %d rx and %d tx channel(s) on each device...\n", s->rx_num_channels, s->tx_num_channels); + else { + printf("Invalid rx or tx number of channels (%d, %d)\n", s->rx_num_channels, s->tx_num_channels); + exit(-1); + } + + for (r = 0; r < s->device_num; r++) { + switch ((int) openair0_cfg[0].sample_rate) { + case 1920000: + s->iris[r]->setMasterClockRate(256 * openair0_cfg[0].sample_rate); + break; + case 3840000: + s->iris[r]->setMasterClockRate(128 * openair0_cfg[0].sample_rate); + break; + case 7680000: + s->iris[r]->setMasterClockRate(64 * openair0_cfg[0].sample_rate); + break; + case 15360000: + s->iris[r]->setMasterClockRate(32 * openair0_cfg[0].sample_rate); + break; + case 30720000: + s->iris[r]->setMasterClockRate(16 * openair0_cfg[0].sample_rate); + break; + default: + printf("Error: unknown sampling rate %f\n", openair0_cfg[0].sample_rate); + exit(-1); + break; + } + // display Iris settings + printf("Actual master clock: %fMHz...\n", (s->iris[r]->getMasterClockRate() / 1e6)); + + /* Setting TX/RX BW after streamers are created due to iris calibration issue */ + for (i = 0; i < s->tx_num_channels; i++) { + if (i < s->iris[r]->getNumChannels(SOAPY_SDR_TX)) { + if (s->iris[r]->getHardwareInfo()["frontend"].compare(devFE) != 0) + s->iris[r]->setBandwidth(SOAPY_SDR_TX, i, 30e6); + else + s->iris[r]->setBandwidth(SOAPY_SDR_TX, i, openair0_cfg[0].tx_bw); + + printf("Setting tx bandwidth on channel %lu/%lu: BW %f (readback %f)\n", i, + s->iris[r]->getNumChannels(SOAPY_SDR_TX), openair0_cfg[0].tx_bw / 1e6, + s->iris[r]->getBandwidth(SOAPY_SDR_TX, i) / 1e6); + } + } + for (i = 0; i < s->rx_num_channels; i++) { + if (i < s->iris[r]->getNumChannels(SOAPY_SDR_RX)) { + if (s->iris[r]->getHardwareInfo()["frontend"].compare(devFE) != 0) + s->iris[r]->setBandwidth(SOAPY_SDR_TX, i, 30e6); + else + s->iris[r]->setBandwidth(SOAPY_SDR_RX, i, openair0_cfg[0].rx_bw); + printf("Setting rx bandwidth on channel %lu/%lu : BW %f (readback %f)\n", i, + s->iris[r]->getNumChannels(SOAPY_SDR_RX), openair0_cfg[0].rx_bw / 1e6, + s->iris[r]->getBandwidth(SOAPY_SDR_RX, i) / 1e6); + } + } + + for (i = 0; i < s->iris[r]->getNumChannels(SOAPY_SDR_RX); i++) { + if (i < s->rx_num_channels) { + s->iris[r]->setSampleRate(SOAPY_SDR_RX, i, openair0_cfg[0].sample_rate / SAMPLE_RATE_DOWN); + s->iris[r]->setFrequency(SOAPY_SDR_RX, i, "RF", openair0_cfg[0].rx_freq[i]); + + set_rx_gain_offset(&openair0_cfg[0], i, bw_gain_adjust); + //s->iris[r]->setGain(SOAPY_SDR_RX, i, openair0_cfg[0].rx_gain[i] - openair0_cfg[0].rx_gain_offset[i]); + if (s->iris[r]->getHardwareInfo()["frontend"].compare(devFE) != 0) { + s->iris[r]->setGain(SOAPY_SDR_RX, i, "LNA", openair0_cfg[0].rx_gain[i] - openair0_cfg[0].rx_gain_offset[i]); + //s->iris[r]->setGain(SOAPY_SDR_RX, i, "LNA", 0); + s->iris[r]->setGain(SOAPY_SDR_RX, i, "LNA1", 30); + s->iris[r]->setGain(SOAPY_SDR_RX, i, "LNA2", 17); + s->iris[r]->setGain(SOAPY_SDR_RX, i, "TIA", 0); + s->iris[r]->setGain(SOAPY_SDR_RX, i, "PGA", 0); + s->iris[r]->setGain(SOAPY_SDR_RX, i, "ATTN", 0); + } else { + s->iris[r]->setGain(SOAPY_SDR_RX, i, "LNA", openair0_cfg[0].rx_gain[i] - openair0_cfg[0].rx_gain_offset[i]); // [0,30] + s->iris[r]->setGain(SOAPY_SDR_RX, i, "TIA", 0); // [0,12,6] + s->iris[r]->setGain(SOAPY_SDR_RX, i, "PGA", 0); // [-12,19,1] + //s->iris[r]->setGain(SOAPY_SDR_RX, i, 50); // [-12,19,1] + + } + + s->iris[r]->setDCOffsetMode(SOAPY_SDR_RX, i, true); // move somewhere else + } + } + for (i = 0; i < s->iris[r]->getNumChannels(SOAPY_SDR_TX); i++) { + if (i < s->tx_num_channels) { + s->iris[r]->setSampleRate(SOAPY_SDR_TX, i, openair0_cfg[0].sample_rate / SAMPLE_RATE_DOWN); + s->iris[r]->setFrequency(SOAPY_SDR_TX, i, "RF", openair0_cfg[0].tx_freq[i]); + + if (s->iris[r]->getHardwareInfo()["frontend"].compare(devFE) == 0) { + //s->iris[r]->setGain(SOAPY_SDR_TX, i, "PAD", openair0_cfg[0].tx_gain[i]); + s->iris[r]->setGain(SOAPY_SDR_TX, i, "PAD", 52); + s->iris[r]->setGain(SOAPY_SDR_TX, i, "IAMP", 12); + //s->iris[r]->writeSetting("TX_ENABLE_DELAY", "0"); + //s->iris[r]->writeSetting("TX_DISABLE_DELAY", "100"); + } else { + s->iris[r]->setGain(SOAPY_SDR_TX, i, "ATTN", 0); // [-18, 0, 6] dB + s->iris[r]->setGain(SOAPY_SDR_TX, i, "IAMP", 9); // [-12, 12, 1] dB + s->iris[r]->setGain(SOAPY_SDR_TX, i, "PAD", 52); //openair0_cfg[0].tx_gain[i]); + //s->iris[r]->setGain(SOAPY_SDR_TX, i, "PAD", 35); // [0, 52, 1] dB + s->iris[r]->setGain(SOAPY_SDR_TX, i, "PA1", 9); // 17 ??? dB + s->iris[r]->setGain(SOAPY_SDR_TX, i, "PA2", 0); // [0, 17, 17] dB + s->iris[r]->setGain(SOAPY_SDR_TX, i, "PA3", 20); // 33 ??? dB + s->iris[r]->writeSetting("TX_ENABLE_DELAY", "0"); + s->iris[r]->writeSetting("TX_DISABLE_DELAY", "100"); + } + +// if (openair0_cfg[0].duplex_mode == 0) { +// printf("\nFDD: Enable TX antenna override\n"); +// s->iris[r]->writeSetting(SOAPY_SDR_TX, i, "TX_ENB_OVERRIDE", +// "true"); // From Josh: forces tx switching to be on always transmit regardless of bursts +// } + } + } + + + for (i = 0; i < s->iris[r]->getNumChannels(SOAPY_SDR_RX); i++) { + if (i < s->rx_num_channels) { + + //if (s->iris[r]->getHardwareInfo()["frontend"].compare(devFE) != 0) { + // printf("\nUsing SKLK calibration...\n"); + // s->iris[r]->writeSetting(SOAPY_SDR_RX, i, "CALIBRATE", "SKLK"); + //} else { + // s->iris[r]->writeSetting(SOAPY_SDR_RX, i, "CALIBRATE", ""); + // printf("\nUsing LMS calibration...\n"); + + //} + } + + } + + for (i = 0; i < s->iris[r]->getNumChannels(SOAPY_SDR_TX); i++) { + if (i < s->tx_num_channels) { + + if (s->iris[r]->getHardwareInfo()["frontend"].compare(devFE) != 0) { + printf("\nUsing SKLK calibration...\n"); + s->iris[r]->writeSetting(SOAPY_SDR_TX, i, "CALIBRATE", "SKLK"); + + } else { + printf("\nUsing LMS calibration...\n"); + s->iris[r]->writeSetting(SOAPY_SDR_TX, i, "CALIBRATE", ""); + } + } + + } + + if (s->iris[r]->getHardwareInfo()["frontend"].compare(devFE) == 0) { + for (i = 0; i < s->iris[r]->getNumChannels(SOAPY_SDR_RX); i++) { + if (openair0_cfg[0].duplex_mode == 0) { + printf("\nFDD: Setting receive antenna to %s\n", s->iris[r]->listAntennas(SOAPY_SDR_RX, i)[1].c_str()); + if (i < s->rx_num_channels) + s->iris[r]->setAntenna(SOAPY_SDR_RX, i, "RX"); + } else { + printf("\nTDD: Setting receive antenna to %s\n", s->iris[r]->listAntennas(SOAPY_SDR_RX, i)[0].c_str()); + if (i < s->rx_num_channels) + s->iris[r]->setAntenna(SOAPY_SDR_RX, i, "TRX"); + } + } + } + + + //s->iris[r]->writeSetting("TX_SW_DELAY", std::to_string( + // -openair0_cfg[0].tx_sample_advance)); //should offset switching to compensate for RF path (Lime) delay -- this will eventually be automated + + // create tx & rx streamer + //const SoapySDR::Kwargs &arg = SoapySDR::Kwargs(); + std::map rxStreamArgs; + rxStreamArgs["WIRE"] = SOAPY_SDR_CS16; + + std::vector channels; + for (i = 0; i < s->rx_num_channels; i++) + if (i < s->iris[r]->getNumChannels(SOAPY_SDR_RX)) + channels.push_back(i); + s->rxStream.push_back(s->iris[r]->setupStream(SOAPY_SDR_RX, SOAPY_SDR_CS16, channels));//, rxStreamArgs)); + + std::vector tx_channels = {}; + for (i = 0; i < s->tx_num_channels; i++) + if (i < s->iris[r]->getNumChannels(SOAPY_SDR_TX)) + tx_channels.push_back(i); + s->txStream.push_back(s->iris[r]->setupStream(SOAPY_SDR_TX, SOAPY_SDR_CS16, tx_channels)); //, arg)); + //s->iris[r]->setHardwareTime(0, ""); + + std::cout << "Front end detected: " << s->iris[r]->getHardwareInfo()["frontend"] << "\n"; + for (i = 0; i < s->rx_num_channels; i++) { + if (i < s->iris[r]->getNumChannels(SOAPY_SDR_RX)) { + printf("RX Channel %lu\n", i); + printf("Actual RX sample rate: %fMSps...\n", (s->iris[r]->getSampleRate(SOAPY_SDR_RX, i) / 1e6)); + printf("Actual RX frequency: %fGHz...\n", (s->iris[r]->getFrequency(SOAPY_SDR_RX, i) / 1e9)); + printf("Actual RX gain: %f...\n", (s->iris[r]->getGain(SOAPY_SDR_RX, i))); + printf("Actual RX LNA gain: %f...\n", (s->iris[r]->getGain(SOAPY_SDR_RX, i, "LNA"))); + printf("Actual RX PGA gain: %f...\n", (s->iris[r]->getGain(SOAPY_SDR_RX, i, "PGA"))); + printf("Actual RX TIA gain: %f...\n", (s->iris[r]->getGain(SOAPY_SDR_RX, i, "TIA"))); + if (s->iris[r]->getHardwareInfo()["frontend"].compare(devFE) != 0) { + printf("Actual RX LNA1 gain: %f...\n", (s->iris[r]->getGain(SOAPY_SDR_RX, i, "LNA1"))); + printf("Actual RX LNA2 gain: %f...\n", (s->iris[r]->getGain(SOAPY_SDR_RX, i, "LNA2"))); + } + printf("Actual RX bandwidth: %fM...\n", (s->iris[r]->getBandwidth(SOAPY_SDR_RX, i) / 1e6)); + printf("Actual RX antenna: %s...\n", (s->iris[r]->getAntenna(SOAPY_SDR_RX, i).c_str())); + } + } + + for (i = 0; i < s->tx_num_channels; i++) { + if (i < s->iris[r]->getNumChannels(SOAPY_SDR_TX)) { + printf("TX Channel %lu\n", i); + printf("Actual TX sample rate: %fMSps...\n", (s->iris[r]->getSampleRate(SOAPY_SDR_TX, i) / 1e6)); + printf("Actual TX frequency: %fGHz...\n", (s->iris[r]->getFrequency(SOAPY_SDR_TX, i) / 1e9)); + printf("Actual TX gain: %f...\n", (s->iris[r]->getGain(SOAPY_SDR_TX, i))); + printf("Actual TX PAD gain: %f...\n", (s->iris[r]->getGain(SOAPY_SDR_TX, i, "PAD"))); + printf("Actual TX IAMP gain: %f...\n", (s->iris[r]->getGain(SOAPY_SDR_TX, i, "IAMP"))); + if (s->iris[r]->getHardwareInfo()["frontend"].compare(devFE) != 0) { + printf("Actual TX PA1 gain: %f...\n", (s->iris[r]->getGain(SOAPY_SDR_TX, i, "PA1"))); + printf("Actual TX PA2 gain: %f...\n", (s->iris[r]->getGain(SOAPY_SDR_TX, i, "PA2"))); + printf("Actual TX PA3 gain: %f...\n", (s->iris[r]->getGain(SOAPY_SDR_TX, i, "PA3"))); + } + printf("Actual TX bandwidth: %fM...\n", (s->iris[r]->getBandwidth(SOAPY_SDR_TX, i) / 1e6)); + printf("Actual TX antenna: %s...\n", (s->iris[r]->getAntenna(SOAPY_SDR_TX, i).c_str())); + } + } + } + s->iris[0]->writeSetting("SYNC_DELAYS", ""); + for (r = 0; r < s->device_num; r++) + s->iris[r]->setHardwareTime(0, "TRIGGER"); + s->iris[0]->writeSetting("TRIGGER_GEN", ""); + for (r = 0; r < s->device_num; r++) + printf("Device timestamp: %f...\n", (s->iris[r]->getHardwareTime("TRIGGER") / 1e9)); + + device->priv = s; + device->trx_start_func = trx_iris_start; + device->trx_write_func = trx_iris_write; + device->trx_read_func = trx_iris_read; + device->trx_get_stats_func = trx_iris_get_stats; + device->trx_reset_stats_func = trx_iris_reset_stats; + device->trx_end_func = trx_iris_end; + device->trx_stop_func = trx_iris_stop; + device->trx_set_freq_func = trx_iris_set_freq; + device->trx_set_gains_func = trx_iris_set_gains; + device->openair0_cfg = openair0_cfg; + + s->sample_rate = openair0_cfg[0].sample_rate; + // TODO: + // init tx_forward_nsamps based iris_time_offset ex + if (is_equal(s->sample_rate, (double) 30.72e6)) + s->tx_forward_nsamps = 176; + if (is_equal(s->sample_rate, (double) 15.36e6)) + s->tx_forward_nsamps = 90; + if (is_equal(s->sample_rate, (double) 7.68e6)) + s->tx_forward_nsamps = 50; + + LOG_I(HW, "Finished initializing %d Iris device(s).\n", s->device_num); + fflush(stdout); + return 0; +} +} +/*@}*/ + + + + + diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.25PRB.iris030.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.25PRB.iris030.conf new file mode 100644 index 0000000000..77993457ab --- /dev/null +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.25PRB.iris030.conf @@ -0,0 +1,264 @@ +Active_eNBs = ( "eNB_Eurecom_LTEBox"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +eNBs = +( + { + ////////// Identification parameters: + eNB_ID = 0xe00; + + cell_type = "CELL_MACRO_ENB"; + + eNB_name = "eNB_Eurecom_LTEBox"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 1; + + plmn_list = ( { mcc = 208; mnc = 92; mnc_length = 2; } ); + + tr_s_preference = "local_mac" + + ////////// Physical parameters: + + component_carriers = ( + { + node_function = "eNodeB_3GPP"; + node_timing = "synch_to_ext_device"; + node_synch_ref = 0; + frame_type = "TDD"; + tdd_config = 3; + tdd_config_s = 0; + prefix_type = "NORMAL"; + eutra_band = 38; + downlink_frequency = 2580000000L; + uplink_frequency_offset = 0; + Nid_cell = 10; + N_RB_DL = 25; + Nid_cell_mbsfn = 0; + nb_antenna_ports = 1; + nb_antennas_tx = 1; + nb_antennas_rx = 1; + tx_gain = 52; # [~50 for DEV-FE, ~30 for CBRS-FE] + rx_gain = 115; # [115 for DEV-FE, 90 for CBRS-FE] + pbch_repetition = "FALSE"; + prach_root = 0; + prach_config_index = 0; + prach_high_speed = "DISABLE"; + prach_zero_correlation = 1; + prach_freq_offset = 2; + pucch_delta_shift = 1; + pucch_nRB_CQI = 1; + pucch_nCS_AN = 0; + pucch_n1_AN = 32; + pdsch_referenceSignalPower = -30; + pdsch_p_b = 0; + pusch_n_SB = 1; + pusch_enable64QAM = "DISABLE"; + pusch_hoppingMode = "interSubFrame"; + pusch_hoppingOffset = 0; + pusch_groupHoppingEnabled = "ENABLE"; + pusch_groupAssignment = 0; + pusch_sequenceHoppingEnabled = "DISABLE"; + pusch_nDMRS1 = 1; + phich_duration = "NORMAL"; + phich_resource = "ONESIXTH"; + srs_enable = "DISABLE"; + /* srs_BandwidthConfig =; + srs_SubframeConfig =; + srs_ackNackST =; + srs_MaxUpPts =;*/ + + pusch_p0_Nominal = -70; + pusch_alpha = "AL1"; + pucch_p0_Nominal = -96; + msg3_delta_Preamble = 6; + pucch_deltaF_Format1 = "deltaF2"; + pucch_deltaF_Format1b = "deltaF3"; + pucch_deltaF_Format2 = "deltaF0"; + pucch_deltaF_Format2a = "deltaF0"; + pucch_deltaF_Format2b = "deltaF0"; + + rach_numberOfRA_Preambles = 64; + rach_preamblesGroupAConfig = "DISABLE"; + /* + rach_sizeOfRA_PreamblesGroupA = ; + rach_messageSizeGroupA = ; + rach_messagePowerOffsetGroupB = ; + */ + rach_powerRampingStep = 4; + rach_preambleInitialReceivedTargetPower = -96; + rach_preambleTransMax = 10; + rach_raResponseWindowSize = 10; + rach_macContentionResolutionTimer = 48; + rach_maxHARQ_Msg3Tx = 4; + + pcch_default_PagingCycle = 128; + pcch_nB = "oneT"; + bcch_modificationPeriodCoeff = 2; + ue_TimersAndConstants_t300 = 1000; + ue_TimersAndConstants_t301 = 1000; + ue_TimersAndConstants_t310 = 1000; + ue_TimersAndConstants_t311 = 10000; + ue_TimersAndConstants_n310 = 20; + ue_TimersAndConstants_n311 = 1; + ue_TransmissionMode = 1; + + //Parameters for SIB18 + rxPool_sc_CP_Len = "normal"; + rxPool_sc_Period = "sf40"; + rxPool_data_CP_Len = "normal"; + rxPool_ResourceConfig_prb_Num = 20; + rxPool_ResourceConfig_prb_Start = 5; + rxPool_ResourceConfig_prb_End = 44; + rxPool_ResourceConfig_offsetIndicator_present = "prSmall"; + rxPool_ResourceConfig_offsetIndicator_choice = 0; + rxPool_ResourceConfig_subframeBitmap_present = "prBs40"; + rxPool_ResourceConfig_subframeBitmap_choice_bs_buf = "00000000000000000000"; + rxPool_ResourceConfig_subframeBitmap_choice_bs_size = 5; + rxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused = 0; +/* rxPool_dataHoppingConfig_hoppingParameter = 0; + rxPool_dataHoppingConfig_numSubbands = "ns1"; + rxPool_dataHoppingConfig_rbOffset = 0; + rxPool_commTxResourceUC-ReqAllowed = "TRUE"; +*/ + // Parameters for SIB19 + discRxPool_cp_Len = "normal" + discRxPool_discPeriod = "rf32" + discRxPool_numRetx = 1; + discRxPool_numRepetition = 2; + discRxPool_ResourceConfig_prb_Num = 5; + discRxPool_ResourceConfig_prb_Start = 3; + discRxPool_ResourceConfig_prb_End = 21; + discRxPool_ResourceConfig_offsetIndicator_present = "prSmall"; + discRxPool_ResourceConfig_offsetIndicator_choice = 0; + discRxPool_ResourceConfig_subframeBitmap_present = "prBs40"; + discRxPool_ResourceConfig_subframeBitmap_choice_bs_buf = "f0ffffffff"; + discRxPool_ResourceConfig_subframeBitmap_choice_bs_size = 5; + discRxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused = 0; + + } + ); + + srb1_parameters : + { + # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] + timer_poll_retransmit = 80; + + # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] + timer_reordering = 35; + + # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] + timer_status_prohibit = 0; + + # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] + poll_pdu = 4; + + # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] + poll_byte = 99999; + + # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] + max_retx_threshold = 4; + } + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// MME parameters: + mme_ip_address = ( { ipv4 = "127.0.0.20"; + ipv6 = "fe80::d65d:dfff:fe1d:f4d4"; + active = "yes"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : + { + ENB_INTERFACE_NAME_FOR_S1_MME = "eno1"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.10/8"; + ENB_INTERFACE_NAME_FOR_S1U = "enp5s0"; + ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.10/8"; + ENB_PORT_FOR_S1U = 2152; # Spec 2152 + + ENB_IPV4_ADDRESS_FOR_X2C = "127.0.0.10/8"; + ENB_PORT_FOR_X2C = 36422; # Spec 36422 + }; + } +); + +MACRLCs = ( + { + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + phy_test_mode = 0; + puSch10xSnr = 200; + puCch10xSnr = 200; + } +); + +L1s = ( + { + num_cc = 1; + tr_n_preference = "local_mac"; + } +); + +RUs = ( + { + local_rf = "yes" + nb_tx = 1 + nb_rx = 1 + att_tx = 0 + att_rx = 0; + bands = [7]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 125; + eNB_instances = [0]; + #sdr_addrs = "RF3C000025"; + } +); + +NETWORK_CONTROLLER : +{ + FLEXRAN_ENABLED = "no"; + FLEXRAN_INTERFACE_NAME = "lo"; + FLEXRAN_IPV4_ADDRESS = "127.0.0.1"; + FLEXRAN_PORT = 2210; + FLEXRAN_CACHE = "/mnt/oai_agent_cache"; + FLEXRAN_AWAIT_RECONF = "no"; +}; + +THREAD_STRUCT = ( + { + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_RU_L1_TRX_SPLIT"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; + } +); + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + }; + diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.iris030.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.iris030.conf new file mode 100644 index 0000000000..ca85c6538f --- /dev/null +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.iris030.conf @@ -0,0 +1,264 @@ +Active_eNBs = ( "eNB_Eurecom_LTEBox"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +eNBs = +( + { + ////////// Identification parameters: + eNB_ID = 0xe00; + + cell_type = "CELL_MACRO_ENB"; + + eNB_name = "eNB_Eurecom_LTEBox"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 1; + + plmn_list = ( { mcc = 208; mnc = 92; mnc_length = 2; } ); + + tr_s_preference = "local_mac" + + ////////// Physical parameters: + + component_carriers = ( + { + node_function = "eNodeB_3GPP"; + node_timing = "synch_to_ext_device"; + node_synch_ref = 0; + frame_type = "FDD"; + tdd_config = 3; + tdd_config_s = 0; + prefix_type = "NORMAL"; + eutra_band = 7; + downlink_frequency = 2660000000L; + uplink_frequency_offset = -120000000; + Nid_cell = 10; + N_RB_DL = 25; + Nid_cell_mbsfn = 0; + nb_antenna_ports = 1; + nb_antennas_tx = 1; + nb_antennas_rx = 1; + tx_gain = 52; # [~50 for DEV-FE, ~30 for CBRS-FE] + rx_gain = 115; # [115 for DEV-FE, 90 for CBRS-FE] + pbch_repetition = "FALSE"; + prach_root = 0; + prach_config_index = 0; + prach_high_speed = "DISABLE"; + prach_zero_correlation = 1; + prach_freq_offset = 2; + pucch_delta_shift = 1; + pucch_nRB_CQI = 1; + pucch_nCS_AN = 0; + pucch_n1_AN = 32; + pdsch_referenceSignalPower = -30; + pdsch_p_b = 0; + pusch_n_SB = 1; + pusch_enable64QAM = "DISABLE"; + pusch_hoppingMode = "interSubFrame"; + pusch_hoppingOffset = 0; + pusch_groupHoppingEnabled = "ENABLE"; + pusch_groupAssignment = 0; + pusch_sequenceHoppingEnabled = "DISABLE"; + pusch_nDMRS1 = 1; + phich_duration = "NORMAL"; + phich_resource = "ONESIXTH"; + srs_enable = "DISABLE"; + /* srs_BandwidthConfig =; + srs_SubframeConfig =; + srs_ackNackST =; + srs_MaxUpPts =;*/ + + pusch_p0_Nominal = -70; + pusch_alpha = "AL1"; + pucch_p0_Nominal = -96; + msg3_delta_Preamble = 6; + pucch_deltaF_Format1 = "deltaF2"; + pucch_deltaF_Format1b = "deltaF3"; + pucch_deltaF_Format2 = "deltaF0"; + pucch_deltaF_Format2a = "deltaF0"; + pucch_deltaF_Format2b = "deltaF0"; + + rach_numberOfRA_Preambles = 64; + rach_preamblesGroupAConfig = "DISABLE"; + /* + rach_sizeOfRA_PreamblesGroupA = ; + rach_messageSizeGroupA = ; + rach_messagePowerOffsetGroupB = ; + */ + rach_powerRampingStep = 4; + rach_preambleInitialReceivedTargetPower = -96; + rach_preambleTransMax = 10; + rach_raResponseWindowSize = 10; + rach_macContentionResolutionTimer = 48; + rach_maxHARQ_Msg3Tx = 4; + + pcch_default_PagingCycle = 128; + pcch_nB = "oneT"; + bcch_modificationPeriodCoeff = 2; + ue_TimersAndConstants_t300 = 1000; + ue_TimersAndConstants_t301 = 1000; + ue_TimersAndConstants_t310 = 1000; + ue_TimersAndConstants_t311 = 10000; + ue_TimersAndConstants_n310 = 20; + ue_TimersAndConstants_n311 = 1; + ue_TransmissionMode = 1; + + //Parameters for SIB18 + rxPool_sc_CP_Len = "normal"; + rxPool_sc_Period = "sf40"; + rxPool_data_CP_Len = "normal"; + rxPool_ResourceConfig_prb_Num = 20; + rxPool_ResourceConfig_prb_Start = 5; + rxPool_ResourceConfig_prb_End = 44; + rxPool_ResourceConfig_offsetIndicator_present = "prSmall"; + rxPool_ResourceConfig_offsetIndicator_choice = 0; + rxPool_ResourceConfig_subframeBitmap_present = "prBs40"; + rxPool_ResourceConfig_subframeBitmap_choice_bs_buf = "00000000000000000000"; + rxPool_ResourceConfig_subframeBitmap_choice_bs_size = 5; + rxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused = 0; +/* rxPool_dataHoppingConfig_hoppingParameter = 0; + rxPool_dataHoppingConfig_numSubbands = "ns1"; + rxPool_dataHoppingConfig_rbOffset = 0; + rxPool_commTxResourceUC-ReqAllowed = "TRUE"; +*/ + // Parameters for SIB19 + discRxPool_cp_Len = "normal" + discRxPool_discPeriod = "rf32" + discRxPool_numRetx = 1; + discRxPool_numRepetition = 2; + discRxPool_ResourceConfig_prb_Num = 5; + discRxPool_ResourceConfig_prb_Start = 3; + discRxPool_ResourceConfig_prb_End = 21; + discRxPool_ResourceConfig_offsetIndicator_present = "prSmall"; + discRxPool_ResourceConfig_offsetIndicator_choice = 0; + discRxPool_ResourceConfig_subframeBitmap_present = "prBs40"; + discRxPool_ResourceConfig_subframeBitmap_choice_bs_buf = "f0ffffffff"; + discRxPool_ResourceConfig_subframeBitmap_choice_bs_size = 5; + discRxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused = 0; + + } + ); + + srb1_parameters : + { + # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] + timer_poll_retransmit = 80; + + # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] + timer_reordering = 35; + + # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] + timer_status_prohibit = 0; + + # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] + poll_pdu = 4; + + # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] + poll_byte = 99999; + + # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] + max_retx_threshold = 4; + } + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// MME parameters: + mme_ip_address = ( { ipv4 = "127.0.0.20"; + ipv6 = "fe80::d65d:dfff:fe1d:f4d4"; + active = "yes"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : + { + ENB_INTERFACE_NAME_FOR_S1_MME = "lo"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.10/8"; + ENB_INTERFACE_NAME_FOR_S1U = "lo"; + ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.10/8"; + ENB_PORT_FOR_S1U = 2152; # Spec 2152 + + ENB_IPV4_ADDRESS_FOR_X2C = "127.0.0.10/8"; + ENB_PORT_FOR_X2C = 36422; # Spec 36422 + }; + } +); + +MACRLCs = ( + { + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + phy_test_mode = 0; + puSch10xSnr = 200; + puCch10xSnr = 200; + } +); + +L1s = ( + { + num_cc = 1; + tr_n_preference = "local_mac"; + } +); + +RUs = ( + { + local_rf = "yes" + nb_tx = 1 + nb_rx = 1 + att_tx = 0 + att_rx = 0; + bands = [7]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 125; + eNB_instances = [0]; + sdr_addrs = "RF3E000028"; + } +); + +NETWORK_CONTROLLER : +{ + FLEXRAN_ENABLED = "no"; + FLEXRAN_INTERFACE_NAME = "lo"; + FLEXRAN_IPV4_ADDRESS = "127.0.0.1"; + FLEXRAN_PORT = 2210; + FLEXRAN_CACHE = "/mnt/oai_agent_cache"; + FLEXRAN_AWAIT_RECONF = "no"; +}; + +THREAD_STRUCT = ( + { + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_RU_L1_TRX_SPLIT"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; + } +); + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + }; + diff --git a/targets/RT/USER/lte-ru.c b/targets/RT/USER/lte-ru.c index 4a0d2d5266..614b29bc8e 100644 --- a/targets/RT/USER/lte-ru.c +++ b/targets/RT/USER/lte-ru.c @@ -761,9 +761,9 @@ void rx_rf(RU_t *ru,int *frame,int *subframe) { proc->timestamp_rx = ts-ru->ts_offset; // AssertFatal(rxs == fp->samples_per_tti, -// "rx_rf: Asked for %d samples, got %d from USRP\n",fp->samples_per_tti,rxs); +// "rx_rf: Asked for %d samples, got %d from SDR\n",fp->samples_per_tti,rxs); if(rxs != fp->samples_per_tti){ - LOG_E(PHY,"rx_rf: Asked for %d samples, got %d from USRP\n",fp->samples_per_tti,rxs); + LOG_E(PHY,"rx_rf: Asked for %d samples, got %d from SDR\n",fp->samples_per_tti,rxs); late_control=STATE_BURST_TERMINATE; } From 5dc5f6bc79763a0ec6df28aee8e55b64324601d9 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Mon, 10 Dec 2018 14:49:48 +0100 Subject: [PATCH 17/31] CI: missing OSA banners Signed-off-by: Raphael Defosseux --- ci-scripts/active_net_interfaces.awk | 20 ++++++++++++++++++++ ci-scripts/doGitLabMerge.sh | 20 ++++++++++++++++++++ ci-scripts/tcp_iperf_stats.awk | 20 ++++++++++++++++++++ 3 files changed, 60 insertions(+) diff --git a/ci-scripts/active_net_interfaces.awk b/ci-scripts/active_net_interfaces.awk index 6d582c763b..6d1174c1cc 100644 --- a/ci-scripts/active_net_interfaces.awk +++ b/ci-scripts/active_net_interfaces.awk @@ -1 +1,21 @@ +#/* +# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more +# * contributor license agreements. See the NOTICE file distributed with +# * this work for additional information regarding copyright ownership. +# * The OpenAirInterface Software Alliance licenses this file to You under +# * the OAI Public License, Version 1.1 (the "License"); you may not use this file +# * except in compliance with the License. +# * You may obtain a copy of the License at +# * +# * http://www.openairinterface.org/?page_id=698 +# * +# * Unless required by applicable law or agreed to in writing, software +# * distributed under the License is distributed on an "AS IS" BASIS, +# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# * See the License for the specific language governing permissions and +# * limitations under the License. +# *------------------------------------------------------------------------------- +# * For more information about the OpenAirInterface (OAI) Software Alliance: +# * contact@openairinterface.org +# */ /inet.*brd/{print "interfaceToUse="$NF"done"} diff --git a/ci-scripts/doGitLabMerge.sh b/ci-scripts/doGitLabMerge.sh index dfe2f02b55..852b6407ea 100755 --- a/ci-scripts/doGitLabMerge.sh +++ b/ci-scripts/doGitLabMerge.sh @@ -1,4 +1,24 @@ #!/bin/bash +#/* +# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more +# * contributor license agreements. See the NOTICE file distributed with +# * this work for additional information regarding copyright ownership. +# * The OpenAirInterface Software Alliance licenses this file to You under +# * the OAI Public License, Version 1.1 (the "License"); you may not use this file +# * except in compliance with the License. +# * You may obtain a copy of the License at +# * +# * http://www.openairinterface.org/?page_id=698 +# * +# * Unless required by applicable law or agreed to in writing, software +# * distributed under the License is distributed on an "AS IS" BASIS, +# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# * See the License for the specific language governing permissions and +# * limitations under the License. +# *------------------------------------------------------------------------------- +# * For more information about the OpenAirInterface (OAI) Software Alliance: +# * contact@openairinterface.org +# */ function usage { echo "OAI GitLab merge request applying script" diff --git a/ci-scripts/tcp_iperf_stats.awk b/ci-scripts/tcp_iperf_stats.awk index e5c64b6283..3a00e4555f 100644 --- a/ci-scripts/tcp_iperf_stats.awk +++ b/ci-scripts/tcp_iperf_stats.awk @@ -1,3 +1,23 @@ +#/* +# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more +# * contributor license agreements. See the NOTICE file distributed with +# * this work for additional information regarding copyright ownership. +# * The OpenAirInterface Software Alliance licenses this file to You under +# * the OAI Public License, Version 1.1 (the "License"); you may not use this file +# * except in compliance with the License. +# * You may obtain a copy of the License at +# * +# * http://www.openairinterface.org/?page_id=698 +# * +# * Unless required by applicable law or agreed to in writing, software +# * distributed under the License is distributed on an "AS IS" BASIS, +# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# * See the License for the specific language governing permissions and +# * limitations under the License. +# *------------------------------------------------------------------------------- +# * For more information about the OpenAirInterface (OAI) Software Alliance: +# * contact@openairinterface.org +# */ BEGIN{max=0;min=10000} { if ($0 ~/Mbits/) { From 1b659b936cf3e224e8838d95b872f9e8a3119ca2 Mon Sep 17 00:00:00 2001 From: Laurent Date: Wed, 12 Dec 2018 14:21:00 +0100 Subject: [PATCH 18/31] fix issue 379 --- cmake_targets/CMakeLists.txt | 111 +++++++++++++++++------------------ 1 file changed, 54 insertions(+), 57 deletions(-) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 8d9a5d263d..c9d6c07291 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -260,17 +260,17 @@ add_boolean_option(ENABLE_ITTI True "ITTI is internal messaging, should remain e set (OCP_ITTI ${OPENAIR_DIR}/common/utils/ocp_itti) if (${ENABLE_ITTI}) add_library(ITTI - # add .h files if depend on (this one is generated) ${OCP_ITTI}/intertask_interface.cpp ${OPENAIR_DIR}/common/utils/backtrace.c ${OPENAIR_DIR}/common/utils/memory_pools.c ) +add_dependencies(ITTI rrc_flag) set(ITTI_LIB ITTI) set(GTPU_need_ITTI ${OPENAIR3_DIR}/GTPV1-U/gtpv1u_eNB.c) endif (${ENABLE_ITTI}) ############################# -# ASN.1 grammar C code generation & dependancies +# ASN.1 grammar C code generation & dependencies ################################ # A difficulty: asn1c generates C code of a un-predictable list of files # so, generate the c from asn1c once at cmake run time @@ -278,8 +278,6 @@ endif (${ENABLE_ITTI}) # (so creating new asn.1 objects instead of modifying the object attributes) # New C code source file, cmake must be re-run (instead of re-running make only) ############# -# set(asn1c_call "${OPENAIR_CMAKE}/tools/generate_asn1") -# set(fix_asn1c_call "${OPENAIR_CMAKE}/tools/fix_asn1") set(asn1_generated_dir ${OPENAIR_BIN_DIR}) set(protoc_call "${OPENAIR_CMAKE}/tools/generate_protobuf") @@ -317,32 +315,27 @@ elseif (${RRC_ASN1_VERSION} STREQUAL "Rel15") endif (${RRC_ASN1_VERSION} STREQUAL "Rel8") add_definitions(-DLTE_RRC_VERSION=${LTE_RRC_VERSION}) set (RRC_FULL_DIR ${asn1_generated_dir}/RRC_${RRC_ASN1_VERSION}) -message("calling ASN1C_PREFIX=LTE_ asn1c -pdu=all -fcompound-names -gen-PER -no-gen-OER -no-gen-example -D ${RRC_FULL_DIR} ${RRC_GRAMMAR}") -execute_process(COMMAND mkdir -p ${RRC_FULL_DIR} - COMMAND env "ASN1C_PREFIX=LTE_" asn1c -pdu=all -fcompound-names -gen-PER -no-gen-OER -no-gen-example -D ${RRC_FULL_DIR} ${RRC_GRAMMAR} + +# Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make +execute_process(COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${RRC_FULL_DIR}" "${RRC_GRAMMAR}" "LTE_" RESULT_VARIABLE ret) if (NOT ${ret} STREQUAL 0) message(FATAL_ERROR "${ret}: error") endif (NOT ${ret} STREQUAL 0) - file(GLOB rrc_source ${RRC_FULL_DIR}/*.c) -file(GLOB rrc_h ${RRC_FULL_DIR}/*.h) -set(rrc_h ${rrc_h} ${RRC_FULL_DIR}/asn_constant.h) -set_source_files_properties(${rrc_source} PROPERTIES COMPILE_FLAGS -w) # suppress warnings from generated code -add_library(RRC_LIB ${rrc_h} ${rrc_source} - ${OPENAIR2_DIR}/RRC/LTE/MESSAGES/asn1_msg.c - ${OPENAIR2_DIR}/RRC/LTE/MESSAGES/asn1_msg_NB_IoT.c) -include_directories ("${RRC_FULL_DIR}") - -# add the command to generate the source code -# Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make -add_custom_command ( - OUTPUT ${RRC_FULL_DIR}/asn_constant.h - COMMAND mkdir -p ${RRC_FULL_DIR} - COMMAND env "ASN1C_PREFIX=LTE_" asn1c -pdu=all -fcompound-names -gen-PER -no-gen-OER -no-gen-example -D ${RRC_FULL_DIR} ${RRC_GRAMMAR} +add_custom_target ( + rrc_flag ALL + ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${RRC_FULL_DIR}" "${RRC_GRAMMAR}" "LTE_" DEPENDS ${RRC_GRAMMAR} ) +set_source_files_properties(${rrc_source} PROPERTIES COMPILE_FLAGS -w) # suppress warnings from generated code +add_library(RRC_LIB ${rrc_source} + ${OPENAIR2_DIR}/RRC/LTE/MESSAGES/asn1_msg.c + ${OPENAIR2_DIR}/RRC/LTE/MESSAGES/asn1_msg_NB_IoT.c) +add_dependencies(RRC_LIB rrc_flag) +include_directories ("${RRC_FULL_DIR}") + # S1AP # Same limitation as described in RRC: unknown generated file list # so we generate it at cmake time @@ -378,28 +371,26 @@ endif(${S1AP_RELEASE} STREQUAL "R8") add_definitions(-DS1AP_VERSION=${S1AP_VERSION}) set(S1AP_ASN_DIR ${S1AP_DIR}/MESSAGES/ASN1/${S1AP_RELEASE}) set(S1AP_C_DIR ${asn1_generated_dir}/S1AP_${S1AP_RELEASE}) -message("calling ASN1C_PREFIX=S1AP_ asn1c -pdu=all -fcompound-names -fno-include-deps -gen-PER -no-gen-OER -no-gen-example -D ${S1AP_C_DIR} ${S1AP_ASN_DIR}/${S1AP_ASN_FILES}") -execute_process(COMMAND mkdir -p ${S1AP_C_DIR} - COMMAND env "ASN1C_PREFIX=S1AP_" asn1c -pdu=all -fcompound-names -fno-include-deps -gen-PER -no-gen-OER -no-gen-example -D ${S1AP_C_DIR} ${S1AP_ASN_DIR}/${S1AP_ASN_FILES} + +# Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make +execute_process(COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${S1AP_C_DIR}" "${S1AP_ASN_DIR}/${S1AP_ASN_FILES}" "S1AP_" -fno-include-deps RESULT_VARIABLE ret) if (NOT ${ret} STREQUAL 0) message(FATAL_ERROR "${ret}: error") endif (NOT ${ret} STREQUAL 0) file(GLOB S1AP_source ${S1AP_C_DIR}/*.c) -file(GLOB s1ap_h ${S1AP_C_DIR}/*.h) -set(s1ap_h ${s1ap_h}) - -add_custom_command ( - OUTPUT ${S1AP_C_DIR}/S1AP_asn_constant.h - COMMAND mkdir -p ${S1AP_C_DIR} - COMMAND env "ASN1C_PREFIX=S1AP_" asn1c -pdu=all -fcompound-names -fno-include-deps -gen-PER -no-gen-OER -no-gen-example -D ${S1AP_C_DIR} ${S1AP_ASN_DIR}/${S1AP_ASN_FILES} - DEPENDS ${S1AP_ASN_DIR}/${S1AP_ASN_FILES} +add_custom_target ( + s1ap_flag ALL + ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${S1AP_C_DIR}" "${S1AP_ASN_DIR}/${S1AP_ASN_FILES}" "S1AP_" -fno-include-deps + DEPENDS "${S1AP_ASN_DIR}/${S1AP_ASN_FILES}" ) + add_library(S1AP_LIB ${S1AP_source} ${S1AP_DIR}/s1ap_common.c ) +add_dependencies(S1AP_LIB rrc_flag s1ap_flag) include_directories ("${S1AP_C_DIR}") include_directories ("${S1AP_DIR}") @@ -418,6 +409,7 @@ add_library(S1AP_ENB ${S1AP_DIR}/s1ap_eNB_trace.c ${S1AP_DIR}/s1ap_eNB_ue_context.c ) +add_dependencies(S1AP_ENB rrc_flag s1ap_flag) #X2AP # Same limitation as described in RRC/S1AP: unknown generated file list @@ -445,22 +437,19 @@ endif(${X2AP_RELEASE} STREQUAL "R8") add_definitions(-DX2AP_VERSION=${X2AP_VERSION}) set(X2AP_ASN_DIR ${X2AP_DIR}/MESSAGES/ASN1/${X2AP_RELEASE}) set(X2AP_C_DIR ${asn1_generated_dir}/X2AP_${X2AP_RELEASE}) -message("calling ASN1C_PREFIX=X2AP_ asn1c -pdu=all -fcompound-names -fno-include-deps -gen-PER -no-gen-OER -no-gen-example -D ${X2AP_C_DIR} ${X2AP_ASN_DIR}/${X2AP_ASN_FILES}") -execute_process(COMMAND mkdir -p ${X2AP_C_DIR} - COMMAND env "ASN1C_PREFIX=X2AP_" asn1c -pdu=all -fcompound-names -fno-include-deps -gen-PER -no-gen-OER -no-gen-example -D ${X2AP_C_DIR} ${X2AP_ASN_DIR}/${X2AP_ASN_FILES} + +# Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make +execute_process(COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${X2AP_C_DIR}" "${X2AP_ASN_DIR}/${X2AP_ASN_FILES}" "X2AP_" -fno-include-deps RESULT_VARIABLE ret) if (NOT ${ret} STREQUAL 0) message(FATAL_ERROR "${ret}: error") endif (NOT ${ret} STREQUAL 0) + file(GLOB X2AP_source ${X2AP_C_DIR}/*.c) -file(GLOB x2ap_h ${X2AP_C_DIR}/*.h) -set(x2ap_h ${x2ap_h}) - -add_custom_command ( - OUTPUT ${X2AP_C_DIR}/X2AP_asn_constant.h - COMMAND mkdir -p ${X2AP_C_DIR} - COMMAND env "ASN1C_PREFIX=X2AP_" asn1c -pdu=all -fcompound-names -fno-include-deps -gen-PER -no-gen-OER -no-gen-example -D ${X2AP_C_DIR} ${X2AP_ASN_DIR}/${X2AP_ASN_FILES} +add_custom_target ( + x2_flag ALL + COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${X2AP_C_DIR}" "${X2AP_ASN_DIR}/${X2AP_ASN_FILES}" "X2AP_" -fno-include-deps DEPENDS ${X2AP_ASN_DIR}/${X2AP_ASN_FILES} ) @@ -468,6 +457,7 @@ add_library(X2AP_LIB ${X2AP_source} ${X2AP_DIR}/x2ap_common.c ) +add_dependencies(X2AP_LIB rrc_flag x2_flag) include_directories ("${X2AP_C_DIR}") include_directories ("${X2AP_DIR}") @@ -481,6 +471,7 @@ add_library(X2AP_ENB ${X2AP_DIR}/x2ap_eNB_management_procedures.c ${X2AP_DIR}/x2ap_eNB_generate_messages.c ) +add_dependencies(X2AP_ENB rrc_flag x2_flag) # Hardware dependant options ################################### @@ -872,6 +863,7 @@ add_library(FLEXRAN_AGENT ${OPENAIR2_DIR}/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac_internal.c ${OPENAIR2_DIR}/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac_slice_verification.c ) +add_dependencies(FLEXRAN_AGENT rrc_flag) set(FLEXRAN_AGENT_LIB FLEXRAN_AGENT) #include_directories(${OPENAIR2_DIR}/ENB_APP) @@ -937,6 +929,7 @@ set(UTIL_SRC # ${OPENAIR2_DIR}/UTIL/OTG/otg_rx.c ) add_library(UTIL ${UTIL_SRC}) +add_dependencies(UTIL rrc_flag) #set(OMG_SUMO_SRC # ${OPENAIR2_DIR}/UTIL/OMG/client_traci_OMG.c @@ -976,12 +969,14 @@ set(SCHED_SRC ${OPENAIR1_DIR}/SCHED/phy_procedures_lte_common.c ) add_library(SCHED_LIB ${SCHED_SRC}) +add_dependencies(SCHED_LIB rrc_flag) set(SCHED_SRC_RU ${OPENAIR1_DIR}/SCHED/ru_procedures.c ${OPENAIR1_DIR}/SCHED/prach_procedures.c ) add_library(SCHED_RU_LIB ${SCHED_SRC_RU}) +add_dependencies(SCHED_RU_LIB rrc_flag) set(SCHED_SRC_UE ${OPENAIR1_DIR}/SCHED_UE/phy_procedures_lte_ue.c @@ -991,6 +986,7 @@ set(SCHED_SRC_UE ${OPENAIR1_DIR}/SCHED_UE/srs_pc.c ) add_library(SCHED_UE_LIB ${SCHED_SRC_UE}) +add_dependencies(SCHED_UE_LIB rrc_flag) # nFAPI ################################# @@ -1042,6 +1038,7 @@ set(NFAPI_USER_SRC ${NFAPI_USER_DIR}/nfapi_vnf.c ) add_library(NFAPI_USER_LIB ${NFAPI_USER_SRC}) +add_dependencies(NFAPI_USER_LIB rrc_flag) include_directories(${NFAPI_USER_DIR}) # Layer 1 @@ -1060,9 +1057,6 @@ set(PHY_TURBOIF add_library(coding MODULE ${PHY_TURBOSRC} ) set(PHY_SRC_COMMON - # depend on code generation from asn1c - ${RRC_FULL_DIR}/asn_constant.h - # actual source ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dci_tools_common.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/lte_mcs.c # ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/slss.c @@ -1113,7 +1107,6 @@ set(PHY_SRC_COMMON ) set(PHY_SRC - # actual source ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pss.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/sss.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/sss_gen.c @@ -1141,7 +1134,6 @@ set(PHY_SRC ) set(PHY_SRC_RU - # actual source ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/if4_tools.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/if5_tools.c ${OPENAIR1_DIR}/PHY/MODULATION/slot_fep_ul.c @@ -1155,7 +1147,6 @@ set(PHY_SRC_RU ) set(PHY_SRC_UE - # actual source ${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/sss_ue.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/sss_gen.c ${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c @@ -1204,9 +1195,13 @@ if (${COMPILATION_AVX2} STREQUAL "True") endif () add_library(PHY_COMMON ${PHY_SRC_COMMON}) +add_dependencies(PHY_COMMON rrc_flag) add_library(PHY ${PHY_SRC}) +add_dependencies(PHY rrc_flag) add_library(PHY_UE ${PHY_SRC_UE}) +add_dependencies(PHY_UE rrc_flag) add_library(PHY_RU ${PHY_SRC_RU}) +add_dependencies(PHY_RU rrc_flag) #Library for mex functions #########################3 @@ -1376,11 +1371,13 @@ add_library(L2 ${MAC_SRC} ${ENB_APP_SRC}) # ${OPENAIR2_DIR}/RRC/L2_INTERFACE/openair_rrc_L2_interface.c) +add_dependencies(L2 rrc_flag s1ap_flag x2_flag) add_library(L2_UE ${L2_SRC_UE} ${MAC_SRC_UE} ) +add_dependencies(L2_UE rrc_flag s1ap_flag x2_flag) include_directories(${NFAPI_USER_DIR}) @@ -1406,6 +1403,7 @@ set (GTPV1U_SRC ${GTPV1U_DIR}/gtpv1u_teid_pool.c ) add_library(GTPV1U ${GTPV1U_SRC}) +add_dependencies(GTPV1U rrc_flag) set(SCTP_SRC ${OPENAIR3_DIR}/SCTP/sctp_common.c @@ -1413,8 +1411,10 @@ set(SCTP_SRC ${OPENAIR3_DIR}/SCTP/sctp_eNB_itti_messaging.c ) add_library(SCTP_CLIENT ${SCTP_SRC}) +add_dependencies(SCTP_CLIENT rrc_flag) add_library(UDP ${OPENAIR3_DIR}/UDP/udp_eNB_task.c) +add_dependencies(UDP rrc_flag) set(NAS_SRC ${OPENAIR3_DIR}/NAS/) @@ -1663,6 +1663,7 @@ if(NAS_UE) ${libnas_ue_esm_OBJS} ${libnas_ue_esm_sap_OBJS} ) + add_dependencies(LIB_NAS_UE rrc_flag) set(NAS_UE_LIB LIB_NAS_UE) include_directories(${NAS_SRC}UE) @@ -1920,8 +1921,6 @@ add_definitions(-DASN1_MINIMUM_VERSION=924) ################################################### add_executable(lte-softmodem - ${rrc_h} - ${s1ap_h} ${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c ${OPENAIR_TARGETS}/RT/USER/lte-enb.c ${OPENAIR_TARGETS}/RT/USER/lte-ru.c @@ -1944,6 +1943,7 @@ add_executable(lte-softmodem ${CONFIG_SOURCES} ${SHLIB_LOADER_SOURCES} ) +add_dependencies(lte-softmodem rrc_flag s1ap_flag x2_flag) target_link_libraries (lte-softmodem -Wl,--start-group @@ -1960,8 +1960,6 @@ target_link_libraries (lte-softmodem ${T_LIB}) # lte-softmodem-nos1 is both eNB and UE implementation ################################################### add_executable(lte-softmodem-nos1 - ${rrc_h} - ${s1ap_h} ${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c ${OPENAIR_TARGETS}/RT/USER/lte-enb.c ${OPENAIR_TARGETS}/RT/USER/lte-ru.c @@ -1983,6 +1981,7 @@ add_executable(lte-softmodem-nos1 ${CONFIG_SOURCES} ${SHLIB_LOADER_SOURCES} ) +add_dependencies(lte-softmodem-nos1 rrc_flag s1ap_flag x2_flag) target_link_libraries (lte-softmodem-nos1 -Wl,--start-group RRC_LIB SECU_CN SECU_OSA UTIL HASHTABLE SCHED_LIB SCHED_RU_LIB PHY_COMMON PHY PHY_RU LFDS L2 ${RAL_LIB} ${ITTI_LIB} @@ -1999,8 +1998,6 @@ target_link_libraries (lte-softmodem-nos1 ${T_LIB}) ####################################### add_executable(lte-uesoftmodem - ${rrc_h} - ${s1ap_h} ${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c ${OPENAIR_TARGETS}/RT/USER/lte-ue.c ${OPENAIR_TARGETS}/RT/USER/lte-uesoftmodem.c @@ -2023,6 +2020,7 @@ add_executable(lte-uesoftmodem ${SHLIB_LOADER_SOURCES} ) +add_dependencies(lte-uesoftmodem rrc_flag s1ap_flag x2_flag) target_link_libraries (lte-uesoftmodem -Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_UE PHY_RU LFDS L2_UE SIMU @@ -2038,8 +2036,6 @@ target_link_libraries (lte-uesoftmodem ${T_LIB}) # lte-uesoftmodem-nos1 is UE implementation ################################################### add_executable(lte-uesoftmodem-nos1 - ${rrc_h} - ${s1ap_h} ${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c ${OPENAIR_TARGETS}/RT/USER/lte-ue.c ${OPENAIR_TARGETS}/RT/USER/lte-uesoftmodem.c @@ -2063,6 +2059,7 @@ add_executable(lte-uesoftmodem-nos1 ${SHLIB_LOADER_SOURCES} ) +add_dependencies(lte-uesoftmodem-nos1 rrc_flag s1ap_flag x2_flag) target_link_libraries (lte-uesoftmodem-nos1 -Wl,--start-group RRC_LIB SECU_CN SECU_OSA UTIL HASHTABLE SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_UE PHY_RU LFDS L2_UE SIMU ${RAL_LIB} ${ITTI_LIB} From 89229ac59a9a8b620ec971c6d045e893074476bd Mon Sep 17 00:00:00 2001 From: Laurent Date: Wed, 12 Dec 2018 14:49:54 +0100 Subject: [PATCH 19/31] fix issue 379 --- cmake_targets/tools/make_asn1c_includes.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 cmake_targets/tools/make_asn1c_includes.sh diff --git a/cmake_targets/tools/make_asn1c_includes.sh b/cmake_targets/tools/make_asn1c_includes.sh new file mode 100755 index 0000000000..bd4254c938 --- /dev/null +++ b/cmake_targets/tools/make_asn1c_includes.sh @@ -0,0 +1,15 @@ +#!/bin/bash +GENERATED_FULL_DIR=$1 +shift +ASN1_SOURCE_DIR=$1 +shift +export ASN1C_PREFIX=$1 +shift +options=$* +done_flag="$GENERATED_FULL_DIR"/done +if [ "$done_flag" -ot $ASN1_SOURCE_DIR ] ; then + rm -f "$GENERATED_FULL_DIR"/${ASN1C_PREFIX}*.c "$GENERATED_FULL_DIR"/${ASN1C_PREFIX}*.h + mkdir -p "$GENERATED_FULL_DIR" + asn1c -pdu=all -fcompound-names -gen-PER -no-gen-OER -no-gen-example $options -D $GENERATED_FULL_DIR $ASN1_SOURCE_DIR |& egrep -v "^Copied|^Compiled" | sort -u +fi +touch $done_flag From 70711c346959b9a132573e6e27366c3bd84e7322 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Thu, 13 Dec 2018 10:02:02 +0100 Subject: [PATCH 20/31] CI: adding support for multiple XML scenario files Signed-off-by: Raphael Defosseux --- ci-scripts/Jenkinsfile-tmp-ran | 36 ++-- ci-scripts/main.py | 306 ++++++++++++++++++++----------- ci-scripts/reportBuildLocally.sh | 21 ++- ci-scripts/reportTestLocally.sh | 19 +- 4 files changed, 243 insertions(+), 139 deletions(-) diff --git a/ci-scripts/Jenkinsfile-tmp-ran b/ci-scripts/Jenkinsfile-tmp-ran index 938110b458..fc01233bfb 100644 --- a/ci-scripts/Jenkinsfile-tmp-ran +++ b/ci-scripts/Jenkinsfile-tmp-ran @@ -27,6 +27,8 @@ def pythonExecutor = params.pythonExecutor // Location of the test XML file to be run def testXMLFile = params.pythonTestXmlFile +def mainPythonAllXmlFiles = "" +def buildStageStatus = true // Name of the test stage def testStageName = params.pipelineTestStageName @@ -108,8 +110,14 @@ pipeline { if (params.pythonTestXmlFile == null) { // picking default testXMLFile = 'xml_files/enb_usrpB210_band7_50PRB.xml' + echo "Test XML file(default): ${testXMLFile}" + mainPythonAllXmlFiles += "--XMLTestFile=" + testXMLFile + " " } else { - echo "Test XML file : ${testXMLFile}" + String[] myXmlTestSuite = testXMLFile.split("\\r?\\n") + for (xmlFile in myXmlTestSuite) { + mainPythonAllXmlFiles += "--XMLTestFile=" + xmlFile + " " + echo "Test XML file : ${xmlFile}" + } } // If not present picking a default Stage Name if (params.pipelineTestStageName == null) { @@ -194,17 +202,23 @@ pipeline { steps { script { dir ('ci-scripts') { - try { - echo "\u2705 \u001B[32m${testStageName}\u001B[0m" - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.eNB_Credentials}", usernameVariable: 'eNB_Username', passwordVariable: 'eNB_Password'], - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'], - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.ADB_Credentials}", usernameVariable: 'ADB_Username', passwordVariable: 'ADB_Password'] - ]) { - sh "python3 main.py --mode=TesteNB --eNBIPAddress=${params.eNB_IPAddress} --eNBRepository=${eNB_Repository} --eNBBranch=${eNB_Branch} --eNBCommitID=${eNB_CommitID} --eNB_AllowMerge=${eNB_AllowMergeRequestProcess} --eNBTargetBranch=${eNB_TargetBranch} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} --eNBSourceCodePath=${params.eNB_SourceCodePath} --EPCIPAddress=${params.EPC_IPAddress} --EPCType=${params.EPC_Type} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --ADBIPAddress=${params.ADB_IPAddress} --ADBUserName=${ADB_Username} --ADBPassword=${ADB_Password} --XMLTestFile=${testXMLFile}" + echo "\u2705 \u001B[32m${testStageName}\u001B[0m" + withCredentials([ + [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.eNB_Credentials}", usernameVariable: 'eNB_Username', passwordVariable: 'eNB_Password'], + [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'], + [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.ADB_Credentials}", usernameVariable: 'ADB_Username', passwordVariable: 'ADB_Password'] + ]) { + sh "python3 main.py --mode=InitiateHtml --eNBRepository=${eNB_Repository} --eNBBranch=${eNB_Branch} --eNBCommitID=${eNB_CommitID} --eNB_AllowMerge=${eNB_AllowMergeRequestProcess} --eNBTargetBranch=${eNB_TargetBranch} --ADBIPAddress=${params.ADB_IPAddress} --ADBUserName=${ADB_Username} --ADBPassword=${ADB_Password} ${mainPythonAllXmlFiles}" + String[] myXmlTestSuite = testXMLFile.split("\\r?\\n") + for (xmlFile in myXmlTestSuite) { + try { + sh "python3 main.py --mode=TesteNB --eNBIPAddress=${params.eNB_IPAddress} --eNBRepository=${eNB_Repository} --eNBBranch=${eNB_Branch} --eNBCommitID=${eNB_CommitID} --eNB_AllowMerge=${eNB_AllowMergeRequestProcess} --eNBTargetBranch=${eNB_TargetBranch} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} --eNBSourceCodePath=${params.eNB_SourceCodePath} --EPCIPAddress=${params.EPC_IPAddress} --EPCType=${params.EPC_Type} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --ADBIPAddress=${params.ADB_IPAddress} --ADBUserName=${ADB_Username} --ADBPassword=${ADB_Password} --XMLTestFile=${xmlFile}" + } catch (Exception e) { + currentBuild.result = 'FAILURE' + buildStageStatus = false + } } - } catch (Exception e) { - currentBuild.result = 'FAILURE' + sh "python3 main.py --mode=FinalizeHtml --finalStatus=${buildStageStatus}" } } } diff --git a/ci-scripts/main.py b/ci-scripts/main.py index c32eb8d286..849e50b076 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -91,7 +91,8 @@ class SSHConnection(): self.ADBUserName = '' self.ADBPassword = '' self.testCase_id = '' - self.testXMLfile = '' + self.testXMLfiles = [] + self.nbTestXMLfiles = 0 self.desc = '' self.Build_eNB_args = '' self.Initialize_eNB_args = '' @@ -112,6 +113,11 @@ class SSHConnection(): self.htmlUEConnected = 0 self.htmleNBFailureMsg = '' self.picocom_closure = False + self.idle_sleep_time = 0 + self.htmlTabRefs = [] + self.htmlTabNames = [] + self.htmlTabIcons = [] + self.finalStatus = False def open(self, ipaddress, username, password): count = 0 @@ -282,9 +288,9 @@ class SSHConnection(): self.command('chmod 777 log', '\$', 5) # no need to remove in log (git clean did the trick) self.command('stdbuf -o0 ./build_oai ' + self.Build_eNB_args + ' 2>&1 | stdbuf -o0 tee -a compile_oai_enb.log', 'Bypassing the Tests', 600) - self.command('mkdir -p build_log_' + SSH.testCase_id, '\$', 5) - self.command('mv log/* ' + 'build_log_' + SSH.testCase_id, '\$', 5) - self.command('mv compile_oai_enb.log ' + 'build_log_' + SSH.testCase_id, '\$', 5) + self.command('mkdir -p build_log_' + self.testCase_id, '\$', 5) + self.command('mv log/* ' + 'build_log_' + self.testCase_id, '\$', 5) + self.command('mv compile_oai_enb.log ' + 'build_log_' + self.testCase_id, '\$', 5) # Workaround to run with develop-nr self.command('if [ -e ran_build ]; then cp -rf ran_build lte_build_oai; fi', '\$', 30) self.close() @@ -300,7 +306,7 @@ class SSHConnection(): self.command('cd ' + self.EPCSourceCodePath, '\$', 5) self.command('source oaienv', '\$', 5) self.command('cd scripts', '\$', 5) - self.command('echo ' + self.EPCPassword + ' | sudo -S ./run_hss 2>&1 | stdbuf -o0 awk \'{ print strftime("[%Y/%m/%d %H:%M:%S] ",systime()) $0 }\' | stdbuf -o0 tee -a hss_' + SSH.testCase_id + '.log &', 'Core state: 2 -> 3', 35) + self.command('echo ' + self.EPCPassword + ' | sudo -S ./run_hss 2>&1 | stdbuf -o0 awk \'{ print strftime("[%Y/%m/%d %H:%M:%S] ",systime()) $0 }\' | stdbuf -o0 tee -a hss_' + self.testCase_id + '.log &', 'Core state: 2 -> 3', 35) else: logging.debug('Using the ltebox simulated HSS') self.command('if [ -d ' + self.EPCSourceCodePath + '/scripts ]; then echo ' + self.eNBPassword + ' | sudo -S rm -Rf ' + self.EPCSourceCodePath + '/scripts ; fi', '\$', 5) @@ -326,7 +332,7 @@ class SSHConnection(): logging.debug('\u001B[1;37;41m Hostname Not Found! \u001B[0m') sys.exit(1) host_name = result.group('host_name') - self.command('echo ' + self.EPCPassword + ' | sudo -S ./run_mme 2>&1 | stdbuf -o0 tee -a mme_' + SSH.testCase_id + '.log &', 'MME app initialization complete', 100) + self.command('echo ' + self.EPCPassword + ' | sudo -S ./run_mme 2>&1 | stdbuf -o0 tee -a mme_' + self.testCase_id + '.log &', 'MME app initialization complete', 100) else: self.command('cd /opt/ltebox/tools', '\$', 5) self.command('echo ' + self.EPCPassword + ' | sudo -S ./start_mme', '\$', 5) @@ -342,7 +348,7 @@ class SSHConnection(): self.command('cd ' + self.EPCSourceCodePath, '\$', 5) self.command('source oaienv', '\$', 5) self.command('cd scripts', '\$', 5) - self.command('echo ' + self.EPCPassword + ' | sudo -S ./run_spgw 2>&1 | stdbuf -o0 tee -a spgw_' + SSH.testCase_id + '.log &', 'Initializing SPGW-APP task interface: DONE', 30) + self.command('echo ' + self.EPCPassword + ' | sudo -S ./run_spgw 2>&1 | stdbuf -o0 tee -a spgw_' + self.testCase_id + '.log &', 'Initializing SPGW-APP task interface: DONE', 30) else: self.command('cd /opt/ltebox/tools', '\$', 5) self.command('echo ' + self.EPCPassword + ' | sudo -S ./start_xGw', '\$', 5) @@ -357,7 +363,7 @@ class SSHConnection(): pStatus = self.CheckProcessExist(initialize_eNB_flag) if (pStatus < 0): self.CreateHtmlTestRow(self.Initialize_eNB_args, 'KO', pStatus) - self.CreateHtmlFooter(False) + self.CreateHtmlTabFooter(False) sys.exit(1) # If tracer options is on, running tshark on EPC side and capture traffic b/ EPC and eNB result = re.search('T_stdout', str(self.Initialize_eNB_args)) @@ -368,8 +374,8 @@ class SSHConnection(): if result is not None: eth_interface = result.group('eth_interface') logging.debug('\u001B[1m Launching tshark on interface ' + eth_interface + '\u001B[0m') - self.command('echo ' + self.EPCPassword + ' | sudo -S rm -f /tmp/enb_' + SSH.testCase_id + '_s1log.pcap', '\$', 5) - self.command('echo $USER; nohup sudo tshark -f "host ' + self.eNBIPAddress +'" -i ' + eth_interface + ' -w /tmp/enb_' + SSH.testCase_id + '_s1log.pcap > /tmp/tshark.log 2>&1 &', self.EPCUserName, 5) + self.command('echo ' + self.EPCPassword + ' | sudo -S rm -f /tmp/enb_' + self.testCase_id + '_s1log.pcap', '\$', 5) + self.command('echo $USER; nohup sudo tshark -f "host ' + self.eNBIPAddress +'" -i ' + eth_interface + ' -w /tmp/enb_' + self.testCase_id + '_s1log.pcap > /tmp/tshark.log 2>&1 &', self.EPCUserName, 5) self.close() self.open(self.eNBIPAddress, self.eNBUserName, self.eNBPassword) self.command('cd ' + self.eNBSourceCodePath, '\$', 5) @@ -384,7 +390,7 @@ class SSHConnection(): logging.debug('\u001B[1m Compiling and launching T Tracer\u001B[0m') self.command('cd common/utils/T/tracer', '\$', 5) self.command('make', '\$', 10) - self.command('echo $USER; nohup ./record -d ../T_messages.txt -o ' + self.eNBSourceCodePath + '/cmake_targets/enb_' + SSH.testCase_id + '_record.raw -ON -off VCD -off HEAVY -off LEGACY_GROUP_TRACE -off LEGACY_GROUP_DEBUG > ' + self.eNBSourceCodePath + '/cmake_targets/enb_' + SSH.testCase_id + '_record.log 2>&1 &', self.eNBUserName, 5) + self.command('echo $USER; nohup ./record -d ../T_messages.txt -o ' + self.eNBSourceCodePath + '/cmake_targets/enb_' + self.testCase_id + '_record.raw -ON -off VCD -off HEAVY -off LEGACY_GROUP_TRACE -off LEGACY_GROUP_DEBUG > ' + self.eNBSourceCodePath + '/cmake_targets/enb_' + self.testCase_id + '_record.log 2>&1 &', self.eNBUserName, 5) self.command('cd ' + self.eNBSourceCodePath, '\$', 5) full_config_file = full_config_file[:extIdx + 5] config_path, config_file = os.path.split(full_config_file) @@ -402,12 +408,12 @@ class SSHConnection(): # Launch eNB with the modified config file self.command('source oaienv', '\$', 5) self.command('cd cmake_targets', '\$', 5) - self.command('echo "ulimit -c unlimited && ./lte_build_oai/build/lte-softmodem -O ' + self.eNBSourceCodePath + '/' + ci_full_config_file + extra_options + '" > ./my-lte-softmodem-run' + str(SSH.eNB_instance) + '.sh ', '\$', 5) - self.command('chmod 775 ./my-lte-softmodem-run' + str(SSH.eNB_instance) + '.sh ', '\$', 5) - self.command('echo ' + self.eNBPassword + ' | sudo -S rm -Rf enb_' + SSH.testCase_id + '.log', '\$', 5) - self.command('echo ' + self.eNBPassword + ' | sudo -S -E daemon --inherit --unsafe --name=enb' + str(SSH.eNB_instance) + '_daemon --chdir=' + self.eNBSourceCodePath + '/cmake_targets -o ' + self.eNBSourceCodePath + '/cmake_targets/enb_' + SSH.testCase_id + '.log ./my-lte-softmodem-run' + str(SSH.eNB_instance) + '.sh', '\$', 5) + self.command('echo "ulimit -c unlimited && ./lte_build_oai/build/lte-softmodem -O ' + self.eNBSourceCodePath + '/' + ci_full_config_file + extra_options + '" > ./my-lte-softmodem-run' + str(self.eNB_instance) + '.sh ', '\$', 5) + self.command('chmod 775 ./my-lte-softmodem-run' + str(self.eNB_instance) + '.sh ', '\$', 5) + self.command('echo ' + self.eNBPassword + ' | sudo -S rm -Rf enb_' + self.testCase_id + '.log', '\$', 5) + self.command('echo ' + self.eNBPassword + ' | sudo -S -E daemon --inherit --unsafe --name=enb' + str(self.eNB_instance) + '_daemon --chdir=' + self.eNBSourceCodePath + '/cmake_targets -o ' + self.eNBSourceCodePath + '/cmake_targets/enb_' + self.testCase_id + '.log ./my-lte-softmodem-run' + str(self.eNB_instance) + '.sh', '\$', 5) if not rruCheck: - self.eNBLogFile = 'enb_' + SSH.testCase_id + '.log' + self.eNBLogFile = 'enb_' + self.testCase_id + '.log' time.sleep(6) doLoop = True loopCounter = 10 @@ -422,7 +428,7 @@ class SSHConnection(): doLoop = False logging.error('\u001B[1;37;41m eNB logging system did not show got sync! \u001B[0m') self.CreateHtmlTestRow('-O ' + config_file + extra_options, 'KO', ALL_PROCESSES_OK) - self.CreateHtmlFooter(False) + self.CreateHtmlTabFooter(False) # In case of T tracer recording, we need to kill tshark on EPC side result = re.search('T_stdout', str(self.Initialize_eNB_args)) if result is not None: @@ -431,12 +437,12 @@ class SSHConnection(): self.command('echo ' + self.EPCPassword + ' | sudo -S killall --signal SIGKILL tshark', '\$', 5) self.close() time.sleep(1) - pcap_log_file = 'enb_' + SSH.testCase_id + '_s1log.pcap' + pcap_log_file = 'enb_' + self.testCase_id + '_s1log.pcap' self.copyin(self.EPCIPAddress, self.EPCUserName, self.EPCPassword, '/tmp/' + pcap_log_file, '.') self.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, pcap_log_file, self.eNBSourceCodePath + '/cmake_targets/.') sys.exit(1) else: - self.command('stdbuf -o0 cat enb_' + SSH.testCase_id + '.log | egrep --text --color=never -i "wait|sync"', '\$', 4) + self.command('stdbuf -o0 cat enb_' + self.testCase_id + '.log | egrep --text --color=never -i "wait|sync"', '\$', 4) if rruCheck: result = re.search('wait RUs', str(self.ssh.before)) else: @@ -472,7 +478,7 @@ class SSHConnection(): sys.exit('Insufficient Parameter') multi_jobs = [] for device_id in self.UEDevices: - p = Process(target = SSH.InitializeUE_common, args = (device_id,)) + p = Process(target = self.InitializeUE_common, args = (device_id,)) p.daemon = True p.start() multi_jobs.append(p) @@ -639,7 +645,7 @@ class SSHConnection(): if (pStatus < 0): self.CreateHtmlTestRow('N/A', 'KO', pStatus) self.AutoTerminateUEandeNB() - self.CreateHtmlFooter(False) + self.CreateHtmlTabFooter(False) sys.exit(1) multi_jobs = [] status_queue = SimpleQueue() @@ -647,7 +653,7 @@ class SSHConnection(): nb_ue_to_connect = 0 for device_id in self.UEDevices: if (self.nbMaxUEtoAttach == -1) or (nb_ue_to_connect < self.nbMaxUEtoAttach): - p = Process(target = SSH.AttachUE_common, args = (device_id, status_queue, lock,)) + p = Process(target = self.AttachUE_common, args = (device_id, status_queue, lock,)) p.daemon = True p.start() multi_jobs.append(p) @@ -657,7 +663,7 @@ class SSHConnection(): if (status_queue.empty()): self.CreateHtmlTestRow('N/A', 'KO', ALL_PROCESSES_OK) - self.CreateHtmlFooter(False) + self.CreateHtmlTabFooter(False) self.AutoTerminateUEandeNB() sys.exit(1) else: @@ -683,7 +689,7 @@ class SSHConnection(): else: self.CreateHtmlTestRowQueue('N/A', 'KO', len(self.UEDevices), html_queue) self.AutoTerminateUEandeNB() - self.CreateHtmlFooter(False) + self.CreateHtmlTabFooter(False) sys.exit(1) def DetachUE_common(self, device_id): @@ -704,11 +710,11 @@ class SSHConnection(): if (pStatus < 0): self.CreateHtmlTestRow('N/A', 'KO', pStatus) self.AutoTerminateUEandeNB() - self.CreateHtmlFooter(False) + self.CreateHtmlTabFooter(False) sys.exit(1) multi_jobs = [] for device_id in self.UEDevices: - p = Process(target = SSH.DetachUE_common, args = (device_id,)) + p = Process(target = self.DetachUE_common, args = (device_id,)) p.daemon = True p.start() multi_jobs.append(p) @@ -767,11 +773,11 @@ class SSHConnection(): pStatus = self.CheckProcessExist(initialize_eNB_flag) if (pStatus < 0): self.CreateHtmlTestRow('N/A', 'KO', pStatus) - self.CreateHtmlFooter(False) + self.CreateHtmlTabFooter(False) sys.exit(1) multi_jobs = [] for device_id in self.UEDevices: - p = Process(target = SSH.RebootUE_common, args = (device_id,)) + p = Process(target = self.RebootUE_common, args = (device_id,)) p.daemon = True p.start() multi_jobs.append(p) @@ -851,7 +857,7 @@ class SSHConnection(): self.command('cd ' + self.EPCSourceCodePath, '\$', 5) self.command('cd scripts', '\$', 5) ping_time = re.findall("-c (\d+)",str(self.ping_args)) - ping_status = self.command('stdbuf -o0 ping ' + self.ping_args + ' ' + UE_IPAddress + ' 2>&1 | stdbuf -o0 tee -a ping_' + SSH.testCase_id + '_' + device_id + '.log', '\$', int(ping_time[0])*1.5) + ping_status = self.command('stdbuf -o0 ping ' + self.ping_args + ' ' + UE_IPAddress + ' 2>&1 | stdbuf -o0 tee -a ping_' + self.testCase_id + '_' + device_id + '.log', '\$', int(ping_time[0])*1.5) # TIMEOUT CASE if ping_status < 0: message = 'Ping with UE (' + str(UE_IPAddress) + ') crashed due to TIMEOUT!' @@ -919,12 +925,12 @@ class SSHConnection(): pStatus = self.CheckProcessExist(initialize_eNB_flag) if (pStatus < 0): self.CreateHtmlTestRow(self.ping_args, 'KO', pStatus) - self.CreateHtmlFooter(False) + self.CreateHtmlTabFooter(False) sys.exit(1) ueIpStatus = self.GetAllUEIPAddresses() if (ueIpStatus < 0): self.CreateHtmlTestRow(self.ping_args, 'KO', UE_IP_ADDRESS_ISSUE) - self.CreateHtmlFooter(False) + self.CreateHtmlTabFooter(False) sys.exit(1) multi_jobs = [] i = 0 @@ -932,7 +938,7 @@ class SSHConnection(): status_queue = SimpleQueue() for UE_IPAddress in self.UEIPAddresses: device_id = self.UEDevices[i] - p = Process(target = SSH.Ping_common, args = (lock,UE_IPAddress,device_id,status_queue,)) + p = Process(target = self.Ping_common, args = (lock,UE_IPAddress,device_id,status_queue,)) p.daemon = True p.start() multi_jobs.append(p) @@ -943,7 +949,7 @@ class SSHConnection(): if (status_queue.empty()): self.CreateHtmlTestRow(self.ping_args, 'KO', ALL_PROCESSES_OK) self.AutoTerminateUEandeNB() - self.CreateHtmlFooter(False) + self.CreateHtmlTabFooter(False) sys.exit(1) else: ping_status = True @@ -962,7 +968,7 @@ class SSHConnection(): else: self.CreateHtmlTestRowQueue(self.ping_args, 'KO', len(self.UEDevices), html_queue) self.AutoTerminateUEandeNB() - self.CreateHtmlFooter(False) + self.CreateHtmlTabFooter(False) sys.exit(1) def Iperf_ComputeTime(self): @@ -978,11 +984,11 @@ class SSHConnection(): logging.debug('\u001B[1;37;41m Iperf bandwidth Not Found! \u001B[0m') sys.exit(1) iperf_bandwidth = result.group('iperf_bandwidth') - if SSH.iperf_profile == 'balanced': + if self.iperf_profile == 'balanced': iperf_bandwidth_new = float(iperf_bandwidth)/ue_num - if SSH.iperf_profile == 'single-ue': + if self.iperf_profile == 'single-ue': iperf_bandwidth_new = float(iperf_bandwidth) - if SSH.iperf_profile == 'unbalanced': + if self.iperf_profile == 'unbalanced': # residual is 2% of max bw residualBW = float(iperf_bandwidth) / 50 if idx == 0: @@ -998,7 +1004,7 @@ class SSHConnection(): return result def Iperf_analyzeV2TCPOutput(self, lock, UE_IPAddress, device_id, statusQueue, iperf_real_options): - self.command('awk -f /tmp/tcp_iperf_stats.awk /tmp/CI-eNB/scripts/iperf_' + SSH.testCase_id + '_' + device_id + '.log', '\$', 5) + self.command('awk -f /tmp/tcp_iperf_stats.awk /tmp/CI-eNB/scripts/iperf_' + self.testCase_id + '_' + device_id + '.log', '\$', 5) result = re.search('Avg Bitrate : (?P[0-9\.]+ Mbits\/sec) Max Bitrate : (?P[0-9\.]+ Mbits\/sec) Min Bitrate : (?P[0-9\.]+ Mbits\/sec)', str(self.ssh.before)) if result is not None: avgbitrate = result.group('average') @@ -1104,7 +1110,7 @@ class SSHConnection(): return 0 def Iperf_analyzeV2Server(self, lock, UE_IPAddress, device_id, statusQueue, iperf_real_options): - if (not os.path.isfile('iperf_server_' + SSH.testCase_id + '_' + device_id + '.log')): + if (not os.path.isfile('iperf_server_' + self.testCase_id + '_' + device_id + '.log')): self.ping_iperf_wrong_exit(lock, UE_IPAddress, device_id, statusQueue, 'Could not analyze from server log') return # Computing the requested bandwidth in float @@ -1129,7 +1135,7 @@ class SSHConnection(): req_bandwidth = '%.1f Gbits/sec' % req_bw req_bw = req_bw * 1000000000 - server_file = open('iperf_server_' + SSH.testCase_id + '_' + device_id + '.log', 'r') + server_file = open('iperf_server_' + self.testCase_id + '_' + device_id + '.log', 'r') br_sum = 0.0 ji_sum = 0.0 pl_sum = 0 @@ -1254,12 +1260,12 @@ class SSHConnection(): # Launch iperf server on EPC side self.open(self.EPCIPAddress, self.EPCUserName, self.EPCPassword) self.command('cd ' + self.EPCSourceCodePath + '/scripts', '\$', 5) - self.command('rm -f iperf_server_' + SSH.testCase_id + '_' + device_id + '.log', '\$', 5) + self.command('rm -f iperf_server_' + self.testCase_id + '_' + device_id + '.log', '\$', 5) port = 5001 + idx if udpIperf: - self.command('echo $USER; nohup iperf -u -s -i 1 -p ' + str(port) + ' > iperf_server_' + SSH.testCase_id + '_' + device_id + '.log &', self.EPCUserName, 5) + self.command('echo $USER; nohup iperf -u -s -i 1 -p ' + str(port) + ' > iperf_server_' + self.testCase_id + '_' + device_id + '.log &', self.EPCUserName, 5) else: - self.command('echo $USER; nohup iperf -s -i 1 -p ' + str(port) + ' > iperf_server_' + SSH.testCase_id + '_' + device_id + '.log &', self.EPCUserName, 5) + self.command('echo $USER; nohup iperf -s -i 1 -p ' + str(port) + ' > iperf_server_' + self.testCase_id + '_' + device_id + '.log &', self.EPCUserName, 5) time.sleep(0.5) self.close() @@ -1276,8 +1282,8 @@ class SSHConnection(): modified_options = modified_options.replace('-R','') time.sleep(0.5) - self.command('rm -f iperf_' + SSH.testCase_id + '_' + device_id + '.log', '\$', 5) - iperf_status = self.command('stdbuf -o0 adb -s ' + device_id + ' shell "/data/local/tmp/iperf -c ' + EPC_Iperf_UE_IPAddress + ' ' + modified_options + ' -p ' + str(port) + '" 2>&1 | stdbuf -o0 tee -a iperf_' + SSH.testCase_id + '_' + device_id + '.log', '\$', int(iperf_time)*5.0) + self.command('rm -f iperf_' + self.testCase_id + '_' + device_id + '.log', '\$', 5) + iperf_status = self.command('stdbuf -o0 adb -s ' + device_id + ' shell "/data/local/tmp/iperf -c ' + EPC_Iperf_UE_IPAddress + ' ' + modified_options + ' -p ' + str(port) + '" 2>&1 | stdbuf -o0 tee -a iperf_' + self.testCase_id + '_' + device_id + '.log', '\$', int(iperf_time)*5.0) # TIMEOUT Case if iperf_status < 0: self.close() @@ -1295,15 +1301,15 @@ class SSHConnection(): # in case of failure, retrieve server log if (clientStatus == -1): time.sleep(1) - if (os.path.isfile('iperf_server_' + SSH.testCase_id + '_' + device_id + '.log')): - os.remove('iperf_server_' + SSH.testCase_id + '_' + device_id + '.log') - self.copyin(self.EPCIPAddress, self.EPCUserName, self.EPCPassword, self.EPCSourceCodePath + '/scripts/iperf_server_' + SSH.testCase_id + '_' + device_id + '.log', '.') + if (os.path.isfile('iperf_server_' + self.testCase_id + '_' + device_id + '.log')): + os.remove('iperf_server_' + self.testCase_id + '_' + device_id + '.log') + self.copyin(self.EPCIPAddress, self.EPCUserName, self.EPCPassword, self.EPCSourceCodePath + '/scripts/iperf_server_' + self.testCase_id + '_' + device_id + '.log', '.') self.Iperf_analyzeV2Server(lock, UE_IPAddress, device_id, statusQueue, modified_options) def Iperf_common(self, lock, UE_IPAddress, device_id, idx, ue_num, statusQueue): try: # Single-UE profile -- iperf only on one UE - if SSH.iperf_profile == 'single-ue' and idx != 0: + if self.iperf_profile == 'single-ue' and idx != 0: return useIperf3 = False udpIperf = True @@ -1334,13 +1340,13 @@ class SSHConnection(): if (useIperf3): self.command('stdbuf -o0 adb -s ' + device_id + ' shell /data/local/tmp/iperf3 -s &', '\$', 5) else: - self.command('rm -f iperf_server_' + SSH.testCase_id + '_' + device_id + '.log', '\$', 5) + self.command('rm -f iperf_server_' + self.testCase_id + '_' + device_id + '.log', '\$', 5) result = re.search('-u', str(self.iperf_args)) if result is None: - self.command('echo $USER; nohup adb -s ' + device_id + ' shell "/data/local/tmp/iperf -s -i 1" > iperf_server_' + SSH.testCase_id + '_' + device_id + '.log &', self.ADBUserName, 5) + self.command('echo $USER; nohup adb -s ' + device_id + ' shell "/data/local/tmp/iperf -s -i 1" > iperf_server_' + self.testCase_id + '_' + device_id + '.log &', self.ADBUserName, 5) udpIperf = False else: - self.command('echo $USER; nohup adb -s ' + device_id + ' shell "/data/local/tmp/iperf -u -s -i 1" > iperf_server_' + SSH.testCase_id + '_' + device_id + '.log &', self.ADBUserName, 5) + self.command('echo $USER; nohup adb -s ' + device_id + ' shell "/data/local/tmp/iperf -u -s -i 1" > iperf_server_' + self.testCase_id + '_' + device_id + '.log &', self.ADBUserName, 5) time.sleep(0.5) self.close() @@ -1355,14 +1361,14 @@ class SSHConnection(): modified_options = str(self.iperf_args) time.sleep(0.5) - self.command('rm -f iperf_' + SSH.testCase_id + '_' + device_id + '.log', '\$', 5) + self.command('rm -f iperf_' + self.testCase_id + '_' + device_id + '.log', '\$', 5) if (useIperf3): - self.command('stdbuf -o0 iperf3 -c ' + UE_IPAddress + ' ' + modified_options + ' 2>&1 | stdbuf -o0 tee -a iperf_' + SSH.testCase_id + '_' + device_id + '.log', '\$', int(iperf_time)*5.0) + self.command('stdbuf -o0 iperf3 -c ' + UE_IPAddress + ' ' + modified_options + ' 2>&1 | stdbuf -o0 tee -a iperf_' + self.testCase_id + '_' + device_id + '.log', '\$', int(iperf_time)*5.0) clientStatus = 0 self.Iperf_analyzeV3Output(lock, UE_IPAddress, device_id, statusQueue) else: - iperf_status = self.command('stdbuf -o0 iperf -c ' + UE_IPAddress + ' ' + modified_options + ' 2>&1 | stdbuf -o0 tee -a iperf_' + SSH.testCase_id + '_' + device_id + '.log', '\$', int(iperf_time)*5.0) + iperf_status = self.command('stdbuf -o0 iperf -c ' + UE_IPAddress + ' ' + modified_options + ' 2>&1 | stdbuf -o0 tee -a iperf_' + self.testCase_id + '_' + device_id + '.log', '\$', int(iperf_time)*5.0) if iperf_status < 0: self.close() message = 'iperf on UE (' + str(UE_IPAddress) + ') crashed due to TIMEOUT !' @@ -1381,9 +1387,9 @@ class SSHConnection(): self.close() if (clientStatus == -1): time.sleep(1) - if (os.path.isfile('iperf_server_' + SSH.testCase_id + '_' + device_id + '.log')): - os.remove('iperf_server_' + SSH.testCase_id + '_' + device_id + '.log') - self.copyin(self.ADBIPAddress, self.ADBUserName, self.ADBPassword, self.EPCSourceCodePath + '/scripts/iperf_server_' + SSH.testCase_id + '_' + device_id + '.log', '.') + if (os.path.isfile('iperf_server_' + self.testCase_id + '_' + device_id + '.log')): + os.remove('iperf_server_' + self.testCase_id + '_' + device_id + '.log') + self.copyin(self.ADBIPAddress, self.ADBUserName, self.ADBPassword, self.EPCSourceCodePath + '/scripts/iperf_server_' + self.testCase_id + '_' + device_id + '.log', '.') self.Iperf_analyzeV2Server(lock, UE_IPAddress, device_id, statusQueue, modified_options) except: os.kill(os.getppid(),signal.SIGUSR1) @@ -1397,13 +1403,13 @@ class SSHConnection(): if (pStatus < 0): self.CreateHtmlTestRow(self.iperf_args, 'KO', pStatus) self.AutoTerminateUEandeNB() - self.CreateHtmlFooter(False) + self.CreateHtmlTabFooter(False) sys.exit(1) ueIpStatus = self.GetAllUEIPAddresses() if (ueIpStatus < 0): self.CreateHtmlTestRow(self.iperf_args, 'KO', UE_IP_ADDRESS_ISSUE) self.AutoTerminateUEandeNB() - self.CreateHtmlFooter(False) + self.CreateHtmlTabFooter(False) sys.exit(1) multi_jobs = [] i = 0 @@ -1423,7 +1429,7 @@ class SSHConnection(): if (status_queue.empty()): self.CreateHtmlTestRow(self.iperf_args, 'KO', ALL_PROCESSES_OK) self.AutoTerminateUEandeNB() - self.CreateHtmlFooter(False) + self.CreateHtmlTabFooter(False) sys.exit(1) else: iperf_status = True @@ -1447,7 +1453,7 @@ class SSHConnection(): else: self.CreateHtmlTestRowQueue(self.iperf_args, 'KO', len(self.UEDevices), html_queue) self.AutoTerminateUEandeNB() - self.CreateHtmlFooter(False) + self.CreateHtmlTabFooter(False) sys.exit(1) def CheckProcessExist(self, initialize_eNB_flag): @@ -1699,8 +1705,8 @@ class SSHConnection(): def TerminateeNB(self): self.open(self.eNBIPAddress, self.eNBUserName, self.eNBPassword) self.command('cd ' + self.eNBSourceCodePath + '/cmake_targets', '\$', 5) - self.command('echo ' + self.eNBPassword + ' | sudo -S daemon --name=enb' + str(SSH.eNB_instance) + '_daemon --stop', '\$', 5) - self.command('rm -f my-lte-softmodem-run' + str(SSH.eNB_instance) + '.sh', '\$', 5) + self.command('echo ' + self.eNBPassword + ' | sudo -S daemon --name=enb' + str(self.eNB_instance) + '_daemon --stop', '\$', 5) + self.command('rm -f my-lte-softmodem-run' + str(self.eNB_instance) + '.sh', '\$', 5) self.command('echo ' + self.eNBPassword + ' | sudo -S killall --signal SIGINT lte-softmodem || true', '\$', 5) time.sleep(5) self.command('stdbuf -o0 ps -aux | grep -v grep | grep lte-softmodem', '\$', 5) @@ -1744,7 +1750,7 @@ class SSHConnection(): logStatus = self.AnalyzeLogFile_eNB(self.eNBLogFile) if (logStatus < 0): self.CreateHtmlTestRow('N/A', 'KO', logStatus) - self.CreateHtmlFooter(False) + self.CreateHtmlTabFooter(False) sys.exit(1) else: self.CreateHtmlTestRow('N/A', 'OK', ALL_PROCESSES_OK) @@ -1818,7 +1824,7 @@ class SSHConnection(): def TerminateUE(self): terminate_ue_flag = True - SSH.GetAllUEDevices(terminate_ue_flag) + self.GetAllUEDevices(terminate_ue_flag) multi_jobs = [] for device_id in self.UEDevices: p = Process(target= SSH.TerminateUE_common, args = (device_id,)) @@ -1840,6 +1846,10 @@ class SSHConnection(): self.eNB_instance = '0' self.TerminateeNB() + def IdleSleep(self): + time.sleep(self.idle_sleep_time) + self.CreateHtmlTestRow(str(self.idle_sleep_time) + ' sec', 'OK', ALL_PROCESSES_OK) + def LogCollectBuild(self): self.open(self.eNBIPAddress, self.eNBUserName, self.eNBPassword) self.command('cd ' + self.eNBSourceCodePath, '\$', 5) @@ -1930,6 +1940,7 @@ class SSHConnection(): self.htmlFile.write(' Test Results for TEMPLATE_JOB_NAME job build #TEMPLATE_BUILD_ID\n') self.htmlFile.write('\n') self.htmlFile.write('
\n') + self.htmlFile.write('
\n') self.htmlFile.write(' \n') self.htmlFile.write(' \n') self.htmlFile.write(' \n') - self.htmlFile.write(' \n') - self.htmlFile.write(' \n') + self.htmlFile.write(' \n') + self.htmlFile.write(' \n') self.htmlFile.write(' \n') if (str(status) == 'OK'): self.htmlFile.write(' \n') @@ -2081,8 +2134,8 @@ class SSHConnection(): if ((not self.htmlFooterCreated) and (self.htmlHeaderCreated)): addOrangeBK = False self.htmlFile.write(' \n') - self.htmlFile.write(' \n') - self.htmlFile.write(' \n') + self.htmlFile.write(' \n') + self.htmlFile.write(' \n') self.htmlFile.write(' \n') if (str(status) == 'OK'): self.htmlFile.write(' \n') @@ -2126,6 +2179,7 @@ def Usage(): print(' --help Show this help.') print(' --mode=[Mode]') print(' TesteNB') + print(' InitiateHtml, FinalizeHtml') print(' TerminateeNB, TerminateUE, TerminateHSS, TerminateMME, TerminateSPGW') print(' LogCollectBuild, LogCollecteNB, LogCollectHSS, LogCollectMME, LogCollectSPGW, LogCollectPing, LogCollectIperf') print(' --eNBIPAddress=[eNB\'s IP Address]') @@ -2149,7 +2203,7 @@ def Usage(): print('------------------------------------------------------------') def CheckClassValidity(action,id): - if action != 'Build_eNB' and action != 'Initialize_eNB' and action != 'Terminate_eNB' and action != 'Initialize_UE' and action != 'Terminate_UE' and action != 'Attach_UE' and action != 'Detach_UE' and action != 'Ping' and action != 'Iperf' and action != 'Reboot_UE' and action != 'Initialize_HSS' and action != 'Terminate_HSS' and action != 'Initialize_MME' and action != 'Terminate_MME' and action != 'Initialize_SPGW' and action != 'Terminate_SPGW' and action != 'Initialize_CatM_module' and action != 'Terminate_CatM_module' and action != 'Attach_CatM_module' and action != 'Detach_CatM_module': + if action != 'Build_eNB' and action != 'Initialize_eNB' and action != 'Terminate_eNB' and action != 'Initialize_UE' and action != 'Terminate_UE' and action != 'Attach_UE' and action != 'Detach_UE' and action != 'Ping' and action != 'Iperf' and action != 'Reboot_UE' and action != 'Initialize_HSS' and action != 'Terminate_HSS' and action != 'Initialize_MME' and action != 'Terminate_MME' and action != 'Initialize_SPGW' and action != 'Terminate_SPGW' and action != 'Initialize_CatM_module' and action != 'Terminate_CatM_module' and action != 'Attach_CatM_module' and action != 'Detach_CatM_module' and action != 'IdleSleep': logging.debug('ERROR: test-case ' + id + ' has wrong class ' + action) return False return True @@ -2191,6 +2245,13 @@ def GetParametersFromXML(action): logging.debug('ERROR: test-case has wrong profile ' + SSH.iperf_profile) SSH.iperf_profile = 'balanced' + if action == 'IdleSleep': + string_field = test.findtext('idle_sleep_time_in_sec') + if (string_field is None): + SSH.idle_sleep_time = 5 + else: + SSH.idle_sleep_time = int(string_field) + #check if given test is in list #it is in list if one of the strings in 'list' is at the beginning of 'test' def test_in_list(test, list): @@ -2281,7 +2342,13 @@ while len(argvs) > 1: SSH.ADBPassword = matchReg.group(1) elif re.match('^\-\-XMLTestFile=(.+)$', myArgv, re.IGNORECASE): matchReg = re.match('^\-\-XMLTestFile=(.+)$', myArgv, re.IGNORECASE) - SSH.testXMLfile = matchReg.group(1) + SSH.testXMLfiles.append(matchReg.group(1)) + SSH.nbTestXMLfiles += 1 + elif re.match('^\-\-finalStatus=(.+)$', myArgv, re.IGNORECASE): + matchReg = re.match('^\-\-finalStatus=(.+)$', myArgv, re.IGNORECASE) + finalStatus = matchReg.group(1) + if ((finalStatus == 'true') or (finalStatus == 'True')): + SSH.finalStatus = True else: Usage() sys.exit('Invalid Parameter: ' + myArgv) @@ -2347,27 +2414,44 @@ elif re.match('^LogCollectIperf$', mode, re.IGNORECASE): Usage() sys.exit('Insufficient Parameter') SSH.LogCollectIperf() +elif re.match('^InitiateHtml$', mode, re.IGNORECASE): + if SSH.ADBIPAddress == '' or SSH.ADBUserName == '' or SSH.ADBPassword == '': + Usage() + sys.exit('Insufficient Parameter') + count = 0 + while (count < SSH.nbTestXMLfiles): + xml_test_file = sys.path[0] + "/" + SSH.testXMLfiles[count] + xmlTree = ET.parse(xml_test_file) + xmlRoot = xmlTree.getroot() + SSH.htmlTabRefs.append(xmlRoot.findtext('htmlTabRef',default='test-tab-' + str(count))) + SSH.htmlTabNames.append(xmlRoot.findtext('htmlTabName',default='Test-' + str(count))) + SSH.htmlTabIcons.append(xmlRoot.findtext('htmlTabIcon',default='info-sign')) + count += 1 + SSH.CreateHtmlHeader() +elif re.match('^FinalizeHtml$', mode, re.IGNORECASE): + SSH.CreateHtmlFooter(SSH.finalStatus) elif re.match('^TesteNB$', mode, re.IGNORECASE): if SSH.eNBIPAddress == '' or SSH.eNBRepository == '' or SSH.eNBBranch == '' or SSH.eNBUserName == '' or SSH.eNBPassword == '' or SSH.eNBSourceCodePath == '' or SSH.EPCIPAddress == '' or SSH.EPCUserName == '' or SSH.EPCPassword == '' or SSH.EPCType == '' or SSH.EPCSourceCodePath == '' or SSH.ADBIPAddress == '' or SSH.ADBUserName == '' or SSH.ADBPassword == '': Usage() sys.exit('Insufficient Parameter') - SSH.copyout(SSH.EPCIPAddress, SSH.EPCUserName, SSH.EPCPassword, sys.path[0] + "/tcp_iperf_stats.awk", "/tmp") - SSH.copyout(SSH.EPCIPAddress, SSH.EPCUserName, SSH.EPCPassword, sys.path[0] + "/active_net_interfaces.awk", "/tmp") - SSH.CreateHtmlHeader() - + if (SSH.EPCIPAddress != 'none'): + SSH.copyout(SSH.EPCIPAddress, SSH.EPCUserName, SSH.EPCPassword, sys.path[0] + "/tcp_iperf_stats.awk", "/tmp") + SSH.copyout(SSH.EPCIPAddress, SSH.EPCUserName, SSH.EPCPassword, sys.path[0] + "/active_net_interfaces.awk", "/tmp") #read test_case_list.xml file # if no parameters for XML file, use default value - if SSH.testXMLfile == '': + if (SSH.nbTestXMLfiles != 1): xml_test_file = sys.path[0] + "/test_case_list.xml" else: - xml_test_file = sys.path[0] + "/" + SSH.testXMLfile + xml_test_file = sys.path[0] + "/" + SSH.testXMLfiles[0] xmlTree = ET.parse(xml_test_file) xmlRoot = xmlTree.getroot() exclusion_tests=xmlRoot.findtext('TestCaseExclusionList',default='') requested_tests=xmlRoot.findtext('TestCaseRequestedList',default='') + if (SSH.nbTestXMLfiles == 1): + SSH.htmlTabRefs.append(xmlRoot.findtext('htmlTabRef',default='test-tab-0')) all_tests=xmlRoot.findall('testCase') exclusion_tests=exclusion_tests.split() @@ -2405,6 +2489,8 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE): signal.signal(signal.SIGUSR1, receive_signal) + SSH.CreateHtmlTabHeader() + for test_case_id in todo_tests: for test in all_tests: id = test.get('id') @@ -2460,10 +2546,12 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE): SSH.InitializeSPGW() elif action == 'Terminate_SPGW': SSH.TerminateSPGW() + elif action == 'IdleSleep': + SSH.IdleSleep() else: sys.exit('Invalid action') - SSH.CreateHtmlFooter(True) + SSH.CreateHtmlTabFooter(True) else: Usage() sys.exit('Invalid mode') diff --git a/ci-scripts/reportBuildLocally.sh b/ci-scripts/reportBuildLocally.sh index 634eac3adc..957eca4324 100755 --- a/ci-scripts/reportBuildLocally.sh +++ b/ci-scripts/reportBuildLocally.sh @@ -323,6 +323,7 @@ function report_build { echo " " >> ./build_results.html echo "" >> ./build_results.html echo "
" >> ./build_results.html + echo "
" >> ./build_results.html echo "
\n') @@ -1946,37 +1957,37 @@ class SSHConnection(): self.htmlFile.write('
\n') self.htmlFile.write(' \n') self.htmlFile.write(' \n') - self.htmlFile.write(' \n') + self.htmlFile.write(' \n') self.htmlFile.write(' \n') self.htmlFile.write(' \n') self.htmlFile.write(' \n') - self.htmlFile.write(' \n') - self.htmlFile.write(' \n') + self.htmlFile.write(' \n') + self.htmlFile.write(' \n') self.htmlFile.write(' \n') self.htmlFile.write(' \n') - self.htmlFile.write(' \n') - if (SSH.eNB_AllowMerge): + self.htmlFile.write(' \n') + if (self.eNB_AllowMerge): self.htmlFile.write(' \n') else: self.htmlFile.write(' \n') self.htmlFile.write(' \n') self.htmlFile.write(' \n') - if (SSH.eNB_AllowMerge): - self.htmlFile.write(' \n') + if (self.eNB_AllowMerge): + self.htmlFile.write(' \n') else: - self.htmlFile.write(' \n') - self.htmlFile.write(' \n') + self.htmlFile.write(' \n') + self.htmlFile.write(' \n') self.htmlFile.write(' \n') self.htmlFile.write(' \n') - if (SSH.eNB_AllowMerge): - self.htmlFile.write(' \n') + if (self.eNB_AllowMerge): + self.htmlFile.write(' \n') else: - self.htmlFile.write(' \n') - self.htmlFile.write(' \n') + self.htmlFile.write(' \n') + self.htmlFile.write(' \n') self.htmlFile.write(' \n') - if (SSH.eNB_AllowMerge): + if (self.eNB_AllowMerge): self.htmlFile.write(' \n') - self.htmlFile.write(' \n') + self.htmlFile.write(' \n') if (self.eNBTargetBranch == ''): self.htmlFile.write(' \n') else: @@ -1985,19 +1996,45 @@ class SSHConnection(): self.htmlFile.write('
Build Start Time (UTC) Build Start Time (UTC) TEMPLATE_BUILD_TIME
GIT Repository' + SSH.eNBRepository + ' GIT Repository ' + self.eNBRepository + '
Job Trigger Job Trigger Merge-RequestPush to Branch
Source Branch Source Branch Branch' + SSH.eNBBranch + ' Branch' + self.eNBBranch + '
Source Commit ID Source Commit ID Commit ID' + SSH.eNBCommitID + ' Commit ID ' + self.eNBCommitID + '
Target Branch Target Branch develop
\n') terminate_ue_flag = True - SSH.GetAllUEDevices(terminate_ue_flag) - SSH.GetAllCatMDevices(terminate_ue_flag) + if (self.ADBIPAddress != 'none'): + self.GetAllUEDevices(terminate_ue_flag) + self.GetAllCatMDevices(terminate_ue_flag) + else: + self.UEDevices.append('doughq9rehg') + self.UEDevices.append('dnsgiuahgia') + self.UEDevices.append('uehgieng9') self.htmlUEConnected = len(self.UEDevices) - self.htmlFile.write('

Jump to Final Status

\n') + self.htmlFile.write('

' + str(len(self.UEDevices)) + ' UE(s) is(are) connected to ADB bench server

\n') + self.htmlFile.write('

' + str(len(self.CatMDevices)) + ' CAT-M UE(s) is(are) connected to bench server

\n') self.htmlFile.write('
\n') + self.htmlFile.write(' \n') + self.htmlFile.write('
\n') + self.htmlFile.close() - self.htmlFile.write('

' + str(len(self.UEDevices)) + ' UE(s) is(are) connected to ADB bench server

\n') - self.htmlFile.write('

' + str(len(self.CatMDevices)) + ' CAT-M UE(s) is(are) connected to bench server

\n') - self.htmlFile.write('
\n') - - self.htmlFile.write('

Test Summary for ' + SSH.testXMLfile + '

\n') - self.htmlFile.write(' \n') + def CreateHtmlTabHeader(self): + if (not self.htmlHeaderCreated): + if (not os.path.isfile('test_results.html')): + self.CreateHtmlHeader() + self.htmlFile = open('test_results.html', 'a') + if (self.nbTestXMLfiles == 1): + self.htmlFile.write('
\n') + self.htmlFile.write('

Test Summary for ' + self.testXMLfiles[0] + '

\n') + else: + self.htmlFile.write('
\n') + self.htmlFile.write('
\n') self.htmlFile.write(' \n') self.htmlFile.write(' \n') self.htmlFile.write(' \n') @@ -2010,28 +2047,44 @@ class SSHConnection(): self.htmlFile.write(' \n') self.htmlHeaderCreated = True - def CreateHtmlFooter(self, passStatus): + def CreateHtmlTabFooter(self, passStatus): if ((not self.htmlFooterCreated) and (self.htmlHeaderCreated)): - self.htmlFile.write(' \n') - self.htmlFile.write(' \n') + self.htmlFile.write(' \n') + self.htmlFile.write(' \n') if passStatus: - self.htmlFile.write(' \n') + self.htmlFile.write(' \n') else: - self.htmlFile.write(' \n') + self.htmlFile.write(' \n') self.htmlFile.write(' \n') self.htmlFile.write('
Test IdTest Desc
Final StatusFinal Tab StatusPASSPASS FAILFAIL
\n') + self.htmlFile.write('
\n') + self.htmlFooterCreated = False + + def CreateHtmlFooter(self, passStatus): + if (os.path.isfile('test_results.html')): + self.htmlFile = open('test_results.html', 'a') + self.htmlFile.write('\n') + self.htmlFile.write('

\n') + self.htmlFile.write(' \n') + self.htmlFile.write(' \n') + self.htmlFile.write(' \n') + if passStatus: + self.htmlFile.write(' \n') + else: + self.htmlFile.write(' \n') + self.htmlFile.write(' \n') + self.htmlFile.write('
Final StatusPASS FAIL
\n') self.htmlFile.write('

\n') self.htmlFile.write('
End of Test Report -- Copyright 2018 OpenAirInterface. All Rights Reserved.
\n') self.htmlFile.write('\n') self.htmlFile.write('\n') self.htmlFile.close() - self.htmlFooterCreated = False def CreateHtmlTestRow(self, options, status, processesStatus): if ((not self.htmlFooterCreated) and (self.htmlHeaderCreated)): self.htmlFile.write('
' + SSH.testCase_id + '' + SSH.desc + '' + self.testCase_id + '' + self.desc + '' + str(options) + '' + str(status) + '
' + SSH.testCase_id + '' + SSH.desc + '' + self.testCase_id + '' + self.desc + '' + str(options) + '' + str(status) + '
" >> ./build_results.html echo " " >> ./build_results.html echo "
" >> ./build_results.html @@ -339,45 +340,45 @@ function report_build { echo "
" >> ./build_results.html echo " " >> ./build_results.html echo " " >> ./build_results.html - echo " " >> ./build_results.html + echo " " >> ./build_results.html echo " " >> ./build_results.html echo " " >> ./build_results.html echo " " >> ./build_results.html - echo " " >> ./build_results.html - echo " " >> ./build_results.html + echo " " >> ./build_results.html + echo " " >> ./test_simulator_results.html echo " " >> ./build_results.html echo " " >> ./build_results.html - echo " " >> ./build_results.html + echo " " >> ./build_results.html if [ $PU_TRIG -eq 1 ]; then echo " " >> ./build_results.html; fi if [ $MR_TRIG -eq 1 ]; then echo " " >> ./build_results.html; fi echo " " >> ./build_results.html if [ $PU_TRIG -eq 1 ] then echo " " >> ./build_results.html - echo " " >> ./build_results.html + echo " " >> ./build_results.html echo " " >> ./build_results.html echo " " >> ./build_results.html echo " " >> ./build_results.html - echo " " >> ./build_results.html + echo " " >> ./build_results.html echo " " >> ./build_results.html echo " " >> ./build_results.html fi if [ $MR_TRIG -eq 1 ] then echo " " >> ./build_results.html - echo " " >> ./build_results.html + echo " " >> ./build_results.html echo " " >> ./build_results.html echo " " >> ./build_results.html echo " " >> ./build_results.html - echo " " >> ./build_results.html + echo " " >> ./build_results.html echo " " >> ./build_results.html echo " " >> ./build_results.html echo " " >> ./build_results.html - echo " " >> ./build_results.html + echo " " >> ./build_results.html echo " " >> ./build_results.html echo " " >> ./build_results.html echo " " >> ./build_results.html - echo " " >> ./build_results.html + echo " " >> ./build_results.html echo " " >> ./build_results.html echo " " >> ./build_results.html fi diff --git a/ci-scripts/reportTestLocally.sh b/ci-scripts/reportTestLocally.sh index c6fef123d7..aae0df0d7d 100755 --- a/ci-scripts/reportTestLocally.sh +++ b/ci-scripts/reportTestLocally.sh @@ -100,6 +100,7 @@ function report_test { echo " " >> ./test_simulator_results.html echo "" >> ./test_simulator_results.html echo "
" >> ./test_simulator_results.html + echo "
" >> ./test_simulator_results.html echo "
Build Start Time (UTC) Build Start Time (UTC)TEMPLATE_BUILD_TIME
GIT Repository$GIT_URL GIT Repository$GIT_URL
Job Trigger Job TriggerPush EventMerge-Request
Branch Branch$SOURCE_BRANCH
Commit ID Commit ID$SOURCE_COMMIT_ID
Source Branch Source Branch$SOURCE_BRANCH
Source Commit ID Source Commit ID$SOURCE_COMMIT_ID
Target Branch Target Branch$TARGET_BRANCH
Target Commit ID Target Commit ID$TARGET_COMMIT_ID
" >> ./test_simulator_results.html echo " " >> ./test_simulator_results.html echo "
" >> ./test_simulator_results.html @@ -116,45 +117,45 @@ function report_test { echo "
" >> ./test_simulator_results.html echo " " >> ./test_simulator_results.html echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html echo " " >> ./test_simulator_results.html echo " " >> ./test_simulator_results.html echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html echo " " >> ./test_simulator_results.html echo " " >> ./test_simulator_results.html echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html if [ $PU_TRIG -eq 1 ]; then echo " " >> ./test_simulator_results.html; fi if [ $MR_TRIG -eq 1 ]; then echo " " >> ./test_simulator_results.html; fi echo " " >> ./test_simulator_results.html if [ $PU_TRIG -eq 1 ] then echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html echo " " >> ./test_simulator_results.html echo " " >> ./test_simulator_results.html echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html echo " " >> ./test_simulator_results.html echo " " >> ./test_simulator_results.html fi if [ $MR_TRIG -eq 1 ] then echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html echo " " >> ./test_simulator_results.html echo " " >> ./test_simulator_results.html echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html echo " " >> ./test_simulator_results.html echo " " >> ./test_simulator_results.html echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html echo " " >> ./test_simulator_results.html echo " " >> ./test_simulator_results.html echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html echo " " >> ./test_simulator_results.html echo " " >> ./test_simulator_results.html fi From 25b60e0c958a3a2380b21b56fbf9b5ad6b475974 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Thu, 13 Dec 2018 10:55:39 +0100 Subject: [PATCH 21/31] CI: missing detection of UE for TAB header Signed-off-by: Raphael Defosseux --- ci-scripts/main.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/ci-scripts/main.py b/ci-scripts/main.py index 849e50b076..d320f34117 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -110,7 +110,7 @@ class SSHConnection(): self.htmlFile = '' self.htmlHeaderCreated = False self.htmlFooterCreated = False - self.htmlUEConnected = 0 + self.htmlUEConnected = -1 self.htmleNBFailureMsg = '' self.picocom_closure = False self.idle_sleep_time = 0 @@ -2040,6 +2040,17 @@ class SSHConnection(): self.htmlFile.write(' \n') self.htmlFile.write(' \n') self.htmlFile.write(' \n') + if (self.htmlUEConnected == -1): + terminate_ue_flag = True + if (self.ADBIPAddress != 'none'): + self.GetAllUEDevices(terminate_ue_flag) + self.GetAllCatMDevices(terminate_ue_flag) + else: + self.UEDevices.append('doughq9rehg') + self.UEDevices.append('dnsgiuahgia') + self.UEDevices.append('uehgieng9') + self.htmlUEConnected = len(self.UEDevices) + i = 0 while (i < self.htmlUEConnected): self.htmlFile.write(' \n') From aacbd7577c58f7bbede6d2eef3d4fa58aad6fea5 Mon Sep 17 00:00:00 2001 From: Laurent Date: Thu, 13 Dec 2018 13:45:59 +0100 Subject: [PATCH 22/31] fix 381 --- cmake_targets/tools/build_helper | 2 +- targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index 551fc13593..010a310230 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -372,7 +372,7 @@ check_install_lmssdr_driver(){ else echo_error "lmssdr support implies installing lmssdr drivers and tools" \ " from sources. check:" - echo_info "https://open-cells.com/index.php/2017/05/10/limesdr-installation/" + echo_info "https://wiki.myriadrf.org/Lime_Suite" echo_fatal "Cannot compile lmssdr device" fi diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp index e1a1b768b2..1f0d78aba5 100644 --- a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp @@ -193,7 +193,7 @@ int trx_lms_start(openair0_device *device){ LMS_EnableChannel(lms_device,LMS_CH_RX,1,true); LMS_EnableChannel(lms_device,LMS_CH_TX,1,true); } */ - LMS_VCTCXOWrite(lms_device,129); + LMS_VCTCXOWrite(lms_device,129, true); if (LMS_SetSampleRate(lms_device,device->openair0_cfg->sample_rate,2)!=0) { From a12ccf1db3664ca4694f845359fe45aaa515bff5 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Thu, 13 Dec 2018 14:42:21 +0100 Subject: [PATCH 23/31] CI: splitting the IF4p5 FDD scenario into several files Signed-off-by: Raphael Defosseux --- ci-scripts/xml_files/if4p5_usrp210_band7.xml | 214 ------------------ .../xml_files/if4p5_usrp210_band7_build.xml | 55 +++++ .../if4p5_usrp210_band7_epc_closure.xml | 48 ++++ .../if4p5_usrp210_band7_test_05mhz.xml | 102 +++++++++ .../if4p5_usrp210_band7_test_10mhz.xml | 102 +++++++++ .../if4p5_usrp210_band7_test_20mhz.xml | 102 +++++++++ 6 files changed, 409 insertions(+), 214 deletions(-) delete mode 100644 ci-scripts/xml_files/if4p5_usrp210_band7.xml create mode 100644 ci-scripts/xml_files/if4p5_usrp210_band7_build.xml create mode 100644 ci-scripts/xml_files/if4p5_usrp210_band7_epc_closure.xml create mode 100644 ci-scripts/xml_files/if4p5_usrp210_band7_test_05mhz.xml create mode 100644 ci-scripts/xml_files/if4p5_usrp210_band7_test_10mhz.xml create mode 100644 ci-scripts/xml_files/if4p5_usrp210_band7_test_20mhz.xml diff --git a/ci-scripts/xml_files/if4p5_usrp210_band7.xml b/ci-scripts/xml_files/if4p5_usrp210_band7.xml deleted file mode 100644 index a582754229..0000000000 --- a/ci-scripts/xml_files/if4p5_usrp210_band7.xml +++ /dev/null @@ -1,214 +0,0 @@ - - - - 010101 - 050101 060101 070101 040101 - 030101 030102 040301 040501 040604 040642 040401 040201 030201 030202 - 030111 030112 040301 040511 040614 040652 040401 040201 030201 030202 - 030121 030122 040301 040521 040624 040662 040401 040201 030201 030202 - 050201 060201 070201 - - - - - - Build_eNB - Build eNB (USRP -- Ethernet Fronthaul) - -t ETHERNET -w USRP -c --eNB - - - - Initialize_eNB - Initialize RRU (FDD/Band7) - -O ci-scripts/conf_files/rru.fdd.band7.conf - 1 - - - - Initialize_eNB - Initialize RCC (FDD/Band7/5MHz) - -O ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.25PRB.usrpb210.conf - 0 - - - - Initialize_eNB - Initialize RRU (FDD/Band7) - -O ci-scripts/conf_files/rru.fdd.band7.conf - 1 - - - - Initialize_eNB - Initialize RCC (FDD/Band7/10MHz) - -O ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.50PRB.usrpb210.conf - 0 - - - - Initialize_eNB - Initialize RRU (FDD/Band7) - -O ci-scripts/conf_files/rru.fdd.band7.conf - 1 - - - - Initialize_eNB - Initialize RCC (FDD/Band7/20MHz) - -O ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.100PRB.usrpb210.conf - 0 - - - - Terminate_eNB - Terminate RCC - 0 - - - - Terminate_eNB - Terminate RRU - 1 - - - - Initialize_UE - Initialize UE - - - - Terminate_UE - Terminate UE - - - - Attach_UE - Attach UE - - - - Detach_UE - Detach UE - - - - Ping - ping (5MHz - 20 sec) - -c 20 - 5 - - - - Iperf - iperf (5MHz - DL/15Mbps/UDP)(30 sec)(single-ue profile) - -u -b 15M -t 30 -i 1 - 50 - single-ue - - - - Iperf - iperf (5MHz - UL/9Mbps/UDP)(30 sec)(single-ue profile) - -u -b 9M -t 30 -i 1 -R - 50 - single-ue - - - - Ping - ping (10MHz - 20 sec) - -c 20 - 5 - - - - Iperf - iperf (10MHz - DL/32Mbps/UDP)(30 sec)(single-ue profile) - -u -b 32M -t 30 -i 1 - 50 - single-ue - - - - Iperf - iperf (10MHz - UL/20Mbps/UDP)(30 sec)(single-ue profile) - -u -b 20M -t 30 -i 1 -R - 50 - single-ue - - - - Ping - ping (20MHz - 20 sec) - -c 20 - 5 - - - - Iperf - iperf (20MHz - DL/70Mbps/UDP)(30 sec)(single-ue profile) - -u -b 70M -t 30 -i 1 - 50 - single-ue - - - - Iperf - iperf (20MHz - UL/20Mbps/UDP)(30 sec)(single-ue profile) - -u -b 20M -t 30 -i 1 -R - 50 - single-ue - - - - Initialize_HSS - Initialize HSS - - - - Initialize_MME - Initialize MME - - - - Initialize_SPGW - Initialize SPGW - - - - Terminate_HSS - Terminate HSS - - - - Terminate_MME - Terminate MME - - - - Terminate_SPGW - Terminate SPGW - - - diff --git a/ci-scripts/xml_files/if4p5_usrp210_band7_build.xml b/ci-scripts/xml_files/if4p5_usrp210_band7_build.xml new file mode 100644 index 0000000000..d4714b0de2 --- /dev/null +++ b/ci-scripts/xml_files/if4p5_usrp210_band7_build.xml @@ -0,0 +1,55 @@ + + + build-tab + Build + wrench + + 010101 + 050101 060101 070101 040101 + + + + + + Build_eNB + Build eNB (USRP -- Ethernet Fronthaul) + -t ETHERNET -w USRP -c --eNB + + + + Initialize_HSS + Initialize HSS + + + + Initialize_MME + Initialize MME + + + + Initialize_SPGW + Initialize SPGW + + + diff --git a/ci-scripts/xml_files/if4p5_usrp210_band7_epc_closure.xml b/ci-scripts/xml_files/if4p5_usrp210_band7_epc_closure.xml new file mode 100644 index 0000000000..cde3581afa --- /dev/null +++ b/ci-scripts/xml_files/if4p5_usrp210_band7_epc_closure.xml @@ -0,0 +1,48 @@ + + + epc-closure + EPC-Closure + log-out + + 050201 060201 070201 + + + + + + Terminate_HSS + Terminate HSS + + + + Terminate_MME + Terminate MME + + + + Terminate_SPGW + Terminate SPGW + + + diff --git a/ci-scripts/xml_files/if4p5_usrp210_band7_test_05mhz.xml b/ci-scripts/xml_files/if4p5_usrp210_band7_test_05mhz.xml new file mode 100644 index 0000000000..fb6642dd0f --- /dev/null +++ b/ci-scripts/xml_files/if4p5_usrp210_band7_test_05mhz.xml @@ -0,0 +1,102 @@ + + + test-05 + Test-05MHz + tasks + + 030101 030102 040301 040501 040604 040642 040401 040201 030201 030202 + + + + + + Initialize_eNB + Initialize RRU (FDD/Band7) + -O ci-scripts/conf_files/rru.fdd.band7.conf + 1 + + + + Initialize_eNB + Initialize RCC (FDD/Band7/5MHz) + -O ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.25PRB.usrpb210.conf + 0 + + + + Terminate_eNB + Terminate RCC + 0 + + + + Terminate_eNB + Terminate RRU + 1 + + + + Initialize_UE + Initialize UE + + + + Terminate_UE + Terminate UE + + + + Attach_UE + Attach UE + + + + Detach_UE + Detach UE + + + + Ping + ping (5MHz - 20 sec) + -c 20 + 5 + + + + Iperf + iperf (5MHz - DL/15Mbps/UDP)(30 sec)(single-ue profile) + -u -b 15M -t 30 -i 1 + 50 + single-ue + + + + Iperf + iperf (5MHz - UL/9Mbps/UDP)(30 sec)(single-ue profile) + -u -b 9M -t 30 -i 1 -R + 50 + single-ue + + + diff --git a/ci-scripts/xml_files/if4p5_usrp210_band7_test_10mhz.xml b/ci-scripts/xml_files/if4p5_usrp210_band7_test_10mhz.xml new file mode 100644 index 0000000000..e3cf3ae41a --- /dev/null +++ b/ci-scripts/xml_files/if4p5_usrp210_band7_test_10mhz.xml @@ -0,0 +1,102 @@ + + + test-10 + Test-10MHz + tasks + + 030111 030112 040301 040511 040614 040652 040401 040201 030201 030202 + + + + + + Initialize_eNB + Initialize RRU (FDD/Band7) + -O ci-scripts/conf_files/rru.fdd.band7.conf + 1 + + + + Initialize_eNB + Initialize RCC (FDD/Band7/10MHz) + -O ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.50PRB.usrpb210.conf + 0 + + + + Terminate_eNB + Terminate RCC + 0 + + + + Terminate_eNB + Terminate RRU + 1 + + + + Initialize_UE + Initialize UE + + + + Terminate_UE + Terminate UE + + + + Attach_UE + Attach UE + + + + Detach_UE + Detach UE + + + + Ping + ping (10MHz - 20 sec) + -c 20 + 5 + + + + Iperf + iperf (10MHz - DL/32Mbps/UDP)(30 sec)(single-ue profile) + -u -b 32M -t 30 -i 1 + 50 + single-ue + + + + Iperf + iperf (10MHz - UL/20Mbps/UDP)(30 sec)(single-ue profile) + -u -b 20M -t 30 -i 1 -R + 50 + single-ue + + + diff --git a/ci-scripts/xml_files/if4p5_usrp210_band7_test_20mhz.xml b/ci-scripts/xml_files/if4p5_usrp210_band7_test_20mhz.xml new file mode 100644 index 0000000000..8e54c90c44 --- /dev/null +++ b/ci-scripts/xml_files/if4p5_usrp210_band7_test_20mhz.xml @@ -0,0 +1,102 @@ + + + test-20 + Test-20MHz + tasks + + 030121 030122 040301 040521 040624 040662 040401 040201 030201 030202 + + + + + + Initialize_eNB + Initialize RRU (FDD/Band7) + -O ci-scripts/conf_files/rru.fdd.band7.conf + 1 + + + + Initialize_eNB + Initialize RCC (FDD/Band7/20MHz) + -O ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.100PRB.usrpb210.conf + 0 + + + + Terminate_eNB + Terminate RCC + 0 + + + + Terminate_eNB + Terminate RRU + 1 + + + + Initialize_UE + Initialize UE + + + + Terminate_UE + Terminate UE + + + + Attach_UE + Attach UE + + + + Detach_UE + Detach UE + + + + Ping + ping (20MHz - 20 sec) + -c 20 + 5 + + + + Iperf + iperf (20MHz - DL/70Mbps/UDP)(30 sec)(single-ue profile) + -u -b 70M -t 30 -i 1 + 50 + single-ue + + + + Iperf + iperf (20MHz - UL/20Mbps/UDP)(30 sec)(single-ue profile) + -u -b 20M -t 30 -i 1 -R + 50 + single-ue + + + From d318ed26cd13ccfe355071b491108ddc883505e5 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Thu, 13 Dec 2018 16:07:59 +0100 Subject: [PATCH 24/31] CI: fixing the name of the tree icon Signed-off-by: Raphael Defosseux --- ci-scripts/main.py | 2 +- ci-scripts/reportBuildLocally.sh | 2 +- ci-scripts/reportTestLocally.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ci-scripts/main.py b/ci-scripts/main.py index d320f34117..9365d9a4b0 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -1975,7 +1975,7 @@ class SSHConnection(): if (self.eNB_AllowMerge): self.htmlFile.write(' \n') else: - self.htmlFile.write(' \n') + self.htmlFile.write(' \n') self.htmlFile.write(' \n') self.htmlFile.write(' \n') self.htmlFile.write(' \n') diff --git a/ci-scripts/reportBuildLocally.sh b/ci-scripts/reportBuildLocally.sh index 957eca4324..6526096d12 100755 --- a/ci-scripts/reportBuildLocally.sh +++ b/ci-scripts/reportBuildLocally.sh @@ -355,7 +355,7 @@ function report_build { if [ $PU_TRIG -eq 1 ] then echo " " >> ./build_results.html - echo " " >> ./build_results.html + echo " " >> ./build_results.html echo " " >> ./build_results.html echo " " >> ./build_results.html echo " " >> ./build_results.html diff --git a/ci-scripts/reportTestLocally.sh b/ci-scripts/reportTestLocally.sh index aae0df0d7d..60dcb1e421 100755 --- a/ci-scripts/reportTestLocally.sh +++ b/ci-scripts/reportTestLocally.sh @@ -132,7 +132,7 @@ function report_test { if [ $PU_TRIG -eq 1 ] then echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html + echo " " >> ./test_simulator_results.html echo " " >> ./test_simulator_results.html echo " " >> ./test_simulator_results.html echo " " >> ./test_simulator_results.html From df6cc9efc018961ae202fd2053c50590cff17883 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Fri, 14 Dec 2018 15:37:55 +0100 Subject: [PATCH 25/31] CI: splitting all xml scenarios Signed-off-by: Raphael Defosseux --- ci-scripts/Jenkinsfile-tmp-ran | 2 +- ci-scripts/main.py | 1 + .../xml_files/enb_usrp210_band40_build.xml | 54 +++ .../enb_usrp210_band40_epc_closure.xml | 47 +++ .../enb_usrp210_band40_test_05mhz_tm1.xml | 119 ++++++ .../enb_usrp210_band40_test_10mhz_tm1.xml | 119 ++++++ .../enb_usrp210_band40_test_20mhz_tm1.xml | 119 ++++++ .../xml_files/enb_usrp210_band40_tracer.xml | 65 ++++ ci-scripts/xml_files/enb_usrp210_band7.xml | 363 ------------------ .../xml_files/enb_usrp210_band7_build.xml | 54 +++ .../enb_usrp210_band7_epc_closure.xml | 47 +++ .../enb_usrp210_band7_test_05mhz_tm1.xml | 143 +++++++ .../enb_usrp210_band7_test_10mhz_tm1.xml | 143 +++++++ .../enb_usrp210_band7_test_20mhz_tm1.xml | 143 +++++++ .../xml_files/enb_usrp210_band7_tracer.xml | 65 ++++ ci-scripts/xml_files/enb_usrpb210_band40.xml | 239 ------------ ci-scripts/xml_files/if4p5_usrp210_band40.xml | 217 ----------- .../xml_files/if4p5_usrp210_band40_build.xml | 55 +++ .../if4p5_usrp210_band40_epc_closure.xml | 48 +++ .../if4p5_usrp210_band40_test_05mhz.xml | 103 +++++ .../if4p5_usrp210_band40_test_10mhz.xml | 103 +++++ .../if4p5_usrp210_band40_test_20mhz.xml | 103 +++++ .../xml_files/if4p5_usrp210_band7_build.xml | 6 +- .../if4p5_usrp210_band7_epc_closure.xml | 6 +- .../if4p5_usrp210_band7_test_05mhz.xml | 7 +- .../if4p5_usrp210_band7_test_10mhz.xml | 7 +- .../if4p5_usrp210_band7_test_20mhz.xml | 7 +- 27 files changed, 1550 insertions(+), 835 deletions(-) create mode 100644 ci-scripts/xml_files/enb_usrp210_band40_build.xml create mode 100644 ci-scripts/xml_files/enb_usrp210_band40_epc_closure.xml create mode 100644 ci-scripts/xml_files/enb_usrp210_band40_test_05mhz_tm1.xml create mode 100644 ci-scripts/xml_files/enb_usrp210_band40_test_10mhz_tm1.xml create mode 100644 ci-scripts/xml_files/enb_usrp210_band40_test_20mhz_tm1.xml create mode 100644 ci-scripts/xml_files/enb_usrp210_band40_tracer.xml delete mode 100644 ci-scripts/xml_files/enb_usrp210_band7.xml create mode 100644 ci-scripts/xml_files/enb_usrp210_band7_build.xml create mode 100644 ci-scripts/xml_files/enb_usrp210_band7_epc_closure.xml create mode 100644 ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml create mode 100644 ci-scripts/xml_files/enb_usrp210_band7_test_10mhz_tm1.xml create mode 100644 ci-scripts/xml_files/enb_usrp210_band7_test_20mhz_tm1.xml create mode 100644 ci-scripts/xml_files/enb_usrp210_band7_tracer.xml delete mode 100644 ci-scripts/xml_files/enb_usrpb210_band40.xml delete mode 100644 ci-scripts/xml_files/if4p5_usrp210_band40.xml create mode 100644 ci-scripts/xml_files/if4p5_usrp210_band40_build.xml create mode 100644 ci-scripts/xml_files/if4p5_usrp210_band40_epc_closure.xml create mode 100644 ci-scripts/xml_files/if4p5_usrp210_band40_test_05mhz.xml create mode 100644 ci-scripts/xml_files/if4p5_usrp210_band40_test_10mhz.xml create mode 100644 ci-scripts/xml_files/if4p5_usrp210_band40_test_20mhz.xml diff --git a/ci-scripts/Jenkinsfile-tmp-ran b/ci-scripts/Jenkinsfile-tmp-ran index fc01233bfb..547970e45e 100644 --- a/ci-scripts/Jenkinsfile-tmp-ran +++ b/ci-scripts/Jenkinsfile-tmp-ran @@ -350,7 +350,7 @@ pipeline { } if(fileExists("ci-scripts/test_results.html")) { sh "mv ci-scripts/test_results.html test_results-${JOB_NAME}.html" - sh "sed -i -e 's#TEMPLATE_JOB_NAME#${JOB_NAME}#' -e 's@build #TEMPLATE_BUILD_ID@build #${BUILD_ID}@' -e 's#Build-ID: TEMPLATE_BUILD_ID#Build-ID: ${BUILD_ID}#' test_results-${JOB_NAME}.html" + sh "sed -i -e 's#TEMPLATE_JOB_NAME#${JOB_NAME}#' -e 's@build #TEMPLATE_BUILD_ID@build #${BUILD_ID}@' -e 's#Build-ID: TEMPLATE_BUILD_ID#Build-ID: ${BUILD_ID}#' -e 's#TEMPLATE_STAGE_NAME#${testStageName}#' test_results-${JOB_NAME}.html" archiveArtifacts "test_results-${JOB_NAME}.html" } } diff --git a/ci-scripts/main.py b/ci-scripts/main.py index 9365d9a4b0..c5c30c8e20 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -1955,6 +1955,7 @@ class SSHConnection(): self.htmlFile.write(' \n') self.htmlFile.write('
Build Start Time (UTC) Build Start Time (UTC)TEMPLATE_BUILD_TIME
GIT Repository GIT Repository$GIT_URL
Job Trigger Job TriggerPush EventMerge-Request
Branch Branch$SOURCE_BRANCH
Commit ID Commit ID$SOURCE_COMMIT_ID
Source Branch Source Branch$SOURCE_BRANCH
Source Commit ID Source Commit ID$SOURCE_COMMIT_ID
Target Branch Target Branch$TARGET_BRANCH
Target Commit ID Target Commit ID$TARGET_COMMIT_ID
Test DescTest OptionsTest StatusUE' + str(i) + ' Status Source Branch Branch Branch' + self.eNBBranch + '
Branch Branch$SOURCE_BRANCH
Branch Branch$SOURCE_BRANCH
\n') self.htmlFile.write('
\n') + self.htmlFile.write('
TEMPLATE_STAGE_NAME
\n') self.htmlFile.write(' \n') self.htmlFile.write(' \n') self.htmlFile.write(' \n') diff --git a/ci-scripts/xml_files/enb_usrp210_band40_build.xml b/ci-scripts/xml_files/enb_usrp210_band40_build.xml new file mode 100644 index 0000000000..8f9489b03e --- /dev/null +++ b/ci-scripts/xml_files/enb_usrp210_band40_build.xml @@ -0,0 +1,54 @@ + + + build-tab + Build + wrench + + 010101 + 050101 060101 070101 + + + + + Build_eNB + Build eNB (USRP) + -w USRP -c --eNB + + + + Initialize_HSS + Initialize HSS + + + + Initialize_MME + Initialize MME + + + + Initialize_SPGW + Initialize SPGW + + + diff --git a/ci-scripts/xml_files/enb_usrp210_band40_epc_closure.xml b/ci-scripts/xml_files/enb_usrp210_band40_epc_closure.xml new file mode 100644 index 0000000000..ad34381a2a --- /dev/null +++ b/ci-scripts/xml_files/enb_usrp210_band40_epc_closure.xml @@ -0,0 +1,47 @@ + + + epc-closure + EPC-Closure + log-out + + 050201 060201 070201 + + + + + Terminate_HSS + Terminate HSS + + + + Terminate_MME + Terminate MME + + + + Terminate_SPGW + Terminate SPGW + + + diff --git a/ci-scripts/xml_files/enb_usrp210_band40_test_05mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band40_test_05mhz_tm1.xml new file mode 100644 index 0000000000..d5a25c7fa7 --- /dev/null +++ b/ci-scripts/xml_files/enb_usrp210_band40_test_05mhz_tm1.xml @@ -0,0 +1,119 @@ + + + test-05-tm1 + Test-05MHz-TM1 + tasks + + 040101 + 030104 040301 040501 040602 040601 040603 040642 040641 040643 040401 040201 030201 + + + + + Initialize_eNB + Initialize eNB (TDD/Band40/5MHz) + -O ci-scripts/conf_files/enb.band40.tm1.25PRB.FairScheduler.usrpb210.conf + + + + Terminate_eNB + Terminate eNB + + + + Initialize_UE + Initialize UE + + + + Terminate_UE + Terminate UE + + + + Attach_UE + Attach UE + + + + Detach_UE + Detach UE + + + + Ping + ping (5MHz - 20 sec) + -c 20 + 25 + + + + Iperf + iperf (5MHz - DL/6.5Mbps/UDP)(30 sec)(balanced) + -u -b 6.5M -t 30 -i 1 + 50 + balanced + + + + Iperf + iperf (5MHz - DL/6.5Mbps/UDP)(30 sec)(single-ue) + -u -b 6.5M -t 30 -i 1 + 50 + single-ue + + + + Iperf + iperf (5MHz - DL/6.5Mbps/UDP)(30 sec)(unbalanced) + -u -b 6.5M -t 30 -i 1 + 50 + unbalanced + + + + Iperf + iperf (5MHz - UL/2Mbps/UDP)(30 sec)(balanced) + -u -b 2M -t 30 -i 1 -R + 50 + balanced + + + + Iperf + iperf (5MHz - UL/2Mbps/UDP)(30 sec)(single-ue) + -u -b 2M -t 30 -i 1 -R + 50 + single-ue + + + + Iperf + iperf (5MHz - UL/2Mbps/UDP)(30 sec)(unbalanced) + -u -b 2M -t 30 -i 1 -R + 50 + unbalanced + + + diff --git a/ci-scripts/xml_files/enb_usrp210_band40_test_10mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band40_test_10mhz_tm1.xml new file mode 100644 index 0000000000..ef50933d4a --- /dev/null +++ b/ci-scripts/xml_files/enb_usrp210_band40_test_10mhz_tm1.xml @@ -0,0 +1,119 @@ + + + test-10-tm1 + Test-10MHz-TM1 + tasks + + 040101 + 030114 040301 040511 040612 040611 040613 040652 040651 040653 040401 040201 030201 + + + + + Initialize_eNB + Initialize eNB (TDD/Band40/10MHz/info) + -O ci-scripts/conf_files/enb.band40.tm1.50PRB.FairScheduler.usrpb210.conf + + + + Terminate_eNB + Terminate eNB + + + + Initialize_UE + Initialize UE + + + + Terminate_UE + Terminate UE + + + + Attach_UE + Attach UE + + + + Detach_UE + Detach UE + + + + Ping + ping (10MHz - 20 sec) + -c 20 + 25 + + + + Iperf + iperf (10MHz - DL/13.5Mbps/UDP)(30 sec)(balanced) + -u -b 13.5M -t 30 -i 1 + 50 + balanced + + + + Iperf + iperf (10MHz - DL/13.5Mbps/UDP)(30 sec)(single-ue) + -u -b 13.5M -t 30 -i 1 + 50 + single-ue + + + + Iperf + iperf (10MHz - DL/13.5Mbps/UDP)(30 sec)(unbalanced) + -u -b 13.5M -t 30 -i 1 + 50 + unbalanced + + + + Iperf + iperf (10MHz - UL/2Mbps/UDP)(30 sec)(balanced) + -u -b 2M -t 30 -i 1 -R + 50 + balanced + + + + Iperf + iperf (10MHz - UL/2Mbps/UDP)(30 sec)(single-ue) + -u -b 2M -t 30 -i 1 -R + 50 + single-ue + + + + Iperf + iperf (10MHz - UL/2Mbps/UDP)(30 sec)(unbalanced) + -u -b 2M -t 30 -i 1 -R + 50 + unbalanced + + + diff --git a/ci-scripts/xml_files/enb_usrp210_band40_test_20mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band40_test_20mhz_tm1.xml new file mode 100644 index 0000000000..9a96baac3f --- /dev/null +++ b/ci-scripts/xml_files/enb_usrp210_band40_test_20mhz_tm1.xml @@ -0,0 +1,119 @@ + + + test-20-tm1 + Test-20MHz-TM1 + tasks + + 040101 + 030124 040301 040521 040622 040621 040623 040662 040661 040663 040401 040201 030201 + + + + + Initialize_eNB + Initialize eNB (TDD/Band40/20MHz/info) + -O ci-scripts/conf_files/enb.band40.tm1.100PRB.FairScheduler.usrpb210.conf + + + + Terminate_eNB + Terminate eNB + + + + Initialize_UE + Initialize UE + + + + Terminate_UE + Terminate UE + + + + Attach_UE + Attach UE + + + + Detach_UE + Detach UE + + + + Ping + ping (20MHz - 20 sec) + -c 20 + 25 + + + + Iperf + iperf (20MHz - DL/13.5Mbps/UDP)(30 sec)(balanced) + -u -b 13.5M -t 30 -i 1 + 50 + balanced + + + + Iperf + iperf (20MHz - DL/13.5Mbps/UDP)(30 sec)(single-ue) + -u -b 13.5M -t 30 -i 1 + 50 + single-ue + + + + Iperf + iperf (20MHz - DL/13.5Mbps/UDP)(30 sec)(unbalanced) + -u -b 13.5M -t 30 -i 1 + 50 + unbalanced + + + + Iperf + iperf (20MHz - UL/2Mbps/UDP)(30 sec)(balanced) + -u -b 2M -t 30 -i 1 -R + 50 + balanced + + + + Iperf + iperf (20MHz - UL/2Mbps/UDP)(30 sec)(single-ue) + -u -b 2M -t 30 -i 1 -R + 50 + single-ue + + + + Iperf + iperf (20MHz - UL/2Mbps/UDP)(30 sec)(unbalanced) + -u -b 2M -t 30 -i 1 -R + 50 + unbalanced + + + diff --git a/ci-scripts/xml_files/enb_usrp210_band40_tracer.xml b/ci-scripts/xml_files/enb_usrp210_band40_tracer.xml new file mode 100644 index 0000000000..dceb6be97a --- /dev/null +++ b/ci-scripts/xml_files/enb_usrp210_band40_tracer.xml @@ -0,0 +1,65 @@ + + + tracer-test + T-Tracer + duplicate + + 040101 + 030100 040300 040401 040201 030201 + + + + + Initialize_eNB + Initialize eNB (TDD/Band40/5MHz) with T Tracer on + -O ci-scripts/conf_files/enb.band40.tm1.25PRB.FairScheduler.usrpb210.conf --T_stdout 0 + + + + Terminate_eNB + Terminate eNB + + + + Initialize_UE + Initialize UE + + + + Terminate_UE + Terminate UE + + + + Attach_UE + Attach single UE + 1 + + + + Detach_UE + Detach UE + + + diff --git a/ci-scripts/xml_files/enb_usrp210_band7.xml b/ci-scripts/xml_files/enb_usrp210_band7.xml deleted file mode 100644 index c85ceee81d..0000000000 --- a/ci-scripts/xml_files/enb_usrp210_band7.xml +++ /dev/null @@ -1,363 +0,0 @@ - - - - 010101 - 050101 060101 070101 040101 - 030100 040300 040401 040201 030201 - 030101 040301 040501 040603 040604 040605 040606 040607 040641 040642 040643 040644 040401 040201 030201 - 030111 040301 040511 040613 040614 040615 040616 040617 040651 040652 040653 040654 040401 040201 030201 - 030121 040301 040521 040623 040624 040625 040626 040627 040662 040661 040663 040664 040401 040201 030201 - 050201 060201 070201 - - - - - Build_eNB - Build eNB (USRP) - -w USRP -c --eNB - - - - Initialize_eNB - Initialize eNB (FDD/Band7/5MHz) with T Tracer on - -O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf --T_stdout 0 - - - - Initialize_eNB - Initialize eNB (FDD/Band7/5MHz) - -O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf - - - - Initialize_eNB - Initialize eNB (FDD/Band7/10MHz) - -O ci-scripts/conf_files/enb.band7.tm1.50PRB.usrpb210.conf - - - - Initialize_eNB - Initialize eNB (FDD/Band7/20MHz) - -O ci-scripts/conf_files/enb.band7.tm1.100PRB.usrpb210.conf - - - - Terminate_eNB - Terminate eNB - - - - Initialize_UE - Initialize UE - - - - Terminate_UE - Terminate UE - - - - Attach_UE - Attach single UE - 1 - - - - Attach_UE - Attach UE - - - - Detach_UE - Detach UE - - - - Ping - ping (5MHz - 20 sec) - -c 20 - 5 - - - - Ping - ping (10MHz - 20 sec) - -c 20 - 5 - - - - Ping - ping (20MHz - 20 sec) - -c 20 - 5 - - - - Iperf - iperf (5MHz - DL/15Mbps/UDP)(30 sec)(balanced profile) - -u -b 15M -t 30 -i 1 - 50 - balanced - - - - Iperf - iperf (5MHz - DL/15Mbps/UDP)(30 sec)(single-ue profile) - -u -b 15M -t 30 -i 1 - 50 - single-ue - - - - Iperf - iperf (5MHz - DL/15Mbps/UDP)(30 sec)(unbalanced profile) - -u -b 15M -t 30 -i 1 - 50 - unbalanced - - - - Iperf - iperf (5MHz - DL/TCP)(30 sec)(single-ue profile) - -t 30 -i 1 -fm - 50 - single-ue - - - - Iperf - iperf (5MHz - DL/TCP)(30 sec)(balanced profile) - -t 30 -i 1 -fm - 50 - balanced - - - - Iperf - iperf (5MHz - UL/9Mbps/UDP)(30 sec)(balanced profile) - -u -b 9M -t 30 -i 1 -R - 50 - balanced - - - - Iperf - iperf (5MHz - UL/9Mbps/UDP)(30 sec)(single-ue profile) - -u -b 9M -t 30 -i 1 -R - 50 - single-ue - - - - Iperf - iperf (5MHz - UL/TCP)(30 sec)(single-ue profile) - -t 30 -i 1 -fm -R - 50 - single-ue - - - - Iperf - iperf (5MHz - UL/TCP)(30 sec)(balanced profile) - -t 30 -i 1 -fm -R - 50 - balanced - - - - Iperf - iperf (10MHz - DL/30Mbps/UDP)(30 sec)(balanced profile) - -u -b 30M -t 30 -i 1 - 50 - balanced - - - - Iperf - iperf (10MHz - DL/30Mbps/UDP)(30 sec)(single-ue profile) - -u -b 30M -t 30 -i 1 - 50 - single-ue - - - - Iperf - iperf (10MHz - DL/30Mbps/UDP)(30 sec)(unbalanced profile) - -u -b 30M -t 30 -i 1 - 50 - unbalanced - - - - Iperf - iperf (10MHz - DL/TCP)(30 sec)(single-ue profile) - -t 30 -i 1 -fm - 50 - single-ue - - - - Iperf - iperf (10MHz - DL/TCP)(30 sec)(balanced profile) - -t 30 -i 1 -fm - 50 - balanced - - - - Iperf - iperf (10MHz - UL/20Mbps/UDP)(30 sec)(balanced profile) - -u -b 20M -t 30 -i 1 -R - 50 - balanced - - - - Iperf - iperf (10MHz - UL/20Mbps/UDP)(30 sec)(single-ue profile) - -u -b 20M -t 30 -i 1 -R - 50 - single-ue - - - - Iperf - iperf (10MHz - UL/TCP)(30 sec)(single-ue profile) - -t 30 -i 1 -fm -R - 50 - single-ue - - - - Iperf - iperf (10MHz - UL/TCP)(30 sec)(balanced profile) - -t 30 -i 1 -fm -R - 50 - balanced - - - - Iperf - iperf (20MHz - DL/70Mbps/UDP)(30 sec)(balanced profile) - -u -b 70M -t 30 -i 1 - 50 - balanced - - - - Iperf - iperf (20MHz - DL/70Mbps/UDP)(30 sec)(single-ue profile) - -u -b 70M -t 30 -i 1 - 50 - single-ue - - - - Iperf - iperf (20MHz - DL/70Mbps/UDP)(30 sec)(unbalanced profile) - -u -b 70M -t 30 -i 1 - 50 - unbalanced - - - - Iperf - iperf (20MHz - DL/TCP)(30 sec)(single-ue profile) - -t 30 -i 1 -fm - 50 - single-ue - - - - Iperf - iperf (20MHz - DL/TCP)(30 sec)(balanced profile) - -t 30 -i 1 -fm - 50 - balanced - - - - Iperf - iperf (20MHz - UL/20Mbps/UDP)(30 sec)(balanced profile) - -u -b 20M -t 30 -i 1 -R - 50 - balanced - - - - Iperf - iperf (20MHz - UL/20Mbps/UDP)(30 sec)(single-ue profile) - -u -b 20M -t 30 -i 1 -R - 50 - single-ue - - - - Iperf - iperf (20MHz - UL/TCP)(30 sec)(single-ue profile) - -t 30 -i 1 -fm -R - 50 - single-ue - - - - Iperf - iperf (20MHz - UL/TCP)(30 sec)(balanced profile) - -t 30 -i 1 -fm -R - 50 - balanced - - - - Initialize_HSS - Initialize HSS - - - - Initialize_MME - Initialize MME - - - - Initialize_SPGW - Initialize SPGW - - - - Terminate_HSS - Terminate HSS - - - - Terminate_MME - Terminate MME - - - - Terminate_SPGW - Terminate SPGW - - - diff --git a/ci-scripts/xml_files/enb_usrp210_band7_build.xml b/ci-scripts/xml_files/enb_usrp210_band7_build.xml new file mode 100644 index 0000000000..31ee57e941 --- /dev/null +++ b/ci-scripts/xml_files/enb_usrp210_band7_build.xml @@ -0,0 +1,54 @@ + + + build-tab + Build + wrench + + 010101 + 050101 060101 070101 + + + + + Build_eNB + Build eNB (USRP) + -w USRP -c --eNB + + + + Initialize_HSS + Initialize HSS + + + + Initialize_MME + Initialize MME + + + + Initialize_SPGW + Initialize SPGW + + + diff --git a/ci-scripts/xml_files/enb_usrp210_band7_epc_closure.xml b/ci-scripts/xml_files/enb_usrp210_band7_epc_closure.xml new file mode 100644 index 0000000000..07fb6951f8 --- /dev/null +++ b/ci-scripts/xml_files/enb_usrp210_band7_epc_closure.xml @@ -0,0 +1,47 @@ + + + epc-closure + EPC-Closure + log-out + + 050201 060201 070201 + + + + + Terminate_HSS + Terminate HSS + + + + Terminate_MME + Terminate MME + + + + Terminate_SPGW + Terminate SPGW + + + diff --git a/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml new file mode 100644 index 0000000000..0057eaefa4 --- /dev/null +++ b/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml @@ -0,0 +1,143 @@ + + + test-05-tm1 + Test-05MHz-TM1 + tasks + + 040101 + 030101 040301 040501 040603 040604 040605 040606 040607 040641 040642 040643 040644 040401 040201 030201 + + + + + Initialize_eNB + Initialize eNB (FDD/Band7/5MHz) + -O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf + + + + Terminate_eNB + Terminate eNB + + + + Initialize_UE + Initialize UE + + + + Terminate_UE + Terminate UE + + + + Attach_UE + Attach UE + + + + Detach_UE + Detach UE + + + + Ping + ping (5MHz - 20 sec) + -c 20 + 5 + + + + Iperf + iperf (5MHz - DL/15Mbps/UDP)(30 sec)(balanced profile) + -u -b 15M -t 30 -i 1 + 50 + balanced + + + + Iperf + iperf (5MHz - DL/15Mbps/UDP)(30 sec)(single-ue profile) + -u -b 15M -t 30 -i 1 + 50 + single-ue + + + + Iperf + iperf (5MHz - DL/15Mbps/UDP)(30 sec)(unbalanced profile) + -u -b 15M -t 30 -i 1 + 50 + unbalanced + + + + Iperf + iperf (5MHz - DL/TCP)(30 sec)(single-ue profile) + -t 30 -i 1 -fm + 50 + single-ue + + + + Iperf + iperf (5MHz - DL/TCP)(30 sec)(balanced profile) + -t 30 -i 1 -fm + 50 + balanced + + + + Iperf + iperf (5MHz - UL/9Mbps/UDP)(30 sec)(balanced profile) + -u -b 9M -t 30 -i 1 -R + 50 + balanced + + + + Iperf + iperf (5MHz - UL/9Mbps/UDP)(30 sec)(single-ue profile) + -u -b 9M -t 30 -i 1 -R + 50 + single-ue + + + + Iperf + iperf (5MHz - UL/TCP)(30 sec)(single-ue profile) + -t 30 -i 1 -fm -R + 50 + single-ue + + + + Iperf + iperf (5MHz - UL/TCP)(30 sec)(balanced profile) + -t 30 -i 1 -fm -R + 50 + balanced + + + diff --git a/ci-scripts/xml_files/enb_usrp210_band7_test_10mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band7_test_10mhz_tm1.xml new file mode 100644 index 0000000000..92ec1efa6e --- /dev/null +++ b/ci-scripts/xml_files/enb_usrp210_band7_test_10mhz_tm1.xml @@ -0,0 +1,143 @@ + + + test-10-tm1 + Test-10MHz-TM1 + tasks + + 040101 + 030111 040301 040511 040613 040614 040615 040616 040617 040651 040652 040653 040654 040401 040201 030201 + + + + + Initialize_eNB + Initialize eNB (FDD/Band7/10MHz) + -O ci-scripts/conf_files/enb.band7.tm1.50PRB.usrpb210.conf + + + + Terminate_eNB + Terminate eNB + + + + Initialize_UE + Initialize UE + + + + Terminate_UE + Terminate UE + + + + Attach_UE + Attach UE + + + + Detach_UE + Detach UE + + + + Ping + ping (10MHz - 20 sec) + -c 20 + 5 + + + + Iperf + iperf (10MHz - DL/30Mbps/UDP)(30 sec)(balanced profile) + -u -b 30M -t 30 -i 1 + 50 + balanced + + + + Iperf + iperf (10MHz - DL/30Mbps/UDP)(30 sec)(single-ue profile) + -u -b 30M -t 30 -i 1 + 50 + single-ue + + + + Iperf + iperf (10MHz - DL/30Mbps/UDP)(30 sec)(unbalanced profile) + -u -b 30M -t 30 -i 1 + 50 + unbalanced + + + + Iperf + iperf (10MHz - DL/TCP)(30 sec)(single-ue profile) + -t 30 -i 1 -fm + 50 + single-ue + + + + Iperf + iperf (10MHz - DL/TCP)(30 sec)(balanced profile) + -t 30 -i 1 -fm + 50 + balanced + + + + Iperf + iperf (10MHz - UL/20Mbps/UDP)(30 sec)(balanced profile) + -u -b 20M -t 30 -i 1 -R + 50 + balanced + + + + Iperf + iperf (10MHz - UL/20Mbps/UDP)(30 sec)(single-ue profile) + -u -b 20M -t 30 -i 1 -R + 50 + single-ue + + + + Iperf + iperf (10MHz - UL/TCP)(30 sec)(single-ue profile) + -t 30 -i 1 -fm -R + 50 + single-ue + + + + Iperf + iperf (10MHz - UL/TCP)(30 sec)(balanced profile) + -t 30 -i 1 -fm -R + 50 + balanced + + + diff --git a/ci-scripts/xml_files/enb_usrp210_band7_test_20mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band7_test_20mhz_tm1.xml new file mode 100644 index 0000000000..68b3829682 --- /dev/null +++ b/ci-scripts/xml_files/enb_usrp210_band7_test_20mhz_tm1.xml @@ -0,0 +1,143 @@ + + + test-20-tm1 + Test-20MHz-TM1 + tasks + + 040101 + 030121 040301 040521 040623 040624 040625 040626 040627 040662 040661 040663 040664 040401 040201 030201 + + + + + Initialize_eNB + Initialize eNB (FDD/Band7/20MHz) + -O ci-scripts/conf_files/enb.band7.tm1.100PRB.usrpb210.conf + + + + Terminate_eNB + Terminate eNB + + + + Initialize_UE + Initialize UE + + + + Terminate_UE + Terminate UE + + + + Attach_UE + Attach UE + + + + Detach_UE + Detach UE + + + + Ping + ping (20MHz - 20 sec) + -c 20 + 5 + + + + Iperf + iperf (20MHz - DL/70Mbps/UDP)(30 sec)(balanced profile) + -u -b 70M -t 30 -i 1 + 50 + balanced + + + + Iperf + iperf (20MHz - DL/70Mbps/UDP)(30 sec)(single-ue profile) + -u -b 70M -t 30 -i 1 + 50 + single-ue + + + + Iperf + iperf (20MHz - DL/70Mbps/UDP)(30 sec)(unbalanced profile) + -u -b 70M -t 30 -i 1 + 50 + unbalanced + + + + Iperf + iperf (20MHz - DL/TCP)(30 sec)(single-ue profile) + -t 30 -i 1 -fm + 50 + single-ue + + + + Iperf + iperf (20MHz - DL/TCP)(30 sec)(balanced profile) + -t 30 -i 1 -fm + 50 + balanced + + + + Iperf + iperf (20MHz - UL/20Mbps/UDP)(30 sec)(balanced profile) + -u -b 20M -t 30 -i 1 -R + 50 + balanced + + + + Iperf + iperf (20MHz - UL/20Mbps/UDP)(30 sec)(single-ue profile) + -u -b 20M -t 30 -i 1 -R + 50 + single-ue + + + + Iperf + iperf (20MHz - UL/TCP)(30 sec)(single-ue profile) + -t 30 -i 1 -fm -R + 50 + single-ue + + + + Iperf + iperf (20MHz - UL/TCP)(30 sec)(balanced profile) + -t 30 -i 1 -fm -R + 50 + balanced + + + diff --git a/ci-scripts/xml_files/enb_usrp210_band7_tracer.xml b/ci-scripts/xml_files/enb_usrp210_band7_tracer.xml new file mode 100644 index 0000000000..4c74f52b0f --- /dev/null +++ b/ci-scripts/xml_files/enb_usrp210_band7_tracer.xml @@ -0,0 +1,65 @@ + + + tracer-test + T-Tracer + duplicate + + 040101 + 030100 040300 040401 040201 030201 + + + + + Initialize_eNB + Initialize eNB (FDD/Band7/5MHz) with T Tracer on + -O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf --T_stdout 0 + + + + Terminate_eNB + Terminate eNB + + + + Initialize_UE + Initialize UE + + + + Terminate_UE + Terminate UE + + + + Attach_UE + Attach single UE + 1 + + + + Detach_UE + Detach UE + + + diff --git a/ci-scripts/xml_files/enb_usrpb210_band40.xml b/ci-scripts/xml_files/enb_usrpb210_band40.xml deleted file mode 100644 index 65492c4209..0000000000 --- a/ci-scripts/xml_files/enb_usrpb210_band40.xml +++ /dev/null @@ -1,239 +0,0 @@ - - - - 010101 - 050101 060101 070101 040101 - 030100 040300 040401 040201 030201 - 030104 040301 040501 040602 040601 040603 040642 040641 040643 040401 040201 030201 - 030114 040301 040511 040612 040611 040613 040652 040651 040653 040401 040201 030201 - 050201 060201 070201 - - - - - - - Build_eNB - Build eNB (USRP) - -w USRP -c --eNB - - - - Initialize_eNB - Initialize eNB (TDD/Band40/5MHz) with T Tracer on - -O ci-scripts/conf_files/enb.band40.tm1.25PRB.FairScheduler.usrpb210.conf --T_stdout 0 - - - - Initialize_eNB - Initialize eNB (TDD/Band40/5MHz) - -O ci-scripts/conf_files/enb.band40.tm1.25PRB.FairScheduler.usrpb210.conf - - - - Initialize_eNB - Initialize eNB (TDD/Band40/10MHz/info) - -O ci-scripts/conf_files/enb.band40.tm1.50PRB.FairScheduler.usrpb210.conf - - - - Initialize_eNB - Initialize eNB (TDD/Band40/20MHz/info) - -O ci-scripts/conf_files/enb.band40.tm1.100PRB.FairScheduler.usrpb210.conf - - - - Terminate_eNB - Terminate eNB - - - - Initialize_UE - Initialize UE - - - - Terminate_UE - Terminate UE - - - - Attach_UE - Attach single UE - 1 - - - - Attach_UE - Attach UE - - - - Detach_UE - Detach UE - - - - Ping - ping (5MHz - 20 sec) - -c 20 - 25 - - - - Ping - ping (10MHz - 20 sec) - -c 20 - 25 - - - - Iperf - iperf (5MHz - DL/6.5Mbps/UDP)(30 sec)(balanced) - -u -b 6.5M -t 30 -i 1 - 50 - balanced - - - - Iperf - iperf (5MHz - DL/6.5Mbps/UDP)(30 sec)(single-ue) - -u -b 6.5M -t 30 -i 1 - 50 - single-ue - - - - Iperf - iperf (5MHz - DL/6.5Mbps/UDP)(30 sec)(unbalanced) - -u -b 6.5M -t 30 -i 1 - 50 - unbalanced - - - - Iperf - iperf (10MHz - DL/13.5Mbps/UDP)(30 sec)(balanced) - -u -b 13.5M -t 30 -i 1 - 50 - balanced - - - - Iperf - iperf (10MHz - DL/13.5Mbps/UDP)(30 sec)(single-ue) - -u -b 13.5M -t 30 -i 1 - 50 - single-ue - - - - Iperf - iperf (10MHz - DL/13.5Mbps/UDP)(30 sec)(unbalanced) - -u -b 13.5M -t 30 -i 1 - 50 - unbalanced - - - - Iperf - iperf (5MHz - UL/2Mbps/UDP)(30 sec)(balanced) - -u -b 2M -t 30 -i 1 -R - 50 - balanced - - - - Iperf - iperf (5MHz - UL/2Mbps/UDP)(30 sec)(single-ue) - -u -b 2M -t 30 -i 1 -R - 50 - single-ue - - - - Iperf - iperf (5MHz - UL/2Mbps/UDP)(30 sec)(unbalanced) - -u -b 2M -t 30 -i 1 -R - 50 - unbalanced - - - - Iperf - iperf (10MHz - UL/2Mbps/UDP)(30 sec)(balanced) - -u -b 2M -t 30 -i 1 -R - 50 - balanced - - - - Iperf - iperf (10MHz - UL/2Mbps/UDP)(30 sec)(single-ue) - -u -b 2M -t 30 -i 1 -R - 50 - single-ue - - - - Iperf - iperf (10MHz - UL/2Mbps/UDP)(30 sec)(unbalanced) - -u -b 2M -t 30 -i 1 -R - 50 - unbalanced - - - - Initialize_HSS - Initialize HSS - - - - Initialize_MME - Initialize MME - - - - Initialize_SPGW - Initialize SPGW - - - - Terminate_HSS - Terminate HSS - - - - Terminate_MME - Terminate MME - - - - Terminate_SPGW - Terminate SPGW - - - diff --git a/ci-scripts/xml_files/if4p5_usrp210_band40.xml b/ci-scripts/xml_files/if4p5_usrp210_band40.xml deleted file mode 100644 index ac5d9ef5ba..0000000000 --- a/ci-scripts/xml_files/if4p5_usrp210_band40.xml +++ /dev/null @@ -1,217 +0,0 @@ - - - - - 010101 - 050101 060101 070101 040101 - 030104 030105 040301 040501 040602 040642 040401 040201 030201 030202 - 030114 030115 040301 040511 040612 040652 040401 040201 030201 030202 - 050201 060201 070201 - - - - - - - Build_eNB - Build eNB (USRP -- Ethernet Fronthaul) - -t ETHERNET -w USRP -c --eNB - - - - Initialize_eNB - Initialize RRU (TDD/Band40) - -O ci-scripts/conf_files/rru.tdd.band40.conf - 0 - - - - Initialize_eNB - Initialize RCC (TDD/Band40/5MHz) - -O ci-scripts/conf_files/rcc.band40.tm1.25PRB.FairScheduler.usrpb210.conf - 1 - - - - Initialize_eNB - Initialize RRU (TDD/Band40) - -O ci-scripts/conf_files/rru.tdd.band40.conf - 0 - - - - Initialize_eNB - Initialize RCC (TDD/Band40/10MHz/info) - -O ci-scripts/conf_files/rcc.band40.tm1.50PRB.FairScheduler.usrpb210.conf - 1 - - - - Initialize_eNB - Initialize RRU (TDD/Band40) - -O ci-scripts/conf_files/rru.tdd.band40.conf - 0 - - - - Initialize_eNB - Initialize RCC (TDD/Band40/20MHz/info) - -O ci-scripts/conf_files/rcc.band40.tm1.100PRB.FairScheduler.usrpb210.conf - 1 - - - - Terminate_eNB - Terminate RCC - 1 - - - - Terminate_eNB - Terminate RRU - 0 - - - - Initialize_UE - Initialize UE - - - - Terminate_UE - Terminate UE - - - - Attach_UE - Attach UE - - - - Detach_UE - Detach UE - - - - Ping - ping (5MHz - 20 sec) - -c 20 - 25 - - - - Ping - ping (10MHz - 20 sec) - -c 20 - 25 - - - - Ping - ping (20MHz - 20 sec) - -c 20 - 25 - - - - Iperf - iperf (5MHz - DL/6.5Mbps/UDP)(30 sec)(single-ue) - -u -b 6.5M -t 30 -i 1 - 50 - single-ue - - - - Iperf - iperf (10MHz - DL/13.5Mbps/UDP)(30 sec)(single-ue) - -u -b 13.5M -t 30 -i 1 - 50 - single-ue - - - - Iperf - iperf (20MHz - DL/13.5Mbps/UDP)(30 sec)(single-ue) - -u -b 13.5M -t 30 -i 1 - 50 - single-ue - - - - Iperf - iperf (5MHz - UL/2Mbps/UDP)(30 sec)(single-ue) - -u -b 2M -t 30 -i 1 -R - 50 - single-ue - - - - Iperf - iperf (10MHz - UL/2Mbps/UDP)(30 sec)(single-ue) - -u -b 2M -t 30 -i 1 -R - 50 - single-ue - - - - Iperf - iperf (20MHz - UL/2Mbps/UDP)(30 sec)(single-ue) - -u -b 2M -t 30 -i 1 -R - 50 - single-ue - - - - Initialize_HSS - Initialize HSS - - - - Initialize_MME - Initialize MME - - - - Initialize_SPGW - Initialize SPGW - - - - Terminate_HSS - Terminate HSS - - - - Terminate_MME - Terminate MME - - - - Terminate_SPGW - Terminate SPGW - - - diff --git a/ci-scripts/xml_files/if4p5_usrp210_band40_build.xml b/ci-scripts/xml_files/if4p5_usrp210_band40_build.xml new file mode 100644 index 0000000000..5bb7db5299 --- /dev/null +++ b/ci-scripts/xml_files/if4p5_usrp210_band40_build.xml @@ -0,0 +1,55 @@ + + + build-tab + Build + wrench + + 010101 + 050101 060101 070101 + + + + + + Build_eNB + Build eNB (USRP -- Ethernet Fronthaul) + -t ETHERNET -w USRP -c --eNB + + + + Initialize_HSS + Initialize HSS + + + + Initialize_MME + Initialize MME + + + + Initialize_SPGW + Initialize SPGW + + + diff --git a/ci-scripts/xml_files/if4p5_usrp210_band40_epc_closure.xml b/ci-scripts/xml_files/if4p5_usrp210_band40_epc_closure.xml new file mode 100644 index 0000000000..c04a8b3cf4 --- /dev/null +++ b/ci-scripts/xml_files/if4p5_usrp210_band40_epc_closure.xml @@ -0,0 +1,48 @@ + + + epc-closure + EPC-Closure + log-out + + 050201 060201 070201 + + + + + + Terminate_HSS + Terminate HSS + + + + Terminate_MME + Terminate MME + + + + Terminate_SPGW + Terminate SPGW + + + diff --git a/ci-scripts/xml_files/if4p5_usrp210_band40_test_05mhz.xml b/ci-scripts/xml_files/if4p5_usrp210_band40_test_05mhz.xml new file mode 100644 index 0000000000..1de23d05d6 --- /dev/null +++ b/ci-scripts/xml_files/if4p5_usrp210_band40_test_05mhz.xml @@ -0,0 +1,103 @@ + + + test-05 + Test-05MHz + tasks + + 040101 + 030104 030105 040301 040501 040602 040642 040401 040201 030201 030202 + + + + + + Initialize_eNB + Initialize RRU (TDD/Band40) + -O ci-scripts/conf_files/rru.tdd.band40.conf + 0 + + + + Initialize_eNB + Initialize RCC (TDD/Band40/5MHz) + -O ci-scripts/conf_files/rcc.band40.tm1.25PRB.FairScheduler.usrpb210.conf + 1 + + + + Terminate_eNB + Terminate RCC + 1 + + + + Terminate_eNB + Terminate RRU + 0 + + + + Initialize_UE + Initialize UE + + + + Terminate_UE + Terminate UE + + + + Attach_UE + Attach UE + + + + Detach_UE + Detach UE + + + + Ping + ping (5MHz - 20 sec) + -c 20 + 25 + + + + Iperf + iperf (5MHz - DL/6.5Mbps/UDP)(30 sec)(single-ue) + -u -b 6.5M -t 30 -i 1 + 50 + single-ue + + + + Iperf + iperf (5MHz - UL/2Mbps/UDP)(30 sec)(single-ue) + -u -b 2M -t 30 -i 1 -R + 50 + single-ue + + + diff --git a/ci-scripts/xml_files/if4p5_usrp210_band40_test_10mhz.xml b/ci-scripts/xml_files/if4p5_usrp210_band40_test_10mhz.xml new file mode 100644 index 0000000000..6bc37db17a --- /dev/null +++ b/ci-scripts/xml_files/if4p5_usrp210_band40_test_10mhz.xml @@ -0,0 +1,103 @@ + + + test-10 + Test-10MHz + tasks + + 040101 + 030114 030115 040301 040511 040612 040652 040401 040201 030201 030202 + + + + + + Initialize_eNB + Initialize RRU (TDD/Band40) + -O ci-scripts/conf_files/rru.tdd.band40.conf + 0 + + + + Initialize_eNB + Initialize RCC (TDD/Band40/10MHz/info) + -O ci-scripts/conf_files/rcc.band40.tm1.50PRB.FairScheduler.usrpb210.conf + 1 + + + + Terminate_eNB + Terminate RCC + 1 + + + + Terminate_eNB + Terminate RRU + 0 + + + + Initialize_UE + Initialize UE + + + + Terminate_UE + Terminate UE + + + + Attach_UE + Attach UE + + + + Detach_UE + Detach UE + + + + Ping + ping (10MHz - 20 sec) + -c 20 + 25 + + + + Iperf + iperf (10MHz - DL/13.5Mbps/UDP)(30 sec)(single-ue) + -u -b 13.5M -t 30 -i 1 + 50 + single-ue + + + + Iperf + iperf (10MHz - UL/2Mbps/UDP)(30 sec)(single-ue) + -u -b 2M -t 30 -i 1 -R + 50 + single-ue + + + diff --git a/ci-scripts/xml_files/if4p5_usrp210_band40_test_20mhz.xml b/ci-scripts/xml_files/if4p5_usrp210_band40_test_20mhz.xml new file mode 100644 index 0000000000..512c958105 --- /dev/null +++ b/ci-scripts/xml_files/if4p5_usrp210_band40_test_20mhz.xml @@ -0,0 +1,103 @@ + + + test-20 + Test-20MHz + tasks + + 040101 + 030124 030125 040301 040521 040622 040662 040401 040201 030201 030202 + + + + + + Initialize_eNB + Initialize RRU (TDD/Band40) + -O ci-scripts/conf_files/rru.tdd.band40.conf + 0 + + + + Initialize_eNB + Initialize RCC (TDD/Band40/20MHz/info) + -O ci-scripts/conf_files/rcc.band40.tm1.100PRB.FairScheduler.usrpb210.conf + 1 + + + + Terminate_eNB + Terminate RCC + 1 + + + + Terminate_eNB + Terminate RRU + 0 + + + + Initialize_UE + Initialize UE + + + + Terminate_UE + Terminate UE + + + + Attach_UE + Attach UE + + + + Detach_UE + Detach UE + + + + Ping + ping (20MHz - 20 sec) + -c 20 + 25 + + + + Iperf + iperf (20MHz - DL/13.5Mbps/UDP)(30 sec)(single-ue) + -u -b 13.5M -t 30 -i 1 + 50 + single-ue + + + + Iperf + iperf (20MHz - UL/2Mbps/UDP)(30 sec)(single-ue) + -u -b 2M -t 30 -i 1 -R + 50 + single-ue + + + diff --git a/ci-scripts/xml_files/if4p5_usrp210_band7_build.xml b/ci-scripts/xml_files/if4p5_usrp210_band7_build.xml index d4714b0de2..a0be9253db 100644 --- a/ci-scripts/xml_files/if4p5_usrp210_band7_build.xml +++ b/ci-scripts/xml_files/if4p5_usrp210_band7_build.xml @@ -21,9 +21,9 @@ --> - build-tab - Build - wrench + build-tab + Build + wrench 010101 050101 060101 070101 040101 diff --git a/ci-scripts/xml_files/if4p5_usrp210_band7_epc_closure.xml b/ci-scripts/xml_files/if4p5_usrp210_band7_epc_closure.xml index cde3581afa..8587db959d 100644 --- a/ci-scripts/xml_files/if4p5_usrp210_band7_epc_closure.xml +++ b/ci-scripts/xml_files/if4p5_usrp210_band7_epc_closure.xml @@ -21,9 +21,9 @@ --> - epc-closure - EPC-Closure - log-out + epc-closure + EPC-Closure + log-out 050201 060201 070201 diff --git a/ci-scripts/xml_files/if4p5_usrp210_band7_test_05mhz.xml b/ci-scripts/xml_files/if4p5_usrp210_band7_test_05mhz.xml index fb6642dd0f..b0501e9875 100644 --- a/ci-scripts/xml_files/if4p5_usrp210_band7_test_05mhz.xml +++ b/ci-scripts/xml_files/if4p5_usrp210_band7_test_05mhz.xml @@ -21,10 +21,11 @@ --> - test-05 - Test-05MHz - tasks + test-05 + Test-05MHz + tasks + 040101 030101 030102 040301 040501 040604 040642 040401 040201 030201 030202 diff --git a/ci-scripts/xml_files/if4p5_usrp210_band7_test_10mhz.xml b/ci-scripts/xml_files/if4p5_usrp210_band7_test_10mhz.xml index e3cf3ae41a..340d33196a 100644 --- a/ci-scripts/xml_files/if4p5_usrp210_band7_test_10mhz.xml +++ b/ci-scripts/xml_files/if4p5_usrp210_band7_test_10mhz.xml @@ -21,10 +21,11 @@ --> - test-10 - Test-10MHz - tasks + test-10 + Test-10MHz + tasks + 040101 030111 030112 040301 040511 040614 040652 040401 040201 030201 030202 diff --git a/ci-scripts/xml_files/if4p5_usrp210_band7_test_20mhz.xml b/ci-scripts/xml_files/if4p5_usrp210_band7_test_20mhz.xml index 8e54c90c44..5d8646cd5e 100644 --- a/ci-scripts/xml_files/if4p5_usrp210_band7_test_20mhz.xml +++ b/ci-scripts/xml_files/if4p5_usrp210_band7_test_20mhz.xml @@ -21,10 +21,11 @@ --> - test-20 - Test-20MHz - tasks + test-20 + Test-20MHz + tasks + 040101 030121 030122 040301 040521 040624 040662 040401 040201 030201 030202 From 6c41b6d77a60b30a14869d254a22a22ce3a8dff7 Mon Sep 17 00:00:00 2001 From: rdoost Date: Mon, 17 Dec 2018 20:24:14 -0600 Subject: [PATCH 26/31] parametrized gains --- targets/ARCH/IRIS/USERSPACE/LIB/iris_lib.cpp | 121 ++++---- .../CONF/enb.band42.tm1.25PRB.iris030.conf | 264 ++++++++++++++++++ 2 files changed, 327 insertions(+), 58 deletions(-) create mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band42.tm1.25PRB.iris030.conf diff --git a/targets/ARCH/IRIS/USERSPACE/LIB/iris_lib.cpp b/targets/ARCH/IRIS/USERSPACE/LIB/iris_lib.cpp index 3133742cd4..7abdf65498 100644 --- a/targets/ARCH/IRIS/USERSPACE/LIB/iris_lib.cpp +++ b/targets/ARCH/IRIS/USERSPACE/LIB/iris_lib.cpp @@ -1,7 +1,8 @@ /** iris_lib.cpp * - * \author: Rahman Doost-Mohammady : doost@rice.edu + * \authors: Rahman Doost-Mohammady : doost@rice.edu + * Clay Shepard : cws@rice.edu */ #include @@ -30,6 +31,7 @@ # include #endif +#define MOVE_DC #define SAMPLE_RATE_DOWN 1 /*! \brief Iris Configuration */ @@ -595,7 +597,8 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) { } for (r = 0; r < s->device_num; r++) { - switch ((int) openair0_cfg[0].sample_rate) { + //this is unnecessary -- it will set the correct master clock based on sample rate + /*switch ((int) openair0_cfg[0].sample_rate) { case 1920000: s->iris[r]->setMasterClockRate(256 * openair0_cfg[0].sample_rate); break; @@ -615,54 +618,34 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) { printf("Error: unknown sampling rate %f\n", openair0_cfg[0].sample_rate); exit(-1); break; - } - // display Iris settings - printf("Actual master clock: %fMHz...\n", (s->iris[r]->getMasterClockRate() / 1e6)); - - /* Setting TX/RX BW after streamers are created due to iris calibration issue */ - for (i = 0; i < s->tx_num_channels; i++) { - if (i < s->iris[r]->getNumChannels(SOAPY_SDR_TX)) { - if (s->iris[r]->getHardwareInfo()["frontend"].compare(devFE) != 0) - s->iris[r]->setBandwidth(SOAPY_SDR_TX, i, 30e6); - else - s->iris[r]->setBandwidth(SOAPY_SDR_TX, i, openair0_cfg[0].tx_bw); - - printf("Setting tx bandwidth on channel %lu/%lu: BW %f (readback %f)\n", i, - s->iris[r]->getNumChannels(SOAPY_SDR_TX), openair0_cfg[0].tx_bw / 1e6, - s->iris[r]->getBandwidth(SOAPY_SDR_TX, i) / 1e6); - } - } - for (i = 0; i < s->rx_num_channels; i++) { - if (i < s->iris[r]->getNumChannels(SOAPY_SDR_RX)) { - if (s->iris[r]->getHardwareInfo()["frontend"].compare(devFE) != 0) - s->iris[r]->setBandwidth(SOAPY_SDR_TX, i, 30e6); - else - s->iris[r]->setBandwidth(SOAPY_SDR_RX, i, openair0_cfg[0].rx_bw); - printf("Setting rx bandwidth on channel %lu/%lu : BW %f (readback %f)\n", i, - s->iris[r]->getNumChannels(SOAPY_SDR_RX), openair0_cfg[0].rx_bw / 1e6, - s->iris[r]->getBandwidth(SOAPY_SDR_RX, i) / 1e6); - } - } + }*/ for (i = 0; i < s->iris[r]->getNumChannels(SOAPY_SDR_RX); i++) { if (i < s->rx_num_channels) { s->iris[r]->setSampleRate(SOAPY_SDR_RX, i, openair0_cfg[0].sample_rate / SAMPLE_RATE_DOWN); +#ifdef MOVE_DC + printf("Moving DC out of main carrier for rx...\n"); + s->iris[r]->setFrequency(SOAPY_SDR_RX, i, "RF", openair0_cfg[0].rx_freq[i]-.75*openair0_cfg[0].sample_rate); + s->iris[r]->setFrequency(SOAPY_SDR_RX, i, "BB", .75*openair0_cfg[0].sample_rate); +#else s->iris[r]->setFrequency(SOAPY_SDR_RX, i, "RF", openair0_cfg[0].rx_freq[i]); +#endif set_rx_gain_offset(&openair0_cfg[0], i, bw_gain_adjust); //s->iris[r]->setGain(SOAPY_SDR_RX, i, openair0_cfg[0].rx_gain[i] - openair0_cfg[0].rx_gain_offset[i]); + printf("rx gain offset: %f, rx_gain: %f, tx_tgain: %f\n", openair0_cfg[0].rx_gain_offset[i], openair0_cfg[0].rx_gain[i], openair0_cfg[0].tx_gain[i]); if (s->iris[r]->getHardwareInfo()["frontend"].compare(devFE) != 0) { s->iris[r]->setGain(SOAPY_SDR_RX, i, "LNA", openair0_cfg[0].rx_gain[i] - openair0_cfg[0].rx_gain_offset[i]); //s->iris[r]->setGain(SOAPY_SDR_RX, i, "LNA", 0); s->iris[r]->setGain(SOAPY_SDR_RX, i, "LNA1", 30); s->iris[r]->setGain(SOAPY_SDR_RX, i, "LNA2", 17); - s->iris[r]->setGain(SOAPY_SDR_RX, i, "TIA", 0); - s->iris[r]->setGain(SOAPY_SDR_RX, i, "PGA", 0); + s->iris[r]->setGain(SOAPY_SDR_RX, i, "TIA", 7); + s->iris[r]->setGain(SOAPY_SDR_RX, i, "PGA", 18); s->iris[r]->setGain(SOAPY_SDR_RX, i, "ATTN", 0); } else { s->iris[r]->setGain(SOAPY_SDR_RX, i, "LNA", openair0_cfg[0].rx_gain[i] - openair0_cfg[0].rx_gain_offset[i]); // [0,30] - s->iris[r]->setGain(SOAPY_SDR_RX, i, "TIA", 0); // [0,12,6] - s->iris[r]->setGain(SOAPY_SDR_RX, i, "PGA", 0); // [-12,19,1] + s->iris[r]->setGain(SOAPY_SDR_RX, i, "TIA", 7); // [0,12,6] + s->iris[r]->setGain(SOAPY_SDR_RX, i, "PGA", 18); // [-12,19,1] //s->iris[r]->setGain(SOAPY_SDR_RX, i, 50); // [-12,19,1] } @@ -673,22 +656,29 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) { for (i = 0; i < s->iris[r]->getNumChannels(SOAPY_SDR_TX); i++) { if (i < s->tx_num_channels) { s->iris[r]->setSampleRate(SOAPY_SDR_TX, i, openair0_cfg[0].sample_rate / SAMPLE_RATE_DOWN); +#ifdef MOVE_DC + printf("Moving DC out of main carrier for tx...\n"); + s->iris[r]->setFrequency(SOAPY_SDR_TX, i, "RF", openair0_cfg[0].tx_freq[i]-.75*openair0_cfg[0].sample_rate); + s->iris[r]->setFrequency(SOAPY_SDR_TX, i, "BB", .75*openair0_cfg[0].sample_rate); +#else s->iris[r]->setFrequency(SOAPY_SDR_TX, i, "RF", openair0_cfg[0].tx_freq[i]); +#endif if (s->iris[r]->getHardwareInfo()["frontend"].compare(devFE) == 0) { - //s->iris[r]->setGain(SOAPY_SDR_TX, i, "PAD", openair0_cfg[0].tx_gain[i]); - s->iris[r]->setGain(SOAPY_SDR_TX, i, "PAD", 52); + s->iris[r]->setGain(SOAPY_SDR_TX, i, "PAD", openair0_cfg[0].tx_gain[i]); + //s->iris[r]->setGain(SOAPY_SDR_TX, i, "PAD", 50); s->iris[r]->setGain(SOAPY_SDR_TX, i, "IAMP", 12); //s->iris[r]->writeSetting("TX_ENABLE_DELAY", "0"); //s->iris[r]->writeSetting("TX_DISABLE_DELAY", "100"); } else { + s->iris[r]->setGain(SOAPY_SDR_TX, i, "PAD", openair0_cfg[0].tx_gain[i]); s->iris[r]->setGain(SOAPY_SDR_TX, i, "ATTN", 0); // [-18, 0, 6] dB - s->iris[r]->setGain(SOAPY_SDR_TX, i, "IAMP", 9); // [-12, 12, 1] dB - s->iris[r]->setGain(SOAPY_SDR_TX, i, "PAD", 52); //openair0_cfg[0].tx_gain[i]); + s->iris[r]->setGain(SOAPY_SDR_TX, i, "IAMP", 6); // [-12, 12, 1] dB + //s->iris[r]->setGain(SOAPY_SDR_TX, i, "PAD", 44); //openair0_cfg[0].tx_gain[i]); //s->iris[r]->setGain(SOAPY_SDR_TX, i, "PAD", 35); // [0, 52, 1] dB - s->iris[r]->setGain(SOAPY_SDR_TX, i, "PA1", 9); // 17 ??? dB + //s->iris[r]->setGain(SOAPY_SDR_TX, i, "PA1", 17); // 17 ??? dB s->iris[r]->setGain(SOAPY_SDR_TX, i, "PA2", 0); // [0, 17, 17] dB - s->iris[r]->setGain(SOAPY_SDR_TX, i, "PA3", 20); // 33 ??? dB + //s->iris[r]->setGain(SOAPY_SDR_TX, i, "PA3", 20); // 33 ??? dB s->iris[r]->writeSetting("TX_ENABLE_DELAY", "0"); s->iris[r]->writeSetting("TX_DISABLE_DELAY", "100"); } @@ -702,32 +692,47 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) { } - for (i = 0; i < s->iris[r]->getNumChannels(SOAPY_SDR_RX); i++) { - if (i < s->rx_num_channels) { + + printf("Actual master clock: %fMHz...\n", (s->iris[r]->getMasterClockRate() / 1e6)); - //if (s->iris[r]->getHardwareInfo()["frontend"].compare(devFE) != 0) { - // printf("\nUsing SKLK calibration...\n"); - // s->iris[r]->writeSetting(SOAPY_SDR_RX, i, "CALIBRATE", "SKLK"); - //} else { - // s->iris[r]->writeSetting(SOAPY_SDR_RX, i, "CALIBRATE", ""); - // printf("\nUsing LMS calibration...\n"); - - //} + int tx_filt_bw = openair0_cfg[0].tx_bw; + int rx_filt_bw = openair0_cfg[0].rx_bw; +#ifdef MOVE_DC //the filter is centered around the carrier, so we have to expand it if we have moved the DC tone. + tx_filt_bw *= 3; + rx_filt_bw *= 3; +#endif + /* Setting TX/RX BW */ + for (i = 0; i < s->tx_num_channels; i++) { + if (i < s->iris[r]->getNumChannels(SOAPY_SDR_TX)) { + s->iris[r]->setBandwidth(SOAPY_SDR_TX, i, tx_filt_bw); + printf("Setting tx bandwidth on channel %lu/%lu: BW %f (readback %f)\n", i, + s->iris[r]->getNumChannels(SOAPY_SDR_TX), tx_filt_bw / 1e6, + s->iris[r]->getBandwidth(SOAPY_SDR_TX, i) / 1e6); + } + } + for (i = 0; i < s->rx_num_channels; i++) { + if (i < s->iris[r]->getNumChannels(SOAPY_SDR_RX)) { + s->iris[r]->setBandwidth(SOAPY_SDR_RX, i, rx_filt_bw); + printf("Setting rx bandwidth on channel %lu/%lu : BW %f (readback %f)\n", i, + s->iris[r]->getNumChannels(SOAPY_SDR_RX), rx_filt_bw / 1e6, + s->iris[r]->getBandwidth(SOAPY_SDR_RX, i) / 1e6); } - } for (i = 0; i < s->iris[r]->getNumChannels(SOAPY_SDR_TX); i++) { if (i < s->tx_num_channels) { + printf("\nUsing SKLK calibration...\n"); + s->iris[r]->writeSetting(SOAPY_SDR_TX, i, "CALIBRATE", "SKLK"); - if (s->iris[r]->getHardwareInfo()["frontend"].compare(devFE) != 0) { - printf("\nUsing SKLK calibration...\n"); - s->iris[r]->writeSetting(SOAPY_SDR_TX, i, "CALIBRATE", "SKLK"); + } + + } + + for (i = 0; i < s->iris[r]->getNumChannels(SOAPY_SDR_RX); i++) { + if (i < s->rx_num_channels) { + printf("\nUsing SKLK calibration...\n"); + s->iris[r]->writeSetting(SOAPY_SDR_RX, i, "CALIBRATE", "SKLK"); - } else { - printf("\nUsing LMS calibration...\n"); - s->iris[r]->writeSetting(SOAPY_SDR_TX, i, "CALIBRATE", ""); - } } } diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band42.tm1.25PRB.iris030.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band42.tm1.25PRB.iris030.conf new file mode 100644 index 0000000000..764d7886e2 --- /dev/null +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band42.tm1.25PRB.iris030.conf @@ -0,0 +1,264 @@ +Active_eNBs = ( "eNB_Eurecom_LTEBox"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +eNBs = +( + { + ////////// Identification parameters: + eNB_ID = 0xe00; + + cell_type = "CELL_MACRO_ENB"; + + eNB_name = "eNB_Eurecom_LTEBox"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 1; + + plmn_list = ( { mcc = 208; mnc = 92; mnc_length = 2; } ); + + tr_s_preference = "local_mac" + + ////////// Physical parameters: + + component_carriers = ( + { + node_function = "eNodeB_3GPP"; + node_timing = "synch_to_ext_device"; + node_synch_ref = 0; + frame_type = "TDD"; + tdd_config = 1; + tdd_config_s = 0; + prefix_type = "NORMAL"; + eutra_band = 42; + downlink_frequency = 3500000000L; + uplink_frequency_offset = 0; + Nid_cell = 10; + N_RB_DL = 25; + Nid_cell_mbsfn = 0; + nb_antenna_ports = 1; + nb_antennas_tx = 1; + nb_antennas_rx = 1; + tx_gain = 48; # [~50 for DEV-FE, ~30 for CBRS-FE] + rx_gain = 80; # [115 for DEV-FE, 90 for CBRS-FE] + pbch_repetition = "FALSE"; + prach_root = 0; + prach_config_index = 0; + prach_high_speed = "DISABLE"; + prach_zero_correlation = 1; + prach_freq_offset = 2; + pucch_delta_shift = 1; + pucch_nRB_CQI = 1; + pucch_nCS_AN = 0; + pucch_n1_AN = 32; + pdsch_referenceSignalPower = -30; + pdsch_p_b = 0; + pusch_n_SB = 1; + pusch_enable64QAM = "DISABLE"; + pusch_hoppingMode = "interSubFrame"; + pusch_hoppingOffset = 0; + pusch_groupHoppingEnabled = "ENABLE"; + pusch_groupAssignment = 0; + pusch_sequenceHoppingEnabled = "DISABLE"; + pusch_nDMRS1 = 1; + phich_duration = "NORMAL"; + phich_resource = "ONESIXTH"; + srs_enable = "DISABLE"; + /* srs_BandwidthConfig =; + srs_SubframeConfig =; + srs_ackNackST =; + srs_MaxUpPts =;*/ + + pusch_p0_Nominal = -70; + pusch_alpha = "AL1"; + pucch_p0_Nominal = -96; + msg3_delta_Preamble = 6; + pucch_deltaF_Format1 = "deltaF2"; + pucch_deltaF_Format1b = "deltaF3"; + pucch_deltaF_Format2 = "deltaF0"; + pucch_deltaF_Format2a = "deltaF0"; + pucch_deltaF_Format2b = "deltaF0"; + + rach_numberOfRA_Preambles = 64; + rach_preamblesGroupAConfig = "DISABLE"; + /* + rach_sizeOfRA_PreamblesGroupA = ; + rach_messageSizeGroupA = ; + rach_messagePowerOffsetGroupB = ; + */ + rach_powerRampingStep = 4; + rach_preambleInitialReceivedTargetPower = -96; + rach_preambleTransMax = 10; + rach_raResponseWindowSize = 10; + rach_macContentionResolutionTimer = 48; + rach_maxHARQ_Msg3Tx = 4; + + pcch_default_PagingCycle = 128; + pcch_nB = "oneT"; + bcch_modificationPeriodCoeff = 2; + ue_TimersAndConstants_t300 = 1000; + ue_TimersAndConstants_t301 = 1000; + ue_TimersAndConstants_t310 = 1000; + ue_TimersAndConstants_t311 = 10000; + ue_TimersAndConstants_n310 = 20; + ue_TimersAndConstants_n311 = 1; + ue_TransmissionMode = 1; + + //Parameters for SIB18 + rxPool_sc_CP_Len = "normal"; + rxPool_sc_Period = "sf40"; + rxPool_data_CP_Len = "normal"; + rxPool_ResourceConfig_prb_Num = 20; + rxPool_ResourceConfig_prb_Start = 5; + rxPool_ResourceConfig_prb_End = 44; + rxPool_ResourceConfig_offsetIndicator_present = "prSmall"; + rxPool_ResourceConfig_offsetIndicator_choice = 0; + rxPool_ResourceConfig_subframeBitmap_present = "prBs40"; + rxPool_ResourceConfig_subframeBitmap_choice_bs_buf = "00000000000000000000"; + rxPool_ResourceConfig_subframeBitmap_choice_bs_size = 5; + rxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused = 0; +/* rxPool_dataHoppingConfig_hoppingParameter = 0; + rxPool_dataHoppingConfig_numSubbands = "ns1"; + rxPool_dataHoppingConfig_rbOffset = 0; + rxPool_commTxResourceUC-ReqAllowed = "TRUE"; +*/ + // Parameters for SIB19 + discRxPool_cp_Len = "normal" + discRxPool_discPeriod = "rf32" + discRxPool_numRetx = 1; + discRxPool_numRepetition = 2; + discRxPool_ResourceConfig_prb_Num = 5; + discRxPool_ResourceConfig_prb_Start = 3; + discRxPool_ResourceConfig_prb_End = 21; + discRxPool_ResourceConfig_offsetIndicator_present = "prSmall"; + discRxPool_ResourceConfig_offsetIndicator_choice = 0; + discRxPool_ResourceConfig_subframeBitmap_present = "prBs40"; + discRxPool_ResourceConfig_subframeBitmap_choice_bs_buf = "f0ffffffff"; + discRxPool_ResourceConfig_subframeBitmap_choice_bs_size = 5; + discRxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused = 0; + + } + ); + + srb1_parameters : + { + # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] + timer_poll_retransmit = 80; + + # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] + timer_reordering = 35; + + # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] + timer_status_prohibit = 0; + + # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] + poll_pdu = 4; + + # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] + poll_byte = 99999; + + # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] + max_retx_threshold = 4; + } + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// MME parameters: + mme_ip_address = ( { ipv4 = "127.0.0.20"; + ipv6 = "fe80::d65d:dfff:fe1d:f4d4"; + active = "yes"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : + { + ENB_INTERFACE_NAME_FOR_S1_MME = "eno1"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.10/8"; + ENB_INTERFACE_NAME_FOR_S1U = "enp5s0"; + ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.10/8"; + ENB_PORT_FOR_S1U = 2152; # Spec 2152 + + ENB_IPV4_ADDRESS_FOR_X2C = "127.0.0.10/8"; + ENB_PORT_FOR_X2C = 36422; # Spec 36422 + }; + } +); + +MACRLCs = ( + { + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + phy_test_mode = 0; + puSch10xSnr = 200; + puCch10xSnr = 200; + } +); + +L1s = ( + { + num_cc = 1; + tr_n_preference = "local_mac"; + } +); + +RUs = ( + { + local_rf = "yes" + nb_tx = 1; + nb_rx = 1; + att_tx = 44; #apparently this is being used as tx_gain... + att_rx = 0; #apparently max_rxgain - att_rx -83 is what is used for rx_gain (at least for 5 MHz) + bands = [7]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 107; + eNB_instances = [0]; + #sdr_addrs = "RF3E000025"; + } +); + +NETWORK_CONTROLLER : +{ + FLEXRAN_ENABLED = "no"; + FLEXRAN_INTERFACE_NAME = "lo"; + FLEXRAN_IPV4_ADDRESS = "127.0.0.1"; + FLEXRAN_PORT = 2210; + FLEXRAN_CACHE = "/mnt/oai_agent_cache"; + FLEXRAN_AWAIT_RECONF = "no"; +}; + +THREAD_STRUCT = ( + { + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_RU_L1_TRX_SPLIT"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; + } +); + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + }; + From 77f2879620af01d6e1302f6aec20c41b849e3693 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Wed, 19 Dec 2018 10:10:33 +0100 Subject: [PATCH 27/31] CI: typo in report build script Signed-off-by: Raphael Defosseux --- ci-scripts/reportBuildLocally.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ci-scripts/reportBuildLocally.sh b/ci-scripts/reportBuildLocally.sh index 6526096d12..bfce7acd8f 100755 --- a/ci-scripts/reportBuildLocally.sh +++ b/ci-scripts/reportBuildLocally.sh @@ -310,6 +310,7 @@ function report_build { echo "############################################################" echo "JENKINS_WKSP = $JENKINS_WKSP" + echo "GIT_URL = $GIT_URL" cd ${JENKINS_WKSP} echo "" > ./build_results.html @@ -345,7 +346,7 @@ function report_build { echo " " >> ./build_results.html echo " " >> ./build_results.html echo " " >> ./build_results.html - echo " " >> ./test_simulator_results.html + echo " " >> ./build_results.html echo " " >> ./build_results.html echo " " >> ./build_results.html echo " " >> ./build_results.html From 3b915b37ff0ec85d30f9b3017ae6c4e97e3a0d6d Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Wed, 19 Dec 2018 16:05:09 +0100 Subject: [PATCH 28/31] Downgrading log message to DEBUG for better RT Signed-off-by: Raphael Defosseux --- targets/RT/USER/lte-ru.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/targets/RT/USER/lte-ru.c b/targets/RT/USER/lte-ru.c index dcad2ece7c..7df0a8c623 100644 --- a/targets/RT/USER/lte-ru.c +++ b/targets/RT/USER/lte-ru.c @@ -1554,8 +1554,8 @@ static void* ru_thread_tx( void* param ) { if (oai_exit) break; - LOG_I(PHY,"ru_thread_tx: Waiting for TX processing\n"); - // wait until eNBs are finished subframe RX n and TX n+4 + LOG_D(PHY,"ru_thread_tx: Waiting for TX processing\n"); + // wait until eNBs are finished subframe RX n and TX n+4 wait_on_condition(&proc->mutex_eNBs,&proc->cond_eNBs,&proc->instance_cnt_eNBs,"ru_thread_tx"); if (oai_exit) break; From c76bbd13f16cdff655981c51ef3574a33cc8f693 Mon Sep 17 00:00:00 2001 From: Rahman Doost Date: Wed, 19 Dec 2018 14:49:56 -0600 Subject: [PATCH 29/31] iris soapy0.7 support --- cmake_targets/CMakeLists.txt | 2 +- cmake_targets/tools/build_helper | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 8e4d1afe3d..679a6596e0 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -557,7 +557,7 @@ set(HWLIB_IRIS_SOURCE ${OPENAIR_TARGETS}/ARCH/IRIS/USERSPACE/LIB/iris_lib.cpp ) add_library(oai_irisdevif MODULE ${HWLIB_IRIS_SOURCE}) -target_include_directories(oai_irisdevif PRIVATE /usr/local/lib/SoapySDR/modules0.6/) +target_include_directories(oai_irisdevif PRIVATE /usr/local/lib/SoapySDR/modules0.7/) target_link_libraries(oai_irisdevif SoapySDR) include_directories("${OPENAIR_TARGETS}/ARCH/mobipass/") diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index 658844531e..5189eca27d 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -386,8 +386,8 @@ install_soapy_from_source(){ cd /tmp echo "Downloading SoapySDR" rm -rf /tmp/soapysdr - git clone https://github.com/pothosware/SoapySDR.git - cd soapysdr + git clone -b soapy-sdr-0.7.0 --single-branch https://github.com/pothosware/SoapySDR.git + cd SoapySDR #git checkout tags/release_003_010_001_001 mkdir -p build cd build @@ -399,8 +399,8 @@ install_soapy_from_source(){ cd /tmp echo "Downloading SoapyRemote" rm -rf /tmp/soapyremote - git clone https://github.com/pothosware/SoapyRemote.git - cd soapyremote + git clone -b soapy-remote-0.5.0 --single-branch https://github.com/pothosware/SoapyRemote.git + cd SoapyRemote #git checkout tags/release_003_010_001_001 mkdir -p build cd build @@ -419,7 +419,7 @@ install_soapy_iris_from_source(){ cd /tmp echo "Downloading SoapyIris" rm -rf /tmp/sklk-soapyiris - git clone https://github.com/skylarkwireless/sklk-soapyiris.git + git clone -b soapy-iris-2018.08.0.1 --single-branch https://github.com/skylarkwireless/sklk-soapyiris.git cd sklk-soapyiris mkdir -p build cd build @@ -434,14 +434,14 @@ install_soapy_iris_from_source(){ check_install_soapy () { #if [[ "$OS_DISTRO" == "ubuntu" ]]; then #first we remove old installation - $SUDO apt-get remove -y soapysdr soapysdr-server libsoapysdr-dev python-soapysdr python3-soapysdr soapysdr-module-remote || true - $SUDO add-apt-repository -y ppa:myriadrf/drivers - $SUDO apt-get update - $SUDO apt-get install -y soapysdr soapysdr-server libsoapysdr-dev python-soapysdr python3-soapysdr soapysdr-module-remote + $SUDO apt-get remove -y soapysdr soapysdr-server libsoapysdr-dev python-soapysdr python3-soapysdr soapysdr-module-remote || true + #$SUDO add-apt-repository -y ppa:myriadrf/drivers + #$SUDO apt-get update + #$SUDO apt-get install -y soapysdr soapysdr-server libsoapysdr-dev python-soapysdr python3-soapysdr soapysdr-module-remote #elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then # $SUDO $INSTALLER -y install software-properties-common python3-software-properties python-software-properties subversion git python3 python-numpy python3-numpy cmake swig python-dev - # install_soapy_from_source + install_soapy_from_source #fi install_soapy_iris_from_source From 32eafc13326fbd7d210b68a5ba3a59c49ff7032f Mon Sep 17 00:00:00 2001 From: Louis Adrien Dufrene Date: Thu, 20 Dec 2018 15:20:10 +0100 Subject: [PATCH 30/31] Some format before testing locally --- .../LAYER2/MAC/eNB_scheduler_primitives.c | 57 +++-- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 208 +++++++++--------- 2 files changed, 138 insertions(+), 127 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 06e7a7f4b2..937cc6e247 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -3254,11 +3254,15 @@ nfapi_ul_config_request_pdu_t *has_ul_grant(module_id_t module_idP, return (NULL); // no ul grant at all for this UE } +//----------------------------------------------------------------------------- boolean_t CCE_allocation_infeasible(int module_idP, - int CC_idP, - int format_flag, - int subframe, int aggregation, int rnti) + int CC_idP, + int format_flag, + int subframe, + int aggregation, + int rnti) +//----------------------------------------------------------------------------- { nfapi_dl_config_request_body_t *DL_req = &RC.mac[module_idP]->DL_req[CC_idP].dl_config_request_body; nfapi_dl_config_request_pdu_t *dl_config_pdu = &DL_req->dl_config_pdu_list[DL_req->number_pdu]; @@ -3269,9 +3273,12 @@ CCE_allocation_infeasible(int module_idP, if (format_flag != 2) { // DL DCI if (DL_req->number_pdu == MAX_NUM_DL_PDU) { - LOG_W(MAC, - "Subframe %d: FAPI DL structure is full, skip scheduling UE %d\n", - subframe, rnti); + LOG_W(MAC, "Subframe %d: FAPI DL structure is full, skip scheduling UE %d\n", + subframe, + rnti); + + res = TRUE; + } else { dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL8_TAG; dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE; @@ -3279,22 +3286,29 @@ CCE_allocation_infeasible(int module_idP, dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type = (format_flag == 0) ? 2 : 1; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level = aggregation; DL_req->number_pdu++; - LOG_D(MAC, - "Subframe %d: Checking CCE feasibility format %d : (%x,%d) (%x,%d,%d)\n", - subframe, format_flag, rnti, aggregation, - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti, - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8. - aggregation_level, - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type); + + LOG_D(MAC, "Subframe %d: Checking CCE feasibility format %d : (%x,%d) \n", + subframe, + format_flag, + rnti, + aggregation); + ret = allocate_CCEs(module_idP, CC_idP, 0, subframe, 0); - if (ret == -1) res = TRUE; + + if (ret == -1) { + res = TRUE; + } + DL_req->number_pdu--; } - } else { // ue-specific UL DCI + } else { // ue-specific UL DCI if (HI_DCI0_req->number_of_dci + HI_DCI0_req->number_of_hi == MAX_NUM_HI_DCI0_PDU) { - LOG_W(MAC, - "Subframe %d: FAPI UL structure is full, skip scheduling UE %d\n", - subframe, rnti); + LOG_W(MAC, "Subframe %d: FAPI UL structure is full, skip scheduling UE %d\n", + subframe, + rnti); + + res = TRUE; + } else { hi_dci0_pdu->pdu_type = NFAPI_HI_DCI0_DCI_PDU_TYPE; hi_dci0_pdu->dci_pdu.dci_pdu_rel8.tl.tag = NFAPI_HI_DCI0_REQUEST_DCI_PDU_REL8_TAG; @@ -3302,13 +3316,18 @@ CCE_allocation_infeasible(int module_idP, hi_dci0_pdu->dci_pdu.dci_pdu_rel8.aggregation_level = aggregation; HI_DCI0_req->number_of_dci++; ret = allocate_CCEs(module_idP, CC_idP, 0, subframe, 0); - if (ret == -1) res = TRUE; + + if (ret == -1) { + res = TRUE; + } + HI_DCI0_req->number_of_dci--; } } return res; } + void get_retransmission_timing(LTE_TDD_Config_t *tdd_Config, frame_t *frameP, sub_frame_t *subframeP) { diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 95aa796992..cdcdba5451 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -1145,12 +1145,8 @@ schedule_ulsch_rnti(module_id_t module_idP, int32_t normalized_rx_power = 0; int32_t target_rx_power = 0; static int32_t tpc_accumulated = 0; - int UE_id = -1; - int n = 0; - int CC_id = 0; - int drop_ue = 0; - int n_rb_ul_val = 0; int sched_frame = 0; + int CC_id = 0; eNB_MAC_INST *mac = NULL; COMMON_channels_t *cc = NULL; UE_list_t *UE_list = NULL; @@ -1159,6 +1155,7 @@ schedule_ulsch_rnti(module_id_t module_idP, UE_sched_ctrl *UE_sched_ctrl_ptr = NULL; int rvidx_tab[4] = {0, 2, 3, 1}; int first_rb_slice[NFAPI_CC_MAX]; + int n_rb_ul_tab[NFAPI_CC_MAX]; /* Init */ mac = RC.mac[module_idP]; @@ -1166,6 +1163,7 @@ schedule_ulsch_rnti(module_id_t module_idP, UE_list = &(mac->UE_list); sli = &(mac->slice_info); memset(first_rb_slice, 0, NFAPI_CC_MAX * sizeof(int)); + memset(n_rb_ul_tab, 0, NFAPI_CC_MAX * sizeof(int)); sched_frame = frameP; if (sched_subframeP < subframeP) { @@ -1180,138 +1178,132 @@ schedule_ulsch_rnti(module_id_t module_idP, nfapi_ul_config_request_body_t *ul_req_tmp_body = &(ul_req_tmp->ul_config_request_body); nfapi_ul_config_ulsch_harq_information *ulsch_harq_information; - for (CC_id = 0; CC_id < RC.nb_mac_CC[module_idP]; ++CC_id) { - n_rb_ul_val = to_prb(cc[CC_id].ul_Bandwidth); - UE_list->first_rb_offset[CC_id][slice_idx] = cmin(n_rb_ul_val, sli->ul[slice_idx].first_rb); + hi_dci0_req->sfn_sf = (frameP << 4) + subframeP; + + /* Note: RC.nb_mac_CC[module_idP] should be lower than or equal to NFAPI_CC_MAX */ + for (CC_id = 0; CC_id < RC.nb_mac_CC[module_idP]; CC_id++) { + n_rb_ul_tab[CC_id] = to_prb(cc[CC_id].ul_Bandwidth); + UE_list->first_rb_offset[CC_id][slice_idx] = cmin(n_rb_ul_tab[CC_id], sli->ul[slice_idx].first_rb); } - //LOG_D(MAC, "entering ulsch preprocesor\n"); + /* ULSCH preprocessor: set UE_template-> + * pre_allocated_nb_rb_ul[slice_idx] + * pre_assigned_mcs_ul + * pre_allocated_rb_table_index_ul + */ ulsch_scheduler_pre_processor(module_idP, slice_idx, frameP, subframeP, sched_subframeP, first_rb); - for (CC_id = 0; CC_id < RC.nb_mac_CC[module_idP]; ++CC_id) { + for (CC_id = 0; CC_id < RC.nb_mac_CC[module_idP]; CC_id++) { first_rb_slice[CC_id] = first_rb[CC_id] + UE_list->first_rb_offset[CC_id][slice_idx]; } - //LOG_D(MAC, "exiting ulsch preprocesor\n"); - hi_dci0_req->sfn_sf = (frameP << 4) + subframeP; - // loop over all active UEs - for (UE_id = UE_list->head_ul; UE_id >= 0; - UE_id = UE_list->next_ul[UE_id]) { - if (!ue_ul_slice_membership(module_idP, UE_id, slice_idx)) + for (int UE_id = UE_list->head_ul; UE_id >= 0; UE_id = UE_list->next_ul[UE_id]) { + if (!ue_ul_slice_membership(module_idP, UE_id, slice_idx)) { continue; + } // don't schedule if Msg4 is not received yet - if (UE_list->UE_template[UE_PCCID(module_idP, UE_id)][UE_id]. - configured == FALSE) { - LOG_D(MAC, - "[eNB %d] frame %d subfarme %d, UE %d: not configured, skipping UE scheduling \n", - module_idP, frameP, subframeP, UE_id); + if (UE_list->UE_template[UE_PCCID(module_idP, UE_id)][UE_id].configured == FALSE) { + LOG_D(MAC, "[eNB %d] frame %d, subframe %d, UE %d: not configured, skipping UE scheduling \n", + module_idP, + frameP, + subframeP, + UE_id); + continue; } rnti = UE_RNTI(module_idP, UE_id); if (rnti == NOT_A_RNTI) { - LOG_W(MAC, "[eNB %d] frame %d subfarme %d, UE %d: no RNTI \n", - module_idP, frameP, subframeP, UE_id); - continue; - } - - drop_ue = 0; - - /* let's drop the UE if get_eNB_UE_stats returns NULL when calling it with any of the UE's active UL CCs */ - /* TODO: refine? - - for (n=0; nnumactiveULCCs[UE_id]; n++) { - CC_id = UE_list->ordered_ULCCids[n][UE_id]; - - if (mac_xface->get_eNB_UE_stats(module_idP,CC_id,rnti) == NULL) { - LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d/%x CC %d: no PHY context\n", module_idP,frameP,subframeP,UE_id,rnti,CC_id); - drop_ue = 1; - break; - } - } */ - if (drop_ue == 1) { - /* we can't come here, ulsch_scheduler_pre_processor won't put in the list a UE with no PHY context */ - abort(); - - /* TODO: this is a hack. Sometimes the UE has no PHY context but - * is still present in the MAC with 'ul_failure_timer' = 0 and - * 'ul_out_of_sync' = 0. It seems wrong and the UE stays there forever. Let's - * start an UL out of sync procedure in this case. - * The root cause of this problem has to be found and corrected. - * In the meantime, this hack... - */ - if (UE_list->UE_sched_ctrl[UE_id].ul_failure_timer == 0 && - UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync == 0) { - LOG_W(MAC, - "[eNB %d] frame %d subframe %d, UE %d/%x CC %d: UE in weird state, let's put it 'out of sync'\n", - module_idP, frameP, subframeP, UE_id, rnti, CC_id); - // inform RRC of failure and clear timer - mac_eNB_rrc_ul_failure(module_idP, CC_id, frameP, - subframeP, rnti); - UE_list->UE_sched_ctrl[UE_id].ul_failure_timer = 0; - UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync = 1; - } + LOG_W(MAC, "[eNB %d] frame %d, subframe %d, UE %d: no RNTI \n", + module_idP, + frameP, + subframeP, + UE_id); continue; } // loop over all active UL CC_ids for this UE - for (n = 0; n < UE_list->numactiveULCCs[UE_id]; n++) { + for (int n = 0; n < UE_list->numactiveULCCs[UE_id]; n++) { // This is the actual CC_id in the list CC_id = UE_list->ordered_ULCCids[n][UE_id]; - n_rb_ul_val = to_prb(cc[CC_id].ul_Bandwidth); - /* - aggregation=get_aggregation(get_bw_index(module_idP,CC_id), - eNB_UE_stats->dl_cqi, - format0); - */ + /* should format_flag be 2 in CCE_allocation_infeasible??? */ + /* this test seems to be way too long, can we provide an optimization? */ + if (CCE_allocation_infeasible(module_idP, CC_id, 1, subframeP, aggregation, rnti)) { + LOG_W(MAC, "[eNB %d] frame %d, subframe %d, UE %d/%x CC %d: not enough CCE\n", + module_idP, + frameP, + subframeP, + UE_id, + rnti, + CC_id); - if (CCE_allocation_infeasible - (module_idP, CC_id, 1, subframeP, aggregation, rnti)) { - LOG_W(MAC, - "[eNB %d] frame %d subframe %d, UE %d/%x CC %d: not enough nCCE\n", - module_idP, frameP, subframeP, UE_id, rnti, CC_id); - continue; // break; - } - - /* be sure that there are some free RBs */ - if (first_rb_slice[CC_id] >= n_rb_ul_val - 1) { - LOG_W(MAC, - "[eNB %d] frame %d subframe %d, UE %d/%x CC %d: dropping, not enough RBs\n", - module_idP, frameP, subframeP, UE_id, rnti, CC_id); continue; } - // if (eNB_UE_stats->mode == PUSCH) { // ue has a ulsch channel - UE_template_ptr = &UE_list->UE_template[CC_id][UE_id]; - UE_sched_ctrl_ptr = &UE_list->UE_sched_ctrl[UE_id]; + /* be sure that there are some free RBs */ + if (first_rb_slice[CC_id] >= n_rb_ul_tab[CC_id] - 1) { + LOG_W(MAC, "[eNB %d] frame %d, subframe %d, UE %d/%x CC %d: dropping, not enough RBs\n", + module_idP, + frameP, + subframeP, + UE_id, + rnti, + CC_id); + + continue; + } + + UE_template_ptr = &(UE_list->UE_template[CC_id][UE_id]); + UE_sched_ctrl_ptr = &(UE_list->UE_sched_ctrl[UE_id]); harq_pid = subframe2harqpid(&cc[CC_id], sched_frame, sched_subframeP); round_index = UE_sched_ctrl_ptr->round_UL[CC_id][harq_pid]; - AssertFatal(round_index < 8, "round %d > 7 for UE %d/%x\n", round_index, - UE_id, rnti); - LOG_D(MAC, - "[eNB %d] frame %d subframe %d (sched_frame %d, sched_subframe %d), Checking PUSCH %d for UE %d/%x CC %d : aggregation level %d, N_RB_UL %d\n", - module_idP, frameP, subframeP, sched_frame, sched_subframeP, harq_pid, UE_id, rnti, - CC_id, aggregation, n_rb_ul_val); - RC.eNB[module_idP][CC_id]->pusch_stats_BO[UE_id][(frameP * 10) + subframeP] = UE_template_ptr->estimated_ul_buffer; - VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_BO,RC.eNB[module_idP][CC_id]->pusch_stats_BO[UE_id][(frameP * - 10) + - subframeP]); - if (UE_is_to_be_scheduled(module_idP, CC_id, UE_id) > 0 || round_index > 0) // || ((frameP%10)==0)) - // if there is information on bsr of DCCH, DTCH or if there is UL_SR, or if there is a packet to retransmit, or we want to schedule a periodic feedback every 10 frames + AssertFatal(round_index < 8, "round %d > 7 for UE %d/%x\n", + round_index, + UE_id, + rnti); + + LOG_D(MAC, "[eNB %d] frame %d subframe %d (sched_frame %d, sched_subframe %d), Checking PUSCH %d for UE %d/%x CC %d : aggregation level %d, N_RB_UL %d\n", + module_idP, + frameP, + subframeP, + sched_frame, + sched_subframeP, + harq_pid, + UE_id, + rnti, + CC_id, + aggregation, + n_rb_ul_tab[CC_id]); + + RC.eNB[module_idP][CC_id]->pusch_stats_BO[UE_id][(frameP * 10) + subframeP] = UE_template_ptr->estimated_ul_buffer; + + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_BO, RC.eNB[module_idP][CC_id]->pusch_stats_BO[UE_id][(frameP * 10) + subframeP]); + + /* + * If there is information on bsr of DCCH, DTCH or if there is UL_SR, + * or if there is a packet to retransmit, or we want to schedule a periodic feedback + */ + if (UE_is_to_be_scheduled(module_idP, CC_id, UE_id) > 0 || round_index > 0) { - LOG_D(MAC, - "[eNB %d][PUSCH %d] Frame %d subframe %d Scheduling UE %d/%x in round %d(SR %d,UL_inactivity timer %d,UL_failure timer %d,cqi_req_timer %d)\n", - module_idP, harq_pid, frameP, subframeP, UE_id, rnti, - round_index, UE_template_ptr->ul_SR, - UE_sched_ctrl_ptr->ul_inactivity_timer, - UE_sched_ctrl_ptr->ul_failure_timer, - UE_sched_ctrl_ptr->cqi_req_timer); + LOG_D(MAC, "[eNB %d][PUSCH %d] Frame %d subframe %d Scheduling UE %d/%x in round %d(SR %d,UL_inactivity timer %d,UL_failure timer %d,cqi_req_timer %d)\n", + module_idP, + harq_pid, + frameP, + subframeP, + UE_id, + rnti, + round_index, + UE_template_ptr->ul_SR, + UE_sched_ctrl_ptr->ul_inactivity_timer, + UE_sched_ctrl_ptr->ul_failure_timer, + UE_sched_ctrl_ptr->cqi_req_timer); + // reset the scheduling request UE_template_ptr->ul_SR = 0; status = mac_eNB_get_rrc_status(module_idP, rnti); @@ -1410,7 +1402,7 @@ schedule_ulsch_rnti(module_id_t module_idP, UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_mcs2 = UE_template_ptr->mcs_UL[harq_pid]; // buffer_occupancy = UE_template_ptr->ul_total_buffer; - while (((rb_table[rb_table_index] > (n_rb_ul_val - first_rb_slice[CC_id])) + while (((rb_table[rb_table_index] > (n_rb_ul_tab[CC_id] - first_rb_slice[CC_id])) || (rb_table[rb_table_index] > 45)) && (rb_table_index > 0)) { rb_table_index--; @@ -1667,7 +1659,7 @@ schedule_ulsch_rnti(module_id_t module_idP, first_rb[CC_id],UE_template_ptr->nb_rb_ul[harq_pid], harq_pid, round_index); - rballoc = mac_xface->computeRIV(frame_parms->n_rb_ul_val, + rballoc = mac_xface->computeRIV(frame_parms->n_rb_ul_tab[CC_id], first_rb[CC_id], UE_template_ptr->nb_rb_ul[harq_pid]); first_rb[CC_id]+=UE_template_ptr->nb_rb_ul[harq_pid]; // increment for next UE allocation @@ -1680,6 +1672,6 @@ schedule_ulsch_rnti(module_id_t module_idP, } */ } // UE_is_to_be_scheduled - } // loop over UE_id - } // loop of CC_id + } // loop over all active CC_ids + } // loop over UE_ids } From a1d5fbea9dac13d57ba87a9f453fea25af063566 Mon Sep 17 00:00:00 2001 From: Stefan Date: Thu, 20 Dec 2018 16:52:06 +0100 Subject: [PATCH 31/31] SSR 21/12/18 ulsch_scheduler_pre_processor2 --- openair2/LAYER2/MAC/pre_processor.c | 1017 ++++++++++++++------------- 1 file changed, 509 insertions(+), 508 deletions(-) diff --git a/openair2/LAYER2/MAC/pre_processor.c b/openair2/LAYER2/MAC/pre_processor.c index 12a3e1704b..a71150fa96 100644 --- a/openair2/LAYER2/MAC/pre_processor.c +++ b/openair2/LAYER2/MAC/pre_processor.c @@ -68,12 +68,12 @@ int phy_stats_exist(module_id_t Mod_id, int rnti) UE_list_t *UE_list = &RC.mac[Mod_id]->UE_list; if (UE_id == -1) { LOG_W(MAC, "[eNB %d] UE %x not found, should be there (in phy_stats_exist)\n", - Mod_id, rnti); + Mod_id, rnti); return 0; } if (UE_list->numactiveCCs[UE_id] == 0) { LOG_W(MAC, "[eNB %d] UE %x has no active CC (in phy_stats_exist)\n", - Mod_id, rnti); + Mod_id, rnti); return 0; } for (i = 0; i < UE_list->numactiveCCs[UE_id]; i++) { @@ -91,7 +91,6 @@ store_dlsch_buffer(module_id_t Mod_id, int slice_idx, frame_t frameP, sub_frame_t subframeP) { - int UE_id, lcid; rnti_t rnti; mac_rlc_status_resp_t rlc_status; @@ -100,13 +99,12 @@ store_dlsch_buffer(module_id_t Mod_id, for (UE_id = 0; UE_id < MAX_MOBILES_PER_ENB; UE_id++) { if (UE_list->active[UE_id] != TRUE) - continue; + continue; if (!ue_dl_slice_membership(Mod_id, UE_id, slice_idx)) continue; UE_template = &UE_list->UE_template[UE_PCCID(Mod_id, UE_id)][UE_id]; - // clear logical channel interface variables UE_template->dl_buffer_total = 0; UE_template->dl_pdus_total = 0; @@ -121,25 +119,23 @@ store_dlsch_buffer(module_id_t Mod_id, rnti = UE_RNTI(Mod_id, UE_id); for (lcid = 0; lcid < MAX_NUM_LCID; ++lcid) { // loop over all the logical channels - - rlc_status = mac_rlc_status_ind(Mod_id, rnti, Mod_id, frameP, subframeP, - ENB_FLAG_YES, MBMS_FLAG_NO, lcid, 0 -#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) - ,0, 0 -#endif - ); + rlc_status = mac_rlc_status_ind(Mod_id, rnti, Mod_id, frameP, subframeP, + ENB_FLAG_YES, MBMS_FLAG_NO, lcid, 0 + #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) + ,0, 0 + #endif + ); UE_template->dl_buffer_info[lcid] = rlc_status.bytes_in_buffer; //storing the dlsch buffer for each logical channel UE_template->dl_pdus_in_buffer[lcid] = rlc_status.pdus_in_buffer; UE_template->dl_buffer_head_sdu_creation_time[lcid] = rlc_status.head_sdu_creation_time; UE_template->dl_buffer_head_sdu_creation_time_max = - cmax(UE_template->dl_buffer_head_sdu_creation_time_max, rlc_status.head_sdu_creation_time); + cmax(UE_template->dl_buffer_head_sdu_creation_time_max, rlc_status.head_sdu_creation_time); UE_template->dl_buffer_head_sdu_remaining_size_to_send[lcid] = rlc_status.head_sdu_remaining_size_to_send; UE_template->dl_buffer_head_sdu_is_segmented[lcid] = rlc_status.head_sdu_is_segmented; UE_template->dl_buffer_total += UE_template->dl_buffer_info[lcid]; //storing the total dlsch buffer UE_template->dl_pdus_total += UE_template->dl_pdus_in_buffer[lcid]; -#ifdef DEBUG_eNB_SCHEDULER - + #ifdef DEBUG_eNB_SCHEDULER /* note for dl_buffer_head_sdu_remaining_size_to_send[lcid] : * 0 if head SDU has not been segmented (yet), else remaining size not already segmented and sent */ @@ -152,9 +148,7 @@ store_dlsch_buffer(module_id_t Mod_id, UE_template->dl_buffer_head_sdu_creation_time[lcid], UE_template->dl_buffer_head_sdu_remaining_size_to_send[lcid], UE_template->dl_buffer_head_sdu_is_segmented[lcid]); - -#endif - + #endif } @@ -178,11 +172,8 @@ assign_rbs_required(module_id_t Mod_id, frame_t frameP, sub_frame_t subframe, uint16_t nb_rbs_required[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB], - int min_rb_unit[NFAPI_CC_MAX]) -{ - + int min_rb_unit[NFAPI_CC_MAX]) { uint16_t TBS = 0; - int UE_id, n, i, j, CC_id, pCCid, tmp; UE_list_t *UE_list = &RC.mac[Mod_id]->UE_list; slice_info_t *sli = &RC.mac[Mod_id]->slice_info; @@ -192,25 +183,27 @@ assign_rbs_required(module_id_t Mod_id, // clear rb allocations across all CC_id for (UE_id = 0; UE_id < MAX_MOBILES_PER_ENB; UE_id++) { if (UE_list->active[UE_id] != TRUE) continue; + if (!ue_dl_slice_membership(Mod_id, UE_id, slice_idx)) continue; + pCCid = UE_PCCID(Mod_id, UE_id); //update CQI information across component carriers for (n = 0; n < UE_list->numactiveCCs[UE_id]; n++) { - CC_id = UE_list->ordered_CCids[n][UE_id]; eNB_UE_stats = &UE_list->eNB_UE_stats[CC_id][UE_id]; -// eNB_UE_stats->dlsch_mcs1 = cmin(cqi_to_mcs[UE_list->UE_sched_ctrl[UE_id].dl_cqi[CC_id]], sli->dl[slice_idx].maxmcs); + // eNB_UE_stats->dlsch_mcs1 = cmin(cqi_to_mcs[UE_list->UE_sched_ctrl[UE_id].dl_cqi[CC_id]], sli->dl[slice_idx].maxmcs); eNB_UE_stats->dlsch_mcs1 = cmin(cqi2mcs(UE_list->UE_sched_ctrl[UE_id].dl_cqi[CC_id]), sli->dl[slice_idx].maxmcs); - } // provide the list of CCs sorted according to MCS for (i = 0; i < UE_list->numactiveCCs[UE_id]; ++i) { eNB_UE_stats_i = &UE_list->eNB_UE_stats[UE_list->ordered_CCids[i][UE_id]][UE_id]; + for (j = i + 1; j < UE_list->numactiveCCs[UE_id]; j++) { DevAssert(j < NFAPI_CC_MAX); eNB_UE_stats_j = &UE_list->eNB_UE_stats[UE_list->ordered_CCids[j][UE_id]][UE_id]; + if (eNB_UE_stats_j->dlsch_mcs1 > eNB_UE_stats_i->dlsch_mcs1) { tmp = UE_list->ordered_CCids[i][UE_id]; UE_list->ordered_CCids[i][UE_id] = UE_list->ordered_CCids[j][UE_id]; @@ -233,18 +226,15 @@ assign_rbs_required(module_id_t Mod_id, } TBS = get_TBS_DL(eNB_UE_stats->dlsch_mcs1, nb_rbs_required[CC_id][UE_id]); - LOG_D(MAC, "[preprocessor] start RB assignement for UE %d CC_id %d dl buffer %d (RB unit %d, MCS %d, TBS %d) \n", UE_id, CC_id, UE_list->UE_template[pCCid][UE_id].dl_buffer_total, nb_rbs_required[CC_id][UE_id], eNB_UE_stats->dlsch_mcs1, TBS); - N_RB_DL = to_prb(RC.mac[Mod_id]->common_channels[CC_id].mib->message.dl_Bandwidth); - UE_list->UE_sched_ctrl[UE_id].max_rbs_allowed_slice[CC_id][slice_idx] = - nb_rbs_allowed_slice(sli->dl[slice_idx].pct, N_RB_DL); + nb_rbs_allowed_slice(sli->dl[slice_idx].pct, N_RB_DL); /* calculating required number of RBs for each UE */ while (TBS < UE_list->UE_template[pCCid][UE_id].dl_buffer_total) { @@ -255,6 +245,7 @@ assign_rbs_required(module_id_t Mod_id, nb_rbs_required[CC_id][UE_id] = UE_list->UE_sched_ctrl[UE_id].max_rbs_allowed_slice[CC_id][slice_idx]; break; } + TBS = get_TBS_DL(eNB_UE_stats->dlsch_mcs1, nb_rbs_required[CC_id][UE_id]); } // end of while @@ -263,7 +254,6 @@ assign_rbs_required(module_id_t Mod_id, Mod_id, frameP, UE_id, CC_id, min_rb_unit[CC_id], nb_rbs_required[CC_id][UE_id], TBS, eNB_UE_stats->dlsch_mcs1); - sli->pre_processor_results[slice_idx].mcs[CC_id][UE_id] = eNB_UE_stats->dlsch_mcs1; } } @@ -275,7 +265,6 @@ assign_rbs_required(module_id_t Mod_id, int maxround(module_id_t Mod_id, uint16_t rnti, int frame, sub_frame_t subframe, uint8_t ul_flag) { - uint8_t round, round_max = 0, UE_id; int CC_id, harq_pid; UE_list_t *UE_list = &RC.mac[Mod_id]->UE_list; @@ -283,11 +272,10 @@ maxround(module_id_t Mod_id, uint16_t rnti, int frame, for (CC_id = 0; CC_id < RC.nb_mac_CC[Mod_id]; CC_id++) { cc = &RC.mac[Mod_id]->common_channels[CC_id]; - UE_id = find_UE_id(Mod_id, rnti); - harq_pid = frame_subframe2_dl_harq_pid(cc->tdd_Config,frame ,subframe); - + harq_pid = frame_subframe2_dl_harq_pid(cc->tdd_Config,frame,subframe); round = UE_list->UE_sched_ctrl[UE_id].round[CC_id][harq_pid]; + if (round > round_max) { round_max = round; } @@ -329,44 +317,39 @@ long min_lcgidpriority(module_id_t Mod_id, int32_t UE_id) { } struct sort_ue_dl_params { - int Mod_idP; - int frameP; - int subframeP; - int slice_idx; + int Mod_idP; + int frameP; + int subframeP; + int slice_idx; }; -static int ue_dl_compare(const void *_a, const void *_b, void *_params) -{ +static int ue_dl_compare(const void *_a, const void *_b, void *_params) { struct sort_ue_dl_params *params = _params; UE_list_t *UE_list = &RC.mac[params->Mod_idP]->UE_list; - int i; int slice_idx = params->slice_idx; int UE_id1 = *(const int *) _a; int UE_id2 = *(const int *) _b; - int rnti1 = UE_RNTI(params->Mod_idP, UE_id1); int pCC_id1 = UE_PCCID(params->Mod_idP, UE_id1); int round1 = maxround(params->Mod_idP, rnti1, params->frameP, params->subframeP, 1); - int rnti2 = UE_RNTI(params->Mod_idP, UE_id2); int pCC_id2 = UE_PCCID(params->Mod_idP, UE_id2); int round2 = maxround(params->Mod_idP, rnti2, params->frameP, params->subframeP, 1); - int cqi1 = maxcqi(params->Mod_idP, UE_id1); int cqi2 = maxcqi(params->Mod_idP, UE_id2); - long lcgid1 = min_lcgidpriority(params->Mod_idP, UE_id1); long lcgid2 = min_lcgidpriority(params->Mod_idP, UE_id2); for (i = 0; i < CR_NUM; ++i) { switch (UE_list->sorting_criteria[slice_idx][i]) { - case CR_ROUND : if (round1 > round2) return -1; + if (round1 < round2) return 1; + break; case CR_SRB12 : @@ -375,41 +358,50 @@ static int ue_dl_compare(const void *_a, const void *_b, void *_params) UE_list->UE_template[pCC_id2][UE_id2].dl_buffer_info[1] + UE_list->UE_template[pCC_id2][UE_id2].dl_buffer_info[2]) return -1; + if (UE_list->UE_template[pCC_id1][UE_id1].dl_buffer_info[1] + UE_list->UE_template[pCC_id1][UE_id1].dl_buffer_info[2] < UE_list->UE_template[pCC_id2][UE_id2].dl_buffer_info[1] + UE_list->UE_template[pCC_id2][UE_id2].dl_buffer_info[2]) return 1; + break; case CR_HOL : if (UE_list-> UE_template[pCC_id1][UE_id1].dl_buffer_head_sdu_creation_time_max > UE_list-> UE_template[pCC_id2][UE_id2].dl_buffer_head_sdu_creation_time_max) return -1; + if (UE_list-> UE_template[pCC_id1][UE_id1].dl_buffer_head_sdu_creation_time_max < UE_list-> UE_template[pCC_id2][UE_id2].dl_buffer_head_sdu_creation_time_max) return 1; + break; case CR_LC : if (UE_list->UE_template[pCC_id1][UE_id1].dl_buffer_total > UE_list->UE_template[pCC_id2][UE_id2].dl_buffer_total) return -1; + if (UE_list->UE_template[pCC_id1][UE_id1].dl_buffer_total < UE_list->UE_template[pCC_id2][UE_id2].dl_buffer_total) return 1; + break; case CR_CQI : if (cqi1 > cqi2) return -1; + if (cqi1 < cqi2) return 1; + break; case CR_LCP : if (lcgid1 < lcgid2) return -1; + if (lcgid1 > lcgid2) return 1; @@ -418,12 +410,11 @@ static int ue_dl_compare(const void *_a, const void *_b, void *_params) } } - return 0; + return 0; } void decode_sorting_policy(module_id_t Mod_idP, int slice_idx) { int i; - UE_list_t *UE_list = &RC.mac[Mod_idP]->UE_list; uint32_t policy = RC.mac[Mod_idP]->slice_info.dl[slice_idx].sorting; uint32_t mask = 0x0000000F; @@ -431,6 +422,7 @@ void decode_sorting_policy(module_id_t Mod_idP, int slice_idx) { for (i = 0; i < CR_NUM; ++i) { criterion = (uint16_t) (policy >> 4 * (CR_NUM - 1 - i) & mask); + if (criterion >= CR_NUM) { LOG_W(MAC, "Invalid criterion in slice index %d ID %d policy, revert to default policy \n", @@ -438,14 +430,14 @@ void decode_sorting_policy(module_id_t Mod_idP, int slice_idx) { RC.mac[Mod_idP]->slice_info.dl[slice_idx].sorting = 0x12345; break; } + UE_list->sorting_criteria[slice_idx][i] = criterion; } } void decode_slice_positioning(module_id_t Mod_idP, int slice_idx, - uint8_t slice_allocation_mask[NFAPI_CC_MAX][N_RBG_MAX]) -{ + uint8_t slice_allocation_mask[NFAPI_CC_MAX][N_RBG_MAX]) { uint8_t CC_id; int RBG, start_frequency, end_frequency; @@ -458,6 +450,7 @@ void decode_slice_positioning(module_id_t Mod_idP, start_frequency = RC.mac[Mod_idP]->slice_info.dl[slice_idx].pos_low; end_frequency = RC.mac[Mod_idP]->slice_info.dl[slice_idx].pos_high; + for (CC_id = 0; CC_id < RC.nb_mac_CC[Mod_idP]; ++CC_id) { for (RBG = start_frequency; RBG <= end_frequency; ++RBG) { slice_allocation_mask[CC_id][RBG] = 1; @@ -467,20 +460,20 @@ void decode_slice_positioning(module_id_t Mod_idP, // This fuction sorts the UE in order their dlsch buffer and CQI -void sort_UEs(module_id_t Mod_idP, int slice_idx, int frameP, sub_frame_t subframeP) -{ +void sort_UEs(module_id_t Mod_idP, int slice_idx, int frameP, sub_frame_t subframeP) { int i; int list[MAX_MOBILES_PER_ENB]; int list_size = 0; struct sort_ue_dl_params params = {Mod_idP, frameP, subframeP, slice_idx}; - UE_list_t *UE_list = &RC.mac[Mod_idP]->UE_list; for (i = 0; i < MAX_MOBILES_PER_ENB; i++) { - if (UE_list->active[i] == FALSE) continue; + if (UE_RNTI(Mod_idP, i) == NOT_A_RNTI) continue; + if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1) continue; + if (!ue_dl_slice_membership(Mod_idP, i, slice_idx)) continue; list[list_size] = i; @@ -488,12 +481,12 @@ void sort_UEs(module_id_t Mod_idP, int slice_idx, int frameP, sub_frame_t subfra } decode_sorting_policy(Mod_idP, slice_idx); - qsort_r(list, list_size, sizeof(int), ue_dl_compare, ¶ms); if (list_size) { for (i = 0; i < list_size - 1; ++i) UE_list->next[list[i]] = list[i + 1]; + UE_list->next[list[list_size - 1]] = -1; UE_list->head = list[0]; } else { @@ -502,18 +495,18 @@ void sort_UEs(module_id_t Mod_idP, int slice_idx, int frameP, sub_frame_t subfra } void dlsch_scheduler_pre_processor_partitioning(module_id_t Mod_id, - int slice_idx, - const uint8_t rbs_retx[NFAPI_CC_MAX]) -{ + int slice_idx, + const uint8_t rbs_retx[NFAPI_CC_MAX]) { int UE_id, CC_id, N_RB_DL, i; UE_list_t *UE_list = &RC.mac[Mod_id]->UE_list; UE_sched_ctrl *ue_sched_ctl; uint16_t available_rbs; for (UE_id = UE_list->head; UE_id >= 0; UE_id = UE_list->next[UE_id]) { - if (UE_RNTI(Mod_id, UE_id) == NOT_A_RNTI) continue; + if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync == 1) continue; + if (!ue_dl_slice_membership(Mod_id, UE_id, slice_idx)) continue; ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; @@ -522,6 +515,7 @@ void dlsch_scheduler_pre_processor_partitioning(module_id_t Mod_id, CC_id = UE_list->ordered_CCids[i][UE_id]; N_RB_DL = to_prb(RC.mac[Mod_id]->common_channels[CC_id].mib->message.dl_Bandwidth); available_rbs = nb_rbs_allowed_slice(RC.mac[Mod_id]->slice_info.dl[slice_idx].pct, N_RB_DL); + if (rbs_retx[CC_id] < available_rbs) ue_sched_ctl->max_rbs_allowed_slice[CC_id][slice_idx] = available_rbs - rbs_retx[CC_id]; else @@ -531,16 +525,14 @@ void dlsch_scheduler_pre_processor_partitioning(module_id_t Mod_id, } void dlsch_scheduler_pre_processor_accounting(module_id_t Mod_id, - int slice_idx, - frame_t frameP, - sub_frame_t subframeP, - int min_rb_unit[NFAPI_CC_MAX], - uint16_t nb_rbs_required[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB], - uint16_t nb_rbs_accounted[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB]) -{ + int slice_idx, + frame_t frameP, + sub_frame_t subframeP, + int min_rb_unit[NFAPI_CC_MAX], + uint16_t nb_rbs_required[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB], + uint16_t nb_rbs_accounted[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB]) { int UE_id, CC_id; int i; - rnti_t rnti; uint8_t harq_pid, round; uint16_t available_rbs[NFAPI_CC_MAX]; @@ -550,7 +542,6 @@ void dlsch_scheduler_pre_processor_accounting(module_id_t Mod_id, int ue_count_newtx[NFAPI_CC_MAX]; int ue_count_retx[NFAPI_CC_MAX]; //uint8_t ue_retx_flag[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB]; - UE_list_t *UE_list = &RC.mac[Mod_id]->UE_list; UE_sched_ctrl *ue_sched_ctl; COMMON_channels_t *cc; @@ -571,15 +562,18 @@ void dlsch_scheduler_pre_processor_accounting(module_id_t Mod_id, // Find total UE count, and account the RBs required for retransmissions for (UE_id = UE_list->head; UE_id >= 0; UE_id = UE_list->next[UE_id]) { rnti = UE_RNTI(Mod_id, UE_id); + if (rnti == NOT_A_RNTI) continue; + if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync == 1) continue; + if (!ue_dl_slice_membership(Mod_id, UE_id, slice_idx)) continue; for (i = 0; i < UE_num_active_CC(UE_list, UE_id); ++i) { CC_id = UE_list->ordered_CCids[i][UE_id]; ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; cc = &RC.mac[Mod_id]->common_channels[CC_id]; - harq_pid = frame_subframe2_dl_harq_pid(cc->tdd_Config,frameP ,subframeP); + harq_pid = frame_subframe2_dl_harq_pid(cc->tdd_Config,frameP,subframeP); round = ue_sched_ctl->round[CC_id][harq_pid]; if (nb_rbs_required[CC_id][UE_id] > 0) { @@ -603,46 +597,53 @@ void dlsch_scheduler_pre_processor_accounting(module_id_t Mod_id, for (CC_id = 0; CC_id < RC.nb_mac_CC[Mod_id]; ++CC_id) { if (UE_list->head < 0) continue; // no UEs in list - // max_rbs_allowed_slice is saved in every UE, so take it from the first one + + // max_rbs_allowed_slice is saved in every UE, so take it from the first one ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_list->head]; available_rbs[CC_id] = ue_sched_ctl->max_rbs_allowed_slice[CC_id][slice_idx]; } switch (RC.mac[Mod_id]->slice_info.dl[slice_idx].accounting) { - // If greedy scheduling, try to account all the required RBs case POL_GREEDY: - for (UE_id = UE_list->head; UE_id >= 0; UE_id = UE_list->next[UE_id]) { rnti = UE_RNTI(Mod_id, UE_id); + if (rnti == NOT_A_RNTI) continue; + if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync == 1) continue; + if (!ue_dl_slice_membership(Mod_id, UE_id, slice_idx)) continue; for (i = 0; i < UE_num_active_CC(UE_list, UE_id); i++) { CC_id = UE_list->ordered_CCids[i][UE_id]; + if (available_rbs[CC_id] == 0) continue; + nb_rbs_accounted[CC_id][UE_id] = cmin(nb_rbs_required[CC_id][UE_id], available_rbs[CC_id]); available_rbs[CC_id] -= nb_rbs_accounted[CC_id][UE_id]; } } + break; // Use the old, fair algorithm // Loop over all active UEs and account the avg number of RBs to each UE, based on all non-retx UEs. // case POL_FAIR: default: + // FIXME: This is not ideal, why loop on UEs to find average_rbs_per_user[], that is per-CC? // TODO: Look how to loop on active CCs only without using the UE_num_active_CC() function. for (UE_id = UE_list->head; UE_id >= 0; UE_id = UE_list->next[UE_id]) { rnti = UE_RNTI(Mod_id, UE_id); if (rnti == NOT_A_RNTI) continue; + if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync == 1) continue; + if (!ue_dl_slice_membership(Mod_id, UE_id, slice_idx)) continue; for (i = 0; i < UE_num_active_CC(UE_list, UE_id); ++i) { - CC_id = UE_list->ordered_CCids[i][UE_id]; ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; available_rbs[CC_id] = ue_sched_ctl->max_rbs_allowed_slice[CC_id][slice_idx]; @@ -662,8 +663,11 @@ void dlsch_scheduler_pre_processor_accounting(module_id_t Mod_id, // extend nb_rbs_required to capture per LCID RB required for (UE_id = UE_list->head; UE_id >= 0; UE_id = UE_list->next[UE_id]) { rnti = UE_RNTI(Mod_id, UE_id); + if (rnti == NOT_A_RNTI) continue; + if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync == 1) continue; + if (!ue_dl_slice_membership(Mod_id, UE_id, slice_idx)) continue; for (i = 0; i < UE_num_active_CC(UE_list, UE_id); i++) { @@ -671,25 +675,26 @@ void dlsch_scheduler_pre_processor_accounting(module_id_t Mod_id, nb_rbs_accounted[CC_id][UE_id] = cmin(average_rbs_per_user[CC_id], nb_rbs_required[CC_id][UE_id]); } } + break; } - - - // Check retransmissions // TODO: Do this once at the beginning for (UE_id = UE_list->head; UE_id >= 0; UE_id = UE_list->next[UE_id]) { rnti = UE_RNTI(Mod_id, UE_id); + if (rnti == NOT_A_RNTI) continue; + if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync == 1) continue; + if (!ue_dl_slice_membership(Mod_id, UE_id, slice_idx)) continue; for (i = 0; i < UE_num_active_CC(UE_list, UE_id); i++) { CC_id = UE_list->ordered_CCids[i][UE_id]; ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; cc = &RC.mac[Mod_id]->common_channels[CC_id]; - harq_pid = frame_subframe2_dl_harq_pid(cc->tdd_Config,frameP ,subframeP); + harq_pid = frame_subframe2_dl_harq_pid(cc->tdd_Config,frameP,subframeP); round = ue_sched_ctl->round[CC_id][harq_pid]; // control channel or retransmission @@ -702,23 +707,23 @@ void dlsch_scheduler_pre_processor_accounting(module_id_t Mod_id, } void dlsch_scheduler_pre_processor_positioning(module_id_t Mod_id, - int slice_idx, - int min_rb_unit[NFAPI_CC_MAX], - uint16_t nb_rbs_required[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB], - uint16_t nb_rbs_accounted[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB], - uint16_t nb_rbs_remaining[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB], - uint8_t rballoc_sub[NFAPI_CC_MAX][N_RBG_MAX], - uint8_t MIMO_mode_indicator[NFAPI_CC_MAX][N_RBG_MAX]) -{ + int slice_idx, + int min_rb_unit[NFAPI_CC_MAX], + uint16_t nb_rbs_required[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB], + uint16_t nb_rbs_accounted[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB], + uint16_t nb_rbs_remaining[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB], + uint8_t rballoc_sub[NFAPI_CC_MAX][N_RBG_MAX], + uint8_t MIMO_mode_indicator[NFAPI_CC_MAX][N_RBG_MAX]) { int UE_id, CC_id; int i; -#ifdef TM5 + + #ifdef TM5 uint8_t transmission_mode; -#endif + #endif + uint8_t slice_allocation_mask[NFAPI_CC_MAX][N_RBG_MAX]; int N_RBG[NFAPI_CC_MAX]; UE_list_t *UE_list = &RC.mac[Mod_id]->UE_list; - decode_slice_positioning(Mod_id, slice_idx, slice_allocation_mask); for (CC_id = 0; CC_id < RC.nb_mac_CC[Mod_id]; CC_id++) { @@ -728,17 +733,19 @@ void dlsch_scheduler_pre_processor_positioning(module_id_t Mod_id, // Try to allocate accounted RBs for (UE_id = UE_list->head; UE_id >= 0; UE_id = UE_list->next[UE_id]) { - if (UE_RNTI(Mod_id, UE_id) == NOT_A_RNTI) continue; + if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync == 1) continue; + if (!ue_dl_slice_membership(Mod_id, UE_id, slice_idx)) continue; for (i = 0; i < UE_num_active_CC(UE_list, UE_id); i++) { CC_id = UE_list->ordered_CCids[i][UE_id]; nb_rbs_remaining[CC_id][UE_id] = nb_rbs_accounted[CC_id][UE_id]; -#ifdef TM5 + + #ifdef TM5 transmission_mode = get_tmode(Mod_id, CC_id, UE_id); -#endif + #endif if (nb_rbs_required[CC_id][UE_id] > 0) LOG_D(MAC, @@ -764,191 +771,183 @@ void dlsch_scheduler_pre_processor_positioning(module_id_t Mod_id, slice_allocation_mask, MIMO_mode_indicator); -#ifdef TM5 + #ifdef TM5 // data chanel TM5: to be revisited - if ((round == 0) && - (transmission_mode == 5) && - (ue_sched_ctl->dl_pow_off[CC_id] != 1)) { - + if ((round == 0) && + (transmission_mode == 5) && + (ue_sched_ctl->dl_pow_off[CC_id] != 1)) { for (j = 0; j < N_RBG[CC_id]; j += 2) { - - if ((((j == (N_RBG[CC_id] - 1)) - && (rballoc_sub[CC_id][j] == 0) - && (ue_sched_ctl-> - rballoc_sub_UE[CC_id][j] == 0)) - || ((j < (N_RBG[CC_id] - 1)) - && (rballoc_sub[CC_id][j + 1] == 0) - && - (ue_sched_ctl->rballoc_sub_UE - [CC_id][j + 1] == 0))) - && (nb_rbs_remaining[CC_id][UE_id] - > 0)) { - + if ((((j == (N_RBG[CC_id] - 1)) + && (rballoc_sub[CC_id][j] == 0) + && (ue_sched_ctl-> + rballoc_sub_UE[CC_id][j] == 0)) + || ((j < (N_RBG[CC_id] - 1)) + && (rballoc_sub[CC_id][j + 1] == 0) + && + (ue_sched_ctl->rballoc_sub_UE + [CC_id][j + 1] == 0))) + && (nb_rbs_remaining[CC_id][UE_id] + > 0)) { for (i = UE_list->next[UE_id + 1]; i >= 0; i = UE_list->next[i]) { - - UE_id2 = i; - rnti2 = UE_RNTI(Mod_id, UE_id2); - ue_sched_ctl2 = + UE_id2 = i; + rnti2 = UE_RNTI(Mod_id, UE_id2); + ue_sched_ctl2 = &UE_list->UE_sched_ctrl[UE_id2]; - round2 = ue_sched_ctl2->round[CC_id]; - if (rnti2 == NOT_A_RNTI) - continue; - if (UE_list-> - UE_sched_ctrl - [UE_id2].ul_out_of_sync == 1) + round2 = ue_sched_ctl2->round[CC_id]; + + if (rnti2 == NOT_A_RNTI) continue; - eNB_UE_stats2 = + if (UE_list-> + UE_sched_ctrl + [UE_id2].ul_out_of_sync == 1) + continue; + + eNB_UE_stats2 = UE_list-> eNB_UE_stats[CC_id][UE_id2]; - //mac_xface->get_ue_active_harq_pid(Mod_id,CC_id,rnti2,frameP,subframeP,&harq_pid2,&round2,0); - - if ((mac_eNB_get_rrc_status - (Mod_id, - rnti2) >= RRC_RECONFIGURED) - && (round2 == 0) - && - (get_tmode(Mod_id, CC_id, UE_id2) - == 5) - && (ue_sched_ctl-> - dl_pow_off[CC_id] != 1)) { + //mac_xface->get_ue_active_harq_pid(Mod_id,CC_id,rnti2,frameP,subframeP,&harq_pid2,&round2,0); + if ((mac_eNB_get_rrc_status + (Mod_id, + rnti2) >= RRC_RECONFIGURED) + && (round2 == 0) + && + (get_tmode(Mod_id, CC_id, UE_id2) + == 5) + && (ue_sched_ctl-> + dl_pow_off[CC_id] != 1)) { if ((((j == (N_RBG[CC_id] - 1)) && (ue_sched_ctl->rballoc_sub_UE [CC_id][j] == 0)) || ((j < (N_RBG[CC_id] - 1)) - && - (ue_sched_ctl-> - rballoc_sub_UE[CC_id][j + - 1] - == 0))) + && + (ue_sched_ctl-> + rballoc_sub_UE[CC_id][j + + 1] + == 0))) && (nb_rbs_remaining [CC_id] [UE_id2] > 0)) { - - if ((((eNB_UE_stats2-> - DL_pmi_single ^ - eNB_UE_stats1-> - DL_pmi_single) - << (14 - j)) & 0xc000) == 0x4000) { //MU-MIMO only for 25 RBs configuration - + if ((((eNB_UE_stats2-> + DL_pmi_single ^ + eNB_UE_stats1-> + DL_pmi_single) + << (14 - j)) & 0xc000) == 0x4000) { //MU-MIMO only for 25 RBs configuration rballoc_sub[CC_id][j] = 1; ue_sched_ctl-> - rballoc_sub_UE[CC_id] - [j] = 1; + rballoc_sub_UE[CC_id] + [j] = 1; ue_sched_ctl2-> - rballoc_sub_UE[CC_id] - [j] = 1; + rballoc_sub_UE[CC_id] + [j] = 1; MIMO_mode_indicator[CC_id] - [j] = 0; + [j] = 0; if (j < N_RBG[CC_id] - 1) { - rballoc_sub[CC_id][j + - 1] = - 1; - ue_sched_ctl-> - rballoc_sub_UE - [CC_id][j + 1] = 1; - ue_sched_ctl2->rballoc_sub_UE - [CC_id][j + 1] = 1; - MIMO_mode_indicator - [CC_id][j + 1] + rballoc_sub[CC_id][j + + 1] = + 1; + ue_sched_ctl-> + rballoc_sub_UE + [CC_id][j + 1] = 1; + ue_sched_ctl2->rballoc_sub_UE + [CC_id][j + 1] = 1; + MIMO_mode_indicator + [CC_id][j + 1] = 0; } ue_sched_ctl-> - dl_pow_off[CC_id] - = 0; + dl_pow_off[CC_id] + = 0; ue_sched_ctl2-> - dl_pow_off[CC_id] - = 0; - + dl_pow_off[CC_id] + = 0; if ((j == N_RBG[CC_id] - 1) && ((N_RB_DL == 25) - || (N_RB_DL == - 50))) { - - nb_rbs_remaining - [CC_id][UE_id] = + || (N_RB_DL == + 50))) { + nb_rbs_remaining + [CC_id][UE_id] = nb_rbs_remaining [CC_id][UE_id] - min_rb_unit[CC_id] + 1; - ue_sched_ctl->pre_nb_available_rbs - [CC_id] = + ue_sched_ctl->pre_nb_available_rbs + [CC_id] = ue_sched_ctl->pre_nb_available_rbs [CC_id] + min_rb_unit[CC_id] - 1; - nb_rbs_remaining - [CC_id][UE_id2] = + nb_rbs_remaining + [CC_id][UE_id2] = nb_rbs_remaining [CC_id][UE_id2] - min_rb_unit[CC_id] + 1; - ue_sched_ctl2->pre_nb_available_rbs - [CC_id] = + ue_sched_ctl2->pre_nb_available_rbs + [CC_id] = ue_sched_ctl2->pre_nb_available_rbs [CC_id] + min_rb_unit[CC_id] - 1; } else { - - nb_rbs_remaining - [CC_id][UE_id] = + nb_rbs_remaining + [CC_id][UE_id] = nb_rbs_remaining [CC_id][UE_id] - 4; - ue_sched_ctl->pre_nb_available_rbs - [CC_id] = + ue_sched_ctl->pre_nb_available_rbs + [CC_id] = ue_sched_ctl->pre_nb_available_rbs [CC_id] + 4; - nb_rbs_remaining - [CC_id][UE_id2] = + nb_rbs_remaining + [CC_id][UE_id2] = nb_rbs_remaining [CC_id][UE_id2] - 4; - ue_sched_ctl2->pre_nb_available_rbs - [CC_id] = + ue_sched_ctl2->pre_nb_available_rbs + [CC_id] = ue_sched_ctl2->pre_nb_available_rbs [CC_id] + 4; } - break; - } - } + } } + } } - } + } } - } -#endif + } + #endif + } } } void dlsch_scheduler_pre_processor_intraslice_sharing(module_id_t Mod_id, - int slice_idx, - int min_rb_unit[NFAPI_CC_MAX], - uint16_t nb_rbs_required[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB], - uint16_t nb_rbs_accounted[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB], - uint16_t nb_rbs_remaining[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB], - uint8_t rballoc_sub[NFAPI_CC_MAX][N_RBG_MAX], - uint8_t MIMO_mode_indicator[NFAPI_CC_MAX][N_RBG_MAX]) -{ + int slice_idx, + int min_rb_unit[NFAPI_CC_MAX], + uint16_t nb_rbs_required[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB], + uint16_t nb_rbs_accounted[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB], + uint16_t nb_rbs_remaining[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB], + uint8_t rballoc_sub[NFAPI_CC_MAX][N_RBG_MAX], + uint8_t MIMO_mode_indicator[NFAPI_CC_MAX][N_RBG_MAX]) { int UE_id, CC_id; int i; -#ifdef TM5 + + #ifdef TM5 uint8_t transmission_mode; -#endif + #endif + UE_list_t *UE_list = &RC.mac[Mod_id]->UE_list; int N_RBG[NFAPI_CC_MAX]; slice_info_t *sli = &RC.mac[Mod_id]->slice_info; uint8_t (*slice_allocation_mask)[N_RBG_MAX] = sli->pre_processor_results[slice_idx].slice_allocation_mask; - decode_slice_positioning(Mod_id, slice_idx, slice_allocation_mask); for (CC_id = 0; CC_id < RC.nb_mac_CC[Mod_id]; CC_id++) { @@ -958,20 +957,23 @@ void dlsch_scheduler_pre_processor_intraslice_sharing(module_id_t Mod_id, // Remaining RBs are allocated to high priority UEs for (UE_id = UE_list->head; UE_id >= 0; UE_id = UE_list->next[UE_id]) { - if (UE_RNTI(Mod_id, UE_id) == NOT_A_RNTI) continue; + if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync == 1) continue; + if (!ue_dl_slice_membership(Mod_id, UE_id, slice_idx)) continue; for (i = 0; i < UE_num_active_CC(UE_list, UE_id); i++) { CC_id = UE_list->ordered_CCids[i][UE_id]; nb_rbs_remaining[CC_id][UE_id] = - nb_rbs_required[CC_id][UE_id] - nb_rbs_accounted[CC_id][UE_id] + nb_rbs_remaining[CC_id][UE_id]; + nb_rbs_required[CC_id][UE_id] - nb_rbs_accounted[CC_id][UE_id] + nb_rbs_remaining[CC_id][UE_id]; + if (nb_rbs_remaining[CC_id][UE_id] < 0) abort(); -#ifdef TM5 + + #ifdef TM5 transmission_mode = get_tmode(Mod_id, CC_id, UE_id); -#endif + #endif if (nb_rbs_required[CC_id][UE_id] > 0) LOG_D(MAC, @@ -997,168 +999,161 @@ void dlsch_scheduler_pre_processor_intraslice_sharing(module_id_t Mod_id, slice_allocation_mask, MIMO_mode_indicator); -#ifdef TM5 + #ifdef TM5 // data chanel TM5: to be revisited - if ((round == 0) && - (transmission_mode == 5) && - (ue_sched_ctl->dl_pow_off[CC_id] != 1)) { + if ((round == 0) && + (transmission_mode == 5) && + (ue_sched_ctl->dl_pow_off[CC_id] != 1)) { + for (j = 0; j < N_RBG[CC_id]; j += 2) { + if ((((j == (N_RBG[CC_id] - 1)) + && (rballoc_sub[CC_id][j] == 0) + && (ue_sched_ctl-> + rballoc_sub_UE[CC_id][j] == 0)) + || ((j < (N_RBG[CC_id] - 1)) + && (rballoc_sub[CC_id][j + 1] == 0) + && + (ue_sched_ctl->rballoc_sub_UE + [CC_id][j + 1] == 0))) + && (nb_rbs_remaining[CC_id][UE_id] + > 0)) { + for (i = UE_list->next[UE_id + 1]; i >= 0; + i = UE_list->next[i]) { + UE_id2 = i; + rnti2 = UE_RNTI(Mod_id, UE_id2); + ue_sched_ctl2 = + &UE_list->UE_sched_ctrl[UE_id2]; + round2 = ue_sched_ctl2->round[CC_id]; - for (j = 0; j < N_RBG[CC_id]; j += 2) { + if (rnti2 == NOT_A_RNTI) + continue; - if ((((j == (N_RBG[CC_id] - 1)) - && (rballoc_sub[CC_id][j] == 0) - && (ue_sched_ctl-> - rballoc_sub_UE[CC_id][j] == 0)) - || ((j < (N_RBG[CC_id] - 1)) - && (rballoc_sub[CC_id][j + 1] == 0) - && - (ue_sched_ctl->rballoc_sub_UE - [CC_id][j + 1] == 0))) - && (nb_rbs_remaining[CC_id][UE_id] - > 0)) { + if (UE_list-> + UE_sched_ctrl + [UE_id2].ul_out_of_sync == 1) + continue; - for (i = UE_list->next[UE_id + 1]; i >= 0; - i = UE_list->next[i]) { + eNB_UE_stats2 = + UE_list-> + eNB_UE_stats[CC_id][UE_id2]; + //mac_xface->get_ue_active_harq_pid(Mod_id,CC_id,rnti2,frameP,subframeP,&harq_pid2,&round2,0); - UE_id2 = i; - rnti2 = UE_RNTI(Mod_id, UE_id2); - ue_sched_ctl2 = - &UE_list->UE_sched_ctrl[UE_id2]; - round2 = ue_sched_ctl2->round[CC_id]; - if (rnti2 == NOT_A_RNTI) - continue; - if (UE_list-> - UE_sched_ctrl - [UE_id2].ul_out_of_sync == 1) - continue; - - eNB_UE_stats2 = - UE_list-> - eNB_UE_stats[CC_id][UE_id2]; - //mac_xface->get_ue_active_harq_pid(Mod_id,CC_id,rnti2,frameP,subframeP,&harq_pid2,&round2,0); - - if ((mac_eNB_get_rrc_status - (Mod_id, - rnti2) >= RRC_RECONFIGURED) - && (round2 == 0) - && - (get_tmode(Mod_id, CC_id, UE_id2) - == 5) - && (ue_sched_ctl-> - dl_pow_off[CC_id] != 1)) { - - if ((((j == (N_RBG[CC_id] - 1)) + if ((mac_eNB_get_rrc_status + (Mod_id, + rnti2) >= RRC_RECONFIGURED) + && (round2 == 0) && - (ue_sched_ctl->rballoc_sub_UE - [CC_id][j] == 0)) - || ((j < (N_RBG[CC_id] - 1)) - && - (ue_sched_ctl-> - rballoc_sub_UE[CC_id][j + - 1] - == 0))) - && - (nb_rbs_remaining - [CC_id] - [UE_id2] > 0)) { - - if ((((eNB_UE_stats2-> - DL_pmi_single ^ - eNB_UE_stats1-> - DL_pmi_single) - << (14 - j)) & 0xc000) == 0x4000) { //MU-MIMO only for 25 RBs configuration - - rballoc_sub[CC_id][j] = 1; - ue_sched_ctl-> + (get_tmode(Mod_id, CC_id, UE_id2) + == 5) + && (ue_sched_ctl-> + dl_pow_off[CC_id] != 1)) { + if ((((j == (N_RBG[CC_id] - 1)) + && + (ue_sched_ctl->rballoc_sub_UE + [CC_id][j] == 0)) + || ((j < (N_RBG[CC_id] - 1)) + && + (ue_sched_ctl-> + rballoc_sub_UE[CC_id][j + + 1] + == 0))) + && + (nb_rbs_remaining + [CC_id] + [UE_id2] > 0)) { + if ((((eNB_UE_stats2-> + DL_pmi_single ^ + eNB_UE_stats1-> + DL_pmi_single) + << (14 - j)) & 0xc000) == 0x4000) { //MU-MIMO only for 25 RBs configuration + rballoc_sub[CC_id][j] = 1; + ue_sched_ctl-> rballoc_sub_UE[CC_id] [j] = 1; - ue_sched_ctl2-> + ue_sched_ctl2-> rballoc_sub_UE[CC_id] [j] = 1; - MIMO_mode_indicator[CC_id] + MIMO_mode_indicator[CC_id] [j] = 0; - if (j < N_RBG[CC_id] - 1) { - rballoc_sub[CC_id][j + - 1] = - 1; + if (j < N_RBG[CC_id] - 1) { + rballoc_sub[CC_id][j + + 1] = + 1; + ue_sched_ctl-> + rballoc_sub_UE + [CC_id][j + 1] = 1; + ue_sched_ctl2->rballoc_sub_UE + [CC_id][j + 1] = 1; + MIMO_mode_indicator + [CC_id][j + 1] + = 0; + } + ue_sched_ctl-> - rballoc_sub_UE - [CC_id][j + 1] = 1; - ue_sched_ctl2->rballoc_sub_UE - [CC_id][j + 1] = 1; - MIMO_mode_indicator - [CC_id][j + 1] - = 0; - } - - ue_sched_ctl-> dl_pow_off[CC_id] - = 0; - ue_sched_ctl2-> + = 0; + ue_sched_ctl2-> dl_pow_off[CC_id] - = 0; + = 0; + if ((j == N_RBG[CC_id] - 1) + && ((N_RB_DL == 25) + || (N_RB_DL == + 50))) { + nb_rbs_remaining + [CC_id][UE_id] = + nb_rbs_remaining + [CC_id][UE_id] - + min_rb_unit[CC_id] + + 1; + ue_sched_ctl->pre_nb_available_rbs + [CC_id] = + ue_sched_ctl->pre_nb_available_rbs + [CC_id] + + min_rb_unit[CC_id] + - 1; + nb_rbs_remaining + [CC_id][UE_id2] = + nb_rbs_remaining + [CC_id][UE_id2] - + min_rb_unit[CC_id] + + 1; + ue_sched_ctl2->pre_nb_available_rbs + [CC_id] = + ue_sched_ctl2->pre_nb_available_rbs + [CC_id] + + min_rb_unit[CC_id] + - 1; + } else { + nb_rbs_remaining + [CC_id][UE_id] = + nb_rbs_remaining + [CC_id][UE_id] - 4; + ue_sched_ctl->pre_nb_available_rbs + [CC_id] = + ue_sched_ctl->pre_nb_available_rbs + [CC_id] + 4; + nb_rbs_remaining + [CC_id][UE_id2] = + nb_rbs_remaining + [CC_id][UE_id2] - + 4; + ue_sched_ctl2->pre_nb_available_rbs + [CC_id] = + ue_sched_ctl2->pre_nb_available_rbs + [CC_id] + 4; + } - if ((j == N_RBG[CC_id] - 1) - && ((N_RB_DL == 25) - || (N_RB_DL == - 50))) { - - nb_rbs_remaining - [CC_id][UE_id] = - nb_rbs_remaining - [CC_id][UE_id] - - min_rb_unit[CC_id] - + 1; - ue_sched_ctl->pre_nb_available_rbs - [CC_id] = - ue_sched_ctl->pre_nb_available_rbs - [CC_id] + - min_rb_unit[CC_id] - - 1; - nb_rbs_remaining - [CC_id][UE_id2] = - nb_rbs_remaining - [CC_id][UE_id2] - - min_rb_unit[CC_id] - + 1; - ue_sched_ctl2->pre_nb_available_rbs - [CC_id] = - ue_sched_ctl2->pre_nb_available_rbs - [CC_id] + - min_rb_unit[CC_id] - - 1; - } else { - - nb_rbs_remaining - [CC_id][UE_id] = - nb_rbs_remaining - [CC_id][UE_id] - 4; - ue_sched_ctl->pre_nb_available_rbs - [CC_id] = - ue_sched_ctl->pre_nb_available_rbs - [CC_id] + 4; - nb_rbs_remaining - [CC_id][UE_id2] = - nb_rbs_remaining - [CC_id][UE_id2] - - 4; - ue_sched_ctl2->pre_nb_available_rbs - [CC_id] = - ue_sched_ctl2->pre_nb_available_rbs - [CC_id] + 4; + break; + } } + } + } + } + } + } + #endif - break; - } - } - } - } - } - } - } -#endif } } } @@ -1170,24 +1165,19 @@ dlsch_scheduler_pre_processor(module_id_t Mod_id, frame_t frameP, sub_frame_t subframeP, int *mbsfn_flag, - uint8_t rballoc_sub[NFAPI_CC_MAX][N_RBG_MAX]) -{ + uint8_t rballoc_sub[NFAPI_CC_MAX][N_RBG_MAX]) { int UE_id; uint8_t CC_id; uint16_t i, j; - int min_rb_unit[NFAPI_CC_MAX]; - slice_info_t *sli = &RC.mac[Mod_id]->slice_info; uint16_t (*nb_rbs_required)[MAX_MOBILES_PER_ENB] = sli->pre_processor_results[slice_idx].nb_rbs_required; uint16_t (*nb_rbs_accounted)[MAX_MOBILES_PER_ENB] = sli->pre_processor_results[slice_idx].nb_rbs_accounted; uint16_t (*nb_rbs_remaining)[MAX_MOBILES_PER_ENB] = sli->pre_processor_results[slice_idx].nb_rbs_remaining; uint8_t (*MIMO_mode_indicator)[N_RBG_MAX] = sli->pre_processor_results[slice_idx].MIMO_mode_indicator; - UE_list_t *UE_list = &RC.mac[Mod_id]->UE_list; UE_sched_ctrl *ue_sched_ctl; -// int rrc_status = RRC_IDLE; - + // int rrc_status = RRC_IDLE; #ifdef TM5 int harq_pid1 = 0; int round1 = 0, round2 = 0; @@ -1198,7 +1188,6 @@ dlsch_scheduler_pre_processor(module_id_t Mod_id, LTE_eNB_UE_stats *eNB_UE_stats2 = NULL; UE_sched_ctrl *ue_sched_ctl1, *ue_sched_ctl2; #endif - // Initialize scheduling information for all active UEs memset(&sli->pre_processor_results[slice_idx], 0, sizeof(sli->pre_processor_results[slice_idx])); // FIXME: After the memset above, some of the resets in reset() are redundant @@ -1208,46 +1197,43 @@ dlsch_scheduler_pre_processor(module_id_t Mod_id, rballoc_sub, MIMO_mode_indicator, mbsfn_flag); // FIXME: Not sure if useful - // STATUS // Store the DLSCH buffer for each logical channel store_dlsch_buffer(Mod_id, slice_idx, frameP, subframeP); - // Calculate the number of RBs required by each UE on the basis of logical channel's buffer assign_rbs_required(Mod_id, slice_idx, frameP, subframeP, nb_rbs_required, min_rb_unit); - // Sorts the user on the basis of dlsch logical channel buffer and CQI sort_UEs(Mod_id, slice_idx, frameP, subframeP); - // ACCOUNTING // This procedure decides the number of RBs to allocate dlsch_scheduler_pre_processor_accounting(Mod_id, slice_idx, frameP, subframeP, - min_rb_unit, - nb_rbs_required, - nb_rbs_accounted); + min_rb_unit, + nb_rbs_required, + nb_rbs_accounted); // POSITIONING // This procedure does the main allocation of the RBs dlsch_scheduler_pre_processor_positioning(Mod_id, slice_idx, - min_rb_unit, - nb_rbs_required, - nb_rbs_accounted, - nb_rbs_remaining, - rballoc_sub, - MIMO_mode_indicator); + min_rb_unit, + nb_rbs_required, + nb_rbs_accounted, + nb_rbs_remaining, + rballoc_sub, + MIMO_mode_indicator); // SHARING // If there are available RBs left in the slice, allocate them to the highest priority UEs if (RC.mac[Mod_id]->slice_info.intraslice_share_active) { dlsch_scheduler_pre_processor_intraslice_sharing(Mod_id, slice_idx, - min_rb_unit, - nb_rbs_required, - nb_rbs_accounted, - nb_rbs_remaining, - rballoc_sub, - MIMO_mode_indicator); + min_rb_unit, + nb_rbs_required, + nb_rbs_accounted, + nb_rbs_remaining, + rballoc_sub, + MIMO_mode_indicator); } #ifdef TM5 + // This has to be revisited!!!! for (CC_id = 0; CC_id < RC.nb_mac_CC[Mod_id]; CC_id++) { COMMON_channels_t *cc = &RC.mac[Mod_id]->common_channels[CC_id]; @@ -1258,42 +1244,42 @@ dlsch_scheduler_pre_processor(module_id_t Mod_id, for (j = 0; j < N_RBG; j++) { if (MIMO_mode_indicator[CC_id][j] == 2) { - i1 = i1 + 1; + i1 = i1 + 1; } else if (MIMO_mode_indicator[CC_id][j] == 1) { - i2 = i2 + 1; + i2 = i2 + 1; } else if (MIMO_mode_indicator[CC_id][j] == 0) { - i3 = i3 + 1; + i3 = i3 + 1; } } if ((i1 < N_RBG) && (i2 > 0) && (i3 == 0)) { PHY_vars_eNB_g[Mod_id][CC_id]->check_for_SUMIMO_transmissions = - PHY_vars_eNB_g[Mod_id][CC_id]-> - check_for_SUMIMO_transmissions + 1; + PHY_vars_eNB_g[Mod_id][CC_id]-> + check_for_SUMIMO_transmissions + 1; } if (i3 == N_RBG && i1 == 0 && i2 == 0) { PHY_vars_eNB_g[Mod_id][CC_id]->FULL_MUMIMO_transmissions = - PHY_vars_eNB_g[Mod_id][CC_id]->FULL_MUMIMO_transmissions + - 1; + PHY_vars_eNB_g[Mod_id][CC_id]->FULL_MUMIMO_transmissions + + 1; } if ((i1 < N_RBG) && (i3 > 0)) { PHY_vars_eNB_g[Mod_id][CC_id]->check_for_MUMIMO_transmissions = - PHY_vars_eNB_g[Mod_id][CC_id]-> - check_for_MUMIMO_transmissions + 1; + PHY_vars_eNB_g[Mod_id][CC_id]-> + check_for_MUMIMO_transmissions + 1; } PHY_vars_eNB_g[Mod_id][CC_id]->check_for_total_transmissions = PHY_vars_eNB_g[Mod_id][CC_id]->check_for_total_transmissions + 1; - } + #endif for (UE_id = UE_list->head; UE_id >= 0; UE_id = UE_list->next[UE_id]) { - ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; + for (i = 0; i < UE_num_active_CC(UE_list, UE_id); i++) { CC_id = UE_list->ordered_CCids[i][UE_id]; //PHY_vars_eNB_g[Mod_id]->mu_mimo_mode[UE_id].dl_pow_off = dl_pow_off[UE_id]; @@ -1330,9 +1316,7 @@ dlsch_scheduler_pre_processor_reset(module_id_t module_idP, uint16_t nb_rbs_required[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB], uint8_t rballoc_sub[NFAPI_CC_MAX][N_RBG_MAX], uint8_t MIMO_mode_indicator[NFAPI_CC_MAX][N_RBG_MAX], - int *mbsfn_flag) -{ - + int *mbsfn_flag) { int UE_id; uint8_t CC_id; int i, j; @@ -1340,17 +1324,15 @@ dlsch_scheduler_pre_processor_reset(module_id_t module_idP, UE_sched_ctrl *ue_sched_ctl; int N_RB_DL, RBGsize, RBGsize_last; int N_RBG[NFAPI_CC_MAX]; - #ifdef SF0_LIMIT int sf0_lower, sf0_upper; #endif - rnti_t rnti; uint8_t *vrb_map; COMMON_channels_t *cc; -// - for (CC_id = 0; CC_id < RC.nb_mac_CC[module_idP]; CC_id++) { + // + for (CC_id = 0; CC_id < RC.nb_mac_CC[module_idP]; CC_id++) { LOG_D(MAC, "Running preprocessor for UE %d (%x)\n", UE_id,(int)(UE_RNTI(module_idP, UE_id))); // initialize harq_pid and round cc = &RC.mac[module_idP]->common_channels[CC_id]; @@ -1361,13 +1343,10 @@ dlsch_scheduler_pre_processor_reset(module_id_t module_idP, continue; for (UE_id = 0; UE_id < MAX_MOBILES_PER_ENB; ++UE_id) { - - UE_list = &RC.mac[module_idP]->UE_list; ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; rnti = UE_RNTI(module_idP, UE_id); - if (rnti == NOT_A_RNTI) continue; @@ -1378,11 +1357,11 @@ dlsch_scheduler_pre_processor_reset(module_id_t module_idP, continue; LOG_D(MAC, "Running preprocessor for UE %d (%x)\n", UE_id, rnti); + // initialize harq_pid and round if (ue_sched_ctl->ta_timer) ue_sched_ctl->ta_timer--; - /* eNB_UE_stats *eNB_UE_stats; @@ -1440,7 +1419,6 @@ dlsch_scheduler_pre_processor_reset(module_id_t module_idP, VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_TIMING_ADVANCE,ue_sched_ctl->ta_update); } */ - nb_rbs_required[CC_id][UE_id] = 0; ue_sched_ctl->pre_nb_available_rbs[CC_id] = 0; ue_sched_ctl->dl_pow_off[CC_id] = 2; @@ -1451,32 +1429,38 @@ dlsch_scheduler_pre_processor_reset(module_id_t module_idP, } N_RB_DL = to_prb(RC.mac[module_idP]->common_channels[CC_id].mib->message.dl_Bandwidth); - #ifdef SF0_LIMIT + switch (N_RBG[CC_id]) { case 6: sf0_lower = 0; sf0_upper = 5; break; + case 8: sf0_lower = 2; sf0_upper = 5; break; + case 13: sf0_lower = 4; sf0_upper = 7; break; + case 17: sf0_lower = 7; sf0_upper = 9; break; + case 25: sf0_lower = 11; sf0_upper = 13; break; + default: AssertFatal(1 == 0, "unsupported RBs (%d)\n", N_RB_DL); } + #endif switch (N_RB_DL) { @@ -1484,37 +1468,43 @@ dlsch_scheduler_pre_processor_reset(module_id_t module_idP, RBGsize = 1; RBGsize_last = 1; break; + case 15: RBGsize = 2; RBGsize_last = 1; break; + case 25: RBGsize = 2; RBGsize_last = 1; break; + case 50: RBGsize = 3; RBGsize_last = 2; break; + case 75: RBGsize = 4; RBGsize_last = 3; break; + case 100: RBGsize = 4; RBGsize_last = 4; break; + default: AssertFatal(1 == 0, "unsupported RBs (%d)\n", N_RB_DL); } vrb_map = RC.mac[module_idP]->common_channels[CC_id].vrb_map; + // Initialize Subbands according to VRB map for (i = 0; i < N_RBG[CC_id]; i++) { int rb_size = i == N_RBG[CC_id] - 1 ? RBGsize_last : RBGsize; - - #ifdef SF0_LIMIT + // for avoiding 6+ PRBs around DC in subframe 0 (avoid excessive errors) /* TODO: make it proper - allocate those RBs, do not "protect" them, but * compute number of available REs and limit MCS according to the @@ -1522,6 +1512,7 @@ dlsch_scheduler_pre_processor_reset(module_id_t module_idP, */ if (subframeP == 0 && i >= sf0_lower && i <= sf0_upper) rballoc_sub[CC_id][i] = 1; + #endif // for SI-RNTI,RA-RNTI and P-RNTI allocations @@ -1532,8 +1523,9 @@ dlsch_scheduler_pre_processor_reset(module_id_t module_idP, break; } } + //LOG_D(MAC, "Frame %d Subframe %d CC_id %d RBG %i : rb_alloc %d\n", - //frameP, subframeP, CC_id, i, rballoc_sub[CC_id][i]); + //frameP, subframeP, CC_id, i, rballoc_sub[CC_id][i]); MIMO_mode_indicator[CC_id][i] = 2; } } @@ -1550,8 +1542,7 @@ dlsch_scheduler_pre_processor_allocate(module_id_t Mod_id, uint16_t nb_rbs_remaining[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB], uint8_t rballoc_sub[NFAPI_CC_MAX][N_RBG_MAX], uint8_t slice_allocation_mask[NFAPI_CC_MAX][N_RBG_MAX], - uint8_t MIMO_mode_indicator[NFAPI_CC_MAX][N_RBG_MAX]) -{ + uint8_t MIMO_mode_indicator[NFAPI_CC_MAX][N_RBG_MAX]) { int i; int tm = get_tmode(Mod_id, CC_id, UE_id); UE_list_t *UE_list = &RC.mac[Mod_id]->UE_list; @@ -1559,12 +1550,16 @@ dlsch_scheduler_pre_processor_allocate(module_id_t Mod_id, int N_RB_DL = to_prb(RC.mac[Mod_id]->common_channels[CC_id].mib->message.dl_Bandwidth); for (i = 0; i < N_RBG; i++) { - if (rballoc_sub[CC_id][i] != 0) continue; + if (ue_sched_ctl->rballoc_sub_UE[CC_id][i] != 0) continue; + if (nb_rbs_remaining[CC_id][UE_id] <= 0) continue; + if (ue_sched_ctl->pre_nb_available_rbs[CC_id] >= nb_rbs_required[CC_id][UE_id]) continue; + if (ue_sched_ctl->dl_pow_off[CC_id] == 0) continue; + if (slice_allocation_mask[CC_id][i] == 0) continue; if ((i == N_RBG - 1) && ((N_RB_DL == 25) || (N_RB_DL == 50))) { @@ -1573,9 +1568,11 @@ dlsch_scheduler_pre_processor_allocate(module_id_t Mod_id, rballoc_sub[CC_id][i] = 1; ue_sched_ctl->rballoc_sub_UE[CC_id][i] = 1; MIMO_mode_indicator[CC_id][i] = 1; + if (tm == 5) { ue_sched_ctl->dl_pow_off[CC_id] = 1; } + nb_rbs_remaining[CC_id][UE_id] = nb_rbs_remaining[CC_id][UE_id] - min_rb_unit + 1; ue_sched_ctl->pre_nb_available_rbs[CC_id] = ue_sched_ctl->pre_nb_available_rbs[CC_id] + min_rb_unit - 1; } @@ -1585,9 +1582,11 @@ dlsch_scheduler_pre_processor_allocate(module_id_t Mod_id, rballoc_sub[CC_id][i] = 1; ue_sched_ctl->rballoc_sub_UE[CC_id][i] = 1; MIMO_mode_indicator[CC_id][i] = 1; + if (tm == 5) { ue_sched_ctl->dl_pow_off[CC_id] = 1; } + nb_rbs_remaining[CC_id][UE_id] = nb_rbs_remaining[CC_id][UE_id] - min_rb_unit; ue_sched_ctl->pre_nb_available_rbs[CC_id] = ue_sched_ctl->pre_nb_available_rbs[CC_id] + min_rb_unit; } @@ -1603,9 +1602,9 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, int frameP, sub_frame_t subframeP, unsigned char sched_subframeP, - uint16_t *first_rb) -{ - uint16_t UE_id, n; + uint16_t *first_rb) { + int UE_id; + uint16_t n; uint8_t CC_id, harq_pid; uint16_t nb_allocated_rbs[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB]; uint16_t total_allocated_rbs[NFAPI_CC_MAX]; @@ -1619,21 +1618,18 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, int N_RB_UL = 0; uint16_t available_rbs, first_rb_offset; rnti_t rntiTable[MAX_MOBILES_PER_ENB]; // Rnti array => Add SSR 12-2018 - bool continueTable[MAX_MOBILES_PER_ENB]; // Loop continue flag array => Add SSR 12-2018 - bool sliceMember; // Slice membership flag => Add SSR 12-2018 - + bool continueTable[MAX_MOBILES_PER_ENB]; // Loop continue flag array => Add SSR 12-2018 + bool sliceMember; // Slice membership flag => Add SSR 12-2018 LOG_D(MAC, "In ulsch_preprocessor: assign max mcs min rb\n"); // maximize MCS and then allocate required RB according to the buffer occupancy with the limit of max available UL RB assign_max_mcs_min_rb(module_idP, slice_idx, frameP, subframeP, first_rb); - LOG_D(MAC, "In ulsch_preprocessor: sort ue \n"); // sort ues sort_ue_ul(module_idP, frameP, subframeP); - - // we need to distribute RBs among UEs // step1: reset the vars uint8_t CC_nb = (uint8_t) RC.nb_mac_CC[module_idP]; + for (CC_id = 0; CC_id < CC_nb; CC_id++) { total_allocated_rbs[CC_id] = 0; total_remaining_rbs[CC_id] = 0; @@ -1644,7 +1640,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, // Step 1.5: Calculate total_ue_count for (UE_id = UE_list->head_ul; UE_id >= 0; UE_id = UE_list->next_ul[UE_id]) { // Calculate continue condition - /* + /* if (UE_RNTI(module_idP, UE_id) == NOT_A_RNTI) continue; if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync == 1) @@ -1653,13 +1649,15 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, continue; */ rntiTable[UE_id] = UE_RNTI(module_idP, UE_id); - sliceMember = ue_ul_slice_membership(module_idP, UE_id, slice_idx); + sliceMember = ue_ul_slice_membership(module_idP, UE_id, slice_idx); continueTable[UE_id] = (rntiTable[UE_id] == NOT_A_RNTI || UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync == 1 || !sliceMember); + // This is not the actual CC_id in the list - if (sliceMember) { + if (sliceMember) { for (n = 0; n < UE_list->numactiveULCCs[UE_id]; n++) { - CC_id = UE_list->ordered_ULCCids[n][UE_id]; + CC_id = UE_list->ordered_ULCCids[n][UE_id]; UE_template = &UE_list->UE_template[CC_id][UE_id]; + if (UE_template->pre_allocated_nb_rb_ul[slice_idx] > 0) { total_ue_count[CC_id]++; } @@ -1668,30 +1666,31 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, } LOG_D(MAC, "In ulsch_preprocessor: step2 \n"); + // step 2: calculate the average rb per UE for (UE_id = UE_list->head_ul; UE_id >= 0; UE_id = UE_list->next_ul[UE_id]) { if (continueTable[UE_id]) continue; + LOG_D(MAC, "In ulsch_preprocessor: handling UE %d/%x\n", UE_id, rntiTable[UE_id]); + for (n = 0; n < UE_list->numactiveULCCs[UE_id]; n++) { // This is the actual CC_id in the list CC_id = UE_list->ordered_ULCCids[n][UE_id]; LOG_D(MAC, "In ulsch_preprocessor: handling UE %d/%x CCid %d\n", UE_id, rntiTable[UE_id], CC_id); - /* if((mac_xface->get_nCCE_max(module_idP,CC_id,3,subframeP) - nCCE_to_be_used[CC_id]) > (1<common_channels[CC_id].ul_Bandwidth); ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; ue_sched_ctl->max_rbs_allowed_slice_uplink[CC_id][slice_idx] = - nb_rbs_allowed_slice(sli->ul[slice_idx].pct, N_RB_UL); - + nb_rbs_allowed_slice(sli->ul[slice_idx].pct, N_RB_UL); first_rb_offset = UE_list->first_rb_offset[CC_id][slice_idx]; available_rbs = cmin(ue_sched_ctl->max_rbs_allowed_slice_uplink[CC_id][slice_idx], - N_RB_UL - first_rb[CC_id] - first_rb_offset); + N_RB_UL - first_rb[CC_id] - first_rb_offset); + if (available_rbs < 0) available_rbs = 0; @@ -1707,6 +1706,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, "[eNB %d] frame %d subframe %d: UE %d CC %d: can't get average rb per user (should not be here)\n", module_idP, frameP, subframeP, UE_id, CC_id); } + if (total_ue_count[CC_id] > 0) { LOG_D(MAC, "[eNB %d] Frame %d subframe %d: total ue to be scheduled %d\n", module_idP, frameP, subframeP, total_ue_count[CC_id]); @@ -1747,6 +1747,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, if (continueTable[UE_id]) continue; ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; + for (n = 0; n < UE_list->numactiveULCCs[UE_id]; n++) { // This is the actual CC_id in the list CC_id = UE_list->ordered_ULCCids[n][UE_id]; @@ -1761,8 +1762,8 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, } while ((UE_template->pre_allocated_nb_rb_ul[slice_idx] > 0) - && (nb_allocated_rbs[CC_id][UE_id] < UE_template->pre_allocated_nb_rb_ul[slice_idx]) - && (total_remaining_rbs[CC_id] > 0)) { + && (nb_allocated_rbs[CC_id][UE_id] < UE_template->pre_allocated_nb_rb_ul[slice_idx]) + && (total_remaining_rbs[CC_id] > 0)) { nb_allocated_rbs[CC_id][UE_id] = cmin(nb_allocated_rbs[CC_id][UE_id] + 1, UE_template->pre_allocated_nb_rb_ul[slice_idx]); total_remaining_rbs[CC_id]--; total_allocated_rbs[CC_id]++; @@ -1775,14 +1776,13 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, module_idP, UE_id, CC_id, UE_template->pre_allocated_nb_rb_ul[slice_idx]); } } + return; } void assign_max_mcs_min_rb(module_id_t module_idP, int slice_idx, int frameP, - sub_frame_t subframeP, uint16_t * first_rb) -{ - + sub_frame_t subframeP, uint16_t *first_rb) { int i; uint16_t n, UE_id; uint8_t CC_id; @@ -1792,7 +1792,6 @@ assign_max_mcs_min_rb(module_id_t module_idP, int slice_idx, int frameP, eNB_MAC_INST *eNB = RC.mac[module_idP]; UE_list_t *UE_list = &eNB->UE_list; slice_info_t *sli = &RC.mac[module_idP]->slice_info; - UE_TEMPLATE *UE_template; UE_sched_ctrl *ue_sched_ctl; int Ncp; @@ -1807,8 +1806,10 @@ assign_max_mcs_min_rb(module_id_t module_idP, int slice_idx, int frameP, if (rnti == NOT_A_RNTI) continue; + if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1) continue; + if (!ue_ul_slice_membership(module_idP, i, slice_idx)) continue; @@ -1826,38 +1827,33 @@ assign_max_mcs_min_rb(module_id_t module_idP, int slice_idx, int frameP, for (n = 0; n < UE_list->numactiveULCCs[UE_id]; n++) { // This is the actual CC_id in the list CC_id = UE_list->ordered_ULCCids[n][UE_id]; - - - AssertFatal(CC_id < RC.nb_mac_CC[module_idP], "CC_id %u should be < %u, loop n=%u < numactiveULCCs[%u]=%u", CC_id, NFAPI_CC_MAX, n, UE_id, UE_list->numactiveULCCs[UE_id]); - UE_template = &UE_list->UE_template[CC_id][UE_id]; UE_template->pre_assigned_mcs_ul = mcs; ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; - Ncp = RC.mac[module_idP]->common_channels[CC_id].Ncp; N_RB_UL = to_prb(RC.mac[module_idP]->common_channels[CC_id].ul_Bandwidth); ue_sched_ctl->max_rbs_allowed_slice_uplink[CC_id][slice_idx] = - nb_rbs_allowed_slice(sli->ul[slice_idx].pct, N_RB_UL); - + nb_rbs_allowed_slice(sli->ul[slice_idx].pct, N_RB_UL); int bytes_to_schedule = UE_template->estimated_ul_buffer - UE_template->scheduled_ul_bytes; + if (bytes_to_schedule < 0) bytes_to_schedule = 0; + int bits_to_schedule = bytes_to_schedule * 8; // if this UE has UL traffic if (bits_to_schedule > 0) { tbs = get_TBS_UL(UE_template->pre_assigned_mcs_ul, 3) << 3; // 1 or 2 PRB with cqi enabled does not work well! rb_table_index = 2; - // fixme: set use_srs flag tx_power = estimate_ue_tx_power(tbs, rb_table[rb_table_index], 0, Ncp, 0); while ((((UE_template->phr_info - tx_power) < 0) - || (tbs > bits_to_schedule)) - && (UE_template->pre_assigned_mcs_ul > 3)) { + || (tbs > bits_to_schedule)) + && (UE_template->pre_assigned_mcs_ul > 3)) { // LOG_I(MAC,"UE_template->phr_info %d tx_power %d mcs %d\n", UE_template->phr_info,tx_power, mcs); UE_template->pre_assigned_mcs_ul--; tbs = get_TBS_UL(UE_template->pre_assigned_mcs_ul, rb_table[rb_table_index]) << 3; @@ -1880,9 +1876,10 @@ assign_max_mcs_min_rb(module_id_t module_idP, int slice_idx, int frameP, if (rb_table[rb_table_index] > (available_rbs - 1)) { rb_table_index--; } + // 1 or 2 PRB with cqi enabled does not work well if (rb_table[rb_table_index] < 3) { - rb_table_index = 2; //3PRB + rb_table_index = 2; //3PRB } UE_template->pre_allocated_rb_table_index_ul = rb_table_index; @@ -1913,91 +1910,95 @@ assign_max_mcs_min_rb(module_id_t module_idP, int slice_idx, int frameP, } struct sort_ue_ul_params { - int module_idP; - int frameP; - int subframeP; + int module_idP; + int frameP; + int subframeP; }; -static int ue_ul_compare(const void *_a, const void *_b, void *_params) -{ - struct sort_ue_ul_params *params = _params; - UE_list_t *UE_list = &RC.mac[params->module_idP]->UE_list; +static int ue_ul_compare(const void *_a, const void *_b, void *_params) { + struct sort_ue_ul_params *params = _params; + UE_list_t *UE_list = &RC.mac[params->module_idP]->UE_list; + int UE_id1 = *(const int *) _a; + int UE_id2 = *(const int *) _b; + int rnti1 = UE_RNTI(params->module_idP, UE_id1); + int pCCid1 = UE_PCCID(params->module_idP, UE_id1); + int round1 = maxround(params->module_idP, rnti1, params->frameP, + params->subframeP, 1); + int rnti2 = UE_RNTI(params->module_idP, UE_id2); + int pCCid2 = UE_PCCID(params->module_idP, UE_id2); + int round2 = maxround(params->module_idP, rnti2, params->frameP, + params->subframeP, 1); - int UE_id1 = *(const int *) _a; - int UE_id2 = *(const int *) _b; + if (round1 > round2) + return -1; - int rnti1 = UE_RNTI(params->module_idP, UE_id1); - int pCCid1 = UE_PCCID(params->module_idP, UE_id1); - int round1 = maxround(params->module_idP, rnti1, params->frameP, - params->subframeP, 1); + if (round1 < round2) + return 1; - int rnti2 = UE_RNTI(params->module_idP, UE_id2); - int pCCid2 = UE_PCCID(params->module_idP, UE_id2); - int round2 = maxround(params->module_idP, rnti2, params->frameP, - params->subframeP, 1); + if (UE_list->UE_template[pCCid1][UE_id1].ul_buffer_info[LCGID0] > + UE_list->UE_template[pCCid2][UE_id2].ul_buffer_info[LCGID0]) + return -1; - if (round1 > round2) - return -1; - if (round1 < round2) - return 1; + if (UE_list->UE_template[pCCid1][UE_id1].ul_buffer_info[LCGID0] < + UE_list->UE_template[pCCid2][UE_id2].ul_buffer_info[LCGID0]) + return 1; - if (UE_list->UE_template[pCCid1][UE_id1].ul_buffer_info[LCGID0] > - UE_list->UE_template[pCCid2][UE_id2].ul_buffer_info[LCGID0]) - return -1; - if (UE_list->UE_template[pCCid1][UE_id1].ul_buffer_info[LCGID0] < - UE_list->UE_template[pCCid2][UE_id2].ul_buffer_info[LCGID0]) - return 1; + int bytes_to_schedule1 = UE_list->UE_template[pCCid1][UE_id1].estimated_ul_buffer - UE_list->UE_template[pCCid1][UE_id1].scheduled_ul_bytes; - int bytes_to_schedule1 = UE_list->UE_template[pCCid1][UE_id1].estimated_ul_buffer - UE_list->UE_template[pCCid1][UE_id1].scheduled_ul_bytes; - if (bytes_to_schedule1 < 0) bytes_to_schedule1 = 0; - int bytes_to_schedule2 = UE_list->UE_template[pCCid2][UE_id2].estimated_ul_buffer - UE_list->UE_template[pCCid2][UE_id2].scheduled_ul_bytes; - if (bytes_to_schedule2 < 0) bytes_to_schedule2 = 0; + if (bytes_to_schedule1 < 0) bytes_to_schedule1 = 0; - if (bytes_to_schedule1 > bytes_to_schedule2) - return -1; - if (bytes_to_schedule1 < bytes_to_schedule2) - return 1; + int bytes_to_schedule2 = UE_list->UE_template[pCCid2][UE_id2].estimated_ul_buffer - UE_list->UE_template[pCCid2][UE_id2].scheduled_ul_bytes; - if (UE_list->UE_template[pCCid1][UE_id1].pre_assigned_mcs_ul > - UE_list->UE_template[pCCid2][UE_id2].pre_assigned_mcs_ul) - return -1; - if (UE_list->UE_template[pCCid1][UE_id1].pre_assigned_mcs_ul < - UE_list->UE_template[pCCid2][UE_id2].pre_assigned_mcs_ul) - return 1; + if (bytes_to_schedule2 < 0) bytes_to_schedule2 = 0; - return 0; + if (bytes_to_schedule1 > bytes_to_schedule2) + return -1; + + if (bytes_to_schedule1 < bytes_to_schedule2) + return 1; + + if (UE_list->UE_template[pCCid1][UE_id1].pre_assigned_mcs_ul > + UE_list->UE_template[pCCid2][UE_id2].pre_assigned_mcs_ul) + return -1; + + if (UE_list->UE_template[pCCid1][UE_id1].pre_assigned_mcs_ul < + UE_list->UE_template[pCCid2][UE_id2].pre_assigned_mcs_ul) + return 1; + + return 0; } -void sort_ue_ul(module_id_t module_idP, int frameP, sub_frame_t subframeP) -{ - int i; - int list[MAX_MOBILES_PER_ENB]; - int list_size = 0; - int rnti; - struct sort_ue_ul_params params = { module_idP, frameP, subframeP }; +void sort_ue_ul(module_id_t module_idP, int frameP, sub_frame_t subframeP) { + int i; + int list[MAX_MOBILES_PER_ENB]; + int list_size = 0; + int rnti; + struct sort_ue_ul_params params = { module_idP, frameP, subframeP }; + UE_list_t *UE_list = &RC.mac[module_idP]->UE_list; - UE_list_t *UE_list = &RC.mac[module_idP]->UE_list; + for (i = 0; i < MAX_MOBILES_PER_ENB; i++) { + if (UE_list->active[i] == FALSE) + continue; - for (i = 0; i < MAX_MOBILES_PER_ENB; i++) { - if (UE_list->active[i] == FALSE) - continue; - if ((rnti = UE_RNTI(module_idP, i)) == NOT_A_RNTI) - continue; - if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1) - continue; + if ((rnti = UE_RNTI(module_idP, i)) == NOT_A_RNTI) + continue; - list[list_size] = i; - list_size++; - } + if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1) + continue; - qsort_r(list, list_size, sizeof(int), ue_ul_compare, ¶ms); + list[list_size] = i; + list_size++; + } - if (list_size) { - for (i = 0; i < list_size - 1; i++) - UE_list->next_ul[list[i]] = list[i + 1]; - UE_list->next_ul[list[list_size - 1]] = -1; - UE_list->head_ul = list[0]; - } else { - UE_list->head_ul = -1; - } + qsort_r(list, list_size, sizeof(int), ue_ul_compare, ¶ms); + + if (list_size) { + for (i = 0; i < list_size - 1; i++) + UE_list->next_ul[list[i]] = list[i + 1]; + + UE_list->next_ul[list[list_size - 1]] = -1; + UE_list->head_ul = list[0]; + } else { + UE_list->head_ul = -1; + } }
Build Start Time (UTC)
GIT Repository$GIT_URL$GIT_URL
Job Trigger