3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-23 00:55:32 +00:00

Merge pull request #4452 from phsauter/shiftadd-underflow-fix

peepopt: avoid shift-amount underflow
This commit is contained in:
Emil J 2024-08-19 15:45:46 +02:00 committed by GitHub
commit e0d3bbf3c3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 21 additions and 2 deletions

15
tests/opt/bug4413.ys Normal file
View file

@ -0,0 +1,15 @@
read_verilog <<EOT
module top(
input wire shift,
input wire [4:0] data,
output wire out
);
wire [1:0] shift2 = shift - 1'b1;
assign out = data >> shift2;
endmodule
EOT
equiv_opt -assert peepopt