Changes between Initial Version and Version 1 of OFDMReferenceDesign/SDK/SDK_Project_Creation


Ignore:
Timestamp:
Aug 22, 2012, 10:46:24 AM (12 years ago)
Author:
murphpo
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • OFDMReferenceDesign/SDK/SDK_Project_Creation

    v1 v1  
     1== Creating the OFDM ref design SDK project ==
     2
     3The goal of this flow is to create an SDK workspace which:
     4 * References the OFDM ref design XPS project for the hw specification
     5 * Includes a single BSP referring to the XPS project, including drivers for custom pcores
     6 * Includes multiple software projects (one per MAC) which refer to a common WARPMAC codebase
     7
     8----
     9
     10=== SDK Workspace, hardware and BSP projects ===
     11 * Copy the fully-built XPS project to a folder with the desired name (like {{{OFDM_RefDesign_FPGAv2_v17.0}}}). I'll call this name {{{<xps_proj>}}} below.
     12 * Delete the {{{<xps_proj>/SDK/SDK_Export}}} folder, if it exists (this will force XPS to create a hardware spec using your chosen {{{<xps_proj>}}} folder name).
     13 * Create the folder {{{<xps_proj>/SDK/SDK_Workspace}}}
     14 * Launch SDK and choose {{{<xps_proj>/SDK/SDK_Workspace}}} as the workspace
     15 * Open Xilinx Tools->Repositories and add {{{<xps_proj>}}} as a Local Repository. Unfortunately it will be recorded as an absolute path. This is unavoidable in 13.4.
     16 * Close SDK
     17 * In the workspace folder ({{{<xps_proj>/SDK/SDK_Workspace}}}) create the folder structure below. If you draw from SVN, make sure to export (not checkout) to avoid .svn metadata folders.
     18{{{
     19{{{<xps_proj>/SDK/SDK_Workspace}}}/
     20 |- .metadata/   <-Created by SDK; don't touch
     21 |- src/
     22    |- WARPMAC/
     23       |- warpmac.{c,h}
     24       |- warpphy.{c,h}
     25       |- warpnet.{c,h}
     26       |- util/
     27          |- *.h (various reg macro headers)
     28    |- MAC/
     29       |- NOMAC/
     30          |- nomac.{c,h}
     31       |- CSMAMAC/
     32          |- csmamac.{c,h}
     33}}}
     34       
     35 * Close SDK
     36 * In XPS, Export Design, and Export & Launch SDK
     37 * SDK will launch; choose {{{<xps_proj>/SDK/SDK_Workspace}}} as you workspace
     38 * Run File->New Xilinx BSP
     39    * Give the BSP a useful name (like {{{OFDM_RefDesign_FPGAv2_bsp}}}). For better portability of software projects, avoid encoding any version numbers in the BSP project name.
     40    * Check that the right Hardware Platform is selected (the one XPS just created should be pre-selected).
     41    * Choose standalone for the OS
     42    * Click Finish
     43 * The BSP settings dialog will then show. Apply these settings:
     44   * Overview: Enable WARP_FPGA_BOARD_LIB, change to version 2.20.a
     45   * standalone: Choose the desired UART for stdin/stdout (rs232_db9 by default)
     46   * drivers: Confirm correct driver and driver version is assigned for all custom pcores (ofdm_txrx, ofdm_agc, etc.). Double-check the versions- the defaults are often wrong. For Sysgen-created pcores the driver version should match the hardware version specified in the XPS project MHS file.
     47   * Click OK
     48 * The BSP software should automatically build. If it works the log will show {{{'Finished building libraries'}}}.
     49
     50----
     51=== Software Projects ===
     52If your BSP project name is the same as in an existing OFDM ref design SDK project, you can import the NoMAC/CSMAMAC software projects into the new SDK workspace (either copy the projects manually or import+copy from the other workspace directory).
     53
     54Otherwise follow the steps below to create the MAC software projects from scratch. Both projects will refer to code in the {{{src}}} folder described above.
     55
     56'''NOMAC'''
     57 * Create an empty Xilinx C project named {{{NoMAC}}}; target the existing BSP
     58 * In the new project, delete src/README.txt
     59 * In the new project, right-click, New->Folder
     60   * Choose the NoMAC C project as parent
     61   * Name the folder {{{WARPMAC}}}
     62   * Under Advanced:
     63      * Set type to Linked Folder
     64      * Set path to {{{WORKSPACE_LOC/src/WARPMAC}}}
     65   * Click Resource Filters, Add
     66      * Filter Type = Include only, Applies to = Files, Recursive = checked
     67      * Attributes: Name matches *.c
     68   * Click Resource Filters, Add
     69      * Filter Type = Include only, Applies to = Files, Recursive = checked
     70      * Attributes: Name matches *.h
     71   * OK/Finish back to workspace
     72 * The project will build, terminating in an error {{{undefined reference to 'main'}}}
     73 * In the new project, right-click, New->Folder
     74   * Choose the NoMAC C project as parent
     75   * Name the folder {{{NOMAC}}}
     76   * Under Advanced:
     77      * Set type to Linked Folder
     78      * Set path to {{{WORKSPACE_LOC/src/MAC/NOMAC}}}
     79   * OK/Finish back to workspace
     80 * The project will re-build, terminating in errors for missing includes/defines
     81 * Right click the project, choose Properties
     82   * Expand {{{C/C++ General}}}->{{{Paths and Symbols}}}
     83   * Add a new Include path
     84     * Check "Add to all configurations"
     85     * Click Workspace
     86     * Choose NOMAC->WARPMAC
     87   * OK back to workspace
     88   * Click Yes if prompted to re-index the source code
     89 * The project will now build to completion, printing {{{elfcheck passed}}}.
     90 * Right click on the project, choose Generate Linker Script
     91   * Assign Code Sections to iocm, Data sections to docm, Heap/Stack to xps_bram_if_cntlr_1
     92   * Confirm nothing is assigned to xps_bram_if_cntlr_2 (this memory maps to the PHY packet buffers)
     93   * Change Heap/Stack sizes to 4096 (4K)
     94   * Click Generate; click Yes to overwrite existing linker script
     95 * Open project properties again, expand {{{Run/Debug Settings}}}
     96   * Click New, choose "Xilinx C/C++ ELF"
     97     * Name = {{{NoMAC}}}
     98     * Main: Leave defaults
     99     * Device Initialization: Uncheck "Verify ELF"
     100     * Debugger Options: Set the ISOCM field to:
     101{{{
     1020x00000000 isocmsize 65536 isocmdcrstartadr 0x100
     103}}}
     104     * Common:
     105       * Under "Display in favorites menu" check "Run" and "Debug"
     106       * Under "Standard Input/Output" uncheck "Allocate Console"
     107   * OK back to workspace
     108 * Project should now re-build, succeeding with {{{elfcheck passed}}}.
     109
     110'''Adding Additional MAC Projects'''
     111 * Create an empty Xilinx C project named {{{TheMAC}}}; target the existing BSP
     112 * Ctrl-drag WARPMAC folder from NoMAC project to TheMAC project
     113 * Repeat the new linked NOMAC folder steps above for TheMAC source
     114 * Repeat the linker script and project options steps from NoMAC above
     115
     116----
     117
     118=== Wrapping Up ===
     119At this point you have a fully working OFDM reference design XPS + SDK project. But it's not quite ready to distribute.
     120
     121'''Export launch configs'''
     122 * In SDK choose File->Export, Run/Debug->Launch Configurations
     123 * Click Next
     124 * Expand Xilinx C/C++ ELF
     125 * Check NOMAC and CSMAMAC (and any other MACs you're bundling with the ref design)
     126 * Set location to {{{<xps_proj>/SDK/SDK_Workspace/__import-then-delete}}}
     127 * Click Finish
     128
     129At this point I suggest copying the full XPS project ({{{<xps_proj>/}}} to a new directory. Be sure to keep the name of the XPS project folder the same (XPS uses this name when generating the hardware spec during SDK export). This way  you'll have an un-cleaned project to revert back to later.
     130
     131'''Cleaning up'''
     132 * Close XPS and SDK
     133 * In the new copy of the XPS project, delete these files and folders:
     134{{{
     135__xps
     136implementation/
     137hdl/
     138synthesis/
     139*.log
     140*.log.bak
     141}}}
     142 * Delete the folder {{{SDK/SDK_Workspace/.metadata/}}}
     143 * You should be left with an XPS project folder containing:
     144{{{
     145data/
     146etc/
     147pcores/
     148SDK/
     149 |- SDK_Export/
     150 |- SDK_Workspace/
     151platgen.opt
     152system.make
     153system.mhs
     154system.xmp
     155system_incl.make
     156}}}
     157 * From the XPS project root folder, select all and Send To Compressed Folder; name it per our usual scheme {{{OFDM_RefDesign_FPGAvX_vY.Z.zip}}} (i.e. {{{OFDM_RefDesign_FPGAv2_v17.0.zip}}})
     158 * Post that .zip file
     159
     160----
     161=== Using the OFDM ref design .zip ===
     162Before using a WARP reference design XPS or SDK project you must setup the environment (link to wiki page with tools versions requirements, svn checkout instructions, XPS/SDK edk_user_repository setting).
     163
     164'''Getting the project files'''
     165 * Download the reference design .zip file
     166 * Expand its contents to a path with no spaces; {{{C:\work\WARP\OFDM_RefDesign_FPGAv2_v17.0}}} is a good example
     167
     168'''Using the XPS project'''
     169The ref design XPS project is at the root of the expanded .zip file, in the directory with the {{{system.xmp}}} and {{{system.mhs}}} files. Open {{{system.xmp}}} in XPS to explore or modify the XPS project.
     170
     171'''Using the SDK project'''
     172Using the SDK requires configuring a workspace. Unfortunately workspaces are not portable. The ref design .zip file contains all the necessary project files to populate a workspace, but you must initialize your workspace first and import these project files manually.
     173
     174In the instructions below we'll use {{{<xps_proj>}}} to represent the path where you expanded the ref design .zip. If the XPS project file is in {{{C:\work\WARP\OFDM_RefDesign_FPGAv2_v17.0\system.xmp}}}, then you should use {{{C:\work\WARP\OFDM_RefDesign_FPGAv2_v17.0\}}} in place of {{{<xps_proj>}}} below.
     175 * Launch the Xilinx SDK
     176   * If prompted to select a workspace, choose {{{<xps_proj>/SDK/SDK_Workspace}}}
     177   * If not, choose File->Switch Workspace, then choose {{{<xps_proj>/SDK/SDK_Workspace}}}
     178 * Choose Xilinx Tools->Repositories
     179   * Verify the WARP edk_user_repository is listed in the Global Repositories section
     180   * In Local Repositories, click New, then navigate to {{{<xps_proj>}}}. Be sure to select the XPS project folder, not any of the folders above/below that.
     181   * Click OK
     182 * Choose File->Import; expand General; choose Existing Projects into Workspace; click Next
     183 *