aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/mpmd/mpmd_impl.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib/usrp/mpmd/mpmd_impl.hpp')
-rw-r--r--host/lib/usrp/mpmd/mpmd_impl.hpp53
1 files changed, 42 insertions, 11 deletions
diff --git a/host/lib/usrp/mpmd/mpmd_impl.hpp b/host/lib/usrp/mpmd/mpmd_impl.hpp
index 9a8b25ba0..6af2e4385 100644
--- a/host/lib/usrp/mpmd/mpmd_impl.hpp
+++ b/host/lib/usrp/mpmd/mpmd_impl.hpp
@@ -34,6 +34,7 @@ static const char MPM_DISCOVERY_CMD[] = "MPM-DISC";
static const char MPM_ECHO_CMD[] = "MPM-ECHO";
static const size_t MPMD_10GE_DATA_FRAME_MAX_SIZE = 8000; // CHDR packet size in bytes
+
struct frame_size_t
{
size_t recv_frame_size;
@@ -46,35 +47,49 @@ struct frame_size_t
class mpmd_mboard_impl
{
public:
+ /*** Types ***************************************************************/
using uptr = std::unique_ptr<mpmd_mboard_impl>;
using dev_info = std::map<std::string, std::string>;
+
+ /*** Structors ***********************************************************/
mpmd_mboard_impl(const std::string& addr);
~mpmd_mboard_impl();
+
+ /*** Factory *************************************************************/
static uptr make(const std::string& addr);
- bool initialization_done = false;
+ /*** Public attributes ***************************************************/
+ //! Device information is read back via MPM and stored here.
uhd::dict<std::string, std::string> device_info;
- uhd::dict<std::string, std::string> recv_args;
- uhd::dict<std::string, std::string> send_args;
- std::map<std::string, std::string> data_interfaces;
- std::string loaded_fpga_image;
- std::string xport_path;
- /*! Reference the RPC client for this motherboard
+ //! Number of RFNoC crossbars on this device
+ size_t num_xbars = 0;
+
+ /*! Reference to the RPC client for this motherboard
*
* We store a shared ptr, because we might share it with some of the RFNoC
* blocks.
*/
uhd::rpc_client::sptr rpc;
+
+
+ /*************************************************************************
+ * API
+ ************************************************************************/
uhd::sid_t allocate_sid(const uint16_t port,
const uhd::sid_t address,
const uint32_t xbar_src_addr,
const uint32_t xbar_src_dst);
private:
+ /*! Renew the claim onto the device.
+ *
+ * This is meant to be called repeatedly, e.g., using a UHD task.
+ */
bool claim();
- std::string generate_token() const;
- std::string _rpc_token;
+
+ /*! Continuously reclaims the device.
+ */
uhd::task::sptr _claimer_task;
};
@@ -91,19 +106,35 @@ class mpmd_impl : public uhd::usrp::device3_impl
mpmd_impl(const uhd::device_addr_t& device_addr);
~mpmd_impl();
- mpmd_mboard_impl::uptr setup_mb(const size_t mb_i,
- const uhd::device_addr_t& dev_addr);
uhd::both_xports_t make_transport(const uhd::sid_t&,
uhd::usrp::device3_impl::xport_type_t,
const uhd::device_addr_t&);
private:
+ mpmd_mboard_impl::uptr setup_mb(
+ const size_t mb_i,
+ const uhd::device_addr_t& dev_addr
+ );
+
+ void setup_rfnoc_blocks(
+ const size_t mb_i,
+ const uhd::device_addr_t& dev_addr
+ );
+
+ //! Configure all blocks that require access to an RPC client
+ void setup_rpc_blocks(const uhd::device_addr_t &block_args);
+
uhd::device_addr_t get_rx_hints(size_t mb_index);
+ uhd::dict<std::string, std::string> recv_args;
+ uhd::dict<std::string, std::string> send_args;
+
uhd::device_addr_t _device_addr;
std::vector<mpmd_mboard_impl::uptr> _mb;
size_t _sid_framer;
};
+
uhd::device_addrs_t mpmd_find(const uhd::device_addr_t& hint_);
+
#endif /* INCLUDED_MPMD_IMPL_HPP */
// vim: sw=4 expandtab: