USRP Hardware Driver and USRP Manual: fft_block_control.hpp Source File

| USRP Hardware Driver and USRP Manual Version: 4.9.0.makepkg-0-g9ec1f582 UHD and USRP Manual |

Loading...
Searching...
No Matches
fft_block_control.hpp
Go to the documentation of this file.
1//
2// Copyright 2024 Ettus Research, a National Instruments Brand
3//
4// SPDX-License-Identifier: GPL-3.0-or-later
5//
6
7#pragma once
8
9#include <uhd/config.hpp>
10#include <uhd/rfnoc/noc_block_base.hpp>
11
12namespace uhd { namespace rfnoc {
13
14 enum class fft_shift { NORMAL, REVERSE, NATURAL, BIT_REVERSE };
15 enum class fft_direction { REVERSE, FORWARD };
16 enum class fft_magnitude { COMPLEX, MAGNITUDE, MAGNITUDE_SQUARED };
17
18// Custom property keys
19static const std::string PROP_KEY_MAGNITUDE = "magnitude";
20static const std::string PROP_KEY_DIRECTION = "direction";
21static const std::string PROP_KEY_LENGTH = "length";
22static const std::string PROP_KEY_FFT_SCALING = "fft_scaling";
23static const std::string PROP_KEY_FFT_SCALING_FACTOR = "fft_scaling_factor";
24static const std::string PROP_KEY_SHIFT_CONFIG = "shift_config";
25static const std::string PROP_KEY_BYPASS_MODE = "bypass_mode";
26static const std::string PROP_KEY_CP_INSERTION_LIST = "cp_insertion_list";
27static const std::string PROP_KEY_CP_REMOVAL_LIST = "cp_removal_list";
28static const std::string PROP_KEY_NIPC = "nipc";
29static const std::string PROP_KEY_MAX_LENGTH = "max_length";
30static const std::string PROP_KEY_MAX_CP_LENGTH = "max_cp_length";
31static const std::string PROP_KEY_MAX_CP_INSERTION_LIST_LENGTH =
32 "max_cp_insertion_list_length";
33static const std::string PROP_KEY_MAX_CP_REMOVAL_LIST_LENGTH =
34 "max_cp_removal_list_length";
35
58 class UHD_API fft_block_control : public uhd::rfnoc::noc_block_base
59{
60public:
61 RFNOC_DECLARE_BLOCK(fft_block_control)
62
63
64 static const uint32_t REG_COMPAT_ADDR;
65 static const uint32_t REG_PORT_CONFIG_ADDR;
66 static const uint32_t REG_CAPABILITIES_ADDR;
67 static const uint32_t REG_CAPABILITIES2_ADDR;
68 static const uint32_t REG_RESET_ADDR;
69 static const uint32_t REG_LENGTH_LOG2_ADDR;
70 static const uint32_t REG_SCALING_ADDR;
71 static const uint32_t REG_DIRECTION_ADDR;
72 static const uint32_t REG_CP_INS_LEN_ADDR;
73 static const uint32_t REG_CP_INS_LIST_LOAD_ADDR;
74 static const uint32_t REG_CP_INS_LIST_CLR_ADDR;
75 static const uint32_t REG_CP_INS_LIST_OCC_ADDR;
76 static const uint32_t REG_CP_REM_LEN_ADDR;
77 static const uint32_t REG_CP_REM_LIST_LOAD_ADDR;
78 static const uint32_t REG_CP_REM_LIST_CLR_ADDR;
79 static const uint32_t REG_CP_REM_LIST_OCC_ADDR;
80 static const uint32_t REG_OVERFLOW_ADDR;
81 static const uint32_t REG_BYPASS_ADDR;
82 static const uint32_t REG_ORDER_ADDR;
83 static const uint32_t REG_MAGNITUDE_ADDR;
84
86 static const uint32_t REG_RESET_ADDR_V1;
87 static const uint32_t REG_LENGTH_LOG2_ADDR_V1;
88 static const uint32_t REG_MAGNITUDE_ADDR_V1;
89 static const uint32_t REG_DIRECTION_ADDR_V1;
90 static const uint32_t REG_SCALING_ADDR_V1;
91 static const uint32_t REG_ORDER_ADDR_V1;
92
100 virtual void set_direction(const fft_direction direction) = 0;
101
108 virtual fft_direction get_direction() const = 0;
109
121 virtual void set_magnitude(const fft_magnitude magnitude) = 0;
122
129 virtual fft_magnitude get_magnitude() const = 0;
130
150 virtual void set_shift_config(const fft_shift shift) = 0;
151
158 virtual fft_shift get_shift_config() const = 0;
159
179 virtual void set_scaling_factor(const double factor) = 0;
180
199 virtual void set_scaling(const uint32_t scaling) = 0;
200
207 virtual uint32_t get_scaling() const = 0;
208
217 virtual void set_length(const uint32_t length) = 0;
218
225 virtual uint32_t get_length() const = 0;
226
236 virtual void set_bypass_mode(const bool bypass) = 0;
237
244 virtual bool get_bypass_mode() const = 0;
245
254 virtual uint32_t get_nipc() const = 0;
255
262 virtual uint32_t get_max_length() const = 0;
263
270 virtual uint32_t get_max_cp_length() const = 0;
271
280 virtual uint32_t get_max_cp_removal_list_length() const = 0;
281
290 virtual uint32_t get_max_cp_insertion_list_length() const = 0;
291
304 virtual void set_cp_insertion_list(const std::vector<uint32_t> cp_lengths) = 0;
305
314 virtual std::vector<uint32_t> get_cp_insertion_list() const = 0;
315
329 virtual void set_cp_removal_list(const std::vector<uint32_t> cp_lengths) = 0;
330
339 virtual std::vector<uint32_t> get_cp_removal_list() const = 0;
340};
341
342}} // namespace uhd::rfnoc
uhd::rfnoc::fft_block_control
Definition fft_block_control.hpp:59
uhd::rfnoc::fft_block_control::REG_SCALING_ADDR_V1
static const uint32_t REG_SCALING_ADDR_V1
Definition fft_block_control.hpp:90
uhd::rfnoc::fft_block_control::set_length
virtual void set_length(const uint32_t length)=0
uhd::rfnoc::fft_block_control::get_max_cp_insertion_list_length
virtual uint32_t get_max_cp_insertion_list_length() const =0
uhd::rfnoc::fft_block_control::REG_CP_INS_LIST_OCC_ADDR
static const uint32_t REG_CP_INS_LIST_OCC_ADDR
Definition fft_block_control.hpp:75
uhd::rfnoc::fft_block_control::set_bypass_mode
virtual void set_bypass_mode(const bool bypass)=0
uhd::rfnoc::fft_block_control::get_direction
virtual fft_direction get_direction() const =0
uhd::rfnoc::fft_block_control::REG_ORDER_ADDR_V1
static const uint32_t REG_ORDER_ADDR_V1
Definition fft_block_control.hpp:91
uhd::rfnoc::fft_block_control::set_cp_insertion_list
virtual void set_cp_insertion_list(const std::vector< uint32_t > cp_lengths)=0
uhd::rfnoc::fft_block_control::REG_CP_INS_LIST_LOAD_ADDR
static const uint32_t REG_CP_INS_LIST_LOAD_ADDR
Definition fft_block_control.hpp:73
uhd::rfnoc::fft_block_control::get_max_cp_removal_list_length
virtual uint32_t get_max_cp_removal_list_length() const =0
uhd::rfnoc::fft_block_control::get_length
virtual uint32_t get_length() const =0
uhd::rfnoc::fft_block_control::REG_OVERFLOW_ADDR
static const uint32_t REG_OVERFLOW_ADDR
Definition fft_block_control.hpp:80
uhd::rfnoc::fft_block_control::REG_COMPAT_ADDR
static const uint32_t REG_COMPAT_ADDR
Register addresses.
Definition fft_block_control.hpp:64
uhd::rfnoc::fft_block_control::REG_CP_REM_LIST_CLR_ADDR
static const uint32_t REG_CP_REM_LIST_CLR_ADDR
Definition fft_block_control.hpp:78
uhd::rfnoc::fft_block_control::REG_MAGNITUDE_ADDR_V1
static const uint32_t REG_MAGNITUDE_ADDR_V1
Definition fft_block_control.hpp:88
uhd::rfnoc::fft_block_control::get_bypass_mode
virtual bool get_bypass_mode() const =0
uhd::rfnoc::fft_block_control::REG_DIRECTION_ADDR_V1
static const uint32_t REG_DIRECTION_ADDR_V1
Definition fft_block_control.hpp:89
uhd::rfnoc::fft_block_control::REG_BYPASS_ADDR
static const uint32_t REG_BYPASS_ADDR
Definition fft_block_control.hpp:81
uhd::rfnoc::fft_block_control::get_shift_config
virtual fft_shift get_shift_config() const =0
uhd::rfnoc::fft_block_control::REG_SCALING_ADDR
static const uint32_t REG_SCALING_ADDR
Definition fft_block_control.hpp:70
uhd::rfnoc::fft_block_control::get_scaling
virtual uint32_t get_scaling() const =0
uhd::rfnoc::fft_block_control::set_shift_config
virtual void set_shift_config(const fft_shift shift)=0
uhd::rfnoc::fft_block_control::REG_CP_REM_LIST_LOAD_ADDR
static const uint32_t REG_CP_REM_LIST_LOAD_ADDR
Definition fft_block_control.hpp:77
uhd::rfnoc::fft_block_control::REG_PORT_CONFIG_ADDR
static const uint32_t REG_PORT_CONFIG_ADDR
Definition fft_block_control.hpp:65
uhd::rfnoc::fft_block_control::REG_LENGTH_LOG2_ADDR_V1
static const uint32_t REG_LENGTH_LOG2_ADDR_V1
Definition fft_block_control.hpp:87
uhd::rfnoc::fft_block_control::REG_CP_REM_LEN_ADDR
static const uint32_t REG_CP_REM_LEN_ADDR
Definition fft_block_control.hpp:76
uhd::rfnoc::fft_block_control::get_max_length
virtual uint32_t get_max_length() const =0
uhd::rfnoc::fft_block_control::get_cp_insertion_list
virtual std::vector< uint32_t > get_cp_insertion_list() const =0
uhd::rfnoc::fft_block_control::REG_CP_INS_LIST_CLR_ADDR
static const uint32_t REG_CP_INS_LIST_CLR_ADDR
Definition fft_block_control.hpp:74
uhd::rfnoc::fft_block_control::set_cp_removal_list
virtual void set_cp_removal_list(const std::vector< uint32_t > cp_lengths)=0
uhd::rfnoc::fft_block_control::get_nipc
virtual uint32_t get_nipc() const =0
uhd::rfnoc::fft_block_control::REG_MAGNITUDE_ADDR
static const uint32_t REG_MAGNITUDE_ADDR
Definition fft_block_control.hpp:83
uhd::rfnoc::fft_block_control::REG_CAPABILITIES2_ADDR
static const uint32_t REG_CAPABILITIES2_ADDR
Definition fft_block_control.hpp:67
uhd::rfnoc::fft_block_control::REG_CP_REM_LIST_OCC_ADDR
static const uint32_t REG_CP_REM_LIST_OCC_ADDR
Definition fft_block_control.hpp:79
uhd::rfnoc::fft_block_control::REG_RESET_ADDR_V1
static const uint32_t REG_RESET_ADDR_V1
Register addresses of the FFT block version 1.
Definition fft_block_control.hpp:86
uhd::rfnoc::fft_block_control::REG_CP_INS_LEN_ADDR
static const uint32_t REG_CP_INS_LEN_ADDR
Definition fft_block_control.hpp:72
uhd::rfnoc::fft_block_control::REG_LENGTH_LOG2_ADDR
static const uint32_t REG_LENGTH_LOG2_ADDR
Definition fft_block_control.hpp:69
uhd::rfnoc::fft_block_control::REG_ORDER_ADDR
static const uint32_t REG_ORDER_ADDR
Definition fft_block_control.hpp:82
uhd::rfnoc::fft_block_control::REG_CAPABILITIES_ADDR
static const uint32_t REG_CAPABILITIES_ADDR
Definition fft_block_control.hpp:66
uhd::rfnoc::fft_block_control::set_scaling_factor
virtual void set_scaling_factor(const double factor)=0
uhd::rfnoc::fft_block_control::set_scaling
virtual void set_scaling(const uint32_t scaling)=0
uhd::rfnoc::fft_block_control::REG_RESET_ADDR
static const uint32_t REG_RESET_ADDR
Definition fft_block_control.hpp:68
uhd::rfnoc::fft_block_control::REG_DIRECTION_ADDR
static const uint32_t REG_DIRECTION_ADDR
Definition fft_block_control.hpp:71
uhd::rfnoc::fft_block_control::get_magnitude
virtual fft_magnitude get_magnitude() const =0
uhd::rfnoc::fft_block_control::get_max_cp_length
virtual uint32_t get_max_cp_length() const =0
uhd::rfnoc::fft_block_control::get_cp_removal_list
virtual std::vector< uint32_t > get_cp_removal_list() const =0
uhd::rfnoc::fft_block_control::set_direction
virtual void set_direction(const fft_direction direction)=0
uhd::rfnoc::fft_block_control::set_magnitude
virtual void set_magnitude(const fft_magnitude magnitude)=0
uhd::rfnoc::noc_block_base
Definition noc_block_base.hpp:43
UHD_API
#define UHD_API
Definition config.h:87
config.hpp
std
STL namespace.
uhd::rfnoc
Definition actions.hpp:24
uhd::rfnoc::fft_magnitude
fft_magnitude
Definition fft_block_control.hpp:16
uhd::rfnoc::fft_magnitude::MAGNITUDE_SQUARED
@ MAGNITUDE_SQUARED
Definition fft_block_control.hpp:16
uhd::rfnoc::fft_magnitude::COMPLEX
@ COMPLEX
Definition fft_block_control.hpp:16
uhd::rfnoc::fft_magnitude::MAGNITUDE
@ MAGNITUDE
Definition fft_block_control.hpp:16
uhd::rfnoc::fft_shift
fft_shift
Definition fft_block_control.hpp:14
uhd::rfnoc::fft_shift::BIT_REVERSE
@ BIT_REVERSE
Definition fft_block_control.hpp:14
uhd::rfnoc::fft_shift::NORMAL
@ NORMAL
Definition fft_block_control.hpp:14
uhd::rfnoc::fft_shift::NATURAL
@ NATURAL
Definition fft_block_control.hpp:14
uhd::rfnoc::fft_shift::REVERSE
@ REVERSE
Definition fft_block_control.hpp:14
uhd::rfnoc::fft_direction
fft_direction
Definition fft_block_control.hpp:15
uhd::rfnoc::fft_direction::FORWARD
@ FORWARD
Definition fft_block_control.hpp:15
uhd
Definition build_info.hpp:12
noc_block_base.hpp
RFNOC_DECLARE_BLOCK
#define RFNOC_DECLARE_BLOCK(CLASS_NAME)
Definition noc_block_base.hpp:22