aboutsummaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorMichael West <michael.west@ettus.com>2019-02-14 10:03:13 -0800
committerBrent Stapleton <brent.stapleton@ettus.com>2019-02-18 11:04:13 -0800
commit7d71823feb6adb3ddd5fda36847c9957b240d5cc (patch)
tree3ea3f967e87fb4857cde58a61dba9b1d7e425477 /host
parentc24901bdcb66d1224e0822ba88c762def193d2fe (diff)
downloaduhd-7d71823feb6adb3ddd5fda36847c9957b240d5cc.tar.gz
uhd-7d71823feb6adb3ddd5fda36847c9957b240d5cc.tar.bz2
uhd-7d71823feb6adb3ddd5fda36847c9957b240d5cc.zip
RFNoC: Fix flush in source_block_ctrl_base
The configure_flow_control_out function was set to dump any packets onto the crossbar, which could cause issues on the crossbar and in downstream blocks. Replacing wil a call to the _flush() function in the block_ctrl_base parent class, which drops the packets so they do not get put onto the crossbar. Signed-off-by: Michael West <michael.west@ettus.com>
Diffstat (limited to 'host')
-rw-r--r--host/include/uhd/rfnoc/block_ctrl_base.hpp6
-rw-r--r--host/lib/rfnoc/source_block_ctrl_base.cpp19
2 files changed, 4 insertions, 21 deletions
diff --git a/host/include/uhd/rfnoc/block_ctrl_base.hpp b/host/include/uhd/rfnoc/block_ctrl_base.hpp
index 0bf701810..df3fab02e 100644
--- a/host/include/uhd/rfnoc/block_ctrl_base.hpp
+++ b/host/include/uhd/rfnoc/block_ctrl_base.hpp
@@ -372,6 +372,9 @@ protected:
// than reset register SR_CLEAR_TX_FC.
virtual void _clear(const size_t port = 0);
+ //! Flush any in-flight packets for this block
+ bool _flush(const size_t port = 0);
+
//! Override this function if your block needs to specially handle
// setting the command time
virtual void _set_command_time(
@@ -404,9 +407,6 @@ private:
//! Helper to start flushing for this block
void _start_drain(const size_t port = 0);
- //! Helper to flush any in-flight packets for this block
- bool _flush(const size_t port = 0);
-
/***********************************************************************
* Private members
**********************************************************************/
diff --git a/host/lib/rfnoc/source_block_ctrl_base.cpp b/host/lib/rfnoc/source_block_ctrl_base.cpp
index 656ab26af..994d66380 100644
--- a/host/lib/rfnoc/source_block_ctrl_base.cpp
+++ b/host/lib/rfnoc/source_block_ctrl_base.cpp
@@ -102,24 +102,7 @@ void source_block_ctrl_base::configure_flow_control_out(const bool enable_fc_out
% buf_size_bytes % unique_id()));
}
- // Disable flow control entirely and let all upstream data flush out
- // We need to do this every time the window is changed because
- // a) We don't know what state the flow-control module was left in
- // in the previous run (it should still be enabled)
- // b) Changing the window size where data is buffered upstream may
- // result in stale packets entering the stream.
- sr_write(SR_FLOW_CTRL_EN, 0, block_port);
-
- // Wait for data to flush out.
- // In the FPGA we are guaranteed that all buffered packets are more-or-less
- // consecutive. 1ms@200MHz = 200,000 cycles of "flush time". 200k cycles = 200k * 8
- // bytes (64 bits) = 1.6MB of data that can be flushed. Typically in the FPGA we have
- // buffering in the order of kilobytes so waiting for 1MB to flush is more than enough
- // time.
- // TODO: Enhancement. We should get feedback from the FPGA about when the
- // source_flow_control
- // module is done flushing.
- std::this_thread::sleep_for(std::chrono::milliseconds(1));
+ _flush(block_port);
// Enable source flow control module and conditionally enable byte based and/or packet
// count based flow control