aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib')
-rw-r--r--host/lib/rfnoc/noc_block_base.cpp5
-rw-r--r--host/lib/rfnoc/rfnoc_graph.cpp18
2 files changed, 23 insertions, 0 deletions
diff --git a/host/lib/rfnoc/noc_block_base.cpp b/host/lib/rfnoc/noc_block_base.cpp
index 9719e739b..f854ca8d4 100644
--- a/host/lib/rfnoc/noc_block_base.cpp
+++ b/host/lib/rfnoc/noc_block_base.cpp
@@ -350,6 +350,11 @@ void noc_block_base::shutdown()
update_reg_iface();
}
+void noc_block_base::post_init()
+{
+ // nop
+}
+
std::shared_ptr<mb_controller> noc_block_base::get_mb_controller()
{
return _mb_controller;
diff --git a/host/lib/rfnoc/rfnoc_graph.cpp b/host/lib/rfnoc/rfnoc_graph.cpp
index 35a5cb28c..0d0e03043 100644
--- a/host/lib/rfnoc/rfnoc_graph.cpp
+++ b/host/lib/rfnoc/rfnoc_graph.cpp
@@ -58,8 +58,25 @@ struct route_info_t
graph_edge_t src_static_edge;
graph_edge_t dst_static_edge;
};
+
} // namespace
+// Define an attorney to limit access to noc_block_base internals
+class rfnoc_graph_impl;
+namespace uhd { namespace rfnoc {
+
+class block_initializer
+{
+ static void post_init(noc_block_base::sptr block)
+ {
+ block->post_init();
+ }
+ friend rfnoc_graph_impl;
+};
+
+}} // namespace uhd::rfnoc
+
+
class rfnoc_graph_impl : public rfnoc_graph
{
public:
@@ -731,6 +748,7 @@ private:
try {
_block_registry->register_block(
block_factory_info.factory_fn(std::move(make_args_uptr)));
+ block_initializer::post_init(_block_registry->get_block(block_id));
} catch (...) {
UHD_LOG_ERROR(
LOG_ID, "Error during initialization of block " << block_id << "!");