Hi Jonathon,
I tried it on 'master' and it still fails.  Attached is a modified version
of my simple example. The new version allows you to specify desired port
numbers on the command line.
Rob

On Wed, Feb 9, 2022 at 9:44 AM Rob Kossler <[email protected]> wrote:

> Thanks Jonathon,
> OK. I will give 'master' a try. But, I would really like to understand why
> this is happening so that I have a better understanding of how the
> action/property forwarding works. Given the two things I mentioned, the
> radio's policy of Drop and the fact that the Replay block uses different
> ports, it seems to me that either of these should allow a resolvable
> propagation.  Let me know if you have any thoughts on this.
>
> Maybe there are some things that are block-related rather than
> port-related (perhaps MTU policy?).  If that is the case, then for me it is
> a good argument for having four 1-port Replay blocks rather than one 4-port
> Replay block (and the same for DDC/DUC/Radio or any multi-port block).
>
> Rob
>
> On Wed, Feb 9, 2022 at 1:25 AM Jonathon Pendlum <
> [email protected]> wrote:
>
>> Hi Rob,
>>
>> 3) I see that on 'master', the Replay block was modified to change the
>>> default forwarding to Drop. Perhaps this would fix the issue, but it
>>> doesn't seem like it given that the Radio is already set to Drop.
>>
>>
>> I can't explain why when using different ports you still get the
>> propagation error, but I'd highly suggest giving the master branch a try.
>> It fixed the case you are describing when using the same port.
>>
>> Jonathon
>>
>> On Wed, Feb 9, 2022 at 12:22 AM Rob Kossler <[email protected]> wrote:
>>
>>> Hi,
>>> I created a simple example that implements an RFNoC graph between the
>>> Replay block and the Radio block on an N310 using UHD 4.1.0.5.  The idea is
>>> that Replay Port 0 connects to the Tx Radio for playing out samples and
>>> then the same Rx Radio connects to Replay Port 1 for capturing the Rx
>>> samples.  The simple source code is included at the bottom of this email
>>> with the relevant part highlighted.
>>>
>>> The example produces the error message below which indicates a circular
>>> graph, I think. I can fix it by replacing the "connect_through_blocks()"
>>> with "graph->connect()" and skipping property propagation on one connection.
>>>
>>> I do not understand why this graph as-is causes a propagation error.
>>> Here are some remarks:
>>> 1) The Replay port numbers are different.  Given that the Replay
>>> controller on branch 4.1 does not modify the default forwarding and that
>>> the default forwarding is One-to-One, it seems that different port numbers
>>> should not cause a circular propagation.
>>> 2) Additionally, given that the Radio block sets its forwarding to Drop,
>>> it seems that there shouldn't be an issue even if the Replay block port
>>> numbers were the same.
>>> 3) I see that on 'master', the Replay block was modified to change the
>>> default forwarding to Drop. Perhaps this would fix the issue, but it
>>> doesn't seem like it given that the Radio is already set to Drop.
>>>
>>> Please let me know if you know why this graph causes an error.
>>> Rob
>>>
>>> // Console ERROR
>>> [ERROR] [RFNOC::GRAPH::DETAIL] Adding edge 0/DDC#0:0 -> 0/Replay#0:1
>>> without disabling property_propagation_active will lead to unresolvable
>>> graph!
>>> Error: RfnocError: Adding edge without disabling
>>> property_propagation_active will lead to unresolvable graph!
>>>
>>> // Example APPLICATION
>>> #include <uhd/rfnoc/block_id.hpp>
>>> #include <uhd/rfnoc/radio_control.hpp>
>>> #include <uhd/rfnoc/replay_block_control.hpp>
>>> #include <uhd/rfnoc_graph.hpp>
>>> #include <uhd/utils/graph_utils.hpp>
>>> #include <uhd/utils/safe_main.hpp>
>>> #include <boost/program_options.hpp>
>>>
>>> namespace po = boost::program_options;
>>>
>>> using std::cout;
>>> using std::endl;
>>>
>>> int UHD_SAFE_MAIN(int argc, char* argv[])
>>> {
>>> std::string args;
>>>
>>> po::options_description desc("Allowed Options");
>>> // clang-format off
>>> desc.add_options()
>>> ("help", "help message")
>>> ("args", po::value<std::string>(&args)->default_value(""), "multi uhd
>>> device address args")
>>> ;
>>>
>>> po::variables_map vm;
>>> po::store(po::parse_command_line(argc, argv, desc), vm);
>>> po::notify(vm);
>>>
>>> // Print help message
>>> if (vm.count("help"))
>>> {
>>> cout << "Replay graph test " << desc << endl;
>>> return EXIT_FAILURE;
>>> }
>>>
>>> /************************************************************************
>>> * Create device and block controls
>>> ***********************************************************************/
>>> cout << endl;
>>> cout << "Creating the RFNoC graph with args: " << args << endl << endl;
>>> uhd::rfnoc::rfnoc_graph::sptr graph =
>>> uhd::rfnoc::rfnoc_graph::make(args);
>>>
>>> // Create handle for radio object
>>> uhd::rfnoc::block_id_t radio_ctrl_id(0, "Radio", 0);
>>> auto radio_ctrl =
>>> graph->get_block<uhd::rfnoc::radio_control>(radio_ctrl_id);
>>>
>>> uhd::rfnoc::block_id_t replay_ctrl_id(0, "Replay", 0);
>>> auto replay_ctrl =
>>> graph->get_block<uhd::rfnoc::replay_block_control>(replay_ctrl_id);
>>>
>>> // Connect the Replay Port 0 to Tx Radio Port 0
>>> connect_through_blocks(graph, replay_ctrl_id, 0, radio_ctrl_id, 0);
>>>
>>> // Connect the Rx Radio Port 0 to Replay Port 1
>>> connect_through_blocks(graph, radio_ctrl_id, 0, replay_ctrl_id, 1);
>>>
>>> graph->commit();
>>>
>>> cout << "Active graph connections:" << endl;
>>> for (auto& edge : graph->enumerate_active_connections())
>>> cout << "* " << edge.to_string() << endl;
>>> cout << endl;
>>>
>>> return EXIT_SUCCESS;
>>> }
>>> _______________________________________________
>>> USRP-users mailing list -- [email protected]
>>> To unsubscribe send an email to [email protected]
>>>
>>
#include <uhd/rfnoc/block_id.hpp>
#include <uhd/rfnoc/radio_control.hpp>
#include <uhd/rfnoc/replay_block_control.hpp>
#include <uhd/rfnoc_graph.hpp>
#include <uhd/utils/graph_utils.hpp>
#include <uhd/utils/safe_main.hpp>
#include <boost/program_options.hpp>

namespace po = boost::program_options;

using std::cout;
using std::endl;

int UHD_SAFE_MAIN(int argc, char* argv[])
{
	std::string args;
	size_t replay_play_port, replay_record_port;
	
	po::options_description desc("Allowed Options");
	// clang-format off
	desc.add_options()
		("help", "help message")
		("args", po::value<std::string>(&args)->default_value(""), "multi uhd device address args")
		("replay-play-port", po::value<size_t>(&replay_play_port)->default_value(0), "replay port for playout")
		("replay-record-port", po::value<size_t>(&replay_record_port)->default_value(1), "replay port for recording")
		;

	po::variables_map vm;
	po::store(po::parse_command_line(argc, argv, desc), vm);
	po::notify(vm);

	// Print help message
	if (vm.count("help")) 
	{
		cout << "Replay graph test " << desc << endl;
		return EXIT_FAILURE;
	}

	/************************************************************************
	 * Create device and block controls
	 ***********************************************************************/
	cout << endl;
	cout << "Creating the RFNoC graph with args: " << args << endl << endl;
	uhd::rfnoc::rfnoc_graph::sptr graph = uhd::rfnoc::rfnoc_graph::make(args);

	// Create handle for radio object
	uhd::rfnoc::block_id_t radio_ctrl_id(0, "Radio", 0);
	auto radio_ctrl = graph->get_block<uhd::rfnoc::radio_control>(radio_ctrl_id);
	
	uhd::rfnoc::block_id_t replay_ctrl_id(0, "Replay", 0);
	auto replay_ctrl = graph->get_block<uhd::rfnoc::replay_block_control>(replay_ctrl_id);

	const size_t radio_port = 0;
	
	// Connect the Replay Port 0 to Tx Radio Port 0
	connect_through_blocks(graph, replay_ctrl_id, replay_play_port, radio_ctrl_id, radio_port);
	
	// Connect the Rx Radio Port 0 to Replay Port 1
	connect_through_blocks(graph, radio_ctrl_id, radio_port, replay_ctrl_id, replay_record_port);
	
	graph->commit();
	
	cout << "Active graph connections:" << endl;
	for (auto& edge : graph->enumerate_active_connections()) 
		cout << "* " << edge.to_string() << endl;
	cout << endl;

	return EXIT_SUCCESS;
}
_______________________________________________
USRP-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to