Add opt_rmdff tests
[yosys.git] / tests / simple / forloops.v
1 module forloops01 (input clk, a, b, output reg [3:0] p, q, x, y);
2 integer k;
3 always @(posedge clk) begin
4 for (k=0; k<2; k=k+1)
5 p[2*k +: 2] = {a, b} ^ {2{k}};
6 x <= k + {a, b};
7 end
8 always @* begin
9 for (k=0; k<4; k=k+1)
10 q[k] = {~a, ~b, a, b} >> k[1:0];
11 y = k - {a, b};
12 end
13 endmodule
14
15 module forloops02 (input clk, a, b, output reg [3:0] q, x, output [3:0] y);
16 integer k;
17 always @* begin
18 for (k=0; k<4; k=k+1)
19 q[k] = {~a, ~b, a, b} >> k[1:0];
20 end
21 always @* begin
22 x = k + {a, b};
23 end
24 assign y = k - {a, b};
25 endmodule