From 2406def0acd7ee4f3f7ac19e3ade1963b4f1c1f5 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Tue, 30 May 2017 17:33:20 -0700 Subject: mpm/mpmd: Crossbar info is now polled instead of hardcoded - Extended base periph manager to provide crossbar info --- host/lib/usrp/mpmd/mpmd_impl.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'host') diff --git a/host/lib/usrp/mpmd/mpmd_impl.cpp b/host/lib/usrp/mpmd/mpmd_impl.cpp index 1d8b2b03b..2464a71cd 100644 --- a/host/lib/usrp/mpmd/mpmd_impl.cpp +++ b/host/lib/usrp/mpmd/mpmd_impl.cpp @@ -120,11 +120,25 @@ mpmd_impl::mpmd_impl(const device_addr_t& device_addr) // TODO read this from the device info _tree->create("/name").set("MPMD - Series device"); + const size_t mb_index = 0; + const size_t num_xbars = _mb[mb_index]->rpc->call("get_num_xbars"); + UHD_ASSERT_THROW(num_xbars >= 1); + if (num_xbars > 1) { + UHD_LOG_WARNING("MPMD", "Only using first crossbar"); + } + const size_t xbar_index = 0; + const size_t num_blocks = _mb[mb_index]->rpc->call("get_num_blocks", xbar_index); + const size_t base_port = _mb[mb_index]->rpc->call("get_base_port", xbar_index); + UHD_LOG_TRACE("MPMD", + "Enumerating RFNoC blocks for xbar " << xbar_index << + ". Total blocks: " << num_blocks << + " Base port: " << base_port + ); try { enumerate_rfnoc_blocks( - 0, - 3, /* num blocks */ // TODO don't hardcode - 3, /* base port */ // TODO don't hardcode + mb_index, + num_blocks, + base_port, uhd::sid_t(0x0200), // TODO don't hardcode device_addr ); -- cgit v1.2.3