Preface

Modern digital devices used in homes, in cars, and on our persons contain increasingly sophisticated computing capabilities. These embedded systems generate, receive, and process digital data streams at rates of up to multiple gigabits per second. This book teaches you how to use field-programmable gate arrays (FPGAs) and high-speed digital circuit design techniques to create your own cutting-edge digital device designs.

Intended audience for this book

This book is intended for software developers, hardware engineers, Internet of Things (IoT) developers, and anyone else seeking to understand the process of developing high-performance embedded systems. The potential audience includes anyone with an interest in learning about the fundamentals of FPGA development and all aspects of firmware development in C and C++. Readers should have a basic level of familiarity with the C language, digital circuits, and soldering electronic components.

What this book covers

Chapter 1, Architecting High-Performance Embedded Systems, introduces the elements of embedded system architectures and discusses some key system features that are common across a wide variety of embedded applications. An embedded system generally includes at least one microcontroller or microprocessor, sensors, actuators, a power source, and, in many cases, one or more network interfaces. The chapter continues with an exploration of the relationship between embedded systems and the IoT.

Chapter 2, Sensing the World, introduces the principles and implementations of sensors used in a wide variety of embedded applications. Passive sensors measure attributes of the world such as temperature, pressure, humidity, light intensity, and atmospheric composition. Active sensors use energy-emitting technologies such as radar and lidar to detect objects and measure their position and velocity.

Chapter 3, Operating in Real Time, addresses the need for embedded systems to generate real-time responses to inputs measured from sensors and other sources. The concepts of Real-Time Operating Systems (RTOSes) and their key features are introduced, as well as some challenges that commonly occur when implementing multitasking in real-time applications. The chapter concludes with a presentation of the important characteristics of some popular open source and commercial RTOS implementations.

Chapter 4, Developing Your First FPGA Program, begins with a discussion on the effective use of FPGA devices in real-time embedded systems and continues with a description of the functional elements contained within standard FPGAs. The range of FPGA design languages, including Hardware Description Languages (HDLs), block diagram methods, and popular software programming languages including C and C++, is introduced. The chapter continues with an overview of the FPGA development process and concludes with a complete example of an FPGA development cycle, starting with a statement of system requirements and ending with a functional system implemented in a low-cost FPGA development board.

Chapter 5, Implementing Systems with FPGAs, dives into the process of designing and implementing embedded devices with FPGAs. It begins with a description of the FPGA compilation software tools that convert a description of a logic design in a programming language into an executable FPGA configuration. We will discuss the types of algorithms best suited to FPGA implementation and suggest a decision-making approach for determining whether a particular embedded system algorithm is more appropriately implemented using a traditional processor or with an FPGA. The chapter ends with the step-by-step development of a baseline FPGA-based processor project that will be expanded to implement a high-speed digital oscilloscope using circuitry and software developed in later chapters.

Chapter 6, Designing Circuits with KiCad, introduces the excellent open source KiCad electronics design and automation suite. Working in KiCad, you will design a circuit using schematic diagrams and develop a corresponding printed circuit board layout. You'll learn how to turn a circuit board design into a prototype at a very reasonable cost. This chapter includes example schematics for the oscilloscope circuit project you will assemble in the next chapter.

Chapter 7, Building High-Performance Digital Circuits, presents the processes and techniques involved in assembling prototype high-performance digital circuits using surface-mount and through-hole electronic components. A recommended set of tools is identified, including a soldering station, a magnifier or microscope, and tweezers for handling tiny parts. The reflow soldering process is introduced, along with descriptions of some low-cost options for implementing a small-scale reflow capability.

Chapter 8, Bringing Up the Board for the First Time, covers how, having designed, constructed, cleaned, and inspected the printed circuit board, it is now time to apply power – in other words, perform the infamous smoke test. This chapter leads you through the process of carefully providing first-time power to the board and checking basic circuit-level functionality. If you discover any problems, the chapter contains suggested approaches for addressing them. After passing these tests, it is time to add to the FPGA logic and test the digital interface to the oscilloscope board.

Chapter 9, The Firmware Development Process, shows how, now that we have a functioning circuit board, to flesh out the remaining key portions of the FPGA algorithm, including communication with the Analog to Digital Converter (ADC), and continue development of the MicroBlaze processor firmware. When developing firmware, it is important to subject the code to static analysis where possible, which can head off many errors that are otherwise difficult to debug. It is also important to implement a version control system to track the evolution of the code over the project life cycle. We will discuss the importance of developing a comprehensive, at least partially automated test suite to maintain code quality as changes are made. The chapter recommends some free and commercial tools for performing each of these functions.

Chapter 10, Testing and Debugging the Embedded System, discusses how, as the development of our embedded system nears completion, the time arrives to conduct thorough testing in the context in which it will operate. This testing must address the entire expected range of environmental conditions and user inputs, including invalid inputs, to ensure proper operation under all conditions. The chapter concludes with a discussion of recommended debugging procedures and a summary of best practices for high-performance embedded system development.

To get the most out of this book

This book takes full advantage of powerful free commercial and open source software tool suites to develop FPGA algorithms and to design sophisticated printed circuit boards. To follow along with the example project, you will need a specific FPGA development board, the Digilent Arty A7-100. To construct the digital circuits to implement your designs, you will need a set of tools for soldering and desoldering surface mount components. You will also need tools to assist in working with fine-scale parts, such as precision tweezers and a magnifier or microscope.

If you are using the digital version of this book, we advise you to access the code via the GitHub repository (link available in the next section). Doing so will help you avoid any potential errors related to the copying and pasting of code.

Download the example code files

The code bundle for the book is hosted on GitHub at https://github.com/PacktPublishing/Architecting-High-Performance-Embedded-Systems. In case there's an update to the code, it will be updated at this GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Download the color images

We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here: http://www.packtpub.com/sites/default/files/downloads/9781789955965_ColorImages.pdf.

Conventions used

There are a number of text conventions used throughout this book.

Code in text: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "The term std_logic refers to a single-bit binary data type."

A block of code is set as follows:

architecture BEHAVIORAL of FULL_ADDER is

begin

S <= (A XOR B) XOR C_IN;

C_OUT <= (A AND B) OR ((A XOR B) AND C_IN);

end architecture BEHAVIORAL;

Any command-line input or output is written as follows:

dism /online /Enable-Feature /FeatureName:TelnetClient

Bold: Indicates a new term, an important word, or words that you see onscreen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "Leave the selections at their default values and click Next."

Tips or important notes

Appear like this.

Get in touch

Feedback from our readers is always welcome.

General feedback: If you have questions about any aspect of this book, mention the book title in the subject of your message and email us at [email protected].

Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packtpub.com/support/errata, selecting your book, clicking on the Errata Submission Form link, and entering the details.

Piracy: If you come across any illegal copies of our works in any form on the Internet, we would be grateful if you would provide us with the location address or website name. Please contact us at [email protected] with a link to the material.

If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.

Reviews

Please leave a review. Once you have read and used this book, why not leave a review on the site that you purchased it from? Potential readers can then see and use your unbiased opinion to make purchase decisions, we at Packt can understand what you think about our products, and our authors can see your feedback on their book. Thank you!

For more information about Packt, please visit packt.com.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.149.168