Commit ef1d5079 authored by laurent's avatar laurent

stats display with 5G flag

parent 2de56bf3
...@@ -313,7 +313,6 @@ static inline int rxtx(PHY_VARS_eNB *eNB, ...@@ -313,7 +313,6 @@ static inline int rxtx(PHY_VARS_eNB *eNB,
return(0); return(0);
} }
static void *L1_thread_tx(void *param) { static void *L1_thread_tx(void *param) {
L1_proc_t *eNB_proc = (L1_proc_t *)param; L1_proc_t *eNB_proc = (L1_proc_t *)param;
L1_rxtx_proc_t *proc = &eNB_proc->L1_proc_tx; L1_rxtx_proc_t *proc = &eNB_proc->L1_proc_tx;
...@@ -811,35 +810,19 @@ static void *eNB_thread_prach_br( void *param ) { ...@@ -811,35 +810,19 @@ static void *eNB_thread_prach_br( void *param ) {
return &eNB_thread_prach_status; return &eNB_thread_prach_status;
} }
static void print_opp_meas(PHY_VARS_eNB *eNB);
extern void init_td_thread(PHY_VARS_eNB *); static void reset_opp_meas(PHY_VARS_eNB *eNB);
extern void init_te_thread(PHY_VARS_eNB *);
extern void kill_td_thread(PHY_VARS_eNB *);
extern void kill_te_thread(PHY_VARS_eNB *);
static void *process_stats_thread(void *param) { static void *process_stats_thread(void *param) {
PHY_VARS_eNB *eNB = (PHY_VARS_eNB *)param; PHY_VARS_eNB *eNB = (PHY_VARS_eNB *)param;
wait_sync("process_stats_thread"); wait_sync("process_stats_thread");
reset_opp_meas(eNB);
while (!oai_exit) { while (!oai_exit) {
sleep(1); sleep(1);
print_opp_meas(eNB);
if (opp_enabled == 1) { if (RC.mac)
if ( eNB->ulsch_decoding_stats.trials>0) lte_dump_mac_stats(RC.mac[0], stdout);
print_meas(&eNB->ulsch_decoding_stats,"ulsch_decoding",NULL,NULL); if (time(NULL) % 10)
reset_opp_meas(eNB);
if (eNB->dlsch_encoding_stats.trials >0) {
print_meas(&eNB->dlsch_turbo_encoding_preperation_stats,"dlsch_coding_crc",NULL,NULL);
print_meas(&eNB->dlsch_turbo_encoding_segmentation_stats,"dlsch_segmentation",NULL,NULL);
print_meas(&eNB->dlsch_encoding_stats,"dlsch_encoding",NULL,NULL);
print_meas(&eNB->dlsch_turbo_encoding_stats,"turbo_encoding",NULL,NULL);
print_meas(&eNB->dlsch_interleaving_stats,"turbo_interleaving",NULL,NULL);
print_meas(&eNB->dlsch_rate_matching_stats,"turbo_rate_matching",NULL,NULL);
}
print_meas(&eNB->dlsch_modulation_stats,"dlsch_modulation",NULL,NULL);
}
} }
return(NULL); return(NULL);
...@@ -918,11 +901,6 @@ void init_eNB_proc(int inst) { ...@@ -918,11 +901,6 @@ void init_eNB_proc(int inst) {
pthread_cond_init( &proc->cond_prach_br, NULL); pthread_cond_init( &proc->cond_prach_br, NULL);
pthread_attr_init( &proc->attr_prach_br); pthread_attr_init( &proc->attr_prach_br);
if(get_thread_worker_conf() == WORKER_ENABLE) {
init_te_thread(eNB);
init_td_thread(eNB);
}
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_parallel_conf() == PARALLEL_RU_L1_SPLIT) && NFAPI_MODE!=NFAPI_MODE_VNF) { if ((get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT) && NFAPI_MODE!=NFAPI_MODE_VNF) {
...@@ -954,8 +932,10 @@ void init_eNB_proc(int inst) { ...@@ -954,8 +932,10 @@ void init_eNB_proc(int inst) {
AssertFatal(proc->instance_cnt_prach == -1,"instance_cnt_prach = %d\n",proc->instance_cnt_prach); AssertFatal(proc->instance_cnt_prach == -1,"instance_cnt_prach = %d\n",proc->instance_cnt_prach);
if (opp_enabled == 1) pthread_create(&proc->process_stats_thread,NULL,process_stats_thread,(void *)eNB); if (opp_enabled == 1)
pthread_create(&proc->L1_stats_thread,NULL,L1_stats_thread,(void*)eNB); threadCreate(&proc->process_stats_thread, process_stats_thread, (void *)eNB, "opp stats", -1, sched_get_priority_min(SCHED_OAI));
if (!IS_SOFTMODEM_NOSTATS_BIT)
threadCreate(&proc->L1_stats_thread, L1_stats_thread, (void *)eNB, "L1 stats", -1, sched_get_priority_min(SCHED_OAI));
} }
//for multiple CCs: setup master and slaves //for multiple CCs: setup master and slaves
...@@ -997,11 +977,6 @@ void kill_eNB_proc(int inst) { ...@@ -997,11 +977,6 @@ void kill_eNB_proc(int inst) {
L1_proc = &proc->L1_proc; L1_proc = &proc->L1_proc;
L1_proc_tx = &proc->L1_proc_tx; 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 ); LOG_I(PHY, "Killing TX CC_id %d inst %d\n", CC_id, inst );
if ((get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT || get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) && NFAPI_MODE!=NFAPI_MODE_VNF) { if ((get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT || get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) && NFAPI_MODE!=NFAPI_MODE_VNF) {
...@@ -1060,30 +1035,43 @@ void kill_eNB_proc(int inst) { ...@@ -1060,30 +1035,43 @@ void kill_eNB_proc(int inst) {
} }
} }
static void reset_opp_meas(PHY_VARS_eNB *eNB)
void reset_opp_meas(void) { {
int sfn;
reset_meas(&softmodem_stats_mt); reset_meas(&softmodem_stats_mt);
reset_meas(&softmodem_stats_hw); reset_meas(&softmodem_stats_hw);
reset_meas(&softmodem_stats_rxtx_sf);
for (sfn=0; sfn < 10; sfn++) { reset_meas(&softmodem_stats_rx_sf);
reset_meas(&softmodem_stats_rxtx_sf); reset_meas(&eNB->ulsch_decoding_stats);
reset_meas(&softmodem_stats_rx_sf); reset_meas(&eNB->dlsch_turbo_encoding_preperation_stats);
} reset_meas(&eNB->dlsch_turbo_encoding_segmentation_stats);
reset_meas(&eNB->dlsch_encoding_stats);
reset_meas(&eNB->dlsch_turbo_encoding_stats);
reset_meas(&eNB->dlsch_interleaving_stats);
reset_meas(&eNB->dlsch_rate_matching_stats);
reset_meas(&eNB->dlsch_modulation_stats);
} }
static void print_opp_meas(PHY_VARS_eNB *eNB)
void print_opp_meas(void) { {
int sfn=0;
print_meas(&softmodem_stats_mt, "Main ENB Thread", NULL, NULL); print_meas(&softmodem_stats_mt, "Main ENB Thread", NULL, NULL);
print_meas(&softmodem_stats_hw, "HW Acquisation", NULL, NULL); print_meas(&softmodem_stats_hw, "HW Acquisation", NULL, NULL);
for (sfn=0; sfn < 10; sfn++) {
print_meas(&softmodem_stats_rxtx_sf,"[eNB][total_phy_proc_rxtx]",NULL, NULL); print_meas(&softmodem_stats_rxtx_sf,"[eNB][total_phy_proc_rxtx]",NULL, NULL);
print_meas(&softmodem_stats_rx_sf,"[eNB][total_phy_proc_rx]",NULL,NULL); print_meas(&softmodem_stats_rx_sf,"[eNB][total_phy_proc_rx]",NULL,NULL);
} if (eNB->ulsch_decoding_stats.trials > 0)
} print_meas(&eNB->ulsch_decoding_stats, "ulsch_decoding", NULL, NULL);
if (eNB->dlsch_encoding_stats.trials > 0) {
print_meas(&eNB->dlsch_turbo_encoding_preperation_stats, "dlsch_coding_crc", NULL, NULL);
print_meas(&eNB->dlsch_turbo_encoding_segmentation_stats, "dlsch_segmentation", NULL, NULL);
print_meas(&eNB->dlsch_encoding_stats, "dlsch_encoding", NULL, NULL);
print_meas(&eNB->dlsch_turbo_encoding_stats, "turbo_encoding", NULL, NULL);
print_meas(&eNB->dlsch_interleaving_stats, "turbo_interleaving", NULL, NULL);
print_meas(&eNB->dlsch_rate_matching_stats, "turbo_rate_matching", NULL, NULL);
}
print_meas(&eNB->dlsch_modulation_stats, "dlsch_modulation", NULL, NULL);
}
void free_transport(PHY_VARS_eNB *eNB) { void free_transport(PHY_VARS_eNB *eNB) {
for (int i=0; i<NUMBER_OF_DLSCH_MAX; i++) { for (int i=0; i<NUMBER_OF_DLSCH_MAX; i++) {
...@@ -1279,7 +1267,6 @@ void init_eNB(int single_thread_flag, ...@@ -1279,7 +1267,6 @@ void init_eNB(int single_thread_flag,
eNB->prach_energy_counter = 0; eNB->prach_energy_counter = 0;
} }
} }
LOG_I(PHY,"[lte-softmodem.c] eNB structure allocated\n"); LOG_I(PHY,"[lte-softmodem.c] eNB structure allocated\n");
} }
......
...@@ -2335,17 +2335,18 @@ void init_RU_proc(RU_t *ru) { ...@@ -2335,17 +2335,18 @@ void init_RU_proc(RU_t *ru) {
init_feptx_thread(ru, NULL); init_feptx_thread(ru, NULL);
} }
if (opp_enabled == 1) pthread_create(&ru->ru_stats_thread,NULL,ru_stats_thread,(void *)ru); if (opp_enabled == 1)
/* pthread_create(&ru->ru_stats_thread, NULL, ru_stats_thread, (void *)ru);
if (ru->function == eNodeB_3GPP) { /*
usleep(10000); if (ru->function == eNodeB_3GPP) {
LOG_I(PHY, "Signaling main thread that RU %d (is_slave %d,send_dmrs %d) is ready in state %s\n",ru->idx,ru->is_slave,ru->generate_dmrs_sync,ru_states[ru->state]); usleep(10000);
AssertFatal((ret=pthread_mutex_lock(ru->ru_mutex))==0,"mutex_lock returns %d\n",ret); LOG_I(PHY, "Signaling main thread that RU %d (is_slave %d,send_dmrs %d) is ready in state %s\n",ru->idx,ru->is_slave,ru->generate_dmrs_sync,ru_states[ru->state]);
*ru->ru_mask &= ~(1<<ru->idx); AssertFatal((ret=pthread_mutex_lock(ru->ru_mutex))==0,"mutex_lock returns %d\n",ret);
pthread_cond_signal(ru->ru_cond); *ru->ru_mask &= ~(1<<ru->idx);
AssertFatal((ret=pthread_mutex_unlock(ru->ru_mutex))==0,"mutex_unlock returns %d\n",ret); pthread_cond_signal(ru->ru_cond);
} AssertFatal((ret=pthread_mutex_unlock(ru->ru_mutex))==0,"mutex_unlock returns %d\n",ret);
*/ }
*/
} }
......
...@@ -156,10 +156,6 @@ void sendFs6Ulharq(enum pckType type, int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI * ...@@ -156,10 +156,6 @@ void sendFs6Ulharq(enum pckType type, int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *
RU_t **RCconfig_RU(int nb_RU,int nb_L1_inst,PHY_VARS_eNB ***eNB,uint64_t *ru_mask,pthread_mutex_t *ru_mutex,pthread_cond_t *ru_cond); RU_t **RCconfig_RU(int nb_RU,int nb_L1_inst,PHY_VARS_eNB ***eNB,uint64_t *ru_mask,pthread_mutex_t *ru_mutex,pthread_cond_t *ru_cond);
extern void reset_opp_meas(void);
extern void print_opp_meas(void);
RU_t **RCconfig_RU(int nb_RU,int nb_L1_inst,PHY_VARS_eNB ***eNB,uint64_t *ru_mask,pthread_mutex_t *ru_mutex,pthread_cond_t *ru_cond); RU_t **RCconfig_RU(int nb_RU,int nb_L1_inst,PHY_VARS_eNB ***eNB,uint64_t *ru_mask,pthread_mutex_t *ru_mutex,pthread_cond_t *ru_cond);
int transmission_mode=1; int transmission_mode=1;
...@@ -452,10 +448,6 @@ int main ( int argc, char **argv ) ...@@ -452,10 +448,6 @@ int main ( int argc, char **argv )
set_taus_seed (0); set_taus_seed (0);
printf("configuring for RAU/RRU\n"); printf("configuring for RAU/RRU\n");
if (opp_enabled ==1) {
reset_opp_meas();
}
cpuf=get_cpu_freq_GHz(); cpuf=get_cpu_freq_GHz();
printf("ITTI init, useMME: %i\n",EPC_MODE_ENABLED); printf("ITTI init, useMME: %i\n",EPC_MODE_ENABLED);
itti_init(TASK_MAX, tasks_info); itti_init(TASK_MAX, tasks_info);
......
...@@ -179,14 +179,6 @@ extern void init_UE(int nb_inst, ...@@ -179,14 +179,6 @@ extern void init_UE(int nb_inst,
extern void init_thread(int sched_runtime, int sched_deadline, int sched_fifo, cpu_set_t *cpuset, char *name); extern void init_thread(int sched_runtime, int sched_deadline, int sched_fifo, cpu_set_t *cpuset, char *name);
extern void reset_opp_meas(void);
extern void print_opp_meas(void);
extern void init_td_thread(PHY_VARS_eNB *);
extern void init_te_thread(PHY_VARS_eNB *);
extern void kill_td_thread(PHY_VARS_eNB *);
extern void kill_te_thread(PHY_VARS_eNB *);
extern void init_ocm(void); extern void init_ocm(void);
extern void init_ue_devices(PHY_VARS_UE *); extern void init_ue_devices(PHY_VARS_UE *);
......
...@@ -241,10 +241,6 @@ void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch) { ...@@ -241,10 +241,6 @@ void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch) {
} }
} }
void *te_thread(void *param) {
return(NULL);
}
static void TPencode(void * arg) { static void TPencode(void * arg) {
turboEncode_t * rdata=(turboEncode_t *) arg; turboEncode_t * rdata=(turboEncode_t *) arg;
unsigned char harq_pid = rdata->harq_pid; unsigned char harq_pid = rdata->harq_pid;
......
...@@ -248,6 +248,7 @@ void processULSegment(void * arg) { ...@@ -248,6 +248,7 @@ void processULSegment(void * arg) {
if(ulsch_harq->repetition_number == 1) { if(ulsch_harq->repetition_number == 1) {
memset(ulsch_harq->pusch_rep_buffer[r],0,(sizeof(int32_t)*3*(6144+64))) ; // reset the buffer every new repetitions memset(ulsch_harq->pusch_rep_buffer[r],0,(sizeof(int32_t)*3*(6144+64))) ; // reset the buffer every new repetitions
} }
if(ulsch_harq->total_number_of_repetitions > 1) { if(ulsch_harq->total_number_of_repetitions > 1) {
if (ulsch_harq->rvidx==1) { if (ulsch_harq->rvidx==1) {
LOG_E(PHY,"Adding HARQ data for segment: %d\n", r); LOG_E(PHY,"Adding HARQ data for segment: %d\n", r);
...@@ -267,28 +268,21 @@ void processULSegment(void * arg) { ...@@ -267,28 +268,21 @@ void processULSegment(void * arg) {
soft_bits+96, soft_bits+96,
ulsch_harq->w[r]); ulsch_harq->w[r]);
stop_meas(&eNB->ulsch_deinterleaving_stats); stop_meas(&eNB->ulsch_deinterleaving_stats);
rdata->decodeIterations = rdata->function( soft_bits+96, rdata->decodeIterations = rdata->function(soft_bits + 96,
NULL, NULL,
rdata->decoded_bytes, rdata->decoded_bytes,
NULL, NULL,
rdata->Kr, rdata->Kr,
rdata->maxIterations, rdata->maxIterations,
rdata->nbSegments == 1 ? CRC24_A: CRC24_B, rdata->nbSegments == 1 ? CRC24_A : CRC24_B,
rdata->Fbits, rdata->Fbits,
&eNB->ulsch_tc_init_stats, &eNB->ulsch_tc_init_stats,
&eNB->ulsch_tc_alpha_stats, &eNB->ulsch_tc_alpha_stats,
&eNB->ulsch_tc_beta_stats, &eNB->ulsch_tc_beta_stats,
&eNB->ulsch_tc_gamma_stats, &eNB->ulsch_tc_gamma_stats,
&eNB->ulsch_tc_ext_stats, &eNB->ulsch_tc_ext_stats,
&eNB->ulsch_tc_intl1_stats, &eNB->ulsch_tc_intl1_stats,
&eNB->ulsch_tc_intl2_stats); &eNB->ulsch_tc_intl2_stats);
stop_meas(&eNB->ulsch_turbo_decoding_stats);
}
void *td_thread(void *param) {
return(NULL);
} }
int ulsch_decoding_data(PHY_VARS_eNB *eNB, L1_rxtx_proc_t *proc, int ulsch_decoding_data(PHY_VARS_eNB *eNB, L1_rxtx_proc_t *proc,
...@@ -1097,6 +1091,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB, ...@@ -1097,6 +1091,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,
LOG_D(PHY,"frame %d subframe %d O_ACK:%d o_ACK[]=%d:%d:%d:%d\n",frame,subframe,ulsch_harq->O_ACK,ulsch_harq->o_ACK[0],ulsch_harq->o_ACK[1],ulsch_harq->o_ACK[2],ulsch_harq->o_ACK[3]); LOG_D(PHY,"frame %d subframe %d O_ACK:%d o_ACK[]=%d:%d:%d:%d\n",frame,subframe,ulsch_harq->O_ACK,ulsch_harq->o_ACK[0],ulsch_harq->o_ACK[1],ulsch_harq->o_ACK[2],ulsch_harq->o_ACK[3]);
// Do ULSCH Decoding for data portion // Do ULSCH Decoding for data portion
start_meas(&eNB->ulsch_turbo_decoding_stats);
ret = ulsch_decoding_data(eNB, proc, UE_id, harq_pid, llr8_flag); ret = ulsch_decoding_data(eNB, proc, UE_id, harq_pid, llr8_flag);
return(ret); return(ret);
} }
......
...@@ -1447,23 +1447,23 @@ void pusch_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc) { ...@@ -1447,23 +1447,23 @@ void pusch_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc) {
rx_ulsch(eNB,proc, i); rx_ulsch(eNB,proc, i);
stop_meas(&eNB->ulsch_demodulation_stats); stop_meas(&eNB->ulsch_demodulation_stats);
start_meas(&eNB->ulsch_decoding_stats); start_meas(&eNB->ulsch_decoding_stats);
ulsch_decoding(eNB,proc, ulsch_decoding(eNB,
i, proc,
0, // control_only_flag i,
ulsch_harq->V_UL_DAI, 0, // control_only_flag
ulsch_harq->nb_rb>20 ? 1 : 0); ulsch_harq->V_UL_DAI,
stop_meas(&eNB->ulsch_decoding_stats); ulsch_harq->nb_rb > 20 ? 1 : 0);
/* /*
int ulsch_id=-1; int ulsch_id=-1;
for (ulsch_id=0;ulsch_id<NUMBER_OF_ULSCH_MAX;ulsch_id++) for (ulsch_id=0;ulsch_id<NUMBER_OF_ULSCH_MAX;ulsch_id++)
if (ulsch->rnti == eNB->ulsch_stats[ulsch_id].rnti) break; if (ulsch->rnti == eNB->ulsch_stats[ulsch_id].rnti) break;
AssertFatal(ulsch_id>=0,"no ulsch_id found\n"); AssertFatal(ulsch_id>=0,"no ulsch_id found\n");
if (eNB->ulsch_stats[ulsch_id].round_trials[0]>100) { if (eNB->ulsch_stats[ulsch_id].round_trials[0]>100) {
dump_ulsch(eNB,frame,subframe,i,ulsch_harq->round); dump_ulsch(eNB,frame,subframe,i,ulsch_harq->round);
AssertFatal(1==0,"exiting\n"); AssertFatal(1==0,"exiting\n");
} }
*/ */
} }
else if ((ulsch) && else if ((ulsch) &&
(ulsch->rnti>0) && (ulsch->rnti>0) &&
...@@ -1478,7 +1478,8 @@ void pusch_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc) { ...@@ -1478,7 +1478,8 @@ void pusch_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc) {
LOG_W (PHY, "Removing stale ULSCH config for UE %x harq_pid %d (harq_mask is now 0x%2.2x)\n", ulsch->rnti, harq_pid, ulsch->harq_mask); LOG_W (PHY, "Removing stale ULSCH config for UE %x harq_pid %d (harq_mask is now 0x%2.2x)\n", ulsch->rnti, harq_pid, ulsch->harq_mask);
} }
} // for (i=0; i<NUMBER_OF_ULSCH_MAX; i++) } // for (i=0; i<NUMBER_OF_ULSCH_MAX; i++)
const bool decode = proc->nbDecode;
while (proc->nbDecode > 0) { while (proc->nbDecode > 0) {
notifiedFIFO_elt_t *req=pullTpool(proc->respDecode, proc->threadPool); notifiedFIFO_elt_t *req=pullTpool(proc->respDecode, proc->threadPool);
if (req == NULL) if (req == NULL)
...@@ -1486,62 +1487,13 @@ void pusch_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc) { ...@@ -1486,62 +1487,13 @@ void pusch_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc) {
postDecode(proc, req); postDecode(proc, req);
delNotifiedFIFO_elt(req); delNotifiedFIFO_elt(req);
} }
} if (decode) {
stop_meas(&eNB->ulsch_decoding_stats);
extern int oai_exit; stop_meas(&eNB->ulsch_turbo_decoding_stats);
extern void *td_thread (void *);
void init_td_thread(PHY_VARS_eNB *eNB) {
/*
L1_proc_t *proc = &eNB->proc;
proc->tdp.eNB = eNB;
proc->instance_cnt_td = -1;
threadCreate(&proc->pthread_td, td_thread, (void *)&proc->tdp, "TD", -1, OAI_PRIORITY_RT);
*/
}
void kill_td_thread(PHY_VARS_eNB *eNB) {
/*
L1_proc_t *proc = &eNB->proc;
proc->instance_cnt_td = 0;
pthread_cond_signal(&proc->cond_td);
pthread_join(proc->pthread_td, NULL);
pthread_mutex_destroy( &proc->mutex_td );
pthread_cond_destroy( &proc->cond_td );
*/
}
extern void *te_thread (void *);
void init_te_thread(PHY_VARS_eNB *eNB) {
/*
L1_proc_t *proc = &eNB->proc;
for(int i=0; i<3 ; i++) {
proc->tep[i].eNB = eNB;
proc->tep[i].instance_cnt_te = -1;
LOG_I(PHY,"Creating te_thread %d\n",i);
char txt[128];
sprintf(txt,"TE_%d", i);
threadCreate(&proc->tep[i].pthread_te, te_thread, (void *)&proc->tep[i], txt, -1, OAI_PRIORITY_RT);
} }
*/
} }
void kill_te_thread(PHY_VARS_eNB *eNB) { extern int oai_exit;
/*
L1_proc_t *proc = &eNB->proc;
for(int i=0; i<3 ; i++) {
proc->tep[i].instance_cnt_te = 0;
pthread_cond_signal(&proc->tep[i].cond_te);
pthread_join(proc->tep[i].pthread_te, NULL);
pthread_mutex_destroy( &proc->tep[i].mutex_te);
pthread_cond_destroy( &proc->tep[i].cond_te);
}
*/
}
void fill_rx_indication(PHY_VARS_eNB *eNB, void fill_rx_indication(PHY_VARS_eNB *eNB,
int ULSCH_id, int ULSCH_id,
......
...@@ -990,13 +990,6 @@ int main(int argc, char **argv) { ...@@ -990,13 +990,6 @@ int main(int argc, char **argv) {
eNB->mac_enabled=1; eNB->mac_enabled=1;
if(get_thread_worker_conf() == WORKER_ENABLE) {
extern void init_td_thread(PHY_VARS_eNB *);
extern void init_te_thread(PHY_VARS_eNB *);
init_td_thread(eNB);
init_te_thread(eNB);
}
// callback functions required for phy_procedures_tx // callback functions required for phy_procedures_tx
// eNB_id_i = UE->n_connected_eNB; // eNB_id_i = UE->n_connected_eNB;
printf("Setting mcs1 = %d\n",mcs1); printf("Setting mcs1 = %d\n",mcs1);
......
...@@ -1109,14 +1109,6 @@ int main(int argc, char **argv) { ...@@ -1109,14 +1109,6 @@ int main(int argc, char **argv) {
eNB->frame_parms.Nid_cell_mbsfn=0; eNB->frame_parms.Nid_cell_mbsfn=0;
#endif #endif
if(get_thread_worker_conf() == WORKER_ENABLE) {
extern void init_td_thread(PHY_VARS_eNB *);
extern void init_te_thread(PHY_VARS_eNB *);
init_td_thread(eNB);
init_te_thread(eNB);
}
// callback functions required for phy_procedures_tx // callback functions required for phy_procedures_tx
// eNB_id_i = UE->n_connected_eNB; // eNB_id_i = UE->n_connected_eNB;
printf("Setting mcs1 = %d\n",mcs1); printf("Setting mcs1 = %d\n",mcs1);
......
...@@ -744,9 +744,7 @@ int main(int argc, char **argv) { ...@@ -744,9 +744,7 @@ int main(int argc, char **argv) {
if(get_thread_worker_conf() == WORKER_ENABLE) { if(get_thread_worker_conf() == WORKER_ENABLE) {
extern void init_fep_thread(RU_t *, pthread_attr_t *); extern void init_fep_thread(RU_t *, pthread_attr_t *);
extern void init_td_thread(PHY_VARS_eNB *); init_fep_thread(ru, NULL);
init_fep_thread(ru,NULL);
init_td_thread(eNB);
} }
// Create transport channel structures for 2 transport blocks (MIMO) // Create transport channel structures for 2 transport blocks (MIMO)
...@@ -1379,13 +1377,12 @@ int main(int argc, char **argv) { ...@@ -1379,13 +1377,12 @@ int main(int argc, char **argv) {
printStatIndent2(&eNB->ulsch_deinterleaving_stats,"sub-block interleaving" ); printStatIndent2(&eNB->ulsch_deinterleaving_stats,"sub-block interleaving" );
printStatIndent2(&eNB->ulsch_demultiplexing_stats,"sub-block demultiplexing" ); printStatIndent2(&eNB->ulsch_demultiplexing_stats,"sub-block demultiplexing" );
printStatIndent2(&eNB->ulsch_rate_unmatching_stats,"sub-block rate-matching" ); printStatIndent2(&eNB->ulsch_rate_unmatching_stats,"sub-block rate-matching" );
printf(" |__ turbo_decoder(%d bits), avg iterations: %.1f %.2f us (%d cycles, %d trials)\n", printf(" |__ harqID: %d turbo_decoder(%d bits), avg iterations: %.1f %.2f us (%d cycles, %d trials)\n",
eNB->ulsch[0]->harq_processes[harq_pid]->Cminus ? harq_pid,
eNB->ulsch[0]->harq_processes[harq_pid]->Kminus : eNB->ulsch[0]->harq_processes[harq_pid]->Cminus ? eNB->ulsch[0]->harq_processes[harq_pid]->Kminus : eNB->ulsch[0]->harq_processes[harq_pid]->Kplus,
eNB->ulsch[0]->harq_processes[harq_pid]->Kplus, eNB->ulsch_tc_intl1_stats.trials / (double)eNB->ulsch_tc_init_stats.trials,
eNB->ulsch_tc_intl1_stats.trials/(double)eNB->ulsch_tc_init_stats.trials, (double)eNB->ulsch_turbo_decoding_stats.diff / eNB->ulsch_turbo_decoding_stats.trials * timeBase,
(double)eNB->ulsch_turbo_decoding_stats.diff/eNB->ulsch_turbo_decoding_stats.trials*timeBase, (int)((double)eNB->ulsch_turbo_decoding_stats.diff / eNB->ulsch_turbo_decoding_stats.trials),
(int)((double)eNB->ulsch_turbo_decoding_stats.diff/eNB->ulsch_turbo_decoding_stats.trials),
eNB->ulsch_turbo_decoding_stats.trials); eNB->ulsch_turbo_decoding_stats.trials);
printStatIndent3(&eNB->ulsch_tc_init_stats,"init"); printStatIndent3(&eNB->ulsch_tc_init_stats,"init");
printStatIndent3(&eNB->ulsch_tc_alpha_stats,"alpha"); printStatIndent3(&eNB->ulsch_tc_alpha_stats,"alpha");
......
...@@ -56,6 +56,7 @@ extern eNB_UE_STATS pre_scd_eNB_UE_stats[MAX_NUM_CCs][NUMBER_OF_UE_MAX]; ...@@ -56,6 +56,7 @@ extern eNB_UE_STATS pre_scd_eNB_UE_stats[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
extern mac_rlc_am_muilist_t rlc_am_mui; extern mac_rlc_am_muilist_t rlc_am_mui;
extern SCHEDULER_MODES global_scheduler_mode; extern SCHEDULER_MODES global_scheduler_mode;
void lte_dump_mac_stats(eNB_MAC_INST *mac, FILE *fd);
#include "common/ran_context.h" #include "common/ran_context.h"
extern RAN_CONTEXT_t RC; extern RAN_CONTEXT_t RC;
......
...@@ -1025,10 +1025,6 @@ uint8_t ul_subframe2_k_phich(COMMON_channels_t *cc, sub_frame_t ul_subframe); ...@@ -1025,10 +1025,6 @@ uint8_t ul_subframe2_k_phich(COMMON_channels_t *cc, sub_frame_t ul_subframe);
unsigned char ul_ACK_subframe2M(LTE_TDD_Config_t *tdd_Config,unsigned char subframe); unsigned char ul_ACK_subframe2M(LTE_TDD_Config_t *tdd_Config,unsigned char subframe);
int to_rbg(int dl_Bandwidth);
int to_prb(int dl_Bandwidth);
uint8_t get_Msg3harqpid(COMMON_channels_t *cc, uint8_t get_Msg3harqpid(COMMON_channels_t *cc,
frame_t frame, sub_frame_t current_subframe); frame_t frame, sub_frame_t current_subframe);
......
...@@ -45,41 +45,38 @@ ...@@ -45,41 +45,38 @@
extern RAN_CONTEXT_t RC; extern RAN_CONTEXT_t RC;
extern int oai_exit; extern int oai_exit;
void *mac_stats_thread(void *param) { void lte_dump_mac_stats(eNB_MAC_INST *mac, FILE *fd)
eNB_MAC_INST *mac = (eNB_MAC_INST *)param; {
FILE *fd; UE_info_t *UE_info = &(mac->UE_info);
UE_info_t *UE_info = &(mac->UE_info);
for (int UE_id = 0; UE_id < MAX_MOBILES_PER_ENB; UE_id++) {
while (!oai_exit) { if (UE_info->active[UE_id]) {
sleep(1); int rnti = UE_RNTI(mac->Mod_id, UE_id);
fd=fopen("MAC_stats.log","w+"); int CC_id = UE_PCCID(mac->Mod_id, UE_id);
AssertFatal(fd!=NULL,"Cannot open MAC_stats.log\n"); UE_sched_ctrl_t *UE_scheduling_control = &(UE_info->UE_sched_ctrl[UE_id]);
for (int UE_id = 0; UE_id < MAX_MOBILES_PER_ENB; UE_id++) { double total_bler;
if (UE_info->active[UE_id]) { if (UE_scheduling_control->pusch_rx_num[CC_id] == 0 && UE_scheduling_control->pusch_rx_error_num[CC_id] == 0) {
int rnti = UE_RNTI(mac->Mod_id, UE_id); total_bler = 0;
int CC_id = UE_PCCID(mac->Mod_id, UE_id); } else {
UE_sched_ctrl_t *UE_scheduling_control = &(UE_info->UE_sched_ctrl[UE_id]); total_bler = (double)UE_scheduling_control->pusch_rx_error_num[CC_id] / (double)(UE_scheduling_control->pusch_rx_error_num[CC_id] + UE_scheduling_control->pusch_rx_num[CC_id]) * 100;
}
double total_bler; fprintf(fd,
if(UE_scheduling_control->pusch_rx_num[CC_id] == 0 && UE_scheduling_control->pusch_rx_error_num[CC_id] == 0) { "MAC UE rnti %x : %s, PHR %d DLCQI %d PUSCH %d PUCCH %d RLC disc %d UL-stat rcv %lu err %lu bler %lf (%lf/%lf) total_bler %lf mcsoff %d pre_allocated nb_rb %d, mcs %d, bsr %u sched %u "
total_bler = 0; "tbs %lu cnt %u , DL-stat tbs %lu cnt %u rb %u buf %u 1st %u ret %u ri %d inactivity timer %d\n",
}
else {
total_bler = (double)UE_scheduling_control->pusch_rx_error_num[CC_id] / (double)(UE_scheduling_control->pusch_rx_error_num[CC_id] + UE_scheduling_control->pusch_rx_num[CC_id]) * 100;
}
fprintf(fd,"MAC UE rnti %x : %s, PHR %d DLCQI %d PUSCH %d PUCCH %d RLC disc %d UL-stat rcv %lu err %lu bler %lf (%lf/%lf) total_bler %lf mcsoff %d pre_allocated nb_rb %d, mcs %d, bsr %u sched %u tbs %lu cnt %u , DL-stat tbs %lu cnt %u rb %u buf %u 1st %u ret %u ri %d inactivity timer %d\n",
rnti, rnti,
UE_scheduling_control->ul_out_of_sync == 0 ? "in synch" : "out of sync", UE_scheduling_control->ul_out_of_sync == 0 ? "in synch" : "out of sync",
UE_info->UE_template[CC_id][UE_id].phr_info, UE_info->UE_template[CC_id][UE_id].phr_info,
UE_scheduling_control->dl_cqi[CC_id], UE_scheduling_control->dl_cqi[CC_id],
UE_scheduling_control->pusch_snr/*_avg*/[CC_id], UE_scheduling_control->pusch_snr /*_avg*/[CC_id],
UE_scheduling_control->pucch1_snr[CC_id], UE_scheduling_control->pucch1_snr[CC_id],
UE_scheduling_control->rlc_out_of_resources_cnt, UE_scheduling_control->rlc_out_of_resources_cnt,
UE_scheduling_control->pusch_rx_num[CC_id], UE_scheduling_control->pusch_rx_num[CC_id],
UE_scheduling_control->pusch_rx_error_num[CC_id], UE_scheduling_control->pusch_rx_error_num[CC_id],
UE_scheduling_control->pusch_bler[CC_id], UE_scheduling_control->pusch_bler[CC_id],
mac->bler_lower,mac->bler_upper,total_bler, mac->bler_lower,
mac->bler_upper,
total_bler,
UE_scheduling_control->mcs_offset[CC_id], UE_scheduling_control->mcs_offset[CC_id],
UE_info->UE_template[CC_id][UE_id].pre_allocated_nb_rb_ul, UE_info->UE_template[CC_id][UE_id].pre_allocated_nb_rb_ul,
UE_info->UE_template[CC_id][UE_id].pre_assigned_mcs_ul, UE_info->UE_template[CC_id][UE_id].pre_assigned_mcs_ul,
...@@ -98,8 +95,7 @@ void *mac_stats_thread(void *param) { ...@@ -98,8 +95,7 @@ void *mac_stats_thread(void *param) {
UE_scheduling_control->first_cnt[CC_id], UE_scheduling_control->first_cnt[CC_id],
UE_scheduling_control->ret_cnt[CC_id], UE_scheduling_control->ret_cnt[CC_id],
UE_scheduling_control->aperiodic_ri_received[CC_id], UE_scheduling_control->aperiodic_ri_received[CC_id],
UE_scheduling_control->ul_inactivity_timer UE_scheduling_control->ul_inactivity_timer);
);
fprintf(fd," ULSCH rounds %d/%d/%d/%d, DLSCH rounds %d/%d/%d/%d, ULSCH errors %d, DLSCH errors %d\n", fprintf(fd," ULSCH rounds %d/%d/%d/%d, DLSCH rounds %d/%d/%d/%d, ULSCH errors %d, DLSCH errors %d\n",
UE_info->eNB_UE_stats[CC_id][UE_id].ulsch_rounds[0], UE_info->eNB_UE_stats[CC_id][UE_id].ulsch_rounds[0],
UE_info->eNB_UE_stats[CC_id][UE_id].ulsch_rounds[1], UE_info->eNB_UE_stats[CC_id][UE_id].ulsch_rounds[1],
...@@ -111,13 +107,24 @@ void *mac_stats_thread(void *param) { ...@@ -111,13 +107,24 @@ void *mac_stats_thread(void *param) {
UE_info->eNB_UE_stats[CC_id][UE_id].dlsch_rounds[3], UE_info->eNB_UE_stats[CC_id][UE_id].dlsch_rounds[3],
UE_info->eNB_UE_stats[CC_id][UE_id].ulsch_errors, UE_info->eNB_UE_stats[CC_id][UE_id].ulsch_errors,
UE_info->eNB_UE_stats[CC_id][UE_id].dlsch_errors); UE_info->eNB_UE_stats[CC_id][UE_id].dlsch_errors);
}
}
return;
}
void *mac_stats_thread(void *param)
{
eNB_MAC_INST *mac = (eNB_MAC_INST *)param;
FILE *fd;
} while (!oai_exit) {
} sleep(1);
fd = fopen("MAC_stats.log", "w+");
AssertFatal(fd != NULL, "Cannot open MAC_stats.log\n");
lte_dump_mac_stats(mac, fd);
fclose(fd); fclose(fd);
} }
return(NULL); return NULL;
} }
void init_UE_info(UE_info_t *UE_info) void init_UE_info(UE_info_t *UE_info)
...@@ -206,8 +213,8 @@ void mac_top_init_eNB(void) ...@@ -206,8 +213,8 @@ void mac_top_init_eNB(void)
rrc_init_global_param(); rrc_init_global_param();
for (i=0;i<RC.nb_macrlc_inst; i++) pthread_create(&mac[i]->mac_stats_thread,NULL,mac_stats_thread,(void*)mac[i]); for (i = 0; i < RC.nb_macrlc_inst; i++)
threadCreate(&mac[i]->mac_stats_thread, mac_stats_thread, (void *)mac[i], "mac stats", -1, sched_get_priority_min(SCHED_OAI));
} }
void mac_init_cell_params(int Mod_idP, int CC_idP) void mac_init_cell_params(int Mod_idP, int CC_idP)
......
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