| Nico Huber | 5e9b1b5 | 2016-10-08 22:09:33 +0200 | [diff] [blame] | 1 | -- |
| 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 | |
| 14 | package body HW.MMIO_Range |
| 15 | with |
| 16 | Refined_State => |
| 17 | (State => Range_A, |
| 18 | Base_Address => Address) |
| 19 | is |
| 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 | |
| 44 | end HW.MMIO_Range; |