aboutsummaryrefslogtreecommitdiffstats
path: root/host/tests
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2019-06-13 13:34:11 -0700
committerMartin Braun <martin.braun@ettus.com>2019-11-26 11:49:27 -0800
commit3da938f1242219fdf993576dcfdce7440a63c044 (patch)
tree145b8999ba2c72ebc8e1115ceedd6a8a3a0d2210 /host/tests
parentde246ea6174e3a6d5fe0dd554d5208f24c2932bb (diff)
downloaduhd-3da938f1242219fdf993576dcfdce7440a63c044.tar.gz
uhd-3da938f1242219fdf993576dcfdce7440a63c044.tar.bz2
uhd-3da938f1242219fdf993576dcfdce7440a63c044.zip
rfnoc: Add clock selection to blocks
During registration, blocks must now specify which clock they are using for the timebase (i.e., for timed commands) and for the ctrlport (this is used to determine the length of sleeps and polls). For example, the X300 provides bus_clk and radio_clk; typically, the former is used for the control port, and the latter for the timebase clock. Another virtual clock is called "__graph__", and it means the clock is derived from property propagation via the graph. The actual clocks are provided by the mb_iface. It has two new API calls: get_timebase_clock() and get_ctrlport_clock(), which take an argument as to which clock exactly is requested. On block initialization, those clock_iface objects are copied into the block controller. The get_tick_rate() API call for blocks now exclusively checks the timebase clock_iface, and will no longer cache the current tick rate in a separate _tick_rate member variable. Block controllers can't manually modify the clock_iface, unless they also have access to the mb_controller (like the radio block), and that mb_controller has provided said access. This commit also adds the clock selection API changes to the DDC block, the Null block, and the default block.
Diffstat (limited to 'host/tests')
-rw-r--r--host/tests/rfnoc_blocks_test.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/host/tests/rfnoc_blocks_test.cpp b/host/tests/rfnoc_blocks_test.cpp
index b69b6f9f8..13fc15848 100644
--- a/host/tests/rfnoc_blocks_test.cpp
+++ b/host/tests/rfnoc_blocks_test.cpp
@@ -24,14 +24,15 @@ noc_block_base::make_args_ptr make_make_args(noc_block_base::noc_id_t noc_id,
const size_t n_inputs,
const size_t n_outputs)
{
- auto make_args = std::make_unique<noc_block_base::make_args_t>();
- make_args->noc_id = noc_id;
- make_args->num_input_ports = n_inputs;
- make_args->num_output_ports = n_outputs;
- make_args->reg_iface = std::make_shared<mock_reg_iface_t>();
- make_args->block_id = block_id;
- make_args->clk_iface = std::make_shared<clock_iface>("MOCK_CLOCK");
- make_args->tree = uhd::property_tree::make();
+ auto make_args = std::make_unique<noc_block_base::make_args_t>();
+ make_args->noc_id = noc_id;
+ make_args->num_input_ports = n_inputs;
+ make_args->num_output_ports = n_outputs;
+ make_args->reg_iface = std::make_shared<mock_reg_iface_t>();
+ make_args->block_id = block_id;
+ make_args->ctrlport_clk_iface = std::make_shared<clock_iface>("MOCK_CLOCK");
+ make_args->tb_clk_iface = std::make_shared<clock_iface>("MOCK_CLOCK");
+ make_args->tree = uhd::property_tree::make();
return make_args;
}