aboutsummaryrefslogtreecommitdiffstats
path: root/host/include
diff options
context:
space:
mode:
authorLars Amsel <lars.amsel@ni.com>2019-08-26 16:55:14 +0200
committerMartin Braun <martin.braun@ettus.com>2019-11-26 12:16:25 -0800
commitf5c06403041edeecd0c0d7078ccadb60e7c98838 (patch)
treee0ea85b225c854739a1820e4f53d786abef09bd6 /host/include
parentf9f9cb0d2cd29b1f2da21c026560215e7f3043a5 (diff)
downloaduhd-f5c06403041edeecd0c0d7078ccadb60e7c98838.tar.gz
uhd-f5c06403041edeecd0c0d7078ccadb60e7c98838.tar.bz2
uhd-f5c06403041edeecd0c0d7078ccadb60e7c98838.zip
rfnoc: Port FFT controller
rfnoc used noc-script for FFT controller implementation. Because erfnoc does not support noc-script yet, the implementation is done as a rfnoc controller.
Diffstat (limited to 'host/include')
-rw-r--r--host/include/uhd/rfnoc/CMakeLists.txt1
-rw-r--r--host/include/uhd/rfnoc/blocks/fft_1x64.yml56
-rw-r--r--host/include/uhd/rfnoc/fft_block_control.hpp52
3 files changed, 109 insertions, 0 deletions
diff --git a/host/include/uhd/rfnoc/CMakeLists.txt b/host/include/uhd/rfnoc/CMakeLists.txt
index 9abacbeaa..bb3cc0190 100644
--- a/host/include/uhd/rfnoc/CMakeLists.txt
+++ b/host/include/uhd/rfnoc/CMakeLists.txt
@@ -34,6 +34,7 @@ UHD_INSTALL(FILES
ddc_block_control.hpp
duc_block_control.hpp
dmafifo_block_control.hpp
+ fft_block_control.hpp
null_block_control.hpp
radio_control.hpp
diff --git a/host/include/uhd/rfnoc/blocks/fft_1x64.yml b/host/include/uhd/rfnoc/blocks/fft_1x64.yml
new file mode 100644
index 000000000..ac2155381
--- /dev/null
+++ b/host/include/uhd/rfnoc/blocks/fft_1x64.yml
@@ -0,0 +1,56 @@
+schema: rfnoc_modtool_args
+module_name: fft
+version: 1.0
+rfnoc_version: 1.0
+chdr_width: 64
+noc_id: 0xFF700000
+
+clocks:
+ - name: rfnoc_chdr
+ freq: "[]"
+ - name: rfnoc_ctrl
+ freq: "[]"
+ - name: fft
+ freq: "[]"
+
+control:
+ sw_iface: nocscript
+ fpga_iface: ctrlport
+ interface_direction: master_slave
+ fifo_depth: 32
+ clk_domain: fft
+ ctrlport:
+ byte_mode: True
+ timed: False
+ has_status: False
+
+# parameters:
+
+data:
+ fpga_iface: axis_chdr
+ clk_domain: fft
+ mtu: 1024
+ inputs:
+ port0:
+ index: 0
+ item_width: 32
+ nipc: 2
+ context_fifo_depth: 1
+ payload_fifo_depth: 1
+ format: int32
+ mdata_sig: ~
+ outputs:
+ port0:
+ index: 0
+ item_width: 32
+ nipc: 2
+ context_fifo_depth: 1
+ payload_fifo_depth: 1
+ format: int32
+ mdata_sig: ~
+
+io_port:
+
+registers:
+
+properties:
diff --git a/host/include/uhd/rfnoc/fft_block_control.hpp b/host/include/uhd/rfnoc/fft_block_control.hpp
new file mode 100644
index 000000000..c865dce78
--- /dev/null
+++ b/host/include/uhd/rfnoc/fft_block_control.hpp
@@ -0,0 +1,52 @@
+//
+// Copyright 2019 Ettus Research, a National Instruments Brand
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+//
+
+#ifndef INCLUDED_LIBUHD_FFT_BLOCK_CONTROL_HPP
+#define INCLUDED_LIBUHD_FFT_BLOCK_CONTROL_HPP
+
+#include <uhd/config.hpp>
+#include <uhd/rfnoc/noc_block_base.hpp>
+
+namespace uhd { namespace rfnoc {
+
+enum class fft_shift { NORMAL, REVERSE, NATURAL };
+enum class fft_direction { REVERSE, FORWARD };
+enum class fft_magnitude { COMPLEX, MAGNITUDE, MAGNITUDE_SQUARED };
+
+// Custom property keys
+static const std::string PROP_KEY_MAGNITUDE = "magnitude";
+static const std::string PROP_KEY_DIRECTION = "direction";
+static const std::string PROP_KEY_FFT_LEN = "fft_len";
+static const std::string PROP_KEY_FFT_SCALING = "fft_scaling";
+static const std::string PROP_KEY_FFT_SHIFT = "fft_shift";
+
+/*! FFT Block Control Class
+ */
+class UHD_API fft_block_control : public noc_block_base
+{
+public:
+ RFNOC_DECLARE_BLOCK(fft_block_control)
+
+ // Readback addresses
+ static const uint32_t RB_FFT_RESET;
+ static const uint32_t RB_MAGNITUDE_OUT;
+ static const uint32_t RB_FFT_SIZE_LOG2;
+ static const uint32_t RB_FFT_DIRECTION;
+ static const uint32_t RB_FFT_SCALING;
+ static const uint32_t RB_FFT_SHIFT_CONFIG;
+ // Write addresses
+ static const uint32_t SR_FFT_RESET;
+ static const uint32_t SR_FFT_SIZE_LOG2;
+ static const uint32_t SR_MAGNITUDE_OUT;
+ static const uint32_t SR_FFT_DIRECTION;
+ static const uint32_t SR_FFT_SCALING;
+ static const uint32_t SR_FFT_SHIFT_CONFIG;
+
+};
+
+}} // namespace uhd::rfnoc
+
+#endif /* INCLUDED_LIBUHD_FFT_BLOCK_CONTROL_HPP */