3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-24 01:25:33 +00:00

select: Fix -none and -clear

If the selection stack only has one element (which it normally does), then
`design->pop_selection()` automatically resets to the default full selection.
This is a problem for `select [-none | -clear]` which were trying to replace the
current selection, but because the pop added an extra element when the `execute`
returned, the extra selection (the one we actually wanted) gets popped too. So
instead, reassign `design->selection()` in the same way as if we called `select
[selection]`.

Also adds selection stack tests, and removes the accidentally-committed
`boxes_dummy.ys`.
This commit is contained in:
Krystine Sherwin 2025-03-14 16:32:00 +13:00
parent 68adac691d
commit 8405b3b723
No known key found for this signature in database
3 changed files with 31 additions and 17 deletions

View file

@ -1509,15 +1509,13 @@ struct SelectPass : public Pass {
log_assert(!design->selection_stack.empty());
if (clear_mode) {
design->pop_selection();
design->push_full_selection();
design->selection() = RTLIL::Selection::FullSelection(design);
design->selected_active_module = std::string();
return;
}
if (none_mode) {
design->pop_selection();
design->push_empty_selection();
design->selection() = RTLIL::Selection::EmptySelection(design);
return;
}