From c256b9df6502536c2e451e690f1ad5962c664d1a Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Wed, 3 Jul 2019 20:15:35 -0700 Subject: x300/mpmd: Port all RFNoC devices to the new RFNoC framework Co-Authored-By: Alex Williams Co-Authored-By: Sugandha Gupta Co-Authored-By: Brent Stapleton Co-Authored-By: Ciro Nishiguchi --- host/lib/usrp/mpmd/mpmd_mb_iface.hpp | 68 ++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 host/lib/usrp/mpmd/mpmd_mb_iface.hpp (limited to 'host/lib/usrp/mpmd/mpmd_mb_iface.hpp') diff --git a/host/lib/usrp/mpmd/mpmd_mb_iface.hpp b/host/lib/usrp/mpmd/mpmd_mb_iface.hpp new file mode 100644 index 000000000..4e47dd35a --- /dev/null +++ b/host/lib/usrp/mpmd/mpmd_mb_iface.hpp @@ -0,0 +1,68 @@ +// +// Copyright 2019 Ettus Research, a National Instruments Brand +// +// SPDX-License-Identifier: GPL-3.0-or-later +// + +#ifndef INCLUDED_MPMD_MB_IFACE_HPP +#define INCLUDED_MPMD_MB_IFACE_HPP + +#include "mpmd_impl.hpp" +#include "mpmd_link_if_mgr.hpp" +#include +#include +#include + +namespace uhd { namespace mpmd { + +class mpmd_mboard_impl::mpmd_mb_iface : public uhd::rfnoc::mb_iface +{ +public: + using uptr = std::unique_ptr; + using clock_iface_list_t = std::vector>; + mpmd_mb_iface(const uhd::device_addr_t& mb_args, uhd::rpc_client::sptr rpc); + ~mpmd_mb_iface() = default; + + /*** mpmd_mb_iface API calls *****************************************/ + //! Initialize transports + void init(); + + /*** mb_iface API calls **********************************************/ + uint16_t get_proto_ver(); + uhd::rfnoc::chdr_w_t get_chdr_w(); + uhd::endianness_t get_endianness(const uhd::rfnoc::device_id_t local_device_id); + uhd::rfnoc::device_id_t get_remote_device_id(); + std::vector get_local_device_ids(); + uhd::transport::adapter_id_t get_adapter_id(const uhd::rfnoc::device_id_t local_device_id); + void reset_network(); + uhd::rfnoc::clock_iface::sptr get_clock_iface(const std::string& clock_name); + uhd::rfnoc::chdr_ctrl_xport::sptr make_ctrl_transport( + uhd::rfnoc::device_id_t local_device_id, const uhd::rfnoc::sep_id_t& local_epid); + uhd::rfnoc::chdr_rx_data_xport::uptr make_rx_data_transport( + uhd::rfnoc::mgmt::mgmt_portal& mgmt_portal, + const uhd::rfnoc::sep_addr_pair_t& addrs, + const uhd::rfnoc::sep_id_pair_t& epids, + const uhd::rfnoc::sw_buff_t pyld_buff_fmt, + const uhd::rfnoc::sw_buff_t mdata_buff_fmt, + const uhd::device_addr_t& xport_args); + uhd::rfnoc::chdr_tx_data_xport::uptr make_tx_data_transport( + uhd::rfnoc::mgmt::mgmt_portal& mgmt_portal, + const uhd::rfnoc::sep_addr_pair_t& addrs, + const uhd::rfnoc::sep_id_pair_t& epids, + const uhd::rfnoc::sw_buff_t pyld_buff_fmt, + const uhd::rfnoc::sw_buff_t mdata_buff_fmt, + const uhd::device_addr_t& xport_args); + +private: + uhd::device_addr_t _mb_args; + uhd::rpc_client::sptr _rpc; + xport::mpmd_link_if_mgr::uptr _link_if_mgr; + uhd::rfnoc::device_id_t _remote_device_id; + std::map _local_device_id_map; + std::unordered_map _adapter_map; + std::map _clock_ifaces; +}; + +}} /* namespace uhd::mpmd */ + +#endif /* INCLUDED_MPMD_MB_IFACE_HPP */ -- cgit v1.2.3