没有合适的资源?快使用搜索试试~ 我知道了~
首页Nios II开发手册:从概念到实施细节全面解析
Nios II开发手册:从概念到实施细节全面解析
需积分: 3 3 下载量 38 浏览量
更新于2024-08-02
收藏 3.44MB PDF 举报
"《Nios II嵌入式处理器开发手册》是针对Nios II处理器家族的主要参考文档,它详尽地涵盖了该处理器从高层次的概念描述到低层次实现细节的全面介绍。该手册分为多个章节,其中包括: 1. 处理器架构:阐述了Nios II处理器的设计理念和结构,包括处理器内核、流水线设计、缓存系统等关键组件的功能和工作原理。 2. 编程模型:详细介绍了如何利用Nios II的体系结构进行程序设计,包括内存管理、中断处理、异常处理以及面向硬件抽象层(HAL)的编程接口。 3. 指令集:涵盖了Nios II的指令集,包括基本操作码、寻址方式、数据类型以及高级指令集特性和优化技巧,帮助开发者理解和编写高效代码。 4. 硬件与软件交互:讨论了处理器与外部设备的通信接口、外设控制以及如何利用硬件加速功能提升系统性能。 5. 工具链和支持:手册还介绍了与Nios II开发相关的工具,如编译器、调试器、模拟器以及软件开发环境,让开发者能够顺利进行项目实施。 6. 版权和许可:手册声明了Altera Corporation对其产品的所有权,并提到了商标和服务标记的规定,以及关于保修、责任和使用限制的法律条款。 7. 更新和维护:强调了获取最新产品信息的重要性,因为Altera可能会根据技术发展对产品和服务进行更新。 通过阅读这份手册,软件开发者可以全面掌握Nios II处理器的特性和用法,从而有效地进行系统设计、优化和调试。无论是嵌入式系统的初学者还是经验丰富的工程师,这本手册都是不可或缺的参考资料。"
资源详情
资源推荐
© March 2009 Altera Corporation Nios II Software Developer’s Handbook
Preliminary
1. Overview
Introduction
The Nios II Software Developer’s Handbook provides the basic information needed to
develop software for the Altera
®
Nios
®
II processor. This document is written for the
user of the Nios II integrated development environment (IDE), as well as the user of
the Nios II command-line software build tools.
This chapter provides a high-level overview of the software development
environment for the Nios II processor. This chapter introduces the Nios II software
development environment, the Nios II embedded design suite (EDS) tools available to
you, and the process for developing software. This chapter contains the following
sections:
■ “Getting Started” on page 1–1
■ “Nios II Software Development Environment” on page 1–2
■ “Nios II Programs” on page 1–2
■ “Altera-Provided Development Tools” on page 1–4
■ “Development Flows for Creating Nios II Programs” on page 1–9
■ “Third-Party Support” on page 1–13
■ “Migrating from the First-Generation Nios Processor” on page 1–13
■ “Further Nios II Information” on page 1–13
Getting Started
Writing software for the Nios II processor is similar to the software development
process for any other microcontroller family. The easiest way to start designing
effectively is to purchase a development kit from Altera that includes documentation,
a ready-made evaluation board, and all the development tools necessary to write
Nios II programs.
Modifying existing code is one of the most common and comfortable ways that you
can learn to write programs in a new environment. The Nios II EDS provides many
example software designs that you can examine, modify, and use in your own
programs. The provided examples range from a simple “Hello world” program, to a
working RTOS example, to a full TCP/IP stack running a web server. Each example is
documented and ready to compile.
Prerequisites
The Nios II Software Developer’s Handbook assumes you have a basic familiarity with
embedded processor concepts. You do not need to be familiar with any specific Altera
technology or with Altera development tools. Familiarity with Altera hardware
development tools can give you a deeper understanding of the reasoning behind the
Nios II software development environment. However, software developers can
develop and debug applications without further knowledge of Altera technology.
NII52001-9.0.0
1–2 Chapter 1: Overview
Nios II Software Development Environment
Nios II Software Developer’s Handbook © March 2009 Altera Corporation
Preliminary
Finding Nios II EDS Files
When you install the Nios II EDS, you specify a root directory for the directory
structure containing the EDS files. For example, if the Nios II EDS 8.1 is installed on
the Windows operating system, the root directory might be c:\altera\81\nios2eds.
The root directory can be any accessible location in your file system. For simplicity,
this handbook refers to this directory as <Nios II EDS install path>.
1 The Nios II EDS defines the environment variable SOPC_KIT_NIOS2 to represent
<Nios II EDS install path>.
Nios II Software Development Environment
The Nios II EDS provides a consistent software development environment that works
for all Nios II processor systems. With a PC, an Altera FPGA, and a JTAG download
cable (such as an Altera USB-Blaster™ download cable), you can write programs for,
and communicate with, any Nios II processor system. The Nios II processor’s JTAG
debug module provides a single, consistent method to communicate with the
processor using a JTAG download cable. Accessing the processor is the same,
regardless of whether a device implements only a Nios II processor system, or
whether the Nios II processor is embedded deeply in a complex multiprocessor
system. Therefore, you do not need to spend time manually creating interface
mechanisms for the embedded processor.
The Nios II EDS provides two distinct development flows and includes many
proprietary and open-source tools (such as the GNU C/C++ tool chain) for creating
Nios II programs. The Nios II EDS automates board support package (BSP) creation
for Nios II processor-based systems, eliminating the need to spend time manually
creating BSPs. Altera BSPs contain the Altera hardware abstraction layer (HAL), an
optional RTOS, and device drivers. The BSP provides a C/C++ runtime environment,
insulating you from the hardware in your embedded system.
Nios II Programs
Each Nios II program you develop in either Nios II EDS development flow consists of
an application project, optional library projects, and a BSP project. You build your
Nios II program to create an executable and linking format (.elf) file which runs on a
Nios II processor.
The following sections describe the project types that constitute a Nios II program.
Application Project
A Nios II C/C++ application project consists of a collection of source code compiled
to create one .elf file. A typical characteristic of an application is that one of the source
files contains function main(). An application includes code that calls functions in
libraries and BSPs.
Chapter 1: Overview 1–3
Nios II Programs
© March 2009 Altera Corporation Nios II Software Developer’s Handbook
Preliminary
Library Project
A library project is a collection of source code compiled to create a single library
archive (.a) file. Libraries often contain reusable, general purpose functions that
multiple application projects can share. A collection of common arithmetical functions
is one example. A library does not contain a function main().
BSP Project
A Nios II BSP project is a specialized library containing system-specific support code.
A BSP provides a software runtime environment customized for one processor in an
SOPC Builder system. The Nios II EDS provides tools to modify settings that control
the behavior of the BSP.
A BSP contains the following elements:
■ Hardware Abstraction Layer
■ Newlib C Standard Library
■ Device Drivers
■ Optional Software Packages
■ Optional Real-Time Operating System
Hardware Abstraction Layer
The HAL provides a non-threaded, UNIX-like, C/C++ runtime environment. The
HAL provides generic I/O devices, allowing you to write programs that access
hardware using the newlib C standard library routines, such as printf(). The HAL
interfaces to HAL device drivers, which access peripheral registers directly,
abstracting hardware details from the software application. This abstraction
minimizes or eliminates the need to access hardware registers directly to control and
communicate with peripherals.
f For complete details about the HAL, refer to the Hardware Abstraction Layer section
and the HAL API Reference chapter of the Nios II Software Developer’s Handbook.
Newlib C Standard Library
Newlib is an open source implementation of the C standard library intended for use
on embedded systems. It is a collection of common routines such as printf(),
malloc(), and open().
Device Drivers
Each device driver manages a hardware component. By default, the HAL instantiates
a device driver for each component in your SOPC Builder system that needs a device
driver. In the Nios II software development environment, a device driver has the
following properties:
■ A device driver is associated with a specific SOPC Builder component.
■ A device driver might have settings that impact its compilation. These settings
become part of the BSP settings.
1–4 Chapter 1: Overview
Altera-Provided Development Tools
Nios II Software Developer’s Handbook © March 2009 Altera Corporation
Preliminary
Optional Software Packages
A software package is source code that you can optionally add to a BSP project to
provide additional functionality. The NicheStack
®
TCP/IP - Nios II Edition is an
example of a software package.
In the Nios II software development environment, a software package typically has
the following properties:
■ A software package is not associated with specific hardware.
■ A software package might have settings that impact its compilation. These settings
become part of the BSP settings.
1 In the Nios II software development environment, a software package is distinct from
a library project. A software package is part of the BSP project, not a separate library
project.
Optional Real-Time Operating System
The Nios II EDS includes an implementation of the third-party MicroC/OS-II RTOS
that you can optionally include in your BSP. MicroC/OS-II is built on the HAL, and
implements a simple, well-documented RTOS scheduler. You can modify settings that
become part of the BSP settings. Other operating systems are available from
third-party vendors.
Altera-Provided Development Tools
This section lists all the development tools that Altera provides for the Nios II
processor. This section does not describe detailed usage of the tools, but refers you to
the most appropriate documentation.
Refer to “Development Flows for Creating Nios II Programs” on page 1–9 an
overview of how you use these tools together to develop software for the Nios II
processor.
The Nios II Command Shell
The Nios II command shell is a command-line environment with the correct settings
to run Nios II command-line tools. To open a Nios II command shell, execute the
following steps, depending on your environment:
■ In the Windows operating system, on the Start menu, point to Programs > Altera >
Nios II EDS, and click Nios II Command Shell.
■ In the Linux operating system, in a command shell, execute the following
commands:
cd $SOPC_KIT_NIOS2r
./sdk_shellr
The Nios II IDE Tools
Table 1–1 describes the tools provided by the Nios II IDE user interface.
剩余431页未读,继续阅读
wangenwei8739
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- C++多态实现机制详解:虚函数与早期绑定
- Java多线程与异常处理详解
- 校园导游系统:无向图实现最短路径探索
- SQL2005彻底删除指南:避免重装失败
- GTD时间管理法:提升效率与组织生活的关键
- Python进制转换全攻略:从10进制到16进制
- 商丘物流业区位优势探究:发展战略与机遇
- C语言实训:简单计算器程序设计
- Oracle SQL命令大全:用户管理、权限操作与查询
- Struts2配置详解与示例
- C#编程规范与最佳实践
- C语言面试常见问题解析
- 超声波测距技术详解:电路与程序设计
- 反激开关电源设计:UC3844与TL431优化稳压
- Cisco路由器配置全攻略
- SQLServer 2005 CTE递归教程:创建员工层级结构
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功