Energy Consumption Analysis of Programs Based on XMOS ISA-Level Models

  • Umer Liqat
  • Steve Kerrison
  • Alejandro Serrano
  • Kyriakos Georgiou
  • Pedro Lopez-Garcia
  • Neville Grech
  • Manuel V. Hermenegildo
  • Kerstin Eder
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 8901)


Energy consumption analysis of embedded programs requires the analysis of low-level program representations. This is challenging because the gap between the high-level program structure and the low-level energy models needs to be bridged. Here, we describe techniques for recreating the structure of low-level programs and transforming these into Horn clauses in order to make use of a generic resource analysis framework (CiaoPP). Our analysis, which makes use of an energy model we produce for the underlying hardware, characterises the energy consumption of the program, and returns energy formulae parametrised by the size of the input data. We have performed an initial experimental assessment and obtained encouraging results when comparing the statically inferred formulae to direct energy measurements from the hardware running a set of benchmarks. Static energy estimation has applications in program optimisation and enables more energy-awareness in software development.


Energy consumption analysis Energy models Resource usage analysis Static analysis 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Albert, E., Arenas, P., Genaim, S., Puebla, G., Zanardini, D.: Cost Analysis of Java Bytecode. In: De Nicola, R. (ed.) ESOP 2007. LNCS, vol. 4421, pp. 157–172. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  2. 2.
    Debray, S.K., Lin, N.-W., Hermenegildo, M.: Task Granularity Analysis in Logic Programs. In: Proc. of the 1990 ACM Conf. on Programming Language Design and Implementation, pp. 174–188. ACM Press (June 1990)Google Scholar
  3. 3.
    Debray, S.K., López-García, P., Hermenegildo, M., Lin, N.-W.: Lower Bound Cost Estimation for Logic Programs. In: 1997 International Logic Programming Symposium, pp. 291–305. MIT Press, Cambridge (October 1997)Google Scholar
  4. 4.
    Wilhelm, R., et al.: The worst-case execution-time problem - overview of methods and survey of tools. ACM Trans. Embedded Comput. Syst. 7(3) (2008)Google Scholar
  5. 5.
    Henriksen, K.S., Gallagher, J.P.: Abstract interpretation of PIC programs through logic programming. In: Sixth IEEE International Workshop on Source Code Analysis and Manipulation (SCAM 2006), pp. 184–196. IEEE Computer Society (2006)Google Scholar
  6. 6.
    Hermenegildo, M., Puebla, G., Bueno, F., López-García, P.: Integrated Program Debugging, Verification, and Optimization Using Abstract Interpretation (and The Ciao System Preprocessor). Science of Computer Programming 58(1–2), 115–140 (2005)CrossRefMathSciNetzbMATHGoogle Scholar
  7. 7.
    Hermenegildo, M.V., Bueno, F., Carro, M., López, P., Mera, E., Morales, J.F., Puebla, G.: An Overview of Ciao and its Design Philosophy. Theory and Practice of Logic Programming 12(1–2), 219–252 (2012)CrossRefMathSciNetzbMATHGoogle Scholar
  8. 8.
    Hoffmann, J., Aehlig, K., Hofmann, M.: Multivariate amortized resource analysis. ACM Trans. Program. Lang. Syst. 34(3), 14 (2012)Google Scholar
  9. 9.
    Jayaseelan, R., Mitra, T., Li, X.: Estimating the worst-case energy consumption of embedded software. In: IEEE Real Time Technology and Applications Symposium, pp. 81–90. IEEE Computer Society (2006)Google Scholar
  10. 10.
    Kerrison, S., Eder, K.: Energy modelling and optimisation of software for a hardware multi-threaded embedded microprocessor. ACM Transactions on Embedded Computing Systems (TECS) (to appear, 2015)Google Scholar
  11. 11.
    Lattner, C., Adve, V.S.: LLVM: A compilation framework for lifelong program analysis and transformation. In: Proc. of the 2004 International Symposium on Code Generation and Optimization (CGO), pp. 75–88. IEEE Computer Society (2004)Google Scholar
  12. 12.
    Lee, J.H., Avgerinos, T., Brumley, D.: TIE: Principled Reverse Engineering of Types in Binary Programs. In: Proceedings of the Network and Distributed System Security Symposium, NDSS 2011. The Internet Society (February 2011)Google Scholar
  13. 13.
    May, D.: The XMOS XS1 architecture (2013).
  14. 14.
    Méndez-Lojo, M., Navas, J., Hermenegildo, M.V.: A flexible, (C)LP-based approach to the analysis of object-oriented programs. In: King, A. (ed.) LOPSTR 2007. LNCS, vol. 4915, pp. 154–168. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  15. 15.
    Navas, J., Méndez-Lojo, M., Hermenegildo, M.: Safe Upper-bounds Inference of Energy Consumption for Java Bytecode Applications. In: The Sixth NASA Langley Formal Methods Workshop (LFM 2008) (April 2008) (Extended Abstract)Google Scholar
  16. 16.
    Navas, J., Méndez-Lojo, M., Hermenegildo, M.: User-Definable Resource Usage Bounds Analysis for Java Bytecode. In: Proceedings of BYTECODE. Electronic Notes in Theoretical Computer Science, vol. 253, pp. 65–82. Elsevier - North Holland (March 2009)Google Scholar
  17. 17.
    Navas, J., Mera, E., López-García, P., Hermenegildo, M.V.: User-Definable Resource Bounds Analysis for Logic Programs. In: Dahl, V., Niemelä, I. (eds.) ICLP 2007. LNCS, vol. 4670, pp. 348–363. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  18. 18.
    Nielson, F., Nielson, H.R., Hankin, C.: Principles of Program Analysis. Springer (1999)Google Scholar
  19. 19.
    Rosendahl, M.: Automatic Complexity Analysis. In: 4th ACM Conference on Functional Programming Languages and Computer Architecture (FPCA 1989). ACM Press (1989)Google Scholar
  20. 20.
    Russell, J.T., Jacome, M.F.: Software power estimation and optimization for high performance, 32-bit embedded processors. In: ICCD, pp. 328–333 (1998)Google Scholar
  21. 21.
    Serrano, A., Lopez-Garcia, P., Hermenegildo, M.: Resource Usage Analysis of Logic Programs via Abstract Interpretation Using Sized Types. In: Theory and Practice of Logic Programming, 30th Int’l. Conference on Logic Programming (ICLP 2014) Special Issue, vol. 14(4–5), pp. 739–754 (2014)Google Scholar
  22. 22.
    Tiwari, V., Malik, S., Wolfe, A., Lee, M.T.C. Instruction level power analysis and optimization of software. In: Proceedings of VLSI Design, pp. 326–328 (1996)Google Scholar
  23. 23.
    Vasconcelos, P.B., Hammond, K.: Inferring Cost Equations for Recursive, Polymorphic and Higher-Order Functional Programs. In: Trinder, P., Michaelson, G.J., Peña, R. (eds.) IFL 2003. LNCS, vol. 3145, pp. 86–101. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  24. 24.
    Watt, D.: Programming XC on XMOS Devices. XMOS Limited (2009)Google Scholar
  25. 25.
    Wegbreit, B.: Mechanical program analysis. Commun. ACM 18(9), 528–539 (1975)CrossRefMathSciNetzbMATHGoogle Scholar
  26. 26.
    Xu, L., Sun, F., Su, Z.: Constructing Precise Control Flow Graphs from Binaries. University of California, Davis, Tech. Rep (2009)Google Scholar

Copyright information

© Springer International Publishing Switzerland 2014

Authors and Affiliations

  • Umer Liqat
    • 1
  • Steve Kerrison
    • 2
  • Alejandro Serrano
    • 1
  • Kyriakos Georgiou
    • 2
  • Pedro Lopez-Garcia
    • 1
    • 3
  • Neville Grech
    • 2
  • Manuel V. Hermenegildo
    • 1
    • 4
  • Kerstin Eder
    • 2
  1. 1.IMDEA Software InstituteMadridSpain
  2. 2.University of BristolBristolUK
  3. 3.Spanish Council for Scientific Research (CSIC)MadridSpain
  4. 4.Universidad Politécnica de Madrid (UPM)MadridSpain

Personalised recommendations