Table Of ContentHigh-Performance Embedded
Computing
Applications in Cyber-Physical Systems
and Mobile Computing
Marilyn Wolf
Georgia Institute of Technology
AMSTERDAM(cid:129)BOSTON(cid:129)HEIDELBERG(cid:129)LONDON
NEWYORK(cid:129)OXFORD(cid:129)PARIS(cid:129)SANDIEGO
SANFRANCISCO(cid:129)SINGAPORE(cid:129)SYDNEY(cid:129)TOKYO
MorganKaufmannisanimprintofElsevier
AcquiringEditor:ToddGreen
EditorialProjectManager:NateMcFadden/LindsayLawrence
ProjectManager:MohanambalNatarajan
Designer:MarkRogers
MorganKaufmannisanimprintofElsevier
225WymanStreet,Waltham,MA02451,USA
Secondedition2014
Copyright(cid:1)2014,2007ElsevierInc.Allrightsreserved.
Nopartofthispublicationmaybereproducedortransmittedinanyformorbyanymeans,electronicormechanical,including
photocopying,recording,oranyinformationstorageandretrievalsystem,withoutpermissioninwritingfromthepublisher.Detailson
howtoseekpermission,furtherinformationaboutthePublisher’spermissionspoliciesandourarrangementswithorganizationssuch
astheCopyrightClearanceCenterandtheCopyrightLicensingAgency,canbefoundatourwebsite:www.elsevier.com/permissions.
ThisbookandtheindividualcontributionscontainedinitareprotectedundercopyrightbythePublisher(otherthanasmaybenoted
herein).
Notices
Knowledgeandbestpracticeinthisfieldareconstantlychanging.Asnewresearchandexperiencebroadenourunderstanding,changes
inresearchmethodsorprofessionalpractices,maybecomenecessary.Practitionersandresearchersmustalwaysrelyontheirown
experienceandknowledgeinevaluatingandusinganyinformationormethodsdescribedherein.Inusingsuchinformationormethods
theyshouldbemindfuloftheirownsafetyandthesafetyofothers,includingpartiesforwhomtheyhaveaprofessionalresponsibility.
Tothefullestextentofthelaw,neitherthePublishernortheauthors,contributors,oreditors,assumeanyliabilityforanyinjuryand/or
damagetopersonsorpropertyasamatterofproductsliability,negligenceorotherwise,orfromanyuseoroperationofanymethods,
products,instructions,orideascontainedinthematerialherein.
LibraryofCongressCataloging-in-PublicationData
Wolf,Marilyn,1958-
Highperformanceembeddedcomputing:architectures,applications,andmethodologies/MarilynWolf.–2ndedition.
pagescm
Includesbibliographicalreferencesandindex.
ISBN978-0-12-410511-9
1.Embeddedcomputersystems.2.Highperformancecomputing.I.Title.
TK7895.E42W652014
006.2’2–dc23
2013050704
BritishLibraryCataloguing-in-PublicationData
AcataloguerecordforthisbookisavailablefromtheBritishLibrary
ISBN:978-0-12-410511-9
ForinformationonallMKpublications,
visitourwebsiteatwww.mkp.com
PrintedandboundintheUnitedStatesofAmerica
141516 13121110987654321
To Alec
Acknowledgments
Designations used by companies to distinguish their products are often claimed as
trademarks or registered trademarks. In all instances where Morgan Kaufmann
Publishersisawareofaclaim,theproductnamesappearininitialcapitalorallcapital
letters. Readers, however, should contact the appropriate companies for more
complete informationregarding trademarks andregistration.
ARM,the ARM Powered logo, StrongARM,Thumb,and ARM7TDMIare regis-
tered trademarks of ARM Limited. ARM Powered, ARM7, ARM7TDMI-S,
ARM710T,ARM740T,ARM9,ARM9TDMI,ARM940T,ARM920T,EmbeddedICE,
ARM7T-S,EmbeddedICE-RT,ARM9E,ARM946E,ARM966E,ARM10,AMBA,and
Multi-ICEaretrademarksofARMLimited.Allotherbrandnamesorproductnames
arethepropertyoftheirrespectiveholders.“ARM”isusedtorepresentARMHoldings
plc(LSE:ARMandNASDAQ:ARMHY);itsoperatingcompany,ARMLimited;and
theregionalsubsidiaries:ARM,INC.;ARMKK;ARMKorea,Ltd.
TheAnalogDeviceslogo,SHARC,theSHARClogo,VisualDSP,andtheVisualDSP
logoareregisteredtrademarksofAnalogDevices,Inc.MicrosoftandWindowsareregis-
teredtrademarksandWindowsNTisatrademarkofMicrosoftCorporation.Pentiumis
atrademarkofIntelCorporation.Allothertrademarksandlogosarepropertyoftheir
respectiveholders.
xiii
About the Author
MarilynClaireWolfistheRhesa“Ray”S.FarmerDistinguishedChairofEmbedded
ComputingSystemsandGeorgiaResearchAllianceEminentScholarattheGeorgia
InstituteofTechnology.BeforejoiningGeorgiaTech,Prof.WolfwaswithPrinceton
Universityfrom1989to2007andwithAT&TBellLaboratoriesfrom1984to1989.
She received her B.S., M.S., and Ph.D. degrees from Stanford University in 1980,
1981, and 1984, respectively. She cofounded Verificon Corporation in 2003. She
has been elected to Phi Beta Kappa and Tau Beta Pi. She received the ASEE/CSE
and HP Frederick E. Terman Award in 2003 and the IEEE Circuits and Systems
SocietyEducation Awardin 2006. Sheisa Fellowofthe IEEE and ACM.
xv
Preface to the Second Edition
Inthissecondedition,Itriedtotakeafreshlookatthefieldofembeddedcomputing
and the range of techniques we now can apply to the design of high-performance
embeddedsystems.Astunningrangeofapplicationsnowuseembeddedmultiproces-
sors and complex software stacks: smartphones, airplanes, cars, electric power
equipment, and the list goes on. These complex applications require sophisticated
hardware,software, and design methodologies.
I updated every chapter; some required more revision than others. I also added
a new chapter on cyber-physical systems. CPS has emerged since the publication
of the first edition as a synthesis of control theory and embedded computing. While
CPS leverages many of the techniques described in the other chapters, a number of
newresultsapplytothedesignofcyber-physicalsystems.Itriedtobothoutlinethose
resultsand tohighlighttheir relationship toresults describedin the other chapters.
My editors, Todd Green and Nate McFadden, gave me invaluable support and
advice.Iwouldliketothanktheanonymousreviewersfortheirthoughtfulandhelpful
comments. Anyfaults inthis book, conceptual,technical, orstylistic, are all mine.
Marilyn Wolf
Atlanta GA
xvii
Preface to the First Edition
This book’sgoal istoprovideaframeofreferencefor theburgeoningfieldofhigh-
performance embedded computing. Embedded computers have moved well beyond
the early days of 8-bit microcontrollers. Today, embedded computers are organized
into multiprocessors that run millions of lines of code. They do so in real time and
at very low power levels. In order to properly design such systems, a large and
growingbodyofresearchhasdevelopedtoanswerquestionsaboutthecharacteristics
of embedded hardware and software. These are real systemsdaircraft, cell phones,
anddigitaltelevisionallrelyonhigh-performanceembeddedsystems.Weunderstand
quite a bit about how to design such systems, butwe also have a greatdeal more to
understand.
Real-time control was actually one of the first uses of computersdChapter 1
mentionstheMITWhirlwindcomputer,developedinthe1950sforweaponscontrol.
Butthemicroprocessormovedembeddedcomputingtothefrontburnerasanappli-
cationareaforcomputers.Althoughsophisticatedembeddedsystemswereinuseby
1980,embeddedcomputingasanacademicfielddidn’temergeuntilthe1990s.Even
today,manytraditionalcomputerscienceandengineeringdisciplinesstudyembedded
computing topics without being fully aware of related work being done in other
disciplines.
Embeddedcomputers arevery widely used, with billionssold each year. Ahuge
number of practitioners design embedded systemsda half-million programmers
designembeddedsoftware.Althoughembeddedsystemsvarywidelyintheirdetails,
therearecommonprinciplesthatapplytothefieldofembeddedcomputing.Someof
those principles were discovered decades agowhile others are just being developed
today. The development of embedded computing as a research field has helped to
move embedded system design from a craft to a discipline, a move that is entirely
appropriate given the important (sometimes safety-critical) tasks entrusted to
embedded computers.
One reasonable question to ask about this field is how it differs from traditional
computer systems topics, such as client-server systems or scientific computing. Are
wejustapplyingthesameprinciplestosmallersystemsordoweneedtodosomething
new? I believe that embedded computing, though it makes use of many techniques
from computer science and engineering, poses some unique challenges. First, most
if not all embedded systems must perform tasks in real time. This requires a major
shift in thinking for both software and hardware designers. Second, embedded
computing also puts a great deal of emphasis on power and energy consumption.
Whilepowerisimportantinallaspectsofcomputersystems,embeddedapplications
tend to be closer to the edge of the energy-operation envelope than many general-
purposesystems.Allthisleadstoembeddedsystemsbeingmoreheavilyengineered
to meet a particular set of requirements than aregeneral-purpose computers, which,
after all, are designedforgeneral use.
xix
xx Preface to the First Edition
Thisbookassumesthatyou,thereader,arefamiliarwiththebasicsofembedded
hardware and software, such as might be found in Computers as Components. This
book builds on those foundations to study a range of advanced topics. In selecting
topics to cover, I tried to identify topics and results that are unique to embedded
computing. I did include some background material from other disciplines to help
set the stage for a discussion of embedded systems problems.
Here isabrief tour through the book:
Chapter1providessomeimportantbackgroundfortherestofthebook.Ittriesto
definethesetoftopicsthatareatthecenterofembeddedcomputing.Itlooksatmeth-
odologiesanddesigngoals.Wesurveymodelsofcomputation,whichserveasaframe
of reference for the characteristics of applications. It also surveys several important
applicationsthatrelyonembeddedcomputinginordertoprovidesometerminology
that can be used throughout the book.
Chapter 2 looks at processors. We consider several different styles of processors
that are used in embedded systems. We consider techniques for tuning the perfor-
manceofaprocessor,suchasvoltagescaling.Weconsidertheroleoftheprocessor
memory hierarchy in embedded CPUs. We look at techniques used to optimize
embedded CPUs, such as code compression and bus encoding. We consider tech-
niquesfor simulatingprocessors.
Chapter3studiesprograms.Thebackendofthecompilationprocess,whichhelps
determinethequalityofthecode,isthefirsttopic.Wespendagreatdealoftimeon
memorysystemoptimizationssincememorybehaviorisaprimedeterminantofboth
performance and energy consumption. We consider performance analysis including
bothsimulationandworst-caseexecutiontimeanalysis.Wealsoconsiderhowmodels
of computing are reflected inprogramming models and languages.
Chapter 4 moves up to multiple-process systems. We study and compare sched-
uling algorithms, including the interaction between language design and scheduling
mechanisms. We evaluate operating system architectures and the overhead incurred
by the operating system. We also consider methods for verifying the behavior of
multipleprocesssystems.
Chapter5concentratesonmultiprocessorarchitectures.Weconsiderbothtightly
coupledmultiprocessorsandthephysicallydistributedsystemsusedinvehicles.We
considerarchitecturesandtheircomponents:processors,memory,andnetworks.We
also look at methodologies for multiprocessordesign.
Chapter 6 looks at software for multiprocessors. We consider scheduling algo-
rithms for multiprocessors. We also study middleware architectures for dynamic
resource allocation inmultiprocessors.
Chapter 7 concentrates on hardware/software co-design. We study different
modelsthathavebeenusedtocharacterizeembeddedapplicationsandtargetarchitec-
tures. We study a wide range of algorithms for co-synthesis and we compare the
modelsandassumptionsused by these algorithms.
Hopefullythisbookcoversatleastmostofthetopicsofinteresttoapractitioner
and student of advanced embedded computing systems. Therewere some topics for
which I could find surprisingly little work in the literature, software testing for
Preface to the First Edition xxi
embeddedsystemsbeingaprimeexample.Itriedtofindrepresentativearticlesofthe
major approaches to each problem. I am sure that I have failed in many cases to
adequatelyrepresent aparticularproblem, for which Iapologize.
This book is about embedded computing; it touches upon but does not exhaus-
tivelycoverseveralrelatedfields:
ApplicationsEmbedded systems are designed tosupportapplications like
multimedia,communications,etc.Chapter1introducessomebasicconceptsabout
a fewapplicationsand understanding something about the application domainis
important. Butan in-depthlook at these fields isbest left to others.
VLSI Althoughsystems-on-chipsare an important medium for embedded
systems,theyare notthe only medium. Automobiles, airplanes, and manyother
important systems are controlled by distributedembedded networks.
Hybridsystems The field ofhybridsystems studies the interactions between
continuous anddiscrete systems. This isan important and interestingarea, and
manyembedded systems can makeuse ofhybridsystem techniques, buthybrid
systemsdeservetheir ownbook.
Softwareengineering Softwaredesign isa rich field that providescritical foun-
dations butleavemanyquestionsspecifictoembedded computing unanswered.
Iwouldliketothankallthepeoplewhohavehelpedmewiththisbook:RobertP.
Adler(Intel),BrianButler(Qualcomm),AlainDarte(CNRS),BabakFalsafi(CMU),
RanGinosar(Gen-GurionUniversity),JohnGlossner(Sandbridge), Graham Helles-
trand(VaSTSystems),PaoloIenne(EPFL),MasaharuImai(OsakaUniversity),Irwin
Jacobs(Qualcomm),AxelJantsch(KTH),AhmedJerraya(TIMA),LizyKurianJohn
(UTAustin),ChristophKirsch(UniversityofSalzburg),HarisLekatsas(NEC),Frank
Mueller (NCSU), Pierre Paulin (ST Microelectronics), Laura Pozzi (University of
Lugano),ChrisRowen(Tensukuca),RobRutenbar(CMU),DeepuTalla(TI),David
Whalley(FSU), Jiang Xu(Sandbridge), andShengqi Yang(Intel).
Igreatlyappreciatethesupport,guidance,andencouragementgivenbymyeditor
Nat McFadden, as well as the reviewers he worked with. The review process has
helped identify the proper role of this book and Nat provided a steady stream of
insightful thoughts and comments. I’d also like to thank my long-standing editor at
MorganKaufman, Denise Penrose, who shepherded this bookfrom the beginning.
I’dalsoliketoexpressmyappreciationtodigitallibraries,particularlythoseofthe
IEEEandACM.Iamnotsurethatthisbookwouldhavebeenpossiblewithoutthem.
IfIhadtofindallthepapersthatIstudiedinabricks-and-mortarlibrary,Iwouldhave
rubberylegsfromwalkingthroughthestacks,tiredeyes,andthousandsofpapercuts.
Withthe help ofdigitallibraries, Ionlyhave the tired eyes.
And for the patience ofNancyandAlec, mylove.
Wayne Wolf
Princeton, New Jersey
Description:2nd Edition. — Morgan Kaufmann, 2014. — 488 p. — ISBN-10: 0124105114, ISBN-13: 978-0124105119.In this second edition, I tried to take a fresh look at the field of embedded computing and the range of techniques we now can apply to the design of high-performance embedded systems. A stunning rang