From bddaac5e2678b190719228fc26877af5a2ef1910 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Thu, 1 Aug 2019 16:05:06 -0700 Subject: rfnoc: graph: Optimize property propagation algorithm This introduces the concept of a resolution context, because the property propagation algorithm needs to behave differently when called during an initialization step (e.g. when the graph is committed), or when the user changes a property on one of the nodes after it was committed. The algorithm is modified as follows: - When called during an initialization step, then all nodes get resolved at least once. If nodes added new properties, then all nodes get touched again until the max number of iterations is reached. - When called because a node modified one of its properties, then that node is always resolved first. From there, all other nodes are resolved in topological order. However, the algorithm immediately terminates as soon as there are no more dirty nodes. - When called because a node modified one of its properties, but the graph is currently not in a committed state, then that node will do a local property resolution. --- host/tests/rfnoc_propprop_test.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'host/tests') diff --git a/host/tests/rfnoc_propprop_test.cpp b/host/tests/rfnoc_propprop_test.cpp index 8942a59f0..2b8cd635c 100644 --- a/host/tests/rfnoc_propprop_test.cpp +++ b/host/tests/rfnoc_propprop_test.cpp @@ -324,11 +324,10 @@ BOOST_AUTO_TEST_CASE(test_graph_ro_prop) graph.commit(); const size_t rx_rssi_resolver_count = mock_rx_radio.rssi_resolver_count; + UHD_LOG_INFO("TEST", "Now testing mock RSSI resolver/get prop"); UHD_LOG_DEBUG("TEST", "RX RSSI: " << mock_rx_radio.get_property("rssi")); // The next value must match the value in graph.cpp - constexpr size_t MAX_NUM_ITERATIONS = 2; - BOOST_CHECK_EQUAL( - rx_rssi_resolver_count + MAX_NUM_ITERATIONS, mock_rx_radio.rssi_resolver_count); + BOOST_CHECK_EQUAL(rx_rssi_resolver_count + 1, mock_rx_radio.rssi_resolver_count); } BOOST_AUTO_TEST_CASE(test_graph_double_connect) -- cgit v1.2.3