blob: 94b51971ea2768f4dfff41df2302a05d4b4db3cf [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
15package HW.Port_IO
16with
17 Abstract_State => (State with External => (Async_Readers, Async_Writers))
18is
19
20 type Port_Type is mod 2**16;
21
22 procedure InB (Value : out Word8; Port : Port_Type)
23 with
24 Global => (In_Out => State),
25 Depends => ((Value, State) => (Port, State)),
26 Inline_Always;
27
28 procedure InW (Value : out Word16; Port : Port_Type)
29 with
30 Global => (In_Out => State),
31 Depends => ((Value, State) => (Port, State)),
32 Pre => Port mod 2 = 0,
33 Inline_Always;
34
35 procedure InL (Value : out Word32; Port : Port_Type)
36 with
37 Global => (In_Out => State),
38 Depends => ((Value, State) => (Port, State)),
39 Pre => Port mod 4 = 0,
40 Inline_Always;
41
42 procedure OutB (Port : Port_Type; Value : Word8)
43 with
44 Global => (In_Out => State),
45 Depends => (State =>+ (Port, Value)),
46 Inline_Always;
47
48 procedure OutW (Port : Port_Type; Value : Word16)
49 with
50 Global => (In_Out => State),
51 Depends => (State =>+ (Port, Value)),
52 Pre => Port mod 2 = 0,
53 Inline_Always;
54
55 procedure OutL (Port : Port_Type; Value : Word32)
56 with
57 Global => (In_Out => State),
58 Depends => (State =>+ (Port, Value)),
59 Pre => Port mod 4 = 0,
60 Inline_Always;
61
62end HW.Port_IO;