From ef8ed898cbc6cb6cd1994d2a8b090112f4f3a664 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Tue, 26 Oct 2010 09:47:53 -0700 Subject: usrp: fixed validate subdev spec typo for empty string cases --- host/lib/usrp/misc_utils.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'host/lib') diff --git a/host/lib/usrp/misc_utils.cpp b/host/lib/usrp/misc_utils.cpp index 7e49baa52..5856d706f 100644 --- a/host/lib/usrp/misc_utils.cpp +++ b/host/lib/usrp/misc_utils.cpp @@ -164,13 +164,13 @@ static void verify_xx_subdev_spec( } //sanity check that the dboard/subdevice names exist for this mboard - BOOST_FOREACH(const subdev_spec_pair_t &pair, subdev_spec){ + BOOST_FOREACH(subdev_spec_pair_t &pair, subdev_spec){ //empty db name means select dboard automatically if (pair.db_name.empty()){ if (dboard_names.size() != 1) throw std::runtime_error( "A daughterboard name must be provided for multi-slot motherboards: " + subdev_spec.to_string() ); - pair.db_name == dboard_names.front(); + pair.db_name = dboard_names.front(); } uhd::assert_has(dboard_names, pair.db_name, xx_type + " dboard name"); wax::obj dboard = mboard[named_prop_t(dboard_prop, pair.db_name)]; @@ -181,7 +181,7 @@ static void verify_xx_subdev_spec( if (subdev_names.size() != 1) throw std::runtime_error( "A subdevice name must be provided for multi-subdev daughterboards: " + subdev_spec.to_string() ); - pair.sd_name == subdev_names.front(); + pair.sd_name = subdev_names.front(); } uhd::assert_has(subdev_names, pair.sd_name, xx_type + " subdev name"); } -- cgit v1.2.3 From 904332c7ba8b66877b8ca56e43ed2e5cfdbc661b Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Thu, 28 Oct 2010 10:26:12 -0700 Subject: uhd: added to python module check macro, move check to lib dir --- host/config/Python.cmake | 25 +++++++++++-------------- host/lib/CMakeLists.txt | 19 +++++++++++++++++++ 2 files changed, 30 insertions(+), 14 deletions(-) (limited to 'host/lib') diff --git a/host/config/Python.cmake b/host/config/Python.cmake index 55ef6acca..a5080fc40 100644 --- a/host/config/Python.cmake +++ b/host/config/Python.cmake @@ -24,26 +24,23 @@ IF(NOT PYTHONINTERP_FOUND) MESSAGE(FATAL_ERROR "Error: Python interpretor required by the build system.") ENDIF(NOT PYTHONINTERP_FOUND) -MACRO(PYTHON_CHECK_MODULE module have) - MESSAGE(STATUS "Checking for python module ${module}") +MACRO(PYTHON_CHECK_MODULE desc mod cmd have) + MESSAGE(STATUS "Python checking for ${desc}") EXECUTE_PROCESS( - COMMAND ${PYTHON_EXECUTABLE} -c "import ${module}" + COMMAND ${PYTHON_EXECUTABLE} -c " +######################################### +try: import ${mod} +except: exit(-1) +try: assert ${cmd} +except: exit(-1) +#########################################" RESULT_VARIABLE ${have} ) IF(${have} EQUAL 0) - MESSAGE(STATUS "Checking for python module ${module} - found") + MESSAGE(STATUS "Python checking for ${desc} - found") SET(${have} TRUE) ELSE(${have} EQUAL 0) - MESSAGE(STATUS "Checking for python module ${module} - not found") + MESSAGE(STATUS "Python checking for ${desc} - not found") SET(${have} FALSE) ENDIF(${have} EQUAL 0) ENDMACRO(PYTHON_CHECK_MODULE) - -######################################################################## -# Check Modules -######################################################################## -PYTHON_CHECK_MODULE("Cheetah" HAVE_PYTHON_MODULE_CHEETAH) - -IF(NOT HAVE_PYTHON_MODULE_CHEETAH) - MESSAGE(FATAL_ERROR "Error: Cheetah Templates required by the build system.") -ENDIF(NOT HAVE_PYTHON_MODULE_CHEETAH) diff --git a/host/lib/CMakeLists.txt b/host/lib/CMakeLists.txt index 81845de21..b0e610d41 100644 --- a/host/lib/CMakeLists.txt +++ b/host/lib/CMakeLists.txt @@ -15,6 +15,25 @@ # along with this program. If not, see . # +######################################################################## +# Check Python Modules +######################################################################## +PYTHON_CHECK_MODULE( + "Python version >= 2.6" + "platform" "platform.python_version() >= '2.6'" + HAVE_PYTHON_PLAT_MIN_VERSION +) + +PYTHON_CHECK_MODULE( + "Cheetah templates >= 2.0.0" + "Cheetah" "Cheetah.Version >= '2.0.0'" + HAVE_PYTHON_MODULE_CHEETAH +) + +IF(NOT HAVE_PYTHON_PLAT_MIN_VERSION OR NOT HAVE_PYTHON_MODULE_CHEETAH) + MESSAGE(FATAL_ERROR "Error: python requirements not met for the build system.") +ENDIF(NOT HAVE_PYTHON_PLAT_MIN_VERSION OR NOT HAVE_PYTHON_MODULE_CHEETAH) + ######################################################################## # Helpful Macros ######################################################################## -- cgit v1.2.3 From 689778831d204b443beb0f5435aa0b540f97b105 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Thu, 28 Oct 2010 10:40:37 -0700 Subject: uhd: change python module check descriptions to use words --- host/lib/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'host/lib') diff --git a/host/lib/CMakeLists.txt b/host/lib/CMakeLists.txt index b0e610d41..e4de7bcc7 100644 --- a/host/lib/CMakeLists.txt +++ b/host/lib/CMakeLists.txt @@ -19,13 +19,13 @@ # Check Python Modules ######################################################################## PYTHON_CHECK_MODULE( - "Python version >= 2.6" + "Python version 2.6 or greater" "platform" "platform.python_version() >= '2.6'" HAVE_PYTHON_PLAT_MIN_VERSION ) PYTHON_CHECK_MODULE( - "Cheetah templates >= 2.0.0" + "Cheetah templates 2.0.0 or greater" "Cheetah" "Cheetah.Version >= '2.0.0'" HAVE_PYTHON_MODULE_CHEETAH ) -- cgit v1.2.3 From 6a3e499f586513d48ef648aa910e252b7d8b046b Mon Sep 17 00:00:00 2001 From: Jason Abele Date: Thu, 28 Oct 2010 18:06:01 -0700 Subject: Fix Bandwidth for IQ subdevs on Basic/LF Additional typo cleanup and fix WBX bandwidth --- host/docs/dboards.rst | 14 +++++++++++--- host/lib/usrp/dboard/db_basic_and_lf.cpp | 14 ++++++++++++-- host/lib/usrp/dboard/db_rfx.cpp | 4 ++-- host/lib/usrp/dboard/db_tvrx.cpp | 2 +- host/lib/usrp/dboard/db_wbx.cpp | 4 ++-- 5 files changed, 28 insertions(+), 10 deletions(-) (limited to 'host/lib') diff --git a/host/docs/dboards.rst b/host/docs/dboards.rst index d93fb9d6a..b39c587f6 100644 --- a/host/docs/dboards.rst +++ b/host/docs/dboards.rst @@ -26,9 +26,13 @@ The boards have no tunable elements or programmable gains. Though the magic of aliasing, you can down-convert signals greater than the Nyquist rate of the ADC. -BasicRX Bandwidth (Hz): 250M +BasicRX Bandwidth (Hz): + For Real-Mode (A or B subdevice): 250M + For Complex (AB or BA subdevice): 500M -LFRX Bandwidth (Hz): 30M +LFRX Bandwidth (Hz): + For Real-Mode (A or B subdevice): 33M + For Complex (AB or BA subdevice): 66M ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Basic TX and and LFTX @@ -45,8 +49,12 @@ Though the magic of aliasing, you can up-convert signals greater than the Nyquist rate of the DAC. BasicTX Bandwidth (Hz): 250M + For Real-Mode (A or B subdevice): 250M + For Complex (AB or BA subdevice): 500M -LFTX Bandwidth (Hz): 30M +LFTX Bandwidth (Hz): 33M + For Real-Mode (A or B subdevice): 33M + For Complex (AB or BA subdevice): 66M ^^^^^^^^^^^^^^^^^^^^^^^^^^^ DBSRX diff --git a/host/lib/usrp/dboard/db_basic_and_lf.cpp b/host/lib/usrp/dboard/db_basic_and_lf.cpp index 4c49b3bff..f03dd43d1 100644 --- a/host/lib/usrp/dboard/db_basic_and_lf.cpp +++ b/host/lib/usrp/dboard/db_basic_and_lf.cpp @@ -30,6 +30,16 @@ using namespace uhd; using namespace uhd::usrp; using namespace boost::assign; +/*********************************************************************** + * Constants + **********************************************************************/ +static const uhd::dict subdev_bandwidth_scalar = map_list_of + ("A", 1.0) + ("B", 1.0) + ("AB", 2.0) + ("BA", 2.0) +; + /*********************************************************************** * The basic and lf boards: * They share a common class because only the frequency bounds differ. @@ -163,7 +173,7 @@ void basic_rx::rx_get(const wax::obj &key_, wax::obj &val){ return; case SUBDEV_PROP_BANDWIDTH: - val = 2*_max_freq; //we want complex double-sided + val = subdev_bandwidth_scalar[get_subdev_name()]*_max_freq; return; default: UHD_THROW_PROP_GET_ERROR(); @@ -274,7 +284,7 @@ void basic_tx::tx_get(const wax::obj &key_, wax::obj &val){ return; case SUBDEV_PROP_BANDWIDTH: - val = 2*_max_freq; //we want complex double-sided + val = subdev_bandwidth_scalar[get_subdev_name()]*_max_freq; return; default: UHD_THROW_PROP_GET_ERROR(); diff --git a/host/lib/usrp/dboard/db_rfx.cpp b/host/lib/usrp/dboard/db_rfx.cpp index 12e458d8c..152198c3a 100644 --- a/host/lib/usrp/dboard/db_rfx.cpp +++ b/host/lib/usrp/dboard/db_rfx.cpp @@ -458,7 +458,7 @@ void rfx_xcvr::rx_get(const wax::obj &key_, wax::obj &val){ return; case SUBDEV_PROP_BANDWIDTH: - val = 2*20.0e6; //30MHz low-pass, we want complex double-sided + val = 2*20.0e6; //20MHz low-pass, we want complex double-sided return; default: UHD_THROW_PROP_GET_ERROR(); @@ -555,7 +555,7 @@ void rfx_xcvr::tx_get(const wax::obj &key_, wax::obj &val){ return; case SUBDEV_PROP_BANDWIDTH: - val = 2*20.0e6; //30MHz low-pass, we want complex double-sided + val = 2*20.0e6; //20MHz low-pass, we want complex double-sided return; default: UHD_THROW_PROP_GET_ERROR(); diff --git a/host/lib/usrp/dboard/db_tvrx.cpp b/host/lib/usrp/dboard/db_tvrx.cpp index 1f3c76556..2873e3d54 100644 --- a/host/lib/usrp/dboard/db_tvrx.cpp +++ b/host/lib/usrp/dboard/db_tvrx.cpp @@ -460,7 +460,7 @@ void tvrx::rx_get(const wax::obj &key_, wax::obj &val){ return; case SUBDEV_PROP_BANDWIDTH: - val = 6.0e6; //30MHz low-pass, we want complex double-sided + val = 6.0e6; return; default: UHD_THROW_PROP_GET_ERROR(); diff --git a/host/lib/usrp/dboard/db_wbx.cpp b/host/lib/usrp/dboard/db_wbx.cpp index 647f1b975..572f5de97 100644 --- a/host/lib/usrp/dboard/db_wbx.cpp +++ b/host/lib/usrp/dboard/db_wbx.cpp @@ -527,7 +527,7 @@ void wbx_xcvr::rx_get(const wax::obj &key_, wax::obj &val){ return; case SUBDEV_PROP_BANDWIDTH: - val = 2*30.0e6; //20MHz low-pass, we want complex double-sided + val = 2*20.0e6; //20MHz low-pass, we want complex double-sided return; default: UHD_THROW_PROP_GET_ERROR(); @@ -628,7 +628,7 @@ void wbx_xcvr::tx_get(const wax::obj &key_, wax::obj &val){ return; case SUBDEV_PROP_BANDWIDTH: - val = 2*30.0e6; //20MHz low-pass, we want complex double-sided + val = 2*20.0e6; //20MHz low-pass, we want complex double-sided return; default: UHD_THROW_PROP_GET_ERROR(); -- cgit v1.2.3