Abstract
Traditional timing analysis, such as worst-case execution time analysis, is normally applied only in the late stages of embedded system software development, when the hardware is available and the code is compiled and linked. However, preliminary timing estimates are often needed in early stages of system development as an essential prerequisite for the configuration of the hardware setup and dimensioning of the system. During this phase the hardware is often not available, and the code might not be ready to link. This article describes an approach to predict the execution time of software through an early, source-level timing analysis. A timing model for source code is automatically derived from a given combination of hardware architecture and compiler. The model is identified from measured execution times for a set of synthetic training programs, compiled for the hardware platform in question. It can be used to estimate the execution time for code running on the platform: the estimation is then done directly from the source code, without compiling and running it. Our experiments show that, using this model, we can predict the execution times of the final, compiled code surprisingly well. For instance, we achieve an average deviation of 8 % for a set of benchmark programs for the ARM7 architecture.
Similar content being viewed by others
References
Abel A, Reineke J (2013) Measurement-based modeling of the cache replacement policy. In: Proceedings of 19th real-time and embedded technology and applications symposium (RTAS) 65–74. doi:10.1109/RTAS.2013.6531080
Altenbernd P, Ermedahl A, Lisper B, Gustafsson J (2011) Automatic generation of timing models for timing analysis of high-level code. In: Faucou S (ed) Proceedings of 19th international conference on real-time and network systems (RTNS2011), Nantes
Bartlett M, Bate I, Kazakov D (2009) Guaranteed loop bound identification from program traces for WCET. In: Proceedings 15th IEEE real-time and embedded technology and applications symposium (RTAS’09), IEEE computer society, San Francisco, pp 287–294
Bate I, Bernat G, Murphy G, Puschner P (2000) Low-level analysis of a portable java byte code WCET analysis framework In: Proceedings of 7th international conference on real-time computing systems and applications (RTCSA’00), pp 39–48
Bernat G, Burns A, Wellings A (2000) Portable worst-case execution time analysis using java byte code In: Proceedings of 12th Euromicro conference on real-time systems, (ECRTS’00), Stockholm pp. 81–88
Binkert N, Beckmann B, Black G, Reinhardt SK, Saidi A, Basu A, Hestness J, Hower DR, Krishna T, Sardashti S, Sen R, Sewell K, Shoaib M, Vaish N, Hill MD, Wood DA (2011) The gem5 simulator. SIGARCH Comput Archit News 39(2):1–7. doi: 10.1145/2024716.2024718, http://doi.acm.org/10.1145/2024716.2024718
Burger D, Austin TM (1997) The simpleScalar tool set, version 2.0. SIGARCH Comput Archit News 25(3):13–25
Dubach C, Jones TM, Bonilla EV, Fursin G, O’Boyle MFP (2009) Portable compiler optimisation across embedded programs and microarchitectures using machine learning. In: Albonesi DH, Martonosi M, August DI, Martínez JF (eds) Proceedings of 42nd annual IEEE/ACM international symposium on microarchitecture (MICRO-42 2009), ACM, New York, pp. 78–88
Ermedahl A, Gustafsson J, Lisper B (2011) Deriving WCET bounds by abstract execution. In: Healy C (ed) Proceedings of 11th international workshop on worst-case execution time analysis (WCET’2011), Porto
Erpenbach E, Altenbernd P (1999) Worst-case execution times and schedulability analysis of statecharts models. In: Proceedings of 11th Euromicro conference on real-time systems, pp 70–77
Ferdinand C, Heckmann R (2008) Worst-case execution time—a tool provider’s perspective. In: Proceedings of 11th IEEE symposium on object oriented real-time distributed computing (ISORC2008), Orlando, pp 340–345
Ferdinand C, Heckmann R, Franzen B (2007) Static memory and timing analysis of embedded systems code. In: Proceedings of 3rd European symposium on verification and validation of software systems (VVSS’07), No. 07–04 in TUE computer science reports, . Eindhoven, The Netherlands, pp 153–163
Ferdinand C, Wilhelm R (1999) Efficient and precise cache behavior prediction for real-time systems. Real-Time Syst 17:131–181
Franke B (2008) Fast cycle-approximate instruction set simulation. In: Falk H (ed) Proceedings of 11\({th}\) international workshop on software and compilers for embedded systems (SCOPES’08), Munich, pp 69–78
Gauss CF (1809) Theoria motus corporum coelestium: in sectionibus conicis solem ambientium/auctore Carolo Friderico Gauss. Sumtibus F. Perthes et I.H, Besser, Hamburg
Giusto P, Martin G, Harcourt E (2001) Reliable estimation of execution time of embedded software. In: Proceedings of conference on design, automation and test in Europe (DAC 2001). IEEE computer society, Los Alamitos (2001). http://doi.ieeecomputersociety.org/10.1109/DATE.2001.915082
Gustafsson J, Altenbernd P, Ermedahl A, Lisper B (2009) Approximate worst-case execution time analysis for early stage embedded systems development. In: Lee S, Narasimhan P (eds) Proceedings of seventh IFIP workshop on software technologies for future embedded and ubiquitous systems (SEUS 2009), Springer-Verlag, Newport Beach, (2009), pp 308–319. URL: http://www.mrtc.mdh.se/index.php?choice=publications&id=1925
Gustafsson J, Betts A, Ermedahl A, Lisper B (2010) The Mälardalen WCET benchmarks—past, present and future. In: Lisper B (ed) Proceedings of 10th international workshop on worst-case execution time analysis (WCET’2010), OCG, Brussels, pp 137–147
Gustafsson J, Ermedahl A, Lisper B (2011) ALF (ARTIST2 language for flow analysis) specification. Technical report, Mälardalen University, Västerås (2011). http://www.es.mdh.se/pdf_publications/1138.pdf
Gustafsson J, Ermedahl A, Lisper B, Sandberg C, Källberg L (2009) ALF—a language for WCET flow analysis. In: Holsti N (ed) Proceedings of 9th international workshop on worst-case execution time analysis (WCET’2009), OCG, Dublin, pp 1–11
Hahn S, Grund D (2012) Relational cache analysis for static timing analysis. In: Davis R (ed) Proceedings of 24th Euromicro conference on real-time systems (ECRTS 2012), IEEE computer society, Pisa, pp 102–111
Heckmann R, Ferdinand C, Kästner D, Nenova S (2013) Architecture exploration and timing estimation during early design phases. Int J Softw Tools Technol Transf (STTT) 15(1):29–39
Holzer A, Januzaj V, Kugele S, Tautschnig M (2010) Timely time estimates. In: Margaria T, Steffen B (eds) Proceedings of vol 6415, 4th international symposium on leveraging applications of formal methods (ISOLA’10) part I lecture notes in computer science, Springer, Heraclion, Crete, pp 33–46
Huber B, Puffitsch W, Puschner P (2011) Towards an open timing analysis platform. In: Healy C (ed) Proceedings of 11th international workshop on worst-case execution time analysis (WCET’2011), Porto
Kincaid DR, Cheney EW (2002) Numerical analysis: mathematics of scientific computing, American Mathematical Society, vol 2
Kirkpatrick S (1984) Optimization by simulated annealing: Quantitative studies. J Stat Phys 34:975–986. doi:10.1007/BF01009452
Kirner R, Lang R, Freiberger G, Puschner P (2002) Fully automatic worst-case execution time analysis for Matlab/Simulink models. In: Proceedings of 14th Euromicro conference on real-time systems, (ECRTS’02). Washington, DC
Leather H, Bonilla EV, O’Boyle MFP (2009) Automatic feature generation for machine learning based optimizing compilation. In: Proceedings of seventh international symposium on code generation and optimization (CGO 2009), IEEE Computer Society, Seattle, pp 81–91
Lee S, Ermedahl A, Min SL, Chang N (2001) An accurate instruction-level energy consumption model for embedded RISC processor. In: Proceedings of ACM SIGPLAN workshop on languages, compilers and tools for embedded systems (LCTES’01), pp 1–10
Lisper B (2014) SWEET—a tool for WCET flow analysis (extended abstract). In: Margaria T, Steffen B (eds) Proceedings of 6th international symposium on leveraging applications of formal methods (ISOLA’14), lecture notes in computer science, Springer, Corfu, Crete (2014). 8803:482–485. doi:10.1007/978-3-662-45231-8_38
Lisper B, Santos M (2009) Model identification for WCET analysis. In: Proceedings of 15th IEEE real-time and embedded technology and applications symposium (RTAS’09), IEEE Computer Society, San Francisco, pp 55–64
LLVM homepage (2013) http://llvm.org
Persson P, Hedin G (1998) Interactive execution time predictions using reference attributed grammars. In: Proceedings of the 2nd workshop on attribute grammars and their applications (WAGA’99), Netherlands, pp 173–184
Stappert F (2004) From low-level to model-based and constructive worst-case execution time analysis. Ph.D. thesis, Faculty of Computer Science, Electrical Engineering, and Mathematics, University of Paderborn, C-LAB Publication, vol 17, Shaker Verlag, ISBN 3-8322-2637-0
Stattelmann S, Bringmann O, Rosenstiel W (2011) Fast and accurate source-level simulation of software timing considering complex code optimizations. In: Stok L, Dutt ND, Hassoun S (eds) Proceedings of 48th design automation conference (DAC 2011), ACM, San Diego, pp 486–491
SWEET home page (2011) www.mrtc.mdh.se/projects/wcet/sweet/
Wang Z, O’Boyle MFP (2013) Using machine learning to partition streaming programs. ACM Trans Arch Code Optim 10(3):20:1–20:25
Wegener S (2012) Computing same block relations for relational cache analysis. In: Vardanega T (ed) Proceedings of 12th international workshop on worst-case execution time analysis, openAccess series in informatics (OASIcs), Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik, Dagstuhl, 23:25–37. doi: 10.4230/OASIcs.WCET.2012.25, http://drops.dagstuhl.de/opus/volltexte/2012/3554
Acknowledgments
This work was partially supported by VINNOVA through the TIMMO-2-USE project, by VINNOVA and ARTEMIS through the CHESS project, by the KK-Foundation through the TOCSYC project, Deutscher Akademischer Austauschdienst, and from the European Commission through the Lifelong Learning ERASMUS-Programme. This publication reflects the views only of the author, and the Commission cannot be held responsible for any use which may be made of the information contained therein. Finally, we are very grateful for the friendly help on GEM5 by Benedikt Huber from the Vienna University of Technology, and his support with the C2ALF translator.
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
Altenbernd, P., Gustafsson, J., Lisper, B. et al. Early execution time-estimation through automatically generated timing models. Real-Time Syst 52, 731–760 (2016). https://doi.org/10.1007/s11241-016-9250-7
Published:
Issue Date:
DOI: https://doi.org/10.1007/s11241-016-9250-7