Hi,
I need to determine which blocks are on a given FPGA image (using UHD).  I
had hoped to use the device3->find_blocks() function for this purpose, but
this function seems to require that you know the names of the blocks in
advance (because of the corresponding block_id_t::match() function that is
called).

I was able to implement the code below in order to enumerate the blocks,
but this implementation doesn't seem like a great solution to me since it
requires me to know the property tree structure.  I had hoped to find a
function that would not require me to know the tree.

Please let me know if there is a better method.  If not, is there a chance
Ettus would implement one or alternatively modify the existing
device3->find_blocks() such that you don't need to know the names of the
blocks in advance?
Rob

std::vector<uhd::rfnoc::block_id_t> blk_ids;
for (size_t mb = 0; mb<usrp->get_num_mboards(); mb++) {
  uhd::fs_path path("/mboards/" + std::to_string(mb) + "/xbar/");
  std::vector<std::string> names =
    usrp->get_device3()->get_tree()->list(path);
  for (auto name: names) {
    uhd::rfnoc::block_id_t id(name);
    id.set_device_no(mb);
    blk_ids.push_back(id);
  }
}
_______________________________________________
USRP-users mailing list
USRP-users@lists.ettus.com
http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com

Reply via email to