aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2020-10-09 11:34:43 +0200
committerAaron Rossetto <aaron.rossetto@ni.com>2020-10-09 12:31:19 -0500
commit67651b9fffa6e6728a70348d0d174c3c0f802bfc (patch)
tree59f4247971a1b61d56c416a0283e3d01efc62d7d /host/lib
parentb5fad9cf0bf1cd3e904017b0630c3c5be143b8e8 (diff)
downloaduhd-67651b9fffa6e6728a70348d0d174c3c0f802bfc.tar.gz
uhd-67651b9fffa6e6728a70348d0d174c3c0f802bfc.tar.bz2
uhd-67651b9fffa6e6728a70348d0d174c3c0f802bfc.zip
tests: mock_block: Allow mock blocks to carry MB controllers
Diffstat (limited to 'host/lib')
-rw-r--r--host/lib/rfnoc/mock_block.cpp11
1 files changed, 6 insertions, 5 deletions
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