In SystemVerilog is there a way to analyze a packed structure and determine it's overall size in bits?
typedef struct packed unsigned {
logic [15:0] field_1;
logic [7:0] field_2;
logic [15:0] field_3;
logic [4:0] field_4;
} my_struct;
For example, I would like to be able to determine programmatic-ally that the size of the above structure is 45.
I've looked at the "Aggregate data types" section (Chapter 7) of the IEEE 1800-2012 SystemVerilog Language Reference Manual, and didn't see anything like this.
Is this possible? If so, how?