131
|
1 with Interfaces;
|
|
2 with System;
|
|
3 with Unchecked_Conversion;
|
|
4
|
|
5 package SSO8_Pkg is
|
|
6
|
|
7 Val8 : Interfaces.Unsigned_8;
|
|
8
|
|
9 type Two_Bit_Int is range 0 .. 3;
|
|
10 for Two_Bit_Int'size use 2;
|
|
11
|
|
12 type Arr is array (1 .. 5) of Boolean;
|
|
13 for Arr'scalar_storage_order use System.High_Order_First;
|
|
14 pragma Pack (Arr);
|
|
15
|
|
16 type Rec is record
|
|
17 Boolean_Data : Boolean;
|
|
18 Array_Data : Arr;
|
|
19 Two_Bit_Data : Two_Bit_Int;
|
|
20 end record;
|
|
21 for Rec use record
|
|
22 Boolean_Data at 0 range 0 .. 0;
|
|
23 Array_Data at 0 range 1 .. 5;
|
|
24 Two_Bit_Data at 0 range 6 .. 7;
|
|
25 end record;
|
|
26 for Rec'size use 8;
|
|
27 for Rec'bit_order use System.High_Order_First;
|
|
28 for Rec'scalar_storage_order use System.High_Order_First;
|
|
29
|
|
30 function Conv is new Unchecked_Conversion (Rec, Interfaces.Unsigned_8);
|
|
31
|
|
32 end SSO8_Pkg;
|