Changes between Version 15 and Version 16 of Exercises/13_4/IntroToSDK


Ignore:
Timestamp:
Aug 15, 2012, 1:11:05 PM (12 years ago)
Author:
chunter
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Exercises/13_4/IntroToSDK

    v15 v16  
    10101. Download either the [wiki:HardwareUsersGuides/WARPv3/TemplateProjects WARP v3 "On Board Peripherals" Template Project] or the [wiki:HardwareUsersGuides/WARPv2/TemplateProjects WARP v2 "On Board Peripherals" Template Project] according to the which hardware you are using.
    11111. Extract the archive into a folder on your hard drive. Note: this folder '''must not''' contain any spaces in the path (this includes the the Windows desktop, as that lives in a folder known as "Documents and Settings").
    12 1. Rename the folder that contains the system.xmp file to remove the "_cleaned" suffix and replace it with "_helloworld." Note: because of the way the archive is constructed, the project folder may be in a subdirectory of the folder that comes out of unzipping process. Make sure to rename the lowest-level folder that contains the actual system.xmp project file.
    13 1. Launch Xilinx Platform Studio and click "Open Project." Navigate to the location of your project and open the system.xmp file in the project folder.
    14  * If this is the first time you have run XPS, you will receive a number of error messages saying that cores cannot be found. XPS must be told where to find the WARP SVN repository in order for it to find these files. In XPS, click Edit->Preferences. Then, under the "Application" category, click "Browse ..." under the "Global Peripheral Repository Search Path." Navigate to and select the "edk_user_repository" folder on your hard drive. If you do not have an "edk_user_respotory" SVN working copy, please see [wiki:edk_user_repository our SVN documentation]. After making this selection, close and reopen XPS. This step of adding the global repository path only needs to be done once per installation of the Xilinx tools.
    15 1. Once the project is open, click "Generate BitStream" under the "Hardware" menu. This step will take some time. XPS provides a busy indicator animation in the bottom right to show you that it is working on generating the bitstream. Furthermore, the "Console" tab at the bottom of the screen can be open while the bitstream is being generated. Log messages will be printed here.
    16 1. In Windows Explorer, navigate to the location of your project folder on your hard drive. Inside this project folder, you will find the system.xmp file as well as a few other folders. Create another folder at this level (e.g. the same level as "import") and name it "workspace."
    17 1. With XPS still open, launch the Xilinx SDK from the Start Menu. It will ask you to select a workspace. Click "Browse ..." and navigate to the "workspace" folder you just created. Click OK. Now close the SDK and return to XPS.
    18 1. In XPS, go to the "Project" menu item and click "Export Hardware Design to SDK..." Then, click "Export & Launch SDK." This will use the workspace you pointed to in the SDK in the previous step. Simply click "OK" at the window that pops up that asks you to select your SDK workspace.
    19 1. At this step in the process, you can close XPS. We'll be working in the SDK exclusively for the rest of the exercise.
     121. Launch the Xilinx SDK from the Start Menu. It will ask you to select a workspace. Click "Browse ..." and navigate to the "workspace" folder in the archive you just extracted. Do '''not''' check the box for "Use this as the default and do not ask again." We recommend the convention of using a single workspace per hardware project; checking this box will make this difficult. More useful tips for using the SDK are available [wiki:XilinxSDK here]. Click OK.
    20131. Rather strangely, the Xilinx SDK does not automatically know about software drivers to custom peripherals in your XPS project. You have to explicitly tell the SDK where to find your hardware project. This is a step you have to do with '''every''' new SDK workspace. In this exercise, we do not have any custom peripherals, but it is still a good habit to get into. Click on the "Xilinx Tools" menu item and select "Repositories." Here, you want to ensure two things:
    2114 * In Local Repositories, you want to point the SDK to the folder that contains the XPS project system.xmp file. Click on "New..." and navigate to and select this folder.
    2215 * In Global Repositories, you want the SDK to point to the edk_user_repository folder on your hard drive. Unlike the local repositories, the SDK does remember this setting across workspaces. You'll only need to manually add the edk_user_repository the first time you run the SDK.
    23 1. Now, we need to create what is known as a "Board Support Package" (BSP). A BSP is basically a project of supporting software for your own software project. It is a collection of drivers for peripherals in your design as well as higher-level software like a TCP/IP networking stack if you need it. Click on the button on the far left of the screen just above the "Project Explorer."
    24 [[Image(wiki:Exercises/HelloWorld/files:newbutton.jpg,nolink,valign=middle)]]
     161. In the template project you downloaded, we have provided a template software project. We now need to add it to the workspace. Click on File→Import...
     171. Click the + next to "General" and select "Existing Projects into Workspace." Then click "Next."
     181. In the "Select root directory:" click "Browse..." Then, navigate to the "workspace" folder in the extracted archive and click "OK"
     191. Three projects have now been populated in the "Projects" area of the import window. Make sure all of these are checked. Do not check "Copy projects into workspace" because these projects are already in the workspace folder. Click "Finish."
     201. The three projects now appear in the "Project Explorer" on the left of the screen:
     21 * The "*_hw_platform" contains all of the necessary hardware-specific information for the project. This includes any custom FPGA cores that the project may have. This comes from the Xilinx Platform Studio (XPS) tool. Instructions for using this tool to generate hardware platform information for the SDK is available in the [wiki:Exercises/IntroToXPS]
    2522
    26 12. Click on "Xilinx Board Support Package" and click "Next."
    27 1. Rename the project from "standalone_bsp_0" to "helloworld_bsp_0." Do not change any other setting on this page. Click "Finish."
    28 1. A new window will pop-up that allows you configure the BSP with various optional software packages. For the purposes of this exercise, the default settings are fine. Just click OK. You will see the console at the bottom of the screen start printing messages as the SDK compiles the BSP. It will end up with "Finished building libraries" printed to the console.
    29 1. We're now ready build the actual software project that will do the Hello World printing and User I/O control. Click the same "new" button above the "Project Explorer."
    30 1. Click "Xilinx C Project" and then click "Next."
    31 1. We are not going to use the Xilinx-provided "Hello World" example. Click "Empty Application" under the "Select Project Template" dialog. This will rename the project to "empty_application_0." Change that name back to "helloworld_0." Click "Next."
    32 1. We have already created a BSP, so we do not want this dialog box to make another one for us. Click the radio button next to "Target an existing Board Support Package." The "helloworld_bsp" will be automatically highlighted. Click "Finish"
    33 1. In the Project Explorer on the left side of the SDK, you will see the helloworld_0 project. Click the + next to it and it will reveal a "src" folder.
    34 1. In Windows Explorer (i.e. not in the SDK), navigate to the directory that contains the XPS project system.xmp. Then navigate to the import/WARPvX_TemplateProject_vX_sw/src" directory (where X depends on your hardware and the latest version of the template project).
    35 1. Drag the "warpvX_example.c" project into the src folder '''inside''' the SDK project explorer window under the helloworld_0 project. This will copy this source file into your SDK project.
     23
    36241. In the SDK, double click the warpvX_example.c file to open it in the editor. At this point, you can look through this source code and see that it basically will print some messages to the terminal and will count upwards, displaying the current count on the hexadecimal displays on the WARP board and the LEDs.
    37251. Right click on the helloworld_0 software project and click "Generate Linker Script." Here, we will assign instruction and data pieces of our code to various pieces of memory in our XPS hardware project. Assign the following: