aboutsummaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorTrung N Tran <trung.tran@ettus.com>2017-07-13 14:01:33 -0700
committerBrent Stapleton <bstapleton@g.hmc.edu>2018-08-22 14:31:34 -0700
commitd5c6e34bd3a9e63bfe661e2d8b38ceb85c4d6d18 (patch)
tree111cbc296f330a8e944957da46693ceba4e2a36d /host
parent0aede451a2f1006aa67450a7d0a07d18a92be138 (diff)
downloaduhd-d5c6e34bd3a9e63bfe661e2d8b38ceb85c4d6d18.tar.gz
uhd-d5c6e34bd3a9e63bfe661e2d8b38ceb85c4d6d18.tar.bz2
uhd-d5c6e34bd3a9e63bfe661e2d8b38ceb85c4d6d18.zip
RFNoC: Convert SR_READBACK_REG_FIFOSIZE to bytes
Change the RB_FIFOSIZE register to store the FIFO size in bytes instead of log2 of bytes.
Diffstat (limited to 'host')
-rw-r--r--host/include/uhd/rfnoc/constants.hpp2
-rw-r--r--host/lib/rfnoc/block_ctrl_base.cpp4
2 files changed, 2 insertions, 4 deletions
diff --git a/host/include/uhd/rfnoc/constants.hpp b/host/include/uhd/rfnoc/constants.hpp
index bda4c6440..92f21cae5 100644
--- a/host/include/uhd/rfnoc/constants.hpp
+++ b/host/include/uhd/rfnoc/constants.hpp
@@ -25,7 +25,7 @@ static const std::string XML_PATH_ENV = "UHD_RFNOC_DIR";
//! If the block name can't be automatically detected, this name is used
static const std::string DEFAULT_BLOCK_NAME = "Block";
static const uint64_t DEFAULT_NOC_ID = 0xFFFFFFFFFFFFFFFF;
-static const size_t NOC_SHELL_COMPAT_MAJOR = 4;
+static const size_t NOC_SHELL_COMPAT_MAJOR = 5;
static const size_t NOC_SHELL_COMPAT_MINOR = 0;
static const size_t MAX_PACKET_SIZE = 8000; // bytes
diff --git a/host/lib/rfnoc/block_ctrl_base.cpp b/host/lib/rfnoc/block_ctrl_base.cpp
index c7884f291..277aedf80 100644
--- a/host/lib/rfnoc/block_ctrl_base.cpp
+++ b/host/lib/rfnoc/block_ctrl_base.cpp
@@ -100,9 +100,7 @@ block_ctrl_base::block_ctrl_base(
sr_write(SR_BLOCK_SID, get_address(ctrl_port), ctrl_port);
// Set sink buffer sizes:
settingsbus_reg_t reg = SR_READBACK_REG_FIFOSIZE;
- uint64_t value = sr_read64(reg, ctrl_port);
- size_t buf_size_log2 = value & 0xFF;
- size_t buf_size_bytes = BYTES_PER_LINE * (1 << buf_size_log2); // Bytes == 8 * 2^x
+ size_t buf_size_bytes = size_t(sr_read64(reg, ctrl_port));
if (buf_size_bytes > 0) n_valid_input_buffers++;
_tree->create<size_t>(_root_path / "input_buffer_size" / ctrl_port).set(buf_size_bytes);
}