Merge remote-tracking branch 'origin/parallel-phy-test-EMUFH' into develop_integration_2018_w31

This commit is contained in:
Cedric Roux
2018-08-03 09:44:38 +02:00
13 changed files with 191 additions and 122 deletions
@@ -33,7 +33,7 @@ eNBs =
tdd_config_s = 0;
prefix_type = "NORMAL";
eutra_band = 7;
downlink_frequency = 2685000000L;
downlink_frequency = 2680000000L;
uplink_frequency_offset = -120000000;
Nid_cell = 0;
N_RB_DL = 100;
+24 -33
View File
@@ -225,7 +225,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 );
if(get_nprocs() >= 8){
if(!eNB->single_thread_flag && get_nprocs() >= 8){
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);
return(-1);
@@ -247,7 +247,7 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam
/* CONFLICT RESOLUTION: BEGIN */
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER , 0 );
if(oai_exit) return(-1);
if(get_nprocs() <= 4){
if(eNB->single_thread_flag || get_nprocs() <= 4){
#ifndef PHY_TX_THREAD
phy_procedures_eNB_TX(eNB, proc, 1);
#endif
@@ -560,7 +560,7 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) {
eNB_proc_t *proc=&eNB->proc;
RU_proc_t *ru_proc=&ru->proc;
eNB_rxtx_proc_t *proc_rxtx0=&proc->proc_rxtx[0];//*proc_rxtx=&proc->proc_rxtx[proc->frame_rx&1];
eNB_rxtx_proc_t *proc_rxtx0=&proc->proc_rxtx[0];
//eNB_rxtx_proc_t *proc_rxtx1=&proc->proc_rxtx[1];
@@ -849,7 +849,6 @@ 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 *);
//////////////////////////////////////need to modified////////////////*****
static void* process_stats_thread(void* param) {
@@ -858,20 +857,23 @@ static void* process_stats_thread(void* param) {
wait_sync("process_stats_thread");
while (!oai_exit) {
sleep(1);
if (opp_enabled == 1) {
if (eNB->td) print_meas(&eNB->ulsch_decoding_stats,"ulsch_decoding",NULL,NULL);
if (eNB->te)
{
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_signal_stats,"coding_signal",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_wakeup_stats0,"coding_worker_0",NULL,NULL);
print_meas(&eNB->dlsch_turbo_encoding_wakeup_stats1,"coding_worker_1",NULL,NULL);
}
sleep(1);
if (opp_enabled == 1) {
if (eNB->td) print_meas(&eNB->ulsch_decoding_stats,"ulsch_decoding",NULL,NULL);
if (eNB->te)
{
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_signal_stats,"coding_signal",NULL,NULL);
print_meas(&eNB->dlsch_turbo_encoding_main_stats,"coding_main",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_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_stats1,"coding_worker_1",NULL,NULL);
}
print_meas(&eNB->dlsch_modulation_stats,"dlsch_modulation",NULL,NULL);
}
}
@@ -952,30 +954,19 @@ void init_eNB_proc(int inst) {
// attr_td = &proc->attr_td;
// attr_te = &proc->attr_te;
#endif
//////////////////////////////////////need to modified////////////////*****
if(get_nprocs() > 2 && codingw)
{
init_te_thread(eNB);
init_td_thread(eNB);
}
//////////////////////////////////////need to modified////////////////*****
//pthread_create( &proc_rxtx[0].pthread_rxtx, attr0, eNB_thread_rxtx, proc );
//pthread_create( &proc_rxtx[0].pthread_rxtx, attr0, eNB_thread_rxtx, proc_rxtx );
//Should we also include here the case where single_thread_flag = 1 ?
if(nfapi_mode!=2){
pthread_create( &proc_rxtx[0].pthread_rxtx, attr0, eNB_thread_rxtx, proc );
pthread_create( &proc_rxtx[1].pthread_rxtx, attr1, tx_thread, proc);
}
LOG_I(PHY,"eNB->single_thread_flag:%d\n", eNB->single_thread_flag);
if (eNB->single_thread_flag==0) {
pthread_create( &proc_rxtx[0].pthread_rxtx, attr0, eNB_thread_rxtx, &proc_rxtx[0] );
pthread_create( &proc_rxtx[1].pthread_rxtx, attr1, eNB_thread_rxtx, &proc_rxtx[1] );
if (eNB->single_thread_flag==0 && nfapi_mode!=2) {
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->pthread_prach, attr_prach, eNB_thread_prach, eNB );
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
+34 -38
View File
@@ -120,6 +120,7 @@ extern volatile int oai_exit;
extern int emulate_rf;
extern int numerology;
extern int fepw;
extern int single_thread_flag;
extern void phy_init_RU(RU_t*);
@@ -714,6 +715,11 @@ static void* emulatedRF_thread(void* param) {
wait_sync("emulatedRF_thread");
while(!oai_exit){
nanosleep(&req, (struct timespec *)NULL);
if(proc->emulate_rf_busy )
{
LOG_E(PHY,"rf being delayed in emulated RF\n");
}
proc->emulate_rf_busy = 1;
pthread_mutex_lock(&proc->mutex_emulateRF);
++proc->instance_cnt_emulateRF;
pthread_mutex_unlock(&proc->mutex_emulateRF);
@@ -1016,7 +1022,6 @@ void wakeup_slaves(RU_proc_t *proc) {
wait.tv_nsec=5000000L;
for (i=0;i<proc->num_slaves;i++) {
//printf("////////////////////calling for slave thrads\n");////////////////////////********
RU_proc_t *slave_proc = proc->slave_proc[i];
// wake up slave FH thread
// lock the FH mutex and make sure the thread is ready
@@ -1252,13 +1257,14 @@ 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);
if (ru->num_eNB==1 && ru->eNB_top!=0 && get_nprocs() <= 4) {
if ((ru->num_eNB==1 && ru->eNB_top!=0 && get_nprocs() <= 4) || single_thread_flag) {
// call eNB function directly
char string[20];
sprintf(string,"Incoming RU %d",ru->idx);
LOG_D(PHY,"RU %d Call eNB_top\n",ru->idx);
ru->eNB_top(eNB_list[0],ru->proc.frame_rx,ru->proc.subframe_rx,string,ru);
ru->proc.emulate_rf_busy = 0;
}
else {
@@ -1270,8 +1276,9 @@ void wakeup_eNBs(RU_t *ru) {
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);
LOG_E(PHY,"could not wakeup eNB rxtx process for subframe %d\n", ru->proc.subframe_rx);
}
ru->proc.emulate_rf_busy = 0;
}
}
}
@@ -1490,12 +1497,11 @@ int setup_RU_buffers(RU_t *ru) {
static void* ru_stats_thread(void* param) {
RU_t *ru = (RU_t*)param;
wait_sync("ru_stats_thread");
while (!oai_exit) {
sleep(1);
if (opp_enabled == 1 && fepw) {
if (opp_enabled) {
if (ru->feprx) print_meas(&ru->ofdm_demod_stats,"feprx",NULL,NULL);
if (ru->feptx_ofdm) print_meas(&ru->ofdm_mod_stats,"feptx_ofdm",NULL,NULL);
if (ru->fh_north_asynch_in) print_meas(&ru->rx_fhaul,"rx_fhaul",NULL,NULL);
@@ -1529,6 +1535,7 @@ static void* ru_thread_tx( void* param ) {
//wait_sync("ru_thread_tx");
wait_on_condition(&proc->mutex_FH1,&proc->cond_FH1,&proc->instance_cnt_FH1,"ru_thread_tx");
printf( "ru_thread_tx ready\n");
while (!oai_exit) {
@@ -1722,7 +1729,6 @@ static void* ru_thread( void* param ) {
ru->do_prach,
is_prach_subframe(fp, proc->frame_rx, proc->subframe_rx),
proc->frame_rx,proc->subframe_rx);
if ((ru->do_prach>0) && (is_prach_subframe(fp, proc->frame_rx, proc->subframe_rx)==1)) {
wakeup_prach_ru(ru);
}
@@ -1775,7 +1781,7 @@ static void* ru_thread( void* param ) {
if (ru->num_eNB>0) wakeup_eNBs(ru);
#ifndef PHY_TX_THREAD
if(get_nprocs() <= 4 || ru->num_eNB==0){
if(get_nprocs() <= 4 || ru->num_eNB==0 || single_thread_flag){
// do TX front-end processing if needed (precoding and/or IDFTs)
if (ru->feptx_prec) ru->feptx_prec(ru);
@@ -1787,6 +1793,7 @@ static void* ru_thread( void* param ) {
if (ru->fh_north_out) ru->fh_north_out(ru);
}
proc->emulate_rf_busy = 0;
}
#else
struct timespec time_req, time_rem;
@@ -1803,10 +1810,12 @@ static void* ru_thread( void* param ) {
printf( "Exiting ru_thread \n");
if (ru->stop_rf != NULL) {
if (ru->stop_rf(ru) != 0)
LOG_E(HW,"Could not stop the RF device\n");
else LOG_I(PHY,"RU %d rf device stopped\n",ru->idx);
if (!emulate_rf){
if (ru->stop_rf != NULL) {
if (ru->stop_rf(ru) != 0)
LOG_E(HW,"Could not stop the RF device\n");
else LOG_I(PHY,"RU %d rf device stopped\n",ru->idx);
}
}
ru_thread_status = 0;
@@ -2077,6 +2086,8 @@ extern void feptx_ofdm_2thread(RU_t *ru);
extern void feptx_prec(RU_t *ru);
extern void init_fep_thread(RU_t *ru,pthread_attr_t *attr);
extern void init_feptx_thread(RU_t *ru,pthread_attr_t *attr);
extern void kill_fep_thread(RU_t *ru);
extern void kill_feptx_thread(RU_t *ru);
void init_RU_proc(RU_t *ru) {
@@ -2212,8 +2223,8 @@ void init_RU_proc(RU_t *ru) {
}
if (get_nprocs()> 2 && fepw) {
if (ru->feprx) init_fep_thread(ru,NULL);
if (ru->feptx_ofdm) init_feptx_thread(ru,NULL);
init_fep_thread(ru,NULL);
init_feptx_thread(ru,NULL);
}
if (opp_enabled == 1) pthread_create(&ru->ru_stats_thread,NULL,ru_stats_thread,(void*)ru);
@@ -2224,6 +2235,13 @@ void kill_RU_proc(int inst)
RU_t *ru = RC.ru[inst];
RU_proc_t *proc = &ru->proc;
if (get_nprocs() > 2 && fepw) {
LOG_D(PHY, "killing FEP thread\n");
kill_fep_thread(ru);
LOG_D(PHY, "killing FEP TX thread\n");
kill_feptx_thread(ru);
}
pthread_mutex_lock(&proc->mutex_FH);
proc->instance_cnt_FH = 0;
pthread_cond_signal(&proc->cond_FH);
@@ -2262,10 +2280,10 @@ void kill_RU_proc(int inst)
pthread_cond_signal(&proc->cond_asynch_rxtx);
pthread_mutex_unlock(&proc->mutex_asynch_rxtx);
LOG_D(PHY, "Joining pthread_FH\n");
/*LOG_D(PHY, "Joining pthread_FH\n");
pthread_join(proc->pthread_FH, NULL);
LOG_D(PHY, "Joining pthread_FHTX\n");
pthread_join(proc->pthread_FH1, NULL);
pthread_join(proc->pthread_FH1, NULL);*/
if (ru->function == NGFI_RRU_IF4p5) {
LOG_D(PHY, "Joining pthread_prach\n");
pthread_join(proc->pthread_prach, NULL);
@@ -2285,28 +2303,6 @@ void kill_RU_proc(int inst)
pthread_join(proc->pthread_asynch_rxtx, NULL);
}
}
if (get_nprocs() > 2 && fepw) {
if (ru->feprx) {
pthread_mutex_lock(&proc->mutex_fep);
proc->instance_cnt_fep = 0;
pthread_mutex_unlock(&proc->mutex_fep);
pthread_cond_signal(&proc->cond_fep);
LOG_D(PHY, "Joining pthread_fep\n");
pthread_join(proc->pthread_fep, NULL);
pthread_mutex_destroy(&proc->mutex_fep);
pthread_cond_destroy(&proc->cond_fep);
}
if (ru->feptx_ofdm) {
pthread_mutex_lock(&proc->mutex_feptx);
proc->instance_cnt_feptx = 0;
pthread_mutex_unlock(&proc->mutex_feptx);
pthread_cond_signal(&proc->cond_feptx);
LOG_D(PHY, "Joining pthread_feptx\n");
pthread_join(proc->pthread_feptx, NULL);
pthread_mutex_destroy(&proc->mutex_feptx);
pthread_cond_destroy(&proc->cond_feptx);
}
}
if (opp_enabled) {
LOG_D(PHY, "Joining ru_stats_thread\n");
pthread_join(ru->ru_stats_thread, NULL);
@@ -2671,7 +2667,7 @@ void set_function_spec_param(RU_t *ru)
} // switch on interface type
}
extern void RCconfig_RU(void);
//extern void RCconfig_RU(void);
void init_RU(char *rf_config_file) {
+1 -1
View File
@@ -137,7 +137,7 @@ static clock_source_t clock_source = internal;
static int wait_for_sync = 0;
unsigned int mmapped_dma=0;
int single_thread_flag=1;
int single_thread_flag = 0;
static int8_t threequarter_fs=0;
+1 -1
View File
@@ -163,7 +163,7 @@
{"mmapped-dma", CONFIG_HLP_DMAMAP, PARAMFLAG_BOOL, uptr:&mmapped_dma, defintval:0, TYPE_INT, 0}, \
{"external-clock", CONFIG_HLP_EXCCLK, PARAMFLAG_BOOL, uptr:&clock_source, defintval:0, TYPE_INT, 0}, \
{"wait-for-sync", NULL, PARAMFLAG_BOOL, iptr:&wait_for_sync, defintval:0, TYPE_INT, 0}, \
{"single-thread-disable", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, iptr:&single_thread_flag, defintval:1, TYPE_INT, 0}, \
{"single-thread-enable", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, iptr:&single_thread_flag, defintval:0, TYPE_INT, 0}, \
{"threadIQ", NULL, 0, iptr:&(threads.iq), defintval:1, TYPE_INT, 0}, \
{"threadOneSubframe", NULL, 0, iptr:&(threads.one), defintval:1, TYPE_INT, 0}, \
{"threadTwoSubframe", NULL, 0, iptr:&(threads.two), defintval:1, TYPE_INT, 0}, \