blob: 8166688e60c492c63db94ce2a60d16d60f0b718b (
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
|
`define CONSTANT_CHECK \
if (WIDTH === 'bx) begin \
$display("FAIL"); \
$finish; \
end
module top;
parameter WIDTH = 32;
integer j;
initial begin
`CONSTANT_CHECK
if (WIDTH == 32) begin : procedural_conditional_block
`CONSTANT_CHECK
end
case (WIDTH)
32: `CONSTANT_CHECK
default: ;
endcase
for (j = 0; j < 2; j = j + 1) begin : procedural_loop_block
`CONSTANT_CHECK
end
end
generate
begin : unconditional_block
initial `CONSTANT_CHECK
end
if (WIDTH == 32) begin : conditional_block
initial `CONSTANT_CHECK
end
case (WIDTH)
32: initial `CONSTANT_CHECK
default: ;
endcase
genvar i;
for (i = 0; i < 2; i = i + 1) begin : loop_block
initial `CONSTANT_CHECK
end
endgenerate
endmodule
|