From d1596dc40b1f0983512ab48372bdf25dd918710e Mon Sep 17 00:00:00 2001 From: Derek Kozel Date: Fri, 7 Apr 2017 19:38:44 -0700 Subject: rfnoc: Add set_command_time hook to radio block --- host/lib/rfnoc/block_ctrl_base.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'host/lib/rfnoc') diff --git a/host/lib/rfnoc/block_ctrl_base.cpp b/host/lib/rfnoc/block_ctrl_base.cpp index 24dad6b47..a6eecc20b 100644 --- a/host/lib/rfnoc/block_ctrl_base.cpp +++ b/host/lib/rfnoc/block_ctrl_base.cpp @@ -356,6 +356,7 @@ void block_ctrl_base::set_command_time( } iface_sptr->set_time(time_spec); + _set_command_time(time_spec, port); } time_spec_t block_ctrl_base::get_command_time( @@ -583,4 +584,8 @@ void block_ctrl_base::_clear(const size_t port) sr_write(SR_CLEAR_RX_FC, 0x00C1EA12, port); // 'CLEAR', but we can write anything, really } +void block_ctrl_base::_set_command_time(const time_spec_t & /*time_spec*/, const size_t /*port*/) +{ + UHD_RFNOC_BLOCK_TRACE() << "block_ctrl_base::_set_command_time() "; +} // vim: sw=4 et: -- cgit v1.2.3 From 75fd281d270d41a6db4010afbdf0be1aaf946039 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Mon, 10 Apr 2017 14:43:34 -0700 Subject: rfnoc: radio blocks update their own command time based on updated tick rate --- host/lib/rfnoc/radio_ctrl_impl.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'host/lib/rfnoc') diff --git a/host/lib/rfnoc/radio_ctrl_impl.cpp b/host/lib/rfnoc/radio_ctrl_impl.cpp index 43e5cb7fc..c43d39f71 100644 --- a/host/lib/rfnoc/radio_ctrl_impl.cpp +++ b/host/lib/rfnoc/radio_ctrl_impl.cpp @@ -162,6 +162,7 @@ double radio_ctrl_impl::set_rate(double rate) _tick_rate = rate; _time64->set_tick_rate(_tick_rate); _time64->self_test(); + set_command_tick_rate(rate); return _tick_rate; } -- cgit v1.2.3 From fae9468c3a2c00c4390a50679b5ae176c5f9a2a5 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Mon, 10 Apr 2017 14:44:24 -0700 Subject: rfnoc: Update DDC and DUC command tick rate Update happens when the sampling rate is queried, which needs revisiting, but happens to occur at the correct time in the sequence. --- host/lib/rfnoc/ddc_block_ctrl_impl.cpp | 9 +++++++++ host/lib/rfnoc/duc_block_ctrl_impl.cpp | 9 +++++++++ host/lib/usrp/x300/x300_radio_ctrl_impl.cpp | 2 +- 3 files changed, 19 insertions(+), 1 deletion(-) (limited to 'host/lib/rfnoc') diff --git a/host/lib/rfnoc/ddc_block_ctrl_impl.cpp b/host/lib/rfnoc/ddc_block_ctrl_impl.cpp index fb70b6f45..8c8b07afd 100644 --- a/host/lib/rfnoc/ddc_block_ctrl_impl.cpp +++ b/host/lib/rfnoc/ddc_block_ctrl_impl.cpp @@ -130,6 +130,15 @@ public: } } } + + // Wait, what? If this seems out of place to you, you're right. However, + // we need a function call that is called when the graph is complete, + // but streaming is not yet set up. + if (_tree->exists("tick_rate")) { + const double tick_rate = _tree->access("tick_rate").get(); + set_command_tick_rate(tick_rate, port); + } + if (not (_rx_streamer_active.count(port) and _rx_streamer_active.at(port))) { return RATE_UNDEFINED; } diff --git a/host/lib/rfnoc/duc_block_ctrl_impl.cpp b/host/lib/rfnoc/duc_block_ctrl_impl.cpp index 0340ba0d6..d755bf519 100644 --- a/host/lib/rfnoc/duc_block_ctrl_impl.cpp +++ b/host/lib/rfnoc/duc_block_ctrl_impl.cpp @@ -113,6 +113,15 @@ public: double get_input_samp_rate(size_t port=ANY_PORT) { port = (port == ANY_PORT) ? 0 : port; + + // Wait, what? If this seems out of place to you, you're right. However, + // we need a function call that is called when the graph is complete, + // but streaming is not yet set up. + if (_tree->exists("tick_rate")) { + const double tick_rate = _tree->access("tick_rate").get(); + set_command_tick_rate(tick_rate, port); + } + if (not (_tx_streamer_active.count(port) and _tx_streamer_active.at(port))) { return RATE_UNDEFINED; } diff --git a/host/lib/usrp/x300/x300_radio_ctrl_impl.cpp b/host/lib/usrp/x300/x300_radio_ctrl_impl.cpp index 80865eaf0..69eb51f55 100644 --- a/host/lib/usrp/x300/x300_radio_ctrl_impl.cpp +++ b/host/lib/usrp/x300/x300_radio_ctrl_impl.cpp @@ -909,7 +909,7 @@ void x300_radio_ctrl_impl::_set_db_eeprom(i2c_iface::sptr i2c, const size_t addr void x300_radio_ctrl_impl::_set_command_time(const time_spec_t &spec, const size_t port) { - set_fe_cmd_time(spec, port); + set_fe_cmd_time(spec, port); } /**************************************************************************** * Helpers -- cgit v1.2.3