I have a struct declared inside a module like this:
module myModule;
struct {
logic a;
logic b;
logic [A - 1:0] c[0:B - 1];
logic [C - 1:0] d;
} [D - 1:0] e [0:E - 1][0:F - 1];
endmodule
I want to use c like an unpacked array, but Verilog does not allow this. It throws an error on the line where c is defined:
Unsupported: Unpacked array in packed struct/union
Is there a way around this?
cis an unpacked variable, you can not usedpackedstructures of SV. The following will work:typedef struct packed{ logic a; logic b; logic [A - 1:0] c[0:B - 1]; logic [C - -1:0] d; } mystruct; mystruct e [0:E - 1][0:F - 1];Note thateshould not have a packed dimension since it is an array of struct variables. - sharvil111