Changes between Version 6 and Version 7 of WARPLab/Reference/Baseband/Buffers


Ignore:
Timestamp:
Mar 13, 2015, 12:22:49 PM (9 years ago)
Author:
welsh
Comment:

--

Legend:

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

    v6 v7  
    4343
    4444== Command List and Documentation ==
     45
    4546=== {{{tx_delay}}} ===
    46 Transmit delay- gets or sets the number of sample periods the baseband [[BR]]
    47 waits between the trigger and starting the transission[[BR]]
     47Transmit delay- gets or sets the number of sample periods the baseband waits between the trigger and starting the transission[[BR]]
    4848
    4949
     
    5454'''Returns:''' (uint32 TX_DLY) or none
    5555
    56 If an argument is specified, this command enters a write mode where[[BR]]
    57 that argument is written to the board. If no argument is specified,[[BR]]
    58 the current value of TX_DLY is read from the board.[[BR]]
     56If an argument is specified, this command enters a write mode where that argument is written to the board. If no argument is specified, the current value of TX_DLY is read from the board.[[BR]]
     57
    5958
    6059
    6160=== {{{tx_length}}} ===
    62 Transmit length- reads or sets the duration of each transmit cycle, in sample periods [[BR]]
    63 
    64 
    65 '''Requires BUFF_SEL:''' No
    66 
    67 '''Arguments:''' none or (uint32 TX_LEN)
    68 
    69 '''Returns:''' (uint32 TX_LEN) or none
    70 
    71 If an argument is specified, this command enters a write mode where[[BR]]
    72 that argument is written to the board. If no argument is specified,[[BR]]
    73 the current value of TX_LEN is read from the board.[[BR]]
     61Transmit length- sets the duration of each transmit cycle, in sample periods [[BR]]
     62
     63
     64'''Requires BUFF_SEL:''' No
     65
     66'''Arguments:''' (uint32 TX_LEN)
     67
     68'''Returns:'''   none
     69
     70NOTE:  This will error if the user tries to read tx_length from the board.  The 'tx_buff_max_num_samples' command should be used to determine the capabilities of the board.[[BR]]
     71
    7472
    7573
     
    8078'''Requires BUFF_SEL:''' No
    8179
    82 '''Arguments:''' none or (uint32 RX_LEN)
    83 
    84 '''Returns:''' (uint32 RX_LEN) or none
    85 
    86 If an argument is specified, this command enters a write mode where[[BR]]
    87 that argument is written to the board. If no argument is specified,[[BR]]
    88 the current value of RX_LEN is read from the board.[[BR]]
     80'''Arguments:''' (uint32 RX_LEN)
     81
     82'''Returns:''' none
     83
     84NOTE:  This will error if the user tries to read tx_length from the board.  The 'rx_buff_max_num_samples' command should be used to determine the capabilities of the board.[[BR]]
     85
     86
     87
     88=== {{{tx_buff_max_num_samples}}} ===
     89Maximum number of TX samples[[BR]]
     90
     91
     92'''Requires BUFF_SEL:''' Yes
     93
     94'''Arguments:''' none
     95
     96'''Returns:''' (uint32 MAX_TX_LEN)
     97
     98
     99
     100=== {{{rx_buff_max_num_samples}}} ===
     101Maximum number of RX samples[[BR]]
     102
     103
     104'''Requires BUFF_SEL:''' Yes
     105
     106'''Arguments:''' none
     107
     108'''Returns:''' (uint32 MAX_RX_LEN)
     109
    89110
    90111
     
    95116'''Requires BUFF_SEL:''' No
    96117
    97 '''Arguments:''' (boolean CONT_TX)
    98 CONT_TX:[[BR]]
    99 true enables continuous transmit mode[[BR]]
    100 false disable continuous transmit mode[[BR]]
    101 
    102 '''Returns:''' none
     118'''Arguments:''' (boolean CONT_TX)[[BR]]
     119    ''true'' - enables continuous transmit mode[[BR]]
     120    ''false'' - disable continuous transmit mode[[BR]]
     121
     122'''Returns:''' none
     123
    103124
    104125
    105126=== {{{tx_buff_en}}} ===
    106 Enable transmit buffer for one or more interfaces. When a buffer is enabled it will[[BR]]
    107 drive samples into its associated interface when a trigger is received. The interface[[BR]]
    108 itself must also be enabled (wl_interfaceCmd(...,'tx_en')) to actually transmit the samples[[BR]]
    109 
    110 
    111 '''Requires BUFF_SEL:''' Yes
    112 
    113 '''Arguments:''' none
    114 
    115 '''Returns:''' none
     127Enable transmit buffer for one or more interfaces. When a buffer is enabled it will drive samples into its associated interface when a trigger is received. The interface itself must also be enabled (wl_interfaceCmd(...,'tx_en')) to actually transmit the samples[[BR]]
     128
     129
     130'''Requires BUFF_SEL:''' Yes
     131
     132'''Arguments:''' none
     133
     134'''Returns:''' none
     135
    116136
    117137
    118138=== {{{rx_buff_en}}} ===
    119 Enable receive buffer for one or more interfaces. When a buffer is enabled it will[[BR]]
    120 capture samples from its associated interface when a trigger is received. The interface[[BR]]
    121 itself must also be enabled (wl_interfaceCmd(...,'rx_en'))[[BR]]
    122 
    123 
    124 '''Requires BUFF_SEL:''' Yes
    125 
    126 '''Arguments:''' none
    127 
    128 '''Returns:''' none
     139Enable receive buffer for one or more interfaces. When a buffer is enabled it will capture samples from its associated interface when a trigger is received. The interface itself must also be enabled (wl_interfaceCmd(...,'rx_en'))[[BR]]
     140
     141
     142'''Requires BUFF_SEL:''' Yes
     143
     144'''Arguments:''' none
     145
     146'''Returns:''' none
     147
    129148
    130149
    131150=== {{{tx_rx_buff_dis}}} ===
    132 Disable the Tx and Rx buffers for one or more interfaces. When a buffer is disabled it will not[[BR]]
    133 output/capture samples when a trigger is received, even if the associated interface is enabled[[BR]]
    134 
    135 
    136 '''Requires BUFF_SEL:''' Yes
    137 
    138 '''Arguments:''' none
    139 
    140 '''Returns:''' none
     151Disable the Tx and Rx buffers for one or more interfaces. When a buffer is disabled it will not output/capture samples when a trigger is received, even if the associated interface is enabled[[BR]]
     152
     153
     154'''Requires BUFF_SEL:''' Yes
     155
     156'''Arguments:''' none
     157
     158'''Returns:''' none
     159
    141160
    142161
     
    153172
    154173
     174
    155175=== {{{rx_buff_clk_freq}}} ===
    156176Read the receive sample clock frequency out of the buffer core.[[BR]]
     
    165185
    166186
     187
    167188=== {{{rx_rssi_clk_freq}}} ===
    168189Read the receive RSSI sample clock frequency out of the buffer core.[[BR]]
     
    177198
    178199
     200
    179201=== {{{write_iq}}} ===
    180 Write I/Q samples to the specified buffers. The dimensions of the buffer selection and samples matrix[[BR]]
    181 must agree. The same samples can be written to multiple buffers by combining buffer IDs[[BR]]
     202Write I/Q samples to the specified buffers. The dimensions of the buffer selection and samples matrix must agree. The same samples can be written to multiple buffers by combining buffer IDs[[BR]]
    182203
    183204
    184205'''Requires BUFF_SEL:''' Yes (combined BUFF_SEL values ok)
    185206
    186 '''Arguments:''' (complex double TX_SAMPS, int OFFSET)
    187 TX_SAMPS: matrix of complex samples. The number of columns must match the length of BUFF_SEL[[BR]]
    188 OFFSET: buffer index of first sample to write (optional; defaults to 0)[[BR]]
     207'''Arguments:''' (complex double TX_SAMPS, int OFFSET)[[BR]]
     208  TX_SAMPS: matrix of complex samples. The number of columns must match the length of BUFF_SEL[[BR]]
     209  OFFSET: buffer index of first sample to write (optional; defaults to 0)[[BR]]
    189210
    190211Examples:[[BR]]
     
    192213TxLength = 2^14;
    193214Ts = 1/(wl_basebandCmd(node0,'tx_buff_clk_freq'));
    194 t = [0:Ts:(TxLength-1)*Ts].'; %column vector
    195 X = exp(t*1i*2*pi*3e6); %3MHz sinusoid
    196 Y = exp(t*1i*2*pi*5e6); %5MHz sinusoid
    197 
    198 %Write X to RFA
    199 wl_basebandCmd(node, RFA, 'write_iq', X);
    200 
    201 %Write X to RFA and RFB
    202 wl_basebandCmd(node, RFA+RFB, 'write_iq', X);
    203 
    204 %Write X to RFA, Y to RFB
    205 wl_basebandCmd(node, [RFA RFB], 'write_iq', [X Y]);
     215t  = ![0:Ts:(TxLength-1)*Ts].';                      % column vector
     216X  = exp(t*1i*2*pi*3e6);                             % 3MHz sinusoid
     217Y  = exp(t*1i*2*pi*5e6);                             % 5MHz sinusoid
     218
     219% Write X to RFA
     220wl_basebandCmd(node, RFA, 'write_IQ', X);
     221
     222% Write X to RFA and RFB
     223wl_basebandCmd(node, (RFA + RFB), 'write_IQ', X);
     224
     225% Write X to RFA, Y to RFB
     226wl_basebandCmd(node, ![RFA RFB], 'write_IQ', ![X Y]);
    206227}}}
    207228
     229
     230=== {{{write_iq_checksum}}} ===
     231Write IQ checksum - gets the current Write IQ checksum from the node. [[BR]]
     232
     233
     234'''Requires BUFF_SEL:''' No
     235
     236'''Arguments:''' none
     237
     238'''Returns:''' (uint32 WRITE_IQ_CHECKSUM)
     239
     240
     241
    208242=== {{{read_iq}}} ===
    209 Read I/Q samples from the specified buffers. The elements of the buffer selection must be scalers which[[BR]]
    210 identify a single buffer. To read multiple buffers in one call, pass a vector of individual buffer IDs[[BR]]
     243Read I/Q samples from the specified buffers. The elements of the buffer selection must be scalers which identify a single buffer. To read multiple buffers in one call, pass a vector of individual buffer IDs[[BR]]
    211244
    212245
    213246'''Requires BUFF_SEL:''' Yes (combined BUFF_SEL values not allowed)
    214247
    215 '''Arguments:''' (int OFFSET, int NUM_SAMPS)
    216 OFFSET: buffer index of first sample to read (optional; defaults to 0)[[BR]]
    217 NUM_SAMPS: number of complex samples to read (optional; defaults to length(OFFSET:rxIQLen-1))[[BR]]
     248'''Arguments:''' (int OFFSET, int NUM_SAMPS)[[BR]]
     249  OFFSET: buffer index of first sample to read (optional; defaults to 0)[[BR]]
     250  NUM_SAMPS: number of complex samples to read (optional; defaults to length(OFFSET:rxIQLen-1))[[BR]]
    218251
    219252Examples:[[BR]]
    220253{{{
    221 %Read full buffer for RFA
    222 %size(X) will be [rxIQLen, 1]
    223 X = wl_basebandCmd(node, RFA, 'read_iq');
    224 
    225 %Read partial buffer for RFA (samples 1000:4999)
    226 %size(X) will be [5000, 1]
    227 X = wl_basebandCmd(node, RFA, 'read_iq', 1000, 5000);
    228 
    229 %Read full buffers for RFA and RFB
    230 %size(X) will be [rxIQLen, 2]
    231 X = wl_basebandCmd(node, [RFA RFB], 'read_iq');
     254% Read full buffer for RFA
     255%     NOTE:  size(X) will be ![rxIQLen, 1]
     256X = wl_basebandCmd(node, RFA, 'read_IQ');
     257
     258% Read partial buffer for RFA (samples 1000:4999)
     259%     NOTE:  size(X) will be ![5000, 1]
     260X = wl_basebandCmd(node, RFA, 'read_IQ', 1000, 5000);
     261
     262% Read full buffers for RFA and RFB
     263%     NOTE:  size(X) will be ![rxIQLen, 2]
     264X = wl_basebandCmd(node, ![RFA RFB], 'read_IQ');
    232265}}}
    233266
     267
    234268=== {{{read_rssi}}} ===
    235 Read RSSI samples from the specified buffers. The elements of the buffer selection must be scalers which[[BR]]
    236 identify a single buffer. To read multiple buffers in one call, pass a vector of individual buffer IDs.[[BR]]
     269Read RSSI samples from the specified buffers. The elements of the buffer selection must be scalers which identify a single buffer. To read multiple buffers in one call, pass a vector of individual buffer IDs.[[BR]]
    237270
    238271See 'read_iq' for arguments/returns[[BR]]
    239272
    240273
     274
    241275=== {{{agc_state}}} ===
    242 Read AGC state from the specified buffers. The elements of the buffer selection must be scalers which[[BR]]
    243 identify a single buffer. To read multiple buffers in one call, pass a vector of individual buffer IDs[[BR]]
     276Read AGC state from the specified buffers. The elements of the buffer selection must be scalers which identify a single buffer. To read multiple buffers in one call, pass a vector of individual buffer IDs[[BR]]
    244277
    245278
     
    249282
    250283
    251 '''Returns:''' agc_state -- column vector per buffer BUFF_SEL
    252 
    253 agc_state(1): RF gain chosen by AGC[[BR]]
    254 agc_state(2): BB gain chosen by AGC[[BR]]
    255 agc_state(3): RSSI observed by AGC at time of lock[[BR]]
    256 
    257 
    258 === {{{agc_thresh}}} ===
    259 Read or write AGC threshold.[[BR]]
    260 
    261 
    262 '''Requires BUFF_SEL:''' No
    263 
    264 '''Arguments:'''  none or (int32 thresh1), (int32 thresh2), (int32 thresh3)
    265 
    266 '''Returns:''' (int32 thresh1), (int32 thresh2), (int32 thresh3) or none
    267 
    268 If arguments are specified, this command enters a write mode where[[BR]]
    269 those arguments are written to the board. If no arguments are specified,[[BR]]
    270 the current values of agc thresholds are read from the board.[[BR]]
    271 
    272 thresh1: receive power (in dBm) under which AGC will not[[BR]]
    273 attempt to change gains[[BR]]
    274 default value: -90[[BR]]
    275 
    276 thresh2: receive power (in dBm) under which AGC will select[[BR]]
    277 high RF gain (RF Gain 3)[[BR]]
    278 default value: -53[[BR]]
    279 
    280 thresh3: receive power (in dBm) under which AGC will select[[BR]]
    281 medium RF gain (RF Gain 2). Above this receive power[[BR]]
    282 the AGC will select low RF gain (RF Gain 1)[[BR]]
    283 default value: -43[[BR]]
    284 
    285 Default known-good values for this threshold are derived from[[BR]]
    286 the MAX2829 datasheet (bottom, middle plot on page 16).[[BR]]
    287 These default values are (-90,-53,-43)dBm. There is no reason[[BR]]
    288 to call this command unless changing from these defaults is desired.[[BR]]
     284'''Returns:''' agc_state -- column vector per buffer BUFF_SEL[[BR]]
     285  agc_state(1): RF gain chosen by AGC[[BR]]
     286  agc_state(2): BB gain chosen by AGC[[BR]]
     287  agc_state(3): RSSI observed by AGC at time of lock[[BR]]
     288
    289289
    290290
     
    295295'''Requires BUFF_SEL:''' No. Values apply to all RF paths
    296296
    297 '''Arguments:''' (int32 target)
    298 target: target receive power (in dBm)[[BR]]
    299 default value: -10[[BR]]
    300 
    301 '''Returns:''' none
    302 
    303 This command is the best way to tweak AGC behavior[[BR]]
    304 to apply more or less gain. For example, a target of[[BR]]
    305 -5dBm will apply more gain thatn a target of -10dBm,
    306 so the waveform will be larger at the inputs of the I[[BR]]
    307 and Q ADCs.[[BR]]
    308 
    309 
    310 === {{{agc_noise_est}}} ===
    311 Set the AGC noise estimate[[BR]]
    312 
    313 
    314 '''Requires BUFF_SEL:''' No. Values apply to all RF paths
    315 
    316 '''Arguments:''' (int32 noise_estimate)
    317 noise_estimate: rx noise power (in dBm)[[BR]]
    318 default value: -95[[BR]]
    319 
    320 '''Returns:''' none
     297'''Arguments:''' (int32 target)[[BR]]
     298  target: target receive power (in dBm)[[BR]]
     299  default value: -16[[BR]]
     300
     301'''Returns:''' none
     302
     303This command is the best way to tweak AGC behavior to apply more or less gain. For example, a target of -5dBm will apply more gain than a target of -10dBm, so the waveform will be larger at the inputs of the I and Q ADCs.[[BR]]
     304
    321305
    322306
     
    327311'''Requires BUFF_SEL:''' No
    328312
    329 '''Arguments:''' (boolean DCO)
    330 DCO:[[BR]]
    331 true enables DC offset correction[[BR]]
    332 false disable DC offset correction[[BR]]
    333 
    334 '''Returns:''' none
    335 
    336 
    337 === {{{agc_trig_delay}}} ===
    338 Sets the AGC trigger delay. The argument specifies a[[BR]]
    339 delay (in number of cycles) that the AGC should wait[[BR]]
    340 before beginning its processing after the node[[BR]]
    341 receives a trigger.[[BR]]
    342 
    343 
    344 '''Requires BUFF_SEL:''' No. Values apply to all RF paths
    345 
    346 '''Arguments:''' (uint16 trigger_delay)
    347 trigger_delay: # if cycles of delay after trigger[[BR]]
    348 valid range: ![0,511][[BR]]
    349 
    350 '''Returns:''' none
     313'''Arguments:''' (boolean DCO)[[BR]]
     314  ''true'' - enables DC offset correction[[BR]]
     315  ''false'' -  disable DC offset correction[[BR]]
     316
     317'''Returns:''' none
     318
    351319
    352320
     
    362330
    363331
     332
    364333=== {{{agc_done_addr}}} ===
    365334Sample index where AGC finished[[BR]]
     
    372341'''Returns:''' (uint32) sample_index
    373342
     343
     344
    374345=== {{{agc_reset_on_timeout}}} ===
    375346Gets / Sets whether the AGC will reset on timeout[[BR]]
    376347
    377348
    378 '''Requires BUFF_SEL:''' No. Values apply to all RF paths
    379 
    380 '''Arguments:''' 'true' or 'false' on write; none on read
    381 
    382 '''Returns:''' none on write; 'true' or 'false' on read
     349'''Arguments:''' 'true' or 'false'; none on read
     350
     351'''Returns:'''   none on write; 'true' or 'false'
     352
     353
    383354
    384355=== {{{agc_reset_timeout_value}}} ===
     
    386357
    387358
    388 '''Requires BUFF_SEL:''' No. Values apply to all RF paths
    389 
    390359'''Arguments:''' timeout value in usec on write; none on read
    391360
    392 '''Returns:''' none on write; timeout value in usec on read
     361'''Returns:'''   none on write; timeout value in usec on read