aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/rfnoc/graph.cpp
diff options
context:
space:
mode:
authormattprost <matt.prost@ni.com>2021-12-14 13:09:58 -0600
committerAaron Rossetto <aaron.rossetto@ni.com>2021-12-17 09:40:36 -0600
commit6a2e566c562db861eb86648ad98d278eceba8236 (patch)
treed3cdb026b57a1e42ab5a6f9851aafcc7d9497f70 /host/lib/rfnoc/graph.cpp
parent4439497afc8e9c9dfb982859c6b438d72c775bca (diff)
downloaduhd-6a2e566c562db861eb86648ad98d278eceba8236.tar.gz
uhd-6a2e566c562db861eb86648ad98d278eceba8236.tar.bz2
uhd-6a2e566c562db861eb86648ad98d278eceba8236.zip
rfnoc: graph: make topology failure more descriptive
Clarify that invalid RFNoC graph topology failures are due to an attempt to access input or output ports that are not connected to anything in the FPGA. Signed-off-by: mattprost <matt.prost@ni.com>
Diffstat (limited to 'host/lib/rfnoc/graph.cpp')
-rw-r--r--host/lib/rfnoc/graph.cpp45
1 files changed, 41 insertions, 4 deletions
diff --git a/host/lib/rfnoc/graph.cpp b/host/lib/rfnoc/graph.cpp
index 9b8b9ec59..897eade57 100644
--- a/host/lib/rfnoc/graph.cpp
+++ b/host/lib/rfnoc/graph.cpp
@@ -709,11 +709,48 @@ void graph_t::_check_topology()
}
if (!node_accessor.check_topology(node, connected_inputs, connected_outputs)) {
+ std::ostringstream input_topology;
+ input_topology << " requested inputs: (";
+ for (auto connected_input : connected_inputs) {
+ input_topology << connected_input;
+ if (connected_input != connected_inputs.back()) {
+ input_topology << ", ";
+ }
+ }
+ input_topology << ")";
+ input_topology << " valid inputs: (";
+ for (size_t expected_input = 0; expected_input < node->get_num_input_ports();
+ expected_input++) {
+ input_topology << expected_input;
+ if (expected_input < node->get_num_input_ports() - 1) {
+ input_topology << ", ";
+ }
+ }
+ input_topology << ")";
+
+ std::ostringstream output_topology;
+ output_topology << " requested outputs: (";
+ for (auto connected_output : connected_outputs) {
+ output_topology << connected_output;
+ if (connected_output != connected_outputs.back()) {
+ output_topology << ", ";
+ }
+ }
+ output_topology << ")";
+ output_topology << " valid outputs: (";
+ for (size_t expected_output = 0;
+ expected_output < node->get_num_output_ports();
+ expected_output++) {
+ output_topology << expected_output;
+ if (expected_output < node->get_num_output_ports() - 1) {
+ output_topology << ", ";
+ }
+ }
+ output_topology << ")";
+
UHD_LOG_ERROR(LOG_ID,
- "Node " << node->get_unique_id()
- << "cannot handle its current topology! ("
- << connected_inputs.size() << "inputs, "
- << connected_outputs.size() << " outputs)");
+ "Node " << node->get_unique_id() << " using invalid inputs or outputs! "
+ << input_topology.str() << ", " << output_topology.str());
topo_ok = false;
}
}