eb0e15d029eaaecf370ace2b426735a0f2d22ab8
[yosys.git] / tests / simple / vloghammer.v
1
2 // test cases found using vloghammer
3 // https://github.com/cliffordwolf/VlogHammer
4
5 module test01(a, y);
6 input [7:0] a;
7 output [3:0] y;
8 assign y = ~a >> 4;
9 endmodule
10
11 module test02(a, y);
12 input signed [3:0] a;
13 output signed [4:0] y;
14 assign y = (~a) >> 1;
15 endmodule
16
17 module test03(a, b, y);
18 input [2:0] a;
19 input signed [1:0] b;
20 output y;
21 assign y = ~(a >>> 1) == b;
22 endmodule
23
24 module test04(a, y);
25 input a;
26 output [1:0] y;
27 assign y = ~(a - 1'b0);
28 endmodule
29
30 // .. this test triggers a bug in xilinx isim.
31 // module test05(a, y);
32 // input a;
33 // output y;
34 // assign y = 12345 >> {a, 32'd0};
35 // endmodule
36
37 // .. this test triggers a bug in icarus verilog.
38 // module test06(a, b, c, y);
39 // input signed [3:0] a;
40 // input signed [1:0] b;
41 // input signed [1:0] c;
42 // output [5:0] y;
43 // assign y = (a >> b) >>> c;
44 // endmodule
45
46 module test07(a, b, y);
47 input signed [1:0] a;
48 input signed [2:0] b;
49 output y;
50 assign y = 2'b11 != a+b;
51 endmodule
52
53 module test08(a, b, y);
54 input [1:0] a;
55 input [1:0] b;
56 output y;
57 assign y = a == ($signed(b) >>> 1);
58 endmodule
59