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/lib/include/uhdlib/rfnoc/resolve_context.hpp | 26 +++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 host/lib/include/uhdlib/rfnoc/resolve_context.hpp (limited to 'host/lib/include/uhdlib/rfnoc/resolve_context.hpp') diff --git a/host/lib/include/uhdlib/rfnoc/resolve_context.hpp b/host/lib/include/uhdlib/rfnoc/resolve_context.hpp new file mode 100644 index 000000000..29a2e5f6f --- /dev/null +++ b/host/lib/include/uhdlib/rfnoc/resolve_context.hpp @@ -0,0 +1,26 @@ +// +// +// Copyright 2019 Ettus Research, a National Instruments Company +// +// SPDX-License-Identifier: GPL-3.0-or-later +// + +#ifndef INCLUDED_UHD_RFNOC_RESOLVE_CONTEXT_HPP +#define INCLUDED_UHD_RFNOC_RESOLVE_CONTEXT_HPP + +namespace uhd { namespace rfnoc { + +/*! Describe situations out of which property propagation is called + */ +enum class resolve_context { + //! Property propagation was called during an initialization process (e.g., + // the graph was committed) + INIT, + //! Property propagation was called because a property on a node was + // updated + NODE_PROP +}; + +}} // namespace uhd::rfnoc + +#endif /* INCLUDED_UHD_RFNOC_RESOLVE_CONTEXT_HPP */ -- cgit v1.2.3