aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/rfnoc/sink_block_ctrl_base.cpp
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2016-11-14 14:30:34 -0800
committerMartin Braun <martin.braun@ettus.com>2018-07-25 15:34:03 -0700
commit988515ab19a715773086a7a8c023ddb8249c7e37 (patch)
tree71c861c3a1d0a5e295dad5939358dd30e0a33f3b /host/lib/rfnoc/sink_block_ctrl_base.cpp
parent8b16ab706fb4768f802ddb65a81fc26e1562cb0d (diff)
downloaduhd-988515ab19a715773086a7a8c023ddb8249c7e37.tar.gz
uhd-988515ab19a715773086a7a8c023ddb8249c7e37.tar.bz2
uhd-988515ab19a715773086a7a8c023ddb8249c7e37.zip
Device3: Change packet-based flow control to byte-based flow control
Diffstat (limited to 'host/lib/rfnoc/sink_block_ctrl_base.cpp')
-rw-r--r--host/lib/rfnoc/sink_block_ctrl_base.cpp19
1 files changed, 7 insertions, 12 deletions
diff --git a/host/lib/rfnoc/sink_block_ctrl_base.cpp b/host/lib/rfnoc/sink_block_ctrl_base.cpp
index b620f917f..1562e134b 100644
--- a/host/lib/rfnoc/sink_block_ctrl_base.cpp
+++ b/host/lib/rfnoc/sink_block_ctrl_base.cpp
@@ -52,22 +52,17 @@ size_t sink_block_ctrl_base::get_fifo_size(size_t block_port) const {
}
void sink_block_ctrl_base::configure_flow_control_in(
- size_t cycles,
- size_t packets,
+ size_t bytes,
size_t block_port
) {
- UHD_RFNOC_BLOCK_TRACE() << boost::format("sink_block_ctrl_base::configure_flow_control_in(cycles=%d, packets=%d)") % cycles % packets ;
- uint32_t cycles_word = 0;
- if (cycles) {
- cycles_word = (1<<31) | cycles;
- }
- sr_write(SR_FLOW_CTRL_CYCS_PER_ACK, cycles_word, block_port);
+ UHD_RFNOC_BLOCK_TRACE() << boost::format("sink_block_ctrl_base::configure_flow_control_in(bytes=%d)") % bytes;
- uint32_t packets_word = 0;
- if (packets) {
- packets_word = (1<<31) | packets;
+ uint32_t bytes_word = 0;
+ if (bytes) {
+ // Bit 32 enables flow control
+ bytes_word = (1<<31) | bytes;
}
- sr_write(SR_FLOW_CTRL_PKTS_PER_ACK, packets_word, block_port);
+ sr_write(SR_FLOW_CTRL_BYTES_PER_ACK, bytes_word, block_port);
}
void sink_block_ctrl_base::set_error_policy(