aboutsummaryrefslogtreecommitdiffstats
path: root/host/include/uhd/rfnoc/switchboard_block_control.hpp
diff options
context:
space:
mode:
authorJesse Zhang <65556515+jessezhang-ni@users.noreply.github.com>2020-07-22 17:09:06 -0500
committerAaron Rossetto <aaron.rossetto@ni.com>2020-07-30 12:51:11 -0500
commit152823d5083d709b7eaafe42c918738e90ecaa4d (patch)
tree35a76ad288d75e3b1dba9329c29abf40936db2d8 /host/include/uhd/rfnoc/switchboard_block_control.hpp
parent8db024d43bbb7cd05f5b18dd3d7cec09cac6ec4b (diff)
downloaduhd-152823d5083d709b7eaafe42c918738e90ecaa4d.tar.gz
uhd-152823d5083d709b7eaafe42c918738e90ecaa4d.tar.bz2
uhd-152823d5083d709b7eaafe42c918738e90ecaa4d.zip
rfnoc: Add Switchboard block support
Diffstat (limited to 'host/include/uhd/rfnoc/switchboard_block_control.hpp')
-rw-r--r--host/include/uhd/rfnoc/switchboard_block_control.hpp48
1 files changed, 48 insertions, 0 deletions
diff --git a/host/include/uhd/rfnoc/switchboard_block_control.hpp b/host/include/uhd/rfnoc/switchboard_block_control.hpp
new file mode 100644
index 000000000..0b0b4c722
--- /dev/null
+++ b/host/include/uhd/rfnoc/switchboard_block_control.hpp
@@ -0,0 +1,48 @@
+//
+// Copyright 2020 Ettus Research, a National Instruments Brand
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+//
+
+#pragma once
+
+#include <uhd/config.hpp>
+#include <uhd/rfnoc/noc_block_base.hpp>
+
+namespace uhd { namespace rfnoc {
+
+/*! Switchboard Block Control Class
+ *
+ * The Switchboard Block is an RFNoC block that routes any single input to any
+ * single output. Routing is 1 to 1, that is, an input port can only be connected
+ * to one output port, and vice versa.
+ *
+ * INIT: This block is initialized with only input port 0 connected to output
+ * port 0.
+ *
+ * NOTE: This block is not intended to switch during the transmission of packets.
+ * Data on disconnected inputs will stall.
+ */
+class UHD_API switchboard_block_control : public noc_block_base
+{
+public:
+ RFNOC_DECLARE_BLOCK(switchboard_block_control)
+
+ // Block registers
+ static const uint32_t REG_BLOCK_SIZE;
+
+ static const uint32_t REG_DEMUX_SELECT_ADDR;
+ static const uint32_t REG_MUX_SELECT_ADDR;
+
+ /*! Connects an input to an output
+ *
+ * Bridges an input to an output. Any existing connections on
+ * either the input or output will be dropped.
+ *
+ * \param input Index of the input port.
+ * \param output Index of the output port.
+ */
+ virtual void connect(const size_t input, const size_t output) = 0;
+};
+
+}} // namespace uhd::rfnoc