From 384a94d1b6e3a980c19df70f8a1a95ec9f52eb6e Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Wed, 1 May 2019 16:45:30 -0700 Subject: 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. --- host/lib/include/uhdlib/rfnoc/mb_iface.hpp | 76 ++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 host/lib/include/uhdlib/rfnoc/mb_iface.hpp (limited to 'host/lib/include/uhdlib/rfnoc/mb_iface.hpp') 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 + +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; + + 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 enumerate_links() = 0; + + /*! + * + * FIXME determine appropriate return type and arg types + */ + //virtual link_iface::uptr create_link() = 0; +}; + +}} /* namespace uhd::rfnoc */ + +#endif /* INCLUDED_LIBUHD_MB_IFACE_HPP */ -- cgit v1.2.3