[[TracNav(WARPLab/TOC)]] = Utility Scripts = == wl_setup == File source: [browser:ResearchApps/PHY/WARPLAB/WARPLab7/M_Code_Reference/wl_setup.m 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: [browser:ResearchApps/PHY/WARPLAB/WARPLab7/M_Code_Reference/util/wl_config_read.m 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: [browser:ResearchApps/PHY/WARPLAB/WARPLab7/M_Code_Reference/util/wl_ver.m wl_ver.m] This function will print the version of the WARPLab framework that is currently configured in MATLAB. == wl_cmd_doc == File source: [browser:ResearchApps/PHY/WARPLAB/WARPLab7/M_Code_Reference/util/wl_cmd_doc.m 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 [wiki:../Commands the online command documentation]. For example, typing {{{wl_cmd_doc('write_IQ')}}} into the MATLAB command line will print command documentation for the [wiki:../Commands/Baseband#write_iq write_IQ] command. == wl_cmd_list == File source: [browser:ResearchApps/PHY/WARPLAB/WARPLab7/M_Code_Reference/util/wl_cmd_list.m 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: [browser:ResearchApps/PHY/WARPLAB/WARPLab7/M_Code_Reference/util/wl_initNodes.m wl_initNodes.m] This function is the best way to create [wiki:../Architecture/Classes#Node 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}}} 2. 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 '''[[BR]] With the release of WARPLab 7.1.0, wl_initNodes has been updated to also accept a vector of configuration structures generated by [wiki:WARPLab/Reference/NodesConfig wl_nodesConfig]. When passed a configuration structure, wl_initNodes will create [wiki:../Architecture/Classes#Node wl_node] objects and configure them according to the information in the structure. Please refer to the documentation on [wiki:WARPLab/Reference/NodesConfig 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: [browser:ResearchApps/PHY/WARPLAB/WARPLab7/M_Code_Reference/util/wl_benchmark.m wl_benchmark.m][[BR]] 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 [wiki:../Architecture/Classes#Node 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 [wiki:WARPLab/Benchmarks Benchmarks] page. Examples: NOTE: This was performed after running [wiki:WARPLab/Reference/Utility#wl_setup wl_setup] to configure the [wiki:WARPLab/Framework/Modules#Transport 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 | ------------------------------------------------------------------------------------------------------------- }}}