1284 IEEE TRANSACTIONS ON COMPUTER-AIDED DESIGN OF INTEGRATED CIRCUITS AND SYSTEMS, VOL. 22, NO. 9, SEPTEMBER 2003 [20] C. Lee, M. Potkonjak, and W. Mangione-Smith, “Mediabench: A tool for evaluating and synthesizing multimedia and communications systems,” in Proc. Int. Symp. Microarchitect., 1997, pp. 330–335. [21] C. Lee, J. Kin, M. Potkonjak, and W. Mangione-Smith, “Media archi- tecture: General purpose vs. multiple application specific programmable processor,” in Proc. Deisgn Automation Conf., 1998, pp. 321–326. [22] P. P. Chang, S. A. Mahlke, W. Y. Chen, N. J. Warter, and W. W. Hwu, “Impact: An architectural framework for multiple-instruction-issue pro- cessors,” Comput. Architect. News, vol. 19, no. 3, pp. 266–275, 1991. A Simulation Framework for Energy-Consumption Analysis of OS-Driven Embedded Applications T. K. Tan, A. Raghunathan, and N. K. Jha Abstract—Energy consumption has become a major focus in the design of embedded systems (e.g., mobile computing and wireless communication devices). In particular, a shift of emphasis from hardware-oriented low-en- ergy design techniques to energy-efficient embedded software design has occurred progressively in the past few years. To that end, various tech- niques have been developed for the design of energy-efficient embedded software. In operating system (OS)-driven embedded systems, the OS has a significant impact on the system’s energy consumption directly (energy consumption associated with the execution of the OS functions and ser- vices), as well as indirectly (interaction of the OS with the application soft- ware). As a first step toward designing energy-efficient OS-based embedded systems, it is important to analyze the energy consumption of embedded software by taking the OS energy characteristics into account. To facilitate such studies, we present, in this work, an energy simulation framework that can be used to analyze the energy consumption characteristics of an embedded system featuring the embedded Linux OS running on the Stron- gARM processor. The framework allows software designers to study the energy consumption of the system software in relation to the application software, identify the energy hot spots, and perform design changes based on the knowledge of the OS energy consumption characteristics as well as application-OS interactions. Index Terms—Embedded system, energy analysis, energy simulation, op- erating system. I. INTRODUCTION The complexity of embedded system software and the underlying hardware, tight performance and power budgets, and aggressive time-to-market schedules, usually necessitate the use of sophisticated runtime software support. In embedded systems where a single processor executes many different system tasks (each system task may be further divided into communicating processes), the use of an embedded operating system (OS) for runtime execution support is quite common. The use of an embedded OS significantly impacts both performance and energy consumption. Representative investigations of performance issues related to the use of an OS can be found in [1]–[4]. However, in modern microprocessors, where idle or sleep Manuscript received March 6, 2002; revised October 17, 2002. This work was supported by DARPA under Contract DAAB07-00-C-L516. This paper was recommended by Associate Editor R. Gupta. T. K. Tan and N. K. Jha are with the Department of Electrical Engineering, Princeton University, NJ 08544 USA (e-mail: tktan@ee.princeton.edu; jha@ee.princeton.edu). A. Raghunathan is with NEC Laboratories America, Princeton, NJ 08540 USA (e-mail: anand@nec-labs.com). Digital Object Identifier 10.1109/TCAD.2003.816207 modes are usually exploited by software, performance optimization does not necessarily lead to energy optimization. Not much literature deals with energy consumption issues related to an embedded OS. The effect of a real-time OS on the energy consumption of embedded software was illustrated in [5] using /OS and SPARClite processor, where it was shown that the OS could consume a significant portion of the total energy consumption. However, this was just a first step. Much remains to be done to fully appreciate and model the impact of an embedded OS on software energy consumption. In this paper, we present an energy simulation framework that en- ables simulation of an embedded Linux OS on a typical hardware plat- form based on the Intel StrongARM processor. We have also made this energy simulation framework available for public use (please visit http://www.ee.princeton.edu/~tktan/emsim to download our simulator, EMSIM). As described in Section III, such a simulation imposes spe- cial requirements in terms of modeling the functionalities of the hard- ware platform. Function and process-based energy accounting has been implemented to provide energy analysis capability, enabling users to identify specific energy hot spots in embedded software programs, and better guide code optimizations. The remainder of the paper is organized as follows. In the next sec- tion, we present some previous work and highlight our contributions. Section III presents the design and validation of our simulator. Sec- tion IV describes a case study that demonstrates the usefulness of our energy simulation framework. Section V discusses several limitations and design issues pertaining to our simulator. Section VI presents the conclusion and future work. II. RELATED WORK AND OUR CONTRIBUTIONS In this section, we discuss related work and highlight our contribu- tions. A. Related Work Many instruction-level energy simulators based on the in- struction-level power modeling approach have emerged since its introduction in [6]. Applications of the instruction-level modeling technique include [5], [7]–[15], and enhancement of the basic ideas leading to either more accurate or efficient modeling techniques are presented in [7], [16]–[18]. Mehta et al. [10] described an energy simulator based on the DLX architecture which they used to evaluate several compiler optimization techniques for low-energy software. Li et al. [8] presented an energy simulation framework for an embedded hardware-software system based on Fujitsu’s SPARClite processor. Simunic et al. [7] enhanced cycle-accurate models of an embedded system based on the StrongARM SA-1100 processor to estimate en- ergy consumption and battery life. Such embedded system simulators could be used to perform design space exploration for low power. JouleTrack [11], a web-based energy simulation tool, performs energy estimation using models that separate the energy consumption into a first-order component that depends only on the operating frequency and voltage, and a second-order component that considers instruction statistics. They also presented techniques to separate out the energy consumption due to leakage from the energy consumption due to switching. A complementary approach to instruction-level power modeling is through the use of structure-based power modeling. In this approach, the power consumption of the microprocessor in each execution cycle is estimated by summing up the power consumption of all the active func- tional blocks in that cycle. The total energy consumption of a program is obtained by accumulation of processor power consumption over the 0278-0070/03$17.00 © 2003 IEEE