| Tim Wawrzynczak | 605660b | 2022-06-08 12:48:19 -0600 | [diff] [blame^] | 1 | -- |
| 2 | -- Copyright (C) 2022 Google, LLC |
| 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; either version 2 of the License, or |
| 7 | -- (at your option) any later version. |
| 8 | -- |
| 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 | |
| 15 | with HW.Debug; |
| 16 | with GNAT.Source_Info; |
| 17 | |
| 18 | package body HW.GFX.GMA.PLLs |
| 19 | with |
| 20 | Refined_State => (State => PLLs) |
| 21 | is |
| 22 | |
| 23 | type Count_Range is new Natural range 0 .. 2; |
| 24 | |
| 25 | type PLL_State is record |
| 26 | Use_Count : Count_Range; |
| 27 | end record; |
| 28 | |
| 29 | type PLL_State_Array is array (Configurable_DPLLs) of PLL_State; |
| 30 | PLLs : PLL_State_Array; |
| 31 | |
| 32 | procedure Initialize is |
| 33 | begin |
| 34 | pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity)); |
| 35 | PLLs := |
| 36 | (Configurable_DPLLs => |
| 37 | (Use_Count => 0)); |
| 38 | end Initialize; |
| 39 | |
| 40 | procedure Alloc |
| 41 | (Port_Cfg : in Port_Config; |
| 42 | PLL : out T; |
| 43 | Success : out Boolean) |
| 44 | is |
| 45 | begin |
| 46 | pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity)); |
| 47 | PLL := Invalid_PLL; |
| 48 | Success := True; |
| 49 | end Alloc; |
| 50 | |
| 51 | procedure Free (PLL : T) is |
| 52 | begin |
| 53 | pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity)); |
| 54 | end Free; |
| 55 | |
| 56 | procedure All_Off is |
| 57 | begin |
| 58 | pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity)); |
| 59 | end All_Off; |
| 60 | |
| 61 | function Register_Value (PLL : T) return Word32 |
| 62 | is |
| 63 | begin |
| 64 | pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity)); |
| 65 | Return 0; |
| 66 | end Register_Value; |
| 67 | end HW.GFX.GMA.PLLs; |