From 1ce6f961a76a455da2284f771a2d0140223a8f48 Mon Sep 17 00:00:00 2001 From: Aaron Rossetto Date: Wed, 17 Jun 2020 10:40:17 -0500 Subject: rfnoc: Add Log Power RFNoC block support --- host/include/uhd/rfnoc/CMakeLists.txt | 1 + host/include/uhd/rfnoc/defaults.hpp | 2 ++ host/include/uhd/rfnoc/logpwr_block_control.hpp | 26 +++++++++++++++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 host/include/uhd/rfnoc/logpwr_block_control.hpp (limited to 'host/include') 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 +#include + +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 -- cgit v1.2.3