1. Overview of Nios II Embedded Development



Similar documents
1. Overview of Nios II Embedded Development

Nios II Software Developer s Handbook

2. Developing Nios II Software

2. Getting Started with the Graphical User Interface

Nios II Classic Software Developer s Handbook

8. Exception Handling

Section II. Hardware Abstraction Layer

Nios II IDE Help System

A. Using the Nios II Integrated Development Environment

13. Publishing Component Information to Embedded Software

8. Hardware Acceleration and Coprocessing

Altera SoC Embedded Design Suite User Guide

Using the NicheStack TCP/IP Stack - Nios II Edition Tutorial

Quartus II Software Download and Installation Quick Start Guide

Using Nios II Floating-Point Custom Instructions Tutorial

Digitale Signalverarbeitung mit FPGA (DSF) Soft Core Prozessor NIOS II Stand Mai Jens Onno Krah

8. MicroC/OS-II Real-Time Operating System

ModelSim-Altera Software Simulation User Guide

Quartus II Software Design Series : Foundation. Digitale Signalverarbeitung mit FPGA. Digitale Signalverarbeitung mit FPGA (DSF) Quartus II 1

Guidelines for Developing a Nios II HAL Device Driver

December 2002, ver. 1.0 Application Note 285. This document describes the Excalibur web server demonstration design and includes the following topics:

Applying the Benefits of Network on a Chip Architecture to FPGA System Design

USB-Blaster Download Cable User Guide

Remote Configuration Over Ethernet with the Nios II Processor

Using Altera MAX Series as Microcontroller I/O Expanders

Five Ways to Build Flexibility into Industrial Applications with FPGAs

Creating a Webserver on the Nios development kit Stratix Edition board Enoch Hwang

Altera Error Message Register Unloader IP Core User Guide

Quartus II Handbook Volume 3: Verification

Eddy Integrated Development Environment, LemonIDE for Embedded Software System Development

Nios II Development Kit Version 5.1 SP1 Release Notes

PROFINET IRT: Getting Started with The Siemens CPU 315 PLC

Using the Agilent 3070 Tester for In-System Programming in Altera CPLDs

Site Configuration SETUP GUIDE. Windows Hosts Single Workstation Installation. May08. May 08

7. Mentor Graphics PCB Design Tools Support

STLinux Software development environment

Q N X S O F T W A R E D E V E L O P M E N T P L A T F O R M v Steps to Developing a QNX Program Quickstart Guide

Embedded Development Tools

Notes and terms of conditions. Vendor shall note the following terms and conditions/ information before they submit their quote.

PowerPlay Power Analysis & Optimization Technology

10 STEPS TO YOUR FIRST QNX PROGRAM. QUICKSTART GUIDE Second Edition

DE4 NetFPGA Packet Generator Design User Guide

DS-5 ARM. Using the Debugger. Version 5.7. Copyright 2010, 2011 ARM. All rights reserved. ARM DUI 0446G (ID092311)

Quartus II Software and Device Support Release Notes Version 15.0

DS-5 ARM. Using the Debugger. Version Copyright ARM. All rights reserved. ARM DUI 0446M (ID120712)

USB-Blaster II Download Cable User Guide

Quartus Prime Standard Edition Handbook Volume 3: Verification

!!! Technical Notes : The One-click Installation & The AXIS Internet Dynamic DNS Service. Table of contents

Zynq-7000 Platform Software Development Using the ARM DS-5 Toolchain Authors: Simon George and Prushothaman Palanichamy

4. Nios II Command-Line Tools

Enhanced Project Management for Embedded C/C++ Programming using Software Components

Qsys System Design Tutorial

15. Introduction to ALTMEMPHY IP

Code Estimation Tools Directions for a Services Engagement

TIBCO ActiveMatrix BusinessWorks Plug-in for TIBCO Managed File Transfer Software Installation

The "Eclipse Classic" version is recommended. Otherwise, a Java or RCP version of Eclipse is recommended.

PingFederate. Identity Menu Builder. User Guide. Version 1.0

Quartus II Installation & Version 8.0

NVIDIA CUDA GETTING STARTED GUIDE FOR MAC OS X

Using the Altera Serial Flash Loader Megafunction with the Quartus II Software

NIOS II Based Embedded Web Server Development for Networking Applications

MasterBlaster Serial/USB Communications Cable User Guide

Introduction to the Quartus II Software. Version 10.0

Getting Started with Embedded System Development using MicroBlaze processor & Spartan-3A FPGAs. MicroBlaze

Using DAVE with MDK Version 5

Embedded Electric Power Network Monitoring System

Using the On-Chip Signal Quality Monitoring Circuitry (EyeQ) Feature in Stratix IV Transceivers

Reminders. Lab opens from today. Many students want to use the extra I/O pins on

Using Red Hat Network Satellite Server to Manage Dell PowerEdge Servers

Model-based system-on-chip design on Altera and Xilinx platforms

Developing an Application on Core8051s IP-Based Embedded Processor System Using Firmware Catalog Drivers. User s Guide

IOTIVITY AND EMBEDDED LINUX SUPPORT. Kishen Maloor Intel Open Source Technology Center

SIM900 Eclipse environment install Application Note_V1.00

AN 589: Using the Design Security Feature in Cyclone III LS Devices

VOL. 2, NO. 1, January 2012 ISSN ARPN Journal of Science and Technology ARPN Journals. All rights reserved

Video and Image Processing Suite

Providing Battery-Free, FPGA-Based RAID Cache Solutions

Nios II System Architect Design Tutorial

DS-5 ARM. Using the Debugger. Version Copyright ARM. All rights reserved. ARM DUI0446P

Soft processors for microcontroller programming education

An Introduction to Android. Huang Xuguang Database Lab. Inha University

MontaVista Linux 6. Streamlining the Embedded Linux Development Process

bbc Installing Your Development Environment Adobe LiveCycle ES July 2007 Version 8.0

UG103.8 APPLICATION DEVELOPMENT FUNDAMENTALS: TOOLS

Document ID: FLXN111 PRODUCTS AND LICENSING

For Quartus II Software. This Quick Start Guide will show you. how to set up a Quartus. enter timing requirements, and

Application Note: AN00141 xcore-xa - Application Development

Networking Remote-Controlled Moving Image Monitoring System

Android Setup Phase 2

Fujisoft solves graphics acceleration for the Android platform

Using Intel C++ Compiler in Eclipse* for Embedded Linux* targets

Building and Debugging a project using Keil MDK-ARM Eclipse plug-in

An Introduction to Android

Setting Up Resources in VMware Identity Manager

IBM Rational Web Developer for WebSphere Software Version 6.0

Python for Series 60 Platform

Integrating TAU With Eclipse: A Performance Analysis System in an Integrated Development Environment

Virtual Server Installation Manual April 8, 2014 Version 1.8

Transcription:

May 2011 NII52001-11.0.0 1. Overview o Nios II Embedded Development NII52001-11.0.0 The Nios II Sotware Developer s Handbook provides the basic inormation needed to develop embedded sotware or the Altera Nios II processor. This handbook describes the Nios II sotware development environment, the Nios II Embedded Design Suite (EDS) tools available to you, and the process or developing sotware. This chapter provides a high-level overview o the embedded sotware development environments or the Nios II processor, and contains the ollowing sections: Prerequisites or Understanding the Nios II Embedded Design Suite on page 1 1 Finding Nios II EDS Files on page 1 1 Nios II Sotware Development Environment on page 1 2 Nios II EDS Development Flows on page 1 2 Nios II Programs on page 1 5 Altera Sotware Packages or Embedded Systems on page 1 6 Nios II Embedded Design Examples on page 1 6 Third-Party Embedded Tools Support on page 1 8 Additional Nios II Inormation on page 1 8 Prerequisites or Understanding the Nios II Embedded Design Suite Finding Nios II EDS Files The Nios II Sotware Developer s Handbook assumes you have a basic amiliarity with embedded processor concepts. You do not need to be amiliar with any speciic Altera technology or with Altera development tools. Familiarity with Altera hardware development tools can give you a deeper understanding o the reasoning behind the Nios II sotware development environment. However, sotware developers can create and debug applications without urther knowledge o Altera technology. When you install the Nios II EDS, you speciy a root directory or the EDS ile structure. This root directory must be adjacent to the Quartus II installation. For example, i the Nios II EDS 10.0 is installed on the Windows operating system, the root directory might be c:\altera\100\nios2eds. For simplicity, this handbook reers to this directory as <Nios II EDS install path>. 2011 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, HARDCOPY, MAX, MEGACORE, NIOS, QUARTUS and STRATIX are Reg. U.S. Pat. & Tm. O. and/or trademarks o Altera Corporation in the U.S. and other countries. All other trademarks and service marks are the property o their respective holders as described at www.altera.com/common/legal.html. Altera warrants perormance o its semiconductor products to current speciications in accordance with Altera s standard warranty, but reserves the right to make changes to any products and services at any time without notice. Altera assumes no responsibility or liability arising out o the application or use o any inormation, product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version o device speciications beore relying on any published inormation and beore placing orders or products or services. Nios II Sotware Developer s Handbook May 2011 Subscribe

1 2 Chapter 1: Overview o Nios II Embedded Development Nios II Sotware Development Environment Nios II Sotware Development Environment The Nios II EDS provides a consistent sotware development environment that works or all Nios II processor systems. With the Nios II EDS running on a host computer, an Altera FPGA, and a JTAG download cable (such as an Altera USB-Blaster download cable), you can write programs or and communicate with any Nios II processor system. The Nios II processor s JTAG debug module provides a single, consistent method to connect to the processor using a JTAG download cable. Accessing the processor is the same, regardless o whether a device implements only a Nios II processor system, or whether the Nios II processor is embedded deeply in a complex multiprocessor system. Thereore, you do not need to spend time manually creating interace mechanisms or the embedded processor. The Nios II EDS includes proprietary and open-source tools (such as the GNU C/C++ tool chain) or creating Nios II programs. The Nios II EDS automates board support package (BSP) creation or Nios II processor-based systems, eliminating the need to spend time manually creating BSPs. The BSP provides a C/C++ runtime environment, insulating you rom the hardware in your embedded system. Altera BSPs contain the Altera hardware abstraction layer (HAL), an optional RTOS, and device drivers. Nios II EDS Development Flows A development low is a way o using a set o development tools together to create a sotware project. The Nios II EDS provides the ollowing development lows or creating Nios II programs: The Nios II Sotware Build Tools (SBT), which provides two user interaces: The Nios II SBT command line The Nios II SBT or Eclipse The Nios II integrated development environment (IDE) The two design lows share a number o development tools. However, the lows dier in how they create makeiles. The development lows are not interchangeable. Source code or your applications, libraries, and drivers works in either low, but the makeiles in the two lows are dierent and not compatible. The Nios II SBT Development Flow The Nios II SBT allows you to create Nios II sotware projects, with detailed control over the sotware build process. The same Nios II SBT utilities, scripts and Tcl commands are available rom both the command line and the Nios II SBT or Eclipse graphical user interace (GUI). The SBT allows you to create and manage single-threaded programs as well as complex applications based on an RTOS and middleware libraries available rom Altera and third-party vendors. The SBT provides powerul Tcl scripting capabilities. In a Tcl script, you can query project settings, speciy project settings conditionally, and incorporate the sotware project creation process in a scripted sotware development low. Tcl scripting is supported both in Eclipse and at the command line. Nios II Sotware Developer s Handbook May 2011 Altera Corporation

Chapter 1: Overview o Nios II Embedded Development 1 3 Nios II EDS Development Flows For inormation about Tcl scripting, reer to the Nios II Sotware Build Tools chapter o the Nios II Sotware Developer s Handbook. The Nios II SBT or Eclipse The Nios II SBT or Eclipse is a thin GUI layer that runs the Nios II SBT utilities and scripts behind the scenes, presenting a uniied development environment. The SBT or Eclipse provides a consistent development platorm that works or all Nios II processor systems. You can accomplish all sotware development tasks within Eclipse, including creating, editing, building, running, debugging, and proiling programs. The Nios II SBT or Eclipse is based on the popular Eclipse ramework and the Eclipse C/C++ development toolkit (CDT) plugins. The Nios II SBT creates your project makeiles or you, and Eclipse provides extensive capabilities or interactive debugging and management o source iles. The SBT or Eclipse also allows you to import and debug projects you created in the Nios II Command Shell. For details about the Nios II SBT or Eclipse, reer to the Getting Started with the Graphical User Interace chapter o the Nios II Sotware Developer s Handbook. For details about Eclipse, visit the Eclipse Foundation website (www.eclipse.org). The Nios II SBT Command Line In the Nios II SBT command line development low, you create, modiy, build, and run Nios II programs with Nios II SBT commands typed at a command line or embedded in a script. You run the Nios II SBT commands rom the Nios II Command Shell. For urther inormation about the Nios II SBT in command-line mode, reer to the Getting Started rom the Command Line chapter o the Nios II Sotware Developer s Handbook. To debug your command-line program, import your SBT projects to Eclipse. You can urther edit, rebuild, run, and debug your imported project in Eclipse. The Nios II IDE Development Flow The Nios II IDE development low is an integrated environment in which you can create, modiy, build, run, and debug Nios II programs with the Nios II IDE GUI. The Nios II IDE low does not use the Nios II SBT. The makeiles it creates cannot be user-managed. This low provides limited control over the build process and the project settings, with no support or customized scripting. 1 In most cases, you should create new projects using the Nios II SBT rom the command line or rom Eclipse. IDE support is or the ollowing situations: Working with pre-existing Nios II IDE sotware projects Creating new projects or the Nios II C2H compiler Debugging with the FS2 console May 2011 Altera Corporation Nios II Sotware Developer s Handbook

1 4 Chapter 1: Overview o Nios II Embedded Development Nios II EDS Development Flows For urther inormation about the Nios II IDE, reer to Appendix A. Using the Nios II Integrated Development Environment in the Nios II Sotware Developer s Handbook. Choosing the Correct Development Flow Consider the ollowing tool restrictions when choosing your development low: SOPC Building, the older system integration tool, works in conjunction with both the Nios II SBT and the Nios II IDE. Qsys, the newer system integration tool, works only in conjunction with the Nios II SBT, the newer sotware development environment. The Nios II EDS provides a tool or converting Nios II IDE projects to Nios II SBT projects. Figure 1 1 illustrates the development lows available with the Nios II EDS. Figure 1 1. Nios II Hardware and Sotware Development Flows Hardware System Generated in SOPC Builder Hardware System Generated in Qsys.pt.sopcino.sopcino Sotware Project Created in Nios II IDE Sotware Project Created in Nios II SBT (Eclipse or Command Line) For details about Nios II IDE project conversion, reer to Porting Nios II IDE Projects to the Sotware Build Tools in Appendix A. Using the Nios II Integrated Development Environment in the Nios II Sotware Developer s Handbook. 1 Hardware designs created with SOPC Builder 7.0 or earlier must either use the Nios II IDE development low or be updated. Except or Appendix A. Using the Nios II Integrated Development Environment, the remainder o this handbook assumes that you are using the Nios II SBT. Nios II Sotware Developer s Handbook May 2011 Altera Corporation

Chapter 1: Overview o Nios II Embedded Development 1 5 Nios II Programs Nios II Programs Each Nios II program you develop consists o an application project, optional user library projects, and a BSP project. You build your Nios II program to create an Executable and Linking Format File (.el) which runs on a Nios II processor. The Nios II SBT creates sotware projects or you. Each project is based on a makeile. This section discusses makeiles and projects. Makeiles and the SBT The makeile is the central component o a Nios II sotware project, whether the project is created with the Nios II SBT or Eclipse, or on the command line. The makeile describes all the components o a sotware project and how they are compiled and linked. With a makeile and a complete set o C/C++ source iles, your Nios II sotware project is ully deined. As a key part o creating a sotware project, the SBT creates a makeile or you. Nios II projects are sometimes called user-managed, because you, the user, are responsible or the content o the project makeile. You use the Nios II SBT to control what goes in the makeile. 1 Makeiles or Nios II IDE projects dier rom the SBT makeiles described in this section. The Nios II Sotware Build Tools chapter o the Nios II Sotware Developer s Handbook provides detailed inormation about creating makeiles. For a description o Nios II IDE makeiles, reer to Appendix A. Using the Nios II Integrated Development Environment in the Nios II Sotware Developer s Handbook. Nios II Sotware Project Types The ollowing sections describe the project types that constitute a Nios II program. Application Project A Nios II C/C++ application project consists o a collection o source code, plus a makeile. A typical characteristic o an application is that one o the source iles contains unction main(). An application includes code that calls unctions in libraries and BSPs. The makeile compiles the source code and links it with a BSP and one or more optional libraries, to create one.el ile. User Library Project A user library project is a collection o source code compiled to create a single library archive ile (.a). Libraries oten contain reusable, general purpose unctions that multiple application projects can share. A collection o common arithmetical unctions is one example. A user library does not contain a main() unction. May 2011 Altera Corporation Nios II Sotware Developer s Handbook

1 6 Chapter 1: Overview o Nios II Embedded Development Altera Sotware Packages or Embedded Systems BSP Project A Nios II BSP project is a specialized library containing system-speciic support code. A BSP provides a sotware runtime environment customized or one processor in a Nios II hardware system. The Nios II EDS provides tools to modiy settings that control the behavior o the BSP. A BSP contains the ollowing elements: Hardware abstraction layer For inormation, reer to the Overview o the Hardware Abstraction Layer chapter o the Nios II Sotware Developer s Handbook. Optional custom newlib C standard library For inormation, reer to the Overview o the Hardware Abstraction Layer chapter o the Nios II Sotware Developer s Handbook. The complete HTML documentation or newlib resides in the Nios II EDS directory. Device drivers For inormation, reer to Nios II Embedded Sotware Projects in the Nios II Sotware Build Tools chapter o the Nios II Sotware Developer s Handbook. Optional sotware packages For inormation, reer to Altera Sotware Packages or Embedded Systems. Optional real-time operating system For inormation, reer to the MicroC/OS-II Real-Time Operating System chapter o the Nios II Sotware Developer s Handbook. Altera Sotware Packages or Embedded Systems The Nios II EDS includes sotware packages to extend the capabilities o your sotware. You can include these sotware packages in your BSP. Table 1 1 shows those Altera Nios II sotware packages that are distributed with the Nios II EDS. Table 1 1. Sotware Packages Name NicheStack TCP/IP Stack - Nios II Edition Read-only zip ile system Host ile system Description Reer to the Ethernet and the NicheStack TCP/IP Stack - Nios II Edition chapter o the Nios II Sotware Developer s Handbook. Reer to the Read-Only Zip File System chapter o the Nios II Sotware Developer s Handbook. Reer to the Developing Programs Using the Hardware Abstraction Layer chapter o the Nios II Sotware Developer s Handbook. Additional sotware packages are available rom Altera s partners. For a complete list, reer to the Embedded Sotware page o the Altera website. Nios II Embedded Design Examples The Nios II EDS includes documented hardware design examples and sotware examples to demonstrate all prominent eatures o the Nios II processor and the development environment. The examples can help you start the development o your custom design. They provide a stable starting point or exploring design options. Also, they demonstrate many commonly used eatures o the Nios II EDS. Nios II Sotware Developer s Handbook May 2011 Altera Corporation

Chapter 1: Overview o Nios II Embedded Development 1 7 Nios II Embedded Design Examples Hardware Examples You can run Nios II hardware designs on many Altera development boards. The hardware examples or each Altera development board reside in the ollowing location: <Nios II EDS install path>/examples/verilog/<board> where <board> is the name o the development board. For example, the Triple Speed Ethernet design example or the Nios II 3C120 development board resides in <Nios II EDS install path>/examples/verilog/niosii_cycloneiii_3c120/ triple_speed_ethernet_design. 1 applications_processor_mmu_design is intended to demonstrate Linux. This design does not work with the SBT, because the SBT does not support the Nios II MMU. Sotware Examples You can run Nios II sotware examples that run on many o the hardware design examples described in the previous section. The Nios II sotware examples include scripts and templates to create the sotware projects using the Nios II SBT. These scripts and templates do everything necessary to create a BSP and an application project or each sotware example. May 2011 Altera Corporation Nios II Sotware Developer s Handbook

1 8 Chapter 1: Overview o Nios II Embedded Development Third-Party Embedded Tools Support Figure 1 2 shows the directory structure under each hardware design example. There are multiple sotware examples and BSP examples, each with its own directory. Each sotware example directory contains a create-this-app script and each BSP example directory contains a create-this-bsp script. These scripts create sotware projects, as demonstrated in Getting Started with Eclipse in the Getting Started rom the Command Line chapter o the Nios II Sotware Developer s Handbook. Figure 1 2. Sotware Design Example Directory Structure <design> (e.g. standard) Quartus II iles (e.g. standard.qp) Hardware system iles (e.g. standard.sopcino) sotware_examples app sotware examples (e.g. hello_world) bsp create-this-app BSP examples (e.g. hal_standard) create-this-bsp Third-Party Embedded Tools Support Several third-party vendors support the Nios II processor, providing products such as design services, operating systems, stacks, other sotware libraries, and development tools. For the most up-to-date inormation about third-party support or the Nios II processor, visit the Nios II Processor page o the Altera website. Additional Nios II Inormation This handbook is one part o the complete Nios II processor documentation suite. Consult the ollowing reerences or urther Nios II inormation: The Nios II Processor Reerence Handbook deines the processor hardware architecture and eatures, including the instruction set architecture. The Embedded Peripherals IP User Guide provides a reerence or the peripherals distributed with the Nios II processor. This handbook describes the hardware structure and Nios II sotware drivers or each peripheral. Nios II Sotware Developer s Handbook May 2011 Altera Corporation

Chapter 1: Overview o Nios II Embedded Development 1 9 Document Revision History The Embedded Design Handbook describes how to use Altera sotware development tools eectively, and recommends design styles and practices or developing, debugging, and optimizing embedded systems. The Altera Knowledge Database is an Internet resource that oers solutions to requently asked questions with an easy-to-use search engine. Visit the Knowledge Database page o the Altera website. Altera application notes and tutorials oer step-by-step instructions on using the Nios II processor or a speciic application or purpose. These documents are available on the Literature: Nios II Processor page o the Altera website. The Nios II EDS documentation launchpad. The launchpad is an HTML page installed with the Nios II EDS, which provides links to Nios II documentation, examples, and other resources. The way you open the launchpad depends on your sotware platorm. In the Windows operating system, on the Start menu, point to Programs > Altera > Nios II EDS, and click Nios II <version> Documentation. In the Linux operating system, open <Nios II EDS install path>/documents/ index.html in a web browser. Document Revision History Table 1 2 shows the revision history or this document. Table 1 2. Document Revision History (Part 1 o 2) Date Version Changes May 2011 11.0.0 Introduced Qsys system integration tool February 2011 10.1.0 Removed Reerenced Documents section. Installation method changed; Nios II EDS always installed in a directory adjacent to July 2010 10.0.0 Quartus II tools. Described the Nios II Sotware Build Tools or Eclipse. Nios II IDE inormation moved to Appendix A. Using the Nios II Integrated Development November 2009 9.1.0 Environment. Detailed Nios II Sotware Build Tools utility inormation moved to Nios II Sotware Build Tools. Incorporate inormation ormerly in Altera-Provided Development Tools chapter. Describe BSP Editor. Reorganize and update inormation and terminology to clariy role o Nios II Sotware March 2009 9.0.0 Build Tools. Describe -data argument or IDE command-line tools. Correct minor typographical errors. Add What s New section. SOPC Inormation File (.sopcino). May 2008 8.0.0 Design examples removed rom EDS. Memory management unit (MMU) added to Nios II core. October 2007 7.2.0 Maintenance release. May 2011 Altera Corporation Nios II Sotware Developer s Handbook

1 10 Chapter 1: Overview o Nios II Embedded Development Document Revision History Table 1 2. Document Revision History (Part 2 o 2) Date Version Changes May 2007 7.1.0 March 2007 7.0.0 Maintenance release. November 2006 6.1.0 Maintenance release. May 2006 6.0.0 Maintenance release. October 2005 5.1.0 Maintenance release. May 2005 5.0.0 Maintenance release. May 2004 1.0 Initial release. Revise entire chapter to introduce Nios II EDS design lows, Nios II programs, Nios II Sotware Build Tools, and Nios II BSPs. Add table o contents to Introduction section. Add Reerenced Documents section. Nios II Sotware Developer s Handbook May 2011 Altera Corporation