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++
12627 Discussions

Performance counter Report in nios

Altera_Forum
Honored Contributor II
1,449 Views

Hi, I wanted to check the performance of my code.But my performance counter doesn't work properly. It generate some character as shown below ....Plz help me.  

Does anyone have any suggestions ? 

 

 

 

 

 

 

--Performance Counter Report-- 

Total Time: seconds (1422548144 clock-cycles) 

ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
0 Kudos
5 Replies
Altera_Forum
Honored Contributor II
493 Views

Hi, 

 

1.How you got this error message? 

2.Which IP you are using? 

3.Which console are you using? 

 

It may be related to your frequency setting. 

 

Best Regards, 

Anand Raj Shankar 

(This message was posted on behalf of Intel Corporation)
0 Kudos
Altera_Forum
Honored Contributor II
493 Views

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

Hi,  

 

Yes, this may be because of frequency setting issues. 

1.If you are using UART/JTAG IP. 

Set the same baud rate as in IP at your host GUI application. 

or 

Change the frequency of clock and check. 

 

Best Regards, 

Anand Raj Shankar 

(This message was posted on behalf of Intel Corporation)
0 Kudos
Altera_Forum
Honored Contributor II
493 Views

Hi Sir, 

First of all thnkz for ur reply.I have a doubt.I used a timestamp instead of program counter for checking Execution time of code in NIOS IDE(9.1).I used the same Jtag uart IP,cyclone 3 kit.I got the correct timestamp report as tutorial.Den how can you say that errror in performance counter report is due to freq issues.?? 

 

Regards, 

Salver
0 Kudos
Altera_Forum
Honored Contributor II
493 Views

Hi 

 

Can you share the screenshot qsys design? 

Have you tried by changing TCK frequency? 

command :jtagconfig --setparam <cable number> JtagClock <frequency><unit prefix> 

check page 14. 

https://www.altera.com/en_us/pdfs/literature/ug/ug_usb_blstr_ii_cable.pdf 

 

Best Regards, 

Anand Raj Shankar 

(This message was posted on behalf of Intel Corporation)
0 Kudos
Reply