From 6bd43946a71173cbf0f1d318843ba34d6849dc30 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Fri, 7 Jun 2019 21:37:15 -0700 Subject: rfnoc: Add shutdown feature to blocks On destruction, the rfnoc_graph will call shutdown() on all blocks. This allows a safe de-initialization of blocks independent of the lifetime of the noc_block_base::sptr. Also adds the shutdown feature to null_block_control. --- host/lib/rfnoc/noc_block_base.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'host/lib/rfnoc/noc_block_base.cpp') diff --git a/host/lib/rfnoc/noc_block_base.cpp b/host/lib/rfnoc/noc_block_base.cpp index 6e72decfe..c0d8cf2a9 100644 --- a/host/lib/rfnoc/noc_block_base.cpp +++ b/host/lib/rfnoc/noc_block_base.cpp @@ -113,7 +113,20 @@ void noc_block_base::_set_tick_rate(const double tick_rate) _tick_rate = tick_rate; } +void noc_block_base::shutdown() +{ + RFNOC_LOG_TRACE("Calling deinit()"); + deinit(); + RFNOC_LOG_DEBUG("Invalidating register interface"); + update_reg_iface(); +} + std::shared_ptr noc_block_base::get_mb_controller() { return _mb_controller; } + +void noc_block_base::deinit() +{ + RFNOC_LOG_DEBUG("deinit() called, but not implemented."); +} -- cgit v1.2.3