Changes between Initial Version and Version 1 of WARPLab/Reference/Baseband/Buffers


Ignore:
Timestamp:
May 15, 2013, 5:07:14 PM (11 years ago)
Author:
chunter
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WARPLab/Reference/Baseband/Buffers

    v1 v1  
     1[[TracNav(WARPLab/TOC)]]
     2
     3= Baseband Buffers Module Implementation =
     4
     5The WARPLab Reference Design implements a [wiki:../../Framework/Modules#Baseband Baseband] module that buffers incoming and outgoing samples from radio interfaces. It supports up to 4 interfaces, including both I/Q and RSSI. On WARP v3 hardware, each buffer is 2^15 samples long. On WARP v2 hardware, each buffer is 2^14 samples long.
     6
     7= Baseband Commands =
     8
     9Baseband commands are selected as string inputs to the {{{wl_basebandCmd}}} method in [browser:ResearchApps/PHY/WARPLAB/WARPLab7/M_Code_Reference/classes/wl_node.m wl_node.m]. These strings are each individual cases of the switch statement in {{{procCmd}}} method of [browser:ResearchApps/PHY/WARPLAB/WARPLab7/M_Code_Reference/classes/wl_baseband_buffers.m wl_baseband_buffers.m].
     10
     11== Syntax ==
     12MATLAB allows two valid forms of syntax for calling methods
     13
     14 * Let {{{N}}} be a scalar or vector of {{{wl_node}}} objects
     15 * Let {{{command_string}}} be a string containing a particular command
     16 * Let {{{arg}}} be an argument for that command (optional)
     17
     18Syntax 1: {{{wl_basebandCmd(N, command_string, arg1, arg2, ..., argN)}}}
     19
     20Syntax 2: {{{N.wl_basebandCmd(command_string, arg1, arg2, ..., argN)}}}
     21
     22These two different forms of syntax are identical and either may be used for issuing commands to WARP nodes.
     23
     24=== Optional Buffer Selection Syntax ===
     25
     26Some baseband commands require the selection of one or more buffers. This requirement is specified in the below documentation with {{{Requires BUFF_SEL:}}}. If a command requires a buffer selection, then the following syntaxes are valid:
     27
     28 * Let {{{buffer_selection}}} be a collection of interfaces or the string {{{'RF_ALL'}}}
     29
     30Syntax 1: {{{wl_interfaceCmd(N, buffer_selection, command_string, arg1, arg2, ..., argN)}}}
     31
     32Syntax 2: {{{N.wl_interfaceCmd(buffer_selection, command_string, arg1, arg2, ..., argN)}}}
     33
     34
     35== Command List and Documentation ==
     36=== {{{tx_delay}}} ===
     37Transmit delay- gets or sets the number of sample periods the baseband [[BR]]
     38waits between the trigger and starting the transission[[BR]]
     39
     40
     41'''Requires BUFF_SEL:''' No
     42
     43'''Arguments:''' none or (uint32 TX_DLY)
     44
     45'''Returns:''' (uint32 TX_DLY) or none
     46
     47If an argument is specified, this command enters a write mode where[[BR]]
     48that argument is written to the board. If no argument is specified,[[BR]]
     49the current value of TX_DLY is read from the board.[[BR]]
     50
     51
     52=== {{{tx_length}}} ===
     53Transmit length- reads or sets the duration of each transmit cycle, in sample periods [[BR]]
     54
     55
     56'''Requires BUFF_SEL:''' No
     57
     58'''Arguments:''' none or (uint32 TX_LEN)
     59
     60'''Returns:''' (uint32 TX_LEN) or none
     61
     62If an argument is specified, this command enters a write mode where[[BR]]
     63that argument is written to the board. If no argument is specified,[[BR]]
     64the current value of TX_LEN is read from the board.[[BR]]
     65
     66
     67=== {{{rx_length}}} ===
     68Receive length- reads or sets the duration of each receive cycle, in sample periods [[BR]]
     69
     70
     71'''Requires BUFF_SEL:''' No
     72
     73'''Arguments:''' none or (uint32 RX_LEN)
     74
     75'''Returns:''' (uint32 RX_LEN) or none
     76
     77If an argument is specified, this command enters a write mode where[[BR]]
     78that argument is written to the board. If no argument is specified,[[BR]]
     79the current value of RX_LEN is read from the board.[[BR]]
     80
     81
     82=== {{{continuous_tx}}} ===
     83Enable/disable continuous transmit mode[[BR]]
     84
     85
     86'''Requires BUFF_SEL:''' No
     87
     88'''Arguments:''' (boolean CONT_TX)
     89CONT_TX:[[BR]]
     90true enables continuous transmit mode[[BR]]
     91false disable continuous transmit mode[[BR]]
     92
     93'''Returns:''' none
     94
     95
     96=== {{{tx_buff_en}}} ===
     97Enable transmit buffer for one or more interfaces. When a buffer is enabled it will[[BR]]
     98drive samples into its associated interface when a trigger is received. The interface[[BR]]
     99itself must also be enabled (wl_interfaceCmd(...,'tx_en')) to actually transmit the samples[[BR]]
     100
     101
     102'''Requires BUFF_SEL:''' Yes
     103
     104'''Arguments:''' none
     105
     106'''Returns:''' none
     107
     108
     109=== {{{rx_buff_en}}} ===
     110Enable receive buffer for one or more interfaces. When a buffer is enabled it will[[BR]]
     111capture samples from its associated interface when a trigger is received. The interface[[BR]]
     112itself must also be enabled (wl_interfaceCmd(...,'rx_en'))[[BR]]
     113
     114
     115'''Requires BUFF_SEL:''' Yes
     116
     117'''Arguments:''' none
     118
     119'''Returns:''' none
     120
     121
     122=== {{{tx_rx_buff_dis}}} ===
     123Disable the Tx and Rx buffers for one or more interfaces. When a buffer is disabled it will not[[BR]]
     124output/capture samples when a trigger is received, even if the associated interface is enabled[[BR]]
     125
     126
     127'''Requires BUFF_SEL:''' Yes
     128
     129'''Arguments:''' none
     130
     131'''Returns:''' none
     132
     133
     134=== {{{tx_buff_clk_freq}}} ===
     135Read the transmit sample clock frequency out of the buffer core.[[BR]]
     136
     137
     138'''Requires BUFF_SEL:''' No
     139
     140'''Arguments:''' none
     141
     142'''Returns:''' (uint32 Fs_Tx)
     143Fs_Tx: Tx sample frequency of buffer core in Hz[[BR]]
     144
     145
     146=== {{{rx_buff_clk_freq}}} ===
     147Read the receive sample clock frequency out of the buffer core.[[BR]]
     148
     149
     150'''Requires BUFF_SEL:''' No
     151
     152'''Arguments:''' none
     153
     154'''Returns:''' (uint32 Fs_Rx)
     155Fs_Rx: Rx sample frequency of buffer core in Hz[[BR]]
     156
     157
     158=== {{{rx_rssi_clk_freq}}} ===
     159Read the receive RSSI sample clock frequency out of the buffer core.[[BR]]
     160
     161
     162'''Requires BUFF_SEL:''' No
     163
     164'''Arguments:''' none
     165
     166'''Returns:''' (uint32 Fs_RxRSSI)
     167Fs_RxRSSI: Rx RSSI sample frequency of buffer core in Hz[[BR]]
     168
     169
     170=== {{{write_iq}}} ===
     171Write I/Q samples to the specified buffers. The dimensions of the buffer selection and samples matrix[[BR]]
     172must agree. The same samples can be written to multiple buffers by combining buffer IDs[[BR]]
     173
     174
     175'''Requires BUFF_SEL:''' Yes (combined BUFF_SEL values ok)
     176
     177'''Arguments:''' (complex double TX_SAMPS, int OFFSET)
     178TX_SAMPS: matrix of complex samples. The number of columns must match the length of BUFF_SEL[[BR]]
     179OFFSET: buffer index of first sample to write (optional; defaults to 0)[[BR]]
     180
     181Examples:[[BR]]
     182{{{
     183TxLength = 2^14;
     184Ts = 1/(wl_basebandCmd(node0,'tx_buff_clk_freq'));
     185t = [0:Ts:(TxLength-1)*Ts].'; %column vector
     186X = exp(t*1i*2*pi*3e6); %3MHz sinusoid
     187Y = exp(t*1i*2*pi*5e6); %5MHz sinusoid
     188
     189%Write X to RFA
     190wl_basebandCmd(node, RFA, 'write_iq', X);
     191
     192%Write X to RFA and RFB
     193wl_basebandCmd(node, RFA+RFB, 'write_iq', X);
     194
     195%Write X to RFA, Y to RFB
     196wl_basebandCmd(node, [RFA RFB], 'write_iq', [X Y]);
     197}}}
     198
     199=== {{{read_iq}}} ===
     200Read I/Q samples from the specified buffers. The elements of the buffer selection must be scalers which[[BR]]
     201identify a single buffer. To read multiple buffers in one call, pass a vector of individual buffer IDs[[BR]]
     202
     203
     204'''Requires BUFF_SEL:''' Yes (combined BUFF_SEL values not allowed)
     205
     206'''Arguments:''' (int OFFSET, int NUM_SAMPS)
     207OFFSET: buffer index of first sample to read (optional; defaults to 0)[[BR]]
     208NUM_SAMPS: number of complex samples to read (optional; defaults to length(OFFSET:rxIQLen-1))[[BR]]
     209
     210Examples:[[BR]]
     211{{{
     212%Read full buffer for RFA
     213%size(X) will be [rxIQLen, 1]
     214X = wl_basebandCmd(node, RFA, 'read_iq');
     215
     216%Read partial buffer for RFA (samples 1000:4999)
     217%size(X) will be [5000, 1]
     218X = wl_basebandCmd(node, RFA, 'read_iq', 1000, 5000);
     219
     220%Read full buffers for RFA and RFB
     221%size(X) will be [rxIQLen, 2]
     222X = wl_basebandCmd(node, [RFA RFB], 'read_iq');
     223}}}
     224
     225=== {{{read_rssi}}} ===
     226Read RSSI samples from the specified buffers. The elements of the buffer selection must be scalers which[[BR]]
     227identify a single buffer. To read multiple buffers in one call, pass a vector of individual buffer IDs.[[BR]]
     228
     229See 'read_iq' for arguments/returns[[BR]]
     230
     231
     232=== {{{agc_state}}} ===
     233Read AGC state from the specified buffers. The elements of the buffer selection must be scalers which[[BR]]
     234identify a single buffer. To read multiple buffers in one call, pass a vector of individual buffer IDs[[BR]]
     235
     236
     237'''Requires BUFF_SEL:''' Yes (combined BUFF_SEL values not allowed)
     238
     239'''Arguments:''' none
     240
     241
     242'''Returns:''' agc_state -- column vector per buffer BUFF_SEL
     243
     244agc_state(1): RF gain chosen by AGC[[BR]]
     245agc_state(2): BB gain chosen by AGC[[BR]]
     246agc_state(3): RSSI observed by AGC at time of lock[[BR]]
     247
     248
     249=== {{{agc_thresh}}} ===
     250Read or write AGC threshold.[[BR]]
     251
     252
     253'''Requires BUFF_SEL:''' No
     254
     255'''Arguments:'''  none or (int32 thresh1), (int32 thresh2), (int32 thresh3)
     256
     257'''Returns:''' (int32 thresh1), (int32 thresh2), (int32 thresh3) or none
     258
     259If arguments are specified, this command enters a write mode where[[BR]]
     260those arguments are written to the board. If no arguments are specified,[[BR]]
     261the current values of agc thresholds are read from the board.[[BR]]
     262
     263thresh1: receive power (in dBm) under which AGC will not[[BR]]
     264attempt to change gains[[BR]]
     265default value: -90[[BR]]
     266
     267thresh2: receive power (in dBm) under which AGC will select[[BR]]
     268high RF gain (RF Gain 3)[[BR]]
     269default value: -53[[BR]]
     270
     271thresh3: receive power (in dBm) under which AGC will select[[BR]]
     272medium RF gain (RF Gain 2). Above this receive power[[BR]]
     273the AGC will select low RF gain (RF Gain 1)[[BR]]
     274default value: -43[[BR]]
     275
     276Default known-good values for this threshold are derived from[[BR]]
     277the MAX2829 datasheet (bottom, middle plot on page 16).[[BR]]
     278These default values are (-90,-53,-43)dBm. There is no reason[[BR]]
     279to call this command unless changing from these defaults is desired.[[BR]]
     280
     281
     282=== {{{agc_target}}} ===
     283Set the AGC target[[BR]]
     284
     285
     286'''Requires BUFF_SEL:''' No. Values apply to all RF paths
     287
     288'''Arguments:''' (int32 target)
     289target: target receive power (in dBm)[[BR]]
     290default value: -10[[BR]]
     291
     292'''Returns:''' none
     293
     294This command is the best way to tweak AGC behavior[[BR]]
     295to apply more or less gain. For example, a target of[[BR]]
     296-5dBm will apply more gain thatn a target of -10dBm,
     297so the waveform will be larger at the inputs of the I[[BR]]
     298and Q ADCs.[[BR]]
     299
     300
     301=== {{{agc_noise_est}}} ===
     302Set the AGC noise estimate[[BR]]
     303
     304
     305'''Requires BUFF_SEL:''' No. Values apply to all RF paths
     306
     307'''Arguments:''' (int32 noise_estimate)
     308noise_estimate: rx noise power (in dBm)[[BR]]
     309default value: -95[[BR]]
     310
     311'''Returns:''' none
     312
     313
     314=== {{{agc_dco}}} ===
     315Enable/disable DC offset correction[[BR]]
     316
     317
     318'''Requires BUFF_SEL:''' No
     319
     320'''Arguments:''' (boolean DCO)
     321DCO:[[BR]]
     322true enables DC offset correction[[BR]]
     323false disable DC offset correction[[BR]]
     324
     325'''Returns:''' none
     326
     327
     328=== {{{agc_trig_delay}}} ===
     329Sets the AGC trigger delay. The argument specifies a[[BR]]
     330delay (in number of cycles) that the AGC should wait[[BR]]
     331before beginning its processing after the node[[BR]]
     332receives a trigger.[[BR]]
     333
     334
     335'''Requires BUFF_SEL:''' No. Values apply to all RF paths
     336
     337'''Arguments:''' (uint16 trigger_delay)
     338trigger_delay: # if cycles of delay after trigger[[BR]]
     339valid range: ![0,511][[BR]]
     340
     341'''Returns:''' none
     342
     343
     344=== {{{agc_reset}}} ===
     345Resets the AGC to its default state[[BR]]
     346
     347
     348'''Requires BUFF_SEL:''' No. Values apply to all RF paths
     349
     350'''Arguments:''' none
     351
     352'''Returns:''' none
     353
     354
     355=== {{{agc_done_addr}}} ===
     356Sample index where AGC finished[[BR]]
     357
     358
     359'''Requires BUFF_SEL:''' No. Values apply to all RF paths
     360
     361'''Arguments:'''
     362
     363'''Returns:''' (uint32) sample_index