Changes between Version 5 and Version 6 of WARPLab/Porting


Ignore:
Timestamp:
May 19, 2013, 9:02:26 PM (11 years ago)
Author:
murphpo
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WARPLab/Porting

    v5 v6  
    8484
    8585----
    86 '''Writing Samples''': WARPLab 7 enables setting the same RF and baseband parameters as previous versions. However the syntax for sending commands to nodes has changed. The new syntax allows the same command to be sent to multiple nodes in one line. Each node can be assigned the same parameter value, or multiple values (one per node) can be passed as an array argument. The example below shows equivalent code for setting a few parameters for two nodes.
     86'''Writing Samples''': Vectors of samples are constructed in MATLAB and written to buffers assigned to specific RF interfaces on the WARP nodes. In WARPLab 7 the buffer selection is parametric, simplifying the processing of iterating over nodes and interfaces, switching interfaces programmatically, etc. The example below illustrates how different waveforms can be written to multiple interfaces in one line. For complete documentation of the {{{write_iq}}} command, refer to the [wiki:../Reference/Baseband/Buffers#write_iq command documentation].
    8787
    8888{{{#!html
     
    116116%WARPLab 7
    117117
    118 %Time vector (assumes 40MHz sampling rate)
    119 t = (1/40e6) .* [0 : 2^14-1];
     118%Time column vector (assumes 40MHz sampling rate)
     119t = (1/40e6) .* [0 : 2^14-1].';
    120120
    121121%Generate a 1MHz sinusoid
     
    135135}}}
    136136
    137 
     137----
     138'''Tx/Rx Cycle''': The basic flow of a Tx/Rx cycle in WARPLab 7 is unchanged:
     139 * Write samples to Tx buffers (see above)
     140 * Enable Tx radios and buffers
     141 * Enable Rx radios and buffers
     142 * Send trigger to Tx and Rx nodes
     143 * Disable Tx/Rx radios and buffers
     144 * Retrieve captured samples from Rx buffers (see below)
     145
     146The code below illustrates the updated syntax for en/disabling radios and buffers and sending triggers.
     147
     148{{{#!html
     149<table border=1 width=600><tr valign=top><td width=50% align=left>
     150}}}
     151
     152{{{
     153%WARPLab 6
     154
     155%Enable the RF transceivers
     156warplab_sendCmd(udp_node1, RADIO2_TXEN, packetNum);
     157warplab_sendCmd(udp_node1, RADIO3_TXEN, packetNum);
     158warplab_sendCmd(udp_node2, RADIO2_RXEN, packetNum);
     159warplab_sendCmd(udp_node2, RADIO3_RXEN, packetNum);
     160
     161%Enable the Tx/Rx buffers
     162warplab_sendCmd(udp_node1, RADIO2TXBUFF_TXEN, packetNum);
     163warplab_sendCmd(udp_node1, RADIO3TXBUFF_TXEN, packetNum);
     164warplab_sendCmd(udp_node2, RADIO2RXBUFF_RXEN, packetNum);
     165warplab_sendCmd(udp_node2, RADIO3RXBUFF_RXEN, packetNum);
     166
     167%Prepare nodes for trigger reception
     168warplab_sendCmd(udp_node1, TX_START, packetNum);
     169warplab_sendCmd(udp_node2, RX_START, packetNum);
     170
     171% Send the trigger
     172warplab_sendSync(udp_Sync);
     173
     174%Disable the RF transceivers
     175warplab_sendCmd(udp_node1, RADIO2_TXDIS, packetNum);
     176warplab_sendCmd(udp_node1, RADIO3_TXDIS, packetNum);
     177warplab_sendCmd(udp_node2, RADIO2_RXDIS, packetNum);
     178warplab_sendCmd(udp_node2, RADIO3_RXDIS, packetNum);
     179
     180%Disable the Tx/Rx buffers
     181warplab_sendCmd(udp_node1, RADIO2TXBUFF_TXDIS, packetNum);
     182warplab_sendCmd(udp_node1, RADIO3TXBUFF_TXDIS, packetNum);
     183warplab_sendCmd(udp_node2, RADIO2RXBUFF_RXDIS, packetNum);
     184warplab_sendCmd(udp_node2, RADIO3RXBUFF_RXDIS, packetNum);
     185
     186
     187}}}
     188
     189{{{#!html
     190</td><td width=50% align=left>
     191}}}
     192
     193{{{
     194%WARPLab 7
     195
     196%Enable the RF transceivers
     197wl_interfaceCmd(nodes(1), [RFA RFB], 'tx_en');
     198wl_interfaceCmd(nodes(2), [RFA RFB], 'rx_en');
     199
     200%Enable the sample buffers
     201wl_basebandCmd(nodes(1), [RFA RFB], 'tx_buff_en');
     202wl_basebandCmd(nodes(2), [RFA RFB], 'rx_buff_en');
     203
     204%Send the broadcast trigger
     205eth_trig.send();
     206
     207%Disable the transceivers and buffers
     208wl_basebandCmd(nodes, 'RF_ALL', 'tx_rx_buff_dis');
     209wl_interfaceCmd(nodes, 'RF_ALL', 'tx_rx_dis');
     210
     211%Retrieve the IQ and RSSI samples from the Rx node
     212rx_IQ = wl_basebandCmd(nodes(2), [RFA RFB], 'read_IQ', 0, 2^14);
     213rx_RSSI = wl_basebandCmd(nodes(2), [RFA RFB], 'read_RSSI', 0, 2^12);
     214}}}
     215
     216{{{#!html
     217</td></tr></table>
     218}}}
     219
     220
     221----
     222'''Reading Samples'': WARPLab 7 simplifies the process for reading samples from multiple nodes and multiple buffers. The example below illustrates reading IQ and RSSI samples from two interfaces (RFA and RFB) on one node.
     223
     224{{{#!html
     225<table border=1 width=600><tr valign=top><td width=50% align=left>
     226}}}
     227
     228{{{
     229%WARPLab 6
     230
     231%Retrieve and format the IQ samples from RFA and RFB
     232[Node2_Radio2_RawRxData] = warplab_readSMRO(udp_node2, RADIO2_RXDATA, 2^14);
     233[Node2_Radio2_RxData] = warplab_processRawRxData(Node2_Radio2_RawRxData);
     234[Node2_Radio3_RawRxData] = warplab_readSMRO(udp_node2, RADIO3_RXDATA, 2^14);
     235[Node2_Radio3_RxData] = warplab_processRawRxData(Node2_Radio3_RawRxData);
     236
     237%Retrieve and format the RSSI samples from RFA and RFB
     238[Node2_Radio2_RawRSSIData] = warplab_readSMRO(udp_node2, RADIO2_RSSIDATA, 2^12);
     239[Node2_Radio2_RSSIData] = warplab_processRawRSSIData(Node2_Radio2_RawRSSIData);
     240[Node2_Radio3_RawRSSIData] = warplab_readSMRO(udp_node2, RADIO3_RSSIDATA, 2^12);
     241[Node2_Radio3_RSSIData] = warplab_processRawRSSIData(Node2_Radio3_RawRSSIData);
     242
     243}}}
     244
     245{{{#!html
     246</td><td width=50% align=left>
     247}}}
     248
     249{{{
     250%WARPLab 7
     251
     252%Retrieve the IQ and RSSI samples from both interfaces on the Rx node
     253rx_IQ = wl_basebandCmd(nodes(2), [RFA RFB], 'read_IQ', 0, 2^14);
     254rx_RSSI = wl_basebandCmd(nodes(2), [RFA RFB], 'read_RSSI', 0, 2^12);
     255}}}
     256
     257{{{#!html
     258</td></tr></table>
     259}}}
     260
     261