Merge pull request #1705 from YosysHQ/logger_pass
[yosys.git] / tests / svtypes / typedef_param.sv
1 `define STRINGIFY(x) `"x`"
2 `define STATIC_ASSERT(x) if(!(x)) $error({"assert failed: ", `STRINGIFY(x)})
3
4 module top;
5
6 typedef logic [1:0] uint2_t;
7 typedef logic signed [3:0] int4_t;
8 typedef logic signed [7:0] int8_t;
9 typedef (int8_t) char_t;
10
11 parameter (uint2_t) int2 = 2'b10;
12 localparam (int4_t) int4 = -1;
13 localparam (int8_t) int8 = int4;
14 localparam (char_t) ch = int8;
15
16
17 `STATIC_ASSERT(int2 == 2'b10);
18 `STATIC_ASSERT(int4 == 4'b1111);
19 `STATIC_ASSERT(int8 == 8'b11111111);
20 `STATIC_ASSERT(ch == 8'b11111111);
21
22 endmodule