From c3327801ca43f3fdeca669e3aff470ce05e439a0 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Wed, 26 Jan 2022 09:52:48 +0100 Subject: 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. --- host/include/uhd/rfnoc/noc_block_base.hpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'host/include') diff --git a/host/include/uhd/rfnoc/noc_block_base.hpp b/host/include/uhd/rfnoc/noc_block_base.hpp index b9ebda63b..b18de41fc 100644 --- a/host/include/uhd/rfnoc/noc_block_base.hpp +++ b/host/include/uhd/rfnoc/noc_block_base.hpp @@ -311,6 +311,8 @@ protected: virtual void deinit(); private: + friend struct block_initializer; + /*! Update the tick rate of this block * * This will make sure that the underlying register_iface is notified of the @@ -325,6 +327,15 @@ private: */ void shutdown() override; + /*! Run post-init tasks, i.e., after the constructor concludes. + * + * The purpose of this method is to make sure the block is in a good state + * after the block controller's ctor has concluded. This allows checking + * that block configurations follow certain rules, even though they may not + * even be part of UHD. + */ + void post_init(); + /************************************************************************** * Attributes **************************************************************************/ -- cgit v1.2.3