aboutsummaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorMichael West <michael.west@ettus.com>2020-03-15 01:17:50 -0700
committerAaron Rossetto <aaron.rossetto@ni.com>2020-05-12 12:03:31 -0500
commit12dfb97c8efce40494efb35bdd81d06b6f8b9b62 (patch)
tree7a5e7f12425dd6a3c5fbb9e2b2ff7faf3a276482 /host
parent7886b71f13e9f6e5786c95286ef98f49ab716119 (diff)
downloaduhd-12dfb97c8efce40494efb35bdd81d06b6f8b9b62.tar.gz
uhd-12dfb97c8efce40494efb35bdd81d06b6f8b9b62.tar.bz2
uhd-12dfb97c8efce40494efb35bdd81d06b6f8b9b62.zip
DUC/DDC: Add variable time increment
Sets time increment based on tick rate and sample rate instead of assuming one tick per sample. Defaults to legacy behavior. Minor compat number bumped on DUC and DDC blocks. Signed-off-by: Michael West <michael.west@ettus.com>
Diffstat (limited to 'host')
-rw-r--r--host/include/uhd/rfnoc/ddc_block_control.hpp1
-rw-r--r--host/include/uhd/rfnoc/duc_block_control.hpp1
-rw-r--r--host/lib/rfnoc/ddc_block_control.cpp26
-rw-r--r--host/lib/rfnoc/duc_block_control.cpp21
4 files changed, 28 insertions, 21 deletions
diff --git a/host/include/uhd/rfnoc/ddc_block_control.hpp b/host/include/uhd/rfnoc/ddc_block_control.hpp
index f4197dd55..834fa0aa3 100644
--- a/host/include/uhd/rfnoc/ddc_block_control.hpp
+++ b/host/include/uhd/rfnoc/ddc_block_control.hpp
@@ -46,6 +46,7 @@ public:
static const uint32_t SR_DECIM_ADDR;
static const uint32_t SR_MUX_ADDR;
static const uint32_t SR_COEFFS_ADDR;
+ static const uint32_t SR_TIME_INCR_ADDR;
/*! Set the DDS frequency
*
diff --git a/host/include/uhd/rfnoc/duc_block_control.hpp b/host/include/uhd/rfnoc/duc_block_control.hpp
index 4cf8a8fb8..cf9d3a5d7 100644
--- a/host/include/uhd/rfnoc/duc_block_control.hpp
+++ b/host/include/uhd/rfnoc/duc_block_control.hpp
@@ -45,6 +45,7 @@ public:
static const uint32_t SR_FREQ_ADDR;
static const uint32_t SR_SCALE_IQ_ADDR;
static const uint32_t SR_INTERP_ADDR;
+ static const uint32_t SR_TIME_INCR_ADDR;
/*! Set the DDS frequency
*
diff --git a/host/lib/rfnoc/ddc_block_control.cpp b/host/lib/rfnoc/ddc_block_control.cpp
index abf8d1f7b..99a00dd1d 100644
--- a/host/lib/rfnoc/ddc_block_control.cpp
+++ b/host/lib/rfnoc/ddc_block_control.cpp
@@ -34,21 +34,22 @@ constexpr uint32_t REG_CHAN_OFFSET = 2048;
using namespace uhd::rfnoc;
-const uint16_t ddc_block_control::MINOR_COMPAT = 0;
+const uint16_t ddc_block_control::MINOR_COMPAT = 1;
const uint16_t ddc_block_control::MAJOR_COMPAT = 0;
const uint32_t ddc_block_control::RB_COMPAT_NUM = 0; // read this first
const uint32_t ddc_block_control::RB_NUM_HB = 8;
const uint32_t ddc_block_control::RB_CIC_MAX_DECIM = 16;
-const uint32_t ddc_block_control::SR_N_ADDR = 128 * 8;
-const uint32_t ddc_block_control::SR_M_ADDR = 129 * 8;
-const uint32_t ddc_block_control::SR_CONFIG_ADDR = 130 * 8;
-const uint32_t ddc_block_control::SR_FREQ_ADDR = 132 * 8;
-const uint32_t ddc_block_control::SR_SCALE_IQ_ADDR = 133 * 8;
-const uint32_t ddc_block_control::SR_DECIM_ADDR = 134 * 8;
-const uint32_t ddc_block_control::SR_MUX_ADDR = 135 * 8;
-const uint32_t ddc_block_control::SR_COEFFS_ADDR = 136 * 8;
+const uint32_t ddc_block_control::SR_N_ADDR = 128 * 8;
+const uint32_t ddc_block_control::SR_M_ADDR = 129 * 8;
+const uint32_t ddc_block_control::SR_CONFIG_ADDR = 130 * 8;
+const uint32_t ddc_block_control::SR_FREQ_ADDR = 132 * 8;
+const uint32_t ddc_block_control::SR_SCALE_IQ_ADDR = 133 * 8;
+const uint32_t ddc_block_control::SR_DECIM_ADDR = 134 * 8;
+const uint32_t ddc_block_control::SR_MUX_ADDR = 135 * 8;
+const uint32_t ddc_block_control::SR_COEFFS_ADDR = 136 * 8;
+const uint32_t ddc_block_control::SR_TIME_INCR_ADDR = 137 * 8;
class ddc_block_control_impl : public ddc_block_control
{
@@ -478,11 +479,12 @@ private:
// Rate change = M/N
_ddc_reg_iface.poke32(SR_N_ADDR, decim, chan);
- // FIXME:
- // - eiscat DDC had a real mode, where M needed to be 2
- // - TwinRX had some issues with M == 1
_ddc_reg_iface.poke32(SR_M_ADDR, 1, chan);
+ // Configure time increment in ticks per M output samples
+ _ddc_reg_iface.poke32(SR_TIME_INCR_ADDR,
+ uint32_t(get_tick_rate()/get_output_rate(chan)), chan);
+
if (cic_decim > 1 and hb_enable == 0) {
RFNOC_LOG_WARNING(
"The requested decimation is odd; the user should expect passband "
diff --git a/host/lib/rfnoc/duc_block_control.cpp b/host/lib/rfnoc/duc_block_control.cpp
index 5888e300e..c5dd2ff02 100644
--- a/host/lib/rfnoc/duc_block_control.cpp
+++ b/host/lib/rfnoc/duc_block_control.cpp
@@ -34,19 +34,20 @@ constexpr uint32_t REG_CHAN_OFFSET = 2048;
using namespace uhd::rfnoc;
-const uint16_t duc_block_control::MINOR_COMPAT = 0;
+const uint16_t duc_block_control::MINOR_COMPAT = 1;
const uint16_t duc_block_control::MAJOR_COMPAT = 0;
const uint32_t duc_block_control::RB_COMPAT_NUM = 0; // read this first
const uint32_t duc_block_control::RB_NUM_HB = 8;
const uint32_t duc_block_control::RB_CIC_MAX_INTERP = 16;
-const uint32_t duc_block_control::SR_N_ADDR = 128 * 8;
-const uint32_t duc_block_control::SR_M_ADDR = 129 * 8;
-const uint32_t duc_block_control::SR_CONFIG_ADDR = 130 * 8;
-const uint32_t duc_block_control::SR_INTERP_ADDR = 131 * 8;
-const uint32_t duc_block_control::SR_FREQ_ADDR = 132 * 8;
-const uint32_t duc_block_control::SR_SCALE_IQ_ADDR = 133 * 8;
+const uint32_t duc_block_control::SR_N_ADDR = 128 * 8;
+const uint32_t duc_block_control::SR_M_ADDR = 129 * 8;
+const uint32_t duc_block_control::SR_CONFIG_ADDR = 130 * 8;
+const uint32_t duc_block_control::SR_INTERP_ADDR = 131 * 8;
+const uint32_t duc_block_control::SR_FREQ_ADDR = 132 * 8;
+const uint32_t duc_block_control::SR_SCALE_IQ_ADDR = 133 * 8;
+const uint32_t duc_block_control::SR_TIME_INCR_ADDR = 137 * 8;
class duc_block_control_impl : public duc_block_control
{
@@ -464,10 +465,12 @@ private:
// Rate change = M/N, where N = 1
_duc_reg_iface.poke32(SR_M_ADDR, interp, chan);
- // FIXME:
- // - TwinRX had some issues with N == 1
_duc_reg_iface.poke32(SR_N_ADDR, 1, chan);
+ // Configure time increment in ticks per M output samples
+ _duc_reg_iface.poke32(SR_TIME_INCR_ADDR,
+ uint32_t(get_tick_rate()/get_output_rate(chan)), chan);
+
if (cic_interp > 1 and hb_enable == 0) {
RFNOC_LOG_WARNING(
"The requested interpolation is odd; the user should expect passband "