Altera_Forum
Honored Contributor
11 years agoNIOS software execution time using performance counter
I want to calculate my NIOS software execution time. My application need approx 3min(180 sec) to complete execution.(measured with a stopwatch)
I am using performance counter. As per its specs, it returns a 64 bit value. I am using DE2 board with 50MHz crystal. So as per my expectation, the counter should return (180*50,000,000) at the end, but its returning something in the range (40*50,000,000). What could be the reason?? My expected value completely comes under the 64 bit return value, so no case of re-loop. I am using: int main() { PERF_RESET(PERFORMANCE_COUNTER_0_BASE); PERF_START_MEASURING(PERFORMANCE_COUNTER_0_BASE); PERF_BEGIN(PERFORMANCE_COUNTER_0_BASE,1); // Code Logic PERF_END(PERFORMANCE_COUNTER_0_BASE,1); PERF_STOP_MEASURING(PERFORMANCE_COUNTER_0_BASE); unsigned long long time; time = (unsigned long long)perf_get_section_time(performance_counter_0_base, 1); printf("\n\nTotal cycles consumed in FIR calculation = %llu cycles\n", time); } Please suggest.. Is their any other way to calculate exact real time??