summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Blum2010-10-18 16:13:10 -0700
committerJosh Blum2010-10-18 16:13:10 -0700
commit1e5db4248e2488e0f1b44ac1405d78e16c2408d8 (patch)
treeb80ea578d1c6306e7c70296316c2e7cd4a7fe50d
parentd029af43c3367a4611185ade70639cc6b7cc5e3d (diff)
downloadgnuradio-1e5db4248e2488e0f1b44ac1405d78e16c2408d8.tar.gz
gnuradio-1e5db4248e2488e0f1b44ac1405d78e16c2408d8.tar.bz2
gnuradio-1e5db4248e2488e0f1b44ac1405d78e16c2408d8.zip
uhd: work on multi usrp blocks, use block tree to categorize blocks, deprecate mimo blocks
-rw-r--r--gr-uhd/grc/Makefile.am1
-rwxr-xr-xgr-uhd/grc/gen_uhd_multi_usrp_blocks_xml.py101
-rwxr-xr-xgr-uhd/grc/gen_uhd_single_usrp_blocks_xml.py3
-rw-r--r--gr-uhd/grc/uhd_block_tree.xml23
-rw-r--r--gr-uhd/grc/uhd_mimo_sink.xml3
-rw-r--r--gr-uhd/grc/uhd_mimo_source.xml3
-rw-r--r--gr-uhd/grc/uhd_simple_sink.xml1
-rw-r--r--gr-uhd/grc/uhd_simple_source.xml1
8 files changed, 99 insertions, 37 deletions
diff --git a/gr-uhd/grc/Makefile.am b/gr-uhd/grc/Makefile.am
index 04b7dca36..d424ca709 100644
--- a/gr-uhd/grc/Makefile.am
+++ b/gr-uhd/grc/Makefile.am
@@ -36,6 +36,7 @@ BUILT_SOURCES = \
$(generated_uhd_single_usrp_blocks)
dist_grcblocks_DATA = \
+ uhd_block_tree.xml \
$(BUILT_SOURCES)
# add the deprecated files
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,
diff --git a/gr-uhd/grc/gen_uhd_single_usrp_blocks_xml.py b/gr-uhd/grc/gen_uhd_single_usrp_blocks_xml.py
index 5b3cb5b5a..5b87719e5 100755
--- a/gr-uhd/grc/gen_uhd_single_usrp_blocks_xml.py
+++ b/gr-uhd/grc/gen_uhd_single_usrp_blocks_xml.py
@@ -24,7 +24,6 @@ MAIN_TMPL = """\
<block>
<name>UHD: Single USRP $sourk.title()</name>
<key>uhd_single_usrp_$(sourk)</key>
- <category>UHD</category>
<import>from gnuradio import uhd</import>
<make>uhd.single_usrp_$(sourk)(\$dev_addr, uhd.io_type_t.\$type.type, \$nchan)
self.\$(id).set_subdev_spec(\$sd_spec)
@@ -115,7 +114,7 @@ self.\$(id).set_antenna(\$ant$(n), $n)
</param>
$params
<check>$max_nchan >= \$nchan</check>
- <check>\$nchan >= 0</check>
+ <check>\$nchan > 0</check>
<check>(len((\$sd_spec).split()) or 1) == \$nchan</check>
<$sourk>
<name>$direction</name>
diff --git a/gr-uhd/grc/uhd_block_tree.xml b/gr-uhd/grc/uhd_block_tree.xml
new file mode 100644
index 000000000..e8c4f069d
--- /dev/null
+++ b/gr-uhd/grc/uhd_block_tree.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0"?>
+<!--
+###################################################
+##Block Tree for uhd blocks.
+###################################################
+ -->
+<cat>
+ <name></name> <!-- Blank for Root Name -->
+ <cat>
+ <name>UHD</name>
+ <block>uhd_single_usrp_source</block>
+ <block>uhd_single_usrp_sink</block>
+ <block>uhd_multi_usrp_source</block>
+ <block>uhd_multi_usrp_sink</block>
+ </cat>
+ <cat>
+ <name>UHD (DEPRECATED)</name>
+ <block>uhd_simple_source</block>
+ <block>uhd_simple_sink</block>
+ <block>uhd_mimo_source</block>
+ <block>uhd_mimo_sink</block>
+ </cat>
+</cat>
diff --git a/gr-uhd/grc/uhd_mimo_sink.xml b/gr-uhd/grc/uhd_mimo_sink.xml
index 2f5f2011f..13865c913 100644
--- a/gr-uhd/grc/uhd_mimo_sink.xml
+++ b/gr-uhd/grc/uhd_mimo_sink.xml
@@ -1,8 +1,7 @@
<?xml version="1.0"?>
<block>
- <name>UHD MIMO Sink</name>
+ <name>UHD MIMO Sink (DEPRECATED)</name>
<key>uhd_mimo_sink</key>
- <category>UHD</category>
<import>from gnuradio import uhd</import>
<make>uhd.mimo_sink($nchan, $args, uhd.io_type_t.$type.type)
self.$(id).set_samp_rate_all($samp_rate)
diff --git a/gr-uhd/grc/uhd_mimo_source.xml b/gr-uhd/grc/uhd_mimo_source.xml
index d8f4e6d66..6167838b0 100644
--- a/gr-uhd/grc/uhd_mimo_source.xml
+++ b/gr-uhd/grc/uhd_mimo_source.xml
@@ -1,8 +1,7 @@
<?xml version="1.0"?>
<block>
- <name>UHD MIMO Source</name>
+ <name>UHD MIMO Source (DEPRECATED)</name>
<key>uhd_mimo_source</key>
- <category>UHD</category>
<import>from gnuradio import uhd</import>
<make>uhd.mimo_source($nchan, $args, uhd.io_type_t.$type.type)
self.$(id).set_samp_rate_all($samp_rate)
diff --git a/gr-uhd/grc/uhd_simple_sink.xml b/gr-uhd/grc/uhd_simple_sink.xml
index 66dc5bf14..ee6051432 100644
--- a/gr-uhd/grc/uhd_simple_sink.xml
+++ b/gr-uhd/grc/uhd_simple_sink.xml
@@ -7,7 +7,6 @@
<block>
<name>UHD Simple Sink (DEPRECATED)</name>
<key>uhd_simple_sink</key>
- <category>UHD</category>
<import>from gnuradio import uhd</import>
<make>uhd.simple_sink($args, uhd.io_type_t.$type.type)
self.$(id).set_subdev_spec($sd_spec)
diff --git a/gr-uhd/grc/uhd_simple_source.xml b/gr-uhd/grc/uhd_simple_source.xml
index 00c60f41d..825981d66 100644
--- a/gr-uhd/grc/uhd_simple_source.xml
+++ b/gr-uhd/grc/uhd_simple_source.xml
@@ -7,7 +7,6 @@
<block>
<name>UHD Simple Source (DEPRECATED)</name>
<key>uhd_simple_source</key>
- <category>UHD</category>
<import>from gnuradio import uhd</import>
<make>uhd.simple_source($args, uhd.io_type_t.$type.type)
self.$(id).set_subdev_spec($sd_spec)