aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2019-05-01 16:45:30 -0700
committerMartin Braun <martin.braun@ettus.com>2019-11-26 11:49:14 -0800
commit384a94d1b6e3a980c19df70f8a1a95ec9f52eb6e (patch)
treeb63ace6f820a59bea09b2d8764b7a65def18d4a6 /host/lib
parent26e48e9224e5c62e2a7a7f42f5c7d0ccb7e9d5fd (diff)
downloaduhd-384a94d1b6e3a980c19df70f8a1a95ec9f52eb6e.tar.gz
uhd-384a94d1b6e3a980c19df70f8a1a95ec9f52eb6e.tar.bz2
uhd-384a94d1b6e3a980c19df70f8a1a95ec9f52eb6e.zip
rfnoc: Add rfnoc::mb_iface interface class
Its purpose is to provide a device-agnostic back-channel interface into the device guts for all rfnoc_graph devices.
Diffstat (limited to 'host/lib')
-rw-r--r--host/lib/include/uhdlib/rfnoc/mb_iface.hpp76
1 files changed, 76 insertions, 0 deletions
diff --git a/host/lib/include/uhdlib/rfnoc/mb_iface.hpp b/host/lib/include/uhdlib/rfnoc/mb_iface.hpp
new file mode 100644
index 000000000..dc1bea3ae
--- /dev/null
+++ b/host/lib/include/uhdlib/rfnoc/mb_iface.hpp
@@ -0,0 +1,76 @@
+//
+// Copyright 2019 Ettus Research, a National Instruments Brand
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+//
+
+#ifndef INCLUDED_LIBUHD_MB_IFACE_HPP
+#define INCLUDED_LIBUHD_MB_IFACE_HPP
+
+#include <memory>
+
+namespace uhd { namespace rfnoc {
+
+
+/*! Motherboard (backchannel) interface
+ *
+ * In RFNoC devices, the RFNoC subystem needs a backchannel interface to talk to
+ * the individual motherboards. Every rfnoc_graph needs one interface per
+ * attached motherboard.
+ *
+ * It's up to the various device implementations (e.g., x300_impl) to implement
+ * this interface.
+ */
+class mb_iface {
+public:
+ using uptr = std::unique_ptr<mb_iface>;
+
+ virtual ~mb_iface() = 0;
+
+ /*! Return the RFNoC protocol version for this motherboard
+ */
+ virtual uint16_t get_proto_ver() = 0;
+
+ /*! Return the CHDR width for this motherboard
+ */
+ virtual chdr_w_t get_chdr_width() = 0;
+
+ /*! Set the device ID of this motherboard
+ *
+ * Every motherboard in a multi-USRP setup needs a unique device ID. It is
+ * up to the rfnoc_graph to choose the various IDs, and then call this
+ * function to set it.
+ */
+ virtual void set_device_id(const uint16_t id) = 0;
+
+ /*! Get device ID
+ *
+ * Returns the value previously written by set_device_id(). A freshly
+ * resetted motherboard which has not been assigned a device ID should
+ * return 0xFFFF.
+ *
+ * \returns the motherboard's device ID
+ */
+ virtual uint16_t get_device_id() = 0;
+
+ /*! Reset the device
+ */
+ virtual void reset_network() = 0;
+
+ /*! Return a list of all physical links available from the current UHD
+ * session to the motherboard.
+ *
+ * FIXME determine appropriate return type
+ */
+ //virtual <link info> enumerate_links() = 0;
+
+ /*!
+ *
+ * FIXME determine appropriate return type and arg types
+ */
+ //virtual link_iface::uptr create_link(<link_params>) = 0;
+};
+
+}} /* namespace uhd::rfnoc */
+
+#endif /* INCLUDED_LIBUHD_MB_IFACE_HPP */