Commit dea85884 authored by Eurecom's avatar Eurecom

code cleanup

parent cfec3ffd
This diff is collapsed.
......@@ -183,7 +183,8 @@ int32_t dlsch_encoding_2threads(PHY_VARS_eNB *eNB,
time_stats_t *te_main_stats,
time_stats_t *te_wakeup_stats0,
time_stats_t *te_wakeup_stats1,
time_stats_t *i_stats);
time_stats_t *i_stats,
int worker_num);
void dlsch_encoding_emul(PHY_VARS_eNB *phy_vars_eNB,
uint8_t *DLSCH_pdu,
......
......@@ -279,6 +279,20 @@ typedef struct {
LTE_eNB_DLSCH_t *dlsch;
int G;
int harq_pid;
int total_worker;
int current_worker;
/// \internal This variable is protected by \ref mutex_te.
int instance_cnt_te;
/// pthread attributes for parallel turbo-encoder thread
pthread_attr_t attr_te;
/// scheduling parameters for parallel turbo-encoder thread
struct sched_param sched_param_te;
/// pthread structure for parallel turbo-encoder thread
pthread_t pthread_te;
/// condition variable for parallel turbo-encoder thread
pthread_cond_t cond_te;
/// mutex for parallel turbo-encoder thread
pthread_mutex_t mutex_te;
} te_params;
typedef struct RU_proc_t_s {
......
......@@ -1507,41 +1507,42 @@ void init_td_thread(PHY_VARS_eNB *eNB,pthread_attr_t *attr_td) {
}
extern void *te_thread(void*);
extern void *te_thread1(void*);
extern void *te_thread2(void*);
void init_te_thread(PHY_VARS_eNB *eNB,pthread_attr_t *attr_te,pthread_attr_t *attr_te1) {
void init_te_thread(PHY_VARS_eNB *eNB) {
eNB_proc_t *proc = &eNB->proc;
proc->tep[0].eNB = eNB;
proc->instance_cnt_te[0] = -1;
proc->tep[0].instance_cnt_te = -1;
pthread_mutex_init( &proc->mutex_te[0], NULL);
pthread_cond_init( &proc->cond_te[0], NULL);
pthread_mutex_init( &proc->tep[0].mutex_te, NULL);
pthread_cond_init( &proc->tep[0].cond_te, NULL);
pthread_attr_init( &proc->tep[0].attr_te);
printf("Creating te_thread\n");
pthread_create(&proc->pthread_te[0], attr_te, te_thread, (void*)&proc->tep[0]);
printf("Creating te_thread 0\n");
pthread_create(&proc->tep[0].pthread_te, &proc->tep[0].attr_te, te_thread, (void*)&proc->tep[0]);
/////////////////////////////////////////////////////////////////////////
proc->tep[1].eNB = eNB;
proc->instance_cnt_te[1] = -1;
proc->tep[1].instance_cnt_te = -1;
pthread_mutex_init( &proc->mutex_te[1], NULL);
pthread_cond_init( &proc->cond_te[1], NULL);
pthread_mutex_init( &proc->tep[1].mutex_te, NULL);
pthread_cond_init( &proc->tep[1].cond_te, NULL);
pthread_attr_init( &proc->tep[1].attr_te);
printf("Creating te_thread1\n");
pthread_create(&proc->pthread_te[1], attr_te1, te_thread1, (void*)&proc->tep[1]);
printf("Creating te_thread 1\n");
pthread_create(&proc->tep[1].pthread_te, &proc->tep[1].attr_te, te_thread, (void*)&proc->tep[1]);
/////////////////////////////////////////////////////////////////////////
proc->tep[2].eNB = eNB;
proc->instance_cnt_te[2] = -1;
proc->tep[2].instance_cnt_te = -1;
pthread_mutex_init( &proc->mutex_te[2], NULL);
pthread_cond_init( &proc->cond_te[2], NULL);
pthread_mutex_init( &proc->tep[2].mutex_te, NULL);
pthread_cond_init( &proc->tep[2].cond_te, NULL);
pthread_attr_init( &proc->tep[2].attr_te);
printf("Creating te_thread2\n");
pthread_create(&proc->pthread_te[2], attr_te1, te_thread2, (void*)&proc->tep[2]);
printf("Creating te_thread 2\n");
pthread_create(&proc->tep[2].pthread_te, &proc->tep[2].attr_te, te_thread, (void*)&proc->tep[2]);
}
......
......@@ -696,7 +696,7 @@ static void* eNB_thread_prach_br( void* param ) {
extern void init_td_thread(PHY_VARS_eNB *, pthread_attr_t *);
extern void init_te_thread(PHY_VARS_eNB *, pthread_attr_t *,pthread_attr_t *);
extern void init_te_thread(PHY_VARS_eNB *);
//////////////////////////////////////need to modified////////////////*****
static void* process_stats_thread(void* param) {
......@@ -734,7 +734,7 @@ void init_eNB_proc(int inst) {
PHY_VARS_eNB *eNB;
eNB_proc_t *proc;
eNB_rxtx_proc_t *proc_rxtx;
pthread_attr_t *attr0=NULL,*attr1=NULL,*attr_prach=NULL,*attr_te=NULL,*attr_te1=NULL,*attr_td=NULL;
pthread_attr_t *attr0=NULL,*attr1=NULL,*attr_prach=NULL,*attr_td=NULL;//,*attr_te=NULL,*attr_te1=NULL;
#ifdef Rel14
pthread_attr_t *attr_prach_br=NULL;
#endif
......@@ -776,8 +776,8 @@ void init_eNB_proc(int inst) {
pthread_attr_init( &proc->attr_prach);
pthread_attr_init( &proc->attr_asynch_rxtx);
pthread_attr_init( &proc->attr_td);
pthread_attr_init( &proc->attr_te[0]);
pthread_attr_init( &proc->attr_te[1]);
//pthread_attr_init( &proc->attr_te[0]);
//pthread_attr_init( &proc->attr_te[1]);
pthread_attr_init( &proc_rxtx[0].attr_rxtx);
pthread_attr_init( &proc_rxtx[1].attr_rxtx);
#ifdef Rel14
......@@ -800,8 +800,8 @@ void init_eNB_proc(int inst) {
// attr_te = &proc->attr_te;
#endif
attr_td = &proc->attr_td;
attr_te = &proc->attr_te[0];
attr_te1 = &proc->attr_te[1];
//attr_te = &proc->attr_te[0];
//attr_te1 = &proc->attr_te[1];
pthread_create( &proc_rxtx[0].pthread_rxtx, attr0, eNB_thread_rxtx, proc );
pthread_create( &proc_rxtx[1].pthread_rxtx, attr1, tx_thread, proc);
if (eNB->single_thread_flag==0) {
......@@ -824,7 +824,7 @@ void init_eNB_proc(int inst) {
//////////////////////////////////////need to modified////////////////*****
init_te_thread(eNB,attr_te,attr_te1);
init_te_thread(eNB);
init_td_thread(eNB,attr_td);
if (opp_enabled == 1) pthread_create(&proc->process_stats_thread,NULL,process_stats_thread,(void*)eNB);
......
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