aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2019-05-24 16:38:28 -0700
committerMartin Braun <martin.braun@ettus.com>2019-11-26 11:49:16 -0800
commit636dad30696b68fc26bb91f370873fb3f938b020 (patch)
treeffdfec2289bd328596ef6c6ee6a893381607d97c /host/lib
parent20d71e178d0de009599bcedca559686928a4503a (diff)
downloaduhd-636dad30696b68fc26bb91f370873fb3f938b020.tar.gz
uhd-636dad30696b68fc26bb91f370873fb3f938b020.tar.bz2
uhd-636dad30696b68fc26bb91f370873fb3f938b020.zip
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.
Diffstat (limited to 'host/lib')
-rw-r--r--host/lib/include/uhdlib/rfnoc/graph.hpp62
1 files changed, 3 insertions, 59 deletions
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 <uhd/rfnoc/graph_edge.hpp>
#include <uhd/rfnoc/actions.hpp>
#include <uhd/rfnoc/node.hpp>
#include <boost/graph/adjacency_list.hpp>
@@ -14,64 +15,7 @@
#include <memory>
#include <deque>
-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<graph_t>;
//! 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