My First Nios II for Altera DE2-115 Board

Slides:



Advertisements
Similar presentations
DE2-115 Control Panel - Part I
Advertisements

Slides created by: Professor Ian G. Harris PIC Development Environment MPLAB IDE integrates all of the tools that we will use 1.Project Manager -Groups.
My First Nios II for Altera DE2-115 Board 數位電路實驗 TA: 吳柏辰 Author: Trumen.
Week 1- Fall 2009 Dr. Kimberly E. Newman University of Colorado.
NIOS II Ethernet Communication Final Presentation
Configurable System-on-Chip: Xilinx EDK
Altera’s Quartus II Installation, usage and tutorials Gopi Tummala Lab/Office Hours : Friday 2:00 PM to.
Technion – Israel Institute of Technology Department of Electrical Engineering High Speed Digital Systems Lab Project performed by: Naor Huri Idan Shmuel.
1-1 Embedded Software Development Tools and Processes Hardware & Software Hardware – Host development system Software – Compilers, simulators etc. Target.
Programming I/O for Embedded System. Page 2 Overview Basis: A DE2 Computer Architecture Parallel I/O 7-Segment Display Basic Manipulating 7-Segment Display.
JTAG UART port in NIOS.
Using PDG with e2studio: Example
ECE Department: University of Massachusetts, Amherst Lab 1: Introduction to NIOS II Hardware Development.
Ethernet Bomber Ethernet Packet Generator for network analysis Oren Novitzky & Rony Setter Advisor: Mony Orbach Started: Spring 2008 Part A final Presentation.
CSCE 430/830 A Tutorial of Project Tools By Dongyuan Zhan Feb. 4, 2010.
Dr. Kimberly E. Newman Hybrid Embedded wk3 Fall 2009.
Part 1 Using the ARM board And start working with C Tutorial 5 and 6
By: Nadav Haklai & Noam Rabinovici Supervisors: Mike Sumszyk & Roni Lavi Semester:Spring 2010.
The 6713 DSP Starter Kit (DSK) is a low-cost platform which lets customers evaluate and develop applications for the Texas Instruments C67X DSP family.
Renesas Technology America Inc. 1 M16C/Tiny SKP Tutorial 2 Creating A New Project Using HEW4.
Lab 2: Capturing and Displaying Digital Image
NetBurner MOD 5282 Network Development Kit MCF 5282 Integrated ColdFire 32 bit Microcontoller 2 DB-9 connectors for serial I/O supports: RS-232, RS-485,
Tutorial 11 Installing, Updating, and Configuring Software
An Introduction Chapter Chapter 1 Introduction2 Computer Systems  Programmable machines  Hardware + Software (program) HardwareProgram.
SOC Consortium Course Material ASIC Logic National Taiwan University Adopted from National Chiao-Tung University IP Core Design.
ECE Department: University of Massachusetts, Amherst Using Altera CAD tools for NIOS Development.
1 3-General Purpose Processors: Altera Nios II 2 Altera Nios II processor A 32-bit soft core processor from Altera Comes in three cores: Fast, Standard,
1 Nios II Processor Architecture and Programming CEG 4131 Computer Architecture III Miodrag Bolic.
Renesas Technology America Inc. 1 SKP8CMINI Tutorial 2 Creating A New Project Using HEW.
ECS642U Embedded Systems Digital I/O William Marsh.
My Second FPGA for Altera DE2-115 Board 數位電路實驗 TA: 吳柏辰 Author: Trumen.
NIOS II Ethernet Communication Final Presentation
July 7, 2003 Slide 1 of 6 Automation, Robotics and Mechatronics Lab, SUNY at Buffalo Introduction To Programming Chetan Jadhav Talib Bhabharawala Seung-Kook.
Lab 2 Parallel processing using NIOS II processors
A Skeleton NIOS II Project for the DE1 board :
Renesas Technology America Inc. 1 SKP8CMINI Tutorial 2 Creating A New Project Using HEW.
Proposal for an Open Source Flash Failure Analysis Platform (FLAP) By Michael Tomer, Cory Shirts, SzeHsiang Harper, Jake Johns
Ethernet Bomber Ethernet Packet Generator for network analysis
Teaching Digital Logic courses with Altera Technology
Embedded Systems Design with Qsys and Altera Monitor Program
Introduction to the FPGA and Labs
Maj Jeffrey Falkinburg Room 2E46E
Lab 4 HW/SW Compression and Decompression of Captured Image
BASIC PROGRAMMING C SCP1103 (02)
DE2-115 Control Panel - Part I
Lab 0: Familiarization with Equipment and Software
Lab 1: Using NIOS II processor for code execution on FPGA
My Second FPGA for Altera DE2-115 Board
EECE6017 Lab 7 HPS to FPGA – Gsensor to LED
ECE354 Embedded Systems Introduction C Andras Moritz.
Computer System Laboratory
CS4101 Introduction to Embedded Systems Lab 1: MSP430 LaunchPad IDE
DE2-115 Control Panel - Part II
Implementation of Embedded OS
BASIC PROGRAMMING C SCP1103 (02)
Introduction to Programmable Logic
ENG3050 Embedded Reconfigurable Computing Systems
Sisteme Incorporate – Curs10
Getting Started with Programmable Logic
Avalon Switch Fabric.
Introduction to Microprocessors and Microcontrollers
Computer Science I CSC 135.
SOPC DE10-Lite Basic Computer Parallel port
Figure 17.2 It is important that the Advanced Import Options be set as shown here.
Introduction to Micro Controllers & Embedded System Design
Lab4 Writing Basic Software Applications Lab: MicroBlaze
Software Setup & Validation
Øyvind Hagen Senior Hardware Developer
Remote System Update Example Design for Cyclone IV GX Transceiver Starter Board April 23rd, 2015 (Rev 1.0)
Chapter 1: Introduction to Computers and Programming
Presentation transcript:

My First Nios II for Altera DE2-115 Board Digital Circuit Lab TA: Po-Chen Wu

Outline Hardware Design Nios II IDE Build Flow Programming the CFI Flash

Hardware Design

Introduction This slides provides comprehensive information that will help you understand how to create a FPGA based SOPC system implementing on your FPGA development board and run software upon it.

Required Features (1/2) The Nios II processor core is a soft-core central processing unit (CPU) that you could program onto an Altera field programmable gate array (FPGA). This chapter illustrates you to the basic flow covering hardware creation and software building.

Required Features (2/2) The example NIOS II standard hardware system provides the following necessary components: Nios II processor core, that’s where the software will be executed. On-chip memory to store and run the software. JTAG link for communication between the host computer and target. Hardware (typically using a USB-Blaster cable). LED peripheral I/O (PIO), be used as indicators.

Creation of Hardware Design 1 2 3

1 2 same as (top-level) file name 3

1

1 2 for DE2-115 3

1 2

1 2 3 4

1 2

1(double-click) 2

1 2

1 2(double-click) 3 JTAG = Joint Test Action Group UART = Universal Asyncronous Receiver/Transmitter 3

1 2

3 4 1 2(double-click)

1 2

3 4 2(double-click) 5 1

1(double-click) 2

1 2

3 2(double-click) 1

1 2

1

1

1 2

1

5 1 3 4 2

1 2 3 4

1

module NiosII ( clk, rst_n, led, ); input clk, rst_n; output [7:0] led; DE2_115_QSYS DE2_115_QSYS_inst ( .clk_clk(clk), .reset_reset_n(rst_n), .led_export(led), endmodule

2 3 1

1 2 3

2 1 3 4

1 2

2 1 4 3

1 2 3

1 2

2 1

1 2

1 2

create_clock -period 20 [get_ports clk] derive_clock_uncertainty set_input_delay 0 -clock clk [all_inputs] set_output_delay 0 -clock clk [all_outputs]

5 1 2 4 3 46

1

1

1

When configuration is complete, the FPGA is configured with the Nios II system, but it does not yet have a C program in memory to execute.

This Chapter covers build flow of Nios II C coded software program. NIOS II IDE Build Flow This Chapter covers build flow of Nios II C coded software program.

Introduction The Nios II IDE build flow is an easy-to-use graphical user interface (GUI) that automates build and makefile management. In this section you will use the Nios II IDE to compile a simple C language example software program to run on the Nios II standard system configured onto the FPGA on your development board.

1 3 4 2

1 2 3

1 2 3

1

Project Description When you create a new project, the NIOS II SBT for Eclipse creates two new projects in the NIOS II C/C++ Projects tab: Hello_NiosII is your C/C++ application project. This project contains the source and header files for your application. Hello_NiosII_bsp is a board support package that encapsulates the details of the Nios II system hardware. Note: When you build the system library for the first time the NIOS II SBT for Eclipse automatically generates files useful for software development, including: ● Installed IP device drivers, including SOPC component device drivers for the NIOS II hardware system ● Newlib C library, which is a richly featured C library for the NIOS II processor. ● NIOS software packages which includes NIOS II hardware abstraction layer, NicheStack TCP/IP Network stack, NIOS II host file system, NIOS II read-only zip file system and Micrium's μC/OS-II real time operating system(RTOS). ● system.h, which is a header file that encapsulates your hardware system. ● alt_sys_init.c, which is an initialization file that initializes the devices in the system. ● Hello_world_0.elf, which is an executable and linked format file for the application located in hello_world_0 folder under Debug. SBT: Software Build Tools

1(right-click) 2

1(right-click) 1. right click 2 3

Edit and Re-Run the Program 2 1

#include <stdio.h> #include "system.h" #include "altera_avalon_pio_regs.h" int main() { printf("Hello from Nios II!\n"); int count = 0; int delay; while(1) { IOWR_ALTERA_AVALON_PIO_DATA(LED_BASE, 1 << count); delay = 0; while(delay < 2000000 ) { delay++; } count = (count+1) % 8; return 0;

1(right-click) 2 3

Orient your development board so that you can observe LEDGs blinking

Why the LEDs Blink? (1/2) The Nios II system description header file, system.h, contains the software definitions, name, locations, base addresses, and settings for all of the components in the Nios II hardware system. The system.h file is located in the in the Hello_NiosII_bsp directory.

Why the LED Blinks? (2/2) The Nios II processor controls the PIO ports (and thereby the LED) by reading and writing to the register map. For the PIO, there are four registers: data, direction, interrupt mask, and edge capture. To turn the LED on and off, the application writes to the PIO data register.

Register Map File (1/2) The PIO core has an associated software file altera_avalon_pio_regs.h. This file defines the core's register map, providing symbolic constants to access the low-level hardware. This file is located in Project\software\Hello_NiosII_bsp\drivers\inc\.

Register Map File (2/2) When you include this file, several useful functions that manipulate the PIO core registers are available to your program. In particular, the function IOWR_ALTERA_AVALON_PIO_DATA (base, data) can write to the PIO data register, turning the LED on and off. The PIO is just one of many SOPC peripherals that you can use in a system. To learn about the PIO core and other embedded peripheral cores, refer to Embedded Peripherals IP User Guide. When developing your own designs, you can use the software functions and resources that are provided with the Nios II HAL. Refer to the Nios II Software Developer’s Handbook for extensive documentation on developing your own Nios II processor-based software applications.

Debugging the Application Before you can debug a project in the NIOS II SBT for Eclipse, you need to create a debug configuration that specifies how to run the software. To learn about the PIO core and other embedded peripheral cores, refer to Embedded Peripherals IP User Guide. When developing your own designs, you can use the software functions and resources that are provided with the Nios II HAL. Refer to the Nios II Software Developer’s Handbook for extensive documentation on developing your own Nios II processor-based software applications.

1(double-click)

1(right-click) 4 2 3

1 2

Debugging Tips When debugging a project in the Nios II SBT for Eclipse, you can pause, stop or single step the program, set breakpoints, examine variables, and perform many other common debugging tasks.

1 2 Return to the Nios II C/C++ project perspective from the debug perspective.

Configure BSP Editor In this section you will learn how to configure some advanced options about the target memory or other things. By performing the following steps, you can charge all the available settings.

1(right-click) 2 3

1

1

Note If you make changes to the system properties or the Qsys properties or your hardware, you must rebuild your project To rebuild, right-click the Hello_NiosII_BSP->Nios II- >Generate BSP and then Rebuild Hello_NiosII Project.

Programming the CFI Flash

Introduction With the density of FPGAs increasing, the need for larger configuration storage is also increasing. If your system contains a common flash interface (CFI) flash memory, you can use your system for FPGA configuration storage as well.

1 2

1 2

1(double-click)

1 2

1 2

1

1

1 2

1 2

1 2 3 4

1 2

2 3 1(double-click)

1 2

2 1(double-click)

1 2

1 2(double-click)

1 2 3

1

1(double-click)

1 2

1 2

1 3 2 4

1

module NiosII ( clk, rst_n, led, // flash FL_ADDR, FL_CE_N, FL_DQ, FL_OE_N, FL_RESET_N, FL_RY, FL_WE_N, FL_WP_N ); input clk, rst_n; output [7:0] led; output [22:0] FL_ADDR; output FL_CE_N; inout [7:0] FL_DQ; output FL_OE_N; output FL_RESET_N; input FL_RY; output FL_WE_N; output FL_WP_N; DE2_115_QSYS DE2_115_QSYS_inst ( .clk_clk(clk), .reset_reset_n(rst_n), .led_export(led), .tristate_bridge_flash_out_fs_addr(FL_ADDR), .tristate_bridge_flash_out_fl_read_n(FL_OE_N), .tristate_bridge_flash_out_fl_cs_n(FL_CE_N), .tristate_bridge_flash_out_fs_data(FL_DQ), .tristate_bridge_flash_out_fl_we_n(FL_WE_N), // flash config assign FL_RESET_N = 1'b1; assign FL_WP_N = 1'b1; endmodule

2 1 3 4

1 2

1

1

1

1 3 4 2

1(right-click) 3 2

1(right-click) 2

1(right-click) 2 3

1 2 3 4 5

1 2 4 5 3

1

1

Finally... Restart power on the development board. Download NiosII.sof of your project “NiosII” to the board. You will see that the LEDs blink!

The End. Any question?

Reference "My First Nios II for Altera DE2-115 Board" by Terasic Technologies Inc. "My First Nios II for Altera DE2i-150 Board" by Terasic Technologies Inc. "DE2-115 User Manual" by Terasic Technologies Inc.