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/block_container.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'host/lib/rfnoc/block_container.cpp') diff --git a/host/lib/rfnoc/block_container.cpp b/host/lib/rfnoc/block_container.cpp index 0151b228b..6bbb3828b 100644 --- a/host/lib/rfnoc/block_container.cpp +++ b/host/lib/rfnoc/block_container.cpp @@ -6,6 +6,7 @@ #include #include +#include #include #include @@ -72,3 +73,11 @@ noc_block_base::sptr block_container_t::get_block(const block_id_t& block_id) co return *block_itr; } +void block_container_t::shutdown() +{ + node_accessor_t node_accessor{}; + for (auto it = _blocks.begin(); it != _blocks.end(); ++it) { + node_accessor.shutdown(it->get()); + } + +} -- cgit v1.2.3