support struct patterns with partial defaults (resolves #35)

This commit is contained in:
Zachary Snow
2019-09-11 19:32:24 +02:00
parent 46242aac5d
commit bd2efb4201
3 changed files with 31 additions and 4 deletions
+11
View File
@@ -0,0 +1,11 @@
module top;
typedef struct packed {
logic a;
logic b;
} foo_t;
foo_t foo;
initial begin
foo = '{a: 1'b1, default: '0};
$display(foo, foo.a, foo.b);
end
endmodule
+4
View File
@@ -0,0 +1,4 @@
module top;
reg [1:0] foo = {1'b1, 1'b0};
initial $display(foo, foo[1], foo[0]);
endmodule