diff options
author | Martin Braun <martin.braun@ettus.com> | 2022-01-26 09:52:48 +0100 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2022-02-01 14:39:35 -0600 |
commit | c3327801ca43f3fdeca669e3aff470ce05e439a0 (patch) | |
tree | 3615492eba2327c3299e36cfe34215025bf0af29 /host/lib/rfnoc/rfnoc_graph.cpp | |
parent | 13f4b9ec43e581f994a235619495ccd06c98ad54 (diff) | |
download | uhd-c3327801ca43f3fdeca669e3aff470ce05e439a0.tar.gz uhd-c3327801ca43f3fdeca669e3aff470ce05e439a0.tar.bz2 uhd-c3327801ca43f3fdeca669e3aff470ce05e439a0.zip |
rfnoc: Add post_init() method to noc_block_base
This method allows running a fixed set of rules to check the internal
consistency of a block. This may be necessary, because blocks authors
may incorrectly implement a certain design rule, and we want the ability
to not start an RFNoC graph with blocks that have rule violations which
we can write checks for.
Diffstat (limited to 'host/lib/rfnoc/rfnoc_graph.cpp')
-rw-r--r-- | host/lib/rfnoc/rfnoc_graph.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
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 << "!"); |