Let s look at each and begin with a view into the software

Similar documents
Program design and analysis

In examining performance Interested in several things Exact times if computable Bounded times if exact not computable Can be measured

Last Time. Making correct concurrent programs. Maintaining invariants Avoiding deadlocks

Scheduling Mar. 19, 2018

Power Management. José Costa. Software for Embedded Systems. Departamento de Engenharia Informática (DEI) Instituto Superior Técnico

19: I/O Devices: Clocks, Power Management

CPU Scheduling. Daniel Mosse. (Most slides are from Sherif Khattab and Silberschatz, Galvin and Gagne 2013)

Operating Systems. Process scheduling. Thomas Ropars.

Embedded computing system RTOS BASED DESIGN-2

Memory. From Chapter 3 of High Performance Computing. c R. Leduc

LECTURE 5: MEMORY HIERARCHY DESIGN

Chapter 6: CPU Scheduling. Operating System Concepts 9 th Edition

LECTURE 11. Memory Hierarchy

Copyright 2012, Elsevier Inc. All rights reserved.

Computer Architecture. A Quantitative Approach, Fifth Edition. Chapter 2. Memory Hierarchy Design. Copyright 2012, Elsevier Inc. All rights reserved.

Copyright 2012, Elsevier Inc. All rights reserved.

I/O Systems (4): Power Management. CSE 2431: Introduction to Operating Systems

Computer Architecture A Quantitative Approach, Fifth Edition. Chapter 2. Memory Hierarchy Design. Copyright 2012, Elsevier Inc. All rights reserved.

Multi-threading technology and the challenges of meeting performance and power consumption demands for mobile applications

ECE468 Computer Organization and Architecture. Virtual Memory

Implementing Scheduling Algorithms. Real-Time and Embedded Systems (M) Lecture 9

ECE4680 Computer Organization and Architecture. Virtual Memory

Advanced Caching Techniques

Block Device Scheduling. Don Porter CSE 506

Block Device Scheduling

Last Class: Processes

An Overview of MIPS Multi-Threading. White Paper

Power Management as I knew it. Jim Kardach

Cycle Time for Non-pipelined & Pipelined processors

Donn Morrison Department of Computer Science. TDT4255 Memory hierarchies

EI338: Computer Systems and Engineering (Computer Architecture & Operating Systems)

Reducing Hit Times. Critical Influence on cycle-time or CPI. small is always faster and can be put on chip

Ch 4 : CPU scheduling

Chapter 5: CPU Scheduling

CS6303 Computer Architecture Regulation 2013 BE-Computer Science and Engineering III semester 2 MARKS

Computer Science 432/563 Operating Systems The College of Saint Rose Spring Topic Notes: Memory Hierarchy

Titolo presentazione. Scheduling. sottotitolo A.Y Milano, XX mese 20XX ACSO Tutoring MSc Eng. Michele Zanella

Operating Systems Unit 3

Operating Systems Design 25. Power Management. Paul Krzyzanowski

Like scalar processor Processes individual data items Item may be single integer or floating point number. - 1 of 15 - Superscalar Architectures

UNIT:2. Process Management

Scheduling - Overview

Caches. Hiding Memory Access Times

Improving Cloud Application Performance with Simulation-Guided CPU State Management

Block Device Scheduling. Don Porter CSE 506

CS 326: Operating Systems. CPU Scheduling. Lecture 6

Memory Hierarchy Basics. Ten Advanced Optimizations. Small and Simple

Interactive Scheduling

Two Level Scheduling. Interactive Scheduling. Our Earlier Example. Round Robin Scheduling. Round Robin Schedule. Round Robin Schedule

Center for Scalable Application Development Software (CScADS): Automatic Performance Tuning Workshop

Memory Hierarchy. ENG3380 Computer Organization and Architecture Cache Memory Part II. Topics. References. Memory Hierarchy

PDF created with pdffactory Pro trial version How Computer Memory Works by Jeff Tyson. Introduction to How Computer Memory Works

Chapter 8. Virtual Memory

Slide Set 9. for ENCM 369 Winter 2018 Section 01. Steve Norman, PhD, PEng

Memory Hierarchy. Maurizio Palesi. Maurizio Palesi 1

SRAMs to Memory. Memory Hierarchy. Locality. Low Power VLSI System Design Lecture 10: Low Power Memory Design

1. Memory technology & Hierarchy

Control Hazards. Prediction

Lecture #10 Context Switching & Performance Optimization

15-740/ Computer Architecture Lecture 19: Main Memory. Prof. Onur Mutlu Carnegie Mellon University

Main Points of the Computer Organization and System Software Module

Adapted from David Patterson s slides on graduate computer architecture

CS162 Operating Systems and Systems Programming Lecture 14. Caching (Finished), Demand Paging

COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface. 5 th. Edition. Chapter 1. Computer Abstractions and Technology

Computer Basics: Step-by-Step Guide (Session 2)

Computer and Hardware Architecture I. Benny Thörnberg Associate Professor in Electronics

LECTURE 1. Introduction

The End of Redundancy. Alan Wood Sun Microsystems May 8, 2009

CPU Scheduling. Operating Systems (Fall/Winter 2018) Yajin Zhou ( Zhejiang University

Chapter 5: CPU Scheduling

CS 167 Final Exam Solutions

CPU Scheduling. The scheduling problem: When do we make decision? - Have K jobs ready to run - Have N 1 CPUs - Which jobs to assign to which CPU(s)

Memory Hierarchy Basics

Process- Concept &Process Scheduling OPERATING SYSTEMS

Computer Systems C S Cynthia Lee Today s materials adapted from Kevin Webb at Swarthmore College

Tasks. Task Implementation and management

COEN-4730 Computer Architecture Lecture 3 Review of Caches and Virtual Memory

ENGN1640: Design of Computing Systems Topic 06: Advanced Processor Design

Embedded Systems Dr. Santanu Chaudhury Department of Electrical Engineering Indian Institute of Technology, Delhi. Lecture 23 Embedded OS

Chapter 19: Real-Time Systems. Operating System Concepts 8 th Edition,

CS370: System Architecture & Software [Fall 2014] Dept. Of Computer Science, Colorado State University

CS162 Operating Systems and Systems Programming Lecture 16. I/O Systems. Page 1

CS 31: Intro to Systems Caching. Kevin Webb Swarthmore College March 24, 2015

Memory Hierarchy. Slides contents from:

Hardware-Software Codesign

Embedded processors. Timo Töyry Department of Computer Science and Engineering Aalto University, School of Science timo.toyry(at)aalto.

Handout 4 Memory Hierarchy

VIRTUAL MEMORY READING: CHAPTER 9

CPU Scheduling: Objectives

Introduction to Operating Systems Prof. Chester Rebeiro Department of Computer Science and Engineering Indian Institute of Technology, Madras

CS370 Operating Systems

CS Computer Architecture

CS24: INTRODUCTION TO COMPUTING SYSTEMS. Spring 2018 Lecture 23

Example: CPU-bound process that would run for 100 quanta continuously 1, 2, 4, 8, 16, 32, 64 (only 37 required for last run) Needs only 7 swaps

Mainstream Computer System Components CPU Core 2 GHz GHz 4-way Superscaler (RISC or RISC-core (x86): Dynamic scheduling, Hardware speculation

Scheduling. Today. Next Time Process interaction & communication

Superscalar Processor Design

Lecture 18: Memory Hierarchy Main Memory and Enhancing its Performance Professor Randy H. Katz Computer Science 252 Spring 1996

COP 5611 Operating Systems Spring Dan C. Marinescu Office: HEC 439 B Office hours: M-Wd 2:00-3:00 PM

Lecture 14: Cache Innovations and DRAM. Today: cache access basics and innovations, DRAM (Sections )

Transcription:

Power Consumption Overview In this lesson we will Identify the different sources of power consumption in embedded systems. Look at ways to measure power consumption. Study several different methods for managing power consumption. Introduction Today more and more embedded applications Targeted towards Small hand held or other types of portable devices Common thread through all such applications Need to have long battery life Translates to low power consumption Power consumption can be attacked in several ways Certainly hardware solution Low power devices Turning portions of system off ACPI Advanced Configuration and Power Interface Surprisingly have software contribution as well Let s look at each and begin with a view into the software Software There are a number of places that we can attack From software point of view Initial places to look The algorithms that we use Location of code Memory accesses can have significant impact on power Using software to control subsystems As we have been stating To analyze then control particular aspect of performance Must be able to measure that aspect Both before and after modification - 1 of 11 -

Measuring Power Consumption For the moment Will assume goal is to reduce power consumed by processor Processor can be stand alone or softcore on FPGA To such an end Measuring power consumption is two step process 1. Identify the portion of code to be analyzed Typically this will be a loop Doesn t need to be Measure the current consumed by the processor While the code is being exercised 2. Modify the loop such that the code comprising the loop is disabled Ensure that the compiler hasn t optimized loop out Measure the current consumed by the processor Once we have identified power consumed Next step is to try to reduce if appropriate Studies have identified several software factors That contribute to processor power consumption Among the contributors we find The kind of instruction The collection or sequence of instructions executed The locations of the instructions and their operands Memory system and transfers in and out Have been shown to be most expensive operation Performed by processor Here memory is referring to main memory not cache This is the DRAM in our system Hierarchy will typically look like Main Cache Registers Cache is high speed memory and is closer to the processor - 2 of 11 -

Using simple addition operation as reference we find Operation Relative Power Consumption 16 Bit Add 1 16 Bit Multiply 3.6 8x128x16 SRAM Read - Cache 4.4 8x128x16 SRAM Write - Cache 9 I/O Access 10 16 Bit DRAM Memory Transfer - Main 33 Evident from table Using cache can have significant affect on power consumption Assumes a cache hit Cache miss requires main memory access SRAM generally consumes more power than DRAM On per cell basis Cache is generally SRAM Want to optimize size of cache\ Want smallest that provides desired performance Almost becomes empirical trade-off Other optimizations 1. Power aware compilers Take an instruction level view of problem Modify schedule of bus activity Bus drivers consume a lot of power 2. Use registers efficiently Bring value into register and leave there for reuse Don't move in and out Read / write operations 3. Look for cache conflicts and eliminate if possible Conflicts are data or instructions That must be moved in or out of cache For instruction conflicts Rewrite if possible May have to move code Scalar data conflicts - 3 of 11 -

Move data to different locations Arrayed data Move to alternate location Change access pattern 4. Unroll loops Must be careful that unrolled loop doesn t result in cache misses 5. Eliminate recursive procedures or repeated function calls where possible Eliminates overhead of function call Hardware Another technique for managing the power consumption In embedded applications Draws from familiar schemes used at home Turn off the portions of system not being used Such a scheme has been used for years In space program Satellites Orbital and interplanetary Shuttle Earlier Mercury, Gemini, Apollo Therein hardware Battery powered Must be recharged Done via solar panels of one form or another Today can fly from Seattle to Japan in 14 hours Laptop computer or other such tools Typical battery life 3-5 hour Yep a laptop is still an embedded application We are in continuous race between Battery technology Demand for more and more powerful features All such features require power - 4 of 11 -

Power Management Schemes To begin to address problem As part of design Formulate power management strategy On one extreme Turn power off In such state Power consumption limited to leakage As with other metrics Sets a lower bound on consumption Opposite extreme Power to all parts of system on and all parts operating In such state Power consumption approaches maximum Such condition sets upper bound Softer than lower bound See earlier discussion on software affects Goal is somewhere in middle Governed once again by requirements specification Based upon such a goal We segregate system components into two categories Those that must remain powered up Referred to as static components Those that may be powered down Referred to as dynamic components Such a scheme sounds simple and is at the high level Like everything else we are doing We have certain trade-offs We must 1. Decide which portions of the system to power down These may be All dynamic components Subgroups based up need or not need 2. Recognize that components cannot be shut down instantly 3. Recognize that components cannot be powered up instantly - 5 of 11 -

These factors can be expressed with a simple first cut graphically as Power Down Power Power Up Time Let s consider a topographic mapping satellite application As satellite is circling the earth collecting data Data is sent to ground station at known points in orbit When over appropriate station No reason to keep transmitter powered up When not in position to transmit Further timing of orbit known with sufficient resolution Know in advance when will need to transmit After passing ground station Shut down transmitter Re-enable shortly before reaching next download point Locations of each ground station known in advance 1. Such fixed schedule scheme is among simplest Can be very effective Observe similar to Round robin schedule with no preemption 2. Next level of sophistication Recognize that schedule may not be fixed Problem now moves from deterministic to probabilistic Use knowledge of Current history Understanding of problem To anticipate when to shut dynamic portions of system down Denoted predictive shutdown Observe that such a scheme commonly used in Branch prediction logic in instruction prefetch pipeline - 6 of 11 -

Managing if-else constructs Using such a scheme Subject to shutdown or restart too early 3. Related idea Rather than set schedule Control algorithm with associated timer Monitors activities of devices to be dynamically controlled If timer expires Device is powered down Device reactivated on demand We ve already used such a scheme in a watchdog timer 4. Next level of sophistication Draws from basic queuing theory Under such a scheme we have A resource or producer Service provided by system whose power is being controlled A consumer Portion of the system that needs the service A queue of service requests A power manager Monitors behaviour of system Producer Consumer Queue Can build schedule using Markov modeling Statistical technique Forecast future behaviour of variable or system Who's current state of behaviour Does not depend upon past Random like flipping an honest coin Approach maximizes System computational performance While satisfying specified power budget - 7 of 11 -

Simple data / control flow diagram appears as Command Power Manager State Information Producer Queue Consumer Let s look at an example of simple power management Queue Queue of requests for power Consumer Issues requests for power Operating system responsible for dynamically controlling power In simple I/O subsystem Dynamically controlled portion Supports two modes Off and On Dynamic subcomponents Terminology joule = 1 watt sec power = joule / sec Consume 10 watts when on and 0 watts when off 10 watts when on then in 25 sec since always on 10 watts 25 sec = 250 joules - 8 of 11 -

Switching 2 seconds and 40 joules Switch from OFF state to ON state 1 second and 10 joules Switch from ON to OFF Request has period of 25 seconds Graphically we illustrate 3 alternative schemes Observe that we have the same average throughput Substantially reduced power consumption Policy Always ON Reactive Greedy Power Aware Energy Consumed in 25 sec 250 J (10 x 25 sec) (10 when on x 25) 240 J (40+10+10)x2 (60x4) 140 J (70 x 2) Average Latency Per Request 1 sec 3 sec (2+1)x4/4 2.5 sec (2+1)/2 +1 5. Advanced Configuration and Power Interface ACPI Industry standard power management Initial application was to PC More specifically windows Currently targeted to wider variety of operating systems Standard Provides some basic power management facilities Provides interface to the hardware Software more specifically the operating system on a system Provides power management module It is the responsibility of the OS Specifying the power management policy for the system - 9 of 11 -

The operating system uses the ACPI module To send required controls to the hardware Monitor the state of the hardware As input to the power manager We express the scheme in the following Block diagram State diagram Devide Drivers Applications Kernel ACPI Driver AML Interpretater Tables ACPI Registers ACPI Bios Power Management Hardware Platform Standard supports five global power states 1. G3 hard off or full off Defined as physically off state System consumes no power 2. G2 soft off requires full OS reboot to restore system to full operational condition Substates S1 low wake-up latency Ensures no loss of system context S2 low wake-up latency state Has loss of CPU and system cache state S3 low wake-up latency state All system state except for main memory is lost S4 lowest power sleeping state All devices are off 3. G1 sleeping state System appears to be off Time required to return to working condition Inversely proportional to power consumption - 10 of 11 -

4. G0 working state in which system is fully usable 5. Legacy state a. System does not comply with ACPI Trade-offs Often times performance is optimization issue Involves trading several contradictory requirements Speed Memory size Cost Weight Power Time must be spent up front to thoroughly understand Application Constraints Summary In this lesson we Identify the different sources of power consumption in embedded systems. Look at ways to measure power consumption. Study several different methods for managing power consumption. - 11 of 11 -