aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/rfnoc/graph.cpp
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2021-12-02 17:12:34 +0100
committerAaron Rossetto <aaron.rossetto@ni.com>2021-12-09 13:10:00 -0800
commitf308a453c4e615143a467869accf550ab36493c7 (patch)
treede873cd23da6a641263a9b478f4cb8269c3ca411 /host/lib/rfnoc/graph.cpp
parent4fd1cb317fbbce6facac1cc1bce65e46aa72dcc2 (diff)
downloaduhd-f308a453c4e615143a467869accf550ab36493c7.tar.gz
uhd-f308a453c4e615143a467869accf550ab36493c7.tar.bz2
uhd-f308a453c4e615143a467869accf550ab36493c7.zip
rfnoc: Fix back-edge consistency check
On back-edges, no properties are forwarded, but properties must be consistent after property resolution. This breaks when the source edge on a back-edge has an edge property which the destination block does not. Consider the following graph: DDC -> Replay -> DDC where both instances of 'DDC' refer to the same block. Now, assume the first edge is declared a back edge (in principle, it shouldn't matter). The DDC block has an edge property `samp_rate` which the Replay block does not. Therefore, it can't forward this edge property to the Replay block's input edge property list. In the consistency check code, we don't check for the existence of edge nodes, because it is assumed edge properties where either forwarded, or aligned through some other manner. This leads to a property lookup failure. With this fix, we skip the consistency check for edge properties which don't exist on the destination node. This is safe because the destination block can not have a property resolver defined for undefined properties. This means the destination block can either: - Drop the property. In this case, there is no value in checking consistency. Even if we could forward edge properties on back-edges, they would always have the same value. - Forward the property. In that case, the consistency check would happen elsewhere in the graph where there's no back-edge.
Diffstat (limited to 'host/lib/rfnoc/graph.cpp')
-rw-r--r--host/lib/rfnoc/graph.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/host/lib/rfnoc/graph.cpp b/host/lib/rfnoc/graph.cpp
index 931777629..9b8b9ec59 100644
--- a/host/lib/rfnoc/graph.cpp
+++ b/host/lib/rfnoc/graph.cpp
@@ -669,6 +669,13 @@ bool graph_t::_assert_edge_props_consistent(rfnoc_graph_t::edge_descriptor edge)
for (auto src_prop_it = src_prop_map.begin(); src_prop_it != src_prop_map.end();
++src_prop_it) {
auto src_prop = src_prop_it->second;
+ if (dst_prop_map.count(src_prop->get_id()) == 0) {
+ UHD_LOG_DEBUG(LOG_ID,
+ "On back-edge "
+ << edge_info.to_string() << ", source block has edge property `"
+ << src_prop->get_id() << "', but destination block does not.");
+ continue;
+ }
auto dst_prop = dst_prop_map.at(src_prop->get_id());
if (!src_prop->equal(dst_prop)) {
UHD_LOG_ERROR(LOG_ID,