Intel® SoC FPGA Embedded Development Suite
Support for SoC FPGA Software Development, SoC FPGA HPS Architecture, HPS SoC Boot and Configuration, Operating Systems
483 Discussions

is it possible to measure the processor time in nanoseconds? by using eclipse software.

KBill3
Beginner
1,305 Views

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.

0 Kudos
1 Reply
AnandRaj_S_Intel
Employee
1,047 Views

Hi,

 

  1. 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.
  2. If you use functions to measure, Even it takest few clock cycle.
  3. 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

 

0 Kudos
Reply