blob: aeda5ec829f6ceca95cc85d0f66795177d74cc40 [file] [log] [blame]
Nico Huber5e9b1b52016-10-08 22:09:33 +02001--
2-- Copyright (C) 2015-2016 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.Time
16 with Abstract_State => (State with External => Async_Writers)
17is
18
19 type T is private;
20
21 function Now return T
22 with
23 Volatile_Function,
24 Global => (Input => State);
25
26 function US_From_Now (US : Natural) return T
27 with
28 Volatile_Function,
29 Global => (Input => State);
30
31 function MS_From_Now (MS : Natural) return T
32 with
33 Volatile_Function,
34 Global => (Input => State);
35
36 function Now_US return Int64
37 with
38 Volatile_Function,
39 Global => (Input => State);
40
41 ----------------------------------------------------------------------------
42
43 pragma Warnings
44 (GNATprove, Off, "subprogram ""*Delay*"" has no effect",
45 Reason => "No effect on dataflow but time always passes.");
46
47 -- Delay execution until Deadline has been reached.
48 procedure Delay_Until (Deadline : T)
49 with
50 Global => (Input => State);
51
52 procedure U_Delay (US : Natural)
53 with
54 Global => (Input => State);
55
56 procedure M_Delay (MS : Natural)
57 with
58 Global => (Input => State);
59
60 pragma Warnings
61 (GNATprove, On, "subprogram ""*Delay*"" has no effect");
62
63 ----------------------------------------------------------------------------
64
65 function Timed_Out (Deadline : T) return Boolean
66 with
67 Volatile_Function,
68 Global => (Input => State);
69
70private
71
72 type T is new Word64;
73
74end HW.Time;
75
76-- vim: set ts=8 sts=3 sw=3 et: