File : i-bit_types.ads
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT COMPILER COMPONENTS --
4 -- --
5 -- I N T E R F A C E S . B I T _ T Y P E S --
6 -- --
7 -- S p e c --
8 -- --
9 -- Copyright (C) 2016, Free Software Foundation, Inc. --
10 -- --
11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 3, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. --
17 -- --
18 -- --
19 -- --
20 -- --
21 -- --
22 -- You should have received a copy of the GNU General Public License and --
23 -- a copy of the GCC Runtime Library Exception along with this program; --
24 -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
25 -- <http://www.gnu.org/licenses/>. --
26 -- --
27 -- GNAT was originally developed by the GNAT team at New York University. --
28 -- Extensive contributions were provided by Ada Core Technologies Inc. --
29 -- --
30 ------------------------------------------------------------------------------
31
32 pragma Ada_2012;
33
34 -- Base types used to describe register fields
35
36 package Interfaces.Bit_Types is
37 pragma No_Elaboration_Code_All;
38 pragma Pure;
39
40 subtype Word is Interfaces.Unsigned_32;
41 subtype Short is Interfaces.Unsigned_16;
42 subtype Byte is Interfaces.Unsigned_8;
43
44 type Bit is mod 2**1
45 with Size => 1;
46 type UInt2 is mod 2**2
47 with Size => 2;
48 type UInt3 is mod 2**3
49 with Size => 3;
50 type UInt4 is mod 2**4
51 with Size => 4;
52 type UInt5 is mod 2**5
53 with Size => 5;
54 type UInt6 is mod 2**6
55 with Size => 6;
56 type UInt7 is mod 2**7
57 with Size => 7;
58 type UInt9 is mod 2**9
59 with Size => 9;
60 type UInt10 is mod 2**10
61 with Size => 10;
62 type UInt11 is mod 2**11
63 with Size => 11;
64 type UInt12 is mod 2**12
65 with Size => 12;
66 type UInt13 is mod 2**13
67 with Size => 13;
68 type UInt14 is mod 2**14
69 with Size => 14;
70 type UInt15 is mod 2**15
71 with Size => 15;
72 type UInt17 is mod 2**17
73 with Size => 17;
74 type UInt18 is mod 2**18
75 with Size => 18;
76 type UInt19 is mod 2**19
77 with Size => 19;
78 type UInt20 is mod 2**20
79 with Size => 20;
80 type UInt21 is mod 2**21
81 with Size => 21;
82 type UInt22 is mod 2**22
83 with Size => 22;
84 type UInt23 is mod 2**23
85 with Size => 23;
86 type UInt24 is mod 2**24
87 with Size => 24;
88 type UInt25 is mod 2**25
89 with Size => 25;
90 type UInt26 is mod 2**26
91 with Size => 26;
92 type UInt27 is mod 2**27
93 with Size => 27;
94 type UInt28 is mod 2**28
95 with Size => 28;
96 type UInt29 is mod 2**29
97 with Size => 29;
98 type UInt30 is mod 2**30
99 with Size => 30;
100 type UInt31 is mod 2**31
101 with Size => 31;
102
103 end Interfaces.Bit_Types;