blob: d96fc4b2200a7c0ebc44387264982ee7404e27ad [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
6-- the Free Software Foundation; version 2 of the License.
7--
8-- This program is distributed in the hope that it will be useful,
9-- but WITHOUT ANY WARRANTY; without even the implied warranty of
10-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11-- GNU General Public License for more details.
12--
13
14package body HW.MMIO_Range
15with
16 Refined_State =>
17 (State => Range_A,
18 Base_Address => Address)
19is
20
21 Range_A : Array_T
22 with
23 Volatile,
24 Async_Readers, Async_Writers, Effective_Reads, Effective_Writes,
25 Import;
26
27 Address : Word64 := Base_Addr;
28
29 procedure Read (Value : out Element_T; Index : in Index_T) is
30 begin
31 Value := Range_A (Index);
32 end Read;
33
34 procedure Write (Index : in Index_T; Value: in Element_T) is
35 begin
36 Range_A (Index) := Value;
37 end Write;
38
39 procedure Set_Base_Address (Base : Word64) is
40 begin
41 Address := Base;
42 end Set_Base_Address;
43
44end HW.MMIO_Range;