aboutsummaryrefslogtreecommitdiffstats
path: root/host/include
diff options
context:
space:
mode:
authorAaron Rossetto <aaron.rossetto@ni.com>2020-06-17 10:40:17 -0500
committerAaron Rossetto <aaron.rossetto@ni.com>2020-06-29 14:03:17 -0500
commit1ce6f961a76a455da2284f771a2d0140223a8f48 (patch)
treeb74d21c6d6f98522b607514e20a4d233c696173e /host/include
parentcf82b36388880237fe7b690c16dde46afc1a3da3 (diff)
downloaduhd-1ce6f961a76a455da2284f771a2d0140223a8f48.tar.gz
uhd-1ce6f961a76a455da2284f771a2d0140223a8f48.tar.bz2
uhd-1ce6f961a76a455da2284f771a2d0140223a8f48.zip
rfnoc: Add Log Power RFNoC block support
Diffstat (limited to 'host/include')
-rw-r--r--host/include/uhd/rfnoc/CMakeLists.txt1
-rw-r--r--host/include/uhd/rfnoc/defaults.hpp2
-rw-r--r--host/include/uhd/rfnoc/logpwr_block_control.hpp26
3 files changed, 29 insertions, 0 deletions
diff --git a/host/include/uhd/rfnoc/CMakeLists.txt b/host/include/uhd/rfnoc/CMakeLists.txt
index cc91a6125..33d324a4d 100644
--- a/host/include/uhd/rfnoc/CMakeLists.txt
+++ b/host/include/uhd/rfnoc/CMakeLists.txt
@@ -38,6 +38,7 @@ UHD_INSTALL(FILES
fft_block_control.hpp
fir_filter_block_control.hpp
fosphor_block_control.hpp
+ logpwr_block_control.hpp
null_block_control.hpp
radio_control.hpp
split_stream_block_control.hpp
diff --git a/host/include/uhd/rfnoc/defaults.hpp b/host/include/uhd/rfnoc/defaults.hpp
index 2104e8416..30df8cbc4 100644
--- a/host/include/uhd/rfnoc/defaults.hpp
+++ b/host/include/uhd/rfnoc/defaults.hpp
@@ -29,6 +29,7 @@ static const std::string PROP_KEY_MTU("mtu");
static const std::string NODE_ID_SEP("SEP");
using io_type_t = std::string;
+static const io_type_t IO_TYPE_S16 = "s16";
static const io_type_t IO_TYPE_SC16 = "sc16";
static const io_type_t IO_TYPE_U8 = "u8";
@@ -78,6 +79,7 @@ static const noc_id_t DDC_BLOCK = 0xDDC00000;
static const noc_id_t FFT_BLOCK = 0xFF700000;
static const noc_id_t FIR_FILTER_BLOCK = 0xF1120000;
static const noc_id_t FOSPHOR_BLOCK = 0x666F0000;
+static const noc_id_t LOGPWR_BLOCK = 0x4C500000;
static const noc_id_t SPLIT_STREAM_BLOCK = 0x57570000;
static const noc_id_t RADIO_BLOCK = 0x12AD1000;
static const noc_id_t VECTOR_IIR_BLOCK = 0x11120000;
diff --git a/host/include/uhd/rfnoc/logpwr_block_control.hpp b/host/include/uhd/rfnoc/logpwr_block_control.hpp
new file mode 100644
index 000000000..45b4b61a3
--- /dev/null
+++ b/host/include/uhd/rfnoc/logpwr_block_control.hpp
@@ -0,0 +1,26 @@
+//
+// 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 {
+
+/*! Log Power Block Control Class
+ *
+ * The Log Power Block is an RFNoC block that takes in a packet of signed
+ * 16-bit complex samples and computes an estimate of 1024 * log2(i^2 + q^2),
+ * putting the result in the upper 16 bits of each 32-bit output sample.
+ */
+class UHD_API logpwr_block_control : public noc_block_base
+{
+public:
+ RFNOC_DECLARE_BLOCK(logpwr_block_control)
+};
+
+}} // namespace uhd::rfnoc