Nios II Processor Reference Handbook
Total Page:16
File Type:pdf, Size:1020Kb
Nios II Processor Reference Handbook 101 Innovation Drive San Jose, CA 95134 www.altera.com NII5V1-7.2 Copyright © 2007 Altera Corporation. All rights reserved. Altera, The Programmable Solutions Company, the stylized Altera logo, specific device des- ignations, and all other words and logos that are identified as trademarks and/or service marks are, unless noted otherwise, the trademarks and service marks of Altera Corporation in the U.S. and other countries. All other product or service names are the property of their respective holders. Al- tera products are protected under numerous U.S. and foreign patents and pending applications, maskwork rights, and copyrights. Altera warrants performance of its semiconductor products to current specifications 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 of the ap- plication or use of any information, product, or service described herein except as expressly agreed to in writing by Altera Corporation. Altera customers are advised to obtain the latest version of device specifications before relying on any published in- formation and before placing orders for products or services. Printed on recycled paper ii Altera Corporation Contents Chapter Revision Dates ........................................................................... ix About This Handbook .............................................................................. xi Introduction ............................................................................................................................................... xi Prerequisites ..................................................................................................................................... 1–xi How to Find Further Information ........................................................................................................ xii How to Contact Altera ........................................................................................................................... xii Typographical Conventions ................................................................................................................. xiii Section I. Nios II Processor Chapter 1. Introduction Introduction ............................................................................................................................................ 1–1 Nios II Processor System Basics .......................................................................................................... 1–1 Getting Started with the Nios II Processor ........................................................................................ 1–2 Customizing Nios II Processor Designs ............................................................................................. 1–3 Configurable Soft-Core Processor Concepts ...................................................................................... 1–4 Configurable Soft-Core Processor .................................................................................................. 1–4 Flexible Peripheral Set and Address Map .................................................................................... 1–5 Custom Instructions ......................................................................................................................... 1–5 Automated System Generation ...................................................................................................... 1–6 OpenCore Plus Evaluation ................................................................................................................... 1–6 Referenced Documents ......................................................................................................................... 1–7 Document Revision History ................................................................................................................. 1–7 Chapter 2. Processor Architecture Introduction ............................................................................................................................................ 2–1 Processor Implementation .................................................................................................................... 2–2 Register File ............................................................................................................................................ 2–3 Arithmetic Logic Unit ........................................................................................................................... 2–4 Unimplemented Instructions .......................................................................................................... 2–4 Custom Instructions ......................................................................................................................... 2–4 Floating Point Instructions .............................................................................................................. 2–5 Reset Signals ........................................................................................................................................... 2–6 Exception and Interrupt Controller .................................................................................................... 2–6 Exception Controller ........................................................................................................................ 2–6 Integral Interrupt Controller ........................................................................................................... 2–6 Interrupt Vector Custom Instruction ............................................................................................. 2–7 Altera Corporation iii Contents Memory and I/O Organization ........................................................................................................... 2–8 Instruction and Data Buses ............................................................................................................. 2–9 Cache Memory ................................................................................................................................ 2–11 Tightly-Coupled Memory ............................................................................................................. 2–13 Address Map ................................................................................................................................... 2–14 JTAG Debug Module .......................................................................................................................... 2–15 JTAG Target Connection ............................................................................................................... 2–15 Download and Execute Software ................................................................................................. 2–16 Software Breakpoints ..................................................................................................................... 2–16 Hardware Breakpoints .................................................................................................................. 2–16 Hardware Triggers ......................................................................................................................... 2–16 Trace Capture .................................................................................................................................. 2–18 Referenced Documents ....................................................................................................................... 2–19 Document Revision History ............................................................................................................... 2–20 Chapter 3. Programming Model Introduction ............................................................................................................................................ 3–1 General-Purpose Registers ................................................................................................................... 3–1 Control Registers ................................................................................................................................... 3–2 Operating Modes ................................................................................................................................... 3–4 Normal Mode .................................................................................................................................... 3–5 Debug Mode ...................................................................................................................................... 3–5 Changing Modes .............................................................................................................................. 3–5 Exception Processing ............................................................................................................................. 3–5 Reset Exceptions ............................................................................................................................... 3–6 Break Exceptions .............................................................................................................................. 3–7 Interrupt Exceptions ........................................................................................................................ 3–8 Instruction-Related Exceptions ...................................................................................................