mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-23 00:55:32 +00:00
fix width detection of array querying function in case and case item expressions
I also removed the unnecessary shadowing of `width_hint` and `sign_hint` in the corresponding case in `simplify()`.
This commit is contained in:
parent
60c3ea367c
commit
7608985d2c
5 changed files with 50 additions and 2 deletions
11
tests/simple/case_expr_extend.sv
Normal file
11
tests/simple/case_expr_extend.sv
Normal file
|
@ -0,0 +1,11 @@
|
|||
module top(
|
||||
output logic [5:0] out
|
||||
);
|
||||
always_comb begin
|
||||
out = '0;
|
||||
case (1'b1 << 1)
|
||||
2'b10: out = '1;
|
||||
default: out = '0;
|
||||
endcase
|
||||
end
|
||||
endmodule
|
32
tests/simple/case_expr_query.sv
Normal file
32
tests/simple/case_expr_query.sv
Normal file
|
@ -0,0 +1,32 @@
|
|||
module top(
|
||||
output logic [5:0] out
|
||||
);
|
||||
always_comb begin
|
||||
out = '0;
|
||||
case ($bits (out)) 6:
|
||||
case ($size (out)) 6:
|
||||
case ($high (out)) 5:
|
||||
case ($low (out)) 0:
|
||||
case ($left (out)) 5:
|
||||
case ($right(out)) 0:
|
||||
case (6) $bits (out):
|
||||
case (6) $size (out):
|
||||
case (5) $high (out):
|
||||
case (0) $low (out):
|
||||
case (5) $left (out):
|
||||
case (0) $right(out):
|
||||
out = '1;
|
||||
endcase
|
||||
endcase
|
||||
endcase
|
||||
endcase
|
||||
endcase
|
||||
endcase
|
||||
endcase
|
||||
endcase
|
||||
endcase
|
||||
endcase
|
||||
endcase
|
||||
endcase
|
||||
end
|
||||
endmodule
|
Loading…
Add table
Add a link
Reference in a new issue