aboutsummaryrefslogtreecommitdiffstats
path: root/host/include
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2019-06-03 22:33:52 -0700
committerMartin Braun <martin.braun@ettus.com>2019-11-26 11:49:23 -0800
commitdebe5189364b0684500b7ce4cd8f45894a3e54e7 (patch)
tree6a1d3d263e904afbe58d4dad77744ecf26ea37c8 /host/include
parent6460e07f91bc468e7c094785093426ee07e26bcb (diff)
downloaduhd-debe5189364b0684500b7ce4cd8f45894a3e54e7.tar.gz
uhd-debe5189364b0684500b7ce4cd8f45894a3e54e7.tar.bz2
uhd-debe5189364b0684500b7ce4cd8f45894a3e54e7.zip
rfnoc: Add null block controller
Diffstat (limited to 'host/include')
-rw-r--r--host/include/uhd/rfnoc/CMakeLists.txt1
-rw-r--r--host/include/uhd/rfnoc/null_block_control.hpp88
2 files changed, 89 insertions, 0 deletions
diff --git a/host/include/uhd/rfnoc/CMakeLists.txt b/host/include/uhd/rfnoc/CMakeLists.txt
index 6251a555d..f5cb4006b 100644
--- a/host/include/uhd/rfnoc/CMakeLists.txt
+++ b/host/include/uhd/rfnoc/CMakeLists.txt
@@ -41,6 +41,7 @@ if(ENABLE_RFNOC)
duc_block_ctrl.hpp
fir_block_ctrl.hpp
null_block_ctrl.hpp
+ null_block_control.hpp
radio_ctrl.hpp
radio_control.hpp
replay_block_ctrl.hpp
diff --git a/host/include/uhd/rfnoc/null_block_control.hpp b/host/include/uhd/rfnoc/null_block_control.hpp
new file mode 100644
index 000000000..74f6db2a3
--- /dev/null
+++ b/host/include/uhd/rfnoc/null_block_control.hpp
@@ -0,0 +1,88 @@
+//
+// Copyright 2019 Ettus Research, a National Instruments Brand
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+//
+
+#ifndef INCLUDED_LIBUHD_NULL_BLOCK_CONTROL_HPP
+#define INCLUDED_LIBUHD_NULL_BLOCK_CONTROL_HPP
+
+#include <uhd/config.hpp>
+#include <uhd/rfnoc/noc_block_base.hpp>
+#include <uhd/types/stream_cmd.hpp>
+
+namespace uhd { namespace rfnoc {
+
+class UHD_API null_block_control : public noc_block_base
+{
+public:
+ RFNOC_DECLARE_BLOCK(null_block_control)
+
+ enum port_type_t { SINK, SOURCE, LOOP };
+ enum count_type_t { LINES, PACKETS };
+
+ static const uint32_t REG_CTRL_STATUS;
+ static const uint32_t REG_SRC_LINES_PER_PKT;
+ static const uint32_t REG_SRC_BYTES_PER_PKT;
+ static const uint32_t REG_SRC_THROTTLE_CYC;
+ static const uint32_t REG_SNK_LINE_CNT_LO;
+ static const uint32_t REG_SNK_LINE_CNT_HI;
+ static const uint32_t REG_SNK_PKT_CNT_LO;
+ static const uint32_t REG_SNK_PKT_CNT_HI;
+ static const uint32_t REG_SRC_LINE_CNT_LO;
+ static const uint32_t REG_SRC_LINE_CNT_HI;
+ static const uint32_t REG_SRC_PKT_CNT_LO;
+ static const uint32_t REG_SRC_PKT_CNT_HI;
+ static const uint32_t REG_LOOP_LINE_CNT_LO;
+ static const uint32_t REG_LOOP_LINE_CNT_HI;
+ static const uint32_t REG_LOOP_PKT_CNT_LO;
+ static const uint32_t REG_LOOP_PKT_CNT_HI;
+
+ /*! Start/stop the null source (port 0)
+ */
+ virtual void issue_stream_cmd(const uhd::stream_cmd_t& stream_cmd) = 0;
+
+ /*! Reset the counters
+ */
+ virtual void reset_counters() = 0;
+
+ /*! Set bytes per packet
+ *
+ * Note: This sets the entire packet size, including header.
+ */
+ virtual void set_bytes_per_packet(const uint32_t bpp) = 0;
+
+ /*! Set throttle cycles
+ *
+ * The block will wait this many cycles between packets. Useful for reducing
+ * the data output.
+ */
+ virtual void set_throttle_cycles(const uint32_t cycs) = 0;
+
+ /*! Get lines per packet (including the header!)
+ */
+ virtual uint32_t get_lines_per_packet() = 0;
+
+ /*! Get bytes per packet
+ */
+ virtual uint32_t get_bytes_per_packet() = 0;
+
+ /*! Get throttle cycles
+ */
+ virtual uint32_t get_throttle_cycles() = 0;
+
+ /*! Returns the number of lines that have been consumed on port 0 since the
+ * last reset
+ *
+ * \param port_type The port for which the counter value should be returned,
+ * sink, source, or loop.
+ * \param count_type If we want the packet count, or the line count
+ */
+ virtual uint64_t get_count(
+ const port_type_t port_type, const count_type_t count_type) = 0;
+};
+
+}} // namespace uhd::rfnoc
+
+#endif /* INCLUDED_LIBUHD_NULL_BLOCK_CONTROL_HPP */
+