首页资源分类FPGA/CPLD > Creating_Embedded_System

Creating_Embedded_System

已有 453361个资源

下载专区

文档信息举报收藏

标    签: FPGAXilinxEDK

分    享:

文档简介

Creating_Embedded_System with ISE

文档预览

Spartan-6 LX9 MicroBoard Embedded Tutorial Spartan-6 LX9 MicroBoard Embedded Tutorial Tutorial 1 Creating an AXI-based Embedded System Version 13.2.01 Spartan-6 LX9 MicroBoard Embedded Tutorial Revision History Version 13.2.01 Description Initial release for EDK 13.2 Date 9/22/2011 Table of Contents Revision History..............................................................................................................................2 Table of Contents ...........................................................................................................................2 Table of Figures..............................................................................................................................2 Overview......................................................................................................................................... 3 Objectives....................................................................................................................................... 3 Requirements ................................................................................................................................. 4 Software ...................................................................................................................................... 4 Hardware .................................................................................................................................... 4 Recommended Reading ............................................................................................................. 4 I. Create the Hardware Platform .....................................................................................................5 II. Understanding the System .........................................................................................................9 III. Compiling a Test Application Using SDK.................................................................................11 IV. Test the Generated System with the Test Application.............................................................16 Getting Help and Support .............................................................................................................20 Table of Figures Figure 1 - Hardware Platform .........................................................................................................3 Figure 2 - Project Location..............................................................................................................5 Figure 3 - Project Settings ..............................................................................................................6 Figure 4 - New Source Wizard........................................................................................................6 Figure 5 - Board and System Selection ..........................................................................................7 Figure 6 - Base System Builder Peripherals...................................................................................8 Figure 7 - System Assembly View ..................................................................................................9 Figure 8 - Generate Top HDL Source...........................................................................................10 Figure 9 - Export Hardware Design to SDK..................................................................................11 Figure 10 - Workspace Launcher .................................................................................................12 Figure 11 - Adding C Applications ................................................................................................12 Figure 12 - Creating a new Board Support Package ....................................................................13 Figure 13 - SDK Project Explorer .................................................................................................14 Figure 14 - Linker Script Configuration .........................................................................................15 Figure 15 - Connect LX9 MicroBoard to host PC..........................................................................16 Figure 16 - COM Port Selection....................................................................................................16 Figure 17 - FPGA Programming ...................................................................................................17 Figure 18 - Run Configurations.....................................................................................................18 Figure 19 - STDIO Configuration ..................................................................................................18 Figure 20 - Console View .............................................................................................................19 Page 2 of 20 Spartan-6 LX9 MicroBoard Embedded Tutorial Overview This is the first tutorial in a series of training material dedicated to introducing engineers to creating their first embedded designs featuring the new AXI interface. These tutorials will cover all the required steps for creating a complete MicroBlaze design in the Spartan-6 LX9 MicroBoard. While dedicated to this platform, the information learned here can be used with any Xilinx FPGA. The tutorial is divided into four main steps: creating the hardware platform, understanding what was created, using SDK to compile a software application and testing the system on the FPGA. The test application will reside in the attached LPDDR. Below is a block diagram of the hardware platform. The General Purpose I/O (GPIO) core will be used for the LEDs on the board. Figure 1 - Hardware Platform Objectives This tutorial demonstrates how to create an embedded hardware platform for MicroBlaze using the Xilinx Platform Studio (XPS) Base System Builder (BSB). The lab will show:  How start Base System Builder from Project Navigator  How to generate a MicroBlaze embedded hardware platform  What files are generated  How to use the software environment (SDK) to test a simple application Page 3 of 20 Spartan-6 LX9 MicroBoard Embedded Tutorial Requirements The following items are required for proper completion of this tutorial. Software The following software setup is required for this reference design:  WindowsXP 32-bit Service Pack 2  Xilinx ISE WebPack with the EDK add-on or ISE Embedded Edition version 13.2  Installed Silicon Labs CP210x USB-to-UART Bridge Driver (see Silicon Labs CP210x USB-toUART Setup Guide, listed in Recommended Reading, below)  Installation of the Spartan-6 LX9 MicroBoard XBD (for EDK 13.2) files (Available from Avnet: http://em.avnet.com/s6microboard) Hardware The hardware setup used by this reference design includes:  Computer with a minimum of 300-900 MB (depending on O/S) to complete an XC6SLX9 design1  Avnet Spartan-6 LX9 MicroBoard Kit o Avnet Spartan-6 LX9 MicroBoard o USB Extension cable (if necessary) o USB A-to-MicroB cable Recommended Reading Available from Avnet: http://em.avnet.com/s6microboard • The hardware used on the Spartan-6 LX9 MicroBoard is described in detail in Avnet document, Spartan-6 LX9 MicroBoard User Guide. • An overview of the configuration options available on the Spartan-6 LX9 MicroBoard, as well as Digilent driver installation instructions can be found in the Avnet document, Spartan-6 LX9 MicroBoard Configuration Guide. • Instructions on installing the Silicon Labs CP210x USB-to-UART drivers can be found in the Avnet document, Silicon Labs CP210x USB-to-UART Setup Guide. Available from Xilinx: http://www.xilinx.com/support/documentation/spartan-6.htm • Details on the Spartan-6 FPGA family are included in the following Xilinx documents: o Spartan-6 Family Overview (DS160) o Spartan-6 FPGA Data Sheet (DS162) o Spartan-6 FPGA Configuration User Guide (UG380) o Platform Studio Help (available in tool menu) o Platform Studio SDK Help (available in tool menu) o MicroBlaze Reference Guide v.13.2 (UG081) o Embedded System Tools Reference Manual v.13.2 (UG111) 1 Refer to www.xilinx.com/ise/products/memory.htm Page 4 of 20 Spartan-6 LX9 MicroBoard Embedded Tutorial I. Create the Hardware Platform We will use Base System Builder to create the MicroBlaze embedded system. The Wizard can quickly create baseline systems for current development boards or for custom boards. The system will include a timer, a UART, a GPIO controller for the LEDs, external DDR memory, and internal memory to store the application. 1. Start Xilinx ISE Project Navigator, Start  Programs  Xilinx ISE Design Suite 13.2  ISE Design Tools  Project Navigator and create a new project: File > New Project… 2. Set the Project Location to C:\Xilinx\Embedded\ and the Project Name to EDK_Tutorial. Click Next. Figure 2 - Project Location Page 5 of 20 Spartan-6 LX9 MicroBoard Embedded Tutorial 3. Select Spartan6, XC6SLX9, CSG324, -2. Select VHDL or Verilog as the Preferred Language. Click Next. Figure 3 - Project Settings 4. Click Finish. 5. Go to Project > New Source… then select Embedded Processor. Type mb_system for the File name. Click Next. Click Finish. Figure 4 - New Source Wizard Page 6 of 20 Spartan-6 LX9 MicroBoard Embedded Tutorial 6. A message will appear asking if you want to create a Base System using the BSB wizard, click Yes. Note: the Base System Builder screen may be minimized to the application tray at the bottom of the screen. 7. Select the AXI system (might already be selected) then click OK. 8. In the Welcome window click Next to create a new design. 9. In the Board and System Selection Window, based on the part selected in Project Navigator, the wizard automatically selected a board with a matching part, the Avnet Spartan-6 LX9 MicroBoard. Configure the following options. • In the Board section, Select Board Revision B • In the Board Configuration section, note the Reference Clock Frequency, 66.666667MHz. This can be changed as the Spartan-6 LX9 Micro Board has a Texas Instruments programmable clock oscillator with preprogrammed outputs up to 100MHz. If this you select this faster input reference clock, you must update the UCF file to select this clock input. • In the Select a System section, select Single MicroBlaze Processor System and Area as the Optimization Strategy. • Click Next. Figure 5 - Board and System Selection Page 7 of 20 Spartan-6 LX9 MicroBoard Embedded Tutorial 10. In the Processor, Cache and Peripheral Configuration window configure the following options. • Processor Frequency = 100 MHz • 16KB of Local Memory. • 2KB of Instruction Cache Memory • 2KB of Data Cache Memory • Remove the CDCE913_I2C core • Remove the DIP_Switch_4Bits core • Remove the Ethernet_MAC core  Click Finish. Figure 6 - Base System Builder Peripherals Page 8 of 20 Spartan-6 LX9 MicroBoard Embedded Tutorial II. Understanding the System The Base System Builder wizard created all the files needed to get started with an embedded MicroBlaze system. Once finished, the Xilinx Platform Studio IDE has all the information for the project. We will look at the interface and the files created. Xilinx Platform Studio provides an integrated environment for creating an embedded hardware platform. We will explore all of the windows and necessary files as shown in the figure below. . Figure 7 - System Assembly View 1. The System Assembly View shows each peripheral used and the connections between the peripherals when the Bus Interfaces tab is selected. We will learn more about the System Assembly View as well as the IP Catalog tab in the next tutorial. 2. The Project window provides information on the project options used, gives access to the main project files, and log files. The main Project Files are:  MHS File. The Microprocessor Hardware Specification file contains the hardware specification of the entire system. The MHS file contains the bus architecture, list of peripherals, connectivity for the system, interrupt request priorities, and address space. The MHS file can also call out custom IP.  UCF File. The User Constraints File contains the timing and placement constraints for the FPGA. Page 9 of 20 Spartan-6 LX9 MicroBoard Embedded Tutorial In previous versions of Platform Studio, several other key files were listed in the Project Files section; the MSS file, Download.cmd, Fast_rutime.opt and Bitgen.ut. The MSS file is now managed by SDK in 13.2. The other three files are managed by ISE in 13.2 since ISE is recommended to be the top-level design entry tool. 3. The Addresses tab in the System Assembly View shows the address map for the system. The Bus Interfaces tab show peripheral connections to the processor via the AXI interface. And the Ports tab lists internal and external connections. 4. Select Project  Generate Block Diagram Image to view the block diagram for the project. The block diagram shows the connections between the different busses and components in the system. A jpeg image of the block diagram gets saved in your project in a folder named blockdiagram 5. A datasheet of the system can also be generated. Go to Project > Generate and View Design Report to view the design report. This is an html file that is generated in a report subfolder. 6. To view the general project options go to Project > Project Options… Click Cancel to close the window. 7. Close XPS when finished. 8. Return to Project Navigator and Go to Project > Add Copy of Source to add the FPGA constraints to the project. 9. Select mb_system.ucf in the mb_system\data directory. Click OK. 10. Select mb_system in the hierarchy window. 11. Double-click on Generate Top HDL Source in the Processes window. This is a new step in ISE 13.1. It creates a HDL instantiation template for your MicroBlaze processor subsystem and instantiates into a new created top-level HDL entity, or module if using Verilog. Figure 8 - Generate Top HDL Source Page 10 of 20 Spartan-6 LX9 MicroBoard Embedded Tutorial III. Compiling a Test Application Using SDK Xilinx SDK is an Eclipse based software development environment to create and debug software applications. Features include project management, multiple build configurations, a feature-rich C/C++ code editor, error navigation, a debugging and profiling environment, and source code version control. More time will be spent on the different features of the SDK in the next tutorials. 1. Select mb_system_i in the Hierarchy window. Double-click on Export Hardware To SDK with Bitstream in the Processes window. This may take several minutes to complete. Figure 9 - Export Hardware Design to SDK Page 11 of 20 Spartan-6 LX9 MicroBoard Embedded Tutorial 2. Create a Workspace named WorkSpace in the EDK_Tutorial directory. Click OK. Figure 10 - Workspace Launcher 3. You can close the Welcome window on the right side of the screen. 4. Go to File > New > Xilinx C Project to create a new C project. 5. Select the Peripheral Tests application from the project templates then click Next. Figure 11 - Adding C Applications Page 12 of 20 Spartan-6 LX9 MicroBoard Embedded Tutorial 6. Change the Board Support Package project name to Standalone_BSP. Figure 12 - Creating a new Board Support Package 7. Click Finish. The application will start building and create an ELF file, which is the compiled application. Page 13 of 20 Spartan-6 LX9 MicroBoard Embedded Tutorial 8. The Project Explorer View in SDK contains 3 projects: the hardware platform, the Board Support Package, and the C application as shown below. Figure 13 - SDK Project Explorer 9. Within the Board Support Package, all the libraries and include files associated with the hardware project are available to browse. The microblaze_0\include folder contains all the header files applicable for the current project. 10. The peripheral_tests_0 project contains C source files to test each peripheral. Expand the project src folder to view the sources. The project is compiled automatically after being created. 11. Double click on the testperiph.c file to view the main application. 12. To view the project properties right click on the peripheral_tests_0 project and select Properties. Expand C/C++ Build and select Settings to view all the build options. Click Cancel to exit. 13. The system contains internal BRAM memory as well as external DDR memory. We can select where the code will be physically located through a linker script. Right-click on the peripheral_tests_0 project and select Generate Linker Script. Page 14 of 20 Spartan-6 LX9 MicroBoard Embedded Tutorial 14. Use the drop-down list to select the internal BRAM memory, microblaze_0_i_bram_ctrl_microblaze_0_d_bram_ctrl, for all the code sections. Click Generate then Yes. Figure 14 - Linker Script Configuration 15. It is OK to overwrite any existing linker script file. Page 15 of 20 Spartan-6 LX9 MicroBoard Embedded Tutorial IV. Test the Generated System with the Test Application The MicroBoard uses a USB-to-UART Bridge controller which is mapped to a COM port on the Windows machine. We will need to check which COM port is being used. The COM port was specified when installing the drivers for the Silicon Labs USB-to-UART Bridge. 1. Plug the MIcroBoard board into the PC. The included USB extension cable can be used if USB access is not convenient. 2. Plug the USB-UART cable between the MicroBoard and the PC. Figure 15 - Connect LX9 MicroBoard to host PC 3. Open Windows Device Manager. Select Start  Control Panel  System (System and Security for Windows 7). For WinXP, In the System Properties window, select the Hardware tab then click on Device Manager. For Windows 7, just click on Device Manager. 4. Write-down the COM port used for the Silicon Labs USB to UART Bridge. If this does not appear, ensure you have completed all the steps in the Software Requirements section. Figure 16 - COM Port Selection 5. Close the Device Manager and the System Properties window. Page 16 of 20 Spartan-6 LX9 MicroBoard Embedded Tutorial 6. In SDK, click on the Program FPGA icon a. For the Bitstream, browse to the EDK_Tutorial directory and select mb_system_top.bit b. For the BMM File, browse to the EDK_Tutorial directory and select edkBmmFile_bd.bmm c. Click on Program Figure 17 - FPGA Programming Page 17 of 20 Spartan-6 LX9 MicroBoard Embedded Tutorial 7. In the SDK Project Explorer View, right-click on the peripheral_tests_0 project and select Run As > Run Configurations. 8. Select Xilinx C/C++ ELF and click on the New Launch Configuration icon. Figure 18 - Run Configurations The Run Configuration contains settings to run the application on the target board. We will change the default settings to enable STDIO inputs and outputs on the SDK console. 9. In the SDK Run Configurations window, select the STDIO Connection tab. 10. Check the Connect STDIO to Console box. 11. Select the COM port from step 5 above and leave the BAUD Rate at 9600. 12. Click on Run. Figure 19 - STDIO Configuration Page 18 of 20 Spartan-6 LX9 MicroBoard Embedded Tutorial 13. Verify that the different peripheral print statements appear on the Hyperterminal window and that all tests pass. Figure 20 - Console View 14. Close SDK. This completes Tutorial #1 of the Spartan-6 LX9 MicroBoard Embedded Tutorial. Page 19 of 20 Spartan-6 LX9 MicroBoard Embedded Tutorial Getting Help and Support Evaluation Kit home page with Documentation and Reference Designs http://em.avnet.com/s6microboard Avnet Spartan-6 LX9 MicroBoard forum: http://community.em.avnet.com/t5/Spartan-6-LX9-MicroBoard/bd-p/Spartan-6LX9MicroBoard For Xilinx technical support, you may contact your local Avnet/Silica FAE or Xilinx Online Technical Support at www.support.xilinx.com. On this site you will also find the following resources for assistance: • Software, IP, and Documentation Updates • Access to Technical Support Web Tools • Searchable Answer Database with Over 4,000 Solutions • User Forums • Training - Select instructor-led classes and recorded e-learning options Contact Avnet Support for any questions regarding the Spartan-6 LX9 MicroBoard reference designs, kit hardware, or if you are interested in designing any of the kit devices into your next design. • http://www.em.avnet.com/techsupport You can also contact your local Avnet/Silica FAE. Page 20 of 20

Top_arrow
回到顶部
EEWORLD下载中心所有资源均来自网友分享,如有侵权,请发送举报邮件到客服邮箱bbs_service@eeworld.com.cn 或通过站内短信息或QQ:273568022联系管理员 高进,我们会尽快处理。