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.
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:
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.
Operation | Cycle Number | Variable Type | Time |
+ | 100000 | long | 4 ms |
+ | 1000000 | long | 45 ms |
* | 100000 | long | 6 ms |
* | 1000000 | long | 48 ms |
+ | 100000 | float | 107 ms |
+ | 1000000 | float | 1061 ms |
* | 100000 | float | 89 ms |
* | 1000000 | float | 887 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.
Operation | Cycle Number | Variable Type | Time |
cos | 100000 | long | 6268 ms |
cos | 1000000 | long | 62681 ms |
No comments:
Post a Comment