Forum Discussion
Altera_Forum
Honored Contributor
16 years ago<div class='quotetop'>QUOTE (ittiam @ Jul 12 2009, 04:46 PM) <{post_snapback}> (index.php?act=findpost&pid=23086)</div>
--- Quote Start --- Hi All, I have some serious problems in usage of performance counters, could anyone please let me know what could have gone wrong. I have included the associate header files. Some junk value is coming ,dont know why. Some data corruption had happened, or the prints not working. nios2-terminal: (Use the IDE stop button or Ctrl-C to terminate) ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ --Performance Counter Report-- Total Time: seconds (1993414581 clock-cycles) ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ Regards, Ravi MS[/b] --- Quote End --- try using like this int main() { PERF_RESET(PERFORMANCE_COUNTER_1_BASE); PERF_START_MEASURING(PERFORMANCE_COUNTER_1_BASE); call your function here PERF_STOP_MEASURING(PERFORMANCE_COUNTER_1_BASE); alt_u64 time2 = 0; time2 = perf_get_section_time((void *)PERFORMANCE_COUNTER_1_BASE, 1); printf("IT TOOK T1: Main Loop : %d cycles\n", time2); } in your function say multiply() { PERF_BEGIN(PERFORMANCE_COUNTER_1_BASE,1); you code for perfomance here PERF_end(PERFORMANCE_COUNTER_1_BASE,1); } select how many section you want o measurein perfomance counter unit. anand