From 59802584b0ad9a9731769d1086b278421e1eca6a Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Fri, 14 Mar 2025 14:08:14 +1300 Subject: [PATCH] Fix describe_selection_for_assert If the current selection is not the provided selection, push the provided selection. --- passes/cmds/select.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/passes/cmds/select.cc b/passes/cmds/select.cc index 1eed7c818..54b6f0a42 100644 --- a/passes/cmds/select.cc +++ b/passes/cmds/select.cc @@ -999,6 +999,8 @@ static void select_stmt(RTLIL::Design *design, std::string arg, bool disable_emp static std::string describe_selection_for_assert(RTLIL::Design *design, RTLIL::Selection *sel, bool whole_modules = false) { + bool push_selection = &design->selection() != sel; + if (push_selection) design->push_selection(*sel); std::string desc = "Selection contains:\n"; for (auto mod : design->all_selected_modules()) { @@ -1007,6 +1009,7 @@ static std::string describe_selection_for_assert(RTLIL::Design *design, RTLIL::S for (auto it : mod->selected_members()) desc += stringf("%s/%s\n", id2cstr(mod->name), id2cstr(it->name)); } + if (push_selection) design->pop_selection(); return desc; }