diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c b/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c index 1c3aa48ed3785e8834a050bec0fec9d901769014..ded09053885c24497b5d4a22c76d94770dc53f28 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c @@ -57,7 +57,7 @@ uint64_t runtime, uint64_t deadline, uint64_t period);*/ -extern uint8_t get_thread_worker_conf(void); +extern WORKER_CONF_t get_thread_worker_conf(void); void free_eNB_dlsch(LTE_eNB_DLSCH_t *dlsch) diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c index 3948b5e018627d63d9cff4fab8d6a4d0fb036958..046e456916a104bf5afc892142a9317807ac4e80 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c @@ -45,7 +45,7 @@ #include "targets/RT/USER/rt_wrapper.h" #include "transport_proto.h" -extern uint8_t get_thread_worker_conf(void); +extern WORKER_CONF_t get_thread_worker_conf(void); void free_eNB_ulsch(LTE_eNB_ULSCH_t *ulsch) { diff --git a/openair1/SIMULATION/LTE_PHY/dlsim.c b/openair1/SIMULATION/LTE_PHY/dlsim.c index a03ce34bcae135d452b54c53a7e5dbb79bf39049..fd649ec0e4d9c513720c08318c265abda8ff477a 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim.c @@ -82,7 +82,23 @@ double t_rx_min = 1000000000; /*!< \brief initial min process time for rx */ int n_tx_dropped = 0; /*!< \brief initial max process time for tx */ int n_rx_dropped = 0; /*!< \brief initial max process time for rx */ -int codingw = 0; +static THREAD_STRUCT thread_struct; +void set_parallel_conf(int parallel_conf) +{ + thread_struct.parallel_conf = (PARALLEL_CONF_t)parallel_conf; +} +void set_parallel_worker_conf(int worker_conf) +{ + thread_struct.worker_conf = (WORKER_CONF_t)worker_conf; +} +PARALLEL_CONF_t get_thread_parallel_conf(void) +{ + return thread_struct.parallel_conf; +} +WORKER_CONF_t get_thread_worker_conf(void) +{ + return thread_struct.worker_conf; +} int emulate_rf = 0; diff --git a/openair1/SIMULATION/LTE_PHY/ulsim.c b/openair1/SIMULATION/LTE_PHY/ulsim.c index 3fcb01068548a1c2fab305b50385174ada689737..826f185d2abe98112f09680b54a50081c98479c1 100644 --- a/openair1/SIMULATION/LTE_PHY/ulsim.c +++ b/openair1/SIMULATION/LTE_PHY/ulsim.c @@ -97,7 +97,23 @@ nfapi_tx_request_pdu_t tx_pdu_list[MAX_NUM_TX_REQUEST_PDU]; nfapi_tx_request_t TX_req; Sched_Rsp_t sched_resp; -int codingw = 0; +static THREAD_STRUCT thread_struct; +void set_parallel_conf(int parallel_conf) +{ + thread_struct.parallel_conf = (PARALLEL_CONF_t)parallel_conf; +} +void set_parallel_worker_conf(int worker_conf) +{ + thread_struct.worker_conf = (WORKER_CONF_t)worker_conf; +} +PARALLEL_CONF_t get_thread_parallel_conf(void) +{ + return thread_struct.parallel_conf; +} +WORKER_CONF_t get_thread_worker_conf(void) +{ + return thread_struct.worker_conf; +} void fill_nfapi_ulsch_config_request(nfapi_ul_config_request_pdu_t *ul_config_pdu, diff --git a/targets/RT/USER/lte-enb.c b/targets/RT/USER/lte-enb.c index b51495c43f7be4c13b717bf8796a6bac09beaef1..91a3c2e479df6ba5d20c3582d10671c771f7ffc3 100644 --- a/targets/RT/USER/lte-enb.c +++ b/targets/RT/USER/lte-enb.c @@ -151,8 +151,8 @@ 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); #endif -extern uint8_t get_thread_paralle_conf(void); -extern uint8_t get_thread_worker_conf(void); +extern PARALLEL_CONF_t get_thread_parallel_conf(void); +extern WORKER_CONF_t get_thread_worker_conf(void); extern uint8_t nfapi_mode; extern void oai_subframe_ind(uint16_t sfn, uint16_t sf); @@ -224,7 +224,7 @@ 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 ); - if(get_thread_paralle_conf() == PARALLEL_RU_L1_TRX_SPLIT){ + 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); return(-1); @@ -246,7 +246,7 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam /* CONFLICT RESOLUTION: BEGIN */ VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER , 0 ); if(oai_exit) return(-1); - if(get_thread_paralle_conf() == PARALLEL_SINGLE_THREAD){ + if(get_thread_parallel_conf() == PARALLEL_SINGLE_THREAD){ #ifndef PHY_TX_THREAD phy_procedures_eNB_TX(eNB, proc, 1); #endif @@ -422,8 +422,8 @@ static void* eNB_thread_rxtx( void* param ) { } pthread_mutex_unlock( &proc->mutex_rxtx ); if (nfapi_mode!=2){ - if(get_thread_paralle_conf() == PARALLEL_RU_L1_TRX_SPLIT) wakeup_tx(eNB,eNB->proc.ru_proc); - else if(get_thread_paralle_conf() == PARALLEL_RU_L1_SPLIT) + 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) { phy_procedures_eNB_TX(eNB, proc, 1); wakeup_txfh(proc,eNB->proc.ru_proc); @@ -963,7 +963,7 @@ void init_eNB_proc(int inst) { LOG_I(PHY,"eNB->single_thread_flag:%d\n", eNB->single_thread_flag); - if ((get_thread_paralle_conf() == PARALLEL_RU_L1_SPLIT || get_thread_paralle_conf() == PARALLEL_RU_L1_TRX_SPLIT) && nfapi_mode!=2) { + 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); } diff --git a/targets/RT/USER/lte-ru.c b/targets/RT/USER/lte-ru.c index 39e482a81fe7ed4f8c77a8242570655accb8a63f..8ee2cb04f609e50c859778d5b6663c0b9623e9c5 100644 --- a/targets/RT/USER/lte-ru.c +++ b/targets/RT/USER/lte-ru.c @@ -121,8 +121,8 @@ extern int emulate_rf; extern int numerology; extern clock_source_t clock_source; -extern uint8_t get_thread_paralle_conf(void); -extern uint8_t get_thread_worker_conf(void); +extern PARALLEL_CONF_t get_thread_parallel_conf(void); +extern WORKER_CONF_t get_thread_worker_conf(void); extern void phy_init_RU(RU_t*); extern void phy_free_RU(RU_t*); @@ -1257,7 +1257,7 @@ void wakeup_eNBs(RU_t *ru) { LOG_D(PHY,"wakeup_eNBs (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_paralle_conf() == PARALLEL_SINGLE_THREAD) { + if (ru->num_eNB==1 && ru->eNB_top!=0 && get_thread_parallel_conf() == PARALLEL_SINGLE_THREAD) { // call eNB function directly char string[20]; @@ -1782,7 +1782,7 @@ static void* ru_thread( void* param ) { if (ru->num_eNB>0) wakeup_eNBs(ru); #ifndef PHY_TX_THREAD - if(get_thread_paralle_conf() == PARALLEL_SINGLE_THREAD || ru->num_eNB==0){ + if(get_thread_parallel_conf() == PARALLEL_SINGLE_THREAD || ru->num_eNB==0){ // do TX front-end processing if needed (precoding and/or IDFTs) if (ru->feptx_prec) ru->feptx_prec(ru); @@ -2195,7 +2195,7 @@ void init_RU_proc(RU_t *ru) { if(emulate_rf) pthread_create( &proc->pthread_emulateRF, attr_emulateRF, emulatedRF_thread, (void*)proc ); - if (get_thread_paralle_conf() == PARALLEL_RU_L1_SPLIT || get_thread_paralle_conf() == PARALLEL_RU_L1_TRX_SPLIT) + if (get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT || get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) pthread_create( &proc->pthread_FH1, attr_FH1, ru_thread_tx, (void*)ru ); if (ru->function == NGFI_RRU_IF4p5) { @@ -2309,7 +2309,7 @@ void kill_RU_proc(RU_t *ru) LOG_D(PHY, "Joining pthread_FH\n"); pthread_join(proc->pthread_FH, NULL); - if (get_thread_paralle_conf() == PARALLEL_RU_L1_SPLIT || get_thread_paralle_conf() == PARALLEL_RU_L1_TRX_SPLIT) { + if (get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT || get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) { LOG_D(PHY, "Joining pthread_FHTX\n"); pthread_join(proc->pthread_FH1, NULL); } diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index f935677124f362c84b1f8874287bdb6572ee1ffe..b9458afa1edac56ac000a978d06d6512e19da913 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -229,7 +229,7 @@ void set_parallel_worker_conf(int worker_conf) { thread_struct.worker_conf = (WORKER_CONF_t)worker_conf; } -PARALLEL_CONF_t get_thread_paralle_conf(void) +PARALLEL_CONF_t get_thread_parallel_conf(void) { return thread_struct.parallel_conf; } diff --git a/targets/RT/USER/lte-softmodem.h b/targets/RT/USER/lte-softmodem.h index e3ffeaab108e601bf0781b958de36565674b6061..7074172a036b1f79ee9ba043867b202cd5dedb07 100644 --- a/targets/RT/USER/lte-softmodem.h +++ b/targets/RT/USER/lte-softmodem.h @@ -276,7 +276,7 @@ PHY_VARS_UE* init_ue_vars(LTE_DL_FRAME_PARMS *frame_parms, uint8_t abstraction_flag); void init_eNB_afterRU(void); void thread_structure_init(void); -PARALLEL_CONF_t get_thread_paralle_conf(void); +PARALLEL_CONF_t get_thread_parallel_conf(void); WORKER_CONF_t get_thread_worker_conf(void); void set_parallel_conf(int parallel_conf); void set_parallel_worker_conf(int worker_conf); diff --git a/targets/RT/USER/lte-uesoftmodem.c b/targets/RT/USER/lte-uesoftmodem.c index d87e3e69b193404156a93c467809a20bb9121a83..1613622567e21cbf7612f17ef71c50428eee7a6f 100644 --- a/targets/RT/USER/lte-uesoftmodem.c +++ b/targets/RT/USER/lte-uesoftmodem.c @@ -230,7 +230,7 @@ void set_parallel_worker_conf(int worker_conf) { thread_struct.worker_conf = (WORKER_CONF_t)worker_conf; } -PARALLEL_CONF_t get_thread_paralle_conf(void) +PARALLEL_CONF_t get_thread_parallel_conf(void) { return thread_struct.parallel_conf; }