Thursday, February 7, 2008

BF537 performance measurements

Customized kernel image created in previous post provides a way to measure execution / performance time. It could be done with help of oscilloscope connected to the boards ground and LED connections. Application pflags-test is executed in user space of uClinux and is using GPIO driver to enable button and LEDs processing. Code below shows in comments measured with oscilloscope execution time.


    write(fd0,"0",sizeof("0"));    // 16 microseconds
    usleep(1000);                      //   4 milliseconds
    write(fd0,"1",sizeof("1"));    // 16 microseconds
    usleep(1000);                      //   4 milliseconds

Arithmetic operations could be tested with help of cycle. This will allow having sufficient amount of time to measure as shown in the code:

    long a, c, i = 0;
    for( i = 0; i < 100000; i++)
    {
         c = i + a;
    }
    printtime();

This time measurements were done with help of system time functions and results are presented in table below.

OperationCycle NumberVariable TypeTime
+100000long4 ms
+1000000long45 ms
*100000long6 ms
*1000000long48 ms
+100000float107 ms
+1000000float1061 ms
*100000float89 ms
*1000000float887 ms

Trigonometric functions measurements could be done with adding in C file #include <math.h>, and option "-lm" to the linker command. Review previous post on details of how to configure blackfin toolkit for uClinux program compilation.


bfin-uclinux-gcc -Wl,-elf2flt perftest.c -o perftest -lm

OperationCycle NumberVariable TypeTime
cos100000long6268 ms
cos1000000long62681 ms