Commit 490d00ea authored by lfarizav's avatar lfarizav

fixing time statistics variables

parent b6417950
...@@ -86,9 +86,8 @@ void print_meas(time_stats_t *ts, const char* name, time_stats_t * total_exec_ti ...@@ -86,9 +86,8 @@ void print_meas(time_stats_t *ts, const char* name, time_stats_t * total_exec_ti
//printf("%20s: total: %10.3f ms, average: %10.3f us (%10d trials)\n", name, ts->diff/cpu_freq_GHz/1000000.0, ts->diff/ts->trials/cpu_freq_GHz/1000.0, ts->trials); //printf("%20s: total: %10.3f ms, average: %10.3f us (%10d trials)\n", name, ts->diff/cpu_freq_GHz/1000000.0, ts->diff/ts->trials/cpu_freq_GHz/1000.0, ts->trials);
//printf("ts->trials>0 is %d\n",ts->trials); //printf("ts->trials>0 is %d\n",ts->trials);
if ((total_exec_time == NULL) || (sf_exec_time== NULL)) { if ((total_exec_time == NULL) || (sf_exec_time== NULL)) {
fprintf(stderr, "%25s: %15.3f ms ; %15.3f us; %15d;\n", fprintf(stderr, "%25s: %15.3f us; %15d;\n",
name, name,
(ts->diff/cpu_freq_GHz/1000000.0),
(ts->diff/ts->trials/cpu_freq_GHz/1000.0), (ts->diff/ts->trials/cpu_freq_GHz/1000.0),
ts->trials); ts->trials);
} else { } else {
......
...@@ -18,7 +18,7 @@ eNBs = ...@@ -18,7 +18,7 @@ eNBs =
mobile_country_code = "208"; mobile_country_code = "208";
mobile_network_code = "10"; mobile_network_code = "93";
////////// Physical parameters: ////////// Physical parameters:
......
...@@ -34,7 +34,7 @@ eNBs = ...@@ -34,7 +34,7 @@ eNBs =
downlink_frequency = 2680000000L; downlink_frequency = 2680000000L;
uplink_frequency_offset = -120000000; uplink_frequency_offset = -120000000;
Nid_cell = 0; Nid_cell = 0;
N_RB_DL = 25; N_RB_DL = 50;
Nid_cell_mbsfn = 0; Nid_cell_mbsfn = 0;
nb_antenna_ports = 2; nb_antenna_ports = 2;
nb_antennas_tx = 2; nb_antennas_tx = 2;
......
...@@ -149,16 +149,16 @@ eNBs = ...@@ -149,16 +149,16 @@ eNBs =
NETWORK_INTERFACES : NETWORK_INTERFACES :
{ {
ENB_INTERFACE_NAME_FOR_S1_MME = "eno2"; ENB_INTERFACE_NAME_FOR_S1_MME = "enx58ef68b419df";
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.170/24"; ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.170/24";
ENB_INTERFACE_NAME_FOR_S1U = "eno2"; ENB_INTERFACE_NAME_FOR_S1U = "enx58ef68b419df";
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.170/24"; ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.170/24";
ENB_PORT_FOR_S1U = 2152; # Spec 2152 ENB_PORT_FOR_S1U = 2152; # Spec 2152
}; };
rrh_gw_config = ( rrh_gw_config = (
{ {
local_if_name = "eno2"; local_if_name = "enx58ef68b419df";
remote_address = "192.168.12.171"; remote_address = "192.168.12.171";
local_address = "192.168.12.170"; local_address = "192.168.12.170";
local_port = 50000; #for raw option local port must be the same to remote local_port = 50000; #for raw option local port must be the same to remote
......
...@@ -149,9 +149,9 @@ eNBs = ...@@ -149,9 +149,9 @@ eNBs =
NETWORK_INTERFACES : NETWORK_INTERFACES :
{ {
ENB_INTERFACE_NAME_FOR_S1_MME = "lo"; ENB_INTERFACE_NAME_FOR_S1_MME = "eno2";
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.170/24"; ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.170/24";
ENB_INTERFACE_NAME_FOR_S1U = "lo"; ENB_INTERFACE_NAME_FOR_S1U = "eno2";
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.170/24"; ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.170/24";
ENB_PORT_FOR_S1U = 2152; # Spec 2152 ENB_PORT_FOR_S1U = 2152; # Spec 2152
}; };
......
...@@ -632,7 +632,7 @@ l2l1_task (void *args_p) ...@@ -632,7 +632,7 @@ l2l1_task (void *args_p)
} }
start_meas (&oaisim_stats); start_meas (&oaisim_stats);
//printf("start meas oaisim_stats\n");
for (frame = 0; for (frame = 0;
(l2l1_state != L2L1_TERMINATED) && (l2l1_state != L2L1_TERMINATED) &&
((oai_emulation.info.n_frames_flag == 0) || ((oai_emulation.info.n_frames_flag == 0) ||
...@@ -713,8 +713,9 @@ l2l1_task (void *args_p) ...@@ -713,8 +713,9 @@ l2l1_task (void *args_p)
update_ocm (); update_ocm ();
for (sf = 0; sf < 10; sf++) { for (sf = 0; sf < 10; sf++) {
LOG_D(EMU,"************************* Subframe %d\n",sf);
LOG_D(EMU,"************************* Subframe %d\n",sf);
//printf("start meas oaisim_stats_f\n");
start_meas (&oaisim_stats_f); start_meas (&oaisim_stats_f);
wait_for_slot_isr (); wait_for_slot_isr ();
...@@ -1070,8 +1071,9 @@ l2l1_task (void *args_p) ...@@ -1070,8 +1071,9 @@ l2l1_task (void *args_p)
(frame_parms[0]->Ncp == 0) ? 1920 : 1728, 1, (frame_parms[0]->Ncp == 0) ? 1920 : 1728, 1,
4); 4);
} }
//printf("oaisim_stats_f is %e us\n",get_time_meas_us(&oaisim_stats_f));
stop_meas (&oaisim_stats_f); stop_meas (&oaisim_stats_f);
//printf("stop meas oaisim_stats_f\n");
} // SUBFRAME INNER PART } // SUBFRAME INNER PART
...@@ -1156,8 +1158,9 @@ l2l1_task (void *args_p) ...@@ -1156,8 +1158,9 @@ l2l1_task (void *args_p)
#endif #endif
} // frame loop } // frame loop
//printf("oaisim_stats is %e us\n",get_time_meas_us(&oaisim_stats));
stop_meas (&oaisim_stats); stop_meas (&oaisim_stats);
//printf("stop meas oaisim_stats\n");
oai_shutdown (); oai_shutdown ();
#ifdef PRINT_STATS #ifdef PRINT_STATS
......
...@@ -1004,8 +1004,7 @@ openair0_timestamp current_eNB_rx_timestamp[NUMBER_OF_eNB_MAX][MAX_NUM_CCs]; ...@@ -1004,8 +1004,7 @@ openair0_timestamp current_eNB_rx_timestamp[NUMBER_OF_eNB_MAX][MAX_NUM_CCs];
openair0_timestamp current_UE_rx_timestamp[NUMBER_OF_UE_MAX][MAX_NUM_CCs]; openair0_timestamp current_UE_rx_timestamp[NUMBER_OF_UE_MAX][MAX_NUM_CCs];
openair0_timestamp last_eNB_rx_timestamp[NUMBER_OF_eNB_MAX][MAX_NUM_CCs]; openair0_timestamp last_eNB_rx_timestamp[NUMBER_OF_eNB_MAX][MAX_NUM_CCs];
openair0_timestamp last_UE_rx_timestamp[NUMBER_OF_UE_MAX][MAX_NUM_CCs]; openair0_timestamp last_UE_rx_timestamp[NUMBER_OF_UE_MAX][MAX_NUM_CCs];
static int first_run=0;
static int count=0;
int eNB_trx_start(openair0_device *device) { int eNB_trx_start(openair0_device *device) {
return(0); return(0);
} }
...@@ -1041,22 +1040,24 @@ int UE_trx_set_gains(openair0_device *device, openair0_config_t *openair0_cfg) { ...@@ -1041,22 +1040,24 @@ int UE_trx_set_gains(openair0_device *device, openair0_config_t *openair0_cfg) {
extern pthread_mutex_t subframe_mutex; extern pthread_mutex_t subframe_mutex;
extern int subframe_eNB_mask,subframe_UE_mask; extern int subframe_eNB_mask,subframe_UE_mask;
static int first_run=0;
//static int count=0;
//static int sum=0;
int eNB_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps, int cc) int eNB_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps, int cc)
{ {
if (!first_run) //if (!first_run)
{ //{
first_run=1; // first_run=1;
} //}
if (count==500) //if (count==1000)
{ //{
//Use ./oaisim -q option to enable the oai performance profiler. //Use ./oaisim -q option to enable the oai performance profiler.
count=0; //count=0;
print_opp_meas_oaisim (); //sum=0;
reset_opp_meas_oaisim (); //print_opp_meas_oaisim ();
} //reset_opp_meas_oaisim ();
count++; //}
//count++;
int ret = nsamps; int ret = nsamps;
int eNB_id = device->Mod_id; int eNB_id = device->Mod_id;
int CC_id = device->CC_id; int CC_id = device->CC_id;
...@@ -1125,7 +1126,7 @@ int eNB_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void * ...@@ -1125,7 +1126,7 @@ int eNB_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void *
if (is_prach_subframe(&PHY_vars_UE_g[UE_id][CC_id]->frame_parms,frame,subframe) && PHY_vars_UE_g[UE_id][CC_id]->generate_prach) if (is_prach_subframe(&PHY_vars_UE_g[UE_id][CC_id]->frame_parms,frame,subframe) && PHY_vars_UE_g[UE_id][CC_id]->generate_prach)
{ {
//clock_t start=clock(); //clock_t start=clock();
printf("subframe UL PRACH: %d\n",subframe); //printf("subframe UL PRACH: %d\n",subframe);
start_meas(&UE2eNB[UE_id][eNB_id][CC_id]->UL_PRACH_channel_freq); start_meas(&UE2eNB[UE_id][eNB_id][CC_id]->UL_PRACH_channel_freq);
do_UL_sig_freq_prach(UE2eNB, do_UL_sig_freq_prach(UE2eNB,
enb_data, enb_data,
...@@ -1146,6 +1147,7 @@ int eNB_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void * ...@@ -1146,6 +1147,7 @@ int eNB_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void *
} }
} }
start_meas(&UE2eNB[0][eNB_id][CC_id]->UL_channel_freq); start_meas(&UE2eNB[0][eNB_id][CC_id]->UL_channel_freq);
//clock_t start=clock();
do_UL_sig_freq(UE2eNB, do_UL_sig_freq(UE2eNB,
enb_data, enb_data,
ue_data, ue_data,
...@@ -1156,6 +1158,9 @@ int eNB_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void * ...@@ -1156,6 +1158,9 @@ int eNB_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void *
eNB_id, eNB_id,
CC_id); CC_id);
stop_meas(&UE2eNB[0][eNB_id][CC_id]->UL_channel_freq); stop_meas(&UE2eNB[0][eNB_id][CC_id]->UL_channel_freq);
/*clock_t stop=clock();
printf("do_UL_sig time is %f s, AVERAGE time is %f s, count %d, sum %d, start %d, stop %d\n",(float) (stop-start)/CLOCKS_PER_SEC,(float) (sum+stop-start)/(count*CLOCKS_PER_SEC),count,sum+stop-start,start,stop);
sum=(sum+stop-start);*/
} }
else else
{ {
...@@ -1177,13 +1182,11 @@ int eNB_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void * ...@@ -1177,13 +1182,11 @@ int eNB_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void *
} }
last_eNB_rx_timestamp[eNB_id][CC_id] = last; last_eNB_rx_timestamp[eNB_id][CC_id] = last;
return ret; return ret;
} }
int UE_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps, int cc) int UE_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps, int cc)
{ {
int ret = nsamps; int ret = nsamps;
int UE_id = device->Mod_id; int UE_id = device->Mod_id;
int CC_id = device->CC_id; int CC_id = device->CC_id;
...@@ -1247,6 +1250,7 @@ int UE_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void ** ...@@ -1247,6 +1250,7 @@ int UE_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void **
LOG_D(PHY,"UE_trx_read generating DL subframe %d (Ts %llu, current TS %llu)\n", LOG_D(PHY,"UE_trx_read generating DL subframe %d (Ts %llu, current TS %llu)\n",
subframe,(unsigned long long)*ptimestamp, subframe,(unsigned long long)*ptimestamp,
(unsigned long long)current_UE_rx_timestamp[UE_id][CC_id]); (unsigned long long)current_UE_rx_timestamp[UE_id][CC_id]);
if (do_ofdm_mod) if (do_ofdm_mod)
{ {
start_meas(&eNB2UE[0][UE_id][CC_id]->DL_channel_freq); start_meas(&eNB2UE[0][UE_id][CC_id]->DL_channel_freq);
...@@ -1260,10 +1264,10 @@ int UE_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void ** ...@@ -1260,10 +1264,10 @@ int UE_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void **
UE_id, UE_id,
CC_id); CC_id);
stop_meas(&eNB2UE[0][UE_id][CC_id]->DL_channel_freq); stop_meas(&eNB2UE[0][UE_id][CC_id]->DL_channel_freq);
/*clock_t stop=clock(); /*clock_t stop=clock();
printf("do_DL_sig time is %f s, AVERAGE time is %f s, count %d, sum %e\n",(float) (stop-start)/CLOCKS_PER_SEC,(float) (sum+stop-start)/(count*CLOCKS_PER_SEC),count,sum+stop-start); printf("do_DL_sig time is %f s, AVERAGE time is %f s, count %d, sum %e\n",(float) (stop-start)/CLOCKS_PER_SEC,(float) (sum+stop-start)/(count_d*CLOCKS_PER_SEC),count_d,sum_d+stop-start);
sum=(sum+stop-start); sum_d=(sum_d+stop-start);
count++;*/ count_d++;*/
//stop_meas(&dl_chan_stats_f); //stop_meas(&dl_chan_stats_f);
//print_meas(&dl_chan_stats_f,"DL_Channel Stats Frequency Domain",&dl_chan_stats_f,&dl_chan_stats_f); //print_meas(&dl_chan_stats_f,"DL_Channel Stats Frequency Domain",&dl_chan_stats_f,&dl_chan_stats_f);
} }
......
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