Commit 7f7acd5e authored by Eurecom's avatar Eurecom

timing measure for full coding process

parent 394c3a7a
...@@ -680,6 +680,8 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB, ...@@ -680,6 +680,8 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB,
time_stats_t *i_stats) time_stats_t *i_stats)
{ {
//start_meas(&eNB->dlsch_turbo_encoding_preperation_stats);
LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms; LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms;
eNB_proc_t *proc = &eNB->proc; eNB_proc_t *proc = &eNB->proc;
unsigned int G; unsigned int G;
...@@ -701,6 +703,7 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB, ...@@ -701,6 +703,7 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB,
if (dlsch->harq_processes[harq_pid]->round == 0) { // this is a new packet if (dlsch->harq_processes[harq_pid]->round == 0) { // this is a new packet
start_meas(&eNB->dlsch_turbo_encoding_preperation_stats);
// Add 24-bit crc (polynomial A) to payload // Add 24-bit crc (polynomial A) to payload
crc = crc24a(a, crc = crc24a(a,
A)>>8; A)>>8;
...@@ -710,7 +713,9 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB, ...@@ -710,7 +713,9 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB,
dlsch->harq_processes[harq_pid]->B = A+24; dlsch->harq_processes[harq_pid]->B = A+24;
memcpy(dlsch->harq_processes[harq_pid]->b,a,(A/8)+4); memcpy(dlsch->harq_processes[harq_pid]->b,a,(A/8)+4);
stop_meas(&eNB->dlsch_turbo_encoding_preperation_stats);
start_meas(&eNB->dlsch_turbo_encoding_segmentation_stats);
if (lte_segmentation(dlsch->harq_processes[harq_pid]->b, if (lte_segmentation(dlsch->harq_processes[harq_pid]->b,
dlsch->harq_processes[harq_pid]->c, dlsch->harq_processes[harq_pid]->c,
dlsch->harq_processes[harq_pid]->B, dlsch->harq_processes[harq_pid]->B,
...@@ -722,8 +727,26 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB, ...@@ -722,8 +727,26 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB,
&dlsch->harq_processes[harq_pid]->F)<0) &dlsch->harq_processes[harq_pid]->F)<0)
return(-1); return(-1);
stop_meas(&eNB->dlsch_turbo_encoding_segmentation_stats);
proc->tep[0].eNB = eNB;
proc->tep[0].dlsch = dlsch;
proc->tep[0].G = G;
proc->tep[0].harq_pid = harq_pid;
proc->tep[1].eNB = eNB;
proc->tep[1].dlsch = dlsch;
proc->tep[1].G = G;
proc->tep[1].harq_pid = harq_pid;
proc->tep[2].eNB = eNB;
proc->tep[2].dlsch = dlsch;
proc->tep[2].G = G;
proc->tep[2].harq_pid = harq_pid;
start_meas(&eNB->dlsch_turbo_encoding_signal_stats);
pthread_mutex_lock( &proc->mutex_te[0] );
if (proc->instance_cnt_te[0]==0) { if (proc->instance_cnt_te[0]==0) {
printf("[eNB] TE thread busy\n"); printf("[eNB] TE thread busy\n");
exit_fun("TE thread busy"); exit_fun("TE thread busy");
...@@ -733,11 +756,6 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB, ...@@ -733,11 +756,6 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB,
++proc->instance_cnt_te[0]; ++proc->instance_cnt_te[0];
proc->tep[0].eNB = eNB;
proc->tep[0].dlsch = dlsch;
proc->tep[0].G = G;
proc->tep[0].harq_pid = harq_pid;
// wakeup worker to do second half segments // wakeup worker to do second half segments
if (pthread_cond_signal(&proc->cond_te[0]) != 0) { if (pthread_cond_signal(&proc->cond_te[0]) != 0) {
printf("[eNB] ERROR pthread_cond_signal for te thread exit\n"); printf("[eNB] ERROR pthread_cond_signal for te thread exit\n");
...@@ -748,6 +766,7 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB, ...@@ -748,6 +766,7 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB,
pthread_mutex_unlock( &proc->mutex_te[0] ); pthread_mutex_unlock( &proc->mutex_te[0] );
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
pthread_mutex_lock( &proc->mutex_te[1] );
if (proc->instance_cnt_te[1]==0) { if (proc->instance_cnt_te[1]==0) {
printf("[eNB] TE thread busy\n"); printf("[eNB] TE thread busy\n");
exit_fun("TE thread busy"); exit_fun("TE thread busy");
...@@ -757,11 +776,6 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB, ...@@ -757,11 +776,6 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB,
++proc->instance_cnt_te[1]; ++proc->instance_cnt_te[1];
proc->tep[1].eNB = eNB;
proc->tep[1].dlsch = dlsch;
proc->tep[1].G = G;
proc->tep[1].harq_pid = harq_pid;
// wakeup worker to do second half segments // wakeup worker to do second half segments
if (pthread_cond_signal(&proc->cond_te[1]) != 0) { if (pthread_cond_signal(&proc->cond_te[1]) != 0) {
printf("[eNB] ERROR pthread_cond_signal for te thread exit\n"); printf("[eNB] ERROR pthread_cond_signal for te thread exit\n");
...@@ -773,6 +787,7 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB, ...@@ -773,6 +787,7 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB,
pthread_mutex_unlock( &proc->mutex_te[1] ); pthread_mutex_unlock( &proc->mutex_te[1] );
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
pthread_mutex_lock( &proc->mutex_te[2] );
if (proc->instance_cnt_te[2]==0) { if (proc->instance_cnt_te[2]==0) {
printf("[eNB] TE thread busy\n"); printf("[eNB] TE thread busy\n");
exit_fun("TE thread busy"); exit_fun("TE thread busy");
...@@ -782,11 +797,6 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB, ...@@ -782,11 +797,6 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB,
++proc->instance_cnt_te[2]; ++proc->instance_cnt_te[2];
proc->tep[2].eNB = eNB;
proc->tep[2].dlsch = dlsch;
proc->tep[2].G = G;
proc->tep[2].harq_pid = harq_pid;
// wakeup worker to do second half segments // wakeup worker to do second half segments
if (pthread_cond_signal(&proc->cond_te[2]) != 0) { if (pthread_cond_signal(&proc->cond_te[2]) != 0) {
printf("[eNB] ERROR pthread_cond_signal for te thread exit\n"); printf("[eNB] ERROR pthread_cond_signal for te thread exit\n");
...@@ -797,6 +807,7 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB, ...@@ -797,6 +807,7 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB,
pthread_mutex_unlock( &proc->mutex_te[2] ); pthread_mutex_unlock( &proc->mutex_te[2] );
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
stop_meas(&eNB->dlsch_turbo_encoding_signal_stats);
start_meas(te_main_stats); start_meas(te_main_stats);
for (r=(dlsch->harq_processes[harq_pid]->C>>2)*3; r<dlsch->harq_processes[harq_pid]->C; r++) { for (r=(dlsch->harq_processes[harq_pid]->C>>2)*3; r<dlsch->harq_processes[harq_pid]->C; r++) {
......
...@@ -1143,8 +1143,11 @@ typedef struct PHY_VARS_eNB_s { ...@@ -1143,8 +1143,11 @@ typedef struct PHY_VARS_eNB_s {
time_stats_t dlsch_modulation_stats; time_stats_t dlsch_modulation_stats;
time_stats_t dlsch_scrambling_stats; time_stats_t dlsch_scrambling_stats;
time_stats_t dlsch_rate_matching_stats; time_stats_t dlsch_rate_matching_stats;
time_stats_t dlsch_turbo_encoding_preperation_stats;
time_stats_t dlsch_turbo_encoding_segmentation_stats;
time_stats_t dlsch_turbo_encoding_stats; time_stats_t dlsch_turbo_encoding_stats;
time_stats_t dlsch_turbo_encoding_waiting_stats; time_stats_t dlsch_turbo_encoding_waiting_stats;
time_stats_t dlsch_turbo_encoding_signal_stats;
time_stats_t dlsch_turbo_encoding_main_stats; time_stats_t dlsch_turbo_encoding_main_stats;
time_stats_t dlsch_turbo_encoding_wakeup_stats0; time_stats_t dlsch_turbo_encoding_wakeup_stats0;
time_stats_t dlsch_turbo_encoding_wakeup_stats1; time_stats_t dlsch_turbo_encoding_wakeup_stats1;
......
...@@ -711,7 +711,10 @@ static void* process_stats_thread(void* param) { ...@@ -711,7 +711,10 @@ static void* process_stats_thread(void* param) {
if (eNB->td) print_meas(&eNB->ulsch_decoding_stats,"ulsch_decoding",NULL,NULL); if (eNB->td) print_meas(&eNB->ulsch_decoding_stats,"ulsch_decoding",NULL,NULL);
if (eNB->te) if (eNB->te)
{ {
print_meas(&eNB->dlsch_turbo_encoding_preperation_stats,"dlsch_coding_prepare",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_encoding_stats,"dlsch_encoding",NULL,NULL);
print_meas(&eNB->dlsch_turbo_encoding_signal_stats,"coding_signal",NULL,NULL);
print_meas(&eNB->dlsch_turbo_encoding_main_stats,"coding_main",NULL,NULL); print_meas(&eNB->dlsch_turbo_encoding_main_stats,"coding_main",NULL,NULL);
print_meas(&eNB->dlsch_turbo_encoding_waiting_stats,"coding_wait",NULL,NULL); print_meas(&eNB->dlsch_turbo_encoding_waiting_stats,"coding_wait",NULL,NULL);
print_meas(&eNB->dlsch_turbo_encoding_wakeup_stats0,"coding_worker_0",NULL,NULL); print_meas(&eNB->dlsch_turbo_encoding_wakeup_stats0,"coding_worker_0",NULL,NULL);
......
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