diff options
author | Martin Braun <martin.braun@ettus.com> | 2019-05-31 22:11:42 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2019-11-26 11:49:23 -0800 |
commit | faa4786e025e787c196eec99f213da0d51a1f87e (patch) | |
tree | 17e39f93b0251e6e87e25d37775f10e55c0119fe /host/lib/rfnoc/rfnoc_graph.cpp | |
parent | 0200aedf4497d5bc4ddf9f3a071ed5395e605f2d (diff) | |
download | uhd-faa4786e025e787c196eec99f213da0d51a1f87e.tar.gz uhd-faa4786e025e787c196eec99f213da0d51a1f87e.tar.bz2 uhd-faa4786e025e787c196eec99f213da0d51a1f87e.zip |
rfnoc: Add mb_controller API
The mb_controller is an interface to hardware-specific functions of the
motherboard. The API works in two ways:
- The user can request access to it, and thus interact directly with the
motherboard
- RFNoC blocks can request access to it, if they need to interact with
the motherboard themselves.
Diffstat (limited to 'host/lib/rfnoc/rfnoc_graph.cpp')
-rw-r--r-- | host/lib/rfnoc/rfnoc_graph.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/host/lib/rfnoc/rfnoc_graph.cpp b/host/lib/rfnoc/rfnoc_graph.cpp index fef2ccccb..22c9b7294 100644 --- a/host/lib/rfnoc/rfnoc_graph.cpp +++ b/host/lib/rfnoc/rfnoc_graph.cpp @@ -6,6 +6,7 @@ #include <uhd/rfnoc/node.hpp> #include <uhd/rfnoc_graph.hpp> +#include <uhd/rfnoc/mb_controller.hpp> #include <uhdlib/rfnoc/block_container.hpp> #include <uhdlib/rfnoc/graph.hpp> #include <uhdlib/rfnoc/rfnoc_device.hpp> @@ -90,6 +91,16 @@ public: throw uhd::not_implemented_error(""); } + std::shared_ptr<mb_controller> get_mb_controller(const size_t mb_index = 0) + { + if (!_mb_controllers.count(mb_index)) { + throw uhd::index_error( + std::string("Could not get mb controller for motherboard index ") + + std::to_string(mb_index)); + } + return _mb_controllers.at(mb_index); + } + private: /************************************************************************** * Device Setup @@ -148,6 +159,8 @@ private: //! Reference to the graph std::unique_ptr<detail::graph_t> _graph; + //! Stash a list of motherboard controllers + std::unordered_map<size_t, mb_controller::sptr> _mb_controllers; }; /* class rfnoc_graph_impl */ |