From 6460e07f91bc468e7c094785093426ee07e26bcb Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Mon, 3 Jun 2019 19:22:23 -0700 Subject: rfnoc: noc_block_base: Pass args into block on construction These args come from the framework, e.g., because the UHD session was launched with them. --- host/include/uhd/rfnoc/noc_block_base.hpp | 8 ++++++++ host/include/uhd/rfnoc/noc_block_make_args.hpp | 3 +++ 2 files 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 6396d64df..fb26f6089 100644 --- a/host/include/uhd/rfnoc/noc_block_base.hpp +++ b/host/include/uhd/rfnoc/noc_block_base.hpp @@ -11,6 +11,7 @@ #include #include #include +#include //! Shorthand for block constructor #define RFNOC_BLOCK_CONSTRUCTOR(CLASS_NAME) \ @@ -100,6 +101,10 @@ public: */ double get_tick_rate() const { return _tick_rate; } + /*! Return the arguments that were passed into this block from the framework + */ + uhd::device_addr_t get_block_args() const { return _block_args; } + protected: noc_block_base(make_args_ptr make_args); @@ -184,6 +189,9 @@ private: // block had requested and was granted access std::shared_ptr _mb_controller; + //! Arguments that were passed into this block + const uhd::device_addr_t _block_args; + }; // 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 2d42d476e..8a5fbd46f 100644 --- a/host/include/uhd/rfnoc/noc_block_make_args.hpp +++ b/host/include/uhd/rfnoc/noc_block_make_args.hpp @@ -51,6 +51,9 @@ struct noc_block_base::make_args_t //! The subtree for this block uhd::property_tree::sptr tree; + + //! Additional args that can be parsed and used by this block + uhd::device_addr_t args; }; }} /* namespace uhd::rfnoc */ -- cgit v1.2.3