blob: 9adb794c3a7f0822fb1a2aedbf1e6caec95816da [file] [log] [blame]
Nico Huber5e9b1b52016-10-08 22:09:33 +02001--
2-- Copyright (C) 2015 secunet Security Networks AG
3--
4-- This program is free software; you can redistribute it and/or modify
5-- it under the terms of the GNU General Public License as published by
Nico Huberaab715f2016-10-18 00:22:25 +02006-- the Free Software Foundation; either version 2 of the License, or
7-- (at your option) any later version.
Nico Huber5e9b1b52016-10-08 22:09:33 +02008--
9-- This program is distributed in the hope that it will be useful,
10-- but WITHOUT ANY WARRANTY; without even the implied warranty of
11-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12-- GNU General Public License for more details.
13--
14
15with Interfaces;
16
17package HW is
18
19 type Bit is mod 2 ** 1;
20
21 subtype Byte is Interfaces.Unsigned_8;
22 subtype Word8 is Byte;
23 function Shift_Left (Value : Word8; Amount : Natural) return Word8
24 renames Interfaces.Shift_Left;
25 function Shift_Right (Value : Word8; Amount : Natural) return Word8
26 renames Interfaces.Shift_Right;
27
28 subtype Word16 is Interfaces.Unsigned_16;
29 function Shift_Left (Value : Word16; Amount : Natural) return Word16
30 renames Interfaces.Shift_Left;
31 function Shift_Right (Value : Word16; Amount : Natural) return Word16
32 renames Interfaces.Shift_Right;
33
34 subtype Word32 is Interfaces.Unsigned_32;
35 function Shift_Left (Value : Word32; Amount : Natural) return Word32
36 renames Interfaces.Shift_Left;
37 function Shift_Right (Value : Word32; Amount : Natural) return Word32
38 renames Interfaces.Shift_Right;
39
40 subtype Word64 is Interfaces.Unsigned_64;
41 function Shift_Left (Value : Word64; Amount : Natural) return Word64
42 renames Interfaces.Shift_Left;
43 function Shift_Right (Value : Word64; Amount : Natural) return Word64
44 renames Interfaces.Shift_Right;
45
46 subtype Int8 is Interfaces.Integer_8;
47 subtype Int16 is Interfaces.Integer_16;
48 subtype Int32 is Interfaces.Integer_32;
49 subtype Int64 is Interfaces.Integer_64;
50
51 subtype Pos8 is Interfaces.Integer_8 range 1 .. Interfaces.Integer_8'Last;
52 subtype Pos16 is Interfaces.Integer_16 range 1 .. Interfaces.Integer_16'Last;
53 subtype Pos32 is Interfaces.Integer_32 range 1 .. Interfaces.Integer_32'Last;
54 subtype Pos64 is Interfaces.Integer_64 range 1 .. Interfaces.Integer_64'Last;
55
56 subtype Buffer_Range is Natural range 0 .. Natural'Last - 1;
57 type Buffer is array (Buffer_Range range <>) of Byte;
58
59end HW;