wiki:WARPLab/Reference/Utility

Utility Scripts

wl_setup

File source: wl_setup.m

This function should be run whenever a WARPLab release is first set up. It will ask the user a series of prompts on the MATLAB command line and, based on responses to those prompts, form a 'wl_config.ini' file inside the config directory of a WARPLab Reference Design release. Additionally, a 'wl_config.ini' file already exists in the config folder, this function will use the configuration options specified there as the default values for creating the new script. As such, if users have complex configurations that they do not want to manually recreate every time they download a new WARPLab Reference Design release, they can copy their old configuration files into the new config folder before running 'wl_setup'.

wl_config_read

File source: wl_config_read.m

This function will read the current configuration file and print its contents to the MATLAB command line.

wl_ver

File source: wl_ver.m

This function will print the version of the WARPLab framework that is currently configured in MATLAB.

wl_cmd_doc

File source: wl_cmd_doc.m

This function prints documentation for individual commands based on the command string provided as the argument. This is the same information that is present in the online command documentation. For example, typing wl_cmd_doc('write_IQ') into the MATLAB command line will print command documentation for the write_IQ command.

wl_cmd_list

File source: wl_cmd_list.m

For the 'wl_cmd_doc' function, a user must know the command string they want documentation for. This function, 'wl_cmd_list', will print the command documentation for all commands in a given class.

Examples:

String:

wl_cmd_list('wl_node')

Prints all commands/help for 'wl_node' class

Class:

wl_cmd_list(wl_node)

Prints all commands/help for 'wl_node' class

Instance:

n = wl_node;
wl_cmd_list(n)

Prints all commands/help for 'wl_node' class

wl_cmd_list(n.baseband)

Prints all commands/help for the node's baseband object

wl_initNodes

File source: wl_initNodes.m

This function is the best way to create wl_node objects and have them configured to communicate with WARP nodes in your network. There are two ways of calling wl_initNodes:

  1. Single Argument

Let N represent the number of nodes in the network. Then,

nodes = wl_initNodes(N)

will create a vector of N wl_node objects in the variable nodes

  1. Double Argument

An optional second argument can be provided to assign specific node IDs to the created wl_node objects.

nodes = wl_initNodes(N, 0:(N-1))

results in precisely the same vector of wl_node objects as the single argument case. However, the optional second argument can be changed to an other vector of IDs to speak to boards configured with those IDs on their DIP switches.

WARPLab 7.1.0 and later
With the release of WARPLab 7.1.0, wl_initNodes has been updated to also accept a vector of configuration structures generated by wl_nodesConfig. When passed a configuration structure, wl_initNodes will create wl_node objects and configure them according to the information in the structure. Please refer to the documentation on wl_nodesConfig to create a proper configuration file.

Examples:

nodesConfig = wl_nodesConfig('read', 'my_node_config_file.txt')
nodes = wl_initNodes(nodesConfig)

or

nodes = wl_initNodes( wl_nodesConfig('read', 'my_node_config_file.txt') )

will create a vector of wl_node objects in the variable nodes that contains one node per line of the configuration file.

wl_benchmark

File source: wl_benchmark.m
Versions supported: WARPLab 7.3.0 and later

With the release of WARPLab 7.3.0, wl_benchmark is now available to perform some basic WARPLab benchmarks on your system setup. The current benchmarks are:

  • Available in WARPLab 7.3.0 or later
    • Read IQ: 'read_iq'
    • Write IQ: 'write_iq'

As more benchmarks are developed, these will be added to the wl_benchmark utility. To run the utility, you must pass in:

  • Array of wl_node objects
  • Benchmark to be run
  • Number of trials to be run
  • Number of samples to be used as part of the benchmark
    • For WARP v2 hardware, this is between 1 and 16384
    • For WARP v3 hardware, this is between 1 and 32768
    • Can use the keyword 'max' to run the maximum number of samples for the hardware

For more information on the WARPLab benchmarks, please visit the Benchmarks page.

Examples:

NOTE: This was performed after running wl_setup to configure the Transport and Ethernet Packet Size.

>> nodes = wl_initNodes(1);
>> results = wl_benchmark( nodes, 'read_iq', 1000, 'max' );
------------------------------------------------------------
Running on node 1 of 1:  ID =    0  Serial Number =   W3-a-00006
------------------------------------------------------------
Displaying results of 1 nodes:

-------------------------------------------------------------------------------------------------------------
|  ID |  WLVER |    Serial # |   Transport | Pkt Size (B) | Num Samples | Num Trials |  Avg Read IQ per sec |
-------------------------------------------------------------------------------------------------------------
|   0 |  7.3.0 |  W3-a-00006 |    Java UDP |         8960 |       32768 |       1000 |              71.0523 |
-------------------------------------------------------------------------------------------------------------

or

>> nodes = wl_initNodes(1);
>> results = wl_benchmark( nodes, 'write_iq', 1000, 1000 );
------------------------------------------------------------
Running on node 1 of 1:  ID =    0  Serial Number =   W3-a-00006
------------------------------------------------------------
Displaying results of 1 nodes:

-------------------------------------------------------------------------------------------------------------
|  ID |  WLVER |    Serial # |   Transport | Pkt Size (B) | Num Samples | Num Trials | Avg Write IQ per sec |
-------------------------------------------------------------------------------------------------------------
|   0 |  7.3.0 |  W3-a-00006 |    Java UDP |         1464 |        1000 |       1000 |             330.0903 |
-------------------------------------------------------------------------------------------------------------
Last modified 5 years ago Last modified on Aug 22, 2013, 4:01:47 PM