diff options
Diffstat (limited to 'gr-uhd/grc/gen_uhd_multi_usrp_blocks_xml.py')
-rwxr-xr-x | gr-uhd/grc/gen_uhd_multi_usrp_blocks_xml.py | 101 |
1 files changed, 72 insertions, 29 deletions
diff --git a/gr-uhd/grc/gen_uhd_multi_usrp_blocks_xml.py b/gr-uhd/grc/gen_uhd_multi_usrp_blocks_xml.py index a4da53a18..8de4408d5 100755 --- a/gr-uhd/grc/gen_uhd_multi_usrp_blocks_xml.py +++ b/gr-uhd/grc/gen_uhd_multi_usrp_blocks_xml.py @@ -24,10 +24,16 @@ MAIN_TMPL = """\ <block> <name>UHD: Multi USRP $sourk.title()</name> <key>uhd_multi_usrp_$(sourk)</key> - <category>UHD</category> <import>from gnuradio import uhd</import> <make>uhd.multi_usrp_$(sourk)(\$dev_addr, uhd.io_type_t.\$type.type, \$nchan) -self.\$(id).set_subdev_spec(\$sd_spec) +\#if \$sync() +self.\$(id).set_time_unknown_pps(uhd.time_spec_t()) +\#end if +#for $m in range($max_mboards) +\#if \$num_mboards() > $m +self.\$(id).set_subdev_spec(\$sd_spec$(m), $m) +\#end if +#end for self.\$(id).set_samp_rate(\$samp_rate) #for $n in range($max_nchan) \#if \$nchan() > $n @@ -63,25 +69,6 @@ self.\$(id).set_antenna(\$ant$(n), $n) </option> </param> <param> - <name>Num Channels</name> - <key>nchan</key> - <value>1</value> - <type>int</type> - <hide>part</hide> - <option> - <name>Multi Channel</name> - <key>1</key> - </option> - <option> - <name>Dual Channel</name> - <key>2</key> - </option> - <option> - <name>Quad Channel</name> - <key>4</key> - </option> - </param> - <param> <name>Device Addr</name> <key>dev_addr</key> <value>addr=192.168.10.2</value> @@ -95,18 +82,61 @@ self.\$(id).set_antenna(\$ant$(n), $n) </hide> </param> <param> - <name>Subdev Spec</name> - <key>sd_spec</key> + <name>Sync</name> + <key>sync</key> + <value>sync</value> + <type>enum</type> + <hide>\#if \$sync() then 'none' else 'part'#</hide> + <option> + <name>unknown PPS</name> + <key>sync</key> + </option> + <option> + <name>don't sync</name> + <key></key> + </option> + </param> + <param> + <name>Num Mboards</name> + <key>num_mboards</key> + <value>2</value> + <type>int</type> + #for $m in range(1, $max_mboards) + <option> + <name>$(m)</name> + <key>$m</key> + </option> + #end for + </param> + #for $m in range($max_mboards) + <param> + <name>Mb$(m): Subdev Spec</name> + <key>sd_spec$(m)</key> <value></value> <type>string</type> <hide> - \#if \$sd_spec() + \#if not \$num_mboards() > $m + all + \#elif \$sd_spec$(m)() none \#else part \#end if </hide> </param> + #end for + <param> + <name>Num Channels</name> + <key>nchan</key> + <value>2</value> + <type>int</type> + #for $n in range(1, $max_nchan) + <option> + <name>$(n)</name> + <key>$n</key> + </option> + #end for + </param> <param> <name>Samp Rate (Sps)</name> <key>samp_rate</key> @@ -115,8 +145,10 @@ self.\$(id).set_antenna(\$ant$(n), $n) </param> $params <check>$max_nchan >= \$nchan</check> - <check>\$nchan >= 0</check> - <check>(len((\$sd_spec).split()) or 1) == \$nchan</check> + <check>\$nchan > 0</check> + <check>$max_mboards >= \$num_mboards</check> + <check>\$num_mboards > 0</check> + <check>\$nchan >= \$num_mboards</check> <$sourk> <name>$direction</name> <type>\$type</type> @@ -132,18 +164,27 @@ If left blank, the first UHD device found will be used. \\ Used args to specify a specfic device. USRP2 Example: addr=192.168.10.2 192.168.10.3 +Num Motherboards: +Selects the number of USRP motherboards in this multi-USRP configuration. + +Num Channels: +Selects the total number of channels in this multi-USRP configuration. +Ex: 4 motherboards with 2 channels per board = 8 channels total + Sample rate: The sample rate is the number of samples per second input by this block. \\ The UHD device driver will try its best to match the requested sample rate. \\ If the requested rate is not possible, the UHD block will print an error at runtime. Subdevice specification: +Each motherboard should have its own subdevice specification \\ +and all subdevice specifications should be the same length. \\ Select the subdevice or subdevices for each channel using a markup string. \\ The markup string consists of a list of dboard_slot:subdev_name pairs (one pair per channel). \\ If left blank, the UHD will try to select the first subdevice on your system. \\ See the application notes for further details. -Single channel example: A:AB -Dual channel example: A:AB B:0 +Single channel example: :AB +Dual channel example: :A :B Antenna: For subdevices/daughterboards with only one antenna, this may be left blank. \\ @@ -189,7 +230,8 @@ def parse_tmpl(_tmpl, **kwargs): from Cheetah import Template return str(Template.Template(_tmpl, kwargs)) -max_num_channels = 4 +max_num_mboards = 4 +max_num_channels = max_num_mboards*4 if __name__ == '__main__': import sys @@ -205,6 +247,7 @@ if __name__ == '__main__': params = ''.join([parse_tmpl(PARAMS_TMPL, n=n) for n in range(max_num_channels)]) open(file, 'w').write(parse_tmpl(MAIN_TMPL, max_nchan=max_num_channels, + max_mboards=max_num_mboards, params=params, sourk=sourk, direction=direction, |