Commit 5b1260a7 authored by Wang Tsu-Han's avatar Wang Tsu-Han

fixed for phy-simulation mode

parent cf09d198
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
uint64_t runtime, uint64_t runtime,
uint64_t deadline, uint64_t deadline,
uint64_t period);*/ 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) void free_eNB_dlsch(LTE_eNB_DLSCH_t *dlsch)
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
#include "targets/RT/USER/rt_wrapper.h" #include "targets/RT/USER/rt_wrapper.h"
#include "transport_proto.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) void free_eNB_ulsch(LTE_eNB_ULSCH_t *ulsch)
{ {
......
...@@ -82,7 +82,23 @@ double t_rx_min = 1000000000; /*!< \brief initial min process time for rx */ ...@@ -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_tx_dropped = 0; /*!< \brief initial max process time for tx */
int n_rx_dropped = 0; /*!< \brief initial max process time for rx */ 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; int emulate_rf = 0;
......
...@@ -97,7 +97,23 @@ nfapi_tx_request_pdu_t tx_pdu_list[MAX_NUM_TX_REQUEST_PDU]; ...@@ -97,7 +97,23 @@ nfapi_tx_request_pdu_t tx_pdu_list[MAX_NUM_TX_REQUEST_PDU];
nfapi_tx_request_t TX_req; nfapi_tx_request_t TX_req;
Sched_Rsp_t sched_resp; 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 void
fill_nfapi_ulsch_config_request(nfapi_ul_config_request_pdu_t *ul_config_pdu, fill_nfapi_ulsch_config_request(nfapi_ul_config_request_pdu_t *ul_config_pdu,
......
...@@ -151,8 +151,8 @@ void wakeup_prach_eNB(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe); ...@@ -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)) #if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
void wakeup_prach_eNB_br(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe); void wakeup_prach_eNB_br(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe);
#endif #endif
extern uint8_t get_thread_paralle_conf(void); extern PARALLEL_CONF_t get_thread_parallel_conf(void);
extern uint8_t get_thread_worker_conf(void); extern WORKER_CONF_t get_thread_worker_conf(void);
extern uint8_t nfapi_mode; extern uint8_t nfapi_mode;
extern void oai_subframe_ind(uint16_t sfn, uint16_t sf); 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 ...@@ -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 ); 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) { 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); LOG_E(PHY,"Frame %d, subframe %d: TX1 not ready\n",proc[1].frame_rx,proc[1].subframe_rx);
return(-1); return(-1);
...@@ -246,7 +246,7 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam ...@@ -246,7 +246,7 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam
/* CONFLICT RESOLUTION: BEGIN */ /* CONFLICT RESOLUTION: BEGIN */
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER , 0 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER , 0 );
if(oai_exit) return(-1); 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 #ifndef PHY_TX_THREAD
phy_procedures_eNB_TX(eNB, proc, 1); phy_procedures_eNB_TX(eNB, proc, 1);
#endif #endif
...@@ -422,8 +422,8 @@ static void* eNB_thread_rxtx( void* param ) { ...@@ -422,8 +422,8 @@ static void* eNB_thread_rxtx( void* param ) {
} }
pthread_mutex_unlock( &proc->mutex_rxtx ); pthread_mutex_unlock( &proc->mutex_rxtx );
if (nfapi_mode!=2){ if (nfapi_mode!=2){
if(get_thread_paralle_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,eNB->proc.ru_proc);
else if(get_thread_paralle_conf() == PARALLEL_RU_L1_SPLIT) else if(get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT)
{ {
phy_procedures_eNB_TX(eNB, proc, 1); phy_procedures_eNB_TX(eNB, proc, 1);
wakeup_txfh(proc,eNB->proc.ru_proc); wakeup_txfh(proc,eNB->proc.ru_proc);
...@@ -963,7 +963,7 @@ void init_eNB_proc(int inst) { ...@@ -963,7 +963,7 @@ void init_eNB_proc(int inst) {
LOG_I(PHY,"eNB->single_thread_flag:%d\n", eNB->single_thread_flag); 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[0].pthread_rxtx, attr0, eNB_thread_rxtx, proc );
pthread_create( &proc_rxtx[1].pthread_rxtx, attr1, tx_thread, proc); pthread_create( &proc_rxtx[1].pthread_rxtx, attr1, tx_thread, proc);
} }
......
...@@ -121,8 +121,8 @@ extern int emulate_rf; ...@@ -121,8 +121,8 @@ extern int emulate_rf;
extern int numerology; extern int numerology;
extern clock_source_t clock_source; extern clock_source_t clock_source;
extern uint8_t get_thread_paralle_conf(void); extern PARALLEL_CONF_t get_thread_parallel_conf(void);
extern uint8_t get_thread_worker_conf(void); extern WORKER_CONF_t get_thread_worker_conf(void);
extern void phy_init_RU(RU_t*); extern void phy_init_RU(RU_t*);
extern void phy_free_RU(RU_t*); extern void phy_free_RU(RU_t*);
...@@ -1257,7 +1257,7 @@ void wakeup_eNBs(RU_t *ru) { ...@@ -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); 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 // call eNB function directly
char string[20]; char string[20];
...@@ -1782,7 +1782,7 @@ static void* ru_thread( void* param ) { ...@@ -1782,7 +1782,7 @@ static void* ru_thread( void* param ) {
if (ru->num_eNB>0) wakeup_eNBs(ru); if (ru->num_eNB>0) wakeup_eNBs(ru);
#ifndef PHY_TX_THREAD #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) // do TX front-end processing if needed (precoding and/or IDFTs)
if (ru->feptx_prec) ru->feptx_prec(ru); if (ru->feptx_prec) ru->feptx_prec(ru);
...@@ -2195,7 +2195,7 @@ void init_RU_proc(RU_t *ru) { ...@@ -2195,7 +2195,7 @@ void init_RU_proc(RU_t *ru) {
if(emulate_rf) if(emulate_rf)
pthread_create( &proc->pthread_emulateRF, attr_emulateRF, emulatedRF_thread, (void*)proc ); 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 ); pthread_create( &proc->pthread_FH1, attr_FH1, ru_thread_tx, (void*)ru );
if (ru->function == NGFI_RRU_IF4p5) { if (ru->function == NGFI_RRU_IF4p5) {
...@@ -2309,7 +2309,7 @@ void kill_RU_proc(RU_t *ru) ...@@ -2309,7 +2309,7 @@ void kill_RU_proc(RU_t *ru)
LOG_D(PHY, "Joining pthread_FH\n"); LOG_D(PHY, "Joining pthread_FH\n");
pthread_join(proc->pthread_FH, NULL); 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"); LOG_D(PHY, "Joining pthread_FHTX\n");
pthread_join(proc->pthread_FH1, NULL); pthread_join(proc->pthread_FH1, NULL);
} }
......
...@@ -229,7 +229,7 @@ void set_parallel_worker_conf(int worker_conf) ...@@ -229,7 +229,7 @@ void set_parallel_worker_conf(int worker_conf)
{ {
thread_struct.worker_conf = (WORKER_CONF_t)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; return thread_struct.parallel_conf;
} }
......
...@@ -276,7 +276,7 @@ PHY_VARS_UE* init_ue_vars(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -276,7 +276,7 @@ PHY_VARS_UE* init_ue_vars(LTE_DL_FRAME_PARMS *frame_parms,
uint8_t abstraction_flag); uint8_t abstraction_flag);
void init_eNB_afterRU(void); void init_eNB_afterRU(void);
void thread_structure_init(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); WORKER_CONF_t get_thread_worker_conf(void);
void set_parallel_conf(int parallel_conf); void set_parallel_conf(int parallel_conf);
void set_parallel_worker_conf(int worker_conf); void set_parallel_worker_conf(int worker_conf);
......
...@@ -230,7 +230,7 @@ void set_parallel_worker_conf(int worker_conf) ...@@ -230,7 +230,7 @@ void set_parallel_worker_conf(int worker_conf)
{ {
thread_struct.worker_conf = (WORKER_CONF_t)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; return thread_struct.parallel_conf;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment