SRAM Controller ...115 JPEG Decoder ...116 Application Software Design ...116 Xilinx PowerPC and MicroBlaze Development Kit FX12 Edition ...118 Choosing an Embedded Processor ...118 Micr
Trang 1RAPID PROTOTYPING OF EMBEDDED SYSTEMS
USING FIELD PROGRAMMABLE GATE ARRAYS
Summa Cum Laude Thesis
Bhavya Daya Bachelor of Science in Electrical Engineering Bachelor of Science in Computer Engineering
Spring 2009
Trang 2© 2009 Bhavya Daya
Trang 3To:
God for granting me patience
My mom, dad and brother for their unwavering support
Trang 4ACKNOWLEDGEMENTS
I would like to thank my supervisor, Professor Herman Lam, for his assistance throughout the honors research, Professor Eric Schwartz for obtaining the Xilinx development board for the project, and Professor Ann Gordon-Ross and Professor Prabhat Mishra for being members of my supervisory committee
I would also like to thank Mr Steve Permann, student advisor, for his guidance and support throughout my undergraduate studies at the University of Florida
Trang 5Table of Contents
ACKNOWLEDGEMENTS iv
LIST OF TABLES x
LIST OF FIGURES xi
ABSTRACT xiv
CHAPTER 1 1
INTRODUCTION 1
What is an Embedded System? 1
Design Considerations when Developing an Embedded System 4
Importance of Rapid Prototyping of Embedded Systems using FPGAs 6
Scope of The Project 10
Outline of Chapters 11
CHAPTER 2 12
EMBEDDED SYSTEMS DESIGN 12
Embedded Systems Design Flow 12
Three Generations of Embedded System Design 16
Trends affecting Embedded System Design 19
Overview of Embedded System Hardware and Software 20
CHAPTER 3 21
Trang 6EMBEDDED SYSTEM HARDWARE 21
Peripherals 22
Processor 24
Microcontroller-Based 31
ASIC-Based 32
DSP Processor-Based 35
FPGA-Based 36
Memory 44
CHAPTER 4 50
EMBEDDED SYSTEM SOFTWARE 50
Intellectual Property 50
Stages of Software Development 51
Embedded Operating System 54
Xilinx and Altera Software Tools 58
CHAPTER 5 63
RAPID PROTOTYPING OF EMBEDDED SYSTEMS 63
Rapid System Prototyping 64
Prototyping of Embedded Hardware and Software Systems 69
CHAPTER 6 74
BOARD-LEVEL RAPID PROTOTYPING OF EMBEDDED SYSTEMS 74
Trang 7Board Level Prototyping Methodology 74
Prototyping Platforms using FPGAs 75
Altera DE2 Development and Education Board 75
Xilinx FX12 PowerPC and Microblaze Embedded Development Kit 84
CHAPTER 7 92
EMBEDDED SYSTEM DEVELOPMENT 92
Embedded System Design 95
Altera DE2 Board 95
USB and Embedded Operating System 96
Choosing an Embedded Operating System 98
UCLinux Operating System 99
Porting uCLinux to Nios II Processor and Cyclone II FPGA 100
Means of Implementing Photo Frame Application Using uCLinux 101
Design of Application Software 102
Porting Application to Nios II processor 103
SD Card and Nios Embedded Processor 104
Research of IP Cores 105
Nios II Hardware Design 105
SD Card Interface 106
VGA Interface 110
Trang 8SRAM Controller 115
JPEG Decoder 116
Application Software Design 116
Xilinx PowerPC and MicroBlaze Development Kit FX12 Edition 118
Choosing an Embedded Processor 118
MicroBlaze Processor 119
PowerPC Processor 121
Research IP Cores Available 122
Compact Flash Interface 123
VGA Interface 125
Embedded Processor Hardware Design 126
Embedded Processor Software Design 129
Embedded System Implementation 130
Altera DE2 Board 130
USB and Embedded Operating System 131
SD Card and Nios Embedded Processor 134
Xilinx PowerPC and MicroBlaze Development Kit FX12 Edition 138
Altera DE2 and Xilinx FX12 140
CHAPTER 8 142
FUTURE AND SIGNIFICANCE OF EMBEDDED SYSTEMS 142
Trang 9CHAPTER 9 146
CONCLUSION 146
APPENDIX 150
SD_Card.h 150
Xsysace_selftest_example.c 157
LIST OF REFERENCES 159
Trang 10LIST OF TABLES
Table 1: Comparison of Embedded Processor Cores within FPGAs 42
Table 2: FPGA comparison to ASIC 43
Table 3: Intellectual Property Added at Different Phases 52
Table 4: Common Embedded Operating Systems and Applications 57
Table 5: Demand for Rapid System Prototyping 68
Table 6: Nios II CPU Cores and Key Features 80
Table 7: PowerPC Processor Features 90
Table 8: Embedded Processor Design Checklist [36] 94
Table 9: Comparison of Operating Systems for Altera Development Boards [15] 98
Table 10: SPI Commands [20] 109
Trang 11LIST OF FIGURES
Figure 1 : Time-to-market and market window 7
Figure 2: Design Cycles for FPGAs and ASICs 10
Figure 3: Hardware Software Partitioning and Co-design [5] 15
Figure 4: Compression Technique Hardware Changes 28
Figure 5: Modern Embedded System Components on a Single Chip 30
Figure 6: Processor Type versus Increasing Flexibility 30
Figure 7: FPGA Underlying Fabric [5] 37
Figure 8: Embedded RAM and Multipliers [5] 40
Figure 9: Hardcore processor within a FPGA [5] 41
Figure 10: Main Memory Options 45
Figure 11: Intellectual Property Incorporation into the FPGA Design Cycle [5] 51
Figure 12: Real-time kernel (left) vs general-purpose operating system (right) [3] 58
Figure 13: Debug Information View in Nios II IDE 60
Figure 14: Incremental Development Model [9] 66
Figure 15: Prototyping Design Cycle 72
Figure 16: DE2 Development Board [10] 76
Figure 17: DE2 Development Board Peripherals and FPGA [10] 77
Figure 18: JTAG Programming of Cyclone II FPGA 78
Figure 19: Active Serial Programming of Cyclone II FPGA 79
Figure 20: Cyclone FPGAs 80
Figure 21: Nios II Processor Core 81
Figure 22: Avalon Switch Fabric 83
Trang 12Figure 23: ML403 Development Board [7] 85
Figure 24: ML403 Board and Virtex 4 FPGA Connections 86
Figure 25: Different Methods of Programming of Virtex 4 FPGA 87
Figure 26: Microblaze Processor 88
Figure 27: PowerPC Processor Architecture 89
Figure 28: Application Design and Implementation Choices 97
Figure 29: Hardware Design – High Level 103
Figure 30: Hardware Design – SD Card 106
Figure 31: SD Card Connected to FPGA [17] 107
Figure 32: SPI Command Structure [20] 108
Figure 33: Initialization of Card into Different Modes [20] 109
Figure 34: Block diagram of VGA Core [18] 112
Figure 35: VGA monitor with 640 columns × 480 rows [18] 113
Figure 36: Horizontal and vertical synchronization signals timing diagram [18] 114
Figure 37: VGA Controller Circuit 115
Figure 38: Software Design Flowchart 117
Figure 39: Hardware View of ML403 Embedded MicroBlaze System [24] 120
Figure 40: Hardware View of ML403 Embedded PPC405 System [23] 121
Figure 41: Compact Flash 50 Pin Female Connector [26] 123
Figure 42: System ACE Controller Block Diagram [25] 124
Figure 43: Embedded Processor Hardware Design 128
Figure 44: Software Design Flowchart 129
Figure 45: Nios II Processor Hardware Components 131
Trang 13Figure 46: uCLinux Operating System Running on DE2 Board 133
Figure 47: Hardware and Software Development in Xilinx Platform Studio 138
Figure 48: Embedded Processor Hardware Implementation 139
Figure 49: Transition to System on Silicon or System on Chip 143
Figure 50: Rapid System Prototyping and Rapid Application Development 149
Trang 14ABSTRACT
The objectives of the project were to review developments in embedded system design and future trends, and to explore board-level rapid prototyping using FPGAs The embedded process design flow consists of many important steps that make it essential
to achieve a functioning final product within the allocated design time In order to make appropriate decisions, embedded systems hardware and software knowledge is an important requirement The embedded hardware decisions are analyzed in terms of processor, memory, and peripheral requirements and limitations The embedded software process is reviewed as well as the necessary considerations to be made by the designer The rapid prototyping strategy and the board-level prototyping method are described as a significant piece of the embedded system design flow As an addition to simulation, prototyping provides functional and performance verification The development platforms that were researched are the Altera DE2 board and the Xilinx Microblaze and PowerPC FX12 Development Kit A test application was designed following the principles of embedded system design and development The future of embedded systems greatly shifts from system on board to system on silicon and designers have to take into account different limitations With many-core processors emerging, designers need to be able to reach peak performance by utilizing the full potential of many cores
Trang 15CHAPTER 1 INTRODUCTION
The development of an embedded system contains many stages and decisions The decisions are based on the application and the standard challenges posed when developing any embedded system Before development, it is vital to understand what
an embedded system is The term is used frequently without giving much thought to the definition Once a product idea is established, the stages of development depend on the product Is the product an embedded system? If the product isn’t, different design considerations and stages of development are followed The embedded system market contains many time constraints The product should be deployed when the demand for the product still exists, if the demand ceases then the product would not yield any profit for the company Rapid prototyping is needed in order for the product to be revealed within the time frame allotted The steps of embedded system design and development are outlined and applied to a test application in later chapters
What is an Embedded System?
An embedded system is a set of circuitry that is lodged within other devices The presence of the internal computer or system is not immediately obvious, but the embedded system market is the fastest growing portion of the computer market The embedded devices range from everyday devices to advanced embedded systems used for complex applications A more formal definition is that an embedded system is a digital system with at least one processor that implements a hardware function that is a
Trang 16part or all of the digital system The processor that is used in an embedded system is an embedded processor
The embedded system usually contains a single function Some systems do exist that are programmable and contain couple different functions, such as PDAs Applications of embedded systems can be broken down into four types, signal processing, mission critical, distributed control, and small systems Signal processing systems could encompass all embedded systems, but the scope is defined to radar, sonar, and real-time video applications Mission critical systems include avionic, space-craft control and nuclear plant control Distributed control systems consist of large networks and routers and transit systems Small systems are usually thought of when considering embedded systems, but it is important not to forget the other types The most well-known small embedded system today is the cell phone Other examples are digital cameras, sensors, and mp3 players The future and trends of embedded systems are discussed in a later chapter
Compared to desktop and server systems, embedded systems contain a larger range of processing power The price of the system is constrained for embedded systems, unlike desktop systems, and it is a key factor when designing the products for this part of the computer market The typical characteristics of an embedded system are
as follows
1 Designed to perform a single or application specific task, rather than multiple tasks Many embedded systems consist of small parts that fit within a larger
Trang 17device The larger device could be a general purpose system An embedded system is usually part of a larger system
2 Many embedded systems contain real-time constraints The design requirements vary by the applications, but usually power, cost, reliability and performance are emphasized The amount of heat produced by the device may be of importance The weight of the device should be minimized for most embedded system applications
3 The embedded system should not cease operation This is a farfetched goal, but the power usage and battery life should be utilized appropriately Reduction in power usage will greatly increase the battery life and the system would operate for a longer period of time
4 Embedded systems usually interact with the outside world in the form of LCD displays, speakers, keyboard, and other visual and auditory signals The interactions allow the users to operate the system and to specify certain commands
5 Although embedded systems are application specific, some degree of programmability is desired and essential The re-programmability assists when upgrading the devices, it is much easier to change the software slightly rather than develop the entire hardware from scratch
re-6 The program written for embedded systems, firmware, is stored in a limited amount of memory Designers need to consider the limited memory and computer hardware resources when developing embedded systems
Trang 18The main goals when designing an embedded system are to minimize memory and power usage The cost of the device will decrease when the parameters are optimized Tradeoffs when designing are also encountered and they will be discussed in the next section
Design Considerations when Developing an Embedded System
Embedded systems are within every industry, from aerospace to consumer applications With the new advances in embedded systems design, more complex applications may be implemented During the development of an embedded system certain process models are followed These models usually include the development of a working prototype of the final system Embedded systems are single-functioned systems which are tightly constrained by power and cost, and are reactive and real-time
Embedded problems can be solved using different approaches Approaches that are used in practice are as follows
1 The designer can use a combined hardware/software approach that contains some custom hardware and an embedded processor core integrated within the custom hardware
2 The designer can create custom software that runs on an off-the-shelf embedded processor
3 The designer uses another type of processor besides a general purpose embedded processor, such as a digital signal processor, and a custom software
Trang 19Since embedded systems usually perform a single function, an Application Specific Integrated Circuit (ASIC) is usually used in the final product development When designing an embedded system, many design challenges emerge These challenges determine the type of chip that will be used In order to design a near optimal system, the following need to be considered besides the functionality and safety of the system
1) Cost 2) Performance 3) Power 4) Maintainability 5) Size
6) Time-to-Market Many embedded systems have substantially different design constraints than desktop computing applications A single characterization cannot apply to the diverse spectrum of embedded system, and the considerations are weighed differently, based
on the type of application and consumers
The cost of the embedded system is a very important factor during the embedded system design process The affordability of the product by many consumers and the profit that can be generated by the device is important while designing The cost is considered based on the application at hand and it can vary depending on the product requirements Performance is a factor that is always considered in systems An embedded system should perform its functions and complete them quickly and accurately High performance is especially emphasized in many embedded systems
Trang 20People using these systems want the functions of the system to be optimal Low power
is an important requirement for embedded systems The embedded systems usually run
on batteries and should last a long time before those batteries need to be changed An ultra-low power design needs to be developed for long-term battery operation
In many cases embedded systems must be repairable in a few minutes to a few hours, which imply that spare components and maintenance personnel must be located close to the system A fast repair time may also imply that extensive diagnosis and data collection capabilities must be built into the system, which may affect the goal of keeping production costs low A system self-test can be created in the design to lower the maintenance and diagnosis costs that might be incurred later
Typically, embedded computers are physically located within some larger device
or casing Therefore, their shape and size may be dictated by the space available and the connections to the mechanical components Time-to-market (TTM) is the length of time from the product idea conception until it is available for sale TTM is important in industries where products are outdated quickly, such as the technology industry The market window, shown in Figure 1, is crucial to deploying a product in the embedded systems technology industry The typical TTM is eight months The company needs to deploy when the peak revenue can be attained
Importance of Rapid Prototyping of Embedded Systems using FPGAs
The significance of rapid prototyping of embedded systems can best be explained by briefly reviewing the trends seen in the embedded system development process
Trang 21Figure 1 : Time-to-market and market window
The first trend noticed is that the life cycle of embedded products is becoming increasingly smaller This will lead to new developments taking place more frequently to replace the outdated products The second trend is that the complexity of the embedded system is rapidly increasing With this increase in functionality and complexity of systems, the embedded system design cycle may be longer and require more time and manpower The consumer’s demand for increasing functionality translates directly into the increased complexity of the embedded system on a chip
There exists a complexity gap between the application requirements and the capabilities of current silicon technologies The real world system-on–chip (SOC) complexities lag behind the capabilities of the silicon hardware even though the demand for high complexity functionality is increasing tremendously The tools to exploit the hardware fully has not been developed as of yet Rapid prototyping of embedded systems may alleviate the complexity gap problem and assist with the current trends in the embedded system market Rapid system prototyping will allow the
Trang 22designers to explore other design alternatives and to unveil design errors as early as possible, given the short development period The embedded system’s short time-to-market window greatly benefits from the rapid development of prototypes
Rapid system prototyping is especially useful when new hardware and software developments are being researched The development model for embedded system creation should consist of a prototyping phase for feasibility studies and final product and testing The development model should lead to a quick and well-tested product With rapid prototyping the product can be developed, tested, and deployed quite easily
The devices that are used range according to the requirements of the application and the degree to which the design challenges are satisfied The device that is impacting embedded systems is the Field Programmable Gate Array (FPGA) The impact of FPGAs occurs on the prototyping phase of development as well as the final product development The prototyping of embedded systems using FPGAs will be considered throughout this paper Embedded systems can be developed using microcontrollers, microprocessors, ASICs and FPGAs These methods of implementation usually require hardware to be designed and built Another alternative method is to use a board-based system The main advantage of using the board-based method is the reduced work load involved in development Therefore, board-based embedded system design can be rapidly developed and is ideal for prototyping
A key question is why should FPGAs be used instead of microprocessors, microcontrollers and ASICs? The individual technologies as it applies to embedded systems will be discussed in detail later Microprocessors and microcontrollers are
Trang 23already being applied in many systems FPGAs and ASICs can be placed along a spectrum that ranges from configurable to “frozen in silicon.” The functionality of the FPGA can be customized in the field The ASIC cannot be changed after a certain point in the design process is passed The disadvantage of ASICs is that the designing and building of the device is very time-consuming and expensive The final design created for the ASIC cannot be modified without going through the long process of development again FPGAs are of great interest when it comes to prototyping a system due to the efficient system development time The design flow for each device is shown in Figure 2 The development of a prototype should be efficient in order for the final product to be marketed quickly Therefore, a FPGA can be used for the prototype and an ASIC can be used for the final product
It may seem like ASICs are the most risky of the available silicon implementation choices Traditional cell-based ASICs can be expensive to design, manufacture, and change Many view this inflexibility to change as the biggest reason to avoid ASICs But the ASIC problem has been greatly exaggerated and misunderstood ASICs have been projected in the market as being expensive, unreliable, and unpredictable, but this is true for very high-complexity ASICs (e.g., 10 million gates at 90 nm), it is not true for most ASIC projects
Since the development of the embedded system contains many challenges, the most prominent being time, a rapid prototype is essential to evaluate the practical necessity and functionality of the system
Trang 24Figure 2: Design Cycles for FPGAs and ASICs
Due to the efficient design cycle of FPGAs, it is considered for developing rapid prototypes during the embedded system design process With the use of prototypes, it
is also important that simulations be performed to further speed up the design process Simulations are useful even before developing a prototype of the device or system It is preferable that both are used when developing
Scope of The Project
The objectives of the project were to review developments in embedded system design and future trends, and to explore board-level rapid prototyping using FPGAs
Although board-based system design is advantageous, it also contains the disadvantage of cost and restrictions on the functionality that is available The use of
Trang 25boards in the prototyping stage will lead to a quick prototype of the system for evaluation and testing The final design may not be a board-based design because of the limitations of the final product, such as power, memory, and performance
Outline of Chapters
The embedded system design flow was briefly mentioned in this introductory chapter Chapter 2 contains an in-depth description of the embedded system design flow and considerations Chapters 3 and 4 contain more information about the hardware and software aspects of the embedded system The design flow requires the designer to be able to make appropriate decisions with regard to the embedded processor, memory, peripherals, tools, compiler, etc… These chapters provide details necessary for these decisions to be made informatively Chapter 5 continues the discussion on rapid prototyping and its benefits Chapter 6 continues onto board-level rapid prototyping and its use in rapid prototyping, benefits, and drawbacks Knowing the different platforms and the processor, peripherals, and memory capabilities on the board greatly assists in choosing the correct platform for the application Chapter 7 applies the concepts to an application and reveals feedback as to the design process and usefulness Chapter 8 concludes with the future and long term trends in embedded system design and development
Trang 26CHAPTER 2 EMBEDDED SYSTEMS DESIGN
Embedded systems are very diverse and one particular approach does not easily apply to all When a successful embedded system is developed, the lessons learned when developing that system cannot be generalized to all embedded systems The design steps emphasized in this section are used to develop a good embedded system design, but it may not be optimal The tools for creating an optimal design have not been developed yet, and with the short design time allotted it is difficult to even create
a good design
The general design flow taken by all embedded system designers is outlined The three generations of embedded system design depict the trend taking place in design practices Design practices are moving away from the specificity that implementation platforms and programming languages offer and more toward greater generality [1] Besides the general design flow, other methodologies have been developed Some of these general methodologies are discussed in detail in order to understand the shift taking place in embedded systems design
Embedded Systems Design Flow
The embedded system design flow consists of the following steps: modeling, refining, hardware-software partitioning, scheduling, and mapping Modeling is the process of designing the system and experimenting with algorithms involved in the
Trang 27embedded application During the initial stage of the design, product planning and requirements engineering are performed Virtual prototypes and “mock-models” are used to explore the functional and software specification with the client It is better to adjust the design specification early in the design process to ensure the customer’s needs are met
The application design is further refined into smaller pieces during the refining or what is also called the partitioning phase The pieces interact to perform the required function Hardware-software partitioning is separating the pieces into hardware and software units The piece of the application can be implemented in either custom hardware or the software will define its functionality on a programmable processor The crucial aspect of this step is the co-design and the joint optimization of hardware and software The next step is the scheduling of functions Several set of instructions may want to access the same hardware; therefore the scheduling has to be completely accurate for correct functionality The mapping phase is the last part of the design flow
It involves the mapping of the functional description into software that runs on a processor and/or custom or semi-custom hardware
Embedded system design can be broken down into two main parts, hardware and software The hardware aspect of the design is implemented using hardware packages, hardware description language programs, and/or gates The software aspect deals with the high level C or C++ program that performs the sequence of steps necessary for the system to operate as specified The decision of separating the design into the software and hardware parts is known as hardware/software partitioning This
Trang 28is a difficult task when using FPGAs because it isn’t apparent which modules should be implemented in hardware and which in software For other embedded system technologies, where the hardware is fixed, the hardware/software partitioning step is not necessary
Figure 3 displays the design flow as it partitions into the hardware and software aspects of the embedded system design One of the main partitioning criteria is the speed of the individual functions composing the entire system If the logic is in the picosecond and nanosecond range, the FPGA fabric implements it If the logic is in the microsecond range, implementation can be performed in hardware as well as software For millisecond logic, implementation in software is easier to accomplish than hardware, because the hardware will be slowed down to implement this type of function The majority of the hardware/software partitioning decisions are made when the function’s speed allow the flexibility of implementation in either software or hardware
Considerable research is being performed with regards to the software partitioning problem Many methods ranging from highly mathematical and theoretical to highly practical are being developed The importance of the partitioning will be further emphasized when a solution to the creation of an optimal partition is found The hardware-software partitioning research focuses on the partitioning when applied to a specific set of embedded systems; a general methodology is not present
hardware-The steps discussed are a high level overview of the required processes to develop a completed embedded system Aside from the five steps, other decisions, not
Trang 29mentioned, need to be taken The decision of which hardware to use is decided even before the steps are refined and partitioned between hardware and software
Figure 3: Hardware Software Partitioning and Co-design [5]
The choice of hardware limits the implementation and thus different decisions need to be made along the design flow As was mentioned before, a hardware/software partitioning step can be eliminated depending on the hardware used for the system design The integration of hardware and software seems simple, but in some or most cases it can prove to be quite difficult
A prototype is any form of specification, hardware and/or software that is built and designed for evaluation purposes The prototype should be executable, and a rapid prototype should be easier and faster to develop than the final product A prototype is a way for the designers to evaluate the product idea by collecting data and obtaining feedback, unveil any deviations from the requirements developed initially with the stakeholders, and improve on any flaws in the design
Trang 30The iterative steps of prototyping and simulation are essential when developing
an embedded system It may seem that once a prototype is developed, the need for simulations diminishes, but simulations are crucial to the design process Simulations allow the evaluation of the design, both hardware and software, before the prototype is even developed When rapid prototyping wasn’t utilized, simulations were extremely important because time did not allow for many errors If an error occurred while developing a prototype, adjustment and recreation of the prototype was very time-consuming Simulations ensure that the prototype developed functions accurately and the time-to-market goal can be accomplished
Formal methods in embedded design have not been properly established and therefore much research is left to be completed In [2] the formal design methods are labeled as the “unexplored frontier of embedded system design.” The author considers the need for formal design methods in embedded system design accelerating within five years In many cases it isn’t essential for the embedded system design to be optimized according to power or throughput, instead business-driven and life-cycle factors influence the design decisions
Three Generations of Embedded System Design
Originally the design created for the embedded system relied on the implementation tools that will be used The evolution of embedded systems shows the separation taking place between the design and implementation details
Trang 31The first generation consists of language and synthesis based designs [1] Language-based designs relate to the software aspect of the design process and synthesis-based designs relate to the hardware aspect of the design process The particular programming language is mainly considered when designing using the language-based approach The programming language is dependent on the target system A synthesis-based approach is taken by first developing a system description in
a form easily transferrable to a hardware description language The system description
is used to develop the embedded system
The second generation begins the separation of the design and implementation levels early in the design process This allows independence from the execution platform Implementation technologies have emerged in this generation which can be applied to different platforms SystemC combines synchronous hardware semantics with asynchronous execution mechanisms from software (C++) The implementation requires hardware-software partitioning
The third generation is based on modeling languages [1] Modeling languages allow the next step in achieving design independence from the platform Examples of modeling languages are the Unified Modeling Language (UML) and Architecture Analysis and Design Language (AADL) The languages are independent of the programming language and platform that will be used for implementation
The goal in any model-based design approach is to describe system components within a modeling language that does not commit the designer early on either to a specific execution and interaction semantics or to specific implementation choices The
Trang 32current general methodology is a model-based approach Systems engineering methodologies are either critical or best effort Critical methods try to guarantee system safety at all costs, even when the system operates under extreme conditions Best-effort methods try to optimize system performance (and cost) when the system operates under expected conditions One views design as a constraint-satisfaction problem and the other views it as an optimization problem
Meeting hard constraints and making the best possible use of available resources work against each other Critical and best-effort engineering do not easily coincide Critical systems engineering can lead to the underutilization of resources, best-effort systems engineering to temporary unavailability The gap between the two approaches will continue to widen as the uncertainties in embedded systems design increase [1]
Embedded systems are becoming more widespread with a range of applications Because of this the design environments are not well-known and largely depend on the application The behavior cannot be accurately predicted and a disparity is seen between the worst-case and expected behaviors Considerable progress has been seen
in VLSI design with multi-core architectures, pipelines, and speculative execution Embedded systems are being developed on these sophisticated hardware architectures
As the gap between critical and best-effort designs increases, partitioned architectures are likely to become more prevalent Partitions physically separate critical and noncritical system parts, letting each run in dedicated memory space during dedicated time slots The partitioning the system into parts allows each part to be optimized appropriately
Trang 33Although a general design method is good practice for embedded system designers, many designers still use the platform-based design methodology The platform-based approach definitely doesn’t separate the design and implementation details It is often easier for the designer to develop the system around a particular platform instead of designing for any platform The reuse of hardware and software components assists when designing different systems with similar components This allows some generality even though the design method is specific
Trends affecting Embedded System Design
A designer doesn’t have to only consider the architectures to be utilized for the embedded system, but also the trends at the chip level The decisions made by the designer impact the future of the embedded system being designed Choosing the processors and architecture that is moving with the market trends will result in the embedded system design being useful for quite a few years before another design needs to be made with newer technology Microelectronics issues and trends contribute
to the design issues and future trends of embedded systems Other commercial happenings are also affecting the embedded systems industry A good embedded system designer considers many aspects when designing and makes choices that are conducive with the technology movement taking place
Trang 34Overview of Embedded System Hardware and Software
The hardware portion of the design process consists of using Verilog or VHDL to define custom hardware, using parts from the library, or gate level parts Often a design environment or board contains intellectual property that can be integrated into the design Configurable regions or parts are developed and available in design environments These are used for commonly used components such as arithmetic functions The use of embedded processors in the design is a major decision The decision depends on the application and design parameters
The software portion of the design process consists of developing the program either in machine language or a chosen high level language The software process choices depend on the tools available to the designer Using a supported processor core assist when designing the software for the embedded system because of the software tools that come with the processor If the designer uses his or her own processor, the tools would not be available to develop the software in C or C++ In this case, machine language is the most logical choice for software implementation
Despite the choices made when designing the hardware and software, the embedded system will essentially be a hardware block with inputs and outputs When completing the software part, it can also be seen as a hardware block with inputs and outputs The external connections to the software block either connect to an external port of the embedded system or there are interconnections between the hardware and software parts of the system
Trang 35CHAPTER 3 EMBEDDED SYSTEM HARDWARE
Design of embedded systems has evolved from the transistor level to gate level and register transfer level Having a higher level of abstraction is beneficial when implementing complex hardware systems Programming at an even higher level known
as the system level, the designer can be concerned with the functionality of the system being designed At this higher level of abstraction, the designer can specify the functionality of the system using a procedural language, such as the C language
Embedded systems contain many elements as listed below:
The main criterion for embedded processors is that it needs to provide enough processing power to perform the tasks Memory is an important part of an embedded
Trang 36system Memory provides storage for the software that will run on the processor or entire system Non-volatile memory must be used so that the program contents are retained when power is no longer applied to the device Random access memory is much more expensive than read only memory, therefore many embedded systems have less RAM available than ROM The program written for embedded systems sometimes have to minimize the usage of the RAM
Software component encompasses the entire functionality of the system It includes the operating system or run-time environment of the embedded system The configuration and error handling of the system is performed by the software Algorithms are a part of embedded software which describes in a sequence of steps the function of the embedded system
The individual hardware components that embedded systems are constituted of are discussed The design decisions that are not outlined in the high level design methodology are considered through in a stepwise fashion
Peripherals
Peripherals consist of inputs and outputs to the embedded system The design of the system relies heavily on the understanding of the communication interfaces in and out of the device When the interface devices are known, then only can the system be designed to communicate appropriately with them There are different types of devices that can be used as inputs and outputs Sensors, LCD displays, speakers, keyboards, and infrared devices are used to communication with the outside world The communication
Trang 37interfaces are used for output display and for input needed from the user and for debugging purposes The user interface can range from simple LED systems to complex graphical and touch sensitive features
There are many different types of sensors Sensors are designed for many physical quantities, such as water, image, pressure, infrared, sound, and biometrics [3] Smart systems can only be developed due to the use of sensors The other communication interfaces include serial, USB, and Ethernet The communication interfaces can be categorized as wireless media, optical media, and wires The wireless media includes radio frequency and infrared signal based communication
The communication interfaces are essential when the embedded system connect
to other devices to communicate data for processing If the system is independent from other devices the user interfaces are mainly used and the serial and USB communication are encapsulated within the system
Usually the customer requirements include the peripherals that are sought The designer is limited by the requirements provided during the first design steps The communication interfaces within the system and the user interfaces for debugging are the choice of the designer As interfaces are included in the design, the complexity also increases Usually for debugging purposes a simple LCD display for LED lights are used The simplest wired communication is the RS232 or serial communication USB and wireless communication can be more complicated, especially if the designer is using it for debugging The speed of the communication interface influence the decision of which technology to utilize Speed is a parameter that also needs to be considered when
Trang 38designing a high performance system Any user will be pleased with a fast embedded system and thus the considerations of speed are always important
Processor
The hardware design doesn’t only consist of designing with embedded processors The basics of hardware design consist of using VHDL and/or Verilog to create custom hardware that will complete certain hardware functions of the system The first design decision is whether to use a processor or not Based on the application and the design time constraints a choice has to be made Relatively simple hardware functions can be developed in VHDL and/or Verilog The same function could also be implemented in by writing a program that will run on an existing or custom processor If the design is very simple, an entirely hardware based design is the better approach The embedded system design process that is reviewed is making the assumption that the application is complex enough for prototypes, simulation and testing to be essential for
a successful product to be launched When designing with an embedded processor, the design process involves: [4]
1 Selection of a processor
2 Design and configuration of the processor memory and interfaces
3 Developing the software for the processor to perform the hardware function
The reason for choosing a processor mostly depends on the application, but there are some general and important requirements that apply to all embedded
Trang 39systems Factors such as efficiency and cost are major concerns for users of the product and designers Developing the system requires attention to the interfaces and memory requirements The second step in the processor design process is not separate from the first step When selecting a processor, the memory and interfaces are also of utmost importance
For high-performance applications and for large markets, application-specific integrated circuits (ASICs) can be designed The cost of manufacturing the ASICs is quite high Thus, microcontrollers are dominating the embedded system industry due to the programmability and its applicability to many embedded systems The use of FPGAs is mainly considered for the prototyping stage, but many researchers claim a trend towards FPGA based embedded systems The advantages of using FPGAs for the prototyping stage were discussed briefly earlier The FPGA and ASIC design cycles are considerably different The FPGA design cycle time is shorter than the ASIC design cycle time Other than time, the cost of the prototype should be kept minimal because it may
be destroyed once it is no longer of use FPGAs are quick and cheap to develop with and are close to ideal for prototype development
Another decision besides the processor for the prototype is the processor for the final system The choices depend on the application The advantages and disadvantages
of each of the common processor types are understood in order to make the correct choices when design and implementation development begins The embedded system hardware can range from traffic controllers to cellular phones The underlying hardware can consist of a few choices These are chosen based on the requirements of the
Trang 40system, such as fault tolerance or high processing capability Standard hardware can be used that will meet to the requirements of the system This hardware can consist of an FPGA with an embedded hard or soft microprocessor
According to [3], the key advantage of processors is their flexibility The author is referring to processors other than ASICs The overall behavior of the embedded system can be changed by adjusted the software running on the processor or processors The flexibility of microprocessors has made it a popular tool for developing embedded systems Microcontrollers which contain microprocessors are the main processing units
in embedded systems Efficiency is another factor that is important when choosing embedded processors Efficiency can be considered in terms of energy efficiency, code-size efficiency, and runtime efficiency [3]
Energy usage is important for embedded systems The system usually runs on batteries and requires operation to continue for a long time Energy efficiency is considered at all abstractions levels From designing the instruction set down to the design of the chip manufacturing process, energy efficiency needs to be considered Power dissipation and energy efficiency can be considered at the chip level Different methods to optimize the chip design exist Chips can enter different power saving states extending the battery life of the embedded system The three states are run, idle, and sleep [3] The run state occurs when the processor is performing some computation The idle state is when the processor is waiting for interrupts The input interfaces and timers cause the processor to transition from the idle state to the run state During the sleep state, the processor is no longer active and the power consumption decreases