aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/rfnoc
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2019-06-01 13:08:56 -0700
committerMartin Braun <martin.braun@ettus.com>2019-11-26 11:49:23 -0800
commitdc9ca94afaa0a1c049eac934ad1c278deedc6766 (patch)
treecd105505e852abe366e2428073390746344de90f /host/lib/rfnoc
parentfaa4786e025e787c196eec99f213da0d51a1f87e (diff)
downloaduhd-dc9ca94afaa0a1c049eac934ad1c278deedc6766.tar.gz
uhd-dc9ca94afaa0a1c049eac934ad1c278deedc6766.tar.bz2
uhd-dc9ca94afaa0a1c049eac934ad1c278deedc6766.zip
rfnoc: noc_block_base: Add API to reduce num ports
This allows blocks to reduce the number of actual, available ports.
Diffstat (limited to 'host/lib/rfnoc')
-rw-r--r--host/lib/rfnoc/noc_block_base.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/host/lib/rfnoc/noc_block_base.cpp b/host/lib/rfnoc/noc_block_base.cpp
index 0b2d456b2..97aaeb002 100644
--- a/host/lib/rfnoc/noc_block_base.cpp
+++ b/host/lib/rfnoc/noc_block_base.cpp
@@ -64,6 +64,26 @@ noc_block_base::~noc_block_base()
// nop
}
+void noc_block_base::set_num_input_ports(const size_t num_ports)
+{
+ if (num_ports > get_num_input_ports()) {
+ throw uhd::value_error(
+ "New number of input ports must not exceed current number!");
+ }
+
+ _num_input_ports = num_ports;
+}
+
+void noc_block_base::set_num_output_ports(const size_t num_ports)
+{
+ if (num_ports > get_num_output_ports()) {
+ throw uhd::value_error(
+ "New number of output ports must not exceed current number!");
+ }
+
+ _num_output_ports = num_ports;
+}
+
void noc_block_base::set_tick_rate(const double tick_rate)
{