aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2024-03-27 11:24:20 +0100
committerWade Fife <wade.fife@ettus.com>2024-04-26 15:19:23 -0500
commite16aec1af589742798261a2958aaa998ac349196 (patch)
tree3a370d0dd23cad3a08a55c6357361df7703a144e
parentfpga: rfnoc: reverse FIR filter coefficients to get embedded in DSPE48 (diff)
downloaduhd-e16aec1af589742798261a2958aaa998ac349196.tar.xz
uhd-e16aec1af589742798261a2958aaa998ac349196.zip
rfnoc: Allow vectors of NoC-IDs in registry
This allows registering RFNoC blocks that have the same implementation for multiple NoC-IDs.
-rw-r--r--host/include/uhd/rfnoc/registry.hpp10
-rw-r--r--host/lib/rfnoc/registry_factory.cpp21
2 files changed, 30 insertions, 1 deletions
diff --git a/host/include/uhd/rfnoc/registry.hpp b/host/include/uhd/rfnoc/registry.hpp
index 362899ccc..3d96abd53 100644
--- a/host/include/uhd/rfnoc/registry.hpp
+++ b/host/include/uhd/rfnoc/registry.hpp
@@ -92,6 +92,16 @@ public:
const std::string& ctrlport_clock,
factory_t factory_fn);
+ /*! Same as above, but with multiple noc_ids
+ */
+ static void register_block_direct(std::vector<noc_id_t> noc_ids,
+ 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);
+
/*! Register a block that does use a block descriptor file
*
* Use this registry function for blocks that also have a textual
diff --git a/host/lib/rfnoc/registry_factory.cpp b/host/lib/rfnoc/registry_factory.cpp
index debe59133..0a1ad5327 100644
--- a/host/lib/rfnoc/registry_factory.cpp
+++ b/host/lib/rfnoc/registry_factory.cpp
@@ -19,7 +19,7 @@
using namespace uhd::rfnoc;
-/*! Pair type for device depended block definitions. */
+/*! Pair type for device dependent block definitions. */
using block_device_pair_t = std::pair<noc_id_t, device_type_t>;
@@ -72,6 +72,25 @@ void registry::register_block_direct(noc_id_t noc_id,
std::move(factory_fn)});
}
+void registry::register_block_direct(std::vector<noc_id_t> noc_ids,
+ 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)
+{
+ for (auto noc_id : noc_ids) {
+ register_block_direct(noc_id,
+ device_id,
+ block_name,
+ mb_access,
+ timebase_clock,
+ ctrlport_clock,
+ std::move(factory_fn));
+ }
+}
+
void registry::register_block_descriptor(
const std::string& block_key, factory_t factory_fn)
{