240 likes | 255 Views
Power Management. Outline. Why manage power? Power management in CPU cores Power management system wide Ways for embedded programmers to be power conscious. Why power management?. Desktops: Lower power bill, lower heat, lower fan noise Laptops, mobile systems: Above + battery life !.
E N D
Outline • Why manage power? • Power management in CPU cores • Power management system wide • Ways for embedded programmers to be power conscious
Why power management? • Desktops: Lower power bill, lower heat, lower fan noise • Laptops, mobile systems: Above + battery life!
Power management tradeoffs • Usually, power consumption is proportional to performance Low performance High performance Low power High power
Main power mgmt goals • Lower I, V • If you’re not using something, turn it off • Try to meet deadlines exactly instead of being too fast
Core power I Inside the core, we are basically charging and discharging capacitances + Vcore - C Q = charge, C = Capacitance, Vcore = Voltage
Let Core power II
Voltage and frequency scaling I Scale voltage and frequency dynamically based on need Intel Speedstep AMD PowerNow!
Voltage and frequency scaling II Voltage and frequency settings for Intel Pentium M processor
Increasing f Increasing Vcc Why scale V & f together? Operation OK Oscillators are not stable at all voltages for a given frequency
Active Power, Performance Latency Power-save Idle Halt Overhead Processor power modes • Many CPUs/systems have several modes of operation • Active, Power-save, Idle, Halt • Latency vs. power tradeoff
Active mode • Processor executes instructions normally • Entire CPU core active
Power-save • Clock circuitry may be disconnected from unused CPU subsystems • CPU not executing instructions • Can usually return to active mode very quickly (several times per ms)
Idle • CPU still not executing instructions • Context may be stored in system memory, CPU registers and cache disabled • Must restore context before resuming execution
Sleep • Entire system context stored to nonvolatile memory upon entering sleep • Power to main memory disabled • Latency very high
PIC 16F877A • SLEEP mode • By executing the SLEEP instruction, the PIC goes into power down mode and draws very little current (μA vs. mA) • Will wake via WDT or external interrupt
Palm OS • Run, doze, sleep • Never really turned off • Run – Executing instructions, returns to doze when finished • Doze – Main clock running, LCD on, CPU not executing instructions • Sleep – Main clock off, LCD off, only user generated interrupt will wake system
Windows XP • Active – computer running normally • Standby – Just enough power to keep contents of RAM, CPU off • Hibernate – Makes image of RAM contents on hard disk • Alter policies through Control Panel -> Power Options on Windows XP
Embedded power mgmt I Use low power modes whenever you can int main(void){ while(1){ … do_stuff(); delay_ms(DELAY); … } } int main(void){ while(1){ … do_stuff(); power_save(); … } }
Embedded power mgmt I • Idle system instead of using delays • Instead of polling lines, configure system to wake up from idle upon an interrupt from that line • If unable to use pin as interrupt, still idle and wake periodically to check status of pin
Embedded power mgmt II Shut down peripherals when possible int main(void){ … if (userinput==FALSE) set_lcd(LCD_BACKLIGHT_OFF); //Turn backlight off if (userpresent==FALSE) set_lcd(LCD_OFF); //Turn LCD completely off … }
GOOD BAD Very small current Not so small current Embedded power mgmt III Don’t allow CMOS inputs to float!
Summary • Buy the right core for the job • Go to low power processor states whenever possible • Power peripherals only when necessary
References • “Dynamic Power Management for Embedded Systems,” IBM and Montavista, November 2002 • “Embedded Power Management,”http://www.embedded.com/story/OEG20030121S0057 • “Palm OS Power Management,”http://www.palmos.com/dev/support/docs/protein_books/SysMgt/PowerManagement.html • “AMD PowerNow! Technology,” AMD, November 2000 • “Low Power Microcontrollers,” NEC, April 2004 • “Microarchitecture and Performance,” Intel, http://www.intel.com/technology/itj/2003/volume07issue02/art03_pentiumm/p11_performance.htm • “Inside DSP on low power,” June 2004, http://insidedsp.eetimes.com/features/showArticle.jhtml?articleID=21400770 • “Power Management Discussion Document,” 3G Lab, February 2001 • “Enhanced Intel SpeedStep Technology for the Intel Pentium M Processor,” Intel, March 2004 • “Bios and Kernel Dev. Guide for AMD Athlon 64 and AMD Opteron Processors,” AMD, April 2004