Commit bddf6304 authored by Raymond Knopp's avatar Raymond Knopp

addition of query of virtual timer frequency and computation of timing information for __aarch64__

parent f6641237
......@@ -27,9 +27,10 @@
// global var for openair performance profiler
int opp_enabled = 0;
double get_cpu_freq_GHz(void) {
#if defined(__i386__) || defined(__x86_64__) || defined(__arm__)
time_stats_t ts = {0};
reset_meas(&ts);
ts.trials++;
......@@ -39,6 +40,14 @@ double get_cpu_freq_GHz(void) {
cpu_freq_GHz = (double)ts.diff/1000000000;
printf("CPU Freq is %f \n", cpu_freq_GHz);
return cpu_freq_GHz;
#elif defined (__aarch64__)
uint64_t cntfrq;
asm volatile("mrs %0, cntfrq_el0" : "=r" (cntfrq));
return (double)cntfrq/1.0e9;
#endif
}
void print_meas_now(time_stats_t *ts, const char* name, FILE* file_name){
......
......@@ -659,7 +659,7 @@ int main(int argc, char **argv)
Sched_Rsp_t sched_resp;
int pa=dB0;
#if defined(__arm__) || defined(__aarch64__)
#if defined(__arm__)
FILE *proc_fd = NULL;
char buf[64];
......@@ -2137,7 +2137,7 @@ int main(int argc, char **argv)
2)/eNB->phy_proc_tx.trials - pow((double)eNB->phy_proc_tx.diff/eNB->phy_proc_tx.trials/cpu_freq_GHz/1000,2));
std_phy_proc_tx_ifft = sqrt((double)eNB->ofdm_mod_stats.diff_square/pow(cpu_freq_GHz,2)/pow(1000,
2)/eNB->ofdm_mod_stats.trials - pow((double)eNB->ofdm_mod_stats.diff/eNB->ofdm_mod_stats.trials/cpu_freq_GHz/1000,2));
printf("OFDM_mod time :%f us (%d trials)\n",(double)eNB->ofdm_mod_stats.diff/eNB->ofdm_mod_stats.trials/cpu_freq_GHz/1000.0,eNB->ofdm_mod_stats.trials);
printf("OFDM_mod time :%f us/%lld cycles (%d trials)\n",(double)eNB->ofdm_mod_stats.diff/eNB->ofdm_mod_stats.trials/cpu_freq_GHz/1000.0,eNB->ofdm_mod_stats.diff/eNB->ofdm_mod_stats.trials,eNB->ofdm_mod_stats.trials);
printf("|__ Statistcs std: %fus median %fus q1 %fus q3 %fus \n",std_phy_proc_tx_ifft, tx_ifft_median, tx_ifft_q1, tx_ifft_q3);
printf("Total PHY proc tx :%f us (%d trials)\n",(double)eNB->phy_proc_tx.diff/eNB->phy_proc_tx.trials/cpu_freq_GHz/1000.0,eNB->phy_proc_tx.trials);
printf("|__ Statistcs std: %fus max: %fus min: %fus median %fus q1 %fus q3 %fus n_dropped: %d packet \n",std_phy_proc_tx, t_tx_max, t_tx_min, tx_median, tx_q1, tx_q3,
......
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