diff options
author | Alex Williams <alex.williams@ni.com> | 2019-08-08 15:41:30 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2019-11-26 11:49:36 -0800 |
commit | 117af6f0b0d50e6ba81bbd8f970d8963f615548a (patch) | |
tree | 61e5b5f037afc406e7208267cf8773bb6e057d94 /host/include | |
parent | bffef674fbbcd892967017e81515bb76e0b850b5 (diff) | |
download | uhd-117af6f0b0d50e6ba81bbd8f970d8963f615548a.tar.gz uhd-117af6f0b0d50e6ba81bbd8f970d8963f615548a.tar.bz2 uhd-117af6f0b0d50e6ba81bbd8f970d8963f615548a.zip |
rfnoc: Add ability to select transport for streamers to user APIs
Now the user can choose which transport is used in connect() calls.
Diffstat (limited to 'host/include')
-rw-r--r-- | host/include/uhd/rfnoc/defaults.hpp | 7 | ||||
-rw-r--r-- | host/include/uhd/rfnoc_graph.hpp | 36 |
2 files changed, 38 insertions, 5 deletions
diff --git a/host/include/uhd/rfnoc/defaults.hpp b/host/include/uhd/rfnoc/defaults.hpp index efc774467..6af67144a 100644 --- a/host/include/uhd/rfnoc/defaults.hpp +++ b/host/include/uhd/rfnoc/defaults.hpp @@ -49,7 +49,12 @@ static const int DEFAULT_SPP = 1996; using noc_id_t = uint32_t; /*** Device Identifiers ******************************************************/ -//! Device ID Type +//! Device ID +using device_id_t = uint16_t; +//! NULL/unassigned device ID +static const device_id_t NULL_DEVICE_ID = 0; + +//! Device Type using device_type_t = uint16_t; // first nibble for device family (E = E, N = 1, X = A), remaining three nibbles // for device number diff --git a/host/include/uhd/rfnoc_graph.hpp b/host/include/uhd/rfnoc_graph.hpp index 09e95d667..556a298dc 100644 --- a/host/include/uhd/rfnoc_graph.hpp +++ b/host/include/uhd/rfnoc_graph.hpp @@ -196,6 +196,7 @@ public: * \param strm_port The port of the streamer to connect. * \param dst_blk The block ID of the destination block to connect to. * \param dst_port The port of the destination block to connect to. + * \param via_device The local device ID (transport) to use for this connection. * * \throws connect_disallowed_on_dst * if the destination port is statically connected to a *different* block @@ -203,14 +204,16 @@ public: virtual void connect(uhd::tx_streamer::sptr streamer, size_t strm_port, const block_id_t& dst_blk, - size_t dst_port) = 0; + size_t dst_port, + device_id_t via_device = NULL_DEVICE_ID) = 0; /*! Connect RX streamer to an output of an NoC block * - * \param src_blk The block ID of the destination block to connect to. - * \param src_port The port of the destination block to connect to. + * \param src_blk The block ID of the source block to connect. + * \param src_port The port of the source block to connect. * \param streamer The streamer to connect. * \param strm_port The port of the streamer to connect. + * \param via_device The local device ID (transport) to use for this connection. * * \throws connect_disallowed_on_src * if the source port is statically connected to a *different* block @@ -218,7 +221,32 @@ public: virtual void connect(const block_id_t& src_blk, size_t src_port, uhd::rx_streamer::sptr streamer, - size_t strm_port) = 0; + size_t strm_port, + device_id_t via_device = NULL_DEVICE_ID) = 0; + + /*! Enumerate all the possible via devices that can be used to receive + * from the specified block + * + * If addr and second_addr were specified in device_args, the device_id_t + * associated with addr will come first in the vector, then second_addr. + * + * \param src_blk The block ID of the source block to connect to. + * \param src_port The port of the source block to connect to. + */ + virtual std::vector<device_id_t> enumerate_dst_via_devices(const block_id_t& src_blk, + size_t src_port) = 0; + + /*! Enumerate all the possible via devices that can be used to send to the + * specified block + * + * If addr and second_addr were specified in device_args, the device_id_t + * associated with addr will come first in the vector, then second_addr. + * + * \param dst_blk The block ID of the destination block to connect to. + * \param dst_port The port of the destination block to connect to. + */ + virtual std::vector<device_id_t> enumerate_src_via_devices(const block_id_t& dst_blk, + size_t dst_port) = 0; /*! Enumerate all the possible static connections in the graph * |