From 636dad30696b68fc26bb91f370873fb3f938b020 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Fri, 24 May 2019 16:38:28 -0700 Subject: rfnoc: Move graph_edge data structure to its own header, add to_string() This structure represents information about a graph edge. Required by detail::graph and rfnoc_graph. graph_edge_t::to_string() will now provide a textual representation of the edge. --- host/lib/include/uhdlib/rfnoc/graph.hpp | 62 ++------------------------------- 1 file changed, 3 insertions(+), 59 deletions(-) (limited to 'host/lib') diff --git a/host/lib/include/uhdlib/rfnoc/graph.hpp b/host/lib/include/uhdlib/rfnoc/graph.hpp index ec6309bd0..fdb4525d1 100644 --- a/host/lib/include/uhdlib/rfnoc/graph.hpp +++ b/host/lib/include/uhdlib/rfnoc/graph.hpp @@ -7,6 +7,7 @@ #ifndef INCLUDED_LIBUHD_GRAPH_HPP #define INCLUDED_LIBUHD_GRAPH_HPP +#include #include #include #include @@ -14,64 +15,7 @@ #include #include -namespace uhd { namespace rfnoc { - -/*! A container that holds information about a graph edge - */ -struct graph_edge_t -{ - enum edge_t { - STATIC, ///< A static connection between two blocks in the FPGA - DYNAMIC, ///< A user (dynamic) connection between two blocks in the FPGA - RX_STREAM, ///< A connection from an FPGA block to a software RX streamer - TX_STREAM ///< A connection from a software TX streamer and an FPGA block - }; - - graph_edge_t() = default; - - graph_edge_t(const size_t src_port_, - const size_t dst_port_, - const edge_t edge_, - const bool ppa) - : src_port(src_port_) - , dst_port(dst_port_) - , edge(edge_) - , property_propagation_active(ppa) - { - } - - //! The block ID of the source block for this edge - std::string src_blockid; - //! The port number of the source block for this edge - size_t src_port = 0; - //! The block ID of the destination block for this edge - std::string dst_blockid; - //! The port number of the destination block for this edge - size_t dst_port = 0; - //! The type of edge - edge_t edge = DYNAMIC; - //! When true, the framework will use this edge for property propagation - bool property_propagation_active = true; - - bool operator==(const graph_edge_t& rhs) const - { - return std::tie(src_blockid, - src_port, - dst_blockid, - dst_port, - edge, - property_propagation_active) - == std::tie(rhs.src_blockid, - rhs.src_port, - rhs.dst_blockid, - rhs.dst_port, - rhs.edge, - rhs.property_propagation_active); - } -}; - - -namespace detail { +namespace uhd { namespace rfnoc { namespace detail { //! Container for the logical graph within an uhd::rfnoc_graph class graph_t @@ -80,7 +24,7 @@ public: using uptr = std::unique_ptr; //! A shorthand for a pointer to a node using node_ref_t = uhd::rfnoc::node_t*; - + //! Shorthand to existing graph_edge_t using graph_edge_t = uhd::rfnoc::graph_edge_t; /*! Add a connection to the graph -- cgit v1.2.3