wiki:WARPLab/QuickStart

Version 30 (modified by murphpo, 11 years ago) (diff)

--

Quick Start

System Requirements


Setting up the WARPLab 7 Framework

  1. Download the latest WARPLab Reference Design Release (Download) and unzip it to a location of your choosing.
  2. Open MATLAB and change the current path to the M_Code_Reference directory from the downloaded archive.
  3. Run wl_setup on the MATLAB command line.
  4. Follow the prompts to configure your WARPLab environment.


Hardware Setup

  • For your PC:
    1. Assign one of your NICs to the manual IP address specified in the wl_setup step above (default 10.0.0.250)
    2. Connect the NIC to a 1Gb Ethernet switch
  • For WARP v3 nodes:
    1. Connect ETH_A to the 1Gb Ethernet switch your PC is connected to.
    2. Set the user DIP switch to a unique value on each node, starting at 0
    3. Configure the FPGA with the Reference Design. The reference bitstreams are included in the Bitstreams_Reference folder from the downloaded archive. Find the bitstream appropriate for your hardware and program the .bit file to the board using the Xilinx iMPACT tool. The .bin file can be used to configure an SD card with the design (see the SD config howto for help using the .bin file).
      1. On boot each node will display its node ID on the right hex display
      2. The bottom green LED will blink until the Ethernet link is up
      3. All four green LEDs will blink when the node is ready to accept commands from MATLAB


Examples

  1. Confirm everything is ready by copying and pasting the following lines to the MATLAB command line:
    clear
    N = 1;
    nodes = wl_initNodes(N);
    wl_nodeCmd(nodes,'identify');
    disp(nodes)
    

Note: N can be changed to the number of nodes in your network. When you run these lines of code, you should see the User I/O LEDs on your N nodes blink as a result of the identify command. Additionally, you should see your nodes object vector print status messages to the screen. For N = 2, your status display should be similar to:

Displaying properties of 2 wl_node objects:
|  ID |  WLVER |  HWVER |    Serial # |  Ethernet MAC Addr |
------------------------------------------------------------
|   0 |  7.0.0 |      3 |  W3-a-00027 |  40-D8-55-04-20-36 |
------------------------------------------------------------
|   1 |  7.0.0 |      3 |  W3-a-00041 |  40-D8-55-04-20-52 |
------------------------------------------------------------
  1. If the previous stepped work, you should now try one of the M-Code Examples.


Getting Help

There are a few resources for getting help with using WARPLab for your own designs:

  1. The wl_cmd_list is a function that allows you to display all commands than an object supports.
  2. The wl_cmd_doc is a function that will display documentation for a particular command.
  3. The WARP forums (http://warpproject.org/forums/) are a great place to ask questions.


Additional Tools

WARPLab MEX UDP Transport (WARPLab 7.3.0 and later)

By default, WARPLab will use built-in java routines for performing network I/O. However, this has some performance limitations as can be seen by our Read IQ / Write IQ benchmarks. Therefore, we have developed a custom WARPLab MEX UDP transport in order to provide a high performance transport for data transfer operations. The WARPLab MEX UDP transport can provide dramatically faster performance while leaving the usage of WARPLab otherwise identical.

To install the WARPLab MEX UDP Transport, please perform the following steps:

NOTE: Make sure your repository is updated to the WARPLab 7.3.0 (or later) release. The repository contains a compiled binary for Windows 7 64-bit. For other platforms, compile the wl_mex_udp_transport mex function (see How-To Compile MEX for more information).

  1. Locate the WARPLab MEX UDP Transport source in one of the following locations:
    1. <Your Installed WARP Repository Directory>\PlatformSupport\wl_mex_udp_transport
    2. /PlatformSupport/wl_mex_udp_transport
    3. svn co http://warpproject.org/svn/WARP/PlatformSupport/wl_mex_udp_transport
  2. Add the wl_mex_udp_transport folder to your MATLAB path. The wl_mex_udp_transport folder should contain wl_mex_udp_transport.m and the wl_mex_udp_transport.mex binary (i.e. wl_mex_udp_transport.mexw64)
    addpath('<wl_mex_udp_transport folder>');
    
  3. Verify wl_mex_udp_transport is recognized by running wl_mex_udp_transport('version'); on the MATLAB command line. The output should print the version number. For example:
    >> wl_mex_udp_transport('version');
    Loaded wl_mex_udp_transport version 1.0.0a 
    WARPLab MEX UDP Transport v1.0.0a (compiled Aug 21 2013 09:46:30)
    Copyright 2013, Mango Communications. All rights reserved.
    Distributed under the WARP license:  http://warpproject.org/license  
    
  4. Re-run the wl_setup function in M_Code_Reference. One prompt will be to select which type of transport you want to use. If you have added a compatible, compiled wl_mex_udp_transport to your path, the script will list it as an option you can select.

NOTE: simply re-running 'wl_setup' and selecting java is sufficient for switching back to the built-in java routines. You do not need to explicitly remove wl_mex_udp_transport from your MATLAB path.


Other Information

pnet Toolbox

NOTE: The PNET toolbox will not be supported in WARPLab 7.4.0 or later.

By default, WARPLab will use built-in java routines for performing network I/O. pnet, a custom UDP mex toolbox for matlab, is also supported, but the latest version is required. pnet can offer modestly higher performance than the built-in java routines, but the usage of WARPLab is otherwise identical. Note: these performance gains are negligible for jumbo frame packets near 9000 bytes on length. If you want to use pnet, please perform the following steps:

  1. Install the updated pnet IP/UDP toolbox for MATLAB
    1. Checkout the source from /PlatformSupport/pnet (or svn co http://warpproject.org/svn/WARP/PlatformSupport/pnet)
      • The repository contains a compiled binary for Windows 7 64-bit
      • For other platforms, compile the pnet mex function
    2. Add the pnet folder to your MATLAB path. The pnet folder should contain pnet.m and th pnet.mex binary (i.e. pnet.mexw64)
    3. Verify pnet is recognized by running pnet('version'); on the MATLAB command line. The output should print the version number.
    4. Re-run the wl_setup function in M_Code_Reference. The final prompt will be to select which type of transport you want to use. If you have added a compatible, compiled pnet to your path, the script will list it as an option you can select. Note: simply re-running 'wl_setup' and selecting java is sufficient for switching back to the built-in java routines. You do not need to explicitly remove pnet from your MATLAB path.