- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hallo everyone,
i have a cyclone V Altera, i did a division operation of two integer numbers by using eclipse software (in c code). I need to measure the processor time, i means how much time will be taken for this function to be done. Of course it is happening in nanosecond. Is there any function, or method using timer or something else to measure the processor time in nanosecond.
the code is like that;
#include <stdio.h> /* printf */
#include <time.h> /* clock_t, clock, CLOCKS_PER_SEC */
int a;
int main (void)
{
clock_t t;
t = clock();
a= 1/2; -- division
t = clock() - t;
return 0;
}
Thanks in advance.
- Tags:
- Include
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
- The number of instructions which take more than one clock cycle is determined by the complexity of the ALU and its pipelining architecture. Therefore, the minimum and maximum cycles per instruction depend on the core you choose (Nios® II/f, Nios II/s, Nios II/e). Normal ALU instructions take 6 cycles for Nios II/e core.
- If you use functions to measure, Even it takest few clock cycle.
- You can check an391 for some methods to measure processing time/function time.
Refer below links.
https://www.intel.com/content/dam/www/programmable/us/en/pdfs/literature/an/an391.pdf
http://www.cs.columbia.edu/~sedwards/classes/2007/4840/n2cpu_nii5v1.pdf
https://www.intel.com/content/altera-www/global/en_us/index/support/support-resources/knowledge-base/solutions/rd03102006_962.html
Regards
Anand
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page