aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2018-05-31 15:31:59 -0700
committerMartin Braun <martin.braun@ettus.com>2018-06-08 13:21:19 -0700
commitec7144d6466e560b00223fb3bb72d31b38a038da (patch)
treecbf50f55cdfaed315e999df82703f391b23c8bf5 /host/lib
parentf08b0160686709a45b0c4ee4a478f4ee016a5798 (diff)
downloaduhd-ec7144d6466e560b00223fb3bb72d31b38a038da.tar.gz
uhd-ec7144d6466e560b00223fb3bb72d31b38a038da.tar.bz2
uhd-ec7144d6466e560b00223fb3bb72d31b38a038da.zip
rfnoc: Warn when a block key is not found in the registry
Before, a block description file could specify a block controlley key which was not mapped to a registered block controller, and it would fall back to the default. While that behaviour is desired, it was lacking a warning when it made that decision.
Diffstat (limited to 'host/lib')
-rw-r--r--host/lib/rfnoc/block_ctrl_base_factory.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/host/lib/rfnoc/block_ctrl_base_factory.cpp b/host/lib/rfnoc/block_ctrl_base_factory.cpp
index 3f3f52ac6..554db5acf 100644
--- a/host/lib/rfnoc/block_ctrl_base_factory.cpp
+++ b/host/lib/rfnoc/block_ctrl_base_factory.cpp
@@ -11,8 +11,6 @@
#include <uhd/rfnoc/blockdef.hpp>
#include <uhd/rfnoc/block_ctrl_base.hpp>
-#define UHD_FACTORY_LOG() UHD_LOGGER_TRACE("RFNOC")
-
using namespace uhd;
using namespace uhd::rfnoc;
@@ -61,7 +59,7 @@ block_ctrl_base::sptr block_ctrl_base::make(
const make_args_t &make_args_,
uint64_t noc_id
) {
- UHD_FACTORY_LOG() << "[RFNoC Factory] block_ctrl_base::make() " ;
+ UHD_LOGGER_TRACE("RFNOC") << "[RFNoC Factory] block_ctrl_base::make()";
make_args_t make_args = make_args_;
// Check if a block key was specified, in this case, we *must* either
@@ -74,13 +72,18 @@ block_ctrl_base::sptr block_ctrl_base::make(
);
}
if (not get_block_fcn_regs().has_key(make_args.block_key)) {
+ UHD_LOG_WARNING("RFNOC",
+ "Can't find a block controller for key " << make_args.block_key
+ << ", using default block controller!");
make_args.block_key = DEFAULT_BLOCK_NAME;
}
if (make_args.block_name.empty()) {
make_args.block_name = make_args.block_key;
}
- UHD_FACTORY_LOG() << "[RFNoC Factory] Using controller key '" << make_args.block_key << "' and block name '" << make_args.block_name << "'" ;
+ UHD_LOGGER_TRACE("RFNOC")
+ << "[RFNoC Factory] Using controller key '" << make_args.block_key
+ << "' and block name '" << make_args.block_name << "'";
return get_block_fcn_regs()[make_args.block_key](make_args);
}