OS strategies for power management in embedded devices

August 1, 2008 OpenSystems Media

During the past decade, Operating Systems (OSs) for embedded devices have evolved significantly, addressing growing processor complexity and providing a more complete software platform for developing sophisticated applications. Yet power management has remained an afterthought until now. With power efficiency becoming one of the dominant issues facing the electronics industry today, OSs are playing a pivotal role in energy management.

Smarter OSs

The OS ultimately controls all devices and thus must decide what to shut down and when to do so. But power management raises a number of questions the OS must address. Which devices can be controlled? How much power is saved in the low power states, and does some context have to be saved when going into these states? How long does it take to go back to full power? The answers to these questions vary for each device, so the OS must be able to deal with a range of possibilities.

Consider the following practical scenarios. If the OS shuts down a device and that device is needed again quickly, an annoying delay might occur while it is restarted. On the other hand, if the OS waits too long to shut down a device, energy is wasted for nothing. The objective then is to find algorithms and methods that let the OS make sensible decisions about what to shut down and when.

Reactive methodology

Reactive power management represents the most basic approach to power management. Today's systems already contain the raw elements of power management. For instance, chip manufacturers have designed power management facilities in their devices for many years. Some are automatic and take little overhead to implement; others need software to manage the system.

However, not all Real-Time OSs (RTOSs) provide the necessary functionality to limit power use. Many embedded OSs are designed to boot the device and enable all the drivers and networking on the board. But when considering lack of power management as a cost, multiplying what it costs to power each device for a year times all the billions of devices in the world quickly results in hundreds of megawatt hours of wasted electricity.

It is evident that systems must become more power savvy, and reactive power management is the initial step to making this possible. Designers must first understand each device's role in the system, its usage life cycle, which other devices relate to it, what control it provides, and how they can minimize its power use by enabling a reactive method.

Implementing reactive power management involves a state machine for every power domain in the system. Power domains are regions of a chip or component that can be controlled to minimize power use. A chip is a power domain if it can be powered down or brought into a lower power state. All devices that are part of that domain are controlled by it. The power manager architecture in Figure 1 illustrates the concept of power domains and events.

21
Figure 1

If a power domain consists of an Ethernet controller and a USB controller and either one needs the power at full level, then the power domain must be on. But if neither one is using power, it can be powered down.

Additionally, power domains have associations with other devices. A classic example is the LCD and its backlight. Designers can monitor when nothing will be displayed on the LCD and can scale back the power consumed by the backlight by powering it off. But what about the keypad? It must be on at some level and may possibly be on all the time. When someone touches a key, they expect that the backlight that was at half power will be brought to full power. This is a power association.

Devices can have very simple state machines with associated timeouts and will react with an expiring timer to change states. This is reactive power management; power decisions are made based on when the device was last used. Embedded system manufacturers that employ these techniques will immediately see power savings in their devices.

Proactive strategy

Proactive power management is the notion that designers can predict the future. Of course, this is impossible; however, designers can use complex scheduling techniques to predict what the power use will be when the system is in operation. This data can be discovered manually by programming the system with a power use scenario or by dynamically measuring which domains are active and when.

For example, if a system has 10 tasks and all are ready to run, designers can expect that the system will be busy for a while running these tasks. It makes sense to run the CPU at high power. However, which 10 tasks are running might make a significant difference. If designers can establish that every time a certain task is made ready to run (regardless of it actually being scheduled) the system will increase its power usage; then they can use Dynamic Voltage and Frequency Scaling (DVFS) to provide enough cycles to get the job done without wasting electrons. This demonstrates the reasons why in some cases, it is better to consume a bit more power now so as not to degrade the quality of user experience while waiting for power modes to change.

Ecodesign for a greener tomorrow

Device integrators must take a holistic approach to power conservation, starting with hardware and infrastructure enabled to scale back power use and employing software capable of controlling the device's overall power consumption. Core to this approach is a power-aware OS platform combining both reactive and proactive power management techniques. Manufacturers pursuing more power-efficient devices will benefit their customers by giving them improved battery life, all the while leaving a greener legacy to us all.

Stephen Olsen is currently product marketing manager in the Embedded Systems Division at Mentor Graphics, based in San Jose, California. Stephen has more than 20 years of embedded software experience, with a focus on consulting, system architecture, embedded software, and IP. He also cochaired the Virtual Socket Interface Alliance's Hardware-Dependent Software Design Working Group and published several papers on system design. Stephen holds a BS in Physics from Humboldt State University in California.

Mentor Graphics
408-487-7122
stephen_olsen@mentor.com
www.mentor.com

Stephen Olsen (Mentor Graphics Corporation)
Previous Article
Telematics take tolls on the Autobahn

The TU-500 onboard unit enables trucking companies to know exactly where their trucks are at any given moment.

Next Article
FPGAs evolve to meet changing computing needs

FPGAs directly address reconfigurable computing requirements by offering a flexible platform that can keep ...