mirror of
https://github.com/YosysHQ/yosys
synced 2026-06-19 15:26:29 +00:00
opt_muxtree: add reconvergence test
This commit is contained in:
parent
8869ce61dc
commit
4605811222
1 changed files with 55 additions and 0 deletions
55
tests/opt/opt_muxtree_port_reconverge.ys
Normal file
55
tests/opt/opt_muxtree_port_reconverge.ys
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
read_rtlil << EOT
|
||||
module \top
|
||||
wire input 1 \a
|
||||
wire input 2 \b
|
||||
wire output 3 \out
|
||||
wire $0\out[0:0]
|
||||
wire \y
|
||||
wire $1\out[0:0]
|
||||
wire \s
|
||||
wire \q
|
||||
wire \n_a
|
||||
|
||||
cell $mux \mux
|
||||
parameter \WIDTH 1
|
||||
connect \A 1'0
|
||||
connect \B \a
|
||||
connect \S \b
|
||||
connect \Y \y
|
||||
end
|
||||
|
||||
attribute \full_case 1
|
||||
cell $pmux \pmux
|
||||
parameter \WIDTH 1
|
||||
parameter \S_WIDTH 2
|
||||
connect \A 1'x
|
||||
connect \B { \y \y }
|
||||
connect \S { \n_a \s }
|
||||
connect \Y \q
|
||||
end
|
||||
|
||||
attribute \full_case 1
|
||||
cell $not \not
|
||||
parameter \A_SIGNED 0
|
||||
parameter \Y_WIDTH 1
|
||||
parameter \A_WIDTH 1
|
||||
connect \A \a
|
||||
connect \Y \n_a
|
||||
end
|
||||
|
||||
connect $0\out[0:0] $1\out[0:0]
|
||||
connect \s \a
|
||||
connect $1\out[0:0] \q
|
||||
connect \out \q
|
||||
end
|
||||
EOT
|
||||
# a drives out
|
||||
select -assert-any i:a %co* o:out %i
|
||||
|
||||
opt_muxtree
|
||||
# a gets optimized out
|
||||
opt_reduce
|
||||
opt_expr
|
||||
|
||||
# a no longer drives out
|
||||
select -assert-any o:out %ci* i:a %i
|
||||
Loading…
Add table
Add a link
Reference in a new issue