aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--host/include/uhd/rfnoc/ddc_block_control.hpp7
-rw-r--r--host/include/uhd/rfnoc/duc_block_control.hpp7
-rw-r--r--host/lib/rfnoc/ddc_block_control.cpp5
-rw-r--r--host/lib/rfnoc/duc_block_control.cpp5
-rw-r--r--host/lib/usrp/multi_usrp_rfnoc.cpp14
5 files changed, 38 insertions, 0 deletions
diff --git a/host/include/uhd/rfnoc/ddc_block_control.hpp b/host/include/uhd/rfnoc/ddc_block_control.hpp
index 88c7ce106..f4197dd55 100644
--- a/host/include/uhd/rfnoc/ddc_block_control.hpp
+++ b/host/include/uhd/rfnoc/ddc_block_control.hpp
@@ -89,6 +89,13 @@ public:
*/
virtual double get_input_rate(const size_t chan) const = 0;
+ /*! Manually set the sampling rate at this block's input
+ *
+ * \param rate The requested rate
+ * \param chan The channel for which the rate is being set
+ */
+ virtual void set_input_rate(const double rate, const size_t chan) = 0;
+
/*! Return the sampling rate at this block's output
*
* This is equivalent to calling get_input_rate() divided by the decimation.
diff --git a/host/include/uhd/rfnoc/duc_block_control.hpp b/host/include/uhd/rfnoc/duc_block_control.hpp
index fcf15068e..4cf8a8fb8 100644
--- a/host/include/uhd/rfnoc/duc_block_control.hpp
+++ b/host/include/uhd/rfnoc/duc_block_control.hpp
@@ -97,6 +97,13 @@ public:
*/
virtual double get_output_rate(const size_t chan) const = 0;
+ /*! Manually set the sampling rate at this block's output
+ *
+ * \param rate The requested rate
+ * \param chan The channel for which the rate is being set
+ */
+ virtual void set_output_rate(const double rate, const size_t chan) = 0;
+
/*! Return a range of valid input rates, based on the current output rate
*
* Note the return value is only valid as long as the output rate does not
diff --git a/host/lib/rfnoc/ddc_block_control.cpp b/host/lib/rfnoc/ddc_block_control.cpp
index 0522991ba..abf8d1f7b 100644
--- a/host/lib/rfnoc/ddc_block_control.cpp
+++ b/host/lib/rfnoc/ddc_block_control.cpp
@@ -136,6 +136,11 @@ public:
return _samp_rate_in.at(chan).is_valid() ? _samp_rate_in.at(chan).get() : 1.0;
}
+ void set_input_rate(const double rate, const size_t chan)
+ {
+ set_property<double>("samp_rate", rate, {res_source_info::INPUT_EDGE, chan});
+ }
+
double get_output_rate(const size_t chan) const
{
return _samp_rate_out.at(chan).is_valid() ? _samp_rate_out.at(chan).get() : 1.0;
diff --git a/host/lib/rfnoc/duc_block_control.cpp b/host/lib/rfnoc/duc_block_control.cpp
index 6b052e17a..5888e300e 100644
--- a/host/lib/rfnoc/duc_block_control.cpp
+++ b/host/lib/rfnoc/duc_block_control.cpp
@@ -138,6 +138,11 @@ public:
return _samp_rate_out.at(chan).is_valid() ? _samp_rate_out.at(chan).get() : 1.0;
}
+ void set_output_rate(const double rate, const size_t chan)
+ {
+ set_property<double>("samp_rate", rate, {res_source_info::OUTPUT_EDGE, chan});
+ }
+
uhd::meta_range_t get_input_rates(const size_t chan) const
{
uhd::meta_range_t result;
diff --git a/host/lib/usrp/multi_usrp_rfnoc.cpp b/host/lib/usrp/multi_usrp_rfnoc.cpp
index 0c716c0a3..f81253997 100644
--- a/host/lib/usrp/multi_usrp_rfnoc.cpp
+++ b/host/lib/usrp/multi_usrp_rfnoc.cpp
@@ -214,6 +214,20 @@ public:
}
}
}
+ // Manually propagate radio block sample rates to DDC/DUC blocks in order to allow
+ // DDC/DUC blocks to have valid internal state before graph is (later) connected
+ for (size_t rx_chan = 0; rx_chan < get_rx_num_channels(); ++rx_chan) {
+ auto& rx_chain = _get_rx_chan(rx_chan);
+ if (rx_chain.ddc) {
+ rx_chain.ddc->set_input_rate(rx_chain.radio->get_rate(), rx_chain.block_chan);
+ }
+ }
+ for (size_t tx_chan = 0; tx_chan < get_tx_num_channels(); ++tx_chan) {
+ auto& tx_chain = _get_tx_chan(tx_chan);
+ if (tx_chain.duc) {
+ tx_chain.duc->set_output_rate(tx_chain.radio->get_rate(), tx_chain.block_chan);
+ }
+ }
_graph->commit();
}