Vivado Design Suite User Guide: High-Level Synthesis (UG902)

Total Page:16

File Type:pdf, Size:1020Kb

Vivado Design Suite User Guide: High-Level Synthesis (UG902) Vivado Design Suite User Guide High-Level Synthesis UG902 (v2018.3) December 20, 2018 Revision History Revision History The following table shows the revision history for this document. Section Revision Summary 12/20/2018 Version 2018.3 Schedule Viewer Updated information on the schedule viewer. Optimizing the Design Clarified information on dataflow and loops throughout section. C++ Arbitrary Precision Fixed-Point Types: Reference Added note on using header files. Information HLS Math Library Updated information on how hls_math.h is used. The HLS Math Library, Fixed-Point Math Functions Updated functions. HLS Video Library, HLS Video Functions Library Moved the HLS video library to the Xilinx GitHub (https:// github.com/Xilinx/xfopencv) HLS SQL Library, HLS SQL Library Functions Updated hls::db to hls::alg functions. System Calls Added information on using the __SYNTHESIS__ macro. Arrays Added information on array sizing behavior. Command Reference Updated commands. config_dataflow, config_rtl Added the option -disable_start_propagation Class Methods, Operators, and Data Members Added guidance on specifying data width. UG902 (v2018.3) December 20, 2018Send Feedback www.xilinx.com High-Level Synthesis 2 Table of Contents Revision History...............................................................................................................2 Chapter 1: High-Level Synthesis............................................................................ 5 High-Level Synthesis Benefits....................................................................................................5 High-Level Synthesis Basics....................................................................................................... 6 Understanding Vivado HLS...................................................................................................... 12 Using Vivado HLS...................................................................................................................... 19 Data Types for Efficient Hardware.......................................................................................... 71 Managing Interfaces.................................................................................................................77 Optimizing the Design............................................................................................................119 Verifying the RTL..................................................................................................................... 176 Exporting the RTL Design.......................................................................................................189 Chapter 2: High-Level Synthesis C Libraries................................................196 Arbitrary Precision Data Types Library.................................................................................196 HLS Stream Library................................................................................................................. 211 HLS Math Library.....................................................................................................................220 HLS Video Library.................................................................................................................... 231 HLS IP Libraries........................................................................................................................231 HLS Linear Algebra Library.................................................................................................... 254 HLS DSP Library....................................................................................................................... 265 HLS SQL Library....................................................................................................................... 267 Chapter 3: High-Level Synthesis Coding Styles..........................................269 Unsupported C Constructs.....................................................................................................269 C Test Bench.............................................................................................................................273 Functions.................................................................................................................................. 280 Loops........................................................................................................................................ 282 Arrays........................................................................................................................................289 Data Types................................................................................................................................299 C Builtin Functions.................................................................................................................. 324 Hardware Efficient C Code..................................................................................................... 325 UG902 (v2018.3) December 20, 2018Send Feedback www.xilinx.com High-Level Synthesis 3 C++ Classes and Templates....................................................................................................343 Assertions.................................................................................................................................351 SystemC Synthesis.................................................................................................................. 354 Chapter 4: High-Level Synthesis Reference Guide...................................373 Command Reference.............................................................................................................. 373 GUI Reference..........................................................................................................................447 Interface Synthesis Reference............................................................................................... 451 AXI4-Lite Slave C Driver Reference........................................................................................469 HLS Video Functions Library.................................................................................................. 482 HLS Linear Algebra Library Functions.................................................................................. 482 HLS DSP Library Functions..................................................................................................... 491 HLS SQL Library Functions..................................................................................................... 504 C Arbitrary Precision Types.................................................................................................... 507 C++ Arbitrary Precision Types................................................................................................ 521 C++ Arbitrary Precision Fixed-Point Types........................................................................... 541 Comparison of SystemC and Vivado HLS Types..................................................................564 Appendix A: Additional Resources and Legal Notices........................... 571 Xilinx Resources.......................................................................................................................571 Documentation Navigator and Design Hubs...................................................................... 571 References................................................................................................................................572 Please Read: Important Legal Notices................................................................................. 572 UG902 (v2018.3) December 20, 2018Send Feedback www.xilinx.com High-Level Synthesis 4 Chapter 1 High-Level Synthesis The Xilinx® Vivado® High-Level Synthesis (HLS) tool transforms a C specification into a register transfer level (RTL) implementation that you can synthesize into a Xilinx field programmable gate array (FPGA). You can write C specifications in C, C++, or SystemC, and the FPGA provides a massively parallel architecture with benefits in performance, cost, and power over traditional processors. This chapter provides an overview of high-level synthesis. Note: For more information on FPGA architectures and Vivado HLS basic concepts, see the Introduction to FPGA Design Using High-Level Synthesis (UG998). High-Level Synthesis Benefits High-level synthesis bridges hardware and software domains, providing the following primary benefits: • Improved productivity for hardware designers Hardware designers can work at a higher level of abstraction while creating high-performance hardware. • Improved system performance for software designers Software developers can accelerate the computationally intensive parts of their algorithms on a new compilation target, the FPGA. Using a high-level synthesis design methodology allows you to: • Develop algorithms at the C-level Work at a level that is abstract from the implementation details, which consume development time. • Verify at the C-level Validate the functional correctness of the design more quickly than with traditional hardware description languages. • Control the C synthesis process through optimization directives Create specific high-performance hardware implementations. • Create multiple implementations from the C source code using optimization directives UG902 (v2018.3) December 20, 2018Send Feedback www.xilinx.com High-Level Synthesis 5 Chapter
Recommended publications
  • Datatypes (Pdf Format)
    Basic Scripting, Syntax, and Data Types in Python Mteor 227 – Fall 2020 Basic Shell Scripting/Programming with Python • Shell: a user interface for access to an operating system’s services. – The outer layer between the user and the operating system. • The first line in your program needs to be: #!/usr/bin/python • This line tells the computer what python interpreter to use. Comments • Comments in Python are indicated with a pound sign, #. • Any text following a # and the end of the line is ignored by the interpreter. • For multiple-line comments, a # must be used at the beginning of each line. Continuation Line • The \ character at the end of a line of Python code signifies that the next line is a continuation of the current line. Variable Names and Assignments • Valid characters for variable, function, module, and object names are any letter or number. The underscore character can also be used. • Numbers cannot be used as the first character. • The underscore should not be used as either the first or last character, unless you know what you are doing. – There are special rules concerning leading and trailing underscore characters. Variable Names and Assignments • Python is case sensitive! Capitalization matters. – The variable f is not the same as the variable F. • Python supports parallel assignment >>> a, b = 5, 'hi' >>> a 5 >>> b 'hi' Data Types • Examples of data types are integers, floating-point numbers, complex numbers, strings, etc. • Python uses dynamic typing, which means that the variable type is determined by its input. – The same variable name can be used as an integer at one point, and then if a string is assigned to it, it then becomes a string or character variable.
    [Show full text]
  • Open Source Synthesis and Verification Tool for Fixed-To-Floating and Floating-To-Fixed Points Conversions
    Circuits and Systems, 2016, 7, 3874-3885 http://www.scirp.org/journal/cs ISSN Online: 2153-1293 ISSN Print: 2153-1285 Open Source Synthesis and Verification Tool for Fixed-to-Floating and Floating-to-Fixed Points Conversions Semih Aslan1, Ekram Mohammad1, Azim Hassan Salamy2 1Ingram School of Engineering, Electrical Engineering Texas State University, San Marcos, Texas, USA 2School of Engineering, Electrical Engineering University of St. Thomas, St. Paul, Minnesota, USA How to cite this paper: Aslan, S., Mo- Abstract hammad, E. and Salamy, A.H. (2016) Open Source Synthesis and Verification Tool for An open source high level synthesis fixed-to-floating and floating-to-fixed conver- Fixed-to-Floating and Floating-to-Fixed Points sion tool is presented for embedded design, communication systems, and signal Conversions. Circuits and Systems, 7, 3874- processing applications. Many systems use a fixed point number system. Fixed point 3885. http://dx.doi.org/10.4236/cs.2016.711323 numbers often need to be converted to floating point numbers for higher accuracy, dynamic range, fixed-length transmission limitations or end user requirements. A Received: May 18, 2016 similar conversion system is needed to convert floating point numbers to fixed point Accepted: May 30, 2016 numbers due to the advantages that fixed point numbers offer when compared with Published: September 23, 2016 floating point number systems, such as compact hardware, reduced verification time Copyright © 2016 by authors and and design effort. The latest embedded and SoC designs use both number systems Scientific Research Publishing Inc. together to improve accuracy or reduce required hardware in the same design.
    [Show full text]
  • Xilinx Vivado Design Suite User Guide: Release Notes, Installation, And
    Vivado Design Suite User Guide Release Notes, Installation, and Licensing UG973 (v2013.3) October 23, 2013 Notice of Disclaimer The information disclosed to you hereunder (the “Materials”) is provided solely for the selection and use of Xilinx products. To the maximum extent permitted by applicable law: (1) Materials are made available "AS IS" and with all faults, Xilinx hereby DISCLAIMS ALL WARRANTIES AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON-INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and (2) Xilinx shall not be liable (whether in contract or tort, including negligence, or under any other theory of liability) for any loss or damage of any kind or nature related to, arising under, or in connection with, the Materials (including your use of the Materials), including for any direct, indirect, special, incidental, or consequential loss or damage (including loss of data, profits, goodwill, or any type of loss or damage suffered as a result of any action brought by a third party) even if such damage or loss was reasonably foreseeable or Xilinx had been advised of the possibility of the same. Xilinx assumes no obligation to correct any errors contained in the Materials or to notify you of updates to the Materials or to product specifications. You may not reproduce, modify, distribute, or publicly display the Materials without prior written consent. Certain products are subject to the terms and conditions of the Limited Warranties which can be viewed at http://www.xilinx.com/warranty.htm; IP cores may be subject to warranty and support terms contained in a license issued to you by Xilinx.
    [Show full text]
  • MPLAB C Compiler for PIC24 Mcus and Dspic Dscs User's Guide
    MPLAB® C Compiler for PIC24 MCUs and dsPIC® DSCs User’s Guide 2002-2011 Microchip Technology Inc. DS51284K Note the following details of the code protection feature on Microchip devices: • Microchip products meet the specification contained in their particular Microchip Data Sheet. • Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the intended manner and under normal conditions. • There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchip’s Data Sheets. Most likely, the person doing so is engaged in theft of intellectual property. • Microchip is willing to work with the customer who is concerned about the integrity of their code. • Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not mean that we are guaranteeing the product as “unbreakable.” Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of our products. Attempts to break Microchip’s code protection feature may be a violation of the Digital Millennium Copyright Act. If such acts allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act. Information contained in this publication regarding device Trademarks applications and the like is provided only for your convenience The Microchip name and logo, the Microchip logo, dsPIC, and may be superseded by updates.
    [Show full text]
  • GNU MPFR the Multiple Precision Floating-Point Reliable Library Edition 4.1.0 July 2020
    GNU MPFR The Multiple Precision Floating-Point Reliable Library Edition 4.1.0 July 2020 The MPFR team [email protected] This manual documents how to install and use the Multiple Precision Floating-Point Reliable Library, version 4.1.0. Copyright 1991, 1993-2020 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back- Cover Texts. A copy of the license is included in Appendix A [GNU Free Documentation License], page 59. i Table of Contents MPFR Copying Conditions ::::::::::::::::::::::::::::::::::::::: 1 1 Introduction to MPFR :::::::::::::::::::::::::::::::::::::::: 2 1.1 How to Use This Manual::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 2 2 Installing MPFR ::::::::::::::::::::::::::::::::::::::::::::::: 3 2.1 How to Install ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 3 2.2 Other `make' Targets :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 4 2.3 Build Problems :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 4 2.4 Getting the Latest Version of MPFR ::::::::::::::::::::::::::::::::::::::::::::::: 4 3 Reporting Bugs::::::::::::::::::::::::::::::::::::::::::::::::: 5 4 MPFR Basics ::::::::::::::::::::::::::::::::::::::::::::::::::: 6 4.1 Headers and Libraries :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 6
    [Show full text]
  • Perl 6 Deep Dive
    Perl 6 Deep Dive Data manipulation, concurrency, functional programming, and more Andrew Shitov BIRMINGHAM - MUMBAI Perl 6 Deep Dive Copyright © 2017 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. First published: September 2017 Production reference: 1060917 Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK. ISBN 978-1-78728-204-9 www.packtpub.com Credits Author Copy Editor Andrew Shitov Safis Editing Reviewer Project Coordinator Alex Kapranoff Prajakta Naik Commissioning Editor Proofreader Merint Mathew Safis Editing Acquisition Editor Indexer Chaitanya Nair Francy Puthiry Content Development Editor Graphics Lawrence Veigas Abhinash Sahu Technical Editor Production Coordinator Mehul Singh Nilesh Mohite About the Author Andrew Shitov has been a Perl enthusiast since the end of the 1990s, and is the organizer of over 30 Perl conferences in eight countries.
    [Show full text]
  • Software II: Principles of Programming Languages
    Software II: Principles of Programming Languages Lecture 6 – Data Types Some Basic Definitions • A data type defines a collection of data objects and a set of predefined operations on those objects • A descriptor is the collection of the attributes of a variable • An object represents an instance of a user- defined (abstract data) type • One design issue for all data types: What operations are defined and how are they specified? Primitive Data Types • Almost all programming languages provide a set of primitive data types • Primitive data types: Those not defined in terms of other data types • Some primitive data types are merely reflections of the hardware • Others require only a little non-hardware support for their implementation The Integer Data Type • Almost always an exact reflection of the hardware so the mapping is trivial • There may be as many as eight different integer types in a language • Java’s signed integer sizes: byte , short , int , long The Floating Point Data Type • Model real numbers, but only as approximations • Languages for scientific use support at least two floating-point types (e.g., float and double ; sometimes more • Usually exactly like the hardware, but not always • IEEE Floating-Point Standard 754 Complex Data Type • Some languages support a complex type, e.g., C99, Fortran, and Python • Each value consists of two floats, the real part and the imaginary part • Literal form real component – (in Fortran: (7, 3) imaginary – (in Python): (7 + 3j) component The Decimal Data Type • For business applications (money)
    [Show full text]
  • Functional and Procedural Languages and Data Structures Learning
    Chapter 1 Functional and Procedural Languages and Data Structures Learning Joao˜ Dovicchi and Joao˜ Bosco da Mota Alves1 Abstract: In this paper authors present a didactic method for teaching Data Structures on Computer Science undergraduate course. An approach using func- tional along with procedural languages (Haskell and ANSI C) is presented, and adequacy of such a method is discussed. Authors are also concerned on how functional language can help students to learn fundamental concepts and acquire competence on data typing and structure for real programming. 1.1 INTRODUCTION Computer science and Information Technology (IT) undergraduate courses have its main focus on software development and software quality. Albeit recent in- troduction of Object Oriented Programming (OOP) have been enphasized, the preferred programming style paradigm is based on imperative languages. FOR- TRAN, Cobol, Algol, Pascal, C and other procedural languages were frequently used to teach computer and programming concepts [Lev95]. Nowadays, Java is the choice for many computer science teaching programs [KW99, Gri00, Blu02, GT98], although “the novelty and popularity of a language do not automatically imply its suitability for the learning of introductory programming” [Had98]. Inside undergraduate curricula, Data Structures courses has some specific re- quirements that depends on mathematical formalism. In this perspective, concepts 1Remote Experimentation Laboratory, Informatics and Statistics Department (INE), Universidade Federal de Santa Catarina (UFSC), Florianopolis,´ SC, Brazil, CEP 88040-900; Phone: +55 (48) 331 7511; Fax: +55 (48) 331 9770; Email: [email protected] and [email protected] 1 on discrete mathematics is very important on understanding this formalism. These courses’ syllabuses include concept attainment and competence development on expression evaluation, iteration, recursion, lists, graphs, trees, and so on.
    [Show full text]
  • Vivado Tutorial
    Lab Workbook Vivado Tutorial Vivado Tutorial Introduction This tutorial guides you through the design flow using Xilinx Vivado software to create a simple digital circuit using Verilog HDL. A typical design flow consists of creating model(s), creating user constraint file(s), creating a Vivado project, importing the created models, assigning created constraint file(s), optionally running behavioral simulation, synthesizing the design, implementing the design, generating the bitstream, and finally verifying the functionality in the hardware by downloading the generated bitstream file. You will go through the typical design flow targeting the Artix-100 based Nexys4 board. The typical design flow is shown below. The circled number indicates the corresponding step in this tutorial. Figure 1. A typical design flow Objectives After completing this tutorial, you will be able to: • Create a Vivado project sourcing HDL model(s) and targeting a specific FPGA device located on the Nexys4 board • Use the provided partially completed Xilinx Design Constraint (XDC) file to constrain some of the pin locations • Add additional constraints using the Tcl scripting feature of Vivado • Simulate the design using the XSim simulator • Synthesize and implement the design • Generate the bitstream • Configure the FPGA using the generated bitstream and verify the functionality • Go through the design flow in batch mode using the Tcl script Procedure This tutorial is broken into steps that consist of general overview statements providing information on the detailed instructions that follow. Follow these detailed instructions to progress through the tutorial. www.xilinx.com/university Nexys4 Vivado Tutorial-1 [email protected] © copyright 2013 Xilinx Vivado Tutorial Lab Workbook Design Description The design consists of some inputs directly connected to the corresponding output LEDs.
    [Show full text]
  • Should C Replace FORTRAN As the Language of Scientific Programming?
    Should C Replace FORTRAN as the Language of Scientific Programming? Linda Wharton CSCI 5535 Fall 1995 Abstract Anti-FORTRAN sentiment has recently become more prevalent. Where does the attitude originate? The most probable source is academia, where C and C++ are the languages of choice. Is there a fact based justification for the attitude? FORTRAN and C are evaluated to determine whether C is a better language than FORTRAN for scientific programming. The features of FORTRAN 77, FORTRAN 90, C and C++ are compared, and evaluated as to how well they meet the requirements of the scientific programming domain. FORTRAN was designed specifically for numerical programming, and thus better meets the requirements. Three algorithms in the scientific domain are coded in both FORTRAN and C. They are evaluated on performance, readability of the code and optimization potential. In all cases the FORTRAN implementations proved superior. Is there evidence to mandate that all upgrades and new development should be done in C, rather than FORTRAN? A good computer programmer can solve any given problem in any language, however it is best to code in the language specifically designed for the problem domain. In the case of scientific programming, that language is FORTRAN. 1 Introduction In the computer arena related to scientific programming, a prevalent attitude seems to be that FORTRAN is obsolete, and C should be used as a replacement language. I am employed as a programmer that supports meteorological research. Most of the programming code I work with is written in FORTRAN. Within the course of my work, I continually encounter prejudice against FORTRAN.
    [Show full text]
  • Xilinx Vivado Design Suite 7 Series FPGA and Zynq-7000 All Programmable Soc Libraries Guide (UG953)
    Vivado Design Suite 7 Series FPGA and Zynq-7000 All Programmable SoC Libraries Guide UG953 (v 2013.1) March 20, 2013 Notice of Disclaimer The information disclosed to you hereunder (the "Materials") is provided solely for the selection and use of Xilinx products. To the maximum extent permitted by applicable law: (1) Materials are made available "AS IS" and with all faults, Xilinx hereby DISCLAIMS ALL WARRANTIES AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON-INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and (2) Xilinx shall not be liable (whether in contract or tort, including negligence, or under any other theory of liability) for any loss or damage of any kind or nature related to, arising under, or in connection with, the Materials (including your use of the Materials), including for any direct, indirect, special, incidental, or consequential loss or damage (including loss of data, profits, goodwill, or any type of loss or damage suffered as a result of any action brought by a third party) even if such damage or loss was reasonably foreseeable or Xilinx had been advised of the possibility of the same. Xilinx assumes no obligation to correct any errors contained in the Materials or to notify you of updates to the Materials or to product specifications. You may not reproduce, modify, distribute, or publicly display the Materials without prior written consent. Certain products are subject to the terms and conditions of the Limited Warranties which can be viewed at http://www.xilinx.com/warranty.htm; IP cores may be subject to warranty and support terms contained in a license issued to you by Xilinx.
    [Show full text]
  • Vivado Design Suite User Guide: Implementation
    See all versions of this document Vivado Design Suite User Guide Implementation UG904 (v2021.1) August 30, 2021 Revision History Revision History The following table shows the revision history for this document. Section Revision Summary 08/30/2021 Version 2021.1 Sweep (Default) Added more information. Incremental Implementation Controls Corrected Block Memory and DSP placement example. Using Incremental Implementation in Project Mode Corrected steps and updated image. Using report_incremental_reuse Updated Reuse Summary example and Reference Run Comparison. Physical Optimization Reports Updated to clarify that report is not cumulative. Available Logic Optimizations Added -resynth_remap. Resynth Remap Added logic optimization. opt_design Added [-resynth_remap] to opt_design Syntax. Physical Synthesis Phase Added entry for Property-Based Retiming. 02/26/2021 Version 2020.2 General Updates General release updates. 08/25/2020 Version 2020.1 Appendix A: Using Remote Hosts and Compute Clusters Updated section. UG904 (v2021.1) August 30, 2021Send Feedback www.xilinx.com Implementation 2 Table of Contents Revision History...............................................................................................................2 Chapter 1: Preparing for Implementation....................................................... 5 About the Vivado Implementation Process............................................................................. 5 Navigating Content by Design Process...................................................................................
    [Show full text]