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

opt_expr: refactor simplification of signed X>=0 and X<0. NFCI.

This commit is contained in:
whitequark 2019-01-02 03:01:25 +00:00
parent 8e53d2e0bf
commit 9e9846a6ea
2 changed files with 40 additions and 32 deletions

View file

@ -1,11 +1,17 @@
module top(...);
input [3:0] a;
output o1 = 4'b0000 > a;
output o2 = 4'b0000 <= a;
output o3 = 4'b1111 < a;
output o4 = 4'b1111 >= a;
output o5 = a < 4'b0000;
output o6 = a >= 4'b0000;
output o7 = a > 4'b1111;
output o8 = a <= 4'b1111;
output o1_1 = 4'b0000 > a;
output o1_2 = 4'b0000 <= a;
output o1_3 = 4'b1111 < a;
output o1_4 = 4'b1111 >= a;
output o1_5 = a < 4'b0000;
output o1_6 = a >= 4'b0000;
output o1_7 = a > 4'b1111;
output o1_8 = a <= 4'b1111;
output o2_1 = 4'sb0000 > $signed(a);
output o2_2 = 4'sb0000 <= $signed(a);
output o2_3 = $signed(a) < 4'sb0000;
output o2_4 = $signed(a) >= 4'sb0000;
endmodule