Skip to content

Commit 6c2418b

Browse files
committed
Revert "RFNoC: Remove incorrect flush"
This reverts commit c8e01d4. The commit introduced random phase offsets for TwinRX phase alignment.
1 parent e7acb05 commit 6c2418b

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

host/lib/rfnoc/source_block_ctrl_base.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,25 @@ void source_block_ctrl_base::configure_flow_control_out(const bool enable_fc_out
102102
% buf_size_bytes % unique_id()));
103103
}
104104

105+
// Disable flow control entirely and let all upstream data flush out
106+
// We need to do this every time the window is changed because
107+
// a) We don't know what state the flow-control module was left in
108+
// in the previous run (it should still be enabled)
109+
// b) Changing the window size where data is buffered upstream may
110+
// result in stale packets entering the stream.
111+
sr_write(SR_FLOW_CTRL_EN, 0, block_port);
112+
113+
// Wait for data to flush out.
114+
// In the FPGA we are guaranteed that all buffered packets are more-or-less
115+
// consecutive. 1ms@200MHz = 200,000 cycles of "flush time". 200k cycles = 200k * 8
116+
// bytes (64 bits) = 1.6MB of data that can be flushed. Typically in the FPGA we have
117+
// buffering in the order of kilobytes so waiting for 1MB to flush is more than enough
118+
// time.
119+
// TODO: Enhancement. We should get feedback from the FPGA about when the
120+
// source_flow_control
121+
// module is done flushing.
122+
std::this_thread::sleep_for(std::chrono::milliseconds(1));
123+
105124
// Enable source flow control module and conditionally enable byte based and/or packet
106125
// count based flow control
107126
const bool enable_byte_fc = (buf_size_bytes != 0);

0 commit comments

Comments
 (0)