support const declarations of alias types

This commit is contained in:
Zachary Snow
2021-02-23 16:45:53 -05:00
parent 5080265e4d
commit da07619642
3 changed files with 20 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
module top;
typedef struct packed { integer y, z; } T;
// TODO iverilog doesn't allow references to variables in initializers
// if (1) begin : blk
// integer a = 11;
// integer b = 12;
const integer w = 11;
const T x = '{ y: 11, z: 12 };
initial $display("%b %b %b %b", w, x, x.y, x.z);
endmodule
+5
View File
@@ -0,0 +1,5 @@
module top;
integer w = 11;
wire [63:0] x = { 32'd11, 32'd12 };
initial $display("%b %b %b %b", w, x, x[32+:32], x[0+:32]);
endmodule