| USRP Hardware Driver and Device Manual Version: 4.10.0.0 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
12 namespace 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
19 static const std::string PROP_KEY_MAGNITUDE = "magnitude";
20 static const std::string PROP_KEY_DIRECTION = "direction";
21 static const std::string PROP_KEY_LENGTH = "length";
22 static const std::string PROP_KEY_FFT_SCALING = "fft_scaling";
23 static const std::string PROP_KEY_FFT_SCALING_FACTOR = "fft_scaling_factor";
24 static const std::string PROP_KEY_SHIFT_CONFIG = "shift_config";
25 static const std::string PROP_KEY_BYPASS_MODE = "bypass_mode";
26 static const std::string PROP_KEY_CP_INSERTION_LIST = "cp_insertion_list";
27 static const std::string PROP_KEY_CP_REMOVAL_LIST = "cp_removal_list";
28 static const std::string PROP_KEY_NIPC = "nipc";
29 static const std::string PROP_KEY_MAX_LENGTH = "max_length";
30 static const std::string PROP_KEY_MAX_CP_LENGTH = "max_cp_length";
31 static const std::string PROP_KEY_MAX_CP_INSERTION_LIST_LENGTH =
32 "max_cp_insertion_list_length";
33 static const std::string PROP_KEY_MAX_CP_REMOVAL_LIST_LENGTH =
34 "max_cp_removal_list_length";
35// clang-format off
407// clang-format on
408 class UHD_API fft_block_control : public uhd::rfnoc::noc_block_base
409{
410 public:
411 RFNOC_DECLARE_BLOCK(fft_block_control)
412
413
414 static const uint32_t REG_COMPAT_ADDR;
415 static const uint32_t REG_PORT_CONFIG_ADDR;
416 static const uint32_t REG_CAPABILITIES_ADDR;
417 static const uint32_t REG_CAPABILITIES2_ADDR;
418 static const uint32_t REG_RESET_ADDR;
419 static const uint32_t REG_LENGTH_LOG2_ADDR;
420 static const uint32_t REG_SCALING_ADDR;
421 static const uint32_t REG_DIRECTION_ADDR;
422 static const uint32_t REG_CP_INS_LEN_ADDR;
423 static const uint32_t REG_CP_INS_LIST_LOAD_ADDR;
424 static const uint32_t REG_CP_INS_LIST_CLR_ADDR;
425 static const uint32_t REG_CP_INS_LIST_OCC_ADDR;
426 static const uint32_t REG_CP_REM_LEN_ADDR;
427 static const uint32_t REG_CP_REM_LIST_LOAD_ADDR;
428 static const uint32_t REG_CP_REM_LIST_CLR_ADDR;
429 static const uint32_t REG_CP_REM_LIST_OCC_ADDR;
430 static const uint32_t REG_OVERFLOW_ADDR;
431 static const uint32_t REG_BYPASS_ADDR;
432 static const uint32_t REG_ORDER_ADDR;
433 static const uint32_t REG_MAGNITUDE_ADDR;
434
436 static const uint32_t REG_RESET_ADDR_V1;
437 static const uint32_t REG_LENGTH_LOG2_ADDR_V1;
438 static const uint32_t REG_MAGNITUDE_ADDR_V1;
439 static const uint32_t REG_DIRECTION_ADDR_V1;
440 static const uint32_t REG_SCALING_ADDR_V1;
441 static const uint32_t REG_ORDER_ADDR_V1;
442
450 virtual void set_direction(const fft_direction direction) = 0;
451
458 virtual fft_direction get_direction() const = 0;
459
471 virtual void set_magnitude(const fft_magnitude magnitude) = 0;
472
479 virtual fft_magnitude get_magnitude() const = 0;
480
500 virtual void set_shift_config(const fft_shift shift) = 0;
501
508 virtual fft_shift get_shift_config() const = 0;
509
529 virtual void set_scaling_factor(const double factor) = 0;
530
549 virtual void set_scaling(const uint32_t scaling) = 0;
550
557 virtual uint32_t get_scaling() const = 0;
558
567 virtual void set_length(const uint32_t length) = 0;
568
575 virtual uint32_t get_length() const = 0;
576
586 virtual void set_bypass_mode(const bool bypass) = 0;
587
594 virtual bool get_bypass_mode() const = 0;
595
604 virtual uint32_t get_nipc() const = 0;
605
612 virtual uint32_t get_max_length() const = 0;
613
620 virtual uint32_t get_max_cp_length() const = 0;
621
630 virtual uint32_t get_max_cp_removal_list_length() const = 0;
631
640 virtual uint32_t get_max_cp_insertion_list_length() const = 0;
641
654 virtual void set_cp_insertion_list(const std::vector<uint32_t> cp_lengths) = 0;
655
662 virtual std::vector<uint32_t> get_cp_insertion_list() const = 0;
663
677 virtual void set_cp_removal_list(const std::vector<uint32_t> cp_lengths) = 0;
678
685 virtual std::vector<uint32_t> get_cp_removal_list() const = 0;
686};
687
688}} // namespace uhd::rfnoc
uhd::rfnoc::fft_block_control
Definition fft_block_control.hpp:409
uhd::rfnoc::fft_block_control::REG_SCALING_ADDR_V1
static const uint32_t REG_SCALING_ADDR_V1
Definition fft_block_control.hpp:440
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:425
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:441
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:423
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:430
uhd::rfnoc::fft_block_control::REG_COMPAT_ADDR
static const uint32_t REG_COMPAT_ADDR
Register addresses.
Definition fft_block_control.hpp:414
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:428
uhd::rfnoc::fft_block_control::REG_MAGNITUDE_ADDR_V1
static const uint32_t REG_MAGNITUDE_ADDR_V1
Definition fft_block_control.hpp:438
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:439
uhd::rfnoc::fft_block_control::REG_BYPASS_ADDR
static const uint32_t REG_BYPASS_ADDR
Definition fft_block_control.hpp:431
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:420
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:427
uhd::rfnoc::fft_block_control::REG_PORT_CONFIG_ADDR
static const uint32_t REG_PORT_CONFIG_ADDR
Definition fft_block_control.hpp:415
uhd::rfnoc::fft_block_control::REG_LENGTH_LOG2_ADDR_V1
static const uint32_t REG_LENGTH_LOG2_ADDR_V1
Definition fft_block_control.hpp:437
uhd::rfnoc::fft_block_control::REG_CP_REM_LEN_ADDR
static const uint32_t REG_CP_REM_LEN_ADDR
Definition fft_block_control.hpp:426
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:424
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:433
uhd::rfnoc::fft_block_control::REG_CAPABILITIES2_ADDR
static const uint32_t REG_CAPABILITIES2_ADDR
Definition fft_block_control.hpp:417
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:429
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:436
uhd::rfnoc::fft_block_control::REG_CP_INS_LEN_ADDR
static const uint32_t REG_CP_INS_LEN_ADDR
Definition fft_block_control.hpp:422
uhd::rfnoc::fft_block_control::REG_LENGTH_LOG2_ADDR
static const uint32_t REG_LENGTH_LOG2_ADDR
Definition fft_block_control.hpp:419
uhd::rfnoc::fft_block_control::REG_ORDER_ADDR
static const uint32_t REG_ORDER_ADDR
Definition fft_block_control.hpp:432
uhd::rfnoc::fft_block_control::REG_CAPABILITIES_ADDR
static const uint32_t REG_CAPABILITIES_ADDR
Definition fft_block_control.hpp:416
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:418
uhd::rfnoc::fft_block_control::REG_DIRECTION_ADDR
static const uint32_t REG_DIRECTION_ADDR
Definition fft_block_control.hpp:421
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:42
UHD_API
#define UHD_API
Definition config.h:87
config.hpp
std
STL namespace.
uhd::rfnoc
Definition actions.hpp:25
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