aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--host/cmake/Modules/UHDVersion.cmake8
-rw-r--r--host/docs/build.dox6
-rw-r--r--host/lib/usrp/b200/CMakeLists.txt2
-rw-r--r--host/lib/usrp/e300/e300_impl.hpp2
-rw-r--r--host/lib/usrp/e300/e300_io_impl.cpp48
-rw-r--r--host/utils/uhd_usrp_probe.cpp5
6 files changed, 57 insertions, 14 deletions
diff --git a/host/cmake/Modules/UHDVersion.cmake b/host/cmake/Modules/UHDVersion.cmake
index 0fb8c0af3..014943b53 100644
--- a/host/cmake/Modules/UHDVersion.cmake
+++ b/host/cmake/Modules/UHDVersion.cmake
@@ -38,7 +38,7 @@ SET(UHD_VERSION_DEVEL FALSE)
FUNCTION(DEPAD_NUM input_num output_num)
EXECUTE_PROCESS(
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
- COMMAND ${PYTHON_EXECUTABLE} -c "print int('${input_num}') if isinstance('${input_num}', (int, long)) else '${input_num}'"
+ COMMAND ${PYTHON_EXECUTABLE} -c "print int('${input_num}')"
OUTPUT_VARIABLE depadded_num OUTPUT_STRIP_TRAILING_WHITESPACE
)
SET(${output_num} ${depadded_num} PARENT_SCOPE)
@@ -46,7 +46,11 @@ ENDFUNCTION(DEPAD_NUM)
DEPAD_NUM(${UHD_VERSION_MAJOR} TRIMMED_VERSION_MAJOR)
DEPAD_NUM(${UHD_VERSION_MINOR} TRIMMED_VERSION_MINOR)
-DEPAD_NUM(${UHD_VERSION_PATCH} TRIMMED_VERSION_PATCH)
+IF(UHD_VERSION_DEVEL)
+ SET(TRIMMED_VERSION_PATCH ${UHD_VERSION_PATCH})
+ELSE(UHD_VERSION_DEVEL)
+ DEPAD_NUM(${UHD_VERSION_PATCH} TRIMMED_VERSION_PATCH)
+ENDIF(UHD_VERSION_DEVEL)
SET(TRIMMED_UHD_VERSION "${TRIMMED_VERSION_MAJOR}.${TRIMMED_VERSION_MINOR}.${TRIMMED_VERSION_PATCH}")
########################################################################
diff --git a/host/docs/build.dox b/host/docs/build.dox
index 01209bc3e..e08bc6bf3 100644
--- a/host/docs/build.dox
+++ b/host/docs/build.dox
@@ -61,7 +61,7 @@ Other compilers (or lower versions) may work, but are unsupported.
- **Minimum Version:** 1.0
- **Usage:** build time + runtime (optional)
- **Download URL:** http://sourceforge.net/projects/libusb/files/libusb-1.0/
-- **Download URL (Windows):** https://github.com/libusbx/libusbx
+- **Download URL (Windows):** https://github.com/libusb/libusb
### Python
@@ -148,7 +148,7 @@ so we must manually tell CMake how to locate the LibUSB header and lib.
- Recommend the static `libusb-1.0.lib` to simplify runtime dependencies.
- Check the box to enable USB support, click "Configure" and "Generate".
-<b>Note:</b> On Windows, LibUSBx is required to use most USB3 controllers.
+<b>Note:</b> On Windows, LibUSB v1.0.19 is required to use most USB3 controllers.
\subsection build_in_msvc Build the project in MSVC
- Open the generated project file in MSVC.
@@ -208,7 +208,7 @@ the UHDConfig.cmake file that gets installed along with the UHD libraries.
Using CMake, UHD can be built as a static library by switching on
`ENABLE_STATIC_LIBS`.
- cmake -DENABLE_STATIC_LIBS=On <path to UHD source>
+ cmake -DENABLE_STATIC_LIBS=ON <path to UHD source>
When linking the static library, you must ensure that the library
is loaded in its entirety, otherwise global objects aren't initialized
diff --git a/host/lib/usrp/b200/CMakeLists.txt b/host/lib/usrp/b200/CMakeLists.txt
index a08c4bd03..ce89b5d80 100644
--- a/host/lib/usrp/b200/CMakeLists.txt
+++ b/host/lib/usrp/b200/CMakeLists.txt
@@ -20,7 +20,7 @@
########################################################################
########################################################################
-# Conditionally configure the B100 support
+# Conditionally configure the B200 support
########################################################################
LIBUHD_REGISTER_COMPONENT("B200" ENABLE_B200 ON "ENABLE_LIBUHD;ENABLE_USB" OFF)
diff --git a/host/lib/usrp/e300/e300_impl.hpp b/host/lib/usrp/e300/e300_impl.hpp
index a4170ee42..c7d683f58 100644
--- a/host/lib/usrp/e300/e300_impl.hpp
+++ b/host/lib/usrp/e300/e300_impl.hpp
@@ -70,6 +70,8 @@ static std::string E300_SERVER_I2C_PORT = "21761";
static std::string E300_SERVER_SENSOR_PORT = "21762";
static const double E300_RX_SW_BUFF_FULLNESS = 0.9; //Buffer should be half full
+static const size_t E300_RX_FC_REQUEST_FREQ = 32; // per flow ctrl window
+static const size_t E300_TX_FC_RESPONSE_FREQ = 8; // per flow ctrl window
// crossbar settings
static const boost::uint8_t E300_RADIO_DEST_PREFIX_TX = 0;
diff --git a/host/lib/usrp/e300/e300_io_impl.cpp b/host/lib/usrp/e300/e300_io_impl.cpp
index dcb6f2afe..fa4915ed1 100644
--- a/host/lib/usrp/e300/e300_io_impl.cpp
+++ b/host/lib/usrp/e300/e300_io_impl.cpp
@@ -25,6 +25,7 @@
#include <uhd/transport/bounded_buffer.hpp>
#include <boost/bind.hpp>
#include <uhd/utils/tasks.hpp>
+#include <uhd/utils/log.hpp>
#include <boost/foreach.hpp>
#include <boost/make_shared.hpp>
@@ -226,6 +227,18 @@ void e300_impl::_handle_overflow(
}
}
+static size_t get_rx_flow_control_window(size_t frame_size, size_t sw_buff_size, double fullness_factor)
+{
+ if (fullness_factor < 0.01 || fullness_factor > 1) {
+ throw uhd::value_error("recv_buff_fullness must be between 0.01 and 1 inclusive (1% to 100%)");
+ }
+
+ size_t window_in_pkts = (static_cast<size_t>(sw_buff_size * fullness_factor) / frame_size);
+ if (window_in_pkts == 0) {
+ throw uhd::value_error("recv_buff_size must be larger than the recv_frame_size.");
+ }
+ return window_in_pkts;
+}
static void handle_rx_flowctrl(
const boost::uint32_t sid,
@@ -457,25 +470,38 @@ rx_streamer::sptr e300_impl::get_rx_stream(const uhd::stream_args_t &args_)
id.num_outputs = 1;
my_streamer->set_converter(id);
+ perif.framer->clear();
perif.framer->set_nsamps_per_packet(spp); //seems to be a good place to set this
perif.framer->set_sid((data_sid << 16) | (data_sid >> 16));
perif.framer->setup(args);
perif.ddc->setup(args);
+
+ // flow control setup
+ const size_t frame_size = data_xports.recv->get_recv_frame_size();
+ const size_t num_frames = data_xports.recv->get_num_recv_frames();
+ const size_t fc_window = get_rx_flow_control_window(
+ frame_size,num_frames * frame_size,
+ E300_RX_SW_BUFF_FULLNESS);
+ const size_t fc_handle_window = std::max<size_t>(1, fc_window / E300_RX_FC_REQUEST_FREQ);
+
+ UHD_LOG << "RX Flow Control Window = " << fc_window
+ << ", RX Flow Control Handler Window = "
+ << fc_handle_window << std::endl;
+
+ perif.framer->configure_flow_control(fc_window);
+ boost::shared_ptr<e300_rx_fc_cache_t> fc_cache(new e300_rx_fc_cache_t());
+
my_streamer->set_xport_chan_get_buff(stream_i, boost::bind(
&zero_copy_if::get_recv_buff, data_xports.recv, _1
), true /*flush*/);
my_streamer->set_overflow_handler(stream_i,
- boost::bind(&rx_vita_core_3000::handle_overflow, perif.framer)
+ boost::bind(&e300_impl::_handle_overflow, this, boost::ref(perif),
+ boost::weak_ptr<uhd::rx_streamer>(my_streamer))
);
- //setup flow control
- const size_t fc_window = data_xports.recv->get_num_recv_frames();
- perif.framer->configure_flow_control(fc_window);
- boost::shared_ptr<e300_rx_fc_cache_t> fc_cache(new e300_rx_fc_cache_t());
my_streamer->set_xport_handle_flowctrl(stream_i,
boost::bind(&handle_rx_flowctrl, data_sid, data_xports.send, fc_cache, _1),
- static_cast<size_t>(static_cast<double>(fc_window) * E300_RX_SW_BUFF_FULLNESS),
- true/*init*/);
+ fc_handle_window, true/*init*/);
my_streamer->set_issue_stream_cmd(stream_i,
boost::bind(&rx_vita_core_3000::issue_stream_command, perif.framer, _1)
@@ -564,7 +590,13 @@ tx_streamer::sptr e300_impl::get_tx_stream(const uhd::stream_args_t &args_)
//flow control setup
const size_t fc_window = data_xports.send->get_num_send_frames();
- perif.deframer->configure_flow_control(0/*cycs off*/, fc_window/8/*pkts*/);
+ const size_t fc_handle_window = std::max<size_t>(1, fc_window/E300_TX_FC_RESPONSE_FREQ);
+
+ UHD_LOG << "TX Flow Control Window = " << fc_window
+ << ", TX Flow Control Handler Window = "
+ << fc_handle_window << std::endl;
+
+ perif.deframer->configure_flow_control(0/*cycs off*/, fc_handle_window/*pkts*/);
boost::shared_ptr<e300_tx_fc_cache_t> fc_cache(new e300_tx_fc_cache_t());
fc_cache->stream_channel = stream_i;
fc_cache->device_channel = args.channels[stream_i];
diff --git a/host/utils/uhd_usrp_probe.cpp b/host/utils/uhd_usrp_probe.cpp
index 656cdf45a..ea346b4c9 100644
--- a/host/utils/uhd_usrp_probe.cpp
+++ b/host/utils/uhd_usrp_probe.cpp
@@ -88,6 +88,11 @@ static std::string get_frontend_pp_string(const std::string &type, property_tree
meta_range_t gain_range = tree->access<meta_range_t>(path / "gains" / name / "range").get();
ss << boost::format("Gain range %s: %.1f to %.1f step %.1f dB") % name % gain_range.start() % gain_range.stop() % gain_range.step() << std::endl;
}
+ if (tree->exists(path / "bandwidth" / "range"))
+ {
+ meta_range_t bw_range = tree->access<meta_range_t>(path / "bandwidth" / "range").get();
+ ss << boost::format("Bandwidth range: %.1f to %.1f step %.1f Hz") % bw_range.start() % bw_range.stop() % bw_range.step() << std::endl;
+ }
ss << boost::format("Connection Type: %s") % (tree->access<std::string>(path / "connection").get()) << std::endl;
ss << boost::format("Uses LO offset: %s") % ((tree->access<bool>(path / "use_lo_offset").get())? "Yes" : "No") << std::endl;