FPGAs Fundamentals, Advanced Features, and Applications in Industrial Electronics FPGAs Fundamentals, Advanced Features, and Applications in Industrial Electronics Juan José Rodríguez Andina, Eduardo de la Torre Arnanz, and María Dolores Valdés Peña MATLAB® is a trademark of The MathWorks, Inc. and is used with permission. The MathWorks does not warrant the accuracy of the text or exercises in this book. This book’s use or discussion of MATLAB® software or related products does not constitute endorsement or sponsorship by The MathWorks of a particular pedagogical approach or particular use of the MATLAB® software. CRC Press Taylor & Francis Group 6000 Broken Sound Parkway NW, Suite 300 Boca Raton, FL 33487-2742 © 2017 by Taylor & Francis Group, LLC CRC Press is an imprint of Taylor & Francis Group, an Informa business No claim to original U.S. Government works Printed on acid-free paper Version Date: 20161025 International Standard Book Number-13: 978-1-4398-9699-0 (Hardback) This book contains information obtained from authentic and highly regarded sources. Reasonable efforts have been made to publish reliable data and information, but the author and publisher cannot assume responsibility for the validity of all materials or the consequences of their use. The authors and publishers have attempted to trace the copyright holders of all material reproduced in this publication and apologize to copyright holders if permission to publish in this form has not been obtained. If any copyright material has not been acknowledged please write and let us know so we may rectify in any future reprint. Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced, transmitted, or utilized in any form by any electronic, mechanical, or other means, now known or hereafter invented, including photocopying, microfilming, and recording, or in any information storage or retrieval system, without written permission from the publishers. For permission to photocopy or use material electronically from this work, please access www. copyright.com (http://www.copyright.com/) or contact the Copyright Clearance Center, Inc. (CCC), 222 Rosewood Drive, Danvers, MA 01923, 978-750-8400. CCC is a not-for-profit organization that provides licenses and registration for a variety of users. For organizations that have been granted a photocopy license by the CCC, a separate system of payment has been arranged. Trademark Notice: Product or corporate names may be trademarks or registered trademarks, and are used only for identification and explanation without intent to infringe. Visit the Taylor & Francis Web site at http://www.taylorandfrancis.com and the CRC Press Web site at http://www.crcpress.com Contents Preface ......................................................................................................................ix Acknowledgments ..............................................................................................xiii Authors ...................................................................................................................xv 1. FPGAs and Their Role in the Design of Electronic Systems.................1 1.1 Introduction ...........................................................................................1 1.2 Embedded Control Systems: A Wide Concept .................................2 1.3 Implementation Options for Embedded Systems ............................4 1.3.1 Technological Improvements and Complexity Growth .....4 1.3.2 Toward Energy-Efficient Improved Computing Performance ..............................................................................6 1.3.3 A Battle for the Target Technology? ......................................7 1.3.4 Design Techniques and Tools for the Different Technologies .............................................................................8 1.3.4.1 General-Purpose Processors and Microcontrollers .......................................................9 1.3.4.2 DSP Processors .......................................................10 1.3.4.3 Multicore Processors and GPGPUs .....................11 1.3.4.4 FPGAs ......................................................................12 1.3.4.5 ASICs ........................................................................12 1.4 How Does Configurable Logic Work? ..............................................13 1.5 Applications and Uses of FPGAs ......................................................18 References .......................................................................................................19 2. Main Architectures and Hardware Resources of FPGAs ....................21 2.1 Introduction .........................................................................................21 2.2 Main FPGA Architectures .................................................................22 2.3 Basic Hardware Resources ................................................................25 2.3.1 Logic Blocks ............................................................................25 2.3.2 I/O Blocks ...............................................................................29 2.3.2.1 SerDes Blocks ..........................................................31 2.3.2.2 FIFO Memories .......................................................32 2.3.3 Interconnection Resources ...................................................32 2.4 Specialized Hardware Blocks ...........................................................34 2.4.1 Clock Management Blocks ...................................................34 2.4.2 Memory Blocks .......................................................................41 v vi Contents 2.4.3 Hard Memory Controllers ....................................................45 2.4.4 Transceivers ............................................................................47 2.4.4.1 PCIe Blocks ..............................................................51 2.4.5 Serial Communication Interfaces ........................................53 References .......................................................................................................56 3. Embedded Processors in FPGA Architectures .......................................59 3.1 Introduction .........................................................................................59 3.1.1 Multicore Processors .............................................................61 3.1.1.1 Main Hardware Issues ..........................................61 3.1.1.2 Main Software Issues.............................................64 3.1.2 Many-Core Processors ..........................................................66 3.1.3 FPSoCs .....................................................................................66 3.2 Soft Processors .....................................................................................67 3.2.1 Proprietary Cores ...................................................................69 3.2.2 Open-Source Cores ................................................................76 3.3 Hard Processors ..................................................................................78 3.4 Other “Configurable” SoC Solutions ...............................................85 3.4.1 Sensor Hubs ............................................................................85 3.4.2 Customizable Processors ......................................................90 3.5 On-Chip Buses .....................................................................................91 3.5.1 AMBA ......................................................................................92 3.5.1.1 AHB ..........................................................................92 3.5.1.2 Multilayer AHB ......................................................94 3.5.1.3 AXI............................................................................95 3.5.2 Avalon ....................................................................................100 3.5.3 CoreConnect .........................................................................108 3.5.4 WishBone ..............................................................................109 References .....................................................................................................111 4. Advanced Signal Processing Resources in FPGAs .............................115 4.1 Introduction .......................................................................................115 4.2 Embedded Multipliers ......................................................................117 4.3 DSP Blocks .........................................................................................118 4.4 Floating-Point Hardware Operators ...............................................121 References .....................................................................................................125 5. Mixed-Signal FPGAs .................................................................................127 5.1 Introduction .......................................................................................127 5.2 ADC Blocks ........................................................................................128 5.3 Analog Sensors ..................................................................................133 5.4 Analog Data Acquisition and Processing Interfaces ...................134 5.5 Hybrid FPGA–FPAA Solutions .......................................................138 References .....................................................................................................142 Contents vii 6. Tools and Methodologies for FPGA-Based Design .............................143 6.1 Introduction .......................................................................................143 6.2 Basic Design Flow Based on RTL Synthesis and Implementation Tools .......................................................................145 6.2.1 Design Entry .........................................................................147 6.2.2 Simulation Tools ...................................................................149 6.2.2.1 Interactive Simulation ..........................................152 6.2.2.2 Mixed-Mode Simulation .....................................152 6.2.2.3 HIL Verification ....................................................152 6.2.3 RTL Synthesis and Back-End Tools ...................................153 6.2.3.1 RTL Synthesis .......................................................153 6.2.3.2 Translation .............................................................156 6.2.3.3 Placement and Routing .......................................156 6.2.3.4 Bitstream Generation ...........................................158 6.3 Design of SoPC Systems ...................................................................160 6.3.1 Hardware Design Tools for SoPCs ....................................160 6.3.2 Software Design Tools for SoPCs ......................................164 6.3.3 Core Libraries and Core Generation Tools .......................167 6.4 HLS Tools ...........................................................................................169 6.5 Design of HPC Multithread Accelerators ......................................171 6.6 Debugging and Other Auxiliary Tools ..........................................173 6.6.1 Hardware/Software Debugging for SoPC Systems........173 6.6.1.1 Software Debugging ............................................174 6.6.1.2 Hardware Debugging ..........................................175 6.6.1.3 Hardware/Software Co-Debugging .................177 6.6.2 Auxiliary Tools .....................................................................177 6.6.2.1 Pin Planning Tools ...............................................177 6.6.2.2 FPGA Selection Advisory Tools .........................178 6.6.2.3 Power Estimation Tools .......................................178 References .....................................................................................................179 7. Off-Chip and In-Chip Communications for FPGA Systems ............181 7.1 Introduction .......................................................................................181 7.2 Off-Chip Communications ..............................................................182 7.2.1 Low-Speed Interfaces ..........................................................182 7.2.2 High-Speed Interfaces .........................................................183 7.3 In-Chip Communications ................................................................185 7.3.1 Point-to-Point Connections .................................................185 7.3.2 Bus-Based Connections .......................................................186 7.3.3 Networks on Chip................................................................192 References .....................................................................................................195 8. Building Reconfigurable Systems Using Commercial FPGAs .........197 8.1 Introduction .......................................................................................197 8.2 Main Reconfiguration-Related Concepts .......................................198 8.2.1 Reconfigurable Architectures ............................................201 viii Contents 8.3 FPGAs as Reconfigurable Elements ...............................................202 8.3.1 Commercial FPGAs with Reconfiguration Support .......203 8.3.2 Setting Up an Architecture for Partial Reconfiguration ...204 8.3.3 Scalable Architectures .........................................................206 8.3.4 Tool Support for Partial Reconfiguration .........................208 8.3.5 On-Chip Communications for Reconfigurable System Support ....................................................................210 8.4 RTR Support .......................................................................................211 8.4.1 Self-Managing Systems .......................................................213 8.4.2 Adaptive Multithread Execution with Reconfigurable Hardware Accelerators ............................216 8.4.3 Evolvable Hardware ............................................................219 References .....................................................................................................227 9. Industrial Electronics Applications of FPGAs .....................................229 9.1 Introduction .......................................................................................229 9.2 FPGA Application Domains in Industrial Electronics ................231 9.2.1 Digital Real-Time Simulation of Power Systems .............231 9.2.2 Advanced Control Techniques ...........................................232 9.2.2.1 Power Systems ......................................................232 9.2.2.2 Robotics and Automotive Electronics ...............233 9.2.2.3 Use of Floating-Point Operations .......................233 9.2.3 Electronic Instrumentation.................................................234 9.3 Conclusion ..........................................................................................234 References .....................................................................................................235 Index .....................................................................................................................241 Preface This book intends to contribute to a wider use of field-programmable gate arrays (FPGAs) in industry by presenting the concepts associated with this technology in a way accessible for nonspecialists in hardware design so that they can analyze if and when these devices are the best (or at least a possible) solution to efficiently address the needs of their target industrial applications. This is not a trivial issue because of the many different (but related) factors involved in the selection of the most suitable hardware platform to solve a specific digital design problem. The possibilities enabled by current FPGA devices are highlighted, with particular emphasis on the combination of tra- ditional FPGA architectures and powerful embedded processors, resulting in the so-called field-programmable systems-on-chip (FPSoCs) or systems- on-programmable-chip (SoPCs). Discussions and analyses are focused on the context of embedded systems, but they are also valid and can be easily extrapolated to other areas. The book is structured into nine chapters: • Chapter 1 analyzes the different existing design approaches for embedded systems, putting FPGA-based design in perspective with its direct competitors in the field. In addition, the basic concept of FPGA “programmability” or “configurability” is discussed, and the main elements of FPGA architectures are introduced. • From the brief presentation in Chapter 1, Chapter 2 describes in detail the main characteristics, structure, and generic hardware resources of modern FPGAs (logic blocks, I/O blocks, and interconnection resources). Some specialized hardware blocks (clock management blocks, memory blocks, hard memory controllers, transceivers, and serial communication interfaces) are also analyzed in this chapter. • Embedded soft and hard processors are analyzed in Chapter 3, because of their special significance and the design paradigm shift they caused as they transformed FPGAs from hardware accelerators to FPSoC platforms. As shown in this chapter, devices have evolved from simple ones, including one general-purpose microcontroller, to the most recent ones, which integrate several (more than 10 in some cases) complex processor cores operating concurrently, opening the door for the implementation of homogeneous or heterogeneous mul- ticore architectures. The efficient communication between processors and their peripherals is a key factor to successfully develop embedded systems. Because of this, the currently available on-chip buses and their historical evolution are also analyzed in detail in this chapter. ix
Description: