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

peepopt: avoid shift-amount underflow

This commit is contained in:
phsauter 2024-06-13 22:40:12 +02:00
parent 62bff3a204
commit 34b5c6d062
2 changed files with 19 additions and 1 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