In Praise of High-Performance Embedded Computing: Architectures, Applications, and Methodologies High-Performance Embedded Computing is a timely addition to the literature of system desi
Trang 2In Praise of High-Performance Embedded Computing:
Architectures, Applications, and Methodologies
High-Performance Embedded Computing is a timely addition to the literature of system
design The number of designs, as well as the number of installed embedded systems,vastly surpasses those of general purpose computing, yet there are very few books onembedded design This book introduces a comprehensive set of topics ranging fromdesign methodologies to metrics to optimization techniques for the critical embeddedsystem resources of space, time, and energy There is substantial coverage of the increas-ingly important design issues associated with multiprocessor systems Wayne Wolf is aleading expert in embedded design He has personally conducted research on many ofthe topics presented in the book, as well as practiced the design methodologies on thenumerous embedded systems he has built This book contains information valuable tothe embedded system veteran as well as the novice designer
—Daniel P Siewiorek, Carnegie Mellon University
High-Performance Embedded Computing addresses high-end embedded computers—
certainly an area where a skilled balance between hardware and software competencies
is particularly important for practitioners, and arguably a research domain which will be
at the heart of the most interesting methodological evolutions in the coming years.Focusing on best industrial practices and real-world examples and applications, WayneWolf presents in an organized and integrated way an impressive amount of leading-edgeresearch approaches, many of which will most likely become key differentiators for win-ning designs in the coming decade This is a timely book ideally suited both for practitio-ners and students in advanced embedded computer engineering courses, as well asresearchers and scientists who want to get a snapshot of the important research takingplace at the confluence of computer architecture and electronic design automation
—Paolo Ienne, Ecole Polytechnique Fédérale de Lausanne (EPFL),
Lausanne, Switzerland
As processors continue to leap off our desks and embed themselves into our appliances,our cars, our phones, and perhaps soon our clothing and our wallets, it’s become clearthat embedded computing is no longer a slow, boring sideshow in the architecture circus.It’s moved to the center ring Wayne Wolf’s book pulls all the diverse hardware and soft-ware threads together into one solid text for the aspiring embedded systems builder
—Rob A Rutenbar, Carnegie Mellon University
Educators in all areas of computer systems and engineering should take a look at thisbook Its contrasting perspective on performance, architecture, and design offer anenhanced comprehension of underlying concepts to students at all levels In my opinion,
it represents the shape of things to come for anyone seeking a career in “systems.”
—Steven Johnson, Indiana University
Trang 3More and more embedded devices are available, as people now walk around with cellphones, PDAs, and MP3 players at their side The design and constraints of these devicesare much different than those of a generic computing system, such as a laptop or desktop
PC High-Performance Embedded Computing provides an abundance of information on
these basic design topics while also covering newer areas of research, such as sensor works and multiprocessors
net-—Mitchell D Theys, University of Illinois at Chicago
High-Performance Embedded Computing not only presents the state of the art in
embed-ded computing augmented with a discussion of relevant example systems, it also featurestopics such as software/hardware co-design and multiprocessor architectures for embed-ded computing This outstanding book is valuable reading for researchers, practitioners,and students
—Andreas Polze, Hasso-Plattner-Institute, Universität Potsdam
Embedded computer systems are everywhere This state-of-the-art book brings togetherindustry practices and the latest research in this arena It provides an in-depth and com-prehensive treatment of the fundamentals, advanced topics, contemporary issues, andreal-world challenges in the design of high-performance embedded systems High- Performance Embedded Computing will be extremely valuable to graduate students,
researchers, and practicing professionals
—Jie Hu, New Jersey Institute of Technology
Trang 4High-Performance Embedded Computing
Trang 5About the Author
Wayne Wolf is a professor of electrical engineering and associated faculty incomputer science at Princeton University Before joining Princeton, he was withAT&T Bell Laboratories in Murray Hill, New Jersey He received his B.S., M.S.,and Ph.D in electrical engineering from Stanford University He is well knownfor his research in the areas of hardware/software co-design, embedded comput-ing, VLSI, and multimedia computing systems He is a fellow of the IEEE andACM and a member of the SPIE He won the ASEE Frederick E Terman Award
in 2003 He was program chair of the First International Workshop on ware/Software Co-Design Wayne was also program chair of the 1996 IEEEInternational Conference on Computer Design, the 2002 IEEE InternationalConference on Compilers, Architecture, and Synthesis for Embedded Systems,and the 2005 ACM EMSOFT Conference He was on the first executive com-mittee of the ACM Special Interest Group on Embedded Computing (SIGBED)
Hard-He is the founding editor-in-chief of ACM Transactions on Embedded ing Systems He was editor-in-chief of IEEE Transactions on VLSI Systems
Comput-(1999–2000) and was founding co-editor of the Kluwer journal Design tion for Embedded Systems He is also series editor of the Morgan Kaufmann
Automa-Series in Systems on Silicon
Trang 6High-Performance Embedded Computing
Architectures, Applications, and Methodologies
Wayne Wolf
Princeton University
AMSTERDAM • BOSTON • HEIDELBERG • LONDON NEW YORK • OXFORD • PARIS • SAN DIEGO SAN FRANCISCO • SINGAPORE • SYDNEY • TOKYO
Trang 7Publisher Denise E M Penrose
Publishing Services Mgr. George Morrison
Developmental Editor Nate McFadden
Editorial Assistant Kimberlee Honjo
Text Design Rebecca Evans & Associates
Composition Multiscience Press, Inc.
Technical Illustration diacriTech
Printer Maple-Vail Book Manufacturing Group
Morgan Kaufmann Publishers is an imprint of Elsevier.
500 Sansome Street, Suite 400, San Francisco, CA 94111
This book is printed on acid-free paper.
© 2007 by Elsevier Inc All rights reserved.
Designations used by companies to distinguish their products are often claimed as trademarks or registered trademarks In all instances in which Morgan Kaufmann Publishers is aware of a claim, the product names appear in initial capital or all capital letters Readers, however, should contact the appropriate companies for more complete information regarding trademarks and registration.
No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means— electronic, mechanical, photocopying, scanning, or otherwise—without prior written permission of the publisher Permissions may be sought directly from Elsevier’s Science & Technology Rights Department in Oxford, UK: phone: (+44) 1865 843830, fax: (+44) 1865 853333, e-mail: permissions@elsevier.co.uk You may also complete your request on-
line via the Elsevier homepage (http://elsevier.com) by selecting “Customer Support” and then “Obtaining Permissions.”
Library of Congress Cataloging-in-Publication Data
Application submitted.
ISBN 13: 978-0-12-369485-0
ISBN 10: 0-12-369485-X
For information on all Morgan Kaufmann publications,
visit our Web site at www.mkp.com or www.books.elsevier.com
Printed in the United States of America
06 07 08 09 10 5 4 3 2 1
Trang 8To Nancy and Alec
Trang 9Supplemental Materials
Resources for this book are available at textbooks.elsevier.com/012369485X
The instructor site, which is accessible to adopters who register at
textbooks.elsevier.com, includes:
■ Instructor slides (in ppt format)
■ Figures from the text (in jpg and ppt formats)
■ Solutions to exercises (in pdf format)The companion site (accessible to all readers) features:
■ Links to related resources on the Web
■ A list of errata
Trang 101.4.2 Embedded Systems Design Flows 261.4.3 Standards-Based Design Methodologies 281.4.4 Design Verification and Validation 311.4.5 A Methodology of Methodologies 311.4.6 Joint Algorithm and Architecture Development 32
1.5.1 Why Study Models of Computation? 33
1.5.3 Control Flow and Data Flow Models 38
Trang 111.5.4 Parallelism and Communication 411.5.5 Sources and Uses of Parallelism 45
1.6 Reliability, Safety, and Security 46
1.6.1 Why Reliable Embedded Systems Are Needed? 471.6.2 Fundamentals of Reliable System Design 481.6.3 Novel Attacks and Countermeasures 52
1.7 Consumer Electronics Architectures 54
2.2.3 Embedded versus General-Purpose Processors 69
2.3 RISC Processors and Digital Signal Processors 69
2.4.1 Very Long Instruction Word Processors 77
Trang 122.5 Variable-Performance CPU Architectures 86
2.5.1 Dynamic Voltage and Frequency Scaling 862.5.2 Better-Than-Worst-Case Design 88
3.2 Code Generation and Back-End Compilation 156
3.2.3 Instruction Selection and Scheduling 163
Trang 144.4 Operating System Design 247
4.4.1 Memory Management in Embedded Operating Systems 2484.4.2 Structure of a Real-Time Operating System 250
4.4.5 Interprocess Communication Mechanisms 254
5.2.1 Requirements on Embedded Systems 270
5.2.3 Specialization and Multiprocessors 274
5.3 Multiprocessor Design Techniques 275
5.3.1 Multiprocessor Design Methodologies 2765.3.2 Multiprocessor Modeling and Simulation 277
Trang 155.7 Memory Systems 304
5.7.1 Traditional Parallel Memory Systems 304
5.7.3 Heterogeneous Memory Systems 3075.7.4 Consistent Parallel Memory Systems 309
5.8 Physically Distributed Systems and Networks 312
6.3.3 Scheduling with Dynamic Tasks 359
6.4 Services and Middleware for Embedded Multiprocessors 361
Trang 18Preface
This book’s goal is to provide a frame of reference for the burgeoning field ofhigh-performance embedded computing Computers have moved well beyondthe early days of 8-bit microcontrollers Today, embedded computers are orga-nized into multiprocessors that can run millions of lines of code They do so inreal time and at very low power levels To properly design such systems, a largeand growing body of research has developed to answer questions about the char-acteristics of embedded hardware and software These are real systems—air-craft, cell phones, and digital television—that all rely on high-performanceembedded systems We understand quite a bit about how to design such systems,but we also have a great deal more to learn
Real-time control was actually one of the first uses of computers—Chapter 1mentions the MIT Whirlwind computer, which was developed during the 1950sfor weapons control But the microprocessor moved embedded computing to thefront burner as an application area for computers Although sophisticatedembedded systems were in use by 1980, embedded computing as an academicfield did not emerge until the 1990s Even today, many traditional computer sci-ence and engineering disciplines study embedded computing topics withoutbeing fully aware of related work being done in other disciplines
Embedded computers are very widely used, with billions sold every year Ahuge number of practitioners design embedded systems, and at least a half mil-lion programmers work on designs for embedded software Although embeddedsystems vary widely in their details, there are common principles that apply tothe field of embedded computing Some principles were discovered decades agowhile others are just being developed today The development of embeddedcomputing as a research field has helped to move embedded system design from
Trang 19a 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 tional computer systems topics, such as client-server systems or scientific com-puting Are we just applying the same principles to smaller systems, or do weneed to do something new? I believe that embedded computing, though it makesuse of many techniques from computer science and engineering, poses someunique challenges
tradi-First, most if not all embedded systems must perform tasks in real time Thisrequires a major shift in thinking for both software and hardware designers Sec-ond, embedded computing puts a great deal of emphasis on power and energyconsumption While power is important in all aspects of computer systems,embedded applications tend to be closer to the edge of the energy-operationenvelope than many general-purpose systems All this leads to embedded sys-tems being more heavily engineered to meet a particular set of requirementsthan those systems that are designed for general use
This book assumes that you, the reader, are familiar with the basics ofembedded 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 resultsthat are unique to embedded computing I did include some background materialfrom other disciplines to help set the stage for a discussion of embedded systemsproblems
Here is a brief tour through the book:
■ Chapter 1 provides some important background for the rest of the chapters
It tries to define the set of topics that are at the center of embedded ing It looks at methodologies and design goals We survey models of com-putation, which serve as a frame of reference for the characteristics ofapplications The chapter also surveys several important applications thatrely on embedded computing to provide background for some terminologythat is used throughout the book
comput-■ Chapter 2 looks at several different styles of processors that are used inembedded systems We consider techniques for tuning the performance of aprocessor, such as voltage scaling, and the role of the processor memoryhierarchy in embedded CPUs We look at techniques used to optimizeembedded CPUs, such as code compression and bus encoding, and tech-niques for simulating processors
■ Chapter 3 studies programs The back end of the compilation process,which helps determine the quality of the code, is the first topic We spend agreat deal of time on memory system optimizations, since memory behavior
is a prime determinant of both performance and energy consumption Weconsider performance analysis, including both simulation and worst-case
Trang 20execution time analysis We also discuss how models of computing arereflected in programming models and languages
■ Chapter 4 moves up to multiple-process systems We study and comparescheduling algorithms, including the interaction between language designand scheduling mechanisms We evaluate operating system architectures andthe overhead incurred by the operating system We also consider methods forverifying the behavior of multiple process systems
■ Chapter 5 concentrates on multiprocessor architectures We consider bothtightly coupled multiprocessors and the physically distributed systems used invehicles We describe architectures and their components: processors, mem-ory, and networks We also look at methodologies for multiprocessor design
■ Chapter 6 looks at software for multiprocessors and considers schedulingalgorithms for them We also study middleware architectures for dynamicresource allocation in multiprocessors
■ Chapter 7 concentrates on hardware and software co-design We study ferent models that have been used to characterize embedded applications andtarget architectures We cover a wide range of algorithms for co-synthesisand compare the models and assumptions used by these algorithms
dif-Hopefully this book covers at least most of the topics of interest to a tioner and student of advanced embedded computing systems There weresome topics for which I could find surprisingly little work in the literature: soft-ware testing for embedded systems is a prime example I tried to find represen-tative articles about the major approaches to each problem I am sure that I havefailed in many cases to adequately represent a particular problem, for which Iapologize
practi-This book is about embedded computing; it touches on, but does not tively cover, several related fields:
exhaus-■ Applications—Embedded systems are designed to support applications such
as multimedia, communications, and so on Chapter 1 introduces some basicconcepts about a few applications, because knowing something about theapplication domain is important An in-depth look at these fields is best left
to others
■ VLSI—Although systems-on-chips are an important medium for embeddedsystems, they are not the only medium Automobiles, airplanes, and manyother important systems are controlled by distributed embedded networks
■ Hybrid systems—The field of hybrid systems studies the interactionsbetween continuous and discrete systems This is an important and interest-ing area, and many embedded systems can make use of hybrid system tech-niques, but hybrid systems deserve their own book
Trang 21■ Software engineering—Software design is a rich field that provides criticalfoundations, but it leaves many questions specific to embedded computingunanswered.
I would like to thank a number of people who have helped me with this book:Brian Butler (Qualcomm), Robert P Adler (Intel), Alain Darte (CNRS), BabakFalsafi (CMU), Ran Ginosar (Technion), John Glossner (Sandbridge), GrahamHellestrand (VaSTSystems), Paolo Ienne (EPFL), Masaharu Imai (Osaka Univer-sity), Irwin Jacobs (Qualcomm), Axel Jantsch (KTH), Ahmed Jerraya (TIMA),Lizy Kurian John (UT Austin), Christoph Kirsch (University of Salzburg), PhilKoopman (CMU), Haris Lekatsas (NEC), Pierre Paulin (ST Microelectronics),Laura Pozzi (University of Lugano), Chris Rowen (Tensilica), Rob Rutenbar(CMU), Deepu Talla (TI), Jiang Xu (Sandbridge), and Shengqi Yang (Princeton)
I greatly appreciate the support, guidance, and encouragement given by myeditor Nate McFadden, as well as the reviewers he worked with The review pro-cess has helped identify the proper role of this book, and Nate provided a steadystream of insightful thoughts and comments I’d also like to thank my long-standing editor at Morgan Kaufmann, Denise Penrose, who shepherded thisbook from the beginning
I’d also like to express my appreciation to digital libraries, particularly those
of the IEEE and ACM I am not sure that this book would have been possiblewithout them If I had to find all the papers that I have studied in a bricks-and-mortar library, I would have rubbery legs from walking through the stacks, tiredeyes, and thousands of paper cuts With the help of digital libraries, I only havethe tired eyes
And for the patience of Nancy and Alec, my love
Wayne WolfPrinceton, New Jersey
Trang 221
Embedded Computing
When trying to design computer systems to meet various sorts of able goals, we quickly come to the conclusion that no one system is best for allapplications Different requirements lead to making different trade-offs betweenperformance and power, hardware and software, and so on We must create dif-ferent implementations to meet the needs of a family of applications Solutionsshould be programmable enough to make the design flexible and long-lived, but
Embedded Computing
Trang 23need not provide unnecessary flexibility that would detract from meeting systemrequirements.
General-purpose computing systems separate the design of hardware andsoftware, but in embedded computing systems we can simultaneously design thehardware and software Often, a problem can be solved by hardware means,software means, or a combination of the two Various solutions can have differ-ent trade-offs; the larger design space afforded by joint hardware/softwaredesign allows us to find better solutions to design problems
ded computer designers rely much more heavily on both methodologies andbasic knowledge of applications Let us consider these aspects one at a time
architectures Because embedded system designers work with both hardware and software,
they must study architectures broadly speaking, including hardware, software,and the relationships between the two Hardware architecture problems canrange from special-purpose hardware units as created by hardware/software co-design, microarchitectures for processors, multiprocessors, or networks of dis-tributed processors Software architectures determine how we can take advan-tage of parallelism and nondeterminism to improve performance and lower cost
applications Understanding your application is key to getting the most out of an
embed-ded computing system We can use the characteristics of the application to mize the design This can be an advantage that enables us to perform manypowerful optimizations that would not be possible in a general-purpose system.But it also means that we must have enough understanding of the application totake advantage of its characteristics and avoid creating problems for systemimplementers
opti-methodologies Methodologies play an especially important role in embedded computing
Not only must we design many different types of embedded systems, but we
Figure 1-1 Aspects of embedded system design.
Trang 24also must do so reliably and predictably The cost of the design process itself isoften a significant component of the total system cost Methodologies, whichmay combine tools and manual steps, codify our knowledge of how to designsystems Methodologies help us make large and small design decisions The designers of general-purpose computers stick to a more narrowlydefined hardware design methodology that uses standard benchmarks as inputs
to tracing and simulation The changes to the processor are generally made byhand and may be the result of invention Embedded computing system designersneed more complex methodologies because their system design encompassesboth hardware and software The varying characteristics of embedded sys-tems—system-on-chip for communications, automotive network, and so on—also push designers to tweak methodologies for their own purposes
Steps in a methodology may be implemented as tools Analysis and tion tools are widely used to evaluate cost, performance, and power consump-tion Synthesis tools create optimized implementations based on specifications.Tools are particularly important in embedded computer design for two reasons.First, we are designing an application-specific system, and we can use tools tohelp us understand the characteristics of the application Second, we are oftenpressed for time when designing an embedded system, and tools help us workfaster and produce more predictable tools
simula-modeling The design of embedded computing systems increasingly relies on a
hierar-chy of models Models have been used for many years in computer science toprovide abstractions Abstractions for performance, energy consumption, andfunctionality are important Because embedded computing systems have com-plex functionality built on top of sophisticated platforms, designers must use aseries of models to have some chance of successfully completing their systemdesign Early stages of the design process need reasonably accurate simple mod-els; later design stages need more sophisticated and accurate models
Figure 1-2* shows highlights in the development of embedded computing
We can see that computers were embedded early in the history of computing:
* Many of the dates in this figure were found in Wikipedia; others are from ola.com and http://www.mvista.com.
http://www.motofuture.motor-history of
embedded
computing
Trang 25one of the earliest computers, the MIT Whirlwind, was designed for artillerycontrol As computer science and engineering solidified into a field, earlyresearch established basic techniques for real-time computing Some techniquesused today in embedded computing were developed specifically for the prob-lems of embedded systems while others, such as those in the following list, wereadapted from general-purpose computing techniques.
■ Low-power design began as primarily hardware-oriented but now passes both software and hardware techniques
encom-■ Programming languages and compilers have provided tools, such as Java andhighly optimized code generators, for embedded system designers
■ Operating systems provide not only schedulers but also file systems andother facilities that are now commonplace in high-performance embeddedsystems
Figure 1-2 Highlights in the history of embedded computing.
Trang 26■ Networks are used to create distributed real-time control systems for cles and many other applications, as well as to create Internet-enabledappliances.
vehi-■ Security and reliability are an increasingly important aspect of embeddedsystem design VLSI components are becoming less reliable at extremelyfine geometries while reliability requirements become more stringent.Security threats once restricted to general-purpose systems now loom overembedded systems as well
Some knowledge of the applications that will run on an embedded system is ofgreat help to system designers This section looks at several basic concepts
in three common applications: communications/networking, multimedia, andvehicles
1.2.1 Radio and Networking
illus-networking The Open Systems Interconnection (OSI) model [Sta97a] of the
Interna-tional Standards Organization (ISO) defines the following model for networkservices
1 Physical layer—The electrical and physical connection
2 Data link layer—Access and error control across a single link
3 Network layer—Basic end-to-end service
4 Transport layer—Connection-oriented services
5 Session layer—Control activities such as checkpointing
6 Presentation layer—Data exchange formats
7 Application layer—The interface between the application and the network
Although it may seem that embedded systems are too simple to require use ofthe OSI model, it is in fact quite useful Even relatively simple embedded net-works provide physical, data link, and network services An increasing number
Trang 27of embedded systems provide Internet service that requires implementing thefull range of functions in the OSI model.
The Internet is one example of a network that follows the OSI model The Internet Protocol (IP) [Los97; Sta97a] is the fundamental protocol of the Inter-
net An IP is used to internetwork between different types of networks—the internetworking standard The IP sits at the network layer in the OSI model It
does not provide guaranteed end-to-end service; instead, it provides best-effort routing of packets Higher-level protocols must be used to manage the stream of
packets between source and destination
wireless Wireless data communication is widely used On the receiver side, digital
communication must perform the following tasks
■ Demodulate the signal down to the baseband
■ Detect the baseband signal to identify bits
■ Correct errors in the raw bit stream software radio Wireless data transmitters may be built from combinations of analog, hard-
wired digital, configurable, and programmable components A software radio
is, broadly speaking, a radio that can be programmed; the term defined radio (SDR) is often used to mean either a purely or partly programma-
software-ble radio Given the clock rates at which today’s digital processors operate, they
Figure 1-3 A radio and network connection.
Trang 28are used primarily for baseband operations Several processors can run fastenough to be used for some radio-frequency processing.
software radio
tiers
The SDR Forum, a technical group for software radio, defines the followingfive tiers of SDR [SDR05]
■ Tier 0—A hardware radio cannot be programmed.
■ Tier 1—A software-controlled radio has some functions implemented in
software, but operations like modulation and filtering cannot be altered out changing hardware
with-■ Tier 2—A software-defined radio may use multiple antennas for different
bands, but the radio can cover a wide range of frequencies and use multiplemodulation techniques
■ Tier 3—An ideal software-defined radio does not use analog amplification
or heterodyne mixing before A/D conversion
■ Tier 4—An ultimate software radio is lightweight, consumes very little
power, and requires no external antenna
digital
demodulation
Demodulation requires multiplying the received signal by a signal from anoscillator and filtering the result to select the signal’s lower-frequency version.The bit-detection process depends somewhat on the modulation scheme, butdigital communication mechanisms often rely on phase High-data rate sys-tems often use multiple frequencies arranged in a constellation The phases of
the component frequencies of the signal can be modulated to create differentsymbols
error correction Traditional error-correction codes can be checked using combinational logic
For example, a convolutional coder can be used as an error-correction coder.The convolutional coder convolves the input with itself according to a chosenpolynomial Figure 1-4 shows a fragment of a trellis that represents possiblestates of a decoder; the label on an edge shows the input bit and the producedoutput bits Any bits in the transmission may have been corrupted; the decodermust determine the most likely sequence of data bits that could have producedthe received sequence
Several more powerful codes that require iterative decoding have recentlybecome popular Turbo codes use multiple encoders The input data is encoded
by two convolutional encoders, each of which uses a different but generally ple code One of the coders is fed the input data directly; the other is fed a per-muted version of the input stream Both coded versions of the data are sentacross the channel The decoder uses two decoding units, one for each code Thetwo decoders are operated iteratively At each iteration, the two decoders swaplikelihood estimates of the decoded bits; each decoder uses the other’s likeli-hoods as a priori estimates for its own next iteration
Trang 29sim-Low-density parity check (LDPC) codes also require multiple iterations to
determine errors and corrections An LDPC code can be defined using a tite graph like the one shown in Figure 1-5; the codes are called “low density”because their graphs are sparse The nodes on the left are called message nodes,
bipar-and the ones on the right are check nodes Each check node defines a sum of
message node values The message nodes define the coordinates for codewords;
a legal codeword is a set of message node values that sets all the check nodes to
1 During decoding, an LDPC decoding algorithm passes messages between themessage nodes and check nodes One approach is to pass probabilities for thedata bit values as messages Multiple iterations should cause the algorithm tosettle onto a good estimate of the data bit values
networking A radio may simply act as the physical layer of a standard network stack,
but many new networks are being designed that take advantage of the inherentcharacteristics of wireless networks For example, traditional wired networkshave only a limited number of nodes connected to a link, but radios inherentlybroadcast; broadcasts can be used to improve network control, error correction,and security Wireless networks are generally ad hoc in that the members of the
Figure 1-4 A trellis representation for a convolutional code.
Figure 1-5 A bipartite graph that defines an LDPC code.
Trang 30network are not predetermined, and nodes may enter or leave during networkoperation Ad hoc networks require somewhat different network control than
is used in fixed, wired networks
Example 1-1 looks at a cell phone communication standard
Example 1-1
cdma2000
cdma2000 [Van04] is a widely used standard for spread spectrum-based cellulartelephony It uses direct sequence spread spectrum transmission The dataappears as noise unless the receiver knows the pseudorandom sequence Severalradios can use the same frequency band without interference because the pseu-dorandom codes allow their signals to be separated A simplified diagram of thesystem follows
The spreader modulates the data with the pseudorandom code The leaver transposes coded data blocks to make the code more resistant to bursterrors The transmitter’s power is controlled so that all signals have the samestrength at the receiver
inter-The physical layer protocol defines a set of channels that can carry data orcontrol A forward channel goes from a base station to a mobile station, while
a reverse channel goes from a mobile station to a base station Pilot channels
are used to acquire the CDMA signal, provide phase information, and enable themobile station to estimate the channel’s characteristics A number of differenttypes of channels are defined for data, control, power control, and so on
Trang 31The link layer defines medium access control (MAC) and signaling link access control (LAC) The MAC layer multiplexes logical channels onto the
physical medium, provides reliable transport of user traffic, and managesquality-of-service The LAC layer provides a variety of services: authentication,integrity, segmentation, reassembly, and so on
Example 1-2 describes a major effort to develop software radios for datacommunication
Example 1-2
Joint Tactical Radio System
The Joint Tactical Radio System (JTRS) [Joi05; Ree02] is an initiative of theU.S Department of Defense to develop next-generation communication systemsbased on radios that perform many functions in software JTRS radios aredesigned to provide secure communication They are also designed to be com-patible with a wide range of existing radios as well as to be upgradeable throughsoftware
The reference model for the hardware architecture has two major nents The front-end subsystem performs low-level radio operations while theback-end subsystem performs higher-level network functions The informationsecurity enforcement module that connects the front and back ends helps protectthe radio and the network from each other
Trang 32compo-1.2.2 Multimedia
Today’s dominant multimedia applications are based on compression: digitaltelevision and radio broadcast, portable music, and digital cameras all rely oncompression algorithms This section reviews some of the algorithms developedfor multimedia compression
that try to throw away data that is less perceptible to the human eye and ear.These algorithms also combine lossless compression with perceptual coding toefficiently code the signal
JPEG-style
image
compression
The JPEG standard [ITU92] is widely used for image compression The two
major techniques used by JPEG are the discrete cosine transform (DCT) plus
quantization, which performs perceptual coding, plus Huffman coding as a form
of entropy coding for lossless encoding Figure 1-6 shows a simplified view ofDCT-based image compression: blocks in the image are transformed using theDCT; the transformed data is quantized and the result is entropy coded
The DCT is a frequency transform whose coefficients describe the spatialfrequency content of an image Because it is designed to transform images, theDCT operates on a two-dimensional set of pixels, in contrast to the Fouriertransform, which operates on a one-dimensional signal However, the advantage
of the DCT over other two-dimensional transforms is that it can be decomposedinto two one-dimensional transforms, making it much easier to compute Theform of the DCT of a set of values u(i) is
, (EQ 1-1)
where
(EQ 1-2)Many efficient algorithms have been developed to compute the DCT
v ( ) k( ) 2
N
C k( ) u t( ) π 2t 1( + ) k
2N
cos
Trang 33JPEG performs the DCT on 8 × 8 blocks of pixels The discrete cosine
trans-form itself does not compress the image The DCT coefficients are quantized toadd loss and change the signal in such a way that lossless compression can moreefficiently compress them Low-order coefficients of the DCT correspond tolarge features in the 8 × 8 block, and high-order coefficients correspond to finefeatures Quantization concentrates on changing the higher-order coefficients tozero This removes some fine features but provides long strings of zeros that can
be efficiently encoded to lossless compression
Huffman coding, which is sometimes called variable-length coding, forms
the basis for the lossless compression stage As shown in Figure 1-7, a ized technique is used to order the quantized DCT coefficients in a way that can
special-be easily Huffman encoded The DCT coefficients can special-be arranged in an 8 × 8matrix The 0,0 entry at the top left is known as the DC coefficient since it
describes the lowest-resolution or DC component of the image The 7,7 entry isthe highest-order AC coefficient Quantization has changed the higher-order ACcoefficients to zero If we were to traverse the matrix in row or column order, wewould intersperse nonzero lower-order coefficients with higher-order coeffi-cients that have been zeroed By traversing the matrix in a zigzag pattern, wemove from low-order to high-order coefficients more uniformly This createslonger strings of zeroes that can be efficiently encoded
JPEG 2000 The JPEG 2000 standard is compatible with JPEG but adds wavelet
com-pression Wavelets are a hierarchical waveform representation of the image that
do not rely on blocks Wavelets can be more computationally expensive butprovide higher-quality compressed images
Figure 1-7 The zigzag pattern used to transmit DCT coefficients.
Trang 34video
compression
standards
There are two major families of video compression standards The MPEG
series of standards was developed primarily for broadcast applications cast systems are asymmetric—more powerful and more expensive transmittersallows receivers to be simpler and cheaper The H.26x series is designed for
Broad-symmetric applications, such as videoconferencing, in which both sides mustencode and decode The two groups have recently completed a joint standardknown as Advanced Video Codec (AVC), or H.264, designed to cover both
types of applications An issue of the Proceedings of the IEEE [Wu06] is
devoted to digital television
multiple streams Video encoding standards are typically defined as being composed of several
streams A useful video system must include audio data; users may want to sendtext or other data as well A compressed video stream is often represented as a
system stream, which is made up of a sequence of system packets Each system
packet may include any of the following types of data
■ Video data
■ Audio data
■ Nonaudiovisual data
■ Synchronization informationBecause several streams are combined into one system stream, synchroniz-ing the streams for decoding can be a challenge Audio and video data must beclosely synchronized to avoid annoying the viewer/listener Text data, such asclosed captioning, may also need to be synchronized with the program
Figure 1-8 shows the block diagram of an MPEG-1 or MPEG-2 styleencoder (The MPEG-2 standard is the basis for digital television broadcasting
in the United States.) The encoder makes use of the DCT and variable-lengthcoding It adds motion estimation and motion compensation to encode the
relationships between frames
Trang 35The search point with the smallest SAD is chosen as the point to which S
has moved in the reference frame That position describes a motion vector for
the macroblock (see Figure 1-9) During decompression, motion compensationcopies the block to the position specified by the motion vector, thus saving thesystem from transmitting the entire image
error signal Motion estimation does not perfectly predict a frame because elements of
the block may move, the search may not provide the exact match, and so on An
Figure 1-8 Structure of an MPEG-1 and MPEG-2 style video encoder.
Figure 1-9 Motion estimation results in a motion vector.
Trang 36error signal is also transmitted to correct for small imperfections in the signal.
The inverse DCT and picture/store predictor in the feedback are used to generatethe uncompressed version of the lossily compressed signal that would be seen
by the receiver; that reconstruction is used to generate the error signal
audio
compression
Digital audio compression also uses combinations of lossy and lossless ing However, the auditory centers of the brain are somewhat better understoodthan the visual center, allowing for more sophisticated perceptual encodingapproaches
cod-Many audio-encoding standards have been developed The best known name
in audio compression is MP3 This is a nickname for MPEG-1 Audio Layer 3,
the most sophisticated of the three levels of audio compression developed forMPEG-1 However, U.S HDTV broadcasting, although it uses the MPEG-2system and video streams, is based on Dolby Digital Many open-source audiocodecs have been developed, with Ogg Vorbis being one popular example
audio encoder As shown in Figure 1-10, an MPEG-1 audio encoder has four major
compo-nents [ISO93] The mapper filters and subsamples the input audio samples Thequantizer codes subbands, allocating bits to the various subbands Its parametersare adjusted by a psychoacoustic model, which looks for phenomena that will not
be heard well and so can be eliminated The framer generates the final bit stream
1.2.3 Vehicle Control and Operation
Real-time vehicle control is one of the major applications of embedded ting Machines like automobiles and airplanes require control systems that arephysically distributed around the vehicle Networks have been designed specifi-cally to meet the needs of real-time distributed control for automotive electron-ics and avionics
compu-Figure 1-10 Structure of an MPEG-1 audio encoder.
Trang 37safety-critical
systems
The basic fact that drives the design of control systems for vehicles is thatthey are safety-critical systems Errors of any kind—component failure, designflaws, and so on—can injure or kill people Not only must these systems be care-fully verified, but they also must be architected to guarantee certain properties
microprocessors
and automobiles
As shown in Figure 1-11, modern automobiles use a number of electronicdevices [Lee02b] Today’s low-end cars often include 40 microprocessors whilehigh-end cars can contain 100 microprocessors These devices are generallyorganized into several networks The critical control systems, such as engineand brake control, may be on one network while noncritical functions, such asentertainment devices, may be on a separate network
But why not use general-purpose networks for real-time control? We canfind reasons to build specialized automotive networks at several levels of
Trang 38abstraction in the network stack One reason is electrical—automotive networksrequire reliable signaling under vary harsh environments The ignition systems
of automobile engines generate huge amounts of electromagnetic interferencethat can render many networks useless Automobiles must also operate underwide temperature ranges and survive large doses of moisture
Most important, real-time control requires guaranteed behavior from thenetwork Many communications networks do not provide hard real-time require-ments Communications systems are also more tolerant of latency than are con-trol systems While data or voice communications may be useful when thenetwork introduces transmission delays of hundreds of milliseconds or evenseconds, long latencies can easily cause disastrous oscillations in real-time con-trol systems Automotive networks must also operate within limited power bud-gets that may not apply to communications networks
avionics Aviation electronics systems developed in parallel to automotive electronics
are now starting to converge Avionics must be certified for use in aircraft bygovernmental authorities (in the U.S., aircraft are certified by the Federal Avia-tion Administration—FAA), which means that devices for aircraft are oftendesigned specifically for aviation use The fact that aviation systems are certi-fied has made it easier to use electronics for critical operations such as the oper-ation of flight control surfaces (e.g., ailerons, rudders, elevators) Airplanecockpits are also highly automated Some commercial airplanes already provideInternet access to passengers; we expect to see such services become common
in cars over the next decade
X-by-wire Control systems have traditionally relied on mechanics or hydraulics to
implement feedback and reaction Microprocessors allow us to use hardwareand software not just to sense and actuate but to implement the control laws Ingeneral, the controller may not be physically close to the device beingcontrolled: the controller may operate several different devices, or it may bephysically shielded from dangerous operating areas Electronic control of criti-cal functions was first performed in aircraft where the technique was known as
fly-by-wire Control operations performed over the network are called wire where X may be brake, steer, and so on.
X-by-noncontrol uses Powerful embedded devices—television systems, navigation systems,
Inter-net access, and so on—are being introduced into cars These devices do not form real-time control, but they can eat up large amounts of bandwidth andrequire real-time service for streaming data Since we can only expect theamount of data being transmitted within a car to increase, automotive networksmust be designed to be future-proof and handle workloads that are even morechallenging than what we see today
per-In general, we can divide the uses of a network in a vehicle into several gories along the following axes
cate-■ Operator versus passenger—This is the most basic distinction in vehicle
networks The passenger may want to use the network for a variety of
Trang 39pur-poses: entertainment, information, and so on But the passenger’s networkmust never interfere with the basic control functions required to drive or flythe vehicle.
■ Control versus instrumentation—The operation of the vehicle relies on a
wide range of devices The basic control functions—steering, brakes, tle, and so on in a car or the control surfaces and throttle in an airplane—must operate with very low latencies and be completely reliable Other func-tions used by the operator may be less important At least some of the instru-mentation in an airplane is extremely important for monitoring in-flightmeteorological conditions, but pilots generally identify a minimal set ofinstruments required to control the airplane Cars are usually driven with rel-atively little attention paid to the instruments While instrumentation is veryimportant, we may separate it from fundamental controls in order to protectthe operation of the control systems
throt-1.2.4 Sensor Networks
Sensor networks are distributed systems designed to capture and process data.They typically use radio links to transmit data between themselves and to serv-ers Sensor networks can be used to monitor buildings, equipment, and people
ad hoc
computing
A key aspect of the design of sensor networks is the use of ad hoc networks.
Sensor networks can be deployed in a variety of configurations and nodes can
be added or removed at any time As a result, both the network and the tions running on the sensor nodes must be designed to dynamically determinetheir configuration and take the necessary steps to operate under that networkconfiguration
applica-For example, when data is transmitted to a server, the nodes do not know inadvance the path that data should take to arrive at the server The nodes mustprovide multihop routing services to transmit data from node to node in order
to arrive at the network This problem is challenging because not all nodes arewithin radio range, and it may take network effort and computation to determinethe topology of the network
Examples 1-3 and 1-4 describe a sensor network node and its operating tem, and Example 1-5 describes an application of sensor networks
sys-Example 1-3
The Intel mote 2 Sensor Node
The Intel mote2, which uses a 802.15.4 radio (the ChipCon 2420 radio) as itscommunication link, is a third-generation sensor network node
Trang 40An antenna is built into the board Each side of the board has a pair of nectors for sensor devices, one side for basic devices and another for advanceddevices Several boards can be stacked using these connectors to build a com-plete system.
con-The on-board processor is an Intel XScale con-The processor can be operated atlow voltages and frequencies (0.85V and 15 MHz, respectively) and can be run
up to 416 MHz at the highest operating voltage The board includes 265 MBytes
of SRAM organized into four banks
Source: Courtesy Intel.
Example 1-4
TinyOS and nesC
TinyOS (http://www.tinyos.net) is an operating system for sensor networks It is
designed to support networks and devices on a small platform using only about
200 bytes of memory
TinyOS code is written in a new language known as nesC This languagesupports the TinyOS concurrency model based on tasks and hardware eventhandlers The nesC compiler detects data races at compile time An nesC