aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/include/uhdlib/rfnoc
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib/include/uhdlib/rfnoc')
-rw-r--r--host/lib/include/uhdlib/rfnoc/graph_stream_manager.hpp9
-rw-r--r--host/lib/include/uhdlib/rfnoc/link_stream_manager.hpp8
-rw-r--r--host/lib/include/uhdlib/rfnoc/mb_iface.hpp34
-rw-r--r--host/lib/include/uhdlib/rfnoc/rfnoc_common.hpp5
4 files changed, 50 insertions, 6 deletions
diff --git a/host/lib/include/uhdlib/rfnoc/graph_stream_manager.hpp b/host/lib/include/uhdlib/rfnoc/graph_stream_manager.hpp
index 8a721ea26..b9f4205ab 100644
--- a/host/lib/include/uhdlib/rfnoc/graph_stream_manager.hpp
+++ b/host/lib/include/uhdlib/rfnoc/graph_stream_manager.hpp
@@ -19,6 +19,7 @@
#include <functional>
#include <memory>
#include <set>
+#include <string>
#include <tuple>
namespace uhd { namespace rfnoc {
@@ -114,6 +115,7 @@ public:
* \param mdata_buff_fmt Datatype of SW buffer that holds the data metadata
* \param adapter The preference for the adapter to use to get to the destination
* \param xport_args The transport arguments
+ * \param streamer_id A unique identifier for the streamer that will own the transport
* \return An transport instance
*/
virtual chdr_rx_data_xport::uptr create_device_to_host_data_stream(
@@ -121,7 +123,8 @@ public:
const sw_buff_t pyld_buff_fmt,
const sw_buff_t mdata_buff_fmt,
const uhd::transport::adapter_id_t adapter,
- const device_addr_t& xport_args) = 0;
+ const device_addr_t& xport_args,
+ const std::string& streamer_id) = 0;
/*! \brief Create a data stream going from the host to the device
*
@@ -130,6 +133,7 @@ public:
* \param mdata_buff_fmt Datatype of SW buffer that holds the data metadata
* \param adapter The preference for the adapter to use to get to the destination
* \param xport_args The transport arguments
+ * \param streamer_id A unique identifier for the streamer that will own the transport
* \return An transport instance
*/
virtual chdr_tx_data_xport::uptr create_host_to_device_data_stream(
@@ -137,7 +141,8 @@ public:
const sw_buff_t pyld_buff_fmt,
const sw_buff_t mdata_buff_fmt,
const uhd::transport::adapter_id_t adapter,
- const device_addr_t& xport_args) = 0;
+ const device_addr_t& xport_args,
+ const std::string& streamer_id) = 0;
/*! \brief Get all the adapters that can reach the specified endpoint
*
diff --git a/host/lib/include/uhdlib/rfnoc/link_stream_manager.hpp b/host/lib/include/uhdlib/rfnoc/link_stream_manager.hpp
index b1a934891..836a50dcf 100644
--- a/host/lib/include/uhdlib/rfnoc/link_stream_manager.hpp
+++ b/host/lib/include/uhdlib/rfnoc/link_stream_manager.hpp
@@ -126,13 +126,15 @@ public:
* \param pyld_buff_fmt Datatype of SW buffer that holds the data payload
* \param mdata_buff_fmt Datatype of SW buffer that holds the data metadata
* \param xport_args The transport arguments
+ * \param streamer_id A unique identifier for the streamer that will own the transport
* \return An transport instance
*/
virtual chdr_tx_data_xport::uptr create_host_to_device_data_stream(
const sep_addr_t dst_addr,
const sw_buff_t pyld_buff_fmt,
const sw_buff_t mdata_buff_fmt,
- const device_addr_t& xport_args) = 0;
+ const device_addr_t& xport_args,
+ const std::string& streamer_id) = 0;
/*! \brief Create a data stream going from the device to the host
*
@@ -140,13 +142,15 @@ public:
* \param pyld_buff_fmt Datatype of SW buffer that holds the data payload
* \param mdata_buff_fmt Datatype of SW buffer that holds the data metadata
* \param xport_args The transport arguments
+ * \param streamer_id A unique identifier for the streamer that will own the transport
* \return An transport instance
*/
virtual chdr_rx_data_xport::uptr create_device_to_host_data_stream(
const sep_addr_t src_addr,
const sw_buff_t pyld_buff_fmt,
const sw_buff_t mdata_buff_fmt,
- const device_addr_t& xport_args) = 0;
+ const device_addr_t& xport_args,
+ const std::string& streamer_id) = 0;
static uptr make(const chdr::chdr_packet_factory& pkt_factory,
mb_iface& mb_if,
diff --git a/host/lib/include/uhdlib/rfnoc/mb_iface.hpp b/host/lib/include/uhdlib/rfnoc/mb_iface.hpp
index abfc9d1c4..53f0897f9 100644
--- a/host/lib/include/uhdlib/rfnoc/mb_iface.hpp
+++ b/host/lib/include/uhdlib/rfnoc/mb_iface.hpp
@@ -7,6 +7,7 @@
#ifndef INCLUDED_LIBUHD_MB_IFACE_HPP
#define INCLUDED_LIBUHD_MB_IFACE_HPP
+#include <uhd/exception.hpp>
#include <uhd/transport/adapter_id.hpp>
#include <uhd/types/endianness.hpp>
#include <uhdlib/rfnoc/chdr_ctrl_xport.hpp>
@@ -14,6 +15,7 @@
#include <uhdlib/rfnoc/chdr_tx_data_xport.hpp>
#include <uhdlib/rfnoc/clock_iface.hpp>
#include <uhdlib/rfnoc/rfnoc_common.hpp>
+#include <uhdlib/usrp/common/io_service_mgr.hpp>
#include <memory>
namespace uhd { namespace rfnoc {
@@ -86,6 +88,27 @@ public:
virtual std::shared_ptr<clock_iface> get_clock_iface(
const std::string& clock_name) = 0;
+ /*! Set the IO service manager
+ *
+ */
+ void set_io_srv_mgr(uhd::usrp::io_service_mgr::sptr io_srv_mgr)
+ {
+ _io_srv_mgr = io_srv_mgr;
+ }
+
+ /*! Get the I/O Service Manager
+ *
+ * This function must be called by the implementations of the various
+ * make_*_transport() calls to get access to the global I/O Service Manager
+ */
+ uhd::usrp::io_service_mgr::sptr get_io_srv_mgr()
+ {
+ if (!_io_srv_mgr) {
+ throw uhd::runtime_error("I/O Service Manager not set for mb_iface!");
+ }
+ return _io_srv_mgr;
+ }
+
/*! Create a control transport
*
* This is usually called once per motherboard, since there is only one
@@ -108,6 +131,7 @@ public:
* \param pyld_buff_fmt Datatype of SW buffer that holds the data payload
* \param mdata_buff_fmt Datatype of SW buffer that holds the data metadata
* \param xport_args Transport configuration args
+ * \param streamer_id A unique identifier for the streamer that will own the transport
* \return A CHDR RX data transport
*/
virtual chdr_rx_data_xport::uptr make_rx_data_transport(
@@ -116,7 +140,8 @@ public:
const sep_id_pair_t& epids,
const sw_buff_t pyld_buff_fmt,
const sw_buff_t mdata_buff_fmt,
- const device_addr_t& xport_args) = 0;
+ const device_addr_t& xport_args,
+ const std::string& streamer_id) = 0;
/*! Create an TX data transport
*
@@ -127,6 +152,7 @@ public:
* \param pyld_buff_fmt Datatype of SW buffer that holds the data payload
* \param mdata_buff_fmt Datatype of SW buffer that holds the data metadata
* \param xport_args Transport configuration args
+ * \param streamer_id A unique identifier for the streamer that will own the transport
* \return A CHDR TX data transport
*/
virtual chdr_tx_data_xport::uptr make_tx_data_transport(
@@ -135,7 +161,11 @@ public:
const sep_id_pair_t& epids,
const uhd::rfnoc::sw_buff_t pyld_buff_fmt,
const uhd::rfnoc::sw_buff_t mdata_buff_fmt,
- const device_addr_t& xport_args) = 0;
+ const device_addr_t& xport_args,
+ const std::string& streamer_id) = 0;
+
+private:
+ uhd::usrp::io_service_mgr::sptr _io_srv_mgr;
};
}} /* namespace uhd::rfnoc */
diff --git a/host/lib/include/uhdlib/rfnoc/rfnoc_common.hpp b/host/lib/include/uhdlib/rfnoc/rfnoc_common.hpp
index c2ec4e0e3..226d4f069 100644
--- a/host/lib/include/uhdlib/rfnoc/rfnoc_common.hpp
+++ b/host/lib/include/uhdlib/rfnoc/rfnoc_common.hpp
@@ -95,6 +95,11 @@ constexpr uint32_t MAX_FC_FREQ_PKTS = (uint32_t(1) << 24) - 1;
constexpr uint64_t MAX_FC_HEADROOM_BYTES = (uint64_t(1) << 16) - 1;
constexpr uint32_t MAX_FC_HEADROOM_PKTS = (uint32_t(1) << 8) - 1;
+// RFNoC devices need a minimum of two frame buffers to be available from the
+// link--one for the data transport and one for the control transport to
+// simultaneously handle MGMT and STRC/STRS initialization packets.
+constexpr size_t MIN_NUM_FRAMES = 2;
+
}} // namespace uhd::rfnoc
#endif /* INCLUDED_RFNOC_RFNOC_COMMON_HPP */