Forum Discussion
Altera_Forum
Honored Contributor
8 years agoHi Anand,
I am running the cyclone3 development kit.I use a Performance counter IP for checking Execution time of code in NIOS IDE(9.1). My code is shown below # include <stdio.h> # include "alt_types.h" # include "system.h" # include "altera_avalon_performance_counter.h" /*Use to measure code performance*/ int main() { int A,B,C,D = 0; PERF_RESET(PERFORMANCE_COUNTER_0_BASE); PERF_START_MEASURING(PERFORMANCE_COUNTER_0_BASE); PERF_BEGIN(PERFORMANCE_COUNTER_0_BASE, 1); C= A+B; D=A-B printf("Hello from Nios II!\n"); PERF_END(PERFORMANCE_COUNTER_0_BASE, 1); PERF_STOP_MEASURING(PERFORMANCE_COUNTER_0_BASE); perf_print_formatted_report((void*)PERFORMANCE_COU NTER_0_BASE, ALT_CPU_FREQ,2, "Sum", "Diff"); return 0; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////// performance counter report in my design shows that counter is not works properly.It generates junk values as shown below. --Performance Counter Report-- Total Time: seconds (1422548144 clock-cycles) ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ what could be the reason?Is this problem relates to its freq setting?? Regard, Salver