This Article 
 Bibliographic References 
 Add to: 
Accurate Determination of Loop Iterations for Worst-Case Execution Time Analysis
November 2010 (vol. 59 no. 11)
pp. 1520-1532
Mark Bartlett, University of York, York
Iain Bate, University of York, York
Dimitar Kazakov, University of York, York
Determination of accurate estimates for the Worst-Case Execution Time of a program is essential for guaranteeing the correct temporal behavior of any Real-Time System. Of particular importance is tightly bounding the number of iterations of loops in the program or excessive undue pessimism can result. This paper presents a novel approach to determining the number of iterations of a loop for such analysis. Program traces are collected and analyzed allowing the number of loop executions to be parametrically determined safely and precisely under certain conditions. The approach is mathematically proved to be safe and its practicality is demonstrated on a series of benchmarks.

[1] R. Wilhelm, J. Engblom, A. Ermedahl, N. Holsti, S. Thesing, D. Whalley, G. Bernat, C. Ferdinand, R. Heckmann, T. Mitra, F. Mueller, I. Puaut, P. Puschner, J. Staschulat, and P. Stenström, "The Worst-Case Execution-Time Problem—Overview of Methods and Survey of Tools," Trans. Embedded Computing Systems, vol. 7, no. 3, pp. 1-53, 2008.
[2] R. Chapman, "Static Timing Analysis and Program Proof," PhD dissertation, Univ. of York, 1995.
[3] C. Cullmann and F. Martin, "Data-Flow Based Detection of Loop Bounds," Proc. Seventh Int'l Workshop Worst Case Execution Time (WCET) Analysis, C. Rochange, ed., 2007.
[4] C. Park and A. Shaw, "A Source Level Tool for Predicting Deterministic Execution Times of Programs," Technical Report 89-09-02, Dept. of Computer Science and Eng., Univ. of Washington, 1989.
[5] J. Gustafsson, A. Ermedahl, C. Sandberg, and B. Lisper, "Automatic Derivation of Loop Bounds and Infeasible Paths for WCET Analysis Using Abstract Execution," Proc. 27th IEEE Int'l Real-Time Systems Symp. (RTSS '06), pp. 57-66, 2006.
[6] M. de Michiel, A. Bonenfant, H. Casse, and P. Sainrat, "Static Loop Bound Analysis of C Programs Based on Flow Analysis and Abstract Interpretation," Proc. 14th IEEE Int'l Conf. Embedded and Real-Time Computing Systems and Applications (RTCSA '08), pp. 161-166, 2008.
[7] M. Bartlett, I. Bate, and D. Kazakov, "Guaranteed Loop Bound Identification from Program Traces for WCET," Proc. 15th IEEE Real-Time and Embedded Technology and Applications Symp. (RTAS '09), pp. 287-294, Apr. 2009.
[8] R. Stansifer, "Presburger's Article on Integer Arithmetic: Remarks and Translation," Technical Report TR84-639, Dept. of Computer Science, Cornell Univ., 1984.
[9] E. Vivancos, C. Healy, F. Mueller, and D. Whalley, "Parametric Timing Analysis," Proc. ACM SIGPLAN Workshop Languages, Compilers and Tools for Embedded Systems (LCTES '01), J. Fenwick and C. Norris, eds., pp. 88-93, 2001.
[10] S. Bygde, A. Ermedahl, and B. Lisper, "An Efficient Algorithm for Parametric WCET Calculation," Proc. 16th Int'l Conf. Real-Time Computing Systems and Applications (RTCSA '09), P. Kellenberger, ed., pp. 13-21, 2009.
[11] E.J. Weyuker, "Axiomatizing Software Test Data Adequacy," IEEE Trans. Software Eng., vol. 12, no. 12, pp. 1128-1138, Dec. 1986.
[12] J. Wegener, H. Sthamer, B.F. Jones, and D.E. Eyres, "Testing Real-Time Systems Using Genetic Algorithms," Software Quality J., vol. 6, pp. 127-135, 1997.
[13] R. Kirner, I. Wenzel, B. Rieder, and P. Puschner, "Using Measurements as a Complement to Static Worst-Case Execution Time Analysis," Intelligent Systems at the Service of Mankind, vol. 2, UBooks Verlag, 2005.
[14] P. Puschner and C. Koza, "Calculating the Maximum Execution Time of Real-Time Programs," Real-Time Systems, vol. 1, no. 2, pp. 159-176, 1989.
[15] C.Y. Park, "Predicting Program Execution Times by Analyzing Static and Dynamic Program Paths," Real-Time Systems, vol. 5, no. 1, pp. 31-62, 1993.
[16] A. Ermedahl and J. Gustafsson, "Deriving Annotations for Tight Calculation of Execution Time," Proc. Third Int'l Euro-Par Conf. Parallel Processing (Euro-Par '97), pp. 1298-1307, 1997.
[17] C. Healy, V. Rustagi, D. Whalley, and R. Van Engelen, "Supporting Timing Analysis by Automatic Bounding of Loop Iterations," Real-Time Systems, vol. 18, pp. 121-148, 2000.
[18] D. Sehlberg, A. Ermedahl, J. Gustafsson, B. Lisper, and S. Wiegratz, "Static WCET Analysis of Real-Time Task-Oriented Code in Vehicle Control Systems," Proc. Second Int'l Symp. Leveraging Applications of Formal Methods, Verification and Validation (ISOLA '06), pp. 212-219, 2006.
[19] R. Wilhelm, D. Grund, J. Reineke, M. Schlickling, M. Pister, and C. Ferdinand, "Memory Hierarchies, Pipelines, and Buses for Future Architectures in Time-Critical Embedded Systems," IEEE Trans. Computer-Aided Design of Integrated Circuits and Systems, vol. 28, no. 7, pp. 966-978, July 2009.
[20] X. Li, A. Roychoudhury, and T. Mitra, "Modeling Out-of-Order Processors for Software Timing Analysis," Proc. 25th IEEE Int'l Real-Time Systems Symp., pp. 92-103, 2004.
[21] D. Kazakov and I. Bate, "New Directions in Worst-Case Execution Time Analysis," Proc. 2008 IEEE World Congress Computational Intelligence, 2008.
[22] B. Lisper and M. Santos, "Model Identification for WCET Analysis," Proc. 15th IEEE Real-Time and Embedded Technology and Applications Symp. (RTAS '09), Apr. 2009.
[23] A. Ermedahl, C. Sandberg, J. Gustafsson, S. Bygde, and B. Lisper, "Loop Bound Analysis Based on a Combination of Program Slicing Abstract Interpretation and Invariant Analysis," Proc. Seventh Int'l Workshop Worst Case Execution Time (WCET), C. Rochange, ed., 2007.
[24] N. Wilde and D. Knudson, "Understanding Embedded Software through Instrumentation: Preliminary Results from a Survey of Techniques," technical report, Dept. of Computer Science, Univ. of Florida, 1999.
[25] E. Kligerman and A.D. Stoyenko, "Real-Time Euclid: A Language for Reliable Real-Time Systems," IEEE Trans. Software Eng., vol. 12, no. 9, pp. 941-949, Sept. 1986.
[26] N. Tawbi, "Estimation of Nested Loops Execution Time by Integer Arithmetic in Convex Polyhedra," Proc. Eighth Int'l Symp. Parallel Processing, pp. 217-221, 1994.
[27] W. Pugh, "Counting Solutions to Presburger Formulas: How and Why," Proc. SIGPLAN Conf. Programming Language Design and Implementation, pp. 121-134, 1994.
[28] P. Clauss, "Counting Solutions to Linear and Nonlinear Constraints through Ehrhart Polynomials: Applications to Analyze and Transform Scientific Programs," Proc. Int'l Conf. Supercomputing, pp. 278-285, 1996.
[29] D.E. Knuth, "Johann Faulhaber and Sums of Powers," Math. Computation, vol. 61, no. 203, pp. 277-294, 1993.
[30] S. Muggleton, "Learning from Positive Data," Proc. Sixth Int'l Workshop Inductive Logic Programming (ILP '96), Aug. 1997.
[31] A. Srinivasan, The Aleph Manual. Computing Laboratory, Oxford Univ, 2000.
[32] M. Bartlett, I. Bate, and D. Kazakov, "Challenges in Relational Learning for Real-Time Systems Applications," Proc. 18th Int'l Conf. Inductive Logic Programming, pp. 42-58, 2008.
[33] D. Kazakov and I. Bate, "Towards New Methods for Developing Real-Time Systems: Automatically Deriving Loop Bounds Using Machine Learning," Proc. 11th IEEE Int'l Conf. Emerging Technologies and Factory Automation (ETFA), 2006.
[34] A. Betts and G. Bernat, "Tree-Based WCET Analysis on Instrumentation Point Graphs," Proc. Ninth IEEE Int'l Symp. Object and Component-Oriented Real-Time Distributed Computing (ISORC '06), pp. 558-565, 2006.

Index Terms:
Real-time and embedded systems, performance of systems, testing and debugging, deduction and theorem proving, knowledge processing.
Mark Bartlett, Iain Bate, Dimitar Kazakov, "Accurate Determination of Loop Iterations for Worst-Case Execution Time Analysis," IEEE Transactions on Computers, vol. 59, no. 11, pp. 1520-1532, Nov. 2010, doi:10.1109/TC.2010.59
Usage of this product signifies your acceptance of the Terms of Use.