From 3da938f1242219fdf993576dcfdce7440a63c044 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Thu, 13 Jun 2019 13:34:11 -0700 Subject: 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. --- host/lib/rfnoc/block_control.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'host/lib/rfnoc/block_control.cpp') diff --git a/host/lib/rfnoc/block_control.cpp b/host/lib/rfnoc/block_control.cpp index 78c390001..e6d5cd31d 100644 --- a/host/lib/rfnoc/block_control.cpp +++ b/host/lib/rfnoc/block_control.cpp @@ -21,4 +21,5 @@ public: } }; -UHD_RFNOC_BLOCK_REGISTER_DIRECT(block_control, DEFAULT_NOC_ID, DEFAULT_BLOCK_NAME) +UHD_RFNOC_BLOCK_REGISTER_DIRECT( + block_control, DEFAULT_NOC_ID, DEFAULT_BLOCK_NAME, CLOCK_KEY_GRAPH, "bus_clk") -- cgit v1.2.3