Escolar Documentos
Profissional Documentos
Cultura Documentos
2013.05.06
UG-01138
Subscribe
Feedback
2013 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, HARDCOPY, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. 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 application or use of any information, product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
Overview
2013.05.06
UG-01138
Subscribe
Feedback
This document describes Cyclone V SoC FPGA golden system reference design (GSRD). The design demonstrates the Hard Processor System (HPS) features and the ability to communicate between HPS to the FPGA logic via the AXI Bridge interfaces. It is designed to provide a solid foundation of the most essential hardware and software system components for various user designs. It consists of the hardware reference design called Golden Hardware Reference Design (GHRD) and Linux software packages.
2013 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, HARDCOPY, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. 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 application or use of any information, product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
Feature Description
2013.05.06
UG-01138
Subscribe
Feedback
The GSRD demonstrates the HPS features and the ability of communication between HPS to the FPGA logic via the AXI Bridges interfaces. This design provides guidance and step-by-step flow for hardware developer as well as software developer to kick starts any development with Cyclone V (CV) SoC FPGA development kit. The golden hardware design consists of an ARM Cortex-A9 MPCore Hard Processor System (HPS), 2-bit of user push button inputs, 4-bit of user dipswitch inputs, 4-bit of user IO blinking LED outputs, 64Kbytes on-chip memory, JTAG to Avalon master bridges, interrupt capturer for use with system console and system ID. HPS contains large number of peripherals such as SDRAM Controller, Gigabit Ethernet MAC, QSPI, USB OTG, SDMMC, CAN, SPI Master, UART and I2C interface. The following figure illustrates the GHRD block diagram.
2013 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, HARDCOPY, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. 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 application or use of any information, product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
Feature Description
UG-01138 2013.05.06
The GHRD has minimum peripheral on the FPGA fabric as HPS has already provided substantial amount of peripheral choice. HPS2FPGA and FPGA2HPS interfaces are set to be 64-bit in data width. The GHRD system also provides an option for hardware designer to be able to access each peripheral in FPGA domain of the system via System-Console through the JTAG Master module. This signal level access is independent of driver readiness of each peripheral.
Altera Corporation
Feature Description
Feedback
UG-01138 2013.05.06
GPIO GPIO GPIO GPIO Ethernet SDMMC USB QSPI SPI UART I2C TRACE
User DIPSW (4 bits), GPI7-10 User Push Button (4 bits), GPI3-6 LED (4 bits), GPIO41-44 Others, (enet_int, CONV_HPS_USB_N) Gbps Ethernet (EMAC1) 4-wire USB1, Set 0 QSPI, 1SS SPI Master (SPIM0) UART0 to USB mini, Set 2 I2C0, Set 1 Trace Port Interface
MPU View
The memory map of system peripherals on FPGA as view by the MPU will sit on top of HPS2FPGA address offset 0xC000_000. Following table describes the offset of each peripheral in FPGA. Table 2: Address offset of peripherals on HPS2FPGA Interface
Peripheral Address offset Size (bytes) Attribute
onchip_memory2_0
0x0
64K
The memory map of system peripherals on FPGA as view by the MPU which sit on top of LWHPS2FPGA with base address of 0xFF20_000 is show in following table. Table 3: Address offset of peripherals on LWHPS2FPGA Interface
Peripheral Address offset Size (bytes) Attribute
sysid_qsys
Feature Description
Feedback
0x10000
Unique system ID
Altera Corporation
UG-01138 2013.05.06
Peripheral
Address offset
Size (bytes)
Attribute
8 8 8 8
LED output display Push button input DIP switch input JTAG UART console
8 8 8 8 8 64K
Unique system ID 4 LED outputs 4 dip switch inputs 2 push button inputs JTAG UART console On-chip RAM
Interrupts Routing
HPS exposes 64 interrupt inputs for FPGA logic. Following table illustrates the FPGA peripherals interrupts to the HPS interrupt input interface. Table 5: Interrupt number of FPGA peripherals
Peripheral Interrupt number Attribute
The interrupts sources are also connected to an interrupt capturer module in the system, which enable system console to make aware of the interrupt status of each peripheral in FPGA.
Altera Corporation
Feature Description
Feedback
Prerequisites
2013.05.06
UG-01138
Subscribe
Feedback
To use this guide, you must download and install version 13.0 or later of the following software from the Altera Download Center: Altera Quartus II software Altera SoC EDS See SoC EDS and ARM DS-5 Installation in the Altera SoC Embedded Design Suite User Guide for installation details. SoC FPGA Linux Binary Support Package SoC FPGA Linux Source File Support Package
2013 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, HARDCOPY, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. 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 application or use of any information, product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
UG-01138
Subscribe
Feedback
1. Make sure that shunts and shorting jumpers are installed as follows: Clock select CLKSELx: Boot select BOOTSELx: J26, J27 set toward the power switch J28, J29: set toward the power switch J30: set away from the power switch Rest of jumper settings: Table 1: Jumper Settings
Number Name Setting
2013 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, HARDCOPY, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. 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 application or use of any information, product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
UG-01138 2013.05.06
Altera Corporation
UG-01138 2013.05.06
SW1 = all switches set toward the board edge. SW2 = all switches set away from the corner of the board. SW3 = all switches set toward the board edge. SW4 = JTAG ENABLE. Each switch enables a connection to the scan chain when its corresponding switch is set away from the board edge (off). Set for programming the FPGA using the on-board USB-Blaster II = ON/OFF/ON/OFF, leaving the FPGA and MAX connected to JTAG.
3. Use a mini-USB to USB cable to connect the board to the host PC, as follows: For the steps in Hardware Development Flow, connect the cable to USB-Blaster II port on the board to the host PC. For the steps in Software Development Flow, connect the cable to the UART port on the board to the host PC. You may need to install the FTDI D2XX UART-to-USB driver from the Future Technology Devices International website. 4. Apply power to the board from a 19 V power supply, as directed in the Cyclone V SoC FPGA Development Kit User Guide.
Altera Corporation
UG-01138 2013.05.06
5. Open a serial terminal program, such as Minicom (for Linux) or PuTTY (for Windows). Set the baud rate to 57.6 kbaud, 8 bits, no parity, 1 stop bit. 6. Attach the network cable to the board and connect to the network port (with DHCP enabled).
Altera Corporation
UG-01138
Subscribe
Feedback
2013 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, HARDCOPY, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. 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 application or use of any information, product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
UG-01138 2013.05.06
3. Click Tools, Programmer to launch Quartus II Programmer. Click Auto Detect and select the device part number from the SoC development board (for example, 5CSXFC6C6). 4. Right-click the device part number and click Change File. In the Select New Programming File dialog box, browse to <my_ghrd_dir>\output_files and select soc_system.sof. 5. Check the Program/Configure box and click Start. This will configure the Cyclone V device with the GHRD image.
Altera Corporation
UG-01138 2013.05.06
6. Click Tools, Qsys to launch Qsys tool. Browse to <my_ghrd_dir> and select soc_system.qsys. Click Open.
Altera Corporation
UG-01138 2013.05.06
7. In Qsys, click Tools, System Console. 8. In the TCL Console panel, type pwd. Make sure that the System Console is point to <my_ghrd_dir>. 9. Type source ghrd_sc_script.tcl.
Altera Corporation
UG-01138 2013.05.06
Exercising LED
Related Information
Exercising LED
You have successfully set up the connection between system console and the development kit. Now lets start with a simple task which is control the LED. 1. 2. 3. 4. 5. LED D5, D6, D7 and D8 are turned on by default. Type led_off to turn off LED D5 to D8. Turn on LED D5 by typing led_on 0x7. Turn on LED D6 by typing led_on 0xb. Turn on LED D7 by typing led_on 0xd. Turn on LED D8 by typing led_on 0xe.
Altera Corporation
UG-01138 2013.05.06
Altera Corporation
UG-01138 2013.05.06
Altera Corporation
UG-01138 2013.05.06
Altera Corporation
UG-01138
Subscribe
Feedback
Software engineers need to synchronize with hardware engineers on the hardware changes. Altera provides software handoff files which contain the necessary hardware setting (i.e. HPS configuration, external memory setting, Soft IP memory-map and interrupt). This is generated by the Quartus II during the hardware flow and is used by software engineers to regenerate the software. This ensures that the software is always in sync with the latest hardware change. In the GSRD, we will only generate 2nd stage boot software called preloader and optional 3rd stage loader called U-Boot. In the future, user can generate BSPs for later stages as well such as Operating System (i.e. Linux).
2013 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, HARDCOPY, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. 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 application or use of any information, product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device specifications before relying on any published information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
UG-01138 2013.05.06
Boot ROM
Preloader
Boot Loader
Operating System
Altera Corporation
UG-01138 2013.05.06
Note: A pre-built preloader can also be found in <my_ghrd_dir>\software\preloader. However, theres a minor issue where the pre-built preloader only works with the DS-5 debugger attached. It is strongly recommended to follow the steps below to build the preloader from the generated source. 1. To launch the Preloader Support Package Generator, type bsp-editor in a Command Shell. 2. The generator starts without loading any .bsp file. To open and modify an existing BSP project, use File->Open and point to the path of an existing .bsp file. To create a new BSP project, use File->New BSP to launch the New BSP GUI. 3. In Preloader setting directory, select the <my_ghrd_dir>\hps_isw_handoff\soc_system_hps_0 directory.
4. Click OK 5. In the next screen, keep every option as default and click Generate. This will generate the new preloader source files in <my_ghrd_dir>/software/spl_bsp directory
Altera Corporation
U-boot Image
UG-01138 2013.05.06
6. Open a command shell and browse to <my_ghrd_dir>/software/spl_bsp and type make all 7. You should now see preloader-mkpimage.bin in the same directory.
Related Information
Prerequisites on page 1
U-boot Image
1. User can build u-boot.img from SoC EDS at folder software/spl_bsp by typing make uboot
Altera Corporation Software Development Flow
Feedback
UG-01138 2013.05.06
Linux Images
Linux Images
Altera provides Linux BSP support for the Cyclone V SoC Development Kit, including the following components: Linux kernel 3.7 Preloader u-boot version 2012.10 Yocto version 'Danny' Packages for the root file system C compiler tool chain (Linaro-GCC, v4.7)
Yocto is used to build the kernel, the u-boot and the root file system from source. There are many source code packages available under the Yocto project. If you enable a package that is not provided with our BSP, it is downloaded. If your system communicates with the network through a proxy server, make sure the network configuration of your Linux host is ready. We use the pre-built binary Linux images in this documentation. For instructions on how to build Linux images from source, refer to the Linux Getting Started Guide and the Linux BSP User Manual on the Altera Linux Portal.
Related Information
Programming Flash
To boot the Linux images on your SoC FPGA development kit, you need to write the required images into one of the three flash devices: SD/MMC, NAND or QSPI. This guide uses the SD/MMC because it is easily removable. 1. Download linux-socfpga-13.02-bin.tar.gz and uncompress into a directory 2. Write the included sd_image.bin file to the SD card using dd utility. For instructions to create an SD image from individual components (Preloader, U-boot, Device Tree, Linux kernel, root file system), if necessary, refer to the the Linux BSP User Manual on the Altera Linux Portal.
Related Information
Altera Corporation
UG-01138 2013.05.06
Altera Corporation
UG-01138 2013.05.06
Altera Corporation
UG-01138 2013.05.06
Related Information
Altera Corporation
UG-01138 2013.05.06
Altera Corporation
10
Over SSH
UG-01138 2013.05.06
Over SSH
A SSH server is started as soon as the Linux boots. A user may use a SSH client on their host machine to connect to the target SoC FPGA using the IP address displayed on the character LCD. root@<IP address displayed on the character LCD>
Altera Corporation
UG-01138 2013.05.06
Applications Examples
11
Applications Examples
A user may run applications (i.e. LED control, push buttons and DIP switches) built into the default Linux root file system from the Linux console. These examples serve as references for users to write their own applications that interact with soft IPs. The source code of these applications can be found at <SoC FPGA Linux Source File Support Package installation directory>/meta-altera/recipes-gsrd/files. You need to execute the BSX file and select the extraction target directory to extract first. In the target Linux root file system, the binaries of these applications sit in /home/root/altera/. Please 'cd' to /home/root/altera to execute these applications. By default, the kernel modules needed for execution of these example applications are added with modprobe when Linux boots up. If users develop their own drivers/kernel modules and the applications dependent on the drivers/kernel modules, then the users will need to add the kernel modules with modprobe before executing the applications. A number of application usages are shown below. the example applications are based on the soft PIO driver in FPGA.
Altera Corporation
12
UG-01138 2013.05.06
Altera Corporation