I have a record type as follows:
type Rec_T is record
a : Bit_12_T;
b : Bit_4_T;
end record;
where Bit_12_T is mod 2**12
and Bit_4_T is mod 2**4
.
To tell the compiler the precise alignment of this record, I use the the for use record
statement. However, I want to split the a
field bewteen the bytes, so I try to do it as follows:
for Rec_T use record
a at 0 range 0 .. 7; -- The 1st byte
a at 1 range 0 .. 3; -- The 2nd byte
b at 1 range 4 .. 7;
end record;
Clearly, this is not the way to do it as the compiler complains that "component clause is previously given at line ...".
Question: Is it possible to have a component split between the bytes and how to do it? If it is not possible, should I have a_high and a_low and then use some bit operations to merge them together?