Commit 42687dfe authored by magounak's avatar magounak

changes at wakeup_rxtx for the RU mask

parent 4c83082e
...@@ -175,7 +175,7 @@ extern void add_subframe(uint16_t *frameP, uint16_t *subframeP, int offset); ...@@ -175,7 +175,7 @@ extern void add_subframe(uint16_t *frameP, uint16_t *subframeP, int offset);
static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_name) { static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_name) {
start_meas(&softmodem_stats_rxtx_sf); start_meas(&softmodem_stats_rxtx_sf);
// ******************************************************************* // *******************************************************************
LOG_I(PHY,"ENTERED rxtx\n");
if (nfapi_mode == 1) { if (nfapi_mode == 1) {
// I am a PNF and I need to let nFAPI know that we have a (sub)frame tick // I am a PNF and I need to let nFAPI know that we have a (sub)frame tick
...@@ -269,7 +269,7 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam ...@@ -269,7 +269,7 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam
stop_meas( &softmodem_stats_rxtx_sf ); stop_meas( &softmodem_stats_rxtx_sf );
LOG_D(PHY,"%s() Exit proc[rx:%d%d tx:%d%d]\n", __FUNCTION__, proc->frame_rx, proc->subframe_rx, proc->frame_tx, proc->subframe_tx); LOG_I(PHY,"%s() Exit proc[rx:%d%d tx:%d%d]\n", __FUNCTION__, proc->frame_rx, proc->subframe_rx, proc->frame_tx, proc->subframe_tx);
LOG_D(PHY, "rxtx:%lld nfapi:%lld phy:%lld tx:%lld rx:%lld prach:%lld ofdm:%lld ", LOG_D(PHY, "rxtx:%lld nfapi:%lld phy:%lld tx:%lld rx:%lld prach:%lld ofdm:%lld ",
softmodem_stats_rxtx_sf.p_time, nfapi_meas.p_time, softmodem_stats_rxtx_sf.p_time, nfapi_meas.p_time,
...@@ -320,7 +320,7 @@ static void* tx_thread(void* param) { ...@@ -320,7 +320,7 @@ static void* tx_thread(void* param) {
eNB_proc_t *eNB_proc = &eNB->proc; eNB_proc_t *eNB_proc = &eNB->proc;
eNB_rxtx_proc_t *proc = &eNB_proc->proc_rxtx[1]; eNB_rxtx_proc_t *proc = &eNB_proc->proc_rxtx[1];
//PHY_VARS_eNB *eNB = RC.eNB[0][proc->CC_id]; //PHY_VARS_eNB *eNB = RC.eNB[0][proc->CC_id];
LOG_I(PHY,"ENTERED tx_thread\n");
char thread_name[100]; char thread_name[100];
sprintf(thread_name,"TXnp4_%d",&eNB->proc.proc_rxtx[0] == proc ? 0 : 1); sprintf(thread_name,"TXnp4_%d",&eNB->proc.proc_rxtx[0] == proc ? 0 : 1);
thread_top_init(thread_name,1,470000,500000,500000); thread_top_init(thread_name,1,470000,500000,500000);
...@@ -354,7 +354,7 @@ if (oai_exit) break; ...@@ -354,7 +354,7 @@ if (oai_exit) break;
LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread\n"); LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread\n");
exit_fun( "ERROR pthread_cond_signal" ); exit_fun( "ERROR pthread_cond_signal" );
} }
LOG_D(PHY,"Sent tx_thread, proc1->cond_rxtx to tx_thread, frame_rx %d, subframe_rx %d, frame_tx %d, subframe_tx %d\n", proc->frame_rx,proc->subframe_rx,proc->frame_tx,proc->subframe_tx); LOG_I(PHY,"Sent tx_thread, proc1->cond_rxtx to tx_thread, frame_rx %d, subframe_rx %d, frame_tx %d, subframe_tx %d\n", proc->frame_rx,proc->subframe_rx,proc->frame_tx,proc->subframe_tx);
pthread_mutex_unlock( &proc->mutex_rxtx ); pthread_mutex_unlock( &proc->mutex_rxtx );
wakeup_txfh(proc,eNB); wakeup_txfh(proc,eNB);
} }
...@@ -373,7 +373,7 @@ static void* eNB_thread_rxtx( void* param ) { ...@@ -373,7 +373,7 @@ static void* eNB_thread_rxtx( void* param ) {
static int eNB_thread_rxtx_status; static int eNB_thread_rxtx_status;
//eNB_proc_t *eNB_proc = (eNB_proc_t*)param; //eNB_proc_t *eNB_proc = (eNB_proc_t*)param;
eNB_rxtx_proc_t *proc; eNB_rxtx_proc_t *proc;
LOG_I(PHY,"ENTERED eNB_thread_rxtx\n");
// Working // Working
if(nfapi_mode ==2){ if(nfapi_mode ==2){
proc = (eNB_rxtx_proc_t*)param; proc = (eNB_rxtx_proc_t*)param;
...@@ -409,16 +409,9 @@ static void* eNB_thread_rxtx( void* param ) { ...@@ -409,16 +409,9 @@ static void* eNB_thread_rxtx( void* param ) {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 0 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 0 );
T(T_ENB_MASTER_TICK, T_INT(0), T_INT(proc->frame_rx), T_INT(proc->subframe_rx)); T(T_ENB_MASTER_TICK, T_INT(0), T_INT(proc->frame_rx), T_INT(proc->subframe_rx));
<<<<<<< HEAD
LOG_D(PHY,"Entering eNB_thread_rxtx, proc0->cond_rxtx, instance_cnt_rxtx, frame_rx %d, subframe_rx %d, frame_tx %d, subframe_tx %d\n", proc->frame_rx,proc->subframe_rx,proc->frame_tx,proc->subframe_tx); LOG_D(PHY,"Entering eNB_thread_rxtx, proc0->cond_rxtx, instance_cnt_rxtx, frame_rx %d, subframe_rx %d, frame_tx %d, subframe_tx %d\n", proc->frame_rx,proc->subframe_rx,proc->frame_tx,proc->subframe_tx);
if (wait_on_condition(&proc->mutex_rxtx,&proc->cond_rxtx,&proc->instance_cnt_rxtx,thread_name)<0) break; if (wait_on_condition(&proc->mutex_rxtx,&proc->cond_rxtx,&proc->instance_cnt_rxtx,thread_name)<0) break;
LOG_D(PHY,"Passed eNB_thread_rxtx proc0->cond_rxtx , frame_rx %d, subframe_rx %d, frame_tx %d, subframe_tx %d\n", proc->frame_rx,proc->subframe_rx,proc->frame_tx,proc->subframe_tx); LOG_D(PHY,"Passed eNB_thread_rxtx proc0->cond_rxtx , frame_rx %d, subframe_rx %d, frame_tx %d, subframe_tx %d\n", proc->frame_rx,proc->subframe_rx,proc->frame_tx,proc->subframe_tx);
=======
//printf("Entering eNB_thread_rxtx, proc0->cond_rxtx, instance_cnt_rxtx %d, frame_rx %d, subframe_rx %d, frame_tx %d, subframe_tx %d\n",
// proc->instance_cnt_rxtx,proc->frame_rx,proc->subframe_rx,proc->frame_tx,proc->subframe_tx);
if (wait_on_condition(&proc->mutex_rxtx,&proc->cond_rxtx,&proc->instance_cnt_rxtx,thread_name)<0) break;
//printf("Passed eNB_thread_rxtx proc0->cond_rxtx , frame_rx %d, subframe_rx %d, frame_tx %d, subframe_tx %d\n", proc->frame_rx,proc->subframe_rx,proc->frame_tx,proc->subframe_tx);
>>>>>>> 22eccb1c2e995bf05c9a1f516f7ac6edfe96a2fb
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_CPUID_ENB_THREAD_RXTX,sched_getcpu()); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_CPUID_ENB_THREAD_RXTX,sched_getcpu());
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 1 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 1 );
...@@ -445,7 +438,7 @@ static void* eNB_thread_rxtx( void* param ) { ...@@ -445,7 +438,7 @@ static void* eNB_thread_rxtx( void* param ) {
LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread\n"); LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread\n");
exit_fun( "ERROR pthread_cond_signal" ); exit_fun( "ERROR pthread_cond_signal" );
} }
LOG_D(PHY,"Sent eNB_thread_rxtx proc0-> cond_rxtx to tx_thread, frame_rx %d, subframe_rx %d, frame_tx %d, subframe_tx %d\n", proc->frame_rx,proc->subframe_rx,proc->frame_tx,proc->subframe_tx); LOG_I(PHY,"Sent eNB_thread_rxtx proc0-> cond_rxtx to tx_thread, frame_rx %d, subframe_rx %d, frame_tx %d, subframe_tx %d\n", proc->frame_rx,proc->subframe_rx,proc->frame_tx,proc->subframe_tx);
pthread_mutex_unlock( &proc->mutex_rxtx ); pthread_mutex_unlock( &proc->mutex_rxtx );
if (nfapi_mode!=2){ if (nfapi_mode!=2){
if(get_thread_parallel_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);
...@@ -500,7 +493,7 @@ int wakeup_txfh(eNB_rxtx_proc_t *proc,PHY_VARS_eNB *eNB) { ...@@ -500,7 +493,7 @@ int wakeup_txfh(eNB_rxtx_proc_t *proc,PHY_VARS_eNB *eNB) {
wait.tv_sec=0; wait.tv_sec=0;
wait.tv_nsec=5000000L; wait.tv_nsec=5000000L;
LTE_DL_FRAME_PARMS *fp; LTE_DL_FRAME_PARMS *fp;
LOG_I(PHY,"ENTERED wakeup_txfh\n");
for(int ru_id=0; ru_id<eNB->num_RU; ru_id++){ for(int ru_id=0; ru_id<eNB->num_RU; ru_id++){
ru_proc = &eNB->RU_list[ru_id]->proc; ru_proc = &eNB->RU_list[ru_id]->proc;
fp = &eNB->RU_list[ru_id]->frame_parms; fp = &eNB->RU_list[ru_id]->frame_parms;
...@@ -526,11 +519,7 @@ int wakeup_txfh(eNB_rxtx_proc_t *proc,PHY_VARS_eNB *eNB) { ...@@ -526,11 +519,7 @@ int wakeup_txfh(eNB_rxtx_proc_t *proc,PHY_VARS_eNB *eNB) {
exit_fun( "error locking mutex_eNB" ); exit_fun( "error locking mutex_eNB" );
return(-1); return(-1);
} }
<<<<<<< HEAD
LOG_D(PHY,"waking up for frame %d subframe %d for RU TX \n", proc->frame_tx, proc->subframe_tx); LOG_D(PHY,"waking up for frame %d subframe %d for RU TX \n", proc->frame_tx, proc->subframe_tx);
=======
//printf("waking up for frame %d subframe %d for RU TX \n", proc->frame_tx, proc->subframe_tx);
>>>>>>> 22eccb1c2e995bf05c9a1f516f7ac6edfe96a2fb
++ru_proc->instance_cnt_eNBs; ++ru_proc->instance_cnt_eNBs;
ru_proc->timestamp_tx = proc->timestamp_tx; ru_proc->timestamp_tx = proc->timestamp_tx;
ru_proc->subframe_tx = proc->subframe_tx; ru_proc->subframe_tx = proc->subframe_tx;
...@@ -542,7 +531,7 @@ int wakeup_txfh(eNB_rxtx_proc_t *proc,PHY_VARS_eNB *eNB) { ...@@ -542,7 +531,7 @@ int wakeup_txfh(eNB_rxtx_proc_t *proc,PHY_VARS_eNB *eNB) {
exit_fun( "ERROR pthread_cond_signal" ); exit_fun( "ERROR pthread_cond_signal" );
return(-1); return(-1);
} }
LOG_D(PHY,"Sent wakeup_txfh ru_proc->cond_eNBs to tx_thread\n, frame_rx %d, subframe_rx %d, frame_tx %d, subframe_tx %d\n", proc->frame_rx,proc->subframe_rx,ru_proc->frame_tx,ru_proc->subframe_tx); LOG_I(PHY,"Sent wakeup_txfh ru_proc->cond_eNBs to tx_thread\n, frame_rx %d, subframe_rx %d, frame_tx %d, subframe_tx %d\n", proc->frame_rx,proc->subframe_rx,ru_proc->frame_tx,ru_proc->subframe_tx);
pthread_mutex_unlock( &ru_proc->mutex_eNBs ); pthread_mutex_unlock( &ru_proc->mutex_eNBs );
} }
return(0); return(0);
...@@ -560,7 +549,7 @@ if ((fp->frame_type == TDD) && (subframe_select(fp,proc_rxtx0->subframe_tx)==SF_ ...@@ -560,7 +549,7 @@ if ((fp->frame_type == TDD) && (subframe_select(fp,proc_rxtx0->subframe_tx)==SF_
struct timespec wait; struct timespec wait;
wait.tv_sec=0; wait.tv_sec=0;
wait.tv_nsec=5000000L; wait.tv_nsec=5000000L;
LOG_I(PHY,"ENTERED wakeup_tx\n");
if (proc_rxtx1->instance_cnt_rxtx == 0) { if (proc_rxtx1->instance_cnt_rxtx == 0) {
...@@ -589,11 +578,7 @@ if ((fp->frame_type == TDD) && (subframe_select(fp,proc_rxtx0->subframe_tx)==SF_ ...@@ -589,11 +578,7 @@ if ((fp->frame_type == TDD) && (subframe_select(fp,proc_rxtx0->subframe_tx)==SF_
exit_fun( "ERROR pthread_cond_signal" ); exit_fun( "ERROR pthread_cond_signal" );
return(-1); return(-1);
} }
<<<<<<< HEAD LOG_I(PHY,"Sent wakeup_tx proc1->cond_rxtx to tx_thread, frame_rx %d, subframe_rx %d, frame_tx %d, subframe_tx %d\n", proc_rxtx1->frame_rx,proc_rxtx1->subframe_rx,proc_rxtx1->frame_tx,proc_rxtx1->subframe_tx);
LOG_D(PHY,"Sent wakeup_tx proc1->cond_rxtx to tx_thread, frame_rx %d, subframe_rx %d, frame_tx %d, subframe_tx %d\n", proc_rxtx1->frame_rx,proc_rxtx1->subframe_rx,proc_rxtx1->frame_tx,proc_rxtx1->subframe_tx);
=======
//printf("Sent wakeup_tx proc1->cond_rxtx to tx_thread, frame_rx %d, subframe_rx %d, frame_tx %d, subframe_tx %d\n", proc_rxtx1->frame_rx,proc_rxtx1->subframe_rx,proc_rxtx1->frame_tx,proc_rxtx1->subframe_tx);
>>>>>>> 22eccb1c2e995bf05c9a1f516f7ac6edfe96a2fb
pthread_mutex_unlock( &proc_rxtx1->mutex_rxtx ); pthread_mutex_unlock( &proc_rxtx1->mutex_rxtx );
return(0); return(0);
...@@ -605,54 +590,22 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) { ...@@ -605,54 +590,22 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) {
eNB_rxtx_proc_t *proc_rxtx0=&proc->proc_rxtx[0]; eNB_rxtx_proc_t *proc_rxtx0=&proc->proc_rxtx[0];
//eNB_rxtx_proc_t *proc_rxtx1=&proc->proc_rxtx[1]; //eNB_rxtx_proc_t *proc_rxtx1=&proc->proc_rxtx[1];
LOG_I(PHY,"ENTERED wakeup_rxtx\n");
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms; LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
int i; int i;
struct timespec wait; struct timespec wait;
pthread_mutex_lock(&proc->mutex_RU);
for (i=0;i<eNB->num_RU;i++) {
if (ru == eNB->RU_list[i]) {
if ((proc->RU_mask[ru->proc.subframe_rx]&(1<<i)) > 0)
LOG_E(PHY,"eNB %d frame %d, subframe %d : previous information from RU %d (num_RU %d,mask %x) has not been served yet!\n",
eNB->Mod_id,proc->frame_rx,proc->subframe_rx,ru->idx,eNB->num_RU,proc->RU_mask[ru->proc.subframe_rx]);
proc->RU_mask[ru->proc.subframe_rx] |= (1<<i);
}else if (eNB->RU_list[i]->state == RU_SYNC){
proc->RU_mask[ru->proc.subframe_rx] |= (1<<i);
}
}
if (proc->RU_mask[ru->proc.subframe_rx] != (1<<eNB->num_RU)-1) { // not all RUs have provided their information so return
LOG_E(PHY,"Not all RUs have provided their info\n");
pthread_mutex_unlock(&proc->mutex_RU);
return(0);
}
else { // all RUs have provided their information so continue on and wakeup eNB processing
proc->RU_mask[ru->proc.subframe_rx] = 0;
pthread_mutex_unlock(&proc->mutex_RU);
}
wait.tv_sec=0; wait.tv_sec=0;
wait.tv_nsec=5000000L; wait.tv_nsec=5000000L;
<<<<<<< HEAD LOG_D(PHY,"Entering wakeup_rxtx, cond_rxtx, proc0->pipe_ready, frame %d, subframe %d\n", proc_rxtx0->frame_rx,proc_rxtx0->subframe_rx);
LOG_D(PHY,"Entering wakeup_rxtx, cond_rxtx, proc0->pipe_ready, frame %d, subframe %d\n", proc_rxtx0->frame_rx,proc_rxtx0->subframe_rx,proc_rxtx0->frame_tx,proc_rxtx0->subframe_tx);
=======
//printf("Entering wakeup_rxtx, cond_rxtx, proc0->pipe_ready %d, frame %d, subframe %d\n", proc_rxtx0->pipe_ready,proc_rxtx0->frame_rx,proc_rxtx0->subframe_rx);
>>>>>>> 22eccb1c2e995bf05c9a1f516f7ac6edfe96a2fb
if(wait_on_condition(&proc_rxtx0->mutex_rxtx,&proc_rxtx0->cond_rxtx,&proc_rxtx0->pipe_ready,"wakeup_rxtx")<0) { if(wait_on_condition(&proc_rxtx0->mutex_rxtx,&proc_rxtx0->cond_rxtx,&proc_rxtx0->pipe_ready,"wakeup_rxtx")<0) {
LOG_E(PHY,"Frame %d, subframe %d: RXTX0 not ready\n",proc_rxtx0->frame_rx,proc_rxtx0->subframe_rx); LOG_E(PHY,"Frame %d, subframe %d: RXTX0 not ready\n",proc_rxtx0->frame_rx,proc_rxtx0->subframe_rx);
return(-1); return(-1);
} }
<<<<<<< HEAD LOG_D(PHY,"Passed wakeup_rxtx proc0->cond_rxtx, frame %d, subframe %d\n", proc_rxtx0->frame_rx,proc_rxtx0->subframe_rx);
LOG_D(PHY,"Passed wakeup_rxtx proc0->cond_rxtx, frame %d, subframe %d\n", proc_rxtx0->frame_rx,proc_rxtx0->subframe_rx,proc_rxtx0->frame_tx,proc_rxtx0->subframe_tx);
=======
//printf("Passed wakeup_rxtx proc0->cond_rxtx, frame %d, subframe %d\n", proc_rxtx0->frame_rx,proc_rxtx0->subframe_rx);
>>>>>>> 22eccb1c2e995bf05c9a1f516f7ac6edfe96a2fb
if (release_thread(&proc_rxtx0->mutex_rxtx,&proc_rxtx0->pipe_ready,"wakeup_rxtx")<0) return(-1); if (release_thread(&proc_rxtx0->mutex_rxtx,&proc_rxtx0->pipe_ready,"wakeup_rxtx")<0) return(-1);
if (proc_rxtx0->instance_cnt_rxtx == 0) { if (proc_rxtx0->instance_cnt_rxtx == 0) {
...@@ -668,7 +621,6 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) { ...@@ -668,7 +621,6 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) {
return(-1); return(-1);
} }
++proc_rxtx0->instance_cnt_rxtx; ++proc_rxtx0->instance_cnt_rxtx;
// We have just received and processed the common part of a subframe, say n. // We have just received and processed the common part of a subframe, say n.
...@@ -689,11 +641,7 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) { ...@@ -689,11 +641,7 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) {
exit_fun( "ERROR pthread_cond_signal" ); exit_fun( "ERROR pthread_cond_signal" );
return(-1); return(-1);
} }
<<<<<<< HEAD LOG_I(PHY,"Sent wakeup_rxtx proc0->cond_rxtx to eNB_thread_rxtx, frame_rx %d, subframe_rx %d, frame_tx %d, subframe_tx %d\n", proc_rxtx0->frame_rx,proc_rxtx0->subframe_rx,proc_rxtx0->frame_tx,proc_rxtx0->subframe_tx);
LOG_D(PHY,"Sent wakeup_rxtx proc0->cond_rxtx to eNB_thread_rxtx, frame %d, subframe %d\n", proc_rxtx0->frame_rx,proc_rxtx0->subframe_rx,proc_rxtx0->frame_tx,proc_rxtx0->subframe_tx);
=======
//printf("Sent wakeup_rxtx proc0->cond_rxtx to eNB_thread_rxtx, frame %d, subframe %d\n", proc_rxtx0->frame_rx,proc_rxtx0->subframe_rx);
>>>>>>> 22eccb1c2e995bf05c9a1f516f7ac6edfe96a2fb
pthread_mutex_unlock( &proc_rxtx0->mutex_rxtx ); pthread_mutex_unlock( &proc_rxtx0->mutex_rxtx );
return(0); return(0);
......
...@@ -155,10 +155,11 @@ static inline void fh_if5_south_out(RU_t *ru) { ...@@ -155,10 +155,11 @@ static inline void fh_if5_south_out(RU_t *ru) {
// southbound IF4p5 fronthaul // southbound IF4p5 fronthaul
static inline void fh_if4p5_south_out(RU_t *ru) { static inline void fh_if4p5_south_out(RU_t *ru) {
if (ru == RC.ru[0]) VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, ru->proc.timestamp_tx&0xffffffff ); if (ru == RC.ru[0]) VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, ru->proc.timestamp_tx&0xffffffff );
LOG_D(PHY,"Sending IF4p5 for frame %d subframe %d\n",ru->proc.frame_tx,ru->proc.subframe_tx); LOG_I(PHY,"ENTERED fh_if4p5_south_out Sending IF4p5 for frame %d subframe %d ru %d\n",ru->proc.frame_tx,ru->proc.subframe_tx,ru->idx);
if (subframe_select(&ru->frame_parms,ru->proc.subframe_tx)!=SF_UL) { if (subframe_select(&ru->frame_parms,ru->proc.subframe_tx)!=SF_UL) {
send_IF4p5(ru,ru->proc.frame_tx, ru->proc.subframe_tx, IF4p5_PDLFFT); send_IF4p5(ru,ru->proc.frame_tx, ru->proc.subframe_tx, IF4p5_PDLFFT);
ru->south_out_cnt++; ru->south_out_cnt++;
LOG_I(PHY,"south_out_cnt %d\n",ru->south_out_cnt);
} }
/*if (ru == RC.ru[0] || ru == RC.ru[1]) { /*if (ru == RC.ru[0] || ru == RC.ru[1]) {
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_RU+ru->idx, ru->proc.frame_tx ); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_RU+ru->idx, ru->proc.frame_tx );
...@@ -210,7 +211,7 @@ void fh_if4p5_south_in(RU_t *ru,int *frame,int *subframe) { ...@@ -210,7 +211,7 @@ void fh_if4p5_south_in(RU_t *ru,int *frame,int *subframe) {
RU_proc_t *proc = &ru->proc; RU_proc_t *proc = &ru->proc;
int f,sf; int f,sf;
LOG_I(PHY,"ENTERED fh_if4p5_south_in\n");
uint16_t packet_type; uint16_t packet_type;
uint32_t symbol_number=0; uint32_t symbol_number=0;
uint32_t symbol_mask_full; uint32_t symbol_mask_full;
...@@ -219,7 +220,7 @@ void fh_if4p5_south_in(RU_t *ru,int *frame,int *subframe) { ...@@ -219,7 +220,7 @@ void fh_if4p5_south_in(RU_t *ru,int *frame,int *subframe) {
symbol_mask_full = (1<<fp->ul_symbols_in_S_subframe)-1; symbol_mask_full = (1<<fp->ul_symbols_in_S_subframe)-1;
else else
symbol_mask_full = (1<<fp->symbols_per_tti)-1; symbol_mask_full = (1<<fp->symbols_per_tti)-1;
LOG_D(PHY,"fh_if4p5_south_in: RU %d, frame %d, subframe %d\n",ru->idx,*frame,*subframe); LOG_I(PHY,"fh_if4p5_south_in: RU %d, frame %d, subframe %d, ru %d\n",ru->idx,*frame,*subframe,ru->idx);
AssertFatal(proc->symbol_mask[*subframe]==0,"rx_fh_if4p5: proc->symbol_mask[%d] = %x\n",*subframe,proc->symbol_mask[*subframe]); AssertFatal(proc->symbol_mask[*subframe]==0,"rx_fh_if4p5: proc->symbol_mask[%d] = %x\n",*subframe,proc->symbol_mask[*subframe]);
do { do {
recv_IF4p5(ru, &f, &sf, &packet_type, &symbol_number); recv_IF4p5(ru, &f, &sf, &packet_type, &symbol_number);
...@@ -232,7 +233,7 @@ void fh_if4p5_south_in(RU_t *ru,int *frame,int *subframe) { ...@@ -232,7 +233,7 @@ void fh_if4p5_south_in(RU_t *ru,int *frame,int *subframe) {
} else if (packet_type == IF4p5_PRACH) { } else if (packet_type == IF4p5_PRACH) {
// nothing in RU for RAU // nothing in RU for RAU
}ru->south_out_cnt= 0; }//ru->south_out_cnt= 0; (why??? I guess this is wrong)
LOG_D(PHY,"rx_fh_if4p5: subframe %d symbol mask %x\n",*subframe,proc->symbol_mask[*subframe]); LOG_D(PHY,"rx_fh_if4p5: subframe %d symbol mask %x\n",*subframe,proc->symbol_mask[*subframe]);
} while(proc->symbol_mask[*subframe] != symbol_mask_full); } while(proc->symbol_mask[*subframe] != symbol_mask_full);
...@@ -1142,12 +1143,9 @@ void wakeup_eNBs(RU_t *ru) { ...@@ -1142,12 +1143,9 @@ void wakeup_eNBs(RU_t *ru) {
eNB_proc_t *proc = &eNB->proc; eNB_proc_t *proc = &eNB->proc;
RU_proc_t *ruproc = &ru->proc; RU_proc_t *ruproc = &ru->proc;
struct timespec t; struct timespec t;
LOG_I(PHY,"ENTERED wakeup_eNBs\n");
LOG_D(PHY,"wakeup_eNBs (num %d) for RU %d (state %s)ru->eNB_top:%p\n",ru->num_eNB,ru->idx, ru_states[ru->state],ru->eNB_top); LOG_D(PHY,"wakeup_eNBs (num %d) for RU %d (state %s)ru->eNB_top:%p\n",ru->num_eNB,ru->idx, ru_states[ru->state],ru->eNB_top);
if (ru->num_eNB==1 && ru->eNB_top!=0 && get_thread_parallel_conf() == PARALLEL_SINGLE_THREAD) {
// call eNB function directly
char string[20]; char string[20];
sprintf(string,"Incoming RU %d",ru->idx); sprintf(string,"Incoming RU %d",ru->idx);
...@@ -1174,7 +1172,7 @@ void wakeup_eNBs(RU_t *ru) { ...@@ -1174,7 +1172,7 @@ void wakeup_eNBs(RU_t *ru) {
if (ru->is_slave == 0 && ( (proc->RU_mask[ru->proc.subframe_rx]&(1<<i)) == 1) && eNB->RU_list[i]->state == RU_RUN) { // This is master & the RRU has already been received if (ru->is_slave == 0 && ( (proc->RU_mask[ru->proc.subframe_rx]&(1<<i)) == 1) && eNB->RU_list[i]->state == RU_RUN) { // This is master & the RRU has already been received
if (check_sync(eNB->RU_list[i],eNB->RU_list[0],ru->proc.subframe_rx) == 0) if (check_sync(eNB->RU_list[i],eNB->RU_list[0],ru->proc.subframe_rx) == 0)
LOG_E(PHY,"RU %d is not SYNC, subframe %d, time %f this is master\n", eNB->RU_list[i]->idx, ru->proc.subframe_rx, fabs(eNB->RU_list[i]->proc.t[ru->proc.subframe_rx].tv_nsec - eNB->RU_list[0]->proc.t[ru->proc.subframe_rx].tv_nsec)); LOG_E(PHY,"RU %d is not SYNC, subframe %d, time %f this is master\n", eNB->RU_list[i]->idx, ru->proc.subframe_rx, fabs(eNB->RU_list[i]->proc.t[ru->proc.subframe_rx].tv_nsec - eNB->RU_list[0]->proc.t[ru->proc.subframe_rx].tv_nsec));
}else if (ru->is_slave == 1 && ru->state == RU_RUN && ( (proc->RU_mask[ru->proc.subframe_rx]&(1<<0)) == 1)){ // master already received. TODO: we assume that RU0 is master. }else if (ru->is_slave == 1 && ru->state == RU_RUN && ( (proc->RU_mask[ru->proc.subframe_rx]&(1<<0)) == 1)){ // master already received. TODO: we assume that RU0 is master.
if (check_sync(ru,eNB->RU_list[0],ru->proc.subframe_rx) == 0) if (check_sync(ru,eNB->RU_list[0],ru->proc.subframe_rx) == 0)
LOG_E(PHY,"RU %d is not SYNC time, subframe %d, time %f\n", ru->idx, ru->proc.subframe_rx, fabs(ru->proc.t[ru->proc.subframe_rx].tv_nsec - eNB->RU_list[0]->proc.t[ru->proc.subframe_rx].tv_nsec)); LOG_E(PHY,"RU %d is not SYNC time, subframe %d, time %f\n", ru->idx, ru->proc.subframe_rx, fabs(ru->proc.t[ru->proc.subframe_rx].tv_nsec - eNB->RU_list[0]->proc.t[ru->proc.subframe_rx].tv_nsec));
...@@ -1184,7 +1182,6 @@ void wakeup_eNBs(RU_t *ru) { ...@@ -1184,7 +1182,6 @@ void wakeup_eNBs(RU_t *ru) {
//clock_gettime(CLOCK_MONOTONIC,&t); //clock_gettime(CLOCK_MONOTONIC,&t);
//LOG_I(PHY,"RU mask is now %x, time is %lu\n",proc->RU_mask[ru->proc.subframe_rx], t.tv_nsec - proc->t[ru->proc.subframe_rx].tv_nsec); //LOG_I(PHY,"RU mask is now %x, time is %lu\n",proc->RU_mask[ru->proc.subframe_rx], t.tv_nsec - proc->t[ru->proc.subframe_rx].tv_nsec);
if (proc->RU_mask[ru->proc.subframe_rx] == (1<<eNB->num_RU)-1) { if (proc->RU_mask[ru->proc.subframe_rx] == (1<<eNB->num_RU)-1) {
LOG_D(PHY, "ru_mask is %d \n ", proc->RU_mask[ru->proc.subframe_rx]); LOG_D(PHY, "ru_mask is %d \n ", proc->RU_mask[ru->proc.subframe_rx]);
LOG_D(PHY, "the number of RU is %d, the current ru is RU %d \n ", (1<<eNB->num_RU)-1, ru->idx); LOG_D(PHY, "the number of RU is %d, the current ru is RU %d \n ", (1<<eNB->num_RU)-1, ru->idx);
...@@ -1202,8 +1199,19 @@ void wakeup_eNBs(RU_t *ru) { ...@@ -1202,8 +1199,19 @@ void wakeup_eNBs(RU_t *ru) {
// unlock RUs that are waiting for eNB processing to be completed // unlock RUs that are waiting for eNB processing to be completed
LOG_D(PHY,"RU %d wakeup eNB top for for subframe %d\n", ru->idx,ru->proc.subframe_rx); LOG_D(PHY,"RU %d wakeup eNB top for for subframe %d\n", ru->idx,ru->proc.subframe_rx);
if (ru->wait_cnt == 0) ru->eNB_top(eNB_list[0],proc->frame_rx,proc->subframe_rx,string,ru); if (ru->wait_cnt == 0) {
if (ru->num_eNB==1 && ru->eNB_top!=0 && get_thread_parallel_conf() == PARALLEL_SINGLE_THREAD)
ru->eNB_top(eNB_list[0],proc->frame_rx,proc->subframe_rx,string,ru);
else {
for (i=0;i<ru->num_eNB;i++) {
eNB_list[i]->proc.ru_proc = &ru->proc;
if (ru->wakeup_rxtx!=0 && ru->wakeup_rxtx(eNB_list[i],ru) < 0)
{
LOG_E(PHY,"could not wakeup eNB rxtx process for subframe %d\n", ru->proc.subframe_rx);
}
}
}
}
AssertFatal(0==pthread_mutex_lock(&ruproc->mutex_eNBs),""); AssertFatal(0==pthread_mutex_lock(&ruproc->mutex_eNBs),"");
LOG_D(PHY,"RU %d sending signal to unlock waiting ru_threads\n", ru->idx); LOG_D(PHY,"RU %d sending signal to unlock waiting ru_threads\n", ru->idx);
AssertFatal(0==pthread_cond_broadcast(&ruproc->cond_eNBs),""); AssertFatal(0==pthread_cond_broadcast(&ruproc->cond_eNBs),"");
...@@ -1219,23 +1227,8 @@ void wakeup_eNBs(RU_t *ru) { ...@@ -1219,23 +1227,8 @@ void wakeup_eNBs(RU_t *ru) {
// ru->eNB_top(eNB_list[0],ru->proc.frame_rx,ru->proc.subframe_rx,string); // ru->eNB_top(eNB_list[0],ru->proc.frame_rx,ru->proc.subframe_rx,string);
ru->proc.emulate_rf_busy = 0; ru->proc.emulate_rf_busy = 0;
}
else {
for (i=0;i<ru->num_eNB;i++)
{
LOG_I(PHY,"ru->wakeup_rxtx:%p\n", ru->wakeup_rxtx);
eNB_list[i]->proc.ru_proc = &ru->proc;
if (ru->wakeup_rxtx!=0 && ru->wakeup_rxtx(eNB_list[i],ru) < 0)
{
LOG_E(PHY,"could not wakeup eNB rxtx process for subframe %d\n", ru->proc.subframe_rx);
}
ru->proc.emulate_rf_busy = 0;
}
}
} }
static inline int wakeup_prach_ru(RU_t *ru) { static inline int wakeup_prach_ru(RU_t *ru) {
...@@ -1516,7 +1509,7 @@ static void* ru_thread_tx( void* param ) { ...@@ -1516,7 +1509,7 @@ static void* ru_thread_tx( void* param ) {
//printf("ru_thread_tx, ru_proc->cond_eNBs, ru_proc->instance_cnt_eNBs\n"); //printf("ru_thread_tx, ru_proc->cond_eNBs, ru_proc->instance_cnt_eNBs\n");
wait_on_condition(&proc->mutex_eNBs,&proc->cond_eNBs,&proc->instance_cnt_eNBs,"ru_thread_tx"); wait_on_condition(&proc->mutex_eNBs,&proc->cond_eNBs,&proc->instance_cnt_eNBs,"ru_thread_tx");
//printf("Passed ru_thread_tx ru_proc->cond_eNBs\n"); //printf("Passed ru_thread_tx ru_proc->cond_eNBs\n");
LOG_D(PHY,"ru_thread_tx (ru %d): Woken from condition\n",ru->idx); LOG_I(PHY,"ru_thread_tx (ru %d): Woken from condition\n",ru->idx);
if (oai_exit) break; if (oai_exit) break;
// do TX front-end processing if needed (precoding and/or IDFTs) // do TX front-end processing if needed (precoding and/or IDFTs)
......
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