diff options
Diffstat (limited to 'host/lib/usrp/device3/device3_impl.cpp')
-rw-r--r-- | host/lib/usrp/device3/device3_impl.cpp | 48 |
1 files changed, 35 insertions, 13 deletions
diff --git a/host/lib/usrp/device3/device3_impl.cpp b/host/lib/usrp/device3/device3_impl.cpp index 6f1719500..772008a38 100644 --- a/host/lib/usrp/device3/device3_impl.cpp +++ b/host/lib/usrp/device3/device3_impl.cpp @@ -13,8 +13,6 @@ #include <boost/make_shared.hpp> #include <algorithm> -#define UHD_DEVICE3_LOG() UHD_LOGGER_TRACE("DEVICE3") - using namespace uhd::usrp; device3_impl::device3_impl() @@ -108,7 +106,6 @@ void device3_impl::enumerate_rfnoc_blocks( // TODO: Clear out all the old block control classes // 3) Create new block controllers for (size_t i = 0; i < n_blocks; i++) { - UHD_DEVICE3_LOG() << "[RFNOC] ------- Block Setup -----------" ; // First, make a transport for port number zero, because we always need that: ctrl_sid.set_dst_xbarport(base_port + i); ctrl_sid.set_dst_blockport(0); @@ -117,22 +114,39 @@ void device3_impl::enumerate_rfnoc_blocks( CTRL, transport_args ); - UHD_DEVICE3_LOG() << str(boost::format("Setting up NoC-Shell Control for port #0 (SID: %s)...") % xport.send_sid.to_pp_string_hex()); + UHD_LOG_TRACE("DEVICE3", + str(boost::format("Setting up NoC-Shell Control for port #0 (SID: %s)...") + % xport.send_sid.to_pp_string_hex()) + ); uhd::rfnoc::ctrl_iface::sptr ctrl = uhd::rfnoc::ctrl_iface::make( - xport, - str(boost::format("CE_%02d_Port_%02X") % i % ctrl_sid.get_dst_endpoint()) + xport, + str(boost::format("CE_%02d_Port_%02X") + % i + % ctrl_sid.get_dst_endpoint()) + ); + uint64_t noc_id = ctrl->send_cmd_pkt( + uhd::rfnoc::SR_READBACK, + uhd::rfnoc::SR_READBACK_REG_ID, + true ); - uint64_t noc_id = ctrl->send_cmd_pkt(uhd::rfnoc::SR_READBACK, uhd::rfnoc::SR_READBACK_REG_ID, true); - UHD_DEVICE3_LOG() << str(boost::format("Port %d: Found NoC-Block with ID %016X.") % int(ctrl_sid.get_dst_endpoint()) % noc_id) ; + UHD_LOG_DEBUG("DEVICE3", str( + boost::format("Port 0x%02X: Found NoC-Block with ID %016X.") + % int(ctrl_sid.get_dst_endpoint()) + % noc_id + )); uhd::rfnoc::make_args_t make_args; uhd::rfnoc::blockdef::sptr block_def = uhd::rfnoc::blockdef::make_from_noc_id(noc_id); if (not block_def) { - UHD_DEVICE3_LOG() << "Using default block configuration." ; - block_def = uhd::rfnoc::blockdef::make_from_noc_id(uhd::rfnoc::DEFAULT_NOC_ID); + UHD_LOG_WARNING("DEVICE3", + "No block definition found, using default block configuration " + "for block with NOC ID: " + str(boost::format("0x%08X") % noc_id) + ); + block_def = uhd::rfnoc::blockdef::make_from_noc_id( + uhd::rfnoc::DEFAULT_NOC_ID); } UHD_ASSERT_THROW(block_def); make_args.ctrl_ifaces[0] = ctrl; - for(const size_t port_number: block_def->get_all_port_numbers()) { + for (const size_t port_number : block_def->get_all_port_numbers()) { if (port_number == 0) { // We've already set this up continue; } @@ -142,14 +156,22 @@ void device3_impl::enumerate_rfnoc_blocks( CTRL, transport_args ); - UHD_DEVICE3_LOG() << str(boost::format("Setting up NoC-Shell Control for port #%d (SID: %s)...") % port_number % xport1.send_sid.to_pp_string_hex()); + UHD_LOG_TRACE("DEVICE3", str( + boost::format("Setting up NoC-Shell Control for port #%d " + "(SID: %s)...") + % port_number + % xport1.send_sid.to_pp_string_hex() + )); uhd::rfnoc::ctrl_iface::sptr ctrl1 = uhd::rfnoc::ctrl_iface::make( xport1, str(boost::format("CE_%02d_Port_%02d") % i % ctrl_sid.get_dst_endpoint()) ); - UHD_DEVICE3_LOG() << "OK" ; make_args.ctrl_ifaces[port_number] = ctrl1; } + UHD_LOG_TRACE("DEVICE3", + "All control transports successfully created for block with ID " << + str(boost::format("0x%08X") % noc_id) + ); make_args.base_address = xport.send_sid.get_dst(); make_args.device_index = device_index; |