From 03023905360dd2c9c17ba70ff1543b0c70f98ad4 Mon Sep 17 00:00:00 2001 From: Brent Stapleton Date: Mon, 3 Jun 2019 14:07:58 -0700 Subject: rfnoc: enumerate and construct block controllers, enable connect() During construction of the rfnoc_graph, enumerate all of the connected blocks, construct their controllers, and store them in the graph. --- host/include/uhd/rfnoc_graph.hpp | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'host/include') diff --git a/host/include/uhd/rfnoc_graph.hpp b/host/include/uhd/rfnoc_graph.hpp index a0a9bf907..55563c6fc 100644 --- a/host/include/uhd/rfnoc_graph.hpp +++ b/host/include/uhd/rfnoc_graph.hpp @@ -36,9 +36,16 @@ public: */ using sptr = std::shared_ptr; - virtual ~rfnoc_graph() {} + + //! Stuct to store information about which blocks are actually stored at a given port on the crossbar + struct block_xbar_info { + size_t xbar_port; + noc_block_base::noc_id_t noc_id; + size_t inst_num; + }; + /****************************************** * Factory ******************************************/ @@ -113,7 +120,7 @@ public: * \param block_id Canonical block name (e.g. "0/FFT#1"). * \note this access is not thread safe if peformed during block enumeration */ - noc_block_base::sptr get_block(const block_id_t& block_id) const; + virtual noc_block_base::sptr get_block(const block_id_t& block_id) const = 0; /*! Same as get_block(), but with a type cast. * @@ -161,11 +168,11 @@ public: * \throws connect_disallowed_on_dst * if the destination port is statically connected to a *different* block */ - void connect(const block_id_t& src_blk, + virtual void connect(const block_id_t& src_blk, size_t src_port, const block_id_t& dst_blk, size_t dst_port, - bool skip_property_propagation = false); + bool skip_property_propagation = false) = 0; /*! Connect TX streamer to an input of an NoC block * @@ -177,10 +184,10 @@ public: * \throws connect_disallowed_on_dst * if the destination port is statically connected to a *different* block */ - void connect(uhd::tx_streamer& streamer, + virtual void connect(uhd::tx_streamer& streamer, size_t strm_port, const block_id_t& dst_blk, - size_t dst_port); + size_t dst_port) = 0; /*! Connect RX streamer to an output of an NoC block * @@ -192,10 +199,10 @@ public: * \throws connect_disallowed_on_src * if the source port is statically connected to a *different* block */ - void connect(const block_id_t& src_blk, + virtual void connect(const block_id_t& src_blk, size_t src_port, uhd::rx_streamer& streamer, - size_t strm_port); + size_t strm_port) = 0; /*! Enumerate all the connections in the graph * -- cgit v1.2.3