aboutsummaryrefslogtreecommitdiffstats
path: root/host/include
diff options
context:
space:
mode:
Diffstat (limited to 'host/include')
-rw-r--r--host/include/uhd/rfnoc/noc_block_base.hpp32
-rw-r--r--host/include/uhd/rfnoc/noc_block_make_args.hpp4
2 files changed, 36 insertions, 0 deletions
diff --git a/host/include/uhd/rfnoc/noc_block_base.hpp b/host/include/uhd/rfnoc/noc_block_base.hpp
index b671e6525..0959e5bdd 100644
--- a/host/include/uhd/rfnoc/noc_block_base.hpp
+++ b/host/include/uhd/rfnoc/noc_block_base.hpp
@@ -22,6 +22,8 @@
namespace uhd { namespace rfnoc {
+class clock_iface;
+
/*!
* The primary interface to a NoC block in the FPGA
*
@@ -83,10 +85,30 @@ public:
*/
const block_id_t& get_block_id() const { return _block_id; }
+ /*! Returns the tick rate of the current time base
+ *
+ * Note there is only ever one time base (or tick rate) per block.
+ */
+ double get_tick_rate() const { return _tick_rate; }
+
protected:
noc_block_base(make_args_ptr make_args);
+ /*! Update tick rate for this node and all the connected nodes
+ *
+ * Careful: Calling this function will trigger a property propagation to any
+ * block this block is connected to.
+ */
+ void set_tick_rate(const double tick_rate);
+
private:
+ /*! Update the tick rate of this block
+ *
+ * This will make sure that the underlying register_iface is notified of the
+ * change in timebase.
+ */
+ void _set_tick_rate(const double tick_rate);
+
//! This block's Noc-ID
noc_id_t _noc_id;
@@ -100,6 +122,16 @@ private:
//! Number of output ports
size_t _num_output_ports;
+
+ //! Container for the 'tick rate' property. This will hold one edge property
+ // for all in- and output edges.
+ std::vector<property_t<double>> _tick_rate_props;
+
+ //! The actual tick rate of the current time base
+ double _tick_rate;
+
+ std::shared_ptr<clock_iface> _clock_iface;
+
}; // class noc_block_base
}} /* namespace uhd::rfnoc */
diff --git a/host/include/uhd/rfnoc/noc_block_make_args.hpp b/host/include/uhd/rfnoc/noc_block_make_args.hpp
index c9b530589..d3679f973 100644
--- a/host/include/uhd/rfnoc/noc_block_make_args.hpp
+++ b/host/include/uhd/rfnoc/noc_block_make_args.hpp
@@ -14,6 +14,7 @@
namespace uhd { namespace rfnoc {
class clock_iface;
+
/*! Data structure to hold the arguments passed into the noc_block_base ctor
*
* We want to hide these from the user, so she can't futz around with them.
@@ -21,6 +22,8 @@ class clock_iface;
*/
struct noc_block_base::make_args_t
{
+ ~make_args_t();
+
//! Noc-ID
noc_id_t noc_id;
@@ -38,6 +41,7 @@ struct noc_block_base::make_args_t
//! Clock interface object that is shared with the reg_iface
std::shared_ptr<clock_iface> clk_iface;
+
//! The subtree for this block
uhd::property_tree::sptr tree;
};