diff --git a/targets/SIMU/USER/oaisim.c b/targets/SIMU/USER/oaisim.c index 8b182ef380c14d1a8c583c6633354fa0b02ed41a..9fb7915544214c2476135a1482440b6454f7d303 100644 --- a/targets/SIMU/USER/oaisim.c +++ b/targets/SIMU/USER/oaisim.c @@ -387,6 +387,86 @@ static void *l2l1_task(void *args_p) { char fname[64], vname[64]; + +#ifdef XFORMS + // current status is that every UE has a DL scope for a SINGLE eNB (eNB_id=0) + // at eNB 0, an UL scope for every UE + FD_lte_phy_scope_ue *form_ue[NUMBER_OF_UE_MAX]; + FD_lte_phy_scope_enb *form_enb[NUMBER_OF_UE_MAX]; + char title[255]; + char xname[32] = "oaisim"; + int xargc=1; + char *xargv[1]; +#endif + +#ifdef PRINT_STATS + int len; + FILE *UE_stats[NUMBER_OF_UE_MAX], *UE_stats_th[NUMBER_OF_UE_MAX], *eNB_stats[NUMBER_OF_eNB_MAX], *eNB_avg_thr, *eNB_l2_stats; + char UE_stats_filename[255]; + char eNB_stats_filename[255]; + char UE_stats_th_filename[255]; + char eNB_stats_th_filename[255]; +#endif + +#ifdef XFORMS + xargv[0] = xname; + fl_initialize (&xargc, xargv, NULL, 0, 0); + eNB_id = 0; + for (UE_id = 0; UE_id < NB_UE_INST; UE_id++) { + // DL scope at UEs + form_ue[UE_id] = create_lte_phy_scope_ue(); + sprintf (title, "LTE DL SCOPE eNB %d to UE %d", eNB_id, UE_id); + fl_show_form (form_ue[UE_id]->lte_phy_scope_ue, FL_PLACE_HOTSPOT, FL_FULLBORDER, title); + + // UL scope at eNB 0 + form_enb[UE_id] = create_lte_phy_scope_enb(); + sprintf (title, "LTE UL SCOPE UE %d to eNB %d", UE_id, eNB_id); + fl_show_form (form_enb[UE_id]->lte_phy_scope_enb, FL_PLACE_HOTSPOT, FL_FULLBORDER, title); + + if (openair_daq_vars.use_ia_receiver == 1) { + fl_set_button(form_ue[UE_id]->button_0,1); + fl_set_object_label(form_ue[UE_id]->button_0, "IA Receiver ON"); + fl_set_object_color(form_ue[UE_id]->button_0, FL_GREEN, FL_GREEN); + } + + } +#endif + + +#ifdef PRINT_STATS + for (UE_id=0;UE_id<NB_UE_INST;UE_id++) { + sprintf(UE_stats_filename,"UE_stats%d.txt",UE_id); + UE_stats[UE_id] = fopen (UE_stats_filename, "w"); + } + for (eNB_id=0;eNB_id<NB_eNB_INST;eNB_id++) { + sprintf(eNB_stats_filename,"eNB_stats%d.txt",eNB_id); + eNB_stats[eNB_id] = fopen (eNB_stats_filename, "w"); + } + + if(abstraction_flag==0) { + for (UE_id=0;UE_id<NB_UE_INST;UE_id++) { + sprintf(UE_stats_th_filename,"UE_stats_th%d_tx%d.txt",UE_id,oai_emulation.info.transmission_mode); + UE_stats_th[UE_id] = fopen (UE_stats_th_filename, "w"); + } + sprintf(eNB_stats_th_filename,"eNB_stats_th_tx%d.txt",oai_emulation.info.transmission_mode); + eNB_avg_thr = fopen (eNB_stats_th_filename, "w"); + } + else { + for (UE_id=0;UE_id<NB_UE_INST;UE_id++) { + sprintf(UE_stats_th_filename,"UE_stats_abs_th%d_tx%d.txt",UE_id,oai_emulation.info.transmission_mode); + UE_stats_th[UE_id] = fopen (UE_stats_th_filename, "w"); + } + sprintf(eNB_stats_th_filename,"eNB_stats_abs_th_tx%d.txt",oai_emulation.info.transmission_mode); + eNB_avg_thr = fopen (eNB_stats_th_filename, "w"); + } +#ifdef OPENAIR2 + eNB_l2_stats = fopen ("eNB_l2_stats.txt", "w"); + LOG_I(EMU,"eNB_l2_stats=%p\n", eNB_l2_stats); +#endif + +#endif + + #if defined(ENABLE_ITTI) MessageDef *message_p = NULL; @@ -850,6 +930,24 @@ static void *l2l1_task(void *args_p) { itti_terminate_tasks(TASK_L2L1); #endif +#ifdef PRINT_STATS + for (UE_id=0;UE_id<NB_UE_INST;UE_id++) { + if (UE_stats[UE_id]) + fclose (UE_stats[UE_id]); + if(UE_stats_th[UE_id]) + fclose (UE_stats_th[UE_id]); + } + for (eNB_id=0;eNB_id<NB_eNB_INST;eNB_id++) { + if (eNB_stats[eNB_id]) + fclose (eNB_stats[eNB_id]); + } + if (eNB_avg_thr) + fclose (eNB_avg_thr); + if (eNB_l2_stats) + fclose (eNB_l2_stats); + +#endif + return NULL; } @@ -930,25 +1028,6 @@ int main(int argc, char **argv) { #endif // time calibration for soft realtime mode - - // u8 awgn_flag = 0; -#ifdef XFORMS - // current status is that every UE has a DL scope for a SINGLE eNB (eNB_id=0) - // at eNB 0, an UL scope for every UE - FD_lte_phy_scope_ue *form_ue[NUMBER_OF_UE_MAX]; - FD_lte_phy_scope_enb *form_enb[NUMBER_OF_UE_MAX]; - char title[255]; -#endif - -#ifdef PRINT_STATS - int len; - FILE *UE_stats[NUMBER_OF_UE_MAX], *UE_stats_th[NUMBER_OF_UE_MAX], *eNB_stats[NUMBER_OF_eNB_MAX], *eNB_avg_thr, *eNB_l2_stats; - char UE_stats_filename[255]; - char eNB_stats_filename[255]; - char UE_stats_th_filename[255]; - char eNB_stats_th_filename[255]; -#endif - //time_t t0,t1; //clock_t start, stop; @@ -1008,39 +1087,6 @@ int main(int argc, char **argv) { check_and_adjust_params (); -#ifdef PRINT_STATS - for (UE_id=0;UE_id<NB_UE_INST;UE_id++) { - sprintf(UE_stats_filename,"UE_stats%d.txt",UE_id); - UE_stats[UE_id] = fopen (UE_stats_filename, "w"); - } - for (eNB_id=0;eNB_id<NB_eNB_INST;eNB_id++) { - sprintf(eNB_stats_filename,"eNB_stats%d.txt",eNB_id); - eNB_stats[eNB_id] = fopen (eNB_stats_filename, "w"); - } - - if(abstraction_flag==0) { - for (UE_id=0;UE_id<NB_UE_INST;UE_id++) { - sprintf(UE_stats_th_filename,"UE_stats_th%d_tx%d.txt",UE_id,oai_emulation.info.transmission_mode); - UE_stats_th[UE_id] = fopen (UE_stats_th_filename, "w"); - } - sprintf(eNB_stats_th_filename,"eNB_stats_th_tx%d.txt",oai_emulation.info.transmission_mode); - eNB_avg_thr = fopen (eNB_stats_th_filename, "w"); - } - else { - for (UE_id=0;UE_id<NB_UE_INST;UE_id++) { - sprintf(UE_stats_th_filename,"UE_stats_abs_th%d_tx%d.txt",UE_id,oai_emulation.info.transmission_mode); - UE_stats_th[UE_id] = fopen (UE_stats_th_filename, "w"); - } - sprintf(eNB_stats_th_filename,"eNB_stats_abs_th_tx%d.txt",oai_emulation.info.transmission_mode); - eNB_avg_thr = fopen (eNB_stats_th_filename, "w"); - } -#ifdef OPENAIR2 - eNB_l2_stats = fopen ("eNB_l2_stats.txt", "w"); - LOG_I(EMU,"eNB_l2_stats=%p\n", eNB_l2_stats); -#endif - -#endif - set_seed = oai_emulation.emulation_config.seed.value; init_otg_pdcp_buffer (); @@ -1053,30 +1099,6 @@ int main(int argc, char **argv) { init_ocm (); -#ifdef XFORMS - eNB_id = 0; - for (UE_id = 0; UE_id < NB_UE_INST; UE_id++) { - // DL scope at UEs - fl_initialize (&argc, argv, NULL, 0, 0); - form_ue[UE_id] = create_lte_phy_scope_ue(); - sprintf (title, "LTE DL SCOPE eNB %d to UE %d", eNB_id, UE_id); - fl_show_form (form_ue[UE_id]->lte_phy_scope_ue, FL_PLACE_HOTSPOT, FL_FULLBORDER, title); - - // UL scope at eNB 0 - fl_initialize (&argc, argv, NULL, 0, 0); - form_enb[UE_id] = create_lte_phy_scope_enb(); - sprintf (title, "LTE UL SCOPE UE %d to eNB %d", UE_id, eNB_id); - fl_show_form (form_enb[UE_id]->lte_phy_scope_enb, FL_PLACE_HOTSPOT, FL_FULLBORDER, title); - - if (openair_daq_vars.use_ia_receiver == 1) { - fl_set_button(form_ue[UE_id]->button_0,1); - fl_set_object_label(form_ue[UE_id]->button_0, "IA Receiver ON"); - fl_set_object_color(form_ue[UE_id]->button_0, FL_GREEN, FL_GREEN); - } - - } -#endif - #ifdef SMBV smbv_init_config(smbv_fname, smbv_nframes); smbv_write_config_from_frame_parms(smbv_fname, &PHY_vars_eNB_g[0]->lte_frame_parms); @@ -1170,24 +1192,6 @@ int main(int argc, char **argv) { mac_top_cleanup (); #endif -#ifdef PRINT_STATS - for (UE_id=0;UE_id<NB_UE_INST;UE_id++) { - if (UE_stats[UE_id]) - fclose (UE_stats[UE_id]); - if(UE_stats_th[UE_id]) - fclose (UE_stats_th[UE_id]); - } - for (eNB_id=0;eNB_id<NB_eNB_INST;eNB_id++) { - if (eNB_stats[eNB_id]) - fclose (eNB_stats[eNB_id]); - } - if (eNB_avg_thr) - fclose (eNB_avg_thr); - if (eNB_l2_stats) - fclose (eNB_l2_stats); - -#endif - // stop OMG stop_mobility_generator (oai_emulation.info.omg_model_ue); //omg_param_list.mobility_type #ifdef OPENAIR2