Nios® II Software Developer Handbook

Total Page:16

File Type:pdf, Size:1020Kb

Nios® II Software Developer Handbook Nios® II Software Developer Handbook Updated for Intel® Quartus® Prime Design Suite: 21.1 Subscribe NII-SDH | 2021.04.02 Send Feedback Latest document on the web: PDF | HTML Contents Contents 1. Nios® II Software Developer's Handbook Revision History........................................... 12 1.1. Overview of Nios® II Embedded Development Revision History.................................. 13 1.2. Getting Started with the Graphical User Interface Revision History..............................13 1.3. Getting Started from the Command Line Revision History..........................................14 1.4. Nios II Software Build Tools Revision History............................................................14 1.5. Overview of the Hardware Abstraction Layer Revision History.................................... 14 1.6. Developing Programs Using the Hardware Abstraction Layer Revision History............... 14 1.7. Developing Device Drivers for the Hardware Abstraction Layer Revision History............15 1.8. Exception Handling Revision History....................................................................... 15 1.9. Cache and Tightly-Coupled Memory Revision History.................................................15 1.10. MicroC/OS-II Real-Time Operating System Revision History..................................... 15 1.11. Ethernet and the NicheStack TCP/IP Stack - Nios II Edition Revision History...............16 1.12. Read-Only Zip File System Revision History........................................................... 16 1.13. Publishing Component Information to Embedded Software Revision History............... 16 1.14. HAL API Reference Revision History...................................................................... 16 1.15. Nios II Software Build Tools Reference Revision History........................................... 16 2. Overview of Nios II Embedded Development................................................................ 18 2.1. Installing Windows Subsystem for Linux (WSL) on Windows...................................... 18 2.2. Prerequisites for Understanding the Nios II Embedded Design Suite............................19 2.3. Finding Nios II EDS Files.......................................................................................19 2.4. Nios II Software Development Environment.............................................................19 2.5. Nios II EDS Development Flows............................................................................. 20 2.5.1. Nios II SBT Development Flow................................................................... 20 2.6. Nios II Programs..................................................................................................21 2.6.1. Makefiles and the SBT.............................................................................. 21 2.6.2. Nios II Software Project Types................................................................... 22 2.7. Intel FPGA Software Packages for Embedded Systems.............................................. 22 2.8. Nios II Embedded Design Examples........................................................................23 2.8.1. Hardware Examples................................................................................. 23 2.8.2. Software Examples.................................................................................. 24 2.9. Third-Party Embedded Tools Support...................................................................... 24 2.10. Additional Nios II Information.............................................................................. 24 3. Getting Started with the Graphical User Interface........................................................ 26 3.1. Installing Eclipse IDE into Nios II EDS.....................................................................26 3.1.1. Windows Installation................................................................................ 26 3.1.2. Linux Installation..................................................................................... 27 3.2. Getting Started with Nios II Software in Eclipse....................................................... 27 3.2.1. The Nios II SBT for Eclipse Workbench........................................................ 28 3.2.2. Creating a Project.................................................................................... 28 3.2.3. Navigating the Project.............................................................................. 30 3.2.4. Building the Project.................................................................................. 31 3.2.5. Configuring the FPGA............................................................................... 31 3.2.6. Running the Project on Nios II Hardware.....................................................31 3.2.7. Debugging the Project on Nios II Hardware................................................. 32 3.2.8. Creating a Simple BSP.............................................................................. 38 3.3. Makefiles and the Nios II SBT for Eclipse................................................................. 38 ® Nios II Software Developer Handbook Send Feedback 2 Contents 3.3.1. Eclipse Source Management...................................................................... 39 3.3.2. User Source Management......................................................................... 40 3.3.3. BSP Source Management.......................................................................... 41 3.4. Using the BSP Editor............................................................................................ 41 3.4.1. Tcl Scripting and the Nios II BSP Editor....................................................... 42 3.4.2. Starting the Nios II BSP Editor...................................................................42 3.4.3. The Nios II BSP Editor Screen Layout..........................................................42 3.4.4. The Command Area..................................................................................42 3.4.5. Messages Tabs........................................................................................49 3.4.6. Exporting a Tcl Script................................................................................50 3.4.7. Creating a New BSP................................................................................. 50 3.4.8. BSP Validation Errors................................................................................51 3.5. Run Configurations in the SBT for Eclipse................................................................ 52 3.5.1. Opening the Run Configuration Dialog Box...................................................52 3.5.2. The Project Tab........................................................................................52 3.5.3. The Target Connection Tab........................................................................ 52 3.5.4. The Debugger Tab....................................................................................53 3.6. Optimizing Project Build Time................................................................................ 53 3.7. Importing a Command-Line Project........................................................................ 53 3.7.1. Nios II Command-Line Projects..................................................................53 3.7.2. Importing through the Import Wizard......................................................... 53 3.7.3. Road Map............................................................................................... 54 3.7.4. Import a Command-Line C/C++ Application................................................ 54 3.7.5. Import a Supporting Project...................................................................... 55 3.7.6. User-Managed Source Files....................................................................... 56 3.8. Packaging a Library for Reuse................................................................................56 3.8.1. Creating the User Library.......................................................................... 56 3.8.2. Using the Library..................................................................................... 56 3.9. Creating a Software Package................................................................................. 57 3.10. Programming Flash in Intel FPGA Embedded Systems............................................. 59 3.10.1. Starting the Flash Programmer................................................................ 60 3.10.2. Creating a Flash Programmer Settings File.................................................60 3.10.3. The Flash Programmer Screen Layout....................................................... 61 3.10.4. The Command Area................................................................................61 3.10.5. The Console Area................................................................................... 61 3.10.6. Saving a Flash Programmer Settings File................................................... 62 3.10.7. Flash Programmer Options...................................................................... 62 3.11. Creating Memory Initialization Files...................................................................... 63 3.11.1. Generate Memory Initialization Files......................................................... 63 3.11.2. Generate Memory Initialization Files by the Legacy Method.......................... 63 3.11.3. Memory Initialization
Recommended publications
  • Linux and Electronics
    Linux and Electronics Urs Lindegger Linux and Electronics Urs Lindegger Copyright © 2019-11-25 Urs Lindegger Table of Contents 1. Introduction .......................................................................................................... 1 Note ................................................................................................................ 1 2. Printed Circuits ...................................................................................................... 2 Printed Circuit Board design ................................................................................ 2 Kicad ....................................................................................................... 2 Eagle ..................................................................................................... 13 Simulation ...................................................................................................... 13 Spice ..................................................................................................... 13 Digital simulation .................................................................................... 18 Wings 3D ....................................................................................................... 18 User interface .......................................................................................... 19 Modeling ................................................................................................ 19 Making holes in Wings 3D .......................................................................
    [Show full text]
  • Nios II Custom Instruction User Guide
    Nios II Custom Instruction User Guide Subscribe UG-20286 | 2020.04.27 Send Feedback Latest document on the web: PDF | HTML Contents Contents 1. Nios II Custom Instruction Overview..............................................................................4 1.1. Custom Instruction Implementation......................................................................... 4 1.1.1. Custom Instruction Hardware Implementation............................................... 5 1.1.2. Custom Instruction Software Implementation................................................ 6 2. Custom Instruction Hardware Interface......................................................................... 7 2.1. Custom Instruction Types....................................................................................... 7 2.1.1. Combinational Custom Instructions.............................................................. 8 2.1.2. Multicycle Custom Instructions...................................................................10 2.1.3. Extended Custom Instructions................................................................... 11 2.1.4. Internal Register File Custom Instructions................................................... 13 2.1.5. External Interface Custom Instructions....................................................... 15 3. Custom Instruction Software Interface.........................................................................16 3.1. Custom Instruction Software Examples................................................................... 16
    [Show full text]
  • Intel Quartus Prime Pro Edition User Guide: Programmer Send Feedback
    Intel® Quartus® Prime Pro Edition User Guide Programmer Updated for Intel® Quartus® Prime Design Suite: 21.2 Subscribe UG-20134 | 2021.07.21 Send Feedback Latest document on the web: PDF | HTML Contents Contents 1. Intel® Quartus® Prime Programmer User Guide..............................................................4 1.1. Generating Primary Device Programming Files........................................................... 5 1.2. Generating Secondary Programming Files................................................................. 6 1.2.1. Generating Secondary Programming Files (Programming File Generator)........... 7 1.2.2. Generating Secondary Programming Files (Convert Programming File Dialog Box)............................................................................................. 11 1.3. Enabling Bitstream Security for Intel Stratix 10 Devices............................................ 18 1.3.1. Enabling Bitstream Authentication (Programming File Generator)................... 19 1.3.2. Specifying Additional Physical Security Settings (Programming File Generator).............................................................................................. 21 1.3.3. Enabling Bitstream Encryption (Programming File Generator).........................22 1.4. Enabling Bitstream Encryption or Compression for Intel Arria 10 and Intel Cyclone 10 GX Devices.................................................................................................. 23 1.5. Generating Programming Files for Partial Reconfiguration.........................................
    [Show full text]
  • Introduction to Intel® FPGA IP Cores
    Introduction to Intel® FPGA IP Cores Updated for Intel® Quartus® Prime Design Suite: 20.3 Subscribe UG-01056 | 2020.11.09 Send Feedback Latest document on the web: PDF | HTML Contents Contents 1. Introduction to Intel® FPGA IP Cores..............................................................................3 1.1. IP Catalog and Parameter Editor.............................................................................. 4 1.1.1. The Parameter Editor................................................................................. 5 1.2. Installing and Licensing Intel FPGA IP Cores.............................................................. 5 1.2.1. Intel FPGA IP Evaluation Mode.....................................................................6 1.2.2. Checking the IP License Status.................................................................... 8 1.2.3. Intel FPGA IP Versioning............................................................................. 9 1.2.4. Adding IP to IP Catalog...............................................................................9 1.3. Best Practices for Intel FPGA IP..............................................................................10 1.4. IP General Settings.............................................................................................. 11 1.5. Generating IP Cores (Intel Quartus Prime Pro Edition)...............................................12 1.5.1. IP Core Generation Output (Intel Quartus Prime Pro Edition)..........................13 1.5.2. Scripting IP Core Generation....................................................................
    [Show full text]
  • Intel® Arria® 10 Device Overview
    Intel® Arria® 10 Device Overview Subscribe A10-OVERVIEW | 2020.10.20 Send Feedback Latest document on the web: PDF | HTML Contents Contents Intel® Arria® 10 Device Overview....................................................................................... 3 Key Advantages of Intel Arria 10 Devices........................................................................ 4 Summary of Intel Arria 10 Features................................................................................4 Intel Arria 10 Device Variants and Packages.....................................................................7 Intel Arria 10 GX.................................................................................................7 Intel Arria 10 GT............................................................................................... 11 Intel Arria 10 SX............................................................................................... 14 I/O Vertical Migration for Intel Arria 10 Devices.............................................................. 17 Adaptive Logic Module................................................................................................ 17 Variable-Precision DSP Block........................................................................................18 Embedded Memory Blocks........................................................................................... 20 Types of Embedded Memory............................................................................... 21 Embedded Memory Capacity in
    [Show full text]
  • Porting and Using Newlib in Embedded Systems William Gatliff Table of Contents Copyright
    Porting and Using Newlib in Embedded Systems William Gatliff Table of Contents Copyright................................................................................................................................3 Newlib.....................................................................................................................................3 Newlib Licenses....................................................................................................................3 Newlib Features ....................................................................................................................3 Building Newlib ...................................................................................................................7 Tweaks ....................................................................................................................................8 Porting Newlib......................................................................................................................9 Onward! ................................................................................................................................19 Resources..............................................................................................................................19 About the Author................................................................................................................19 $Revision: 1.5 $ Although technically not a GNU product, the C runtime library newlib is the best choice for many GNU-based
    [Show full text]
  • Red Hat Developer Toolset 9 User Guide
    Red Hat Developer Toolset 9 User Guide Installing and Using Red Hat Developer Toolset Last Updated: 2020-08-07 Red Hat Developer Toolset 9 User Guide Installing and Using Red Hat Developer Toolset Zuzana Zoubková Red Hat Customer Content Services Olga Tikhomirova Red Hat Customer Content Services [email protected] Supriya Takkhi Red Hat Customer Content Services Jaromír Hradílek Red Hat Customer Content Services Matt Newsome Red Hat Software Engineering Robert Krátký Red Hat Customer Content Services Vladimír Slávik Red Hat Customer Content Services Legal Notice Copyright © 2020 Red Hat, Inc. The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/ . In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version. Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law. Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries. Linux ® is the registered trademark of Linus Torvalds in the United States and other countries. Java ® is a registered trademark of Oracle and/or its affiliates. XFS ® is a trademark of Silicon Graphics International Corp.
    [Show full text]
  • Download Chapter 3: "Configuring Your Project with Autoconf"
    CONFIGURING YOUR PROJECT WITH AUTOCONF Come my friends, ’Tis not too late to seek a newer world. —Alfred, Lord Tennyson, “Ulysses” Because Automake and Libtool are essen- tially add-on components to the original Autoconf framework, it’s useful to spend some time focusing on using Autoconf without Automake and Libtool. This will provide a fair amount of insight into how Autoconf operates by exposing aspects of the tool that are often hidden by Automake. Before Automake came along, Autoconf was used alone. In fact, many legacy open source projects never made the transition from Autoconf to the full GNU Autotools suite. As a result, it’s not unusual to find a file called configure.in (the original Autoconf naming convention) as well as handwritten Makefile.in templates in older open source projects. In this chapter, I’ll show you how to add an Autoconf build system to an existing project. I’ll spend most of this chapter talking about the fundamental features of Autoconf, and in Chapter 4, I’ll go into much more detail about how some of the more complex Autoconf macros work and how to properly use them. Throughout this process, we’ll continue using the Jupiter project as our example. Autotools © 2010 by John Calcote Autoconf Configuration Scripts The input to the autoconf program is shell script sprinkled with macro calls. The input stream must also include the definitions of all referenced macros—both those that Autoconf provides and those that you write yourself. The macro language used in Autoconf is called M4. (The name means M, plus 4 more letters, or the word Macro.1) The m4 utility is a general-purpose macro language processor originally written by Brian Kernighan and Dennis Ritchie in 1977.
    [Show full text]
  • Anatomy of Cross-Compilation Toolchains
    Embedded Linux Conference Europe 2016 Anatomy of cross-compilation toolchains Thomas Petazzoni free electrons [email protected] Artwork and Photography by Jason Freeny free electrons - Embedded Linux, kernel, drivers - Development, consulting, training and support. http://free-electrons.com 1/1 Thomas Petazzoni I CTO and Embedded Linux engineer at Free Electrons I Embedded Linux specialists. I Development, consulting and training. I http://free-electrons.com I Contributions I Kernel support for the Marvell Armada ARM SoCs from Marvell I Major contributor to Buildroot, an open-source, simple and fast embedded Linux build system I Living in Toulouse, south west of France Drawing from Frank Tizzoni, at Kernel Recipes 2016 free electrons - Embedded Linux, kernel, drivers - Development, consulting, training and support. http://free-electrons.com 2/1 Disclaimer I I am not a toolchain developer. Not pretending to know everything about toolchains. I Experience gained from building simple toolchains in the context of Buildroot I Purpose of the talk is to give an introduction, not in-depth information. I Focused on simple gcc-based toolchains, and for a number of examples, on ARM specific details. I Will not cover advanced use cases, such as LTO, GRAPHITE optimizations, etc. I Will not cover LLVM free electrons - Embedded Linux, kernel, drivers - Development, consulting, training and support. http://free-electrons.com 3/1 What is a cross-compiling toolchain? I A set of tools that allows to build source code into binary code for
    [Show full text]
  • Building Multi-File Programs with the Make Tool
    Princeton University Computer Science 217: Introduction to Programming Systems Agenda Motivation for Make Building Multi-File Programs Make Fundamentals with the make Tool Non-File Targets Macros Implicit Rules 1 2 Multi-File Programs Motivation for Make (Part 1) intmath.h (interface) Building testintmath, approach 1: testintmath.c (client) #ifndef INTMATH_INCLUDED • Use one gcc217 command to #define INTMATH_INCLUDED #include "intmath.h" int gcd(int i, int j); #include <stdio.h> preprocess, compile, assemble, and link int lcm(int i, int j); #endif int main(void) { int i; intmath.c (implementation) int j; printf("Enter the first integer:\n"); #include "intmath.h" scanf("%d", &i); testintmath.c intmath.h intmath.c printf("Enter the second integer:\n"); int gcd(int i, int j) scanf("%d", &j); { int temp; printf("Greatest common divisor: %d.\n", while (j != 0) gcd(i, j)); { temp = i % j; printf("Least common multiple: %d.\n", gcc217 testintmath.c intmath.c –o testintmath i = j; lcm(i, j); j = temp; return 0; } } return i; } Note: intmath.h is int lcm(int i, int j) #included into intmath.c { return (i / gcd(i, j)) * j; testintmath } and testintmath.c 3 4 Motivation for Make (Part 2) Partial Builds Building testintmath, approach 2: Approach 2 allows for partial builds • Preprocess, compile, assemble to produce .o files • Example: Change intmath.c • Link to produce executable binary file • Must rebuild intmath.o and testintmath • Need not rebuild testintmath.o!!! Recall: -c option tells gcc217 to omit link changed testintmath.c intmath.h intmath.c
    [Show full text]
  • Intel FPGA Product Catalog Devices: 10 Nm Device Portfolio Intel Agilex FPGA and Soc Overview
    • Cover TBD INTEL® FPGA PRODUCT CATALOG Version 19.3 CONTENTS Overview Acceleration Platforms and Solutions Intel® FPGA Solutions Portfolio 1 Intel FPGA Programmable Acceleration Overview 61 Devices Intel Acceleration Stack for Intel Xeon® CPU with FPGAs 62 Intel FPGA Programmable Acceleration Cards 63 10 nm Device Portfolio - Intel AgilexTM - Intel Programmable Acceleration Card with 63 FPGA and SoC Overview 2 Intel Arria 10 GX FPGA - Intel Agilex FPGA Features 4 - Intel FPGA Programmable Acceleration Card D5005 64 Generation 10 Device Portfolio - Intel FPGA Programmable Acceleration Card N3000 65 - Generation 10 FPGAs and SoCs 6 - Intel FPGA Programmable Acceleration Card 66 - Intel Stratix® 10 FPGA and SoC Overview 7 Comparison - Intel Stratix 10 FPGA Features 9 Accelerated Workload Solutions 67 - Intel Stratix 10 SoC Features 11 - Intel Stratix 10 TX Features 13 - Intel Stratix 10 MX Features 15 Design Tools, OS Support, and Processors - Intel Stratix 10 DX Features 17 Intel Quartus® Prime Software 68 - Intel Arria® 10 FPGA and SoC Overview 20 DSP Builder for Intel FPGAs 71 - Intel Arria 10 FPGA Features 21 Intel FPGA SDK for OpenCL™ 72 - Intel Arria 10 SoC Features 23 - Intel Cyclone® 10 FPGA Overview 25 Intel SoC FPGA Embedded Development Suite 73 - Intel Cyclone 10 GX FPGA Features 26 SoC Operating System Support 74 - Intel Cyclone 10 LP FPGA Features 27 Nios® II Processor 75 - Intel MAX® 10 FPGA Overview 29 - Intel MAX 10 FPGA Features 30 Nios II Processor Embedded Design Suite 76 Nios II Processor Operating System Support 28
    [Show full text]
  • Intel FPGA SDK for Opencl Pro Edition: Programming Guide Send Feedback
    Intel® FPGA SDK for OpenCL™ Pro Edition Programming Guide Updated for Intel® Quartus® Prime Design Suite: 21.2 Subscribe UG-OCL002 | 2021.06.23 Send Feedback Latest document on the web: PDF | HTML Contents Contents 1. Intel® FPGA SDK for OpenCL™ Overview......................................................................... 7 1.1. Intel FPGA SDK for OpenCL Pro Edition Programming Guide Prerequisites......................7 1.2. Intel FPGA SDK for OpenCL FPGA Programming Flow..................................................8 2. Intel FPGA SDK for OpenCL Offline Compiler Kernel Compilation Flows........................ 10 2.1. One-Step Compilation for Simple Kernels................................................................ 11 2.2. Multistep Intel FPGA SDK for OpenCL Pro Edition Design Flow.................................... 12 3. Obtaining General Information on Software, Compiler, and Custom Platform...............16 3.1. Displaying the Software Version (version)............................................................... 16 3.2. Displaying the Compiler Version (-version).............................................................. 16 3.3. Listing the Intel FPGA SDK for OpenCL Utility Command Options (help).......................17 3.3.1. Displaying Information on an Intel FPGA SDK for OpenCL Utility Command Option (help <command_option>)............................................................. 17 3.4. Listing the Intel FPGA SDK for OpenCL Offline Compiler Command Options (no argument, -help, or -h)......................................................................................17
    [Show full text]