Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12606 Discussions

Performance Counter Issues Urgent!!

Altera_Forum
Honored Contributor II
989 Views

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
0 Kudos
4 Replies
Altera_Forum
Honored Contributor II
321 Views

<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
0 Kudos
Altera_Forum
Honored Contributor II
321 Views

Hello, 

 

My program looks like this , certainly something is wrong, could you anyone let me know the details. 

 

if (inverse) 

PERF_RESET(PERFORMANCE_COUNTER_0_BASE); 

PERF_START_MEASURING(PERFORMANCE_COUNTER_0_BASE); 

PERF_BEGIN(PERFORMANCE_COUNTER_0_BASE,1);  

scale = fix_fft(fi, fr, m-1, inverse); 

PERF_END (PERFORMANCE_COUNTER_0_BASE,1 ); 

 

PERF_STOP_MEASURING(PERFORMANCE_COUNTER_0_BASE); 

perf_print_formatted_report ((void *)PERFORMANCE_COUNTER_0_BASE, /* defined in "system.h" */ 

ALT_CPU_FREQ, /* defined in "system.h" */ 

1, /* How many sections to print */ 

"INVERSE FFT" 

); 

//sw_time_1 = alt_timestamp(); 

 

}  

for (i=1; i<N; i+=2)  

tt = f[N+i-1]; 

f[N+i-1] = f

f = tt; 

if (! inverse) 

PERF_RESET(PERFORMANCE_COUNTER_0_BASE); 

PERF_START_MEASURING(PERFORMANCE_COUNTER_0_BASE); 

PERF_BEGIN(PERFORMANCE_COUNTER_0_BASE,1); 

scale = fix_fft(fi, fr, m-1, inverse); 

PERF_END (PERFORMANCE_COUNTER_0_BASE,1 ); 

PERF_STOP_MEASURING(PERFORMANCE_COUNTER_0_BASE); 

perf_print_formatted_report ((void *)PERFORMANCE_COUNTER_0_BASE, /* defined in "system.h" */ 

ALT_CPU_FREQ, /* defined in "system.h" */ 

1, /* How many sections to print */ 

"FFT" 

); 

 

 

 

Regards, 

Ravi MS 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

<div class='quotetop'>QUOTE (anapar @ Jul 14 2009, 04:26 PM) <{post_snapback}> (index.php?act=findpost&pid=23105)</div> 

--- Quote Start ---  

<div class='quotetop'>QUOTE (ittiam @ Jul 12 2009, 04:46 PM) <{post_snapback}> (index.php?act=findpost&pid=23086) 

--- Quote End ---  

 

--- 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 

[/b] 

--- Quote End ---  

 

0 Kudos
Altera_Forum
Honored Contributor II
321 Views

Same Problem here... 

I think the problem is the perf_print_formatted_report. 

If I choose the "Small C Library" the code works. If not, then there is the garbage. 

Also if you look at the perf_print_formattec_report.c the Nios IDE complains that there are syntax errors. 

Anybody got a workaround?
0 Kudos
Altera_Forum
Honored Contributor II
321 Views

So check the "Small C Library" option and build the project, and then uncheck it, build the project again, the counter_report will work fine.

0 Kudos
Reply