Embedded Design Handbook (Nios and Platform Designer)

Total Page:16

File Type:pdf, Size:1020Kb

Embedded Design Handbook (Nios and Platform Designer) Embedded Design Handbook Subscribe EDH | 2018.11.12 Send Feedback Latest document on the web: PDF | HTML Contents Contents 1. Introduction................................................................................................................... 6 1.1. Document Revision History for Embedded Design Handbook........................................ 6 2. First Time Designer's Guide............................................................................................ 8 2.1. FPGAs and Soft-Core Processors.............................................................................. 8 2.2. Embedded System Design...................................................................................... 9 2.3. Embedded Design Resources................................................................................. 11 2.3.1. Intel Embedded Support........................................................................... 11 2.3.2. Intel Embedded Training........................................................................... 11 2.3.3. Intel Embedded Documentation................................................................. 12 2.3.4. Third Party Intellectual Property.................................................................12 2.4. Intel Embedded Glossary...................................................................................... 13 2.5. First Time Designer's Guide Revision History............................................................14 3. Hardware System Design with Intel Quartus Prime and Platform Designer.................. 15 3.1. FPGA Hardware Design......................................................................................... 16 3.1.1. Connecting Your FPGA Design to Your Hardware...........................................17 3.1.2. Connecting Signals to your Platform Designer System...................................17 3.1.3. Constraining Your FPGA-Based Design.........................................................18 3.2. System Design with Platform Designer....................................................................19 3.2.1. Intel System on a Programmable Chip (Platform Designer) Solutions.............. 20 3.2.2. Platform Designer Design..........................................................................22 3.3. Interfacing an External Processor to an Intel FPGA................................................... 23 3.3.1. Configuration Options............................................................................... 24 3.3.2. RapidIO Interface.....................................................................................27 3.3.3. PCI Express Interface............................................................................... 29 3.3.4. PCI Interface...........................................................................................31 3.3.5. Serial Protocol Interface (SPI)................................................................... 31 3.3.6. Custom Bridge Interfaces..........................................................................33 3.4. Avalon-MM Byte Ordering......................................................................................35 3.4.1. Endianness............................................................................................. 35 3.4.2. Avalon-MM Interface Ordering................................................................... 36 3.4.3. Nios II Processor Data Accesses.................................................................40 3.4.4. Adapting Processor Masters to be Avalon-MM Compliant................................42 3.4.5. System-Wide Design Recommendations...................................................... 50 3.5. Memory System Design........................................................................................ 52 3.5.1. Memory Types......................................................................................... 52 3.5.2. On-Chip Memory......................................................................................52 3.5.3. External SRAM.........................................................................................55 3.5.4. Flash Memory..........................................................................................56 3.5.5. SDRAM...................................................................................................58 3.5.6. Case Study............................................................................................. 64 3.6. Nios II Hardware Development Tutorial................................................................... 68 3.6.1. Software and Hardware Requirements........................................................ 68 3.6.2. Intel FPGA IP Evaluation Mode................................................................... 69 3.6.3. Nios II Design Example.............................................................................69 3.6.4. Nios II System Development Flow.............................................................. 71 3.6.5. Creating the Design Example.....................................................................75 Embedded Design Handbook Send Feedback 2 Contents 3.7. Platform Designer System Design Tutorial............................................................... 89 3.7.1. Software and Hardware Requirements........................................................ 90 3.7.2. Download and Install the Tutorial Design Files..............................................91 3.7.3. Open the Tutorial Project...........................................................................91 3.7.4. Creating Platform Designer Systems...........................................................92 3.7.5. Assemble a Hierarchical System............................................................... 100 3.7.6. Viewing the Memory Tester System in Platform Designer............................. 107 3.7.7. Compiling and Downloading Software to a Development Board.....................107 3.7.8. Debugging Your Design........................................................................... 109 3.7.9. Verifying Hardware in System Console...................................................... 109 3.7.10. Simulating Custom Components............................................................. 111 3.7.11. View a Diagram of the Completed System................................................117 3.8. Hardware System Design with Intel Quartus Prime and Platform Designer Revision History...........................................................................................................118 4. Software System Design with a Nios II Processor ......................................................119 4.1. Nios II Command-Line Tools................................................................................ 120 4.1.1. Intel Command-Line Tools for Board Bringup and Diagnostics.......................120 4.1.2. Intel Command-Line Tools for Flash Programming.......................................122 4.1.3. Intel Command-Line Tools for Software Development and Debug..................125 4.1.4. Intel Command-Line Nios II Software Build Tools........................................128 4.1.5. Rebuilding Software from the Command Line............................................. 129 4.1.6. GNU Command-Line Tools....................................................................... 130 4.2. Developing Nios II Software................................................................................ 137 4.2.1. Software Development Cycle................................................................... 138 4.2.2. Software Project Mechanics..................................................................... 142 4.2.3. Developing With the Hardware Abstraction Layer........................................161 4.2.4. Linking Applications................................................................................182 4.3. Nios II MPU Usage..............................................................................................184 4.3.1. Requirements........................................................................................ 184 4.3.2. General Usage....................................................................................... 185 4.3.3. Nios II MPU Design Examples...................................................................195 4.4. Profiling Nios II Systems..................................................................................... 200 4.4.1. Requirements........................................................................................ 200 4.4.2. Tools.................................................................................................... 200 4.4.3. Using the GNU Profiler to Measure Code Performance..................................202 4.4.4. Using Performance Counter and Timer Components.................................... 209 4.4.5. Troubleshooting..................................................................................... 215 4.5. Software System Design with a Nios II Processor Revision History............................ 216 5. Nios II Configuration and Booting Solutions............................................................... 217 5.1. Introduction...................................................................................................... 217 5.1.1. Prerequisites......................................................................................... 217 5.2. Nios II Processor Booting Methods........................................................................218
Recommended publications
  • Freescale E200z6 Powerpc Core Reference Manual
    e200z6RM 6/2004 Rev. 0 e200z6 PowerPC™ Core Reference Manual Contents SectionParagraph Page Number Title Number ChapterContents 1 e200z6 Overview 1.1 Overview of the e200z6....................................................................................... 1-1 1.1.1 Features............................................................................................................ 1-3 1.2 Programming Model ............................................................................................ 1-4 1.2.1 Register Set...................................................................................................... 1-4 1.3 Instruction Set ...................................................................................................... 1-6 1.4 Interrupts and Exception Handling ...................................................................... 1-7 1.4.1 Exception Handling ......................................................................................... 1-8 1.4.2 Interrupt Classes .............................................................................................. 1-8 1.4.3 Interrupt Types................................................................................................. 1-9 1.4.4 Interrupt Registers............................................................................................ 1-9 1.5 Microarchitecture Summary .............................................................................. 1-12 1.5.1 Instruction Unit Features ..............................................................................
    [Show full text]
  • CS3210: Booting and X86
    1 CS3210: Booting and x86 Taesoo Kim 2 What is an operating system? • e.g. OSX, Windows, Linux, FreeBSD, etc. • What does an OS do for you? • Abstract the hardware for convenience and portability • Multiplex the hardware among multiple applications • Isolate applications to contain bugs • Allow sharing among applications 3 Example: Intel i386 4 Example: IBM T42 5 Abstract model (Wikipedia) 6 Abstract model: CPU, Memory, and I/O • CPU: execute instruction, IP → next IP • Memory: read/write, address → data • I/O: talk to external world, memory-mapped I/O or port I/O I/O: input and output, IP: instruction pointer 7 Today: Bootstrapping • CPU → what's first instruction? • Memory → what's initial code/data? • I/O → whom to talk to? 8 What happens after power on? • High-level: Firmware → Bootloader → OS kernel • e.g., jos: BIOS → boot/* → kern/* • e.g., xv6: BIOS → bootblock → kernel • e.g., Linux: BIOS/UEFI → LILO/GRUB/syslinux → vmlinuz • Why three steps? • What are the handover protocols? 9 BIOS: Basic Input/Output System • QEMU uses an opensource BIOS, called SeaBIOS • e.g., try to run, qemu (with no arguments) 10 From power-on to BIOS in x86 (miniboot) • Set IP → 4GB - 16B (0xfffffff0) • e.g., 80286: 1MB - 16B (0xffff0) • e.g., SPARCS v8: 0x00 (reset vector) DEMO : x86 initial state on QEMU 11 The first instruction • To understand, we first need to understand: 1. x86 state (e.g., registers) 2. Memory referencing model (e.g,. segmentation) 3. BIOS features (e.g., memory aliasing) (gdb) x/1i 0xfffffff0 0xfffffff0: ljmp $0xf000,$0xe05b 12 x86
    [Show full text]
  • UM0434 E200z3 Powerpc Core Reference Manual
    UM0434 e200z3 PowerPC core Reference manual Introduction The primary objective of this user’s manual is to describe the functionality of the e200z3 embedded microprocessor core for software and hardware developers. This book is intended as a companion to the EREF: A Programmer's Reference Manual for Freescale Book E Processors (hereafter referred to as EREF). Book E is a PowerPC™ architecture definition for embedded processors that ensures binary compatibility with the user-instruction set architecture (UISA) portion of the PowerPC architecture as it was jointly developed by Apple, IBM, and Motorola (referred to as the AIM architecture). This document distinguishes among the three levels of the architectural and implementation definition, as follows: ● The Book E architecture—Book E defines a set of user-level instructions and registers that are drawn from the user instruction set architecture (UISA) portion of the AIM definition PowerPC architecture. Book E also includes numerous supervisor-level registers and instructions as they were defined in the AIM version of the PowerPC architecture for the virtual environment architecture (VEA) and the operating environment architecture (OEA). Because the operating system resources (such as the MMU and interrupts) defined by Book E differ greatly from those defined by the AIM architecture, Book E introduces many new registers and instructions. ● Freescale Book E implementation standards (EIS)—In many cases, the Book E architecture definition provides a general framework, leaving specific details up to the implementation. To ensure consistency among its Book E implementations, Freescale has defined implementation standards that provide an additional layer of architecture between Book E and the actual devices.
    [Show full text]
  • Embedded Design Handbook
    Embedded Design Handbook Subscribe EDH | 2020.07.22 Send Feedback Latest document on the web: PDF | HTML Contents Contents 1. Introduction................................................................................................................... 6 1.1. Document Revision History for Embedded Design Handbook........................................ 6 2. First Time Designer's Guide............................................................................................ 8 2.1. FPGAs and Soft-Core Processors.............................................................................. 8 2.2. Embedded System Design...................................................................................... 9 2.3. Embedded Design Resources................................................................................. 11 2.3.1. Intel Embedded Support........................................................................... 11 2.3.2. Intel Embedded Training........................................................................... 11 2.3.3. Intel Embedded Documentation................................................................. 12 2.3.4. Third Party Intellectual Property.................................................................12 2.4. Intel Embedded Glossary...................................................................................... 13 2.5. First Time Designer's Guide Revision History............................................................14 3. Hardware System Design with Intel Quartus Prime and Platform Designer.................
    [Show full text]
  • System Organization Chapter Three
    System Organization Chapter Three To write even a modest 80x86 assembly language program requires considerable familiarity with the 80x86 family. To write good assembly language programs requires a strong knowledge of the underlying hardware. Unfortunately, the underlying hardware is not consistent. Techniques that are crucial for 8088 programs may not be useful on 80486 systems. Likewise, programming techniques that provide big performance boosts on an 80486 chip may not help at all on an 80286. Fortunately, some programming techniques work well whatever microprocessor you’re using. This chapter discusses the effect hard- ware has on the performance of computer software. 3.0 Chapter Overview This chapter describes the basic components that make up a computer system: the CPU, memory, I/O, and the bus that connects them. Although you can write software that is ignorant of these concepts, high performance software requires a complete understand- ing of this material. This chapter begins by discussing bus organization and memory organization. These two hardware components will probably have a bigger performance impact on your soft- ware than the CPU’s speed. Understanding the organization of the system bus will allow you to design data structures that operate and maximum speed. Similarly, knowing about memory performance characteristics, data locality, and cache operation can help you design software that runs as fast as possible. Of course, if you’re not interested in writing code that runs as fast as possible, you can skip this discussion; however, most people do care about speed at one point or another, so learning this information is useful. Unfortunately, the 80x86 family microprocessors are a complex group and often over- whelm beginning students.
    [Show full text]
  • Ultrasparc T1™ Supplement to the Ultrasparc Architecture 2005
    UltraSPARC T1™ Supplement to the UltraSPARC Architecture 2005 Draft D2.1, 14 May 2007 Privilege Levels: Hyperprivileged, Privileged, and Nonprivileged Distribution: Public Sun Microsystems, Inc. 4150 Network Circle Santa Clara, CA 95054 U.S.A. 650-960-1300 Part No.No: 8xx-xxxx-xx819-3404-05 ReleaseRevision: 1.0, Draft 2002 D2.1, 14 May 2007 ii UltraSPARC T1 Supplement • Draft D2.1, 14 May 2007 Copyright 2002-2006 Sun Microsystems, Inc., 4150 Network Circle • Santa Clara, CA 950540 USA. All rights reserved. This product or document is protected by copyright and distributed under licenses restricting its use, copying, distribution, and decompilation. No part of this product or document may be reproduced in any form by any means without prior written authorization of Sun and its licensors, if any. Third-party software, including font technology, is copyrighted and licensed from Sun suppliers. Parts of the product may be derived from Berkeley BSD systems, licensed from the University of California. UNIX is a registered trademark in the U.S. and other countries, exclusively licensed through X/Open Company, Ltd. For Netscape Communicator™, the following notice applies: Copyright 1995 Netscape Communications Corporation. All rights reserved. Sun, Sun Microsystems, the Sun logo, Solaris, and VIS are trademarks, registered trademarks, or service marks of Sun Microsystems, Inc. in the U.S. and other countries. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. in the U.S. and other countries. Products bearing SPARC trademarks are based upon an architecture developed by Sun Microsystems, Inc The OPEN LOOK and Sun™ Graphical User Interface was developed by Sun Microsystems, Inc.
    [Show full text]
  • Intel® PXA255 Processor
    Intel® PXA255 Processor Developer’s Manual January, 2004 Order Number: 278693-002 INFORMATION IN THIS DOCUMENT IS PROVIDED IN CONNECTION WITH INTEL® PRODUCTS. NO LICENSE, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, TO ANY INTELLECTUAL PROPERTY RIGHTS IS GRANTED BY THIS DOCUMENT. EXCEPT AS PROVIDED IN INTEL'S TERMS AND CONDITIONS OF SALE FOR SUCH PRODUCTS, INTEL ASSUMES NO LIABILITY WHATSOEVER, AND INTEL DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY, RELATING TO SALE AND/OR USE OF INTEL PRODUCTS INCLUDING LIABILITY OR WARRANTIES RELATING TO FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT. Intel products are not intended for use in medical, life saving, or life sustaining applications. Intel may make changes to specifications and product descriptions at any time, without notice. Designers must not rely on the absence or characteristics of any features or instructions marked “reserved” or “undefined.” Intel reserves these for future definition and shall have no responsibility whatsoever for conflicts or incompatibilities arising from future changes to them. The Intel® PXA255 Processor may contain design defects or errors known as errata which may cause the product to deviate from published specifications. Current characterized errata are available on request. MPEG is an international standard for video compression/decompression promoted by ISO. Implementations of MPEG CODECs, or MPEG enabled platforms may require licenses from various entities, including Intel Corporation. This document and the software described in it are furnished under license and may only be used or copied in accordance with the terms of the license. The information in this document is furnished for informational use only, is subject to change without notice, and should not be construed as a commitment by Intel Corporation.
    [Show full text]
  • Am486 Microprocessor PCI Customer Development Platform User's Manual
    Am486® Microprocessor PCI Customer Development Platform User’s Manual Order #22408A Am486® Microprocessor PCI Customer Development Platform User’s Manual © 1998 by Advanced Micro Devices, Inc. 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 written permission of Advanced Micro Devices, Inc. Use, duplication, or disclosure by the Government is subject to restrictions as set forth in subdivision (b)(3)(ii) of the Rights in Technical Data and Computer Software clause at 252.227-7013. Advanced Micro Devices, Inc., 5204 E. Ben White Blvd., Austin, TX 78741. AMD, the AMD logo, and combinations thereof, Comm86, E86, E86MON, and PCnet are trademarks of, Am486, MACH, and PAL are registered trademarks of, and FusionE86 is a service mark of Advanced Micro Devices, Inc. Vantis is a trademark of Vantis Corporation. Microsoft and Windows are registered trademarks of Microsoft Corp. Other product or brand names are used solely for identification and may be the trademarks or registered trademarks of their respective companies. IF YOU HAVE QUESTIONS, WE’RE HERE TO HELP YOU. The AMD customer service network includes U.S. offices, international offices, and a customer training center. Technical assistance is available from the AMD worldwide staff of field application engineers and factory support staff to answer E86™ and Comm86™ microcontroller family hardware and software development questions. Frequently accessed numbers are listed below. Additional contact information is listed on the back of this manual. AMD’s WWW site lists the latest phone numbers.
    [Show full text]
  • QEMU Support for the RISC-V Instruction Set Architecture
    QEMU Support for the RISC-V Instruction Set Architecture Sagar Karandikar [email protected] KVM Forum 2016 https://github.com/riscv/riscv-qemu Outline • Why RISC-V? • Benefits of an Open ISA • RISC-V ISA Basics • Virtualization Support • QEMU RISC-V Target Support • Work in Progress/TODOs for Upstreaming/Future Work ISAs don’t matter • Most of the performance and energy of running software on a computer is due to: • Algorithms • Application code • Compilers • OS/Runtimes • ISA • Microarchitecture (core and memory hierarchy) • Circuit design • Physical design • Fabrication process + In a system, there are also displays, radios, DC/DC converters, sensors, actuators… Why Instruction Set Architecture Matters • Why can’t Intel sell mobile chips? • 99%+ of mobile phones/tablets based on ARM v7/v8 ISA • Why can’t ARM partners sell servers? • 99%+ of laptops/desktops/servers based on AMD64 ISA (over 95%+ built by Intel) • How can IBM still sell mainframes? • IBM 360, oldest surviving ISA (50+ years) ISA is the most important interface in a computer system where software meets hardware Why so many ISAs on an SoC? • Applications processor (usually ARM) • Graphics processors • Image processors • Radio DSPs • Audio DSPs • Security processors • Power-management processor • …. • Apps processor ISA (e.g. ARM) too large for most accelerators • IP bought from different places, each proprietary ISA NVIDIA Tegra SoC • Home-grown ISA cores • Over a dozen ISAs on some SoCs – each with unique software stack Do we need all these different ISAs? Must they
    [Show full text]
  • BIOS and System Management Mode Internals Reset Vector
    Advanced x86: BIOS and System Management Mode Internals Reset Vector Xeno Kovah && Corey Kallenberg LegbaCore, LLC All materials are licensed under a Creative Commons “Share Alike” license. http://creativecommons.org/licenses/by-sa/3.0/ ABribuEon condiEon: You must indicate that derivave work "Is derived from John BuBerworth & Xeno Kovah’s ’Advanced Intel x86: BIOS and SMM’ class posted at hBp://opensecuritytraining.info/IntroBIOS.html” 2 Reset Vector ExecuEon Environment Real-Address Mode (Real Mode) • The original x86 operating mode • Referred to as “Real Mode” for short • Introduced way back in 8086/8088 processors • Was the only operating mode until Protected Mode (with its "virtual addresses") was introduced in the Intel 286 • Exists today solely for compatibility so that code written for 8086 will still run on a modern processor – Someday processors will boot into protected mode instead • In the BIOS’ I have looked at, the general theme seems to be to get out of Real Mode as fast as possible • Therefore we won’t stay here long either 4 E6400 Registers at Reset Processor State After Reset Name Value EAX 00000000 • EAX, EBX, ECX, EBP, ESI, EDI, ESP are all EBX 00000000 reset to 0 ECX 00000000 • EDX contains the CPU stepping EDX 00010676* identification information EBP 00000000 – Same info returned in EAX when CPUID is called with EAX initialized to ‘1’ ESI 00000000 – *This will vary of course, the value in the table EDI 00000000 to the left corresponds to the Core2Duo inside the E6400 ESP 00000000 • The base registers are 0 with the exception CS F000 of CS which is initialized with F000 DS 0000 • EIP (or IP since it’s 16-bit mode) is SS 0000 initialized with (0000)FFF0 – CS:IP = F:FFF0h ES 0000 • EFLAGS is 00000002h FS 0000 – Only hard-coded bit 1 is asserted GS 0000 – If I were sitting at a breakpoint at the entry vector, then bit 16 (resume flag) would be EIP 0000FFF0 asserted indicating that debug exceptions EFLAGS 00000002 (#DB) are disabled.
    [Show full text]
  • Controlling the Boostrap Process
    UPTEC F11 064 Examensarbete 30 hp December 2011 Controlling the Bootstrap Process Firmware Alternatives for an x86 Embedded Platform Svante Ekholm Lindahl Abstract Controlling the Bootstrap Process: Firmware Alternatives for an x86 Embedded Platform Svante Ekholm Lindahl Teknisk- naturvetenskaplig fakultet UTH-enheten The viability of firmware engineering on a lower-tier computer manufacturer (OEM) level, where the OEM receives processor and chipset components second hand, was Besöksadress: investigated. It was believed that safer and more reliable operation of an embedded Ångströmlaboratoriet Lägerhyddsvägen 1 system would be achieved if system startup times were minimised. Theoretical Hus 4, Plan 0 knowledge of firmware engineering, methods and standards for the x86 platform was compiled and evaluated. The practical aspects of firmware engineering were Postadress: investigated through the construction of an open source boot loader for a rugged, Box 536 751 21 Uppsala closed-box embedded x86 Intel system using Coreboot and Seabios. The boot loader was compared with the original firmware and the startup times were found to be Telefon: reduced ninefold from entry vector to operating system handover. 018 – 471 30 03 Telefax: Firmware engineering was found to be a complex field stretching from computer 018 – 471 30 00 science to electrical engineering. Firmware development on a lower-tier OEM level was found to be possible, provided that the proper documentation could be obtained. Hemsida: To this end, the boot loader prototype was proof of concept. This allowed an http://www.teknat.uu.se/student alternative, open-source oriented model for firmware development to be proposed. Ultimately, each product use case needed to be individually evaluated in terms of requirements, cost and ideology.
    [Show full text]
  • AMD Geode™ SC2200 Processor Data Book
    AMD Geode™ SC2200 Processor Data Book March 2006 Publication ID: 32580B AMD Geode™ SC2200 Processor Data Book © 2006 Advanced Micro Devices, Inc. All rights reserved. The contents of this document are provided in connection with Advanced Micro Devices, Inc. (“AMD”) products. AMD makes no representations or warranties with respect to the accuracy or completeness of the contents of this publication and reserves the right to make changes to specifications and product descriptions at any time without notice. No license, whether express, implied, arising by estoppel or otherwise, to any intellectual property rights is granted by this publication. Except as set forth in AMD’s Standard Terms and Conditions of Sale, AMD assumes no liability whatsoever, and disclaims any express or implied warranty, relating to its products including, but not limited to, the implied warranty of mer- chantability, fitness for a particular purpose, or infringement of any intellectual property right. AMD’s products are not designed, intended, authorized or warranted for use as components in systems intended for surgical implant into the body, or in other applications intended to support or sustain life, or in any other application in which the failure of AMD’s product could create a situation where personal injury, death, or severe property or environmental damage may occur. AMD reserves the right to discontinue or make changes to its products at any time without notice. Contacts www.amd.com Trademarks AMD, the AMD Arrow logo, and combinations thereof, and Geode and Virtual System Architecture are trademarks of Advanced Micro Devices, Inc. Microsoft and Windows are registered trademarks of Microsoft Corporation in the United States and/or other jurisdictions.
    [Show full text]