rfnoc_graph: Add get_chdr_width() API call

This allows querying the CHDR width for a given device in an RFNoC
graph. The mb_index parameter is mostly for future proofing, given that
the CHDR width must be constant between devices.
This commit is contained in:
Martin Braun 2025-01-13 10:24:59 +01:00 committed by Jörg Hofrichter
parent dcb582d2b3
commit e25b16a303
2 changed files with 10 additions and 0 deletions

View File

@ -10,6 +10,7 @@
#include <uhd/rfnoc/block_id.hpp>
#include <uhd/rfnoc/graph_edge.hpp>
#include <uhd/rfnoc/noc_block_base.hpp>
#include <uhd/rfnoc/rfnoc_types.hpp>
#include <uhd/stream.hpp>
#include <uhd/transport/adapter_id.hpp>
#include <uhd/types/device_addr.hpp>
@ -428,6 +429,9 @@ public:
//! Return a reference to the property tree
virtual uhd::property_tree::sptr get_tree(void) const = 0;
//! Return the CHDR width for a given device
virtual chdr_w_t get_chdr_width(const size_t mb_index = 0) const = 0;
}; // class rfnoc_graph
}}; // namespace uhd::rfnoc

View File

@ -591,6 +591,12 @@ public:
return _graph->to_dot();
}
chdr_w_t get_chdr_width(const size_t mb_index) const
{
UHD_ASSERT_THROW(mb_index < _num_mboards);
return _device->get_mb_iface(mb_index).get_chdr_w();
}
private:
/**************************************************************************
* Device Setup