Skip blackbox modules in design->selected_modules()
authorClifford Wolf <clifford@clifford.at>
Tue, 3 Feb 2015 22:11:57 +0000 (23:11 +0100)
committerClifford Wolf <clifford@clifford.at>
Tue, 3 Feb 2015 22:12:23 +0000 (23:12 +0100)
kernel/rtlil.cc

index 9b55d4255df2fa41a38297e946a8e3f182cde6ab..8c64217bb180a67e8069bfad4cd4041a3770a938 100644 (file)
@@ -460,7 +460,7 @@ std::vector<RTLIL::Module*> RTLIL::Design::selected_modules() const
        std::vector<RTLIL::Module*> result;
        result.reserve(modules_.size());
        for (auto &it : modules_)
-               if (selected_module(it.first))
+               if (selected_module(it.first) && !it.second->get_bool_attribute("\\blackbox"))
                        result.push_back(it.second);
        return result;
 }
@@ -470,7 +470,7 @@ std::vector<RTLIL::Module*> RTLIL::Design::selected_whole_modules() const
        std::vector<RTLIL::Module*> result;
        result.reserve(modules_.size());
        for (auto &it : modules_)
-               if (selected_whole_module(it.first))
+               if (selected_whole_module(it.first) && !it.second->get_bool_attribute("\\blackbox"))
                        result.push_back(it.second);
        return result;
 }
@@ -480,7 +480,9 @@ std::vector<RTLIL::Module*> RTLIL::Design::selected_whole_modules_warn() const
        std::vector<RTLIL::Module*> result;
        result.reserve(modules_.size());
        for (auto &it : modules_)
-               if (selected_whole_module(it.first))
+               if (it.second->get_bool_attribute("\\blackbox"))
+                       continue;
+               else if (selected_whole_module(it.first))
                        result.push_back(it.second);
                else if (selected_module(it.first))
                        log_warning("Ignoring partially selected module %s.\n", log_id(it.first));