diff options
author | Martin Braun <martin.braun@ettus.com> | 2020-10-09 11:34:43 +0200 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2020-10-09 12:31:19 -0500 |
commit | 67651b9fffa6e6728a70348d0d174c3c0f802bfc (patch) | |
tree | 59f4247971a1b61d56c416a0283e3d01efc62d7d /host | |
parent | b5fad9cf0bf1cd3e904017b0630c3c5be143b8e8 (diff) | |
download | uhd-67651b9fffa6e6728a70348d0d174c3c0f802bfc.tar.gz uhd-67651b9fffa6e6728a70348d0d174c3c0f802bfc.tar.bz2 uhd-67651b9fffa6e6728a70348d0d174c3c0f802bfc.zip |
tests: mock_block: Allow mock blocks to carry MB controllers
Diffstat (limited to 'host')
-rw-r--r-- | host/include/uhd/rfnoc/mock_block.hpp | 4 | ||||
-rw-r--r-- | host/lib/rfnoc/mock_block.cpp | 11 |
2 files changed, 9 insertions, 6 deletions
diff --git a/host/include/uhd/rfnoc/mock_block.hpp b/host/include/uhd/rfnoc/mock_block.hpp index fef8815b7..a456d30a6 100644 --- a/host/include/uhd/rfnoc/mock_block.hpp +++ b/host/include/uhd/rfnoc/mock_block.hpp @@ -9,6 +9,7 @@ #include <uhd/config.hpp> #include <uhd/property_tree.hpp> #include <uhd/rfnoc/defaults.hpp> +#include <uhd/rfnoc/mb_controller.hpp> #include <uhd/rfnoc/noc_block_base.hpp> #include <uhd/rfnoc/register_iface.hpp> #include <uhd/types/time_spec.hpp> @@ -184,6 +185,7 @@ UHD_API mock_block_container get_mock_block(const noc_id_t noc_id, const uhd::device_addr_t& args = uhd::device_addr_t(), const size_t mtu = 8000, const device_type_t device_id = ANY_DEVICE, - std::shared_ptr<mock_reg_iface_t> client_reg_iface = nullptr); + std::shared_ptr<mock_reg_iface_t> client_reg_iface = nullptr, + mb_controller::sptr mbc = nullptr); }}; // namespace uhd::rfnoc diff --git a/host/lib/rfnoc/mock_block.cpp b/host/lib/rfnoc/mock_block.cpp index 834803bd5..4332d078e 100644 --- a/host/lib/rfnoc/mock_block.cpp +++ b/host/lib/rfnoc/mock_block.cpp @@ -19,7 +19,8 @@ uhd::rfnoc::mock_block_container uhd::rfnoc::get_mock_block(const noc_id_t noc_i const device_addr_t& args, const size_t mtu, const device_type_t device_id, - std::shared_ptr<mock_reg_iface_t> client_reg_iface) + std::shared_ptr<mock_reg_iface_t> client_reg_iface, + mb_controller::sptr mbc) { block_factory_info_t fac_info = factory::get_block_factory(noc_id, device_id); @@ -42,10 +43,10 @@ uhd::rfnoc::mock_block_container uhd::rfnoc::get_mock_block(const noc_id_t noc_i std::make_shared<clock_iface>(fac_info.timebase_clk); ret_val.make_args->ctrlport_clk_iface = std::make_shared<clock_iface>(fac_info.ctrlport_clk); - // TODO Make a mock mb controller too - ret_val.make_args->mb_control = nullptr; - if (fac_info.mb_access) { - UHD_LOG_WARNING("MOCK", "Mock block controllers cannot have mb_controllers."); + ret_val.make_args->mb_control = mbc; + if (fac_info.mb_access && !mbc) { + UHD_LOG_WARNING("MOCK", + "Mock block controllers has request for MB controller, but none was given."); } // Make block and return |