blob: 9c0da37073c8f5122b7b7946fa9f9843d15bc78f [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 body HW.MMIO_Range
16with
17 Refined_State =>
18 (State => Range_A,
19 Base_Address => Address)
20is
21
22 Range_A : Array_T
23 with
24 Volatile,
25 Async_Readers, Async_Writers, Effective_Reads, Effective_Writes,
26 Import;
27
28 Address : Word64 := Base_Addr;
29
30 procedure Read (Value : out Element_T; Index : in Index_T) is
31 begin
32 Value := Range_A (Index);
33 end Read;
34
35 procedure Write (Index : in Index_T; Value: in Element_T) is
36 begin
37 Range_A (Index) := Value;
38 end Write;
39
40 procedure Set_Base_Address (Base : Word64) is
41 begin
42 Address := Base;
43 end Set_Base_Address;
44
45end HW.MMIO_Range;