Forum Discussion
Altera_Forum
Honored Contributor
12 years agoFor performance evaluation, I used the below template:
PERF_RESET(PERFORMANCE_COUNTER_0_BASE); PERF_START_MEASURING(PERFORMANCE_COUNTER_0_BASE); PERF_BEGIN(PERFORMANCE_COUNTER_0_BASE,1); // Here is the code block to be tested. // I wanted to know the cycles consumed during this block. PERF_END(PERFORMANCE_COUNTER_0_BASE,1); PERF_STOP_MEASURING(PERFORMANCE_COUNTER_0_BASE); long time; time = perf_get_section_time(PERFORMANCE_COUNTER_0_BASE, 1); printf("\n\nTotal cycles consumed in FIR calculation = %ld cycles\n", time); This returns the no of clock cycles consumed. And by knowing the oscillator frequency, we can calcuate the total time consumed in the block. Thanks, Anuj