mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-23 17:15: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:
parent
68adac691d
commit
8405b3b723
3 changed files with 31 additions and 17 deletions
|
@ -1,13 +0,0 @@
|
|||
read_verilog -specify boxes.v
|
||||
clean
|
||||
|
||||
echo on
|
||||
select -list
|
||||
select -count
|
||||
select -count *
|
||||
select -count top
|
||||
select -count top/w:*
|
||||
select -list =*
|
||||
select -count =*
|
||||
select -clear
|
||||
select -assert-count 9 =?b
|
29
tests/select/boxes_stack.ys
Normal file
29
tests/select/boxes_stack.ys
Normal file
|
@ -0,0 +1,29 @@
|
|||
read_verilog -specify boxes.v
|
||||
clean
|
||||
|
||||
# default selection == select *
|
||||
select -assert-count 4 *
|
||||
select -assert-count 4 %
|
||||
|
||||
# -none replaces default selection
|
||||
select -none
|
||||
select -assert-none %
|
||||
select -assert-count 13 =*
|
||||
|
||||
# select replaces current selection
|
||||
select =*
|
||||
select -assert-count 13 %
|
||||
|
||||
# -module changes module
|
||||
select -module wb
|
||||
select -assert-none %
|
||||
select -assert-count 5 =*
|
||||
|
||||
# -none maintains module
|
||||
select -none
|
||||
select -assert-count 5 =*
|
||||
|
||||
# -clear clears current selection and module
|
||||
select -clear
|
||||
select -assert-count 4 %
|
||||
select -assert-count 13 =*
|
Loading…
Add table
Add a link
Reference in a new issue