diff options
Diffstat (limited to 'host/lib/rfnoc')
-rw-r--r-- | host/lib/rfnoc/client_zero.cpp | 27 | ||||
-rw-r--r-- | host/lib/rfnoc/rfnoc_graph.cpp | 4 |
2 files changed, 10 insertions, 21 deletions
diff --git a/host/lib/rfnoc/client_zero.cpp b/host/lib/rfnoc/client_zero.cpp index f5a54fd62..af23ba1cc 100644 --- a/host/lib/rfnoc/client_zero.cpp +++ b/host/lib/rfnoc/client_zero.cpp @@ -154,38 +154,25 @@ bool client_zero::complete_flush(uint16_t portno) return poll_flush_done(portno); } -void client_zero::complete_flush_all_blocks() +bool client_zero::complete_flush_all_blocks() { const size_t num_blocks = get_num_blocks(); const size_t first_block_port = 1 + get_num_stream_endpoints(); // Issue flush commands - auto flush_done = std::vector<bool>(); for (size_t portno = 0; portno < num_blocks; ++portno) { auto block_portno = portno + first_block_port; set_flush(block_portno); - flush_done.push_back(false); } // Poll for flush done - auto start = std::chrono::steady_clock::now(); - size_t flushes_done = 0; - while (flushes_done < num_blocks) { - for (size_t portno = 0; portno < num_blocks; ++portno) { - if (flush_done[portno]) { - continue; - } - if (std::chrono::steady_clock::now() > (start + DEFAULT_POLL_TIMEOUT)) { - throw uhd::runtime_error( - str(boost::format("Timeout while flushing port %d") % portno)); - } - auto block_portno = portno + first_block_port; - if (get_flush_done(block_portno)) { - flush_done[portno] = true; - flushes_done++; - } - } + bool all_ports_flushed = true; + for (size_t portno = 0; portno < num_blocks; ++portno) { + size_t block_portno = portno + first_block_port; + all_ports_flushed = all_ports_flushed && poll_flush_done(block_portno); } + + return all_ports_flushed; } void client_zero::reset_ctrl(uint16_t portno) diff --git a/host/lib/rfnoc/rfnoc_graph.cpp b/host/lib/rfnoc/rfnoc_graph.cpp index 795ffd289..f820a6960 100644 --- a/host/lib/rfnoc/rfnoc_graph.cpp +++ b/host/lib/rfnoc/rfnoc_graph.cpp @@ -663,7 +663,9 @@ private: std::string("Flushing and resetting blocks on mboard ") + std::to_string(mb_idx)); - mb_cz->complete_flush_all_blocks(); + if (!mb_cz->complete_flush_all_blocks()) { + UHD_LOG_WARNING(LOG_ID, "One or more blocks timed out during flush!"); + } // Reset for (size_t portno = 0; portno < num_blocks; ++portno) { |