Dirk Koch · Frank Hannig Daniel Ziener Editors Fpgas for Software Programmers Fpgas for Software Programmers

Total Page:16

File Type:pdf, Size:1020Kb

Dirk Koch · Frank Hannig Daniel Ziener Editors Fpgas for Software Programmers Fpgas for Software Programmers Dirk Koch · Frank Hannig Daniel Ziener Editors FPGAs for Software Programmers FPGAs for Software Programmers [email protected] [email protected] Dirk Koch • Frank Hannig • Daniel Ziener Editors FPGAs for Software Programmers 123 [email protected] Editors Dirk Koch Frank Hannig The University of Manchester Friedrich-Alexander-Universität Manchester, United Kingdom Erlangen-Nürnberg (FAU) Erlangen, Germany Daniel Ziener Friedrich-Alexander-Universität Erlangen-Nürnberg (FAU) Erlangen, Germany ISBN 978-3-319-26406-6 ISBN 978-3-319-26408-0 (eBook) DOI 10.1007/978-3-319-26408-0 Library of Congress Control Number: 2015957420 Springer Cham Heidelberg New York Dordrecht London © Springer International Publishing Switzerland 2016 This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed. The use of general descriptive names, registered names, trademarks, service marks, etc. in this publication does not imply, even in the absence of a specific statement, that such names are exempt from the relevant protective laws and regulations and therefore free for general use. The publisher, the authors and the editors are safe to assume that the advice and information in this book are believed to be true and accurate at the date of publication. Neither the publisher nor the authors or the editors give a warranty, express or implied, with respect to the material contained herein or for any errors or omissions that may have been made. Printed on acid-free paper Springer International Publishing AG Switzerland is part of Springer Science+Business Media (www. springer.com) [email protected] Preface “FPGAs.” — “What?” “Field programmable gate arrays that are cool programmable chips.” — “I see! Programmable. Great. I have programming skills. So, this should be an easy task for me.” “Well, not really, but I can help you.” Dear valued reader, when software engineers and hardware engineers talk about FPGAs, often two worlds are clashing together, each with different mindsets, skills, and expectations. Until recently, FPGA programming was mostly a hardware engi- neering discipline carried out by specially trained people. The design productivity of FPGA design was rather low, and for the time a hardware engineer was fiddling out a few flipping bits, a software engineer might have implemented his new large-scale cloud service application running on a big data center. Please note that we wrote “was rather low!” Like the widespread success of the processor took off with the development of expressive languages and corresponding compilers,thisiscurrently happening for FPGAs. For decades, FPGA programming was carried out at very low abstraction levels (comparable to assembly language), but during recent years several compilers have emerged that can bring an algorithm to an FPGA at a quality far beyond what human handcrafting would be able to do. Currently, the software and hardware worlds are strongly converging. Software is going parallel, which has a long tradition in hardware design and vice versa, hardware gets more and more designed from expressive languages. This book aims at closing the gap between these two worlds. Instead of following a programming model that is tailored to CPUs (following the so-called von Neumann computer architecture model), FPGA programming can be considered rather as molding the liquid silicon [IBEC10] to create a certain desired functionality, and FPGAs allow computing without processors [Sin11]. v [email protected] vi Preface This gives an engineer full control over the machine itself and not only over the program a machine runs. For example, if we want to perform DNA sequencing. Then, let us build a reconfigurable processor which is tailored to small alphabet string matching and achieve 395 million base pairs per second throughput [ALJ15]. Or we need fast AES encryption? Then build a custom compute accelerator on an FPGA, and get 260 Gbps throughput [SS15]. As a reference, the fastest Intel Core i7 Extreme Edition i7-980X CPU does not even yield that memory throughput, and this processor provides three times less AES throughput when using all 12 cores and despite having special hardware support for AES. And if we take an i7 Extreme Edition 975x without AES hardware support, the FPGA would be 52 times faster. Please note that the FPGA delivers its AES throughput on one problem, while the software solutions provide only high aggregated performance for AES on different problems. On the same problem, the FPGA will be significantly faster. And not only that the FPGA is much faster, it will do the job at a fraction of the power consumption. Does implementing AES for an FPGA sound too complicated? Well, tuning the performance for AES on, for example, a GPU (that is optimized for floating-point number-crunching instead of bit-level operations) is likely to be harder, will still be slower than an FPGA implementation, and would burn at least an order of magnitude more power. So why not getting it right in the first place? This is what this book wants to help with. For making this happen, this book brings together leading experts from the industry and academia across the globe to cover: Theoretical foundations and background on computer architectures, program- ming models, and hardware compilation techniques (throughout the first three chapters). Programming languages and compilers for FPGAs from a rather practical point of view with various case studies. This includes six state-of-the-art and emerg- ing commercial approaches (located in Part I, beginning at page 61)aswellas three established academic compilers (located in Part II, beginning at page 173). This shall demonstrate that there is a large ecosystem for FPGA programming that software engineers can choose from to find the best language and compiler environment for virtually any given problem. FPGA runtime environments are needed for building complex systems and for running and managing them. This provides a higher abstraction in the system allowing to focus more on applications while abstracting from many low-level details of the underlying FPGA hardware (as covered in Part III, beginning at page 225). Ready-to-go approaches allow building a complex system on a chip (SoC) and using pre-implemented programmable architectures on an FPGA without any need for hardware programming (as revealed in Part IV, starting from page 259). With all this, we intend making reconfigurable FPGA technology more acces- sible to software programmers and to moderate between hardware and software [email protected] Preface vii engineers. FPGA technology provides maybe the most promising answer for improving performance and energy efficiency of computers at the end of CMOS scaling. To make this happen, it will need hardware and software engineers working harmonically together. Let us start with this today! This book is written for software engineers who want to know more about FPGAs and how to use them. Consequently, we do not assume any hardware engineering background. In a few cases, where further background information is provided, this book is using terms that are common in computer engineering (e.g., “flip- flop”) and compiler construction (e.g., “scheduling”) that might not be thoroughly introduced but that are assumed to be clear from the context for most readers. This was done by intention as we do not want to fill the book with all possible background information while eventually hiding the big picture, which is what are FPGAs good for and how can they be programmed and used by software engineers. Such sections should be seen as optional and should not be seen as essential when reading this book. Those terms are also nicely presented on Wikipedia, if further explanation might be needed. In addition to software engineers, this book can also serve as a textbook in university courses on alternative programming approaches and acceleration techniques. Finally, this book is also relevant for hardware engineers who want to get an overview on how to enhance design productivity with latest languages and tools. We thank all the chapter authors for their outstanding contributions, their feedback, and their will to compile a comprehensive textbook targeting software engineers. We also thank Springer, especially Charles Glaser for his encouragement to develop this book and Hemalatha Gunasekaran for her support. Furthermore, we thank Mikel Luján for his feedback and suggestions to improve this book. Finally, we thank Philippa Ordnung for providing the Index. All editor’s and author’s profit of the book sales will be donated to the United Nations Children’s Fund (UNICEF). Manchester, UK Dirk Koch Erlangen, Germany Frank Hannig Erlangen, Germany Daniel Ziener [email protected] viii Preface Contributors Michael Adler C 14 Intel Corporation, VSSAD Group, Hudson, MA, USA Andreas Agne C 13 University of Paderborn, Paderborn, Germany Stephan Ahrends C 4 National Instruments, Munich, Germany Jason Anderson C 10 Department of Electrical and Computer Engineering, University of Toronto, Toronto, ON, Canada Hugo A. Andrade C 4 National Instruments, Berkeley, CA, USA Oriol Arcas-Abella C 9 Barcelona Supercomputing
Recommended publications
  • Advances in Modeling Language Engineering
    Advances in Modeling Language Engineering Katrin Hölldobler, Alexander Roth, Bernhard Rumpe, Andreas Wortmann Software Engineering, RWTH Aachen University, www:se-rwth:de Abstract. The increasing complexity of modern systems development demands for specific modeling languages capturing the various aspects to be tackled. However, engineering of comfortable modeling languages as well as their tooling is a challenging endeavor. Far too often, new lan- guages are built from scratch. We shed light into the advances of model- ing language engineering that facilitates reuse, modularity, composition- ality and derivation of new languages based on language components. We discuss ways to design, combine, and derive modeling languages in all their relevant aspects. For each of these activities, we illustrate their application for the model-driven development of a data exploration tool. The tool itself uses a set of meta-information, namely the structural model to derive all necessary software components that help to gather, store, visualize and navigate the data. The limits of my language mean the limits of my world – Ludwig Wittgenstein 1 Motivation The use of models to understand and shape the world is a very foundational technique that has already been used in ancient Greece and Egypt. Scientists model to understand the world and engineers model to design (parts of) the world. Although modeling has been employed for ages in virtually all disciplines it is fairly new that the form of models is made explicit in so-called modeling languages. Computer science has invented this approach to provide formality and a precise understanding of what is a well-formed model to the communication between humans and machines.
    [Show full text]
  • Reusable Textual Styles for Domain-Specific Modeling Languages⋆
    Reusable Textual Styles for Domain-Specific Modeling Languages⋆ 1[0000 0002 9811 4772] 2[0000 0001 9914 3287] Patrick Neubauer − − − , Robert Bill − − − , Dimitris 1[0000 0002 1724 6563] 3[0000 0002 1978 9852] Kolovos − − − , Richard Paige − − − , and Manuel 4[0000 0002 1124 7098] Wimmer − − − 1 University of York, Deramore Lane, York YO10 5GH, UK {forename.lastname}@york.ac.uk 2 CDP, Technische Universität Wien, Karlsplatz 13, 1040 Vienna, Austria [email protected] 3 McMaster University, 1280 Main Street West, Hamilton, Ontario L8S 4L8, Canada [email protected] 4 CDL-MINT, Johannes Kepler Universität, Altenberger Straße 69, 4040 Linz, Austria [email protected] Abstract. Domain-specific languages enable concise and precise formalization of domain concepts and promote direct employment by domain experts. There- fore, syntactic constructs are introduced to empower users to associate concepts and relationships with visual textual symbols. Model-based language engineer- ing facilitates the description of concepts and relationships in an abstract man- ner. However, concrete representations are commonly attached to abstract do- main representations, such as annotations in metamodels, or directly encoded into language grammar and thus introduce redundancy between metamodel ele- ments and grammar elements. In this work we propose an approach that enables autonomous development and maintenance of domain concepts and textual lan- guage notations in a distinctive and metamodel-agnostic manner by employing style models containing grammar rule templates and injection-based property selection. We provide an implementation and showcase the proposed notation- specification language in a comparison with state of the art practices during the creation of notations for an executable domain-specific modeling language based on the Eclipse Modeling Framework and Xtext.
    [Show full text]
  • Domain-Specific Languages
    Domain-Specific Languages Vassilios Karakoidas Department of Management Science and Technology, Athens University of Economics and Business, Athens, Greece Abstract Domain-specific languages (DSLs) are programming languages that are by design focused to one domain. The specificity of their syntax and features permits efficient representation of domain concepts expressed within a program, thus enabling the involvement of experts in the software development process. In addition, DSL usage in software development leads to increased productivity for the programmers. This entry provides an overview on DSLs, their design, implementation, and usage. INTRODUCTION declared directly as a type. In addition, it also contains the method multiply, which is closer to the reality of the Domain-specific languages (DSLs), also known as micro- mathematical domain. languages or little languages, are programming languages With modern programming languages, it is easy to create designed to focus on a particular domain.[1] Well-known complex libraries that declare and implement the abstrac- DSLs include regular expressions, markdown, extensible tions of specific domains, but there is a barrier; the syntax markup language (XML), and structured query language of the language must always be used. (SQL). General-purpose languages (GPLs) have a wider Consider now octave or mathematica, a language cre- scope. They provide a set of processing capabilities appli- ated specifically to deal with this algorithm implemen- cable to different problem domains. Mainstream GPLs are tation. These DSLs are used massively for simulations Java, C/C++, Python, and Scala. and mathematical modeling. Does anyone consider mathe- To better understand the differences between DSLs and matica’s language to develop a web server or a database GPLs, consider the following example.
    [Show full text]
  • Software Language Engineering in the Large: Towards Composing and Deriving Languages
    Software Language Engineering in the Large: Towards Composing and Deriving Languages Katrin Hölldobler, Bernhard Rumpe, Andreas Wortmann Software Engineering, RWTH Aachen University, Aachen, Germany www.se-rwth.de Abstract Suitable software languages are crucial to tackling the ever-increasing complexity of software engineering processes and software products. They model, specify, and test products, describe processes and interactions with services and serve many other purposes. Meanwhile, engineering suitable modeling languages with useful tooling also has become a challenging en- deavor - and far too often, new languages are developed from scratch. We shed light on the advances of modeling language engineering that facilitate reuse, modularity, compositionality, and derivation of new languages based on language components. To this end, we discuss ways to design, combine, and derive modeling languages in all their relevant aspects. We illustrate the application of advanced language engineering throughout the paper, which culminates in the example of deriving complete domain-specific transforma- tions language from existing language components. Keywords: Software Language Engineering, Language Composition, Language Derivation The limits of my language mean the limits of my world – Ludwig Wittgenstein 1. Motivation Using models to understand and shape the world is a very foundational technique that has already been used in ancient Greece and Egypt. Scientists model to comprehend while engineers model to design (parts of) the world. Although modeling has been employed for ages in virtually all disciplines it is fairly recent that the form of models is made explicit in modeling languages. Preprint submitted to Computer Languages, Systems and Structures October 15, 2018 [HRW18] K. Hölldobler, B. Rumpe, A.
    [Show full text]
  • An Extensible Component & Connector
    An Extensible Component & Connector Architecture Description Infrastructure for Multi-Platform Modeling Von der Fakult¨at fur¨ Mathematik, Informatik und Naturwissenschaften der RWTH Aachen University zur Erlangung des akademischen Grades eines Doktors der Naturwissenschaften genehmigte Dissertation vorgelegt von Diplom Informatiker Diplom-Wirtschaftsinformatiker Andreas Wortmann aus Joinville, Brasilien Berichter: Universit¨atsprofessor Dr. Bernhard Rumpe Professor Benoit Combemale, Ph. D. Tag der mundlichen¨ Prufung:¨ 12. Juli 2016 Diese Dissertation ist auf den Internetseiten der Universit¨atsbibliothek online verfugbar.¨ WICHTIG: D 82 überprüfen !!! Aachener Informatik-Berichte, Software Engineering herausgegeben von Prof. Dr. rer. nat. Bernhard Rumpe Software Engineering RWTH Aachen University Band 25 Andreas Wortmann An Extensible Component & Connector Architecture Description Infrastructure for Multi-Platform Modeling Shaker Verlag Aachen 2016 Bibliographic information published by the Deutsche Nationalbibliothek The Deutsche Nationalbibliothek lists this publication in the Deutsche Nationalbibliografie; detailed bibliographic data are available in the Internet at http://dnb.d-nb.de. Zugl.: D 82 (Diss. RWTH Aachen University, 2016) Copyright Shaker Verlag 2016 All rights reserved. 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, recording or otherwise, without the prior permission of the publishers. Printed in Germany. ISBN 978-3-8440-4724-0 ISSN 1869-9170 Shaker Verlag GmbH • P.O. BOX 101818 • D-52018 Aachen Phone: 0049/2407/9596-0 • Telefax: 0049/2407/9596-9 Internet: www.shaker.de • e-mail: [email protected] I was born not knowing and have had only a little time to change that here and there. Richard P. Feynman Abstract Efficient software engineering for complex systems requires abstraction, expertise from multiple domains, separation of concerns, and reuse.
    [Show full text]
  • A Guide to Understanding Emerging Interoperability Technologies
    M P 0 0 W 0 0 0 0 0 8 8 M I T R E P R O D U C T A Guide to Understanding Emerging Interoperability Technologies July 2000 Terry Bollinger Sponsor: ONR Contract No.: DAAB07-99-C-C201 Dept. No.: W09T Project No.: 0700V13A-AA The views, opinions and/or findings contained in this report Approved for public release; distribution unlimited. are those of The MITRE Corporation and should not be construed as an official Government position, policy, or decision, unless designated by other documentation. 2000 The MITRE Corporation Washington C3 Center McLean, Virginia ii MITRE Department Approval: Gary R. Brisbois MITRE Project Approval: Daniel J. Lowen iii iv Abstract Interoperability is the ability to use resources from diverse origins as if they had been designed as parts of a single system. Over time, individual interoperability problems tend to disappear as the resources involved literally become part of one system through integration and standardization, but the overall problem of interoperability itself never disappears. Instead, it simply moves up to a new level of complexity that accepts earlier integrations as a given. Interoperability is especially critical for military systems, where international politics can lead to abrupt realignments where yesterday’s foe becomes today’s coalition partner. This report on interoperability has five sections. The first section is an introduction to the interoperability problem, and the second section describes fundamental interoperability concepts and develops a terminology for describing interoperability issues and needs. The second section also addresses the vital issue of interoperability security. The third section is about the processes by which interoperability technologies are standardized, including comparisons of the interoperability benefits of different processes.
    [Show full text]