Energy consumption and execution time estimation of embedded system applications Gustavo Callou ⇑ , Paulo Maciel, Eduardo Tavares, Ermeson Andrade, Bruno Nogueira, Carlos Araujo, Paulo Cunha Center for Informatics (CIn), Federal University of Pernambuco, Recife, PE, Brazil article info Article history: Available online 17 August 2010 Keywords: Petri nets Stochastic simulation Embedded system Energy consumption Performance abstract Embedded systems often have conflicting constraints such as energy and time which considerably harden the design of those systems. In this context, this work proposes a mechanism for supporting design deci- sions on energy consumption and performance of embedded system applications. In order to depict the practical usability of the proposed methodology, a real case study as well as customized examples are presented. The estimates obtained through the conceived model are 93% close to the respective measures obtained from the real hardware platform. Ó 2010 Elsevier B.V. All rights reserved. 1. Introduction Nowadays, embedded systems are present in many areas of hu- man activity. Mobile phones, refrigerators, microwaves, oscillo- scopes and routers are a few examples of those devices that have a digital processor responsible for performing specific tasks. In addition, advances in microelectronics have allowed for the devel- opment of embedded systems with several complex features, thereby upholding the development of powerful mobile devices such as military gadgets (e.g.: spy satellites and guide missiles) and medical devices (e.g.: thermometers and pulse-oximeters). These devices generally rely on constrained energy sources (e.g.: battery), in such a way that if the energy source is depleted, the system stops functioning. Moreover, embedded system may also have timing constraints, in the sense that not only the logical re- sults of computations are important, but also the time instant in which they are obtained. Hence, energy consumption and execu- tion time estimation are essential issues on the development life cycle of those systems. Without loss of generality, there are two basic approaches based on simulation for estimating embedded software energy consumption and execution time: (i) instruction based simulation and (ii) hardware based simulation [20]. In hardware simulation, despite the great computational effort, more accurate results might be obtained in comparison with instruction simulation due to the laborious system specification. However, instruction simulation has been adopted by many works in order to provide energy con- sumption estimation in a satisfactory period of time. Some works concern hardware and instruction simulation, but to the best of our knowledge, only a small number adopts formal models as basis for simulation. This work proposes a methodology that aims to evaluate the en- ergy consumption and execution time of embedded real-time applications in early design phases. From an assembly code or C program, a Coloured Petri net (CPN) model is generated to estimate through stochastic simulation the energy consumption and execu- tion time. Furthermore, a tool, named ALUPAS, was developed for supporting automatic measurement on hardware platform. This paper is organized as follows: Section 2 presents the re- lated works. Section 3 introduces the background information for this paper. Section 4 depicts the methodology as well as the pro- posed framework for estimating energy consumption and execu- tion time of embedded system application. Section 5 details the adopted basic CPN models. Section 6 presents the proposed simu- lation environment. Section 7 considers some experiments and re- sults. Section 8 concludes the paper. 2. Related works In general, the energy consumption of a software is described considering the instruction set of the processor under study. The instruction can consume energy basically in two situations: (i) dur- ing the instruction execution, in which a sequence of internal pro- cessor states is generated and the state transitions result in a hardware energy consumption pattern, named Instruction Base 0141-9331/$ - see front matter Ó 2010 Elsevier B.V. All rights reserved. doi:10.1016/j.micpro.2010.08.006 ⇑ Corresponding author. E-mail addresses: grac@cin.ufpe.br (G. Callou), prmm@cin.ufpe.br (P. Maciel), eagt@cin.ufpe.br (E. Tavares), ecda@cin.ufpe.br (E. Andrade), bcsn@cin.ufpe.br (B. Nogueira), cjma@cin.ufpe.br (C. Araujo), prfc@cin.ufpe.br (P. Cunha). Microprocessors and Microsystems 35 (2011) 426–440 Contents lists available at ScienceDirect Microprocessors and Microsystems journal homepage: www.elsevier.com/locate/micpro