USRP Hardware Driver and Device Manual  Version: 4.10.0.0-0-g2af4ddb9
UHD and USRP Manual
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>
11 
12 namespace uhd { namespace rfnoc {
13 
15 enum class fft_direction { REVERSE, FORWARD };
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
409 {
410 public:
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
Definition: fft_block_control.hpp:409
Definition: noc_block_base.hpp:42
#define UHD_API
Definition: config.h:87
fft_magnitude
Definition: fft_block_control.hpp:16
fft_shift
Definition: fft_block_control.hpp:14
fft_direction
Definition: fft_block_control.hpp:15
UHD_INLINE size_t shift(const soft_reg_field_t field)
Definition: soft_register.hpp:80
Definition: build_info.hpp:12
#define RFNOC_DECLARE_BLOCK(CLASS_NAME)
Definition: noc_block_base.hpp:22