I am using the LPC43xx series, which has cortex-m4/m0. This is a bare-metal system. I am new to bare metal programming and I want to make small benchmark programs for performance evaluation. This is a non-cache system. How can I do this ? or Should I try profiling.
Asked
Active
Viewed 843 times
2
-
not having a cache greatly improves the quality of your results. – old_timer Jul 28 '17 at 12:24
-
Thank you all for the answer. My system does not have a cache :) Using Dhrystone , I am not sure how that code works, only on one core or both. what other type of parameters can be implemented: I wish for memory bandwitdh,Memory Latency , cpu performance or so .Can all this be measured using threads?Is it possible to implement RTOS and work with Pthreads. As bare-metal does-not go with threads. – Kael Jul 28 '17 at 13:57
-
thank you so much for the support,I guess including RTOS may reduce the performance of the system. – Kael Jul 28 '17 at 14:36
-
yep, that is true.. to me itseems like,it is like benchmarking two single cores which lies inside same chip! that is why i wanted to know if there are any methods for dual working – Kael Jul 28 '17 at 16:01
1 Answers
1
As I know there are three ways to measure code execution time in your case:
timers (init timer on frequency which you want, read timer value before and after code execution)
gpio (or similar thing) set it to 1 before and to 0 after your code execution, use oscillograph to measure time
performance counter embedded into CPU, in your case I think this one relevant: Cycle counter on ARM Cortex M4 (or M3)?

fghj
- 8,898
- 4
- 28
- 56
-
-
@Kael timer and gpio should work for both core case, about cpu counters you should carefully read cpu documentation. – fghj Jul 28 '17 at 14:20
-
@PeterJ I used all of them, and I suppose you missed the whole point. It is not for profiling (finding hot spot), it is for benchmarking of small algorithms. Like bubble sort vs quick sort. – fghj Jul 29 '17 at 10:11
-
@PeterJ You really not understand that algorithm that win go to software for this embedded system? – fghj Jul 29 '17 at 16:10
-
@fghj I have already agreed with you that I do not understand, have no clue ............. <- you can add more here . – 0___________ Jul 29 '17 at 16:21
-
so the approach which I can visualize is using all its different types of components – Kael Jul 30 '17 at 08:51