summaryrefslogtreecommitdiff
path: root/tests/no-icarus/var_range.v
blob: 431eacb869c5939f0587eacb6f112ee8a22040e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
module test01(a, b, x, y, z);

input [7:0] a;
input [2:0] b;
output [7:0] x, y;
output z;

assign x = a >> b;
assign y = a[b+7:b];
assign z = a[b];

endmodule

module test02(clk, a, b, x, y, z);

input clk;
input [7:0] a;
input [2:0] b;
output reg [7:0] x, y;
output reg z;

always @(posedge clk) begin
	x <= a >> b;
	y <= a[b+7:b];
	z <= a[b];
end

endmodule

module test03(clk, a, b, x, y);

input clk;
input [2:0] a, b;
output reg [7:0] x;
output reg [9:0] y;

always @(posedge clk)
	y[b] <= a;

always @(posedge clk)
	y[b+2:b] <= a;

endmodule