// // Copyright 2019 Ettus Research, a National Instruments Brand // // SPDX-License-Identifier: GPL-3.0-or-later // #include #include #include #include #include #include #include #include #include #include #include using namespace uhd::rfnoc; /*! Pair type for device depended block definitions. */ using block_device_pair_t = std::pair; /////////////////////////////////////////////////////////////////////////////// // There are two registries: // - The "direct" registry, which is for blocks that do not have a block // descriptor file // - The "descriptor" registry, which is for blocks that *do* have a block // descriptor file // // This is the direct registry: using block_direct_reg_t = std::unordered_map>; UHD_SINGLETON_FCN(block_direct_reg_t, get_direct_block_registry); // // This is the descriptor registry: using block_descriptor_reg_t = std::unordered_map; UHD_SINGLETON_FCN(block_descriptor_reg_t, get_descriptor_block_registry); /////////////////////////////////////////////////////////////////////////////// /****************************************************************************** * Registry functions * * Note: Don't use UHD_LOG_*, since all of this can be executed in a static * fashion. *****************************************************************************/ void registry::register_block_direct(noc_id_t noc_id, device_type_t device_id, const std::string& block_name, bool mb_access, const std::string& timebase_clock, const std::string& ctrlport_clock, factory_t factory_fn) { block_device_pair_t key{noc_id, device_id}; if (get_direct_block_registry().count(key)) { std::cerr << "[REGISTRY] WARNING: Attempting to overwrite previously " "registered RFNoC block with noc_id,device_id: " << std::hex << "0x" << noc_id << ", 0x" << device_id <