Professional Documents
Culture Documents
Systems
Nam Ho
Dr. Anh-Vu Dinh-Duc
Module Outline
8/20/2010 Embedded Systems Course: Measuring Execution Time and Real-Time Performance - 2010 4
Measurement Methods
Stop-watch
Program starts, state the watch. Program ends,
stop the watch and read the time
Too low in accuracy for real-time code
Ignore this manual method
Software Analyzer
WindView, Tornado Environment (VxWorks)
ARM RealView Profiler
Real-Time Trace, Keil ARM Development Tools
…
8/20/2010 Embedded Systems Course: Measuring Execution Time and Real-Time Performance - 2010 5
Measurement Methods –
WindView
8/20/2010 Embedded Systems Course: Measuring Execution Time and Real-Time Performance - 2010 6
Measurement Methods –
Using Timer Services
start = OSTimerGet();
do stuff; Measurement
finish = OSTimerGet();
total = (finish – start)/CLOCK_TICKS;
8/20/2010 Embedded Systems Course: Measuring Execution Time and Real-Time Performance - 2010 7
Code Execution Time
Estimation
T = Ic * CPI / f
8/20/2010 Embedded Systems Course: Measuring Execution Time and Real-Time Performance - 2010 8
Measurement Methods –
Hardware Tools
8/20/2010 Embedded Systems Course: Measuring Execution Time and Real-Time Performance - 2010 10
Measurement Methods –
Logic Analyzer
8/20/2010 Embedded Systems Course: Measuring Execution Time and Real-Time Performance - 2010 11
Measurement Methods –
Oscilloscope
8/20/2010 Embedded Systems Course: Measuring Execution Time and Real-Time Performance - 2010 12
Measurement Methods
8/20/2010 Embedded Systems Course: Measuring Execution Time and Real-Time Performance - 2010 13
Measuring Task Execution
8/20/2010 Embedded Systems Course: Measuring Execution Time and Real-Time Performance - 2010 14
Measuring Task Execution
8/20/2010 Embedded Systems Course: Measuring Execution Time and Real-Time Performance - 2010 17
Measuring Task Execution – Effect
of Context Switch Overhead
8/20/2010 Embedded Systems Course: Measuring Execution Time and Real-Time Performance - 2010 18
Measuring Time of Task
Context Switch
Using two periodic tasks each at a different priority
The slowest task toggles bit on a GPIO pin connecting to channel 1
The other toggles bit on another GPIO pin connecting to channel 2
2Δthr = t1 – t2 – t3
8/20/2010 Embedded Systems Course: Measuring Execution Time and Real-Time Performance - 2010 19
Measuring Time of Interrupt
Latency
Force a software interrupt
Toggle a GPIO pin
8/20/2010 Embedded Systems Course: Measuring Execution Time and Real-Time Performance - 2010 20
Measuring Time of Interrupt
Latency
8/20/2010 Embedded Systems Course: Measuring Execution Time and Real-Time Performance - 2010 21
Measuring Time of Interrupt
Latency
8/20/2010 Embedded Systems Course: Measuring Execution Time and Real-Time Performance - 2010 22
Measuring Time of RTOS’s
Services
Message Passing
Semaphore Processing
Memory Allocation/Deallocation
8/20/2010 Embedded Systems Course: Measuring Execution Time and Real-Time Performance - 2010 23
Reference
David B. Stewart, Measuring Execution Time and
Real-Time Performance, Embedded Systems
Conference, Boston, September 2006
William Lamie and John Carbone, Measure your
RTOS’s Real-Time Performance,
http://www.eetimes.com/design/automotive-
design/4007081/Measure-your-RTOS-s-real-time-
performance, 2007
Phillip A. Laplante, Real-Time System Design and
Analysis An Engineers Handbook, John Wiley &
Sons, Inc., Third Edition, 2004
8/20/2010 Embedded Systems Course: Measuring Execution Time and Real-Time Performance - 2010 24