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

custom instruction

Altera_Forum
Honored Contributor II
946 Views

hello, 

Does everyone know how to count the time of calling a custom insruction to run C program? http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/huh.gif
0 Kudos
5 Replies
Altera_Forum
Honored Contributor II
252 Views

I want to know the time of calling a custom instruction. thx!

0 Kudos
Altera_Forum
Honored Contributor II
252 Views

Hi allen01, 

I think u can use the "performance counter" that is a Nios II peripheral available in SOPC builder under extra utilities. There is also a documentation that explains its usage...
0 Kudos
Altera_Forum
Honored Contributor II
252 Views

I used Nois I, does Nios I can also use "performance counter"? THX!

0 Kudos
Altera_Forum
Honored Contributor II
252 Views

Sorry, 

the drivers for the performance counter are defined for the HAL of Nios II. I think u can calculate your timing using a simple timer: starting it before your call, stoping at return of the call and reading the value of timer. You could also calculate first the offset timing for these operation: starting-stoping-reading timer, and subtract this value from the timing above...
0 Kudos
Altera_Forum
Honored Contributor II
252 Views

Hi Allen, 

 

I would suggest that the cycle count of the custom instruction is pretty much what the field "cycle count" in the custom instruction tab of th SOPC cpu wizard says. I verified this using a timer for the hw division in a NIOS I cpu.
0 Kudos
Reply