From 6013a511370b9452020adfc72d7893f1c3bb2963 Mon Sep 17 00:00:00 2001 From: Trung Tran Date: Mon, 23 Jul 2018 15:23:01 -0700 Subject: mpmd: add option to enum rfnoc blocks from args --- host/lib/usrp/mpmd/mpmd_impl.cpp | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/host/lib/usrp/mpmd/mpmd_impl.cpp b/host/lib/usrp/mpmd/mpmd_impl.cpp index d63a2cfa0..80061ede3 100644 --- a/host/lib/usrp/mpmd/mpmd_impl.cpp +++ b/host/lib/usrp/mpmd/mpmd_impl.cpp @@ -297,12 +297,16 @@ void mpmd_impl::setup_rfnoc_blocks( UHD_LOG_TRACE("MPMD", "Mboard " << mb_index << " reports " << mb->num_xbars << " crossbar(s)." ); - + // TODO: The args apply to all xbars, which may or may not be true for (size_t xbar_index = 0; xbar_index < mb->num_xbars; xbar_index++) { - const size_t num_blocks = - mb->rpc->request("get_num_blocks", xbar_index); - const size_t base_port = - mb->rpc->request("get_base_port", xbar_index); + // Pull the number of blocks and base port from the args, if available. + // Otherwise, get the values from MPM. + const size_t num_blocks = ctrl_xport_args.has_key("rfnoc_num_blocks") + ? ctrl_xport_args.cast("rfnoc_num_blocks", 0) + : mb->rpc->request("get_num_blocks", xbar_index); + const size_t base_port = ctrl_xport_args.has_key("rfnoc_base_port") + ? ctrl_xport_args.cast("rfnoc_base_port", 0) + : mb->rpc->request("get_base_port", xbar_index); const size_t local_addr = mb->get_xbar_local_addr(xbar_index); UHD_LOGGER_TRACE("MPMD") << "Enumerating RFNoC blocks for xbar " << xbar_index @@ -310,6 +314,18 @@ void mpmd_impl::setup_rfnoc_blocks( << " Base port: " << base_port << " Local address: " << local_addr ; + if (ctrl_xport_args.has_key("rfnoc_num_blocks") or + ctrl_xport_args.has_key("rfnoc_base_port")) { + // TODO: Remove this warning once we're confident this is + // (relatively) safe and useful. Also add documentation to + // usrp_n3xx.dox + UHD_LOGGER_WARNING("MPMD") + << "Overriding default RFNoC configuration. You are using an " + << "experimental development feature, which may go away in " + << "future versions." + ; + } + try { enumerate_rfnoc_blocks( mb_index, -- cgit v1.2.3