aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/x300/x300_impl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib/usrp/x300/x300_impl.cpp')
-rw-r--r--host/lib/usrp/x300/x300_impl.cpp173
1 files changed, 97 insertions, 76 deletions
diff --git a/host/lib/usrp/x300/x300_impl.cpp b/host/lib/usrp/x300/x300_impl.cpp
index fe422db46..2d6ce822e 100644
--- a/host/lib/usrp/x300/x300_impl.cpp
+++ b/host/lib/usrp/x300/x300_impl.cpp
@@ -23,12 +23,11 @@
#include <boost/algorithm/string.hpp>
#include <boost/asio.hpp>
#include <uhd/utils/static.hpp>
-#include <uhd/utils/msg.hpp>
+#include <uhd/utils/log.hpp>
#include <uhd/utils/paths.hpp>
#include <uhd/utils/safe_call.hpp>
#include <uhd/usrp/subdev_spec.hpp>
#include <uhd/transport/if_addrs.hpp>
-#include <boost/foreach.hpp>
#include <boost/bind.hpp>
#include <boost/make_shared.hpp>
#include <boost/functional/hash.hpp>
@@ -183,7 +182,7 @@ static device_addrs_t x300_find_pcie(const device_addr_t &hint, bool explicit_qu
nirio_status status = niusrprio_session::enumerate(rpc_port_name, dev_info_vtr);
if (explicit_query) nirio_status_to_exception(status, "x300_find_pcie: Error enumerating NI-RIO devices.");
- BOOST_FOREACH(niusrprio_session::device_info &dev_info, dev_info_vtr)
+ for(niusrprio_session::device_info &dev_info: dev_info_vtr)
{
device_addr_t new_addr;
new_addr["type"] = "x300";
@@ -278,7 +277,7 @@ device_addrs_t x300_find(const device_addr_t &hint_)
{
device_addrs_t found_devices;
std::string error_msg;
- BOOST_FOREACH(const device_addr_t &hint_i, hints)
+ for(const device_addr_t &hint_i: hints)
{
device_addrs_t found_devices_i = x300_find(hint_i);
if (found_devices_i.size() != 1) error_msg += str(boost::format(
@@ -310,11 +309,11 @@ device_addrs_t x300_find(const device_addr_t &hint_)
}
catch(const std::exception &ex)
{
- UHD_MSG(error) << "X300 Network discovery error " << ex.what() << std::endl;
+ UHD_LOGGER_ERROR("X300") << "X300 Network discovery error " << ex.what() ;
}
catch(...)
{
- UHD_MSG(error) << "X300 Network discovery unknown error " << std::endl;
+ UHD_LOGGER_ERROR("X300") << "X300 Network discovery unknown error " ;
}
return reply_addrs;
}
@@ -322,7 +321,7 @@ device_addrs_t x300_find(const device_addr_t &hint_)
if (!hint.has_key("resource"))
{
//otherwise, no address was specified, send a broadcast on each interface
- BOOST_FOREACH(const if_addrs_t &if_addrs, get_if_addrs())
+ for(const if_addrs_t &if_addrs: get_if_addrs())
{
//avoid the loopback device
if (if_addrs.inet == asio::ip::address_v4::loopback().to_string()) continue;
@@ -358,7 +357,7 @@ UHD_STATIC_BLOCK(register_x300_device)
static void x300_load_fw(wb_iface::sptr fw_reg_ctrl, const std::string &file_name)
{
- UHD_MSG(status) << "Loading firmware " << file_name << std::flush;
+ UHD_LOGGER_INFO("X300") << "Loading firmware " << file_name;
//load file into memory
std::ifstream fw_file(file_name.c_str());
@@ -373,28 +372,52 @@ static void x300_load_fw(wb_iface::sptr fw_reg_ctrl, const std::string &file_nam
//@TODO: FIXME: Since x300_ctrl_iface acks each write and traps exceptions, the first try for the last word
// written will print an error because it triggers a FW reload and fails to reply.
fw_reg_ctrl->poke32(SR_ADDR(BOOT_LDR_BASE, BL_DATA), uhd::byteswap(fw_file_buff[i/sizeof(uint32_t)]));
- if ((i & 0x1fff) == 0) UHD_MSG(status) << "." << std::flush;
}
//Wait for fimrware to reboot. 3s is an upper bound
boost::this_thread::sleep(boost::posix_time::milliseconds(3000));
- UHD_MSG(status) << " done!" << std::endl;
+ UHD_LOGGER_INFO("X300") << "Firmware loaded!" ;
}
-x300_impl::x300_impl(const uhd::device_addr_t &dev_addr)
+x300_impl::x300_impl(const uhd::device_addr_t &dev_addr)
: device3_impl()
, _sid_framer(0)
{
- UHD_MSG(status) << "X300 initialization sequence..." << std::endl;
+ UHD_LOGGER_INFO("X300") << "X300 initialization sequence...";
_ignore_cal_file = dev_addr.has_key("ignore-cal-file");
_tree->create<std::string>("/name").set("X-Series Device");
const device_addrs_t device_args = separate_device_addr(dev_addr);
_mb.resize(device_args.size());
- for (size_t i = 0; i < device_args.size(); i++)
+
+ // Serialize the initialization process
+ if (dev_addr.has_key("serialize_init") or device_args.size() == 1) {
+ for (size_t i = 0; i < device_args.size(); i++)
+ {
+ this->setup_mb(i, device_args[i]);
+ }
+ return;
+ }
+
+
+ // Initialize groups of USRPs in parallel
+ size_t total_usrps = device_args.size();
+ size_t num_usrps = 0;
+ while (num_usrps < total_usrps)
{
- this->setup_mb(i, device_args[i]);
+ size_t init_usrps = std::min(total_usrps - num_usrps, X300_MAX_INIT_THREADS);
+ boost::thread_group setup_threads;
+ for (size_t i = 0; i < init_usrps; i++)
+ {
+ size_t index = num_usrps + i;
+ setup_threads.create_thread(
+ boost::bind(&x300_impl::setup_mb, this, index, device_args[index])
+ );
+ }
+ setup_threads.join_all();
+ num_usrps += init_usrps;
}
+
}
void x300_impl::mboard_members_t::discover_eth(
@@ -412,7 +435,7 @@ void x300_impl::mboard_members_t::discover_eth(
// Show a warning if there exists duplicate addresses in the mboard eeprom
if (std::find(mb_eeprom_addrs.begin(), mb_eeprom_addrs.end(), mb_eeprom[key]) != mb_eeprom_addrs.end()) {
- UHD_MSG(warning) << str(boost::format(
+ UHD_LOGGER_WARNING("X300") << str(boost::format(
"Duplicate IP address %s found in mboard EEPROM. "
"Device may not function properly.\nView and reprogram the values "
"using the usrp_burn_mb_eeprom utility.\n") % mb_eeprom[key]);
@@ -420,7 +443,7 @@ void x300_impl::mboard_members_t::discover_eth(
mb_eeprom_addrs.push_back(mb_eeprom[key]);
}
- BOOST_FOREACH(const std::string& addr, ip_addrs) {
+ for(const std::string& addr: ip_addrs) {
x300_eth_conn_t conn_iface;
conn_iface.addr = addr;
conn_iface.type = X300_IFACE_NONE;
@@ -442,7 +465,7 @@ void x300_impl::mboard_members_t::discover_eth(
// Check default IP addresses if we couldn't
// determine the IP from the mboard eeprom
if (conn_iface.type == X300_IFACE_NONE) {
- UHD_MSG(warning) << str(boost::format(
+ UHD_LOGGER_WARNING("X300") << str(boost::format(
"Address %s not found in mboard EEPROM. Address may be wrong or "
"the EEPROM may be corrupt.\n Attempting to continue with default "
"IP addresses.\n") % conn_iface.addr
@@ -505,6 +528,14 @@ void x300_impl::setup_mb(const size_t mb_i, const uhd::device_addr_t &dev_addr)
mboard_members_t &mb = _mb[mb_i];
mb.initialization_done = false;
+ const std::string thread_id(
+ boost::lexical_cast<std::string>(boost::this_thread::get_id())
+ );
+ const std::string thread_msg(
+ "Thread ID " + thread_id + " for motherboard "
+ + boost::lexical_cast<std::string>(mb_i)
+ );
+
std::vector<std::string> eth_addrs;
// Not choosing eth0 based on resource might cause user issues
std::string eth0_addr = dev_addr.has_key("resource") ? dev_addr["resource"] : dev_addr["addr"];
@@ -536,7 +567,7 @@ void x300_impl::setup_mb(const size_t mb_i, const uhd::device_addr_t &dev_addr)
if (dev_addr.has_key("niusrpriorpc_port")) {
rpc_port_name = dev_addr["niusrpriorpc_port"];
}
- UHD_MSG(status) << boost::format("Connecting to niusrpriorpc at localhost:%s...\n") % rpc_port_name;
+ UHD_LOGGER_INFO("X300") << boost::format("Connecting to niusrpriorpc at localhost:%s...") % rpc_port_name;
//Instantiate the correct lvbitx object
nifpga_lvbitx::sptr lvbitx;
@@ -553,7 +584,7 @@ void x300_impl::setup_mb(const size_t mb_i, const uhd::device_addr_t &dev_addr)
drivers have loaded successfully.");
}
//Load the lvbitx onto the device
- UHD_MSG(status) << boost::format("Using LVBITX bitfile %s...\n") % lvbitx->get_bitfile_path();
+ UHD_LOGGER_INFO("X300") << boost::format("Using LVBITX bitfile %s...") % lvbitx->get_bitfile_path();
mb.rio_fpga_interface.reset(new niusrprio_session(dev_addr["resource"], rpc_port_name));
nirio_status_chain(mb.rio_fpga_interface->open(lvbitx, dev_addr.has_key("download-fpga")), status);
nirio_status_to_exception(status, "x300_impl: Could not initialize RIO session.");
@@ -567,7 +598,7 @@ void x300_impl::setup_mb(const size_t mb_i, const uhd::device_addr_t &dev_addr)
_tree->create<double>(mb_path / "link_max_rate").set(X300_MAX_RATE_PCIE);
}
- BOOST_FOREACH(const std::string &key, dev_addr.keys())
+ for(const std::string &key: dev_addr.keys())
{
if (key.find("recv") != std::string::npos) mb.recv_args[key] = dev_addr[key];
if (key.find("send") != std::string::npos) mb.send_args[key] = dev_addr[key];
@@ -626,33 +657,33 @@ void x300_impl::setup_mb(const size_t mb_i, const uhd::device_addr_t &dev_addr)
);
}
} catch(std::exception &e) {
- UHD_MSG(error) << e.what() << std::endl;
+ UHD_LOGGER_ERROR("X300") << e.what() ;
}
if ((mb.recv_args.has_key("recv_frame_size"))
&& (req_max_frame_size.recv_frame_size > _max_frame_sizes.recv_frame_size)) {
- UHD_MSG(warning)
+ UHD_LOGGER_WARNING("X300")
<< boost::format("You requested a receive frame size of (%lu) but your NIC's max frame size is (%lu).")
% req_max_frame_size.recv_frame_size
% _max_frame_sizes.recv_frame_size
- << std::endl
+
<< boost::format("Please verify your NIC's MTU setting using '%s' or set the recv_frame_size argument appropriately.")
- % mtu_tool << std::endl
+ % mtu_tool
<< "UHD will use the auto-detected max frame size for this connection."
- << std::endl;
+ ;
}
if ((mb.recv_args.has_key("send_frame_size"))
&& (req_max_frame_size.send_frame_size > _max_frame_sizes.send_frame_size)) {
- UHD_MSG(warning)
+ UHD_LOGGER_WARNING("X300")
<< boost::format("You requested a send frame size of (%lu) but your NIC's max frame size is (%lu).")
% req_max_frame_size.send_frame_size
% _max_frame_sizes.send_frame_size
- << std::endl
+
<< boost::format("Please verify your NIC's MTU setting using '%s' or set the send_frame_size argument appropriately.")
- % mtu_tool << std::endl
+ % mtu_tool
<< "UHD will use the auto-detected max frame size for this connection."
- << std::endl;
+ ;
}
_tree->create<size_t>(mb_path / "mtu/recv").set(_max_frame_sizes.recv_frame_size);
@@ -661,7 +692,7 @@ void x300_impl::setup_mb(const size_t mb_i, const uhd::device_addr_t &dev_addr)
}
//create basic communication
- UHD_MSG(status) << "Setup basic communication..." << std::endl;
+ UHD_LOGGER_INFO("X300") << "Setup basic communication...";
if (mb.xport_path == "nirio") {
boost::mutex::scoped_lock(pcie_zpu_iface_registry_mutex);
if (get_pcie_zpu_iface_registry().has_key(mb.get_pri_eth().addr)) {
@@ -721,11 +752,10 @@ void x300_impl::setup_mb(const size_t mb_i, const uhd::device_addr_t &dev_addr)
const uint32_t nbor_addr = mb.zpu_ctrl->peek32(SR_ADDR(routes_addr, i*2+1));
if (node_addr != 0 and nbor_addr != 0)
{
- UHD_MSG(status) << boost::format("%u: %s -> %s")
+ UHD_LOGGER_INFO("X300") << boost::format("%u: %s -> %s")
% i
% asio::ip::address_v4(node_addr).to_string()
- % asio::ip::address_v4(nbor_addr).to_string()
- << std::endl;
+ % asio::ip::address_v4(nbor_addr).to_string();
}
}
*/
@@ -733,11 +763,11 @@ void x300_impl::setup_mb(const size_t mb_i, const uhd::device_addr_t &dev_addr)
////////////////////////////////////////////////////////////////////
// setup the mboard eeprom
////////////////////////////////////////////////////////////////////
- UHD_MSG(status) << "Loading values from EEPROM..." << std::endl;
+ UHD_LOGGER_INFO("X300") << "Loading values from EEPROM...";
x300_mb_eeprom_iface::sptr eeprom16 = x300_mb_eeprom_iface::make(mb.zpu_ctrl, mb.zpu_i2c);
if (dev_addr.has_key("blank_eeprom"))
{
- UHD_MSG(warning) << "Obliterating the motherboard EEPROM..." << std::endl;
+ UHD_LOGGER_WARNING("X300") << "Obliterating the motherboard EEPROM..." ;
eeprom16->write_eeprom(0x50, 0, byte_vector_t(256, 0xff));
}
const mboard_eeprom_t mb_eeprom(*eeprom16, "X300");
@@ -747,9 +777,9 @@ void x300_impl::setup_mb(const size_t mb_i, const uhd::device_addr_t &dev_addr)
bool recover_mb_eeprom = dev_addr.has_key("recover_mb_eeprom");
if (recover_mb_eeprom) {
- UHD_MSG(warning) << "UHD is operating in EEPROM Recovery Mode which disables hardware version "
+ UHD_LOGGER_WARNING("X300") << "UHD is operating in EEPROM Recovery Mode which disables hardware version "
"checks.\nOperating in this mode may cause hardware damage and unstable "
- "radio performance!"<< std::endl;
+ "radio performance!";
}
////////////////////////////////////////////////////////////////////
@@ -829,7 +859,7 @@ void x300_impl::setup_mb(const size_t mb_i, const uhd::device_addr_t &dev_addr)
////////////////////////////////////////////////////////////////////
// create clock control objects
////////////////////////////////////////////////////////////////////
- UHD_MSG(status) << "Setup RF frontend clocking..." << std::endl;
+ UHD_LOGGER_INFO("X300") << "Setup RF frontend clocking...";
//Initialize clock control registers. NOTE: This does not configure the LMK yet.
mb.clock = x300_clock_ctrl::make(mb.zpu_spi,
@@ -851,8 +881,7 @@ void x300_impl::setup_mb(const size_t mb_i, const uhd::device_addr_t &dev_addr)
.set_publisher(boost::bind(&x300_clock_ctrl::get_master_clock_rate, mb.clock))
;
- UHD_MSG(status) << "Radio 1x clock:" << (mb.clock->get_master_clock_rate()/1e6)
- << std::endl;
+ UHD_LOGGER_INFO("X300") << "Radio 1x clock:" << (mb.clock->get_master_clock_rate()/1e6);
////////////////////////////////////////////////////////////////////
// Create the GPSDO control
@@ -862,18 +891,18 @@ void x300_impl::setup_mb(const size_t mb_i, const uhd::device_addr_t &dev_addr)
//otherwise if not disabled, look for the internal GPSDO
if (mb.zpu_ctrl->peek32(SR_ADDR(X300_FW_SHMEM_BASE, X300_FW_SHMEM_GPSDO_STATUS)) != dont_look_for_gpsdo)
{
- UHD_MSG(status) << "Detecting internal GPSDO.... " << std::flush;
+ UHD_LOGGER_INFO("X300") << "Detecting internal GPSDO.... ";
try
{
mb.gps = gps_ctrl::make(x300_make_uart_iface(mb.zpu_ctrl));
}
catch(std::exception &e)
{
- UHD_MSG(error) << "An error occurred making GPSDO control: " << e.what() << std::endl;
+ UHD_LOGGER_ERROR("X300") << "An error occurred making GPSDO control: " << e.what() ;
}
if (mb.gps and mb.gps->gps_detected())
{
- BOOST_FOREACH(const std::string &name, mb.gps->get_sensors())
+ for(const std::string &name: mb.gps->get_sensors())
{
_tree->create<sensor_value_t>(mb_path / "sensors" / name)
.set_publisher(boost::bind(&gps_ctrl::get_sensor, mb.gps, name));
@@ -886,14 +915,6 @@ void x300_impl::setup_mb(const size_t mb_i, const uhd::device_addr_t &dev_addr)
}
////////////////////////////////////////////////////////////////////
- //clear router?
- ////////////////////////////////////////////////////////////////////
- for (size_t i = 0; i < 512; i++) {
- mb.zpu_ctrl->poke32(SR_ADDR(SETXB_BASE, i), 0);
- }
-
-
- ////////////////////////////////////////////////////////////////////
// setup time sources and properties
////////////////////////////////////////////////////////////////////
_tree->create<std::string>(mb_path / "time_source" / "value")
@@ -950,8 +971,7 @@ void x300_impl::setup_mb(const size_t mb_i, const uhd::device_addr_t &dev_addr)
n_rfnoc_blocks,
X300_XB_DST_PCI + 1, /* base port */
uhd::sid_t(X300_SRC_ADDR0, 0, X300_DST_ADDR + mb_i, 0),
- dev_addr,
- mb.if_pkt_is_big_endian ? ENDIANNESS_BIG : ENDIANNESS_LITTLE
+ dev_addr
);
//////////////// RFNOC /////////////////
@@ -961,11 +981,11 @@ void x300_impl::setup_mb(const size_t mb_i, const uhd::device_addr_t &dev_addr)
find_blocks<rfnoc::x300_radio_ctrl_impl>(radio_blockid_hint);
if (not radio_ids.empty()) {
if (radio_ids.size() > 2) {
- UHD_MSG(warning) << "Too many Radio Blocks found. Using only the first two." << std::endl;
+ UHD_LOGGER_WARNING("X300") << "Too many Radio Blocks found. Using only the first two." ;
radio_ids.resize(2);
}
- BOOST_FOREACH(const rfnoc::block_id_t &id, radio_ids) {
+ for(const rfnoc::block_id_t &id: radio_ids) {
rfnoc::x300_radio_ctrl_impl::sptr radio(get_block_ctrl<rfnoc::x300_radio_ctrl_impl>(id));
mb.radios.push_back(radio);
radio->setup_radio(
@@ -1003,7 +1023,7 @@ void x300_impl::setup_mb(const size_t mb_i, const uhd::device_addr_t &dev_addr)
}
} else {
- UHD_MSG(status) << "No Radio Block found. Assuming radio-less operation." << std::endl;
+ UHD_LOGGER_INFO("X300") << "No Radio Block found. Assuming radio-less operation.";
} /* end of radio block(s) initialization */
mb.initialization_done = true;
@@ -1013,7 +1033,7 @@ x300_impl::~x300_impl(void)
{
try
{
- BOOST_FOREACH(mboard_members_t &mb, _mb)
+ for(mboard_members_t &mb: _mb)
{
//kill the claimer task and unclaim the device
mb.claimer_task.reset();
@@ -1046,8 +1066,8 @@ uint32_t x300_impl::mboard_members_t::allocate_pcie_dma_chan(const uhd::sid_t &t
if (_dma_chan_pool.count(raw_sid) == 0) {
_dma_chan_pool[raw_sid] = _dma_chan_pool.size() + FIRST_DATA_CHANNEL;
- UHD_LOG << "[X300] Assigning PCIe DMA channel " << _dma_chan_pool[raw_sid]
- << " to SID " << tx_sid.to_pp_string_hex() << std::endl;
+ UHD_LOGGER_DEBUG("X300") << "[X300] Assigning PCIe DMA channel " << _dma_chan_pool[raw_sid]
+ << " to SID " << tx_sid.to_pp_string_hex() ;
}
if (_dma_chan_pool.size() + FIRST_DATA_CHANNEL > X300_PCIE_MAX_CHANNELS) {
@@ -1072,6 +1092,7 @@ uhd::both_xports_t x300_impl::make_transport(
zero_copy_xport_params default_buff_args;
both_xports_t xports;
+ xports.endianness = mb.if_pkt_is_big_endian ? ENDIANNESS_BIG : ENDIANNESS_LITTLE;
if (mb.xport_path == "nirio") {
xports.send_sid = this->allocate_sid(mb, address, X300_SRC_ADDR0, X300_XB_DST_PCI);
xports.recv_sid = xports.send_sid.reversed();
@@ -1181,23 +1202,23 @@ uhd::both_xports_t x300_impl::make_transport(
/* Print a warning if the system's max available frame size is less than the most optimal
* frame size for this type of connection. */
if (_max_frame_sizes.send_frame_size < eth_data_rec_frame_size) {
- UHD_MSG(warning)
+ UHD_LOGGER_WARNING("X300")
<< boost::format("For this connection, UHD recommends a send frame size of at least %lu for best\nperformance, but your system's MTU will only allow %lu.")
% eth_data_rec_frame_size
% _max_frame_sizes.send_frame_size
- << std::endl
+
<< "This will negatively impact your maximum achievable sample rate."
- << std::endl;
+ ;
}
if (_max_frame_sizes.recv_frame_size < eth_data_rec_frame_size) {
- UHD_MSG(warning)
+ UHD_LOGGER_WARNING("X300")
<< boost::format("For this connection, UHD recommends a receive frame size of at least %lu for best\nperformance, but your system's MTU will only allow %lu.")
% eth_data_rec_frame_size
% _max_frame_sizes.recv_frame_size
- << std::endl
+
<< "This will negatively impact your maximum achievable sample rate."
- << std::endl;
+ ;
}
size_t system_max_send_frame_size = (size_t) _max_frame_sizes.send_frame_size;
@@ -1255,8 +1276,8 @@ uhd::both_xports_t x300_impl::make_transport(
//send a mini packet with SID into the ZPU
//ZPU will reprogram the ethernet framer
- UHD_LOG << "programming packet for new xport on "
- << interface_addr << " sid " << xports.send_sid << std::endl;
+ UHD_LOGGER_DEBUG("X300") << "programming packet for new xport on "
+ << interface_addr << " sid " << xports.send_sid ;
//YES, get a __send__ buffer from the __recv__ socket
//-- this is the only way to program the framer for recv:
managed_send_buffer::sptr buff = xports.recv->get_send_buff();
@@ -1266,7 +1287,7 @@ uhd::both_xports_t x300_impl::make_transport(
buff.reset();
//reprogram the ethernet dispatcher's udp port (should be safe to always set)
- UHD_LOG << "reprogram the ethernet dispatcher's udp port" << std::endl;
+ UHD_LOGGER_DEBUG("X300") << "reprogram the ethernet dispatcher's udp port" ;
mb.zpu_ctrl->poke32(SR_ADDR(SET0_BASE, (ZPU_SR_ETHINT0+8+3)), X300_VITA_UDP_PORT);
mb.zpu_ctrl->poke32(SR_ADDR(SET0_BASE, (ZPU_SR_ETHINT1+8+3)), X300_VITA_UDP_PORT);
@@ -1298,7 +1319,7 @@ uhd::sid_t x300_impl::allocate_sid(
// This type of packet does not match the XB_LOCAL address and is looked up in the lower half of the CAM
mb.zpu_ctrl->poke32(SR_ADDR(SETXB_BASE, 0 + src_addr), src_dst);
- UHD_LOG << "done router config for sid " << sid << std::endl;
+ UHD_LOGGER_DEBUG("X300") << "done router config for sid " << sid ;
//increment for next setup
_sid_framer++;
@@ -1355,8 +1376,8 @@ void x300_impl::update_clock_source(mboard_members_t &mb, const std::string &sou
throw uhd::runtime_error((boost::format("Reference Clock PLL failed to lock to %s source.") % source).str());
} else {
//TODO: Re-enable this warning when we figure out a reliable lock time
- //UHD_MSG(warning) << "Reference clock failed to lock to " + source + " during device initialization. " <<
- // "Check for the lock before operation or ignore this warning if using another clock source." << std::endl;
+ //UHD_LOGGER_WARNING("X300") << "Reference clock failed to lock to " + source + " during device initialization. " <<
+ // "Check for the lock before operation or ignore this warning if using another clock source." ;
}
}
}
@@ -1381,7 +1402,7 @@ void x300_impl::update_clock_source(mboard_members_t &mb, const std::string &sou
}
// Reset ADCs and DACs
- BOOST_FOREACH(rfnoc::x300_radio_ctrl_impl::sptr r, mb.radios) {
+ for(rfnoc::x300_radio_ctrl_impl::sptr r: mb.radios) {
r->reset_codec();
}
}
@@ -1413,7 +1434,7 @@ void x300_impl::update_time_source(mboard_members_t &mb, const std::string &sour
void x300_impl::sync_times(mboard_members_t &mb, const uhd::time_spec_t& t)
{
std::vector<rfnoc::block_id_t> radio_ids = find_blocks<rfnoc::x300_radio_ctrl_impl>("Radio");
- BOOST_FOREACH(const rfnoc::block_id_t &id, radio_ids) {
+ for(const rfnoc::block_id_t &id: radio_ids) {
get_block_ctrl<rfnoc::x300_radio_ctrl_impl>(id)->set_time_sync(t);
}
@@ -1574,7 +1595,7 @@ x300_impl::frame_size_t x300_impl::determine_max_frame_size(const std::string &a
size_t min_send_frame_size = sizeof(x300_mtu_t);
size_t max_send_frame_size = std::min(user_frame_size.send_frame_size, X300_10GE_DATA_FRAME_MAX_SIZE) & size_t(~3);
- UHD_MSG(status) << "Determining maximum frame size... ";
+ UHD_LOGGER_INFO("X300") << "Determining maximum frame size... ";
while (min_recv_frame_size < max_recv_frame_size)
{
size_t test_frame_size = (max_recv_frame_size/2 + min_recv_frame_size/2 + 3) & ~3;
@@ -1623,7 +1644,7 @@ x300_impl::frame_size_t x300_impl::determine_max_frame_size(const std::string &a
// of the recv and send frame sizes.
frame_size.recv_frame_size = std::min(min_recv_frame_size, min_send_frame_size);
frame_size.send_frame_size = std::min(min_recv_frame_size, min_send_frame_size);
- UHD_MSG(status) << frame_size.send_frame_size << " bytes." << std::endl;
+ UHD_LOGGER_INFO("X300") << "Maximim frame size: " << frame_size.send_frame_size << " bytes.";
return frame_size;
}
@@ -1800,7 +1821,7 @@ x300_impl::x300_mboard_t x300_impl::get_mb_type_from_eeprom(const uhd::usrp::mbo
case X310_2955R_PCIE_SSID_ADC_18:
mb_type = USRP_X310_MB; break;
default:
- UHD_MSG(warning) << "X300 unknown product code in EEPROM: " << product_num << std::endl;
+ UHD_LOGGER_WARNING("X300") << "X300 unknown product code in EEPROM: " << product_num ;
mb_type = UNKNOWN; break;
}
}