workload prediction based on supply current tracking : a fuzzy … · workload prediction based on...

123
Workload prediction based on supply current tracking : a fuzzy logic approach Citation for published version (APA): Pourshaghaghi, H. R. (2013). Workload prediction based on supply current tracking : a fuzzy logic approach. Technische Universiteit Eindhoven. https://doi.org/10.6100/IR759388 DOI: 10.6100/IR759388 Document status and date: Published: 01/01/2013 Document Version: Publisher’s PDF, also known as Version of Record (includes final page, issue and volume numbers) Please check the document version of this publication: • A submitted manuscript is the version of the article upon submission and before peer-review. There can be important differences between the submitted version and the official published version of record. People interested in the research are advised to contact the author for the final version of the publication, or visit the DOI to the publisher's website. • The final author version and the galley proof are versions of the publication after peer review. • The final published version features the final layout of the paper including the volume, issue and page numbers. Link to publication General rights Copyright and moral rights for the publications made accessible in the public portal are retained by the authors and/or other copyright owners and it is a condition of accessing publications that users recognise and abide by the legal requirements associated with these rights. • Users may download and print one copy of any publication from the public portal for the purpose of private study or research. • You may not further distribute the material or use it for any profit-making activity or commercial gain • You may freely distribute the URL identifying the publication in the public portal. If the publication is distributed under the terms of Article 25fa of the Dutch Copyright Act, indicated by the “Taverne” license above, please follow below link for the End User Agreement: www.tue.nl/taverne Take down policy If you believe that this document breaches copyright please contact us at: [email protected] providing details and we will investigate your claim. Download date: 04. Feb. 2021

Upload: others

Post on 30-Sep-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

Workload prediction based on supply current tracking : a fuzzylogic approachCitation for published version (APA):Pourshaghaghi, H. R. (2013). Workload prediction based on supply current tracking : a fuzzy logic approach.Technische Universiteit Eindhoven. https://doi.org/10.6100/IR759388

DOI:10.6100/IR759388

Document status and date:Published: 01/01/2013

Document Version:Publisher’s PDF, also known as Version of Record (includes final page, issue and volume numbers)

Please check the document version of this publication:

• A submitted manuscript is the version of the article upon submission and before peer-review. There can beimportant differences between the submitted version and the official published version of record. Peopleinterested in the research are advised to contact the author for the final version of the publication, or visit theDOI to the publisher's website.• The final author version and the galley proof are versions of the publication after peer review.• The final published version features the final layout of the paper including the volume, issue and pagenumbers.Link to publication

General rightsCopyright and moral rights for the publications made accessible in the public portal are retained by the authors and/or other copyright ownersand it is a condition of accessing publications that users recognise and abide by the legal requirements associated with these rights.

• Users may download and print one copy of any publication from the public portal for the purpose of private study or research. • You may not further distribute the material or use it for any profit-making activity or commercial gain • You may freely distribute the URL identifying the publication in the public portal.

If the publication is distributed under the terms of Article 25fa of the Dutch Copyright Act, indicated by the “Taverne” license above, pleasefollow below link for the End User Agreement:www.tue.nl/taverne

Take down policyIf you believe that this document breaches copyright please contact us at:[email protected] details and we will investigate your claim.

Download date: 04. Feb. 2021

Page 2: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

Workload Prediction Based on Supply Current Tracking:

A Fuzzy Logic Approach

PROEFSCHRIFT

ter verkrijging van de graad van doctor aan de Technische Universiteit Eindhoven, op gezag van de rector magnificus prof.dr.ir. C.J. van Duijn,

voor een commissie aangewezen door het College voor Promoties, in het openbaar te verdedigen op woensdag 2 oktober 2013 om 16:00 uur

door

Hamid Reza Pourshaghaghi

geboren te Teheran, Iran

Page 3: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

Dit proefschrift is goedgekeurd door de promotiecommissie:

voorzitter: prof.dr.ir. A.C.P.M. Backx 1

e promotor: prof.dr. J. Pineda de Gyvez

2e promotor: prof.dr.ir. R.H.J.M. Otten

copromotor: dr.ir. L. Jozwiak leden: prof.dr.ir. P.M.J. Van den Hof

Prof.dr. G. Setti (University of Ferrara, University of Bologna) dr. S. Cotofana (Delft University of Technology)

adviseur: dr. H. Fatemi (NXP Semiconductors)

Page 4: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

i

Workload Prediction based on Supply Current Tracking:

A Fuzzy Logic Approach

Page 5: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

ii

This work was supported under project number 07857 “Synthesis and Implementation of Adaptive Energy-Aware Circuits and System” by the Dutch Technological Science Foundation STW.

© Hamid Reza Pourshaghaghi, 2013 All rights reserved. No part of this document may be photocopied, reproduced, stored, in a retrieval system, or transmitted, in any form or by any means whether, electronic, mechanical, or otherwise without the prior written permission of the author.

Printing: Printservice Technische Universiteit Eindhoven

CIP-DATA LIBRARY TECHNISCHE UNIVERSITEIT EINDHOVEN

Pourshaghaghi, Hamid Reza

Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach / by Hamid Reza Pourshaghaghi. – Eindhoven : Technische Universiteit Eindhoven, 2013. A catalogue record is available from the Eindhoven University of Technology Library ISBN 978-90-386-3452-4 NUR 959 Subject headings: workload prediction / fuzzy logic predictor / low power / dynamic voltage and frequency scaling / embedded systems.

Page 6: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

iii

Summary Reducing supply voltage and clock frequency of VLSI chips are important keys to save power and energy in a digital circuit. It has been demonstrated that dynamic voltage (and frequency) scaling DVS (DVFS) leads to a considerable savings in dynamic and static power of a digital processor. The processor needs a specific minimum of the supply voltage and clock frequency to correctly operate without sacrificing any timing-constraints or deadlines. Maximum power savings are achieved when the supply voltage (and accordingly the clock frequency) are adjusted based on the processor’s workload. Due to the existence of some delays in adjusting the voltage and frequency values in a closed loop DVFS system, the prediction of the workload activity is of utmost importance. Essentially, miss-estimation of the workload variations causes a failure of the task. One way of measuring the workload activity in a circuit is to observe the average of the supply current. In this thesis, a fuzzy logic predictor is designed to accurately and robustly predicts and tracks the average of the supply current of digital processors. The proposed fuzzy logic predictor tracks the average of the supply current without updating any parameter during its run-time prediction. The problem of the supply current tracking is comprehensively formulated in this thesis by presenting a new definition over the supply current prediction, which is different from the conventional definition of the concept prediction in statistics theory. Based on the new definition, the predicted value of the supply current value must be always greater than the measured value to ensure the correct operation of the processor in a DVS system. To track the average of the supply current, the derivative of the current variations is used to predict one step-ahead current value. Also a robustness guardband is designed to protect the circuit against any possible miss estimation of the current value. This fuzzy predictor can be used to adjust the supply voltage and the clock frequency of the processor based on the workload variations.

The stability analysis of the closed loop DVS system containing the fuzzy controller and the digital processor is studied in this thesis. To analyze the stability of the DVS system, first, the frequency-domain models (transfer functions) of the fuzzy controller and the processor are obtained. Then by using these transfer functions and utilizing the Popov theory; it has been proved that the fuzzy controller guarantees the asymptotic stability of the DVS system.

Several simulations were performed to prove the effectiveness of the proposed fuzzy prediction when compared to other existing conventional methods e.g. PID controllers, nonlinear/linear system identification methods, polynomial and exponential estimations. The results show that the proposed fuzzy predictor outperforms other existing methods even though the fuzzy predictor is an on-line predictor, which does not need to be updated for every new current profile. Unlike the other predictors, the fuzzy controller is a task-agnostic predictor and can be used for both stationary and non-stationary workload variations. In a fuzzy DVS system, the predicted signal of the current variations is used to dynamically adjust the supply voltage values. However, the predicted signal of the supply current does not necessarily result in achieving the minimum possible power consumption.

Page 7: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

iv

To use the fuzzy predictor for DVS applications, several practical issues should be taken into account. Some of these issues are: the accuracy of the current sensor to measure the average of the supply current, the resolution of the analogue to digital converter to make the current signal available for the fuzzy predictor, the accuracy of the prediction w.r.t. the fuzzy time, the accuracy of the voltage (and frequency) actuators, and the delay of each component used in the circuit to perform DVS (from the moment of measuring a current value to the moment of adjusting a new voltage value). The fuzzy predictor is used as a fuzzy controller that takes care of all those practical issues and that ensures the correct operation of the processor. The fuzzy predictor was tested out on a dual processor circuit and was evaluated under several real-time experiments. In the dual processor system, the applications run in the first processor, while, the fuzzy controller runs in the second processor. By observing the average of the supply current of processor 1, digitalizing it, and sending it to processor 2, the fuzzy controller dynamically adjusts the supply voltage of processor 1 by predicting the supply current. The experimental results of implementing the fuzzy controller on four different applications demonstrate considerable power savings. The fuzzy controller was successful with run-time tracking of the current in all experiments. All the practical issues that the fuzzy controller should face with them have been examined in this thesis.

A new nonlinear controller is also presented in this thesis. It is used in multi-core systems to control inter-processor buffer sharing. The presented method is based on the sliding-mode feedback control theory. This controller has strong capabilities to deal with unpredicted disturbances and with the nonlinearity behavior of the system under control. By observing the queue occupancy in between the processors and comparing it with the reference value, the sliding-mode controller adjusts the supply voltage and/or the clock frequency values. The sliding-mode controller can be used for various applications e.g. DVS, or to compensate for the process, voltage and temperature PVT variations in multi-core systems. In this thesis, a supervisory sliding-mode controller is designed to dynamically adjust the speed of a dual-processor system. The stability of the sliding feedback controller is proved by Lyapunov theory, as well as the experiments.

The presented fuzzy based control technique in this thesis has been used for workload monitoring and/or voltage adaptation. Also the prediction properties of the proposed technique can be used for other applications e.g. adaptive body bias scaling, leakage control, temperature control and etc. The fuzzy controller can also be upgraded by adding more input information data to improve its performance.

Page 8: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

v

Samenvatting Het verminderen van de voedingsspanning en klokfrequentie van VLSI- chips zijn belangrijke middelen om vermogen en energie in een digitale schakeling te reduceren. Het is aangetoond dat dynamische schaling van spanning (DVS) en frequentie (DVFS) kan leiden tot een aanzienlijke besparing in dynamisch en statisch vermogen van een digitale processorkern. De processorkern heeft een bepaald minimum van de voedingsspanning en klokfrequentie nodig om te kunnen werken zonder concessies te doen op deadlines. Maximale energiebesparing wordt bereikt wanneer de voedingsspanning (en dienovereenkomstig de klokfrequentie) zijn aangepast op basis van de werklast van de processorkern. Omdat er enige vertraging zit in het instellen van de spanning- en frequentiewaarden in een gesloten-lus DVFS-systeem, is de voorspelling van de werklastactiviteit van groot belang. In wezen zal een verkeerde schatting van de werklast-variatie voor het mislukken van de taak zorgen. Een manier om de werklastactiviteit in een circuit te meten is om het gemiddelde van de voedingsstroom te observeren. In dit proefschrift is een fuzzy logic voorspeller ontworpen die nauwkeurig en robuust het gemiddelde van de voedingsstroom van digitale processorkernen te voorspellen en te volgen. De voorgestelde fuzzy logic voorspeller volgt het gemiddelde van de

voedingsstroom zonder parameters bij te werken tijdens zijn run-time voorspelling. Het probleem van het volgen van de voedingsstroom is uitgebreid geformuleerd in dit proefschrift door een nieuwe definitie te geven van de voedingsstroom voorspelling. Deze definitie verschilt van de gebruikelijke definitie van het begrip voorspelling in de statistiek. Op basis van de nieuwe definitie moet de voorspelde waarde van de voedingsspanning altijd groter zijn dan de gemeten waarde om de juiste werking van de processorkern in een DVS systeem te waarborgen. Om de gemiddelde voedingsstroom te volgen is de afgeleide van de stroomvariatie gebruikt om de volgende waarde te voorspellen. Er is ook een guardband voor robuustheid ontworpen om het circuit te beschermen tegen een mogelijke verkeerde schatting van de stroom. Deze fuzzy voorspeller kan worden gebruikt om de voedingsspanning en klokfrequentie van de processorkern aan te passen naar variaties in de werklast.

De stabiliteitsanalyse van het gesloten-lus DVS-systeem met daarin de fuzzy regelaar en de digitale processorkern wordt bestudeerd in dit proefschrift. Om de stabiliteit van het DVS-systeem te analyseren worden eerst de frequentiedomein modellen (overdrachtsfuncties) van de fuzzy regelaar en processorkern bepaald. Vervolgens is bewezen - door de overdrachtsfuncties en de Popov-theorie te gebruiken - dat de fuzzy regelaar de asymptotische stabiliteit van het DVS-systeem garandeert.

Verschillende simulaties zijn uitgevoerd om de effectiviteit van de voorgestelde fuzzy voorspeller te bewijzen in vergelijking met andere bestaande conventionele methoden zoals PID-regelaars, lineaire/niet-lineaire systeem-identificatiemethoden en polynomen en exponentiële schatters. De resultaten tonen aan dat de voorgestelde fuzzy voorspeller beter presteert in vergelijking met andere bestaande methoden. Dit terwijl de fuzzy voorspeller een online voorspeller is die niet hoeft te worden bijgewerkt voor elk nieuw stroomprofiel. In tegenstelling tot de andere voorspellers is de fuzzy regelaar

Page 9: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

vi

een taak-onafhankelijke voorspeller en kan hij worden gebruikt voor stationaire en niet-stationaire werklastvariaties. In een fuzzy DVS-systeem worden de voorspelde stroomvariaties gebruikt om de spanningswaarden dynamisch aan te passen. Echter, het voorspelde gedrag van de voedingsstroom leidt niet noodzakelijkerwijs tot het bereiken van het minimale stroomverbruik.

Om de fuzzy voorspeller te gebruiken voor DVS applicaties moeten verschillende praktische problemen bekeken worden. Sommige van deze problemen zijn: de nauwkeurigheid van de gemiddelde voedingsstroom meting van de stroomsensor, de resolutie van de analoog naar digitaal omvormer om het stroom signaal beschikbaar te maken voor de fuzzy voorspeller, the nauwkeurigheid van de voorspelling met betrekking tot de fuzzy tijd, de

nauwkeurigheid van de voltage (en frequentie) aandrijvers, en de vertraging van elk van de componenten gebruikt in het circuit om de DVS uit te voeren (van het moment van de stroommeting tot het moment van het aanpassen van de voltage). De fuzzy voorspeller is gebruikt als een fuzzy regelaar die al deze praktische problemen afvangt en er voor zorgt dat de processorkern correct opereert. De fuzzy regelaar is getest voor een systeem met twee processorkernen, waar de applicaties draaien op de eerste processorkern, terwijl de fuzzy regelaar de tweede processorkern gebruikt. Met behulp van het observeren van de gemiddelde voedingsstroom van processorkern 1, het digitaliseren daarvan, en het doorsturen van deze waarde naar processorkern 2, kan de fuzzy regelaar zich dynamische aanpassen aan de voedingsstroom door het voorspellen van de voedingsstroom. The experimentele resultaten een fuzzy regelaar implementatie voor vier verschillende applicaties laten significante reducties in vermogen zien. De fuzzy regelaar was succesvol in het

volgen van de run-time stroomwaarde voor alle experimenten. Alle praktische problemen die de fuzzy regelaar kan tegenkomen zijn behandeld in dit proefschrift.

Dit proefschrift beschrijft ook een nieuwe niet-lineaire regelaar. Hij wordt gebruikt in systemen met meerdere processorkernen om het delen van buffers tussen processorkernen te beheren. De voorgestelde methode is gebaseerd op de schuif-modus terugkoppelregeltechniek. Deze regelaar is geschikt om om te gaan met onverwachte verstoringen en niet-linear gedrag van het te controleren systeem. Door het observeren van de bezettingsgraad van de wachtrijen tussen processorkernen en het te vergelijken met de referentiewaarde, past de schuif-modus regelaar de voedingsspanning en/of klokfrequentie waarden aan. De schuif-modus regelaar kan worden gebruikt voor verschillende toepassingen zoals DVS of ter compensatie van proces, spanning en temperatuur variaties in systemen met meerdere processorkernen. In dit proefschrift wordt een toezichthoudende schuif-modus regelaar ontworpen om de snelheid van een systeem met twee processorkernen dynamisch aan te passen. De stabiliteit van de terugkoppelregelaar blijkt zowel uit de Lyapunov theorie en uit experimenten.

De in dit proefschrift gepresenteerde fuzzy regeltechniek is gebruikt voor werklast en/of spanningsaanpassingen. De voorspellingen van de voorgestelde techniek kunnen ook worden gebruikt voor andere toepassingen zoals het adaptief schalen van body-bias, lekstroomregeling, temperatuurregeling etc.

Page 10: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

vii

De fuzzy regelaar kan ook verder worden ontwikkeld door meer invoerinformatie toe te voegen om zo de prestaties te verbeteren.

Page 11: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

viii

.

Page 12: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

ix

Acknowledgements This thesis officially ends another chapter of my life, being a “PhD student”. A chapter filled with memories and challenges. Looking back at it all, I feel blessed to have had many supportive and positive people in my work and personal life, who have constantly challenged and encouraged me to move forward and improve myself as an engineer as well as an individual.

My deepest appreciation goes to José Pineda de Gyvez, for his guidance and care. He opened to me the door to opportunities and under his supervision and forever constructive feedbacks I felt more mature and more independent every day. José is a very unique person; I’d like to share in here some of his motivational quotes: “we work for the glory and bright”, “a sheep walks in the group and a lion walks alone” (when I was working alone disappointed by some unresolved issues), “you are young and fresh, work harder!” (when I asked to take vacation time!). Every Thursday, in our weekly meetings, which I named the “Hard-Talk”, he pushed me forward by brain storming ideas with me, discussing all the designs thoroughly in detail and giving me an outlook of the general path and the future plans for my project. These were very practical meetings. Jose’s charismatic personality enabled him to get his students to go beyond the standards. I definitely feel the positive influence of his mentoring and couching in myself; He always shared with me his valuable experiences and all these things help me every day to progress forward in my professional life. José, I feel privileged to have worked with you, and I appreciate all your hard work and novelties.

I’d also like to thank Ralph Otten as my promoter. Although I didn’t have the privilege to work too closely with him, I still learned many things both technically and ethically. His attitude and commitment to his profession is plausible and rare in our world. His blunt comments and feedbacks have always helped me see things more clearly. Having been his TA in the 5AA72 course, I really enjoyed working with him and learned many things from him.

Lech Jóźwiak, my daily supervisor, was always available to discuss with me issues raised in my project. He gave me a lot of moral support and his kindness and patience created a warm and healthy environment for me to work and to explore. I’d like to express gratitude for giving his precious time to reading my scripts and providing me with many comments.

To me, Marja de Mol and Rian van Gaalen are the best secretaries ever! They are very kind, helpful, fast and responsible. I would like to acknowledge them not only as the secretaries, but as my friends. Rian, you kindly initiated the “Nederlands Uurtje” for us with so much enthusiastic efforts. The kindness of your heart and soul touched me time after time. Thanks a lot!

My invited PhD committee members are gratefully acknowledged for reading my thesis, providing useful comments and being present in my defense session. It is my privilege to have Paul Van den Hof, Gianluca Setti, Sorin Cotofana, and Hamed Fatemi in my thesis committee.

I would like to thank following people for all the resourceful technical discussions we had about my research: Henk Corporal, Jos Huisken, Hamed Fatemi, Martijn koedam, Sebastian Moreno, Alexandre Nery, Alexandar

Page 13: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

x

Milutinovic, Juan Diego Echeveri, Majid Nabi, Morteza Damavandpeyma, Firew Siyoum, Marc Geilen, Karthik Chandrasekar, Francesco Comaschi, Sahar Foroutan, Davit Mirzoyan, Rosilde Corvino, Cedric Nugteren, Marcel Steine, Yifan He, Gert-Jan van den Braak, and Raymond Frijns.

After finishing my PhD project, I started working with Marc Klein-Wolt and Heino Falcke at Radboud University as a post-doc researcher. I am very excited about this position and am looking forward to the work I’ll be doing with these gentlemen.

Aside from all the support I received at university, I also thank my many friends who’ve created many priceless memories for me.

I remember the first days of my immigration to the Netherlands. New country, new language, new people, new culture; and I was unfamiliar with them all. The transition to this new environment could have been very difficult, exhausting and possibly depressing had I not been supported by old friends. Hamid and Hoda helped me out too much during that time, and I owe them a big thank you for it. Majid, Hamed, Amirhosein, Mohammad and Sogol also helped me out a lot. Their company felt like a home away from home and we created many good memories together.

Kudos to all the rest of my friends for simply being there for me and helping me forget about all the hardships of life. There are many people to mention and a page is simply not enough for them all. I’m lucky to be surrounded by so many good souls. They are a grand group of gems.

A big difference between being a PhD candidate and being in the work force comes in the freedom level of it. When working on PhD, you are free to take as many breaks as you like, and we definitely exercised our right to our breaks. Along with the fellow members of the ES group, I had a few thousands coffee breaks during my PhD years. In these breaks, we discussed many different topics, politics, jokes, cultural differences, etc. Oh, I will miss these breaks dearly.

A very fun part of my life as a PhD candidate has been the futsal games we played every Saturday and Wednesday evening. This hobby has been a permanent activity in my schedule and it always boosted up my energy level, physically and mentally. It was a great way of staying connected with my cool and athletic friends. I will always remember all the ups and downs our team went through in the table of scores each season!

Last but certainly not least, I want to give my extended thanks to my loving family. I am grateful for having my beautiful wife, Marzieh, by my side. She is smart, strong, and patient. My Mom, Dad, Shohreh (and her family), Mohammad-Reza (and his family), and Ashraf (and her family) have all filled me with love unconditionally. Amir, Zahra, Mahsa, Mohammad and Khadijeh, have also given me support time after time. You are part of my heart and I love you all.

Hamid Pourshaghaghi

September 2013

Page 14: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

xi

Contents Summary ............................................................................................................ iii

Samenvatting ....................................................................................................... v

Acknowledgements ............................................................................................ ix

Contents ............................................................................................................. xi

1 Introduction ...................................................................................................... 1 1.1 Principles of the Workload-Based Dynamic Voltage and Frequency

Scaling (DVFS) ......................................................................................... 1 1.2 Survey of Workload-Based Dynamic Voltage and Frequency

Techniques ............................................................................................... 3 1.3 Problem Statement of a Fuzzy Logic Supply Current Predictor ..... 7 1.4 Contributions ................................................................................... 8 1.5 Thesis Outline ............................................................................... 11

2 Fuzzy-Controlled Voltage Scaling Based on Supply Current Tracking ......... 13 2.1 Overview ....................................................................................... 13 2.2 Supply-Current Based Workload Tracking ................................... 13

2.2.2 Supply Current Tacking System Description ................... 14 2.2.3 Supply Current Tracking System Model .......................... 15

2.3 Fuzzy-Based Configuration for Tracking of the Supply Current

Variations ............................................................................................... 16 2.3.1 Fuzzy Set Theory and Fuzzy Logic Controllers ............... 16 2.3.2 Proposed Configuration of Fuzzy DVFS System Based on

Supply Current Tracking .............................................................. 17 2.3.3 Sampling of Supply Current ............................................. 18

2.4 Fuzzy Logic Supply Current Predictor Design .............................. 20 2.4.1 Membership Function Modeling ...................................... 20 2.4.2 Fuzzy “If-Then” Rules to Perform an On-Line Supply

Current Tracking .......................................................................... 22 2.4.3 Output of the Fuzzy Supply Current Tracking ................. 25

2.5 The Necessary Requirement for Supply Current Tracking ........... 27 2.5.1 Rational Expressions about the Necessary Robustness

Guard Band .................................................................................. 27 2.5.2 Design of the Robustness Guard Band for the Fuzzy-

Predictor ....................................................................................... 28 2.5.3 Calculation of the fuzzy robustness guard band for the

Supply Current Tracking .............................................................. 29 2.6 Analysis and Stability Proof of the Closed Loop System .............. 31 2.7 Summary ....................................................................................... 36

Page 15: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

xii

3 Experimental Results and Practical Issues ................................................... 37 3.1 Overview ....................................................................................... 37 3.2 Simulation Results and Discussions ............................................. 37

3.2.1 Simulation Setup .............................................................. 38 3.2.2 Design of Non-Fuzzy Supply Current Predictors ............. 38 3.2.3 Analysis and Comparison of Simulation Results ............. 46

3.3 Experimental Results and Practical Issues ................................... 51 3.3.1 Experimental Setup ......................................................... 51 3.3.2 Software-Based Fuzzy Logic Predictor for the Supply

Current Tracking .......................................................................... 53 3.3.3 Sampling of the Supply Current ....................................... 56 3.3.4 Resolution of the Supply Voltage Actuator ...................... 62 3.3.5 Calculation of the Robustness Guard Band .................... 63 3.3.6 Number of Supply Current Membership Functions ......... 64 3.3.7 Power Savings Results .................................................... 66

3.4 Summary ....................................................................................... 68

4 Sliding-Mode Control to Compensate PVT Variations in Dual Core Systems

.......................................................................................................................... 69 4.1 Overview ....................................................................................... 69 4.2 Introduction ................................................................................... 69 4.3 Problem Description in a Dual-Core Architecture ......................... 70 4.4 Sliding-Mode Feedback Controller ................................................ 71

4.4.1 Individual State-Space Model for Buffer .......................... 72 4.4.2 Modeling of PVT Variations and Uncertainties ................ 73 4.4.3 Design the Sliding-Mode Feedback Controller ................ 73

4.5 Results .......................................................................................... 77 4.5.1 FPGA Implementation of the Two-Processor Controlled

System ........................................................................................ 80 4.6 Summary ....................................................................................... 82

5 Forward Looking ............................................................................................ 83 5.1 Research Contributions ................................................................ 83 5.2 Outlook and Suggestions for the Future Research ....................... 84

References ....................................................................................................... 89

Curriculum Vitae ............................................................................................... 93

List of Publications ............................................................................................ 95

Appendix ........................................................................................................... 97 VHDL Implementation of the Fuzzy Logic Predictor .............................. 97

A.1 Implementation of the Fuzzification Stage ............................ 98

Page 16: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

xiii

A.2 Rule Evaluation: Implementation of the Fuzzy Inference

System ......................................................................................... 99 A.3 Implementation of the Defuzzification Stage ....................... 100 A.4 Synthesis Results ................................................................ 103

Reader’s Notes ............................................................................................... 105

Page 17: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

xiv

Page 18: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

1Introduction

Power consumption is one of the primary concerns in modern high performance processors, digital circuits and systems on chips (SoCs). While CMOS technology has been scaling towards smaller feature sizes, the performance of digital systems and the clock frequency of using them have been quickly increasing. Also the computational workload and hence the activity of a digital circuit may change substantially; it exposes a lot of breakthroughs in the exploitation of adaptive low power systems. One key for reducing power consumption of a digital circuit or a processor is to reduce its supply voltage and clock frequency according to the performance requirements and the workload variations. Over the years, researchers have proposed different techniques to construct software and/or hardware based power management units. Out of all those techniques, dynamic voltage and frequency scaling (DVFS) is widely recognized as one of the most effective system-level power management techniques [1]. In this Chapter, a brief overview of the principles of DVFS is presented, followed by a review of existing design approaches and the motivation of this research. The Chapter closes by elaborating the main contributions of this work, and organization of the thesis.

1.1 Principles of the Workload-Based Dynamic Voltage and Frequency Scaling (DVFS)

The power consumption of a clocked digital CMOS circuit can be represented by the well-known formula:

(1-1)

where is the power consumption, is the total switched capacitance,

is the supply voltage, is the clock frequency and is the off-state current of the circuit. Depending on the workload variations and performance demands of a circuit, considerable power can be saved by reducing its supply voltage and clock frequency. The general block diagram of a dynamic supply voltage and frequency scaled system is shown in Figure 1-1. It consists of three main components. The first component is a performance sensor that monitors the main specifications of the processor (e.g. the critical path monitor, or the workload variation sensors or the supply current sensors). In the second component, the DVFS controller, then adjusts voltage and frequency based on the input data received from the sensors. The adjustment happens by comparing the data with the reference performance received from the power management hardware or software unit. The third block includes a supply voltage and a clock frequency actuator. The voltage actuator can be an on-chip or off-chip device, e.g. a LDO or DC-DC converter, and the clock frequency

P =

Page 19: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

1. Introduction

2

actuator can be a PLL. Since there is a strong correlation between the workload of a processor and the supply current [2][3], in this thesis dynamic voltage scaling is examined based on the observation and tracking of average supply current. In all voltage regulators, switching between the voltage output levels takes a few tens of microseconds. For switching voltage and frequency in a safe manner, voltage and clock frequency changes may not be done in parallel. If the supply current is to decrease, the frequency should be decreased first, and subsequently, the voltage should be lowered to the appropriate value. On the contrary when the demand for supply current increases the circuit requires increase of the voltage first, followed by the frequency update. This ensures that the voltage supplied to the processor is never less than the minimum voltage required for the necessary operating frequency. Otherwise data corruption can occur due to a circuit timing failure.

Circuit Under ControlInput Data

DVFSVdd

Actuator

Performance

sensors

Performance

Refrence

Vdd

Output Data

Fck

Figure 1-1 General block diagram of a DVFS system

In a DVFS system, optimum power savings can be achieved by adequately adjusting the supply voltage according to the circuit’s switching activity and/or the workload variations. Therefore, adequate estimation of the workload variations is crucial in a DVFS system. Changes in the supply voltages do not occur instantaneously because some delays are involved in the large capacitance of the supply rails. One main challenge in the design of a DVFS system is therefore to measure and to predict the workload of a processor before changing the supply voltage or the clock frequency accurately. Hence the efficiency of DVFS strongly depends on the accuracy of the workload estimation, and its misestimating can substantially reduce the effectiveness of DVFS systems [4].

There are two main approaches to design DVFS systems. One approach is to control the supply voltage through monitoring of the delay of the chip’s critical path. The supply voltage is set to a minimum value at which the chip is able to operate for a given clock frequency. For example, an on-chip critical path monitor is used in a hardware feedback loop to adjust supply voltage and clock frequency [5]. This approach targets the worst case conditions, and accordingly, determines the processor parameters. Another approach is to take a further step in power saving by adjusting the voltage and frequency through workload estimation of the processor; hence providing the minimum supply voltage and frequency necessary for correct operation of the processor in a

Page 20: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

Workload Prediction Based on Supply Current Tracking

3

given workload. In the next Section, a short review of the adaptive power management methods based on workload estimation of processors is presented, followed by an overview of existing dynamic voltage scaling DVS and DVFS design approaches.

1.2 Survey of Workload-Based Dynamic Voltage and Frequency Techniques

Dynamic voltage (and frequency) scaling DVS (DVFS), as a strong technique for power consumption reduction, has been extensively studied over the last years. Here, some DVS and DVFS techniques are highlighted that combine the estimation of the workload variations with the performance requirements.

Many of the conventional DVFS techniques are related to the task level (known as inter-task level DVFS and intra-task level DVFS) techniques and require either application, compiler or operating system support. These techniques mostly deal with the worst-case execution time (WCET) or the average-case execution time (ACET) as the estimation of the target performance for a given application. Hence, many different algorithms are presented to estimate performance requirements and accordingly adjust supply voltage and clock frequency. For example, one of the earliest works was presented in [6], where for a given task, the arrival time, deadline of the task, and task execution time based on the CPU cycle are assumed to be constant. Then, after formulation of the corresponding energy consumption problem, a feasible off-line scheduling technique was proposed to adjust the clock frequency and to minimize energy consumption of the task. As another example, the work presented in [7] considered a real time system where tasks arrive periodically with specific deadlines; then scheduling of the tasks on a single processor is comprehensively studied, based on variable clock frequencies. To give one hardware implementation example, in [5] a ring oscillator is used as a replica of the critical path to model the delay of the CMOS circuit for a given supply voltage. Output frequency of the ring oscillator is compared with the desired frequency, and then the supply voltage is adjusted by a frequency-voltage feedback loop. A voltage scheduler, responsible for predicting workload to estimate the number of the CPU cycles, obtains the desired frequency. This desired frequency is set by the operating system. In fact, to determine the clock frequency, the critical path is taken into account, and hence always, some slack time exists to save more power. Moreover, the workload of the task executed varies from time to time, which results in a different kind of slack time. In [8] moreover the worst case, variable slack time is also taken into account for power reduction. In this technique, the relationship between clock frequency and supply voltage is measured by off-line experiments and is stored as a look-up table. The task is partitioned into several pieces, called timeslots (and the supply voltage is controlled on the timeslot-by-timeslot basis).

This technique and other similar techniques that use the workload variations at the task level can be categorized as intra-task DVS methods. Usually, in intra-task DVS techniques, the workload variations are estimated to dynamically

Page 21: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

1. Introduction

4

determine the performance in the middle of the task execution, let say by where is the estimated remaining workload and is the time to deadline. In the task-level DVFS methods, some statistical workload predictions are reported in [9][10], where cumulative distribution functions (CDF) and probability distribution functions (PDF) are used to model the run time distribution of a given task. In both techniques, by using distribution functions, each program region has its own specific CDF or PDF function for DVFS purposes. These distribution functions are obtained through either off-line profiling or online monitoring for the stationary workloads (periodic). Several more workload estimations in the task level DVFS, have been presented in [6][11][12]. In [11][12] a numerical solution for workload predictions is presented to achieve the minimum average energy consumption. And in [6], the statistical methods are used to minimize energy based on mathematical formulations.

In parallel to the task level workload-estimation based DVFS techniques, recently, system level workload-estimation based DVFS techniques have also been extensively studied. One of the earliest work in system-level DVFS is presented in [13]. In this work, buffer utilization is measured to accordingly adjust the supply voltage and the clock frequency in a stream-based processor. The proposed architecture in [13] is shown in Figure 1-2. When the utilization of the FIFO is close to full, the processor should speed up; and in contrary, when the utilization is close to empty, the processor can slow down.

Figure 1-2 Utilization of the FIFO is a direct measure of the workload in a stream-based processing [13]

Similar configuration has been used in [14] for adjusting supply voltage to reduce power consumption in digital signal processors DSPs. The structure of the proposed system architecture in [14] is same as the one presented in [13]. Like in the self-timed variable voltage system of [13], input data is buffered into a FIFO type buffer to enable averaging of the workload. Then, the feedback loop controls the processing rate to avoid queuing overflow and underflow of the FIFOs. The controller in this methodology consists of a voltage regulator, ring oscillator, rate-compare block and programmable look-up table (LUT). The controller decides to change the voltage and frequency based on the processing rate and LUT contents.

In [15] adaptive filters are used to predict workload variations in DVFS applications. The generic block diagram of the proposed technique in [15] is

Processor

FIF

O

FIF

O

RE

G

RE

G

Control

Stream In Stream Out

CLK

Vd

d

Fc

k

Page 22: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

Workload Prediction Based on Supply Current Tracking

5

shown in Figure 1-3. In this Figure, various events that have to be executed by the processor are shown in the task queue model. An operating system scheduler is necessary to manage timing priorities in these different tasks. In Figure 1-3, the workload rate at each event arriving at the processor is shown as to . In this system, the power management unit monitors the processing rates and accordingly adjusts the supply voltage and the clock frequency values. The operating system measures the idle cycles and computes the

workload . Depending on the current workload , and a history of the workload variations, power management unit determines the processing rate value. For each observation slot, the processing rate, r, is used to decide about the operating voltage and frequency for the next observation slot.

As mentioned, the prediction strategy is based on observing the current workload and a history of the workload variations. Assuming that the observation period is , is the average normalized workload in the

interval , then at the time , the processing rate for the next observation slot is decided as follows:

(1-2)

where is a n-tap of an adaptable FIR filter whose coefficients are updated in every observation interval. Updating of coefficient happens by comparing the processing rate, which is set by the workload prediction, and the actual value of

the workload. To obtain , four different adaptive filters are examined: Moving Average Workload (MAW), Exponential Weighted Averaging (EWA), Least Mean Square (LMS), and Expected Workload State (EWS). According to the presented results, adaptive LMS filtering method is concluded to use as the workload predictor.

Figure 1-3 Block diagram of the DVS processor system presented in [15] using an adaptive LMS filtering to predict the workload variations

In [16], an adaptive workload estimator based on Kalman-Filter is designed as a DVS technique in applications with soft real-time constrains e.g. MPEG decoder or other similar multimedia applications. The overall architecture of the proposed estimator is shown in Figure 1-4.

Variable Voltage

Processor

DC

-DC

Co

nv

ert

er

Wo

rklo

ad

Mo

nit

or

Task queue

1

2

n

)(rddV w )(rf

r

Page 23: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

1. Introduction

6

Figure 1-4 Adaptive Kalman-Filter based estimator architecture proposed in [16]

This configuration works as follows. Once the processor receives task(s) to execute, the estimator adjusts the voltage and frequency level in order to achieve power savings by exploiting the idle time of each task and computing workload variations. In the configuration, the timer module is used to measure the actual processing time of each task’s workload and to send it to the observer module. The observer module receives the actual processing time information from the timer, as well as some additional workload information (e.g., start/end time and workload type) from the multimedia tasks. Then the observer module, for the correction of the estimation errors, calculates various statistics parameters e.g. the average, variance, and error covariance. These statistical parameters are sent to the adaptive filter module. By using the error information provided by the observer module and the measurement updates, adaptive feedback controller estimates the workload processing and corrects error covariance. Adaptive feedback controller is based on the Kalman-Filter method. In this research, the results of Kalman-filter based workload estimator are compared to the results of four other estimators.

In [17], another control-theoretic approach to predict future workload variations is presented. The schematic of the proposed structure in this work is shown in Figure 1-5. In this work, a mathematical modeling for the dynamic voltage scaling system based on CPU utilization is presented. Depending on the measured utilization and its reference value, the future utilization value is predicted. The power management unit is designed based on a proportional-integral-derivative (PID) controller. In an ideal DVS system, the error signal obtained by comparing the measured utilization value and its reference value should be zero. Therefore, PID controller is designed to reduce the amount of this error value as much as possible. By observing the error value and adjusting the PID coefficients, an estimated utilization is obtained, and the clock frequency and the supply voltage of the processor are updated in every control interval time. It is obvious that for each application, the reference utilization should be obtained by off-line profiling and the PID coefficients have

Multimedia Contents (Video, MP3, etc)

MPEG decoder

(or other multimedia applications)

Streaming data

DVS

module

Timer Observer

Error info.

Adaptive Filter

(Kalman Filter)

Co

ntr

ol

sig

na

l

Estimation

Streaming info.

(start, type, etc.)

Page 24: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

Workload Prediction Based on Supply Current Tracking

7

to be updated by the designer. The framework presented in [17], is a software based PID controller, which is only applicable on soft real-tasks.

Figure 1-5 The proposed schematic of the control-theoretic dynamic voltage scaling presented in [17]

The same PID-based structure shown in Figure 1-5 has been used in [18] to estimate CPU utilizations. Also in [19], a PID controller is used for DVFS of processors running interactive 3D game applications. In [19], PID controller is used to predict the workload variations of game applications. The PID coefficients are adjusted manually to achieve the optimal performance. Some other examples of using the PID-based controller to estimate workload variations are presented in [20] and [21]. In [20] and [21], PID controller has been used for the video processing applications. In these works, video frames are buffered and the buffer occupancies are used as the primary inputs to the feedback PID controller.

Despite the PID controller is an adaptive technique, it suffers from possible overshooting and undershooting, depending on the selected coefficients. Also using the PID controller for workload estimation purposes is useful when the coefficients are selected for specific workload trends; but if the trend changes, the coefficients should be defined again based on the new workload variations. Hence, the tuning of coefficients critically determines the prediction accuracy.

It is also worth to mentioning that, apart from DVFS purposes, there are some other strong estimation methods that use off-line profiling to, first, model a system, and then, use it for the forecasting purposes [32]. Time series analysis [22], system identification methods [23], and model predictive control approaches [24] are examples of these techniques.

1.3 Problem Statement of a Fuzzy Logic Supply Current Predictor

In the field of low power digital circuit design, dynamic voltage and frequency scaling is one of the most effective methods to save power consumption. To design a strong DVS/DVFS-based power management unit, the prediction of workload variations plays the critical role. As it was reviewed in the previous Section, the workload estimation and adaptive control methods became one of the main challenges in the design of efficient DVS-DVFS systems. Most of the known methods used to estimate workload variations rely on off-line data profiling. Moreover, a few of them are designed for on-line workload tracking besides that they are application specific. The main

Power Manager

(PI Controller)

Embedded Processor

Control Task

Reference Utilization

Measured

Utilization

Page 25: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

1. Introduction

8

drawback of the off-line methods is that the prediction accuracy strongly depends on the data used for training. Therefore, when the application is changed, the model has to be adequately updated. The goal of the on-line prediction technique is that the desired workload tracker adapts its parameters using a set of input data, and also tunes them in each time interval. The re-tuning of the tracker/predictor with different shapes of workload variations is a crucial problem for all the earlier proposed on-line methods applied for dynamic voltage and frequency scaling goals.

In this thesis, a new prediction technique based on fuzzy logic theory is

presented to control the supply voltage and if necessary the clock frequency based on supply current tracking. In this thesis, the activity of the circuit is acquired by measuring the average of the supply current. The fuzzy prediction technique takes into account the workload activity based on sensing the average of the supply current. In fact, the fuzzy technique is an on-line predictor of the average of supply current when a processor executes a specific application. Therefore, the fuzzy predictor presented in this thesis, represents a fully dynamic technique that is able to estimate and track the activity of the circuit and to adjust the supply voltage. The proposed fuzzy predictor can track all kinds of supply current profiles independent from the type of the application or task being executed by the processor. The most important goals in the design of a fuzzy DVS/DVFS technique are: 1) how to predict and track the average of supply current variations, and 2) how to drive the processor to operate at the lowest possible voltage and maximum corresponding performance [25]. In other words, in an ideal DVFS, the supply voltage variations are the same as the average of the supply current variations, while the clock frequency is obtained based on the delay-voltage model of the processor. Also any miss-predictions in the supply current tracking must be taken into account to avoid providing a wrong supply voltage adjustment. In the next Section, the main contributions of this thesis are highlighted w.r.t. the earlier mentioned techniques.

1.4 Contributions

This thesis makes several contributions to the state-of-the-art of workload-estimation based DVFS techniques. The following are the most important ones:

1- As mentioned earlier, most of the proposed DVFS methods are based on adjusting the power supply according to the estimated performance. To have a clear view on how does the proposed technique in this thesis outperform the conventional methods, let’s consider as an example. The relation of the normalized operating frequency versus the supply voltage of a sample processor shown in Figure 1-6. Imagine a specific application is running with a

constant frequency at its nominal supply voltage . Now suppose that the performance requirement is such that there is an opportunity to save power by reducing the supply voltage. The procedure can be as the existing DVFS methods have already proposed: depending on the required performance, one can switch the supply voltage and the frequency values among all the possible pairs e.g. (1.2V,191MhZ), (1V,124Mhz), and (0.8V,56Mhz), as shown in Figure 1-6. In this thesis, a novel fuzzy-based

Page 26: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

Workload Prediction Based on Supply Current Tracking

9

technique is proposed to adaptively adjust the supply voltage based on workload variations, even if the frequency is fixed at the maximum value. For instance, in the performance spread of the processor shown in Figure 1-6, when the clock frequency is fixed at 124 MHz, the supply voltage can be adjusted between considering workload variations. Therefore, the processor can work at its highest performance while the supply voltage is adjusted (based on the workload) to minimize power consumption.

The supply current of a processor is given as

(1-3)

where is the activity of the circuit and is the total circuit’s capacitance.

Depending on the activity , the proposed fuzzy logic controller adjusts accordingly the supply voltage. Therefore, the processor has always the minimum enough supply current to execute the task in real-time. The proposed current-tracking fuzzy controller is the only of all famous techniques that truly tracks the activity of the processor and that adjusts the supply voltage to save maximum power consumption.

Figure 1-6 Performance spread of a sample processor in 90nm Technology

2- Another main property of the proposed fuzzy controller in DVFS is that the proposed technique is application agnostic. It does not require any coefficient tuning or off-line profiling. Moreover, the proposed fuzzy controller can accurately estimate and track any kind of current variations without any prior information about the nature of the supply current profile. This is a big advantage of the fuzzy logic predictor over all the other conventional prediction methods.

3- In this thesis, the supply current estimation problem has been formulated based on a new definition of the current prediction. The meaning of “prediction” known in statistics theory is modified for dynamic voltage scaling purposes. Following to the new definition, the predicted value of the supply current should always be greater than the measured value. This guarantees that the

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

1.1

0.5 0.6 0.7 0.8 0.9 1 1.1 1.2 1.3

Voltage-Frequency (at Temp. 25 C)

VDD=1.2VFck=191 MHz

VDD=1.0VFck=124 MHz

No

rma

lize

d fre

qu

en

cy

VDD=0.8VFck=56 MHz

Supply Voltage (V)

Page 27: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

1. Introduction

10

processor works with a correct value of the supply voltage. The proposed fuzzy technique is an on-line current predictor that also can be used for other applications. Moreover in this thesis, the tracking properties of the fuzzy predictor are compared to five other existing methods. Those examined predictors are the following: nonlinear system identification modeling, linear system identification modeling, polynomial estimator, exponential estimator, and PID controller. The tracking properties are evaluated based on three criteria: 1) Sum of the negative errors (SNE) which ensures that the processor works with a correct supply voltage value, 2) RSQ which determines how much a predictor successfully tracks current variations, and 3) Power Savings (PS) in case the predictor is used for DVS purposes.

4- In this thesis, the stability analysis of the fuzzy logic controller for DVS goals is studied based on the Popov theory. In this analysis, the nonlinear model of the fuzzy logic system is approximated by a linear multilevel relay input-output function; also modeling of an equivalent RC circuit approximates the frequency-model of the processor. This stability analysis explains that the supply voltage values obtained by the fuzzy logic controller guarantee the correct operation of processors in the DVS closed loop systems.

5- In this thesis, the proposed fuzzy controller is used for DVFS purposes in both a single processor architecture (hardware-based DVFS) and a dual-processor system (software-based DVFS), as shown in Figure 1-7. The use of DVS in system on chips SoCs results in a substantial power reduction, particularly dynamic power. However, depending on the operating voltage e.g. at sub-threshold, the leakage power sometimes dominates. Therefore, DVS cannot be very efficient to cope with the leakage increase. Alternatively, a dynamic voltage and threshold scaling (DVTS) approach can deliver the best solution to both the dynamic and the leakage power management. The proposed fuzzy technique can easily be upgraded by adding new rules to improve the performance. Another example of the application of the proposed fuzzy-logic controller, apart from dynamic voltage scaling based on supply current tracking, is that it can be used to adjust body bias voltages when the input represents the delay of the circuit [26].

6- In this thesis, a software-based fuzzy dynamic voltage scaling is implemented and all practical aspects of its implementation were analyzed. These practical considerations are termed as: resolution of the supply voltage actuators, sampling time of the supply current measurement, accuracy of the fuzzy controller (predictor), protection of DVS system against the noise of the measurements and miss-estimation of current values, and finally the delays of all components involved in the DVS loop from the moment of sampling the current till changing the supply voltage to a new value by fuzzy controller. All these practical issues are comprehensively discussed in Chapter 3. The experimental results of applying the fuzzy controller on a dual-processor circuit are also reported in Chapter 3.

Page 28: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

Workload Prediction Based on Supply Current Tracking

11

Figure 1-7 Proposed architecture for a low power processor based on proposing fuzzy logic supply current predictor

7- In this thesis, the application of the fuzzy logic controller in a multi-core architecture is also presented. The use of a multiprocessor architecture instead of a single-processor architecture typically results in more power savings. The operating supply voltage and clock frequency determined through DVFS are not always reliable, due to the fact that they are prone to process, voltage and temperature (PVT) variations. In [27][28], it has been shown that parameter variations pose a major challenge for the design and reliability of high performance microprocessors in nanometer technologies. Also, due to a higher impact of memory latency and bandwidth on the overall throughput, multi-core processors are essentially less variation tolerant than single core processors [29][30]. Therefore, in this thesis a technique to control the nominal behavior of system parameters -supply voltage and clock frequency- is proposed to attain the optimum performance in the low power multi-core systems. This technique is based on a sliding-mode controller and, in fact, it is a supervisory feedback controller for fuzzy DVFS to reject the impact of PVT variations. Unlike other existing works in this research area [31], the proposed sliding-mode feedback law guarantees the stability of the system against PVT variations. The stability of the dual-core architecture is analyzed in this thesis and proved based on the Lyapunov method. For this purpose the state-space model of the dual-core system is obtained and a sliding-mode feedback rule is designed to compensate for PVT variations [Chapter 4].

1.5 Thesis Outline

The thesis is organized as follows. Chapter 2 discusses the supply current estimation problem and a new definition of the supply current prediction. The necessary requirement for a safe current tracking is also presented in Chapter 2. The design of a fuzzy logic predictor for a robust supply current tracking is given in this Chapter as well. Also the stability analysis of the proposed fuzzy system is reported in Chapter 2. A robustness guard-band is also designed in Chapter 2 for fuzzy supply current tracking. Chapter 3 discusses the experimental results of the fuzzy predictor implementation. The prediction accuracy of the fuzzy system is compared to the other already well-known prediction methods. In this Chapter, all the

ProcessorFuzzy

Controller

BUS

Data

MemoryInput

MemoryOutput

Memory

Program-

Memory

Core 1

Application

Core 2:

Fuzzy

Controller

Current

Voltage

Page 29: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

1. Introduction

12

practical issues of the fuzzy DVFS technique implementation are also extensively analyzed. The fuzzy predictor is implemented in a dual processor circuit and all the corresponding practical issues are studied in Chapter 3. In Chapter 4, a low power dual-core system is modelled and the theoretical conditions under which the system is controllable are identified. Also a supervisory sliding-mode controller is presented in Chapter 4 to modify supply voltage and clock frequency values obtained by fuzzy DVFS to cope with process, voltage and temperature (PVT) variations. Chapter 5 concludes this thesis and gives recommendations for the future works.

Page 30: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

2Fuzzy-Controlled Voltage Scaling Based on

Supply Current Tracking

2.1 Overview

In this Chapter, a fuzzy logic predictor (controller) that accurately and robustly tracks supply current variations of digital processors is presented. The proposed predictor tracks supply current variations without updating any parameter during its run-time prediction. It can be used to adjust the supply voltage and clock frequency of digital processors based on workload variations when accounting for timing-constraints and other practical requirements. In this Chapter, first, the supply current tracking problem is modeled based on a new definition about the prediction concept in DVFS. Then the fuzzy logic controller is designed to predict the average of the supply current variations. Additionally, the stability analysis of the closed loop DVFS configuration is examined by approximating the model of the fuzzy controller and the digital processor. It will be proved that the fuzzy controller guarantees the asymptotic stability of the closed loop DVFS system. A robustness guard band will also be designed to protect the circuit against any possible miss-estimations of the current values. This band guarantees the correct operation of the fuzzy DVS system.

In this Chapter, the theory behind the design of the fuzzy predictor is presented and in the next Chapter the experimental results and all the related practical issues will be comprehensively discussed.

2.2 Supply-Current Based Workload Tracking

In this Section, first a short introduction about workload prediction based on the average of supply current tracking is presented. Then, supply current tracking model is presented are formulated. This model will help to have a better understanding about the design of a dynamic voltage scaling system based on current prediction. Also the current model will be used to design a fuzzy logic-based DVS configuration in the next Sections.

2.2.1 Preliminaries

As already mentioned, the main challenge is how to predict the average of supply current in a circuit under control, say a processor, and also how to drive the DVFS controller such that the processor operates at the lowest possible voltage and corresponding minimum frequency. Essentially, if the average of supply current can be tracked in a proper way, the processor’s supply voltage and clock frequency can be well adjusted in accordance to a predicted supply current signal.

Page 31: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

2. Fuzzy-Controlled Voltage Scaling Based on Supply Current Tracking

14

Basically, one can reason about an average workload by observing the supply current variations [2][3]. The relation of the supply current with the supply voltage and the clock frequency is mentioned in equations (2-1) as:

(2-1)

Observe in the current formula that the dynamic current linearly depends on the switching activity, which in turn relates to the processor’s workload characteristics for the task that is being executed. When a processor executes more operations, the switching activity increases and therefore the processor needs more supply current to keep executing the application. Likewise, dynamic current increases if the processor operates at an increased speed. For example, Figure 2-1 shows the measured supply current of a processor when it executes a periodic (Mpeg2-decoding) application. In Figure 2-1, one can observe that when the processor works in its high workload mode, it needs a high average supply current. Conversely, when it switches to work into a low workload mode, the required average supply current reduces accordingly.

Figure 2-1 Supply current profile of a processor when it executes a periodic application. Each deadline equals to the time needed for finishing necessary processing

2.2.2 Supply Current Tacking System Description

Workload based DVFS consists of scaling voltage and frequency based on performance variation demands. To perform a faultless voltage scaling based on supply current tracking, two important points must be taken into account: 1) the predicted voltage should be changed before the moment in which the supply current is about to increase. If the tracker (predictor) acts earlier than the positive slope of the changing current then it is easier for the

Time (ms)

deadline4

675

725

775

825

875

925

975

0 33 66 99 132 165

Current (uA)

Time (ms)

deadline5

Workload [%]

deadline1 deadline2 deadline3

idle

processing

period

average of current

Page 32: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

Workload Prediction Based on Supply Current Tracking

15

voltage and frequency actuators to act sooner to adjust the new voltage and frequency values. 2) the predicted voltage should be changed just after the moment in which the current is about to decrease. Figure 2-2 illustrates the concept of the correct and wrong supply current tracking. Therefore, the supply current prediction means differently with regards to the conventional definition of the prediction theory. Now let’s formulate the supply current tracking system as in the next subsection.

Figure 2-2 A conceptual illustration of an online supply current tracking: A) Incorrect prediction and tracking B) Correct prediction; This can be considered as a new definition of

supply current prediction

2.2.3 Supply Current Tracking System Model

To formulate the supply current tracking model for dynamic voltage scaling DVS purposes, let us consider the following notations for the rest of this thesis:

: Stands for the measured supply current value; and is the set of supply current measurement points available from time to time :

(2-2)

: Stands for the output estimation value of the current predictor

Robustness guard band considered for all possible errors during the current prediction (and also to protect the circuit against any voltage and/or frequency changes). This will be discussed more in this Chapter and also in the rest of thesis.

: Stands for the “final predicted value” as one-step ahead prediction of the measured supply current ( ), considering all the possible protections (e.g. miss-

estimation of the predictor). In another words, is the final value that should be scaled in order to change the supply voltage based on supply current tracking.

Predicted track

Su

pp

ly C

urr

en

t

t

current

Predicted track

Su

pp

ly C

urr

en

t

t

current

(B)(A)

Page 33: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

2. Fuzzy-Controlled Voltage Scaling Based on Supply Current Tracking

16

Consider a tracking system as the one shown in Figure 2-3 consisting of three different signals: 1) a scalar input supply current signal , 2) a scalar

predicted output signal and 3) an additive output term representing the robustness guard band. Let us assume that the system is time invariant since the output response to a certain supply current signal does not depend on an absolute time. Moreover, let us consider that all the observations and are defined in a discrete time. Using the above notations, a supply current tracking system model is as follows (2-3).

{

(2-3)

where represents the general function (or model) to compute the output

tracking signal , based on different supply current scenarios. This function could be either a linear model or a nonlinear one, depending on the desired complexity and demanding accuracy.

Based on the supply current tracking model of (2-3), the aim is to design an on-line predictor to estimate a one step-ahead current value based on a history of the available current data mentioned in (2-2).

Figure 2-3 Supply current tracking system

2.3 Fuzzy-Based Configuration for Tracking of the Supply Current Variations

In this Section, the structure of the fuzzy logic current predictor in a DVFS system is described and in the next Section, the fuzzy predictor will be designed.

2.3.1 Fuzzy Set Theory and Fuzzy Logic Controllers

Fuzzy logic controllers (FLCs) have been successfully applied to many practical applications due to their advantages over conventional controllers: Fuzzy controllers are cheaper to develop, they cover a wider range of operating conditions, and they have a simple computational structure [33]. They are especially applicable when (1) there is no exact mathematical model of the system that has to be controlled, and (2) there exists experienced human designers who can suitably define the system by qualitative control rules. A brief definition of fuzzy set theory is given as next.

Tracking System

represented by nonlinear

function f{.} or linearized transfer

function

( )

( ) ( )

Page 34: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

Workload Prediction Based on Supply Current Tracking

17

Definition1 (based on [34]) -Suppose that defines a collection of elements ,

then a fuzzy set in is defined as a collection of ordered pairs ( ) as:

(2-4)

where is also called a universe of discourse, i.e. the set of all possible

elements with respect to a fuzzy concept, and is the membership function of is the grade (or degree) of the membership in .

Preprocessing PostprocessingFuzzification Defuzzification

Rule base

Fuzzy Inference

System

(FIS)

Figure 2-4 Internal structure of a fuzzy logic system/controller

In general, a fuzzy system is composed of four main components as it is shown in Figure 2-4 [34]: fuzzification interface, fuzzy if-then rules, fuzzy inference mechanism, and defuzzification interface. The fuzzification interface translates the observed crisp input space to a fuzzy set characterized by membership functions. Then, the inference mechanism applies a predetermined set of linguistic rules in the rule-base module with respect to these fuzzy variables, and produces the fuzzy sets of the output linguistic variable based on Definition 1. Fuzzy if-then rules are in the form of “If a set of conditions for the supplycurrent and its derivative are satisfied, THEN a set of consequences for the output prediction signal is inferred”. The fuzzy inference engine is a decision-making module that employs fuzzy rules from the fuzzy sets in the input space to the fuzzy sets in the output space [34]. Finally, the defuzzification interface converts the fuzzy output values to a numeric output value.

This was a brief overview about how a fuzzy system is designed. In the following sections more details about each block in Figure 2-4 for current tracking application will be presented.

2.3.2 Proposed Configuration of Fuzzy DVFS System Based on Supply Current Tracking

The block diagram of the proposed fuzzy dynamic voltage and frequency scaling configuration is shown in Figure 2-5. The proposed fuzzy system for DVFS applications includes a two-input, one output fuzzy predictor in which the average of supply current and its derivative are two fuzzy inputs and the predicted current output signal ( ) is the single fuzzy output. After measuring the inputs, the fuzzy logic controller produces the output signal, which is scalable to the supply voltage. The supply voltage of the circuit can be changed by voltage actuators e.g. a DC-DC converter. Clock frequency values can be determined by a predefined look-up table based on supply voltage values and can be changed by PLLs in the processor. In this configuration, the supply current sensors measure current of the digital circuit. The last two supply

Page 35: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

2. Fuzzy-Controlled Voltage Scaling Based on Supply Current Tracking

18

current values are used to predict the one-step-ahead current value. Note that the derivative of the supply current in each time can be calculated

using . In short, based on the input data, the fuzzy logic predictor, as an expert system, can decide about the next current value.

Figure 2-5 Block diagram of the proposed closed loop FLC for applying dynamic voltage and frequency scaling on a digital CMOS circuit

Based on (2-3), the fuzzy model of the supply current tracker can be represented as

(2-5)

where represents the fuzzy logic operation as a nonlinear function to predict the next supply current value. In this model, after forecasting the next supply current value by the fuzzy predictor, the supply voltage and frequency of the circuit can be adjusted by voltage and frequency actuators. By this technique, we make sure that the determined frequency value is always greater than the frequency obtained by the worst-case execution time.

2.3.3 Sampling of Supply Current

There exists an important timing restriction that should be taken into account when tracking methods like fuzzy predictor are used. Consider the configuration of Figure 2-5, which shows the procedure of sensing the supply current, performing the prediction, changing the supply voltage by a voltage actuator, and adjusting the clock frequency by a PLL. Each operation in this block diagram needs enough time to properly finish its operation. If the

sampling time of the current sensor is denoted by , the time that the fuzzy predictor (or in general any other predictor) needs to operate is denoted

by , the time that the voltage actuator needs to change the supply voltage level is de noted by

, and the time needed for the PLL to change the clock

RI

RI

],[ maxmin VVV

],[ maxmin fffck Digital CMOS

Circuit

Fuzzy Inference

System (FIS)

Membership Functions

Fuzzy Rule Base

Defuzzification Fuzzification)(VFf

Voltage

Actuator

PLL

Page 36: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

Workload Prediction Based on Supply Current Tracking

19

frequency is indicated by , then the minimum necessary timing requirement for the current sensor to sample data is as follows:

( )⏟

(2-6)

where the term ( ) is called the control interval time ( ).

Inequality (2-6) represents the minimum time requirement for sampling the supply current. Also there is a maximum requirement that restricts the current sensor to not miss crucial points of the current signal. The maximum sampling time of the current sensor depends on the supply current variation of the application that is being executed and the latency to execute such measurement. If the supply current variation of application is slowly varying, then the sampling time can be bigger than in the case when the variation rate of supply current is at a higher rate. In general, the sampling time can be determined based on inequality (2-7):

(2-7)

where is the circuit’s clock period and is an arbitrary value that depends

on the latency of the system to acquire a supply current sample. The value should be big enough to ensure that . Selecting bigger sampling times means that the probability of missing some critical points e.g. maximum points in current signal is increased.

Given the unavoidable latency of the closed loop DVFS system, the preferred way of using the fuzzy predictor is in application based configurations, in which the system could warn the fuzzy system of upcoming application tasks to

prevent missing critical points. Within an application task, the guard band in (2-3) can be adjusted to accommodate for the current range of operation.

Page 37: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

2. Fuzzy-Controlled Voltage Scaling Based on Supply Current Tracking

20

2.4 Fuzzy Logic Supply Current Predictor Design

To design a high quality fuzzy system, a designer should define the proper membership functions for the fuzzy inputs and outputs, define fuzzy “if-then” rules, and train the fuzzy system based on a fuzzy inference system to act as an expert fuzzy controller. In [34], all the necessary background to design and implement different kinds of FLCs is presented. In this Section, the fuzzy system is formulated and designed that fulfills precise online workload tracking conditions considering the voltage and frequency scaling requirements.

2.4.1 Membership Function Modeling

Defining membership functions plays an important role in designing a fuzzy logic system. There are three main considerations in the design process of membership functions: 1) the number of partitions for each fuzzy control state over its universe of discourse (UD), 2) the shape of the membership functions in each partition, and 3) UD partitioning including the boundaries and overlaps between partitions. All these factors carry some information about the fuzzy system. There are generally two ways for defining membership functions: expert knowledge and real data. Most of the designers use expert knowledge because of its readiness. However its subjective behavior is a disadvantage for this way. Different shapes of membership functions have been already proposed. Trapezoidal, Sigmoid, Gaussian, Triangular are some of the common shapes for membership functions. Obviously, there exist different mathematical models for the fuzzification of a variable. To simply explain the mathematical formulation of membership functions, and without loss of generality, let us consider only a triangular/trapezoidal membership function. Membership functions can be determined by three parameters: support, boundary and core or prototype, which are shown in Figure 2-6.

Boundary

Core

Support

Boundary

Support

UD UD

Figure 2-6 Membership function parameters in two famous membership functions

Suppose that is the universe of discourse of the supply current ; which means . One can divide into different subsets like as:

(2-8)

where and are lower and upper boundary of the supply current variation ranges respectively.

Page 38: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

Workload Prediction Based on Supply Current Tracking

21

In this definition, it is supposed that the supply current universe of discourse has been divided into partitions and all the current values belong to one or more partitions as (2-9). Indeed these partitions are named “membership functions” in fuzzy system theory.

{ ⋃ ⋃

∩ ≠ ∅ 𝑜

(2-9)

So let us define functions in every partition (or membership function)

as:

0 (2-10)

Consequently, the three mentioned parameters of the membership functions shown in Figure 2-6 can be defined as:

{

𝑜

𝑜

𝑜

(2-11)

Essentially, the parameters defined in the format of the function formulate

the degree of membership functions in the supply current universe of discourse. These formulations take into account the overlap between two adjacent partitions of the membership functions. From (2-9), we have:

(2-12)

Therefore, the overlap between the membership functions is defined as:

(2-13)

where shows the overlap between the and partitions. Obviously we have:

(2-14)

If membership functions for the supply current universe of discourse are defined, therefore overlaps should be defined. Based on (2-14), one should define parameters to model these overlaps. Including the first

and last non-overlaps parameters, and , the set of overlap parameters will be as in (2-15).

Page 39: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

2. Fuzzy-Controlled Voltage Scaling Based on Supply Current Tracking

22

(2-15)

Note that the same formulations can be done for the other inputs or the output of the fuzzy logic predictor. In short, to design a fuzzy predictor moreover the inputs and outputs, one should also determine the number of membership functions ( ), shape of the membership functions ( ), and the

overlaps of the membership functions ( ).

2.4.2 Fuzzy “If-Then” Rules to Perform an On-Line Supply Current Tracking

If membership functions are defined for the supply current and membership functions are defined for its derivative, then rules define the fuzzy logic rule-base block. The rules are defined such that the fuzzy output prediction signal tracks the variations of the supply current in an accurate way as mentioned in Section 2.2.2. The fuzzy inference system (FIS) formulates the

process of computing the fuzzy output ( ) based on the fuzzy inputs ( ), the defined input membership functions and the fuzzy if-then rules. Mamdani FIS is the most commonly useful methodology for applying fuzzy controllers in practical systems. In [34], necessary knowledge to design the Mamdani FIS is presented. For supply current tracking applications, it is recommended to use the “AND” operator for the “Product” stage, the “Minimum” operator for the “Implication” stage, the “Maximum” operator for the “Aggregation” stage and the “Center of gravity COG” method for the “Defuzzification” stage of the Mamdani FIS in the presented fuzzy controller.

To predict supply current variations, the derivative of the current can be computed. Given a specific value for the supply current, if the derivative is positive, it implies that the supply current is increasing. Otherwise, the supply current is decreasing. If more accuracy for the prediction is required, exploiting the second derivative of the supply current is a solution, and therefore the last

three current samples should be measured. Executing different simulations show that using the first derivative of the supply current is adequate to satisfy the requirements for a flawless online tracking. Note that, as it was mentioned in (2-3), the tracked signal should always keep a minimum distance gap with

regards to the supply current , which will be discusses in the Section 2.5.

Now let us review an example to explain how to define fuzzy if-then rules to predict and track the supply current variations. Suppose that the normalized average supply current of a sample processor, when it executes seven different applications sequentially, is like the one shown in Figure 2-7. Nine membership

functions for the supply current and five membership functions for its derivative are defined for this example. Also nine membership functions for the output of the fuzzy controller are defined. Therefore, 45 if-then rules for the fuzzy rule engine should be defined. All the rules have the same weight and all of them are evaluated in parallel. The parallel nature of the rules is one of the most important aspects of fuzzy controllers and results in a fast predictions.

pI

Page 40: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

Workload Prediction Based on Supply Current Tracking

23

Figure 2-7 The normalized average supply current of a sample processor when it executes seven different applications sequentially

The defined membership functions for the supply current, its derivative, and the output signal are shown in Figure 2-8. As mentioned before, one can define a different shape of membership functions e.g. a Gaussian one. A relatively large variation in the form of the particular used function does not influence in a significant way the output result of the designed fuzzy predictor. In these defined functions, all the parameters are normalized and they can be used for different current ranges. Table 2-1 presents the delineated If-then rules, which are used for the Mamdani FIS to train the fuzzy system. Also, the number of qualitative levels that have been used in the fuzzification section depends on the complexity and performance of the controller. Based on the tracking requirements described in Section 2.2.2 and to reveal how the prediction in this definition happens, consider three rules of the Table 2-1 as follows:

1) IF the supply current belongs to I(3) AND the derivative of the supply currentbelongs to Zero, THEN the output belongs to y(3)

2) IF the supply current belongs to I(3) AND the derivative of the supply currentbelongs to DP (positive), THEN the output belongs to y(4)

3) IF the supply current belongs to I(3) AND the derivative of the supply currentbelongs to DPP (strong positive), THEN the output belongs to y(5)

The first rule indicates that when there are no supply current variations, as the derivative is in the zero area, the output of the fuzzy predictor is determined according to the values of the supply current. The second rule shows that if the derivative of the supply current is positive, the output of the fuzzy predictor should be increased as well. Thus, the output prediction signal goes to membership function level 4 when the supply current is in membership function level 3. Moreover, if the increasing rate of the supply current derivative is very high, the output of the fuzzy predictor should increase even more (rule 3) and it could be placed in level 5-membership function.

0 20 40 60 80 100 120 140 160 180 2000.75

0.8

0.85

0.9

0.95

1

Time (msec)

No

rma

lize

d A

ve

rag

e S

up

ply

Cu

rre

nt

One Example of Average Supply Current

Normalized average supply current

Application 2

Application 3

Application 4

Application 5

Application 7

Application 1

Application 6

Page 41: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

2. Fuzzy-Controlled Voltage Scaling Based on Supply Current Tracking

24

Figure 2-8 Inputs and output membership functions (MFs) of the fuzzy logic predictor: A) Supply current is the first input of the fuzzy predictor. Nine MFs are named as I(1), I(2),…,

I(9), B) Derivative of supply current is the second input of the fuzzy predictor, Five MFs are named as DNN, DN, Z, DP and DPP, C) Output of the predictor, it also has nine MFs (same

number as the supply current) named as y(1), y(2),…, y(9).

Now consider the two remaining rules for supply current I(3):

4) IF the supply current belongs to I(3) AND the derivative of the supply currentbelongs to DN (Negative), THEN the output belongs to y(3)

5) IF the supply current is I(3) AND the derivative of the supply current belongs to DNN(Strong Negative), THEN the output belongs to y(2)

These two rules are considered when the supply current is going to decrease since its derivate is negative. Rule 4 indicates that when the derivative is negative the membership function level of the output signal stays in the same membership function level of the supply current. In a normal prediction strategy, as is this case, the membership function of the output signal stays at

I(1) I(2) I(4) I(5) I(6)I(3)

A) MFs of the supply current

1

0

I(7) I(9)I(8)

uA

uA

1

0

DPPDPZDNDNN

B) MFs of the derivative of the supply current

y(1) y(2) y(4) y(5) y(6)y(3)

1

0

y(7) y(9)y(8)

mA/s

C) MFs of the output yt

Z : Derivative Zero

DP : Derivative-Positive

DPP: Strong Positive-Derivative

DN: Negative Derivative

DNN: Strong Negative-Derivative

de

gre

e o

f M

F

for

the

inp

ut cu

rre

nt

current value

de

gre

e o

f M

F f

or

the

de

riva

tive

of th

e in

pu

t

cu

rre

nt

de

gre

e o

f M

F f

or

the

ou

tpu

t p

red

ictio

n

sig

na

l μy

t(j) {

J=

1,.

.,9

}

derivative of current value

output yt

Max

Max

ymax

Min

Min

ymin

Page 42: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

Workload Prediction Based on Supply Current Tracking

25

least one level lower than the membership function level of the supply current. But it is assumed that when the decreasing rate of the supply current derivative is high, the membership function of the output prediction signal stays in a lower level. By applying this strategy, the output prediction signal of the fuzzy predictor tries to act only after the supply current decreases. It should be taken into account that these rules are not unique and it is possible to add more rules related to the second derivative of the supply current variations to predict the supply current changes with more accuracy.

Table 2-1 Fuzzy If-Then Rules (related to the membership functions defined in Figure 2-8); of course this Table is expandable if the number of the membership functions is increased

I(1) I(2) I(3) I(4) I(5) I(6) I(7) I(8) I(9)

DNN y(1) y(1) y(2) y(3) y(4) y(5) y(6) y(7) y(8)

DN y(1) y(2) y(3) y(4) y(5) y(6) y(7) y(8) y(9)

Z y(1) y(2) y(3) y(4) y(5) y(6) y(7) y(8) y(9)

DP y(2) y(3) y(4) y(5) y(6) y(7) y(8) y(9) y(9)

DPP y(3) y(4) y(5) y(6) y(7) y(8) y(9) y(9) y(9)

2.4.3 Output of the Fuzzy Supply Current Tracking

The output values of the fuzzy logic engine are converted into crisp values by the defuzzification process. To obtain the crisp output value of the fuzzy controller, the output fuzzy set must be defuzzified [34]. As in this design the Mamdani FIS and the center of gravity COG defuzzification method are

used, the crisp current output will be computed as

( | ) ∑ 𝑗 𝑗

∑ 𝑗

{ 𝑗

𝑗 (2-16)

where is the number of output membership functions, 𝑗 is the fuzzy output set at time , 𝑗 is the output degree of membership function at

time , and are the minimum and maximum values of supply current. As way of example, let us consider the current profile shown in Figure 2-7. Using the membership functions for two input states as shown in Figure 2-8 and defined through the rules shown in Table 2-1, the supply current tracked signal is shown in Figure 2-9.

In this example, all the requirements of a correct supply current prediction are satisfied by applying the proposed fuzzy logic current predictor. It is obvious from Figure 2-9 that the output signal of the fuzzy controller can track the supply current variations very well as an accurate current tracking.

Page 43: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

2. Fuzzy-Controlled Voltage Scaling Based on Supply Current Tracking

26

Figure 2-9 Normalized average supply current and its normalized tracking signal

Also, the tracking signal is changing sooner than the supply current variation when it is increasing, and changing later than the supply current variation when it is decreasing. There always exists a desired robust gap between the tracked and actual current signal regarding to the robustness nature of the designed fuzzy predictor. The output surface of the fuzzy system is shown in Figure 2-10 where the entire span of the fuzzy output w.r.t. the entire span of the inputs is displayed. Actually Figure 2-10 shows the pseudo continuity of the fuzzy output w.r.t. the variations of the supply current.

Figure 2-10 Output surface of the fuzzy predictor which shows the variation rate of the output based on the two inputs variations

0 20 40 60 80 100 120 140 160 180 2000.75

0.8

0.85

0.9

0.95

1

Time (msec)

No

rma

lize

d S

up

ply

Cu

rre

nt

an

d I

ts T

rac

ke

d S

ign

al

Tracking of Average Supply Current by Fuzzy Logic Tracker

tracking signal

Normalized average supply current

3540

4550

55

-40-20

020

40

40

45

50

Supply-Current uADerivative-of-Current mA/S

Ou

tpu

t-F

uzzy

UA

Page 44: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

Workload Prediction Based on Supply Current Tracking

27

2.5 The Necessary Requirement for Supply Current Tracking

Based on the current tracking model of (2-3) and the prediction concept described in Section 2.2.2, the predicted signal of the current values, always, must be bigger than the measured ones. During the current prediction, it might happen that the predictor makes mistakes and estimate a wrong current value. Therefore, the DVS system should be protected against all possible mistakes in current prediction. Consequently, a strict requirement for supply current tracking should be defined as follows:

Necessary Requirement for Supply Current Tracking- Let be the supply current of the processor at time . Let be the one-step

ahead prediction of . If supply current variations are utilized for dynamic voltage scaling aims, then predicted current value must be

always greater than the measured such that

(2-17)

where represents: 1) the variation of the supply current because of voltage and frequency changes in a certain time , and 2) a robustness guard band to protect the prediction accuracy against any miss-estimations of the current values. Note that is also defined in the model (2-3).

2.5.1 Rational Expressions about the Necessary Robustness Guard Band

The necessary requirement (2-17) presents a strict law for predicting supply current variations. The processor’s supply voltage and clock frequency change according to the supply current prediction value . Since processing a specific application needs enough supply current to be used by the processor to execute a task within a given deadline, a negative tracking error is not permitted as this is an indication of a too low supply current and therefore, a too long execution time. Hence, satisfying the necessary requirement (2-17) guarantees a correct operation of the processor under control to execute a specific application. When the supply voltage increases (decreases) to its upper (lower) level, the supply current increases (decreases) as well. It is required to raise (lower) the supply voltage to overcome a possible performance malfunctioning. The robustness guard band between the actual

and the tracked supply current is denoted as . Figure 2-11 shows an example of a robustness band to guarantee the correct operation of the circuit.

To find an appropriate value for , one can use the relation of the supply current to the supply voltage and frequency as (2-1). Feasible values of

are computed as:

{

(2-18)

Page 45: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

2. Fuzzy-Controlled Voltage Scaling Based on Supply Current Tracking

28

where represents the partial derivative and stands for the control time interval. The value of the robust gap can be added to the obtained value by the fuzzy predictor to make the system robust against possible supply current variations to satisfy the necessary requirement of (2-17).

Figure 2-11 Possible robust distances at different times for the average of supply current tracking – Robustness guard band

2.5.2 Design of the Robustness Guard Band for the Fuzzy-Predictor

As already mentioned, one of the main challenges in a dynamic voltage scaling system is that the supply voltage changes do not occur instantaneously as there are some delays involved in changing up or down the supply voltage [4]. Hence the effectiveness of a DVS system depends on the quality of the workload prediction. A low prediction accuracy reduces the quality of voltage scaling. It is already pre-discussed in Section 2.5.1. that a robustness guard could be a solution to protect the proposed fuzzy DVS system against any possible miss-estimation of current values. The robustness guard value in (2-3) and (2-17) should be defined well enough to compensate for any possiblefaults in the current prediction process. For better understanding of this concept and as a way of example, consider a series of sample current points and their estimated values as the ones shown in Figure 2-12. In Figure 2-12, the current points are identified in the forms of to and the estimated values as , . Assume that the fuzzy predictor has received two input current points to

predict a value for the next current point . Therefore, by observing the value

and considering the fact that there are not considerable deviations in the current history (the derivate of the current is small), the fuzzy predictor will

estimate as the output result of this prediction (again, note that this is just an example to explain the concept and the values are not real). Then by observing

the value and comparing it with estimated , the accuracy of the predicted value is confirmed as the error value (where is the pre-considered robustness guard band). The same prediction procedure will occur

Sam

ple

Cu

rren

t

time

Current

Tracking of Current

Robustness guard band

Page 46: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

Workload Prediction Based on Supply Current Tracking

29

when the fuzzy predictor receives the two inputs of to estimate . In this case, the fuzzy controller does not change the output level since the

derivative value is still in the range of zero and is small. By measuring , the accuracy of prediction is also confirmed. Now to estimate the next

current point ( as the predicted point of ), the fuzzy predictor receives as the inputs. Therefore, when the fuzzy predictor observes a zero

derivative value out of inputs data ( is still small), it will predict the point as the one shown in Figure 2-12. Based on the defined if-then rules, the fuzzy controller, because of a small derivative value, estimates a value in the range of the last point. However in reality an increment has happened in the

current profile and the fuzzy controller is failed to catch it. In this situation is smaller than . The only possible solution to solve this failure during an on-line prediction is to have a bigger robustness guard. For instance defining a robustness guard band as in Figure 2-12 is a good choice to compensate for the error. Now let us calculate a proper robustness guard value for a fuzzy DVS system.

Figure 2-12 Define a proper robustness guard for supply current tracking to compensate for miss-estimation. Note: the values are draw to explain the concept and are not real

2.5.3 Calculation of the fuzzy robustness guard band for the Supply Current Tracking

To apply the fuzzy DVS technique, the necessary requirement of current racking discussed in (2-17) and (2-18) demonstrates that one should always

consider the use of enough robustness guard to protect the circuits against the possible current miss-estimations. Now let us examines how much robustness guard for the supply current predictions needs to be considered in a fuzzy supply current tracking system.

If the designed fuzzy predictor is used for a DVS system, the final output of the

predictor will be used to adjust the supply voltage according to current profile. Let us assume that the clock frequency is fixed and the supply voltage is

adjustable within a certain proper voltage range. Suppose that is the number of membership functions used for the first input (current) in fuzzy predictor

structure. Suppose also that the voltage actuator provides possible

Cu

rren

t p

oin

ts a

nd

pre

dic

tio

ns

Cu

rren

t p

oin

ts a

nd

pre

dic

tio

ns

Sample numbers Sample numbers

Enough robustness guard to

Protect DVS against miss prediction

wrong prediction effect:

miss estimation, not enough robustness guard

error

s too small s well designed

Page 47: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

2. Fuzzy-Controlled Voltage Scaling Based on Supply Current Tracking

30

quantized levels of voltages in the range of . This means that for each membership function of the supply current, there is one voltage level to be assigned. Since the clock frequency is fixed, equation (2-18) will be simplified as

(2-19)

The equation shows that at each control interval time, has a linear relationship with the voltage variations. Therefore, this linear relationship can be used to select the maximum guard band in the worst case.

The fuzzy predictor produces one output value for every supply current sample point. Assume that the input supply current belongs to the membership function . Therefore, the output value of this current point will

definitely belong to one membership function out of ,

, , . Even if the fuzzy controller does not correctly

predict the output current value, with a conservative approach the following robustness guard can be used to protect the circuit against possible faults.

(2-20)

where is the maximum variation in the supply current profile. It is worth to mentioning that the proposed robustness guard in (2-20) reduces power savings however it helps the predictor to perform a safe current tracking.

Page 48: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

Workload Prediction Based on Supply Current Tracking

31

2.6 Analysis and Stability Proof of the Closed Loop System

Since the fuzzy predictor is a nonlinear controller, using classical nonlinear control theory tools can be used for the stability analysis. Traditional analytical tools for dealing with stability analysis of nonlinear control systems are established on the Lyapunov stability methods. As there is no precise state-space model for digital CMOS systems, it is not possible to use the Lyapunov stability method in the time domain. Many researchers have been explored to evaluate the stability of fuzzy logic systems when the mathematical model of the system under control is known [35][36]. Kicker and Mamdani [37] introduced a describing function approach to evaluate fuzzy system stability problem. They showed that a fuzzy system could be treated as a multidimensional, multilevel relay as shown in Figure 2-13 by considering the fuzzy controller as a bounded nonlinear function. The multilevel relay is a nonlinear element, which is used to estimate the behavior of nonlinear systems. Since in [37] some strict preconditions are defined for the used fuzzy logic controller and the order of the system under control, the proposed methodology is limited to a few practical systems and applications. Those strict preconditions are related to the combination of the mathematical model of the system under control and the type of used fuzzy controller that both should be matched with proposed theorems. In the work hereby presented, the Popov criterion is used to analyze the stability of fuzzy control system with the controller as a multi-level relay, as it was proposed in [38] and shown in Figure 2-13. V. M. Popov proposed a prominent frequency domain method for analyzing the stability of nonlinear configurations like the one shown in Figure 2-5.

Figure 2-13 Linear fuzzy model approximated by multilevel relay input-output function

Suppose now that the linear transfer function of the digital CMOS circuit under control is represented by and that the nonlinear fuzzy system as a time-invariant system is defined by where is the output, is the input, and is the fuzzy nonlinear function. The Popov theorem has

Outp

ut

Input

y

I

I1 I2 I3 I4

y1

y2

y3

y4

Nonlinear fuzzy controller input output function

Page 49: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

2. Fuzzy-Controlled Voltage Scaling Based on Supply Current Tracking

32

two preconditions that need to be satisfied by the linear and nonlinear parts. The precondition for the nonlinear part is as follows:

≠ (2-21)

where is an arbitrary integer which can also be infinity. The precondition for the linear part is that its poles should be placed in the left hand side of the imaginary axis and the degree of its denominator has to be greater than the degree of its numerator.

Popov nonlinear stability Theorem [39]: The closed loop system is

absolutely stable if and there exists a constant such that the following equation is satisfied

𝑗

𝑗 𝑗 (2-22)

where the term 𝑗 represents the real part of the L 𝑗 and the term

𝑗 represents its imaginary part. If we define the Popov plot as

𝑗 𝑗 𝑗 𝑗 (2-23)

then the closed loop system is absolutely stable if lies to the right of the line

that intercepts the point – 𝑗 with a slope .

A sufficient condition to prove the stability of the proposed configuration is to find the Popov line that satisfies (2-22) or (2-23). Hence, it is

required to determine the linear transfer function of the digital circuit to be able to draw the Popov plot. As it was mentioned in the proposed closed loop configuration, the fuzzy controller is approximated by a multi-relay input-output function as shown in Figure 2-14.

To obtain the transfer function of the linear part, one needs to model two transfer functions: 1) a model of the digital CMOS circuit and 2) a model of the delay in the DVFS closed loop which includes all of the sensor delays, dc conversion delays and analogue to digital converters (ADCs) delay.

Power consumption of a digital CMOS circuit can be represented by (2-24)

𝑜 (2-24)

where is the average switching activity of the circuit, is the total circuit capacitance, is the power supply voltage, is the frequency of operation,

and is the leakage current.

Page 50: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

Workload Prediction Based on Supply Current Tracking

33

Figure 2-14 Multi-relay input-output function (to approximate fuzzy predictor) and the Popov

line obtained to satisfy the Popov theorem. The Popov line has slope , the same slope as obtained in Figure 2-15.

From (2-24), it is possible to derive equivalent impedance of the circuit as follows:

(2-25)

Hence, one can model the digital circuit by one low pass filter. Therefore, the frequency domain transfer function of the digital circuit can be approximated by the following expression:

(2-26)

where is the non-switching circuit capacitance. Also the loop delay which consists of the delay of different blocks such as the voltage and

frequency actuators, sensors, etc. can be entirely modeled as where is

the total delay of all blocks in the closed loop. Therefore, the loop delay

can be approximated by a transfer function as

(2-27)

Hence, according to (2-26) and (2-27), the transfer function of the linear part in the Popov theorem is as follows:

I(1) I(2) I(3) I(4)

y(1)

y(2)

y(3)

Y(4)

Multirelay input-output function

Popov Line obtained from Figure 2-15

Slope : 1/q

Input

I(t)O

utp

ut

Page 51: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

2. Fuzzy-Controlled Voltage Scaling Based on Supply Current Tracking

34

( ⁄ )

(

⁄ )

(

) (

⁄ ) (

⁄ )

(2-28)

From equation (2-28), it is obvious that the linear element is stable because the

roots (

⁄ ) and (

⁄ ) lie on the left hand side of the s-plane. Also, the

degree of its denominator is two and it is greater than the degree of its numerator (which is one). Therefore, the preconditions of the linear part in the Popov theorem are satisfied.

In short, the stability evaluation is performed as follows: First, 𝑗 is calculated by the transformation of the linear transfer function 𝑗 obtained in

(2-28). Next, the Nyquist plot of the corresponding 𝑗 has to be drawn. Subsequently, the Popov line can be obtained directly from the 𝑗 plot, which satisfies the asymptotic stability of the nonlinear fuzzy control system. If the nonlinear element satisfies the Popov restricting line requirement, the

system is stable. The 𝑗 Nyquist plot, as defined in (2-23) based on the obtained in (2-28), is drawn in Figure 2-15. The nonlinear element , which is shown in Figure 2-14, must satisfy the restriction on parameter

to have a stable nonlinear system. By choosing a proper positive value for the Popov criteria is satisfied as the line shown in Figure 2-14 and Figure 2-15.

Figure 2-15 Nyquist plot based on the equations (2-21) and (2-26)

As a numerical example, the stability of the proposed fuzzy controller has been evaluated on a sample digital CMOS circuit. In this analysis, the Popov

Popov Line)}(Im{ jwGw

)}(Re{ jwG

k/1

swnonCZ .

Slope : 1/q

0

w

w

Page 52: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

Workload Prediction Based on Supply Current Tracking

35

Nyquist has been drawn and is shown in Figure 2-16. The necessary parameters of (2-24), (2-26), and (2-28) are mentioned in Table 2-2.

Table 2-2 Parameters of the CMOS circuit

Parameter Description

Switching capacitance

Non-switching circuit capacitance

Equivalent impedance of the circuit

Clock frequency

Threshold voltage

Nominal supply voltage

Total delay of the closed loop system

Based on the Popov plot of Figure 2-16 and the parameter

, it is

possible to find an example Popov line, like the red line shown in Figure 2-16, which shows that the multi-relay input-output function lies on the right side of the Popov line and satisfies the asymptotic stability of the closed loop system. This asymptotic stability ensures that when the supply current is for instance between and , the output of the fuzzy controller is absolutely placed in a

right corresponding interval, e.g. between and or between and .

Figure 2-16 Popov plot for a sample 65 nm digital circuit controlled by the adaptive fuzzy logic controller, this plot proofs the stability of the closed loop system based on the Popov

line with slope q.

-7000 -6000 -5000 -4000 -3000 -2000 -1000 0 1000

-2.5

-2

-1.5

-1

-0.5

0

0.5

1

1.5

2

2.5

x 107 Popov Criterion Study of a Stable Plant

Real Axis: Re(G(j))

Ima

gin

ary

Ax

is:

I

m(G

(j

))

Popov Line (Slope: q)

Re P(jw)=-1/K+j0=-2857.1

w=infinity

w=0

Page 53: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

2. Fuzzy-Controlled Voltage Scaling Based on Supply Current Tracking

36

2.7 Summary

In this Chapter, an adaptive fuzzy logic controller (predictor) was proposed to predict and track the average of supply current variations in an accurate and robust manner. By observing the processor’s average of supply-current and its variation rate, the fuzzy controller can drive the processor to operate at the lowest possible voltage and the corresponding minimum frequency. In this Chapter, first, the problem description of the supply current tracking was presented. The necessary requirements of an online-supply current tracking were analyzed and formulated for dynamic voltage scaling aims. Based on the current tracking model, the details of designing a fuzzy current predictor were explained. In the proposed fuzzy controller structure, the derivative of supply current has been used to predict future current values. The necessary condition of a safe fuzzy prediction was explained in (2-17) to protect DVS system against any possible current miss-estimations. The

robustness guard band was defined in (2-20) to be considered for the DVS system when the supply voltage is adjusted based on the output of the fuzzy predictor.

Also in this Chapter, the stability of the closed loop DVFS configuration has been analyzed using a frequency-domain technique known as Popov stability analysis. First the frequency model (transfer function) of the circuit was obtained; and then the nonlinear fuzzy controller was modeled by approximating it with a linear multilevel relay input-output function. It has been proven that for a digital processor, the fuzzy controller guarantees the stability of the closed loop DVFS system.

In the next Chapter, it will be discussed how the proposed fuzzy predictor (controller) can be applied in real circuit setups by analyzing all the practical issues. The stability analysis also will be used to evaluate how the supply voltage of a processor can be adjusted based on the average of supply current

tracking while the design parameters (e.g. the robustness guard value , number of the membership functions, processing time of the fuzzy logic current predictor and other similar practical parameters.) are changed.

Page 54: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

37

3Experimental Results and Practical Issues

3.1 Overview

The design of the fuzzy controller to predict the average of the supply current variations for dynamic voltage scaling purposes was explained in Chapter 2. To validate the efficiency of the proposed technique, in this Chapter, the fuzzy predictor has been applied to various supply current profiles and the results are evaluated based on the prediction, power savings, and tracking properties. Also, the results of the fuzzy supply current tracking have been compared to the results of the five other known prediction methods. By these sorts of experiments, one can examine the efficiency of the fuzzy predictor in satisfying the necessary requirements of a correct current tracking presented in Chapter 2. All these simulation results and corresponding discussions are described in Section 3-2 of this Chapter.

Moreover in this Chapter, the experimental results of applying the proposed fuzzy technique on a dual processor circuit are presented and the results are fully analyzed. All the practical issues of implementing the fuzzy controller in a real circuit have been also comprehensively studied. The experimental setup to implement the fuzzy predictor as DVS unit includes a dual processor circuit. In this circuit, by observing the average of the supply current of the first processor, digitizing it, and sending it to the second processor, the fuzzy controller dynamically adjusts the supply voltage of the first processor based on its supply current prediction. In the experimental setup, there is also one interface circuit including the necessary components for a DVS system, e.g. the current sensors to monitor the supply current of the first processor, a high resolution LDO to adjust the supply voltage, and I

2C

communication tools to make the connection between the two processors. The quality of the DVS system and the amount of power savings are seriously dependent on some practical issues, e.g. the sampling time of the current sensor, the resolution of the voltage actuator, the delay of all components in DVS circuit and etc. By studying this Chapter, one can design the fuzzy controller and apply it on every other circuits for DVS purposes. The experimental implementation, the results and all the corresponding discussions are presented in Section 3-3.

3.2 Simulation Results and Discussions

The fuzzy logic controller is proposed as an online predictor of the supply current variations. To analyze the prediction quality, five more conventional prediction methods have been designed to compare the results with the fuzzy method. To evaluate the prediction/tracking accuracy of each method, the discrepancy between the observed values of supply current and the values expected under the model has been evaluated. Satisfying the error criterion

Page 55: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

3. Experimental Results and Practical Issues

38

mentioned in Section 2.2 and in (2-17) is considered as a necessary condition to design a supply current tracker.

3.2.1 Simulation Setup

In these experiments, a settling delay of 100 us for the supply voltage actuator has been considered. Also, the supply current is measured with 1ms sampling time. The supply voltage is adjusted between 1V and 1.2V, while the frequency of operation is kept constant to maintain the integrity of the execution time of the tasks. Considering these minimum and maximum voltage values for a fixed clock frequency is inspired from the specification of operating performance points (OPPs) of Texas Ins. Beagleboard [40][41] where an OMAP35x device is under control of a software-based DVFS technique. In Beagleboard, the clock rates and the supply voltage are lowered by software or an operating system OS based on the performance requirements of a desired task. There are five predefined frequency-voltage pairs that depending on each operating performance point (OPP), the software or the OS sends control signals to external regulators to set the corresponding voltage value. For instance if the required operating performance point OPP is 500 MHz, the corresponding supply voltage adjustable by software or OS is 1.2V; and if OPP is 250 MHz, the corresponding voltage is 1V. Supposing that the required performance is 500 MHz, the corresponding voltage 1.2V is considered to guarantee the right operation of OMAP35x in all different situations e.g. taking care of the voltage regulator and the process, voltage, temperature variations. Therefore, there is always a possibility to apply more voltage scaling and reduce the supply voltage from 1.2V to 1V when the processor, say, works at 500 MHz w.r.t. the workload variations.

3.2.2 Design of Non-Fuzzy Supply Current Predictors

For the comparison purposes, five other current predictors have been designed to evaluate the efficiency of the fuzzy tracker in terms of: 1) prediction accuracy 2) tracking properties 3) power savings in case of using the designed predictor as a DVS control system.

To model the function in (2-3), simulated tracking methods are sub-divided into two different categories: nonlinear modeling and linear modeling of the current tracking system. The nonlinear models are selected as the following methods: 1) PID controller 2) nonlinear system identification method 3) polynomial function 4) exponential function 5) fuzzy logic controller. To select the above nonlinear methods, specific criteria has been considered e.g. the accuracy of the nonlinear model based on the minimum error in current prediction, easy implementation feasibility, possibility of tuning the predictor’s parameters using off-line current data, and fast reaction to the input data. The linear models are based on the linear system identification methods (specifically based on ARX or ARMAX modeling). Therefore in total, six different prediction methods have been implemented including the fuzzy controller to examine the current prediction accuracy.

Page 56: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

Workload Prediction Based on Supply Current Tracking

39

For comparison purposes, let us first highlight results from applying the prediction methods on only one specific current profile, then review the results of implementing the predictors on more six current profiles.

The design properties of the six mentioned prediction methods are presented in Table 3-1. In the following subsection, more descriptions about the design properties are mentioned. Also the first supply current profile (that will be discussed in the following subsections) corresponds to a video application.

3.2.2.1 Fuzzy-Predictor of a sample current profile tracking

Figure 3-1 shows the result of implementing the fuzzy predictor on a sample current profile of a video application. As one can see from Figure 3-1, the fuzzy controller can follow the supply current in an accurate and robust manner. The predicted signal always has a higher value than the measured one, even when the supply current has quite high variations. The design properties of the fuzzy controller are as the previously mentioned in Chapter 2. Now let us design other non-fuzzy predictor and see how the other predictors can track this current profile.

Figure 3-1 Tracking result of the supply current profile of a video application by the designed fuzzy predictor

3.2.2.2 Linear Prediction based on ARX-ARMAX methods

To design a linear model for the supply current tracking system (2-3), first of all, the supply current profile of the application being executed should be measured in advance. Then, the measured current profile is used to obtain a linear model for the current tracking system. Note that when the application is changed (which means the corresponding current profile is changed), then the model should be changed as well, since the initial obtained model is not valid for the new application (current profile). The general current tracking model in

(2-3) is introduced to design a nonlinear function for each current profile. However it is always possible to linearize this nonlinear function around a certain current trajectory. There are different methods for linearizing nonlinear models around a certain current trajectory, e.g. Jacobian method. Therefore,

80 100 120 140 160 180 200 220 240 260 280 300

600

650

700

750

800

850

900

Supply Current Tracking of a Fast Video Application

Time (msec)

Cu

rre

nt

an

d its

tra

ck

ing

sig

na

l (u

A)

Supply Current

Tracking Signal by FLC

Page 57: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

3. Experimental Results and Practical Issues

40

without loss of generality, assume that the tracking system presented in (203) and shown in Figure 2-3 can be modeled also as a linear system described by

its impulse response as follows:

(3-1)

where is the transfer function of the linear system which is the z-transform of

defined as follows:

and can be considered (optionally) as the measurement noise. In general,

the function denotes the dynamic properties of the tracking system. The primary characteristic of disturbances and noises, in both the linear and

nonlinear models, is their unpredictable nature. Consequently, the term modeled as white noise, which is a good candidate to represent a source of measurement noises and unpredictable disturbances. For a linear model of the current prediction system, we can simply ignore the noise term by making an average of the current signal and adding the robustness guard. But let’s assume that stands for the white noise, and then let in (3-1) be given as

∑ (3-2)

where is the transfer function for disturbances and noises. In result, the basic linear description of the supply current tracking system with additive disturbances is as follows:

(3-3)

The main challenges to linearly model the supply tracking system are,

first, to design the transfer functions and , and second, to choose how many last measure samples of the current points to use for predicting of one current value ahead.

Linear system identification methods are known as the best candidates

to design the transfer functions and . In [23], all the necessary knowledge about design and implementation of a linear model based on off-line input-output data are provided. In this thesis, ARX and ARMAX methods have been used to estimate the linear model of current predictor. ARX technique is to design and ARMAX is used to model , if necessarily and when a white noise has been simulated as measurement noises.

Now let’s assume the current profile of the same application shown in Figure 3-1 to design an ARX linear model. Several models have been designed by using the system identification toolbox in Matlab to find out the better model. One of the designs is as the model of (3-4), which the tracking result of this model is shown in Figure 3-2.

Page 58: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

Workload Prediction Based on Supply Current Tracking

41

(3-4)

where coefficients are designed based on off-line current data.

Figure 3-2 Tracking result of the current profile of a video application by the designed linear model of (3-4)

Note that the model shown in (3-4) with forth degree polynomials is not necessarily the best model for the current profile of this current profile. This model has been obtained by trial and error and is not proven to be the best linear model. In this example, the last four current points have been used to predict one value ahead of the supply current.

3.2.2.3 Nonlinear Prediction

Consider a nonlinear relation of the supply current and its tracking signal (2-3) as a finite dimensional system. Depending on the number of available

data as in (2-2), different nonlinear functions can be used to estimate the behavior of the supply current tracking. Polynomial function, exponential function, and nonlinear system identification methods are some possible candidates to approximate the nonlinear function in (2-3). The nonlinear ARX model has been used to design the nonlinear model for the current tracking system. For the mentioned current profile, a nonlinear ARX structure has been designed and the tracking results is shown in Figure 3-3. To design the nonlinear ARX model, the nonlinear identification toolbox of Matlab has been used. Also in [23], one can find all the necessary information about the nonlinear system identification design. Again, it is worth to mentioning that the model is not unique and depending of the design, the tracking output can be different. The tracking result of implementiong the nonlinear ARX model on the sampled current profile is presented in Figure 3-3.

80 100 120 140 160 180 200 220 240 260 280 300

600

650

700

750

800

850

900

950

1000Supply current tracking of a fast video application

Time(msec)

Cu

rre

nt

an

d i

ts t

rac

kin

g s

ign

al(

uA

)

Supply Current

Tracking Signal byLinear System Identification

(ARX Method)

Page 59: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

3. Experimental Results and Practical Issues

42

Figure 3-3 Tracking result of the nonlinear ARX methods

3.2.2.4 Polynomial Estimation

Depending on the desired tracking accuracy, different numbers of polynomial terms can be considered. In this thesis, the primary concern is the tracking quality and not the complexity of the method itself.

Figure 3-4 Tracking result of the Polynomial function estimation

As it is mentioned in Table 3-1, a Polynomial function has been design based on offline current data. For the mentioned current profile, consider a ninth-degree of a polynomial function as (3-5) where the prediction result is shown in Figure 3-4.

(3-5)

Where coefficients are obtained based on off-line experiments.

0.1 0.15 0.2 0.25 0.3300

400

500

600

700

800

900

Time(sec)

Cu

rre

nt

an

d I

ts t

rac

kin

g s

ign

al

(uA

)

Supply current tracking of a fast video application

Tracking Signal by Nonlinear System Identification

Supply Current

80 100 120 140 160 180 200 220 240 260 280 300

600

650

700

750

800

850

900

Supply current tracking of a fast video application

Time(msec)

Cu

rre

nt

an

d i

ts t

rac

kin

g s

ign

al(

uA

)

Supply Current

Tracking Signal by 9th degree polynomial function

Page 60: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

Workload Prediction Based on Supply Current Tracking

43

3.2.2.5 Exponential Estimation

Same as the Polynomial method, Exponential estimation is another

known nonlinear choice to estimate the function in (2-3). Therefore, without considering the complexity of the design and being worry about the number of parameters to tune, an exponential function with eighth-degree has been designed. By using a toolbox in Matlab (cftool), an exponential function is designed in the form of (3-6) and the tracking result s is shown in Figure 3-5.

(3-6)

where coefficients are obtained based on off-line experiments.

Figure 3-5 Tracking result of Exponential current estimation using (3-6)

3.2.2.6 PID based Controller- Predictor

To design a PID-based control system, a transfer function model for the digital processor is needed. In the simulation part, the linear transfer function obtained by the linear identification method has been used as the reference model; and PID controller is designed to improve the quality of current tracking as it is shown in Figure 3-6.

Figure 3-6 Design PID-Based current tracking system

For this supply current profile example, the PID parameters have been designed to track the input current signal. Considering (3-4) as the reference

80 100 120 140 160 180 200 220 240 260 280 300

600

650

700

750

800

850

900

Supply current tracking of a fast video application

Time(msec)

Cu

rre

nt

an

d i

ts t

rac

kin

g s

ign

al(

uA

)

Supply Current

Tracking Signal by exponentional function

PID Linear Model

Obtained by ARX

Page 61: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

3. Experimental Results and Practical Issues

44

model of the processor, and the prediction structure as the one shown in Figure 3-6, the PID parameters ( ) are designed to improve the tracking

quality. The tracking result of PID-based predictor system is shown in Figure 3-7.

Figure 3-7 Simulation tracking result of PID

It is very important to stress that, as the other previously designed linear and nonlinear methods, the simulated PID controller is not necessarily the best possible design. All these proposed estimator methods have been designed based on executing several experiments by using off-line current data.

Tracking results of applying six predictors have been shown above, Now let us define some solid criteria to compare all the tracking results. Also more experiments have to be done to make a fair comparison between all the tracking methods. In the following, first three criteria will be introduced; and then the results of simulating the trackers on six more current profiles will be reviewed and analyzed.

80 100 120 140 160 180 200 220 240 260 280 300500

550

600

650

700

750

800

850

900Tracking of supply current using PID controller

Time(msec)

Cu

rre

nt

an

d i

ts t

rac

kin

g s

ign

al(

uA

)

Supply Current

Tracking Signal by PID

Page 62: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

Workload Prediction Based on Supply Current Tracking

Tab

le 3

-1 D

esig

n P

rop

ert

ies o

f th

e P

red

icti

on

Meth

od

s

De

scri

pti

on

Se

ctio

n 2

-3 a

nd

2-4

𝑗

∑∑

𝑗

𝑗

- W

he

n d

esig

nin

g a

ll pre

dic

tion m

eth

od

s, th

e n

ois

e te

rm in

(3

-3)

is c

on

sid

ere

d a

s th

e n

ois

e o

f m

easuri

ng

th

e s

up

ply

curr

en

t in

sid

e th

e s

en

so

rs.

- T

he

te

rm “

nu

mb

er

of p

ara

mete

rs to

ob

tain

” fo

r lin

ear

an

d n

on

linea

r id

en

tification

me

tho

ds,

fuzzy p

red

icto

r, p

oly

no

mia

l, a

nd e

xpon

ential m

eth

ods a

re

ob

tain

ed b

ase

d o

n p

erf

orm

ing s

evera

l e

xp

eri

men

ts to a

ch

ieve

th

e b

est re

sults.

The

refo

re, th

ey a

re n

ot u

niq

ue

va

lue

s f

or

eve

ry a

pplic

atio

n.

- T

he

“N

um

ber

of

Cu

rren

t S

am

ple

s “

in c

olu

mn 3

of th

e ta

ble

re

pre

sen

ts th

e te

rm

in

(2

-2)

and

it m

ean

s t

ha

t h

ow

ma

ny last sup

ply

curr

ent sa

mple

da

ta

( )

are

used

to

pre

dic

t th

e o

ne

-ste

p a

hea

d o

utp

ut valu

e

.

- It

is w

ort

h m

entionin

g that th

e fu

nction

ord

er

of 9

an

d 8

fo

r th

e P

oly

no

mia

l a

nd

Exp

on

en

tia

l m

eth

od

s a

re u

se

d,

respe

ctive

ly.

In t

he

exp

eri

men

ts,

the

se

functio

ns h

ave b

ette

r re

su

lts t

han t

he s

am

e fu

nctio

ns w

ith

fe

we

r o

rders

.

Nu

mb

er

of

cu

rre

nt

sa

mp

les

us

ed

(n

)

2

2

4

4

1

1

Nu

mb

er

of

pa

ram

ete

rs t

o o

bta

in

46

fo

r G

aussia

n M

Fs

58

fo

r T

rian

gu

lar

MF

s a

s F

igure

2.8

3 :

,

,

8 :

𝑗

8 :

𝑗

10 :

24 :

Me

tho

d

Fu

zzy

Pre

dic

tor

PID

No

nli

ne

ar

Ide

nti

fic

ati

on

Lin

ea

r Id

en

tifi

cati

on

Po

lyn

om

ial

Ex

po

ne

nti

al

Page 63: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

3. Experimental Results and Practical Issues

46

3.2.3 Analysis and Comparison of Simulation Results

To compare the effectiveness of each method, the error signal is evaluated based on the definitions in (2-3) and (2-17). Figure 3-8 shows the error signals of all mentioned tracking methods together.

Figure 3-8 Error profiles of the prediction methods corresponding to the implementation of the video application

To statistically evaluate all tracking methods, three criteria were examined. The first criterion is defined as the “sum of the negative errors” or SNE as follows

∑ ( )

(3-7)

The SNE value describes how much the method successfully satisfies (2-17) as a necessary condition for the supply current tracking. The second criterion, called “R-Square” or “RSQ”, statistically measures how successful the tracking is. Basically, RSQ is the square of the correlation between the current values

and the predicted response values and is defined as [42]:

∑ ( )

∑ ( )

(3-8)

where is the average of the measured current variations and is the total number of the supply current samples. For computing RSQ, first, the error

criterion of (2-17) has to be satisfied. Without considering a robust value in (2-3) and (2-17), the RSQ value is always equal or less than 1. Also, it becomes negative if the differences between the current profile and its

prediction signal ( ) increases or decreases. If RSQ is closer to 1, it

80 100 120 140 160 180 200 220 240 260 280 300-350

-300

-250

-200

-150

-100

-50

0

50

100

150

Time (msec)

No

rma

lize

d E

rro

r

Error Profiles

FLC ARMAX NL-ID Poly. PID EXp.

Page 64: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

Workload Prediction Based on Supply Current Tracking

47

means that the tracker is following the current variation more precisely and vice versa.

In addition to SNE and RSQ, power savings (PS) is another important metric to compare different DVS methods. The average amount of power savings is calculated based on executing the application in two cases: 1) when the

processor works at nominal unmanaged supply voltage . In this case the average of power consumption is as follows

(3-9)

where is the supply current of processor when it executes an specific application at , and is the total number of the supply current samples. 2) when the processor works under the DVS method. In this case, depending on the measured supply current value and the supply voltage actuator, the supply

voltage can be adjusted according to the designed predictor. Suppose that in this case, the supply voltage is denoted as and the supply current is

denoted as , then the average of power consumption can be calculated as

(3-10)

where Therefore, based on (3-9) and (3-10), the power savings (PS%) is calculated as

(

) (3-11)

Table 3-2 shows SNE, RSQ and PS% results of all methods over seven distinct applications.

It is worth mentioning that for each trace of the supply current it is necessary to perform off-line profiling and to update the necessary parameters to be able to achieve the accurate tracking properties (except for the fuzzy controller). For instance, to design a PID controller for the experiment of the video application, an initial value is chosen for the three coefficients , and shown in Table

3-2. Then, the PID controller is tuned w.r.t the selected initial conditions. Based on its output tracking results, the coefficients are further tuned to obtain better tracking properties. After performing several trials, the optimum values of the PID coefficients are obtained for the specific video application. Now, if another application is selected, then a new PID controller must be designed and the whole procedure carried over again.

In general, to maintain a fair comparison among all the methods, accuracy is pursued following the same criteria as for designing the fuzzy predictor: 1) minimizing the SNE 2) obtaining RSQ value as much as close to 1, and 3)

Page 65: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

3. Experimental Results and Practical Issues

48

checking if the necessary requirement of current tracking mentioned in (2-17) is satisfied or not. Also note that for calculating the RSQ values a proper positive constant value has been added to the outputs of the tracking methods, except to the fuzzy controller, to be able to use them for the DVS goals.

Let us briefly discuss the results of Table 3-2 now. As one can see, the fuzzy predictor outperforms all the tracking methods. Compared to the conventional prediction methods, the fuzzy predictor has the RSQ value nearest to 1, the minimum SNE value and the maximum power savings for the examined supply current profiles.

To design a linear model, as explained before, one can use the model presented in (3-1) or (3-3) and execute the system with various off-line input-output data to find an optimum model. Therefore, off-line profiling is necessary to find a proper linear model for supply current prediction. From looking at RSQ values of the linear ARMAX model in Table 3-2, it is obvious that current variations are not always properly predicted. For the results of Table 3-2, for every supply current profile one different linear model has been designed. Therefore, seven different models have been totally designed.

Nonlinear system identification modeling is one of the most powerful methods among all nonlinear fitting algorithms; however, it needs more off-line profiling than the linear ones to find a proper model. In all the presented experiments, the current signals are tracked by the nonlinear system identification method with negative RSQ values. Consider the first video application where the tracking results is shown in Figure 3-3. From the SNE values of the first video experiment in Table 3-2, it is observed that there are many big negative error values during predictions as also shown in Figure 3-8. This implies that to satisfy the necessary condition for a safe current tracking

mentioned in (2-17), a large constant value should be added to the output signal to compensate for negative errors. On the other hand the SNE value of nonlinear identification for the web-browsing application, with nonlinear supply current variations, is zero.

The polynomial and exponential methods are classified as nonlinear methods. From Table 3-2, one can observe that these methods are as strong as the other nonlinear methods in predicting supply current variations except the fuzzy one. It is worth noting that in the first video experiment (where the tracking results are shown in the last section), the exponential function fully satisfies necessary error criterion (2-17), but it has the most negative RSQ value implying that it cannot follow the current variations.

As mentioned earlier, designing the PID controller needs either a mathematical equation or the state-space model of the processor. Here, to design the PID controller, the transfer function model derived by the linear system identification method has been used. There are three coefficients in the PID method that should be determined by the designer: proportional ,

integral and derivative coefficients. As it was mentioned before, for each specific application these three confidents should be defined accordingly. Therefore, the PID controller is not counted as an on-line controller.

Table 3-2 also shows the power savings. Note that Table 3-2 only shows an estimation of power savings when the controller is used to convert the supply

Page 66: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

Workload Prediction Based on Supply Current Tracking

49

current variations to voltage values in a circuit with an unmanaged power management technique. In these experiments the frequency of operation is fixed and the supply voltage is adjusted between 1V and 1.2V, as described in Section 3-2, with a resolution of 10 mV. Of course larger power savings are possible if the power supply voltage and operating frequency are scaled down even further. In these experiments the processor executes the application in a continuous high-workload mode. Therefore, it is not possible to further scale down voltage and frequency to save more power in possible idle modes.

By referring to the results of all prediction methods on seven different supply current profiles, and considering the following facts: 1) for every current profile, except the fuzzy predictor all the other predictors need to be re-designed based on new off-line data 2) SNE, SRE, and PS results explained in these results, one can conclude that using the fuzzy predictor as the supply current tracker in DVS systems is strongly advisable.

In the next Section, we examine the experimental implementation of the fuzzy predictor and evaluate how it can face with all the practical issues in a dynamic voltage scaling DVS system.

Page 67: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

Workload Prediction Based on Supply Current Tracking

Tab

le 3

-2

Tra

ck

ing

ch

ara

cte

risti

cs a

nd

pre

dic

tin

g e

valu

ati

on

of

seven

ex

peri

men

ts b

ase

d o

n S

NE

, R

SQ

an

d P

S%

Cri

teri

a

PID

-18.4

6

-0.0

85

6

-68u

-15.1

6.9

-78.4

m

-2.1

8.2

-13.4

m

-21.3

6.6

-0.3

5

-14.2

6

-1.7

-7

10

.1

- - -

No

te -

In

th

e B

row

sin

g a

pplic

atio

n, L

ine

ar

ide

ntifica

tion

me

tho

d a

nd P

ID c

ou

ld n

ot fo

llow

th

e c

urr

en

t p

rofile

Ex

po

ne

nti

al

0

-1.2

3

6.4

-0.2

m

-13.5

7.4

-5.1

m

-2.3

7.8

16

.8m

-14.5

7.8

-0.2

7

-9.5

7.3

-1.0

1

-9.1

9.6

-79

m

-23

7

Po

lyn

om

ial

-34.5

-2.5

2.3

-0.2

m

-12.6

7.6

-14.1

6m

-2.3

7.8

-11

m

0.2

7

13

.3

-23

m

-9.5

7.3

-0.2

3

-7.5

9.9

-105

-31

6.2

No

nli

ne

ar

Ide

nti

fic

ati

on

-95.0

2

-0.9

5

4.1

-4.2

u

-9.2

8.4

-3.2

m

-9.2

5.5

-11

m

-14.7

8

7.2

-0.2

8

-16

5.3

-54

m

-2.2

11

.2

0

-5.4

3.9

Lin

ea

r Id

en

tifi

cati

on

-11.8

1

-0.7

6

4.9

-5.7

u

-23.7

5.2

-23.7

m

-2.5

8.2

-11.8

m

-21.9

6.6

-0.5

1

-14.2

5.9

-1.8

-38

5.9

- - -

FL

C

0

0.8

36

9.2

-0.7

u

0.2

2

12

.6

-0.2

8m

-1.9

8.2

-5.6

m

0.5

7

13

.2

-2m

0.7

8

14

.3

-8.6

m

-0.2

12

.3

0

0.5

9

11

.9

SN

E (

uA

)

RS

Q

PS

%

SN

E (

uA

)

RS

Q

PS

%

SN

E (

uA

)

RS

Q

PS

%

SN

E (

uA

)

RS

Q

PS

%

SN

E (

uA

)

RS

Q

PS

%

SN

E (

uA

)

RS

Q

PS

%

SN

E (

uA

)

RS

Q

PS

%

Ex

pe

rim

en

t1

Vid

eo

Ap

pl.

No

. 1

(w.r

.t.

Fig

ure

s 3

-1, 3

. 2

,

…,

3-8

)

Ex

pe

rim

en

t 2

Vid

eo

Ap

pl.

No

. 2

Ex

pe

rim

en

t 3

Vid

eo

Ap

pl.

No

. 3

Ex

pe

rim

en

t 4

Vid

eo

Ap

pl.

No

.4

Ex

pe

rim

en

t 5

32

-bit

Mu

ltip

lie

r

Ex

pe

rim

en

t 6

Ma

trix

Mu

ltip

lica

tio

n

Ex

pe

rim

en

t 7

Bro

ws

ing

Page 68: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

Workload Prediction Based on Supply Current Tracking

3.3 Experimental Results and Practical Issues

Section 3.2 describes the simulation results of implementing the fuzzy predictor on different supply current profiles. In this Section, the experimental implementation of the controller on a dual-processor circuit is comprehensively explained. Also in this Section, all the practical issues related to the use of the fuzzy logic predictor in a dual processor system are discussed. Experimental results and practical limitations based on a dual processor circuit in which one processor is used to control the other processor along with the corresponding dc conversion and current sensing are reported.

3.3.1 Experimental Setup

The experimental dual processor circuit is shown in Figure 3-9. This circuit consists of different components:

1-two microprocessors for which the first one is used for executing applications and the second one is used for controlling the power consumption of the first one,

2- one voltage actuator used to adjust the supply voltage of processor 1, the voltage actuator is an LDO [43],

3- one current sensor to measure the average of the supply current of processor 1 when it is executing specific applications.

Figure 3-9 The experimental dual processor circuit

Test board

Power delivery

Control board (Processor 2)

Buffer for programming

ULi

nk

SW

Processor 1

Page 69: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

3. Experimental Results and Practical Issues

52

A software-based fuzzy predictor was developed and deployed to a dual processor system to evaluate its efficiency in a working environment. In a practical implementation, one has to look into issues such as: selecting a correct sampling time to cope with the delay of the closed loop, the complexity of fuzzy predictor w.r.t. the number of membership functions and fuzzy if-then rules, the dependency of DVS on the resolution of the voltage actuator, and finally the amount of power savings gained by applying the fuzzy DVS technique.

In detail, the block diagram of the experimental circuit setup is shown in Figure 3-10. In the experiments, the clock frequency of processors 1 and 2 are fixed and the goal is to adjust the supply voltage of processor 1 w.r.t. the average of the supply current it is using. In the configuration of Figure 3-10, processor 1 works at a frequency of with a nominal supply voltage of 1.2V. The supply voltage can be changed with a resolution of 1 mv

with a delay of around . Measuring the voltage drop across the resistor connected to processor 1 senses the current. The current sensor measures the voltage drop across the resistor, computes an average of the current and also rejects high frequency noise [44]. The fuzzy logic controller runs in processor 2. It predicts the average of supply current, computes the supply voltage of processor 1 and adjusts it through programming of the voltage actuator [43].

Figure 3-10 The configuration of the experimental circuit set-up

Table 3-3 shows the delays of each path in the experimental circuit setup shown in Figure 3-10. From the delay values of Table 3-3, the total delay of the closed loop system is around 30 ms. Therefore, during each 30 ms, one average value of the supply current is calculated, one output current value is predicted by the fuzzy controller, and the supply voltage is switched to a new value.

As it is indicated, to use the fuzzy predictor for DVS purposes, one should takes into account several practical aspects of the implementation such

Processor 1

(Application)

DACLDOProcessor 2

(DVS)

Current

SensorFilter

I2C-

write

I2C-readR

Page 70: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

Workload Prediction Based on Supply Current Tracking

53

as the LDO resolution, choice of a proper sampling time to measure the average of current variations, as well as dealing with measurement noises and the delay of the whole closed loop DVS system. The following subsections cover the discussions about these practical issues.

Table 3-3 Delays in the Experimental Dual Processor Circuit

Sensor sampling delay: the delay from current sensor to Processor 2 including I

2C-Read delay.

Delay of FLC: running in Processor 2 with the speed of . This delay is for when 25 supply current and supply voltage membership functions of the fuzzy controller are used.

Voltage actuator delay: delay of the used LDO. Note that this delay does not include the I

2C-write delay; It only is the delay of LDO when it switches

between two voltage levels. LDO delay in this circuit is fairly small and not comparable with the other component’s delays.

Communication delay: delay of (I2C-write) communication and the digital

to analogue converter DAC (to program the LDO) in the setup.

3.3.2 Software-Based Fuzzy Logic Predictor for the Supply Current Tracking

The design of the fuzzy logic controller and the stability analysis were discussed in Chapter 2. In this experimental circuit setup, the fuzzy controller is designed as a software-based controller, which is executed by a second processor. In short, algorithm 3-1 shows how to implement the fuzzy controller.

Algorithm 3-1 A brief pseudo-code of the fuzzy current predictor for DVS purposes

Data (Inputs: current and its derivative - Output: Predicted current )

1. Get input values: , 2. Map input values into membership functions (MFs) – see Figure 2-8

, 3. For to 𝑜 𝑜

If degree of MF and ≠ 0

Identify rule and degree of MF of by MIN-MAX algorithm

End For 4. Calculate fuzzy output MFs 5. Calculate defuzzified output : see (2-16)

6. Add robustness guard band : see (2-20)

7. Scale to adjust voltage values and get next current sample

8. Go to step1

To make a fuzzy logic based supply current predictor, one can choose different numbers of membership functions for the inputs and output. The precision of

Page 71: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

3. Experimental Results and Practical Issues

54

the prediction and the delay of computation depend on the number of membership functions. Therefore, there is always a trade-off between choosing a large number of membership functions to achieve high precision and choosing fewer membership functions to achieve a shorter computation time for the fuzzy predictor. This will be discussed in Section 3.3.6.

As way of analysis, let us start by reviewing the implementation results of applying the fuzzy DVS Algorithm 3-1 when processor 1 executes three different applications periodically: while (1), FIR filter and Matrix Multiplication. In this experiment, as mentioned before, the clock frequency of processor 1 is

fixed at . The predicted signal of the average of the supply

current is obtained by the fuzzy controller running in processor 2. Figure 3-11 shows the average of the supply current and the on-line predicted

signal of processor 1 obtained by the fuzzy controller.

Figure 3-11 Online prediction experimental results: The average of the supply current and

the fuzzy predicted output values when processor 1 executes three applications periodically and the fuzzy predictor is running in the Processor 2

Now let us use the predicted signal to adjust the supply voltage when there is the chance to reduce power consumption at a fix frequency. Suppose

that Processor 1 works with an unmanaged supply voltage and the

speed of . The predicted signal is converted to the supply voltage values that range between 1V and 1.2V. In fact, 1.2V is the maximum voltage and 1V is the minimum voltage that the processor can work with them at 100 MHz. These values are obtained by executing several off-line experiments.

3700

3900

4100

4300

4500

4700

4900

5100

5300

5500

5700

1 4 7 10 13 16 19 22 25 28 31 34 37 40

supply current

predicted fuzzy output

Time (40 ms /Div)

Cu

rre

nt

(uA

)

Page 72: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

Workload Prediction Based on Supply Current Tracking

55

Now assume that there is no power management technique applied on the circuit and the processor works with an unnecessary high voltage value 1.2V. The goal is to reduce the supply voltage w.r.t. the average of supply current.

In this experiment, the sampling time of the current sensor is around , the settling time of the voltage actuator is around and the

voltage actuator resolution is . The measurement results are shown in Figure 3-12 and Figure 3-13 where there exist three different levels for the averages of the supply current corresponding to the aggregation of the three tasks.

In this experiment, first, Processor 1 works with the fixed voltage

and then after around 7.5s, the fuzzy controller is applied to adjust the supply voltage corresponding to the average of the supply current variations. As one can see from Figure 3-13, the supply voltage starts to reduce from 1.2V following the average of the supply current variations shown in Figure 3-12. The presented results are quite promising by considering the facts that the fuzzy controller works as an on-line predictor and can compensate for all the mentioned delays in the closed loop dynamic voltage scaling system.

Figure 3-12 Measurement results: supply current of processor 1 over time (s) when it executes three different applications periodically. Processor 1 starts to execute applications

with a fix unmanaged supply voltage (1.2V); and after 7.5 sec, the fuzzy DVS is applied to adjust the supply voltage with regards to the average current. When DVS is applied, the

minimum and the maximum of supply current are reduced to lower values.

3000

6200

3400

3800

4200

4600

5000

5400

5800

uA

0.000 s 20.000 s2.000 s 4.000 s 6.000 s 8.000 s 10.000 s 12.000 s 14.000 s 16.000 s 18.000 s

Appl.1:while(1)App. 2: FIR Filter

App. 3: matrix multiplicationSupply Current (uA)

Page 73: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

3. Experimental Results and Practical Issues

56

Figure 3-13 Supply voltage of processor 1 over time (s); the voltage is controlled by the fuzzy controller, the voltage signal corresponds to the current signal shown in Figure 3-12

A main concern is how to measure the average of the supply current, and making sure that the delays of the circuit and the fuzzy predictor accuracy are the appropriate ones for maximum power savings. Let us discuss these mentioned practical issues in the following subsections.

3.3.3 Sampling of the Supply Current

As it was argued in Section 2.3.3, a good sampling of the supply current is of utmost importance to perform a precise current-based DVS. First of all, the

sampling time of the current sensors should be chosen to fulfill (2-6) and (2-7). Second, the value in (2-7) should be selected as small as possible to keep the DVS circuit away from missing crucial supply current points. As way of example, Figure 3-14 shows two snapshots of fuzzy output signals when the averages of supply currents are sampled with different sampling times (second is increased by a factor of 2x). It can be clearly recognized that at least 6 crucial deadlines cannot be fulfilled in this current profile snapshot. It follows then that although the controller has good tracking properties, due to the latency of the closed loop control, a good sampling strategy is needed.

A best use of the fuzzy controller is in scenario-based applications in which the time interval between scenarios is larger than the controller’s latency.

1.0000

1.2000

1.0244

1.0495

1.0746

1.0996

1.1247

1.1498

1.1749

V

0.000 s 20.000 s2.000 s 4.000 s 6.000 s 8.000 s 10.000 s 12.000 s 14.000 s 16.000 s 18.000 s

fix Vdd = 1.2V

dynamic Vdd < 1.2V

Supply Voltage (V)

Page 74: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

Workload Prediction Based on Supply Current Tracking

57

Figure 3-14 Evaluation of sampling time in DVS accuracy

3.3.3.1 Sampling time in the setup of Figure 3-10

Now let us analyze the sampling strategy in the experimental setup shown in Figure 3-9. The delay calculation in the setup is as follows

(3-12)

where indicates the sampling time of the current sensor (in the circuit setup has been used as the delay from Processor 1 to Processor 2),

denotes the delay of I2C-write communication and the analogue to digital

converter, is the delay of the fuzzy logic predictor computation, and is the delay of the voltage actuator. These delays are shown in Figure 3-15.

Figure 3-15 Timing analysis of the experimental DVS setup

0 10 20 30 40 50 60 70 80

0.75

0.8

0.85

0.9

0.95

1

Time (msec)

FL

C o

utp

uts

at

2 d

iffr

en

t s

am

plin

g t

ime

s

Evaluation of sampling time in DVFS

algorithm resilience

Ts =2 ms

Ts = 1ms

missing crucial points

Sensoring Delay

Processor 1

(Application)

Processor 2

(FLC)Current

SensorFilter

I2C

ReadR

I2C WriteDAC LDO

Fuzzy

computation

Delay

Communication

Delay

Tsens TFLC Tcomm TLDO

Page 75: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

3. Experimental Results and Practical Issues

58

As it was mentioned in equation (2-6), the sampling time of the supply current should be short enought to acquire a sufficient amount of points. In this setup

the minimum sampling time is defined as follows

(3-13)

It is very important to mention that the sampling time of the average of the

supply current is different from the sampling time of the current sensor . In the circuit setup during , 64 supply current values are sampled and only one final current value is obtained by computing the average; but is defined

as (3-13). Also note that can have different values depending on the componets used in every circuit, e.g. ADC, LDO, or current sensor. However, it should be always selected as small as possible w.r.t. equation (2-6).

To review this concept, let us reason over the results of the experiment shown in Figure 3-16-Figure 3-18, where the supply current profile is shown

with diffrent sampling times . In each sampling event, 64 current points are measured but only the averaged measurement is shown.

First assume that the sampling time of the circuit is .The supply current and the average of the supply current are shown in Figure 3-16.

Figure 3-16 Sampling of the supply current and calculating the average; the sampling time is 10 ms – Note that in every 10 ms, 64 current points are samples and the average is

calculated

Again, it is important to mention that in every sampling period, 64 current values are sampled and one average is calculated. Now, let us increase the sampling time of the circuit to examine how much the average of supply current variations are changed. Figure 3-17 shows the average of the supply current

when the sampling time is increased to w.r.t. the refrence current average profile with the sampling time of 1 . As it is clear from the figure, when the sampling time is increased, the average of the suply current tolerates with some small deviations from the reference supply current profile.

2 4 6 8 10 12 14 16 18

3000

3500

4000

4500

5000

5500

Time (sec)

Cu

rre

nt

(uA

)

Supply current samples and its average

current samples

average of current

Page 76: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

Workload Prediction Based on Supply Current Tracking

59

Figure 3-17 Comparison of the averages of the supply current variations in two different cases: sampling times of 10 and 20 msec;

More deviations happens when the the sampling time is increasded to 100 since the number of the sampled points are less. Figure 3-18 shows the comparison of the average of the current profiles with two sampling times:

and . The average of the supply current in case of does not follow the refrence current profile with . Hence, if is chosen as the sampling time, then the supply voltage will be improperly adjusted and the processor will execute the application with a non optimal supply voltage even if a precise predictor is used. Obviously more crucial points are lost when the sampling time is increased to .

In short, depending on the processor’s clock frequency and the delay of

the controlling loop (3-13), one should choose a minimum value of in equation (2-7). Again, the value should be big enough to ensure that , where is defined in inequality (2-6). Selecting a bigger sampling time means that the probability of missing maximum points in the current signal is increased. Given the unavoidable latency of the closed loop system, the preferred way of using the fuzzy controller is in scenario based configurations for which the application could warn the fuzzy controller of new scenarios to prevent missing critical points. Within a scenario, the guard-band of (2-3) and (2-17) can be adjusted to accommodate for the current range of operation.

2 4 6 8 10 12 14 16

3000

3500

4000

4500

5000

5500

Time (sec)

av

era

ge

of

cu

rre

nt

(uA

)

Averages of the supply current with two sampling times

Refrence Current Signal with Ts= 10ms

Average of Current with Ts = 20ms

Refrence

Page 77: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

3. Experimental Results and Practical Issues

60

Figure 3-18 Comparison of the averages of the supply current variations with two different sampling times: 10 and 100 ms; If the sampling time is increased, then the average of the

supply current w.r.t. the reference one has more discrepancies and it becomes more unreliable to use for DVS - specially the parts shown in the circles

3.3.3.2 Lost of accuracy in the supply current measurements because of the latency of loop

From Section 3.3.3.1, one can see that if , the chance of losing

crucial points in the current profile gradually increases despite the high number of current samples to make the average. Suppose that during , the current

sensor samples numbers of the current points and one average current value is calculated. At the end of , one current value is available and ready to be sent to the fuzzy controller. To sample the next average current point, the current sensor has to wait to receive the next order from processor 2. This will

happen at the end of . Therefore, all the current points in the time interval are missing. In other words, the probability of losing a crucial point

in this case is equal to

.

If the current variations of the application are too much that it is not

possible to capture the average in , then applying the fuzzy technique is not recommended. As way of example, suppose that the supply current of an application is as the one shown in Figure 3-19. (The current profile and the timings shown in Figure 3-19 are not real. They are exaggerated and only used to review the concept). As it is shown in Figure 3-19, there are some peaks in the current profile that are not captured due to the high latency of the system. Of course there is always a chance to capture those current peaks by the predefined robustness guard band , but in general there is no firm guarantee for the correct operation of the circuit. For those applications, an embedded fuzzy controller, current sensor and voltage actuator is recommended due to less latency in the closed loop.

2 4 6 8 10 12 14 16 182500

3000

3500

4000

4500

5000

Time(sec)

Averages of the supply current with two sampling times

av

era

ge

of

cu

rre

nt

(uA

)

Refrence Current Signal with Ts= 10ms

Average of Current with Ts = 100ms

Page 78: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

Workload Prediction Based on Supply Current Tracking

61

Figure 3-19 Accuracy lost because of the latency of the loop in a very high variation supply current profile – Note: the shown current profile in not a real one

In the experimental results shown in Figure 3-16-Figure 3-18, the latency of the circuit becomes critical when the sampling time is bigger than 100ms. In this case when the sampling time is more than 100ms, the average of the supply current is not the right current profile to be predicted. This has been confirmed by running several experiments with different applications as well.

One solution for not missing the crucial points is to use two separate current sensors. In this case, one current sensor normally measures the current by the sampling time , and the second current sensor measures the

current values in the time interval of . In this situation, the second current sensor can catch any missing crucial point in this interval and send it to the fuzzy controller to take it into account.

3.3.3.3 Noise of the supply current measurement

Before closing the supply current sampling analysis, let’s point out that noise measurements are also important and that they need to be taken into account. Based on (2-3), the predicted output signal of the fuzzy controller is

represented by where is the fuzzy logic operation on current samples. If noise measurements are denoted by as is defined in (3-1), then we have:

( ) (3-14)

From (3-14) and since the current values are measured by sensors, the environment and other noises on the measurements have a direct effect on the quality of the data. Note that apart from noise in the measurements, there are already some inaccuracies by digitizing the current samples and by adjusting the voltage actuators. Let us suppose that the supply current variations in a processor running a specific application change between 100 uA and 300 uA

N samples of

current are taken at Tsens

Tsens

Ts

Tsens Tsens

Ts Ts

Ideal average Average signal resulted by sampling

Crucial points are missed to sample

No sampling

Page 79: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

3. Experimental Results and Practical Issues

62

and that an 8 bit analogue to digital converter has been selected to digitize the supply current values. In this case, the resolution of the supply current samples is 0.7813 uA. If a voltage actuator that regulates the supply voltage between 1V and 1.2V with steps of 5 mV are selected, then there are 40 steps of supply voltage to be adjusted based on these current variations. It means that per each 5 uA, there is one step of supply voltage while the current accuracy is 0.78 uA. Therefore, around 22% of the noise in the current sample can result in a fault when adjusting the supply voltage in the worst case. As a result, a good quality current sensor is critical for an accurate DVS system based on current tracking. One solution to protect the circuit against the measurement noise is to allow a wider robustness band in (2-17) at the expense of some power savings loss.

In general, as a very important conclusion, by modifying the fuzzy controller according to the parameters of the available experimental circuit setup, all the practical limitations can be taken into account except long latencies in the system. Long latencies result in wrong supply voltage decisions. This can be clearly seen from Figure 3-18.

3.3.4 Resolution of the Supply Voltage Actuator

Essentially, gaining a high amount of power savings critically depends on the choice of the voltage actuator just as much as designing a precise current predictor. For a voltage actuator, there are two main issues that need to be taken into account: the delay (settling time) and the resolution of the voltage

actuator. Although robustness guard as stated in Chapter 2 is satisfied by the

fuzzy predictor and the output signal is obtained, it still holds that the delay of the supply voltage actuator can significantly affect the accuracy of the whole DVS system. This was described in Section 3.3.3.1 as the sampling

time . The resolution of the voltage actuator plays an important role to save

power when the predicted signal is mapped to a supply value.

Let us suppose that two voltage actuators are available and that they

can produce and possible quantized levels of voltages ( .

For simplicity purposes and without loss of generality assume that and

are even values and where . If the minimum possible value of the supply voltage is and the maximum value of the supply voltage is

, then the voltage intervals and are as

{

(3-15)

Suppose also that the upper and lower boundaries of the predicted fuzzy

output signal are named as and respectively. As it was

described, the fuzzy output signal should be mapped onto supply voltage values. Hence, is equivalent to the maximum voltage value

and is equivalent to the minimum voltage value .

Page 80: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

Workload Prediction Based on Supply Current Tracking

63

Therefore, if vector stores all possible voltage values, there are and voltage levels available as:

{

𝑗 𝑗 (3-16)

The operation of the fuzzy predictor is not dependent on the number of voltage levels stored in or . On the other hand the amount of power savings, which is the ultimate goal of DVS, significantly relies on the resolution of the voltage actuator. According to (3-15), the voltage intervals have the following relations

(3-17)

Consider the case when one uses the voltage actuator with steps instead of

and let us assume that the fuzzy output is a stochastic pattern (phenomenon). At one sampling point of the supply current and one voltage

change, with probability of at least (

)

% power savings is lost

as (3-18).

𝑜 ( 𝑗

𝑗 )

𝑜

(3-18)

This amount of power lost is because of using a voltage actuator with bigger voltage levels steps.

3.3.5 Calculation of the Robustness Guard Band

As in Section 2.5.1 explained, to apply the fuzzy DVS technique, the necessary requirement for a safe supply current tracking (2-17) in Chapter 2 demonstrates that one should always consider the use of enough robustness

guard to protect the circuits against the possible current miss-estimations. Equation (2-20) examines how much robustness guard for the supply current predictions needs to be considered:

where is the number of membership functions used for the fuzzy predictor and also the quantized levels of voltages.

As way of example, consider the mentioned experiment of three applications running in Processor 1. As it is shown in Figure 3-12, the supply

current has maximum value of 6mA. Let us consider . The number of membership considered in this experiment is . Therefore, the

boundary guard of can guarantee the proper operation of the fuzzy DVS. Since the resolution of the voltage actuator is at least ten times more

Page 81: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

3. Experimental Results and Practical Issues

64

than the number of membership functions, can also be acceptable in this experiment. The experimental results have validated this theory.

3.3.6 Number of Supply Current Membership Functions

There is an actual correlation between the numbers of membership

functions, guard band and the delay of the closed loop. By increasing the number of supply current and output fuzzy membership functions (and as a result of increasing the number of fuzzy if-then rules), the accuracy of current tracking will vary. As it was mentioned in equation (2-16), the fuzzy output of the supply current is as follows:

( | ) ∑ 𝑗 ( 𝑗 )

∑ ( 𝑗 )

{ ( 𝑗 )

𝑗

According to this equation, and since the minimum and maximum values of the supply current are fixed values, the only parameter that plays a role in the accuracy of the prediction is the number of membership functions and hence the number of the fuzzy if-then rules. Increasing the number of membership functions results in higher prediction accuracy however it costs more power and implementation complexity. Essentially, by increasing the number of membership functions and fuzzy if-then rules, one can compensate the possible inaccuracy of the current sensor by defining a bigger guard value . To study this concept, let us analyze it with the experiments described in Section 3.3.2. The results shown in Figure 3-11, Figure 3-12, and Figure 3-13 make use of a fuzzy controller that was designed with 25 membership functions

for the supply current and its predicted output . The delay of the fuzzy computation in this case is and the robustness guard of is considered. Now suppose that the number of the membership functions in both

the supply current and the predicted output ( | ) is increased. It follows then

that the fuzzy computation time will be increased accordingly as shown in Figure 3-20.

Figure 3-20 Relation of the number of membership functions and delay of fuzzy predictor

0

5

10

15

20

25

30

10 25 35 45 60

Del

ay

of

pre

dic

tor

(ms)

Number of current and voltage functions

Delay vs number of membership functions

Page 82: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

Workload Prediction Based on Supply Current Tracking

65

Theoretically, the fuzzy predictor has more accuracy to predict the supply current variations if it has more membership functions. But, at the same time it also takes more time to predict one point ahead of the current value. On the other hand, due to the higher resolution of the fuzzy predictor, a smaller protection guard band and more power savings are expected. Consequently, to choose a proper number of membership functions there is always a trade-off among the number of the membership functions, the accuracy of the prediction, and the amount of power savings.

To understand the dependency of the fuzzy based DVS to the number of membership functions, more experiments with different number of membership functions were done. In these experiments, the numbers of the supply current and supply voltage membership functions have been increased from 10 to 60 and accordingly different robustness guard bands are designed based on (2-20). For each experiment, the power savings has also been calculated. The results of these experiments are shown in Figure 3-21. From Figure 3-21, one can observe that increasing the number of membership functions and reducing the robustness guard does not result in more power savings. Adding more membership functions and fuzzy if-then rules dramatically increase the delay of the fuzzy predictor resulting is in less power savings.

By executing different experiments, the best choices for the number of membership functions are acquired from 10 to 25. Note that this choice is only

correct when the fuzzy controller works with a frequency of . Thus to design a fuzzy predictor for other circuit setups, one should design the fuzzy controller based on the dependency of accuracy and the number of membership functions in that specific circuit setup.

Figure 3-21 Relation of the power savings and the resolution of predictor w.r.t. the number

of membership functions and the corresponding robustness bounds

0

20

40

60

80

100

120

10 25 35 45 60

Rob

ust

nes

s gu

ard

(u

A)

Number of membership unctions

Robustness bounds

21.77

17.20

12.01 12.75 12.08

0

5

10

15

20

10 25 35 45 60Po

wer

sa

vin

g (

uW

)

Number of membership functions

Power Savings

Page 83: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

3. Experimental Results and Practical Issues

66

3.3.7 Power Savings Results

Four different applications have been implemented to evaluate the power savings when the fuzzy DVS technique is applied. The first experiment is already fully analyzed in subsections 3.3.1 - 3.3.5. The other three are: JPEG decoding, Dhrystone and Edge detection applications.

To calculate the power savings amounts, the clock frequency of processor 1 is

always held fixed at and only the supply voltage is scaled between 1.2V and 1V. Note that in these experiments, Processor 1 is assumed to work with an unmanaged reasonably high and fixed supply voltage of . With the clock frequncy of , there is a possibility to

reduce the supply voltage to the minimum value of . This minimum voltage of is obtained by performing several experiments at the speed of 100 MHz where Processor 1 is able to run applications. Of course more power savings is achievable if the frequency is scaled down at the cost of performance degradation.

Processor starts to run the applications at and the fuzzy controller is applied to reduce the supply voltage according to the supply current variations. The power savings results are shown in Table 3-4. This table shows the power savings results compared to the fixed unmanaged

supply voltage . The average of power savings is around 20% except for the JPEG Decoding applications since the diffrences between the minimum average and maximum average variations of the supply current are not significant enough to reduce the supply voltage.

Table 3-4 Experimental Results: Power Savings

Application: Multi Task Experiment

(Matrix Multiplication+FIR+While1)

Edge Detection

JPEG Decoding

Dhrystone

Power Savings w.r.t. Vdd=1.2V

21.7% 25.4% 8.87% 20.9%

Note that in these experiments, the fuzzy predictor system is designed with 10 membership functions for the supply current and the fuzzy predicted

output . As the second experiment, consider Figure 3-22 where the current variations and the supply voltage of a Dhrystone application are shown. In this experiment, Processor 1 starts to work with the voltage of 1.2V in the first 8 seconds and subsequently the fuzzy controller is applied to reduce the voltage. There are two main observations from the results of Figure 3-22: 1- the supply voltage is well adjusted by the predicted average of the supply current variations 2- After applying the fuzzy voltage scaling technique, the range of the supply current variations is changed approximately from [3.6mA, 5.5mA] to [2.8mA, 5.4mA] because of the voltage drops.

Page 84: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

Workload Prediction Based on Supply Current Tracking

67

Figure 3-22 The supply current variations (left) and the supply voltage (right) over time (s) in a Dhrystone application – DVS is applied after around 8s to adjust initial unmanaged Vdd =

1.2V

As two more experiments, Figure 3-23 and Figure 3-24 show the experimental results of applying the fuzzy controller in Edge detection and JPEG decoding applications respectively. As one can see from the figures, the supply voltage can be reduced to lower values than 1.2V by DVS methods. But the strong novelity of the fuzzy controller is to reduce the supply voltage as much as possible to precisely track the workload variations of the application.

Again, it is worth to mentioning that all the presented results are based on one unique fuzzy predictor that tracks the supply current of different applications in an on-line approach. Therefore, to switch between different applications, there is no need to update any parameters in the fuzzy structure itslef.

Figure 3-23 Supply current variations (left) and supply voltage (right) in Edge detection

2000.0

7000.0

2625.0

3250.0

3875.0

4500.0

5125.0

5750.0

6375.0

0.000 s 30.000 s6.000 s 12.000 s 18.000 s 24.000 s

0.9000

1.2000

0.9375

0.9750

1.0125

1.0500

1.0875

1.1250

1.1625

0.000 s 30.000 s6.000 s 12.000 s 18.000 s 24.000 s

3742.7

4560

3844.9

3947

4049.2

4151.4

4253.5

4355.7

4457.8

0.000 s 20.091 s4.018 s 8.036 s 12.054 s 16.073 s

1.0895

1.1362

1.0954

1.1012

1.1070

1.1129

1.1187

1.1245

1.1304

0.000 s 20.000 s4.000 s 8.000 s 12.000 s 16.000 s

Page 85: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

3. Experimental Results and Practical Issues

68

Figure 3-24 Supply current (left) and supply voltage (right) in a JPEG decoding application

3.4 Summary

In the first part of Chapter 3, a series of experiments were performed to exhibit the effectiveness of the proposed fuzzy current predictor when compared to five other existing conventional prediction methods. These experiments demonstrated that the fuzzy predictor is the most effective estimator on several representative profiles based on power savings, sum of negative errors (SNE) and R-Square (RSQ) figures of merit. Evaluation of those three figures of merit help us to understand how much a predictor: 1) is able to satisfy the necessary requirement of a safe current tracking as discussed in (2-17) and (2-20), 2) is successful to track a supply current profile, and 3) can save power if it is used in a DVS system. The simulation results and the corresponding discussions were presented in Table 3-2 and Section 3.2.

In the second part of this Chapter, the fuzzy controller was applied on a dual processor circuit as a software-based dynamic voltage scaling method. There were two processors in the experimental circuit setup, which the first one was used to run the applications and the second one was used to run the fuzzy controller. In this Chapter, the experimental setup was comprehensively explained. All the practical issues of applying the fuzzy predictor in a DVS system were also analyzed. These practical issues were summarized as the delay of the closed loop, the resolution of the voltage actuator, the sampling time of the supply current, the prediction accuracy of the fuzzy predictor, number of membership functions, and also consideration of a proper value for the robustness prediction guard . All those issues were extensively studied and possible solutions for each of them were presented.

Tracking results and power savings of applying the fuzzy predictor as the supply power controller on four different applications in the dual processor circuit were also presented in this Chapter.

3851

4616

3946.6

4042.3

4137.9

4233.5

4329.1

4424.7

4520.4

0.000 s 20.091 s4.018 s 8.036 s 12.054 s 16.073 s

1.0895

1.1500

1.0971

1.1046

1.1122

1.1198

1.1273

1.1349

1.1424

0.000 s 20.000 s4.000 s 8.000 s 12.000 s 16.000 s

Page 86: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

69

4Sliding-Mode Control to Compensate PVT

Variations in Dual Core Systems

4.1 Overview

In the last two Chapters, the fuzzy logic controller was comprehensively studied for DVS applications. In this Chapter a supervisory feedback is designed to control the supply voltage or the clock frequency values obtained by the fuzzy controller (or even any other DVFS approaches) to overcome possible process, voltage and temperature PVT variations in a multi-core system. In other words, a robust controller is presented to stabilize the supply voltage and clock frequency values obtained by DVFS.

In this Chapter, the method is described and the approach is shown to work for at least a dual-core architectures in the presence of PVT variations. The model of dual core processors that are communicating with each other across two mixed-voltage and mixed-frequency buffers is obtained. There are two assumptions to utilize the proposed technique: 1) DVFS is applied to both processors to determine the minimum voltage and frequency of each processor and the buffers in between them, 2) The occupancy of both buffers is measurable. Considering the assumptions, a sliding-mode control rule to compensate PVT variations is described in this Chapter. The sliding-mode controller measures the buffer occupancy in the presence of PVT variations. With respect to the reference occupancy value, it adjusts clock frequency to compensate the maximum amount of variations. In fact, the sliding-mode controller is a supervisory feedback controller for DVFS that rejects the impact of PVT variations. The proposed sliding-mode feedback law guarantees the stability of the system against PVT variations. The stability of the sliding-mode feedback rule is proved based on the Lyapunov method and the state-space model of the dual core system. The Chapter is organized as follows: First one short introduction is presented in the next Section. In Section 4-3 the problem description is presented. In Section 4.4 the sliding- mode controller is designed to stabilize system parameters around desired values determined by DVFS in the presence of system uncertainties and PVT variations. The results are presented in Section 4.5.

4.2 Introduction

As it was mentioned, the operating supply voltage and clock frequency determined through DVFS are not always reliable, since they are prone to process, voltage and temperature (PVT) variations. In [27][28], it has been shown that parameter variations pose a major challenge for design and reliability of high performance microprocessors in nanometer technologies. Also, because of the larger impact of memory latency and bandwidth on the overall throughput, multi-core processors are essentially less variation tolerant

Page 87: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

4. Sliding-Mode Control to Compensate PVT variations in Dual Core Systems

70

than single core processors [29][30]. Therefore, a technique to control the nominal behavior of system parameters (supply voltage and clock frequency) is needed to attain the optimum performance in low power multi-core systems.

So far different extensive works have been done to cope with the synchronization and control of multiple concurrent tasks on multiple processor cores [45]. Also two major feedback-based methods have been proposed to deal with the stabilization of voltage and frequency in multiprocessors: the proportional integral derivative (PID) controller presented in [20] and the state-feedback controller presented in [46]. However, a PID controller does not guarantee the correct operation of the processors in the presence of parameter variations [31]. The same argument holds for state-feedback controllers. A state-feedback controller has a limited robustness bound for system parameters against dynamic process variations. Beside feedback controllers, software based look-up tables have been proposed as well to compensate process variations in multi-core processors [47]. Due to the unpredictable nature of PVT variations, look-up table methods are not reliable for diverse applications, and furthermore, the table needs to be designed for each particular application. In this Chapter a new configurations is studied to stabilize the multi-core system against unpredicted variations.

4.3 Problem Description in a Dual-Core Architecture

Consider the dual core architecture shown in Figure 4-1. The state-space model of this architecture is as follows [20][46][48]:

{

(4-1)

where is the occupancy of the th buffer at time

, is the control interval time during which the system parameters,

frequency and supply voltage of processors, are fixed, is the arrival rate of data into the th

buffer at time t, is the departure rate of data from the th

buffer, and is the clock frequency of processor at time .

Figure 4-1 Dual processor architecture used to share and execute applications. Two buffers between processors are used, one for writing data and the other one for reading data

Bus

Data-

Memory

Program-

Memory

Processor

1

Buffer 1Bus

Data-

Memory

Program-

Memory

Processor

2

output-

Memoryinput-

Memory

Buffer 2

Page 88: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

Workload Prediction Based on Supply Current Tracking

71

Suppose that the application is already divided between processors and that the values of and are determined by DVFS, taking into account workload variations to satisfy the worst case execution time (WCET) of the application. If PVT variations do not exist and DVFS determines the frequency values of

processor 1 and 2 as , then the occupancy values of buffer 1 and 2 at time are as . But due to PVT variations the frequency values of

processor 1 and 2 are as and consequently the occupancy values of buffers are as . Since the correct operation of the system depends on nominal parameter values known at design time, it then follows that should approach as much as possible. Our goal is to design two sliding-mode controllers to stabilize system parameters around the desired values (references points) considering PVT variations and possible state-space model uncertainties. The sliding-mode controller modifies the operating frequency (and supply voltage) of processors 1 and 2 to regulate the occupancy values of both buffers to the desired values without being affected by PVT variations and also inaccuracy of the state-space model (4-1). On the other hand the sliding-mode controller modifies the frequency of processors in the neighborhood of their nominal values to compensate PVT variations. Figure 4-2 shows that the frequency values of processors 1 and 2 are determined by the DVFS method (the nominal values) and that the sliding-mode controllers adjust them to minimize PVT variations.

Figure 4-2 General block diagram of the proposed sliding feedbacks to adjust the clock frequencies of the dual core system

4.4 Sliding-Mode Feedback Controller

Sliding-mode control is a high-speed switching feedback control that switches between two values based upon a control rule [39]. In this Section, it is described how to design the sliding-mode feedback controllers to regulate

Processor 1

(V1,f1)

Processor 2

(V2,f2)Buffer 2

Occupation q2

Reference

Buffer Occupancy2

Sliding

controller 1

DVFSInitial f1 Initial f2

Mo

dify

f2

Buffer 1

Sliding

controller 2

Mo

dify

f1

Occupation q1

Reference

Buffer Occupancy 1

Page 89: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

4. Sliding-Mode Control to Compensate PVT variations in Dual Core Systems

72

buffer occupancies of (4-1) by modifying frequency values determined by DVFS. Also, it is proved that the feedback controllers guarantee the stability of the architecture against PVT variations and system uncertainties. The model

(4-1) has two control states: occupancy of buffer 1 and occupancy of buffer 2 , and two input states: frequency of processor 1 and frequency of processor 2 . To regulate buffer occupancy , it is assumed that the

sliding-mode controller adjusts only frequency and hence is fixed. Also for regulating the buffer occupancy the frequency needs to be adjusted by

the second sliding feedback and is fixed. In the following Section the design of two sliding-mode controllers for regulating and around their nominal values is described. The design for buffer 1 is described in the next Section and the same design procedure can be followed for buffer 2.

4.4.1 Individual State-Space Model for Buffer

In the dual core architecture, the frequency of each processor and the corresponding supply voltages are not changing instantaneously and there is a time interval in which the frequencies and voltages are fixed.

Let us denote this time interval as the control interval time in (4-1). Using as the length of the control interval, suppose that the minimum time requirement for one possible change in frequency is Assume that the

sampling period needed to measure the buffer occupancy is .

Furthermore, suppose is the total number of samples of the buffer occupancy and the frequency changes in . Therefore, if ,

then . Also let us assume that the demand and service rate that

hold for are modeled as two independent and stationary random processes along the time axis [49]. Since the goal is to keep the buffer occupancy fixed around the nominal value in presence of PVT variations, we assume here that

frequency is adjustable and is fixed. The same assumption holds for buffer 2 and for stabilizing the frequency is adjustable and is fixed. For simplicity and without loss of generality, let us divide the model (4-1) into two separate state-space models: one state-space for buffer 1 and one for buffer 2.

The state-space model for regulating buffer 1 is defined in (4-2) where the notations defined in Table 4-1 are used.

[

] [

]⏟

[

] [

]

[

]

(4-2)

Now consider the model of (4-2) to design the sliding feedback rule for . For simplicity of formulations, let us define:

(4-3)

hence (4-2) can be rewritten as (4-4).

(4-4)

Page 90: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

Workload Prediction Based on Supply Current Tracking

73

Table 4-1 Notation used for the state-space model of buffer

Symbol Explanation

: Occupancy of buffer 1 at time

where .

: Occupancy variation rate of buffer 1. This state has been defined to control the buffer size with more accuracy. Note that ( )

where .

Average demand (writing) rate in the whole control interval time. Assume

that .

Average service (reading) rate in the whole control interval time. Assume that .

Matrices of the state-space model. system matrix and input matrix. Matrix is always fixed for all dual core systems. The system (4-2) is

always controllable if ≠

Reference occupancy of buffer 1. The goal in buffer 1 is to adjust around the nominal value to compensate PVT variations and approaches to as much as possible.

4.4.2 Modeling of PVT Variations and Uncertainties

Let us model all existing PVT variations, uncertainties and both systematic and random variations with two extra terms in the state-space model as follows

(4-5)

where and are system matrices defined in (4-2) and (4-4), represents

systematic and random parameter variations , models other

external uncertainties and PVT variations, and is the unknown coefficient matrix related to PVT variations. Obviously, because of the random nature of PVT variations, it is not possible to model it with apparent matrices. To design a proper controller, assume a maximum bound for unknown values and matrices. Observe that other traditional feedback controllers [50] are not able to regulate system parameters around the reference points in the presence of variations, noises, uncertainties and other unpredictable disturbances. Assume that , then one can merge all kinds of unknown PVT variations and disturbances into one term and suppose a maximum bound for all unknown terms.

4.4.3 Design the Sliding-Mode Feedback Controller

The procedure to design a sliding-mode controller is, first, to define a line with two control states ( and ), and then, based on the desired

reference point ( with zero derivative), find out a feedback law for to

Page 91: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

4. Sliding-Mode Control to Compensate PVT variations in Dual Core Systems

74

move the buffer occupancy value into the line. The sliding line can be defined in a way that it ends with the reference point.

As an example and without loss of generality, suppose that the desired

occupancy buffer values at control interval time are and . Then, because of variations, the actual values are different, e.g. and . In this case, the sliding line should pass the desired reference point ( such that the control law forces states and to first come onto the line and then keep them following in line while the desired reference point is reached. Figure 4-3 explains the sliding-mode feedback controller from a conceptual standpoint.

Figure 4-3 Moving system states through the defined sliding line

The states of the system (4-5) ( and ) start moving from the initial point to approach the sliding line by a feedback rule. After approaching the line, the switching sliding feedback enforces both sates to move over the line to reach the final desired reference point. In this experiment, the slope of the sliding line is -1 and states start moving from an arbitrary initial point (1,1) to go to the origin (0,0). Note that these initial and final values are only example points to show the sliding-mode feedback concept. Depending on the system model, PVT variations and frequency values these points can take different values.

Suppose now that the maximum amount of parameter variations and state-

space model uncertainties is :

(4-6)

The value represents the maximum of PVT variations and state-space model uncertainties that affects the buffer occupancy 1. To derive a proper feedback controller to stabilize the state-space (4-5), the Lyapunov theory is used which is presented in [39]. The following theorem describes how to design the sliding

0 1

-1

0

1Sliding Mode Control of Frequency

State x1 - Occupancy of FIFO 1

Sta

te x

2 -

Deri

vati

ve o

f o

ccu

pan

cy

Initial Conditions

Refrence Point

Page 92: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

Workload Prediction Based on Supply Current Tracking

75

feedback law for to compensate unknown PVT variations and to model uncertainties besides stabilizing the buffer size.

Theorem- Consider the state-space model of buffer occupancy 1 controlled by frequency (and/or supply voltage) as (4-5) and suppose that the maximum amount of PVT variations and model uncertainties is as (4-6). If the frequency value of processor 2 is fixed, the feedback rule (4-7) for stabilizes the occupancy of buffer 1 in the dual core architecture.

(4-7)

where is the equation of the sliding line, matrix and is an

arbitrary value determined by the designer. Also in (4-7) is a sign function with the following definition:

{

(4-8)

Rule (4-7) can regulate the buffer occupancy 1 to the desired reference points, even if it has initial values far from the desired ones. The designer can change

the value of . Consider Figure 4-2, which shows the proposed closed loop controller configuration to compensate PVT variations. DVFS determines the voltage and frequency values of each processor. Based on a determined and let be the occupancy of buffer 1. The sliding controller

measures the occupancy of buffer 1 as . The term is due to

PVT variations. Then, the sliding controller changes the clock frequency as (4-7) to make the term smaller as much as possible and to compensate PVT

variations. In (4-7), there exists only one free parameter that should be modified by the designer for each application. The parameter can be changed to find the best control rule in sense of PVT rejection.

Proof- Select the Lyapunov function as . The first derivative of with respect to time is

(4-9)

and based on Lyapunov theory, if then the system (4-5) is stable. The Lyapunov function is a positive function corresponding to system states . It is not a unique function and designers can define other Lyapunov

functions for the system and get different control rules. To calculate , use the definition of the sliding line and (4-5). We then have:

(4-10)

Let us divide the feedback control law into two parts:

Page 93: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

4. Sliding-Mode Control to Compensate PVT variations in Dual Core Systems

76

(4-11)

where is the feedback control frequency for known part of the model without

considering PVT variations and model uncertainties, and is the feedback control frequency for unknown part of the model. Hence (4-10) can be rewritten as

(4-12)

From (4-12) it is possible to find as

(4-13)

Therefore, the derivative of the Lyapunov function changes as

(4-14)

Then we always have:

(4-15)

Since the maximum amount of PVT variations in (4-6) is defined, , then in the worst case we have:

(4-16)

by choosing as

(4-17)

The Lyapunov function will always be zero (in case of ) or negative (in

case of ) and the theorem is proved. Therefore, by using (4-7) and choosing a proper and values, the stabilizing buffer occupancy becomes 1 around the desired reference value.

Page 94: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

Workload Prediction Based on Supply Current Tracking

77

4.5 Results

In this Section, the performance of the proposed sliding-mode feedback rule (4-7) in the presence of PVT variations is evaluated by executing different experiments. As the first experiment a state-space model of a dual core system and two FIFOs in between is simulated by the numerical parameters presented in Table 4-2. In this experiment, it has been shown that how the sliding controller regulates the occupancy of buffers around the nominal reference values.

Table 4-2 Numerical Values of the First Experiment, Sliding Feedback Design to Regulate Buffer Occupancies 1 and 2

PARAMETER Explanations

[

]

[

]

System matrices are defined as (4-2). Note that matrix is fixed for all buffer models.

Sliding lines defined by the designer. For each buffer off-line

profiling should be done to find the best values. Select here

[

]

[

]

Matrix mentioned in (4-5) –Note that in this experiment, the

speeds of two-processors are assumed to be the same ( .

Disturbance signal: this models PVT variations that affect the system parameters.

Maximum amount of PVT variations – the value 30 means that

PVT variations change the system parameters with of the nominal values.

Assumption for the average of writing and reading in each buffer.

Assumption: sample the occupancies 100x per control interval

The controller is designed based on (4-7) and the buffer occupancy results of this experiment are shown in Figure 4-4 and Figure 4-5. The occupancy of FIFO 1 in one control interval time is shown in Figure 4-4 and the occupancy of FIFO 2 is shown in Figure 4-5. The sliding-mode feedback rules move the occupancies from unstable conditions to the stable conditions and stabilize them around desired reference values. Different desired values depend on the frequency values of two processors and writing-reading coefficients. In this experiment, it is assumed that PVT variations affect nominal system

Page 95: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

4. Sliding-Mode Control to Compensate PVT variations in Dual Core Systems

78

parameters as shown in Figure 4-6. Note that since the initial conditions are far from the reference points, it takes around for the sliding feedbacks to regulate occupancies. For the purpose of evaluating the controller, in this experiment, it is only assumed that sinusoidal wave PVT variations affect the buffer occupations in the system. Other experiments confirm that if the shape of the PVT variation changes, the buffer occupancy is tuned accordingly.

Figure 4-4 Occupancy of FIFO 1 controlled by the sliding-feedback rule in one control interval time

Figure 4-5 Occupancy of FIFO 2 regulated by the sliding-feedback rule

It is worth mentioning that in case the maximum PVT variations increase to a

value more than of the nominal occupancy value, the buffer occupancy starts to oscillate around its reference value. In this case, the sliding-feedback

cannot stabilize it, unless the PVT variation decreases to a value less than of the nominal value. Also, the choice of parameter as the slope of the sliding line plays an important rule on the operation of the controller. In this experiment if a negative value had been chosen, the controller would break and destabilize the system.

0 20*delta t 40*delta t 60*delta t 80*delta t 100*delta t

q_ref

Occupancy Variation of FIFO 1

Sta

te x

1:

occu

pan

cy

Time Control Interval

0 20*delta t 40*delta t 60*delta t 80*delta t 100*delta t

q_ref

Occupancy Variation of FIFO 2

Sta

te x

1(q

2):

occu

pan

cy

Time Control Interval

Page 96: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

Workload Prediction Based on Supply Current Tracking

79

Figure 4-6 PVT variations used for evaluating the effectiveness of the sliding-mode controller. Note that this is just as arbitrary signal to model PVT variations

In the proposed sliding rule (4-7), it is assumed that is fixed and is

controllable. Likewise, for designing a sliding feedback rule for , it is assumed that is fixed. In practice, these two frequencies change instantaneously together and they may disturb each other’s behavior. Despite the apparent fact

that the sliding rules designed for and don’t take into account each other’s interaction between frequencies, there is no possibility that a positive feedback happens to destabilize buffer occupancy. If, for example, buffer occupancy 1 increases, in practice, it means that PVT variations are causing the system to increase or to decrease . In this case, the first sliding-mode

controller starts reducing (to regulate buffer occupancy 1), while the second sliding controller starts increasing (to regulate buffer occupancy 2). Similarly, both controllers operate in opposite directions to compensate PVT variations when buffer occupancy 1 decreases. When both sliding feedbacks work instantaneously, the number of frequency switchings in each time interval

increases since each increase or decrease of ( ) affects the occupancy of buffer 2 (buffer 1). As an example consider the previous experiment.

Frequency which regulates the occupancy of buffer 1 is shown in Figure 4-7 in the presence of PVT variations. In this case, both frequencies are controlled

by sliding-feedback rules. When and change together, each feedback rule adapts itself with new variations. Therefore, both sliding rules have more

changes of the nominal parameters. Now assume that is not controlled by the second sliding-controller and that it is fixed. In this case frequency changes only due to PVT variations and it turns into the shape shown in Figure 4-8 with much less switching activities.

0 20*delta t 40*delta t 60*delta t 80*delta t 100*delta t-30%

-15%

0%

15%

30%PVT Variations Affecting on FIFO 1 and 2 Occupancies

Time Control Interval

Exte

rnal

Dis

turb

an

ce

Page 97: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

4. Sliding-Mode Control to Compensate PVT variations in Dual Core Systems

80

Figure 4-7 Frequency when is also controlling by sliding rule

Figure 4-8 Frequency when is fixed

4.5.1 FPGA Implementation of the Two-Processor Controlled System

The sliding-controller is implemented in an Altera Statrix II FPGA. The platform of Figure 4-1 with two processors and a shared-memory in between as the buffer are mapped into the FPGA. A JPEG decoding application is selected as our benchmark set-up to evaluate the controller efficiency. The first processor receives input pictures from a JPEG-coded stream to decode them and to send them into the second processor. The second processor reads the decoded stream’s data from the shared-memory to execute an image processing application (e.g. edge or face detection). In this experiment, the goal is to apply the sliding-feedback to control the shared-memory size in the presence of PVT variations. The shared-memory size depends on the image size, which is in VGA format (640×480 pixels). Each processor works with the nominal voltage of 1.2 V and a nominal frequency of 50 MHz. In this experiment, the memory size is measured and compared to the reference size, then is adjusted based on the feedback rule (4-7). The worst-case execution time (WCET) to execute one JPEG decoding application in this experiment is 1.5 msec. Also the sampling time is chosen as msec. It is also assumed that a less than 2% variation in the nominal size value of the memory

0 20*delta t

-20%

Nominal F1

20%

Frequency F1 while F2 changes by Sliding Controller

% V

ari

ati

on

in

F1

Time Control Interval

0 20*delta t

-20%

Nominal F1

20%

Frequency F1 while F2 is fixed

% V

ari

ati

on

in

F1

Time Control Interval

Page 98: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

Workload Prediction Based on Supply Current Tracking

81

is acceptable. For more than 2% variations, the feedback rule should change the frequency to compensate PVT variations and compels the size of the memory to turn back to its reference value. A random PVT variation signal is produced that can influence the operation of the processors by a maximum of 20% variation of the nominal frequency values.

The experimental results of applying the sliding-mode feedback to the two-processor architecture are shown in Figure 4-9 and Figure 4-10. PVT variations and the regulated size of the memory are shown in Figure 4-9. Also, Figure 4-10 shows the sliding-feedback rule for the frequency of processor 1, which changes based on the memory size variations. The feedback rule regulates the memory size based on the maximum amount of parameter variations. In the sliding-feedback rule (4-7), there is always the possibility of defining different boundaries for to speed up the buffer size’s regulating

process. For example in this experiment three boundaries for are defined: , and of the nominal memory size. If the variations

are less than and more than , then the controller changes frequency with steps of . And if the variations are less than and more than of the nominal values, then the controller changes frequency with steps of .

Consider the memory size at time in Figure 4-9 where the memory size is affected by 18% PVT variations. It means that the frequency

has a value 18% more than its nominal value (59MHz) at time . The sliding-feedback, at this time, reduces the frequency with a factor of 10% and sets

MHz. Since there is a linear relationship between the frequency and memory size, at time the memory size will be 8% more than its nominal value. At this time, the controller measures the memory size and since it is less than 10% of the nominal value, it starts reducing the frequency with steps of

with regards to 50 MHZ. Therefore at the end, after , the controller compensates 18% PVT variations.

Figure 4-9 Memory size of the experimental setup affected by PVT variations

-20

-15

-10

-5

0

5

10

15

20

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

Bu

ffer

Ov

erh

ead

(%

)

Time - delta t

Buffer Size Adjustment

buffer overhead

PVT

Page 99: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

4. Sliding-Mode Control to Compensate PVT variations in Dual Core Systems

82

Figure 4-10 Frequency adjustment by the sliding-feedback controller w.r.t. the variations shown in Figure 4-9

4.6 Summary

In this Chapter a robust feedback controller to protect dual core systems against PVT variations has been presented. The feedback controller measures the buffer occupancies and adjusts the frequency of processors in the neighborhood of their nominal values to compensate PVT variations. This technique can be used as a supervisory feedback on the voltage and frequency values obtained by DVFS. The stability of the feedback rules was proved using the Lyapunov theory. Several experiments have been performed to examine the feedback efficiency. Also the implementation results of the feedback on a dual core FPGA were reported.

This proposed feedback could be extended to use in different similar architectures, e.g. network on chips, to stabilize them against uncertainties and variations in the design parameters.

38

43

48

53

58

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

Fre

qu

ency

(M

Hz)

Time - delta t

Frequency Adjustment

Page 100: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

83

5Forward Looking

In this Chapter, the research contributions are briefly summarized. Also the outlook and suggestions for the future research are presented.

5.1 Research Contributions

Workload estimation of digital processors is an important and challenging topic of research. Applying workload estimators for dynamic voltage and frequency scaling purposes enables significant power savings in modern digital circuits and systems. In this thesis, a new application of fuzzy logic controller was presented: being the supply current predictor in DVFS system. Moreover, the effects of process voltage and temperature PVT variations in the dual-core circuits were also studied and a sliding mode feedback rule was designed to compensate for PVT variations. In short, the major contributions and the main concluding remarks of this thesis are as follows:

- The current tracking system has been used within the context of a workload-aware dynamic voltage and frequency scaling (DVFS) system for the sake of reducing power consumption. In this thesis, supply current tracking problem of digital circuits was formulated and a necessary requirement was presented for a safe current prediction. Based on the necessary requirement presented in (2-17), the predicted current values must be bigger than the actual measured values. This ensures the correct operation of the processor in a DVS system. It also protects the predictor against any miss-estimations of the current points during run-time prediction.

- A formal proof of stability of fuzzy controller has been developed within the scope of DVFS based on current prediction. For the stability analysis, Popov theory is used to prove that the supply voltage values obtained by the fuzzy logic controller guarantee the correct operation of digital circuits in DVFS closed loop system.

- The proposed current-tracking fuzzy controller is an effective means, compared to other controllers, that truly tracks the highly dynamic average transient current of the processor. This has been verified in simulations and actual experimental work. Several experiments were performed to prove the effectiveness of the fuzzy predictor when compared to other existing conventional predictors. The comparison has been made based on three solid defined criteria. Also the fuzzy predictor was tested to perform DVS on a dual processor circuit under several real-time working conditions. In these actual experiments, all the practical issues to implement the fuzzy predictor in DVS systems have been analysed. Major practical aspects of the fuzzy DVS system are: resolution of the supply voltage actuators, sampling time of the supply current, accuracy of the fuzzy predictor, protection of the DVS system against

Page 101: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

5. Forward Looking

84

the noise of measurements, protection of the DVS system against miss-estimation of current value by the fuzzy controller, and delays of system components involved in the DVS loop.

- To accurately estimate and track current values, the proposed fuzzy predictor does not require any prior information about the supply current profile, and in consequences, it does not require any off-line profiling or coefficient tuning.

- Due to appropriate definition and computation of the predicted supply current values, the controlled system always has enough supply current to guarantee the required real-time task execution.

- The proposed fuzzy controller can easily be modified by adding new inputs/outputs, fuzzy if-then rules, or membership functions to improve its performance or adapt to new applications.

- In this thesis (Chapter 4), a sliding-mode controller was developed as a supervisory feedback controller for fuzzy DVFS to reject the impact of PVT variations in the context of dual-core systems. The proposed sliding-mode feedback law guarantees the stability of the system against PVT variations.

5.2 Outlook and Suggestions for the Future Research

By measuring the average of supply current in a digital circuit, one can estimate the activity of the circuit and accordingly adjust its supply voltage. The proposed fuzzy predictor (controller) is a good solution to fulfil all the current prediction requirements. Nevertheless the supply voltage decided by the fuzzy controller is not necessarily the “minimum voltage” or the “optimum voltage” that the processor can correctly operate with it. In fact this voltage is a “fuzzy-optimum” value acquired by the fuzzy supply current predictor.

Let’s take one example to make this concept more clear. Consider the performance spread of a sample processor as the one shown in Figure 5-1. Suppose that the processor works at the frequency . In order to achieve this speed, the minimum possible supply voltage that silicon can work with it is . This minimum voltage does not include any substantial voltage margins that normally designers consider them to deal with process variations, system power supply variations, thermal variations or any other random uncertainties or test inaccuracies. In other words, with the

voltage , processor does not operate correctly during the worst-case conditions. To determine a safe supply voltage, a margin should be introduced to guarantee the correct operation of the processor in the worst-case scenarios (at a certain performance demand).

Suppose, the minimum possible voltage that the processor can operate

at the speed of is ; and denotes the margin considered to ensure the correct operation of the processor in worst-case conditions. Also assume the following notations: the voltage margin to compensate for process variation is , the margin to compensate for system

power supply variation or power grid distribution is , the margin to compensate for workload-induced thermal and voltage variation is , the

margin to compensate for random uncertainties and test inaccuracy is ,

Page 102: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

Workload Prediction Based on Supply Current Tracking

85

and the margin to compensate for the voltage actuator inefficiency is . According to the above notations, a reasonable voltage margin is as (5-1).

+ (5-1)

Figure 5-1 Frequency-Voltage spread of a processor

Therefore, the worse-case supply voltage is as follows:

(5-2)

The supply voltage in (5-2) is a guarded and safe supply voltage to be considered for a specific performance demand. Let us assume that 10% margin has been considered for the minimum supply voltage to compensate for all the variations and uncertainties mentioned in (5-1). Looking at Figure 5-1, if

the processor works at 158 MHz, the supply voltage is advised to be 1.2 V rather than 1.1 V (to cope with ). Therefore, depending on the workload variations, the supply voltage can be varied between 1.2 V and 1.1 V. The proposed fuzzy controller is a good solution to be applied in this case. Note that

if the design is such that the minimum voltage is applied to run the processor at (without considering the worse-case margins), then there is no chance to save any power since the processor works at the strict minimum power.

Therefore adding more information to the fuzzy controller is always a wise recommendation. For example in the fuzzy controller, the clock frequency of the processor can be dynamically set based on the critical paths existing in the processor design. The block diagram of Figure 5-2 shows briefly this idea. For a given processor, there are usually several critical paths inherent in the design. Depending on the workload being executed and information about the

0.5

0.55

0.6

0.65

0.7

0.75

0.8

0.85

0.9

0.95

1

1.05

0.9 1 1.1 1.2 1.3

Voltage-Frequency (at Temp. 25 C)N

orm

alize

d fre

qu

en

cy

Supply Voltage (V)

power savings

possibility

Page 103: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

5. Forward Looking

86

critical paths, fuzzy controller can adaptively decide about the minimum possible supply voltage to achieve maximum performance.

Processor

Critical Path

Monitor CPM

Fuzzy Controller

PLL

Ad

jus

t fr

eq

ue

nc

y

Current

Monitors CM

Voltage regulator

Possible info. Over

Execution Time

Figure 5-2 Extending the proposed fuzzy controller by adding more input data e.g. the critical path delay to adjust the clock frequency

Moreover, by changing the inputs-outputs of the proposed fuzzy controller, one can use it for different applications. Let us review some more problems that can be solved by modifying the proposed fuzzy controller.

Some applications of the fuzzy controller can be in the subjects of process variation reduction, thermal effects prediction and other similar power-performance tuning problems. As an example, in [26], the proposed fuzzy controller is modified and applied for the body-bias voltage adjustment of digital circuits. In [26], the digital circuit under control is designed based on a robust sub-threshold library and the fuzzy controller is deployed as a post-silicon technique to adjust its body-bias voltage. In this work, first, a robust library is characterized operating at sub-threshold region to compensate the effect of the performance degradation due to process variations, and then, the fuzzy predictor is designed to control the (forward) body bias voltage to achieve more throughputs and increase the yield. Instead of the supply current as the input of the fuzzy controller, a critical path replica measures the delay of the circuit. Also, instead of the supply voltage as the output of the fuzzy controller, the body bias voltage is adjusted. The results reported in [26] show that by using the fuzzy controller for body bias voltage adjustment, an increase in leakage power (1.8x) with respect to the commercial library has happened. However, the maximum throughput achieved by the new fuzzy-based technique is 4 times bigger, with 100% yield, which means that besides the increase in leakage, the proposed method guaranteed a more energy efficient digital circuit.

As the notable future work, the hardware implementation of the fuzzy controller is strongly recommended. The results presented in Chapter 3 confirm that the fuzzy controller correctly adjusts supply voltage of processors by predicting the supply current. However it is still a software-based DVS method

Page 104: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

Workload Prediction Based on Supply Current Tracking

87

and a second processor is necessary to be used. Hardware implementation of the fuzzy controller will result in reducing the delay of the DVS closed loop system, reducing area and saving more power consumption. Also, no external interface circuit is needed when on-chip fuzzy controller is used. Therefore, on-chip voltage actuators and on-chip current sensors can be used to speed up the current prediction. It is worth to mentioning that the initial step in hardware implementation of the proposed fuzzy controller has been taken in this thesis. In the appendix of this thesis, the synthesis result of implementing the fuzzy controller in VHDL is reported.

Producing a processor including a fuzzy controller as its power management unit is the sincere wish of the author.

Page 105: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

5. Forward Looking

88

Page 106: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

89

References [1] A. Chandrakasan and R. Brodersen, Low Power Digital CMOS Design,

Kluwer Academic Publishers, 1995.

[2] L. Benini, A. Bogliolo, G.A. Paleologo, and G. De Micheli, "Policy Optimization for Dynamic Power Management," IEEE Trans. on Computer-Aided Design of Integrated Circuits and Systems, vol. 18, no. 6, 1999.

[3] V. Tiwari, S. Malik, A. Wolfe, and M. T-C. Lee, "Instruction Level power Analysis and optimization of Software," Journal of VLSI Signal Processing, vol. 13, no. 2-3, pp. 223-238, 1996.

[4] J. Rabaey, Low Power Design Essentials. Springer, pp. 249-288, 2010.

[5] T. Burd, T. Pering, A. Stratakos, and R. Brodersen, "A Dynamic Voltage Scaled Microprocessor System," IEEE Journal of Solid-State Circuits, vol. 35, no. 11, pp. 1571-1580, 2000.

[6] F. Yao, Demers, A. Demers, and S. Shenker, “Scheduling Model for Reduced CPU Energy,” In Proc. of the 36

th Annual Symposium on

Foundations of Computer Science, pp. 374-382, 1995.

[7] R. Jejurikar and R. Gupta, “Energy-Aware Task Scheduling with Task Synchronization for Embedded Real-Time Systems,” IEEE Transaction on Computer Aided Design Integration Circuits and Systems, vol. 25, no. 6, pp. 1024–1037, 2006.

[8] S. Lee and T. Sakurai, “Run-Time Hopping for Low-Power Real-Time Systems,” In Proc. of Design, Automation Conference (DAC), pp. 806-809, 2000.

[9] C. Xian and Y-H. Lu, “Dynamic Voltage Scaling for Multitasking Real-Time Systems with Uncertain Execution Time,” In Proc. of the 16

th ACM Great

Lakes Symposium VLSI, pp. 392-397, 2006.

[10] S. Hong, S. Yoo, B. Bin, and T. Kim, “Dynamic Voltage Scaling of Supply and Body Bias Exploiting Software Runtime Distribution,” In Proc. of Design, Automation and Test in Europe (DATE), pp. 242-247, 2008.

[11] S. Hong, S. Yoo, B. Bin, K. Choi, S. K. Eo, and T. Kim, “Dynamic Voltage Scaling of Supply and Body Bias Exploiting Software Runtime Distribution,” In Proc. Design, Automation and Test in Europe (DATE), pp. 242-247, 2008.

[12] S. Hong, S. Yoo, H. Jin, K. Choi, J. Kong, and S. K. Eo, “Runtime Distribution-Aware Dynamic Voltage Scaling,” In Proc. of the 2006 IEEE/ACM International Conference on Computer-Aided Design (ICCD2006), pp. 587-594, 2006.

[13] L. S. Nielsen, C. Nielssen, J. Sparsø, and K. Van Berkel, "Low-power operation using self-timed circuits and adaptive scaling of the supply voltage," IEEE Transaction on VLSI Systems, vol.2, no. 4, pp. 391–397, 1994.

[14] V. Gutnik and A. P. Chandrakasan, "Embedded power supply for low-power DSP," IEEE Tranactions on VLSI Systesms, vol.5, no.4, pp. 425-435, 1997.

Page 107: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

References

90

[15] A. Sinha and A. P. Chandrakasan, “Dynamic Voltage Scheduling Using Adaptive Filtering of Workload Traces,” In Proc. of 14

th International

Conference on VLSI Design (GLVLSI), pp. 221-226, 2001.

[16] S. Y. Bang, K. Bang, S. Yoon, and E. Y. Chung, “Run-Time Adaptive Workload Estimation for Dynamic Voltage Scaling,” IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems, vol. 28, no. 9, 2009.

[17] F. Xia, Y.-C. Tian, and J. Dong, “Control-Theoretic Dynamic Voltage Scaling for Embedded Controllers” IET Computers and Digital Techniques, vol. 2, no. 5, pp. 377-385, 2008.

[18] A. Varma, B. Ganesh, M. Sen, S. R. Choudhury, K. Srinivasan, and B. Jacob, “A Control-Theoretic Approach to Dynamic Voltage Scaling,” in Proceedings of the 2003 international conference on Compilers, architecture and synthesis for embedded systems, pp. 255-266, 2003.

[19] Y. Gu and S. Chakraborty, "Control Theory-Based DVS for Interactive 3D Games," In Proc. Design and Automation Conf. (DAC), pp. 740–745, 2008.

[20] Q. Wu, P. Juang, M. Martonosi, D. W. Clark, “Formal Online Methods for Voltage/Frequency Control in Multiple Clock Domain Microprocessors,” In Proc. of the 11th International Conference on Architectural Support for Programming Languages and Operating Systems APOLOS, pp. 248-259, 2004.

[21] Q. Wu, P. Juang, M. Martonosi, D. W. Clark, “Formal Control Techniques for Power-Performance Management,” IEEE Micro, vol. 25, no. 5, pp. 52-62, 2005.

[22] A. C. Harvey, Forecasting Structural Time Series Models and the Kalman Filter. Cambridge University Press, Cambridge, 1989.

[23] L. Ljung, System Identification Theory for the User. (2nd Edition), Prentice Hall, 1987.

[24] N. Kandasamy, S. Abdelwahed, G. C. Sharp, and J. P. Hayes, “An Online Control Framework for Designing Self- ptimizing Computing Systems: Application to Power Management,” Self-star Properties in Complex Information Systems, Springer, pp. 174-188, 2005.

[25] H. R. Pourshaghaghi and J. Pineda de Gyvez, "Fuzzy-controlled voltage scaling based on supply current tracking," To Publish in IEEE Transaction on Computers (TC), 2013.

[26] B. Liu, H. R. Pourshaghaghi, S. Moreno Londono, J. Pineda de Gyvez, "Process Variation Reduction for CMOS Logic Operating at Sub-Threshold Supply Voltage," In Proc. of 14th Euromicro Conference on Digital System Design DSD, pp. 135-139, 2011.

[27] S. Borkar, T. Karnik, and V. De, “Design and Reliability Challenges in Nanometer Technologies,” In Proc. of the 40th Annual Design Automation Conference (DAC 04), pp. 75, 2004.

[28] S. Borkar, T. Karnik, S. Narendra, J. Tschanz, A. Keshavarzi, and V. De, “Parameter Variations and Impact on Circuit and Microarchitecture,” In

Page 108: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

Workload Prediction Based on Supply Current Tracking

91

Proc. of the 40th Annual Design Automation Conference (DAC 03), pp. 338-342, 2003.

[29] K. A. Bowman, A. R. Alameldeen, S. T. Srinivasan, and C. B. Wilkerson, “Impact of Die-to-Die and Within-Die Parameter Variations on the Throughput Distribution of Multi-Core Processors,” In Proc. of the Int’l Symposium on Low Power Electronics and Design, pp. 1679-1690, 2007.

[30] E. Humenay, D. Tarjan, and K. Skadron, “Impact of Process Variations on Multicore Performance Symmetry,” In Proc. of the Conference on Design, Automation and Test in Europe (DATE 07), pp. 1653-1658, 2007.

[31] J. B. Gamble and N. D. Vaughan, “Comparison of Sliding Mode Control with State Feedback and PID Control Applied to a Proportional Solenoid Valve,” Journal of Dynamic Systems, Measurement, and Control, vol. 118, no. 3, pp. 434-439, 1996.

[32] W. J. Lambert, M.J. Hill, and R. Ayyanar, "Estimation of Microprocessor Instantaneous Load Current," IEEE Transactions on Advanced Packing, vol. 32, no. 4, Nov. 2009.

[33] A. I. Al-Odienat, A. A. Al-Lawama, "The Advantages of PID Fuzzy Controllers over the Conventional Types," American Journal of Applied Science, vol. 5, no. 6, pp. 653-658, 2008.

[34] C.-C., Lee, "Fuzzy Logic in Control Systems: Fuzzy Logic Controller-Parts 1 and 2," IEEE Transactions on Systems, Man and Cybernetics, vol. 20, no. 2, pp. 404-435, 1990.

[35] M. A. L. Thathachar and P. Viswanath, "On the Stability of Fuzzy Systems," IEEE Transactions on Fuzzy systems, vol. 5, no. 1, pp. 145-151, 1997.

[36] T. Yamashita, "Stability Analysis of Fuzzy Control System Applying Conventional Method," In Proc. of IECON, pp. 1579-1584, 1991.

[37] W. M. Kickert and E. H. Mamdani, "Analysis of a Fuzzy Logic Controller," Fuzzy Sets and Systems 1, vol. 1, pp. 29-44, 1978.

[38] A. Kandel, Y. Luo, and Y. Q. Zhang, "Stability Analysis of Fuzzy Control Systems," Fuzzy Sets and Systems, vol. 105, pp. 33-48, 1999.

[39] H. Khalil, Nonlinear Systems. Prentice Hall, 3rd edition, 2002.

[40] Beagle Board, http://www.beagleboard.org/.

[41] Texas Instrument, "Power Estimation Spreadsheet," 2010' http://processors.wiki.ti.com/index.php/OMAP3530_Power_Estimation_Spreadsheet

[42] A. C. Cameron and F.A.G. Windmeijer, “An R-Squared Measure of Goodness of Fit for Some Common Regression Models,” Journal of Econometrics, vol. 77, no. 2, pp. 329-342, 1997.

[43] Texas Inst. LP38502-ADJ Catalogue, Low Dropout Linear Regulator, http://www.ti.com/product/lp38502-adj

[44] Linear Technology Corporation, LTC2991 Catalogue, Octal I2C Voltage, Current, and Temperature Monitor.

http://cds.linear.com/docs/Datasheet/2991fa.pdf

Page 109: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

References

92

[45] D. Zhu, R. Melhem, and B. R. Childers, “Scheduling with Dynamic Voltage/Speed Adjustment Using Slack Reclamation in Multiprocessor Real-Time Systems,” IEEE Trans. on parallel and Distributed System, vol. 14, no. 7, pp. 686-700, 2003.

[46] U. Y. Ogras, R. Marculescu, and D. Marculescu, “Variation-Adaptive Feedback Control for Networks-on-Chip with Multiple Clock Domains,” In Proc. of the Design Automation Conference DAC 08, pp. 614-619, 2008.

[47] L. Zhang, L. S. Bai, R. P. Dick, L. Shang, and R. Joseph, “Process Variation Characterization of Chip-Level Multiprocessors,” In Proc. of DAC 09, pp. 694-697, 2009.

[48] A. Alimonda, A. Acquaviva, S. Carta, and A. Pisano, "A Control Theoretic to Run-Time Energy Optimization of Pipelined Processing in MPSoCs," In Proc. of Design, Automation and Test in Europe, pp. 1-2, 2006.

[49] R. V. Hogg and A. T. Craig, Introduction to Mathematical Statistics, 5th Edition. Prentice Hall, 1995.

[50] K. Ogata. Modern Control Engineering. 3rd Edition, Prentice Hall, 1996.

[51] S. P. J. Vasantha Rani, P. Kanagasabapathy, and A. Sathish Kumar, "Digital Fuzzy Logic Controller using VHDL," INDICON2005, pp. 463-466, 2005.

[52] P.T. Vuong, A. M. Madni, and J. B. Vuong, "VHDL implementation for a fuzzy logic controller," World Automation Congress WAC '06, pp. 1-8, 2006.

[53] G. Sakthivel, T. S. Anandhi, and S. P. Natarajan, "Real time implementation of a fuzzy logic controller on FPGA using VHDL for DC-Motor speed control," International Journal of Engineering Science and Technology, vol. 2, no. 9, pp. 4511-4519, 2010.

[54] K. Daijin, "An Implementation of Fuzzy Logic Controller on the Reconfigurable FPGA System," IEEE Transactions on Industrial Electronic, vol. 47, no. 3, pp. 703 – 715, 2000.

Page 110: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

93

Curriculum Vitae

Hamid Reza Pourshaghaghi was born on November 19th, 1981 in

Tehran, Iran. He received his Bachelor’s degree in Electronic Engineering from University of Semnan, Iran in 2004 and his Masters degree with honors in Control Engineering from Iran University of Science and Technology (IUST), Tehran, Iran in 2007.

From 2007 to 2008, he has worked as a research assistant in the Chaos-Computing Lab in the Computer Engineering Department of Iran University of Science and Technology.

Since September 2008, he has been a Ph.D. student within the electronic systems group at the Electrical Engineering Department of Eindhoven University of Technology (TU/e) in Eindhoven, The Netherlands. His research was funded by the Dutch Technological Science Foundation (STW) within the project “Synthesis and Implementation of Adaptive Energy-Aware Circuits and System”. His research has led among others to several publications and this thesis. This research was also done partly in cooperation with NXP Semiconductors.

Hamid is currently a postdoctoral researcher, working on “Prototype DSP Receiver Design for Lunar Radio eXplorer LRX Project” in the Department of Astrophysics, Faculty of Science at Radboud University of Nijmegen (RUN).

Page 111: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

Curriculum Vitae

94

Page 112: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

List of Publications Journal Paper

H. R. Pourshaghaghi and J. Pineda de Gyvez, “Fuzzy-Controlled Voltage Scaling Based on Supply Current Tracking” to publish in IEEE Transaction on Computers (TC).

Conference Publications

H. R. Pourshaghaghi, H. Fatemi, and J. Pineda de Gyvez. “Sliding-Mode Control to Compensate PVT Variations in Dual Core Systems,” Design, Automation and Test in Europe, DATE 12, Munich, Dresden. March 11-16, 2012.

H. R. Pourshaghaghi, J. Pineda de Gyvez, “Fuzzy-Controlled Voltage Scaling Based on Supply Current Tracking” A Demo Presentation in ProRISC 2012, Rotterdam, Netherlands, 2012.

B. Liu, H. R. Pourshaghaghi, S. M. Londono, and J. Pineda de Gyvez, “Process Variation Reduction for CMOS Logic Operating at Sub-threshold Supply Voltage,” Euromicro Conference on Digital System Design, DSD 2011, pp. 135-139, 2011.

H. R. Pourshaghaghi and J. Pineda de Gyvez, “Power-Performance Optimization Problem of Processors Operating at Subthreshold Supply Voltage,” Proceedings of ProRISC 2011, 22st Annual Workshop on Circuits Systems and Signal Processing, Veldhoven , the Netherlands, 2011.

H. R. Pourshaghaghi and J. Pineda de Gyvez, “Power-Performance Optimization using Fuzzy Control of Simultaneous Supply Voltage and Body Biasing Scaling,” Proceedings of the 17th IEEE Int. Conference on Electronics, Circuits and Systems (ICECS 2010), pp. 277-280, Athens, Greece, 2010.

S. Moreno Londono, H.R. Pourshaghaghi, and J. Pineda de Gyvez, “Dynamic Voltage Scaling for an Adaptive Energy-Aware 32-bit Multiplier Based on Fuzzy Logic Controller,” Proceedings of ProRISC 2010, Veldhoven, the Netherlands, 2010.

H. R. Pourshaghaghi and J. Pineda de Gyvez, “Dynamic Voltage Scaling Based on Supply Current Tracking using Fuzzy Logic Controller,” Proceedings of the 16th IEEE Int. Conference on Electronics, Circuits and Systems (ICECS 2009), Yasmine Hammamet, Tunesia, pp. 779-782, 2009.

Page 113: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

List of Publications

96

H. R. Pourshaghaghi and J. Pineda de Gyvez, “Adaptive voltage (frequency) scaling based on fuzzy logic controllers,” Proceedings of ProRISC 2009, Veldhoven, The Netherlands, pp. 263-268, 2009.

Book Chapter

H. R. Pourshaghaghi, J. D. Echeverri, and J. Pineda de Gyvez, “Synthesis and VHDL Implementation of Fuzzy Logic Controller for Dynamic Voltage and Frequency Scaling Goals in Digital Processors,” Intech, Fuzzy Logic / Book 2, ISBN 979-953-307-872-3, 2012.

Papers not covered in this thesis

H.R. Pourshaghaghi, R. Ahmadi, M. R. Jahed-Motlagh, and B. Kia, “Experimental realization of reconfigurable three input one output logic function based on a chaotic circuit,” International Journal of Bifurcation and Chaos (IJBC), vol. 20, no. 3, pp. 715-726, 2010.

H. R. Pourshaghaghi, R. Ahmadi, and M. R. Jahed-Motlagh, “Reconfigurable logic blocks based on a discrete chaotic circuit: implementation of all fundamental two input, one output logic functions,” Proceedings of the Second IFAC Conference on Analysis and Control of Chaotic Systems CHAOS09, Queen Marry University of London, London, United Kingdom, Oxford: Pergamon, June 22-24, 2009.

Page 114: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

Appendix

VHDL Implementation of the Fuzzy Logic Predictor

Figure A-1 shows the general architecture of implementing the fuzzy predictor in VHDL where the information flows from left to right. The fuzzy logic controller is designed based on the Mamdani fuzzy inference system (FIS). The first step to implement the predictor as a digital circuit is to convert analogue input values, which are the average of the supply current and its derivative, to digital ones. For this purpose, an analogue to digital converter (ADC) is necessary to digitize the input crisp values. The resolution of the selected ADC depends on the desired accuracy for the supply current, derivative of the supply current and the supply voltage data. For example, suppose that the supply current of a processors change between 0 mA and 10 mA and one has selected an 8-bit ADC. In this case, the resolution of the supply current samples is calculated as follows:

(A-1)

where ) stands for the resolution of supply current, is the maximum of current, and is the minimum of current. Hence if a voltage actuator has been selected to regulate the processor’s voltage between 0.7 V and 1.2 V, the output supply voltage made by the fuzzy controller has steps of 1.95 mV.

Figure A-1 Architecture of the Mamdani Fuzzy Inference System (FIS) for supply current tracking

P

Z

N

I(1)

I(9)

1

I(5)

2

3

25

26

27

dmf_y(2) based

on Rule 1

max

I

)(Idt

d

dmf_y(1) based

on Rule 2

dmf_y(1) based

on Rule 3

dmf_y(9) based

on Rule 25

dmf_y(9) based

on Rule 26

dmf_y(8) based

on Rule 27

FuzzificationMin-Max Mamdani Fuzzy Inference System (FIS) Defuzzification

y

A/D

A/D

Algorithm A-1 Algorithm A-2 Algorithm A-3 Algorithm A-4 Algorithm A-5

dmf_I(1)

dmf_I(1)

dmf_I(1)

dm

f_p

dm

f_N

dm

f_Z

Min {dmf_I(1)

, dmf_P}

Min {dmf_I(1)

, dmf_Z}

Min {dmf_I(1)

, dmf_N}

Min {dmf_I(9)

, dmf_P}

Min {dmf_I(9)

, dmf_Z}

Min {dmf_I(9)

, dmf_N}

{dmf_y(1) ,…, dmf_y(9)}

Fuzzy if then

rules

dm

f_y(2

)

dm

f_y(1

)

Page 115: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

Appendix

98

In this appendix, the design the fuzzy predictor in VHDL is shortly presented. From now assume an 8 bits resolution for all the digital values is considered; and of course without loss of generality, one can extend this design for other resolutions.

A.1 Implementation of the Fuzzification Stage

After digitizing the input crisp values, the first step is to define membership functions for the supply current, derivative of the supply current and the fuzzy output. Let us consider nine membership functions for the supply current, three membership functions for its derivative, and nine membership functions for the fuzzy output. These functions are defined in the triangular shapes like the ones presented in Figure 2-8 combined with the same corresponding Table of fuzzy if-then rules in Table 2-1. Since 8 bits resolution for ADC is considered, the input range of the current should map between 0 ($0) and 255 ($FF). Assume membership functions of the supply current are as the ones shown in Figure A-2. In this Figure, the Y-axis shows the degree of membership function (dmf) as a value between 0 and 1, and the X-axis shows the supply current universe of discourse (UD). All these parameters should to be mapped between 0 and 255. Each membership function in Figure A-2 is represented by four parameters: point1 (P1), the positive slope value, point2 (P2), and the negative slope value. For each current value, depending of its location in X-axis, the degree of membership function (dmf) is a function of these four parameters. The pseudo code to calculate the degree of membership function for a specific input current value is presented in Algorithm A-1.

Algorithm A-1 – Fuzzification: Triangular Membership functions (MFs) for current; calculation of current degree of membership function

Data ( , , slope, , ) : Counter for the Number of membership function for supply current variations : Point 1 of the membership function N shown in Figure A-2

: Point 2 of the membership function N (middle point in each MF)

: 8

: Number of membership function for supply current variations (here: 9)

: Degree of membership functions I: input supply current 1 For to

2 IF 3

4 Elseif

5 ( )

6 Elseif

7 ( )

8 Else

9 10 End

Page 116: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

99

Note that in this pseudo code, it is assumed that the slopes of all triangular membership functions are 8. With this assumption, we do not need to use any multiplier in the circuit to calculate the degree of membership functions. It also helps to increase the computation speed in the circuit.

To calculate the degree of membership functions (dmf) of derivative of the supply current, an algorithm similar to Algorithm A-1 can be used. The only differences are 1) three MFs are defined (N=3) for derivative of the supply current, 2) different slopes are defined for the MFs of derivate of current with slope (MF1) =slope (MF3) =8 and slope (MF2) =16.

Figure A-2 Triangular membership functions for the supply current variations

A.2 Rule Evaluation: Implementation of the Fuzzy Inference System

Suppose that nine membership functions (MFs) for current, three MFs for its derivative, and 27 fuzzy if-the rules are defined to correspondingly

calculate the fuzzy output values . Fuzzy If-Then rules are used by the Mamdani Fuzzy Inference System (FIS) as the configuration shown in Figure A-1. To design Mamdani FIS, let us consider one example of fuzzy if-then rule defined in Table 2-1:

Rule A-1: IF the supply current belongs to I(1) AND the derivative of the supply current belongs to P (Positive) Then the fuzzy output belongs to y(2).

In this rule, AND operator has to be applied to obtain a result value based on two degrees of membership functions (the result of the antecedent part in rule A-1). Actually this value represents a weighting factor for this specific rule A-1. In the Mamdani FIS structure, AND operator is to find the minimum value between two degrees of membership function (dmf): supply current and its derivative. Algorithm A-2 can be used to implement the fuzzy AND operator in VHDL. In Figure A-1, this part is shown ad the product layer, which is one part of the min-max Mamdani FIS.

P1(N) P2(N)=P1(N+1) P2(N+1)=P1(N+2)

N N+1

0

1

Current

value

$FF

$0

Slop values = 8

N+2

De

gre

e o

f m

em

be

rsh

ip f

un

cti

on

Page 117: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

Appendix

100

Algorithm A-2 – Minimum Function for AND operator

Data ( , , min)

: Current degree of membership functions, input

: Derivative of current degree of membership functions, input

min: minimum value of and , output

1 Function Minimum 2 Begin min = 0

3 If < Then

4 min = 5 Else

6 min = 7 End 8 Return min 9 End Minimum

In rule A-1, the output value of the minimum function determines the degree of membership function (dmf) for the output y(2). For each of 27 fuzzy if-then rules, there is a different degree of membership function value. Therefore, one final value for each membership function of the fuzzy output should be determined. The min-max Mamdani FIS uses the maximum operator to calculate the final degree of the membership function for y(1) to y(9). The fuzzy maximum operator models one fuzzy set with the maximum values returned by the output fuzzy (which are obtained for each of 27 rules). Algorithm A-3 can be used for the maximum operator in Mamdani FIS.

Algorithm A-3 – Maximum Function

Data (a, b, max) a,b: represent the dmf_y values (degree of membership function of fuzzy output). This function should be called for each dmf_y(1), …,dmf_y(9) separately. Max: maximum output

1 Function Maximum 2 Begin max =0 3 If a > b then 4 max = a 5 Else 6 max = b 7 End 8 Return max 9 End Maximum

A.3 Implementation of the Defuzzification Stage

In the last stage, Defuzzification converts the obtained fuzzy set into a single number (the resulted fuzzy predicted value). The aggregated fuzzy output set includes a range of fuzzy output values and has to be defuzzified to

determine value. For the Defuzzification stage, the centroid method is used to compute the final value . In the centroid method, the center of area under the curve of the fuzzy output set is computed. From the min-max FIS, nine degrees of membership functions for each output set is obtained (dmf_y(1),…,

Page 118: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

101

dmf_y(9)). For each input value of current and its derivative, there are a maximum of three degree of membership functions that have a nonzero value. Suppose that the aggregated output fuzzy set is as the one shown in Figure A-3.

Figure A-3 Calculation of the final supply voltage value in Defuzzification stage

If the centroid method for the Defuzzification is applied, the output fuzzy value is as follows:

(A-2)

To compute the fuzzy output value , as one can see from (A-2), the following functions are needed to use: summation, multiplier, and divider. Since implementing a divider block results in a circuit that occupies more area, using a look up table (LUT) stored in the memory of processor is proposed. This LUT needs to be filled out by the designer. Under this approach, the data stored in the memory estimates the center of gravity of the output fuzzy set obtained by the min-max Mamdani FIS. Here, the required size of the memory and how to address and access to data in the LUT is described.

To track supply current variations, for each pair of fuzzy inputs (the supply current and its derivative) at a specific time, there is a maximum of three adjacent membership functions for the fuzzy output sets which have degree of membership function value distinct from zero. Therefore, one can use Algorithm A-4 to, first, find those involved output membership functions and, then, use the LUT to calculate the final output value.

To construct the LUT, only the first 3 most significant bits (MSB) of each output membership function are used. Since there is a maximum of three membership functions involved in calculating the final crisp output value, one

needs to consider words of the memory to make the desired LUT. Suppose if one considers the whole 8 bits of each degree of output membership function value, the number of words in the memory changes

to .

y1 y2 y3 y4 y5 y6

dmf-y(3)=dmf-y(4)

dmf-y(1)=dmf-y(2)

dmf-y(5)=dmf-y(6)

Fuzzy output

value

De

gre

e o

f M

F

Page 119: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

Appendix

102

Algorithm A-4 – Specifying the active output membership functions in Defuzzification

Data:

: Number of membership functions for fuzzy output of current (here: 9)

: Counter for the number of membership functions of output of supply current

: Degree of output membership functions

𝑜 : a bit to specify which membership function MF is involved in calculating the final fuzzy output value

1 For to

2 IF Then 3

4 Else 5 End 6 End

For now, let us assume 3 MSBs are considered for each degree of membership function. Depending on the number of the active output membership functions and the corresponding degree of membership functions obtained by the Mamdani FIS, one can access the corresponding word in the memory and access the estimated output value stored in it. Algorithm A-5 presents how to access the proper memory address in the Defuzzification stage.

Algorithm A-5 – How to access data stored in the memory in the Defuzzification stage

Data:

: The address of the memory

: The number of membership function for supply voltage

𝑜 : A bit to specify which membership function is involved in calculating the final voltage value : Output estimated value obtained by the fuzzy controller

1 Counter = 0 2 For to 3 Counter = Counter + 1 4 IF

5 = concatenate ( ) 6 break 7 End IF 8 End For

9 (Counter - 1) + LUT ( )

Now each address of the memory should be filled out by a proper value to estimate the center of gravity accordingly. All the corresponding possible situations for the aggregated fuzzy output sets are simulated in Matlab, and therefore the output values are estimated. Then, all the corresponding values are stored into the 512 bytes considered memory.

Page 120: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

103

A.4 Synthesis Results

Fuzzy predictor has been implemented in a CMOS 90nm technology and synthesized by Cadence RC compiler. For benchmarking purposes, the synthesis of the circuit is done with different speeds. Synthesis specifications are mentioned in Table A-1.

Table A-1 Library specification for synthesizing the fuzzy logic predictor

Synthesis and the Library specifications:

Design Technology Supply Voltage PVT Temperature Frequencies

CMOS 90 nm HVT-TSMC 1.2V Typical corner 25 degree {20, 40,60,80,100,200,333} MHz

The synthesis results are shown in Figure A-4. Since the fuzzy predictor is a digital controller, its circuit does not consume much power and it does not occupy much area as shown in Figure A-4.

Figure A-4 Synthesis results of the fuzzy logic predictor

The main differences between the proposed VHDL implementation of the fuzzy predictor and the other already implemented VHDL fuzzy controllers [51][52][53][54] is about the speed of the controller. In the proposed implementation strategy, there are no multiplier and divider circuits used. Also a fixed slope value for the membership functions has been considered. For these reasons, the circuit naturally works faster.

Since the memory is used to store the Defuzzification data, it is worth to mentioning that the power consumption of the proposed fuzzy circuit is probably higher than the previously reported circuits.

As way of example, the fuzzy predictor circuit is applied on the supply current profile of a processor when it executes an MPEG2-decoding application. The output result of the fuzzy predictor circuit implemented in VHDL is shown in

0

50

100

150

200

250

300

20 40 60 80 100 200 333

Power(uw)

Frequency (MHz)

average area: 7582 um2

area :

8408um2

Page 121: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

Appendix

104

Figure A-5. The output signal of the predictor can accurately track the supply current variations. Also in Figure A-5, the simulation result of the predictor implemented in Matlab is also presented.

Figure A-5 Comparison between the tracking results of the implemented VHDL fuzzy predictor circuit and Matlab simulations

50

70

90

110

130

150

170

190

210

1 6 11 16 21 26 31 36 41 46 51 56 61 66 71 76 81

Supply Current VHDL Output Matlab OutputCurrent [0:255]

Time (ms)

Page 122: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging

105

Reader’s Notes

Page 123: Workload prediction based on supply current tracking : a fuzzy … · Workload Prediction Based on Supply Current Tracking: A Fuzzy Logic Approach . PROEFSCHRIFT . ter verkrijging