skip to main content
research-article

How to compute worst-case execution time by optimization modulo theory and a clever encoding of program semantics

Published:12 June 2014Publication History
Skip Abstract Section

Abstract

In systems with hard real-time constraints, it is necessary to compute upper bounds on the worst-case execution time (WCET) of programs; the closer the bound to the real WCET, the better. This is especially the case of synchronous reactive control loops with a fixed clock; the WCET of the loop body must not exceed the clock period.

We compute the WCET (or at least a close upper bound thereof) as the solution of an optimization modulo theory problem that takes into account the semantics of the program, in contrast to other methods that compute the longest path whether or not it is feasible according to these semantics. Optimization modulo theory extends satisfiability modulo theory (SMT) to maximization problems.

Immediate encodings of WCET problems into SMT yield formulas intractable for all current production-grade solvers --- this is inherent to the DPLL(T) approach to SMT implemented in these solvers. By conjoining some appropriate "cuts" to these formulas, we considerably reduce the computation time of the SMT-solver.

We experimented our approach on a variety of control programs, using the OTAWA analyzer both as baseline and as underlying microarchitectural analysis for our analysis, and show notable improvement on the WCET bound on a variety of benchmarks and control programs.

References

  1. M. Asavoae, C. Maiza, and P. Raymond. Program semantics in modelbased WCET analysis: A state of the art perspective. In C. Maiza, editor, WCET 2013, volume 30 of OASICS, pages 32--41. Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik, 2013.Google ScholarGoogle Scholar
  2. C. Ballabriga, H. Casse, C. Rochange, and P. Sainrat. OTAWA: An open toolbox for adaptive WCET analysis. In SEUS, volume 6399 of LNCS, pages 35--46. Springer, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. A. Banerjee, S. Chattopadhyay, and A. Roychoudhury. Precise microarchitectural modeling for WCET analysis via AI+SAT. In IEEE Real- Time and Embedded Technology and Applications Symposium (RTAS), pages 87--96. IEEE Computer Society, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. A. Biere, J. Knoop, L. Kovács, and J. Zwirchmayr. The Auspicious Couple: Symbolic Execution and WCET Analysis. In WCET, volume 30 of OASIcs, pages 53--63. IBFI Schloss Dagstuhl, 2013. URL http://drops.dagstuhl.de/opus/volltexte/2013/4122.Google ScholarGoogle Scholar
  5. N. Bjørner, B. Dutertre, and L. de Moura. Accelerating lemma learning using joins - DPLL(t), 2008. Appeared as short paper inLPAR 2008, outside of proceedings.Google ScholarGoogle Scholar
  6. C. Cadar and K. Sen. Symbolic execution for software testing: Three decades later. Commun. ACM, 56(2):82--90, Feb. 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. P. Caspi, P. Raymond, and S. Tripakis. Synchronous programming. In Handbook of Real-Time and Embedded Systems, chapter 14. Chapman & Hall / CRC, 2008.Google ScholarGoogle Scholar
  8. S. Chaki and J. Ivers. Software model checking without source code. Innovations in Systems and Software Engineering, 6(3):233-- 242, 2010. ISSN 1614--5046. . Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. S. Chattopadhyay and A. Roychoudhury. Scalable and precise refinement of cache timing analysis via path-sensitive verification. Real- Time Systems, 49(4):517--562, 2013.Google ScholarGoogle ScholarCross RefCross Ref
  10. D.-H. Chu and J. Jaffar. Symbolic simulation on complicated loops for WCET path analysis. In EMSOFT, pages 319--328, 2011. ISBN 978--1--4503-0714--7. . Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. L. Cordeiro, B. Fischer, and J. Marques-Silva. SMT-based bounded model checking for embedded ANSI-C software. IEEE Trans. Software Eng., 38(4):957--974, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. S. Cotton. On Some Problems in Satisfiability Solving. PhD thesis, Universite Joseph Fourier, Grenoble, 2009.Google ScholarGoogle Scholar
  13. S. Cotton. Natural domain SMT: A preliminary assessment. In FORMATS, volume 6246 of LNCS, pages 77--91. Springer, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. P. Cousot et al. The Astree analyzer. In ESOP, volume 3444 of LNCS, pages 21--30. Springer, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. A. Dalsgaard, M. Olesen, M. Toft, R. Hansen, and K. Larsen. METAMOC: Modular execution time analysis using model checking. In WCET, pages 113--123, 2010.Google ScholarGoogle Scholar
  16. L. M. de Moura and N. Bjørner. Z3: An efficient SMT solver. In TACAS, volume 4963 of LNCS, pages 337--340. Springer, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. L. M. de Moura and D. Jovanovic. A model-constructing satisfiability calculus. In VMCAI, volume 7737 of LNCS, pages 1--12. Springer, 2013.Google ScholarGoogle Scholar
  18. J. Engblom and B. Jonsson. Processor pipelines and their properties for static wcet analysis. In EMSOFT, volume 2491 of LNCS, pages 334--348. Springer, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. J. Gustafsson, A. Ermedahl, C. Sandberg, and B. Lisper. Automaticderivation of loop bounds and infeasible paths for WCET analysis using abstract execution. In RTSS, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. J. Gustafsson, A. Betts, A. Ermedahl, and B. Lisper. The Malardalen WCET benchmarks -- past, present and future. In WCET, volume 15 of OASICS, pages 136--146. IBFI Schloss Dagstuhl, 2010.Google ScholarGoogle Scholar
  21. C. Healy and D. Whalley. Automatic detection and exploitation of branch constraints for timing analysis. IEEE Trans. on Software Engineering, 28(8), Aug. 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. J. Henry, D. Monniaux, and M. Moy. Pagai: A path sensitive static analyser. Electr. Notes Theor. Comput. Sci., 289:15--25, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. N. Holsti. Computing time as a program variable: a way around infeasible paths. In WCET, volume 08003 of Dagstuhl Seminar Proceedings. IBFI Schloss Dagstuhl, 2008.Google ScholarGoogle Scholar
  24. B. Huber and M. Schoeberl. Comparison of implicit path enumeration and model checking based wcet analysis. In WCET, volume 10 of OASICS. IBFI Schloss Dagstuhl, 2009. URL http://drops. dagstuhl.de/opus/volltexte/2009/2281.Google ScholarGoogle Scholar
  25. B. K. Huynh, L. Ju, and A. Roychoudhury. Scope-aware data cache analysis for WCET estimation. In IEEE Real-Time and Embedded Technology and Applications Symposium, pages 203--212, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. J. Knoop, L. Kovacs, and J. Zwirchmayr. WCET squeezing: ondemand feasibility refinement for proven precise WCET-bounds. In RTNS, pages 161--170, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. D. Kroening and O. Strichman. Decision Procedures. Springer, 2008.Google ScholarGoogle Scholar
  28. C. Lattner and V. S. Adve. LLVM: A compilation framework for lifelong program analysis & transformation. In CGO, pages 75--88. IEEE Computer Society, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. X. Li, Y. Liang, T. Mitra, and A. Roychoudhury. Chronos: A timing analyzer for embedded software. Science of Computer Programming, 69(1--3):56--67, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Y.-T. S. Li and S. Malik. Performance analysis of embedded software using implicit path enumeration. IEEE Trans. on Computer-Aided Design of Integrated Circuits and Systems, 16(12):1477--1487, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. K. L. McMillan, A. Kuehlmann, and M. Sagiv. Generalizing DPLL to richer logics. In CAV, volume 5643 of LNCS, pages 462--476. Springer, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. A. Metzner. Why model checking can improve WCET analysis. In CAV, pages 334--347, 2004.Google ScholarGoogle Scholar
  33. H. Negi, A. Roychoudhury, and T. Mitra. Simplifying WCET analysis by code transformations. In WCET, 2004.Google ScholarGoogle Scholar
  34. F. Nemer, H. Casse, P. Sainrat, J. P. Bahsoun, and M. D. Michiel. Papabench: a free real-time benchmark. In WCET, volume 4 of OASICS. IBFI Schloss Dagstuhl, 2006.Google ScholarGoogle Scholar
  35. J. Reineke. Caches in WCET Analysis: Predictability - Competitiveness - Sensitivity. PhD thesis, University of Saarland, 2009.Google ScholarGoogle Scholar
  36. R. Sebastiani and S. Tomasi. Optimization in SMT with LA(Q) cost functions. In IJCAR, volume 7364 of LNCS, pages 484--498. Springer, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. J. Souyris, V. Wiels, D. Delmas, and H. Delseny. Formal verification of avionics software products. In A. Cavalcanti and D. Dams, editors, Formal Methods (FM), volume 5850 of LNCS, pages 532--546. Springer, 2009. ISBN 978--3--642-05088--6. . Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. H. Theiling, C. Ferdinand, and R. Wilhelm. Fast and precise WCET prediction by separated cache and path analyses. Int. J. of Time- Critical Computing Systems, 18:157--179, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. R. Wilhelm. Determining bounds on execution times. In Handbook on Embedded Systems, chapter 14. CRC Press, 2006.Google ScholarGoogle Scholar
  40. R. Wilhelm et al. The worst-case execution-time problem - overview of methods and survey of tools. ACM Trans. Embedded Comput. Syst., 7(3), 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. W. Zhao,W. C. Kreahling, D. B. Whalley, C. A. Healy, and F. Mueller. Improving WCET by applying worst-case path optimizations. Real- Time Systems, 34(2):129--152, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. How to compute worst-case execution time by optimization modulo theory and a clever encoding of program semantics

            Recommendations

            Comments

            Login options

            Check if you have access through your login credentials or your institution to get full access on this article.

            Sign in

            Full Access

            PDF Format

            View or Download as a PDF file.

            PDF

            eReader

            View online with eReader.

            eReader
            About Cookies On This Site

            We use cookies to ensure that we give you the best experience on our website.

            Learn more

            Got it!