content
stringlengths
23
1.05M
package deref1 is type T is tagged limited null record; procedure Op (Obj : in out T); end deref1;
------------------------------------------------------------------------------ -- -- -- Copyright (c) 2014-2021 Vitalii Bondarenko <vibondare@gmail.com> -- -- -- ------------------------------------------------------------------------------ -- -- -- The MIT License (MIT) -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- -- "Software"), to deal in the Software without restriction, including -- -- without limitation the rights to use, copy, modify, merge, publish, -- -- distribute, sublicense, and/or sell copies of the Software, and to -- -- permit persons to whom the Software is furnished to do so, subject to -- -- the following conditions: -- -- -- -- The above copyright notice and this permission notice shall be included -- -- in all copies or substantial portions of the Software. -- -- -- -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- -- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- -- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- -- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -- -- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -- -- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -- -- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- ------------------------------------------------------------------------------ with Interfaces.C.Strings; use Interfaces.C.Strings; with System; use System; package body Notify is ----------------- -- Notify_Init -- ----------------- function Notify_Init (App_Name : UTF8_String) return Boolean is function Internal (App_Name : chars_ptr) return Gboolean; pragma Import (C, Internal, "notify_init"); begin return 0 /= Internal (New_String (App_Name)); end Notify_Init; ----------------- -- Notify_Init -- ----------------- procedure Notify_Init (App_Name : UTF8_String) is Success : Boolean; begin Success := Notify_Init (App_Name); end Notify_Init; ------------------- -- Notify_Uninit -- ------------------- procedure Notify_Uninit is procedure Internal; pragma Import (C, Internal, "notify_uninit"); begin Internal; end Notify_Uninit; ----------------------- -- Notify_Is_Initted -- ----------------------- function Notify_Is_Initted return Boolean is function Internal return Gboolean; pragma Import (C, Internal, "notify_is_initted"); begin return 0 /= Internal; end Notify_Is_Initted; ------------------------- -- Notify_Get_App_Name -- ------------------------- function Notify_Get_App_Name return UTF8_String is function Internal return chars_ptr; pragma Import (C, Internal, "notify_get_app_name"); Name : chars_ptr := Internal; begin if Name = Null_Ptr then return ""; else declare N : UTF8_String := Value (Name); begin Free (Name); return N; end; end if; end Notify_Get_App_Name; ------------------------- -- Notify_Set_App_Name -- ------------------------- procedure Notify_Set_App_Name (App_Name : UTF8_String) is procedure Internal (App_Name : chars_ptr); pragma Import (C, Internal, "notify_set_app_name"); begin Internal (New_String (App_Name)); end Notify_Set_App_Name; ---------------------------- -- Notify_Get_Server_Caps -- ---------------------------- function Notify_Get_Server_Caps return Gtk.Enums.String_List.Glist is function Internal return System.Address; pragma Import (C, Internal, "notify_get_server_caps"); List : Gtk.Enums.String_List.Glist; begin String_List.Set_Object (List, Internal); return List; end Notify_Get_Server_Caps; ---------------------------- -- Notify_Get_Server_Info -- ---------------------------- function Notify_Get_Server_Info (Name : out String_Ptr; Vendor : out String_Ptr; Version : out String_Ptr; Spec_Version : out String_Ptr) return Boolean is function Internal (Name : access chars_ptr; Vendor : access chars_ptr; Version : access chars_ptr; Spec_Version : access chars_ptr) return Gboolean; pragma Import (C, internal, "notify_get_server_info"); R : Boolean; N : aliased chars_ptr; Ven : aliased chars_ptr; Ver : aliased chars_ptr; Spec : aliased chars_ptr; begin R := 0 /= Internal (N'Access, Ven'Access, Ver'Access, Spec'Access); if R then Name := new String'(Value (N)); Vendor := new String'(Value (Ven)); Version := new String'(Value (Ver)); Spec_Version := new String'(Value (Spec)); end if; return R; end Notify_Get_Server_Info; end Notify;
with Ada.Text_IO; with Ada.Command_Line; with Bundle; procedure Show_Message is use Bundle; Count : constant Natural := Ada.Command_Line.Argument_Count; begin if Count = 0 then Ada.Text_IO.Put_Line ("Missing argument 'msg' or 'msg_fr'"); Ada.Command_Line.Set_Exit_Status (Ada.Command_Line.Failure); return; end if; for I in 1 .. Count loop declare Name : constant String := Ada.Command_Line.Argument (I); C : constant Content_Access := Get_Content (Name); begin if C = null then Ada.Text_IO.Put_Line ("FAIL: No bundle file " & Name); Ada.Command_Line.Set_Exit_Status (Ada.Command_Line.Failure); return; end if; for Val of C.all loop Ada.Text_IO.Put (Character'Val (Val)); end loop; end; end loop; end Show_Message;
-- The Village of Vampire by YT, このソースコードはNYSLです with Serialization; package Vampire.Villages.Village_IO is Yaml_Type : constant String := "vampire-village"; procedure IO ( Serializer : not null access Serialization.Serializer; Name : in String; People : in out Villages.People.Vector); procedure IO ( Serializer : not null access Serialization.Serializer; Village : in out Village_Type; Info_Only : in Boolean := False); package Requested_Role_IO is new Serialization.IO_Enumeration (Requested_Role); package Person_Role_IO is new Serialization.IO_Enumeration (Person_Role); package Person_State_IO is new Serialization.IO_Enumeration (Person_State); package Message_Kind_IO is new Serialization.IO_Enumeration (Message_Kind); package Village_Time_IO is new Serialization.IO_Enumeration (Village_Time); package Role_Appearance_IO is new Serialization.IO_Enumeration (Role_Appearance); package Vote_IO is new Serialization.IO_Enumeration (Vote_Mode); package Execution_IO is new Serialization.IO_Enumeration (Execution_Mode); package Formation_IO is new Serialization.IO_Enumeration (Formation_Mode); package Monster_Side_IO is new Serialization.IO_Enumeration (Monster_Side_Mode); package Attack_IO is new Serialization.IO_Enumeration (Attack_Mode); package Vampire_Action_Set_IO is new Serialization.IO_Enumeration (Vampire_Action_Set_Mode); package Servant_Knowing_IO is new Serialization.IO_Enumeration (Servant_Knowing_Mode); package Daytime_Preview_IO is new Serialization.IO_Enumeration (Daytime_Preview_Mode); package Doctor_Infected_IO is new Serialization.IO_Enumeration (Doctor_Infected_Mode); package Hunter_Silver_Bullet_IO is new Serialization.IO_Enumeration (Hunter_Silver_Bullet_Mode); package Unfortunate_IO is new Serialization.IO_Enumeration (Unfortunate_Mode); package Obsolete_Teaming_IO is new Serialization.IO_Enumeration (Obsolete_Teaming_Mode); end Vampire.Villages.Village_IO;
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- E R R O U T -- -- -- -- S p e c -- -- -- -- $Revision$ -- -- -- Copyright (C) 1992-2001 Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This package contains the routines to output error messages. They -- are basically system independent, however in some environments, e.g. -- when the parser is embedded into an editor, it may be appropriate -- to replace the implementation of this package. with Table; with Types; use Types; with Uintp; use Uintp; package Errout is Errors_Detected : Nat; -- Number of errors detected so far Warnings_Detected : Nat; -- Number of warnings detected type Compiler_State_Type is (Parsing, Analyzing); Compiler_State : Compiler_State_Type; -- Indicates current state of compilation. This is put in the Errout -- spec because it affects the action of the error message handling. -- In particular, an attempt is made by Errout to suppress cascaded -- error messages in Parsing mode, but not in the other modes. Current_Error_Source_File : Source_File_Index; -- Id of current messages. Used to post file name when unit changes. This -- is initialized to Main_Source_File at the start of a compilation, which -- means that no file names will be output unless there are errors in units -- other than the main unit. However, if the main unit has a pragma -- Source_Reference line, then this is initialized to No_Source_File, -- to force an initial reference to the real source file name. Raise_Exception_On_Error : Nat := 0; -- If this value is non-zero, then any attempt to generate an error -- message raises the exception Error_Msg_Exception, and the error -- message is not output. This is used for defending against junk -- resulting from illegalities, and also for substitution of more -- appropriate error messages from higher semantic levels. It is -- a counter so that the increment/decrement protocol nests neatly. Error_Msg_Exception : exception; -- Exception raised if Raise_Exception_On_Error is true ----------------------------------- -- Suppression of Error Messages -- ----------------------------------- -- In an effort to reduce the impact of redundant error messages, the -- error output routines in this package normally suppress certain -- classes of messages as follows: -- 1. Identical messages placed at the same point in the text. Such -- duplicate error message result for example from rescanning -- sections of the text that contain lexical errors. Only one of -- such a set of duplicate messages is output, and the rest are -- suppressed. -- 2. If more than one parser message is generated for a single source -- line, then only the first message is output, the remaining -- messages on the same line are suppressed. -- 3. If a message is posted on a node for which a message has been -- previously posted, then only the first message is retained. The -- Error_Posted flag is used to detect such multiple postings. Note -- that this only applies to semantic messages, since otherwise -- for parser messages, this would be a special case of case 2. -- 4. If a message is posted on a node whose Etype or Entity -- fields reference entities on which an error message has -- already been placed, as indicated by the Error_Posted flag -- being set on these entities, then the message is suppressed. -- 5. If a message attempts to insert an Error node, or a direct -- reference to the Any_Type node, then the message is suppressed. -- This normal suppression action may be overridden in cases 2-5 (but not -- in case 1) by setting All_Errors mode, or by setting the special -- unconditional message insertion character (!) at the end of the message -- text as described below. --------------------------------------------------------- -- Error Message Text and Message Insertion Characters -- --------------------------------------------------------- -- Error message text strings are composed of lower case letters, digits -- and the special characters space, comma, period, colon and semicolon, -- apostrophe and parentheses. Special insertion characters can also -- appear which cause the error message circuit to modify the given -- string as follows: -- Insertion character % (Percent: insert name from Names table) -- The character % is replaced by the text for the name specified by -- the Name_Id value stored in Error_Msg_Name_1. A blank precedes -- the name if it is preceded by a non-blank character other than a -- left parenthesis. The name is enclosed in quotes unless manual -- quotation mode is set. If the Name_Id is set to No_Name, then -- no insertion occurs; if the Name_Id is set to Error_Name, then -- the string <error> is inserted. A second and third % may appear -- in a single message, similarly replaced by the names which are -- specified by the Name_Id values stored in Error_Msg_Name_2 and -- Error_Msg_Name_3. The names are decoded and cased according to -- the current identifier casing mode. -- Insertion character $ (Dollar: insert unit name from Names table) -- The character $ is treated similarly to %, except that the name -- is obtained from the Unit_Name_Type value in Error_Msg_Unit_1 -- and Error_Msg_Unit_2, as provided by Get_Unit_Name_String in -- package Uname. Note that this name includes the postfix (spec) -- or (body) strings. If this postfix is not required, use the -- normal % insertion for the unit name. -- Insertion character { (Left brace: insert literally from names table) -- The character { is treated similarly to %, except that the -- name is output literally as stored in the names table without -- adjusting the casing. This can be used for file names and in -- other situations where the name string is to be output unchanged. -- Insertion character * (Asterisk, insert reserved word name) -- The insertion character * is treated exactly like % except that -- the resulting name is cased according to the default conventions -- for reserved words (see package Scans). -- Insertion character & (Ampersand: insert name from node) -- The insertion character & is treated similarly to %, except that -- the name is taken from the Chars field of the given node, and may -- refer to a child unit name, or a selected component. The casing -- is, if possible, taken from the original source reference, which -- is obtained from the Sloc field of the given node or nodes. If no -- Sloc is available (happens e.g. for nodes in package Standard), -- then the default case (see Scans spec) is used. The nodes to be -- used are stored in Error_Msg_Node_1, Error_Msg_Node_2. No insertion -- occurs for the Empty node, and the Error node results in the -- insertion of the characters <error>. In addition, if the special -- global variable Error_Msg_Qual_Level is non-zero, then the -- reference will include up to the given number of levels of -- qualification, using the scope chain. -- Insertion character # (Pound: insert line number reference) -- The character # is replaced by the string indicating the source -- position stored in Error_Msg_Sloc. There are three cases: -- -- for package Standard: in package Standard -- for locations in current file: at line nnn:ccc -- for locations in other files: at filename:nnn:ccc -- -- By convention, the # insertion character is only used at the end -- of an error message, so the above strings only appear as the last -- characters of an error message. -- Insertion character } (Right brace: insert type reference) -- The character } is replaced by a string describing the type -- referenced by the entity whose Id is stored in Error_Msg_Node_1. -- the string gives the name or description of the type, and also -- where appropriate the location of its declaration. Special -- cases like "some integer type" are handled appropriately. Only -- one } is allowed in a message, since there is not enough room -- for two (the insertion can be quite long, including a file name) -- In addition, if the special global variable Error_Msg_Qual_Level -- is non-zero, then the reference will include up to the given -- number of levels of qualification, using the scope chain. -- Insertion character @ (At: insert column number reference) -- The character @ is replaced by null if the RM_Column_Check mode is -- off (False). If the switch is on (True), then @ is replaced by the -- text string " in column nnn" where nnn is the decimal representation -- of the column number stored in Error_Msg_Col plus one (the plus one -- is because the number is stored 0-origin and displayed 1-origin). -- Insertion character ^ (Carret: insert integer value) -- The character ^ is replaced by the decimal conversion of the Uint -- value stored in Error_Msg_Uint_1, with a possible leading minus. -- A second ^ may occur in the message, in which case it is replaced -- by the decimal conversion of the Uint value in Error_Msg_Uint_2. -- Insertion character ! (Exclamation: unconditional message) -- The character ! appearing as the last character of a message makes -- the message unconditional which means that it is output even if it -- would normally be suppressed. See section above for a description -- of the cases in which messages are normally suppressed. -- Insertion character ? (Question: warning message) -- The character ? appearing anywhere in a message makes the message -- a warning instead of a normal error message, and the text of the -- message will be preceded by "Warning:" instead of "Error:" The -- handling of warnings if further controlled by the Warning_Mode -- option (-w switch), see package Opt for further details, and -- also by the current setting from pragma Warnings. This pragma -- applies only to warnings issued from the semantic phase (not -- the parser), but currently all relevant warnings are posted -- by the semantic phase anyway. Messages starting with (style) -- are also treated as warning messages. -- Insertion character A-Z (Upper case letter: Ada reserved word) -- If two or more upper case letters appear in the message, they are -- taken as an Ada reserved word, and are converted to the default -- case for reserved words (see Scans package spec). Surrounding -- quotes are added unless manual quotation mode is currently set. -- Insertion character ` (Backquote: set manual quotation mode) -- The backquote character always appears in pairs. Each backquote -- of the pair is replaced by a double quote character. In addition, -- Any reserved keywords, or name insertions between these backquotes -- are not surrounded by the usual automatic double quotes. See the -- section below on manual quotation mode for further details. -- Insertion character ' (Quote: literal character) -- Precedes a character which is placed literally into the message. -- Used to insert characters into messages that are one of the -- insertion characters defined here. -- Insertion character \ (Backslash: continuation message) -- Indicates that the message is a continuation of a message -- previously posted. This is used to ensure that such groups -- of messages are treated as a unit. The \ character must be -- the first character of the message text. ----------------------------------------------------- -- Global Values Used for Error Message Insertions -- ----------------------------------------------------- -- The following global variables are essentially additional parameters -- passed to the error message routine for insertion sequences described -- above. The reason these are passed globally is that the insertion -- mechanism is essentially an untyped one in which the appropriate -- variables are set dependingon the specific insertion characters used. Error_Msg_Col : Column_Number; -- Column for @ insertion character in message Error_Msg_Uint_1 : Uint; Error_Msg_Uint_2 : Uint; -- Uint values for ^ insertion characters in message Error_Msg_Sloc : Source_Ptr; -- Source location for # insertion character in message Error_Msg_Name_1 : Name_Id; Error_Msg_Name_2 : Name_Id; Error_Msg_Name_3 : Name_Id; -- Name_Id values for % insertion characters in message Error_Msg_Unit_1 : Name_Id; Error_Msg_Unit_2 : Name_Id; -- Name_Id values for $ insertion characters in message Error_Msg_Node_1 : Node_Id; Error_Msg_Node_2 : Node_Id; -- Node_Id values for & insertion characters in message Error_Msg_Qual_Level : Int := 0; -- Number of levels of qualification required for type name (see the -- description of the } insertion character. Note that this value does -- note get reset by any Error_Msg call, so the caller is responsible -- for resetting it. Warn_On_Instance : Boolean := False; -- Normally if a warning is generated in a generic template from the -- analysis of the template, then the warning really belongs in the -- template, and the default value of False for this Boolean achieves -- that effect. If Warn_On_Instance is set True, then the warnings are -- generated on the instantiation (referring to the template) rather -- than on the template itself. ----------------------------------------------------- -- Format of Messages and Manual Quotation Control -- ----------------------------------------------------- -- Messages are generally all in lower case, except for inserted names -- and appear in one of the following three forms: -- error: text -- warning: text -- The prefixes error and warning are supplied automatically (depending -- on the use of the ? insertion character), and the call to the error -- message routine supplies the text. The "error: " prefix is omitted -- in brief error message formats. -- Reserved Ada keywords in the message are in the default keyword case -- (determined from the given source program), surrounded by quotation -- marks. This is achieved by spelling the reserved word in upper case -- letters, which is recognized as a request for insertion of quotation -- marks by the error text processor. Thus for example: -- Error_Msg_AP ("IS expected"); -- would result in the output of one of the following: -- error: "is" expected -- error: "IS" expected -- error: "Is" expected -- the choice between these being made by looking at the casing convention -- used for keywords (actually the first compilation unit keyword) in the -- source file. -- In the case of names, the default mode for the error text processor -- is to surround the name by quotation marks automatically. The case -- used for the identifier names is taken from the source program where -- possible, and otherwise is the default casing convention taken from -- the source file usage. -- In some cases, better control over the placement of quote marks is -- required. This is achieved using manual quotation mode. In this mode, -- one or more insertion sequences is surrounded by backquote characters. -- The backquote characters are output as double quote marks, and normal -- automatic insertion of quotes is suppressed between the double quotes. -- For example: -- Error_Msg_AP ("`END &;` expected"); -- generates a message like -- error: "end Open_Scope;" expected -- where the node specifying the name Open_Scope has been stored in -- Error_Msg_Node_1 prior to the call. The great majority of error -- messages operates in normal quotation mode. -- Note: the normal automatic insertion of spaces before insertion -- sequences (such as those that come from & and %) is suppressed in -- manual quotation mode, so blanks, if needed as in the above example, -- must be explicitly present. ---------------------------- -- Message ID Definitions -- ---------------------------- type Error_Msg_Id is new Int; -- A type used to represent specific error messages. Used by the clients -- of this package only in the context of the Get_Error_Id and -- Change_Error_Text subprograms. No_Error_Msg : constant Error_Msg_Id := 0; -- A constant which is different from any value returned by Get_Error_Id. -- Typically used by a client to indicate absense of a saved Id value. function Get_Msg_Id return Error_Msg_Id; -- Returns the Id of the message most recently posted using one of the -- Error_Msg routines. function Get_Location (E : Error_Msg_Id) return Source_Ptr; -- Returns the flag location of the error message with the given id E. ------------------------ -- List Pragmas Table -- ------------------------ -- When a pragma Page or pragma List is encountered by the parser, an -- entry is made in the following table. This table is then used to -- control the full listing if one is being generated. Note that the -- reason we do the processing in the parser is so that we get proper -- listing control even in syntax check only mode. type List_Pragma_Type is (List_On, List_Off, Page); type List_Pragma_Record is record Ptyp : List_Pragma_Type; Ploc : Source_Ptr; end record; -- Note: Ploc points to the terminating semicolon in the List_Off and -- Page cases, and to the pragma keyword for List_On. In the case of -- a pragma List_Off, a List_On entry is also made in the table, -- pointing to the pragma keyword. This ensures that, as required, -- a List (Off) pragma is listed even in list off mode. package List_Pragmas is new Table.Table ( Table_Component_Type => List_Pragma_Record, Table_Index_Type => Int, Table_Low_Bound => 1, Table_Initial => 50, Table_Increment => 200, Table_Name => "List_Pragmas"); --------------------------- -- Ignore_Errors Feature -- --------------------------- -- In certain cases, notably for optional subunits, the compiler operates -- in a mode where errors are to be ignored, and the whole unit is to be -- considered as not present. To implement this we provide the following -- flag to enable special handling, where error messages are suppressed, -- but the Fatal_Error flag will still be set in the normal manner. Ignore_Errors_Enable : Nat := 0; -- Triggering switch. If non-zero, then ignore errors mode is activated. -- This is a counter to allow convenient nesting of enable/disable. ------------------------------ -- Error Output Subprograms -- ------------------------------ procedure Initialize; -- Initializes for output of error messages. Must be called for each -- source file before using any of the other routines in the package. procedure Finalize; -- Finalize processing of error messages for one file and output message -- indicating the number of detected errors. procedure Error_Msg (Msg : String; Flag_Location : Source_Ptr); -- Output a message at specified location. Can be called from the parser -- or the semantic analyzer. procedure Error_Msg_S (Msg : String); -- Output a message at current scan pointer location. This routine can be -- called only from the parser, since it references Scan_Ptr. procedure Error_Msg_AP (Msg : String); -- Output a message just after the previous token. This routine can be -- called only from the parser, since it references Prev_Token_Ptr. procedure Error_Msg_BC (Msg : String); -- Output a message just before the current token. Note that the important -- difference between this and the previous routine is that the BC case -- posts a flag on the current line, whereas AP can post a flag at the -- end of the preceding line. This routine can be called only from the -- parser, since it references Token_Ptr. procedure Error_Msg_SC (Msg : String); -- Output a message at the start of the current token, unless we are at -- the end of file, in which case we always output the message after the -- last real token in the file. This routine can be called only from the -- parser, since it references Token_Ptr. procedure Error_Msg_SP (Msg : String); -- Output a message at the start of the previous token. This routine can -- be called only from the parser, since it references Prev_Token_Ptr. procedure Error_Msg_N (Msg : String; N : Node_Or_Entity_Id); -- Output a message at the Sloc of the given node. This routine can be -- called from the parser or the semantic analyzer, although the call -- from the latter is much more common (and is the most usual way of -- generating error messages from the analyzer). The message text may -- contain a single & insertion, which will reference the given node. procedure Error_Msg_NE (Msg : String; N : Node_Or_Entity_Id; E : Node_Or_Entity_Id); -- Output a message at the Sloc of the given node, with an insertion of -- the name from the given entity node. This is used by the semantic -- routines, where this is a common error message situation. The Msg -- text will contain a & or } as usual to mark the insertion point. -- This routine can be called from the parser or the analyzer. procedure Change_Error_Text (Error_Id : Error_Msg_Id; New_Msg : String); -- The error message text of the message identified by Id is replaced by -- the given text. This text may contain insertion characters in the -- usual manner, and need not be the same length as the original text. procedure Purge_Messages (From : Source_Ptr; To : Source_Ptr); -- All error messages whose location is in the range From .. To (not -- including the end points) will be deleted from the error listing. procedure Remove_Warning_Messages (N : Node_Id); -- Remove any warning messages corresponding to the Sloc of N or any -- of its descendent nodes. No effect if no such warnings. procedure Set_Warnings_Mode_Off (Loc : Source_Ptr); -- Called in response to a pragma Warnings (Off) to record the source -- location from which warnings are to be turned off. procedure Set_Warnings_Mode_On (Loc : Source_Ptr); -- Called in response to a pragma Warnings (On) to record the source -- location from which warnings are to be turned back on. function Compilation_Errors return Boolean; -- Returns true if errors have been detected, or warnings in -gnatwe -- (treat warnings as errors) mode. procedure dmsg (Id : Error_Msg_Id); -- Debugging routine to dump an error message end Errout;
with AUnit.Reporter.Text; with AUnit.Run; with Day1_Suite; use Day1_Suite; procedure Test_Day1 is procedure Runner is new AUnit.Run.Test_Runner (Suite); Reporter : AUnit.Reporter.Text.Text_Reporter; begin Runner (Reporter); end Test_Day1;
with CLIC.TTY; use CLIC.TTY; with Ada.Text_IO; use Ada.Text_IO; package body CLIC_Ex.Commands.TTY is package TTY renames CLIC.TTY; ------------- -- Execute -- ------------- overriding procedure Execute (Cmd : in out Instance; Args : AAA.Strings.Vector) is begin Put_Line (TTY.Bold ("CLIC.TTY.Bold ()")); Put_Line (TTY.Dim ("CLIC.TTY.Dim ()")); Put_Line (TTY.Italic ("CLIC.TTY.Italic ()")); Put_Line (TTY.Underline ("CLIC.TTY.Underline ()")); Put_Line (TTY.Emph ("CLIC.TTY.Emph ()")); Put_Line (TTY.Description ("CLIC.TTY.Description ()")); Put_Line (TTY.Error ("CLIC.TTY.Error ()")); Put_Line (TTY.Warn ("CLIC.TTY.Warn ()")); Put_Line (TTY.Info ("CLIC.TTY.Info ()")); Put_Line (TTY.Success ("CLIC.TTY.Success ()")); Put_Line (TTY.Terminal ("CLIC.TTY.Terminal ()")); Put_Line (TTY.Format (Text => "CLIC.TTY.Format ("", Fore => ANSI.Light_Blue, Style => ANSI.Strike)", Fore => ANSI.Light_Blue, Style => ANSI.Strike)); end Execute; end CLIC_Ex.Commands.TTY;
---------------------------------- -- Binary Space Partition (BSP) -- ---------------------------------- -- -- Changes: -- -- 31 - Mar - 2008 : comment : node_id also meant for use with I/O -- 14 - Oct - 2006 : created package GLOBE_3D.BSP is type BSP_node; type p_BSP_node is access BSP_node; type BSP_node is record front_child, back_child : p_BSP_node := null; front_leaf, back_leaf : p_Object_3D := null; -- outer normal to node's plane : normal : Vector_3D; -- signed distance between origin O and plane; positive if O in front : distance : Real; -- informative (debug) or as temporary for I/O : node_id : Natural := 0; end record; procedure Locate (P : Point_3D; tree : p_BSP_node; area : out p_Object_3D); -- if P is in no area known to the BSP tree, area := null procedure Delete (tree : in out p_BSP_node); end GLOBE_3D.BSP;
------------------------------------------------------------------------------ -- -- -- AUDIO / RIFF / WAV -- -- -- -- Standard channel configurations for wavefiles -- -- -- -- The MIT License (MIT) -- -- -- -- Copyright (c) 2020 Gustavo A. Hoffmann -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining -- -- a copy of this software and associated documentation files (the -- -- "Software"), to deal in the Software without restriction, including -- -- without limitation the rights to use, copy, modify, merge, publish, -- -- distribute, sublicense, and / or sell copies of the Software, and to -- -- permit persons to whom the Software is furnished to do so, subject to -- -- the following conditions: -- -- -- -- The above copyright notice and this permission notice shall be -- -- included in all copies or substantial portions of the Software. -- -- -- -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -- -- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- -- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- -- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -- -- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -- -- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -- -- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- ------------------------------------------------------------------------------ package Audio.RIFF.Wav.Formats.Standard_Channel_Configurations is Channel_Config_Empty : constant Channel_Configuration := (others => False); Channel_Config_1_0 : constant Channel_Configuration := (Speaker_Front_Left => True, others => False); type Channel_Position_1_0 is (Front_Left); for Channel_Position_1_0 use (Front_Left => 1); function F_L return Channel_Position_1_0 renames Front_Left; Channel_Config_2_0 : constant Channel_Configuration := (Speaker_Front_Left | Speaker_Front_Right => True, others => False); type Channel_Position_2_0 is (Front_Left, Front_Right); function F_L return Channel_Position_2_0 renames Front_Left; function F_R return Channel_Position_2_0 renames Front_Right; Channel_Config_3_0 : constant Channel_Configuration := (Speaker_Front_Left | Speaker_Front_Right | Speaker_Front_Center => True, others => False); type Channel_Position_3_0 is (Front_Left, Front_Right, Front_Center); function F_L return Channel_Position_3_0 renames Front_Left; function F_R return Channel_Position_3_0 renames Front_Right; function F_C return Channel_Position_3_0 renames Front_Center; Channel_Config_4_0 : constant Channel_Configuration := (Speaker_Front_Left | Speaker_Front_Right | Speaker_Back_Left | Speaker_Back_Right => True, others => False); type Channel_Position_4_0 is (Front_Left, Front_Right, Back_Left, Back_Right); function F_L return Channel_Position_4_0 renames Front_Left; function F_R return Channel_Position_4_0 renames Front_Right; function B_L return Channel_Position_4_0 renames Back_Left; function B_R return Channel_Position_4_0 renames Back_Right; Channel_Config_5_0 : constant Channel_Configuration := (Speaker_Front_Left | Speaker_Front_Right | Speaker_Front_Center | Speaker_Back_Left | Speaker_Back_Right => True, others => False); type Channel_Position_5_0 is (Front_Left, Front_Right, Front_Center, Back_Left, Back_Right); function F_L return Channel_Position_5_0 renames Front_Left; function F_R return Channel_Position_5_0 renames Front_Right; function F_C return Channel_Position_5_0 renames Front_Center; function B_L return Channel_Position_5_0 renames Back_Left; function B_R return Channel_Position_5_0 renames Back_Right; Channel_Config_5_1 : constant Channel_Configuration := (Speaker_Front_Left | Speaker_Front_Right | Speaker_Front_Center | Speaker_Low_Frequency | Speaker_Back_Left | Speaker_Back_Right => True, others => False); type Channel_Position_5_1 is (Front_Left, Front_Right, Front_Center, Low_Frequency, Back_Left, Back_Right); function F_L return Channel_Position_5_1 renames Front_Left; function F_R return Channel_Position_5_1 renames Front_Right; function F_C return Channel_Position_5_1 renames Front_Center; function LFE return Channel_Position_5_1 renames Low_Frequency; function B_L return Channel_Position_5_1 renames Back_Left; function B_R return Channel_Position_5_1 renames Back_Right; Channel_Config_7_0 : constant Channel_Configuration := (Speaker_Front_Left | Speaker_Front_Right | Speaker_Front_Center | Speaker_Back_Left | Speaker_Back_Right | Speaker_Side_Left | Speaker_Side_Right => True, others => False); type Channel_Position_7_0 is (Front_Left, Front_Right, Front_Center, Back_Left, Back_Right, Side_Left, Side_Right); function F_L return Channel_Position_7_0 renames Front_Left; function F_R return Channel_Position_7_0 renames Front_Right; function F_C return Channel_Position_7_0 renames Front_Center; function B_L return Channel_Position_7_0 renames Back_Left; function B_R return Channel_Position_7_0 renames Back_Right; function S_L return Channel_Position_7_0 renames Side_Left; function S_R return Channel_Position_7_0 renames Side_Right; Channel_Config_7_1 : constant Channel_Configuration := (Speaker_Front_Left | Speaker_Front_Right | Speaker_Front_Center | Speaker_Low_Frequency | Speaker_Back_Left | Speaker_Back_Right | Speaker_Side_Left | Speaker_Side_Right => True, others => False); type Channel_Position_7_1 is (Front_Left, Front_Right, Front_Center, Low_Frequency, Back_Left, Back_Right, Side_Left, Side_Right); function F_L return Channel_Position_7_1 renames Front_Left; function F_R return Channel_Position_7_1 renames Front_Right; function F_C return Channel_Position_7_1 renames Front_Center; function LFE return Channel_Position_7_1 renames Low_Frequency; function B_L return Channel_Position_7_1 renames Back_Left; function B_R return Channel_Position_7_1 renames Back_Right; function S_L return Channel_Position_7_1 renames Side_Left; function S_R return Channel_Position_7_1 renames Side_Right; Channel_Config_7_1_BC : constant Channel_Configuration := (Speaker_Front_Left | Speaker_Front_Right | Speaker_Front_Center | Speaker_Low_Frequency | Speaker_Back_Left | Speaker_Back_Right | Speaker_Side_Left | Speaker_Side_Right | Speaker_Back_Center => True, others => False); type Channel_Position_7_1_BC is (Front_Left, Front_Right, Front_Center, Low_Frequency, Back_Left, Back_Right, Side_Left, Side_Right, Back_Center); function F_L return Channel_Position_7_1_BC renames Front_Left; function F_R return Channel_Position_7_1_BC renames Front_Right; function F_C return Channel_Position_7_1_BC renames Front_Center; function LFE return Channel_Position_7_1_BC renames Low_Frequency; function B_L return Channel_Position_7_1_BC renames Back_Left; function B_R return Channel_Position_7_1_BC renames Back_Right; function S_L return Channel_Position_7_1_BC renames Side_Left; function S_R return Channel_Position_7_1_BC renames Side_Right; function B_C return Channel_Position_7_1_BC renames Back_Center; Channel_Config_5_1_2 : constant Channel_Configuration := (Speaker_Front_Left | Speaker_Front_Right | Speaker_Front_Center | Speaker_Low_Frequency | Speaker_Back_Left | Speaker_Back_Right | Speaker_Top_Front_Left | Speaker_Top_Front_Right => True, others => False); type Channel_Position_5_1_2 is (Front_Left, Front_Right, Front_Center, Low_Frequency, Back_Left, Back_Right, Top_Front_Left, Top_Front_Right); function F_L return Channel_Position_5_1_2 renames Front_Left; function F_R return Channel_Position_5_1_2 renames Front_Right; function F_C return Channel_Position_5_1_2 renames Front_Center; function LFE return Channel_Position_5_1_2 renames Low_Frequency; function B_L return Channel_Position_5_1_2 renames Back_Left; function B_R return Channel_Position_5_1_2 renames Back_Right; function T_F_L return Channel_Position_5_1_2 renames Top_Front_Left; function T_F_R return Channel_Position_5_1_2 renames Top_Front_Right; Channel_Config_5_1_4 : constant Channel_Configuration := (Speaker_Front_Left | Speaker_Front_Right | Speaker_Front_Center | Speaker_Low_Frequency | Speaker_Back_Left | Speaker_Back_Right | Speaker_Top_Front_Left | Speaker_Top_Front_Right | Speaker_Top_Back_Left | Speaker_Top_Back_Right => True, others => False); type Channel_Position_5_1_4 is (Front_Left, Front_Right, Front_Center, Low_Frequency, Back_Left, Back_Right, Top_Front_Left, Top_Front_Right, Top_Back_Left, Top_Back_Right); function F_L return Channel_Position_5_1_4 renames Front_Left; function F_R return Channel_Position_5_1_4 renames Front_Right; function F_C return Channel_Position_5_1_4 renames Front_Center; function LFE return Channel_Position_5_1_4 renames Low_Frequency; function B_L return Channel_Position_5_1_4 renames Back_Left; function B_R return Channel_Position_5_1_4 renames Back_Right; function T_F_L return Channel_Position_5_1_4 renames Top_Front_Left; function T_F_R return Channel_Position_5_1_4 renames Top_Front_Right; function T_B_L return Channel_Position_5_1_4 renames Top_Back_Left; function T_B_R return Channel_Position_5_1_4 renames Top_Back_Right; Channel_Config_7_1_2 : constant Channel_Configuration := (Speaker_Front_Left | Speaker_Front_Right | Speaker_Front_Center | Speaker_Low_Frequency | Speaker_Back_Left | Speaker_Back_Right | Speaker_Side_Left | Speaker_Side_Right | Speaker_Top_Front_Left | Speaker_Top_Front_Right => True, others => False); type Channel_Position_7_1_2 is (Front_Left, Front_Right, Front_Center, Low_Frequency, Back_Left, Back_Right, Side_Left, Side_Right, Top_Front_Left, Top_Front_Right); function F_L return Channel_Position_7_1_2 renames Front_Left; function F_R return Channel_Position_7_1_2 renames Front_Right; function F_C return Channel_Position_7_1_2 renames Front_Center; function LFE return Channel_Position_7_1_2 renames Low_Frequency; function B_L return Channel_Position_7_1_2 renames Back_Left; function B_R return Channel_Position_7_1_2 renames Back_Right; function S_L return Channel_Position_7_1_2 renames Side_Left; function S_R return Channel_Position_7_1_2 renames Side_Right; function T_F_L return Channel_Position_7_1_2 renames Top_Front_Left; function T_F_R return Channel_Position_7_1_2 renames Top_Front_Right; Channel_Config_7_0_4 : constant Channel_Configuration := (Speaker_Front_Left | Speaker_Front_Right | Speaker_Front_Center | Speaker_Back_Left | Speaker_Back_Right | Speaker_Side_Left | Speaker_Side_Right | Speaker_Top_Front_Left | Speaker_Top_Front_Right | Speaker_Top_Back_Left | Speaker_Top_Back_Right => True, others => False); type Channel_Position_7_0_4 is (Front_Left, Front_Right, Front_Center, Back_Left, Back_Right, Side_Left, Side_Right, Top_Front_Left, Top_Front_Right, Top_Back_Left, Top_Back_Right); function F_L return Channel_Position_7_0_4 renames Front_Left; function F_R return Channel_Position_7_0_4 renames Front_Right; function F_C return Channel_Position_7_0_4 renames Front_Center; function B_L return Channel_Position_7_0_4 renames Back_Left; function B_R return Channel_Position_7_0_4 renames Back_Right; function S_L return Channel_Position_7_0_4 renames Side_Left; function S_R return Channel_Position_7_0_4 renames Side_Right; function T_F_L return Channel_Position_7_0_4 renames Top_Front_Left; function T_F_R return Channel_Position_7_0_4 renames Top_Front_Right; function T_B_L return Channel_Position_7_0_4 renames Top_Back_Left; function T_B_R return Channel_Position_7_0_4 renames Top_Back_Right; Channel_Config_7_1_4 : constant Channel_Configuration := (Speaker_Front_Left | Speaker_Front_Right | Speaker_Front_Center | Speaker_Low_Frequency | Speaker_Back_Left | Speaker_Back_Right | Speaker_Side_Left | Speaker_Side_Right | Speaker_Top_Front_Left | Speaker_Top_Front_Right | Speaker_Top_Back_Left | Speaker_Top_Back_Right => True, others => False); type Channel_Position_7_1_4 is (Front_Left, Front_Right, Front_Center, Low_Frequency, Back_Left, Back_Right, Side_Left, Side_Right, Top_Front_Left, Top_Front_Right, Top_Back_Left, Top_Back_Right); function F_L return Channel_Position_7_1_4 renames Front_Left; function F_R return Channel_Position_7_1_4 renames Front_Right; function F_C return Channel_Position_7_1_4 renames Front_Center; function LFE return Channel_Position_7_1_4 renames Low_Frequency; function B_L return Channel_Position_7_1_4 renames Back_Left; function B_R return Channel_Position_7_1_4 renames Back_Right; function S_L return Channel_Position_7_1_4 renames Side_Left; function S_R return Channel_Position_7_1_4 renames Side_Right; function T_F_L return Channel_Position_7_1_4 renames Top_Front_Left; function T_F_R return Channel_Position_7_1_4 renames Top_Front_Right; function T_B_L return Channel_Position_7_1_4 renames Top_Back_Left; function T_B_R return Channel_Position_7_1_4 renames Top_Back_Right; function Guessed_Channel_Configuration (Number_Of_Channels : Positive) return Channel_Configuration with Post => (if Guessed_Channel_Configuration'Result /= Channel_Config_Empty then Is_Consistent (Guessed_Channel_Configuration'Result, Number_Of_Channels)); end Audio.RIFF.Wav.Formats.Standard_Channel_Configurations;
-- { dg-do compile } -- { dg-options "-gnatws" } with System; package SSO2 is I : Integer; type Rec1 is record A : System.Address; end record; for Rec1'Bit_Order use System.High_Order_First; for Rec1'Scalar_Storage_Order use System.High_Order_First; R1 : Rec1 := (A => I'Address); type Rec2 is record A : System.Address; end record; for Rec2'Bit_Order use System.Low_Order_First; for Rec2'Scalar_Storage_Order use System.Low_Order_First; R2 : Rec2 := (A => I'Address); end SSO2;
------------------------------------------------------------------------------- -- Copyright (c) 2019, Daniel King -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- * Redistributions of source code must retain the above copyright -- notice, this list of conditions and the following disclaimer. -- * Redistributions in binary form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. -- * The name of the copyright holder may not be used to endorse or promote -- Products derived from this software without specific prior written -- permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY -- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------- with Keccak.Types; -- @summary -- Implements padding rules. -- -- @description -- This package contains the implementation of the pad10*1 padding rule. -- package Keccak.Padding with SPARK_Mode => On is --------------- -- Pad1*01 -- --------------- -- These padding rules append a 1 bit, followed by zero or more 0 bits, -- and ending with a final 1 bit. Pad101_Min_Bits : constant := 2; -- The pad10*1 rule appends at least 2 bits procedure Pad101_Multi_Blocks (First_Block : in out Keccak.Types.Byte_Array; Num_Used_Bits : in Natural; Max_Bit_Length : in Natural; Next_Block : out Keccak.Types.Byte_Array; Spilled : out Boolean) with Global => null, Depends => (First_Block =>+ (Num_Used_Bits, Max_Bit_Length), Next_Block =>+ (Num_Used_Bits, Max_Bit_Length), Spilled => (Num_Used_Bits, Max_Bit_Length)), Pre => (Next_Block'Length = First_Block'Length and then First_Block'Length <= Natural'Last / 8 and then Max_Bit_Length <= Natural'Last - 7 and then First_Block'Length = (Max_Bit_Length + 7) / 8 and then Num_Used_Bits < Max_Bit_Length), Post => Spilled = ((Num_Used_Bits + Pad101_Min_Bits) > Max_Bit_Length); -- pad10*1 padding rule -- -- This procedure is used in cases where there might not be enough free space -- in a block for all the padding bits, in which case the padding spills -- over into a second block. -- -- @param First_Block The block which is to be padded. At least 1 padding bit -- is applied to this block. -- -- @param Num_Used_Bits The number of bits which are in-use in First_Block. -- The padding bits will be applied immediately after this length. -- -- @param Max_Bit_Length The maximum number of bits that can be stored in -- First_Block and Next_Block. Padding will only be appended up to this -- length. -- -- @param Next_Block If there is less than 2 bits of unused bits in -- First_Block then the padding continues into this block. If there -- are at least 2 unused bits in First_Block then Next_Block is not used -- and is filled with zeroes. -- -- @param Spilled Set to True if there was not enough unused bits in -- First_Block to store all of the padding bits. When Spilled is True then -- both First_Block and Next_Block contain the padded data. -- Otherwise, Spilled is set to False if there is enough free space in -- First_Block for all of the padding bits. When Spilled is False then -- Next_Block is not used. procedure Pad101_Single_Block (Block : in out Keccak.Types.Byte_Array; Num_Used_Bits : in Natural; Max_Bit_Length : in Natural) with Global => null, Depends => (Block =>+ (Num_Used_Bits, Max_Bit_Length)), Pre => (Block'Length <= Natural'Last / 8 and then Max_Bit_Length <= Natural'Last - 7 and then Block'Length = (Max_Bit_Length + 7) / 8 and then Max_Bit_Length >= Pad101_Min_Bits and then Num_Used_Bits <= (Max_Bit_Length - Pad101_Min_Bits)); -- pad10*1 padding rule -- -- This procedure is used in cases where there is always enough space for -- the padding bits (at least 2 bits free in the block). -- -- Before calling this function there must be at least 2 bits free in the -- block. I.e. Num_Used_Bits <= (Max_Bit_Length - 2). -- -- @param Block The byte array which is to be padded. -- -- @param Num_Used_Bits The number of bits which are currently in-use in the -- block. The padding bits are appended after these in-use bits. -- -- @param Max_Bit_Length The maximum bit-size of the block. Padding bits -- are applied up to the end of this length. generic State_Size_Bits : Positive; type State_Type is private; with procedure XOR_Byte_Into_State (State : in out State_Type; Offset : in Natural; Value : in Keccak.Types.Byte); procedure XOR_Pad101_Into_State (State : in out State_Type; First_Bit : in Natural; Last_Bit : in Natural) with Global => null, Depends => (State =>+ (First_Bit, Last_Bit)), Pre => (Last_Bit < State_Size_Bits and First_Bit < Last_Bit); -------------- -- Pad10 --* -------------- -- The Pad10* rule only appends a 1 bit followed by at least one 0 bit. Pad10_Min_Bits : constant := 2; -- The pad10*1 rule appends at least 2 bits procedure Pad10_Multi_Blocks_Big_Endian (First_Block : in out Keccak.Types.Byte_Array; Num_Used_Bits : in Natural; Max_Bit_Length : in Natural; Next_Block : out Keccak.Types.Byte_Array; Spilled : out Boolean) with Global => null, Pre => (Next_Block'Length = First_Block'Length and then First_Block'Length <= Natural'Last / 8 and then Max_Bit_Length <= Natural'Last - 7 and then First_Block'Length = (Max_Bit_Length + 7) / 8 and then Num_Used_Bits < Max_Bit_Length), Post => Spilled = ((Num_Used_Bits + Pad10_Min_Bits) > Max_Bit_Length); -- pad10* padding rule -- -- This procedure is used in cases where there might not be enough free space -- in a block for all the padding bits, in which case the padding spills -- over into a second block. -- -- This is a big endian version intended for use in Ascon-Hash. This means -- that the padding bit added starts from the MSB (16#80#) instead of the -- LSB (16#01#). In the case where Num_Used_Bits is not a multiple of 8, -- the partial byte of the block is shifted towards the MSB. -- -- For example, if the last byte of the input data is 2#0000_0011# then -- it is shifted to align to the MSB and becomes 2#1100_0000#. Next, the -- padding bit is added: 2#1110_0000#. -- -- @param First_Block The block which is to be padded. At least 1 padding bit -- is applied to this block. -- -- @param Num_Used_Bits The number of bits which are in-use in First_Block. -- The padding bits will be applied immediately after this length. -- -- @param Max_Bit_Length The maximum number of bits that can be stored in -- First_Block and Next_Block. Padding will only be appended up to this -- length. -- -- @param Next_Block If there is less than 2 bits of unused bits in -- First_Block then the padding continues into this block. If there -- are at least 2 unused bits in First_Block then Next_Block is not used -- and is filled with zeroes. -- -- @param Spilled Set to True if there was not enough unused bits in -- First_Block to store all of the padding bits. When Spilled is True then -- both First_Block and Next_Block contain the padded data. -- Otherwise, Spilled is set to False if there is enough free space in -- First_Block for all of the padding bits. When Spilled is False then -- Next_Block is not used. end Keccak.Padding;
with Ada.Text_IO; procedure Caesar is type M26 is mod 26; function To_M26(C: Character; Offset: Character) return M26 is begin return M26(Character'Pos(C)-Character'Pos(Offset)); end To_M26; function To_Character(Value: in M26; Offset: Character) return Character is begin return Character'Val(Integer(Value)+Character'Pos(Offset)); end To_Character; function Encrypt (Plain: String; Key: M26) return String is Ciph: String(Plain'Range); begin for I in Plain'Range loop case Plain(I) is when 'A' .. 'Z' => Ciph(I) := To_Character(To_M26(Plain(I), 'A')+Key, 'A'); when 'a' .. 'z' => Ciph(I) := To_Character(To_M26(Plain(I), 'a')+Key, 'a'); when others => Ciph(I) := Plain(I); end case; end loop; return Ciph; end Encrypt; Text: String := Ada.Text_IO.Get_Line; Key: M26 := 3; -- Default key from "Commentarii de Bello Gallico" begin -- Caesar main program Ada.Text_IO.Put_Line("Plaintext ------------>" & Text); Text := Encrypt(Text, Key); Ada.Text_IO.Put_Line("Ciphertext ----------->" & Text); Ada.Text_IO.Put_Line("Decrypted Ciphertext ->" & Encrypt(Text, -Key)); end Caesar;
-- Ada_GUI implementation based on Gnoga. Adapted 2021 -- -- -- GNOGA - The GNU Omnificent GUI for Ada -- -- -- -- G N O G A . G U I . L O C A T I O N -- -- -- -- S p e c -- -- -- -- -- -- Copyright (C) 2014 David Botton -- -- -- -- This library is free software; you can redistribute it and/or modify -- -- it under terms of the GNU General Public License as published by the -- -- Free Software Foundation; either version 3, or (at your option) any -- -- later version. This library is distributed in the hope that it will be -- -- useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are -- -- granted additional permissions described in the GCC Runtime Library -- -- Exception, version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- For more information please go to http://www.gnoga.com -- ------------------------------------------------------------------------------ package Ada_GUI.Gnoga.Gui.Location is ------------------------------------------------------------------------- -- Location_Type ------------------------------------------------------------------------- -- Location_Type is the class encapsulating the DOM Location node -- To use, access via Window_Type.Location type Location_Type is new Gnoga.Gui.Base_Type with private; type Location_Access is access all Location_Type; type Pointer_To_Location_Class is access all Location_Type'Class; ------------------------------------------------------------------------- -- Location_Type - Properties ------------------------------------------------------------------------- procedure URL (Location : in out Location_Type; Value : in String); function URL (Location : Location_Type) return String; -- Setting URL will navigate the browser from the current location and -- close the current Gnoga Connection. procedure Hash (Location : in out Location_Type; Value : in String); function Hash (Location : Location_Type) return String; procedure Host (Location : in out Location_Type; Value : in String); function Host (Location : Location_Type) return String; procedure Host_Name (Location : in out Location_Type; Value : in String); function Host_Name (Location : Location_Type) return String; function Origin (Location : Location_Type) return String; procedure Path_Name (Location : in out Location_Type; Value : in String); function Path_Name (Location : Location_Type) return String; procedure Port (Location : in out Location_Type; Value : in String); function Port (Location : Location_Type) return String; procedure Protocol (Location : in out Location_Type; Value : in String); function Protocol (Location : Location_Type) return String; procedure Search (Location : in out Location_Type; Value : in String); function Search (Location : Location_Type) return String; function Parse (URL : in String; Encoding : String := "") return Gnoga.Data_Map_Type; -- Parse form GET parameters in URL (typically from Search function) -- to Data_Map_Type -- Supported encodings are ISO-8859-1 (default) -- and UTF-8 (typically from Input_Encoding function) ------------------------------------------------------------------------- -- Location_Type - Methods ------------------------------------------------------------------------- procedure Reload (Location : in out Location_Type); -- Reload the current page procedure Replace (Location : in out Location_Type; URL : in String); -- Replace the current page with URL (the current page will be removed -- from the browser history) procedure Assign (Location : in out Location_Type; URL : in String); -- Assign URL to the current page, the current page will be available -- using the back button. private type Location_Type is new Gnoga.Gui.Base_Type with null record; end Ada_GUI.Gnoga.Gui.Location;
----------------------------------------------------------------------- -- gen-model-projects -- Projects meta data -- Copyright (C) 2011, 2012, 2013, 2014, 2017, 2018, 2021 Stephane Carrez -- Written by Stephane Carrez (Stephane.Carrez@gmail.com) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Ada.Containers.Vectors; with Util.Properties; with Gen.Utils; with Gen.Utils.GNAT; package Gen.Model.Projects is type Project_Definition is tagged; type Project_Definition_Access is access all Project_Definition'Class; type Dependency_Type is (NONE, DIRECT, INDIRECT, BOTH); type Project_Reference is record Project : Project_Definition_Access := null; Name : UString; Kind : Dependency_Type := NONE; end record; package Project_Vectors is new Ada.Containers.Vectors (Element_Type => Project_Reference, Index_Type => Natural); -- ------------------------------ -- Project Definition -- ------------------------------ type Project_Definition is new Definition with record Path : UString; Props : Util.Properties.Manager; Modules : Project_Vectors.Vector; -- The root project definition. Root : Project_Definition_Access := null; -- The list of plugin names that this plugin or project depends on. Dependencies : Project_Vectors.Vector; -- The list of GNAT project files used by the project. Project_Files : Gen.Utils.GNAT.Project_Info_Vectors.Vector; -- The list of 'dynamo.xml' files used by the project (gathered from GNAT files -- and by scanning the 'plugins' directory). Dynamo_Files : Gen.Utils.String_List.Vector; -- Whether we did a recursive scan of GNAT project files. Recursive_Scan : Boolean := False; -- Whether we are doing a recursive operation on the project (prevent from cycles). Recursing : Boolean := False; -- Whether we did a recursive scan of Dynamo dependencies. Depend_Scan : Boolean := False; -- Whether this project is a plugin. Is_Plugin : Boolean := False; -- Whether the project needs the generation for the different databases Use_Mysql : Boolean := True; Use_Sqlite : Boolean := True; Use_Postgresql : Boolean := True; end record; -- Get the value identified by the name. -- If the name cannot be found, the method should return the Null object. overriding function Get_Value (From : Project_Definition; Name : String) return UBO.Object; -- Get the project name. function Get_Project_Name (Project : in Project_Definition) return String; -- Get the GNAT project file name. The default is to use the Dynamo project -- name and add the <b>.gpr</b> extension. The <b>gnat_project</b> configuration -- property allows to override this default. function Get_GNAT_Project_Name (Project : in Project_Definition) return String; -- Get the directory path which holds application modules. -- This is controlled by the <b>modules_dir</b> configuration property. -- The default is <tt>plugins</tt>. function Get_Module_Dir (Project : in Project_Definition) return String; -- Get the directory path which holds database model files. -- This is controlled by the <b>db_dir</b> configuration property. -- The default is <tt>db</tt>. function Get_Database_Dir (Project : in Project_Definition) return String; -- Get the directory path which is the base dir for the 'web, 'config' and 'bundles'. -- This is controlled by the <b>base_dir</b> configuration property. -- The default is <tt>.</tt>. function Get_Base_Dir (Project : in Project_Definition) return String; -- Find the dependency for the <b>Name</b> plugin. -- Returns a null dependency if the project does not depend on that plugin. function Find_Dependency (From : in Project_Definition; Name : in String) return Project_Reference; -- Add a dependency to the plugin identified by <b>Name</b>. procedure Add_Dependency (Into : in out Project_Definition; Name : in String; Kind : in Dependency_Type); -- Add a dependency to the plugin identified by <b>Project</b>. procedure Add_Dependency (Into : in out Project_Definition; Project : in Project_Definition_Access; Kind : in Dependency_Type); -- Create a project definition instance to record a project with the dynamo XML file path. procedure Create_Project (Into : in out Project_Definition; Name : in String; Path : in String; Project : out Project_Definition_Access); -- Add the project in the global project list on the root project instance. procedure Add_Project (Into : in out Project_Definition; Project : in Project_Definition_Access); -- Add the project <b>Name</b> as a module. procedure Add_Module (Into : in out Project_Definition; Name : in String); -- Add the project represented by <b>Project</b> if it is not already part of the modules. procedure Add_Module (Into : in out Project_Definition; Project : in Project_Definition_Access); -- Find the project definition associated with the dynamo XML file <b>Path</b>. -- Returns null if there is no such project function Find_Project (From : in Project_Definition; Path : in String) return Project_Definition_Access; -- Find the project definition having the name <b>Name</b>. -- Returns null if there is no such project function Find_Project_By_Name (From : in Project_Definition; Name : in String) return Project_Definition_Access; -- Save the project description and parameters. procedure Save (Project : in out Project_Definition; Path : in String); -- Read the XML project description into the project description. procedure Read_Project (Project : in out Project_Definition); -- Scan and read the possible modules used by the application. Modules are stored in the -- <b>modules</b> directory. Each module is stored in its own directory and has its own -- <b>dynamo.xml</b> file. procedure Read_Modules (Project : in out Project_Definition); -- Update the project definition from the properties. procedure Update_From_Properties (Project : in out Project_Definition); -- ------------------------------ -- Root Project Definition -- ------------------------------ -- The root project is the project that is actually read by Dynamo. -- It contains the lists of all projects that are necessary and which are found either -- by scanning GNAT projects or by looking at plugin dependencies. type Root_Project_Definition is new Project_Definition with record Projects : Project_Vectors.Vector; Install_Dir : UString; end record; -- Add the project in the global project list on the root project instance. overriding procedure Add_Project (Into : in out Root_Project_Definition; Project : in Project_Definition_Access); -- Find the project definition having the name <b>Name</b>. -- Returns null if there is no such project overriding function Find_Project_By_Name (From : in Root_Project_Definition; Name : in String) return Project_Definition_Access; -- Find the project definition associated with the dynamo XML file <b>Path</b>. -- Returns null if there is no such project overriding function Find_Project (From : in Root_Project_Definition; Path : in String) return Project_Definition_Access; -- Read the XML project file. When <b>Recursive</b> is set, read the GNAT project -- files used by the main project and load all the <b>dynamo.xml</b> files defined -- by these project. procedure Read_Project (Project : in out Root_Project_Definition; File : in String; Config : in Util.Properties.Manager'Class; Recursive : in Boolean := False); private -- Update the project references after a project is found and initialized. procedure Update_References (Root : in out Root_Project_Definition; Project : in Project_Definition_Access); -- Iterate over the project referenced in the list and execute the <b>Process</b> procedure. procedure Iterate (List : in out Project_Vectors.Vector; Process : access procedure (Item : in out Project_Reference)); -- Find a project from the list function Find_Project (List : in Project_Vectors.Vector; Name : in String) return Project_Reference; end Gen.Model.Projects;
-- { dg-do compile } package body Array19 is function N return Integer is begin return 1; end; type Array_Type is array (1 .. N) of Float; type Enum is (One, Two); type Rec (D : Enum := Enum'First) is record case D is when One => null; when Two => A : Array_Type; end case; end record; procedure Proc is R : Rec; function F return Array_Type is begin return (others => 0.0); end F; begin R.A := F; end; end Array19;
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- G E T _ T A R G -- -- -- -- S p e c -- -- -- -- Copyright (C) 1992-2005 Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- -- Boston, MA 02110-1301, USA. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This package provides an Import to the C functions which provide -- values related to types on the target system. It is only needed for -- exp_dbug and the elaboration of ttypes. -- NOTE: Any changes in this package must be reflected in jgettarg.ads -- and aa_getta.ads! -- Note that all these values return sizes of C types with corresponding -- names. This allows GNAT to define the corresponding Ada types to have -- the same representation. There is one exception to this: the -- Wide_Character_Type uses twice the size of a C char, instead of the -- size of wchar_t. with Types; use Types; package Get_Targ is pragma Preelaborate; function Get_Bits_Per_Unit return Pos; pragma Import (C, Get_Bits_Per_Unit, "get_target_bits_per_unit"); function Get_Bits_Per_Word return Pos; pragma Import (C, Get_Bits_Per_Word, "get_target_bits_per_word"); function Get_Char_Size return Pos; -- Standard.Character'Size pragma Import (C, Get_Char_Size, "get_target_char_size"); function Get_Wchar_T_Size return Pos; -- Interfaces.C.wchar_t'Size pragma Import (C, Get_Wchar_T_Size, "get_target_wchar_t_size"); function Get_Short_Size return Pos; -- Standard.Short_Integer'Size pragma Import (C, Get_Short_Size, "get_target_short_size"); function Get_Int_Size return Pos; -- Standard.Integer'Size pragma Import (C, Get_Int_Size, "get_target_int_size"); function Get_Long_Size return Pos; -- Standard.Long_Integer'Size pragma Import (C, Get_Long_Size, "get_target_long_size"); function Get_Long_Long_Size return Pos; -- Standard.Long_Long_Integer'Size pragma Import (C, Get_Long_Long_Size, "get_target_long_long_size"); function Get_Float_Size return Pos; -- Standard.Float'Size pragma Import (C, Get_Float_Size, "get_target_float_size"); function Get_Double_Size return Pos; -- Standard.Long_Float'Size pragma Import (C, Get_Double_Size, "get_target_double_size"); function Get_Long_Double_Size return Pos; -- Standard.Long_Long_Float'Size pragma Import (C, Get_Long_Double_Size, "get_target_long_double_size"); function Get_Pointer_Size return Pos; -- System.Address'Size pragma Import (C, Get_Pointer_Size, "get_target_pointer_size"); function Get_Maximum_Alignment return Pos; pragma Import (C, Get_Maximum_Alignment, "get_target_maximum_alignment"); function Get_Float_Words_BE return Nat; pragma Import (C, Get_Float_Words_BE, "get_float_words_be"); function Get_Words_BE return Nat; pragma Import (C, Get_Words_BE, "get_words_be"); function Get_Bytes_BE return Nat; pragma Import (C, Get_Bytes_BE, "get_bytes_be"); function Get_Bits_BE return Nat; pragma Import (C, Get_Bits_BE, "get_bits_be"); function Get_Strict_Alignment return Nat; pragma Import (C, Get_Strict_Alignment, "get_strict_alignment"); function Get_Max_Unaligned_Field return Pos; -- Returns the maximum supported size in bits for a field that is -- not aligned on a storage unit boundary. function Width_From_Size (Size : Pos) return Pos; function Digits_From_Size (Size : Pos) return Pos; -- Calculate values for 'Width or 'Digits from 'Size end Get_Targ;
pragma Ada_95; pragma Warnings (Off); with System; package testmain is procedure testinit; pragma Export (C, testinit, "testinit"); pragma Linker_Constructor (testinit); procedure testfinal; pragma Export (C, testfinal, "testfinal"); pragma Linker_Destructor (testfinal); type Version_32 is mod 2 ** 32; u00001 : constant Version_32 := 16#cc79430b#; pragma Export (C, u00001, "my_libB"); u00002 : constant Version_32 := 16#c2ed1210#; pragma Export (C, u00002, "my_libS"); -- BEGIN ELABORATION ORDER -- ada%s -- ada.characters%s -- ada.characters.handling%s -- ada.characters.latin_1%s -- interfaces%s -- system%s -- system.case_util%s -- system.case_util%b -- system.htable%s -- system.img_int%s -- system.img_int%b -- system.io%s -- system.io%b -- system.parameters%s -- system.parameters%b -- system.crtl%s -- interfaces.c_streams%s -- interfaces.c_streams%b -- system.standard_library%s -- system.exceptions_debug%s -- system.exceptions_debug%b -- system.storage_elements%s -- system.storage_elements%b -- system.stack_checking%s -- system.stack_checking%b -- system.string_hash%s -- system.string_hash%b -- system.htable%b -- system.strings%s -- system.strings%b -- system.os_lib%s -- system.traceback_entries%s -- system.traceback_entries%b -- ada.exceptions%s -- system.soft_links%s -- system.unsigned_types%s -- system.img_uns%s -- system.img_uns%b -- system.val_lli%s -- system.val_llu%s -- system.val_uns%s -- system.val_util%s -- system.val_util%b -- system.val_uns%b -- system.val_llu%b -- system.val_lli%b -- system.wch_con%s -- system.wch_con%b -- system.wch_cnv%s -- system.wch_jis%s -- system.wch_jis%b -- system.wch_cnv%b -- system.wch_stw%s -- system.wch_stw%b -- ada.exceptions.last_chance_handler%s -- ada.exceptions.last_chance_handler%b -- ada.exceptions.traceback%s -- system.address_image%s -- system.bit_ops%s -- system.bit_ops%b -- system.exception_table%s -- system.exception_table%b -- ada.io_exceptions%s -- ada.strings%s -- ada.strings.maps%s -- ada.strings.maps.constants%s -- ada.tags%s -- ada.streams%s -- ada.streams%b -- interfaces.c%s -- system.exceptions%s -- system.exceptions%b -- system.exceptions.machine%s -- system.file_control_block%s -- system.file_io%s -- system.finalization_root%s -- system.finalization_root%b -- ada.finalization%s -- system.win32%s -- system.exception_traces%s -- system.exception_traces%b -- system.memory%s -- system.memory%b -- system.standard_library%b -- system.object_reader%s -- system.dwarf_lines%s -- system.secondary_stack%s -- system.file_io%b -- interfaces.c%b -- ada.tags%b -- ada.strings.maps%b -- system.soft_links%b -- system.os_lib%b -- ada.characters.handling%b -- system.secondary_stack%b -- system.dwarf_lines%b -- system.object_reader%b -- system.address_image%b -- ada.exceptions.traceback%b -- system.traceback%s -- system.traceback%b -- system.traceback.symbolic%s -- system.traceback.symbolic%b -- ada.exceptions%b -- ada.text_io%s -- ada.text_io%b -- my_lib%s -- my_lib%b -- END ELABORATION ORDER end testmain;
-- sarge_test.adb - Implementation file for the Sarge command line argument parser test. -- Revision 0 -- Features: -- - -- Notes: -- - -- 2019/04/10, Maya Posch with Sarge; with Ada.Text_IO; use Ada.Text_IO; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; procedure Sarge_Test is function "+"(S : in String) return Unbounded_String renames Ada.Strings.Unbounded.To_Unbounded_String; begin -- Create Sarge instance, set stuff, parse stuff. Sarge.setArgument(+"h", +"help", +"Get help.", False); Sarge.setArgument(+"k", +"kittens", +"K is for kittens. Everyone needs kittens in their life.", True); Sarge.setArgument(+"n", +"number", +"Gimme a number. Any number.", True); Sarge.setArgument(+"a", +"apple", +"Just an apple.", False); Sarge.setArgument(+"b", +"bear", +"Look, it's a bear.", False); Sarge.setDescription(+"Sarge command line argument parsing testing app. For demonstration purposes and testing."); Sarge.setUsage(+"sarge_test <options>"); if Sarge.parseArguments /= True then put_line("Couldn't parse arguments..."); return; end if; put_line("Number of flags found: " & Sarge.flagCount'Image); if Sarge.exists(+"help") /= False then Sarge.printHelp; else put_line("No help requested..."); end if; -- end Sarge_Test;
with VisitablePackage, EnvironmentPackage, VisitFailurePackage; use VisitablePackage, EnvironmentPackage, VisitFailurePackage; package body OneIdStrategy is ---------------------------------------------------------------------------- -- Object implementation ---------------------------------------------------------------------------- overriding function toString(o: OneId) return String is begin return "OneId()"; end; ---------------------------------------------------------------------------- -- Strategy implementation ---------------------------------------------------------------------------- overriding function visitLight(str:access OneId; any: ObjectPtr; intro: access Introspector'Class) return ObjectPtr is childCount : Integer := getChildCount(intro, any); newSubterm : ObjectPtr := null; begin for i in 0..childCount-1 loop newSubterm := visitLight(StrategyPtr(str.arguments(ARG)), getChildAt(intro, any, i), intro); if newSubterm /= getChildAt(intro, any, i) then return setChildAt(intro, any, i, newSubterm); end if; end loop; return any; end; overriding function visit(str: access OneId; intro: access Introspector'Class) return Integer is childCount : Integer := getChildCount(intro, getSubject(str.env.all)); oldSubject : ObjectPtr := null; newSubject : ObjectPtr := null; status : Integer; begin for i in 0..childCount-1 loop down(str.env.all, i+1); oldSubject := getSubject(str.env.all); status := visit(StrategyPtr(str.arguments(ARG)), intro); newSubject := getSubject(str.env.all); if status = EnvironmentPackage.SUCCESS and then oldSubject /= newSubject then up(str.env.all); return status; else upLocal(str.env.all); end if; end loop; return EnvironmentPackage.SUCCESS; end; ---------------------------------------------------------------------------- procedure makeOneId(o : in out OneId; v: StrategyPtr) is begin initSubterm(o,v); end; function newOneId(v: StrategyPtr) return StrategyPtr is id : StrategyPtr := new OneId; begin makeOneId(OneId(id.all), v); return id; end; ---------------------------------------------------------------------------- end OneIdStrategy;
-- Copyright (c) 2020 Raspberry Pi (Trading) Ltd. -- -- SPDX-License-Identifier: BSD-3-Clause -- This spec has been automatically generated from rp2040.svd pragma Restrictions (No_Elaboration_Code); pragma Ada_2012; pragma Style_Checks (Off); with HAL; with System; package RP_SVD.IO_BANK0 is pragma Preelaborate; --------------- -- Registers -- --------------- -- GPIO status type GPIO0_STATUS_Register is record -- unspecified Reserved_0_7 : HAL.UInt8; -- Read-only. output signal from selected peripheral, before register -- override is applied OUTFROMPERI : Boolean; -- Read-only. output signal to pad after register override is applied OUTTOPAD : Boolean; -- unspecified Reserved_10_11 : HAL.UInt2; -- Read-only. output enable from selected peripheral, before register -- override is applied OEFROMPERI : Boolean; -- Read-only. output enable to pad after register override is applied OETOPAD : Boolean; -- unspecified Reserved_14_16 : HAL.UInt3; -- Read-only. input signal from pad, before override is applied INFROMPAD : Boolean; -- unspecified Reserved_18_18 : HAL.Bit; -- Read-only. input signal to peripheral, after override is applied INTOPERI : Boolean; -- unspecified Reserved_20_23 : HAL.UInt4; -- Read-only. interrupt from pad before override is applied IRQFROMPAD : Boolean; -- unspecified Reserved_25_25 : HAL.Bit; -- Read-only. interrupt to processors, after override is applied IRQTOPROC : Boolean; -- unspecified Reserved_27_31 : HAL.UInt5; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO0_STATUS_Register use record Reserved_0_7 at 0 range 0 .. 7; OUTFROMPERI at 0 range 8 .. 8; OUTTOPAD at 0 range 9 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEFROMPERI at 0 range 12 .. 12; OETOPAD at 0 range 13 .. 13; Reserved_14_16 at 0 range 14 .. 16; INFROMPAD at 0 range 17 .. 17; Reserved_18_18 at 0 range 18 .. 18; INTOPERI at 0 range 19 .. 19; Reserved_20_23 at 0 range 20 .. 23; IRQFROMPAD at 0 range 24 .. 24; Reserved_25_25 at 0 range 25 .. 25; IRQTOPROC at 0 range 26 .. 26; Reserved_27_31 at 0 range 27 .. 31; end record; -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL type GPIO0_CTRL_FUNCSEL_Field is (JTAG_TCK, SPI0_RX, UART0_TX, I2C0_SDA, PWM_A_0, SIO_0, PIO0_0, PIO1_0, USB_MUXING_OVERCURR_DETECT, NULL_k) with Size => 5; for GPIO0_CTRL_FUNCSEL_Field use (JTAG_TCK => 0, SPI0_RX => 1, UART0_TX => 2, I2C0_SDA => 3, PWM_A_0 => 4, SIO_0 => 5, PIO0_0 => 6, PIO1_0 => 7, USB_MUXING_OVERCURR_DETECT => 9, NULL_k => 31); type GPIO0_CTRL_OUTOVER_Field is (-- drive output from peripheral signal selected by funcsel Normal, -- drive output from inverse of peripheral signal selected by funcsel Invert, -- drive output low Low, -- drive output high High) with Size => 2; for GPIO0_CTRL_OUTOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO0_CTRL_OEOVER_Field is (-- drive output enable from peripheral signal selected by funcsel Normal, -- drive output enable from inverse of peripheral signal selected by funcsel Invert, -- disable output Disable, -- enable output Enable) with Size => 2; for GPIO0_CTRL_OEOVER_Field use (Normal => 0, Invert => 1, Disable => 2, Enable => 3); type GPIO0_CTRL_INOVER_Field is (-- don't invert the peri input Normal, -- invert the peri input Invert, -- drive peri input low Low, -- drive peri input high High) with Size => 2; for GPIO0_CTRL_INOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO0_CTRL_IRQOVER_Field is (-- don't invert the interrupt Normal, -- invert the interrupt Invert, -- drive interrupt low Low, -- drive interrupt high High) with Size => 2; for GPIO0_CTRL_IRQOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); -- GPIO control including function select and overrides. type GPIO0_CTRL_Register is record -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL FUNCSEL : GPIO0_CTRL_FUNCSEL_Field := RP_SVD.IO_BANK0.NULL_k; -- unspecified Reserved_5_7 : HAL.UInt3 := 16#0#; OUTOVER : GPIO0_CTRL_OUTOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_10_11 : HAL.UInt2 := 16#0#; OEOVER : GPIO0_CTRL_OEOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_14_15 : HAL.UInt2 := 16#0#; INOVER : GPIO0_CTRL_INOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; IRQOVER : GPIO0_CTRL_IRQOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_30_31 : HAL.UInt2 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO0_CTRL_Register use record FUNCSEL at 0 range 0 .. 4; Reserved_5_7 at 0 range 5 .. 7; OUTOVER at 0 range 8 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEOVER at 0 range 12 .. 13; Reserved_14_15 at 0 range 14 .. 15; INOVER at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; IRQOVER at 0 range 28 .. 29; Reserved_30_31 at 0 range 30 .. 31; end record; -- GPIO status type GPIO1_STATUS_Register is record -- unspecified Reserved_0_7 : HAL.UInt8; -- Read-only. output signal from selected peripheral, before register -- override is applied OUTFROMPERI : Boolean; -- Read-only. output signal to pad after register override is applied OUTTOPAD : Boolean; -- unspecified Reserved_10_11 : HAL.UInt2; -- Read-only. output enable from selected peripheral, before register -- override is applied OEFROMPERI : Boolean; -- Read-only. output enable to pad after register override is applied OETOPAD : Boolean; -- unspecified Reserved_14_16 : HAL.UInt3; -- Read-only. input signal from pad, before override is applied INFROMPAD : Boolean; -- unspecified Reserved_18_18 : HAL.Bit; -- Read-only. input signal to peripheral, after override is applied INTOPERI : Boolean; -- unspecified Reserved_20_23 : HAL.UInt4; -- Read-only. interrupt from pad before override is applied IRQFROMPAD : Boolean; -- unspecified Reserved_25_25 : HAL.Bit; -- Read-only. interrupt to processors, after override is applied IRQTOPROC : Boolean; -- unspecified Reserved_27_31 : HAL.UInt5; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO1_STATUS_Register use record Reserved_0_7 at 0 range 0 .. 7; OUTFROMPERI at 0 range 8 .. 8; OUTTOPAD at 0 range 9 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEFROMPERI at 0 range 12 .. 12; OETOPAD at 0 range 13 .. 13; Reserved_14_16 at 0 range 14 .. 16; INFROMPAD at 0 range 17 .. 17; Reserved_18_18 at 0 range 18 .. 18; INTOPERI at 0 range 19 .. 19; Reserved_20_23 at 0 range 20 .. 23; IRQFROMPAD at 0 range 24 .. 24; Reserved_25_25 at 0 range 25 .. 25; IRQTOPROC at 0 range 26 .. 26; Reserved_27_31 at 0 range 27 .. 31; end record; -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL type GPIO1_CTRL_FUNCSEL_Field is (JTAG_TMS, SPI0_SS_N, UART0_RX, I2C0_SCL, PWM_B_0, SIO_1, PIO0_1, PIO1_1, USB_MUXING_VBUS_DETECT, NULL_k) with Size => 5; for GPIO1_CTRL_FUNCSEL_Field use (JTAG_TMS => 0, SPI0_SS_N => 1, UART0_RX => 2, I2C0_SCL => 3, PWM_B_0 => 4, SIO_1 => 5, PIO0_1 => 6, PIO1_1 => 7, USB_MUXING_VBUS_DETECT => 9, NULL_k => 31); type GPIO1_CTRL_OUTOVER_Field is (-- drive output from peripheral signal selected by funcsel Normal, -- drive output from inverse of peripheral signal selected by funcsel Invert, -- drive output low Low, -- drive output high High) with Size => 2; for GPIO1_CTRL_OUTOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO1_CTRL_OEOVER_Field is (-- drive output enable from peripheral signal selected by funcsel Normal, -- drive output enable from inverse of peripheral signal selected by funcsel Invert, -- disable output Disable, -- enable output Enable) with Size => 2; for GPIO1_CTRL_OEOVER_Field use (Normal => 0, Invert => 1, Disable => 2, Enable => 3); type GPIO1_CTRL_INOVER_Field is (-- don't invert the peri input Normal, -- invert the peri input Invert, -- drive peri input low Low, -- drive peri input high High) with Size => 2; for GPIO1_CTRL_INOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO1_CTRL_IRQOVER_Field is (-- don't invert the interrupt Normal, -- invert the interrupt Invert, -- drive interrupt low Low, -- drive interrupt high High) with Size => 2; for GPIO1_CTRL_IRQOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); -- GPIO control including function select and overrides. type GPIO1_CTRL_Register is record -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL FUNCSEL : GPIO1_CTRL_FUNCSEL_Field := RP_SVD.IO_BANK0.NULL_k; -- unspecified Reserved_5_7 : HAL.UInt3 := 16#0#; OUTOVER : GPIO1_CTRL_OUTOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_10_11 : HAL.UInt2 := 16#0#; OEOVER : GPIO1_CTRL_OEOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_14_15 : HAL.UInt2 := 16#0#; INOVER : GPIO1_CTRL_INOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; IRQOVER : GPIO1_CTRL_IRQOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_30_31 : HAL.UInt2 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO1_CTRL_Register use record FUNCSEL at 0 range 0 .. 4; Reserved_5_7 at 0 range 5 .. 7; OUTOVER at 0 range 8 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEOVER at 0 range 12 .. 13; Reserved_14_15 at 0 range 14 .. 15; INOVER at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; IRQOVER at 0 range 28 .. 29; Reserved_30_31 at 0 range 30 .. 31; end record; -- GPIO status type GPIO2_STATUS_Register is record -- unspecified Reserved_0_7 : HAL.UInt8; -- Read-only. output signal from selected peripheral, before register -- override is applied OUTFROMPERI : Boolean; -- Read-only. output signal to pad after register override is applied OUTTOPAD : Boolean; -- unspecified Reserved_10_11 : HAL.UInt2; -- Read-only. output enable from selected peripheral, before register -- override is applied OEFROMPERI : Boolean; -- Read-only. output enable to pad after register override is applied OETOPAD : Boolean; -- unspecified Reserved_14_16 : HAL.UInt3; -- Read-only. input signal from pad, before override is applied INFROMPAD : Boolean; -- unspecified Reserved_18_18 : HAL.Bit; -- Read-only. input signal to peripheral, after override is applied INTOPERI : Boolean; -- unspecified Reserved_20_23 : HAL.UInt4; -- Read-only. interrupt from pad before override is applied IRQFROMPAD : Boolean; -- unspecified Reserved_25_25 : HAL.Bit; -- Read-only. interrupt to processors, after override is applied IRQTOPROC : Boolean; -- unspecified Reserved_27_31 : HAL.UInt5; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO2_STATUS_Register use record Reserved_0_7 at 0 range 0 .. 7; OUTFROMPERI at 0 range 8 .. 8; OUTTOPAD at 0 range 9 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEFROMPERI at 0 range 12 .. 12; OETOPAD at 0 range 13 .. 13; Reserved_14_16 at 0 range 14 .. 16; INFROMPAD at 0 range 17 .. 17; Reserved_18_18 at 0 range 18 .. 18; INTOPERI at 0 range 19 .. 19; Reserved_20_23 at 0 range 20 .. 23; IRQFROMPAD at 0 range 24 .. 24; Reserved_25_25 at 0 range 25 .. 25; IRQTOPROC at 0 range 26 .. 26; Reserved_27_31 at 0 range 27 .. 31; end record; -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL type GPIO2_CTRL_FUNCSEL_Field is (JTAG_TDI, SPI0_SCLK, UART0_CTS, I2C1_SDA, PWM_A_1, SIO_2, PIO0_2, PIO1_2, USB_MUXING_VBUS_EN, NULL_k) with Size => 5; for GPIO2_CTRL_FUNCSEL_Field use (JTAG_TDI => 0, SPI0_SCLK => 1, UART0_CTS => 2, I2C1_SDA => 3, PWM_A_1 => 4, SIO_2 => 5, PIO0_2 => 6, PIO1_2 => 7, USB_MUXING_VBUS_EN => 9, NULL_k => 31); type GPIO2_CTRL_OUTOVER_Field is (-- drive output from peripheral signal selected by funcsel Normal, -- drive output from inverse of peripheral signal selected by funcsel Invert, -- drive output low Low, -- drive output high High) with Size => 2; for GPIO2_CTRL_OUTOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO2_CTRL_OEOVER_Field is (-- drive output enable from peripheral signal selected by funcsel Normal, -- drive output enable from inverse of peripheral signal selected by funcsel Invert, -- disable output Disable, -- enable output Enable) with Size => 2; for GPIO2_CTRL_OEOVER_Field use (Normal => 0, Invert => 1, Disable => 2, Enable => 3); type GPIO2_CTRL_INOVER_Field is (-- don't invert the peri input Normal, -- invert the peri input Invert, -- drive peri input low Low, -- drive peri input high High) with Size => 2; for GPIO2_CTRL_INOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO2_CTRL_IRQOVER_Field is (-- don't invert the interrupt Normal, -- invert the interrupt Invert, -- drive interrupt low Low, -- drive interrupt high High) with Size => 2; for GPIO2_CTRL_IRQOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); -- GPIO control including function select and overrides. type GPIO2_CTRL_Register is record -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL FUNCSEL : GPIO2_CTRL_FUNCSEL_Field := RP_SVD.IO_BANK0.NULL_k; -- unspecified Reserved_5_7 : HAL.UInt3 := 16#0#; OUTOVER : GPIO2_CTRL_OUTOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_10_11 : HAL.UInt2 := 16#0#; OEOVER : GPIO2_CTRL_OEOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_14_15 : HAL.UInt2 := 16#0#; INOVER : GPIO2_CTRL_INOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; IRQOVER : GPIO2_CTRL_IRQOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_30_31 : HAL.UInt2 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO2_CTRL_Register use record FUNCSEL at 0 range 0 .. 4; Reserved_5_7 at 0 range 5 .. 7; OUTOVER at 0 range 8 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEOVER at 0 range 12 .. 13; Reserved_14_15 at 0 range 14 .. 15; INOVER at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; IRQOVER at 0 range 28 .. 29; Reserved_30_31 at 0 range 30 .. 31; end record; -- GPIO status type GPIO3_STATUS_Register is record -- unspecified Reserved_0_7 : HAL.UInt8; -- Read-only. output signal from selected peripheral, before register -- override is applied OUTFROMPERI : Boolean; -- Read-only. output signal to pad after register override is applied OUTTOPAD : Boolean; -- unspecified Reserved_10_11 : HAL.UInt2; -- Read-only. output enable from selected peripheral, before register -- override is applied OEFROMPERI : Boolean; -- Read-only. output enable to pad after register override is applied OETOPAD : Boolean; -- unspecified Reserved_14_16 : HAL.UInt3; -- Read-only. input signal from pad, before override is applied INFROMPAD : Boolean; -- unspecified Reserved_18_18 : HAL.Bit; -- Read-only. input signal to peripheral, after override is applied INTOPERI : Boolean; -- unspecified Reserved_20_23 : HAL.UInt4; -- Read-only. interrupt from pad before override is applied IRQFROMPAD : Boolean; -- unspecified Reserved_25_25 : HAL.Bit; -- Read-only. interrupt to processors, after override is applied IRQTOPROC : Boolean; -- unspecified Reserved_27_31 : HAL.UInt5; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO3_STATUS_Register use record Reserved_0_7 at 0 range 0 .. 7; OUTFROMPERI at 0 range 8 .. 8; OUTTOPAD at 0 range 9 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEFROMPERI at 0 range 12 .. 12; OETOPAD at 0 range 13 .. 13; Reserved_14_16 at 0 range 14 .. 16; INFROMPAD at 0 range 17 .. 17; Reserved_18_18 at 0 range 18 .. 18; INTOPERI at 0 range 19 .. 19; Reserved_20_23 at 0 range 20 .. 23; IRQFROMPAD at 0 range 24 .. 24; Reserved_25_25 at 0 range 25 .. 25; IRQTOPROC at 0 range 26 .. 26; Reserved_27_31 at 0 range 27 .. 31; end record; -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL type GPIO3_CTRL_FUNCSEL_Field is (JTAG_TDO, SPI0_TX, UART0_RTS, I2C1_SCL, PWM_B_1, SIO_3, PIO0_3, PIO1_3, USB_MUXING_OVERCURR_DETECT, NULL_k) with Size => 5; for GPIO3_CTRL_FUNCSEL_Field use (JTAG_TDO => 0, SPI0_TX => 1, UART0_RTS => 2, I2C1_SCL => 3, PWM_B_1 => 4, SIO_3 => 5, PIO0_3 => 6, PIO1_3 => 7, USB_MUXING_OVERCURR_DETECT => 9, NULL_k => 31); type GPIO3_CTRL_OUTOVER_Field is (-- drive output from peripheral signal selected by funcsel Normal, -- drive output from inverse of peripheral signal selected by funcsel Invert, -- drive output low Low, -- drive output high High) with Size => 2; for GPIO3_CTRL_OUTOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO3_CTRL_OEOVER_Field is (-- drive output enable from peripheral signal selected by funcsel Normal, -- drive output enable from inverse of peripheral signal selected by funcsel Invert, -- disable output Disable, -- enable output Enable) with Size => 2; for GPIO3_CTRL_OEOVER_Field use (Normal => 0, Invert => 1, Disable => 2, Enable => 3); type GPIO3_CTRL_INOVER_Field is (-- don't invert the peri input Normal, -- invert the peri input Invert, -- drive peri input low Low, -- drive peri input high High) with Size => 2; for GPIO3_CTRL_INOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO3_CTRL_IRQOVER_Field is (-- don't invert the interrupt Normal, -- invert the interrupt Invert, -- drive interrupt low Low, -- drive interrupt high High) with Size => 2; for GPIO3_CTRL_IRQOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); -- GPIO control including function select and overrides. type GPIO3_CTRL_Register is record -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL FUNCSEL : GPIO3_CTRL_FUNCSEL_Field := RP_SVD.IO_BANK0.NULL_k; -- unspecified Reserved_5_7 : HAL.UInt3 := 16#0#; OUTOVER : GPIO3_CTRL_OUTOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_10_11 : HAL.UInt2 := 16#0#; OEOVER : GPIO3_CTRL_OEOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_14_15 : HAL.UInt2 := 16#0#; INOVER : GPIO3_CTRL_INOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; IRQOVER : GPIO3_CTRL_IRQOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_30_31 : HAL.UInt2 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO3_CTRL_Register use record FUNCSEL at 0 range 0 .. 4; Reserved_5_7 at 0 range 5 .. 7; OUTOVER at 0 range 8 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEOVER at 0 range 12 .. 13; Reserved_14_15 at 0 range 14 .. 15; INOVER at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; IRQOVER at 0 range 28 .. 29; Reserved_30_31 at 0 range 30 .. 31; end record; -- GPIO status type GPIO4_STATUS_Register is record -- unspecified Reserved_0_7 : HAL.UInt8; -- Read-only. output signal from selected peripheral, before register -- override is applied OUTFROMPERI : Boolean; -- Read-only. output signal to pad after register override is applied OUTTOPAD : Boolean; -- unspecified Reserved_10_11 : HAL.UInt2; -- Read-only. output enable from selected peripheral, before register -- override is applied OEFROMPERI : Boolean; -- Read-only. output enable to pad after register override is applied OETOPAD : Boolean; -- unspecified Reserved_14_16 : HAL.UInt3; -- Read-only. input signal from pad, before override is applied INFROMPAD : Boolean; -- unspecified Reserved_18_18 : HAL.Bit; -- Read-only. input signal to peripheral, after override is applied INTOPERI : Boolean; -- unspecified Reserved_20_23 : HAL.UInt4; -- Read-only. interrupt from pad before override is applied IRQFROMPAD : Boolean; -- unspecified Reserved_25_25 : HAL.Bit; -- Read-only. interrupt to processors, after override is applied IRQTOPROC : Boolean; -- unspecified Reserved_27_31 : HAL.UInt5; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO4_STATUS_Register use record Reserved_0_7 at 0 range 0 .. 7; OUTFROMPERI at 0 range 8 .. 8; OUTTOPAD at 0 range 9 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEFROMPERI at 0 range 12 .. 12; OETOPAD at 0 range 13 .. 13; Reserved_14_16 at 0 range 14 .. 16; INFROMPAD at 0 range 17 .. 17; Reserved_18_18 at 0 range 18 .. 18; INTOPERI at 0 range 19 .. 19; Reserved_20_23 at 0 range 20 .. 23; IRQFROMPAD at 0 range 24 .. 24; Reserved_25_25 at 0 range 25 .. 25; IRQTOPROC at 0 range 26 .. 26; Reserved_27_31 at 0 range 27 .. 31; end record; -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL type GPIO4_CTRL_FUNCSEL_Field is (SPI0_RX, UART1_TX, I2C0_SDA, PWM_A_2, SIO_4, PIO0_4, PIO1_4, USB_MUXING_VBUS_DETECT, NULL_k) with Size => 5; for GPIO4_CTRL_FUNCSEL_Field use (SPI0_RX => 1, UART1_TX => 2, I2C0_SDA => 3, PWM_A_2 => 4, SIO_4 => 5, PIO0_4 => 6, PIO1_4 => 7, USB_MUXING_VBUS_DETECT => 9, NULL_k => 31); type GPIO4_CTRL_OUTOVER_Field is (-- drive output from peripheral signal selected by funcsel Normal, -- drive output from inverse of peripheral signal selected by funcsel Invert, -- drive output low Low, -- drive output high High) with Size => 2; for GPIO4_CTRL_OUTOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO4_CTRL_OEOVER_Field is (-- drive output enable from peripheral signal selected by funcsel Normal, -- drive output enable from inverse of peripheral signal selected by funcsel Invert, -- disable output Disable, -- enable output Enable) with Size => 2; for GPIO4_CTRL_OEOVER_Field use (Normal => 0, Invert => 1, Disable => 2, Enable => 3); type GPIO4_CTRL_INOVER_Field is (-- don't invert the peri input Normal, -- invert the peri input Invert, -- drive peri input low Low, -- drive peri input high High) with Size => 2; for GPIO4_CTRL_INOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO4_CTRL_IRQOVER_Field is (-- don't invert the interrupt Normal, -- invert the interrupt Invert, -- drive interrupt low Low, -- drive interrupt high High) with Size => 2; for GPIO4_CTRL_IRQOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); -- GPIO control including function select and overrides. type GPIO4_CTRL_Register is record -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL FUNCSEL : GPIO4_CTRL_FUNCSEL_Field := RP_SVD.IO_BANK0.NULL_k; -- unspecified Reserved_5_7 : HAL.UInt3 := 16#0#; OUTOVER : GPIO4_CTRL_OUTOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_10_11 : HAL.UInt2 := 16#0#; OEOVER : GPIO4_CTRL_OEOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_14_15 : HAL.UInt2 := 16#0#; INOVER : GPIO4_CTRL_INOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; IRQOVER : GPIO4_CTRL_IRQOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_30_31 : HAL.UInt2 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO4_CTRL_Register use record FUNCSEL at 0 range 0 .. 4; Reserved_5_7 at 0 range 5 .. 7; OUTOVER at 0 range 8 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEOVER at 0 range 12 .. 13; Reserved_14_15 at 0 range 14 .. 15; INOVER at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; IRQOVER at 0 range 28 .. 29; Reserved_30_31 at 0 range 30 .. 31; end record; -- GPIO status type GPIO5_STATUS_Register is record -- unspecified Reserved_0_7 : HAL.UInt8; -- Read-only. output signal from selected peripheral, before register -- override is applied OUTFROMPERI : Boolean; -- Read-only. output signal to pad after register override is applied OUTTOPAD : Boolean; -- unspecified Reserved_10_11 : HAL.UInt2; -- Read-only. output enable from selected peripheral, before register -- override is applied OEFROMPERI : Boolean; -- Read-only. output enable to pad after register override is applied OETOPAD : Boolean; -- unspecified Reserved_14_16 : HAL.UInt3; -- Read-only. input signal from pad, before override is applied INFROMPAD : Boolean; -- unspecified Reserved_18_18 : HAL.Bit; -- Read-only. input signal to peripheral, after override is applied INTOPERI : Boolean; -- unspecified Reserved_20_23 : HAL.UInt4; -- Read-only. interrupt from pad before override is applied IRQFROMPAD : Boolean; -- unspecified Reserved_25_25 : HAL.Bit; -- Read-only. interrupt to processors, after override is applied IRQTOPROC : Boolean; -- unspecified Reserved_27_31 : HAL.UInt5; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO5_STATUS_Register use record Reserved_0_7 at 0 range 0 .. 7; OUTFROMPERI at 0 range 8 .. 8; OUTTOPAD at 0 range 9 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEFROMPERI at 0 range 12 .. 12; OETOPAD at 0 range 13 .. 13; Reserved_14_16 at 0 range 14 .. 16; INFROMPAD at 0 range 17 .. 17; Reserved_18_18 at 0 range 18 .. 18; INTOPERI at 0 range 19 .. 19; Reserved_20_23 at 0 range 20 .. 23; IRQFROMPAD at 0 range 24 .. 24; Reserved_25_25 at 0 range 25 .. 25; IRQTOPROC at 0 range 26 .. 26; Reserved_27_31 at 0 range 27 .. 31; end record; -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL type GPIO5_CTRL_FUNCSEL_Field is (SPI0_SS_N, UART1_RX, I2C0_SCL, PWM_B_2, SIO_5, PIO0_5, PIO1_5, USB_MUXING_VBUS_EN, NULL_k) with Size => 5; for GPIO5_CTRL_FUNCSEL_Field use (SPI0_SS_N => 1, UART1_RX => 2, I2C0_SCL => 3, PWM_B_2 => 4, SIO_5 => 5, PIO0_5 => 6, PIO1_5 => 7, USB_MUXING_VBUS_EN => 9, NULL_k => 31); type GPIO5_CTRL_OUTOVER_Field is (-- drive output from peripheral signal selected by funcsel Normal, -- drive output from inverse of peripheral signal selected by funcsel Invert, -- drive output low Low, -- drive output high High) with Size => 2; for GPIO5_CTRL_OUTOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO5_CTRL_OEOVER_Field is (-- drive output enable from peripheral signal selected by funcsel Normal, -- drive output enable from inverse of peripheral signal selected by funcsel Invert, -- disable output Disable, -- enable output Enable) with Size => 2; for GPIO5_CTRL_OEOVER_Field use (Normal => 0, Invert => 1, Disable => 2, Enable => 3); type GPIO5_CTRL_INOVER_Field is (-- don't invert the peri input Normal, -- invert the peri input Invert, -- drive peri input low Low, -- drive peri input high High) with Size => 2; for GPIO5_CTRL_INOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO5_CTRL_IRQOVER_Field is (-- don't invert the interrupt Normal, -- invert the interrupt Invert, -- drive interrupt low Low, -- drive interrupt high High) with Size => 2; for GPIO5_CTRL_IRQOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); -- GPIO control including function select and overrides. type GPIO5_CTRL_Register is record -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL FUNCSEL : GPIO5_CTRL_FUNCSEL_Field := RP_SVD.IO_BANK0.NULL_k; -- unspecified Reserved_5_7 : HAL.UInt3 := 16#0#; OUTOVER : GPIO5_CTRL_OUTOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_10_11 : HAL.UInt2 := 16#0#; OEOVER : GPIO5_CTRL_OEOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_14_15 : HAL.UInt2 := 16#0#; INOVER : GPIO5_CTRL_INOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; IRQOVER : GPIO5_CTRL_IRQOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_30_31 : HAL.UInt2 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO5_CTRL_Register use record FUNCSEL at 0 range 0 .. 4; Reserved_5_7 at 0 range 5 .. 7; OUTOVER at 0 range 8 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEOVER at 0 range 12 .. 13; Reserved_14_15 at 0 range 14 .. 15; INOVER at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; IRQOVER at 0 range 28 .. 29; Reserved_30_31 at 0 range 30 .. 31; end record; -- GPIO status type GPIO6_STATUS_Register is record -- unspecified Reserved_0_7 : HAL.UInt8; -- Read-only. output signal from selected peripheral, before register -- override is applied OUTFROMPERI : Boolean; -- Read-only. output signal to pad after register override is applied OUTTOPAD : Boolean; -- unspecified Reserved_10_11 : HAL.UInt2; -- Read-only. output enable from selected peripheral, before register -- override is applied OEFROMPERI : Boolean; -- Read-only. output enable to pad after register override is applied OETOPAD : Boolean; -- unspecified Reserved_14_16 : HAL.UInt3; -- Read-only. input signal from pad, before override is applied INFROMPAD : Boolean; -- unspecified Reserved_18_18 : HAL.Bit; -- Read-only. input signal to peripheral, after override is applied INTOPERI : Boolean; -- unspecified Reserved_20_23 : HAL.UInt4; -- Read-only. interrupt from pad before override is applied IRQFROMPAD : Boolean; -- unspecified Reserved_25_25 : HAL.Bit; -- Read-only. interrupt to processors, after override is applied IRQTOPROC : Boolean; -- unspecified Reserved_27_31 : HAL.UInt5; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO6_STATUS_Register use record Reserved_0_7 at 0 range 0 .. 7; OUTFROMPERI at 0 range 8 .. 8; OUTTOPAD at 0 range 9 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEFROMPERI at 0 range 12 .. 12; OETOPAD at 0 range 13 .. 13; Reserved_14_16 at 0 range 14 .. 16; INFROMPAD at 0 range 17 .. 17; Reserved_18_18 at 0 range 18 .. 18; INTOPERI at 0 range 19 .. 19; Reserved_20_23 at 0 range 20 .. 23; IRQFROMPAD at 0 range 24 .. 24; Reserved_25_25 at 0 range 25 .. 25; IRQTOPROC at 0 range 26 .. 26; Reserved_27_31 at 0 range 27 .. 31; end record; -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL type GPIO6_CTRL_FUNCSEL_Field is (SPI0_SCLK, UART1_CTS, I2C1_SDA, PWM_A_3, SIO_6, PIO0_6, PIO1_6, USB_MUXING_EXTPHY_SOFTCON, USB_MUXING_OVERCURR_DETECT, NULL_k) with Size => 5; for GPIO6_CTRL_FUNCSEL_Field use (SPI0_SCLK => 1, UART1_CTS => 2, I2C1_SDA => 3, PWM_A_3 => 4, SIO_6 => 5, PIO0_6 => 6, PIO1_6 => 7, USB_MUXING_EXTPHY_SOFTCON => 8, USB_MUXING_OVERCURR_DETECT => 9, NULL_k => 31); type GPIO6_CTRL_OUTOVER_Field is (-- drive output from peripheral signal selected by funcsel Normal, -- drive output from inverse of peripheral signal selected by funcsel Invert, -- drive output low Low, -- drive output high High) with Size => 2; for GPIO6_CTRL_OUTOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO6_CTRL_OEOVER_Field is (-- drive output enable from peripheral signal selected by funcsel Normal, -- drive output enable from inverse of peripheral signal selected by funcsel Invert, -- disable output Disable, -- enable output Enable) with Size => 2; for GPIO6_CTRL_OEOVER_Field use (Normal => 0, Invert => 1, Disable => 2, Enable => 3); type GPIO6_CTRL_INOVER_Field is (-- don't invert the peri input Normal, -- invert the peri input Invert, -- drive peri input low Low, -- drive peri input high High) with Size => 2; for GPIO6_CTRL_INOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO6_CTRL_IRQOVER_Field is (-- don't invert the interrupt Normal, -- invert the interrupt Invert, -- drive interrupt low Low, -- drive interrupt high High) with Size => 2; for GPIO6_CTRL_IRQOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); -- GPIO control including function select and overrides. type GPIO6_CTRL_Register is record -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL FUNCSEL : GPIO6_CTRL_FUNCSEL_Field := RP_SVD.IO_BANK0.NULL_k; -- unspecified Reserved_5_7 : HAL.UInt3 := 16#0#; OUTOVER : GPIO6_CTRL_OUTOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_10_11 : HAL.UInt2 := 16#0#; OEOVER : GPIO6_CTRL_OEOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_14_15 : HAL.UInt2 := 16#0#; INOVER : GPIO6_CTRL_INOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; IRQOVER : GPIO6_CTRL_IRQOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_30_31 : HAL.UInt2 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO6_CTRL_Register use record FUNCSEL at 0 range 0 .. 4; Reserved_5_7 at 0 range 5 .. 7; OUTOVER at 0 range 8 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEOVER at 0 range 12 .. 13; Reserved_14_15 at 0 range 14 .. 15; INOVER at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; IRQOVER at 0 range 28 .. 29; Reserved_30_31 at 0 range 30 .. 31; end record; -- GPIO status type GPIO7_STATUS_Register is record -- unspecified Reserved_0_7 : HAL.UInt8; -- Read-only. output signal from selected peripheral, before register -- override is applied OUTFROMPERI : Boolean; -- Read-only. output signal to pad after register override is applied OUTTOPAD : Boolean; -- unspecified Reserved_10_11 : HAL.UInt2; -- Read-only. output enable from selected peripheral, before register -- override is applied OEFROMPERI : Boolean; -- Read-only. output enable to pad after register override is applied OETOPAD : Boolean; -- unspecified Reserved_14_16 : HAL.UInt3; -- Read-only. input signal from pad, before override is applied INFROMPAD : Boolean; -- unspecified Reserved_18_18 : HAL.Bit; -- Read-only. input signal to peripheral, after override is applied INTOPERI : Boolean; -- unspecified Reserved_20_23 : HAL.UInt4; -- Read-only. interrupt from pad before override is applied IRQFROMPAD : Boolean; -- unspecified Reserved_25_25 : HAL.Bit; -- Read-only. interrupt to processors, after override is applied IRQTOPROC : Boolean; -- unspecified Reserved_27_31 : HAL.UInt5; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO7_STATUS_Register use record Reserved_0_7 at 0 range 0 .. 7; OUTFROMPERI at 0 range 8 .. 8; OUTTOPAD at 0 range 9 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEFROMPERI at 0 range 12 .. 12; OETOPAD at 0 range 13 .. 13; Reserved_14_16 at 0 range 14 .. 16; INFROMPAD at 0 range 17 .. 17; Reserved_18_18 at 0 range 18 .. 18; INTOPERI at 0 range 19 .. 19; Reserved_20_23 at 0 range 20 .. 23; IRQFROMPAD at 0 range 24 .. 24; Reserved_25_25 at 0 range 25 .. 25; IRQTOPROC at 0 range 26 .. 26; Reserved_27_31 at 0 range 27 .. 31; end record; -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL type GPIO7_CTRL_FUNCSEL_Field is (SPI0_TX, UART1_RTS, I2C1_SCL, PWM_B_3, SIO_7, PIO0_7, PIO1_7, USB_MUXING_EXTPHY_OE_N, USB_MUXING_VBUS_DETECT, NULL_k) with Size => 5; for GPIO7_CTRL_FUNCSEL_Field use (SPI0_TX => 1, UART1_RTS => 2, I2C1_SCL => 3, PWM_B_3 => 4, SIO_7 => 5, PIO0_7 => 6, PIO1_7 => 7, USB_MUXING_EXTPHY_OE_N => 8, USB_MUXING_VBUS_DETECT => 9, NULL_k => 31); type GPIO7_CTRL_OUTOVER_Field is (-- drive output from peripheral signal selected by funcsel Normal, -- drive output from inverse of peripheral signal selected by funcsel Invert, -- drive output low Low, -- drive output high High) with Size => 2; for GPIO7_CTRL_OUTOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO7_CTRL_OEOVER_Field is (-- drive output enable from peripheral signal selected by funcsel Normal, -- drive output enable from inverse of peripheral signal selected by funcsel Invert, -- disable output Disable, -- enable output Enable) with Size => 2; for GPIO7_CTRL_OEOVER_Field use (Normal => 0, Invert => 1, Disable => 2, Enable => 3); type GPIO7_CTRL_INOVER_Field is (-- don't invert the peri input Normal, -- invert the peri input Invert, -- drive peri input low Low, -- drive peri input high High) with Size => 2; for GPIO7_CTRL_INOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO7_CTRL_IRQOVER_Field is (-- don't invert the interrupt Normal, -- invert the interrupt Invert, -- drive interrupt low Low, -- drive interrupt high High) with Size => 2; for GPIO7_CTRL_IRQOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); -- GPIO control including function select and overrides. type GPIO7_CTRL_Register is record -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL FUNCSEL : GPIO7_CTRL_FUNCSEL_Field := RP_SVD.IO_BANK0.NULL_k; -- unspecified Reserved_5_7 : HAL.UInt3 := 16#0#; OUTOVER : GPIO7_CTRL_OUTOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_10_11 : HAL.UInt2 := 16#0#; OEOVER : GPIO7_CTRL_OEOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_14_15 : HAL.UInt2 := 16#0#; INOVER : GPIO7_CTRL_INOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; IRQOVER : GPIO7_CTRL_IRQOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_30_31 : HAL.UInt2 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO7_CTRL_Register use record FUNCSEL at 0 range 0 .. 4; Reserved_5_7 at 0 range 5 .. 7; OUTOVER at 0 range 8 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEOVER at 0 range 12 .. 13; Reserved_14_15 at 0 range 14 .. 15; INOVER at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; IRQOVER at 0 range 28 .. 29; Reserved_30_31 at 0 range 30 .. 31; end record; -- GPIO status type GPIO8_STATUS_Register is record -- unspecified Reserved_0_7 : HAL.UInt8; -- Read-only. output signal from selected peripheral, before register -- override is applied OUTFROMPERI : Boolean; -- Read-only. output signal to pad after register override is applied OUTTOPAD : Boolean; -- unspecified Reserved_10_11 : HAL.UInt2; -- Read-only. output enable from selected peripheral, before register -- override is applied OEFROMPERI : Boolean; -- Read-only. output enable to pad after register override is applied OETOPAD : Boolean; -- unspecified Reserved_14_16 : HAL.UInt3; -- Read-only. input signal from pad, before override is applied INFROMPAD : Boolean; -- unspecified Reserved_18_18 : HAL.Bit; -- Read-only. input signal to peripheral, after override is applied INTOPERI : Boolean; -- unspecified Reserved_20_23 : HAL.UInt4; -- Read-only. interrupt from pad before override is applied IRQFROMPAD : Boolean; -- unspecified Reserved_25_25 : HAL.Bit; -- Read-only. interrupt to processors, after override is applied IRQTOPROC : Boolean; -- unspecified Reserved_27_31 : HAL.UInt5; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO8_STATUS_Register use record Reserved_0_7 at 0 range 0 .. 7; OUTFROMPERI at 0 range 8 .. 8; OUTTOPAD at 0 range 9 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEFROMPERI at 0 range 12 .. 12; OETOPAD at 0 range 13 .. 13; Reserved_14_16 at 0 range 14 .. 16; INFROMPAD at 0 range 17 .. 17; Reserved_18_18 at 0 range 18 .. 18; INTOPERI at 0 range 19 .. 19; Reserved_20_23 at 0 range 20 .. 23; IRQFROMPAD at 0 range 24 .. 24; Reserved_25_25 at 0 range 25 .. 25; IRQTOPROC at 0 range 26 .. 26; Reserved_27_31 at 0 range 27 .. 31; end record; -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL type GPIO8_CTRL_FUNCSEL_Field is (SPI1_RX, UART1_TX, I2C0_SDA, PWM_A_4, SIO_8, PIO0_8, PIO1_8, USB_MUXING_EXTPHY_RCV, USB_MUXING_VBUS_EN, NULL_k) with Size => 5; for GPIO8_CTRL_FUNCSEL_Field use (SPI1_RX => 1, UART1_TX => 2, I2C0_SDA => 3, PWM_A_4 => 4, SIO_8 => 5, PIO0_8 => 6, PIO1_8 => 7, USB_MUXING_EXTPHY_RCV => 8, USB_MUXING_VBUS_EN => 9, NULL_k => 31); type GPIO8_CTRL_OUTOVER_Field is (-- drive output from peripheral signal selected by funcsel Normal, -- drive output from inverse of peripheral signal selected by funcsel Invert, -- drive output low Low, -- drive output high High) with Size => 2; for GPIO8_CTRL_OUTOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO8_CTRL_OEOVER_Field is (-- drive output enable from peripheral signal selected by funcsel Normal, -- drive output enable from inverse of peripheral signal selected by funcsel Invert, -- disable output Disable, -- enable output Enable) with Size => 2; for GPIO8_CTRL_OEOVER_Field use (Normal => 0, Invert => 1, Disable => 2, Enable => 3); type GPIO8_CTRL_INOVER_Field is (-- don't invert the peri input Normal, -- invert the peri input Invert, -- drive peri input low Low, -- drive peri input high High) with Size => 2; for GPIO8_CTRL_INOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO8_CTRL_IRQOVER_Field is (-- don't invert the interrupt Normal, -- invert the interrupt Invert, -- drive interrupt low Low, -- drive interrupt high High) with Size => 2; for GPIO8_CTRL_IRQOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); -- GPIO control including function select and overrides. type GPIO8_CTRL_Register is record -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL FUNCSEL : GPIO8_CTRL_FUNCSEL_Field := RP_SVD.IO_BANK0.NULL_k; -- unspecified Reserved_5_7 : HAL.UInt3 := 16#0#; OUTOVER : GPIO8_CTRL_OUTOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_10_11 : HAL.UInt2 := 16#0#; OEOVER : GPIO8_CTRL_OEOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_14_15 : HAL.UInt2 := 16#0#; INOVER : GPIO8_CTRL_INOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; IRQOVER : GPIO8_CTRL_IRQOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_30_31 : HAL.UInt2 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO8_CTRL_Register use record FUNCSEL at 0 range 0 .. 4; Reserved_5_7 at 0 range 5 .. 7; OUTOVER at 0 range 8 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEOVER at 0 range 12 .. 13; Reserved_14_15 at 0 range 14 .. 15; INOVER at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; IRQOVER at 0 range 28 .. 29; Reserved_30_31 at 0 range 30 .. 31; end record; -- GPIO status type GPIO9_STATUS_Register is record -- unspecified Reserved_0_7 : HAL.UInt8; -- Read-only. output signal from selected peripheral, before register -- override is applied OUTFROMPERI : Boolean; -- Read-only. output signal to pad after register override is applied OUTTOPAD : Boolean; -- unspecified Reserved_10_11 : HAL.UInt2; -- Read-only. output enable from selected peripheral, before register -- override is applied OEFROMPERI : Boolean; -- Read-only. output enable to pad after register override is applied OETOPAD : Boolean; -- unspecified Reserved_14_16 : HAL.UInt3; -- Read-only. input signal from pad, before override is applied INFROMPAD : Boolean; -- unspecified Reserved_18_18 : HAL.Bit; -- Read-only. input signal to peripheral, after override is applied INTOPERI : Boolean; -- unspecified Reserved_20_23 : HAL.UInt4; -- Read-only. interrupt from pad before override is applied IRQFROMPAD : Boolean; -- unspecified Reserved_25_25 : HAL.Bit; -- Read-only. interrupt to processors, after override is applied IRQTOPROC : Boolean; -- unspecified Reserved_27_31 : HAL.UInt5; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO9_STATUS_Register use record Reserved_0_7 at 0 range 0 .. 7; OUTFROMPERI at 0 range 8 .. 8; OUTTOPAD at 0 range 9 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEFROMPERI at 0 range 12 .. 12; OETOPAD at 0 range 13 .. 13; Reserved_14_16 at 0 range 14 .. 16; INFROMPAD at 0 range 17 .. 17; Reserved_18_18 at 0 range 18 .. 18; INTOPERI at 0 range 19 .. 19; Reserved_20_23 at 0 range 20 .. 23; IRQFROMPAD at 0 range 24 .. 24; Reserved_25_25 at 0 range 25 .. 25; IRQTOPROC at 0 range 26 .. 26; Reserved_27_31 at 0 range 27 .. 31; end record; -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL type GPIO9_CTRL_FUNCSEL_Field is (SPI1_SS_N, UART1_RX, I2C0_SCL, PWM_B_4, SIO_9, PIO0_9, PIO1_9, USB_MUXING_EXTPHY_VP, USB_MUXING_OVERCURR_DETECT, NULL_k) with Size => 5; for GPIO9_CTRL_FUNCSEL_Field use (SPI1_SS_N => 1, UART1_RX => 2, I2C0_SCL => 3, PWM_B_4 => 4, SIO_9 => 5, PIO0_9 => 6, PIO1_9 => 7, USB_MUXING_EXTPHY_VP => 8, USB_MUXING_OVERCURR_DETECT => 9, NULL_k => 31); type GPIO9_CTRL_OUTOVER_Field is (-- drive output from peripheral signal selected by funcsel Normal, -- drive output from inverse of peripheral signal selected by funcsel Invert, -- drive output low Low, -- drive output high High) with Size => 2; for GPIO9_CTRL_OUTOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO9_CTRL_OEOVER_Field is (-- drive output enable from peripheral signal selected by funcsel Normal, -- drive output enable from inverse of peripheral signal selected by funcsel Invert, -- disable output Disable, -- enable output Enable) with Size => 2; for GPIO9_CTRL_OEOVER_Field use (Normal => 0, Invert => 1, Disable => 2, Enable => 3); type GPIO9_CTRL_INOVER_Field is (-- don't invert the peri input Normal, -- invert the peri input Invert, -- drive peri input low Low, -- drive peri input high High) with Size => 2; for GPIO9_CTRL_INOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO9_CTRL_IRQOVER_Field is (-- don't invert the interrupt Normal, -- invert the interrupt Invert, -- drive interrupt low Low, -- drive interrupt high High) with Size => 2; for GPIO9_CTRL_IRQOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); -- GPIO control including function select and overrides. type GPIO9_CTRL_Register is record -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL FUNCSEL : GPIO9_CTRL_FUNCSEL_Field := RP_SVD.IO_BANK0.NULL_k; -- unspecified Reserved_5_7 : HAL.UInt3 := 16#0#; OUTOVER : GPIO9_CTRL_OUTOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_10_11 : HAL.UInt2 := 16#0#; OEOVER : GPIO9_CTRL_OEOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_14_15 : HAL.UInt2 := 16#0#; INOVER : GPIO9_CTRL_INOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; IRQOVER : GPIO9_CTRL_IRQOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_30_31 : HAL.UInt2 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO9_CTRL_Register use record FUNCSEL at 0 range 0 .. 4; Reserved_5_7 at 0 range 5 .. 7; OUTOVER at 0 range 8 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEOVER at 0 range 12 .. 13; Reserved_14_15 at 0 range 14 .. 15; INOVER at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; IRQOVER at 0 range 28 .. 29; Reserved_30_31 at 0 range 30 .. 31; end record; -- GPIO status type GPIO10_STATUS_Register is record -- unspecified Reserved_0_7 : HAL.UInt8; -- Read-only. output signal from selected peripheral, before register -- override is applied OUTFROMPERI : Boolean; -- Read-only. output signal to pad after register override is applied OUTTOPAD : Boolean; -- unspecified Reserved_10_11 : HAL.UInt2; -- Read-only. output enable from selected peripheral, before register -- override is applied OEFROMPERI : Boolean; -- Read-only. output enable to pad after register override is applied OETOPAD : Boolean; -- unspecified Reserved_14_16 : HAL.UInt3; -- Read-only. input signal from pad, before override is applied INFROMPAD : Boolean; -- unspecified Reserved_18_18 : HAL.Bit; -- Read-only. input signal to peripheral, after override is applied INTOPERI : Boolean; -- unspecified Reserved_20_23 : HAL.UInt4; -- Read-only. interrupt from pad before override is applied IRQFROMPAD : Boolean; -- unspecified Reserved_25_25 : HAL.Bit; -- Read-only. interrupt to processors, after override is applied IRQTOPROC : Boolean; -- unspecified Reserved_27_31 : HAL.UInt5; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO10_STATUS_Register use record Reserved_0_7 at 0 range 0 .. 7; OUTFROMPERI at 0 range 8 .. 8; OUTTOPAD at 0 range 9 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEFROMPERI at 0 range 12 .. 12; OETOPAD at 0 range 13 .. 13; Reserved_14_16 at 0 range 14 .. 16; INFROMPAD at 0 range 17 .. 17; Reserved_18_18 at 0 range 18 .. 18; INTOPERI at 0 range 19 .. 19; Reserved_20_23 at 0 range 20 .. 23; IRQFROMPAD at 0 range 24 .. 24; Reserved_25_25 at 0 range 25 .. 25; IRQTOPROC at 0 range 26 .. 26; Reserved_27_31 at 0 range 27 .. 31; end record; -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL type GPIO10_CTRL_FUNCSEL_Field is (SPI1_SCLK, UART1_CTS, I2C1_SDA, PWM_A_5, SIO_10, PIO0_10, PIO1_10, USB_MUXING_EXTPHY_VM, USB_MUXING_VBUS_DETECT, NULL_k) with Size => 5; for GPIO10_CTRL_FUNCSEL_Field use (SPI1_SCLK => 1, UART1_CTS => 2, I2C1_SDA => 3, PWM_A_5 => 4, SIO_10 => 5, PIO0_10 => 6, PIO1_10 => 7, USB_MUXING_EXTPHY_VM => 8, USB_MUXING_VBUS_DETECT => 9, NULL_k => 31); type GPIO10_CTRL_OUTOVER_Field is (-- drive output from peripheral signal selected by funcsel Normal, -- drive output from inverse of peripheral signal selected by funcsel Invert, -- drive output low Low, -- drive output high High) with Size => 2; for GPIO10_CTRL_OUTOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO10_CTRL_OEOVER_Field is (-- drive output enable from peripheral signal selected by funcsel Normal, -- drive output enable from inverse of peripheral signal selected by funcsel Invert, -- disable output Disable, -- enable output Enable) with Size => 2; for GPIO10_CTRL_OEOVER_Field use (Normal => 0, Invert => 1, Disable => 2, Enable => 3); type GPIO10_CTRL_INOVER_Field is (-- don't invert the peri input Normal, -- invert the peri input Invert, -- drive peri input low Low, -- drive peri input high High) with Size => 2; for GPIO10_CTRL_INOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO10_CTRL_IRQOVER_Field is (-- don't invert the interrupt Normal, -- invert the interrupt Invert, -- drive interrupt low Low, -- drive interrupt high High) with Size => 2; for GPIO10_CTRL_IRQOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); -- GPIO control including function select and overrides. type GPIO10_CTRL_Register is record -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL FUNCSEL : GPIO10_CTRL_FUNCSEL_Field := RP_SVD.IO_BANK0.NULL_k; -- unspecified Reserved_5_7 : HAL.UInt3 := 16#0#; OUTOVER : GPIO10_CTRL_OUTOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_10_11 : HAL.UInt2 := 16#0#; OEOVER : GPIO10_CTRL_OEOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_14_15 : HAL.UInt2 := 16#0#; INOVER : GPIO10_CTRL_INOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; IRQOVER : GPIO10_CTRL_IRQOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_30_31 : HAL.UInt2 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO10_CTRL_Register use record FUNCSEL at 0 range 0 .. 4; Reserved_5_7 at 0 range 5 .. 7; OUTOVER at 0 range 8 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEOVER at 0 range 12 .. 13; Reserved_14_15 at 0 range 14 .. 15; INOVER at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; IRQOVER at 0 range 28 .. 29; Reserved_30_31 at 0 range 30 .. 31; end record; -- GPIO status type GPIO11_STATUS_Register is record -- unspecified Reserved_0_7 : HAL.UInt8; -- Read-only. output signal from selected peripheral, before register -- override is applied OUTFROMPERI : Boolean; -- Read-only. output signal to pad after register override is applied OUTTOPAD : Boolean; -- unspecified Reserved_10_11 : HAL.UInt2; -- Read-only. output enable from selected peripheral, before register -- override is applied OEFROMPERI : Boolean; -- Read-only. output enable to pad after register override is applied OETOPAD : Boolean; -- unspecified Reserved_14_16 : HAL.UInt3; -- Read-only. input signal from pad, before override is applied INFROMPAD : Boolean; -- unspecified Reserved_18_18 : HAL.Bit; -- Read-only. input signal to peripheral, after override is applied INTOPERI : Boolean; -- unspecified Reserved_20_23 : HAL.UInt4; -- Read-only. interrupt from pad before override is applied IRQFROMPAD : Boolean; -- unspecified Reserved_25_25 : HAL.Bit; -- Read-only. interrupt to processors, after override is applied IRQTOPROC : Boolean; -- unspecified Reserved_27_31 : HAL.UInt5; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO11_STATUS_Register use record Reserved_0_7 at 0 range 0 .. 7; OUTFROMPERI at 0 range 8 .. 8; OUTTOPAD at 0 range 9 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEFROMPERI at 0 range 12 .. 12; OETOPAD at 0 range 13 .. 13; Reserved_14_16 at 0 range 14 .. 16; INFROMPAD at 0 range 17 .. 17; Reserved_18_18 at 0 range 18 .. 18; INTOPERI at 0 range 19 .. 19; Reserved_20_23 at 0 range 20 .. 23; IRQFROMPAD at 0 range 24 .. 24; Reserved_25_25 at 0 range 25 .. 25; IRQTOPROC at 0 range 26 .. 26; Reserved_27_31 at 0 range 27 .. 31; end record; -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL type GPIO11_CTRL_FUNCSEL_Field is (SPI1_TX, UART1_RTS, I2C1_SCL, PWM_B_5, SIO_11, PIO0_11, PIO1_11, USB_MUXING_EXTPHY_SUSPND, USB_MUXING_VBUS_EN, NULL_k) with Size => 5; for GPIO11_CTRL_FUNCSEL_Field use (SPI1_TX => 1, UART1_RTS => 2, I2C1_SCL => 3, PWM_B_5 => 4, SIO_11 => 5, PIO0_11 => 6, PIO1_11 => 7, USB_MUXING_EXTPHY_SUSPND => 8, USB_MUXING_VBUS_EN => 9, NULL_k => 31); type GPIO11_CTRL_OUTOVER_Field is (-- drive output from peripheral signal selected by funcsel Normal, -- drive output from inverse of peripheral signal selected by funcsel Invert, -- drive output low Low, -- drive output high High) with Size => 2; for GPIO11_CTRL_OUTOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO11_CTRL_OEOVER_Field is (-- drive output enable from peripheral signal selected by funcsel Normal, -- drive output enable from inverse of peripheral signal selected by funcsel Invert, -- disable output Disable, -- enable output Enable) with Size => 2; for GPIO11_CTRL_OEOVER_Field use (Normal => 0, Invert => 1, Disable => 2, Enable => 3); type GPIO11_CTRL_INOVER_Field is (-- don't invert the peri input Normal, -- invert the peri input Invert, -- drive peri input low Low, -- drive peri input high High) with Size => 2; for GPIO11_CTRL_INOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO11_CTRL_IRQOVER_Field is (-- don't invert the interrupt Normal, -- invert the interrupt Invert, -- drive interrupt low Low, -- drive interrupt high High) with Size => 2; for GPIO11_CTRL_IRQOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); -- GPIO control including function select and overrides. type GPIO11_CTRL_Register is record -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL FUNCSEL : GPIO11_CTRL_FUNCSEL_Field := RP_SVD.IO_BANK0.NULL_k; -- unspecified Reserved_5_7 : HAL.UInt3 := 16#0#; OUTOVER : GPIO11_CTRL_OUTOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_10_11 : HAL.UInt2 := 16#0#; OEOVER : GPIO11_CTRL_OEOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_14_15 : HAL.UInt2 := 16#0#; INOVER : GPIO11_CTRL_INOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; IRQOVER : GPIO11_CTRL_IRQOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_30_31 : HAL.UInt2 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO11_CTRL_Register use record FUNCSEL at 0 range 0 .. 4; Reserved_5_7 at 0 range 5 .. 7; OUTOVER at 0 range 8 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEOVER at 0 range 12 .. 13; Reserved_14_15 at 0 range 14 .. 15; INOVER at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; IRQOVER at 0 range 28 .. 29; Reserved_30_31 at 0 range 30 .. 31; end record; -- GPIO status type GPIO12_STATUS_Register is record -- unspecified Reserved_0_7 : HAL.UInt8; -- Read-only. output signal from selected peripheral, before register -- override is applied OUTFROMPERI : Boolean; -- Read-only. output signal to pad after register override is applied OUTTOPAD : Boolean; -- unspecified Reserved_10_11 : HAL.UInt2; -- Read-only. output enable from selected peripheral, before register -- override is applied OEFROMPERI : Boolean; -- Read-only. output enable to pad after register override is applied OETOPAD : Boolean; -- unspecified Reserved_14_16 : HAL.UInt3; -- Read-only. input signal from pad, before override is applied INFROMPAD : Boolean; -- unspecified Reserved_18_18 : HAL.Bit; -- Read-only. input signal to peripheral, after override is applied INTOPERI : Boolean; -- unspecified Reserved_20_23 : HAL.UInt4; -- Read-only. interrupt from pad before override is applied IRQFROMPAD : Boolean; -- unspecified Reserved_25_25 : HAL.Bit; -- Read-only. interrupt to processors, after override is applied IRQTOPROC : Boolean; -- unspecified Reserved_27_31 : HAL.UInt5; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO12_STATUS_Register use record Reserved_0_7 at 0 range 0 .. 7; OUTFROMPERI at 0 range 8 .. 8; OUTTOPAD at 0 range 9 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEFROMPERI at 0 range 12 .. 12; OETOPAD at 0 range 13 .. 13; Reserved_14_16 at 0 range 14 .. 16; INFROMPAD at 0 range 17 .. 17; Reserved_18_18 at 0 range 18 .. 18; INTOPERI at 0 range 19 .. 19; Reserved_20_23 at 0 range 20 .. 23; IRQFROMPAD at 0 range 24 .. 24; Reserved_25_25 at 0 range 25 .. 25; IRQTOPROC at 0 range 26 .. 26; Reserved_27_31 at 0 range 27 .. 31; end record; -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL type GPIO12_CTRL_FUNCSEL_Field is (SPI1_RX, UART0_TX, I2C0_SDA, PWM_A_6, SIO_12, PIO0_12, PIO1_12, USB_MUXING_EXTPHY_SPEED, USB_MUXING_OVERCURR_DETECT, NULL_k) with Size => 5; for GPIO12_CTRL_FUNCSEL_Field use (SPI1_RX => 1, UART0_TX => 2, I2C0_SDA => 3, PWM_A_6 => 4, SIO_12 => 5, PIO0_12 => 6, PIO1_12 => 7, USB_MUXING_EXTPHY_SPEED => 8, USB_MUXING_OVERCURR_DETECT => 9, NULL_k => 31); type GPIO12_CTRL_OUTOVER_Field is (-- drive output from peripheral signal selected by funcsel Normal, -- drive output from inverse of peripheral signal selected by funcsel Invert, -- drive output low Low, -- drive output high High) with Size => 2; for GPIO12_CTRL_OUTOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO12_CTRL_OEOVER_Field is (-- drive output enable from peripheral signal selected by funcsel Normal, -- drive output enable from inverse of peripheral signal selected by funcsel Invert, -- disable output Disable, -- enable output Enable) with Size => 2; for GPIO12_CTRL_OEOVER_Field use (Normal => 0, Invert => 1, Disable => 2, Enable => 3); type GPIO12_CTRL_INOVER_Field is (-- don't invert the peri input Normal, -- invert the peri input Invert, -- drive peri input low Low, -- drive peri input high High) with Size => 2; for GPIO12_CTRL_INOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO12_CTRL_IRQOVER_Field is (-- don't invert the interrupt Normal, -- invert the interrupt Invert, -- drive interrupt low Low, -- drive interrupt high High) with Size => 2; for GPIO12_CTRL_IRQOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); -- GPIO control including function select and overrides. type GPIO12_CTRL_Register is record -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL FUNCSEL : GPIO12_CTRL_FUNCSEL_Field := RP_SVD.IO_BANK0.NULL_k; -- unspecified Reserved_5_7 : HAL.UInt3 := 16#0#; OUTOVER : GPIO12_CTRL_OUTOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_10_11 : HAL.UInt2 := 16#0#; OEOVER : GPIO12_CTRL_OEOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_14_15 : HAL.UInt2 := 16#0#; INOVER : GPIO12_CTRL_INOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; IRQOVER : GPIO12_CTRL_IRQOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_30_31 : HAL.UInt2 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO12_CTRL_Register use record FUNCSEL at 0 range 0 .. 4; Reserved_5_7 at 0 range 5 .. 7; OUTOVER at 0 range 8 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEOVER at 0 range 12 .. 13; Reserved_14_15 at 0 range 14 .. 15; INOVER at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; IRQOVER at 0 range 28 .. 29; Reserved_30_31 at 0 range 30 .. 31; end record; -- GPIO status type GPIO13_STATUS_Register is record -- unspecified Reserved_0_7 : HAL.UInt8; -- Read-only. output signal from selected peripheral, before register -- override is applied OUTFROMPERI : Boolean; -- Read-only. output signal to pad after register override is applied OUTTOPAD : Boolean; -- unspecified Reserved_10_11 : HAL.UInt2; -- Read-only. output enable from selected peripheral, before register -- override is applied OEFROMPERI : Boolean; -- Read-only. output enable to pad after register override is applied OETOPAD : Boolean; -- unspecified Reserved_14_16 : HAL.UInt3; -- Read-only. input signal from pad, before override is applied INFROMPAD : Boolean; -- unspecified Reserved_18_18 : HAL.Bit; -- Read-only. input signal to peripheral, after override is applied INTOPERI : Boolean; -- unspecified Reserved_20_23 : HAL.UInt4; -- Read-only. interrupt from pad before override is applied IRQFROMPAD : Boolean; -- unspecified Reserved_25_25 : HAL.Bit; -- Read-only. interrupt to processors, after override is applied IRQTOPROC : Boolean; -- unspecified Reserved_27_31 : HAL.UInt5; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO13_STATUS_Register use record Reserved_0_7 at 0 range 0 .. 7; OUTFROMPERI at 0 range 8 .. 8; OUTTOPAD at 0 range 9 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEFROMPERI at 0 range 12 .. 12; OETOPAD at 0 range 13 .. 13; Reserved_14_16 at 0 range 14 .. 16; INFROMPAD at 0 range 17 .. 17; Reserved_18_18 at 0 range 18 .. 18; INTOPERI at 0 range 19 .. 19; Reserved_20_23 at 0 range 20 .. 23; IRQFROMPAD at 0 range 24 .. 24; Reserved_25_25 at 0 range 25 .. 25; IRQTOPROC at 0 range 26 .. 26; Reserved_27_31 at 0 range 27 .. 31; end record; -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL type GPIO13_CTRL_FUNCSEL_Field is (SPI1_SS_N, UART0_RX, I2C0_SCL, PWM_B_6, SIO_13, PIO0_13, PIO1_13, USB_MUXING_EXTPHY_VPO, USB_MUXING_VBUS_DETECT, NULL_k) with Size => 5; for GPIO13_CTRL_FUNCSEL_Field use (SPI1_SS_N => 1, UART0_RX => 2, I2C0_SCL => 3, PWM_B_6 => 4, SIO_13 => 5, PIO0_13 => 6, PIO1_13 => 7, USB_MUXING_EXTPHY_VPO => 8, USB_MUXING_VBUS_DETECT => 9, NULL_k => 31); type GPIO13_CTRL_OUTOVER_Field is (-- drive output from peripheral signal selected by funcsel Normal, -- drive output from inverse of peripheral signal selected by funcsel Invert, -- drive output low Low, -- drive output high High) with Size => 2; for GPIO13_CTRL_OUTOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO13_CTRL_OEOVER_Field is (-- drive output enable from peripheral signal selected by funcsel Normal, -- drive output enable from inverse of peripheral signal selected by funcsel Invert, -- disable output Disable, -- enable output Enable) with Size => 2; for GPIO13_CTRL_OEOVER_Field use (Normal => 0, Invert => 1, Disable => 2, Enable => 3); type GPIO13_CTRL_INOVER_Field is (-- don't invert the peri input Normal, -- invert the peri input Invert, -- drive peri input low Low, -- drive peri input high High) with Size => 2; for GPIO13_CTRL_INOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO13_CTRL_IRQOVER_Field is (-- don't invert the interrupt Normal, -- invert the interrupt Invert, -- drive interrupt low Low, -- drive interrupt high High) with Size => 2; for GPIO13_CTRL_IRQOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); -- GPIO control including function select and overrides. type GPIO13_CTRL_Register is record -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL FUNCSEL : GPIO13_CTRL_FUNCSEL_Field := RP_SVD.IO_BANK0.NULL_k; -- unspecified Reserved_5_7 : HAL.UInt3 := 16#0#; OUTOVER : GPIO13_CTRL_OUTOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_10_11 : HAL.UInt2 := 16#0#; OEOVER : GPIO13_CTRL_OEOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_14_15 : HAL.UInt2 := 16#0#; INOVER : GPIO13_CTRL_INOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; IRQOVER : GPIO13_CTRL_IRQOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_30_31 : HAL.UInt2 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO13_CTRL_Register use record FUNCSEL at 0 range 0 .. 4; Reserved_5_7 at 0 range 5 .. 7; OUTOVER at 0 range 8 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEOVER at 0 range 12 .. 13; Reserved_14_15 at 0 range 14 .. 15; INOVER at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; IRQOVER at 0 range 28 .. 29; Reserved_30_31 at 0 range 30 .. 31; end record; -- GPIO status type GPIO14_STATUS_Register is record -- unspecified Reserved_0_7 : HAL.UInt8; -- Read-only. output signal from selected peripheral, before register -- override is applied OUTFROMPERI : Boolean; -- Read-only. output signal to pad after register override is applied OUTTOPAD : Boolean; -- unspecified Reserved_10_11 : HAL.UInt2; -- Read-only. output enable from selected peripheral, before register -- override is applied OEFROMPERI : Boolean; -- Read-only. output enable to pad after register override is applied OETOPAD : Boolean; -- unspecified Reserved_14_16 : HAL.UInt3; -- Read-only. input signal from pad, before override is applied INFROMPAD : Boolean; -- unspecified Reserved_18_18 : HAL.Bit; -- Read-only. input signal to peripheral, after override is applied INTOPERI : Boolean; -- unspecified Reserved_20_23 : HAL.UInt4; -- Read-only. interrupt from pad before override is applied IRQFROMPAD : Boolean; -- unspecified Reserved_25_25 : HAL.Bit; -- Read-only. interrupt to processors, after override is applied IRQTOPROC : Boolean; -- unspecified Reserved_27_31 : HAL.UInt5; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO14_STATUS_Register use record Reserved_0_7 at 0 range 0 .. 7; OUTFROMPERI at 0 range 8 .. 8; OUTTOPAD at 0 range 9 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEFROMPERI at 0 range 12 .. 12; OETOPAD at 0 range 13 .. 13; Reserved_14_16 at 0 range 14 .. 16; INFROMPAD at 0 range 17 .. 17; Reserved_18_18 at 0 range 18 .. 18; INTOPERI at 0 range 19 .. 19; Reserved_20_23 at 0 range 20 .. 23; IRQFROMPAD at 0 range 24 .. 24; Reserved_25_25 at 0 range 25 .. 25; IRQTOPROC at 0 range 26 .. 26; Reserved_27_31 at 0 range 27 .. 31; end record; -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL type GPIO14_CTRL_FUNCSEL_Field is (SPI1_SCLK, UART0_CTS, I2C1_SDA, PWM_A_7, SIO_14, PIO0_14, PIO1_14, USB_MUXING_EXTPHY_VMO, USB_MUXING_VBUS_EN, NULL_k) with Size => 5; for GPIO14_CTRL_FUNCSEL_Field use (SPI1_SCLK => 1, UART0_CTS => 2, I2C1_SDA => 3, PWM_A_7 => 4, SIO_14 => 5, PIO0_14 => 6, PIO1_14 => 7, USB_MUXING_EXTPHY_VMO => 8, USB_MUXING_VBUS_EN => 9, NULL_k => 31); type GPIO14_CTRL_OUTOVER_Field is (-- drive output from peripheral signal selected by funcsel Normal, -- drive output from inverse of peripheral signal selected by funcsel Invert, -- drive output low Low, -- drive output high High) with Size => 2; for GPIO14_CTRL_OUTOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO14_CTRL_OEOVER_Field is (-- drive output enable from peripheral signal selected by funcsel Normal, -- drive output enable from inverse of peripheral signal selected by funcsel Invert, -- disable output Disable, -- enable output Enable) with Size => 2; for GPIO14_CTRL_OEOVER_Field use (Normal => 0, Invert => 1, Disable => 2, Enable => 3); type GPIO14_CTRL_INOVER_Field is (-- don't invert the peri input Normal, -- invert the peri input Invert, -- drive peri input low Low, -- drive peri input high High) with Size => 2; for GPIO14_CTRL_INOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO14_CTRL_IRQOVER_Field is (-- don't invert the interrupt Normal, -- invert the interrupt Invert, -- drive interrupt low Low, -- drive interrupt high High) with Size => 2; for GPIO14_CTRL_IRQOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); -- GPIO control including function select and overrides. type GPIO14_CTRL_Register is record -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL FUNCSEL : GPIO14_CTRL_FUNCSEL_Field := RP_SVD.IO_BANK0.NULL_k; -- unspecified Reserved_5_7 : HAL.UInt3 := 16#0#; OUTOVER : GPIO14_CTRL_OUTOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_10_11 : HAL.UInt2 := 16#0#; OEOVER : GPIO14_CTRL_OEOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_14_15 : HAL.UInt2 := 16#0#; INOVER : GPIO14_CTRL_INOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; IRQOVER : GPIO14_CTRL_IRQOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_30_31 : HAL.UInt2 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO14_CTRL_Register use record FUNCSEL at 0 range 0 .. 4; Reserved_5_7 at 0 range 5 .. 7; OUTOVER at 0 range 8 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEOVER at 0 range 12 .. 13; Reserved_14_15 at 0 range 14 .. 15; INOVER at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; IRQOVER at 0 range 28 .. 29; Reserved_30_31 at 0 range 30 .. 31; end record; -- GPIO status type GPIO15_STATUS_Register is record -- unspecified Reserved_0_7 : HAL.UInt8; -- Read-only. output signal from selected peripheral, before register -- override is applied OUTFROMPERI : Boolean; -- Read-only. output signal to pad after register override is applied OUTTOPAD : Boolean; -- unspecified Reserved_10_11 : HAL.UInt2; -- Read-only. output enable from selected peripheral, before register -- override is applied OEFROMPERI : Boolean; -- Read-only. output enable to pad after register override is applied OETOPAD : Boolean; -- unspecified Reserved_14_16 : HAL.UInt3; -- Read-only. input signal from pad, before override is applied INFROMPAD : Boolean; -- unspecified Reserved_18_18 : HAL.Bit; -- Read-only. input signal to peripheral, after override is applied INTOPERI : Boolean; -- unspecified Reserved_20_23 : HAL.UInt4; -- Read-only. interrupt from pad before override is applied IRQFROMPAD : Boolean; -- unspecified Reserved_25_25 : HAL.Bit; -- Read-only. interrupt to processors, after override is applied IRQTOPROC : Boolean; -- unspecified Reserved_27_31 : HAL.UInt5; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO15_STATUS_Register use record Reserved_0_7 at 0 range 0 .. 7; OUTFROMPERI at 0 range 8 .. 8; OUTTOPAD at 0 range 9 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEFROMPERI at 0 range 12 .. 12; OETOPAD at 0 range 13 .. 13; Reserved_14_16 at 0 range 14 .. 16; INFROMPAD at 0 range 17 .. 17; Reserved_18_18 at 0 range 18 .. 18; INTOPERI at 0 range 19 .. 19; Reserved_20_23 at 0 range 20 .. 23; IRQFROMPAD at 0 range 24 .. 24; Reserved_25_25 at 0 range 25 .. 25; IRQTOPROC at 0 range 26 .. 26; Reserved_27_31 at 0 range 27 .. 31; end record; -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL type GPIO15_CTRL_FUNCSEL_Field is (SPI1_TX, UART0_RTS, I2C1_SCL, PWM_B_7, SIO_15, PIO0_15, PIO1_15, USB_MUXING_DIGITAL_DP, USB_MUXING_OVERCURR_DETECT, NULL_k) with Size => 5; for GPIO15_CTRL_FUNCSEL_Field use (SPI1_TX => 1, UART0_RTS => 2, I2C1_SCL => 3, PWM_B_7 => 4, SIO_15 => 5, PIO0_15 => 6, PIO1_15 => 7, USB_MUXING_DIGITAL_DP => 8, USB_MUXING_OVERCURR_DETECT => 9, NULL_k => 31); type GPIO15_CTRL_OUTOVER_Field is (-- drive output from peripheral signal selected by funcsel Normal, -- drive output from inverse of peripheral signal selected by funcsel Invert, -- drive output low Low, -- drive output high High) with Size => 2; for GPIO15_CTRL_OUTOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO15_CTRL_OEOVER_Field is (-- drive output enable from peripheral signal selected by funcsel Normal, -- drive output enable from inverse of peripheral signal selected by funcsel Invert, -- disable output Disable, -- enable output Enable) with Size => 2; for GPIO15_CTRL_OEOVER_Field use (Normal => 0, Invert => 1, Disable => 2, Enable => 3); type GPIO15_CTRL_INOVER_Field is (-- don't invert the peri input Normal, -- invert the peri input Invert, -- drive peri input low Low, -- drive peri input high High) with Size => 2; for GPIO15_CTRL_INOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO15_CTRL_IRQOVER_Field is (-- don't invert the interrupt Normal, -- invert the interrupt Invert, -- drive interrupt low Low, -- drive interrupt high High) with Size => 2; for GPIO15_CTRL_IRQOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); -- GPIO control including function select and overrides. type GPIO15_CTRL_Register is record -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL FUNCSEL : GPIO15_CTRL_FUNCSEL_Field := RP_SVD.IO_BANK0.NULL_k; -- unspecified Reserved_5_7 : HAL.UInt3 := 16#0#; OUTOVER : GPIO15_CTRL_OUTOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_10_11 : HAL.UInt2 := 16#0#; OEOVER : GPIO15_CTRL_OEOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_14_15 : HAL.UInt2 := 16#0#; INOVER : GPIO15_CTRL_INOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; IRQOVER : GPIO15_CTRL_IRQOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_30_31 : HAL.UInt2 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO15_CTRL_Register use record FUNCSEL at 0 range 0 .. 4; Reserved_5_7 at 0 range 5 .. 7; OUTOVER at 0 range 8 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEOVER at 0 range 12 .. 13; Reserved_14_15 at 0 range 14 .. 15; INOVER at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; IRQOVER at 0 range 28 .. 29; Reserved_30_31 at 0 range 30 .. 31; end record; -- GPIO status type GPIO16_STATUS_Register is record -- unspecified Reserved_0_7 : HAL.UInt8; -- Read-only. output signal from selected peripheral, before register -- override is applied OUTFROMPERI : Boolean; -- Read-only. output signal to pad after register override is applied OUTTOPAD : Boolean; -- unspecified Reserved_10_11 : HAL.UInt2; -- Read-only. output enable from selected peripheral, before register -- override is applied OEFROMPERI : Boolean; -- Read-only. output enable to pad after register override is applied OETOPAD : Boolean; -- unspecified Reserved_14_16 : HAL.UInt3; -- Read-only. input signal from pad, before override is applied INFROMPAD : Boolean; -- unspecified Reserved_18_18 : HAL.Bit; -- Read-only. input signal to peripheral, after override is applied INTOPERI : Boolean; -- unspecified Reserved_20_23 : HAL.UInt4; -- Read-only. interrupt from pad before override is applied IRQFROMPAD : Boolean; -- unspecified Reserved_25_25 : HAL.Bit; -- Read-only. interrupt to processors, after override is applied IRQTOPROC : Boolean; -- unspecified Reserved_27_31 : HAL.UInt5; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO16_STATUS_Register use record Reserved_0_7 at 0 range 0 .. 7; OUTFROMPERI at 0 range 8 .. 8; OUTTOPAD at 0 range 9 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEFROMPERI at 0 range 12 .. 12; OETOPAD at 0 range 13 .. 13; Reserved_14_16 at 0 range 14 .. 16; INFROMPAD at 0 range 17 .. 17; Reserved_18_18 at 0 range 18 .. 18; INTOPERI at 0 range 19 .. 19; Reserved_20_23 at 0 range 20 .. 23; IRQFROMPAD at 0 range 24 .. 24; Reserved_25_25 at 0 range 25 .. 25; IRQTOPROC at 0 range 26 .. 26; Reserved_27_31 at 0 range 27 .. 31; end record; -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL type GPIO16_CTRL_FUNCSEL_Field is (SPI0_RX, UART0_TX, I2C0_SDA, PWM_A_0, SIO_16, PIO0_16, PIO1_16, USB_MUXING_DIGITAL_DM, USB_MUXING_VBUS_DETECT, NULL_k) with Size => 5; for GPIO16_CTRL_FUNCSEL_Field use (SPI0_RX => 1, UART0_TX => 2, I2C0_SDA => 3, PWM_A_0 => 4, SIO_16 => 5, PIO0_16 => 6, PIO1_16 => 7, USB_MUXING_DIGITAL_DM => 8, USB_MUXING_VBUS_DETECT => 9, NULL_k => 31); type GPIO16_CTRL_OUTOVER_Field is (-- drive output from peripheral signal selected by funcsel Normal, -- drive output from inverse of peripheral signal selected by funcsel Invert, -- drive output low Low, -- drive output high High) with Size => 2; for GPIO16_CTRL_OUTOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO16_CTRL_OEOVER_Field is (-- drive output enable from peripheral signal selected by funcsel Normal, -- drive output enable from inverse of peripheral signal selected by funcsel Invert, -- disable output Disable, -- enable output Enable) with Size => 2; for GPIO16_CTRL_OEOVER_Field use (Normal => 0, Invert => 1, Disable => 2, Enable => 3); type GPIO16_CTRL_INOVER_Field is (-- don't invert the peri input Normal, -- invert the peri input Invert, -- drive peri input low Low, -- drive peri input high High) with Size => 2; for GPIO16_CTRL_INOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO16_CTRL_IRQOVER_Field is (-- don't invert the interrupt Normal, -- invert the interrupt Invert, -- drive interrupt low Low, -- drive interrupt high High) with Size => 2; for GPIO16_CTRL_IRQOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); -- GPIO control including function select and overrides. type GPIO16_CTRL_Register is record -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL FUNCSEL : GPIO16_CTRL_FUNCSEL_Field := RP_SVD.IO_BANK0.NULL_k; -- unspecified Reserved_5_7 : HAL.UInt3 := 16#0#; OUTOVER : GPIO16_CTRL_OUTOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_10_11 : HAL.UInt2 := 16#0#; OEOVER : GPIO16_CTRL_OEOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_14_15 : HAL.UInt2 := 16#0#; INOVER : GPIO16_CTRL_INOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; IRQOVER : GPIO16_CTRL_IRQOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_30_31 : HAL.UInt2 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO16_CTRL_Register use record FUNCSEL at 0 range 0 .. 4; Reserved_5_7 at 0 range 5 .. 7; OUTOVER at 0 range 8 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEOVER at 0 range 12 .. 13; Reserved_14_15 at 0 range 14 .. 15; INOVER at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; IRQOVER at 0 range 28 .. 29; Reserved_30_31 at 0 range 30 .. 31; end record; -- GPIO status type GPIO17_STATUS_Register is record -- unspecified Reserved_0_7 : HAL.UInt8; -- Read-only. output signal from selected peripheral, before register -- override is applied OUTFROMPERI : Boolean; -- Read-only. output signal to pad after register override is applied OUTTOPAD : Boolean; -- unspecified Reserved_10_11 : HAL.UInt2; -- Read-only. output enable from selected peripheral, before register -- override is applied OEFROMPERI : Boolean; -- Read-only. output enable to pad after register override is applied OETOPAD : Boolean; -- unspecified Reserved_14_16 : HAL.UInt3; -- Read-only. input signal from pad, before override is applied INFROMPAD : Boolean; -- unspecified Reserved_18_18 : HAL.Bit; -- Read-only. input signal to peripheral, after override is applied INTOPERI : Boolean; -- unspecified Reserved_20_23 : HAL.UInt4; -- Read-only. interrupt from pad before override is applied IRQFROMPAD : Boolean; -- unspecified Reserved_25_25 : HAL.Bit; -- Read-only. interrupt to processors, after override is applied IRQTOPROC : Boolean; -- unspecified Reserved_27_31 : HAL.UInt5; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO17_STATUS_Register use record Reserved_0_7 at 0 range 0 .. 7; OUTFROMPERI at 0 range 8 .. 8; OUTTOPAD at 0 range 9 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEFROMPERI at 0 range 12 .. 12; OETOPAD at 0 range 13 .. 13; Reserved_14_16 at 0 range 14 .. 16; INFROMPAD at 0 range 17 .. 17; Reserved_18_18 at 0 range 18 .. 18; INTOPERI at 0 range 19 .. 19; Reserved_20_23 at 0 range 20 .. 23; IRQFROMPAD at 0 range 24 .. 24; Reserved_25_25 at 0 range 25 .. 25; IRQTOPROC at 0 range 26 .. 26; Reserved_27_31 at 0 range 27 .. 31; end record; -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL type GPIO17_CTRL_FUNCSEL_Field is (SPI0_SS_N, UART0_RX, I2C0_SCL, PWM_B_0, SIO_17, PIO0_17, PIO1_17, USB_MUXING_VBUS_EN, NULL_k) with Size => 5; for GPIO17_CTRL_FUNCSEL_Field use (SPI0_SS_N => 1, UART0_RX => 2, I2C0_SCL => 3, PWM_B_0 => 4, SIO_17 => 5, PIO0_17 => 6, PIO1_17 => 7, USB_MUXING_VBUS_EN => 9, NULL_k => 31); type GPIO17_CTRL_OUTOVER_Field is (-- drive output from peripheral signal selected by funcsel Normal, -- drive output from inverse of peripheral signal selected by funcsel Invert, -- drive output low Low, -- drive output high High) with Size => 2; for GPIO17_CTRL_OUTOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO17_CTRL_OEOVER_Field is (-- drive output enable from peripheral signal selected by funcsel Normal, -- drive output enable from inverse of peripheral signal selected by funcsel Invert, -- disable output Disable, -- enable output Enable) with Size => 2; for GPIO17_CTRL_OEOVER_Field use (Normal => 0, Invert => 1, Disable => 2, Enable => 3); type GPIO17_CTRL_INOVER_Field is (-- don't invert the peri input Normal, -- invert the peri input Invert, -- drive peri input low Low, -- drive peri input high High) with Size => 2; for GPIO17_CTRL_INOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO17_CTRL_IRQOVER_Field is (-- don't invert the interrupt Normal, -- invert the interrupt Invert, -- drive interrupt low Low, -- drive interrupt high High) with Size => 2; for GPIO17_CTRL_IRQOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); -- GPIO control including function select and overrides. type GPIO17_CTRL_Register is record -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL FUNCSEL : GPIO17_CTRL_FUNCSEL_Field := RP_SVD.IO_BANK0.NULL_k; -- unspecified Reserved_5_7 : HAL.UInt3 := 16#0#; OUTOVER : GPIO17_CTRL_OUTOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_10_11 : HAL.UInt2 := 16#0#; OEOVER : GPIO17_CTRL_OEOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_14_15 : HAL.UInt2 := 16#0#; INOVER : GPIO17_CTRL_INOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; IRQOVER : GPIO17_CTRL_IRQOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_30_31 : HAL.UInt2 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO17_CTRL_Register use record FUNCSEL at 0 range 0 .. 4; Reserved_5_7 at 0 range 5 .. 7; OUTOVER at 0 range 8 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEOVER at 0 range 12 .. 13; Reserved_14_15 at 0 range 14 .. 15; INOVER at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; IRQOVER at 0 range 28 .. 29; Reserved_30_31 at 0 range 30 .. 31; end record; -- GPIO status type GPIO18_STATUS_Register is record -- unspecified Reserved_0_7 : HAL.UInt8; -- Read-only. output signal from selected peripheral, before register -- override is applied OUTFROMPERI : Boolean; -- Read-only. output signal to pad after register override is applied OUTTOPAD : Boolean; -- unspecified Reserved_10_11 : HAL.UInt2; -- Read-only. output enable from selected peripheral, before register -- override is applied OEFROMPERI : Boolean; -- Read-only. output enable to pad after register override is applied OETOPAD : Boolean; -- unspecified Reserved_14_16 : HAL.UInt3; -- Read-only. input signal from pad, before override is applied INFROMPAD : Boolean; -- unspecified Reserved_18_18 : HAL.Bit; -- Read-only. input signal to peripheral, after override is applied INTOPERI : Boolean; -- unspecified Reserved_20_23 : HAL.UInt4; -- Read-only. interrupt from pad before override is applied IRQFROMPAD : Boolean; -- unspecified Reserved_25_25 : HAL.Bit; -- Read-only. interrupt to processors, after override is applied IRQTOPROC : Boolean; -- unspecified Reserved_27_31 : HAL.UInt5; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO18_STATUS_Register use record Reserved_0_7 at 0 range 0 .. 7; OUTFROMPERI at 0 range 8 .. 8; OUTTOPAD at 0 range 9 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEFROMPERI at 0 range 12 .. 12; OETOPAD at 0 range 13 .. 13; Reserved_14_16 at 0 range 14 .. 16; INFROMPAD at 0 range 17 .. 17; Reserved_18_18 at 0 range 18 .. 18; INTOPERI at 0 range 19 .. 19; Reserved_20_23 at 0 range 20 .. 23; IRQFROMPAD at 0 range 24 .. 24; Reserved_25_25 at 0 range 25 .. 25; IRQTOPROC at 0 range 26 .. 26; Reserved_27_31 at 0 range 27 .. 31; end record; -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL type GPIO18_CTRL_FUNCSEL_Field is (SPI0_SCLK, UART0_CTS, I2C1_SDA, PWM_A_1, SIO_18, PIO0_18, PIO1_18, USB_MUXING_OVERCURR_DETECT, NULL_k) with Size => 5; for GPIO18_CTRL_FUNCSEL_Field use (SPI0_SCLK => 1, UART0_CTS => 2, I2C1_SDA => 3, PWM_A_1 => 4, SIO_18 => 5, PIO0_18 => 6, PIO1_18 => 7, USB_MUXING_OVERCURR_DETECT => 9, NULL_k => 31); type GPIO18_CTRL_OUTOVER_Field is (-- drive output from peripheral signal selected by funcsel Normal, -- drive output from inverse of peripheral signal selected by funcsel Invert, -- drive output low Low, -- drive output high High) with Size => 2; for GPIO18_CTRL_OUTOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO18_CTRL_OEOVER_Field is (-- drive output enable from peripheral signal selected by funcsel Normal, -- drive output enable from inverse of peripheral signal selected by funcsel Invert, -- disable output Disable, -- enable output Enable) with Size => 2; for GPIO18_CTRL_OEOVER_Field use (Normal => 0, Invert => 1, Disable => 2, Enable => 3); type GPIO18_CTRL_INOVER_Field is (-- don't invert the peri input Normal, -- invert the peri input Invert, -- drive peri input low Low, -- drive peri input high High) with Size => 2; for GPIO18_CTRL_INOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO18_CTRL_IRQOVER_Field is (-- don't invert the interrupt Normal, -- invert the interrupt Invert, -- drive interrupt low Low, -- drive interrupt high High) with Size => 2; for GPIO18_CTRL_IRQOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); -- GPIO control including function select and overrides. type GPIO18_CTRL_Register is record -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL FUNCSEL : GPIO18_CTRL_FUNCSEL_Field := RP_SVD.IO_BANK0.NULL_k; -- unspecified Reserved_5_7 : HAL.UInt3 := 16#0#; OUTOVER : GPIO18_CTRL_OUTOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_10_11 : HAL.UInt2 := 16#0#; OEOVER : GPIO18_CTRL_OEOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_14_15 : HAL.UInt2 := 16#0#; INOVER : GPIO18_CTRL_INOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; IRQOVER : GPIO18_CTRL_IRQOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_30_31 : HAL.UInt2 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO18_CTRL_Register use record FUNCSEL at 0 range 0 .. 4; Reserved_5_7 at 0 range 5 .. 7; OUTOVER at 0 range 8 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEOVER at 0 range 12 .. 13; Reserved_14_15 at 0 range 14 .. 15; INOVER at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; IRQOVER at 0 range 28 .. 29; Reserved_30_31 at 0 range 30 .. 31; end record; -- GPIO status type GPIO19_STATUS_Register is record -- unspecified Reserved_0_7 : HAL.UInt8; -- Read-only. output signal from selected peripheral, before register -- override is applied OUTFROMPERI : Boolean; -- Read-only. output signal to pad after register override is applied OUTTOPAD : Boolean; -- unspecified Reserved_10_11 : HAL.UInt2; -- Read-only. output enable from selected peripheral, before register -- override is applied OEFROMPERI : Boolean; -- Read-only. output enable to pad after register override is applied OETOPAD : Boolean; -- unspecified Reserved_14_16 : HAL.UInt3; -- Read-only. input signal from pad, before override is applied INFROMPAD : Boolean; -- unspecified Reserved_18_18 : HAL.Bit; -- Read-only. input signal to peripheral, after override is applied INTOPERI : Boolean; -- unspecified Reserved_20_23 : HAL.UInt4; -- Read-only. interrupt from pad before override is applied IRQFROMPAD : Boolean; -- unspecified Reserved_25_25 : HAL.Bit; -- Read-only. interrupt to processors, after override is applied IRQTOPROC : Boolean; -- unspecified Reserved_27_31 : HAL.UInt5; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO19_STATUS_Register use record Reserved_0_7 at 0 range 0 .. 7; OUTFROMPERI at 0 range 8 .. 8; OUTTOPAD at 0 range 9 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEFROMPERI at 0 range 12 .. 12; OETOPAD at 0 range 13 .. 13; Reserved_14_16 at 0 range 14 .. 16; INFROMPAD at 0 range 17 .. 17; Reserved_18_18 at 0 range 18 .. 18; INTOPERI at 0 range 19 .. 19; Reserved_20_23 at 0 range 20 .. 23; IRQFROMPAD at 0 range 24 .. 24; Reserved_25_25 at 0 range 25 .. 25; IRQTOPROC at 0 range 26 .. 26; Reserved_27_31 at 0 range 27 .. 31; end record; -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL type GPIO19_CTRL_FUNCSEL_Field is (SPI0_TX, UART0_RTS, I2C1_SCL, PWM_B_1, SIO_19, PIO0_19, PIO1_19, USB_MUXING_VBUS_DETECT, NULL_k) with Size => 5; for GPIO19_CTRL_FUNCSEL_Field use (SPI0_TX => 1, UART0_RTS => 2, I2C1_SCL => 3, PWM_B_1 => 4, SIO_19 => 5, PIO0_19 => 6, PIO1_19 => 7, USB_MUXING_VBUS_DETECT => 9, NULL_k => 31); type GPIO19_CTRL_OUTOVER_Field is (-- drive output from peripheral signal selected by funcsel Normal, -- drive output from inverse of peripheral signal selected by funcsel Invert, -- drive output low Low, -- drive output high High) with Size => 2; for GPIO19_CTRL_OUTOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO19_CTRL_OEOVER_Field is (-- drive output enable from peripheral signal selected by funcsel Normal, -- drive output enable from inverse of peripheral signal selected by funcsel Invert, -- disable output Disable, -- enable output Enable) with Size => 2; for GPIO19_CTRL_OEOVER_Field use (Normal => 0, Invert => 1, Disable => 2, Enable => 3); type GPIO19_CTRL_INOVER_Field is (-- don't invert the peri input Normal, -- invert the peri input Invert, -- drive peri input low Low, -- drive peri input high High) with Size => 2; for GPIO19_CTRL_INOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO19_CTRL_IRQOVER_Field is (-- don't invert the interrupt Normal, -- invert the interrupt Invert, -- drive interrupt low Low, -- drive interrupt high High) with Size => 2; for GPIO19_CTRL_IRQOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); -- GPIO control including function select and overrides. type GPIO19_CTRL_Register is record -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL FUNCSEL : GPIO19_CTRL_FUNCSEL_Field := RP_SVD.IO_BANK0.NULL_k; -- unspecified Reserved_5_7 : HAL.UInt3 := 16#0#; OUTOVER : GPIO19_CTRL_OUTOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_10_11 : HAL.UInt2 := 16#0#; OEOVER : GPIO19_CTRL_OEOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_14_15 : HAL.UInt2 := 16#0#; INOVER : GPIO19_CTRL_INOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; IRQOVER : GPIO19_CTRL_IRQOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_30_31 : HAL.UInt2 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO19_CTRL_Register use record FUNCSEL at 0 range 0 .. 4; Reserved_5_7 at 0 range 5 .. 7; OUTOVER at 0 range 8 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEOVER at 0 range 12 .. 13; Reserved_14_15 at 0 range 14 .. 15; INOVER at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; IRQOVER at 0 range 28 .. 29; Reserved_30_31 at 0 range 30 .. 31; end record; -- GPIO status type GPIO20_STATUS_Register is record -- unspecified Reserved_0_7 : HAL.UInt8; -- Read-only. output signal from selected peripheral, before register -- override is applied OUTFROMPERI : Boolean; -- Read-only. output signal to pad after register override is applied OUTTOPAD : Boolean; -- unspecified Reserved_10_11 : HAL.UInt2; -- Read-only. output enable from selected peripheral, before register -- override is applied OEFROMPERI : Boolean; -- Read-only. output enable to pad after register override is applied OETOPAD : Boolean; -- unspecified Reserved_14_16 : HAL.UInt3; -- Read-only. input signal from pad, before override is applied INFROMPAD : Boolean; -- unspecified Reserved_18_18 : HAL.Bit; -- Read-only. input signal to peripheral, after override is applied INTOPERI : Boolean; -- unspecified Reserved_20_23 : HAL.UInt4; -- Read-only. interrupt from pad before override is applied IRQFROMPAD : Boolean; -- unspecified Reserved_25_25 : HAL.Bit; -- Read-only. interrupt to processors, after override is applied IRQTOPROC : Boolean; -- unspecified Reserved_27_31 : HAL.UInt5; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO20_STATUS_Register use record Reserved_0_7 at 0 range 0 .. 7; OUTFROMPERI at 0 range 8 .. 8; OUTTOPAD at 0 range 9 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEFROMPERI at 0 range 12 .. 12; OETOPAD at 0 range 13 .. 13; Reserved_14_16 at 0 range 14 .. 16; INFROMPAD at 0 range 17 .. 17; Reserved_18_18 at 0 range 18 .. 18; INTOPERI at 0 range 19 .. 19; Reserved_20_23 at 0 range 20 .. 23; IRQFROMPAD at 0 range 24 .. 24; Reserved_25_25 at 0 range 25 .. 25; IRQTOPROC at 0 range 26 .. 26; Reserved_27_31 at 0 range 27 .. 31; end record; -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL type GPIO20_CTRL_FUNCSEL_Field is (SPI0_RX, UART1_TX, I2C0_SDA, PWM_A_2, SIO_20, PIO0_20, PIO1_20, CLOCKS_GPIN_0, USB_MUXING_VBUS_EN, NULL_k) with Size => 5; for GPIO20_CTRL_FUNCSEL_Field use (SPI0_RX => 1, UART1_TX => 2, I2C0_SDA => 3, PWM_A_2 => 4, SIO_20 => 5, PIO0_20 => 6, PIO1_20 => 7, CLOCKS_GPIN_0 => 8, USB_MUXING_VBUS_EN => 9, NULL_k => 31); type GPIO20_CTRL_OUTOVER_Field is (-- drive output from peripheral signal selected by funcsel Normal, -- drive output from inverse of peripheral signal selected by funcsel Invert, -- drive output low Low, -- drive output high High) with Size => 2; for GPIO20_CTRL_OUTOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO20_CTRL_OEOVER_Field is (-- drive output enable from peripheral signal selected by funcsel Normal, -- drive output enable from inverse of peripheral signal selected by funcsel Invert, -- disable output Disable, -- enable output Enable) with Size => 2; for GPIO20_CTRL_OEOVER_Field use (Normal => 0, Invert => 1, Disable => 2, Enable => 3); type GPIO20_CTRL_INOVER_Field is (-- don't invert the peri input Normal, -- invert the peri input Invert, -- drive peri input low Low, -- drive peri input high High) with Size => 2; for GPIO20_CTRL_INOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO20_CTRL_IRQOVER_Field is (-- don't invert the interrupt Normal, -- invert the interrupt Invert, -- drive interrupt low Low, -- drive interrupt high High) with Size => 2; for GPIO20_CTRL_IRQOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); -- GPIO control including function select and overrides. type GPIO20_CTRL_Register is record -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL FUNCSEL : GPIO20_CTRL_FUNCSEL_Field := RP_SVD.IO_BANK0.NULL_k; -- unspecified Reserved_5_7 : HAL.UInt3 := 16#0#; OUTOVER : GPIO20_CTRL_OUTOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_10_11 : HAL.UInt2 := 16#0#; OEOVER : GPIO20_CTRL_OEOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_14_15 : HAL.UInt2 := 16#0#; INOVER : GPIO20_CTRL_INOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; IRQOVER : GPIO20_CTRL_IRQOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_30_31 : HAL.UInt2 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO20_CTRL_Register use record FUNCSEL at 0 range 0 .. 4; Reserved_5_7 at 0 range 5 .. 7; OUTOVER at 0 range 8 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEOVER at 0 range 12 .. 13; Reserved_14_15 at 0 range 14 .. 15; INOVER at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; IRQOVER at 0 range 28 .. 29; Reserved_30_31 at 0 range 30 .. 31; end record; -- GPIO status type GPIO21_STATUS_Register is record -- unspecified Reserved_0_7 : HAL.UInt8; -- Read-only. output signal from selected peripheral, before register -- override is applied OUTFROMPERI : Boolean; -- Read-only. output signal to pad after register override is applied OUTTOPAD : Boolean; -- unspecified Reserved_10_11 : HAL.UInt2; -- Read-only. output enable from selected peripheral, before register -- override is applied OEFROMPERI : Boolean; -- Read-only. output enable to pad after register override is applied OETOPAD : Boolean; -- unspecified Reserved_14_16 : HAL.UInt3; -- Read-only. input signal from pad, before override is applied INFROMPAD : Boolean; -- unspecified Reserved_18_18 : HAL.Bit; -- Read-only. input signal to peripheral, after override is applied INTOPERI : Boolean; -- unspecified Reserved_20_23 : HAL.UInt4; -- Read-only. interrupt from pad before override is applied IRQFROMPAD : Boolean; -- unspecified Reserved_25_25 : HAL.Bit; -- Read-only. interrupt to processors, after override is applied IRQTOPROC : Boolean; -- unspecified Reserved_27_31 : HAL.UInt5; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO21_STATUS_Register use record Reserved_0_7 at 0 range 0 .. 7; OUTFROMPERI at 0 range 8 .. 8; OUTTOPAD at 0 range 9 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEFROMPERI at 0 range 12 .. 12; OETOPAD at 0 range 13 .. 13; Reserved_14_16 at 0 range 14 .. 16; INFROMPAD at 0 range 17 .. 17; Reserved_18_18 at 0 range 18 .. 18; INTOPERI at 0 range 19 .. 19; Reserved_20_23 at 0 range 20 .. 23; IRQFROMPAD at 0 range 24 .. 24; Reserved_25_25 at 0 range 25 .. 25; IRQTOPROC at 0 range 26 .. 26; Reserved_27_31 at 0 range 27 .. 31; end record; -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL type GPIO21_CTRL_FUNCSEL_Field is (SPI0_SS_N, UART1_RX, I2C0_SCL, PWM_B_2, SIO_21, PIO0_21, PIO1_21, CLOCKS_GPOUT_0, USB_MUXING_OVERCURR_DETECT, NULL_k) with Size => 5; for GPIO21_CTRL_FUNCSEL_Field use (SPI0_SS_N => 1, UART1_RX => 2, I2C0_SCL => 3, PWM_B_2 => 4, SIO_21 => 5, PIO0_21 => 6, PIO1_21 => 7, CLOCKS_GPOUT_0 => 8, USB_MUXING_OVERCURR_DETECT => 9, NULL_k => 31); type GPIO21_CTRL_OUTOVER_Field is (-- drive output from peripheral signal selected by funcsel Normal, -- drive output from inverse of peripheral signal selected by funcsel Invert, -- drive output low Low, -- drive output high High) with Size => 2; for GPIO21_CTRL_OUTOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO21_CTRL_OEOVER_Field is (-- drive output enable from peripheral signal selected by funcsel Normal, -- drive output enable from inverse of peripheral signal selected by funcsel Invert, -- disable output Disable, -- enable output Enable) with Size => 2; for GPIO21_CTRL_OEOVER_Field use (Normal => 0, Invert => 1, Disable => 2, Enable => 3); type GPIO21_CTRL_INOVER_Field is (-- don't invert the peri input Normal, -- invert the peri input Invert, -- drive peri input low Low, -- drive peri input high High) with Size => 2; for GPIO21_CTRL_INOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO21_CTRL_IRQOVER_Field is (-- don't invert the interrupt Normal, -- invert the interrupt Invert, -- drive interrupt low Low, -- drive interrupt high High) with Size => 2; for GPIO21_CTRL_IRQOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); -- GPIO control including function select and overrides. type GPIO21_CTRL_Register is record -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL FUNCSEL : GPIO21_CTRL_FUNCSEL_Field := RP_SVD.IO_BANK0.NULL_k; -- unspecified Reserved_5_7 : HAL.UInt3 := 16#0#; OUTOVER : GPIO21_CTRL_OUTOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_10_11 : HAL.UInt2 := 16#0#; OEOVER : GPIO21_CTRL_OEOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_14_15 : HAL.UInt2 := 16#0#; INOVER : GPIO21_CTRL_INOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; IRQOVER : GPIO21_CTRL_IRQOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_30_31 : HAL.UInt2 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO21_CTRL_Register use record FUNCSEL at 0 range 0 .. 4; Reserved_5_7 at 0 range 5 .. 7; OUTOVER at 0 range 8 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEOVER at 0 range 12 .. 13; Reserved_14_15 at 0 range 14 .. 15; INOVER at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; IRQOVER at 0 range 28 .. 29; Reserved_30_31 at 0 range 30 .. 31; end record; -- GPIO status type GPIO22_STATUS_Register is record -- unspecified Reserved_0_7 : HAL.UInt8; -- Read-only. output signal from selected peripheral, before register -- override is applied OUTFROMPERI : Boolean; -- Read-only. output signal to pad after register override is applied OUTTOPAD : Boolean; -- unspecified Reserved_10_11 : HAL.UInt2; -- Read-only. output enable from selected peripheral, before register -- override is applied OEFROMPERI : Boolean; -- Read-only. output enable to pad after register override is applied OETOPAD : Boolean; -- unspecified Reserved_14_16 : HAL.UInt3; -- Read-only. input signal from pad, before override is applied INFROMPAD : Boolean; -- unspecified Reserved_18_18 : HAL.Bit; -- Read-only. input signal to peripheral, after override is applied INTOPERI : Boolean; -- unspecified Reserved_20_23 : HAL.UInt4; -- Read-only. interrupt from pad before override is applied IRQFROMPAD : Boolean; -- unspecified Reserved_25_25 : HAL.Bit; -- Read-only. interrupt to processors, after override is applied IRQTOPROC : Boolean; -- unspecified Reserved_27_31 : HAL.UInt5; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO22_STATUS_Register use record Reserved_0_7 at 0 range 0 .. 7; OUTFROMPERI at 0 range 8 .. 8; OUTTOPAD at 0 range 9 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEFROMPERI at 0 range 12 .. 12; OETOPAD at 0 range 13 .. 13; Reserved_14_16 at 0 range 14 .. 16; INFROMPAD at 0 range 17 .. 17; Reserved_18_18 at 0 range 18 .. 18; INTOPERI at 0 range 19 .. 19; Reserved_20_23 at 0 range 20 .. 23; IRQFROMPAD at 0 range 24 .. 24; Reserved_25_25 at 0 range 25 .. 25; IRQTOPROC at 0 range 26 .. 26; Reserved_27_31 at 0 range 27 .. 31; end record; -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL type GPIO22_CTRL_FUNCSEL_Field is (SPI0_SCLK, UART1_CTS, I2C1_SDA, PWM_A_3, SIO_22, PIO0_22, PIO1_22, CLOCKS_GPIN_1, USB_MUXING_VBUS_DETECT, NULL_k) with Size => 5; for GPIO22_CTRL_FUNCSEL_Field use (SPI0_SCLK => 1, UART1_CTS => 2, I2C1_SDA => 3, PWM_A_3 => 4, SIO_22 => 5, PIO0_22 => 6, PIO1_22 => 7, CLOCKS_GPIN_1 => 8, USB_MUXING_VBUS_DETECT => 9, NULL_k => 31); type GPIO22_CTRL_OUTOVER_Field is (-- drive output from peripheral signal selected by funcsel Normal, -- drive output from inverse of peripheral signal selected by funcsel Invert, -- drive output low Low, -- drive output high High) with Size => 2; for GPIO22_CTRL_OUTOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO22_CTRL_OEOVER_Field is (-- drive output enable from peripheral signal selected by funcsel Normal, -- drive output enable from inverse of peripheral signal selected by funcsel Invert, -- disable output Disable, -- enable output Enable) with Size => 2; for GPIO22_CTRL_OEOVER_Field use (Normal => 0, Invert => 1, Disable => 2, Enable => 3); type GPIO22_CTRL_INOVER_Field is (-- don't invert the peri input Normal, -- invert the peri input Invert, -- drive peri input low Low, -- drive peri input high High) with Size => 2; for GPIO22_CTRL_INOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO22_CTRL_IRQOVER_Field is (-- don't invert the interrupt Normal, -- invert the interrupt Invert, -- drive interrupt low Low, -- drive interrupt high High) with Size => 2; for GPIO22_CTRL_IRQOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); -- GPIO control including function select and overrides. type GPIO22_CTRL_Register is record -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL FUNCSEL : GPIO22_CTRL_FUNCSEL_Field := RP_SVD.IO_BANK0.NULL_k; -- unspecified Reserved_5_7 : HAL.UInt3 := 16#0#; OUTOVER : GPIO22_CTRL_OUTOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_10_11 : HAL.UInt2 := 16#0#; OEOVER : GPIO22_CTRL_OEOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_14_15 : HAL.UInt2 := 16#0#; INOVER : GPIO22_CTRL_INOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; IRQOVER : GPIO22_CTRL_IRQOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_30_31 : HAL.UInt2 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO22_CTRL_Register use record FUNCSEL at 0 range 0 .. 4; Reserved_5_7 at 0 range 5 .. 7; OUTOVER at 0 range 8 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEOVER at 0 range 12 .. 13; Reserved_14_15 at 0 range 14 .. 15; INOVER at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; IRQOVER at 0 range 28 .. 29; Reserved_30_31 at 0 range 30 .. 31; end record; -- GPIO status type GPIO23_STATUS_Register is record -- unspecified Reserved_0_7 : HAL.UInt8; -- Read-only. output signal from selected peripheral, before register -- override is applied OUTFROMPERI : Boolean; -- Read-only. output signal to pad after register override is applied OUTTOPAD : Boolean; -- unspecified Reserved_10_11 : HAL.UInt2; -- Read-only. output enable from selected peripheral, before register -- override is applied OEFROMPERI : Boolean; -- Read-only. output enable to pad after register override is applied OETOPAD : Boolean; -- unspecified Reserved_14_16 : HAL.UInt3; -- Read-only. input signal from pad, before override is applied INFROMPAD : Boolean; -- unspecified Reserved_18_18 : HAL.Bit; -- Read-only. input signal to peripheral, after override is applied INTOPERI : Boolean; -- unspecified Reserved_20_23 : HAL.UInt4; -- Read-only. interrupt from pad before override is applied IRQFROMPAD : Boolean; -- unspecified Reserved_25_25 : HAL.Bit; -- Read-only. interrupt to processors, after override is applied IRQTOPROC : Boolean; -- unspecified Reserved_27_31 : HAL.UInt5; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO23_STATUS_Register use record Reserved_0_7 at 0 range 0 .. 7; OUTFROMPERI at 0 range 8 .. 8; OUTTOPAD at 0 range 9 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEFROMPERI at 0 range 12 .. 12; OETOPAD at 0 range 13 .. 13; Reserved_14_16 at 0 range 14 .. 16; INFROMPAD at 0 range 17 .. 17; Reserved_18_18 at 0 range 18 .. 18; INTOPERI at 0 range 19 .. 19; Reserved_20_23 at 0 range 20 .. 23; IRQFROMPAD at 0 range 24 .. 24; Reserved_25_25 at 0 range 25 .. 25; IRQTOPROC at 0 range 26 .. 26; Reserved_27_31 at 0 range 27 .. 31; end record; -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL type GPIO23_CTRL_FUNCSEL_Field is (SPI0_TX, UART1_RTS, I2C1_SCL, PWM_B_3, SIO_23, PIO0_23, PIO1_23, CLOCKS_GPOUT_1, USB_MUXING_VBUS_EN, NULL_k) with Size => 5; for GPIO23_CTRL_FUNCSEL_Field use (SPI0_TX => 1, UART1_RTS => 2, I2C1_SCL => 3, PWM_B_3 => 4, SIO_23 => 5, PIO0_23 => 6, PIO1_23 => 7, CLOCKS_GPOUT_1 => 8, USB_MUXING_VBUS_EN => 9, NULL_k => 31); type GPIO23_CTRL_OUTOVER_Field is (-- drive output from peripheral signal selected by funcsel Normal, -- drive output from inverse of peripheral signal selected by funcsel Invert, -- drive output low Low, -- drive output high High) with Size => 2; for GPIO23_CTRL_OUTOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO23_CTRL_OEOVER_Field is (-- drive output enable from peripheral signal selected by funcsel Normal, -- drive output enable from inverse of peripheral signal selected by funcsel Invert, -- disable output Disable, -- enable output Enable) with Size => 2; for GPIO23_CTRL_OEOVER_Field use (Normal => 0, Invert => 1, Disable => 2, Enable => 3); type GPIO23_CTRL_INOVER_Field is (-- don't invert the peri input Normal, -- invert the peri input Invert, -- drive peri input low Low, -- drive peri input high High) with Size => 2; for GPIO23_CTRL_INOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO23_CTRL_IRQOVER_Field is (-- don't invert the interrupt Normal, -- invert the interrupt Invert, -- drive interrupt low Low, -- drive interrupt high High) with Size => 2; for GPIO23_CTRL_IRQOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); -- GPIO control including function select and overrides. type GPIO23_CTRL_Register is record -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL FUNCSEL : GPIO23_CTRL_FUNCSEL_Field := RP_SVD.IO_BANK0.NULL_k; -- unspecified Reserved_5_7 : HAL.UInt3 := 16#0#; OUTOVER : GPIO23_CTRL_OUTOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_10_11 : HAL.UInt2 := 16#0#; OEOVER : GPIO23_CTRL_OEOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_14_15 : HAL.UInt2 := 16#0#; INOVER : GPIO23_CTRL_INOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; IRQOVER : GPIO23_CTRL_IRQOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_30_31 : HAL.UInt2 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO23_CTRL_Register use record FUNCSEL at 0 range 0 .. 4; Reserved_5_7 at 0 range 5 .. 7; OUTOVER at 0 range 8 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEOVER at 0 range 12 .. 13; Reserved_14_15 at 0 range 14 .. 15; INOVER at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; IRQOVER at 0 range 28 .. 29; Reserved_30_31 at 0 range 30 .. 31; end record; -- GPIO status type GPIO24_STATUS_Register is record -- unspecified Reserved_0_7 : HAL.UInt8; -- Read-only. output signal from selected peripheral, before register -- override is applied OUTFROMPERI : Boolean; -- Read-only. output signal to pad after register override is applied OUTTOPAD : Boolean; -- unspecified Reserved_10_11 : HAL.UInt2; -- Read-only. output enable from selected peripheral, before register -- override is applied OEFROMPERI : Boolean; -- Read-only. output enable to pad after register override is applied OETOPAD : Boolean; -- unspecified Reserved_14_16 : HAL.UInt3; -- Read-only. input signal from pad, before override is applied INFROMPAD : Boolean; -- unspecified Reserved_18_18 : HAL.Bit; -- Read-only. input signal to peripheral, after override is applied INTOPERI : Boolean; -- unspecified Reserved_20_23 : HAL.UInt4; -- Read-only. interrupt from pad before override is applied IRQFROMPAD : Boolean; -- unspecified Reserved_25_25 : HAL.Bit; -- Read-only. interrupt to processors, after override is applied IRQTOPROC : Boolean; -- unspecified Reserved_27_31 : HAL.UInt5; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO24_STATUS_Register use record Reserved_0_7 at 0 range 0 .. 7; OUTFROMPERI at 0 range 8 .. 8; OUTTOPAD at 0 range 9 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEFROMPERI at 0 range 12 .. 12; OETOPAD at 0 range 13 .. 13; Reserved_14_16 at 0 range 14 .. 16; INFROMPAD at 0 range 17 .. 17; Reserved_18_18 at 0 range 18 .. 18; INTOPERI at 0 range 19 .. 19; Reserved_20_23 at 0 range 20 .. 23; IRQFROMPAD at 0 range 24 .. 24; Reserved_25_25 at 0 range 25 .. 25; IRQTOPROC at 0 range 26 .. 26; Reserved_27_31 at 0 range 27 .. 31; end record; -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL type GPIO24_CTRL_FUNCSEL_Field is (SPI1_RX, UART1_TX, I2C0_SDA, PWM_A_4, SIO_24, PIO0_24, PIO1_24, CLOCKS_GPOUT_2, USB_MUXING_OVERCURR_DETECT, NULL_k) with Size => 5; for GPIO24_CTRL_FUNCSEL_Field use (SPI1_RX => 1, UART1_TX => 2, I2C0_SDA => 3, PWM_A_4 => 4, SIO_24 => 5, PIO0_24 => 6, PIO1_24 => 7, CLOCKS_GPOUT_2 => 8, USB_MUXING_OVERCURR_DETECT => 9, NULL_k => 31); type GPIO24_CTRL_OUTOVER_Field is (-- drive output from peripheral signal selected by funcsel Normal, -- drive output from inverse of peripheral signal selected by funcsel Invert, -- drive output low Low, -- drive output high High) with Size => 2; for GPIO24_CTRL_OUTOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO24_CTRL_OEOVER_Field is (-- drive output enable from peripheral signal selected by funcsel Normal, -- drive output enable from inverse of peripheral signal selected by funcsel Invert, -- disable output Disable, -- enable output Enable) with Size => 2; for GPIO24_CTRL_OEOVER_Field use (Normal => 0, Invert => 1, Disable => 2, Enable => 3); type GPIO24_CTRL_INOVER_Field is (-- don't invert the peri input Normal, -- invert the peri input Invert, -- drive peri input low Low, -- drive peri input high High) with Size => 2; for GPIO24_CTRL_INOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO24_CTRL_IRQOVER_Field is (-- don't invert the interrupt Normal, -- invert the interrupt Invert, -- drive interrupt low Low, -- drive interrupt high High) with Size => 2; for GPIO24_CTRL_IRQOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); -- GPIO control including function select and overrides. type GPIO24_CTRL_Register is record -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL FUNCSEL : GPIO24_CTRL_FUNCSEL_Field := RP_SVD.IO_BANK0.NULL_k; -- unspecified Reserved_5_7 : HAL.UInt3 := 16#0#; OUTOVER : GPIO24_CTRL_OUTOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_10_11 : HAL.UInt2 := 16#0#; OEOVER : GPIO24_CTRL_OEOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_14_15 : HAL.UInt2 := 16#0#; INOVER : GPIO24_CTRL_INOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; IRQOVER : GPIO24_CTRL_IRQOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_30_31 : HAL.UInt2 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO24_CTRL_Register use record FUNCSEL at 0 range 0 .. 4; Reserved_5_7 at 0 range 5 .. 7; OUTOVER at 0 range 8 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEOVER at 0 range 12 .. 13; Reserved_14_15 at 0 range 14 .. 15; INOVER at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; IRQOVER at 0 range 28 .. 29; Reserved_30_31 at 0 range 30 .. 31; end record; -- GPIO status type GPIO25_STATUS_Register is record -- unspecified Reserved_0_7 : HAL.UInt8; -- Read-only. output signal from selected peripheral, before register -- override is applied OUTFROMPERI : Boolean; -- Read-only. output signal to pad after register override is applied OUTTOPAD : Boolean; -- unspecified Reserved_10_11 : HAL.UInt2; -- Read-only. output enable from selected peripheral, before register -- override is applied OEFROMPERI : Boolean; -- Read-only. output enable to pad after register override is applied OETOPAD : Boolean; -- unspecified Reserved_14_16 : HAL.UInt3; -- Read-only. input signal from pad, before override is applied INFROMPAD : Boolean; -- unspecified Reserved_18_18 : HAL.Bit; -- Read-only. input signal to peripheral, after override is applied INTOPERI : Boolean; -- unspecified Reserved_20_23 : HAL.UInt4; -- Read-only. interrupt from pad before override is applied IRQFROMPAD : Boolean; -- unspecified Reserved_25_25 : HAL.Bit; -- Read-only. interrupt to processors, after override is applied IRQTOPROC : Boolean; -- unspecified Reserved_27_31 : HAL.UInt5; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO25_STATUS_Register use record Reserved_0_7 at 0 range 0 .. 7; OUTFROMPERI at 0 range 8 .. 8; OUTTOPAD at 0 range 9 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEFROMPERI at 0 range 12 .. 12; OETOPAD at 0 range 13 .. 13; Reserved_14_16 at 0 range 14 .. 16; INFROMPAD at 0 range 17 .. 17; Reserved_18_18 at 0 range 18 .. 18; INTOPERI at 0 range 19 .. 19; Reserved_20_23 at 0 range 20 .. 23; IRQFROMPAD at 0 range 24 .. 24; Reserved_25_25 at 0 range 25 .. 25; IRQTOPROC at 0 range 26 .. 26; Reserved_27_31 at 0 range 27 .. 31; end record; -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL type GPIO25_CTRL_FUNCSEL_Field is (SPI1_SS_N, UART1_RX, I2C0_SCL, PWM_B_4, SIO_25, PIO0_25, PIO1_25, CLOCKS_GPOUT_3, USB_MUXING_VBUS_DETECT, NULL_k) with Size => 5; for GPIO25_CTRL_FUNCSEL_Field use (SPI1_SS_N => 1, UART1_RX => 2, I2C0_SCL => 3, PWM_B_4 => 4, SIO_25 => 5, PIO0_25 => 6, PIO1_25 => 7, CLOCKS_GPOUT_3 => 8, USB_MUXING_VBUS_DETECT => 9, NULL_k => 31); type GPIO25_CTRL_OUTOVER_Field is (-- drive output from peripheral signal selected by funcsel Normal, -- drive output from inverse of peripheral signal selected by funcsel Invert, -- drive output low Low, -- drive output high High) with Size => 2; for GPIO25_CTRL_OUTOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO25_CTRL_OEOVER_Field is (-- drive output enable from peripheral signal selected by funcsel Normal, -- drive output enable from inverse of peripheral signal selected by funcsel Invert, -- disable output Disable, -- enable output Enable) with Size => 2; for GPIO25_CTRL_OEOVER_Field use (Normal => 0, Invert => 1, Disable => 2, Enable => 3); type GPIO25_CTRL_INOVER_Field is (-- don't invert the peri input Normal, -- invert the peri input Invert, -- drive peri input low Low, -- drive peri input high High) with Size => 2; for GPIO25_CTRL_INOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO25_CTRL_IRQOVER_Field is (-- don't invert the interrupt Normal, -- invert the interrupt Invert, -- drive interrupt low Low, -- drive interrupt high High) with Size => 2; for GPIO25_CTRL_IRQOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); -- GPIO control including function select and overrides. type GPIO25_CTRL_Register is record -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL FUNCSEL : GPIO25_CTRL_FUNCSEL_Field := RP_SVD.IO_BANK0.NULL_k; -- unspecified Reserved_5_7 : HAL.UInt3 := 16#0#; OUTOVER : GPIO25_CTRL_OUTOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_10_11 : HAL.UInt2 := 16#0#; OEOVER : GPIO25_CTRL_OEOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_14_15 : HAL.UInt2 := 16#0#; INOVER : GPIO25_CTRL_INOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; IRQOVER : GPIO25_CTRL_IRQOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_30_31 : HAL.UInt2 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO25_CTRL_Register use record FUNCSEL at 0 range 0 .. 4; Reserved_5_7 at 0 range 5 .. 7; OUTOVER at 0 range 8 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEOVER at 0 range 12 .. 13; Reserved_14_15 at 0 range 14 .. 15; INOVER at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; IRQOVER at 0 range 28 .. 29; Reserved_30_31 at 0 range 30 .. 31; end record; -- GPIO status type GPIO26_STATUS_Register is record -- unspecified Reserved_0_7 : HAL.UInt8; -- Read-only. output signal from selected peripheral, before register -- override is applied OUTFROMPERI : Boolean; -- Read-only. output signal to pad after register override is applied OUTTOPAD : Boolean; -- unspecified Reserved_10_11 : HAL.UInt2; -- Read-only. output enable from selected peripheral, before register -- override is applied OEFROMPERI : Boolean; -- Read-only. output enable to pad after register override is applied OETOPAD : Boolean; -- unspecified Reserved_14_16 : HAL.UInt3; -- Read-only. input signal from pad, before override is applied INFROMPAD : Boolean; -- unspecified Reserved_18_18 : HAL.Bit; -- Read-only. input signal to peripheral, after override is applied INTOPERI : Boolean; -- unspecified Reserved_20_23 : HAL.UInt4; -- Read-only. interrupt from pad before override is applied IRQFROMPAD : Boolean; -- unspecified Reserved_25_25 : HAL.Bit; -- Read-only. interrupt to processors, after override is applied IRQTOPROC : Boolean; -- unspecified Reserved_27_31 : HAL.UInt5; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO26_STATUS_Register use record Reserved_0_7 at 0 range 0 .. 7; OUTFROMPERI at 0 range 8 .. 8; OUTTOPAD at 0 range 9 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEFROMPERI at 0 range 12 .. 12; OETOPAD at 0 range 13 .. 13; Reserved_14_16 at 0 range 14 .. 16; INFROMPAD at 0 range 17 .. 17; Reserved_18_18 at 0 range 18 .. 18; INTOPERI at 0 range 19 .. 19; Reserved_20_23 at 0 range 20 .. 23; IRQFROMPAD at 0 range 24 .. 24; Reserved_25_25 at 0 range 25 .. 25; IRQTOPROC at 0 range 26 .. 26; Reserved_27_31 at 0 range 27 .. 31; end record; -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL type GPIO26_CTRL_FUNCSEL_Field is (SPI1_SCLK, UART1_CTS, I2C1_SDA, PWM_A_5, SIO_26, PIO0_26, PIO1_26, USB_MUXING_VBUS_EN, NULL_k) with Size => 5; for GPIO26_CTRL_FUNCSEL_Field use (SPI1_SCLK => 1, UART1_CTS => 2, I2C1_SDA => 3, PWM_A_5 => 4, SIO_26 => 5, PIO0_26 => 6, PIO1_26 => 7, USB_MUXING_VBUS_EN => 9, NULL_k => 31); type GPIO26_CTRL_OUTOVER_Field is (-- drive output from peripheral signal selected by funcsel Normal, -- drive output from inverse of peripheral signal selected by funcsel Invert, -- drive output low Low, -- drive output high High) with Size => 2; for GPIO26_CTRL_OUTOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO26_CTRL_OEOVER_Field is (-- drive output enable from peripheral signal selected by funcsel Normal, -- drive output enable from inverse of peripheral signal selected by funcsel Invert, -- disable output Disable, -- enable output Enable) with Size => 2; for GPIO26_CTRL_OEOVER_Field use (Normal => 0, Invert => 1, Disable => 2, Enable => 3); type GPIO26_CTRL_INOVER_Field is (-- don't invert the peri input Normal, -- invert the peri input Invert, -- drive peri input low Low, -- drive peri input high High) with Size => 2; for GPIO26_CTRL_INOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO26_CTRL_IRQOVER_Field is (-- don't invert the interrupt Normal, -- invert the interrupt Invert, -- drive interrupt low Low, -- drive interrupt high High) with Size => 2; for GPIO26_CTRL_IRQOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); -- GPIO control including function select and overrides. type GPIO26_CTRL_Register is record -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL FUNCSEL : GPIO26_CTRL_FUNCSEL_Field := RP_SVD.IO_BANK0.NULL_k; -- unspecified Reserved_5_7 : HAL.UInt3 := 16#0#; OUTOVER : GPIO26_CTRL_OUTOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_10_11 : HAL.UInt2 := 16#0#; OEOVER : GPIO26_CTRL_OEOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_14_15 : HAL.UInt2 := 16#0#; INOVER : GPIO26_CTRL_INOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; IRQOVER : GPIO26_CTRL_IRQOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_30_31 : HAL.UInt2 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO26_CTRL_Register use record FUNCSEL at 0 range 0 .. 4; Reserved_5_7 at 0 range 5 .. 7; OUTOVER at 0 range 8 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEOVER at 0 range 12 .. 13; Reserved_14_15 at 0 range 14 .. 15; INOVER at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; IRQOVER at 0 range 28 .. 29; Reserved_30_31 at 0 range 30 .. 31; end record; -- GPIO status type GPIO27_STATUS_Register is record -- unspecified Reserved_0_7 : HAL.UInt8; -- Read-only. output signal from selected peripheral, before register -- override is applied OUTFROMPERI : Boolean; -- Read-only. output signal to pad after register override is applied OUTTOPAD : Boolean; -- unspecified Reserved_10_11 : HAL.UInt2; -- Read-only. output enable from selected peripheral, before register -- override is applied OEFROMPERI : Boolean; -- Read-only. output enable to pad after register override is applied OETOPAD : Boolean; -- unspecified Reserved_14_16 : HAL.UInt3; -- Read-only. input signal from pad, before override is applied INFROMPAD : Boolean; -- unspecified Reserved_18_18 : HAL.Bit; -- Read-only. input signal to peripheral, after override is applied INTOPERI : Boolean; -- unspecified Reserved_20_23 : HAL.UInt4; -- Read-only. interrupt from pad before override is applied IRQFROMPAD : Boolean; -- unspecified Reserved_25_25 : HAL.Bit; -- Read-only. interrupt to processors, after override is applied IRQTOPROC : Boolean; -- unspecified Reserved_27_31 : HAL.UInt5; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO27_STATUS_Register use record Reserved_0_7 at 0 range 0 .. 7; OUTFROMPERI at 0 range 8 .. 8; OUTTOPAD at 0 range 9 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEFROMPERI at 0 range 12 .. 12; OETOPAD at 0 range 13 .. 13; Reserved_14_16 at 0 range 14 .. 16; INFROMPAD at 0 range 17 .. 17; Reserved_18_18 at 0 range 18 .. 18; INTOPERI at 0 range 19 .. 19; Reserved_20_23 at 0 range 20 .. 23; IRQFROMPAD at 0 range 24 .. 24; Reserved_25_25 at 0 range 25 .. 25; IRQTOPROC at 0 range 26 .. 26; Reserved_27_31 at 0 range 27 .. 31; end record; -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL type GPIO27_CTRL_FUNCSEL_Field is (SPI1_TX, UART1_RTS, I2C1_SCL, PWM_B_5, SIO_27, PIO0_27, PIO1_27, USB_MUXING_OVERCURR_DETECT, NULL_k) with Size => 5; for GPIO27_CTRL_FUNCSEL_Field use (SPI1_TX => 1, UART1_RTS => 2, I2C1_SCL => 3, PWM_B_5 => 4, SIO_27 => 5, PIO0_27 => 6, PIO1_27 => 7, USB_MUXING_OVERCURR_DETECT => 9, NULL_k => 31); type GPIO27_CTRL_OUTOVER_Field is (-- drive output from peripheral signal selected by funcsel Normal, -- drive output from inverse of peripheral signal selected by funcsel Invert, -- drive output low Low, -- drive output high High) with Size => 2; for GPIO27_CTRL_OUTOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO27_CTRL_OEOVER_Field is (-- drive output enable from peripheral signal selected by funcsel Normal, -- drive output enable from inverse of peripheral signal selected by funcsel Invert, -- disable output Disable, -- enable output Enable) with Size => 2; for GPIO27_CTRL_OEOVER_Field use (Normal => 0, Invert => 1, Disable => 2, Enable => 3); type GPIO27_CTRL_INOVER_Field is (-- don't invert the peri input Normal, -- invert the peri input Invert, -- drive peri input low Low, -- drive peri input high High) with Size => 2; for GPIO27_CTRL_INOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO27_CTRL_IRQOVER_Field is (-- don't invert the interrupt Normal, -- invert the interrupt Invert, -- drive interrupt low Low, -- drive interrupt high High) with Size => 2; for GPIO27_CTRL_IRQOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); -- GPIO control including function select and overrides. type GPIO27_CTRL_Register is record -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL FUNCSEL : GPIO27_CTRL_FUNCSEL_Field := RP_SVD.IO_BANK0.NULL_k; -- unspecified Reserved_5_7 : HAL.UInt3 := 16#0#; OUTOVER : GPIO27_CTRL_OUTOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_10_11 : HAL.UInt2 := 16#0#; OEOVER : GPIO27_CTRL_OEOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_14_15 : HAL.UInt2 := 16#0#; INOVER : GPIO27_CTRL_INOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; IRQOVER : GPIO27_CTRL_IRQOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_30_31 : HAL.UInt2 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO27_CTRL_Register use record FUNCSEL at 0 range 0 .. 4; Reserved_5_7 at 0 range 5 .. 7; OUTOVER at 0 range 8 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEOVER at 0 range 12 .. 13; Reserved_14_15 at 0 range 14 .. 15; INOVER at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; IRQOVER at 0 range 28 .. 29; Reserved_30_31 at 0 range 30 .. 31; end record; -- GPIO status type GPIO28_STATUS_Register is record -- unspecified Reserved_0_7 : HAL.UInt8; -- Read-only. output signal from selected peripheral, before register -- override is applied OUTFROMPERI : Boolean; -- Read-only. output signal to pad after register override is applied OUTTOPAD : Boolean; -- unspecified Reserved_10_11 : HAL.UInt2; -- Read-only. output enable from selected peripheral, before register -- override is applied OEFROMPERI : Boolean; -- Read-only. output enable to pad after register override is applied OETOPAD : Boolean; -- unspecified Reserved_14_16 : HAL.UInt3; -- Read-only. input signal from pad, before override is applied INFROMPAD : Boolean; -- unspecified Reserved_18_18 : HAL.Bit; -- Read-only. input signal to peripheral, after override is applied INTOPERI : Boolean; -- unspecified Reserved_20_23 : HAL.UInt4; -- Read-only. interrupt from pad before override is applied IRQFROMPAD : Boolean; -- unspecified Reserved_25_25 : HAL.Bit; -- Read-only. interrupt to processors, after override is applied IRQTOPROC : Boolean; -- unspecified Reserved_27_31 : HAL.UInt5; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO28_STATUS_Register use record Reserved_0_7 at 0 range 0 .. 7; OUTFROMPERI at 0 range 8 .. 8; OUTTOPAD at 0 range 9 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEFROMPERI at 0 range 12 .. 12; OETOPAD at 0 range 13 .. 13; Reserved_14_16 at 0 range 14 .. 16; INFROMPAD at 0 range 17 .. 17; Reserved_18_18 at 0 range 18 .. 18; INTOPERI at 0 range 19 .. 19; Reserved_20_23 at 0 range 20 .. 23; IRQFROMPAD at 0 range 24 .. 24; Reserved_25_25 at 0 range 25 .. 25; IRQTOPROC at 0 range 26 .. 26; Reserved_27_31 at 0 range 27 .. 31; end record; -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL type GPIO28_CTRL_FUNCSEL_Field is (SPI1_RX, UART0_TX, I2C0_SDA, PWM_A_6, SIO_28, PIO0_28, PIO1_28, USB_MUXING_VBUS_DETECT, NULL_k) with Size => 5; for GPIO28_CTRL_FUNCSEL_Field use (SPI1_RX => 1, UART0_TX => 2, I2C0_SDA => 3, PWM_A_6 => 4, SIO_28 => 5, PIO0_28 => 6, PIO1_28 => 7, USB_MUXING_VBUS_DETECT => 9, NULL_k => 31); type GPIO28_CTRL_OUTOVER_Field is (-- drive output from peripheral signal selected by funcsel Normal, -- drive output from inverse of peripheral signal selected by funcsel Invert, -- drive output low Low, -- drive output high High) with Size => 2; for GPIO28_CTRL_OUTOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO28_CTRL_OEOVER_Field is (-- drive output enable from peripheral signal selected by funcsel Normal, -- drive output enable from inverse of peripheral signal selected by funcsel Invert, -- disable output Disable, -- enable output Enable) with Size => 2; for GPIO28_CTRL_OEOVER_Field use (Normal => 0, Invert => 1, Disable => 2, Enable => 3); type GPIO28_CTRL_INOVER_Field is (-- don't invert the peri input Normal, -- invert the peri input Invert, -- drive peri input low Low, -- drive peri input high High) with Size => 2; for GPIO28_CTRL_INOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO28_CTRL_IRQOVER_Field is (-- don't invert the interrupt Normal, -- invert the interrupt Invert, -- drive interrupt low Low, -- drive interrupt high High) with Size => 2; for GPIO28_CTRL_IRQOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); -- GPIO control including function select and overrides. type GPIO28_CTRL_Register is record -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL FUNCSEL : GPIO28_CTRL_FUNCSEL_Field := RP_SVD.IO_BANK0.NULL_k; -- unspecified Reserved_5_7 : HAL.UInt3 := 16#0#; OUTOVER : GPIO28_CTRL_OUTOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_10_11 : HAL.UInt2 := 16#0#; OEOVER : GPIO28_CTRL_OEOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_14_15 : HAL.UInt2 := 16#0#; INOVER : GPIO28_CTRL_INOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; IRQOVER : GPIO28_CTRL_IRQOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_30_31 : HAL.UInt2 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO28_CTRL_Register use record FUNCSEL at 0 range 0 .. 4; Reserved_5_7 at 0 range 5 .. 7; OUTOVER at 0 range 8 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEOVER at 0 range 12 .. 13; Reserved_14_15 at 0 range 14 .. 15; INOVER at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; IRQOVER at 0 range 28 .. 29; Reserved_30_31 at 0 range 30 .. 31; end record; -- GPIO status type GPIO29_STATUS_Register is record -- unspecified Reserved_0_7 : HAL.UInt8; -- Read-only. output signal from selected peripheral, before register -- override is applied OUTFROMPERI : Boolean; -- Read-only. output signal to pad after register override is applied OUTTOPAD : Boolean; -- unspecified Reserved_10_11 : HAL.UInt2; -- Read-only. output enable from selected peripheral, before register -- override is applied OEFROMPERI : Boolean; -- Read-only. output enable to pad after register override is applied OETOPAD : Boolean; -- unspecified Reserved_14_16 : HAL.UInt3; -- Read-only. input signal from pad, before override is applied INFROMPAD : Boolean; -- unspecified Reserved_18_18 : HAL.Bit; -- Read-only. input signal to peripheral, after override is applied INTOPERI : Boolean; -- unspecified Reserved_20_23 : HAL.UInt4; -- Read-only. interrupt from pad before override is applied IRQFROMPAD : Boolean; -- unspecified Reserved_25_25 : HAL.Bit; -- Read-only. interrupt to processors, after override is applied IRQTOPROC : Boolean; -- unspecified Reserved_27_31 : HAL.UInt5; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO29_STATUS_Register use record Reserved_0_7 at 0 range 0 .. 7; OUTFROMPERI at 0 range 8 .. 8; OUTTOPAD at 0 range 9 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEFROMPERI at 0 range 12 .. 12; OETOPAD at 0 range 13 .. 13; Reserved_14_16 at 0 range 14 .. 16; INFROMPAD at 0 range 17 .. 17; Reserved_18_18 at 0 range 18 .. 18; INTOPERI at 0 range 19 .. 19; Reserved_20_23 at 0 range 20 .. 23; IRQFROMPAD at 0 range 24 .. 24; Reserved_25_25 at 0 range 25 .. 25; IRQTOPROC at 0 range 26 .. 26; Reserved_27_31 at 0 range 27 .. 31; end record; -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL type GPIO29_CTRL_FUNCSEL_Field is (SPI1_SS_N, UART0_RX, I2C0_SCL, PWM_B_6, SIO_29, PIO0_29, PIO1_29, USB_MUXING_VBUS_EN, NULL_k) with Size => 5; for GPIO29_CTRL_FUNCSEL_Field use (SPI1_SS_N => 1, UART0_RX => 2, I2C0_SCL => 3, PWM_B_6 => 4, SIO_29 => 5, PIO0_29 => 6, PIO1_29 => 7, USB_MUXING_VBUS_EN => 9, NULL_k => 31); type GPIO29_CTRL_OUTOVER_Field is (-- drive output from peripheral signal selected by funcsel Normal, -- drive output from inverse of peripheral signal selected by funcsel Invert, -- drive output low Low, -- drive output high High) with Size => 2; for GPIO29_CTRL_OUTOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO29_CTRL_OEOVER_Field is (-- drive output enable from peripheral signal selected by funcsel Normal, -- drive output enable from inverse of peripheral signal selected by funcsel Invert, -- disable output Disable, -- enable output Enable) with Size => 2; for GPIO29_CTRL_OEOVER_Field use (Normal => 0, Invert => 1, Disable => 2, Enable => 3); type GPIO29_CTRL_INOVER_Field is (-- don't invert the peri input Normal, -- invert the peri input Invert, -- drive peri input low Low, -- drive peri input high High) with Size => 2; for GPIO29_CTRL_INOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); type GPIO29_CTRL_IRQOVER_Field is (-- don't invert the interrupt Normal, -- invert the interrupt Invert, -- drive interrupt low Low, -- drive interrupt high High) with Size => 2; for GPIO29_CTRL_IRQOVER_Field use (Normal => 0, Invert => 1, Low => 2, High => 3); -- GPIO control including function select and overrides. type GPIO29_CTRL_Register is record -- 0-31 -> selects pin function according to the gpio table\n 31 == NULL FUNCSEL : GPIO29_CTRL_FUNCSEL_Field := RP_SVD.IO_BANK0.NULL_k; -- unspecified Reserved_5_7 : HAL.UInt3 := 16#0#; OUTOVER : GPIO29_CTRL_OUTOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_10_11 : HAL.UInt2 := 16#0#; OEOVER : GPIO29_CTRL_OEOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_14_15 : HAL.UInt2 := 16#0#; INOVER : GPIO29_CTRL_INOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; IRQOVER : GPIO29_CTRL_IRQOVER_Field := RP_SVD.IO_BANK0.Normal; -- unspecified Reserved_30_31 : HAL.UInt2 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO29_CTRL_Register use record FUNCSEL at 0 range 0 .. 4; Reserved_5_7 at 0 range 5 .. 7; OUTOVER at 0 range 8 .. 9; Reserved_10_11 at 0 range 10 .. 11; OEOVER at 0 range 12 .. 13; Reserved_14_15 at 0 range 14 .. 15; INOVER at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; IRQOVER at 0 range 28 .. 29; Reserved_30_31 at 0 range 30 .. 31; end record; -- Raw Interrupts type INTR0_Register is record -- Read-only. GPIO0_LEVEL_LOW : Boolean := False; -- Read-only. GPIO0_LEVEL_HIGH : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO0_EDGE_LOW : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO0_EDGE_HIGH : Boolean := False; -- Read-only. GPIO1_LEVEL_LOW : Boolean := False; -- Read-only. GPIO1_LEVEL_HIGH : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO1_EDGE_LOW : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO1_EDGE_HIGH : Boolean := False; -- Read-only. GPIO2_LEVEL_LOW : Boolean := False; -- Read-only. GPIO2_LEVEL_HIGH : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO2_EDGE_LOW : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO2_EDGE_HIGH : Boolean := False; -- Read-only. GPIO3_LEVEL_LOW : Boolean := False; -- Read-only. GPIO3_LEVEL_HIGH : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO3_EDGE_LOW : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO3_EDGE_HIGH : Boolean := False; -- Read-only. GPIO4_LEVEL_LOW : Boolean := False; -- Read-only. GPIO4_LEVEL_HIGH : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO4_EDGE_LOW : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO4_EDGE_HIGH : Boolean := False; -- Read-only. GPIO5_LEVEL_LOW : Boolean := False; -- Read-only. GPIO5_LEVEL_HIGH : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO5_EDGE_LOW : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO5_EDGE_HIGH : Boolean := False; -- Read-only. GPIO6_LEVEL_LOW : Boolean := False; -- Read-only. GPIO6_LEVEL_HIGH : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO6_EDGE_LOW : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO6_EDGE_HIGH : Boolean := False; -- Read-only. GPIO7_LEVEL_LOW : Boolean := False; -- Read-only. GPIO7_LEVEL_HIGH : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO7_EDGE_LOW : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO7_EDGE_HIGH : Boolean := False; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for INTR0_Register use record GPIO0_LEVEL_LOW at 0 range 0 .. 0; GPIO0_LEVEL_HIGH at 0 range 1 .. 1; GPIO0_EDGE_LOW at 0 range 2 .. 2; GPIO0_EDGE_HIGH at 0 range 3 .. 3; GPIO1_LEVEL_LOW at 0 range 4 .. 4; GPIO1_LEVEL_HIGH at 0 range 5 .. 5; GPIO1_EDGE_LOW at 0 range 6 .. 6; GPIO1_EDGE_HIGH at 0 range 7 .. 7; GPIO2_LEVEL_LOW at 0 range 8 .. 8; GPIO2_LEVEL_HIGH at 0 range 9 .. 9; GPIO2_EDGE_LOW at 0 range 10 .. 10; GPIO2_EDGE_HIGH at 0 range 11 .. 11; GPIO3_LEVEL_LOW at 0 range 12 .. 12; GPIO3_LEVEL_HIGH at 0 range 13 .. 13; GPIO3_EDGE_LOW at 0 range 14 .. 14; GPIO3_EDGE_HIGH at 0 range 15 .. 15; GPIO4_LEVEL_LOW at 0 range 16 .. 16; GPIO4_LEVEL_HIGH at 0 range 17 .. 17; GPIO4_EDGE_LOW at 0 range 18 .. 18; GPIO4_EDGE_HIGH at 0 range 19 .. 19; GPIO5_LEVEL_LOW at 0 range 20 .. 20; GPIO5_LEVEL_HIGH at 0 range 21 .. 21; GPIO5_EDGE_LOW at 0 range 22 .. 22; GPIO5_EDGE_HIGH at 0 range 23 .. 23; GPIO6_LEVEL_LOW at 0 range 24 .. 24; GPIO6_LEVEL_HIGH at 0 range 25 .. 25; GPIO6_EDGE_LOW at 0 range 26 .. 26; GPIO6_EDGE_HIGH at 0 range 27 .. 27; GPIO7_LEVEL_LOW at 0 range 28 .. 28; GPIO7_LEVEL_HIGH at 0 range 29 .. 29; GPIO7_EDGE_LOW at 0 range 30 .. 30; GPIO7_EDGE_HIGH at 0 range 31 .. 31; end record; -- Raw Interrupts type INTR1_Register is record -- Read-only. GPIO8_LEVEL_LOW : Boolean := False; -- Read-only. GPIO8_LEVEL_HIGH : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO8_EDGE_LOW : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO8_EDGE_HIGH : Boolean := False; -- Read-only. GPIO9_LEVEL_LOW : Boolean := False; -- Read-only. GPIO9_LEVEL_HIGH : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO9_EDGE_LOW : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO9_EDGE_HIGH : Boolean := False; -- Read-only. GPIO10_LEVEL_LOW : Boolean := False; -- Read-only. GPIO10_LEVEL_HIGH : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO10_EDGE_LOW : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO10_EDGE_HIGH : Boolean := False; -- Read-only. GPIO11_LEVEL_LOW : Boolean := False; -- Read-only. GPIO11_LEVEL_HIGH : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO11_EDGE_LOW : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO11_EDGE_HIGH : Boolean := False; -- Read-only. GPIO12_LEVEL_LOW : Boolean := False; -- Read-only. GPIO12_LEVEL_HIGH : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO12_EDGE_LOW : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO12_EDGE_HIGH : Boolean := False; -- Read-only. GPIO13_LEVEL_LOW : Boolean := False; -- Read-only. GPIO13_LEVEL_HIGH : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO13_EDGE_LOW : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO13_EDGE_HIGH : Boolean := False; -- Read-only. GPIO14_LEVEL_LOW : Boolean := False; -- Read-only. GPIO14_LEVEL_HIGH : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO14_EDGE_LOW : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO14_EDGE_HIGH : Boolean := False; -- Read-only. GPIO15_LEVEL_LOW : Boolean := False; -- Read-only. GPIO15_LEVEL_HIGH : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO15_EDGE_LOW : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO15_EDGE_HIGH : Boolean := False; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for INTR1_Register use record GPIO8_LEVEL_LOW at 0 range 0 .. 0; GPIO8_LEVEL_HIGH at 0 range 1 .. 1; GPIO8_EDGE_LOW at 0 range 2 .. 2; GPIO8_EDGE_HIGH at 0 range 3 .. 3; GPIO9_LEVEL_LOW at 0 range 4 .. 4; GPIO9_LEVEL_HIGH at 0 range 5 .. 5; GPIO9_EDGE_LOW at 0 range 6 .. 6; GPIO9_EDGE_HIGH at 0 range 7 .. 7; GPIO10_LEVEL_LOW at 0 range 8 .. 8; GPIO10_LEVEL_HIGH at 0 range 9 .. 9; GPIO10_EDGE_LOW at 0 range 10 .. 10; GPIO10_EDGE_HIGH at 0 range 11 .. 11; GPIO11_LEVEL_LOW at 0 range 12 .. 12; GPIO11_LEVEL_HIGH at 0 range 13 .. 13; GPIO11_EDGE_LOW at 0 range 14 .. 14; GPIO11_EDGE_HIGH at 0 range 15 .. 15; GPIO12_LEVEL_LOW at 0 range 16 .. 16; GPIO12_LEVEL_HIGH at 0 range 17 .. 17; GPIO12_EDGE_LOW at 0 range 18 .. 18; GPIO12_EDGE_HIGH at 0 range 19 .. 19; GPIO13_LEVEL_LOW at 0 range 20 .. 20; GPIO13_LEVEL_HIGH at 0 range 21 .. 21; GPIO13_EDGE_LOW at 0 range 22 .. 22; GPIO13_EDGE_HIGH at 0 range 23 .. 23; GPIO14_LEVEL_LOW at 0 range 24 .. 24; GPIO14_LEVEL_HIGH at 0 range 25 .. 25; GPIO14_EDGE_LOW at 0 range 26 .. 26; GPIO14_EDGE_HIGH at 0 range 27 .. 27; GPIO15_LEVEL_LOW at 0 range 28 .. 28; GPIO15_LEVEL_HIGH at 0 range 29 .. 29; GPIO15_EDGE_LOW at 0 range 30 .. 30; GPIO15_EDGE_HIGH at 0 range 31 .. 31; end record; -- Raw Interrupts type INTR2_Register is record -- Read-only. GPIO16_LEVEL_LOW : Boolean := False; -- Read-only. GPIO16_LEVEL_HIGH : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO16_EDGE_LOW : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO16_EDGE_HIGH : Boolean := False; -- Read-only. GPIO17_LEVEL_LOW : Boolean := False; -- Read-only. GPIO17_LEVEL_HIGH : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO17_EDGE_LOW : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO17_EDGE_HIGH : Boolean := False; -- Read-only. GPIO18_LEVEL_LOW : Boolean := False; -- Read-only. GPIO18_LEVEL_HIGH : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO18_EDGE_LOW : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO18_EDGE_HIGH : Boolean := False; -- Read-only. GPIO19_LEVEL_LOW : Boolean := False; -- Read-only. GPIO19_LEVEL_HIGH : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO19_EDGE_LOW : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO19_EDGE_HIGH : Boolean := False; -- Read-only. GPIO20_LEVEL_LOW : Boolean := False; -- Read-only. GPIO20_LEVEL_HIGH : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO20_EDGE_LOW : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO20_EDGE_HIGH : Boolean := False; -- Read-only. GPIO21_LEVEL_LOW : Boolean := False; -- Read-only. GPIO21_LEVEL_HIGH : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO21_EDGE_LOW : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO21_EDGE_HIGH : Boolean := False; -- Read-only. GPIO22_LEVEL_LOW : Boolean := False; -- Read-only. GPIO22_LEVEL_HIGH : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO22_EDGE_LOW : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO22_EDGE_HIGH : Boolean := False; -- Read-only. GPIO23_LEVEL_LOW : Boolean := False; -- Read-only. GPIO23_LEVEL_HIGH : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO23_EDGE_LOW : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO23_EDGE_HIGH : Boolean := False; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for INTR2_Register use record GPIO16_LEVEL_LOW at 0 range 0 .. 0; GPIO16_LEVEL_HIGH at 0 range 1 .. 1; GPIO16_EDGE_LOW at 0 range 2 .. 2; GPIO16_EDGE_HIGH at 0 range 3 .. 3; GPIO17_LEVEL_LOW at 0 range 4 .. 4; GPIO17_LEVEL_HIGH at 0 range 5 .. 5; GPIO17_EDGE_LOW at 0 range 6 .. 6; GPIO17_EDGE_HIGH at 0 range 7 .. 7; GPIO18_LEVEL_LOW at 0 range 8 .. 8; GPIO18_LEVEL_HIGH at 0 range 9 .. 9; GPIO18_EDGE_LOW at 0 range 10 .. 10; GPIO18_EDGE_HIGH at 0 range 11 .. 11; GPIO19_LEVEL_LOW at 0 range 12 .. 12; GPIO19_LEVEL_HIGH at 0 range 13 .. 13; GPIO19_EDGE_LOW at 0 range 14 .. 14; GPIO19_EDGE_HIGH at 0 range 15 .. 15; GPIO20_LEVEL_LOW at 0 range 16 .. 16; GPIO20_LEVEL_HIGH at 0 range 17 .. 17; GPIO20_EDGE_LOW at 0 range 18 .. 18; GPIO20_EDGE_HIGH at 0 range 19 .. 19; GPIO21_LEVEL_LOW at 0 range 20 .. 20; GPIO21_LEVEL_HIGH at 0 range 21 .. 21; GPIO21_EDGE_LOW at 0 range 22 .. 22; GPIO21_EDGE_HIGH at 0 range 23 .. 23; GPIO22_LEVEL_LOW at 0 range 24 .. 24; GPIO22_LEVEL_HIGH at 0 range 25 .. 25; GPIO22_EDGE_LOW at 0 range 26 .. 26; GPIO22_EDGE_HIGH at 0 range 27 .. 27; GPIO23_LEVEL_LOW at 0 range 28 .. 28; GPIO23_LEVEL_HIGH at 0 range 29 .. 29; GPIO23_EDGE_LOW at 0 range 30 .. 30; GPIO23_EDGE_HIGH at 0 range 31 .. 31; end record; -- Raw Interrupts type INTR3_Register is record -- Read-only. GPIO24_LEVEL_LOW : Boolean := False; -- Read-only. GPIO24_LEVEL_HIGH : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO24_EDGE_LOW : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO24_EDGE_HIGH : Boolean := False; -- Read-only. GPIO25_LEVEL_LOW : Boolean := False; -- Read-only. GPIO25_LEVEL_HIGH : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO25_EDGE_LOW : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO25_EDGE_HIGH : Boolean := False; -- Read-only. GPIO26_LEVEL_LOW : Boolean := False; -- Read-only. GPIO26_LEVEL_HIGH : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO26_EDGE_LOW : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO26_EDGE_HIGH : Boolean := False; -- Read-only. GPIO27_LEVEL_LOW : Boolean := False; -- Read-only. GPIO27_LEVEL_HIGH : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO27_EDGE_LOW : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO27_EDGE_HIGH : Boolean := False; -- Read-only. GPIO28_LEVEL_LOW : Boolean := False; -- Read-only. GPIO28_LEVEL_HIGH : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO28_EDGE_LOW : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO28_EDGE_HIGH : Boolean := False; -- Read-only. GPIO29_LEVEL_LOW : Boolean := False; -- Read-only. GPIO29_LEVEL_HIGH : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO29_EDGE_LOW : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. GPIO29_EDGE_HIGH : Boolean := False; -- unspecified Reserved_24_31 : HAL.UInt8 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for INTR3_Register use record GPIO24_LEVEL_LOW at 0 range 0 .. 0; GPIO24_LEVEL_HIGH at 0 range 1 .. 1; GPIO24_EDGE_LOW at 0 range 2 .. 2; GPIO24_EDGE_HIGH at 0 range 3 .. 3; GPIO25_LEVEL_LOW at 0 range 4 .. 4; GPIO25_LEVEL_HIGH at 0 range 5 .. 5; GPIO25_EDGE_LOW at 0 range 6 .. 6; GPIO25_EDGE_HIGH at 0 range 7 .. 7; GPIO26_LEVEL_LOW at 0 range 8 .. 8; GPIO26_LEVEL_HIGH at 0 range 9 .. 9; GPIO26_EDGE_LOW at 0 range 10 .. 10; GPIO26_EDGE_HIGH at 0 range 11 .. 11; GPIO27_LEVEL_LOW at 0 range 12 .. 12; GPIO27_LEVEL_HIGH at 0 range 13 .. 13; GPIO27_EDGE_LOW at 0 range 14 .. 14; GPIO27_EDGE_HIGH at 0 range 15 .. 15; GPIO28_LEVEL_LOW at 0 range 16 .. 16; GPIO28_LEVEL_HIGH at 0 range 17 .. 17; GPIO28_EDGE_LOW at 0 range 18 .. 18; GPIO28_EDGE_HIGH at 0 range 19 .. 19; GPIO29_LEVEL_LOW at 0 range 20 .. 20; GPIO29_LEVEL_HIGH at 0 range 21 .. 21; GPIO29_EDGE_LOW at 0 range 22 .. 22; GPIO29_EDGE_HIGH at 0 range 23 .. 23; Reserved_24_31 at 0 range 24 .. 31; end record; -- Interrupt Enable for proc0 type PROC0_INTE0_Register is record GPIO0_LEVEL_LOW : Boolean := False; GPIO0_LEVEL_HIGH : Boolean := False; GPIO0_EDGE_LOW : Boolean := False; GPIO0_EDGE_HIGH : Boolean := False; GPIO1_LEVEL_LOW : Boolean := False; GPIO1_LEVEL_HIGH : Boolean := False; GPIO1_EDGE_LOW : Boolean := False; GPIO1_EDGE_HIGH : Boolean := False; GPIO2_LEVEL_LOW : Boolean := False; GPIO2_LEVEL_HIGH : Boolean := False; GPIO2_EDGE_LOW : Boolean := False; GPIO2_EDGE_HIGH : Boolean := False; GPIO3_LEVEL_LOW : Boolean := False; GPIO3_LEVEL_HIGH : Boolean := False; GPIO3_EDGE_LOW : Boolean := False; GPIO3_EDGE_HIGH : Boolean := False; GPIO4_LEVEL_LOW : Boolean := False; GPIO4_LEVEL_HIGH : Boolean := False; GPIO4_EDGE_LOW : Boolean := False; GPIO4_EDGE_HIGH : Boolean := False; GPIO5_LEVEL_LOW : Boolean := False; GPIO5_LEVEL_HIGH : Boolean := False; GPIO5_EDGE_LOW : Boolean := False; GPIO5_EDGE_HIGH : Boolean := False; GPIO6_LEVEL_LOW : Boolean := False; GPIO6_LEVEL_HIGH : Boolean := False; GPIO6_EDGE_LOW : Boolean := False; GPIO6_EDGE_HIGH : Boolean := False; GPIO7_LEVEL_LOW : Boolean := False; GPIO7_LEVEL_HIGH : Boolean := False; GPIO7_EDGE_LOW : Boolean := False; GPIO7_EDGE_HIGH : Boolean := False; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for PROC0_INTE0_Register use record GPIO0_LEVEL_LOW at 0 range 0 .. 0; GPIO0_LEVEL_HIGH at 0 range 1 .. 1; GPIO0_EDGE_LOW at 0 range 2 .. 2; GPIO0_EDGE_HIGH at 0 range 3 .. 3; GPIO1_LEVEL_LOW at 0 range 4 .. 4; GPIO1_LEVEL_HIGH at 0 range 5 .. 5; GPIO1_EDGE_LOW at 0 range 6 .. 6; GPIO1_EDGE_HIGH at 0 range 7 .. 7; GPIO2_LEVEL_LOW at 0 range 8 .. 8; GPIO2_LEVEL_HIGH at 0 range 9 .. 9; GPIO2_EDGE_LOW at 0 range 10 .. 10; GPIO2_EDGE_HIGH at 0 range 11 .. 11; GPIO3_LEVEL_LOW at 0 range 12 .. 12; GPIO3_LEVEL_HIGH at 0 range 13 .. 13; GPIO3_EDGE_LOW at 0 range 14 .. 14; GPIO3_EDGE_HIGH at 0 range 15 .. 15; GPIO4_LEVEL_LOW at 0 range 16 .. 16; GPIO4_LEVEL_HIGH at 0 range 17 .. 17; GPIO4_EDGE_LOW at 0 range 18 .. 18; GPIO4_EDGE_HIGH at 0 range 19 .. 19; GPIO5_LEVEL_LOW at 0 range 20 .. 20; GPIO5_LEVEL_HIGH at 0 range 21 .. 21; GPIO5_EDGE_LOW at 0 range 22 .. 22; GPIO5_EDGE_HIGH at 0 range 23 .. 23; GPIO6_LEVEL_LOW at 0 range 24 .. 24; GPIO6_LEVEL_HIGH at 0 range 25 .. 25; GPIO6_EDGE_LOW at 0 range 26 .. 26; GPIO6_EDGE_HIGH at 0 range 27 .. 27; GPIO7_LEVEL_LOW at 0 range 28 .. 28; GPIO7_LEVEL_HIGH at 0 range 29 .. 29; GPIO7_EDGE_LOW at 0 range 30 .. 30; GPIO7_EDGE_HIGH at 0 range 31 .. 31; end record; -- Interrupt Enable for proc0 type PROC0_INTE1_Register is record GPIO8_LEVEL_LOW : Boolean := False; GPIO8_LEVEL_HIGH : Boolean := False; GPIO8_EDGE_LOW : Boolean := False; GPIO8_EDGE_HIGH : Boolean := False; GPIO9_LEVEL_LOW : Boolean := False; GPIO9_LEVEL_HIGH : Boolean := False; GPIO9_EDGE_LOW : Boolean := False; GPIO9_EDGE_HIGH : Boolean := False; GPIO10_LEVEL_LOW : Boolean := False; GPIO10_LEVEL_HIGH : Boolean := False; GPIO10_EDGE_LOW : Boolean := False; GPIO10_EDGE_HIGH : Boolean := False; GPIO11_LEVEL_LOW : Boolean := False; GPIO11_LEVEL_HIGH : Boolean := False; GPIO11_EDGE_LOW : Boolean := False; GPIO11_EDGE_HIGH : Boolean := False; GPIO12_LEVEL_LOW : Boolean := False; GPIO12_LEVEL_HIGH : Boolean := False; GPIO12_EDGE_LOW : Boolean := False; GPIO12_EDGE_HIGH : Boolean := False; GPIO13_LEVEL_LOW : Boolean := False; GPIO13_LEVEL_HIGH : Boolean := False; GPIO13_EDGE_LOW : Boolean := False; GPIO13_EDGE_HIGH : Boolean := False; GPIO14_LEVEL_LOW : Boolean := False; GPIO14_LEVEL_HIGH : Boolean := False; GPIO14_EDGE_LOW : Boolean := False; GPIO14_EDGE_HIGH : Boolean := False; GPIO15_LEVEL_LOW : Boolean := False; GPIO15_LEVEL_HIGH : Boolean := False; GPIO15_EDGE_LOW : Boolean := False; GPIO15_EDGE_HIGH : Boolean := False; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for PROC0_INTE1_Register use record GPIO8_LEVEL_LOW at 0 range 0 .. 0; GPIO8_LEVEL_HIGH at 0 range 1 .. 1; GPIO8_EDGE_LOW at 0 range 2 .. 2; GPIO8_EDGE_HIGH at 0 range 3 .. 3; GPIO9_LEVEL_LOW at 0 range 4 .. 4; GPIO9_LEVEL_HIGH at 0 range 5 .. 5; GPIO9_EDGE_LOW at 0 range 6 .. 6; GPIO9_EDGE_HIGH at 0 range 7 .. 7; GPIO10_LEVEL_LOW at 0 range 8 .. 8; GPIO10_LEVEL_HIGH at 0 range 9 .. 9; GPIO10_EDGE_LOW at 0 range 10 .. 10; GPIO10_EDGE_HIGH at 0 range 11 .. 11; GPIO11_LEVEL_LOW at 0 range 12 .. 12; GPIO11_LEVEL_HIGH at 0 range 13 .. 13; GPIO11_EDGE_LOW at 0 range 14 .. 14; GPIO11_EDGE_HIGH at 0 range 15 .. 15; GPIO12_LEVEL_LOW at 0 range 16 .. 16; GPIO12_LEVEL_HIGH at 0 range 17 .. 17; GPIO12_EDGE_LOW at 0 range 18 .. 18; GPIO12_EDGE_HIGH at 0 range 19 .. 19; GPIO13_LEVEL_LOW at 0 range 20 .. 20; GPIO13_LEVEL_HIGH at 0 range 21 .. 21; GPIO13_EDGE_LOW at 0 range 22 .. 22; GPIO13_EDGE_HIGH at 0 range 23 .. 23; GPIO14_LEVEL_LOW at 0 range 24 .. 24; GPIO14_LEVEL_HIGH at 0 range 25 .. 25; GPIO14_EDGE_LOW at 0 range 26 .. 26; GPIO14_EDGE_HIGH at 0 range 27 .. 27; GPIO15_LEVEL_LOW at 0 range 28 .. 28; GPIO15_LEVEL_HIGH at 0 range 29 .. 29; GPIO15_EDGE_LOW at 0 range 30 .. 30; GPIO15_EDGE_HIGH at 0 range 31 .. 31; end record; -- Interrupt Enable for proc0 type PROC0_INTE2_Register is record GPIO16_LEVEL_LOW : Boolean := False; GPIO16_LEVEL_HIGH : Boolean := False; GPIO16_EDGE_LOW : Boolean := False; GPIO16_EDGE_HIGH : Boolean := False; GPIO17_LEVEL_LOW : Boolean := False; GPIO17_LEVEL_HIGH : Boolean := False; GPIO17_EDGE_LOW : Boolean := False; GPIO17_EDGE_HIGH : Boolean := False; GPIO18_LEVEL_LOW : Boolean := False; GPIO18_LEVEL_HIGH : Boolean := False; GPIO18_EDGE_LOW : Boolean := False; GPIO18_EDGE_HIGH : Boolean := False; GPIO19_LEVEL_LOW : Boolean := False; GPIO19_LEVEL_HIGH : Boolean := False; GPIO19_EDGE_LOW : Boolean := False; GPIO19_EDGE_HIGH : Boolean := False; GPIO20_LEVEL_LOW : Boolean := False; GPIO20_LEVEL_HIGH : Boolean := False; GPIO20_EDGE_LOW : Boolean := False; GPIO20_EDGE_HIGH : Boolean := False; GPIO21_LEVEL_LOW : Boolean := False; GPIO21_LEVEL_HIGH : Boolean := False; GPIO21_EDGE_LOW : Boolean := False; GPIO21_EDGE_HIGH : Boolean := False; GPIO22_LEVEL_LOW : Boolean := False; GPIO22_LEVEL_HIGH : Boolean := False; GPIO22_EDGE_LOW : Boolean := False; GPIO22_EDGE_HIGH : Boolean := False; GPIO23_LEVEL_LOW : Boolean := False; GPIO23_LEVEL_HIGH : Boolean := False; GPIO23_EDGE_LOW : Boolean := False; GPIO23_EDGE_HIGH : Boolean := False; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for PROC0_INTE2_Register use record GPIO16_LEVEL_LOW at 0 range 0 .. 0; GPIO16_LEVEL_HIGH at 0 range 1 .. 1; GPIO16_EDGE_LOW at 0 range 2 .. 2; GPIO16_EDGE_HIGH at 0 range 3 .. 3; GPIO17_LEVEL_LOW at 0 range 4 .. 4; GPIO17_LEVEL_HIGH at 0 range 5 .. 5; GPIO17_EDGE_LOW at 0 range 6 .. 6; GPIO17_EDGE_HIGH at 0 range 7 .. 7; GPIO18_LEVEL_LOW at 0 range 8 .. 8; GPIO18_LEVEL_HIGH at 0 range 9 .. 9; GPIO18_EDGE_LOW at 0 range 10 .. 10; GPIO18_EDGE_HIGH at 0 range 11 .. 11; GPIO19_LEVEL_LOW at 0 range 12 .. 12; GPIO19_LEVEL_HIGH at 0 range 13 .. 13; GPIO19_EDGE_LOW at 0 range 14 .. 14; GPIO19_EDGE_HIGH at 0 range 15 .. 15; GPIO20_LEVEL_LOW at 0 range 16 .. 16; GPIO20_LEVEL_HIGH at 0 range 17 .. 17; GPIO20_EDGE_LOW at 0 range 18 .. 18; GPIO20_EDGE_HIGH at 0 range 19 .. 19; GPIO21_LEVEL_LOW at 0 range 20 .. 20; GPIO21_LEVEL_HIGH at 0 range 21 .. 21; GPIO21_EDGE_LOW at 0 range 22 .. 22; GPIO21_EDGE_HIGH at 0 range 23 .. 23; GPIO22_LEVEL_LOW at 0 range 24 .. 24; GPIO22_LEVEL_HIGH at 0 range 25 .. 25; GPIO22_EDGE_LOW at 0 range 26 .. 26; GPIO22_EDGE_HIGH at 0 range 27 .. 27; GPIO23_LEVEL_LOW at 0 range 28 .. 28; GPIO23_LEVEL_HIGH at 0 range 29 .. 29; GPIO23_EDGE_LOW at 0 range 30 .. 30; GPIO23_EDGE_HIGH at 0 range 31 .. 31; end record; -- Interrupt Enable for proc0 type PROC0_INTE3_Register is record GPIO24_LEVEL_LOW : Boolean := False; GPIO24_LEVEL_HIGH : Boolean := False; GPIO24_EDGE_LOW : Boolean := False; GPIO24_EDGE_HIGH : Boolean := False; GPIO25_LEVEL_LOW : Boolean := False; GPIO25_LEVEL_HIGH : Boolean := False; GPIO25_EDGE_LOW : Boolean := False; GPIO25_EDGE_HIGH : Boolean := False; GPIO26_LEVEL_LOW : Boolean := False; GPIO26_LEVEL_HIGH : Boolean := False; GPIO26_EDGE_LOW : Boolean := False; GPIO26_EDGE_HIGH : Boolean := False; GPIO27_LEVEL_LOW : Boolean := False; GPIO27_LEVEL_HIGH : Boolean := False; GPIO27_EDGE_LOW : Boolean := False; GPIO27_EDGE_HIGH : Boolean := False; GPIO28_LEVEL_LOW : Boolean := False; GPIO28_LEVEL_HIGH : Boolean := False; GPIO28_EDGE_LOW : Boolean := False; GPIO28_EDGE_HIGH : Boolean := False; GPIO29_LEVEL_LOW : Boolean := False; GPIO29_LEVEL_HIGH : Boolean := False; GPIO29_EDGE_LOW : Boolean := False; GPIO29_EDGE_HIGH : Boolean := False; -- unspecified Reserved_24_31 : HAL.UInt8 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for PROC0_INTE3_Register use record GPIO24_LEVEL_LOW at 0 range 0 .. 0; GPIO24_LEVEL_HIGH at 0 range 1 .. 1; GPIO24_EDGE_LOW at 0 range 2 .. 2; GPIO24_EDGE_HIGH at 0 range 3 .. 3; GPIO25_LEVEL_LOW at 0 range 4 .. 4; GPIO25_LEVEL_HIGH at 0 range 5 .. 5; GPIO25_EDGE_LOW at 0 range 6 .. 6; GPIO25_EDGE_HIGH at 0 range 7 .. 7; GPIO26_LEVEL_LOW at 0 range 8 .. 8; GPIO26_LEVEL_HIGH at 0 range 9 .. 9; GPIO26_EDGE_LOW at 0 range 10 .. 10; GPIO26_EDGE_HIGH at 0 range 11 .. 11; GPIO27_LEVEL_LOW at 0 range 12 .. 12; GPIO27_LEVEL_HIGH at 0 range 13 .. 13; GPIO27_EDGE_LOW at 0 range 14 .. 14; GPIO27_EDGE_HIGH at 0 range 15 .. 15; GPIO28_LEVEL_LOW at 0 range 16 .. 16; GPIO28_LEVEL_HIGH at 0 range 17 .. 17; GPIO28_EDGE_LOW at 0 range 18 .. 18; GPIO28_EDGE_HIGH at 0 range 19 .. 19; GPIO29_LEVEL_LOW at 0 range 20 .. 20; GPIO29_LEVEL_HIGH at 0 range 21 .. 21; GPIO29_EDGE_LOW at 0 range 22 .. 22; GPIO29_EDGE_HIGH at 0 range 23 .. 23; Reserved_24_31 at 0 range 24 .. 31; end record; -- Interrupt Force for proc0 type PROC0_INTF0_Register is record GPIO0_LEVEL_LOW : Boolean := False; GPIO0_LEVEL_HIGH : Boolean := False; GPIO0_EDGE_LOW : Boolean := False; GPIO0_EDGE_HIGH : Boolean := False; GPIO1_LEVEL_LOW : Boolean := False; GPIO1_LEVEL_HIGH : Boolean := False; GPIO1_EDGE_LOW : Boolean := False; GPIO1_EDGE_HIGH : Boolean := False; GPIO2_LEVEL_LOW : Boolean := False; GPIO2_LEVEL_HIGH : Boolean := False; GPIO2_EDGE_LOW : Boolean := False; GPIO2_EDGE_HIGH : Boolean := False; GPIO3_LEVEL_LOW : Boolean := False; GPIO3_LEVEL_HIGH : Boolean := False; GPIO3_EDGE_LOW : Boolean := False; GPIO3_EDGE_HIGH : Boolean := False; GPIO4_LEVEL_LOW : Boolean := False; GPIO4_LEVEL_HIGH : Boolean := False; GPIO4_EDGE_LOW : Boolean := False; GPIO4_EDGE_HIGH : Boolean := False; GPIO5_LEVEL_LOW : Boolean := False; GPIO5_LEVEL_HIGH : Boolean := False; GPIO5_EDGE_LOW : Boolean := False; GPIO5_EDGE_HIGH : Boolean := False; GPIO6_LEVEL_LOW : Boolean := False; GPIO6_LEVEL_HIGH : Boolean := False; GPIO6_EDGE_LOW : Boolean := False; GPIO6_EDGE_HIGH : Boolean := False; GPIO7_LEVEL_LOW : Boolean := False; GPIO7_LEVEL_HIGH : Boolean := False; GPIO7_EDGE_LOW : Boolean := False; GPIO7_EDGE_HIGH : Boolean := False; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for PROC0_INTF0_Register use record GPIO0_LEVEL_LOW at 0 range 0 .. 0; GPIO0_LEVEL_HIGH at 0 range 1 .. 1; GPIO0_EDGE_LOW at 0 range 2 .. 2; GPIO0_EDGE_HIGH at 0 range 3 .. 3; GPIO1_LEVEL_LOW at 0 range 4 .. 4; GPIO1_LEVEL_HIGH at 0 range 5 .. 5; GPIO1_EDGE_LOW at 0 range 6 .. 6; GPIO1_EDGE_HIGH at 0 range 7 .. 7; GPIO2_LEVEL_LOW at 0 range 8 .. 8; GPIO2_LEVEL_HIGH at 0 range 9 .. 9; GPIO2_EDGE_LOW at 0 range 10 .. 10; GPIO2_EDGE_HIGH at 0 range 11 .. 11; GPIO3_LEVEL_LOW at 0 range 12 .. 12; GPIO3_LEVEL_HIGH at 0 range 13 .. 13; GPIO3_EDGE_LOW at 0 range 14 .. 14; GPIO3_EDGE_HIGH at 0 range 15 .. 15; GPIO4_LEVEL_LOW at 0 range 16 .. 16; GPIO4_LEVEL_HIGH at 0 range 17 .. 17; GPIO4_EDGE_LOW at 0 range 18 .. 18; GPIO4_EDGE_HIGH at 0 range 19 .. 19; GPIO5_LEVEL_LOW at 0 range 20 .. 20; GPIO5_LEVEL_HIGH at 0 range 21 .. 21; GPIO5_EDGE_LOW at 0 range 22 .. 22; GPIO5_EDGE_HIGH at 0 range 23 .. 23; GPIO6_LEVEL_LOW at 0 range 24 .. 24; GPIO6_LEVEL_HIGH at 0 range 25 .. 25; GPIO6_EDGE_LOW at 0 range 26 .. 26; GPIO6_EDGE_HIGH at 0 range 27 .. 27; GPIO7_LEVEL_LOW at 0 range 28 .. 28; GPIO7_LEVEL_HIGH at 0 range 29 .. 29; GPIO7_EDGE_LOW at 0 range 30 .. 30; GPIO7_EDGE_HIGH at 0 range 31 .. 31; end record; -- Interrupt Force for proc0 type PROC0_INTF1_Register is record GPIO8_LEVEL_LOW : Boolean := False; GPIO8_LEVEL_HIGH : Boolean := False; GPIO8_EDGE_LOW : Boolean := False; GPIO8_EDGE_HIGH : Boolean := False; GPIO9_LEVEL_LOW : Boolean := False; GPIO9_LEVEL_HIGH : Boolean := False; GPIO9_EDGE_LOW : Boolean := False; GPIO9_EDGE_HIGH : Boolean := False; GPIO10_LEVEL_LOW : Boolean := False; GPIO10_LEVEL_HIGH : Boolean := False; GPIO10_EDGE_LOW : Boolean := False; GPIO10_EDGE_HIGH : Boolean := False; GPIO11_LEVEL_LOW : Boolean := False; GPIO11_LEVEL_HIGH : Boolean := False; GPIO11_EDGE_LOW : Boolean := False; GPIO11_EDGE_HIGH : Boolean := False; GPIO12_LEVEL_LOW : Boolean := False; GPIO12_LEVEL_HIGH : Boolean := False; GPIO12_EDGE_LOW : Boolean := False; GPIO12_EDGE_HIGH : Boolean := False; GPIO13_LEVEL_LOW : Boolean := False; GPIO13_LEVEL_HIGH : Boolean := False; GPIO13_EDGE_LOW : Boolean := False; GPIO13_EDGE_HIGH : Boolean := False; GPIO14_LEVEL_LOW : Boolean := False; GPIO14_LEVEL_HIGH : Boolean := False; GPIO14_EDGE_LOW : Boolean := False; GPIO14_EDGE_HIGH : Boolean := False; GPIO15_LEVEL_LOW : Boolean := False; GPIO15_LEVEL_HIGH : Boolean := False; GPIO15_EDGE_LOW : Boolean := False; GPIO15_EDGE_HIGH : Boolean := False; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for PROC0_INTF1_Register use record GPIO8_LEVEL_LOW at 0 range 0 .. 0; GPIO8_LEVEL_HIGH at 0 range 1 .. 1; GPIO8_EDGE_LOW at 0 range 2 .. 2; GPIO8_EDGE_HIGH at 0 range 3 .. 3; GPIO9_LEVEL_LOW at 0 range 4 .. 4; GPIO9_LEVEL_HIGH at 0 range 5 .. 5; GPIO9_EDGE_LOW at 0 range 6 .. 6; GPIO9_EDGE_HIGH at 0 range 7 .. 7; GPIO10_LEVEL_LOW at 0 range 8 .. 8; GPIO10_LEVEL_HIGH at 0 range 9 .. 9; GPIO10_EDGE_LOW at 0 range 10 .. 10; GPIO10_EDGE_HIGH at 0 range 11 .. 11; GPIO11_LEVEL_LOW at 0 range 12 .. 12; GPIO11_LEVEL_HIGH at 0 range 13 .. 13; GPIO11_EDGE_LOW at 0 range 14 .. 14; GPIO11_EDGE_HIGH at 0 range 15 .. 15; GPIO12_LEVEL_LOW at 0 range 16 .. 16; GPIO12_LEVEL_HIGH at 0 range 17 .. 17; GPIO12_EDGE_LOW at 0 range 18 .. 18; GPIO12_EDGE_HIGH at 0 range 19 .. 19; GPIO13_LEVEL_LOW at 0 range 20 .. 20; GPIO13_LEVEL_HIGH at 0 range 21 .. 21; GPIO13_EDGE_LOW at 0 range 22 .. 22; GPIO13_EDGE_HIGH at 0 range 23 .. 23; GPIO14_LEVEL_LOW at 0 range 24 .. 24; GPIO14_LEVEL_HIGH at 0 range 25 .. 25; GPIO14_EDGE_LOW at 0 range 26 .. 26; GPIO14_EDGE_HIGH at 0 range 27 .. 27; GPIO15_LEVEL_LOW at 0 range 28 .. 28; GPIO15_LEVEL_HIGH at 0 range 29 .. 29; GPIO15_EDGE_LOW at 0 range 30 .. 30; GPIO15_EDGE_HIGH at 0 range 31 .. 31; end record; -- Interrupt Force for proc0 type PROC0_INTF2_Register is record GPIO16_LEVEL_LOW : Boolean := False; GPIO16_LEVEL_HIGH : Boolean := False; GPIO16_EDGE_LOW : Boolean := False; GPIO16_EDGE_HIGH : Boolean := False; GPIO17_LEVEL_LOW : Boolean := False; GPIO17_LEVEL_HIGH : Boolean := False; GPIO17_EDGE_LOW : Boolean := False; GPIO17_EDGE_HIGH : Boolean := False; GPIO18_LEVEL_LOW : Boolean := False; GPIO18_LEVEL_HIGH : Boolean := False; GPIO18_EDGE_LOW : Boolean := False; GPIO18_EDGE_HIGH : Boolean := False; GPIO19_LEVEL_LOW : Boolean := False; GPIO19_LEVEL_HIGH : Boolean := False; GPIO19_EDGE_LOW : Boolean := False; GPIO19_EDGE_HIGH : Boolean := False; GPIO20_LEVEL_LOW : Boolean := False; GPIO20_LEVEL_HIGH : Boolean := False; GPIO20_EDGE_LOW : Boolean := False; GPIO20_EDGE_HIGH : Boolean := False; GPIO21_LEVEL_LOW : Boolean := False; GPIO21_LEVEL_HIGH : Boolean := False; GPIO21_EDGE_LOW : Boolean := False; GPIO21_EDGE_HIGH : Boolean := False; GPIO22_LEVEL_LOW : Boolean := False; GPIO22_LEVEL_HIGH : Boolean := False; GPIO22_EDGE_LOW : Boolean := False; GPIO22_EDGE_HIGH : Boolean := False; GPIO23_LEVEL_LOW : Boolean := False; GPIO23_LEVEL_HIGH : Boolean := False; GPIO23_EDGE_LOW : Boolean := False; GPIO23_EDGE_HIGH : Boolean := False; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for PROC0_INTF2_Register use record GPIO16_LEVEL_LOW at 0 range 0 .. 0; GPIO16_LEVEL_HIGH at 0 range 1 .. 1; GPIO16_EDGE_LOW at 0 range 2 .. 2; GPIO16_EDGE_HIGH at 0 range 3 .. 3; GPIO17_LEVEL_LOW at 0 range 4 .. 4; GPIO17_LEVEL_HIGH at 0 range 5 .. 5; GPIO17_EDGE_LOW at 0 range 6 .. 6; GPIO17_EDGE_HIGH at 0 range 7 .. 7; GPIO18_LEVEL_LOW at 0 range 8 .. 8; GPIO18_LEVEL_HIGH at 0 range 9 .. 9; GPIO18_EDGE_LOW at 0 range 10 .. 10; GPIO18_EDGE_HIGH at 0 range 11 .. 11; GPIO19_LEVEL_LOW at 0 range 12 .. 12; GPIO19_LEVEL_HIGH at 0 range 13 .. 13; GPIO19_EDGE_LOW at 0 range 14 .. 14; GPIO19_EDGE_HIGH at 0 range 15 .. 15; GPIO20_LEVEL_LOW at 0 range 16 .. 16; GPIO20_LEVEL_HIGH at 0 range 17 .. 17; GPIO20_EDGE_LOW at 0 range 18 .. 18; GPIO20_EDGE_HIGH at 0 range 19 .. 19; GPIO21_LEVEL_LOW at 0 range 20 .. 20; GPIO21_LEVEL_HIGH at 0 range 21 .. 21; GPIO21_EDGE_LOW at 0 range 22 .. 22; GPIO21_EDGE_HIGH at 0 range 23 .. 23; GPIO22_LEVEL_LOW at 0 range 24 .. 24; GPIO22_LEVEL_HIGH at 0 range 25 .. 25; GPIO22_EDGE_LOW at 0 range 26 .. 26; GPIO22_EDGE_HIGH at 0 range 27 .. 27; GPIO23_LEVEL_LOW at 0 range 28 .. 28; GPIO23_LEVEL_HIGH at 0 range 29 .. 29; GPIO23_EDGE_LOW at 0 range 30 .. 30; GPIO23_EDGE_HIGH at 0 range 31 .. 31; end record; -- Interrupt Force for proc0 type PROC0_INTF3_Register is record GPIO24_LEVEL_LOW : Boolean := False; GPIO24_LEVEL_HIGH : Boolean := False; GPIO24_EDGE_LOW : Boolean := False; GPIO24_EDGE_HIGH : Boolean := False; GPIO25_LEVEL_LOW : Boolean := False; GPIO25_LEVEL_HIGH : Boolean := False; GPIO25_EDGE_LOW : Boolean := False; GPIO25_EDGE_HIGH : Boolean := False; GPIO26_LEVEL_LOW : Boolean := False; GPIO26_LEVEL_HIGH : Boolean := False; GPIO26_EDGE_LOW : Boolean := False; GPIO26_EDGE_HIGH : Boolean := False; GPIO27_LEVEL_LOW : Boolean := False; GPIO27_LEVEL_HIGH : Boolean := False; GPIO27_EDGE_LOW : Boolean := False; GPIO27_EDGE_HIGH : Boolean := False; GPIO28_LEVEL_LOW : Boolean := False; GPIO28_LEVEL_HIGH : Boolean := False; GPIO28_EDGE_LOW : Boolean := False; GPIO28_EDGE_HIGH : Boolean := False; GPIO29_LEVEL_LOW : Boolean := False; GPIO29_LEVEL_HIGH : Boolean := False; GPIO29_EDGE_LOW : Boolean := False; GPIO29_EDGE_HIGH : Boolean := False; -- unspecified Reserved_24_31 : HAL.UInt8 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for PROC0_INTF3_Register use record GPIO24_LEVEL_LOW at 0 range 0 .. 0; GPIO24_LEVEL_HIGH at 0 range 1 .. 1; GPIO24_EDGE_LOW at 0 range 2 .. 2; GPIO24_EDGE_HIGH at 0 range 3 .. 3; GPIO25_LEVEL_LOW at 0 range 4 .. 4; GPIO25_LEVEL_HIGH at 0 range 5 .. 5; GPIO25_EDGE_LOW at 0 range 6 .. 6; GPIO25_EDGE_HIGH at 0 range 7 .. 7; GPIO26_LEVEL_LOW at 0 range 8 .. 8; GPIO26_LEVEL_HIGH at 0 range 9 .. 9; GPIO26_EDGE_LOW at 0 range 10 .. 10; GPIO26_EDGE_HIGH at 0 range 11 .. 11; GPIO27_LEVEL_LOW at 0 range 12 .. 12; GPIO27_LEVEL_HIGH at 0 range 13 .. 13; GPIO27_EDGE_LOW at 0 range 14 .. 14; GPIO27_EDGE_HIGH at 0 range 15 .. 15; GPIO28_LEVEL_LOW at 0 range 16 .. 16; GPIO28_LEVEL_HIGH at 0 range 17 .. 17; GPIO28_EDGE_LOW at 0 range 18 .. 18; GPIO28_EDGE_HIGH at 0 range 19 .. 19; GPIO29_LEVEL_LOW at 0 range 20 .. 20; GPIO29_LEVEL_HIGH at 0 range 21 .. 21; GPIO29_EDGE_LOW at 0 range 22 .. 22; GPIO29_EDGE_HIGH at 0 range 23 .. 23; Reserved_24_31 at 0 range 24 .. 31; end record; -- Interrupt status after masking & forcing for proc0 type PROC0_INTS0_Register is record -- Read-only. GPIO0_LEVEL_LOW : Boolean; -- Read-only. GPIO0_LEVEL_HIGH : Boolean; -- Read-only. GPIO0_EDGE_LOW : Boolean; -- Read-only. GPIO0_EDGE_HIGH : Boolean; -- Read-only. GPIO1_LEVEL_LOW : Boolean; -- Read-only. GPIO1_LEVEL_HIGH : Boolean; -- Read-only. GPIO1_EDGE_LOW : Boolean; -- Read-only. GPIO1_EDGE_HIGH : Boolean; -- Read-only. GPIO2_LEVEL_LOW : Boolean; -- Read-only. GPIO2_LEVEL_HIGH : Boolean; -- Read-only. GPIO2_EDGE_LOW : Boolean; -- Read-only. GPIO2_EDGE_HIGH : Boolean; -- Read-only. GPIO3_LEVEL_LOW : Boolean; -- Read-only. GPIO3_LEVEL_HIGH : Boolean; -- Read-only. GPIO3_EDGE_LOW : Boolean; -- Read-only. GPIO3_EDGE_HIGH : Boolean; -- Read-only. GPIO4_LEVEL_LOW : Boolean; -- Read-only. GPIO4_LEVEL_HIGH : Boolean; -- Read-only. GPIO4_EDGE_LOW : Boolean; -- Read-only. GPIO4_EDGE_HIGH : Boolean; -- Read-only. GPIO5_LEVEL_LOW : Boolean; -- Read-only. GPIO5_LEVEL_HIGH : Boolean; -- Read-only. GPIO5_EDGE_LOW : Boolean; -- Read-only. GPIO5_EDGE_HIGH : Boolean; -- Read-only. GPIO6_LEVEL_LOW : Boolean; -- Read-only. GPIO6_LEVEL_HIGH : Boolean; -- Read-only. GPIO6_EDGE_LOW : Boolean; -- Read-only. GPIO6_EDGE_HIGH : Boolean; -- Read-only. GPIO7_LEVEL_LOW : Boolean; -- Read-only. GPIO7_LEVEL_HIGH : Boolean; -- Read-only. GPIO7_EDGE_LOW : Boolean; -- Read-only. GPIO7_EDGE_HIGH : Boolean; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for PROC0_INTS0_Register use record GPIO0_LEVEL_LOW at 0 range 0 .. 0; GPIO0_LEVEL_HIGH at 0 range 1 .. 1; GPIO0_EDGE_LOW at 0 range 2 .. 2; GPIO0_EDGE_HIGH at 0 range 3 .. 3; GPIO1_LEVEL_LOW at 0 range 4 .. 4; GPIO1_LEVEL_HIGH at 0 range 5 .. 5; GPIO1_EDGE_LOW at 0 range 6 .. 6; GPIO1_EDGE_HIGH at 0 range 7 .. 7; GPIO2_LEVEL_LOW at 0 range 8 .. 8; GPIO2_LEVEL_HIGH at 0 range 9 .. 9; GPIO2_EDGE_LOW at 0 range 10 .. 10; GPIO2_EDGE_HIGH at 0 range 11 .. 11; GPIO3_LEVEL_LOW at 0 range 12 .. 12; GPIO3_LEVEL_HIGH at 0 range 13 .. 13; GPIO3_EDGE_LOW at 0 range 14 .. 14; GPIO3_EDGE_HIGH at 0 range 15 .. 15; GPIO4_LEVEL_LOW at 0 range 16 .. 16; GPIO4_LEVEL_HIGH at 0 range 17 .. 17; GPIO4_EDGE_LOW at 0 range 18 .. 18; GPIO4_EDGE_HIGH at 0 range 19 .. 19; GPIO5_LEVEL_LOW at 0 range 20 .. 20; GPIO5_LEVEL_HIGH at 0 range 21 .. 21; GPIO5_EDGE_LOW at 0 range 22 .. 22; GPIO5_EDGE_HIGH at 0 range 23 .. 23; GPIO6_LEVEL_LOW at 0 range 24 .. 24; GPIO6_LEVEL_HIGH at 0 range 25 .. 25; GPIO6_EDGE_LOW at 0 range 26 .. 26; GPIO6_EDGE_HIGH at 0 range 27 .. 27; GPIO7_LEVEL_LOW at 0 range 28 .. 28; GPIO7_LEVEL_HIGH at 0 range 29 .. 29; GPIO7_EDGE_LOW at 0 range 30 .. 30; GPIO7_EDGE_HIGH at 0 range 31 .. 31; end record; -- Interrupt status after masking & forcing for proc0 type PROC0_INTS1_Register is record -- Read-only. GPIO8_LEVEL_LOW : Boolean; -- Read-only. GPIO8_LEVEL_HIGH : Boolean; -- Read-only. GPIO8_EDGE_LOW : Boolean; -- Read-only. GPIO8_EDGE_HIGH : Boolean; -- Read-only. GPIO9_LEVEL_LOW : Boolean; -- Read-only. GPIO9_LEVEL_HIGH : Boolean; -- Read-only. GPIO9_EDGE_LOW : Boolean; -- Read-only. GPIO9_EDGE_HIGH : Boolean; -- Read-only. GPIO10_LEVEL_LOW : Boolean; -- Read-only. GPIO10_LEVEL_HIGH : Boolean; -- Read-only. GPIO10_EDGE_LOW : Boolean; -- Read-only. GPIO10_EDGE_HIGH : Boolean; -- Read-only. GPIO11_LEVEL_LOW : Boolean; -- Read-only. GPIO11_LEVEL_HIGH : Boolean; -- Read-only. GPIO11_EDGE_LOW : Boolean; -- Read-only. GPIO11_EDGE_HIGH : Boolean; -- Read-only. GPIO12_LEVEL_LOW : Boolean; -- Read-only. GPIO12_LEVEL_HIGH : Boolean; -- Read-only. GPIO12_EDGE_LOW : Boolean; -- Read-only. GPIO12_EDGE_HIGH : Boolean; -- Read-only. GPIO13_LEVEL_LOW : Boolean; -- Read-only. GPIO13_LEVEL_HIGH : Boolean; -- Read-only. GPIO13_EDGE_LOW : Boolean; -- Read-only. GPIO13_EDGE_HIGH : Boolean; -- Read-only. GPIO14_LEVEL_LOW : Boolean; -- Read-only. GPIO14_LEVEL_HIGH : Boolean; -- Read-only. GPIO14_EDGE_LOW : Boolean; -- Read-only. GPIO14_EDGE_HIGH : Boolean; -- Read-only. GPIO15_LEVEL_LOW : Boolean; -- Read-only. GPIO15_LEVEL_HIGH : Boolean; -- Read-only. GPIO15_EDGE_LOW : Boolean; -- Read-only. GPIO15_EDGE_HIGH : Boolean; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for PROC0_INTS1_Register use record GPIO8_LEVEL_LOW at 0 range 0 .. 0; GPIO8_LEVEL_HIGH at 0 range 1 .. 1; GPIO8_EDGE_LOW at 0 range 2 .. 2; GPIO8_EDGE_HIGH at 0 range 3 .. 3; GPIO9_LEVEL_LOW at 0 range 4 .. 4; GPIO9_LEVEL_HIGH at 0 range 5 .. 5; GPIO9_EDGE_LOW at 0 range 6 .. 6; GPIO9_EDGE_HIGH at 0 range 7 .. 7; GPIO10_LEVEL_LOW at 0 range 8 .. 8; GPIO10_LEVEL_HIGH at 0 range 9 .. 9; GPIO10_EDGE_LOW at 0 range 10 .. 10; GPIO10_EDGE_HIGH at 0 range 11 .. 11; GPIO11_LEVEL_LOW at 0 range 12 .. 12; GPIO11_LEVEL_HIGH at 0 range 13 .. 13; GPIO11_EDGE_LOW at 0 range 14 .. 14; GPIO11_EDGE_HIGH at 0 range 15 .. 15; GPIO12_LEVEL_LOW at 0 range 16 .. 16; GPIO12_LEVEL_HIGH at 0 range 17 .. 17; GPIO12_EDGE_LOW at 0 range 18 .. 18; GPIO12_EDGE_HIGH at 0 range 19 .. 19; GPIO13_LEVEL_LOW at 0 range 20 .. 20; GPIO13_LEVEL_HIGH at 0 range 21 .. 21; GPIO13_EDGE_LOW at 0 range 22 .. 22; GPIO13_EDGE_HIGH at 0 range 23 .. 23; GPIO14_LEVEL_LOW at 0 range 24 .. 24; GPIO14_LEVEL_HIGH at 0 range 25 .. 25; GPIO14_EDGE_LOW at 0 range 26 .. 26; GPIO14_EDGE_HIGH at 0 range 27 .. 27; GPIO15_LEVEL_LOW at 0 range 28 .. 28; GPIO15_LEVEL_HIGH at 0 range 29 .. 29; GPIO15_EDGE_LOW at 0 range 30 .. 30; GPIO15_EDGE_HIGH at 0 range 31 .. 31; end record; -- Interrupt status after masking & forcing for proc0 type PROC0_INTS2_Register is record -- Read-only. GPIO16_LEVEL_LOW : Boolean; -- Read-only. GPIO16_LEVEL_HIGH : Boolean; -- Read-only. GPIO16_EDGE_LOW : Boolean; -- Read-only. GPIO16_EDGE_HIGH : Boolean; -- Read-only. GPIO17_LEVEL_LOW : Boolean; -- Read-only. GPIO17_LEVEL_HIGH : Boolean; -- Read-only. GPIO17_EDGE_LOW : Boolean; -- Read-only. GPIO17_EDGE_HIGH : Boolean; -- Read-only. GPIO18_LEVEL_LOW : Boolean; -- Read-only. GPIO18_LEVEL_HIGH : Boolean; -- Read-only. GPIO18_EDGE_LOW : Boolean; -- Read-only. GPIO18_EDGE_HIGH : Boolean; -- Read-only. GPIO19_LEVEL_LOW : Boolean; -- Read-only. GPIO19_LEVEL_HIGH : Boolean; -- Read-only. GPIO19_EDGE_LOW : Boolean; -- Read-only. GPIO19_EDGE_HIGH : Boolean; -- Read-only. GPIO20_LEVEL_LOW : Boolean; -- Read-only. GPIO20_LEVEL_HIGH : Boolean; -- Read-only. GPIO20_EDGE_LOW : Boolean; -- Read-only. GPIO20_EDGE_HIGH : Boolean; -- Read-only. GPIO21_LEVEL_LOW : Boolean; -- Read-only. GPIO21_LEVEL_HIGH : Boolean; -- Read-only. GPIO21_EDGE_LOW : Boolean; -- Read-only. GPIO21_EDGE_HIGH : Boolean; -- Read-only. GPIO22_LEVEL_LOW : Boolean; -- Read-only. GPIO22_LEVEL_HIGH : Boolean; -- Read-only. GPIO22_EDGE_LOW : Boolean; -- Read-only. GPIO22_EDGE_HIGH : Boolean; -- Read-only. GPIO23_LEVEL_LOW : Boolean; -- Read-only. GPIO23_LEVEL_HIGH : Boolean; -- Read-only. GPIO23_EDGE_LOW : Boolean; -- Read-only. GPIO23_EDGE_HIGH : Boolean; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for PROC0_INTS2_Register use record GPIO16_LEVEL_LOW at 0 range 0 .. 0; GPIO16_LEVEL_HIGH at 0 range 1 .. 1; GPIO16_EDGE_LOW at 0 range 2 .. 2; GPIO16_EDGE_HIGH at 0 range 3 .. 3; GPIO17_LEVEL_LOW at 0 range 4 .. 4; GPIO17_LEVEL_HIGH at 0 range 5 .. 5; GPIO17_EDGE_LOW at 0 range 6 .. 6; GPIO17_EDGE_HIGH at 0 range 7 .. 7; GPIO18_LEVEL_LOW at 0 range 8 .. 8; GPIO18_LEVEL_HIGH at 0 range 9 .. 9; GPIO18_EDGE_LOW at 0 range 10 .. 10; GPIO18_EDGE_HIGH at 0 range 11 .. 11; GPIO19_LEVEL_LOW at 0 range 12 .. 12; GPIO19_LEVEL_HIGH at 0 range 13 .. 13; GPIO19_EDGE_LOW at 0 range 14 .. 14; GPIO19_EDGE_HIGH at 0 range 15 .. 15; GPIO20_LEVEL_LOW at 0 range 16 .. 16; GPIO20_LEVEL_HIGH at 0 range 17 .. 17; GPIO20_EDGE_LOW at 0 range 18 .. 18; GPIO20_EDGE_HIGH at 0 range 19 .. 19; GPIO21_LEVEL_LOW at 0 range 20 .. 20; GPIO21_LEVEL_HIGH at 0 range 21 .. 21; GPIO21_EDGE_LOW at 0 range 22 .. 22; GPIO21_EDGE_HIGH at 0 range 23 .. 23; GPIO22_LEVEL_LOW at 0 range 24 .. 24; GPIO22_LEVEL_HIGH at 0 range 25 .. 25; GPIO22_EDGE_LOW at 0 range 26 .. 26; GPIO22_EDGE_HIGH at 0 range 27 .. 27; GPIO23_LEVEL_LOW at 0 range 28 .. 28; GPIO23_LEVEL_HIGH at 0 range 29 .. 29; GPIO23_EDGE_LOW at 0 range 30 .. 30; GPIO23_EDGE_HIGH at 0 range 31 .. 31; end record; -- Interrupt status after masking & forcing for proc0 type PROC0_INTS3_Register is record -- Read-only. GPIO24_LEVEL_LOW : Boolean; -- Read-only. GPIO24_LEVEL_HIGH : Boolean; -- Read-only. GPIO24_EDGE_LOW : Boolean; -- Read-only. GPIO24_EDGE_HIGH : Boolean; -- Read-only. GPIO25_LEVEL_LOW : Boolean; -- Read-only. GPIO25_LEVEL_HIGH : Boolean; -- Read-only. GPIO25_EDGE_LOW : Boolean; -- Read-only. GPIO25_EDGE_HIGH : Boolean; -- Read-only. GPIO26_LEVEL_LOW : Boolean; -- Read-only. GPIO26_LEVEL_HIGH : Boolean; -- Read-only. GPIO26_EDGE_LOW : Boolean; -- Read-only. GPIO26_EDGE_HIGH : Boolean; -- Read-only. GPIO27_LEVEL_LOW : Boolean; -- Read-only. GPIO27_LEVEL_HIGH : Boolean; -- Read-only. GPIO27_EDGE_LOW : Boolean; -- Read-only. GPIO27_EDGE_HIGH : Boolean; -- Read-only. GPIO28_LEVEL_LOW : Boolean; -- Read-only. GPIO28_LEVEL_HIGH : Boolean; -- Read-only. GPIO28_EDGE_LOW : Boolean; -- Read-only. GPIO28_EDGE_HIGH : Boolean; -- Read-only. GPIO29_LEVEL_LOW : Boolean; -- Read-only. GPIO29_LEVEL_HIGH : Boolean; -- Read-only. GPIO29_EDGE_LOW : Boolean; -- Read-only. GPIO29_EDGE_HIGH : Boolean; -- unspecified Reserved_24_31 : HAL.UInt8; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for PROC0_INTS3_Register use record GPIO24_LEVEL_LOW at 0 range 0 .. 0; GPIO24_LEVEL_HIGH at 0 range 1 .. 1; GPIO24_EDGE_LOW at 0 range 2 .. 2; GPIO24_EDGE_HIGH at 0 range 3 .. 3; GPIO25_LEVEL_LOW at 0 range 4 .. 4; GPIO25_LEVEL_HIGH at 0 range 5 .. 5; GPIO25_EDGE_LOW at 0 range 6 .. 6; GPIO25_EDGE_HIGH at 0 range 7 .. 7; GPIO26_LEVEL_LOW at 0 range 8 .. 8; GPIO26_LEVEL_HIGH at 0 range 9 .. 9; GPIO26_EDGE_LOW at 0 range 10 .. 10; GPIO26_EDGE_HIGH at 0 range 11 .. 11; GPIO27_LEVEL_LOW at 0 range 12 .. 12; GPIO27_LEVEL_HIGH at 0 range 13 .. 13; GPIO27_EDGE_LOW at 0 range 14 .. 14; GPIO27_EDGE_HIGH at 0 range 15 .. 15; GPIO28_LEVEL_LOW at 0 range 16 .. 16; GPIO28_LEVEL_HIGH at 0 range 17 .. 17; GPIO28_EDGE_LOW at 0 range 18 .. 18; GPIO28_EDGE_HIGH at 0 range 19 .. 19; GPIO29_LEVEL_LOW at 0 range 20 .. 20; GPIO29_LEVEL_HIGH at 0 range 21 .. 21; GPIO29_EDGE_LOW at 0 range 22 .. 22; GPIO29_EDGE_HIGH at 0 range 23 .. 23; Reserved_24_31 at 0 range 24 .. 31; end record; -- Interrupt Enable for proc1 type PROC1_INTE0_Register is record GPIO0_LEVEL_LOW : Boolean := False; GPIO0_LEVEL_HIGH : Boolean := False; GPIO0_EDGE_LOW : Boolean := False; GPIO0_EDGE_HIGH : Boolean := False; GPIO1_LEVEL_LOW : Boolean := False; GPIO1_LEVEL_HIGH : Boolean := False; GPIO1_EDGE_LOW : Boolean := False; GPIO1_EDGE_HIGH : Boolean := False; GPIO2_LEVEL_LOW : Boolean := False; GPIO2_LEVEL_HIGH : Boolean := False; GPIO2_EDGE_LOW : Boolean := False; GPIO2_EDGE_HIGH : Boolean := False; GPIO3_LEVEL_LOW : Boolean := False; GPIO3_LEVEL_HIGH : Boolean := False; GPIO3_EDGE_LOW : Boolean := False; GPIO3_EDGE_HIGH : Boolean := False; GPIO4_LEVEL_LOW : Boolean := False; GPIO4_LEVEL_HIGH : Boolean := False; GPIO4_EDGE_LOW : Boolean := False; GPIO4_EDGE_HIGH : Boolean := False; GPIO5_LEVEL_LOW : Boolean := False; GPIO5_LEVEL_HIGH : Boolean := False; GPIO5_EDGE_LOW : Boolean := False; GPIO5_EDGE_HIGH : Boolean := False; GPIO6_LEVEL_LOW : Boolean := False; GPIO6_LEVEL_HIGH : Boolean := False; GPIO6_EDGE_LOW : Boolean := False; GPIO6_EDGE_HIGH : Boolean := False; GPIO7_LEVEL_LOW : Boolean := False; GPIO7_LEVEL_HIGH : Boolean := False; GPIO7_EDGE_LOW : Boolean := False; GPIO7_EDGE_HIGH : Boolean := False; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for PROC1_INTE0_Register use record GPIO0_LEVEL_LOW at 0 range 0 .. 0; GPIO0_LEVEL_HIGH at 0 range 1 .. 1; GPIO0_EDGE_LOW at 0 range 2 .. 2; GPIO0_EDGE_HIGH at 0 range 3 .. 3; GPIO1_LEVEL_LOW at 0 range 4 .. 4; GPIO1_LEVEL_HIGH at 0 range 5 .. 5; GPIO1_EDGE_LOW at 0 range 6 .. 6; GPIO1_EDGE_HIGH at 0 range 7 .. 7; GPIO2_LEVEL_LOW at 0 range 8 .. 8; GPIO2_LEVEL_HIGH at 0 range 9 .. 9; GPIO2_EDGE_LOW at 0 range 10 .. 10; GPIO2_EDGE_HIGH at 0 range 11 .. 11; GPIO3_LEVEL_LOW at 0 range 12 .. 12; GPIO3_LEVEL_HIGH at 0 range 13 .. 13; GPIO3_EDGE_LOW at 0 range 14 .. 14; GPIO3_EDGE_HIGH at 0 range 15 .. 15; GPIO4_LEVEL_LOW at 0 range 16 .. 16; GPIO4_LEVEL_HIGH at 0 range 17 .. 17; GPIO4_EDGE_LOW at 0 range 18 .. 18; GPIO4_EDGE_HIGH at 0 range 19 .. 19; GPIO5_LEVEL_LOW at 0 range 20 .. 20; GPIO5_LEVEL_HIGH at 0 range 21 .. 21; GPIO5_EDGE_LOW at 0 range 22 .. 22; GPIO5_EDGE_HIGH at 0 range 23 .. 23; GPIO6_LEVEL_LOW at 0 range 24 .. 24; GPIO6_LEVEL_HIGH at 0 range 25 .. 25; GPIO6_EDGE_LOW at 0 range 26 .. 26; GPIO6_EDGE_HIGH at 0 range 27 .. 27; GPIO7_LEVEL_LOW at 0 range 28 .. 28; GPIO7_LEVEL_HIGH at 0 range 29 .. 29; GPIO7_EDGE_LOW at 0 range 30 .. 30; GPIO7_EDGE_HIGH at 0 range 31 .. 31; end record; -- Interrupt Enable for proc1 type PROC1_INTE1_Register is record GPIO8_LEVEL_LOW : Boolean := False; GPIO8_LEVEL_HIGH : Boolean := False; GPIO8_EDGE_LOW : Boolean := False; GPIO8_EDGE_HIGH : Boolean := False; GPIO9_LEVEL_LOW : Boolean := False; GPIO9_LEVEL_HIGH : Boolean := False; GPIO9_EDGE_LOW : Boolean := False; GPIO9_EDGE_HIGH : Boolean := False; GPIO10_LEVEL_LOW : Boolean := False; GPIO10_LEVEL_HIGH : Boolean := False; GPIO10_EDGE_LOW : Boolean := False; GPIO10_EDGE_HIGH : Boolean := False; GPIO11_LEVEL_LOW : Boolean := False; GPIO11_LEVEL_HIGH : Boolean := False; GPIO11_EDGE_LOW : Boolean := False; GPIO11_EDGE_HIGH : Boolean := False; GPIO12_LEVEL_LOW : Boolean := False; GPIO12_LEVEL_HIGH : Boolean := False; GPIO12_EDGE_LOW : Boolean := False; GPIO12_EDGE_HIGH : Boolean := False; GPIO13_LEVEL_LOW : Boolean := False; GPIO13_LEVEL_HIGH : Boolean := False; GPIO13_EDGE_LOW : Boolean := False; GPIO13_EDGE_HIGH : Boolean := False; GPIO14_LEVEL_LOW : Boolean := False; GPIO14_LEVEL_HIGH : Boolean := False; GPIO14_EDGE_LOW : Boolean := False; GPIO14_EDGE_HIGH : Boolean := False; GPIO15_LEVEL_LOW : Boolean := False; GPIO15_LEVEL_HIGH : Boolean := False; GPIO15_EDGE_LOW : Boolean := False; GPIO15_EDGE_HIGH : Boolean := False; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for PROC1_INTE1_Register use record GPIO8_LEVEL_LOW at 0 range 0 .. 0; GPIO8_LEVEL_HIGH at 0 range 1 .. 1; GPIO8_EDGE_LOW at 0 range 2 .. 2; GPIO8_EDGE_HIGH at 0 range 3 .. 3; GPIO9_LEVEL_LOW at 0 range 4 .. 4; GPIO9_LEVEL_HIGH at 0 range 5 .. 5; GPIO9_EDGE_LOW at 0 range 6 .. 6; GPIO9_EDGE_HIGH at 0 range 7 .. 7; GPIO10_LEVEL_LOW at 0 range 8 .. 8; GPIO10_LEVEL_HIGH at 0 range 9 .. 9; GPIO10_EDGE_LOW at 0 range 10 .. 10; GPIO10_EDGE_HIGH at 0 range 11 .. 11; GPIO11_LEVEL_LOW at 0 range 12 .. 12; GPIO11_LEVEL_HIGH at 0 range 13 .. 13; GPIO11_EDGE_LOW at 0 range 14 .. 14; GPIO11_EDGE_HIGH at 0 range 15 .. 15; GPIO12_LEVEL_LOW at 0 range 16 .. 16; GPIO12_LEVEL_HIGH at 0 range 17 .. 17; GPIO12_EDGE_LOW at 0 range 18 .. 18; GPIO12_EDGE_HIGH at 0 range 19 .. 19; GPIO13_LEVEL_LOW at 0 range 20 .. 20; GPIO13_LEVEL_HIGH at 0 range 21 .. 21; GPIO13_EDGE_LOW at 0 range 22 .. 22; GPIO13_EDGE_HIGH at 0 range 23 .. 23; GPIO14_LEVEL_LOW at 0 range 24 .. 24; GPIO14_LEVEL_HIGH at 0 range 25 .. 25; GPIO14_EDGE_LOW at 0 range 26 .. 26; GPIO14_EDGE_HIGH at 0 range 27 .. 27; GPIO15_LEVEL_LOW at 0 range 28 .. 28; GPIO15_LEVEL_HIGH at 0 range 29 .. 29; GPIO15_EDGE_LOW at 0 range 30 .. 30; GPIO15_EDGE_HIGH at 0 range 31 .. 31; end record; -- Interrupt Enable for proc1 type PROC1_INTE2_Register is record GPIO16_LEVEL_LOW : Boolean := False; GPIO16_LEVEL_HIGH : Boolean := False; GPIO16_EDGE_LOW : Boolean := False; GPIO16_EDGE_HIGH : Boolean := False; GPIO17_LEVEL_LOW : Boolean := False; GPIO17_LEVEL_HIGH : Boolean := False; GPIO17_EDGE_LOW : Boolean := False; GPIO17_EDGE_HIGH : Boolean := False; GPIO18_LEVEL_LOW : Boolean := False; GPIO18_LEVEL_HIGH : Boolean := False; GPIO18_EDGE_LOW : Boolean := False; GPIO18_EDGE_HIGH : Boolean := False; GPIO19_LEVEL_LOW : Boolean := False; GPIO19_LEVEL_HIGH : Boolean := False; GPIO19_EDGE_LOW : Boolean := False; GPIO19_EDGE_HIGH : Boolean := False; GPIO20_LEVEL_LOW : Boolean := False; GPIO20_LEVEL_HIGH : Boolean := False; GPIO20_EDGE_LOW : Boolean := False; GPIO20_EDGE_HIGH : Boolean := False; GPIO21_LEVEL_LOW : Boolean := False; GPIO21_LEVEL_HIGH : Boolean := False; GPIO21_EDGE_LOW : Boolean := False; GPIO21_EDGE_HIGH : Boolean := False; GPIO22_LEVEL_LOW : Boolean := False; GPIO22_LEVEL_HIGH : Boolean := False; GPIO22_EDGE_LOW : Boolean := False; GPIO22_EDGE_HIGH : Boolean := False; GPIO23_LEVEL_LOW : Boolean := False; GPIO23_LEVEL_HIGH : Boolean := False; GPIO23_EDGE_LOW : Boolean := False; GPIO23_EDGE_HIGH : Boolean := False; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for PROC1_INTE2_Register use record GPIO16_LEVEL_LOW at 0 range 0 .. 0; GPIO16_LEVEL_HIGH at 0 range 1 .. 1; GPIO16_EDGE_LOW at 0 range 2 .. 2; GPIO16_EDGE_HIGH at 0 range 3 .. 3; GPIO17_LEVEL_LOW at 0 range 4 .. 4; GPIO17_LEVEL_HIGH at 0 range 5 .. 5; GPIO17_EDGE_LOW at 0 range 6 .. 6; GPIO17_EDGE_HIGH at 0 range 7 .. 7; GPIO18_LEVEL_LOW at 0 range 8 .. 8; GPIO18_LEVEL_HIGH at 0 range 9 .. 9; GPIO18_EDGE_LOW at 0 range 10 .. 10; GPIO18_EDGE_HIGH at 0 range 11 .. 11; GPIO19_LEVEL_LOW at 0 range 12 .. 12; GPIO19_LEVEL_HIGH at 0 range 13 .. 13; GPIO19_EDGE_LOW at 0 range 14 .. 14; GPIO19_EDGE_HIGH at 0 range 15 .. 15; GPIO20_LEVEL_LOW at 0 range 16 .. 16; GPIO20_LEVEL_HIGH at 0 range 17 .. 17; GPIO20_EDGE_LOW at 0 range 18 .. 18; GPIO20_EDGE_HIGH at 0 range 19 .. 19; GPIO21_LEVEL_LOW at 0 range 20 .. 20; GPIO21_LEVEL_HIGH at 0 range 21 .. 21; GPIO21_EDGE_LOW at 0 range 22 .. 22; GPIO21_EDGE_HIGH at 0 range 23 .. 23; GPIO22_LEVEL_LOW at 0 range 24 .. 24; GPIO22_LEVEL_HIGH at 0 range 25 .. 25; GPIO22_EDGE_LOW at 0 range 26 .. 26; GPIO22_EDGE_HIGH at 0 range 27 .. 27; GPIO23_LEVEL_LOW at 0 range 28 .. 28; GPIO23_LEVEL_HIGH at 0 range 29 .. 29; GPIO23_EDGE_LOW at 0 range 30 .. 30; GPIO23_EDGE_HIGH at 0 range 31 .. 31; end record; -- Interrupt Enable for proc1 type PROC1_INTE3_Register is record GPIO24_LEVEL_LOW : Boolean := False; GPIO24_LEVEL_HIGH : Boolean := False; GPIO24_EDGE_LOW : Boolean := False; GPIO24_EDGE_HIGH : Boolean := False; GPIO25_LEVEL_LOW : Boolean := False; GPIO25_LEVEL_HIGH : Boolean := False; GPIO25_EDGE_LOW : Boolean := False; GPIO25_EDGE_HIGH : Boolean := False; GPIO26_LEVEL_LOW : Boolean := False; GPIO26_LEVEL_HIGH : Boolean := False; GPIO26_EDGE_LOW : Boolean := False; GPIO26_EDGE_HIGH : Boolean := False; GPIO27_LEVEL_LOW : Boolean := False; GPIO27_LEVEL_HIGH : Boolean := False; GPIO27_EDGE_LOW : Boolean := False; GPIO27_EDGE_HIGH : Boolean := False; GPIO28_LEVEL_LOW : Boolean := False; GPIO28_LEVEL_HIGH : Boolean := False; GPIO28_EDGE_LOW : Boolean := False; GPIO28_EDGE_HIGH : Boolean := False; GPIO29_LEVEL_LOW : Boolean := False; GPIO29_LEVEL_HIGH : Boolean := False; GPIO29_EDGE_LOW : Boolean := False; GPIO29_EDGE_HIGH : Boolean := False; -- unspecified Reserved_24_31 : HAL.UInt8 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for PROC1_INTE3_Register use record GPIO24_LEVEL_LOW at 0 range 0 .. 0; GPIO24_LEVEL_HIGH at 0 range 1 .. 1; GPIO24_EDGE_LOW at 0 range 2 .. 2; GPIO24_EDGE_HIGH at 0 range 3 .. 3; GPIO25_LEVEL_LOW at 0 range 4 .. 4; GPIO25_LEVEL_HIGH at 0 range 5 .. 5; GPIO25_EDGE_LOW at 0 range 6 .. 6; GPIO25_EDGE_HIGH at 0 range 7 .. 7; GPIO26_LEVEL_LOW at 0 range 8 .. 8; GPIO26_LEVEL_HIGH at 0 range 9 .. 9; GPIO26_EDGE_LOW at 0 range 10 .. 10; GPIO26_EDGE_HIGH at 0 range 11 .. 11; GPIO27_LEVEL_LOW at 0 range 12 .. 12; GPIO27_LEVEL_HIGH at 0 range 13 .. 13; GPIO27_EDGE_LOW at 0 range 14 .. 14; GPIO27_EDGE_HIGH at 0 range 15 .. 15; GPIO28_LEVEL_LOW at 0 range 16 .. 16; GPIO28_LEVEL_HIGH at 0 range 17 .. 17; GPIO28_EDGE_LOW at 0 range 18 .. 18; GPIO28_EDGE_HIGH at 0 range 19 .. 19; GPIO29_LEVEL_LOW at 0 range 20 .. 20; GPIO29_LEVEL_HIGH at 0 range 21 .. 21; GPIO29_EDGE_LOW at 0 range 22 .. 22; GPIO29_EDGE_HIGH at 0 range 23 .. 23; Reserved_24_31 at 0 range 24 .. 31; end record; -- Interrupt Force for proc1 type PROC1_INTF0_Register is record GPIO0_LEVEL_LOW : Boolean := False; GPIO0_LEVEL_HIGH : Boolean := False; GPIO0_EDGE_LOW : Boolean := False; GPIO0_EDGE_HIGH : Boolean := False; GPIO1_LEVEL_LOW : Boolean := False; GPIO1_LEVEL_HIGH : Boolean := False; GPIO1_EDGE_LOW : Boolean := False; GPIO1_EDGE_HIGH : Boolean := False; GPIO2_LEVEL_LOW : Boolean := False; GPIO2_LEVEL_HIGH : Boolean := False; GPIO2_EDGE_LOW : Boolean := False; GPIO2_EDGE_HIGH : Boolean := False; GPIO3_LEVEL_LOW : Boolean := False; GPIO3_LEVEL_HIGH : Boolean := False; GPIO3_EDGE_LOW : Boolean := False; GPIO3_EDGE_HIGH : Boolean := False; GPIO4_LEVEL_LOW : Boolean := False; GPIO4_LEVEL_HIGH : Boolean := False; GPIO4_EDGE_LOW : Boolean := False; GPIO4_EDGE_HIGH : Boolean := False; GPIO5_LEVEL_LOW : Boolean := False; GPIO5_LEVEL_HIGH : Boolean := False; GPIO5_EDGE_LOW : Boolean := False; GPIO5_EDGE_HIGH : Boolean := False; GPIO6_LEVEL_LOW : Boolean := False; GPIO6_LEVEL_HIGH : Boolean := False; GPIO6_EDGE_LOW : Boolean := False; GPIO6_EDGE_HIGH : Boolean := False; GPIO7_LEVEL_LOW : Boolean := False; GPIO7_LEVEL_HIGH : Boolean := False; GPIO7_EDGE_LOW : Boolean := False; GPIO7_EDGE_HIGH : Boolean := False; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for PROC1_INTF0_Register use record GPIO0_LEVEL_LOW at 0 range 0 .. 0; GPIO0_LEVEL_HIGH at 0 range 1 .. 1; GPIO0_EDGE_LOW at 0 range 2 .. 2; GPIO0_EDGE_HIGH at 0 range 3 .. 3; GPIO1_LEVEL_LOW at 0 range 4 .. 4; GPIO1_LEVEL_HIGH at 0 range 5 .. 5; GPIO1_EDGE_LOW at 0 range 6 .. 6; GPIO1_EDGE_HIGH at 0 range 7 .. 7; GPIO2_LEVEL_LOW at 0 range 8 .. 8; GPIO2_LEVEL_HIGH at 0 range 9 .. 9; GPIO2_EDGE_LOW at 0 range 10 .. 10; GPIO2_EDGE_HIGH at 0 range 11 .. 11; GPIO3_LEVEL_LOW at 0 range 12 .. 12; GPIO3_LEVEL_HIGH at 0 range 13 .. 13; GPIO3_EDGE_LOW at 0 range 14 .. 14; GPIO3_EDGE_HIGH at 0 range 15 .. 15; GPIO4_LEVEL_LOW at 0 range 16 .. 16; GPIO4_LEVEL_HIGH at 0 range 17 .. 17; GPIO4_EDGE_LOW at 0 range 18 .. 18; GPIO4_EDGE_HIGH at 0 range 19 .. 19; GPIO5_LEVEL_LOW at 0 range 20 .. 20; GPIO5_LEVEL_HIGH at 0 range 21 .. 21; GPIO5_EDGE_LOW at 0 range 22 .. 22; GPIO5_EDGE_HIGH at 0 range 23 .. 23; GPIO6_LEVEL_LOW at 0 range 24 .. 24; GPIO6_LEVEL_HIGH at 0 range 25 .. 25; GPIO6_EDGE_LOW at 0 range 26 .. 26; GPIO6_EDGE_HIGH at 0 range 27 .. 27; GPIO7_LEVEL_LOW at 0 range 28 .. 28; GPIO7_LEVEL_HIGH at 0 range 29 .. 29; GPIO7_EDGE_LOW at 0 range 30 .. 30; GPIO7_EDGE_HIGH at 0 range 31 .. 31; end record; -- Interrupt Force for proc1 type PROC1_INTF1_Register is record GPIO8_LEVEL_LOW : Boolean := False; GPIO8_LEVEL_HIGH : Boolean := False; GPIO8_EDGE_LOW : Boolean := False; GPIO8_EDGE_HIGH : Boolean := False; GPIO9_LEVEL_LOW : Boolean := False; GPIO9_LEVEL_HIGH : Boolean := False; GPIO9_EDGE_LOW : Boolean := False; GPIO9_EDGE_HIGH : Boolean := False; GPIO10_LEVEL_LOW : Boolean := False; GPIO10_LEVEL_HIGH : Boolean := False; GPIO10_EDGE_LOW : Boolean := False; GPIO10_EDGE_HIGH : Boolean := False; GPIO11_LEVEL_LOW : Boolean := False; GPIO11_LEVEL_HIGH : Boolean := False; GPIO11_EDGE_LOW : Boolean := False; GPIO11_EDGE_HIGH : Boolean := False; GPIO12_LEVEL_LOW : Boolean := False; GPIO12_LEVEL_HIGH : Boolean := False; GPIO12_EDGE_LOW : Boolean := False; GPIO12_EDGE_HIGH : Boolean := False; GPIO13_LEVEL_LOW : Boolean := False; GPIO13_LEVEL_HIGH : Boolean := False; GPIO13_EDGE_LOW : Boolean := False; GPIO13_EDGE_HIGH : Boolean := False; GPIO14_LEVEL_LOW : Boolean := False; GPIO14_LEVEL_HIGH : Boolean := False; GPIO14_EDGE_LOW : Boolean := False; GPIO14_EDGE_HIGH : Boolean := False; GPIO15_LEVEL_LOW : Boolean := False; GPIO15_LEVEL_HIGH : Boolean := False; GPIO15_EDGE_LOW : Boolean := False; GPIO15_EDGE_HIGH : Boolean := False; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for PROC1_INTF1_Register use record GPIO8_LEVEL_LOW at 0 range 0 .. 0; GPIO8_LEVEL_HIGH at 0 range 1 .. 1; GPIO8_EDGE_LOW at 0 range 2 .. 2; GPIO8_EDGE_HIGH at 0 range 3 .. 3; GPIO9_LEVEL_LOW at 0 range 4 .. 4; GPIO9_LEVEL_HIGH at 0 range 5 .. 5; GPIO9_EDGE_LOW at 0 range 6 .. 6; GPIO9_EDGE_HIGH at 0 range 7 .. 7; GPIO10_LEVEL_LOW at 0 range 8 .. 8; GPIO10_LEVEL_HIGH at 0 range 9 .. 9; GPIO10_EDGE_LOW at 0 range 10 .. 10; GPIO10_EDGE_HIGH at 0 range 11 .. 11; GPIO11_LEVEL_LOW at 0 range 12 .. 12; GPIO11_LEVEL_HIGH at 0 range 13 .. 13; GPIO11_EDGE_LOW at 0 range 14 .. 14; GPIO11_EDGE_HIGH at 0 range 15 .. 15; GPIO12_LEVEL_LOW at 0 range 16 .. 16; GPIO12_LEVEL_HIGH at 0 range 17 .. 17; GPIO12_EDGE_LOW at 0 range 18 .. 18; GPIO12_EDGE_HIGH at 0 range 19 .. 19; GPIO13_LEVEL_LOW at 0 range 20 .. 20; GPIO13_LEVEL_HIGH at 0 range 21 .. 21; GPIO13_EDGE_LOW at 0 range 22 .. 22; GPIO13_EDGE_HIGH at 0 range 23 .. 23; GPIO14_LEVEL_LOW at 0 range 24 .. 24; GPIO14_LEVEL_HIGH at 0 range 25 .. 25; GPIO14_EDGE_LOW at 0 range 26 .. 26; GPIO14_EDGE_HIGH at 0 range 27 .. 27; GPIO15_LEVEL_LOW at 0 range 28 .. 28; GPIO15_LEVEL_HIGH at 0 range 29 .. 29; GPIO15_EDGE_LOW at 0 range 30 .. 30; GPIO15_EDGE_HIGH at 0 range 31 .. 31; end record; -- Interrupt Force for proc1 type PROC1_INTF2_Register is record GPIO16_LEVEL_LOW : Boolean := False; GPIO16_LEVEL_HIGH : Boolean := False; GPIO16_EDGE_LOW : Boolean := False; GPIO16_EDGE_HIGH : Boolean := False; GPIO17_LEVEL_LOW : Boolean := False; GPIO17_LEVEL_HIGH : Boolean := False; GPIO17_EDGE_LOW : Boolean := False; GPIO17_EDGE_HIGH : Boolean := False; GPIO18_LEVEL_LOW : Boolean := False; GPIO18_LEVEL_HIGH : Boolean := False; GPIO18_EDGE_LOW : Boolean := False; GPIO18_EDGE_HIGH : Boolean := False; GPIO19_LEVEL_LOW : Boolean := False; GPIO19_LEVEL_HIGH : Boolean := False; GPIO19_EDGE_LOW : Boolean := False; GPIO19_EDGE_HIGH : Boolean := False; GPIO20_LEVEL_LOW : Boolean := False; GPIO20_LEVEL_HIGH : Boolean := False; GPIO20_EDGE_LOW : Boolean := False; GPIO20_EDGE_HIGH : Boolean := False; GPIO21_LEVEL_LOW : Boolean := False; GPIO21_LEVEL_HIGH : Boolean := False; GPIO21_EDGE_LOW : Boolean := False; GPIO21_EDGE_HIGH : Boolean := False; GPIO22_LEVEL_LOW : Boolean := False; GPIO22_LEVEL_HIGH : Boolean := False; GPIO22_EDGE_LOW : Boolean := False; GPIO22_EDGE_HIGH : Boolean := False; GPIO23_LEVEL_LOW : Boolean := False; GPIO23_LEVEL_HIGH : Boolean := False; GPIO23_EDGE_LOW : Boolean := False; GPIO23_EDGE_HIGH : Boolean := False; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for PROC1_INTF2_Register use record GPIO16_LEVEL_LOW at 0 range 0 .. 0; GPIO16_LEVEL_HIGH at 0 range 1 .. 1; GPIO16_EDGE_LOW at 0 range 2 .. 2; GPIO16_EDGE_HIGH at 0 range 3 .. 3; GPIO17_LEVEL_LOW at 0 range 4 .. 4; GPIO17_LEVEL_HIGH at 0 range 5 .. 5; GPIO17_EDGE_LOW at 0 range 6 .. 6; GPIO17_EDGE_HIGH at 0 range 7 .. 7; GPIO18_LEVEL_LOW at 0 range 8 .. 8; GPIO18_LEVEL_HIGH at 0 range 9 .. 9; GPIO18_EDGE_LOW at 0 range 10 .. 10; GPIO18_EDGE_HIGH at 0 range 11 .. 11; GPIO19_LEVEL_LOW at 0 range 12 .. 12; GPIO19_LEVEL_HIGH at 0 range 13 .. 13; GPIO19_EDGE_LOW at 0 range 14 .. 14; GPIO19_EDGE_HIGH at 0 range 15 .. 15; GPIO20_LEVEL_LOW at 0 range 16 .. 16; GPIO20_LEVEL_HIGH at 0 range 17 .. 17; GPIO20_EDGE_LOW at 0 range 18 .. 18; GPIO20_EDGE_HIGH at 0 range 19 .. 19; GPIO21_LEVEL_LOW at 0 range 20 .. 20; GPIO21_LEVEL_HIGH at 0 range 21 .. 21; GPIO21_EDGE_LOW at 0 range 22 .. 22; GPIO21_EDGE_HIGH at 0 range 23 .. 23; GPIO22_LEVEL_LOW at 0 range 24 .. 24; GPIO22_LEVEL_HIGH at 0 range 25 .. 25; GPIO22_EDGE_LOW at 0 range 26 .. 26; GPIO22_EDGE_HIGH at 0 range 27 .. 27; GPIO23_LEVEL_LOW at 0 range 28 .. 28; GPIO23_LEVEL_HIGH at 0 range 29 .. 29; GPIO23_EDGE_LOW at 0 range 30 .. 30; GPIO23_EDGE_HIGH at 0 range 31 .. 31; end record; -- Interrupt Force for proc1 type PROC1_INTF3_Register is record GPIO24_LEVEL_LOW : Boolean := False; GPIO24_LEVEL_HIGH : Boolean := False; GPIO24_EDGE_LOW : Boolean := False; GPIO24_EDGE_HIGH : Boolean := False; GPIO25_LEVEL_LOW : Boolean := False; GPIO25_LEVEL_HIGH : Boolean := False; GPIO25_EDGE_LOW : Boolean := False; GPIO25_EDGE_HIGH : Boolean := False; GPIO26_LEVEL_LOW : Boolean := False; GPIO26_LEVEL_HIGH : Boolean := False; GPIO26_EDGE_LOW : Boolean := False; GPIO26_EDGE_HIGH : Boolean := False; GPIO27_LEVEL_LOW : Boolean := False; GPIO27_LEVEL_HIGH : Boolean := False; GPIO27_EDGE_LOW : Boolean := False; GPIO27_EDGE_HIGH : Boolean := False; GPIO28_LEVEL_LOW : Boolean := False; GPIO28_LEVEL_HIGH : Boolean := False; GPIO28_EDGE_LOW : Boolean := False; GPIO28_EDGE_HIGH : Boolean := False; GPIO29_LEVEL_LOW : Boolean := False; GPIO29_LEVEL_HIGH : Boolean := False; GPIO29_EDGE_LOW : Boolean := False; GPIO29_EDGE_HIGH : Boolean := False; -- unspecified Reserved_24_31 : HAL.UInt8 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for PROC1_INTF3_Register use record GPIO24_LEVEL_LOW at 0 range 0 .. 0; GPIO24_LEVEL_HIGH at 0 range 1 .. 1; GPIO24_EDGE_LOW at 0 range 2 .. 2; GPIO24_EDGE_HIGH at 0 range 3 .. 3; GPIO25_LEVEL_LOW at 0 range 4 .. 4; GPIO25_LEVEL_HIGH at 0 range 5 .. 5; GPIO25_EDGE_LOW at 0 range 6 .. 6; GPIO25_EDGE_HIGH at 0 range 7 .. 7; GPIO26_LEVEL_LOW at 0 range 8 .. 8; GPIO26_LEVEL_HIGH at 0 range 9 .. 9; GPIO26_EDGE_LOW at 0 range 10 .. 10; GPIO26_EDGE_HIGH at 0 range 11 .. 11; GPIO27_LEVEL_LOW at 0 range 12 .. 12; GPIO27_LEVEL_HIGH at 0 range 13 .. 13; GPIO27_EDGE_LOW at 0 range 14 .. 14; GPIO27_EDGE_HIGH at 0 range 15 .. 15; GPIO28_LEVEL_LOW at 0 range 16 .. 16; GPIO28_LEVEL_HIGH at 0 range 17 .. 17; GPIO28_EDGE_LOW at 0 range 18 .. 18; GPIO28_EDGE_HIGH at 0 range 19 .. 19; GPIO29_LEVEL_LOW at 0 range 20 .. 20; GPIO29_LEVEL_HIGH at 0 range 21 .. 21; GPIO29_EDGE_LOW at 0 range 22 .. 22; GPIO29_EDGE_HIGH at 0 range 23 .. 23; Reserved_24_31 at 0 range 24 .. 31; end record; -- Interrupt status after masking & forcing for proc1 type PROC1_INTS0_Register is record -- Read-only. GPIO0_LEVEL_LOW : Boolean; -- Read-only. GPIO0_LEVEL_HIGH : Boolean; -- Read-only. GPIO0_EDGE_LOW : Boolean; -- Read-only. GPIO0_EDGE_HIGH : Boolean; -- Read-only. GPIO1_LEVEL_LOW : Boolean; -- Read-only. GPIO1_LEVEL_HIGH : Boolean; -- Read-only. GPIO1_EDGE_LOW : Boolean; -- Read-only. GPIO1_EDGE_HIGH : Boolean; -- Read-only. GPIO2_LEVEL_LOW : Boolean; -- Read-only. GPIO2_LEVEL_HIGH : Boolean; -- Read-only. GPIO2_EDGE_LOW : Boolean; -- Read-only. GPIO2_EDGE_HIGH : Boolean; -- Read-only. GPIO3_LEVEL_LOW : Boolean; -- Read-only. GPIO3_LEVEL_HIGH : Boolean; -- Read-only. GPIO3_EDGE_LOW : Boolean; -- Read-only. GPIO3_EDGE_HIGH : Boolean; -- Read-only. GPIO4_LEVEL_LOW : Boolean; -- Read-only. GPIO4_LEVEL_HIGH : Boolean; -- Read-only. GPIO4_EDGE_LOW : Boolean; -- Read-only. GPIO4_EDGE_HIGH : Boolean; -- Read-only. GPIO5_LEVEL_LOW : Boolean; -- Read-only. GPIO5_LEVEL_HIGH : Boolean; -- Read-only. GPIO5_EDGE_LOW : Boolean; -- Read-only. GPIO5_EDGE_HIGH : Boolean; -- Read-only. GPIO6_LEVEL_LOW : Boolean; -- Read-only. GPIO6_LEVEL_HIGH : Boolean; -- Read-only. GPIO6_EDGE_LOW : Boolean; -- Read-only. GPIO6_EDGE_HIGH : Boolean; -- Read-only. GPIO7_LEVEL_LOW : Boolean; -- Read-only. GPIO7_LEVEL_HIGH : Boolean; -- Read-only. GPIO7_EDGE_LOW : Boolean; -- Read-only. GPIO7_EDGE_HIGH : Boolean; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for PROC1_INTS0_Register use record GPIO0_LEVEL_LOW at 0 range 0 .. 0; GPIO0_LEVEL_HIGH at 0 range 1 .. 1; GPIO0_EDGE_LOW at 0 range 2 .. 2; GPIO0_EDGE_HIGH at 0 range 3 .. 3; GPIO1_LEVEL_LOW at 0 range 4 .. 4; GPIO1_LEVEL_HIGH at 0 range 5 .. 5; GPIO1_EDGE_LOW at 0 range 6 .. 6; GPIO1_EDGE_HIGH at 0 range 7 .. 7; GPIO2_LEVEL_LOW at 0 range 8 .. 8; GPIO2_LEVEL_HIGH at 0 range 9 .. 9; GPIO2_EDGE_LOW at 0 range 10 .. 10; GPIO2_EDGE_HIGH at 0 range 11 .. 11; GPIO3_LEVEL_LOW at 0 range 12 .. 12; GPIO3_LEVEL_HIGH at 0 range 13 .. 13; GPIO3_EDGE_LOW at 0 range 14 .. 14; GPIO3_EDGE_HIGH at 0 range 15 .. 15; GPIO4_LEVEL_LOW at 0 range 16 .. 16; GPIO4_LEVEL_HIGH at 0 range 17 .. 17; GPIO4_EDGE_LOW at 0 range 18 .. 18; GPIO4_EDGE_HIGH at 0 range 19 .. 19; GPIO5_LEVEL_LOW at 0 range 20 .. 20; GPIO5_LEVEL_HIGH at 0 range 21 .. 21; GPIO5_EDGE_LOW at 0 range 22 .. 22; GPIO5_EDGE_HIGH at 0 range 23 .. 23; GPIO6_LEVEL_LOW at 0 range 24 .. 24; GPIO6_LEVEL_HIGH at 0 range 25 .. 25; GPIO6_EDGE_LOW at 0 range 26 .. 26; GPIO6_EDGE_HIGH at 0 range 27 .. 27; GPIO7_LEVEL_LOW at 0 range 28 .. 28; GPIO7_LEVEL_HIGH at 0 range 29 .. 29; GPIO7_EDGE_LOW at 0 range 30 .. 30; GPIO7_EDGE_HIGH at 0 range 31 .. 31; end record; -- Interrupt status after masking & forcing for proc1 type PROC1_INTS1_Register is record -- Read-only. GPIO8_LEVEL_LOW : Boolean; -- Read-only. GPIO8_LEVEL_HIGH : Boolean; -- Read-only. GPIO8_EDGE_LOW : Boolean; -- Read-only. GPIO8_EDGE_HIGH : Boolean; -- Read-only. GPIO9_LEVEL_LOW : Boolean; -- Read-only. GPIO9_LEVEL_HIGH : Boolean; -- Read-only. GPIO9_EDGE_LOW : Boolean; -- Read-only. GPIO9_EDGE_HIGH : Boolean; -- Read-only. GPIO10_LEVEL_LOW : Boolean; -- Read-only. GPIO10_LEVEL_HIGH : Boolean; -- Read-only. GPIO10_EDGE_LOW : Boolean; -- Read-only. GPIO10_EDGE_HIGH : Boolean; -- Read-only. GPIO11_LEVEL_LOW : Boolean; -- Read-only. GPIO11_LEVEL_HIGH : Boolean; -- Read-only. GPIO11_EDGE_LOW : Boolean; -- Read-only. GPIO11_EDGE_HIGH : Boolean; -- Read-only. GPIO12_LEVEL_LOW : Boolean; -- Read-only. GPIO12_LEVEL_HIGH : Boolean; -- Read-only. GPIO12_EDGE_LOW : Boolean; -- Read-only. GPIO12_EDGE_HIGH : Boolean; -- Read-only. GPIO13_LEVEL_LOW : Boolean; -- Read-only. GPIO13_LEVEL_HIGH : Boolean; -- Read-only. GPIO13_EDGE_LOW : Boolean; -- Read-only. GPIO13_EDGE_HIGH : Boolean; -- Read-only. GPIO14_LEVEL_LOW : Boolean; -- Read-only. GPIO14_LEVEL_HIGH : Boolean; -- Read-only. GPIO14_EDGE_LOW : Boolean; -- Read-only. GPIO14_EDGE_HIGH : Boolean; -- Read-only. GPIO15_LEVEL_LOW : Boolean; -- Read-only. GPIO15_LEVEL_HIGH : Boolean; -- Read-only. GPIO15_EDGE_LOW : Boolean; -- Read-only. GPIO15_EDGE_HIGH : Boolean; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for PROC1_INTS1_Register use record GPIO8_LEVEL_LOW at 0 range 0 .. 0; GPIO8_LEVEL_HIGH at 0 range 1 .. 1; GPIO8_EDGE_LOW at 0 range 2 .. 2; GPIO8_EDGE_HIGH at 0 range 3 .. 3; GPIO9_LEVEL_LOW at 0 range 4 .. 4; GPIO9_LEVEL_HIGH at 0 range 5 .. 5; GPIO9_EDGE_LOW at 0 range 6 .. 6; GPIO9_EDGE_HIGH at 0 range 7 .. 7; GPIO10_LEVEL_LOW at 0 range 8 .. 8; GPIO10_LEVEL_HIGH at 0 range 9 .. 9; GPIO10_EDGE_LOW at 0 range 10 .. 10; GPIO10_EDGE_HIGH at 0 range 11 .. 11; GPIO11_LEVEL_LOW at 0 range 12 .. 12; GPIO11_LEVEL_HIGH at 0 range 13 .. 13; GPIO11_EDGE_LOW at 0 range 14 .. 14; GPIO11_EDGE_HIGH at 0 range 15 .. 15; GPIO12_LEVEL_LOW at 0 range 16 .. 16; GPIO12_LEVEL_HIGH at 0 range 17 .. 17; GPIO12_EDGE_LOW at 0 range 18 .. 18; GPIO12_EDGE_HIGH at 0 range 19 .. 19; GPIO13_LEVEL_LOW at 0 range 20 .. 20; GPIO13_LEVEL_HIGH at 0 range 21 .. 21; GPIO13_EDGE_LOW at 0 range 22 .. 22; GPIO13_EDGE_HIGH at 0 range 23 .. 23; GPIO14_LEVEL_LOW at 0 range 24 .. 24; GPIO14_LEVEL_HIGH at 0 range 25 .. 25; GPIO14_EDGE_LOW at 0 range 26 .. 26; GPIO14_EDGE_HIGH at 0 range 27 .. 27; GPIO15_LEVEL_LOW at 0 range 28 .. 28; GPIO15_LEVEL_HIGH at 0 range 29 .. 29; GPIO15_EDGE_LOW at 0 range 30 .. 30; GPIO15_EDGE_HIGH at 0 range 31 .. 31; end record; -- Interrupt status after masking & forcing for proc1 type PROC1_INTS2_Register is record -- Read-only. GPIO16_LEVEL_LOW : Boolean; -- Read-only. GPIO16_LEVEL_HIGH : Boolean; -- Read-only. GPIO16_EDGE_LOW : Boolean; -- Read-only. GPIO16_EDGE_HIGH : Boolean; -- Read-only. GPIO17_LEVEL_LOW : Boolean; -- Read-only. GPIO17_LEVEL_HIGH : Boolean; -- Read-only. GPIO17_EDGE_LOW : Boolean; -- Read-only. GPIO17_EDGE_HIGH : Boolean; -- Read-only. GPIO18_LEVEL_LOW : Boolean; -- Read-only. GPIO18_LEVEL_HIGH : Boolean; -- Read-only. GPIO18_EDGE_LOW : Boolean; -- Read-only. GPIO18_EDGE_HIGH : Boolean; -- Read-only. GPIO19_LEVEL_LOW : Boolean; -- Read-only. GPIO19_LEVEL_HIGH : Boolean; -- Read-only. GPIO19_EDGE_LOW : Boolean; -- Read-only. GPIO19_EDGE_HIGH : Boolean; -- Read-only. GPIO20_LEVEL_LOW : Boolean; -- Read-only. GPIO20_LEVEL_HIGH : Boolean; -- Read-only. GPIO20_EDGE_LOW : Boolean; -- Read-only. GPIO20_EDGE_HIGH : Boolean; -- Read-only. GPIO21_LEVEL_LOW : Boolean; -- Read-only. GPIO21_LEVEL_HIGH : Boolean; -- Read-only. GPIO21_EDGE_LOW : Boolean; -- Read-only. GPIO21_EDGE_HIGH : Boolean; -- Read-only. GPIO22_LEVEL_LOW : Boolean; -- Read-only. GPIO22_LEVEL_HIGH : Boolean; -- Read-only. GPIO22_EDGE_LOW : Boolean; -- Read-only. GPIO22_EDGE_HIGH : Boolean; -- Read-only. GPIO23_LEVEL_LOW : Boolean; -- Read-only. GPIO23_LEVEL_HIGH : Boolean; -- Read-only. GPIO23_EDGE_LOW : Boolean; -- Read-only. GPIO23_EDGE_HIGH : Boolean; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for PROC1_INTS2_Register use record GPIO16_LEVEL_LOW at 0 range 0 .. 0; GPIO16_LEVEL_HIGH at 0 range 1 .. 1; GPIO16_EDGE_LOW at 0 range 2 .. 2; GPIO16_EDGE_HIGH at 0 range 3 .. 3; GPIO17_LEVEL_LOW at 0 range 4 .. 4; GPIO17_LEVEL_HIGH at 0 range 5 .. 5; GPIO17_EDGE_LOW at 0 range 6 .. 6; GPIO17_EDGE_HIGH at 0 range 7 .. 7; GPIO18_LEVEL_LOW at 0 range 8 .. 8; GPIO18_LEVEL_HIGH at 0 range 9 .. 9; GPIO18_EDGE_LOW at 0 range 10 .. 10; GPIO18_EDGE_HIGH at 0 range 11 .. 11; GPIO19_LEVEL_LOW at 0 range 12 .. 12; GPIO19_LEVEL_HIGH at 0 range 13 .. 13; GPIO19_EDGE_LOW at 0 range 14 .. 14; GPIO19_EDGE_HIGH at 0 range 15 .. 15; GPIO20_LEVEL_LOW at 0 range 16 .. 16; GPIO20_LEVEL_HIGH at 0 range 17 .. 17; GPIO20_EDGE_LOW at 0 range 18 .. 18; GPIO20_EDGE_HIGH at 0 range 19 .. 19; GPIO21_LEVEL_LOW at 0 range 20 .. 20; GPIO21_LEVEL_HIGH at 0 range 21 .. 21; GPIO21_EDGE_LOW at 0 range 22 .. 22; GPIO21_EDGE_HIGH at 0 range 23 .. 23; GPIO22_LEVEL_LOW at 0 range 24 .. 24; GPIO22_LEVEL_HIGH at 0 range 25 .. 25; GPIO22_EDGE_LOW at 0 range 26 .. 26; GPIO22_EDGE_HIGH at 0 range 27 .. 27; GPIO23_LEVEL_LOW at 0 range 28 .. 28; GPIO23_LEVEL_HIGH at 0 range 29 .. 29; GPIO23_EDGE_LOW at 0 range 30 .. 30; GPIO23_EDGE_HIGH at 0 range 31 .. 31; end record; -- Interrupt status after masking & forcing for proc1 type PROC1_INTS3_Register is record -- Read-only. GPIO24_LEVEL_LOW : Boolean; -- Read-only. GPIO24_LEVEL_HIGH : Boolean; -- Read-only. GPIO24_EDGE_LOW : Boolean; -- Read-only. GPIO24_EDGE_HIGH : Boolean; -- Read-only. GPIO25_LEVEL_LOW : Boolean; -- Read-only. GPIO25_LEVEL_HIGH : Boolean; -- Read-only. GPIO25_EDGE_LOW : Boolean; -- Read-only. GPIO25_EDGE_HIGH : Boolean; -- Read-only. GPIO26_LEVEL_LOW : Boolean; -- Read-only. GPIO26_LEVEL_HIGH : Boolean; -- Read-only. GPIO26_EDGE_LOW : Boolean; -- Read-only. GPIO26_EDGE_HIGH : Boolean; -- Read-only. GPIO27_LEVEL_LOW : Boolean; -- Read-only. GPIO27_LEVEL_HIGH : Boolean; -- Read-only. GPIO27_EDGE_LOW : Boolean; -- Read-only. GPIO27_EDGE_HIGH : Boolean; -- Read-only. GPIO28_LEVEL_LOW : Boolean; -- Read-only. GPIO28_LEVEL_HIGH : Boolean; -- Read-only. GPIO28_EDGE_LOW : Boolean; -- Read-only. GPIO28_EDGE_HIGH : Boolean; -- Read-only. GPIO29_LEVEL_LOW : Boolean; -- Read-only. GPIO29_LEVEL_HIGH : Boolean; -- Read-only. GPIO29_EDGE_LOW : Boolean; -- Read-only. GPIO29_EDGE_HIGH : Boolean; -- unspecified Reserved_24_31 : HAL.UInt8; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for PROC1_INTS3_Register use record GPIO24_LEVEL_LOW at 0 range 0 .. 0; GPIO24_LEVEL_HIGH at 0 range 1 .. 1; GPIO24_EDGE_LOW at 0 range 2 .. 2; GPIO24_EDGE_HIGH at 0 range 3 .. 3; GPIO25_LEVEL_LOW at 0 range 4 .. 4; GPIO25_LEVEL_HIGH at 0 range 5 .. 5; GPIO25_EDGE_LOW at 0 range 6 .. 6; GPIO25_EDGE_HIGH at 0 range 7 .. 7; GPIO26_LEVEL_LOW at 0 range 8 .. 8; GPIO26_LEVEL_HIGH at 0 range 9 .. 9; GPIO26_EDGE_LOW at 0 range 10 .. 10; GPIO26_EDGE_HIGH at 0 range 11 .. 11; GPIO27_LEVEL_LOW at 0 range 12 .. 12; GPIO27_LEVEL_HIGH at 0 range 13 .. 13; GPIO27_EDGE_LOW at 0 range 14 .. 14; GPIO27_EDGE_HIGH at 0 range 15 .. 15; GPIO28_LEVEL_LOW at 0 range 16 .. 16; GPIO28_LEVEL_HIGH at 0 range 17 .. 17; GPIO28_EDGE_LOW at 0 range 18 .. 18; GPIO28_EDGE_HIGH at 0 range 19 .. 19; GPIO29_LEVEL_LOW at 0 range 20 .. 20; GPIO29_LEVEL_HIGH at 0 range 21 .. 21; GPIO29_EDGE_LOW at 0 range 22 .. 22; GPIO29_EDGE_HIGH at 0 range 23 .. 23; Reserved_24_31 at 0 range 24 .. 31; end record; -- Interrupt Enable for dormant_wake type DORMANT_WAKE_INTE0_Register is record GPIO0_LEVEL_LOW : Boolean := False; GPIO0_LEVEL_HIGH : Boolean := False; GPIO0_EDGE_LOW : Boolean := False; GPIO0_EDGE_HIGH : Boolean := False; GPIO1_LEVEL_LOW : Boolean := False; GPIO1_LEVEL_HIGH : Boolean := False; GPIO1_EDGE_LOW : Boolean := False; GPIO1_EDGE_HIGH : Boolean := False; GPIO2_LEVEL_LOW : Boolean := False; GPIO2_LEVEL_HIGH : Boolean := False; GPIO2_EDGE_LOW : Boolean := False; GPIO2_EDGE_HIGH : Boolean := False; GPIO3_LEVEL_LOW : Boolean := False; GPIO3_LEVEL_HIGH : Boolean := False; GPIO3_EDGE_LOW : Boolean := False; GPIO3_EDGE_HIGH : Boolean := False; GPIO4_LEVEL_LOW : Boolean := False; GPIO4_LEVEL_HIGH : Boolean := False; GPIO4_EDGE_LOW : Boolean := False; GPIO4_EDGE_HIGH : Boolean := False; GPIO5_LEVEL_LOW : Boolean := False; GPIO5_LEVEL_HIGH : Boolean := False; GPIO5_EDGE_LOW : Boolean := False; GPIO5_EDGE_HIGH : Boolean := False; GPIO6_LEVEL_LOW : Boolean := False; GPIO6_LEVEL_HIGH : Boolean := False; GPIO6_EDGE_LOW : Boolean := False; GPIO6_EDGE_HIGH : Boolean := False; GPIO7_LEVEL_LOW : Boolean := False; GPIO7_LEVEL_HIGH : Boolean := False; GPIO7_EDGE_LOW : Boolean := False; GPIO7_EDGE_HIGH : Boolean := False; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for DORMANT_WAKE_INTE0_Register use record GPIO0_LEVEL_LOW at 0 range 0 .. 0; GPIO0_LEVEL_HIGH at 0 range 1 .. 1; GPIO0_EDGE_LOW at 0 range 2 .. 2; GPIO0_EDGE_HIGH at 0 range 3 .. 3; GPIO1_LEVEL_LOW at 0 range 4 .. 4; GPIO1_LEVEL_HIGH at 0 range 5 .. 5; GPIO1_EDGE_LOW at 0 range 6 .. 6; GPIO1_EDGE_HIGH at 0 range 7 .. 7; GPIO2_LEVEL_LOW at 0 range 8 .. 8; GPIO2_LEVEL_HIGH at 0 range 9 .. 9; GPIO2_EDGE_LOW at 0 range 10 .. 10; GPIO2_EDGE_HIGH at 0 range 11 .. 11; GPIO3_LEVEL_LOW at 0 range 12 .. 12; GPIO3_LEVEL_HIGH at 0 range 13 .. 13; GPIO3_EDGE_LOW at 0 range 14 .. 14; GPIO3_EDGE_HIGH at 0 range 15 .. 15; GPIO4_LEVEL_LOW at 0 range 16 .. 16; GPIO4_LEVEL_HIGH at 0 range 17 .. 17; GPIO4_EDGE_LOW at 0 range 18 .. 18; GPIO4_EDGE_HIGH at 0 range 19 .. 19; GPIO5_LEVEL_LOW at 0 range 20 .. 20; GPIO5_LEVEL_HIGH at 0 range 21 .. 21; GPIO5_EDGE_LOW at 0 range 22 .. 22; GPIO5_EDGE_HIGH at 0 range 23 .. 23; GPIO6_LEVEL_LOW at 0 range 24 .. 24; GPIO6_LEVEL_HIGH at 0 range 25 .. 25; GPIO6_EDGE_LOW at 0 range 26 .. 26; GPIO6_EDGE_HIGH at 0 range 27 .. 27; GPIO7_LEVEL_LOW at 0 range 28 .. 28; GPIO7_LEVEL_HIGH at 0 range 29 .. 29; GPIO7_EDGE_LOW at 0 range 30 .. 30; GPIO7_EDGE_HIGH at 0 range 31 .. 31; end record; -- Interrupt Enable for dormant_wake type DORMANT_WAKE_INTE1_Register is record GPIO8_LEVEL_LOW : Boolean := False; GPIO8_LEVEL_HIGH : Boolean := False; GPIO8_EDGE_LOW : Boolean := False; GPIO8_EDGE_HIGH : Boolean := False; GPIO9_LEVEL_LOW : Boolean := False; GPIO9_LEVEL_HIGH : Boolean := False; GPIO9_EDGE_LOW : Boolean := False; GPIO9_EDGE_HIGH : Boolean := False; GPIO10_LEVEL_LOW : Boolean := False; GPIO10_LEVEL_HIGH : Boolean := False; GPIO10_EDGE_LOW : Boolean := False; GPIO10_EDGE_HIGH : Boolean := False; GPIO11_LEVEL_LOW : Boolean := False; GPIO11_LEVEL_HIGH : Boolean := False; GPIO11_EDGE_LOW : Boolean := False; GPIO11_EDGE_HIGH : Boolean := False; GPIO12_LEVEL_LOW : Boolean := False; GPIO12_LEVEL_HIGH : Boolean := False; GPIO12_EDGE_LOW : Boolean := False; GPIO12_EDGE_HIGH : Boolean := False; GPIO13_LEVEL_LOW : Boolean := False; GPIO13_LEVEL_HIGH : Boolean := False; GPIO13_EDGE_LOW : Boolean := False; GPIO13_EDGE_HIGH : Boolean := False; GPIO14_LEVEL_LOW : Boolean := False; GPIO14_LEVEL_HIGH : Boolean := False; GPIO14_EDGE_LOW : Boolean := False; GPIO14_EDGE_HIGH : Boolean := False; GPIO15_LEVEL_LOW : Boolean := False; GPIO15_LEVEL_HIGH : Boolean := False; GPIO15_EDGE_LOW : Boolean := False; GPIO15_EDGE_HIGH : Boolean := False; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for DORMANT_WAKE_INTE1_Register use record GPIO8_LEVEL_LOW at 0 range 0 .. 0; GPIO8_LEVEL_HIGH at 0 range 1 .. 1; GPIO8_EDGE_LOW at 0 range 2 .. 2; GPIO8_EDGE_HIGH at 0 range 3 .. 3; GPIO9_LEVEL_LOW at 0 range 4 .. 4; GPIO9_LEVEL_HIGH at 0 range 5 .. 5; GPIO9_EDGE_LOW at 0 range 6 .. 6; GPIO9_EDGE_HIGH at 0 range 7 .. 7; GPIO10_LEVEL_LOW at 0 range 8 .. 8; GPIO10_LEVEL_HIGH at 0 range 9 .. 9; GPIO10_EDGE_LOW at 0 range 10 .. 10; GPIO10_EDGE_HIGH at 0 range 11 .. 11; GPIO11_LEVEL_LOW at 0 range 12 .. 12; GPIO11_LEVEL_HIGH at 0 range 13 .. 13; GPIO11_EDGE_LOW at 0 range 14 .. 14; GPIO11_EDGE_HIGH at 0 range 15 .. 15; GPIO12_LEVEL_LOW at 0 range 16 .. 16; GPIO12_LEVEL_HIGH at 0 range 17 .. 17; GPIO12_EDGE_LOW at 0 range 18 .. 18; GPIO12_EDGE_HIGH at 0 range 19 .. 19; GPIO13_LEVEL_LOW at 0 range 20 .. 20; GPIO13_LEVEL_HIGH at 0 range 21 .. 21; GPIO13_EDGE_LOW at 0 range 22 .. 22; GPIO13_EDGE_HIGH at 0 range 23 .. 23; GPIO14_LEVEL_LOW at 0 range 24 .. 24; GPIO14_LEVEL_HIGH at 0 range 25 .. 25; GPIO14_EDGE_LOW at 0 range 26 .. 26; GPIO14_EDGE_HIGH at 0 range 27 .. 27; GPIO15_LEVEL_LOW at 0 range 28 .. 28; GPIO15_LEVEL_HIGH at 0 range 29 .. 29; GPIO15_EDGE_LOW at 0 range 30 .. 30; GPIO15_EDGE_HIGH at 0 range 31 .. 31; end record; -- Interrupt Enable for dormant_wake type DORMANT_WAKE_INTE2_Register is record GPIO16_LEVEL_LOW : Boolean := False; GPIO16_LEVEL_HIGH : Boolean := False; GPIO16_EDGE_LOW : Boolean := False; GPIO16_EDGE_HIGH : Boolean := False; GPIO17_LEVEL_LOW : Boolean := False; GPIO17_LEVEL_HIGH : Boolean := False; GPIO17_EDGE_LOW : Boolean := False; GPIO17_EDGE_HIGH : Boolean := False; GPIO18_LEVEL_LOW : Boolean := False; GPIO18_LEVEL_HIGH : Boolean := False; GPIO18_EDGE_LOW : Boolean := False; GPIO18_EDGE_HIGH : Boolean := False; GPIO19_LEVEL_LOW : Boolean := False; GPIO19_LEVEL_HIGH : Boolean := False; GPIO19_EDGE_LOW : Boolean := False; GPIO19_EDGE_HIGH : Boolean := False; GPIO20_LEVEL_LOW : Boolean := False; GPIO20_LEVEL_HIGH : Boolean := False; GPIO20_EDGE_LOW : Boolean := False; GPIO20_EDGE_HIGH : Boolean := False; GPIO21_LEVEL_LOW : Boolean := False; GPIO21_LEVEL_HIGH : Boolean := False; GPIO21_EDGE_LOW : Boolean := False; GPIO21_EDGE_HIGH : Boolean := False; GPIO22_LEVEL_LOW : Boolean := False; GPIO22_LEVEL_HIGH : Boolean := False; GPIO22_EDGE_LOW : Boolean := False; GPIO22_EDGE_HIGH : Boolean := False; GPIO23_LEVEL_LOW : Boolean := False; GPIO23_LEVEL_HIGH : Boolean := False; GPIO23_EDGE_LOW : Boolean := False; GPIO23_EDGE_HIGH : Boolean := False; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for DORMANT_WAKE_INTE2_Register use record GPIO16_LEVEL_LOW at 0 range 0 .. 0; GPIO16_LEVEL_HIGH at 0 range 1 .. 1; GPIO16_EDGE_LOW at 0 range 2 .. 2; GPIO16_EDGE_HIGH at 0 range 3 .. 3; GPIO17_LEVEL_LOW at 0 range 4 .. 4; GPIO17_LEVEL_HIGH at 0 range 5 .. 5; GPIO17_EDGE_LOW at 0 range 6 .. 6; GPIO17_EDGE_HIGH at 0 range 7 .. 7; GPIO18_LEVEL_LOW at 0 range 8 .. 8; GPIO18_LEVEL_HIGH at 0 range 9 .. 9; GPIO18_EDGE_LOW at 0 range 10 .. 10; GPIO18_EDGE_HIGH at 0 range 11 .. 11; GPIO19_LEVEL_LOW at 0 range 12 .. 12; GPIO19_LEVEL_HIGH at 0 range 13 .. 13; GPIO19_EDGE_LOW at 0 range 14 .. 14; GPIO19_EDGE_HIGH at 0 range 15 .. 15; GPIO20_LEVEL_LOW at 0 range 16 .. 16; GPIO20_LEVEL_HIGH at 0 range 17 .. 17; GPIO20_EDGE_LOW at 0 range 18 .. 18; GPIO20_EDGE_HIGH at 0 range 19 .. 19; GPIO21_LEVEL_LOW at 0 range 20 .. 20; GPIO21_LEVEL_HIGH at 0 range 21 .. 21; GPIO21_EDGE_LOW at 0 range 22 .. 22; GPIO21_EDGE_HIGH at 0 range 23 .. 23; GPIO22_LEVEL_LOW at 0 range 24 .. 24; GPIO22_LEVEL_HIGH at 0 range 25 .. 25; GPIO22_EDGE_LOW at 0 range 26 .. 26; GPIO22_EDGE_HIGH at 0 range 27 .. 27; GPIO23_LEVEL_LOW at 0 range 28 .. 28; GPIO23_LEVEL_HIGH at 0 range 29 .. 29; GPIO23_EDGE_LOW at 0 range 30 .. 30; GPIO23_EDGE_HIGH at 0 range 31 .. 31; end record; -- Interrupt Enable for dormant_wake type DORMANT_WAKE_INTE3_Register is record GPIO24_LEVEL_LOW : Boolean := False; GPIO24_LEVEL_HIGH : Boolean := False; GPIO24_EDGE_LOW : Boolean := False; GPIO24_EDGE_HIGH : Boolean := False; GPIO25_LEVEL_LOW : Boolean := False; GPIO25_LEVEL_HIGH : Boolean := False; GPIO25_EDGE_LOW : Boolean := False; GPIO25_EDGE_HIGH : Boolean := False; GPIO26_LEVEL_LOW : Boolean := False; GPIO26_LEVEL_HIGH : Boolean := False; GPIO26_EDGE_LOW : Boolean := False; GPIO26_EDGE_HIGH : Boolean := False; GPIO27_LEVEL_LOW : Boolean := False; GPIO27_LEVEL_HIGH : Boolean := False; GPIO27_EDGE_LOW : Boolean := False; GPIO27_EDGE_HIGH : Boolean := False; GPIO28_LEVEL_LOW : Boolean := False; GPIO28_LEVEL_HIGH : Boolean := False; GPIO28_EDGE_LOW : Boolean := False; GPIO28_EDGE_HIGH : Boolean := False; GPIO29_LEVEL_LOW : Boolean := False; GPIO29_LEVEL_HIGH : Boolean := False; GPIO29_EDGE_LOW : Boolean := False; GPIO29_EDGE_HIGH : Boolean := False; -- unspecified Reserved_24_31 : HAL.UInt8 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for DORMANT_WAKE_INTE3_Register use record GPIO24_LEVEL_LOW at 0 range 0 .. 0; GPIO24_LEVEL_HIGH at 0 range 1 .. 1; GPIO24_EDGE_LOW at 0 range 2 .. 2; GPIO24_EDGE_HIGH at 0 range 3 .. 3; GPIO25_LEVEL_LOW at 0 range 4 .. 4; GPIO25_LEVEL_HIGH at 0 range 5 .. 5; GPIO25_EDGE_LOW at 0 range 6 .. 6; GPIO25_EDGE_HIGH at 0 range 7 .. 7; GPIO26_LEVEL_LOW at 0 range 8 .. 8; GPIO26_LEVEL_HIGH at 0 range 9 .. 9; GPIO26_EDGE_LOW at 0 range 10 .. 10; GPIO26_EDGE_HIGH at 0 range 11 .. 11; GPIO27_LEVEL_LOW at 0 range 12 .. 12; GPIO27_LEVEL_HIGH at 0 range 13 .. 13; GPIO27_EDGE_LOW at 0 range 14 .. 14; GPIO27_EDGE_HIGH at 0 range 15 .. 15; GPIO28_LEVEL_LOW at 0 range 16 .. 16; GPIO28_LEVEL_HIGH at 0 range 17 .. 17; GPIO28_EDGE_LOW at 0 range 18 .. 18; GPIO28_EDGE_HIGH at 0 range 19 .. 19; GPIO29_LEVEL_LOW at 0 range 20 .. 20; GPIO29_LEVEL_HIGH at 0 range 21 .. 21; GPIO29_EDGE_LOW at 0 range 22 .. 22; GPIO29_EDGE_HIGH at 0 range 23 .. 23; Reserved_24_31 at 0 range 24 .. 31; end record; -- Interrupt Force for dormant_wake type DORMANT_WAKE_INTF0_Register is record GPIO0_LEVEL_LOW : Boolean := False; GPIO0_LEVEL_HIGH : Boolean := False; GPIO0_EDGE_LOW : Boolean := False; GPIO0_EDGE_HIGH : Boolean := False; GPIO1_LEVEL_LOW : Boolean := False; GPIO1_LEVEL_HIGH : Boolean := False; GPIO1_EDGE_LOW : Boolean := False; GPIO1_EDGE_HIGH : Boolean := False; GPIO2_LEVEL_LOW : Boolean := False; GPIO2_LEVEL_HIGH : Boolean := False; GPIO2_EDGE_LOW : Boolean := False; GPIO2_EDGE_HIGH : Boolean := False; GPIO3_LEVEL_LOW : Boolean := False; GPIO3_LEVEL_HIGH : Boolean := False; GPIO3_EDGE_LOW : Boolean := False; GPIO3_EDGE_HIGH : Boolean := False; GPIO4_LEVEL_LOW : Boolean := False; GPIO4_LEVEL_HIGH : Boolean := False; GPIO4_EDGE_LOW : Boolean := False; GPIO4_EDGE_HIGH : Boolean := False; GPIO5_LEVEL_LOW : Boolean := False; GPIO5_LEVEL_HIGH : Boolean := False; GPIO5_EDGE_LOW : Boolean := False; GPIO5_EDGE_HIGH : Boolean := False; GPIO6_LEVEL_LOW : Boolean := False; GPIO6_LEVEL_HIGH : Boolean := False; GPIO6_EDGE_LOW : Boolean := False; GPIO6_EDGE_HIGH : Boolean := False; GPIO7_LEVEL_LOW : Boolean := False; GPIO7_LEVEL_HIGH : Boolean := False; GPIO7_EDGE_LOW : Boolean := False; GPIO7_EDGE_HIGH : Boolean := False; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for DORMANT_WAKE_INTF0_Register use record GPIO0_LEVEL_LOW at 0 range 0 .. 0; GPIO0_LEVEL_HIGH at 0 range 1 .. 1; GPIO0_EDGE_LOW at 0 range 2 .. 2; GPIO0_EDGE_HIGH at 0 range 3 .. 3; GPIO1_LEVEL_LOW at 0 range 4 .. 4; GPIO1_LEVEL_HIGH at 0 range 5 .. 5; GPIO1_EDGE_LOW at 0 range 6 .. 6; GPIO1_EDGE_HIGH at 0 range 7 .. 7; GPIO2_LEVEL_LOW at 0 range 8 .. 8; GPIO2_LEVEL_HIGH at 0 range 9 .. 9; GPIO2_EDGE_LOW at 0 range 10 .. 10; GPIO2_EDGE_HIGH at 0 range 11 .. 11; GPIO3_LEVEL_LOW at 0 range 12 .. 12; GPIO3_LEVEL_HIGH at 0 range 13 .. 13; GPIO3_EDGE_LOW at 0 range 14 .. 14; GPIO3_EDGE_HIGH at 0 range 15 .. 15; GPIO4_LEVEL_LOW at 0 range 16 .. 16; GPIO4_LEVEL_HIGH at 0 range 17 .. 17; GPIO4_EDGE_LOW at 0 range 18 .. 18; GPIO4_EDGE_HIGH at 0 range 19 .. 19; GPIO5_LEVEL_LOW at 0 range 20 .. 20; GPIO5_LEVEL_HIGH at 0 range 21 .. 21; GPIO5_EDGE_LOW at 0 range 22 .. 22; GPIO5_EDGE_HIGH at 0 range 23 .. 23; GPIO6_LEVEL_LOW at 0 range 24 .. 24; GPIO6_LEVEL_HIGH at 0 range 25 .. 25; GPIO6_EDGE_LOW at 0 range 26 .. 26; GPIO6_EDGE_HIGH at 0 range 27 .. 27; GPIO7_LEVEL_LOW at 0 range 28 .. 28; GPIO7_LEVEL_HIGH at 0 range 29 .. 29; GPIO7_EDGE_LOW at 0 range 30 .. 30; GPIO7_EDGE_HIGH at 0 range 31 .. 31; end record; -- Interrupt Force for dormant_wake type DORMANT_WAKE_INTF1_Register is record GPIO8_LEVEL_LOW : Boolean := False; GPIO8_LEVEL_HIGH : Boolean := False; GPIO8_EDGE_LOW : Boolean := False; GPIO8_EDGE_HIGH : Boolean := False; GPIO9_LEVEL_LOW : Boolean := False; GPIO9_LEVEL_HIGH : Boolean := False; GPIO9_EDGE_LOW : Boolean := False; GPIO9_EDGE_HIGH : Boolean := False; GPIO10_LEVEL_LOW : Boolean := False; GPIO10_LEVEL_HIGH : Boolean := False; GPIO10_EDGE_LOW : Boolean := False; GPIO10_EDGE_HIGH : Boolean := False; GPIO11_LEVEL_LOW : Boolean := False; GPIO11_LEVEL_HIGH : Boolean := False; GPIO11_EDGE_LOW : Boolean := False; GPIO11_EDGE_HIGH : Boolean := False; GPIO12_LEVEL_LOW : Boolean := False; GPIO12_LEVEL_HIGH : Boolean := False; GPIO12_EDGE_LOW : Boolean := False; GPIO12_EDGE_HIGH : Boolean := False; GPIO13_LEVEL_LOW : Boolean := False; GPIO13_LEVEL_HIGH : Boolean := False; GPIO13_EDGE_LOW : Boolean := False; GPIO13_EDGE_HIGH : Boolean := False; GPIO14_LEVEL_LOW : Boolean := False; GPIO14_LEVEL_HIGH : Boolean := False; GPIO14_EDGE_LOW : Boolean := False; GPIO14_EDGE_HIGH : Boolean := False; GPIO15_LEVEL_LOW : Boolean := False; GPIO15_LEVEL_HIGH : Boolean := False; GPIO15_EDGE_LOW : Boolean := False; GPIO15_EDGE_HIGH : Boolean := False; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for DORMANT_WAKE_INTF1_Register use record GPIO8_LEVEL_LOW at 0 range 0 .. 0; GPIO8_LEVEL_HIGH at 0 range 1 .. 1; GPIO8_EDGE_LOW at 0 range 2 .. 2; GPIO8_EDGE_HIGH at 0 range 3 .. 3; GPIO9_LEVEL_LOW at 0 range 4 .. 4; GPIO9_LEVEL_HIGH at 0 range 5 .. 5; GPIO9_EDGE_LOW at 0 range 6 .. 6; GPIO9_EDGE_HIGH at 0 range 7 .. 7; GPIO10_LEVEL_LOW at 0 range 8 .. 8; GPIO10_LEVEL_HIGH at 0 range 9 .. 9; GPIO10_EDGE_LOW at 0 range 10 .. 10; GPIO10_EDGE_HIGH at 0 range 11 .. 11; GPIO11_LEVEL_LOW at 0 range 12 .. 12; GPIO11_LEVEL_HIGH at 0 range 13 .. 13; GPIO11_EDGE_LOW at 0 range 14 .. 14; GPIO11_EDGE_HIGH at 0 range 15 .. 15; GPIO12_LEVEL_LOW at 0 range 16 .. 16; GPIO12_LEVEL_HIGH at 0 range 17 .. 17; GPIO12_EDGE_LOW at 0 range 18 .. 18; GPIO12_EDGE_HIGH at 0 range 19 .. 19; GPIO13_LEVEL_LOW at 0 range 20 .. 20; GPIO13_LEVEL_HIGH at 0 range 21 .. 21; GPIO13_EDGE_LOW at 0 range 22 .. 22; GPIO13_EDGE_HIGH at 0 range 23 .. 23; GPIO14_LEVEL_LOW at 0 range 24 .. 24; GPIO14_LEVEL_HIGH at 0 range 25 .. 25; GPIO14_EDGE_LOW at 0 range 26 .. 26; GPIO14_EDGE_HIGH at 0 range 27 .. 27; GPIO15_LEVEL_LOW at 0 range 28 .. 28; GPIO15_LEVEL_HIGH at 0 range 29 .. 29; GPIO15_EDGE_LOW at 0 range 30 .. 30; GPIO15_EDGE_HIGH at 0 range 31 .. 31; end record; -- Interrupt Force for dormant_wake type DORMANT_WAKE_INTF2_Register is record GPIO16_LEVEL_LOW : Boolean := False; GPIO16_LEVEL_HIGH : Boolean := False; GPIO16_EDGE_LOW : Boolean := False; GPIO16_EDGE_HIGH : Boolean := False; GPIO17_LEVEL_LOW : Boolean := False; GPIO17_LEVEL_HIGH : Boolean := False; GPIO17_EDGE_LOW : Boolean := False; GPIO17_EDGE_HIGH : Boolean := False; GPIO18_LEVEL_LOW : Boolean := False; GPIO18_LEVEL_HIGH : Boolean := False; GPIO18_EDGE_LOW : Boolean := False; GPIO18_EDGE_HIGH : Boolean := False; GPIO19_LEVEL_LOW : Boolean := False; GPIO19_LEVEL_HIGH : Boolean := False; GPIO19_EDGE_LOW : Boolean := False; GPIO19_EDGE_HIGH : Boolean := False; GPIO20_LEVEL_LOW : Boolean := False; GPIO20_LEVEL_HIGH : Boolean := False; GPIO20_EDGE_LOW : Boolean := False; GPIO20_EDGE_HIGH : Boolean := False; GPIO21_LEVEL_LOW : Boolean := False; GPIO21_LEVEL_HIGH : Boolean := False; GPIO21_EDGE_LOW : Boolean := False; GPIO21_EDGE_HIGH : Boolean := False; GPIO22_LEVEL_LOW : Boolean := False; GPIO22_LEVEL_HIGH : Boolean := False; GPIO22_EDGE_LOW : Boolean := False; GPIO22_EDGE_HIGH : Boolean := False; GPIO23_LEVEL_LOW : Boolean := False; GPIO23_LEVEL_HIGH : Boolean := False; GPIO23_EDGE_LOW : Boolean := False; GPIO23_EDGE_HIGH : Boolean := False; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for DORMANT_WAKE_INTF2_Register use record GPIO16_LEVEL_LOW at 0 range 0 .. 0; GPIO16_LEVEL_HIGH at 0 range 1 .. 1; GPIO16_EDGE_LOW at 0 range 2 .. 2; GPIO16_EDGE_HIGH at 0 range 3 .. 3; GPIO17_LEVEL_LOW at 0 range 4 .. 4; GPIO17_LEVEL_HIGH at 0 range 5 .. 5; GPIO17_EDGE_LOW at 0 range 6 .. 6; GPIO17_EDGE_HIGH at 0 range 7 .. 7; GPIO18_LEVEL_LOW at 0 range 8 .. 8; GPIO18_LEVEL_HIGH at 0 range 9 .. 9; GPIO18_EDGE_LOW at 0 range 10 .. 10; GPIO18_EDGE_HIGH at 0 range 11 .. 11; GPIO19_LEVEL_LOW at 0 range 12 .. 12; GPIO19_LEVEL_HIGH at 0 range 13 .. 13; GPIO19_EDGE_LOW at 0 range 14 .. 14; GPIO19_EDGE_HIGH at 0 range 15 .. 15; GPIO20_LEVEL_LOW at 0 range 16 .. 16; GPIO20_LEVEL_HIGH at 0 range 17 .. 17; GPIO20_EDGE_LOW at 0 range 18 .. 18; GPIO20_EDGE_HIGH at 0 range 19 .. 19; GPIO21_LEVEL_LOW at 0 range 20 .. 20; GPIO21_LEVEL_HIGH at 0 range 21 .. 21; GPIO21_EDGE_LOW at 0 range 22 .. 22; GPIO21_EDGE_HIGH at 0 range 23 .. 23; GPIO22_LEVEL_LOW at 0 range 24 .. 24; GPIO22_LEVEL_HIGH at 0 range 25 .. 25; GPIO22_EDGE_LOW at 0 range 26 .. 26; GPIO22_EDGE_HIGH at 0 range 27 .. 27; GPIO23_LEVEL_LOW at 0 range 28 .. 28; GPIO23_LEVEL_HIGH at 0 range 29 .. 29; GPIO23_EDGE_LOW at 0 range 30 .. 30; GPIO23_EDGE_HIGH at 0 range 31 .. 31; end record; -- Interrupt Force for dormant_wake type DORMANT_WAKE_INTF3_Register is record GPIO24_LEVEL_LOW : Boolean := False; GPIO24_LEVEL_HIGH : Boolean := False; GPIO24_EDGE_LOW : Boolean := False; GPIO24_EDGE_HIGH : Boolean := False; GPIO25_LEVEL_LOW : Boolean := False; GPIO25_LEVEL_HIGH : Boolean := False; GPIO25_EDGE_LOW : Boolean := False; GPIO25_EDGE_HIGH : Boolean := False; GPIO26_LEVEL_LOW : Boolean := False; GPIO26_LEVEL_HIGH : Boolean := False; GPIO26_EDGE_LOW : Boolean := False; GPIO26_EDGE_HIGH : Boolean := False; GPIO27_LEVEL_LOW : Boolean := False; GPIO27_LEVEL_HIGH : Boolean := False; GPIO27_EDGE_LOW : Boolean := False; GPIO27_EDGE_HIGH : Boolean := False; GPIO28_LEVEL_LOW : Boolean := False; GPIO28_LEVEL_HIGH : Boolean := False; GPIO28_EDGE_LOW : Boolean := False; GPIO28_EDGE_HIGH : Boolean := False; GPIO29_LEVEL_LOW : Boolean := False; GPIO29_LEVEL_HIGH : Boolean := False; GPIO29_EDGE_LOW : Boolean := False; GPIO29_EDGE_HIGH : Boolean := False; -- unspecified Reserved_24_31 : HAL.UInt8 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for DORMANT_WAKE_INTF3_Register use record GPIO24_LEVEL_LOW at 0 range 0 .. 0; GPIO24_LEVEL_HIGH at 0 range 1 .. 1; GPIO24_EDGE_LOW at 0 range 2 .. 2; GPIO24_EDGE_HIGH at 0 range 3 .. 3; GPIO25_LEVEL_LOW at 0 range 4 .. 4; GPIO25_LEVEL_HIGH at 0 range 5 .. 5; GPIO25_EDGE_LOW at 0 range 6 .. 6; GPIO25_EDGE_HIGH at 0 range 7 .. 7; GPIO26_LEVEL_LOW at 0 range 8 .. 8; GPIO26_LEVEL_HIGH at 0 range 9 .. 9; GPIO26_EDGE_LOW at 0 range 10 .. 10; GPIO26_EDGE_HIGH at 0 range 11 .. 11; GPIO27_LEVEL_LOW at 0 range 12 .. 12; GPIO27_LEVEL_HIGH at 0 range 13 .. 13; GPIO27_EDGE_LOW at 0 range 14 .. 14; GPIO27_EDGE_HIGH at 0 range 15 .. 15; GPIO28_LEVEL_LOW at 0 range 16 .. 16; GPIO28_LEVEL_HIGH at 0 range 17 .. 17; GPIO28_EDGE_LOW at 0 range 18 .. 18; GPIO28_EDGE_HIGH at 0 range 19 .. 19; GPIO29_LEVEL_LOW at 0 range 20 .. 20; GPIO29_LEVEL_HIGH at 0 range 21 .. 21; GPIO29_EDGE_LOW at 0 range 22 .. 22; GPIO29_EDGE_HIGH at 0 range 23 .. 23; Reserved_24_31 at 0 range 24 .. 31; end record; -- Interrupt status after masking & forcing for dormant_wake type DORMANT_WAKE_INTS0_Register is record -- Read-only. GPIO0_LEVEL_LOW : Boolean; -- Read-only. GPIO0_LEVEL_HIGH : Boolean; -- Read-only. GPIO0_EDGE_LOW : Boolean; -- Read-only. GPIO0_EDGE_HIGH : Boolean; -- Read-only. GPIO1_LEVEL_LOW : Boolean; -- Read-only. GPIO1_LEVEL_HIGH : Boolean; -- Read-only. GPIO1_EDGE_LOW : Boolean; -- Read-only. GPIO1_EDGE_HIGH : Boolean; -- Read-only. GPIO2_LEVEL_LOW : Boolean; -- Read-only. GPIO2_LEVEL_HIGH : Boolean; -- Read-only. GPIO2_EDGE_LOW : Boolean; -- Read-only. GPIO2_EDGE_HIGH : Boolean; -- Read-only. GPIO3_LEVEL_LOW : Boolean; -- Read-only. GPIO3_LEVEL_HIGH : Boolean; -- Read-only. GPIO3_EDGE_LOW : Boolean; -- Read-only. GPIO3_EDGE_HIGH : Boolean; -- Read-only. GPIO4_LEVEL_LOW : Boolean; -- Read-only. GPIO4_LEVEL_HIGH : Boolean; -- Read-only. GPIO4_EDGE_LOW : Boolean; -- Read-only. GPIO4_EDGE_HIGH : Boolean; -- Read-only. GPIO5_LEVEL_LOW : Boolean; -- Read-only. GPIO5_LEVEL_HIGH : Boolean; -- Read-only. GPIO5_EDGE_LOW : Boolean; -- Read-only. GPIO5_EDGE_HIGH : Boolean; -- Read-only. GPIO6_LEVEL_LOW : Boolean; -- Read-only. GPIO6_LEVEL_HIGH : Boolean; -- Read-only. GPIO6_EDGE_LOW : Boolean; -- Read-only. GPIO6_EDGE_HIGH : Boolean; -- Read-only. GPIO7_LEVEL_LOW : Boolean; -- Read-only. GPIO7_LEVEL_HIGH : Boolean; -- Read-only. GPIO7_EDGE_LOW : Boolean; -- Read-only. GPIO7_EDGE_HIGH : Boolean; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for DORMANT_WAKE_INTS0_Register use record GPIO0_LEVEL_LOW at 0 range 0 .. 0; GPIO0_LEVEL_HIGH at 0 range 1 .. 1; GPIO0_EDGE_LOW at 0 range 2 .. 2; GPIO0_EDGE_HIGH at 0 range 3 .. 3; GPIO1_LEVEL_LOW at 0 range 4 .. 4; GPIO1_LEVEL_HIGH at 0 range 5 .. 5; GPIO1_EDGE_LOW at 0 range 6 .. 6; GPIO1_EDGE_HIGH at 0 range 7 .. 7; GPIO2_LEVEL_LOW at 0 range 8 .. 8; GPIO2_LEVEL_HIGH at 0 range 9 .. 9; GPIO2_EDGE_LOW at 0 range 10 .. 10; GPIO2_EDGE_HIGH at 0 range 11 .. 11; GPIO3_LEVEL_LOW at 0 range 12 .. 12; GPIO3_LEVEL_HIGH at 0 range 13 .. 13; GPIO3_EDGE_LOW at 0 range 14 .. 14; GPIO3_EDGE_HIGH at 0 range 15 .. 15; GPIO4_LEVEL_LOW at 0 range 16 .. 16; GPIO4_LEVEL_HIGH at 0 range 17 .. 17; GPIO4_EDGE_LOW at 0 range 18 .. 18; GPIO4_EDGE_HIGH at 0 range 19 .. 19; GPIO5_LEVEL_LOW at 0 range 20 .. 20; GPIO5_LEVEL_HIGH at 0 range 21 .. 21; GPIO5_EDGE_LOW at 0 range 22 .. 22; GPIO5_EDGE_HIGH at 0 range 23 .. 23; GPIO6_LEVEL_LOW at 0 range 24 .. 24; GPIO6_LEVEL_HIGH at 0 range 25 .. 25; GPIO6_EDGE_LOW at 0 range 26 .. 26; GPIO6_EDGE_HIGH at 0 range 27 .. 27; GPIO7_LEVEL_LOW at 0 range 28 .. 28; GPIO7_LEVEL_HIGH at 0 range 29 .. 29; GPIO7_EDGE_LOW at 0 range 30 .. 30; GPIO7_EDGE_HIGH at 0 range 31 .. 31; end record; -- Interrupt status after masking & forcing for dormant_wake type DORMANT_WAKE_INTS1_Register is record -- Read-only. GPIO8_LEVEL_LOW : Boolean; -- Read-only. GPIO8_LEVEL_HIGH : Boolean; -- Read-only. GPIO8_EDGE_LOW : Boolean; -- Read-only. GPIO8_EDGE_HIGH : Boolean; -- Read-only. GPIO9_LEVEL_LOW : Boolean; -- Read-only. GPIO9_LEVEL_HIGH : Boolean; -- Read-only. GPIO9_EDGE_LOW : Boolean; -- Read-only. GPIO9_EDGE_HIGH : Boolean; -- Read-only. GPIO10_LEVEL_LOW : Boolean; -- Read-only. GPIO10_LEVEL_HIGH : Boolean; -- Read-only. GPIO10_EDGE_LOW : Boolean; -- Read-only. GPIO10_EDGE_HIGH : Boolean; -- Read-only. GPIO11_LEVEL_LOW : Boolean; -- Read-only. GPIO11_LEVEL_HIGH : Boolean; -- Read-only. GPIO11_EDGE_LOW : Boolean; -- Read-only. GPIO11_EDGE_HIGH : Boolean; -- Read-only. GPIO12_LEVEL_LOW : Boolean; -- Read-only. GPIO12_LEVEL_HIGH : Boolean; -- Read-only. GPIO12_EDGE_LOW : Boolean; -- Read-only. GPIO12_EDGE_HIGH : Boolean; -- Read-only. GPIO13_LEVEL_LOW : Boolean; -- Read-only. GPIO13_LEVEL_HIGH : Boolean; -- Read-only. GPIO13_EDGE_LOW : Boolean; -- Read-only. GPIO13_EDGE_HIGH : Boolean; -- Read-only. GPIO14_LEVEL_LOW : Boolean; -- Read-only. GPIO14_LEVEL_HIGH : Boolean; -- Read-only. GPIO14_EDGE_LOW : Boolean; -- Read-only. GPIO14_EDGE_HIGH : Boolean; -- Read-only. GPIO15_LEVEL_LOW : Boolean; -- Read-only. GPIO15_LEVEL_HIGH : Boolean; -- Read-only. GPIO15_EDGE_LOW : Boolean; -- Read-only. GPIO15_EDGE_HIGH : Boolean; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for DORMANT_WAKE_INTS1_Register use record GPIO8_LEVEL_LOW at 0 range 0 .. 0; GPIO8_LEVEL_HIGH at 0 range 1 .. 1; GPIO8_EDGE_LOW at 0 range 2 .. 2; GPIO8_EDGE_HIGH at 0 range 3 .. 3; GPIO9_LEVEL_LOW at 0 range 4 .. 4; GPIO9_LEVEL_HIGH at 0 range 5 .. 5; GPIO9_EDGE_LOW at 0 range 6 .. 6; GPIO9_EDGE_HIGH at 0 range 7 .. 7; GPIO10_LEVEL_LOW at 0 range 8 .. 8; GPIO10_LEVEL_HIGH at 0 range 9 .. 9; GPIO10_EDGE_LOW at 0 range 10 .. 10; GPIO10_EDGE_HIGH at 0 range 11 .. 11; GPIO11_LEVEL_LOW at 0 range 12 .. 12; GPIO11_LEVEL_HIGH at 0 range 13 .. 13; GPIO11_EDGE_LOW at 0 range 14 .. 14; GPIO11_EDGE_HIGH at 0 range 15 .. 15; GPIO12_LEVEL_LOW at 0 range 16 .. 16; GPIO12_LEVEL_HIGH at 0 range 17 .. 17; GPIO12_EDGE_LOW at 0 range 18 .. 18; GPIO12_EDGE_HIGH at 0 range 19 .. 19; GPIO13_LEVEL_LOW at 0 range 20 .. 20; GPIO13_LEVEL_HIGH at 0 range 21 .. 21; GPIO13_EDGE_LOW at 0 range 22 .. 22; GPIO13_EDGE_HIGH at 0 range 23 .. 23; GPIO14_LEVEL_LOW at 0 range 24 .. 24; GPIO14_LEVEL_HIGH at 0 range 25 .. 25; GPIO14_EDGE_LOW at 0 range 26 .. 26; GPIO14_EDGE_HIGH at 0 range 27 .. 27; GPIO15_LEVEL_LOW at 0 range 28 .. 28; GPIO15_LEVEL_HIGH at 0 range 29 .. 29; GPIO15_EDGE_LOW at 0 range 30 .. 30; GPIO15_EDGE_HIGH at 0 range 31 .. 31; end record; -- Interrupt status after masking & forcing for dormant_wake type DORMANT_WAKE_INTS2_Register is record -- Read-only. GPIO16_LEVEL_LOW : Boolean; -- Read-only. GPIO16_LEVEL_HIGH : Boolean; -- Read-only. GPIO16_EDGE_LOW : Boolean; -- Read-only. GPIO16_EDGE_HIGH : Boolean; -- Read-only. GPIO17_LEVEL_LOW : Boolean; -- Read-only. GPIO17_LEVEL_HIGH : Boolean; -- Read-only. GPIO17_EDGE_LOW : Boolean; -- Read-only. GPIO17_EDGE_HIGH : Boolean; -- Read-only. GPIO18_LEVEL_LOW : Boolean; -- Read-only. GPIO18_LEVEL_HIGH : Boolean; -- Read-only. GPIO18_EDGE_LOW : Boolean; -- Read-only. GPIO18_EDGE_HIGH : Boolean; -- Read-only. GPIO19_LEVEL_LOW : Boolean; -- Read-only. GPIO19_LEVEL_HIGH : Boolean; -- Read-only. GPIO19_EDGE_LOW : Boolean; -- Read-only. GPIO19_EDGE_HIGH : Boolean; -- Read-only. GPIO20_LEVEL_LOW : Boolean; -- Read-only. GPIO20_LEVEL_HIGH : Boolean; -- Read-only. GPIO20_EDGE_LOW : Boolean; -- Read-only. GPIO20_EDGE_HIGH : Boolean; -- Read-only. GPIO21_LEVEL_LOW : Boolean; -- Read-only. GPIO21_LEVEL_HIGH : Boolean; -- Read-only. GPIO21_EDGE_LOW : Boolean; -- Read-only. GPIO21_EDGE_HIGH : Boolean; -- Read-only. GPIO22_LEVEL_LOW : Boolean; -- Read-only. GPIO22_LEVEL_HIGH : Boolean; -- Read-only. GPIO22_EDGE_LOW : Boolean; -- Read-only. GPIO22_EDGE_HIGH : Boolean; -- Read-only. GPIO23_LEVEL_LOW : Boolean; -- Read-only. GPIO23_LEVEL_HIGH : Boolean; -- Read-only. GPIO23_EDGE_LOW : Boolean; -- Read-only. GPIO23_EDGE_HIGH : Boolean; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for DORMANT_WAKE_INTS2_Register use record GPIO16_LEVEL_LOW at 0 range 0 .. 0; GPIO16_LEVEL_HIGH at 0 range 1 .. 1; GPIO16_EDGE_LOW at 0 range 2 .. 2; GPIO16_EDGE_HIGH at 0 range 3 .. 3; GPIO17_LEVEL_LOW at 0 range 4 .. 4; GPIO17_LEVEL_HIGH at 0 range 5 .. 5; GPIO17_EDGE_LOW at 0 range 6 .. 6; GPIO17_EDGE_HIGH at 0 range 7 .. 7; GPIO18_LEVEL_LOW at 0 range 8 .. 8; GPIO18_LEVEL_HIGH at 0 range 9 .. 9; GPIO18_EDGE_LOW at 0 range 10 .. 10; GPIO18_EDGE_HIGH at 0 range 11 .. 11; GPIO19_LEVEL_LOW at 0 range 12 .. 12; GPIO19_LEVEL_HIGH at 0 range 13 .. 13; GPIO19_EDGE_LOW at 0 range 14 .. 14; GPIO19_EDGE_HIGH at 0 range 15 .. 15; GPIO20_LEVEL_LOW at 0 range 16 .. 16; GPIO20_LEVEL_HIGH at 0 range 17 .. 17; GPIO20_EDGE_LOW at 0 range 18 .. 18; GPIO20_EDGE_HIGH at 0 range 19 .. 19; GPIO21_LEVEL_LOW at 0 range 20 .. 20; GPIO21_LEVEL_HIGH at 0 range 21 .. 21; GPIO21_EDGE_LOW at 0 range 22 .. 22; GPIO21_EDGE_HIGH at 0 range 23 .. 23; GPIO22_LEVEL_LOW at 0 range 24 .. 24; GPIO22_LEVEL_HIGH at 0 range 25 .. 25; GPIO22_EDGE_LOW at 0 range 26 .. 26; GPIO22_EDGE_HIGH at 0 range 27 .. 27; GPIO23_LEVEL_LOW at 0 range 28 .. 28; GPIO23_LEVEL_HIGH at 0 range 29 .. 29; GPIO23_EDGE_LOW at 0 range 30 .. 30; GPIO23_EDGE_HIGH at 0 range 31 .. 31; end record; -- Interrupt status after masking & forcing for dormant_wake type DORMANT_WAKE_INTS3_Register is record -- Read-only. GPIO24_LEVEL_LOW : Boolean; -- Read-only. GPIO24_LEVEL_HIGH : Boolean; -- Read-only. GPIO24_EDGE_LOW : Boolean; -- Read-only. GPIO24_EDGE_HIGH : Boolean; -- Read-only. GPIO25_LEVEL_LOW : Boolean; -- Read-only. GPIO25_LEVEL_HIGH : Boolean; -- Read-only. GPIO25_EDGE_LOW : Boolean; -- Read-only. GPIO25_EDGE_HIGH : Boolean; -- Read-only. GPIO26_LEVEL_LOW : Boolean; -- Read-only. GPIO26_LEVEL_HIGH : Boolean; -- Read-only. GPIO26_EDGE_LOW : Boolean; -- Read-only. GPIO26_EDGE_HIGH : Boolean; -- Read-only. GPIO27_LEVEL_LOW : Boolean; -- Read-only. GPIO27_LEVEL_HIGH : Boolean; -- Read-only. GPIO27_EDGE_LOW : Boolean; -- Read-only. GPIO27_EDGE_HIGH : Boolean; -- Read-only. GPIO28_LEVEL_LOW : Boolean; -- Read-only. GPIO28_LEVEL_HIGH : Boolean; -- Read-only. GPIO28_EDGE_LOW : Boolean; -- Read-only. GPIO28_EDGE_HIGH : Boolean; -- Read-only. GPIO29_LEVEL_LOW : Boolean; -- Read-only. GPIO29_LEVEL_HIGH : Boolean; -- Read-only. GPIO29_EDGE_LOW : Boolean; -- Read-only. GPIO29_EDGE_HIGH : Boolean; -- unspecified Reserved_24_31 : HAL.UInt8; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for DORMANT_WAKE_INTS3_Register use record GPIO24_LEVEL_LOW at 0 range 0 .. 0; GPIO24_LEVEL_HIGH at 0 range 1 .. 1; GPIO24_EDGE_LOW at 0 range 2 .. 2; GPIO24_EDGE_HIGH at 0 range 3 .. 3; GPIO25_LEVEL_LOW at 0 range 4 .. 4; GPIO25_LEVEL_HIGH at 0 range 5 .. 5; GPIO25_EDGE_LOW at 0 range 6 .. 6; GPIO25_EDGE_HIGH at 0 range 7 .. 7; GPIO26_LEVEL_LOW at 0 range 8 .. 8; GPIO26_LEVEL_HIGH at 0 range 9 .. 9; GPIO26_EDGE_LOW at 0 range 10 .. 10; GPIO26_EDGE_HIGH at 0 range 11 .. 11; GPIO27_LEVEL_LOW at 0 range 12 .. 12; GPIO27_LEVEL_HIGH at 0 range 13 .. 13; GPIO27_EDGE_LOW at 0 range 14 .. 14; GPIO27_EDGE_HIGH at 0 range 15 .. 15; GPIO28_LEVEL_LOW at 0 range 16 .. 16; GPIO28_LEVEL_HIGH at 0 range 17 .. 17; GPIO28_EDGE_LOW at 0 range 18 .. 18; GPIO28_EDGE_HIGH at 0 range 19 .. 19; GPIO29_LEVEL_LOW at 0 range 20 .. 20; GPIO29_LEVEL_HIGH at 0 range 21 .. 21; GPIO29_EDGE_LOW at 0 range 22 .. 22; GPIO29_EDGE_HIGH at 0 range 23 .. 23; Reserved_24_31 at 0 range 24 .. 31; end record; ----------------- -- Peripherals -- ----------------- type IO_BANK0_Peripheral is record -- GPIO status GPIO0_STATUS : aliased GPIO0_STATUS_Register; -- GPIO control including function select and overrides. GPIO0_CTRL : aliased GPIO0_CTRL_Register; -- GPIO status GPIO1_STATUS : aliased GPIO1_STATUS_Register; -- GPIO control including function select and overrides. GPIO1_CTRL : aliased GPIO1_CTRL_Register; -- GPIO status GPIO2_STATUS : aliased GPIO2_STATUS_Register; -- GPIO control including function select and overrides. GPIO2_CTRL : aliased GPIO2_CTRL_Register; -- GPIO status GPIO3_STATUS : aliased GPIO3_STATUS_Register; -- GPIO control including function select and overrides. GPIO3_CTRL : aliased GPIO3_CTRL_Register; -- GPIO status GPIO4_STATUS : aliased GPIO4_STATUS_Register; -- GPIO control including function select and overrides. GPIO4_CTRL : aliased GPIO4_CTRL_Register; -- GPIO status GPIO5_STATUS : aliased GPIO5_STATUS_Register; -- GPIO control including function select and overrides. GPIO5_CTRL : aliased GPIO5_CTRL_Register; -- GPIO status GPIO6_STATUS : aliased GPIO6_STATUS_Register; -- GPIO control including function select and overrides. GPIO6_CTRL : aliased GPIO6_CTRL_Register; -- GPIO status GPIO7_STATUS : aliased GPIO7_STATUS_Register; -- GPIO control including function select and overrides. GPIO7_CTRL : aliased GPIO7_CTRL_Register; -- GPIO status GPIO8_STATUS : aliased GPIO8_STATUS_Register; -- GPIO control including function select and overrides. GPIO8_CTRL : aliased GPIO8_CTRL_Register; -- GPIO status GPIO9_STATUS : aliased GPIO9_STATUS_Register; -- GPIO control including function select and overrides. GPIO9_CTRL : aliased GPIO9_CTRL_Register; -- GPIO status GPIO10_STATUS : aliased GPIO10_STATUS_Register; -- GPIO control including function select and overrides. GPIO10_CTRL : aliased GPIO10_CTRL_Register; -- GPIO status GPIO11_STATUS : aliased GPIO11_STATUS_Register; -- GPIO control including function select and overrides. GPIO11_CTRL : aliased GPIO11_CTRL_Register; -- GPIO status GPIO12_STATUS : aliased GPIO12_STATUS_Register; -- GPIO control including function select and overrides. GPIO12_CTRL : aliased GPIO12_CTRL_Register; -- GPIO status GPIO13_STATUS : aliased GPIO13_STATUS_Register; -- GPIO control including function select and overrides. GPIO13_CTRL : aliased GPIO13_CTRL_Register; -- GPIO status GPIO14_STATUS : aliased GPIO14_STATUS_Register; -- GPIO control including function select and overrides. GPIO14_CTRL : aliased GPIO14_CTRL_Register; -- GPIO status GPIO15_STATUS : aliased GPIO15_STATUS_Register; -- GPIO control including function select and overrides. GPIO15_CTRL : aliased GPIO15_CTRL_Register; -- GPIO status GPIO16_STATUS : aliased GPIO16_STATUS_Register; -- GPIO control including function select and overrides. GPIO16_CTRL : aliased GPIO16_CTRL_Register; -- GPIO status GPIO17_STATUS : aliased GPIO17_STATUS_Register; -- GPIO control including function select and overrides. GPIO17_CTRL : aliased GPIO17_CTRL_Register; -- GPIO status GPIO18_STATUS : aliased GPIO18_STATUS_Register; -- GPIO control including function select and overrides. GPIO18_CTRL : aliased GPIO18_CTRL_Register; -- GPIO status GPIO19_STATUS : aliased GPIO19_STATUS_Register; -- GPIO control including function select and overrides. GPIO19_CTRL : aliased GPIO19_CTRL_Register; -- GPIO status GPIO20_STATUS : aliased GPIO20_STATUS_Register; -- GPIO control including function select and overrides. GPIO20_CTRL : aliased GPIO20_CTRL_Register; -- GPIO status GPIO21_STATUS : aliased GPIO21_STATUS_Register; -- GPIO control including function select and overrides. GPIO21_CTRL : aliased GPIO21_CTRL_Register; -- GPIO status GPIO22_STATUS : aliased GPIO22_STATUS_Register; -- GPIO control including function select and overrides. GPIO22_CTRL : aliased GPIO22_CTRL_Register; -- GPIO status GPIO23_STATUS : aliased GPIO23_STATUS_Register; -- GPIO control including function select and overrides. GPIO23_CTRL : aliased GPIO23_CTRL_Register; -- GPIO status GPIO24_STATUS : aliased GPIO24_STATUS_Register; -- GPIO control including function select and overrides. GPIO24_CTRL : aliased GPIO24_CTRL_Register; -- GPIO status GPIO25_STATUS : aliased GPIO25_STATUS_Register; -- GPIO control including function select and overrides. GPIO25_CTRL : aliased GPIO25_CTRL_Register; -- GPIO status GPIO26_STATUS : aliased GPIO26_STATUS_Register; -- GPIO control including function select and overrides. GPIO26_CTRL : aliased GPIO26_CTRL_Register; -- GPIO status GPIO27_STATUS : aliased GPIO27_STATUS_Register; -- GPIO control including function select and overrides. GPIO27_CTRL : aliased GPIO27_CTRL_Register; -- GPIO status GPIO28_STATUS : aliased GPIO28_STATUS_Register; -- GPIO control including function select and overrides. GPIO28_CTRL : aliased GPIO28_CTRL_Register; -- GPIO status GPIO29_STATUS : aliased GPIO29_STATUS_Register; -- GPIO control including function select and overrides. GPIO29_CTRL : aliased GPIO29_CTRL_Register; -- Raw Interrupts INTR0 : aliased INTR0_Register; -- Raw Interrupts INTR1 : aliased INTR1_Register; -- Raw Interrupts INTR2 : aliased INTR2_Register; -- Raw Interrupts INTR3 : aliased INTR3_Register; -- Interrupt Enable for proc0 PROC0_INTE0 : aliased PROC0_INTE0_Register; -- Interrupt Enable for proc0 PROC0_INTE1 : aliased PROC0_INTE1_Register; -- Interrupt Enable for proc0 PROC0_INTE2 : aliased PROC0_INTE2_Register; -- Interrupt Enable for proc0 PROC0_INTE3 : aliased PROC0_INTE3_Register; -- Interrupt Force for proc0 PROC0_INTF0 : aliased PROC0_INTF0_Register; -- Interrupt Force for proc0 PROC0_INTF1 : aliased PROC0_INTF1_Register; -- Interrupt Force for proc0 PROC0_INTF2 : aliased PROC0_INTF2_Register; -- Interrupt Force for proc0 PROC0_INTF3 : aliased PROC0_INTF3_Register; -- Interrupt status after masking & forcing for proc0 PROC0_INTS0 : aliased PROC0_INTS0_Register; -- Interrupt status after masking & forcing for proc0 PROC0_INTS1 : aliased PROC0_INTS1_Register; -- Interrupt status after masking & forcing for proc0 PROC0_INTS2 : aliased PROC0_INTS2_Register; -- Interrupt status after masking & forcing for proc0 PROC0_INTS3 : aliased PROC0_INTS3_Register; -- Interrupt Enable for proc1 PROC1_INTE0 : aliased PROC1_INTE0_Register; -- Interrupt Enable for proc1 PROC1_INTE1 : aliased PROC1_INTE1_Register; -- Interrupt Enable for proc1 PROC1_INTE2 : aliased PROC1_INTE2_Register; -- Interrupt Enable for proc1 PROC1_INTE3 : aliased PROC1_INTE3_Register; -- Interrupt Force for proc1 PROC1_INTF0 : aliased PROC1_INTF0_Register; -- Interrupt Force for proc1 PROC1_INTF1 : aliased PROC1_INTF1_Register; -- Interrupt Force for proc1 PROC1_INTF2 : aliased PROC1_INTF2_Register; -- Interrupt Force for proc1 PROC1_INTF3 : aliased PROC1_INTF3_Register; -- Interrupt status after masking & forcing for proc1 PROC1_INTS0 : aliased PROC1_INTS0_Register; -- Interrupt status after masking & forcing for proc1 PROC1_INTS1 : aliased PROC1_INTS1_Register; -- Interrupt status after masking & forcing for proc1 PROC1_INTS2 : aliased PROC1_INTS2_Register; -- Interrupt status after masking & forcing for proc1 PROC1_INTS3 : aliased PROC1_INTS3_Register; -- Interrupt Enable for dormant_wake DORMANT_WAKE_INTE0 : aliased DORMANT_WAKE_INTE0_Register; -- Interrupt Enable for dormant_wake DORMANT_WAKE_INTE1 : aliased DORMANT_WAKE_INTE1_Register; -- Interrupt Enable for dormant_wake DORMANT_WAKE_INTE2 : aliased DORMANT_WAKE_INTE2_Register; -- Interrupt Enable for dormant_wake DORMANT_WAKE_INTE3 : aliased DORMANT_WAKE_INTE3_Register; -- Interrupt Force for dormant_wake DORMANT_WAKE_INTF0 : aliased DORMANT_WAKE_INTF0_Register; -- Interrupt Force for dormant_wake DORMANT_WAKE_INTF1 : aliased DORMANT_WAKE_INTF1_Register; -- Interrupt Force for dormant_wake DORMANT_WAKE_INTF2 : aliased DORMANT_WAKE_INTF2_Register; -- Interrupt Force for dormant_wake DORMANT_WAKE_INTF3 : aliased DORMANT_WAKE_INTF3_Register; -- Interrupt status after masking & forcing for dormant_wake DORMANT_WAKE_INTS0 : aliased DORMANT_WAKE_INTS0_Register; -- Interrupt status after masking & forcing for dormant_wake DORMANT_WAKE_INTS1 : aliased DORMANT_WAKE_INTS1_Register; -- Interrupt status after masking & forcing for dormant_wake DORMANT_WAKE_INTS2 : aliased DORMANT_WAKE_INTS2_Register; -- Interrupt status after masking & forcing for dormant_wake DORMANT_WAKE_INTS3 : aliased DORMANT_WAKE_INTS3_Register; end record with Volatile; for IO_BANK0_Peripheral use record GPIO0_STATUS at 16#0# range 0 .. 31; GPIO0_CTRL at 16#4# range 0 .. 31; GPIO1_STATUS at 16#8# range 0 .. 31; GPIO1_CTRL at 16#C# range 0 .. 31; GPIO2_STATUS at 16#10# range 0 .. 31; GPIO2_CTRL at 16#14# range 0 .. 31; GPIO3_STATUS at 16#18# range 0 .. 31; GPIO3_CTRL at 16#1C# range 0 .. 31; GPIO4_STATUS at 16#20# range 0 .. 31; GPIO4_CTRL at 16#24# range 0 .. 31; GPIO5_STATUS at 16#28# range 0 .. 31; GPIO5_CTRL at 16#2C# range 0 .. 31; GPIO6_STATUS at 16#30# range 0 .. 31; GPIO6_CTRL at 16#34# range 0 .. 31; GPIO7_STATUS at 16#38# range 0 .. 31; GPIO7_CTRL at 16#3C# range 0 .. 31; GPIO8_STATUS at 16#40# range 0 .. 31; GPIO8_CTRL at 16#44# range 0 .. 31; GPIO9_STATUS at 16#48# range 0 .. 31; GPIO9_CTRL at 16#4C# range 0 .. 31; GPIO10_STATUS at 16#50# range 0 .. 31; GPIO10_CTRL at 16#54# range 0 .. 31; GPIO11_STATUS at 16#58# range 0 .. 31; GPIO11_CTRL at 16#5C# range 0 .. 31; GPIO12_STATUS at 16#60# range 0 .. 31; GPIO12_CTRL at 16#64# range 0 .. 31; GPIO13_STATUS at 16#68# range 0 .. 31; GPIO13_CTRL at 16#6C# range 0 .. 31; GPIO14_STATUS at 16#70# range 0 .. 31; GPIO14_CTRL at 16#74# range 0 .. 31; GPIO15_STATUS at 16#78# range 0 .. 31; GPIO15_CTRL at 16#7C# range 0 .. 31; GPIO16_STATUS at 16#80# range 0 .. 31; GPIO16_CTRL at 16#84# range 0 .. 31; GPIO17_STATUS at 16#88# range 0 .. 31; GPIO17_CTRL at 16#8C# range 0 .. 31; GPIO18_STATUS at 16#90# range 0 .. 31; GPIO18_CTRL at 16#94# range 0 .. 31; GPIO19_STATUS at 16#98# range 0 .. 31; GPIO19_CTRL at 16#9C# range 0 .. 31; GPIO20_STATUS at 16#A0# range 0 .. 31; GPIO20_CTRL at 16#A4# range 0 .. 31; GPIO21_STATUS at 16#A8# range 0 .. 31; GPIO21_CTRL at 16#AC# range 0 .. 31; GPIO22_STATUS at 16#B0# range 0 .. 31; GPIO22_CTRL at 16#B4# range 0 .. 31; GPIO23_STATUS at 16#B8# range 0 .. 31; GPIO23_CTRL at 16#BC# range 0 .. 31; GPIO24_STATUS at 16#C0# range 0 .. 31; GPIO24_CTRL at 16#C4# range 0 .. 31; GPIO25_STATUS at 16#C8# range 0 .. 31; GPIO25_CTRL at 16#CC# range 0 .. 31; GPIO26_STATUS at 16#D0# range 0 .. 31; GPIO26_CTRL at 16#D4# range 0 .. 31; GPIO27_STATUS at 16#D8# range 0 .. 31; GPIO27_CTRL at 16#DC# range 0 .. 31; GPIO28_STATUS at 16#E0# range 0 .. 31; GPIO28_CTRL at 16#E4# range 0 .. 31; GPIO29_STATUS at 16#E8# range 0 .. 31; GPIO29_CTRL at 16#EC# range 0 .. 31; INTR0 at 16#F0# range 0 .. 31; INTR1 at 16#F4# range 0 .. 31; INTR2 at 16#F8# range 0 .. 31; INTR3 at 16#FC# range 0 .. 31; PROC0_INTE0 at 16#100# range 0 .. 31; PROC0_INTE1 at 16#104# range 0 .. 31; PROC0_INTE2 at 16#108# range 0 .. 31; PROC0_INTE3 at 16#10C# range 0 .. 31; PROC0_INTF0 at 16#110# range 0 .. 31; PROC0_INTF1 at 16#114# range 0 .. 31; PROC0_INTF2 at 16#118# range 0 .. 31; PROC0_INTF3 at 16#11C# range 0 .. 31; PROC0_INTS0 at 16#120# range 0 .. 31; PROC0_INTS1 at 16#124# range 0 .. 31; PROC0_INTS2 at 16#128# range 0 .. 31; PROC0_INTS3 at 16#12C# range 0 .. 31; PROC1_INTE0 at 16#130# range 0 .. 31; PROC1_INTE1 at 16#134# range 0 .. 31; PROC1_INTE2 at 16#138# range 0 .. 31; PROC1_INTE3 at 16#13C# range 0 .. 31; PROC1_INTF0 at 16#140# range 0 .. 31; PROC1_INTF1 at 16#144# range 0 .. 31; PROC1_INTF2 at 16#148# range 0 .. 31; PROC1_INTF3 at 16#14C# range 0 .. 31; PROC1_INTS0 at 16#150# range 0 .. 31; PROC1_INTS1 at 16#154# range 0 .. 31; PROC1_INTS2 at 16#158# range 0 .. 31; PROC1_INTS3 at 16#15C# range 0 .. 31; DORMANT_WAKE_INTE0 at 16#160# range 0 .. 31; DORMANT_WAKE_INTE1 at 16#164# range 0 .. 31; DORMANT_WAKE_INTE2 at 16#168# range 0 .. 31; DORMANT_WAKE_INTE3 at 16#16C# range 0 .. 31; DORMANT_WAKE_INTF0 at 16#170# range 0 .. 31; DORMANT_WAKE_INTF1 at 16#174# range 0 .. 31; DORMANT_WAKE_INTF2 at 16#178# range 0 .. 31; DORMANT_WAKE_INTF3 at 16#17C# range 0 .. 31; DORMANT_WAKE_INTS0 at 16#180# range 0 .. 31; DORMANT_WAKE_INTS1 at 16#184# range 0 .. 31; DORMANT_WAKE_INTS2 at 16#188# range 0 .. 31; DORMANT_WAKE_INTS3 at 16#18C# range 0 .. 31; end record; IO_BANK0_Periph : aliased IO_BANK0_Peripheral with Import, Address => IO_BANK0_Base; end RP_SVD.IO_BANK0;
with Ada.Text_IO; use Ada.Text_IO; procedure Triple is begin for C in 1 .. 40 loop for B in 1 .. C loop for A in 1 .. B loop if A ** 2 + B ** 2 = C ** 2 then Put_Line (Integer'Image(A) & ", " & Integer'Image(B) & ", " & Integer'Image(C)); end if; end loop; end loop; end loop; end Triple;
with Ada.Unchecked_Deallocation; package body TH is procedure Initialiser(Sda: out T_TH; Capacite: in Integer) is begin Sda.Elements := new T_Tab_LCA(1..Capacite); Sda.Capacite := Capacite; for i in 1..Capacite loop T_LCA_C.Initialiser(Sda.Elements(i)); end loop; end Initialiser; function Est_Vide (Sda : T_TH) return Boolean is begin for i in 1..Sda.Capacite loop if not T_LCA_C.Est_Vide(Sda.Elements(i)) then return False; end if; end loop; return True; end Est_Vide; function Block(Sda: in T_TH; Cle: in T_Cle) return Integer is begin return (Hachage(Cle) - 1) mod Sda.Capacite + 1; end Block; function Taille (Sda : in T_TH) return Integer is Length: Integer; begin Length := 0; for i in 1..Sda.Capacite loop Length := Length + T_LCA_C.Taille(Sda.Elements(i)); end loop; return Length; end Taille; procedure Enregistrer (Sda : in out T_TH ; Cle : in T_Cle ; Donnee : in T_Donnee) is begin T_LCA_C.Enregistrer(Sda.Elements(Block(Sda, Cle)), Cle, Donnee); end Enregistrer; function Cle_Presente (Sda : in T_TH ; Cle : in T_Cle) return Boolean is begin return T_LCA_C.Cle_Presente(Sda.Elements(Block(Sda, Cle)), Cle); end Cle_Presente; function LCA(Sda: in T_TH; Cle: in T_Cle) return T_LCA_C.T_LCA is begin return Sda.Elements(Block(Sda, Cle)); end LCA; function La_Donnee (Sda : in T_TH ; Cle : in T_Cle) return T_Donnee is begin return T_LCA_C.La_Donnee(Sda.Elements(Block(Sda, Cle)), Cle); end La_Donnee; procedure Supprimer (Sda : in out T_TH ; Cle : in T_Cle) is begin T_LCA_C.Supprimer(Sda.Elements(Block(Sda, Cle)), Cle); end Supprimer; procedure Vider (Sda : in out T_TH) is begin for i in 1..Sda.Capacite loop T_LCA_C.Vider(Sda.Elements(i)); end loop; end Vider; procedure Detruire(Sda: in out T_TH) is procedure Free is new Ada.Unchecked_Deallocation (Object => T_Tab_LCA, Name => T_Tab_LCA_Access); begin if not Est_Vide(Sda) then Vider(Sda); end if; Free(Sda.Elements); end Detruire; procedure Pour_Chaque (Sda : in T_TH) is procedure LCA_Pour_Chaque is new T_LCA_C.Pour_Chaque (Traiter); begin for i in 1..Sda.Capacite loop LCA_Pour_Chaque(Sda.Elements(i)); end loop; end Pour_Chaque; end TH;
with Tkmrpc.Types; with Tkmrpc.Operations.Ike; package Tkmrpc.Response.Ike.Isa_Create is Data_Size : constant := 272; type Data_Type is record Sk_Ai : Types.Key_Type; Sk_Ar : Types.Key_Type; Sk_Ei : Types.Key_Type; Sk_Er : Types.Key_Type; end record; for Data_Type use record Sk_Ai at 0 range 0 .. (68 * 8) - 1; Sk_Ar at 68 range 0 .. (68 * 8) - 1; Sk_Ei at 136 range 0 .. (68 * 8) - 1; Sk_Er at 204 range 0 .. (68 * 8) - 1; end record; for Data_Type'Size use Data_Size * 8; Padding_Size : constant := Response.Body_Size - Data_Size; subtype Padding_Range is Natural range 1 .. Padding_Size; subtype Padding_Type is Types.Byte_Sequence (Padding_Range); type Response_Type is record Header : Response.Header_Type; Data : Data_Type; Padding : Padding_Type; end record; for Response_Type use record Header at 0 range 0 .. (Response.Header_Size * 8) - 1; Data at Response.Header_Size range 0 .. (Data_Size * 8) - 1; Padding at Response.Header_Size + Data_Size range 0 .. (Padding_Size * 8) - 1; end record; for Response_Type'Size use Response.Response_Size * 8; Null_Response : constant Response_Type := Response_Type' (Header => Response.Header_Type'(Operation => Operations.Ike.Isa_Create, Result => Results.Invalid_Operation, Request_Id => 0), Data => Data_Type'(Sk_Ai => Types.Null_Key_Type, Sk_Ar => Types.Null_Key_Type, Sk_Ei => Types.Null_Key_Type, Sk_Er => Types.Null_Key_Type), Padding => Padding_Type'(others => 0)); end Tkmrpc.Response.Ike.Isa_Create;
-- -- -- package Strings_Edit Copyright (c) Dmitry A. Kazakov -- -- Interface Luebeck -- -- Spring, 2000 -- -- -- -- Last revision : 22:14 08 May 2009 -- -- -- -- This library is free software; you can redistribute it and/or -- -- modify it under the terms of the GNU General Public License as -- -- published by the Free Software Foundation; either version 2 of -- -- the License, or (at your option) any later version. This library -- -- is distributed in the hope that it will be useful, but WITHOUT -- -- ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- General Public License for more details. You should have -- -- received a copy of the GNU General Public License along with -- -- this library; if not, write to the Free Software Foundation, -- -- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- this unit, or you link this unit with other files to produce an -- -- executable, this unit does not by itself cause the resulting -- -- executable to be covered by the GNU General Public License. This -- -- exception does not however invalidate any other reasons why the -- -- executable file might be covered by the GNU Public License. -- --____________________________________________________________________-- -- -- The following I/O items are supported by the package: -- -- (o) Integer numbers (generic, package Integer_Edit) -- (o) Floating-point numbers (generic, package Float_Edit) -- (o) Roman numbers (the child package Roman_Edit) -- (o) Strings -- -- The major differences to the standard Image/Value attributes and -- Text_IO procedures. -- -- 1. For numeric types, the base is neither written nor read. For -- instance, output of 23 as hexadecimal gives 17, not 16#17#. -- -- 2. Get procedures do not skip blank characters around input tokens, -- except the cases when the blank charactes is required by the -- syntax. -- -- 3. Get procedures use the current string position pointer, so that -- they can be consequently called advancing the pointer as the tokes -- are recognized. -- -- 4. Numeric get procedures allow to specify the expected value range. -- When the actual value is out of the range then depending on -- procedure parameters, either Constrain_Error is propagated or the -- value is forced to the nearest range boundary. -- -- 5. Put procedures also use the current string position pointer, which -- allows to call them consequently. -- -- 6. The format used for floating-number output is based on the number -- precision, instead of rather typographic approach of Text_IO. The -- precision can be specified either as the number of valid digits of -- the current base (i.e. relative) or as the position of the last -- valid digit (i.e. absolute). For instance, 12.345678 with relative -- precision 3 gives 12.3. With absolute precision -3, it gives -- 12.346. -- -- G E T P R O C E D U R E S -- -- Get procedures are used to scan strings. The first two parameters are -- always Source and Pointer. Source is the string to be scaned. Pointer -- indicates the current position. After successful completion it is -- advanced to the first string position following the recognized item. -- The value of Pointer shall be in the range Source'First .. -- Source'Last+1. The Layout_Error exception is propagated when this -- check fails. The third parameter usually accepts the value. The -- following example shows how to use get procedures: -- -- package Edit_Float is new Strings_Edit.Float_Edit (Float); -- use Edit_Float; -- -- Line : String (1..512); -- A line -- Pointer : Integer; -- Value : Float; -- TabAndSpace : Ada.Strings.Maps.Character_Set := -- To_Set (" " & Ada.Characters.Latin_1.HT); -- begin -- ... -- Pointer := Line'First; -- Get (Line, Pointer, TabAndSpace); -- Skip tabs and spaces -- Get (Line, Pointer, Value); -- Get number -- Get (Line, Pointer, TabAndSpace); -- Skip tabs and spaces -- ... -- -- The numeric Get procedures have additional parameters controlling the -- range of the input value. The parameters First and Last define the -- range of the expected value. The exception Constraint_Error is -- propagated when the value is not in the range. The exception can be -- suppressed using the parameters ToFirst and ToLast, which cause the -- input value to be substituted by the corresponding margin when the -- parameter is True. -- -- V A L U E F U N C T I O N S -- -- Each get procedure returning some value has a corresponding function -- Value. The function Value has the same parameter profile with the -- exception that the parameter Pointer is absent and the value is -- returned via result. Unlike Get the function Value tolerates spaces -- and tabs around the converted value. The whole string should be -- matched, otherwise, the exception Data_Error is propagated. -- -- P U T P R O C E D U R E S -- -- Put procedures place something into the output string Destination. -- The string is written starting from Destination (Pointer). The -- parameter Field defines the output size. When it has the value zero -- then the output size is defined by the output item. Otherwise the -- output is justified within the field and the parameter Justify -- specifies output alignment and the parameter Fill gives the pad -- character. When Field is greater than Destination'Last - Pointer + 1, -- the later is used instead. After successful completion Pointer is -- advanced to the first character following the output or to -- Destination'Last + 1. -- -- I M A G E F U N C T I O N S -- -- Image functions convert a value into string. Unlike standard S'Image -- they do not place an extra space character. -- with Ada.Strings.Maps; use Ada.Strings.Maps; with Ada.Strings; with Ada.Characters.Latin_1; package Strings_Edit is pragma Elaborate_Body (Strings_Edit); MaxSmall : constant := 250; -- Bigger than any possible Figures : constant String := "0123456789ABCDEF"; Blanks : constant String := ' ' & Ada.Characters.Latin_1.HT; SpaceAndTab : constant Character_Set := To_Set (Blanks); subtype Alignment is Ada.Strings.Alignment; Center : Alignment renames Ada.Strings.Center; Left : Alignment renames Ada.Strings.Left; Right : Alignment renames Ada.Strings.Right; subtype NumberBase is Integer range 2..16; -- -- S T R I N G S -- -- Get -- Skip blank characters -- -- Source - The string to be processed -- Pointer - The current position in the string -- Blank - The blank character -- -- This procedure skips the character Blank starting from Source -- (Pointer). Pointer is advanced to the first non-Blank character or -- to Source'Last + 1. -- -- Exceptions : -- -- Layout_Error - Pointer is not in Source'First..Source'Last + 1 -- procedure Get ( Source : String; Pointer : in out Integer; Blank : Character := ' ' ); -- -- Get -- Skip blank characters -- -- Source - The string to be processed -- Pointer - The current position in the string -- Blanks - The set characters to be considered as blank ones -- -- This procedure skips all the characters of the set Blanks starting -- from Source (Pointer). Pointer is advanced to the first non-blank -- character or to Source'Last + 1. -- -- Exceptions : -- -- Layout_Error - Pointer is not in Source'First..Source'Last + 1 -- procedure Get ( Source : String; Pointer : in out Integer; Blanks : Character_Set ); -- -- Put -- Put a character into a string -- -- Destination - The string that accepts the output -- Pointer - The current position in the string -- Value - The character to be put -- Field - The output field -- Justify - Alignment within the field -- Fill - The fill character -- -- This procedure places the specified character (Value parameter) -- into the output string Destination. The string is written starting -- from the Destination (Pointer). -- -- Exceptions: -- -- Layout_Error - Pointer is not in Destination'Range or there is -- no room for the output. -- procedure Put ( Destination : in out String; Pointer : in out Integer; Value : Character; Field : Natural := 0; Justify : Alignment := Left; Fill : Character := ' ' ); -- -- Put -- Put a string into another string -- -- Destination - The string that accepts the output -- Pointer - The current position in the string -- Value - The string to be put -- Field - The output field -- Justify - Alignment within the field -- Fill - The fill character -- -- This procedure places the specified by the Value parameter string -- into the output string Destination. The string is written starting -- from the Destination (Pointer). -- -- Exceptions: -- -- Layout_Error - Pointer is not in Destination'Range or there is -- no room for the output. -- procedure Put ( Destination : in out String; Pointer : in out Integer; Value : String; Field : Natural := 0; Justify : Alignment := Left; Fill : Character := ' ' ); -- -- R O M A N N U M B E R S -- -- Roman_Edit -- Child package for roman numbers -- -- I N T E G E R N U M B E R S -- -- Integer_Edit -- Generic child package for integer numbers -- -- F L O A T I N G - P O I N T N U M B E R S -- -- Float_Edit -- Generic child package for floating-point numbers -- -- P R E F I X T E S T -- -- -- Is_Prefix -- Test if Prefix is a prefix of Text -- -- Prefix - To check -- Source - The string -- [ Pointer ] - To start at -- [ Map ] - Used to convert characters before comparison -- -- Returns : -- -- True if Prefix is a prefix of Source -- function Is_Prefix (Prefix, Source : String) return Boolean; function Is_Prefix ( Prefix, Source : String; Pointer : Integer ) return Boolean; function Is_Prefix ( Prefix, Source : String; Map : Character_Mapping ) return Boolean; function Is_Prefix ( Prefix, Source : String; Pointer : Integer; Map : Character_Mapping ) return Boolean; -- -- T R I M F U N C T I O N S -- -- Trim -- Delete blank characters form string ends -- -- Source - The string to be processed -- Blank - The blank character -- -- This function removes the Blank character from both ends of the -- string and returns the result. -- -- Returns : -- -- The result string -- function Trim ( Source : String; Blank : Character := ' ' ) return String; -- -- Trim -- Delete blank characters form string ends -- -- Source - The string to be processed -- Blanks - The set of blank characters -- -- This function removes any characters of the Blanks set from both -- ends of the string and returns the result. -- -- Returns : -- -- The result string -- function Trim ( Source : String; Blanks : Character_Set ) return String; private pragma Inline (Is_Prefix); -- -- GetDigit -- Get one digit -- -- Symbol - To be decoded -- -- Returns : -- -- [0..15] The decoded digit value -- [16] The Symbol is not a digit -- function GetDigit (Symbol : Character) return Natural; pragma Inline (GetDigit); end Strings_Edit;
with System.Native_Real_Time; with System.Native_Time; with System.Tasks; with System.Debug; -- assertions with C.errno; with C.poll; package body System.Synchronous_Objects.Abortable is use type Native_Time.Nanosecond_Number; use type C.signed_int; use type C.unsigned_short; type struct_pollfd_array is array (C.size_t range <>) of aliased C.poll.struct_pollfd with Convention => C; pragma Suppress_Initialization (struct_pollfd_array); -- queue procedure Take ( Object : in out Queue; Item : out Queue_Node_Access; Params : Address; Filter : Queue_Filter; Aborted : out Boolean) is begin Aborted := Tasks.Is_Aborted; Enter (Object.Mutex.all); declare Previous : Queue_Node_Access := null; I : Queue_Node_Access := Object.Head; begin Taking : loop Take_No_Sync (Object, Item, Params, Filter, Previous, I); exit Taking when Item /= null; -- not found declare Tail_On_Waiting : constant Queue_Node_Access := Object.Tail; begin Object.Params := Params; Object.Filter := Filter; loop Object.Waiting := True; Leave (Object.Mutex.all); Wait (Object.Pipe, Aborted => Aborted); if not Aborted then Read_1 (Object.Pipe.Reading_Pipe); end if; Enter (Object.Mutex.all); Object.Waiting := False; exit Taking when Aborted; exit when Object.Tail /= Tail_On_Waiting; end loop; if Tail_On_Waiting /= null then Previous := Tail_On_Waiting; I := Tail_On_Waiting.Next; else Previous := null; I := Object.Head; end if; end; end loop Taking; end; Leave (Object.Mutex.all); end Take; -- event procedure Wait ( Object : in out Event; Aborted : out Boolean) is Abort_Event : constant access Event := Tasks.Abort_Event; begin if Abort_Event /= null then declare Polling : aliased struct_pollfd_array (0 .. 1); begin Polling (0).fd := Object.Reading_Pipe; Polling (0).events := C.signed_short ( C.unsigned_short'(C.poll.POLLIN or C.poll.POLLERR)); Polling (1).fd := Abort_Event.Reading_Pipe; Polling (1).events := C.signed_short ( C.unsigned_short'(C.poll.POLLIN or C.poll.POLLERR)); loop declare R : C.signed_int; Value : Boolean; begin R := C.poll.poll ( Polling (0)'Access, 2, -1); -- waiting indefinitely if R > 0 then pragma Check (Debug, Check => ((C.unsigned_short (Polling (0).revents) and C.poll.POLLERR) = 0 and then (C.unsigned_short (Polling (0).revents) and C.poll.POLLERR) = 0) or else Debug.Runtime_Error ("POLLERR")); Value := (C.unsigned_short (Polling (0).revents) and C.poll.POLLIN) /= 0; Aborted := (C.unsigned_short (Polling (1).revents) and C.poll.POLLIN) /= 0; exit when Value or else Aborted; end if; pragma Check (Debug, Check => not (R < 0) or else C.errno.errno = C.errno.EINTR or else Debug.Runtime_Error ("poll failed")); end; end loop; end; else Wait (Object); Aborted := Tasks.Is_Aborted; end if; end Wait; procedure Wait ( Object : in out Event; Timeout : Duration; Value : out Boolean; Aborted : out Boolean) is Abort_Event : constant access Event := Tasks.Abort_Event; begin if Abort_Event /= null then declare Deadline : constant Duration := Native_Real_Time.To_Duration (Native_Real_Time.Clock) + Timeout; Span : Duration := Timeout; Polling : aliased struct_pollfd_array (0 .. 1); begin Polling (0).fd := Object.Reading_Pipe; Polling (0).events := C.signed_short ( C.unsigned_short'(C.poll.POLLIN or C.poll.POLLERR)); Polling (1).fd := Abort_Event.Reading_Pipe; Polling (1).events := C.signed_short ( C.unsigned_short'(C.poll.POLLIN or C.poll.POLLERR)); loop declare Nanoseconds : constant Native_Time.Nanosecond_Number := Native_Time.Nanosecond_Number'Integer_Value (Span); Milliseconds : constant C.signed_int := C.signed_int'Max ( C.signed_int (Nanoseconds / 1_000_000), 0); R : C.signed_int; begin R := C.poll.poll (Polling (0)'Access, 2, Milliseconds); if R > 0 then pragma Check (Debug, Check => ((C.unsigned_short (Polling (0).revents) and C.poll.POLLERR) = 0 and then (C.unsigned_short (Polling (1).revents) and C.poll.POLLERR) = 0) or else Debug.Runtime_Error ("POLLERR")); Value := (C.unsigned_short (Polling (0).revents) and C.poll.POLLIN) /= 0; Aborted := (C.unsigned_short (Polling (1).revents) and C.poll.POLLIN) /= 0; exit when Value or else Aborted; end if; pragma Check (Debug, Check => not (R < 0) or else C.errno.errno = C.errno.EINTR or else Debug.Runtime_Error ("poll failed")); end; Span := Deadline - Native_Real_Time.To_Duration (Native_Real_Time.Clock); if Span <= 0.0 then -- timeout Value := False; Aborted := Tasks.Is_Aborted; exit; end if; end loop; end; else Wait (Object, Timeout, Value); Aborted := Tasks.Is_Aborted; end if; end Wait; end System.Synchronous_Objects.Abortable;
pragma Ada_2012; with Ada.Unchecked_Deallocation; package body Protypo.Api.Consumers.Buffers is ------------- -- Process -- ------------- overriding procedure Process (Consumer : in out Buffer; Parameter : String) is begin if Consumer.Data /= Null_Unbounded_String then Consumer.Data := Consumer.Data & Ascii.Lf; end if; Consumer.Data := Consumer.Data & Parameter; end Process; function New_Buffer return Buffer_Access is begin return new Buffer'(Data => Null_Unbounded_String); end New_Buffer; -------------- -- Get_Data -- -------------- function Get_Data (Consumer : Buffer) return String is begin return To_String (Consumer.Data); end Get_Data; procedure Destroy (Item : in out Buffer_Access) is procedure Free is new Ada.Unchecked_Deallocation (Object => Buffer, Name => Buffer_Access); begin Free (Item); end Destroy; end Protypo.Api.Consumers.Buffers;
with AdaBase; with Connect; with CommonText; with Ada.Text_IO; with AdaBase.Results.Sets; procedure DS_Fetch is package CON renames Connect; package TIO renames Ada.Text_IO; package ARS renames AdaBase.Results.Sets; package CT renames CommonText; begin CON.DR.set_trait_character_set (""); -- Native charset (Latin1), not UTF-8 CON.connect_database; declare sql : constant String := "SELECT * FROM fruits WHERE color = 'orange'"; stmt : CON.Stmt_Type := CON.DR.query (sql); row : ARS.Datarow; begin TIO.Put_Line (" Query successful: " & stmt.successful'Img); TIO.Put_Line (" Data Discarded: " & stmt.data_discarded'Img); TIO.Put_Line ("Number of columns:" & stmt.column_count'Img); TIO.Put_Line (" Number of rows:" & stmt.rows_returned'Img); TIO.Put_Line (""); for c in Natural range 1 .. stmt.column_count loop TIO.Put_Line ("Column" & c'Img & ":"); TIO.Put_Line (" TABLE: " & stmt.column_table (c)); TIO.Put_Line (" NAME: " & stmt.column_name (c)); TIO.Put_Line (" TYPE: " & stmt.column_native_type (c)'Img); end loop; TIO.Put_Line (""); loop row := stmt.fetch_next; exit when row.data_exhausted; TIO.Put (CT.zeropad (Natural (row.column (1).as_byte2), 2) & " "); declare fruit : String := row.column ("fruit").as_string; frlen : Natural := fruit'Length; rest : String (1 .. 12 - frlen) := (others => ' '); begin TIO.Put (rest & fruit); end; TIO.Put (" (" & row.column ("color").as_string & ") calories ="); TIO.Put_Line (row.column (4).as_byte2'Img); end loop; end; CON.DR.disconnect; end DS_Fetch;
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- S E M _ C H 3 -- -- -- -- S p e c -- -- -- -- Copyright (C) 1992-2005, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- -- Boston, MA 02110-1301, USA. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with Nlists; use Nlists; with Types; use Types; package Sem_Ch3 is procedure Analyze_Component_Declaration (N : Node_Id); procedure Analyze_Incomplete_Type_Decl (N : Node_Id); procedure Analyze_Itype_Reference (N : Node_Id); procedure Analyze_Number_Declaration (N : Node_Id); procedure Analyze_Object_Declaration (N : Node_Id); procedure Analyze_Others_Choice (N : Node_Id); procedure Analyze_Private_Extension_Declaration (N : Node_Id); procedure Analyze_Subtype_Declaration (N : Node_Id); procedure Analyze_Subtype_Indication (N : Node_Id); procedure Analyze_Type_Declaration (N : Node_Id); procedure Analyze_Variant_Part (N : Node_Id); function Access_Definition (Related_Nod : Node_Id; N : Node_Id) return Entity_Id; -- An access definition defines a general access type for a formal -- parameter. The procedure is called when processing formals, when -- the current scope is the subprogram. The Implicit type is attached -- to the Related_Nod put into the enclosing scope, so that the only -- entities defined in the spec are the formals themselves. procedure Access_Subprogram_Declaration (T_Name : Entity_Id; T_Def : Node_Id); -- The subprogram specification yields the signature of an implicit -- type, whose Ekind is Access_Subprogram_Type. This implicit type is -- the designated type of the declared access type. In subprogram calls, -- the signature of the implicit type works like the profile of a regular -- subprogram. procedure Analyze_Declarations (L : List_Id); -- Called to analyze a list of declarations (in what context ???). Also -- performs necessary freezing actions (more description needed ???) procedure Analyze_Interface_Declaration (T : Entity_Id; Def : Node_Id); -- Analyze an interface declaration or a formal interface declaration procedure Analyze_Per_Use_Expression (N : Node_Id; T : Entity_Id); -- Default and per object expressions do not freeze their components, -- and must be analyzed and resolved accordingly. The analysis is -- done by calling the Pre_Analyze_And_Resolve routine and setting -- the global In_Default_Expression flag. See the documentation section -- entitled "Handling of Default and Per-Object Expressions" in sem.ads -- for details. N is the expression to be analyzed, T is the expected type. procedure Array_Type_Declaration (T : in out Entity_Id; Def : Node_Id); -- Process an array type declaration. If the array is constrained, we -- create an implicit parent array type, with the same index types and -- component type. procedure Access_Type_Declaration (T : Entity_Id; Def : Node_Id); -- Process an access type declaration procedure Check_Abstract_Overriding (T : Entity_Id); -- Check that all abstract subprograms inherited from T's parent type -- have been overridden as required, and that nonabstract subprograms -- have not been incorrectly overridden with an abstract subprogram. procedure Check_Aliased_Component_Types (T : Entity_Id); -- Given an array type or record type T, check that if the type is -- nonlimited, then the nominal subtype of any components of T -- that have discriminants must be constrained. procedure Check_Completion (Body_Id : Node_Id := Empty); -- At the end of a declarative part, verify that all entities that -- require completion have received one. If Body_Id is absent, the -- error indicating a missing completion is placed on the declaration -- that needs completion. If Body_Id is present, it is the defining -- identifier of a package body, and errors are posted on that node, -- rather than on the declarations that require completion in the package -- declaration. procedure Collect_Interfaces (N : Node_Id; Derived_Type : Entity_Id); -- Ada 2005 (AI-251): Subsidiary procedure to Build_Derived_Record_Type -- and Analyze_Formal_Interface_Type. -- Collect the list of interfaces that are not already implemented by the -- ancestors. This is the list of interfaces for which we must provide -- additional tag components. procedure Derive_Subprogram (New_Subp : in out Entity_Id; Parent_Subp : Entity_Id; Derived_Type : Entity_Id; Parent_Type : Entity_Id; Actual_Subp : Entity_Id := Empty); -- Derive the subprogram Parent_Subp from Parent_Type, and replace the -- subsidiary subtypes with the derived type to build the specification -- of the inherited subprogram (returned in New_Subp). For tagged types, -- the derived subprogram is aliased to that of the actual (in the -- case where Actual_Subp is nonempty) rather than to the corresponding -- subprogram of the parent type. procedure Derive_Subprograms (Parent_Type : Entity_Id; Derived_Type : Entity_Id; Generic_Actual : Entity_Id := Empty; No_Predefined_Prims : Boolean := False); -- To complete type derivation, collect/retrieve the primitive operations -- of the parent type, and replace the subsidiary subtypes with the derived -- type, to build the specs of the inherited ops. For generic actuals, the -- mapping of the primitive operations to those of the parent type is also -- done by rederiving the operations within the instance. For tagged types, -- the derived subprograms are aliased to those of the actual, not those of -- the ancestor. The last two params are used in case of derivation from -- abstract interface types: No_Predefined_Prims is used to avoid the -- derivation of predefined primitives from an abstract interface. -- -- Note: one might expect this to be private to the package body, but -- there is one rather unusual usage in package Exp_Dist. function Find_Type_Of_Subtype_Indic (S : Node_Id) return Entity_Id; -- Given a subtype indication S (which is really an N_Subtype_Indication -- node or a plain N_Identifier), find the type of the subtype mark. function Find_Type_Name (N : Node_Id) return Entity_Id; -- Enter the identifier in a type definition, or find the entity already -- declared, in the case of the full declaration of an incomplete or -- private type. function Get_Discriminant_Value (Discriminant : Entity_Id; Typ_For_Constraint : Entity_Id; Constraint : Elist_Id) return Node_Id; -- ??? MORE DOCUMENTATION -- Given a discriminant somewhere in the Typ_For_Constraint tree -- and a Constraint, return the value of that discriminant. function Is_Null_Extension (T : Entity_Id) return Boolean; -- Returns True if the tagged type T has an N_Full_Type_Declaration that -- is a null extension, meaning that it has an extension part without any -- components and does not have a known discriminant part. function Is_Visible_Component (C : Entity_Id) return Boolean; -- Determines if a record component C is visible in the present context. -- Note that even though component C could appear in the entity chain -- of a record type, C may not be visible in the current context. For -- instance, C may be a component inherited in the full view of a private -- extension which is not visible in the current context. procedure Make_Index (I : Node_Id; Related_Nod : Node_Id; Related_Id : Entity_Id := Empty; Suffix_Index : Nat := 1); -- Process an index that is given in an array declaration, an entry -- family declaration or a loop iteration. The index is given by an -- index declaration (a 'box'), or by a discrete range. The later can -- be the name of a discrete type, or a subtype indication. -- Related_Nod is the node where the potential generated implicit types -- will be inserted. The 2 last parameters are used for creating the name. procedure Make_Class_Wide_Type (T : Entity_Id); -- A Class_Wide_Type is created for each tagged type definition. The -- attributes of a class wide type are inherited from those of the type -- T. If T is introduced by a private declaration, the corresponding -- class wide type is created at the same time, and therefore there is -- a private and a full declaration for the class wide type type as well. procedure Process_Full_View (N : Node_Id; Full_T, Priv_T : Entity_Id); -- Process some semantic actions when the full view of a private type is -- encountered and analyzed. The first action is to create the full views -- of the dependant private subtypes. The second action is to recopy the -- primitive operations of the private view (in the tagged case). -- N is the N_Full_Type_Declaration node. -- Full_T is the full view of the type whose full declaration is in N. -- -- Priv_T is the private view of the type whose full declaration is in N. procedure Process_Range_Expr_In_Decl (R : Node_Id; T : Entity_Id; Check_List : List_Id := Empty_List; R_Check_Off : Boolean := False); -- Process a range expression that appears in a declaration context. The -- range is analyzed and resolved with the base type of the given type, -- and an appropriate check for expressions in non-static contexts made -- on the bounds. R is analyzed and resolved using T, so the caller should -- if necessary link R into the tree before the call, and in particular in -- the case of a subtype declaration, it is appropriate to set the parent -- pointer of R so that the types get properly frozen. The Check_List -- parameter is used when the subprogram is called from -- Build_Record_Init_Proc and is used to return a set of constraint -- checking statements generated by the Checks package. R_Check_Off is -- set to True when the call to Range_Check is to be skipped. function Process_Subtype (S : Node_Id; Related_Nod : Node_Id; Related_Id : Entity_Id := Empty; Suffix : Character := ' ') return Entity_Id; -- Process a subtype indication S and return corresponding entity. -- Related_Nod is the node where the potential generated implicit types -- will be inserted. The Related_Id and Suffix parameters are used to -- build the associated Implicit type name. procedure Process_Discriminants (N : Node_Id; Prev : Entity_Id := Empty); -- Process the discriminants contained in an N_Full_Type_Declaration or -- N_Incomplete_Type_Decl node N. If the declaration is a completion, -- Prev is entity on the partial view, on which references are posted. function Replace_Anonymous_Access_To_Protected_Subprogram (N : Node_Id; Prev_E : Entity_Id) return Entity_Id; -- Ada 2005 (AI-254): Create and decorate an internal full type declaration -- in the enclosing scope corresponding to an anonymous access to protected -- subprogram. In addition, replace the anonymous access by an occurrence -- of this internal type. Prev_Etype is used to link the new internal -- entity with the anonymous entity. Return the entity of this type -- declaration. procedure Set_Completion_Referenced (E : Entity_Id); -- If E is the completion of a private or incomplete type declaration, -- or the completion of a deferred constant declaration, mark the entity -- as referenced. Warnings on unused entities, if needed, go on the -- partial view. end Sem_Ch3;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- G N A T . T R A C E B A C K -- -- -- -- S p e c -- -- -- -- Copyright (C) 1999-2016, AdaCore -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- Run-time non-symbolic traceback support -- This package provides a method for generating a traceback of the -- current execution location. The traceback shows the locations of -- calls in the call chain, up to either the top or a designated -- number of levels. -- The traceback information is in the form of absolute code locations. -- These code locations may be converted to corresponding source locations -- using the external addr2line utility, or from within GDB. -- In order to use this facility, in some cases the binder must be invoked -- with -E switch (store the backtrace with exception occurrence). Please -- refer to gnatbind documentation for more information. -- To analyze the code locations later using addr2line or gdb, the necessary -- units must be compiled with the debugging switch -g in the usual manner. -- Note that it is not necessary to compile with -g to use Call_Chain. In -- other words, the following sequence of steps can be used: -- Compile without -g -- Run the program, and call Call_Chain -- Recompile with -g -- Use addr2line to interpret the absolute call locations (note that -- addr2line expects addresses in hexadecimal format). -- This capability is currently supported on the following targets: -- AiX PowerPC -- GNU/Linux x86 -- GNU/Linux PowerPC -- LynxOS x86 -- LynxOS 178 xcoff PowerPC -- LynxOS 178 elf PowerPC -- Solaris x86 -- Solaris sparc -- VxWorks ARM -- VxWorks7 ARM -- VxWorks PowerPC -- VxWorks x86 -- Windows XP -- Note: see also GNAT.Traceback.Symbolic, a child unit in file g-trasym.ads -- providing symbolic trace back capability for a subset of the above targets. with System; with Ada.Exceptions.Traceback; package GNAT.Traceback is pragma Elaborate_Body; subtype Code_Loc is System.Address; -- Code location used in building tracebacks subtype Tracebacks_Array is Ada.Exceptions.Traceback.Tracebacks_Array; -- Traceback array used to hold a generated traceback list ---------------- -- Call_Chain -- ---------------- procedure Call_Chain (Traceback : out Tracebacks_Array; Len : out Natural); -- Store up to Traceback'Length tracebacks corresponding to the current -- call chain. The first entry stored corresponds to the deepest level -- of subprogram calls. Len shows the number of traceback entries stored. -- It will be equal to Traceback'Length unless the entire traceback is -- shorter, in which case positions in Traceback past the Len position -- are undefined on return. end GNAT.Traceback;
-- Copyright (c) 2013, Nordic Semiconductor ASA -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- -- * Redistributions of source code must retain the above copyright notice, this -- list of conditions and the following disclaimer. -- -- * Redistributions in binary form must reproduce the above copyright notice, -- this list of conditions and the following disclaimer in the documentation -- and/or other materials provided with the distribution. -- -- * Neither the name of Nordic Semiconductor ASA nor the names of its -- contributors may be used to endorse or promote products derived from -- this software without specific prior written permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- This spec has been automatically generated from nrf51.svd pragma Restrictions (No_Elaboration_Code); pragma Ada_2012; pragma Style_Checks (Off); with HAL; with System; package NRF51_SVD.LPCOMP is pragma Preelaborate; --------------- -- Registers -- --------------- -- Shortcut between READY event and SAMPLE task. type SHORTS_READY_SAMPLE_Field is ( -- Shortcut disabled. Disabled, -- Shortcut enabled. Enabled) with Size => 1; for SHORTS_READY_SAMPLE_Field use (Disabled => 0, Enabled => 1); -- Shortcut between RADY event and STOP task. type SHORTS_READY_STOP_Field is ( -- Shortcut disabled. Disabled, -- Shortcut enabled. Enabled) with Size => 1; for SHORTS_READY_STOP_Field use (Disabled => 0, Enabled => 1); -- Shortcut between DOWN event and STOP task. type SHORTS_DOWN_STOP_Field is ( -- Shortcut disabled. Disabled, -- Shortcut enabled. Enabled) with Size => 1; for SHORTS_DOWN_STOP_Field use (Disabled => 0, Enabled => 1); -- Shortcut between UP event and STOP task. type SHORTS_UP_STOP_Field is ( -- Shortcut disabled. Disabled, -- Shortcut enabled. Enabled) with Size => 1; for SHORTS_UP_STOP_Field use (Disabled => 0, Enabled => 1); -- Shortcut between CROSS event and STOP task. type SHORTS_CROSS_STOP_Field is ( -- Shortcut disabled. Disabled, -- Shortcut enabled. Enabled) with Size => 1; for SHORTS_CROSS_STOP_Field use (Disabled => 0, Enabled => 1); -- Shortcuts for the LPCOMP. type SHORTS_Register is record -- Shortcut between READY event and SAMPLE task. READY_SAMPLE : SHORTS_READY_SAMPLE_Field := NRF51_SVD.LPCOMP.Disabled; -- Shortcut between RADY event and STOP task. READY_STOP : SHORTS_READY_STOP_Field := NRF51_SVD.LPCOMP.Disabled; -- Shortcut between DOWN event and STOP task. DOWN_STOP : SHORTS_DOWN_STOP_Field := NRF51_SVD.LPCOMP.Disabled; -- Shortcut between UP event and STOP task. UP_STOP : SHORTS_UP_STOP_Field := NRF51_SVD.LPCOMP.Disabled; -- Shortcut between CROSS event and STOP task. CROSS_STOP : SHORTS_CROSS_STOP_Field := NRF51_SVD.LPCOMP.Disabled; -- unspecified Reserved_5_31 : HAL.UInt27 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for SHORTS_Register use record READY_SAMPLE at 0 range 0 .. 0; READY_STOP at 0 range 1 .. 1; DOWN_STOP at 0 range 2 .. 2; UP_STOP at 0 range 3 .. 3; CROSS_STOP at 0 range 4 .. 4; Reserved_5_31 at 0 range 5 .. 31; end record; -- Enable interrupt on READY event. type INTENSET_READY_Field is ( -- Interrupt disabled. Disabled, -- Interrupt enabled. Enabled) with Size => 1; for INTENSET_READY_Field use (Disabled => 0, Enabled => 1); -- Enable interrupt on READY event. type INTENSET_READY_Field_1 is ( -- Reset value for the field Intenset_Ready_Field_Reset, -- Enable interrupt on write. Set) with Size => 1; for INTENSET_READY_Field_1 use (Intenset_Ready_Field_Reset => 0, Set => 1); -- Enable interrupt on DOWN event. type INTENSET_DOWN_Field is ( -- Interrupt disabled. Disabled, -- Interrupt enabled. Enabled) with Size => 1; for INTENSET_DOWN_Field use (Disabled => 0, Enabled => 1); -- Enable interrupt on DOWN event. type INTENSET_DOWN_Field_1 is ( -- Reset value for the field Intenset_Down_Field_Reset, -- Enable interrupt on write. Set) with Size => 1; for INTENSET_DOWN_Field_1 use (Intenset_Down_Field_Reset => 0, Set => 1); -- Enable interrupt on UP event. type INTENSET_UP_Field is ( -- Interrupt disabled. Disabled, -- Interrupt enabled. Enabled) with Size => 1; for INTENSET_UP_Field use (Disabled => 0, Enabled => 1); -- Enable interrupt on UP event. type INTENSET_UP_Field_1 is ( -- Reset value for the field Intenset_Up_Field_Reset, -- Enable interrupt on write. Set) with Size => 1; for INTENSET_UP_Field_1 use (Intenset_Up_Field_Reset => 0, Set => 1); -- Enable interrupt on CROSS event. type INTENSET_CROSS_Field is ( -- Interrupt disabled. Disabled, -- Interrupt enabled. Enabled) with Size => 1; for INTENSET_CROSS_Field use (Disabled => 0, Enabled => 1); -- Enable interrupt on CROSS event. type INTENSET_CROSS_Field_1 is ( -- Reset value for the field Intenset_Cross_Field_Reset, -- Enable interrupt on write. Set) with Size => 1; for INTENSET_CROSS_Field_1 use (Intenset_Cross_Field_Reset => 0, Set => 1); -- Interrupt enable set register. type INTENSET_Register is record -- Enable interrupt on READY event. READY : INTENSET_READY_Field_1 := Intenset_Ready_Field_Reset; -- Enable interrupt on DOWN event. DOWN : INTENSET_DOWN_Field_1 := Intenset_Down_Field_Reset; -- Enable interrupt on UP event. UP : INTENSET_UP_Field_1 := Intenset_Up_Field_Reset; -- Enable interrupt on CROSS event. CROSS : INTENSET_CROSS_Field_1 := Intenset_Cross_Field_Reset; -- unspecified Reserved_4_31 : HAL.UInt28 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for INTENSET_Register use record READY at 0 range 0 .. 0; DOWN at 0 range 1 .. 1; UP at 0 range 2 .. 2; CROSS at 0 range 3 .. 3; Reserved_4_31 at 0 range 4 .. 31; end record; -- Disable interrupt on READY event. type INTENCLR_READY_Field is ( -- Interrupt disabled. Disabled, -- Interrupt enabled. Enabled) with Size => 1; for INTENCLR_READY_Field use (Disabled => 0, Enabled => 1); -- Disable interrupt on READY event. type INTENCLR_READY_Field_1 is ( -- Reset value for the field Intenclr_Ready_Field_Reset, -- Disable interrupt on write. Clear) with Size => 1; for INTENCLR_READY_Field_1 use (Intenclr_Ready_Field_Reset => 0, Clear => 1); -- Disable interrupt on DOWN event. type INTENCLR_DOWN_Field is ( -- Interrupt disabled. Disabled, -- Interrupt enabled. Enabled) with Size => 1; for INTENCLR_DOWN_Field use (Disabled => 0, Enabled => 1); -- Disable interrupt on DOWN event. type INTENCLR_DOWN_Field_1 is ( -- Reset value for the field Intenclr_Down_Field_Reset, -- Disable interrupt on write. Clear) with Size => 1; for INTENCLR_DOWN_Field_1 use (Intenclr_Down_Field_Reset => 0, Clear => 1); -- Disable interrupt on UP event. type INTENCLR_UP_Field is ( -- Interrupt disabled. Disabled, -- Interrupt enabled. Enabled) with Size => 1; for INTENCLR_UP_Field use (Disabled => 0, Enabled => 1); -- Disable interrupt on UP event. type INTENCLR_UP_Field_1 is ( -- Reset value for the field Intenclr_Up_Field_Reset, -- Disable interrupt on write. Clear) with Size => 1; for INTENCLR_UP_Field_1 use (Intenclr_Up_Field_Reset => 0, Clear => 1); -- Disable interrupt on CROSS event. type INTENCLR_CROSS_Field is ( -- Interrupt disabled. Disabled, -- Interrupt enabled. Enabled) with Size => 1; for INTENCLR_CROSS_Field use (Disabled => 0, Enabled => 1); -- Disable interrupt on CROSS event. type INTENCLR_CROSS_Field_1 is ( -- Reset value for the field Intenclr_Cross_Field_Reset, -- Disable interrupt on write. Clear) with Size => 1; for INTENCLR_CROSS_Field_1 use (Intenclr_Cross_Field_Reset => 0, Clear => 1); -- Interrupt enable clear register. type INTENCLR_Register is record -- Disable interrupt on READY event. READY : INTENCLR_READY_Field_1 := Intenclr_Ready_Field_Reset; -- Disable interrupt on DOWN event. DOWN : INTENCLR_DOWN_Field_1 := Intenclr_Down_Field_Reset; -- Disable interrupt on UP event. UP : INTENCLR_UP_Field_1 := Intenclr_Up_Field_Reset; -- Disable interrupt on CROSS event. CROSS : INTENCLR_CROSS_Field_1 := Intenclr_Cross_Field_Reset; -- unspecified Reserved_4_31 : HAL.UInt28 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for INTENCLR_Register use record READY at 0 range 0 .. 0; DOWN at 0 range 1 .. 1; UP at 0 range 2 .. 2; CROSS at 0 range 3 .. 3; Reserved_4_31 at 0 range 4 .. 31; end record; -- Result of last compare. Decision point SAMPLE task. type RESULT_RESULT_Field is ( -- Input voltage is bellow the reference threshold. Bellow, -- Input voltage is above the reference threshold. Above) with Size => 1; for RESULT_RESULT_Field use (Bellow => 0, Above => 1); -- Result of last compare. type RESULT_Register is record -- Read-only. Result of last compare. Decision point SAMPLE task. RESULT : RESULT_RESULT_Field; -- unspecified Reserved_1_31 : HAL.UInt31; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for RESULT_Register use record RESULT at 0 range 0 .. 0; Reserved_1_31 at 0 range 1 .. 31; end record; -- Enable or disable LPCOMP. type ENABLE_ENABLE_Field is ( -- Disabled LPCOMP. Disabled, -- Enable LPCOMP. Enabled) with Size => 2; for ENABLE_ENABLE_Field use (Disabled => 0, Enabled => 1); -- Enable the LPCOMP. type ENABLE_Register is record -- Enable or disable LPCOMP. ENABLE : ENABLE_ENABLE_Field := NRF51_SVD.LPCOMP.Disabled; -- unspecified Reserved_2_31 : HAL.UInt30 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for ENABLE_Register use record ENABLE at 0 range 0 .. 1; Reserved_2_31 at 0 range 2 .. 31; end record; -- Analog input pin select. type PSEL_PSEL_Field is ( -- Use analog input 0 as analog input. Analoginput0, -- Use analog input 1 as analog input. Analoginput1, -- Use analog input 2 as analog input. Analoginput2, -- Use analog input 3 as analog input. Analoginput3, -- Use analog input 4 as analog input. Analoginput4, -- Use analog input 5 as analog input. Analoginput5, -- Use analog input 6 as analog input. Analoginput6, -- Use analog input 7 as analog input. Analoginput7) with Size => 3; for PSEL_PSEL_Field use (Analoginput0 => 0, Analoginput1 => 1, Analoginput2 => 2, Analoginput3 => 3, Analoginput4 => 4, Analoginput5 => 5, Analoginput6 => 6, Analoginput7 => 7); -- Input pin select. type PSEL_Register is record -- Analog input pin select. PSEL : PSEL_PSEL_Field := NRF51_SVD.LPCOMP.Analoginput0; -- unspecified Reserved_3_31 : HAL.UInt29 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for PSEL_Register use record PSEL at 0 range 0 .. 2; Reserved_3_31 at 0 range 3 .. 31; end record; -- Reference select. type REFSEL_REFSEL_Field is ( -- Use supply with a 1/8 prescaler as reference. Supplyoneeighthprescaling, -- Use supply with a 2/8 prescaler as reference. Supplytwoeighthsprescaling, -- Use supply with a 3/8 prescaler as reference. Supplythreeeighthsprescaling, -- Use supply with a 4/8 prescaler as reference. Supplyfoureighthsprescaling, -- Use supply with a 5/8 prescaler as reference. Supplyfiveeighthsprescaling, -- Use supply with a 6/8 prescaler as reference. Supplysixeighthsprescaling, -- Use supply with a 7/8 prescaler as reference. Supplyseveneighthsprescaling, -- Use external analog reference as reference. Aref) with Size => 3; for REFSEL_REFSEL_Field use (Supplyoneeighthprescaling => 0, Supplytwoeighthsprescaling => 1, Supplythreeeighthsprescaling => 2, Supplyfoureighthsprescaling => 3, Supplyfiveeighthsprescaling => 4, Supplysixeighthsprescaling => 5, Supplyseveneighthsprescaling => 6, Aref => 7); -- Reference select. type REFSEL_Register is record -- Reference select. REFSEL : REFSEL_REFSEL_Field := NRF51_SVD.LPCOMP.Supplyoneeighthprescaling; -- unspecified Reserved_3_31 : HAL.UInt29 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for REFSEL_Register use record REFSEL at 0 range 0 .. 2; Reserved_3_31 at 0 range 3 .. 31; end record; -- External analog reference pin selection. type EXTREFSEL_EXTREFSEL_Field is ( -- Use analog reference 0 as reference. Analogreference0, -- Use analog reference 1 as reference. Analogreference1) with Size => 1; for EXTREFSEL_EXTREFSEL_Field use (Analogreference0 => 0, Analogreference1 => 1); -- External reference select. type EXTREFSEL_Register is record -- External analog reference pin selection. EXTREFSEL : EXTREFSEL_EXTREFSEL_Field := NRF51_SVD.LPCOMP.Analogreference0; -- unspecified Reserved_1_31 : HAL.UInt31 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for EXTREFSEL_Register use record EXTREFSEL at 0 range 0 .. 0; Reserved_1_31 at 0 range 1 .. 31; end record; -- Analog detect configuration. type ANADETECT_ANADETECT_Field is ( -- Generate ANADETEC on crossing, both upwards and downwards crossing. Cross, -- Generate ANADETEC on upwards crossing only. Up, -- Generate ANADETEC on downwards crossing only. Down) with Size => 2; for ANADETECT_ANADETECT_Field use (Cross => 0, Up => 1, Down => 2); -- Analog detect configuration. type ANADETECT_Register is record -- Analog detect configuration. ANADETECT : ANADETECT_ANADETECT_Field := NRF51_SVD.LPCOMP.Cross; -- unspecified Reserved_2_31 : HAL.UInt30 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for ANADETECT_Register use record ANADETECT at 0 range 0 .. 1; Reserved_2_31 at 0 range 2 .. 31; end record; -- Peripheral power control. type POWER_POWER_Field is ( -- Module power disabled. Disabled, -- Module power enabled. Enabled) with Size => 1; for POWER_POWER_Field use (Disabled => 0, Enabled => 1); -- Peripheral power control. type POWER_Register is record -- Peripheral power control. POWER : POWER_POWER_Field := NRF51_SVD.LPCOMP.Disabled; -- unspecified Reserved_1_31 : HAL.UInt31 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for POWER_Register use record POWER at 0 range 0 .. 0; Reserved_1_31 at 0 range 1 .. 31; end record; ----------------- -- Peripherals -- ----------------- -- Low power comparator. type LPCOMP_Peripheral is record -- Start the comparator. TASKS_START : aliased HAL.UInt32; -- Stop the comparator. TASKS_STOP : aliased HAL.UInt32; -- Sample comparator value. TASKS_SAMPLE : aliased HAL.UInt32; -- LPCOMP is ready and output is valid. EVENTS_READY : aliased HAL.UInt32; -- Input voltage crossed the threshold going down. EVENTS_DOWN : aliased HAL.UInt32; -- Input voltage crossed the threshold going up. EVENTS_UP : aliased HAL.UInt32; -- Input voltage crossed the threshold in any direction. EVENTS_CROSS : aliased HAL.UInt32; -- Shortcuts for the LPCOMP. SHORTS : aliased SHORTS_Register; -- Interrupt enable set register. INTENSET : aliased INTENSET_Register; -- Interrupt enable clear register. INTENCLR : aliased INTENCLR_Register; -- Result of last compare. RESULT : aliased RESULT_Register; -- Enable the LPCOMP. ENABLE : aliased ENABLE_Register; -- Input pin select. PSEL : aliased PSEL_Register; -- Reference select. REFSEL : aliased REFSEL_Register; -- External reference select. EXTREFSEL : aliased EXTREFSEL_Register; -- Analog detect configuration. ANADETECT : aliased ANADETECT_Register; -- Peripheral power control. POWER : aliased POWER_Register; end record with Volatile; for LPCOMP_Peripheral use record TASKS_START at 16#0# range 0 .. 31; TASKS_STOP at 16#4# range 0 .. 31; TASKS_SAMPLE at 16#8# range 0 .. 31; EVENTS_READY at 16#100# range 0 .. 31; EVENTS_DOWN at 16#104# range 0 .. 31; EVENTS_UP at 16#108# range 0 .. 31; EVENTS_CROSS at 16#10C# range 0 .. 31; SHORTS at 16#200# range 0 .. 31; INTENSET at 16#304# range 0 .. 31; INTENCLR at 16#308# range 0 .. 31; RESULT at 16#400# range 0 .. 31; ENABLE at 16#500# range 0 .. 31; PSEL at 16#504# range 0 .. 31; REFSEL at 16#508# range 0 .. 31; EXTREFSEL at 16#50C# range 0 .. 31; ANADETECT at 16#520# range 0 .. 31; POWER at 16#FFC# range 0 .. 31; end record; -- Low power comparator. LPCOMP_Periph : aliased LPCOMP_Peripheral with Import, Address => System'To_Address (16#40013000#); end NRF51_SVD.LPCOMP;
with Memory.Super_Time; with Memory.Super_Writes; with Memory.Super_None; with Util; use Util; separate (Parser) procedure Parse_Super(parser : in out Parser_Type; result : out Memory_Pointer) is type Opt_Type is (Opt_Time, Opt_Writes, Opt_None); max_cost : Cost_Type := 1e6; permute_only : Boolean := False; dram : Memory_Pointer := null; seed : Integer := 0; max_iterations : Long_Integer := 1000; opt : Opt_Type := Opt_Time; sp : Memory_Pointer := null; begin while Get_Type(parser) = Open loop Match(parser, Open); declare name : constant String := Get_Value(parser); begin Match(parser, Literal); if name = "memory" then if dram = null then Parse_Memory(parser, dram); else Destroy(dram); Raise_Error(parser, "duplicate memory in super"); end if; else declare value : constant String := Get_Value(parser); begin Match(parser, Literal); if name = "max_cost" then max_cost := Cost_Type'Value(value); elsif name = "seed" then seed := Integer'Value(value); elsif name = "max_iterations" then max_iterations := Long_Integer'Value(value); elsif name = "optimize" then if value = "time" then opt := Opt_Time; elsif value = "writes" then opt := Opt_Writes; elsif value = "none" then opt := Opt_None; else Raise_Error(parser, "invalid optimization target: " & value); end if; elsif name = "permute_only" then if value = "true" then permute_only := True; elsif value = "false" then permute_only := False; else Raise_Error(parser, "invalid permute_only setting; " & value); end if; else Raise_Error(parser, "invalid attribute in super: " & name); end if; end; end if; end; Match(parser, Close); end loop; case opt is when Opt_Time => sp := Memory_Pointer(Super_Time.Create_Super(dram, max_cost, seed, max_iterations, permute_only)); when Opt_Writes => sp := Memory_Pointer(Super_Writes.Create_Super(dram, max_cost, seed, max_iterations, permute_only)); when Opt_None => sp := Memory_Pointer(Super_None.Create_Super(dram, max_cost, seed, max_iterations, permute_only)); end case; if sp = null then Raise_Error(parser, "invalid initial memory"); else result := sp; end if; exception when Data_Error | Constraint_Error => if dram /= null then Destroy(dram); end if; Raise_Error(parser, "invalid value in super"); end Parse_Super;
with ACO.Messages; with ACO.OD_Types; with ACO.Utils.Byte_Order; with Interfaces; with System; package ACO.SDO_Commands is use Interfaces; use ACO.Messages; use ACO.OD_Types; use ACO.Utils.Byte_Order; type Unsigned_3 is mod 2 ** 3 with Size => 3; type Unsigned_2 is mod 2 ** 2 with Size => 2; subtype Abort_Code_Type is Interfaces.Unsigned_32; Download_Initiate_Req : constant := 1; Download_Initiate_Conf : constant := 3; Download_Segment_Req : constant := 0; Download_Segment_Conf : constant := 1; Upload_Initiate_Req : constant := 2; Upload_Initiate_Conf : constant := 2; Upload_Segment_Req : constant := 3; Upload_Segment_Conf : constant := 0; Abort_Req : constant := 4; function Get_CS (Msg : Message) return Unsigned_3 is (Unsigned_3 (Shift_Right (Msg.Data (0), 5) and 2#111#)); function Get_Index (Msg : Message) return Entry_Index is ((Object => Swap_Bus (Octets_2 (Msg.Data (1 .. 2))), Sub => Msg.Data (3))); -- function Index_To_Bus (Index : Object_Index) return Data_Array is -- (Data_Array (Octets_2' (Swap_Bus (Unsigned_16 (Index))))); type Download_Initiate_Cmd (As_Raw : Boolean := False) is record case As_Raw is when True => Raw : Data_Array (0 .. 7); when False => Command : Unsigned_3; Nof_No_Data : Unsigned_2; Is_Expedited : Boolean; Is_Size_Indicated : Boolean; Index : Unsigned_16; Subindex : Unsigned_8; Data : Data_Array (0 .. 3); end case; end record with Unchecked_Union, Size => 64, Bit_Order => System.Low_Order_First; for Download_Initiate_Cmd use record Raw at 0 range 0 .. 63; Data at 0 range 32 .. 63; Subindex at 0 range 24 .. 31; Index at 0 range 8 .. 23; Command at 0 range 5 .. 7; Nof_No_Data at 0 range 2 .. 3; Is_Expedited at 0 range 1 .. 1; Is_Size_Indicated at 0 range 0 .. 0; end record; function Get_Data_Size (Cmd : Download_Initiate_Cmd) return Natural is (if Cmd.Is_Expedited then 4 - Natural (Cmd.Nof_No_Data) else Natural (Swap_Bus (Octets_4 (Cmd.Data)))); function Convert (Msg : Message) return Download_Initiate_Cmd is ((As_Raw => True, Raw => Msg.Data)); subtype Expedited_Data is Data_Array (0 .. 3); function Create (Index : Entry_Index; Data : Data_Array) return Download_Initiate_Cmd with Pre => Data'Length <= Expedited_Data'Length; function Create (Index : Entry_Index; Size : Natural) return Download_Initiate_Cmd; subtype Segment_Data is Data_Array (0 .. 6); type Download_Segment_Cmd (As_Raw : Boolean := False) is record case As_Raw is when True => Raw : Data_Array (0 .. 7); when False => Command : Unsigned_3; Toggle : Boolean; Nof_No_Data : Unsigned_3; Is_Complete : Boolean; Data : Segment_Data; end case; end record with Unchecked_Union, Size => 64, Bit_Order => System.Low_Order_First; for Download_Segment_Cmd use record Raw at 0 range 0 .. 63; Data at 0 range 8 .. 63; Command at 0 range 5 .. 7; Toggle at 0 range 4 .. 4; Nof_No_Data at 0 range 1 .. 3; Is_Complete at 0 range 0 .. 0; end record; function Convert (Msg : Message) return Download_Segment_Cmd is ((As_Raw => True, Raw => Msg.Data)); function Create (Toggle : Boolean; Is_Complete : Boolean; Data : Data_Array) return Download_Segment_Cmd with Pre => Data'Length <= Segment_Data'Length; type Download_Initiate_Resp (As_Raw : Boolean := False) is record case As_Raw is when True => Raw : Data_Array (0 .. 7) := (others => 0); when False => Command : Unsigned_3; Index : Unsigned_16; Subindex : Unsigned_8; end case; end record with Unchecked_Union, Size => 64, Bit_Order => System.Low_Order_First; for Download_Initiate_Resp use record Raw at 0 range 0 .. 63; Subindex at 0 range 24 .. 31; Index at 0 range 8 .. 23; Command at 0 range 5 .. 7; end record; function Convert (Msg : Message) return Download_Initiate_Resp is ((As_Raw => True, Raw => Msg.Data)); function Create (Index : Entry_Index) return Download_Initiate_Resp; type Download_Segment_Resp (As_Raw : Boolean := False) is record case As_Raw is when True => Raw : Data_Array (0 .. 7) := (others => 0); when False => Command : Unsigned_3; Toggle : Boolean; end case; end record with Unchecked_Union, Size => 64, Bit_Order => System.Low_Order_First; for Download_Segment_Resp use record Raw at 0 range 0 .. 63; Command at 0 range 5 .. 7; Toggle at 0 range 4 .. 4; end record; function Convert (Msg : Message) return Download_Segment_Resp is ((As_Raw => True, Raw => Msg.Data)); function Create (Toggle : Boolean) return Download_Segment_Resp; type Abort_Cmd (As_Raw : Boolean := False) is record case As_Raw is when True => Raw : Data_Array (0 .. 7) := (others => 0); when False => Command : Unsigned_3; Index : Unsigned_16; Subindex : Unsigned_8; Code : Unsigned_32; end case; end record with Unchecked_Union, Size => 64, Bit_Order => System.Low_Order_First; for Abort_Cmd use record Raw at 0 range 0 .. 63; Code at 0 range 32 .. 63; Subindex at 0 range 24 .. 31; Index at 0 range 8 .. 23; Command at 0 range 5 .. 7; end record; function Convert (Msg : Message) return Abort_Cmd is ((As_Raw => True, Raw => Msg.Data)); function Create (Index : Entry_Index; Code : Abort_Code_Type) return Abort_Cmd; function Code (Cmd : Abort_Cmd) return Abort_Code_Type is (Abort_Code_Type (Unsigned_32' (Swap_Bus (Cmd.Code)))); type Upload_Initiate_Cmd (As_Raw : Boolean := False) is record case As_Raw is when True => Raw : Data_Array (0 .. 7) := (others => 0); when False => Command : Unsigned_3; Index : Unsigned_16; Subindex : Unsigned_8; end case; end record with Unchecked_Union, Size => 64, Bit_Order => System.Low_Order_First; for Upload_Initiate_Cmd use record Raw at 0 range 0 .. 63; Subindex at 0 range 24 .. 31; Index at 0 range 8 .. 23; Command at 0 range 5 .. 7; end record; function Convert (Msg : Message) return Upload_Initiate_Cmd is ((As_Raw => True, Raw => Msg.Data)); function Create (Index : Entry_Index) return Upload_Initiate_Cmd; type Upload_Initiate_Resp (As_Raw : Boolean := False) is record case As_Raw is when True => Raw : Data_Array (0 .. 7); when False => Command : Unsigned_3; Nof_No_Data : Unsigned_2; Is_Expedited : Boolean; Is_Size_Indicated : Boolean; Index : Unsigned_16; Subindex : Unsigned_8; Data : Data_Array (0 .. 3); end case; end record with Unchecked_Union, Size => 64, Bit_Order => System.Low_Order_First; for Upload_Initiate_Resp use record Raw at 0 range 0 .. 63; Data at 0 range 32 .. 63; Subindex at 0 range 24 .. 31; Index at 0 range 8 .. 23; Command at 0 range 5 .. 7; Nof_No_Data at 0 range 2 .. 3; Is_Expedited at 0 range 1 .. 1; Is_Size_Indicated at 0 range 0 .. 0; end record; function Get_Data_Size (Cmd : Upload_Initiate_Resp) return Natural is (if Cmd.Is_Expedited then 4 - Natural (Cmd.Nof_No_Data) else Natural (Swap_Bus (Octets_4 (Cmd.Data)))); function Convert (Msg : Message) return Upload_Initiate_Resp is ((As_Raw => True, Raw => Msg.Data)); function Create (Index : Entry_Index; Data : Data_Array) return Upload_Initiate_Resp with Pre => Data'Length <= Expedited_Data'Length; function Create (Index : Entry_Index; Size : Natural) return Upload_Initiate_Resp; type Upload_Segment_Cmd (As_Raw : Boolean := False) is record case As_Raw is when True => Raw : Data_Array (0 .. 7) := (others => 0); when False => Command : Unsigned_3; Toggle : Boolean; end case; end record with Unchecked_Union, Size => 64, Bit_Order => System.Low_Order_First; for Upload_Segment_Cmd use record Raw at 0 range 0 .. 63; Command at 0 range 5 .. 7; Toggle at 0 range 4 .. 4; end record; function Convert (Msg : Message) return Upload_Segment_Cmd is ((As_Raw => True, Raw => Msg.Data)); function Create (Toggle : Boolean) return Upload_Segment_Cmd; type Upload_Segment_Resp (As_Raw : Boolean := False) is record case As_Raw is when True => Raw : Data_Array (0 .. 7); when False => Command : Unsigned_3; Toggle : Boolean; Nof_No_Data : Unsigned_3; Is_Complete : Boolean; Data : Segment_Data; end case; end record with Unchecked_Union, Size => 64, Bit_Order => System.Low_Order_First; for Upload_Segment_Resp use record Raw at 0 range 0 .. 63; Data at 0 range 8 .. 63; Command at 0 range 5 .. 7; Toggle at 0 range 4 .. 4; Nof_No_Data at 0 range 1 .. 3; Is_Complete at 0 range 0 .. 0; end record; function Convert (Msg : Message) return Upload_Segment_Resp is ((As_Raw => True, Raw => Msg.Data)); function Create (Toggle : Boolean; Is_Complete : Boolean; Data : Data_Array) return Upload_Segment_Resp with Pre => Data'Length <= Segment_Data'Length; end ACO.SDO_Commands;
-- Copyright (C) 2019 Thierry Rascle <thierr26@free.fr> -- MIT license. Please refer to the LICENSE file. with Ada.Tags; use Ada.Tags; with Apsepp.Test_Event_Class; use Apsepp.Test_Event_Class; package Apsepp.Test_Reporter_Data_Struct_Class is type Event_Count is new Natural; subtype Event_Index is Event_Count range 1 .. Event_Count'Last; type Test_Reporter_Data_Interfa is limited interface; type Test_Reporter_Data_Proc is access procedure (Data : Test_Reporter_Data_Interfa'Class); not overriding function Is_Empty (Obj : Test_Reporter_Data_Interfa) return Boolean is abstract; not overriding procedure Reset (Obj : in out Test_Reporter_Data_Interfa) is abstract with Post'Class => Obj.Is_Empty; not overriding function Is_Active (Obj : Test_Reporter_Data_Interfa; Node_Tag : Tag) return Boolean is abstract; not overriding procedure Include_Node (Obj : in out Test_Reporter_Data_Interfa; Node_Lineage : Tag_Array) is abstract with Pre'Class => (for all T of Node_Lineage => T /= No_Tag), Post'Class => not Obj.Is_Empty; -- TODOC: A new event (copy of Event) is allocated by Add_Event. Event -- should be cleaned up after the Add_Event call. not overriding procedure Add_Event (Obj : in out Test_Reporter_Data_Interfa; Node_Tag : Tag; Event : Test_Event_Base'Class) is abstract with Post'Class => not Obj.Is_Empty; end Apsepp.Test_Reporter_Data_Struct_Class;
------------------------------------------------------------------------------ -- -- -- GNAT SYSTEM UTILITIES -- -- -- -- G N A T P S Y S -- -- -- -- B o d y -- -- -- -- $Revision$ -- -- -- Copyright (C) 1997 Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- Program to print out listing of System package with all constants -- appearing explicitly. with Ada.Text_IO; with System; use System; with Gnatvsn; procedure GnatPsys is pragma Ident (Gnatvsn.Gnat_Version_String); procedure P (Item : String) renames Ada.Text_IO.Put_Line; begin P ("package System is"); P ("pragma Pure (System);"); P (""); P (" type Name is (SYSTEM_NAME_GNAT);"); P (" System_Name : constant Name := SYSTEM_NAME_GNAT;"); P (""); P (" -- System-Dependent Named Numbers"); P (""); P (" Min_Int : constant := -(2 **" & Long_Long_Integer'Image (Long_Long_Integer'Size - 1) & ");"); P (" Max_Int : constant := 2 **" & Long_Long_Integer'Image (Long_Long_Integer'Size - 1) & " - 1;"); P (""); P (" Max_Binary_Modulus : constant := 2 **" & Long_Long_Integer'Image (Long_Long_Integer'Size) & ";"); P (" Max_Nonbinary_Modulus : constant :=" & Integer'Image (Integer'Last) & ";"); P (""); P (" Max_Base_Digits : constant :=" & Natural'Image (Long_Long_Float'Digits) & ";"); P (" Max_Digits : constant :=" & Natural'Image (Long_Long_Float'Digits) & ";"); P (""); P (" Max_Mantissa : constant := 63;"); P (" Fine_Delta : constant := 2.0 ** (-Max_Mantissa);"); P (""); P (" Tick : constant :=" & Duration'Image (Duration (Standard'Tick)) & ";"); P (""); P (" -- Storage-related Declarations"); P (""); P (" type Address is private;"); P (" Null_Address : constant Address;"); P (""); P (" Storage_Unit : constant :=" & Natural'Image (Standard'Storage_Unit) & ";"); P (" Word_Size : constant :=" & Natural'Image (Standard'Word_Size) & ";"); P (" Memory_Size : constant := 2 **" & Natural'Image (Standard'Address_Size) & ";"); P (""); P (" -- Address comparison"); P (""); P (" function ""<"" (Left, Right : Address) return Boolean;"); P (" function ""<="" (Left, Right : Address) return Boolean;"); P (" function "">"" (Left, Right : Address) return Boolean;"); P (" function "">="" (Left, Right : Address) return Boolean;"); P (" function ""="" (Left, Right : Address) return Boolean;"); P (""); P (" pragma Import (Intrinsic, ""<""); "); P (" pragma Import (Intrinsic, ""<="");"); P (" pragma Import (Intrinsic, "">""); "); P (" pragma Import (Intrinsic, "">="");"); P (" pragma Import (Intrinsic, ""=""); "); P (""); P (" -- Other System-Dependent Declarations"); P (""); P (" type Bit_Order is (High_Order_First, Low_Order_First);"); P (" Default_Bit_Order : constant Bit_Order;"); P (""); P (" -- Priority-related Declarations (RM D.1)"); P (""); P (" subtype Any_Priority is Integer range 0 .." & Natural'Image (Standard'Max_Interrupt_Priority) & ";"); P (""); P (" subtype Priority is Any_Priority range 0 .." & Natural'Image (Standard'Max_Priority) & ";"); P (""); P (" subtype Interrupt_Priority is Any_Priority range" & Natural'Image (Standard'Max_Priority + 1) & " .." & Natural'Image (Standard'Max_Interrupt_Priority) & ";"); P (""); P (" Default_Priority : constant Priority :=" & Natural'Image ((Priority'First + Priority'Last) / 2) & ";"); P (""); P ("private"); P (""); P (" type Address is mod Memory_Size; "); P (" Null_Address : constant Address := 0; "); P (" "); P (" Default_Bit_Order : constant Bit_Order := " & Bit_Order'Image (Bit_Order'Val (Standard'Default_Bit_Order)) & ";"); P (""); P ("end System;"); end GnatPsys;
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2012, Vadim Godunko <vgodunko@gmail.com> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This package provides interface types and registry for internal factories. -- Every module should provide implementation of the interface type -- Abstract_Module_Factory and one or more implementations of the interface -- type Abstract_Metamodel_Factory to allow AMF to create elements and convert -- data types. ------------------------------------------------------------------------------ with League.Strings; with AMF.CMOF.Packages.Collections; with AMF.Elements; with AMF.Factories; package AMF.Internals.Factories is pragma Preelaborate; ---------------------------- -- Metamodel_Factory_Base -- ---------------------------- type Metamodel_Factory_Base is abstract limited new AMF.Factories.Factory with record Extent : AMF_Extent; end record; ----------------------------- -- Abstract_Module_Factory -- ----------------------------- type Abstract_Module_Factory is limited interface; type Module_Factory_Access is access all Abstract_Module_Factory'Class; not overriding function To_Element (Self : not null access constant Abstract_Module_Factory; Element : AMF.Internals.AMF_Element) return AMF.Elements.Element_Access is abstract; -- Converts internal element's identifier into element object. not overriding procedure Connect_Extent (Self : not null access constant Abstract_Module_Factory; Element : AMF.Internals.AMF_Element; Extent : AMF.Internals.AMF_Extent) is abstract; -- Connects element with extent. not overriding procedure Connect_Link_End (Self : not null access constant Abstract_Module_Factory; Element : AMF.Internals.AMF_Element; Property : AMF.Internals.CMOF_Element; Link : AMF.Internals.AMF_Link; Other : AMF.Internals.AMF_Element) is abstract; -- Connects link end with specified element:property. not overriding procedure Synchronize_Link_Set (Self : not null access constant Abstract_Module_Factory; Element : AMF.Internals.AMF_Element; Property : AMF.Internals.CMOF_Element; Link : AMF.Internals.AMF_Link) is null; -- Creates required additional links to construct set of links. type Factory_Constructor is access function (Extent : AMF_Extent) return not null AMF.Factories.Factory_Access; procedure Register (The_Package : not null AMF.CMOF.Packages.CMOF_Package_Access; Constructor : not null Factory_Constructor); -- Registers metamodel factory. procedure Register (Factory : not null Module_Factory_Access; Module : out AMF_Metamodel); -- Registers module factory. function Create_Factory (URI : League.Strings.Universal_String; Extent : AMF_Extent) return AMF.Factories.Factory_Access; -- Creates factory for the metamodel specified by URI and returns it. -- Returns null when metamodel is not registered. function Get_Factory (Metamodel : AMF.Internals.AMF_Metamodel) return Module_Factory_Access; -- Returns factory for the metamodel. function Get_Packages return AMF.CMOF.Packages.Collections.Set_Of_CMOF_Package; -- Returns packages for all registered factories. end AMF.Internals.Factories;
-- Copyright (c) 2019 Maxim Reznik <reznikmm@gmail.com> -- -- SPDX-License-Identifier: MIT -- License-Filename: LICENSE ------------------------------------------------------------- with Ada.Wide_Wide_Text_IO; with Slim.Menu_Commands.Play_File_Commands; package body Slim.Menu_Models.Play_Lists is function Create_Play_Command (Self : Play_List_Menu_Model'Class; Path : Menu_Path; Skip : Natural := 0) return Slim.Menu_Commands.Menu_Command_Access; ------------- -- Collect -- ------------- procedure Collect (Self : Play_List_Menu_Model'Class; Path_List : in out League.String_Vectors.Universal_String_Vector; Title_List : in out League.String_Vectors.Universal_String_Vector) is use type League.Strings.Universal_String; begin for J in 1 .. Self.Items.Last_Index loop declare Item : constant Play_List_Item := Self.Items (J); begin Path_List.Append (Self.Path & Item.URI); Title_List.Append (Item.Label); end; end loop; end Collect; ------------------------- -- Create_Play_Command -- ------------------------- function Create_Play_Command (Self : Play_List_Menu_Model'Class; Path : Menu_Path; Skip : Natural := 0) return Slim.Menu_Commands.Menu_Command_Access is use type League.Strings.Universal_String; use Slim.Menu_Commands.Play_File_Commands; Result : constant Play_File_Command_Access := new Play_File_Command (Self.Player); begin Result.Root := Self.Root; Result.M3U_Name := Self.M3U; Result.Start := Path.List (1); Result.Skip := Skip; for J in 1 .. Self.Items.Last_Index loop declare Item : constant Play_List_Item := Self.Items (J); begin Result.Relative_Path_List.Append (Self.Path & Item.URI); Result.Title_List.Append (Item.Label); end; end loop; return Slim.Menu_Commands.Menu_Command_Access (Result); end Create_Play_Command; ------------------- -- Enter_Command -- ------------------- overriding function Enter_Command (Self : Play_List_Menu_Model; Path : Menu_Path) return Slim.Menu_Commands.Menu_Command_Access is begin return Self.Create_Play_Command (Path); end Enter_Command; ---------------- -- Initialize -- ---------------- procedure Initialize (Self : in out Play_List_Menu_Model'Class; Label : League.Strings.Universal_String; Root : League.Strings.Universal_String; File : League.Strings.Universal_String) is Name : constant String := File.To_UTF_8_String; Input : Ada.Wide_Wide_Text_IO.File_Type; Next : League.Strings.Universal_String; begin Self.Label := Label; Self.M3U := File; Self.Root := Root; Self.Path := File.Tail_From (Root.Length + 1); Self.Path := Self.Path.Head (Self.Path.Last_Index ('/')); Ada.Wide_Wide_Text_IO.Open (Input, Ada.Wide_Wide_Text_IO.In_File, Name); while not Ada.Wide_Wide_Text_IO.End_Of_File (Input) loop declare Line : constant League.Strings.Universal_String := League.Strings.To_Universal_String (Ada.Wide_Wide_Text_IO.Get_Line (Input)); begin if Line.Starts_With ("#EXTINF:") then declare List : constant League.String_Vectors.Universal_String_Vector := Line.Split (','); begin if List.Length > 1 then Next := List.Element (2); end if; end; elsif Line.Is_Empty or else Line.Starts_With ("#") then null; -- Skip other tags else if Next.Is_Empty then Next := Line; end if; Self.Items.Append ((URI => Line, Label => Next)); Next.Clear; end if; end; end loop; Ada.Wide_Wide_Text_IO.Close (Input); end Initialize; ---------------- -- Item_Count -- ---------------- overriding function Item_Count (Self : Play_List_Menu_Model; Path : Slim.Menu_Models.Menu_Path) return Natural is begin if Path.Length = 0 then return Self.Items.Last_Index; else return 0; -- No nested items in a play list end if; end Item_Count; ----------- -- Label -- ----------- overriding function Label (Self : Play_List_Menu_Model; Path : Slim.Menu_Models.Menu_Path) return League.Strings.Universal_String is begin if Path.Length = 0 then return Self.Label; else return Self.Items (Path.List (1)).Label; end if; end Label; ------------------ -- Play_Command -- ------------------ overriding function Play_Command (Self : Play_List_Menu_Model; Path : Menu_Path) return Slim.Menu_Commands.Menu_Command_Access is Index : Positive; Skip : Natural; begin if Path.Length = 0 then Self.Player.Get_Position (Self.M3U, Index, Skip); -- Try to continue from saved prosition return Self.Create_Play_Command ((Length => 1, List => (1 => Index)), Skip); else return Self.Create_Play_Command (Path); end if; end Play_Command; end Slim.Menu_Models.Play_Lists;
with MSP430_SVD; use MSP430_SVD; with MSPGD.Clock.Source; generic Speed: UInt32; with package Clock is new MSPGD.Clock.Source (<>); package MSPGD.UART.Peripheral is pragma Preelaborate; procedure Init; procedure Transmit (Data : Byte); function Receive return Byte; function Data_Available return Boolean; end MSPGD.UART.Peripheral;
-- part of AdaYaml, (c) 2017 Felix Krause -- released under the terms of the MIT license, see the file "copying.txt" with Ada.Containers.Hashed_Maps; with System.Address_To_Access_Conversions; with System.Storage_Elements; with Yaml.Dom.Node; with Yaml.Events.Queue.Stream; with Yaml.Presenter; package body Yaml.Dom.Dumping is package Conversions is new System.Address_To_Access_Conversions (Node.Instance); function Hash (Value : System.Storage_Elements.Integer_Address) return Ada.Containers.Hash_Type is (Ada.Containers.Hash_Type'Mod (System.Storage_Elements.Integer_Address'Pos (Value))); package Address_Maps is new Ada.Containers.Hashed_Maps (System.Storage_Elements.Integer_Address, Events.Queue.Mark, Hash, System.Storage_Elements."=", Events.Queue."="); procedure Dump_One (Document : Document_Reference; Queue : not null access Events.Queue.Instance) is Event_Map : Address_Maps.Map; Anchor_Index : Natural := 0; function To_Anchor (Index : Natural) return String is ((if Index < 26 then "" else To_Anchor (Index / 26)) & Character'Val (Character'Pos ('a') + Index mod 26)); procedure Visit_Pairs (Key, Value : not null access Node.Instance); procedure Visit (Cur : not null access Node.Instance) is Image : constant System.Storage_Elements.Integer_Address := System.Storage_Elements.To_Integer (Conversions.To_Address (Cur.all'Unrestricted_Access)); Position : constant Address_Maps.Cursor := Event_Map.Find (Image); New_Position : Events.Queue.Mark; begin if Address_Maps.Has_Element (Position) then declare Accessor : constant Events.Queue.Element_Accessor := Queue.Element (Address_Maps.Element (Position)); function Get_Anchor (Props : in out Properties) return Text.Reference is begin if Props.Anchor.Length = 0 then Props.Anchor := Document.Data.Pool.From_String (To_Anchor (Anchor_Index)); Anchor_Index := Anchor_Index + 1; end if; return Props.Anchor; end Get_Anchor; Element_Anchor : constant Text.Reference := (if Accessor.Kind = Scalar then Get_Anchor (Accessor.Scalar_Properties) else Get_Anchor (Accessor.Collection_Properties)); begin Queue.Append ((Kind => Alias, Target => Element_Anchor, Start_Position => <>, End_Position => <>)); end; return; end if; case Cur.Kind is when Scalar => Queue.Append ((Kind => Scalar, Scalar_Properties => (Tag => Cur.Tag, Anchor => <>), Content => Cur.Content, Start_Position => <>, End_Position => <>, Scalar_Style => Cur.Scalar_Style), New_Position); Event_Map.Insert (Image, New_Position); when Mapping => Queue.Append ((Kind => Mapping_Start, Collection_Properties => (Tag => Cur.Tag, Anchor => <>), Collection_Style => Cur.Mapping_Style, Start_Position => <>, End_Position => <>), New_Position); Event_Map.Insert (Image, New_Position); Cur.Pairs.Iterate (Visit_Pairs'Access); Queue.Append ((Kind => Mapping_End, Start_Position => <>, End_Position => <>)); when Sequence => Queue.Append ((Kind => Sequence_Start, Collection_Properties => (Tag => Cur.Tag, Anchor => <>), Collection_Style => Cur.Sequence_Style, Start_Position => <>, End_Position => <>), New_Position); Event_Map.Insert (Image, New_Position); Cur.Items.Iterate (Visit'Access); Queue.Append ((Kind => Sequence_End, Start_Position => <>, End_Position => <>)); end case; end Visit; procedure Visit_Pairs (Key, Value : not null access Node.Instance) is begin Visit (Key); Visit (Value); end Visit_Pairs; begin Queue.Append ((Kind => Document_Start, Implicit_Start => Document.Data.Implicit_Start, others => <>)); Visit (Document.Data.Root_Node); Queue.Append ((Kind => Document_End, Implicit_End => Document.Data.Implicit_End, others => <>)); end Dump_One; function To_Event_Queue (Document : Document_Reference) return Events.Queue.Reference is begin return Ret : constant Events.Queue.Reference := Events.Queue.New_Queue do declare Queue : constant not null access Events.Queue.Instance := Events.Queue.Value (Ret).Data; begin Queue.Append ((Kind => Stream_Start, others => <>)); Dump_One (Document, Queue); Queue.Append ((Kind => Stream_End, others => <>)); end; end return; end To_Event_Queue; function To_Event_Queue (Documents : Vectors.Vector) return Events.Queue.Reference is begin return Ret : constant Events.Queue.Reference := Events.Queue.New_Queue do declare Queue : constant not null access Events.Queue.Instance := Events.Queue.Value (Ret).Data; begin Queue.Append ((Kind => Stream_Start, others => <>)); for Document of Documents loop Dump_One (Document, Queue); end loop; Queue.Append ((Kind => Stream_End, others => <>)); end; end return; end To_Event_Queue; procedure Consume_Queue is new Presenter.Consume (Events.Queue.Stream); procedure Dump (Document : Document_Reference; Output : not null Destination.Pointer) is Queue : constant Events.Queue.Reference := To_Event_Queue (Document); Writer : Presenter.Instance; begin Writer.Set_Output (Output); Consume_Queue (Writer, Queue.As_Stream.Value); end Dump; procedure Dump (Documents : Vectors.Vector; Output : not null Destination.Pointer) is Queue : constant Events.Queue.Reference := To_Event_Queue (Documents); Writer : Presenter.Instance; begin Writer.Set_Output (Output); Consume_Queue (Writer, Queue.As_Stream.Value); end Dump; end Yaml.Dom.Dumping;
----------------------------------------------------------------------- -- Util.Files -- Various File Utility Packages -- Copyright (C) 2001, 2002, 2003, 2009, 2010, 2011, 2012 Stephane Carrez -- Written by Stephane Carrez (Stephane.Carrez@gmail.com) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Ada.Strings.Unbounded; with Util.Strings.Maps; package Util.Files is use Ada.Strings.Unbounded; subtype Direction is Ada.Strings.Direction; -- Read a complete file into a string. -- The <b>Max_Size</b> parameter indicates the maximum size that is read. procedure Read_File (Path : in String; Into : out Unbounded_String; Max_Size : in Natural := 0); -- Read the file with the given path, one line at a time and execute the <b>Process</b> -- procedure with each line as argument. procedure Read_File (Path : in String; Process : not null access procedure (Line : in String)); -- Save the string into a file creating the file if necessary procedure Write_File (Path : in String; Content : in String); -- Save the string into a file creating the file if necessary procedure Write_File (Path : in String; Content : in Unbounded_String); -- Iterate over the search directories defined in <b>Path</b> and execute -- <b>Process</b> with each directory until it returns <b>True</b> in <b>Done</b> -- or the last search directory is found. Each search directory -- is separated by ';' (yes, even on Unix). When <b>Going</b> is set to Backward, the -- directories are searched in reverse order. procedure Iterate_Path (Path : in String; Process : not null access procedure (Dir : in String; Done : out Boolean); Going : in Direction := Ada.Strings.Forward); -- Iterate over the search directories defined in <b>Path</b> and search -- for files matching the pattern defined by <b>Pattern</b>. For each file, -- execute <b>Process</b> with the file basename and the full file path. -- Stop iterating when the <b>Process</b> procedure returns True. -- Each search directory is separated by ';'. When <b>Going</b> is set to Backward, the -- directories are searched in reverse order. procedure Iterate_Files_Path (Pattern : in String; Path : in String; Process : not null access procedure (Name : in String; File : in String; Done : out Boolean); Going : in Direction := Ada.Strings.Forward); -- Find the file in one of the search directories. Each search directory -- is separated by ';' (yes, even on Unix). -- Returns the path to be used for reading the file. function Find_File_Path (Name : String; Paths : String) return String; -- Find the files which match the pattern in the directories specified in the -- search path <b>Path</b>. Each search directory is separated by ';'. -- File names are added to the string set in <b>Into</b>. procedure Find_Files_Path (Pattern : in String; Path : in String; Into : in out Util.Strings.Maps.Map); -- Returns the name of the external file with the specified directory -- and the name. Unlike the Ada.Directories.Compose, the name can represent -- a relative path and thus include directory separators. function Compose (Directory : in String; Name : in String) return String; -- Compose an existing path by adding the specified name to each path component -- and return a new paths having only existing directories. Each directory is -- separated by ';'. -- If the composed path exists, it is added to the result path. -- Example: -- paths = 'web;regtests' name = 'info' -- result = 'web/info;regtests/info' -- Returns the composed path. function Compose_Path (Paths : in String; Name : in String) return String; -- Returns a relative path whose origin is defined by <b>From</b> and which refers -- to the absolute path referenced by <b>To</b>. Both <b>From</b> and <b>To</b> are -- assumed to be absolute pathes. Returns the absolute path <b>To</b> if the relative -- path could not be found. Both paths must have at least one root component in common. function Get_Relative_Path (From : in String; To : in String) return String; end Util.Files;
with Ada.Text_IO; use Ada.Text_IO; procedure Test is function F(X: Integer) return Integer is begin Put('F'); return X; end; begin for I in F(1) .. F(10) loop Put('A'); end loop; New_Line; for I in F(10) .. F(1) loop Put('B'); end loop; New_Line; for I in reverse F(1) .. F(10) loop Put('C'); end loop; New_Line; for I in reverse F(10) .. F(1) loop Put('D'); end loop; New_Line; end; -- Local Variables: -- compile-command: "gnatmake for2.adb && ./for2" -- End:
-- This file is covered by the Internet Software Consortium (ISC) License -- Reference: ../../License.txt with AdaBase.Connection.Base.MySQL; with AdaBase.Bindings.MySQL; with Ada.Containers.Vectors; package AdaBase.Statement.Base.MySQL is package ACM renames AdaBase.Connection.Base.MySQL; package ABM renames AdaBase.Bindings.MySQL; package AC renames Ada.Containers; type MySQL_statement (type_of_statement : Stmt_Type; log_handler : ALF.LogFacility_access; mysql_conn : ACM.MySQL_Connection_Access; initial_sql : SQL_Access; con_error_mode : Error_Modes; con_case_mode : Case_Modes; con_max_blob : BLOB_Maximum; con_buffered : Boolean) is new Base_Statement and AIS.iStatement with private; type MySQL_statement_access is access all MySQL_statement; overriding function column_count (Stmt : MySQL_statement) return Natural; overriding function last_insert_id (Stmt : MySQL_statement) return Trax_ID; overriding function last_sql_state (Stmt : MySQL_statement) return SQL_State; overriding function last_driver_code (Stmt : MySQL_statement) return Driver_Codes; overriding function last_driver_message (Stmt : MySQL_statement) return String; overriding procedure discard_rest (Stmt : out MySQL_statement); overriding function execute (Stmt : out MySQL_statement) return Boolean; overriding function execute (Stmt : out MySQL_statement; parameters : String; delimiter : Character := '|') return Boolean; overriding function rows_returned (Stmt : MySQL_statement) return Affected_Rows; overriding function column_name (Stmt : MySQL_statement; index : Positive) return String; overriding function column_table (Stmt : MySQL_statement; index : Positive) return String; overriding function column_native_type (Stmt : MySQL_statement; index : Positive) return field_types; overriding function fetch_next (Stmt : out MySQL_statement) return ARS.Datarow; overriding function fetch_all (Stmt : out MySQL_statement) return ARS.Datarow_Set; overriding function fetch_bound (Stmt : out MySQL_statement) return Boolean; overriding procedure fetch_next_set (Stmt : out MySQL_statement; data_present : out Boolean; data_fetched : out Boolean); private type mysql_canvas; procedure initialize (Object : in out MySQL_statement); procedure Adjust (Object : in out MySQL_statement); procedure finalize (Object : in out MySQL_statement); procedure internal_post_prep_stmt (Stmt : out MySQL_statement); procedure internal_direct_post_exec (Stmt : out MySQL_statement; newset : Boolean := False); procedure process_direct_result (Stmt : out MySQL_statement); procedure scan_column_information (Stmt : out MySQL_statement); procedure clear_column_information (Stmt : out MySQL_statement); procedure construct_bind_slot (Stmt : MySQL_statement; struct : out ABM.MYSQL_BIND; canvas : out mysql_canvas; marker : Positive); function internal_fetch_bound (Stmt : out MySQL_statement) return Boolean; function internal_fetch_row (Stmt : out MySQL_statement) return ARS.Datarow; function internal_ps_fetch_row (Stmt : out MySQL_statement) return ARS.Datarow; function internal_ps_fetch_bound (Stmt : out MySQL_statement) return Boolean; function convert_to_bitstring (nv : String; width : Natural) return String; function num_set_items (nv : String) return Natural; function bincopy (data : ABM.ICS.char_array_access; datalen, max_size : Natural) return String; function bincopy (data : ABM.ICS.char_array_access; datalen, max_size : Natural; hard_limit : Natural := 0) return AR.Chain; procedure log_problem (statement : MySQL_statement; category : Log_Category; message : String; pull_codes : Boolean := False; break : Boolean := False); type column_info is record table : CT.Text; field_name : CT.Text; field_type : field_types; field_size : Natural; null_possible : Boolean; mysql_type : ABM.enum_field_types; end record; type fetch_status is (pending, progressing, completed); package VColumns is new AC.Vectors (Index_Type => Positive, Element_Type => column_info); -- mysql_canvas is used by prepared statement execution -- The Ada types are converted to C types and stored in this record which -- MySQL finds through pointers. type mysql_canvas is record length : aliased ABM.IC.unsigned_long := 0; is_null : aliased ABM.my_bool := 0; error : aliased ABM.my_bool := 0; buffer_uint8 : ABM.IC.unsigned_char := 0; buffer_uint16 : ABM.IC.unsigned_short := 0; buffer_uint32 : ABM.IC.unsigned := 0; buffer_uint64 : ABM.IC.unsigned_long := 0; buffer_int8 : ABM.IC.signed_char := 0; buffer_int16 : ABM.IC.short := 0; buffer_int32 : ABM.IC.int := 0; buffer_int64 : ABM.IC.long := 0; buffer_float : ABM.IC.C_float := 0.0; buffer_double : ABM.IC.double := 0.0; buffer_binary : ABM.ICS.char_array_access := null; buffer_time : ABM.MYSQL_TIME; end record; type mysql_canvases is array (Positive range <>) of aliased mysql_canvas; type mysql_canvases_Access is access all mysql_canvases; procedure free_canvas is new Ada.Unchecked_Deallocation (mysql_canvases, mysql_canvases_Access); procedure free_binary is new Ada.Unchecked_Deallocation (ABM.IC.char_array, ABM.ICS.char_array_access); procedure reclaim_canvas (Stmt : out MySQL_statement); type MySQL_statement (type_of_statement : Stmt_Type; log_handler : ALF.LogFacility_access; mysql_conn : ACM.MySQL_Connection_Access; initial_sql : SQL_Access; con_error_mode : Error_Modes; con_case_mode : Case_Modes; con_max_blob : BLOB_Maximum; con_buffered : Boolean) is new Base_Statement and AIS.iStatement with record delivery : fetch_status := completed; result_handle : ABM.MYSQL_RES_Access := null; stmt_handle : ABM.MYSQL_STMT_Access := null; bind_canvas : mysql_canvases_Access := null; assign_counter : Natural := 0; num_columns : Natural := 0; size_of_rowset : Trax_ID := 0; column_info : VColumns.Vector; sql_final : SQL_Access; end record; end AdaBase.Statement.Base.MySQL;
with Ada.Directories; with Ada.Strings.Unbounded; with Iictl; with Posix; with Util; package Srv_Conn is -- TODO rename Server_Reconnection or something? procedure Reconnect_Servers (Irc_Dir : in String; Nick : in String); procedure Maintain_Connection (Dir_Ent : in Ada.Directories.Directory_Entry_Type; Nick : in String); procedure Spawn_Client (Srv_Name : in String; Nick : in String); procedure Respawn_Clients (Server_List : Util.Unbounded_String_Vector; Process_List : Util.Unbounded_String_Vector); procedure Reap_Defunct_Procs; function Is_Srv_Dir (Dir_Ent : in Ada.Directories.Directory_Entry_Type) return Boolean; -- TODO use private? function Scan_Server_Directory (Irc_Dir : in String) return Util.Unbounded_String_Vector; function Scan_Ii_Procs return Util.Unbounded_String_Vector; -- TODO sort function Is_Ii_Proc (Dir_Ent : in Ada.Directories.Directory_Entry_Type) return Boolean; function Get_Server_Name (Dir_Ent : in Ada.Directories.Directory_Entry_Type) return Ada.Strings.Unbounded.Unbounded_String; end Srv_Conn;
----------------------------------------------------------------------- -- bbox -- Bbox API -- Copyright (C) 2017 Stephane Carrez -- Written by Stephane Carrez (Stephane.Carrez@gmail.com) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Ada.Strings.Unbounded; with Ada.Calendar; with Util.Properties; with Util.Http.Clients; package Bbox.API is type Client_Type is tagged limited private; -- Set the server IP address. procedure Set_Server (Client : in out Client_Type; Server : in String); -- Login to the server Bbox API with the password. procedure Login (Client : in out Client_Type; Password : in String); -- Execute a GET operation on the Bbox API to retrieve the result into the property list. procedure Get (Client : in out Client_Type; Operation : in String; Result : in out Util.Properties.Manager); -- Execute a PUT operation on the Bbox API to change some parameter. procedure Put (Client : in out Client_Type; Operation : in String; Params : in String); -- Execute a POST operation on the Bbox API to change some parameter. procedure Post (Client : in out Client_Type; Operation : in String; Params : in String); -- Execute a GET operation on the Bbox API to retrieve the JSON result and return it. function Get (Client : in out Client_Type; Operation : in String) return String; -- Iterate over a JSON array flattened in the properties. procedure Iterate (Props : in Util.Properties.Manager; Name : in String; Process : access procedure (P : in Util.Properties.Manager; Base : in String)); private -- Internal operation to get the URI based on the operation being called. function Get_URI (Client : in Client_Type; Operation : in String) return String; type Client_Type is tagged limited record Password : Ada.Strings.Unbounded.Unbounded_String; Server : Ada.Strings.Unbounded.Unbounded_String; Auth : Ada.Strings.Unbounded.Unbounded_String; Is_Logged : Boolean := False; Http : Util.Http.Clients.Client; Token : Ada.Strings.Unbounded.Unbounded_String; Expires : Ada.Calendar.Time; end record; procedure Refresh_Token (Client : in out Client_Type); end Bbox.API;
------------------------------------------------------------------------------ -- -- -- GNAT RUNTIME COMPONENTS -- -- -- -- A D A . T A G S -- -- -- -- S p e c -- -- -- -- $Revision: 2 $ -- -- -- -- Copyright (c) 1992,1993,1994 NYU, All Rights Reserved -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. -- -- -- ------------------------------------------------------------------------------ with System; with System.Storage_Elements; package Ada.Tags is type Tag is private; function Expanded_Name (T : Tag) return String; function External_Tag (T : Tag) return String; function Internal_Tag (External : String) return Tag; Tag_Error : exception; private -- DT stands for Dispatch Table procedure Set_Prim_Op_Address (DTptr : Tag; Position : Positive; Value : System.Address); -- Given a pointer to a dispatch Table (DTptr) and a position in the -- dispatch Table put the address of the virtual function in it (used for -- overriding) function Get_Prim_Op_Address (DTptr : Tag; Position : Positive) return System.Address; -- Given a pointer to a dispatch Table (DTptr) and a position in the DT -- this function returns the address of the virtual function stored in it -- (used for dispatching calls) procedure Set_Inheritance_Depth (DTptr : Tag; Value : Natural); -- Given a pointer to a dispatch Table, stores the value representing the -- depth in the inheritance tree. (used during elaboration of the tagged -- type) function Get_Inheritance_Depth (DTptr : Tag) return Natural; -- Given a pointer to a dispatch Table, retreives the value representing -- the depth in the inheritance tree. (used for membership) procedure Set_Ancestor_Tags (DTptr : Tag; Value : System.Address); -- Given a pointer to a dispatch Table, stores the address of a table -- containing the DTptrs of the ancestors (used during elaboration of the -- tagged type) function Get_Ancestor_Tags (DTptr : Tag) return System.Address; -- Given a pointer to a dispatch Table, retreives the address of a table -- containing the DTptrs of the ancestors (used for membership) function DT_Size (Entry_Count : Natural) return System.Storage_Elements.Storage_Count; -- give the size in 'storage_count' of the dispatch Table (used to create -- statically the dispatch Table) procedure Inherit_DT (Old_DTptr : Tag; New_DTptr : Tag; Entry_Count : Natural); -- the dispatch Table referenced by New_DTptr 'inherits' the Entry_Count -- first entries of the dispatch Table referenced by Old_DTptr (used when -- deriving and the root type is CPP_Class) function CW_Membership (Obj_Tag : Tag; Typ_Tag : Tag) return Boolean; -- Given the tag of an object and the tag associated to a type, return -- true if Obj is in Typ'Class. type Address_Array is array (Natural range <>) of System.Address; type Dispatch_Table; type Tag is access all Dispatch_Table; pragma Inline (Set_Prim_Op_Address); pragma Inline (Get_Prim_Op_Address); pragma Inline (Set_Inheritance_Depth); pragma Inline (Get_Inheritance_Depth); pragma Inline (Set_Ancestor_Tags); pragma Inline (Get_Ancestor_Tags); pragma Inline (DT_Size); pragma Inline (Inherit_DT); pragma Inline (CW_Membership); end Ada.Tags;
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Localization, Internationalization, Globalization for Ada -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2012-2015, Vadim Godunko <vgodunko@gmail.com> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ pragma Restrictions (No_Elaboration_Code); -- GNAT: enforce generation of preinitialized data section instead of -- generation of elaboration code. package Matreshka.Internals.Unicode.Ucd.Core_0111 is pragma Preelaborate; Group_0111 : aliased constant Core_Second_Stage := (16#00# .. 16#02# => -- 011100 .. 011102 (Nonspacing_Mark, Neutral, Extend, Extend, Extend, Combining_Mark, (Other_Alphabetic | Alphabetic | Case_Ignorable | Grapheme_Extend | ID_Continue | XID_Continue => True, others => False)), 16#27# .. 16#2B# => -- 011127 .. 01112B (Nonspacing_Mark, Neutral, Extend, Extend, Extend, Combining_Mark, (Other_Alphabetic | Alphabetic | Case_Ignorable | Grapheme_Extend | ID_Continue | XID_Continue => True, others => False)), 16#2C# => -- 01112C (Spacing_Mark, Neutral, Spacing_Mark, Extend, Extend, Combining_Mark, (Other_Alphabetic | Alphabetic | Grapheme_Base | ID_Continue | XID_Continue => True, others => False)), 16#2D# .. 16#32# => -- 01112D .. 011132 (Nonspacing_Mark, Neutral, Extend, Extend, Extend, Combining_Mark, (Other_Alphabetic | Alphabetic | Case_Ignorable | Grapheme_Extend | ID_Continue | XID_Continue => True, others => False)), 16#33# .. 16#34# => -- 011133 .. 011134 (Nonspacing_Mark, Neutral, Extend, Extend, Extend, Combining_Mark, (Diacritic | Case_Ignorable | Grapheme_Extend | Grapheme_Link | ID_Continue | XID_Continue => True, others => False)), 16#35# => -- 011135 (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#36# .. 16#3F# => -- 011136 .. 01113F (Decimal_Number, Neutral, Other, Numeric, Numeric, Numeric, (Grapheme_Base | ID_Continue | XID_Continue => True, others => False)), 16#40# => -- 011140 (Other_Punctuation, Neutral, Other, Other, Other, Break_After, (Grapheme_Base => True, others => False)), 16#41# .. 16#43# => -- 011141 .. 011143 (Other_Punctuation, Neutral, Other, Other, S_Term, Break_After, (STerm | Terminal_Punctuation | Grapheme_Base => True, others => False)), 16#44# .. 16#4F# => -- 011144 .. 01114F (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#73# => -- 011173 (Nonspacing_Mark, Neutral, Extend, Extend, Extend, Combining_Mark, (Diacritic | Case_Ignorable | Grapheme_Extend | ID_Continue | XID_Continue => True, others => False)), 16#74# => -- 011174 (Other_Punctuation, Neutral, Other, Other, Other, Alphabetic, (Grapheme_Base => True, others => False)), 16#75# => -- 011175 (Other_Punctuation, Neutral, Other, Other, Other, Break_Before, (Grapheme_Base => True, others => False)), 16#77# .. 16#7F# => -- 011177 .. 01117F (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#80# .. 16#81# => -- 011180 .. 011181 (Nonspacing_Mark, Neutral, Extend, Extend, Extend, Combining_Mark, (Other_Alphabetic | Alphabetic | Case_Ignorable | Grapheme_Extend | ID_Continue | XID_Continue => True, others => False)), 16#82# => -- 011182 (Spacing_Mark, Neutral, Spacing_Mark, Extend, Extend, Combining_Mark, (Other_Alphabetic | Alphabetic | Grapheme_Base | ID_Continue | XID_Continue => True, others => False)), 16#B3# .. 16#B5# => -- 0111B3 .. 0111B5 (Spacing_Mark, Neutral, Spacing_Mark, Extend, Extend, Combining_Mark, (Other_Alphabetic | Alphabetic | Grapheme_Base | ID_Continue | XID_Continue => True, others => False)), 16#B6# .. 16#BE# => -- 0111B6 .. 0111BE (Nonspacing_Mark, Neutral, Extend, Extend, Extend, Combining_Mark, (Other_Alphabetic | Alphabetic | Case_Ignorable | Grapheme_Extend | ID_Continue | XID_Continue => True, others => False)), 16#BF# => -- 0111BF (Spacing_Mark, Neutral, Spacing_Mark, Extend, Extend, Combining_Mark, (Other_Alphabetic | Alphabetic | Grapheme_Base | ID_Continue | XID_Continue => True, others => False)), 16#C0# => -- 0111C0 (Spacing_Mark, Neutral, Spacing_Mark, Extend, Extend, Combining_Mark, (Diacritic | Grapheme_Base | Grapheme_Link | ID_Continue | XID_Continue => True, others => False)), 16#C5# .. 16#C6# => -- 0111C5 .. 0111C6 (Other_Punctuation, Neutral, Other, Other, S_Term, Break_After, (STerm | Terminal_Punctuation | Grapheme_Base => True, others => False)), 16#C7# => -- 0111C7 (Other_Punctuation, Neutral, Other, Other, Other, Alphabetic, (Grapheme_Base => True, others => False)), 16#C8# => -- 0111C8 (Other_Punctuation, Neutral, Other, Other, Other, Break_After, (Grapheme_Base => True, others => False)), 16#C9# .. 16#CC# => -- 0111C9 .. 0111CC (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#CD# => -- 0111CD (Other_Punctuation, Neutral, Other, Other, S_Term, Alphabetic, (STerm | Terminal_Punctuation | Grapheme_Base => True, others => False)), 16#CE# .. 16#CF# => -- 0111CE .. 0111CF (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#D0# .. 16#D9# => -- 0111D0 .. 0111D9 (Decimal_Number, Neutral, Other, Numeric, Numeric, Numeric, (Grapheme_Base | ID_Continue | XID_Continue => True, others => False)), 16#DB# .. 16#E0# => -- 0111DB .. 0111E0 (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#E1# .. 16#F4# => -- 0111E1 .. 0111F4 (Other_Number, Neutral, Other, Other, Other, Alphabetic, (Grapheme_Base => True, others => False)), 16#F5# .. 16#FF# => -- 0111F5 .. 0111FF (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), others => (Other_Letter, Neutral, Other, A_Letter, O_Letter, Alphabetic, (Alphabetic | Grapheme_Base | ID_Continue | ID_Start | XID_Continue | XID_Start => True, others => False))); end Matreshka.Internals.Unicode.Ucd.Core_0111;
------------------------------------------------------------------------------ -- AGAR CORE LIBRARY -- -- A G A R . D S O -- -- S p e c -- ------------------------------------------------------------------------------ with Ada.Containers.Indefinite_Vectors; with Interfaces.C; with Interfaces.C.Strings; with Interfaces.C.Pointers; with System; -- -- Interface to dynamic linker facilities. -- package Agar.DSO is package C renames Interfaces.C; package CS renames Interfaces.C.Strings; type DSO is array (1 .. $SIZEOF_AG_DSO) of aliased Interfaces.Unsigned_8 with Convention => C; for DSO'Size use $SIZEOF_AG_DSO * System.Storage_Unit; type DSO_Access is access all DSO with Convention => C; subtype DSO_Not_Null_Access is not null DSO_Access; type Symbol_Access is access all System.Address with Convention => C; -- -- Load the named module into the process address space. If it already -- exists in memory, return an access to the existing object and increment -- its reference count. -- function Load (Name : in String) return DSO_Access; -- -- Decrement the reference count of the given loaded DSO, and unload the -- module from the process's address space if it reaches zero. -- function Unload (DSO : DSO_Not_Null_Access) return Boolean; -- -- Return a handle to an already loaded DSO by name. If no such module is -- loaded, return NULL. -- function Lookup (Name : in String) return DSO_Access; -- -- Acquire the mutex protecting the DSO handle. -- procedure Lock with Import, Convention => C, Link_Name => "ag_lock_dso"; procedure Unlock with Import, Convention => C, Link_Name => "ag_unlock_dso"; -- -- Scan the registered module directories for loadable shared libraries -- and return a list of String for all available modules. -- package DSO_List_Package is new Ada.Containers.Indefinite_Vectors (Index_Type => Positive, Element_Type => String); subtype DSO_List is DSO_List_Package.Vector; function Get_List return DSO_List; generic type Subprogram_Access_Type is private; function Symbol_Lookup (DSO : in DSO_Not_Null_Access; Symbol : in String) return Subprogram_Access_Type; private function AG_LoadDSO (Name : in CS.chars_ptr; Flags : C.unsigned) return DSO_Access with Import, Convention => C, Link_Name => "AG_LoadDSO"; function AG_UnloadDSO (DSO : in DSO_Not_Null_Access) return C.int with Import, Convention => C, Link_Name => "AG_UnloadDSO"; function AG_LookupDSO (Name : in CS.chars_ptr) return DSO_Access with Import, Convention => C, Link_Name => "AG_LookupDSO"; function AG_SymDSO (DSO : in DSO_Not_Null_Access; Symbol : in CS.chars_ptr; Value : in Symbol_Access) return C.int with Import, Convention => C, Link_Name => "AG_SymDSO"; type DSO_List_Entry is array (C.unsigned range <>) of aliased CS.chars_ptr with Convention => C; package DSO_List_To_Strings is new Interfaces.C.Pointers (Index => C.unsigned, Element => CS.chars_ptr, Element_Array => DSO_List_Entry, Default_Terminator => Null); function AG_GetDSOList (Count : access C.unsigned) return DSO_List_To_Strings.Pointer with Import, Convention => C, Link_Name => "AG_GetDSOList"; procedure AG_FreeDSOList (List : DSO_List_To_Strings.Pointer; Count : C.unsigned) with import, Convention => C, Link_Name => "AG_FreeDSOList"; end Agar.DSO;
with FIFO; with Ada.Text_Io; use Ada.Text_Io; procedure Queue_Test is package Int_FIFO is new FIFO (Integer); use Int_FIFO; Queue : FIFO_Type; Value : Integer; begin Push (Queue, 1); Push (Queue, 2); Push (Queue, 3); Pop (Queue, Value); Pop (Queue, Value); Push (Queue, 4); Pop (Queue, Value); Pop (Queue, Value); Push (Queue, 5); Pop (Queue, Value); Put_Line ("Is_Empty " & Boolean'Image (Is_Empty (Queue))); end Queue_Test;
package Ant_Handler with SPARK_Mode => On is function Do_Something (Text : String) return String; end Ant_Handler;
-- SPDX-FileCopyrightText: 2019-2021 Max Reznik <reznikmm@gmail.com> -- -- SPDX-License-Identifier: MIT ------------------------------------------------------------- with Ada.Characters.Conversions; with Ada.Command_Line; with Ada.Wide_Wide_Text_IO; with Program.Compilation_Unit_Vectors; with Program.Compilation_Units; with Program.Element_Iterators; with Program.Element_Visitors; with Program.Elements.Character_Literals; with Program.Elements.Defining_Identifiers; with Program.Elements.Defining_Operator_Symbols; with Program.Elements.Identifiers; with Program.Elements.Operator_Symbols; with Program.Elements.Procedure_Body_Declarations; with Program.Lexical_Elements; with Program.Plain_Contexts; with Program.Storage_Pools.Instance; pragma Unreferenced (Program.Storage_Pools.Instance); with Errors; procedure Def_Name is package Dump_Names is type Visitor is new Program.Element_Visitors.Element_Visitor with record Level : Natural := 0; End_Name : Program.Elements.Element_Access; end record; procedure Identifier (Self : in out Visitor; Element : not null Program.Elements.Identifiers.Identifier_Access); procedure Operator_Symbol (Self : in out Visitor; Element : not null Program.Elements.Operator_Symbols .Operator_Symbol_Access); procedure Character_Literal (Self : in out Visitor; Element : not null Program.Elements.Character_Literals .Character_Literal_Access); overriding procedure Procedure_Body_Declaration (Self : in out Visitor; Element : not null Program.Elements.Procedure_Body_Declarations .Procedure_Body_Declaration_Access); end Dump_Names; procedure Process_Units (List : Program.Compilation_Unit_Vectors.Compilation_Unit_Vector_Access; Spec : Boolean); procedure Process_Unit (Unit : Program.Compilation_Units.Compilation_Unit_Access; Spec : Boolean); procedure Traverse (Element : Program.Elements.Element_Access; End_Name : Program.Elements.Element_Access); procedure Enclosing_Unit_Name (Element : access Program.Elements.Element'Class; Position : Wide_Wide_String); package body Dump_Names is ---------------- -- Identifier -- ---------------- procedure Identifier (Self : in out Visitor; Element : not null Program.Elements.Identifiers.Identifier_Access) is use type Program.Elements.Element_Access; Text : Program.Elements.Identifiers.Identifier_Text_Access; Token : Program.Lexical_Elements.Lexical_Element_Access; Def : Program.Elements.Defining_Identifiers .Defining_Identifier_Access; Def_Text : Program.Elements.Defining_Identifiers. Defining_Identifier_Text_Access; begin if Self.End_Name = Program.Elements.Element_Access (Element) then null; elsif not Element.Is_Part_Of_Implicit then Text := Element.To_Identifier_Text; Token := Text.Identifier_Token; Ada.Wide_Wide_Text_IO.Put (Token.Image); Ada.Wide_Wide_Text_IO.Put (" "); Ada.Wide_Wide_Text_IO.Put (Token.From_Image); Ada.Wide_Wide_Text_IO.Put (" => "); Def := Element.Corresponding_Defining_Identifier; if not Def.Assigned then Ada.Wide_Wide_Text_IO.Put_Line ("-"); elsif Def.Is_Part_Of_Implicit then Ada.Wide_Wide_Text_IO.Put_Line (" implicit"); else Def_Text := Def.To_Defining_Identifier_Text; Token := Def_Text.Identifier_Token; Enclosing_Unit_Name (Def, Token.From_Image); Ada.Wide_Wide_Text_IO.New_Line; end if; end if; end Identifier; --------------------- -- Operator_Symbol -- --------------------- procedure Operator_Symbol (Self : in out Visitor; Element : not null Program.Elements.Operator_Symbols .Operator_Symbol_Access) is use type Program.Elements.Element_Access; Text : Program.Elements.Operator_Symbols.Operator_Symbol_Text_Access; Token : Program.Lexical_Elements.Lexical_Element_Access; Def : Program.Elements.Defining_Operator_Symbols .Defining_Operator_Symbol_Access; Def_Text : Program.Elements.Defining_Operator_Symbols. Defining_Operator_Symbol_Text_Access; begin if Self.End_Name = Program.Elements.Element_Access (Element) then null; elsif not Element.Is_Part_Of_Implicit then Text := Element.To_Operator_Symbol_Text; Token := Text.Operator_Symbol_Token; Ada.Wide_Wide_Text_IO.Put (Token.Image); Ada.Wide_Wide_Text_IO.Put (" "); Ada.Wide_Wide_Text_IO.Put (Token.From_Image); Ada.Wide_Wide_Text_IO.Put (" => "); Def := Element.Corresponding_Defining_Operator_Symbol; if not Def.Assigned then Ada.Wide_Wide_Text_IO.Put_Line ("-"); elsif Def.Is_Part_Of_Implicit then Ada.Wide_Wide_Text_IO.Put_Line (" implicit"); else Def_Text := Def.To_Defining_Operator_Symbol_Text; Token := Def_Text.Operator_Symbol_Token; Enclosing_Unit_Name (Def, Token.From_Image); Ada.Wide_Wide_Text_IO.New_Line; end if; end if; end Operator_Symbol; ----------------------- -- Character_Literal -- ----------------------- procedure Character_Literal (Self : in out Visitor; Element : not null Program.Elements.Character_Literals .Character_Literal_Access) is begin null; end Character_Literal; overriding procedure Procedure_Body_Declaration (Self : in out Visitor; Element : not null Program.Elements.Procedure_Body_Declarations .Procedure_Body_Declaration_Access) is begin Self.End_Name := Program.Elements.Element_Access (Element.End_Name); end Procedure_Body_Declaration; end Dump_Names; procedure Process_Unit (Unit : Program.Compilation_Units.Compilation_Unit_Access; Spec : Boolean) is begin for J in 1 .. Ada.Command_Line.Argument_Count loop if Unit.Compilation.Text_Name = Ada.Characters.Conversions.To_Wide_Wide_String (Ada.Command_Line.Argument (J)) then if Spec then Ada.Wide_Wide_Text_IO.Put ("spec"); else Ada.Wide_Wide_Text_IO.Put ("body"); end if; Ada.Wide_Wide_Text_IO.Put (" "); Ada.Wide_Wide_Text_IO.Put_Line (Unit.Full_Name); for Item in Unit.Context_Clause_Elements.Each_Element loop Traverse (Item.Element, null); end loop; Traverse (Unit.Unit_Declaration, null); exit; end if; end loop; end Process_Unit; procedure Process_Units (List : Program.Compilation_Unit_Vectors.Compilation_Unit_Vector_Access; Spec : Boolean) is begin for Cursor in List.Each_Unit loop Process_Unit (Cursor.Unit, Spec); end loop; end Process_Units; procedure Traverse (Element : Program.Elements.Element_Access; End_Name : Program.Elements.Element_Access) is Printer : Dump_Names.Visitor; begin Printer.End_Name := End_Name; Element.Visit (Printer); for Cursor in Element.Each_Child loop Traverse (Cursor.Element, Printer.End_Name); end loop; end Traverse; Ctx : aliased Program.Plain_Contexts.Context; procedure Enclosing_Unit_Name (Element : access Program.Elements.Element'Class; Position : Wide_Wide_String) is use type Program.Elements.Element_Access; Parent : Program.Elements.Element_Access := Element; begin while Parent.Enclosing_Element.Assigned loop Parent := Parent.Enclosing_Element; end loop; for Cursor in Ctx.Library_Unit_Declarations.Each_Unit loop if Cursor.Unit.Unit_Declaration = Parent then if Cursor.Unit.Full_Name = "" then Ada.Wide_Wide_Text_IO.Put ("[Standard]"); return; -- Don't print slocs in Standard (they could change) else Ada.Wide_Wide_Text_IO.Put (Cursor.Unit.Full_Name); exit; end if; end if; end loop; for Cursor in Ctx.Compilation_Unit_Bodies.Each_Unit loop if Cursor.Unit.Unit_Declaration = Parent then Ada.Wide_Wide_Text_IO.Put (Cursor.Unit.Full_Name); exit; end if; end loop; Ada.Wide_Wide_Text_IO.Put (" "); Ada.Wide_Wide_Text_IO.Put (Position); end Enclosing_Unit_Name; Err : aliased Errors.Error_Listener; begin Ctx.Initialize (Err'Unchecked_Access); for J in 1 .. Ada.Command_Line.Argument_Count loop declare Arg : constant Wide_Wide_String := Ada.Characters.Conversions.To_Wide_Wide_String (Ada.Command_Line.Argument (J)); begin if Arg'Length > 2 and then Arg (1 .. 2) = "-I" then Ctx.Add_Search_Directory (Arg (3 .. Arg'Last)); else Ctx.Parse_File (Arg); end if; end; end loop; Ctx.Complete_Analysis; Process_Units (Ctx.Library_Unit_Declarations, True); Process_Units (Ctx.Compilation_Unit_Bodies, False); end Def_Name;
with OpenAL.Types; package OpenAL.Buffer is -- -- Types -- type Buffer_t is private; type Buffer_Array_t is array (Positive range <>) of Buffer_t; No_Buffer : constant Buffer_t; -- -- API -- -- proc_map : alGenBuffers procedure Generate_Buffers (Buffers : in out Buffer_Array_t); -- proc_map : alDeleteBuffers procedure Delete_Buffers (Buffers : in Buffer_Array_t); -- proc_map : alIsBuffer function Is_Valid (Buffer : in Buffer_t) return Boolean; -- -- Frequency -- -- proc_map : alGetBuffer procedure Get_Frequency (Buffer : in Buffer_t; Frequency : out Types.Frequency_t); -- -- Size -- type Sample_Size_t is range 1 .. Types.Size_t'Last; -- proc_map : alGetBuffer procedure Get_Size (Buffer : in Buffer_t; Size : out Sample_Size_t); -- -- Bits -- type Sample_Bits_t is range 8 .. 16; -- proc_map : alGetBuffer procedure Get_Bits (Buffer : in Buffer_t; Bits : out Sample_Bits_t); -- -- Channels -- type Sample_Channels_t is range 1 .. 2; -- proc_map : alGetBuffer procedure Get_Channels (Buffer : in Buffer_t; Channels : out Sample_Channels_t); -- -- Data -- type Sample_16_t is range -32768 .. 32767; for Sample_16_t'Size use 16; type Sample_8_t is range 0 .. 255; for Sample_8_t'Size use 8; type Sample_Array_16_t is array (Sample_Size_t range <>) of aliased Sample_16_t; type Sample_Array_8_t is array (Sample_Size_t range <>) of aliased Sample_8_t; -- proc_map : alBufferData procedure Set_Data_Mono_8 (Buffer : in Buffer_t; Data : in Sample_Array_8_t; Frequency : in Types.Frequency_t); -- proc_map : alBufferData procedure Set_Data_Stereo_8 (Buffer : in Buffer_t; Data : in Sample_Array_8_t; Frequency : in Types.Frequency_t); -- proc_map : alBufferData procedure Set_Data_Mono_16 (Buffer : in Buffer_t; Data : in Sample_Array_16_t; Frequency : in Types.Frequency_t); -- proc_map : alBufferData procedure Set_Data_Stereo_16 (Buffer : in Buffer_t; Data : in Sample_Array_16_t; Frequency : in Types.Frequency_t); -- -- -- function To_Integer (Buffer : Buffer_t) return Types.Unsigned_Integer_t; function From_Integer (Buffer : Types.Unsigned_Integer_t) return Buffer_t; private type Buffer_t is new Types.Unsigned_Integer_t; No_Buffer : constant Buffer_t := 0; end OpenAL.Buffer;
-- -- Raytracer implementation in Ada -- by John Perry (github: johnperry-math) -- 2021 -- -- main program -- -- Ada packages with Ada.Text_IO; use Ada.Text_IO; -- I/O with Ada.Real_Time; -- timing -- local packages with Bitmap; with Cameras; with Colors; with Lights; with Objects; with RayTracer; with Vectors; with RayTracing_Constants; use RayTracing_Constants; -- @summary -- creates, draws, and saves a 500px x 500px image of two shiny balls -- on a checkerboard procedure Main is Start, Stop: Ada.Real_Time.Time; -- clock times at start, stop of render Difference: Ada.Real_Time.Time_Span; -- difference between Start and Stop Width: Int32 := 500; -- image width Height: Int32 := 500; -- image height Bmp: Bitmap.Bitmap_Data( 1 .. Integer( Width * Height ) ); -- bitmap to save function "-"(First, Second: Ada.Real_Time.Time) return Ada.Real_Time.Time_Span renames Ada.Real_Time."-"; -- make the predefined subtraction operator available for time package L renames Lights; Lights: L.Light_Array( 1 .. 4 ); -- lights shining on the image Things: Objects.Thing_Array( 1 .. 3 ); -- things present in the image Camera: Cameras.Camera_Type; Scene: RayTracer.Scene_Type( Light_Count => Lights'Length, Thing_Count => Things'Length ); -- the scene to display begin -- set up the objects in the scene, the lights, and the Camera_Type Objects.Create_Plane( Things(1), Vectors.Create_Vector(0.0, 1.0, 0.0), 0.0, Objects.Checkerboard ); Objects.Create_Sphere( Things(2), Vectors.Create_Vector(0.0, 1.0, -0.25), 1.0, Objects.Shiny ); Objects.Create_Sphere( Things(3), Vectors.Create_Vector(-1.0, 0.5, 1.5), 0.5, Objects.Shiny ); Lights(1) := L.Create_Light( Vectors.Create_Vector(-2.0, 2.5, 0.0), Colors.Create_Color(0.49, 0.07, 0.07) ); Lights(2) := L.Create_Light( Vectors.Create_Vector(1.5, 2.5, 1.5), Colors.Create_Color(0.07, 0.07, 0.49) ); Lights(3) := L.Create_Light( Vectors.Create_Vector(1.5, 2.5, -1.5), Colors.Create_Color(0.07, 0.49, 0.071) ); Lights(4) := L.Create_Light( Vectors.Create_Vector(0.0, 3.5, 0.0), Colors.Create_Color(0.21, 0.21, 0.35) ); Camera := Cameras.Create_Camera( Vectors.Create_Vector(3.0, 2.0, 4.0), Vectors.Create_Vector(-1.0, 0.5, 0.0) ); RayTracer.Create_Scene(Scene, Things, Lights, Camera, 5); -- render and time the rendering Put_Line("started"); Start := Ada.Real_Time.Clock; RayTracer.Render_Scene(Scene, Bmp, Width, Height); Stop := Ada.Real_Time.Clock; Difference := Stop - Start; -- report time, then save output Put_Line( "Completed in" & Duration'Image( Ada.Real_Time.To_Duration(Difference)) & " seconds" ); Bitmap.Save_RGB_Bitmap(Bmp, Width, Height, 32, "ada-raytracer.bmp"); end Main;
with Text_IO; with Ada.Characters.Handling; use Ada.Characters.Handling; with Ada.Strings.UTF_Encoding; with System.WCh_Con; with System.WCh_Cnv; with JSON_Gen.Command_Lines; use JSON_Gen.Command_Lines; with Ada.Directories; use Ada.Directories; with Interfaces; use type Interfaces.Unsigned_16; with GNAT.OS_Lib; use GNAT.OS_Lib; with Langkit_Support.Diagnostics; with Langkit_Support.Slocs; with Langkit_Support.Text; with Libadalang; use Libadalang; with Libadalang.Common; use Libadalang.Common; with LAL_Extensions; use LAL_Extensions; with Utils.Command_Lines.Common; use Utils.Command_Lines.Common; with Utils.Dbg_Out; with Utils.Formatted_Output; with Utils.Tool_Names; with GNATCOLL.VFS; with GNATCOLL.Projects; with Utils.Generic_Formatted_Output; with Utils_Debug; use Utils_Debug; with Utils.Environment; -- with Pp.Actions; -- with JSON_Gen.Command_Lines; package body JSON_Gen.Actions is use Utils.Char_Vectors.Char_Vectors; function Image (X : Integer) return String renames Utils.String_Utilities.Image; pragma Warnings (Off); use Common_Flag_Switches, Common_String_Switches, Common_String_Seq_Switches, Common_Nat_Switches; pragma Warnings (On); use Json_Gen_Flag_Switches, Json_Gen_String_Switches, Json_Gen_Nat_Switches; use Scanner.Source_Message_Vectors; -- The current body-generating version of gnatstub generates output bodies; -- we could implement a new body-modifying version modifies existing -- bodies. -- -- Body-generating: By default, the command line arguments refer to specs, -- and the --subunits switch is not given. The output is a body. It is an -- error if the body already exists. If the --force/-f switch is given, -- then any existing body is overwritten; if that body contains -- hand-written code, it is lost. If the --subunits switch is given, the -- command line arguments refer to bodies, and a subunit is generated for -- each Ada stub found in that body, skipping ones that already exist. -- -- Thus "--subunits switch given" if and only if "argument is a body". -- -- Body-modifying: Command-line arguments always refer to specs. [???Or -- perhaps allow bodies, but process as if the corresponding spec were -- mentioned.] If the body exists, read it; otherwise create an empty one. -- Further processing can then assume that the body exists. -- -- If --subunits is not given, then for each declaration in the spec and in -- the body that requires completion, and whose completion does not exist, -- generate the completion in the body. The completion is placed -- immediately after the completion of the preceding declaration (where the -- order takes into account the Alphabetical_Order switch, if given). -- What about private types??? -- -- If --subunits is given, then processing is as above, except we generate -- an Ada stub instead of a proper body. -- -- With or without --subunits, for each Ada stub (whether or not newly -- generated), we generate the subunit if it doesn't already exist. -- ???Recursively process subunits, even if they already exist? -- -- Withdraw support for the --force/-f switch. We are always updating an -- existing body, not replacing it. -- -- Design notes: -- -- Read text of spec, parse. -- Read text of body (or concoct empty one), parse, split text into lines. -- Collect relevant nodes into an Ada_Node_Vector. Relevant = requires -- completion, or is an Ada Stub. Nodes from the spec, followed by nodes -- from the body. -- Sort. By default, types first, then other things, otherwise retaining -- order from the source. If --alphabetical-order is given, then types -- first, in alphabetical order, then bodies, in alphabetical order, -- retaining source order for overloaded declarations. -- -- Walk the sorted vector, generating a vector of strings. Each string is -- the text of a completion, and has a source location attached. For each -- item: -- If it requires completion, and the completion does not exist, append -- that completion to the string vector, along with the source location -- just after the preceding item. If --subunits is given, the completion -- is an Ada stub, and we also generate the subunit if it does not -- exist. -- If it is an Ada stub, generate the subunit if it does not exist. -- -- Sort the completions in source location order. -- -- Walk the text lines of the body and the completions in sync, copying -- both to the output, interleaved by source location. -- The above is way too complicated for now. A customer has asked for a way -- to generate the body for a single declaration in a package spec. Here -- are design notes for that. See Update_Body. -- -- If --update=line:col is given, it must be a [generic] package spec. -- Collect subp decls. -- Find the one with the right sloc. Better not have a completion. -- Sort if --alphabetic-order. -- Find preceding one that has a completion, or the start of the -- declarative part if no such. -- Copy body text through that one. -- Append completion. -- Copy rest of body text. package Slocs renames Langkit_Support.Slocs; ---------- -- Init -- ---------- overriding procedure Init (Tool : in out Json_Gen_Tool; Cmd : in out Command_Line) is pragma Unreferenced (Tool); begin -- ????Other checks from gnatstub/lal_ul-check_parameters.adb? pragma Assert (Environment.Initial_Dir = Current_Directory); if Update_Body_Specified (Cmd) and then Num_File_Names (Cmd) > 1 then Cmd_Error ("only one file name allowed with " & Switch_Text (JSON_Gen.Command_Lines.Descriptor, To_All (Update_Body)).all); end if; end Init; ----------- -- Final -- ----------- overriding procedure Final (Tool : in out Json_Gen_Tool; Cmd : Command_Line) is begin null; end Final; procedure Format_Vector (Cmd : Command_Line; Input : Char_Vector; Node : Ada_Node; In_Range : Char_Subrange; Output : out Char_Vector; Out_Range : out Char_Subrange; Messages : out Pp.Scanner.Source_Message_Vector) is begin null; end; --------------------- -- Per_File_Action -- --------------------- -- Debugging printouts: -- See also Libadalang.Debug. pragma Warnings (Off); pragma Style_Checks (Off); procedure knd (X : Ada_Node) is use Utils.Dbg_Out; begin Utils.Dbg_Out.Output_Enabled := True; Put ("\1\n", Kind (X)'Img); end knd; procedure psloc (X : Ada_Node) is function Lines_String (Sloc_Range : Slocs.Source_Location_Range) return String is (Image (Integer (Sloc_Range.Start_Line)) & ": " & Image (Integer (Sloc_Range.End_Line))); use Utils.Dbg_Out; begin Utils.Dbg_Out.Output_Enabled := True; Put ("\1\n", Lines_String (Sloc_Range (X))); end psloc; procedure nn (X : Ada_Node) is use Utils.Dbg_Out; begin Utils.Dbg_Out.Output_Enabled := True; Put ("\1\n", (if X.Is_Null then "null" else Short_Image (X))); end nn; procedure ppp (X : Ada_Node) is use Utils.Dbg_Out; begin nn (X); Print (X); end ppp; procedure Put_Ada_Node_Array (X : Ada_Node_Array) is use Utils.Dbg_Out; begin for N of X loop nn (N); Put ("----------------\n"); end loop; end Put_Ada_Node_Array; procedure Put_Child_Record (C : Child_Record) is use Utils.Dbg_Out; begin case C.Kind is when Child => Put ("Child: \1\n", Short_Image (C.Node)); when Trivia => declare Trivia_Data : constant Token_Data_Type := Data (C.Trivia); begin Put ("Trivia: \1 ""\2"" \3\n", Kind (Trivia_Data)'Img, To_UTF8 (Text_To_W_Str (Libadalang.common.Text (C.Trivia))), Slocs.Image (Sloc_Range (Trivia_Data))); end; end case; end Put_Child_Record; procedure Put_Children_Array (A : Children_Array) is use Utils.Dbg_Out; begin for I in A'Range loop Put ("\1: ", Image (I)); Put_Child_Record (A (I)); end loop; end Put_Children_Array; procedure Dump (Tool : in out Json_Gen_Tool; Message : String := "") is pragma Unreferenced (Tool); use Utils.Formatted_Output; begin if Debug_Flag_V then Put ("\1\n", Message); end if; end Dump; pragma Style_Checks (On); pragma Warnings (On); procedure Generate (Tool : in out Json_Gen_Tool; Cmd : Command_Line; File_Name : String; Input : String; BOM_Seen : Boolean; Root_Node : Ada_Node; Parent_Body_Of_Subunit : Ada_Node); -- Given a spec, generate the body file. Given a body, recursively call -- Generate on any Ada stubs, and given a stub, generate the subunit file. -- -- Note: "stub" is used in two different ways. In Ada, a stub ends with "is -- separate;", and we generate subunits for those. But the "stubs" -- generated by gnatstub are not stubs in the Ada sense; they are proper -- bodies. function Q (S : W_Str) return W_Str is (if S (S'First) = '"' then """" & S & """" else S); -- S is the name of a program unit. If it's an operator symbol, like -- "and", we return ""and"" so it can be used inside a generated string -- literal. If it's an identifier, we return it unchanged. function Intersperse_Spaces (S : W_Str) return W_Str; -- Put a space between each character, so "Foo" --> "F o o". -- Used in generating header comments. function Centered_Comment (S : W_Str; Len : Natural) return W_Str; -- Return something like "-- S --" of the right length. -- Used in generating header comments. function Needs_Completion (N : Ada_Node) return Boolean; -- Returns True if N is a declaration that needs a completion. function Get_Parent_Name (Parent_Body_Of_Subunit : Ada_Node) return W_Str; -- This is the name to put in "separate (...)" when generating a subunit. function Less_Than (X, Y : Ada_Node) return Boolean; package Sorting is new Ada_Node_Vectors.Generic_Sorting (Less_Than); -- Used to implement the Alphabetical_Order switch (-gnatyo). -- Type declarations come first, in alphabetical order, then bodies, in -- alphabetical order. If two or more subprograms have the same name, they -- retain their order in the spec. Here we are sorting the incomplete types -- and specs into the order their completions should appear in. function Get_JSON_Gen_Cmd return Command_Line; -- Return a command line for passing to the pretty printer. Comments_Fill_Arg : aliased String := "--comments-fill"; Decimal_Grouping_Arg : aliased String := "--decimal-grouping=3"; Based_Grouping_Arg : aliased String := "--based-grouping=4"; Args : aliased GNAT.OS_Lib.Argument_List := (Comments_Fill_Arg'Access, Decimal_Grouping_Arg'Access, Based_Grouping_Arg'Access); function Get_JSON_Gen_Cmd return Command_Line is begin return Result : Command_Line (JSON_Gen.Command_Lines.Descriptor'Access) do Parse (Args'Access, Result, Cmd_Line_1, Null_Callback'Access, Collect_File_Names => False); end return; end Get_JSON_Gen_Cmd; JSON_Gen_Cmd : Command_Line := Get_JSON_Gen_Cmd; function Overriding_String (Overrides : Ada_Overriding_Node) return W_Str is (case Overrides is when Ada_Overriding_Not_Overriding => "not overriding ", when Ada_Overriding_Overriding => "overriding ", when Ada_Overriding_Unspecified => ""); function Intersperse_Spaces (S : W_Str) return W_Str is use WChar_Vectors; Result : WChar_Vector; First_Time : Boolean := True; begin for C of S loop if First_Time then First_Time := False; else Append (Result, ' '); end if; Append (Result, C); end loop; return To_Array (Result); end Intersperse_Spaces; function Centered_Comment (S : W_Str; Len : Natural) return W_Str is Num_Spaces : constant Integer := Len - S'Length - 4; begin if Num_Spaces < 0 then return "--" & S & "--"; else declare L : constant Natural := Num_Spaces / 2; R : constant Natural := (if Num_Spaces mod 2 = 0 then L else L + 1); begin return "--" & (1 .. L => ' ') & S & (1 .. R => ' ') & "--"; end; end if; end Centered_Comment; function Less_Than (X, Y : Ada_Node) return Boolean is X_Name : constant W_Str := L_Name (Get_Def_Name (X)); Y_Name : constant W_Str := L_Name (Get_Def_Name (Y)); use Slocs; X_Sloc : constant Source_Location := Start_Sloc (Sloc_Range (X)); Y_Sloc : constant Source_Location := Start_Sloc (Sloc_Range (Y)); begin if X.Kind in Ada_Type_Decl and then Y.Kind not in Ada_Type_Decl then return True; end if; if X.Kind not in Ada_Type_Decl and then Y.Kind in Ada_Type_Decl then return False; end if; if X_Name = Y_Name then return Compare (X_Sloc, Y_Sloc) = After; -- Make the sort stable. end if; return X_Name < Y_Name; end Less_Than; function Needs_Completion (N : Ada_Node) return Boolean is function Recurse (Decls : Ada_Node_List) return Boolean; -- Recursively process a nested declaration list. This is used for a -- package spec, which needs a completion if and only if there's -- something in it that needs a completion. function Recurse (Decls : Ada_Node_List) return Boolean is begin if not Decls.Is_Null then for X in 1 .. Last_Child_Index (Decls) loop declare Subtree : constant Ada_Node := Childx (Decls, X); begin if Needs_Completion (Subtree) or else Subtree.Kind in Ada_Incomplete_Type_Decl | Ada_Incomplete_Tagged_Type_Decl then return True; end if; end; end loop; end if; return False; end Recurse; -- Start of processing for Needs_Completion begin case N.Kind is when Ada_Package_Decl | Ada_Generic_Package_Decl => declare VP : constant Public_Part := Vis_Part (N); PP : constant Private_Part := Priv_Part (N); begin return (not VP.Is_Null and then Recurse (F_Decls (VP))) or else (not PP.Is_Null and then Recurse (F_Decls (PP))); end; when Ada_Single_Protected_Decl | Ada_Protected_Type_Decl | Ada_Single_Task_Decl | Ada_Task_Type_Decl => return True; when Ada_Entry_Decl => return True; when Ada_Subp_Decl => return not N.As_Basic_Subp_Decl.P_Is_Imported; when Ada_Generic_Subp_Decl => return not N.As_Generic_Subp_Decl.P_Is_Imported; when Ada_Incomplete_Type_Decl | Ada_Incomplete_Tagged_Type_Decl => return False; -- Because these are handled specially in Walk when others => return False; end case; end Needs_Completion; function Get_Parent_Name (Parent_Body_Of_Subunit : Ada_Node) return W_Str is begin if Parent_Body_Of_Subunit.Is_Null then return ""; elsif Ada_Node'(Parent (Parent_Body_Of_Subunit)).Kind = Ada_Subunit then declare Parent_Parent : constant W_Str := Full_Name (Parent_Body_Of_Subunit.Parent.As_Subunit.F_Name); Parent_Simple : constant W_Str := Id_Name (Get_Def_Name (Parent_Body_Of_Subunit)); begin return Parent_Parent & "." & Parent_Simple; end; else return Full_Name (Get_Def_Name (Parent_Body_Of_Subunit).As_Name); end if; end Get_Parent_Name; procedure Generate (Tool : in out Json_Gen_Tool; Cmd : Command_Line; File_Name : String; Input : String; BOM_Seen : Boolean; Root_Node : Ada_Node; Parent_Body_Of_Subunit : Ada_Node) is Looking_For_Ada_Stubs : constant Boolean := Root_Node.Kind in Ada_Body_Node and then Root_Node.Kind not in Ada_Body_Stub; Parent_Name : constant W_Str := Get_Parent_Name (Parent_Body_Of_Subunit); Root_Node_Name : constant W_Str := (if not Parent_Body_Of_Subunit.Is_Null then Parent_Name & "." else "") & Full_Name (Get_Def_Name (Root_Node).As_Name); UC_Root_Node_Name : constant W_Str := To_Upper (Root_Node_Name); LC_Root_Node_Name : constant W_Str := To_Lower (Root_Node_Name); Wide_Char_Encoding : constant System.WCh_Con.WC_Encoding_Method := Wide_Character_Encoding (Cmd); Out_Vec, JSON_Gen_Out_Vec : Char_Vector; procedure Put_To_Out_Vec (WC : W_Char); procedure Put_To_Out_Vec (WC : W_Char) is procedure Append_One (C : Character); pragma Inline (Append_One); procedure Append_One (C : Character) is begin Append (Out_Vec, C); end Append_One; procedure Encode is new System.WCh_Cnv.Wide_Char_To_Char_Sequence (Append_One); begin Encode (WC, Wide_Char_Encoding); end Put_To_Out_Vec; package Buffered_Output is new Utils.Generic_Formatted_Output (W_Char, W_Str, Basic_Put_Char => Put_To_Out_Vec); use Buffered_Output; procedure Generate_CU_Header; procedure Walk (Decl : Ada_Node; Level : Natural); -- Generate code corresponding to Decl, and recursively walk subtrees. -- -- Note on recursion: Generate calls Walk. Walk calls Walk. Walk calls -- Generate. In more detail: Generate is called on the compilation unit -- spec or body. In the case of a spec, Generate calls Walk on the spec, -- which calls Walk on nested specs, and generates a body for each one. -- In the case of a body, Generate calls Walk on the body, which calls -- Generate on nested Ada body stubs, to generate subunit files for each -- one. procedure Generate_Local_Header (Name : W_Str; Level : Natural); -- Generate the local header that appears before each body, -- unless the --no_local_header switch was given. procedure Generate_Subunit_Start (Level : Natural); -- If we are processing a subunit, generate "separate (parent)". procedure Generate_Subp_Body (Decl : Ada_Node; Name : W_Str; Ada_Stub : Boolean); -- Generate a subprogram body stub. If Ada_Stub is True, we generate -- "is separate"; otherwise the so-called "stub" is a proper body. procedure Generate_Entry_Body (Decl : Ada_Node; Name : W_Str); -- Generate an entry body stub procedure Generate_Subp_Or_Entry_Body (Decl : Ada_Node; Name : W_Str; Ada_Stub : Boolean); procedure Generate_Json_Gen_Begin_End (Name, Json_Gen_Kind : W_Str); -- Generate the text from "begin" to "end" of the generated code for a -- subprogram, entry, or task body. Json_Gen_Kind is "function", -- "procedure", "entry", or "task". procedure Format; -- Call the pretty printer on Out_Vec, producing JSON_Gen_Out_Vec. procedure Write_Output_File; -- Write the content of JSON_Gen_Out_Vec to the output file function Get_Output_Name (Resolve_Links : Boolean) return String; -- Return the name of the output file procedure Generate_CU_Header is begin if Arg (Cmd, Header_File) /= null then declare Header : String_Access := Read_File (Arg (Cmd, Header_File).all); begin Put ("\1", From_UTF8 (Header.all)); Free (Header); end; end if; if Arg (Cmd, Comment_Header_Sample) then declare With_Spaces : constant W_Str := Intersperse_Spaces (UC_Root_Node_Name); Len : constant Natural := Arg (Cmd, Max_Line_Length); Dashes : constant W_Str := (1 .. Len => '-'); Spaces : constant W_Str := "--" & (1 .. Len - 4 => ' ') & "--"; begin Put ("\1\n", Dashes); Put ("\1\n", Spaces); Put ("\1\n", Centered_Comment (With_Spaces, Len)); Put ("\1\n", Spaces); Put ("\1\n", Centered_Comment ("B o d y", Len)); Put ("\1\n", Spaces); Put ("\1\n", Dashes); Put ("\n"); end; end if; if Arg (Cmd, Comment_Header_Spec) then declare pragma Assert (Input'First = 1); Last : Natural := 0; Next : Positive := 1; begin -- We want to copy comment lines from the input, starting at -- the start of the file, and stopping when we get to a -- noncomment line. Se set Last to point to the NL at the -- end of the last comment line in the header. while Next <= Input'Last - 2 loop while Next <= Input'Last - 2 and then Input (Next) in ' ' | ASCII.HT loop Next := Next + 1; end loop; exit when Input (Next .. Next + 1) /= "--"; while Next <= Input'Last and then Input (Next) /= ASCII.LF loop Next := Next + 1; end loop; Last := Next; Next := Next + 1; end loop; -- Now the slice ending at Last is what we want to copy, -- replacing the "S p e c" string, if any. Append (Out_Vec, Replace_String (Input (1 .. Last), From => "S p e c", To => "B o d y")); Put ("\n"); end; end if; end Generate_CU_Header; procedure Generate_Local_Header (Name : W_Str; Level : Natural) is begin if not Arg (Cmd, No_Local_Header) and then Level > 0 then declare Header_Length : constant Natural := Name'Length + 6; Header_Line : constant W_Str := (1 .. Header_Length => '-'); begin Put (" \1\n", Header_Line); Put (" -- \1 --\n", Name); Put (" \1\n\n", Header_Line); end; end if; end Generate_Local_Header; procedure Generate_Subunit_Start (Level : Natural) is begin if Level = 0 and then not Parent_Body_Of_Subunit.Is_Null then Put ("separate (\1)\n", Parent_Name); end if; end Generate_Subunit_Start; procedure Generate_Subp_Body (Decl : Ada_Node; Name : W_Str; Ada_Stub : Boolean) is Empty_Vec, JSON_Gen_Out_Vec : Char_Vector; Spec : constant Subp_Spec := Get_Subp_Spec (Decl); Overrides : constant Ada_Overriding_Node := (if Decl.Kind in Ada_Classic_Subp_Decl then Decl.As_Classic_Subp_Decl.F_Overriding else Ada_Overriding_Unspecified); Returns : constant Boolean := not F_Subp_Returns (Spec).Is_Null; begin JSON_Gen.Actions.Format_Vector (JSON_Gen_Cmd, Input => Empty_Vec, Node => Ada_Node (Spec), In_Range => (1, 0), Output => JSON_Gen_Out_Vec, Out_Range => Tool.Ignored_Out_Range, Messages => Tool.Ignored_Messages); pragma Assert (Is_Empty (Tool.Ignored_Messages)); Put (" \1\2 is", Overriding_String (Overrides), From_UTF8 (Elems (JSON_Gen_Out_Vec) (1 .. Last_Index (JSON_Gen_Out_Vec)))); if Ada_Stub then Put (" separate;\n"); else Put ("\n"); Generate_Json_Gen_Begin_End (Name, (if Returns then "function" else "procedure")); end if; end Generate_Subp_Body; procedure Generate_Entry_Body (Decl : Ada_Node; Name : W_Str) is Empty_Vec, JSON_Gen_Out_Vec : Char_Vector; Parms : constant Params := Decl.As_Entry_Decl.F_Spec.F_Entry_Params; Overrides : constant Ada_Overriding_Node := Decl.As_Entry_Decl.F_Overriding; begin if not Parms.Is_Null then JSON_Gen.Actions.Format_Vector (JSON_Gen_Cmd, Input => Empty_Vec, Node => Ada_Node (Parms), In_Range => (1, 0), Output => JSON_Gen_Out_Vec, Out_Range => Tool.Ignored_Out_Range, Messages => Tool.Ignored_Messages); pragma Assert (Is_Empty (Tool.Ignored_Messages)); Put ("\1entry \2 \3 when Standard.True is\n", Overriding_String (Overrides), Name, From_UTF8 (Elems (JSON_Gen_Out_Vec) (1 .. Last_Index (JSON_Gen_Out_Vec)))); else Put ("\1entry \2 when Standard.True is\n", Overriding_String (Overrides), Name); end if; Generate_Json_Gen_Begin_End (Name, "entry"); end Generate_Entry_Body; procedure Generate_Subp_Or_Entry_Body (Decl : Ada_Node; Name : W_Str; Ada_Stub : Boolean) is begin case Decl.Kind is when Ada_Subp_Decl | Ada_Generic_Subp_Decl => Generate_Subp_Body (Decl, Name, Ada_Stub); when Ada_Entry_Decl => Generate_Entry_Body (Decl, Name); when others => raise Program_Error; end case; end Generate_Subp_Or_Entry_Body; procedure Generate_Json_Gen_Begin_End (Name, Json_Gen_Kind : W_Str) is Returns : constant Boolean := Json_Gen_Kind = "function"; begin Put ("begin\n"); Put (" -- Generated stub: replace with real body!\n"); Put ("pragma Compile_Time_Warning " & "(Standard.True, ""\1 unimplemented"");\n", Q (Name)); if Arg (Cmd, No_Exception) and then not Returns then Put ("null;"); else Put ("\1raise Program_Error with ""Unimplemented \2 \3"";\n", (if Returns then "return " else ""), Json_Gen_Kind, Q (Name)); end if; Put ("end;\n"); end Generate_Json_Gen_Begin_End; procedure Walk (Decl : Ada_Node; Level : Natural) is Local_Decls, Incomplete_Types : Ada_Node_Vector; Name : constant W_Str := Full_Name (Get_Def_Name (Decl).As_Name); use Ada_Node_Vectors; procedure Collect_Local_Decls (Decls : Ada_Node_List); -- Append all the declarations that need recursive processing onto -- Local_Decls. procedure Collect_Incomplete_Types (Decls : Ada_Node_List); -- Append all the incomplete type declarations in a private part that -- are not completed in the same private part onto Incomplete_Types. procedure Collect_Local_Decls (Decls : Ada_Node_List) is begin for X in 1 .. Last_Child_Index (Decls) loop declare Subtree : constant Ada_Node := Childx (Decls, X); begin if (Looking_For_Ada_Stubs and then Subtree.Kind in Ada_Body_Stub) or else (not Looking_For_Ada_Stubs and then Needs_Completion (Subtree)) then Append (Local_Decls, Subtree); end if; end; end loop; end Collect_Local_Decls; procedure Collect_Incomplete_Types (Decls : Ada_Node_List) is begin for X in 1 .. Last_Child_Index (Decls) loop declare Subtree : constant Ada_Node := Childx (Decls, X); begin if Subtree.Kind in Ada_Incomplete_Type_Decl | Ada_Incomplete_Tagged_Type_Decl then declare Next_Part : constant Base_Type_Decl := Subtree.As_Base_Type_Decl.P_Next_Part; begin if Next_Part.Is_Null or else Next_Part = Subtree then -- ???Not sure why P_Next_Part sometimes returns -- "self". Append (Incomplete_Types, Subtree); end if; end; end if; end; end loop; end Collect_Incomplete_Types; -- Start of processing for Walk begin if Level > 0 then Put ("\n"); end if; -- For things we will recursively walk (packages, protecteds), -- generate the start of the body. For other things (tasks, -- subprograms, entries), generate the body. case Decl.Kind is when Ada_Package_Decl | Ada_Generic_Package_Decl | Ada_Package_Body_Stub => Generate_Local_Header (Name, Level); Generate_Subunit_Start (Level); Put ("package body \1 is\n", Name); when Ada_Single_Protected_Decl | Ada_Protected_Type_Decl | Ada_Protected_Body_Stub => Generate_Local_Header (Name, Level); Generate_Subunit_Start (Level); Put ("protected body \1 is\n", Name); when Ada_Single_Task_Decl | Ada_Task_Type_Decl | Ada_Task_Body_Stub => Generate_Local_Header (Name, Level); Generate_Subunit_Start (Level); Put ("task body \1 is\n", Name); Generate_Json_Gen_Begin_End (Name, "task"); when Ada_Subp_Decl | Ada_Generic_Subp_Decl | Ada_Subp_Body_Stub => Generate_Local_Header (Name, Level); Generate_Subunit_Start (Level); Generate_Subp_Body (Decl, Name, Ada_Stub => False); when Ada_Entry_Decl => Generate_Local_Header (Name, Level); Generate_Entry_Body (Decl, Name); when Ada_Subp_Body | Ada_Package_Body | Ada_Task_Body | Ada_Protected_Body => null; when others => raise Program_Error; end case; -- Collect in Local_Decls all the nested declarations or body stubs -- that need recursive processing. We don't process them right away, -- because we might need to sort the list. case Decl.Kind is when Ada_Package_Decl | Ada_Generic_Package_Decl | Ada_Single_Protected_Decl | Ada_Protected_Type_Decl => if not Vis_Part (Decl).Is_Null then Collect_Local_Decls (F_Decls (Vis_Part (Decl))); end if; if not Priv_Part (Decl).Is_Null then Collect_Local_Decls (F_Decls (Priv_Part (Decl))); end if; when Ada_Subp_Body | Ada_Package_Body | Ada_Task_Body | Ada_Protected_Body => Collect_Local_Decls (F_Decls (Body_Decls (Decl))); when Ada_Package_Body_Stub | Ada_Protected_Body_Stub => -- Find the corresponding spec, and walk the decls therein declare Spec : constant Basic_Decl := P_Previous_Part (Decl.As_Body_Node); begin if not Vis_Part (Spec).Is_Null then Collect_Local_Decls (F_Decls (Vis_Part (Spec))); end if; if not Priv_Part (Spec).Is_Null then Collect_Local_Decls (F_Decls (Priv_Part (Spec))); end if; end; when Ada_Subp_Decl | Ada_Generic_Subp_Decl | Ada_Single_Task_Decl | Ada_Task_Type_Decl | Ada_Entry_Decl | Ada_Task_Body_Stub | Ada_Subp_Body_Stub => null; when others => raise Program_Error; end case; -- Sort the list if appropriate. There's no point in sorting if we're -- doing subunits, because each one goes in a separate file. if Arg (Cmd, Alphabetical_Order) and then not Looking_For_Ada_Stubs then Sorting.Sort (Local_Decls); end if; -- For an incomplete type in a private part that has no completion in -- the same private part, generate a completion in the package body. -- We do this separately from the normal walk, because we want the -- full type declarations to come first, before procedure bodies and -- whatnot. case Decl.Kind is when Ada_Package_Decl | Ada_Generic_Package_Decl => if not Priv_Part (Decl).Is_Null then Collect_Incomplete_Types (F_Decls (Priv_Part (Decl))); for Child of Incomplete_Types loop Put ("\ntype \1 is\2 null record;\n", Full_Name (Get_Def_Name (Child).As_Name), (if Child.Kind = Ada_Incomplete_Type_Decl then "" else " tagged")); end loop; end if; when others => null; end case; -- Recursively process the nested declarations. In the case of Ada -- stubs, we call Generate, because the corrsponding subunit goes in -- a separate file, and Generate knows how to create files. for Child of Local_Decls loop if Looking_For_Ada_Stubs and then Decl.Kind not in Ada_Package_Body_Stub | Ada_Protected_Body_Stub then pragma Assert (Child.Kind in Ada_Body_Stub); Generate (Tool, Cmd, File_Name, Input, BOM_Seen, Root_Node => Child, Parent_Body_Of_Subunit => Root_Node); else Walk (Child, Level + 1); end if; end loop; -- For things we recursively walked above (packages, protecteds), -- generate the end of the body. For other things (tasks, -- subprograms, entries), generate nothing. case Decl.Kind is when Ada_Package_Decl | Ada_Generic_Package_Decl | Ada_Package_Body_Stub | Ada_Single_Protected_Decl | Ada_Protected_Type_Decl | Ada_Protected_Body_Stub => Put ("\nend;\n"); when Ada_Subp_Decl | Ada_Generic_Subp_Decl | Ada_Subp_Body_Stub | Ada_Single_Task_Decl | Ada_Task_Type_Decl | Ada_Task_Body_Stub | Ada_Entry_Decl | Ada_Subp_Body | Ada_Package_Body | Ada_Task_Body | Ada_Protected_Body => null; when others => raise Program_Error; end case; end Walk; procedure Format is Context : constant Analysis_Context := Create_Context (Charset => Wide_Character_Encoding (Cmd)); Out_Str : String renames Elems (Out_Vec) (1 .. Last_Index (Out_Vec)); Out_Unit : constant Analysis_Unit := Get_From_Buffer (Context, Filename => "", Buffer => Out_Str); begin if Has_Diagnostics (Out_Unit) then if Assert_Enabled then Text_IO.Put_Line ("Errors while parsing """ & Out_Str & """"); for D of Analysis.Diagnostics (Out_Unit) loop Text_IO.Put_Line (Langkit_Support.Diagnostics.To_Pretty_String (D)); end loop; end if; raise Program_Error; end if; pragma Assert (not Root (Out_Unit).Is_Null); JSON_Gen.Actions.Format_Vector (JSON_Gen_Cmd, Input => Out_Vec, Node => Root (Out_Unit), In_Range => (1, 0), Output => JSON_Gen_Out_Vec, Out_Range => Tool.Ignored_Out_Range, Messages => Tool.Ignored_Messages); pragma Assert (Is_Empty (Tool.Ignored_Messages)); end Format; function Get_Output_Name (Resolve_Links : Boolean) return String is pragma Unreferenced (Resolve_Links); use GNATCOLL.Projects, GNATCOLL.VFS; function Default_Name return String; -- This is used when the output file is not specified on the -- command line, and there is no project file. It uses the -- default GNAT conventions for file names (.ads, .adb). function Name_From_Project return String; -- This is used when there is a project file. It queries the -- project, so it uses whatever naming convention is specified in -- the project. function Default_Name return String is begin if Has_Suffix (File_Name, Suffix => ".ads") or else Has_Suffix (File_Name, Suffix => ".adb") then if Root_Node.Kind in Ada_Body_Stub then declare Root_Node_Name_String : constant String := To_UTF8 (LC_Root_Node_Name) & ".JSON"; -- Root_Node is the stub (in the Ada sense). begin return Replace_String (Root_Node_Name_String, From => ".", To => "-") & ".adb"; end; else return Result : String := File_Name do Result (Result'Last) := 'b'; end return; end if; else Cmd_Error ("output file name should be provided because " & File_Name & " does not follow GNAT naming rules for " & "spec files"); end if; end Default_Name; function Name_From_Project return String is Arg_Virt_File : constant Virtual_File := Create (Tool.Project_Tree.all, +File_Name); Arg_File_Info : constant File_Info := Info (Tool.Project_Tree.all, Arg_Virt_File); Unit_Name : constant String := To_UTF8 (LC_Root_Node_Name); -- Unit_Name is correct for both library units and Ada stubs Part : constant Unit_Parts := (if Root_Node.Kind in Ada_Body_Stub then Unit_Separate else Unit_Body); begin pragma Assert (Extending_Project (Project (Arg_File_Info)) = No_Project); -- We don't want to modify extended projects return Result : constant String := +GNATCOLL.Projects.File_From_Unit (Project => Project (Arg_File_Info), Unit_Name => Unit_Name, Part => Part, Language => "Ada", File_Must_Exist => False) do null; end return; end Name_From_Project; -- If the output file is specified on the command line, -- use that. Otherwise, if there is a project file, -- use that. Otherwise use the default naming convention. Simple : constant String := (if Arg (Cmd, Output) = null then (if Status (Tool.Project_Tree.all) = Empty then Simple_Name (Default_Name) else Name_From_Project) else Arg (Cmd, Output).all); pragma Assert (Simple_Name (Simple) = Simple); begin return Result : constant String := (if Arg (Cmd, Output_Directory) = null then Compose (Containing_Directory (File_Name), Simple) else Compose (Arg (Cmd, Output_Directory).all, Simple)) do if Debug_Flag_C then Formatted_Output.Put ("writing \1?\n", Result); end if; end return; end Get_Output_Name; Output_Name : constant String := Get_Output_Name (Resolve_Links => True); procedure Write_Output_File is Out_File : constant File_Descriptor := Create_File (Output_Name, Fmode => Binary); Out_String : String renames Elems (JSON_Gen_Out_Vec) (1 .. Last_Index (JSON_Gen_Out_Vec)); Status : Boolean; -- Start of Processing for Write_Output_File begin if Out_File = Invalid_FD then raise Program_Error with "write of " & Output_Name & " failed"; end if; if BOM_Seen then -- if Options.Output_Encoding /= System.WCh_Con.WCEM_UTF8 then -- raise Program_Error; -- end if; Write_File (Out_File, Ada.Strings.UTF_Encoding.BOM_8); -- Put (W_Char'Val (16#FEFF#)); -- BOM as a wide character end if; Write_File (Out_File, Out_String); Close (Out_File, Status); if not Status then raise Program_Error with "write of " & Output_Name & " failed"; end if; if Debug_Flag_C then Formatted_Output.Put ("wrote \1\n", Output_Name); end if; -- ???The following messages would be more helpful if they say what -- is created, not what it's created for. if not Arg (Cmd, Quiet) then if Root_Node.Kind in Ada_Body_Stub then Formatted_Output.Put ("separate body is created for stub for \1\n", To_UTF8 (Id_Name (Get_Def_Name (Root_Node)))); elsif Update_Body_Specified (Cmd) then Formatted_Output.Put ("body is updated for \1\n", File_Name); else Formatted_Output.Put ("body is created for \1\n", File_Name); end if; end if; end Write_Output_File; procedure Update_Body; -- Implement the --update-body=N switch. procedure Update_Body is use Slocs, Ada_Node_Vectors; Search_Line : constant Line_Number := Line_Number (Arg (Cmd, Update_Body)); -- For --update-body=N, this is the value of N; we are searching for -- a subprogram declaration that appears on line N of the spec. Subp_Decl : Ada_Node := No_Ada_Node; -- The Subp_Decl at Search_Line Body_Line : Line_Number; -- The line number in the body file after which the new subprogram -- body should be inserted. Body_Line_Set : Boolean := False; procedure Search; -- Compute Subp_Decl and Body_Line function Find_Insertion_Index (Old_Content : String; Body_Line : Line_Number) return Positive; -- Return the index at which the stub is to be inserted procedure Indent_Stub (Amount : Natural); -- Indents the stub that is in JSON_Gen_Out_Vec. This is needed because the -- --initial-indentation switch doesn't fully work. We don't specify -- --initial-indentation=3; instead we subtract 3 from -- --max-line-length, and call Indent_Stub. procedure Search is -- Walk the spec, recursing into nested package and protected -- specs, searching for the subprogram declaration at Search_Line. -- Each time we see a declaration that has a corresponding -- declaration in the body, update Body_Line; we're going to -- insert the new body after the last such one encountered. When -- we find the subprogram we're searching for, we set Subp_Decl -- and quit. procedure Rec (Decl : Ada_Node); procedure Rec (Decl : Ada_Node) is Sorted : Ada_Node_Vector; procedure Update_Body_Line (New_Body_Line : Line_Number); -- Update Body_Line, asserting that we have not yet found the -- subprogram declaration we are looking for; once found, we -- should quit. procedure Collect_Decls (Decls : Ada_Node_List); -- Collect the declarations into Sorted, which will be sorted -- if --alphabetical-order was specified. procedure Update_Body_Line (New_Body_Line : Line_Number) is use Utils.Formatted_Output; begin if Debug_Flag_V then nn (Decl); Put ("\1 ==> \2\n", Image (Integer (Body_Line)), Image (Integer (New_Body_Line))); end if; pragma Assert (Subp_Decl.Is_Null); Body_Line_Set := True; Body_Line := New_Body_Line; end Update_Body_Line; procedure Collect_Decls (Decls : Ada_Node_List) is begin for X in 1 .. Last_Child_Index (Decls) loop declare Subtree : constant Ada_Node := Childx (Decls, X); begin Append (Sorted, Subtree); end; end loop; end Collect_Decls; Sloc : constant Source_Location_Range := Sloc_Range (Decl); Decl_Name : constant String := To_UTF8 (Full_Name (Get_Def_Name (Decl).As_Name)); -- Start of processing for Rec begin if Search_Line in Sloc.Start_Line .. Sloc.End_Line then case Decl.Kind is when Ada_Package_Decl | Ada_Generic_Package_Decl | Ada_Single_Protected_Decl | Ada_Protected_Type_Decl => declare B : constant Body_Node := Decl.As_Basic_Decl.P_Body_Part_For_Decl; begin if B.Is_Null then if not Body_Line_Set then Cmd_Error ("body of " & Decl_Name & " not found"); end if; else Update_Body_Line (Body_Decls (B).Sloc_Range.Start_Line); end if; end; if not Vis_Part (Decl).Is_Null then Collect_Decls (F_Decls (Vis_Part (Decl))); end if; if not Priv_Part (Decl).Is_Null then Collect_Decls (F_Decls (Priv_Part (Decl))); end if; if Arg (Cmd, Alphabetical_Order) then Sorting.Sort (Sorted); end if; for X in 1 .. Last_Index (Sorted) loop Rec (Sorted (X)); exit when not Subp_Decl.Is_Null; end loop; if Subp_Decl.Is_Null then Cmd_Error ("subprogram not found at line " & Image (Arg (Cmd, Update_Body))); end if; when Ada_Subp_Decl | Ada_Generic_Subp_Decl | Ada_Entry_Decl => pragma Assert (Subp_Decl.Is_Null); Subp_Decl := Decl; if not Decl.As_Basic_Decl.P_Body_Part_For_Decl.Is_Null then Cmd_Error ("body for " & Decl_Name & " already exists"); end if; when others => null; end case; else declare B : constant Body_Node := Decl.As_Basic_Decl.P_Body_Part_For_Decl; begin if not B.Is_Null then Update_Body_Line (B.Sloc_Range.End_Line); end if; end; end if; end Rec; begin Rec (Root_Node); if Subp_Decl.Is_Null then Cmd_Error ("no subprogram found at line " & Image (Arg (Cmd, Update_Body))); end if; end Search; function Find_Insertion_Index (Old_Content : String; Body_Line : Line_Number) return Positive is Line_Num : Line_Number := 1; begin return Result : Positive := 1 do while Line_Num <= Body_Line loop if Old_Content (Result) = ASCII.LF then Line_Num := Line_Num + 1; end if; Result := Result + 1; end loop; end return; end Find_Insertion_Index; procedure Indent_Stub (Amount : Natural) is Ind : constant String := (1 .. Amount => ' '); Temp : Char_Vector; begin Append (Temp, Ind); for X in 1 .. Last_Index (JSON_Gen_Out_Vec) loop Append (Temp, JSON_Gen_Out_Vec (X)); if JSON_Gen_Out_Vec (X) = ASCII.LF and then X /= Last_Index (JSON_Gen_Out_Vec) and then JSON_Gen_Out_Vec (X + 1) /= ASCII.LF then Append (Temp, Ind); end if; end loop; Move (Target => JSON_Gen_Out_Vec, Source => Temp); end Indent_Stub; Old_Content : String_Access := Read_File (Output_Name); Backup_Name : constant String := Output_Name & ".bak"; Create_Backup : constant Boolean := False; -- For now, we do not create a backup file -- Start of processing for Update_Body begin if Root_Node.Kind not in Ada_Package_Decl | Ada_Generic_Package_Decl then Cmd_Error ("package spec not found"); end if; Search; pragma Assert (Body_Line_Set); declare Name : constant W_Str := Full_Name (Get_Def_Name (Subp_Decl).As_Name); Level : constant Natural := 1; Insertion_Index : constant Positive := Find_Insertion_Index (Old_Content.all, Body_Line); pragma Assert (Old_Content (Insertion_Index - 1) = ASCII.LF); begin -- We want to insert the generated stub into the body at -- Insertion_Index. We want to pretty print the generated stub, -- but leave the rest of the code alone. So we generate the stub -- into Out_Vec, then call Format, which formats it into -- JSON_Gen_Out_Vec. Then move it back into Out_Vec, copy the first part -- of the body to JSON_Gen_Out_Vec, copy the stub into JSON_Gen_Out_Vec, and -- copy the rest of the body into JSON_Gen_Out_Vec. Finally, call -- Write_Output_File to write JSON_Gen_Out_Vec to the output (body) -- file. pragma Assert (Is_Empty (Out_Vec) and then Is_Empty (JSON_Gen_Out_Vec)); Generate_Local_Header (Name, Level); Generate_Subunit_Start (Level); Generate_Subp_Or_Entry_Body (Subp_Decl, Name, Ada_Stub => Arg (Cmd, Subunits)); -- JSON_Gen.Command_Lines.Json_Gen_Nat_Switches.Set_Arg -- (JSON_Gen_Cmd, JSON_Gen.Command_Lines.Initial_Indentation, 0); JSON_Gen.Command_Lines.Json_Gen_Nat_Switches.Set_Arg (JSON_Gen_Cmd, JSON_Gen.Command_Lines.Max_Line_Length, JSON_Gen.Command_Lines.Json_Gen_Nat_Switches.Arg (JSON_Gen_Cmd, JSON_Gen.Command_Lines.Max_Line_Length) - 3); if Update_Body_Specified (Cmd) and then Arg (Cmd, Subunits) then -- We would prefer to use Format in this case, with an -- appropriate Rule passed to Get_From_Buffer, but that -- doesn't quite work. Move (Target => JSON_Gen_Out_Vec, Source => Out_Vec); Indent_Stub (2); else Format; Indent_Stub (3); end if; Move (Target => Out_Vec, Source => JSON_Gen_Out_Vec); Append (JSON_Gen_Out_Vec, Old_Content (Old_Content'First .. Insertion_Index - 1)); Append (JSON_Gen_Out_Vec, ASCII.LF); Append (JSON_Gen_Out_Vec, Elems (Out_Vec) (1 .. Last_Index (Out_Vec))); if Old_Content (Insertion_Index) /= ASCII.LF then Append (JSON_Gen_Out_Vec, ASCII.LF); end if; Append (JSON_Gen_Out_Vec, Old_Content (Insertion_Index .. Old_Content'Last)); Free (Old_Content); Clear (Out_Vec); end; if Create_Backup then Move_File (Old_Name => Output_Name, New_Name => Backup_Name); end if; Write_Output_File; -- Finally, if we generated an Ada stub (i.e. --subunits is True), we -- recursively call ourself on the body to generate the subunits. if Arg (Cmd, Subunits) then declare Body_Cmd : Cmd_Line := Copy_Command_Line (Cmd); Cont : Natural := 1; begin Clear_File_Names (Body_Cmd); Append_File_Name (Body_Cmd, Output_Name); Set_Arg (Body_Cmd, Update_Body, No_Update_Body); Process_File (Tool, Body_Cmd, Output_Name, Cont); end; end if; end Update_Body; -- Start of processing for Generate begin if Update_Body_Specified (Cmd) then Update_Body; goto Skip; end if; -- If we are looking for Ada stubs, then of course the body file exists; -- we are not going to overwrite it. If we are generating a subunit for -- an Ada stub, and the subunit file already exists, we simply skip -- it. If we are generating a body for an Ada spec, it is an error if -- the output already exists, unless --force was given. if not Looking_For_Ada_Stubs and then Exists (Output_Name) then if Root_Node.Kind in Ada_Body_Stub then goto Skip; else if not Arg (Cmd, Force) then Cmd_Error ("the body for " & File_Name & " already exists; " & "use -f to overwrite it"); end if; end if; end if; Generate_CU_Header; Put ("pragma Ada_2012;\n"); Walk (Root_Node, Level => 0); -- If we're processing a body for stubs, we don't want to output -- anything corresponding to that body; we've already output the -- subunits. In that case, the above Walk will have generated some -- rubbage, which we ignore. Looking_For_Ada_Stubs will be False if the -- input is a spec, so we're generating bodies, or if we're in a -- recursive call to Generate for an Ada stub. It will be True only for -- the outer call with a body as input. if not Looking_For_Ada_Stubs then Format; Write_Output_File; end if; <<Skip>> end Generate; overriding procedure Per_File_Action (Tool : in out Json_Gen_Tool; Cmd : Command_Line; File_Name : String; Input : String; BOM_Seen : Boolean; Unit : Analysis_Unit) is Lib_Item_Or_Subunit : constant Ada_Node := Root (Unit).As_Compilation_Unit.F_Body; Root_Node : constant Ada_Node := (case Lib_Item_Or_Subunit.Kind is when Ada_Library_Item => Lib_Item_Or_Subunit.As_Library_Item.F_Item.As_Ada_Node, when Ada_Subunit => Lib_Item_Or_Subunit.As_Subunit.F_Body.As_Ada_Node, when others => raise Program_Error); -- Start of processing for Per_File_Action begin if Debug_Mode then Print (Unit); -- Put ("With trivia\n"); -- PP_Trivia (Unit); end if; case Root_Node.Kind is when Ada_Package_Decl | Ada_Generic_Package_Decl | Ada_Subp_Decl | Ada_Generic_Subp_Decl => if Arg (Cmd, Subunits) and then not Update_Body_Specified (Cmd) then Cmd_Error ("argument unit cannot have subunits"); end if; if not Needs_Completion (Root_Node) then Cmd_Error_No_Help ("Compilation unit " & To_UTF8 (Full_Name (Get_Def_Name (Root_Node).As_Name)) & " does not require a body"); end if; when Ada_Body_Node => if not Arg (Cmd, Subunits) then declare use Text_IO; begin Put (Standard_Error, Utils.Tool_Names.Tool_Name & ": "); Put_Line (Standard_Error, "input file looks like a body"); Cmd_Error_No_Help ("output file name should be provided because " & File_Name & " does not follow GNAT naming rules for " & "spec files"); end; end if; when others => raise Program_Error; end case; Generate (Tool, Cmd, File_Name, Input, BOM_Seen, Root_Node, Parent_Body_Of_Subunit => No_Ada_Node); end Per_File_Action; --------------- -- Tool_Help -- --------------- overriding procedure Tool_Help (Tool : Json_Gen_Tool) is pragma Unreferenced (Tool); use Utils.Formatted_Output; begin pragma Style_Checks ("M200"); -- Allow long lines Put ("Usage: jsongen [options] {filename}\n"); Put ("\n"); Put (" filename Ada source file\n"); Put ("\n"); Put ("options:\n"); Put (" --version Display version and exit\n"); Put (" --help Display usage and exit\n"); Put ("\n"); Put (" -Pproject Use project file project\n"); Put (" -U process all sources of the argument project\n"); Put (" -U main process the closure of units rooted at unit main\n"); Put (" -Xname=value specify an external reference for argument project file\n"); Put (" -eL follow all symbolic links when processing project files\n"); Put ("\n"); Put (" --subunits generate separate bodies for body stubs\n"); Put (" --files=filename name of a file containing a list of files to process\n"); Put ("\n"); Put (" --force replace an existing body file (if any), with a body sample\n"); Put (" --max-line-length=nnn maximum line length in sample body\n"); Put (" --indentation=n number of spaces used for indentation in sample body\n"); Put (" --alphabetical-order alphabetically order local bodies\n"); Put (" --comment_header_sample insert a sample comment header\n"); Put (" --comment_header_spec insert the comment header from the spec\n"); Put (" --header-file=filename insert the comment header from the specified file\n"); Put (" --no-exception avoid raising Program_Error in procedure stubs\n"); Put (" --no-local-header no local comment headers for unit stubs\n"); Put (" --output=body-name the name of the file to place the body into\n"); Put (" --output-dir=directory place generated file(s) into directory\n"); Put (" --wide-character-encoding=(8|b)\n"); Put (" wide character encoding of the result file\n"); Put ("\n"); Put (" --quiet / -q quiet mode\n"); Put (" --verbose / -v verbose mode\n"); Put ("\n\nReport bugs to report@adacore.com\n"); pragma Style_Checks ("M79"); end Tool_Help; end JSON_Gen.Actions;
with physics.Object, physics.Model, physics.Shape, bullet_C; private with bullet_c.Pointers, lace.Any; package bullet_Physics.Object -- -- Provides glue between a physics object and a Bullet3D object. -- is type Item is limited new physics.Object.item with private; type View is access all Item'Class; use Math; --------- --- Forge -- function new_Object (Shape : in physics.Shape.view; Mass : in Real; Friction : in Real; Restitution : in Real; at_Site : in Vector_3) return View; -- is_Kinematic : in Boolean) return View; overriding procedure define (Self : access Item; Shape : in physics.Shape.view; Mass : in Real; Friction : in Real; Restitution : in Real; at_Site : in Vector_3); procedure free (the_Object : in out physics.Object.view); -------------- --- Attributes -- function C (Self : in Item) return access bullet_C.Object; overriding function Model (Self : in Item) return physics.Model.view; overriding procedure Model_is (Self : in out Item; Now : in physics.Model.view); overriding procedure update_Dynamics (Self : in out Item); overriding function get_Dynamics (Self : in Item) return Matrix_4x4; private type Item is limited new physics.Object.item with record C : bullet_c.Pointers.Object_pointer; Shape : physics.Shape.view; Model : physics.Model.view; Dynamics : physics.Object.safe_Dynamics; user_Data : access lace.Any.limited_item'Class; end record; overriding procedure destruct (Self : in out Item); overriding function Shape (Self : in Item) return physics.Shape.view; overriding function Scale (Self : in Item) return Vector_3; overriding procedure Scale_is (Self : in out Item; Now : in Vector_3); overriding procedure activate (Self : in out Item; forceActivation : in Boolean := False); overriding function is_Active (Self : in Item) return Boolean; overriding function Mass (Self : in Item) return Real; overriding function Site (Self : in Item) return Vector_3; overriding procedure Site_is (Self : in out Item; Now : in Vector_3); overriding function Spin (Self : in Item) return Matrix_3x3; overriding procedure Spin_is (Self : in out Item; Now : in Matrix_3x3); overriding function xy_Spin (Self : in Item) return Radians; overriding procedure xy_Spin_is (Self : in out Item; Now : in Radians); overriding function Transform (Self : in Item) return Matrix_4x4; overriding procedure Transform_is (Self : in out Item; Now : in Matrix_4x4); overriding function Speed (Self : in Item) return Vector_3; overriding procedure Speed_is (Self : in out Item; Now : in Vector_3); overriding function Gyre (Self : in Item) return Vector_3; overriding procedure Gyre_is (Self : in out Item; Now : in Vector_3); overriding procedure Friction_is (Self : in out Item; Now : in Real); overriding procedure Restitution_is (Self : in out Item; Now : in Real); --- Forces -- overriding procedure apply_Torque (Self : in out Item; Torque : in Vector_3); overriding procedure apply_Torque_impulse (Self : in out Item; Torque : in Vector_3); overriding procedure apply_Force (Self : in out Item; Force : in Vector_3); --- User data -- overriding procedure user_Data_is (Self : in out Item; Now : access lace.Any.limited_item'Class); overriding function user_Data (Self : in Item) return access lace.Any.limited_item'Class; end bullet_Physics.Object;
--***************************************************************************** --* --* PROJECT: BINGADA --* --* FILE: q_bingo.adb --* --* AUTHOR: Javier Fuica Fernandez --* --***************************************************************************** with Q_GEN_SHUFFLE; -- Sound library -- with CANBERRA; with Ada.Directories; with Ada.Strings.Fixed; with GTKADA.Intl; package body Q_BINGO.Q_BOMBO is --================================================================== V_INDEX : T_NUMBER; --================================================================== package Q_SHUFFLE is new Q_GEN_SHUFFLE (ELEMENT_TYPE => T_NUMBER, C_MAX_NUMBER => T_NUMBER'LAST); V_BINGO_ARRAY : Q_SHUFFLE.ARRAY_TYPE; V_CONTEXT : CANBERRA.CONTEXT := CANBERRA.CREATE (NAME => "BingAda", ID => "bingada.lovelace", ICON => "applications-games"); --================================================================== procedure P_INIT is begin for I in 1 .. T_NUMBER'LAST loop V_BINGO_ARRAY (I) := I; end loop; Q_SHUFFLE.P_SHUFFLE (LIST => V_BINGO_ARRAY); V_INDEX := 1; end P_INIT; --================================================================== procedure P_Play_Number (V_NUMBER : Positive) is C_Number_Image : constant String := Ada.Strings.Fixed.Trim (V_Number'Image, Ada.Strings.Left); C_Path : constant String := "media/"; C_Extension : constant String := ".ogg"; C_Lang_Code_Last : constant := 2; C_locale : constant String := GTKADA.INTL.Getlocale; C_Default_Lang : constant String := "en"; V_Lang : String (1 .. C_Lang_Code_Last) := C_Default_Lang; V_Sound : Canberra.Sound; begin if C_locale'Length >= C_Lang_Code_Last then V_Lang := C_Locale (C_Locale'First .. C_Locale'First + C_Lang_Code_Last - 1); end if; if not Ada.Directories.Exists (C_Path & V_Lang & '/' & C_Number_Image & C_Extension) then V_Lang := C_Default_Lang; end if; V_Context.Play_FILE (C_Path & V_Lang & '/' & C_Number_Image & C_Extension, V_SOUND, CANBERRA.Music, "Number"); end P_Play_Number; --================================================================== procedure P_SPIN (V_NUMBER : out POSITIVE; V_CURRENT_INDEX : out T_NUMBER; V_LAST_NUMBER : out BOOLEAN) is begin if V_INDEX = T_NUMBER'LAST then V_NUMBER := V_BINGO_ARRAY (T_NUMBER'LAST); V_LAST_NUMBER := TRUE; V_CURRENT_INDEX := V_INDEX; else V_NUMBER := V_BINGO_ARRAY (V_INDEX); V_CURRENT_INDEX := V_INDEX; V_INDEX := V_INDEX + 1; V_LAST_NUMBER := FALSE; end if; P_PLAY_NUMBER (V_Bingo_Array(V_Current_Index)); end P_SPIN; --================================================================== function F_GET_NUMBER (V_INDEX : T_NUMBER) return T_NUMBER is begin return V_BINGO_ARRAY (V_INDEX); end F_GET_NUMBER; --================================================================== function F_GET_CURRENT_INDEX return T_NUMBER is begin return V_INDEX; end F_GET_CURRENT_INDEX; --================================================================== end Q_BINGO.Q_BOMBO;
------------------------------------------------------------------------------ -- Copyright (c) 2016-2017, Natacha Porté -- -- -- -- Permission to use, copy, modify, and distribute this software for any -- -- purpose with or without fee is hereby granted, provided that the above -- -- copyright notice and this permission notice appear in all copies. -- -- -- -- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -- -- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -- -- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -- -- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -- -- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -- -- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -- -- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -- ------------------------------------------------------------------------------ with Ada.Streams.Stream_IO; with Natools.File_Streams; with Natools.S_Expressions.Atom_Buffers; with Natools.S_Expressions.Atom_Ref_Constructors; with Natools.S_Expressions.Lockable; with Natools.String_Slices; with Lithium.Line_Parsers; with Lithium.Markdown; package body Natools.Web.Simple_Pages.Markdown_Multipages is procedure Insert_Text (Mutator : in Data_Refs.Mutator; Name : in String; Text : in S_Expressions.Atom_Refs.Immutable_Reference); function Is_Boundary (Line : S_Expressions.Atom) return Boolean; function Is_Boundary (Line : S_Expressions.Atom_Buffers.Atom_Buffer) return Boolean; function Key_Path (Path, Spec : S_Expressions.Atom) return S_Expressions.Atom; function To_Slice (Buffer : S_Expressions.Atom_Buffers.Atom_Buffer) return Natools.String_Slices.Slice; function Web_Path (Path, Spec : S_Expressions.Atom) return S_Expressions.Atom_Refs.Immutable_Reference; ------------------------------ -- Local Helper Subprograms -- ------------------------------ procedure Insert_Text (Mutator : in Data_Refs.Mutator; Name : in String; Text : in S_Expressions.Atom_Refs.Immutable_Reference) is Expr : S_Expressions.Caches.Reference; begin Expr.Append_Atom (Text.Query); Mutator.Elements := Mutator.Elements.Include (S_Expressions.To_Atom (Name), Expr.First); end Insert_Text; function Is_Boundary (Line : S_Expressions.Atom) return Boolean is use type S_Expressions.Octet; use type S_Expressions.Offset; I : S_Expressions.Offset; begin if Line'Length = 0 or else Line (Line'First) not in Character'Pos ('-') | Character'Pos ('+') then return False; end if; I := Line'First + 1; while I in Line'Range and then Line (I) = Character'Pos ('-') + Character'Pos ('+') - Line (I - 1) loop I := I + 1; end loop; return I > Line'First + 2 and then (I > Line'Last or else Line (I) in 10 | 13); end Is_Boundary; function Is_Boundary (Line : S_Expressions.Atom_Buffers.Atom_Buffer) return Boolean is begin return Is_Boundary (Line.Raw_Query.Data.all); end Is_Boundary; function Key_Path (Path, Spec : S_Expressions.Atom) return S_Expressions.Atom is use type S_Expressions.Atom; use type S_Expressions.Offset; begin case Spec (Spec'First) is when Character'Pos ('+') => return Path & Spec (Spec'First + 1 .. Spec'Last); when Character'Pos ('-') | Character'Pos ('#') => return S_Expressions.Null_Atom; when others => return Spec; end case; end Key_Path; function To_Slice (Buffer : S_Expressions.Atom_Buffers.Atom_Buffer) return Natools.String_Slices.Slice is procedure Initialize (S : out String); procedure Initialize (S : out String) is use type S_Expressions.Offset; Accessor : constant S_Expressions.Atom_Refs.Accessor := Buffer.Raw_Query; I : S_Expressions.Offset := Accessor.Data.all'First; begin for O in S'Range loop S (O) := Character'Val (Accessor.Data (I)); I := I + 1; end loop; end Initialize; begin return Natools.String_Slices.New_Slice (1, Natural (Buffer.Length), Initialize'Access); end To_Slice; function Web_Path (Path, Spec : S_Expressions.Atom) return S_Expressions.Atom_Refs.Immutable_Reference is use type S_Expressions.Atom; use type S_Expressions.Offset; begin case Spec (Spec'First) is when Character'Pos ('+') | Character'Pos ('#') => return S_Expressions.Atom_Ref_Constructors.Create (Path & Spec (Spec'First + 1 .. Spec'Last)); when Character'Pos ('-') => return S_Expressions.Atom_Ref_Constructors.Create (Spec (Spec'First + 1 .. Spec'Last)); when others => return S_Expressions.Atom_Ref_Constructors.Create (Spec); end case; end Web_Path; ---------------------- -- Public Interface -- ---------------------- function Create (File : in S_Expressions.Atom) return Sites.Page_Loader'Class is begin return Loader'(File_Path => S_Expressions.Atom_Ref_Constructors.Create (File)); end Create; overriding procedure Load (Object : in out Loader; Builder : in out Sites.Site_Builder; Path : in S_Expressions.Atom) is use type S_Expressions.Events.Event; Stream : aliased File_Streams.File_Stream := File_Streams.Open (Ada.Streams.Stream_IO.In_File, S_Expressions.To_String (Object.File_Path.Query)); Parser : Lithium.Line_Parsers.Parser (Stream'Access); Lock : S_Expressions.Lockable.Lock_State; Text : S_Expressions.Atom_Refs.Immutable_Reference; Summary : S_Expressions.Atom_Refs.Immutable_Reference; Line, Markdown : S_Expressions.Atom_Buffers.Atom_Buffer; Event : S_Expressions.Events.Event; Finished : Boolean; Template : Page_Template; begin Read_Pages : loop Skip_To_Next_Page : loop Parser.Next (Event); exit Read_Pages when Event /= S_Expressions.Events.Open_List; Parser.Lock (Lock); Parser.Next (Event); exit Read_Pages when Event /= S_Expressions.Events.Add_Atom; exit Skip_To_Next_Page when Parser.Current_Atom'Length > 0; -- Read templae Update (Template, Parser); Parser.Unlock (Lock); end loop Skip_To_Next_Page; declare use type S_Expressions.Offset; Path_Spec : constant S_Expressions.Atom := Parser.Current_Atom; Page : constant Page_Ref := Create (Parser, Template, (if Path_Spec (Path_Spec'First) in Character'Pos ('#') | Character'Pos ('+') | Character'Pos ('-') then Path_Spec (Path_Spec'First + 1 .. Path_Spec'Last) else Path_Spec)); begin Markdown.Soft_Reset; Read_Markdown : loop Line.Soft_Reset; Lithium.Line_Parsers.Append_Line (Line, Stream, Finished); exit Read_Markdown when Is_Boundary (Line); Markdown.Append (Line.Data); exit Read_Markdown when Finished; end loop Read_Markdown; Lithium.Markdown.Extended.Render (To_Slice (Markdown), Text, Summary); declare Mutator : constant Data_Refs.Mutator := Page.Ref.Update; begin Insert_Text (Mutator, "markdown-text", Text); if not Summary.Is_Empty then Insert_Text (Mutator, "markdown-summary", Summary); end if; Mutator.File_Path := Object.File_Path; Mutator.Web_Path := Web_Path (Path, Path_Spec); end; Register (Page, Builder, Key_Path (Path, Path_Spec)); end; exit Read_Pages when Finished; Parser.Reset; end loop Read_Pages; end Load; end Natools.Web.Simple_Pages.Markdown_Multipages;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- G N A T . C A L E N D A R -- -- -- -- S p e c -- -- -- -- Copyright (C) 1999-2020, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This package extends Ada.Calendar to handle Hour, Minute, Second, -- Second_Duration and Day_Of_Week and Day_In_Year from Calendar.Time. -- Second_Duration precision depends on the target clock precision. -- -- GNAT.Calendar provides the same kind of abstraction found in Ada.Calendar. -- It provides Split and Time_Of to build and split a Time data. And it -- provides accessor functions to get only one of Hour, Minute, Second, -- Second_Duration. Other functions are to access more advanced values like -- Day_Of_Week, Day_In_Year and Week_In_Year. with Ada.Calendar.Formatting; with Interfaces.C; package GNAT.Calendar is type Day_Name is (Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday); pragma Ordered (Day_Name); subtype Hour_Number is Natural range 0 .. 23; subtype Minute_Number is Natural range 0 .. 59; subtype Second_Number is Natural range 0 .. 59; subtype Second_Duration is Ada.Calendar.Day_Duration range 0.0 .. 1.0; subtype Day_In_Year_Number is Positive range 1 .. 366; subtype Week_In_Year_Number is Positive range 1 .. 53; No_Time : constant Ada.Calendar.Time; -- A constant set to the first date that can be represented by the type -- Time. It can be used to indicate an uninitialized date. function Hour (Date : Ada.Calendar.Time) return Hour_Number; function Minute (Date : Ada.Calendar.Time) return Minute_Number; function Second (Date : Ada.Calendar.Time) return Second_Number; function Sub_Second (Date : Ada.Calendar.Time) return Second_Duration; -- Hour, Minute, Second and Sub_Second returns the complete time data for -- the Date (H:M:S.SS). See Ada.Calendar for Year, Month, Day accessors. -- Second_Duration precision depends on the target clock precision. function Day_Of_Week (Date : Ada.Calendar.Time) return Day_Name; -- Return the day name function Day_In_Year (Date : Ada.Calendar.Time) return Day_In_Year_Number; -- Return the day number in the year. (1st January is day 1 and 31st -- December is day 365 or 366 for leap year). procedure Split (Date : Ada.Calendar.Time; Year : out Ada.Calendar.Year_Number; Month : out Ada.Calendar.Month_Number; Day : out Ada.Calendar.Day_Number; Hour : out Hour_Number; Minute : out Minute_Number; Second : out Second_Number; Sub_Second : out Second_Duration); -- Split a standard Ada.Calendar.Time value in date data (Year, Month, Day) -- and Time data (Hour, Minute, Second, Sub_Second). procedure Split_At_Locale (Date : Ada.Calendar.Time; Year : out Ada.Calendar.Year_Number; Month : out Ada.Calendar.Month_Number; Day : out Ada.Calendar.Day_Number; Hour : out Hour_Number; Minute : out Minute_Number; Second : out Second_Number; Sub_Second : out Second_Duration); -- Split a standard Ada.Calendar.Time value in date data (Year, Month, Day) -- and Time data (Hour, Minute, Second, Sub_Second). This version of Split -- utilizes the time zone and DST bias of the locale (equivalent to Clock). -- Due to this simplified behavior, the implementation does not require -- expensive system calls on targets such as Windows. -- WARNING: Split_At_Locale is no longer aware of historic events and may -- produce inaccurate results over DST changes which occurred in the past. function Time_Of (Year : Ada.Calendar.Year_Number; Month : Ada.Calendar.Month_Number; Day : Ada.Calendar.Day_Number; Hour : Hour_Number; Minute : Minute_Number; Second : Second_Number; Sub_Second : Second_Duration := 0.0) return Ada.Calendar.Time; -- Return an Ada.Calendar.Time data built from the date and time values function Time_Of_At_Locale (Year : Ada.Calendar.Year_Number; Month : Ada.Calendar.Month_Number; Day : Ada.Calendar.Day_Number; Hour : Hour_Number; Minute : Minute_Number; Second : Second_Number; Sub_Second : Second_Duration := 0.0) return Ada.Calendar.Time; -- Return an Ada.Calendar.Time data built from the date and time values. -- This version of Time_Of utilizes the time zone and DST bias of the -- locale (equivalent to Clock). Due to this simplified behavior, the -- implementation does not require expensive system calls on targets such -- as Windows. -- WARNING: Split_At_Locale is no longer aware of historic events and may -- produce inaccurate results over DST changes which occurred in the past. function Week_In_Year (Date : Ada.Calendar.Time) return Week_In_Year_Number; -- Return the week number as defined in ISO 8601. A week always starts on -- a Monday and the first week of a particular year is the one containing -- the first Thursday. A year may have 53 weeks when January 1st is a -- Wednesday and the year is leap or January 1st is a Thursday. Note that -- the last days of December may belong to the first week on the next year -- and conversely, the first days of January may belong to the last week -- of the last year. procedure Year_Week_In_Year (Date : Ada.Calendar.Time; Year : out Ada.Calendar.Year_Number; Week : out Week_In_Year_Number); -- Return the week number as defined in ISO 8601 along with the year in -- which the week occurs. -- C timeval conversion -- C timeval represent a duration (used in Select for example). This -- structure is composed of a number of seconds and a number of micro -- seconds. The timeval structure is not exposed here because its -- definition is target dependent. Interface to C programs is done via a -- pointer to timeval structure. type timeval is private; function To_Duration (T : not null access timeval) return Duration; function To_Timeval (D : Duration) return timeval; private -- This is a dummy declaration that should be the largest possible timeval -- structure of all supported targets. type timeval is array (1 .. 3) of Interfaces.C.long; function Julian_Day (Year : Ada.Calendar.Year_Number; Month : Ada.Calendar.Month_Number; Day : Ada.Calendar.Day_Number) return Integer; -- Compute Julian day number -- -- The code of this function is a modified version of algorithm 199 from -- the Collected Algorithms of the ACM. The author of algorithm 199 is -- Robert G. Tantzen. No_Time : constant Ada.Calendar.Time := Ada.Calendar.Formatting.Time_Of (Ada.Calendar.Year_Number'First, Ada.Calendar.Month_Number'First, Ada.Calendar.Day_Number'First, Time_Zone => 0); -- Use Time_Zone => 0 to be the same binary representation in any timezone end GNAT.Calendar;
private with ADA.Containers.Vectors; package ACO.Drivers.Dummy is type Dummy_Driver is new Driver with private; overriding procedure Receive_Message_Blocking (This : in out Dummy_Driver; Msg : out ACO.Messages.Message); overriding procedure Send_Message (This : in out Dummy_Driver; Msg : in ACO.Messages.Message); overriding procedure Initialize (This : in out Dummy_Driver); overriding procedure Finalize (This : in out Dummy_Driver); overriding function Is_Message_Pending (This : Dummy_Driver) return Boolean; procedure Get_First_Sent (This : in out Dummy_Driver; Msg : out ACO.Messages.Message); function Nof_Sent (This : Dummy_Driver) return Natural; overriding function Current_Time (This : Dummy_Driver) return Ada.Real_Time.Time; procedure Set_Time (This : in out Dummy_Driver; T : in Ada.Real_Time.Time); private use type ACO.Messages.Message; package V_Message is new Ada.Containers.Vectors (Natural, ACO.Messages.Message); subtype Message_Vec is V_Message.Vector; type Dummy_Driver is new Driver with record T_Now : Ada.Real_Time.Time := Ada.Real_Time.Time_First; Tx_Buffer : Message_Vec; end record; end ACO.Drivers.Dummy;
private with COBS.Stream.Encoder; package Test_Utils.Abstract_Encoder.COBS_Stream is subtype Parent is Abstract_Encoder.Instance; type Instance is new Parent with private; type Acc is access all Instance; type Any_Acc is access all Instance'Class; overriding procedure Receive (This : in out Instance; Data : Storage_Element); overriding procedure End_Of_Frame (This : in out Instance); overriding procedure Update (This : in out Instance); overriding procedure End_Of_Test (This : in out Instance); private type Test_Instance is new COBS.Stream.Encoder.Instance with record Output : Data_Frame; end record; overriding procedure Flush (This : in out Test_Instance; Data : Storage_Array); type Instance is new Parent with record Encoder : Test_Instance; end record; end Test_Utils.Abstract_Encoder.COBS_Stream;
with Ada.Exception_Identification.From_Here; package body Ada.Streams.Block_Transmission is pragma Suppress (All_Checks); use Exception_Identification.From_Here; procedure Read ( Stream : not null access Root_Stream_Type'Class; Item : out Array_Type) is begin if Element_Type'Size = Element_Type'Stream_Size and then Array_Type'Component_Size = Element_Type'Stream_Size then declare Item_As_SEA : Stream_Element_Array ( 1 .. (Element_Type'Stream_Size / Stream_Element'Size) * Item'Length); for Item_As_SEA'Address use Item'Address; begin Stream_Element_Arrays.Read (Stream, Item_As_SEA); end; else Array_Type'Read (Stream, Item); end if; end Read; procedure Write ( Stream : not null access Root_Stream_Type'Class; Item : Array_Type) is begin if Element_Type'Size = Element_Type'Stream_Size and then Array_Type'Component_Size = Element_Type'Stream_Size then declare Item_As_SEA : Stream_Element_Array ( 1 .. (Element_Type'Stream_Size / Stream_Element'Size) * Item'Length); for Item_As_SEA'Address use Item'Address; begin Stream_Element_Arrays.Write (Stream, Item_As_SEA); end; else Array_Type'Write (Stream, Item); end if; end Write; function Input ( Stream : not null access Root_Stream_Type'Class) return Array_Type is First, Last : Index_Type'Base; begin Index_Type'Base'Read (Stream, First); Index_Type'Base'Read (Stream, Last); if First < Index_Type'First or else Last > Index_Type'Last then Raise_Exception (Data_Error'Identity); end if; return Result : Array_Type (First .. Last) do Read (Stream, Result); end return; end Input; procedure Output ( Stream : not null access Root_Stream_Type'Class; Item : Array_Type) is begin Index_Type'Write (Stream, Item'First); Index_Type'Write (Stream, Item'Last); Write (Stream, Item); end Output; package body Stream_Element_Arrays is procedure Read ( Stream : not null access Root_Stream_Type'Class; Item : out Stream_Element_Array) is I : Stream_Element_Offset := Item'First; begin if I <= Item'Last then loop declare Last : Stream_Element_Offset; begin Streams.Read (Stream.all, Item (I .. Item'Last), Last); exit when Last >= Item'Last; if Last < I then Raise_Exception (End_Error'Identity); end if; I := Last + 1; end; end loop; end if; end Read; procedure Write ( Stream : not null access Root_Stream_Type'Class; Item : Stream_Element_Array) is begin Streams.Write (Stream.all, Item); end Write; end Stream_Element_Arrays; end Ada.Streams.Block_Transmission;
with avtas.lmcp.types; use avtas.lmcp.types; with afrl.cmasi.object; use afrl.cmasi.object; with afrl.cmasi.enumerations; use afrl.cmasi.enumerations; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; package afrl.cmasi.keyValuePair is type KeyValuePair is new afrl.cmasi.object.Object with private; type KeyValuePair_Acc is access all KeyValuePair; -- Technically, nothing inherits from this, so we don't need a class access type type KeyValuePair_Class_Acc is access all KeyValuePair'Class; function getFullLmcpTypeName(this : KeyValuePair) return String; function getLmcpTypeName(this : KeyValuePair) return String; function getLmcpType(this : KeyValuePair) return UInt32_t; function getKey(this : KeyValuePair'Class) return Unbounded_String; procedure setKey(this : out KeyValuePair'Class; Key : in Unbounded_String); function getValue(this : KeyValuePair'Class) return Unbounded_String; procedure setValue(this : out KeyValuePair'Class; Value : in Unbounded_String); private type KeyValuePair is new afrl.cmasi.object.Object with record Key : Unbounded_String; Value : Unbounded_String; end record; end afrl.cmasi.keyValuePair;
-- ************************************************************************************* -- -- The recipient is warned that this code should be handled in accordance -- with the HM Government Security Classification indicated throughout. -- -- This code and its contents shall not be used for other than UK Government -- purposes. -- -- The copyright in this code is the property of BAE SYSTEMS Electronic Systems Limited. -- The Code is supplied by BAE SYSTEMS on the express terms that it is to be treated in -- confidence and that it may not be copied, used or disclosed to others for any -- purpose except in accordance with DEFCON 91 (Edn 10/92). -- -- File Name: Root_Object.adb -- Version: As detailed by ClearCase -- Version Date: As detailed by ClearCase -- Creation Date: 03-11-99 -- Security Classification: Unclassified -- Project: SRLE (Sting Ray Life Extension) -- Author: J Mann -- Section: Tactical Software/ Software Architecture -- Division: Underwater Systems Division -- Description: Top-level object and event hierarchy implementation -- Comments: -- -- MODIFICATION RECORD -- -------------------- -- NAME DATE ECR No MODIFICATION -- -- jmm 06/07/00 PILOT_0000_0247 Legacy code removed from application -- -- db 09/07/01 PILOT_0000_0230 Remove use clause as per coding standards -- -- db 08/02/02 SRLE100001622 Legacy code removed from application -- -- db 18/03/02 SRLE100002754 Simplification of withing statements. -- -- db 03/04/02 SRLE100002907 Remove Initialise_List -- -- db 17/04/02 SRLE100003005 Removal of loitering legacy code. -- -- ************************************************************************************** with log; package body Root_Object is ------------------------------------------------------------------------ --********************* Object Management ***************************** ------------------------------------------------------------------------ function Create return Object_Access is this: Object_Access; begin this := new Object_Type; return this; end Create; ------------------------------------------------------------------------ procedure Description (This_Object: Object_Type) is begin Log.Put (Object_String&".Description: ID = "); Log.Put_Line (integer'image (This_Object.Root_Object_Attribute)); end Description; ------------------------------------------------------------------------ procedure Delete (Old_Object: in out Object_Access) is begin Log.Put (Object_String&".Delete"); end Delete; --------------------------------------------------------------------- Root_Object_Attribute: integer := 0; function Get_Next_Root_Object_Attribute return integer is begin Root_Object_Attribute := Root_Object_Attribute + 1; return Root_Object_Attribute; end Get_Next_Root_Object_Attribute; ------------------------------------------------------------------------ --************************** Event Stuff ****************************** ------------------------------------------------------------------------ procedure Do_Events is -- The_Object: Object_Access; begin Log.Put_Line (Object_String&" Do_Events "); end Do_Events ; ------------------------------------------------------------------------ procedure Put_Event (Event: in Root_Object.Root_Event_Access_Type; To_Class: in Object_Type; Top: in boolean := false) is begin Log.Put_Line (Object_String&" Put_Event"); end Put_Event; -------------------------------------------------------------------------- procedure Polymorphic_Put (This_Object: in out Object_Type; This_Event: in Root_Event_Access_Type) is begin Log.Put_Line (Object_String&" Polymorphic_Put"); end Polymorphic_Put; -------------------------------------------------------------------------- Root_Event_Attribute: integer := 0; function Get_Root_Event_Attribute return integer is begin return Root_Event_Attribute; end Get_Root_Event_Attribute; -------------------------------------------------------------------------- function Get_Next_Root_Event_Attribute return integer is begin Root_Event_Attribute := Root_Event_Attribute + 1; return Root_Event_Attribute; end Get_Next_Root_Event_Attribute; ---------------------------------------------------------------------- procedure Process_Events (This_Event: in Root_Event_Type) is begin Log.Put_Line (Object_String&": Process_Events "); end Process_Events; ---------------------------------------------------------------------- procedure Event_Action (Dispatch_Event: in Root_Event_Type; This_Event: in out Root_Event_Access_Type) is begin Log.Put_Line (Object_String&": Event_Action "); end Event_Action; ------------------------------------------------------------------------ --******************* Navigation Utilities **************************** ------------------------------------------------------------------------ function Size_Of_Access return natural is begin return Access_Type_Size; end Size_Of_Access; ------------------------------------------------------------------------ function Size_Of_Boolean return natural is begin return Boolean'Size; end Size_Of_Boolean; ------------------------------------------------------------------------ end Root_Object;
-- -- Copyright 2018 The wookey project team <wookey@ssi.gouv.fr> -- - Ryad Benadjila -- - Arnauld Michelizza -- - Mathieu Renard -- - Philippe Thierry -- - Philippe Trebuchet -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. -- -- package soc.interrupts with spark_mode => on is ------------------------------------- -- STM32F4xx interrupts and events -- ------------------------------------- type t_interrupt is (ESTACK, -- 0 INT_RESET, INT_NMI, INT_HARDFAULT, INT_MEMMANAGE, INT_BUSFAULT, -- 5 INT_USAGEFAULT, INT_VOID1, INT_VOID2, INT_VOID3, INT_VOID4, -- 10 INT_SVC, INT_DEBUGON, INT_VOID5, INT_PENDSV, INT_SYSTICK, -- 15 INT_WWDG, INT_PVD, INT_TAMP_STAMP, INT_RTC_WKUP, INT_FLASH, -- 20 INT_RCC, INT_EXTI0, INT_EXTI1, INT_EXTI2, INT_EXTI3, -- 25 INT_EXTI4, INT_DMA1_STREAM0, INT_DMA1_STREAM1, INT_DMA1_STREAM2, INT_DMA1_STREAM3, -- 30 INT_DMA1_STREAM4, INT_DMA1_STREAM5, INT_DMA1_STREAM6, INT_ADC, INT_CAN1_TX, -- 35 INT_CAN1_RX0, INT_CAN1_RX1, INT_CAN1_SCE, INT_EXTI9_5, INT_TIM1_BRK_TIM9, -- 40 INT_TIM1_UP_TIM10, INT_TIM1_TRG_COM_TIM11, INT_TIM1_CC, INT_TIM2, INT_TIM3, -- 45 INT_TIM4, INT_I2C1_EV, INT_I2C1_ER, INT_I2C2_EV, INT_I2C2_ER, -- 50 INT_SPI1, INT_SPI2, INT_USART1, INT_USART2, INT_USART3, -- 55 INT_EXTI15_10, INT_RTC_ALARM, INT_OTG_FS_WKUP, INT_TIM8_BRK_TIM12, INT_TIM8_UP_TIM13, -- 60 INT_TIM8_TRG_COM_TIM14, INT_TIM8_CC, INT_DMA1_STREAM7, INT_FSMC, INT_SDIO, -- 65 INT_TIM5, INT_SPI3, INT_UART4, INT_UART5, INT_TIM6_DAC, -- 70 INT_TIM7, INT_DMA2_STREAM0, INT_DMA2_STREAM1, INT_DMA2_STREAM2, INT_DMA2_STREAM3, -- 75 INT_DMA2_STREAM4, INT_ETH, INT_ETH_WKUP, INT_CAN2_TX, INT_CAN2_RX0, -- 80 INT_CAN2_RX1, INT_CAN2_SCE, INT_OTG_FS, INT_DMA2_STREAM5, INT_DMA2_STREAM6, -- 85 INT_DMA2_STREAM7, INT_USART6, INT_I2C3_EV, INT_I2C3_ER, INT_OTG_HS_EP1_OUT, -- 90 INT_OTG_HS_EP1_IN, INT_OTG_HS_WKUP, INT_OTG_HS, INT_DCMI, INT_CRYP, -- 95 INT_HASH_RNG, INT_FPU, INT_98, INT_99, INT_100, INT_101, INT_102, INT_103, INT_104, INT_105, INT_106, INT_107, INT_108, INT_109, INT_110, INT_111, INT_112, INT_113, INT_114, INT_115, INT_116, INT_117, INT_118, INT_119, INT_120, INT_121, INT_122, INT_123, INT_124, INT_125, INT_126, INT_127, INT_128, INT_129, INT_130, INT_131, INT_132, INT_133, INT_134, INT_135, INT_136, INT_137, INT_138, INT_139, INT_140, INT_141, INT_142, INT_143, INT_144, INT_145, INT_146, INT_147, INT_148, INT_149, INT_150, INT_151, INT_152, INT_153, INT_154, INT_155, INT_156, INT_157, INT_158, INT_159, INT_160, INT_161, INT_162, INT_163, INT_164, INT_165, INT_166, INT_167, INT_168, INT_169, INT_170, INT_171, INT_172, INT_173, INT_174, INT_175, INT_176, INT_177, INT_178, INT_179, INT_180, INT_181, INT_182, INT_183, INT_184, INT_185, INT_186, INT_187, INT_188, INT_189, INT_190, INT_191, INT_192, INT_193, INT_194, INT_195, INT_196, INT_197, INT_198, INT_199, INT_200, INT_201, INT_202, INT_203, INT_204, INT_205, INT_206, INT_207, INT_208, INT_209, INT_210, INT_211, INT_212, INT_213, INT_214, INT_215, INT_216, INT_217, INT_218, INT_219, INT_220, INT_221, INT_222, INT_223, INT_224, INT_225, INT_226, INT_227, INT_228, INT_229, INT_230, INT_231, INT_232, INT_233, INT_234, INT_235, INT_236, INT_237, INT_238, INT_239, INT_240, INT_241, INT_242, INT_243, INT_244, INT_245, INT_246, INT_247, INT_248, INT_249, INT_250, INT_251, INT_252, INT_253, INT_254, INT_255) with size => 8; function get_interrupt return t_interrupt with inline, convention => c, export => true, external_name => "interrupt_get_num"; end soc.interrupts;
-- { dg-do compile } -- { dg-options "-O" } with Loop_Optimization13_Pkg; use Loop_Optimization13_Pkg; package body Loop_Optimization13 is function F (A : Rec) return Rec is N : constant Integer := A.V'Length / L; Res : Rec := (True, new Complex_Vector' (0 .. A.V'Length / L - 1 => (0.0, 0.0))); begin for I in 0 .. L - 1 loop for J in 0 .. N - 1 loop Res.V (J) := Res.V (J) + A.V (I * N + J); end loop; end loop; return Res; end; end Loop_Optimization13;
with gel.Camera.forge, gel.Events, lace.Event.utility; package body gel.Applet.gui_and_sim_world is procedure define (Self : access Item; Name : in String; use_Window : in gel.Window.view) is use lace.Event.utility; begin declare the_world_Info : constant world_Info_view := new world_Info; the_Camera : constant gel.Camera.view := gel.Camera.forge.new_Camera; begin the_world_Info.World := gel.World.forge.new_World (Name, gui_world_Id, space_Kind => physics.Bullet, Renderer => Self.Renderer); the_world_Info.World.register (Self.all'unchecked_Access, to_Kind (gel.events.new_sprite_added_to_world_Event'Tag)); the_Camera.set_viewport_Size (Self.Window.Width, Self.Window.Height); the_Camera.Renderer_is (Self.Renderer); the_Camera.Site_is ((0.0, 5.0, 5.0)); the_world_Info.Cameras.append (the_Camera); Self.Worlds .append (the_world_Info); Self.local_Subject_and_Observer.add (the_add_new_sprite_Response'Access, to_Kind (gel.events.new_sprite_added_to_world_Event'Tag), the_world_Info.World.Name); the_world_Info.World.start; end; declare the_world_Info : constant world_Info_view := new world_Info; the_Camera : constant gel.Camera.View := gel.Camera.forge.new_Camera; begin the_world_Info.World := gel.World.forge.new_World (Name => Name, Id => sim_world_Id, space_Kind => physics.Bullet, Renderer => Self.Renderer); the_world_Info.World.register (the_Observer => Self.all'unchecked_Access, of_Kind => to_Kind (gel.events.new_sprite_added_to_world_Event'Tag)); the_Camera.set_viewport_Size (Self.Window.Width, Self.Window.Height); the_Camera.Renderer_is (Self.Renderer); the_Camera.Site_is ((0.0, 5.0, 5.0)); the_world_Info.Cameras.append (the_Camera); Self.Worlds .append (the_world_Info); Self.local_Subject_and_Observer.add (the_add_new_sprite_Response'Access, to_Kind (gel.events.new_sprite_added_to_world_Event'Tag), the_world_Info.World.Name); the_world_Info.World.start; end; end define; package body Forge is function to_Applet (Name : in String; use_Window : in gel.Window.view) return Item is begin return Self : Item := (gel.Applet.Forge.to_Applet (Name, use_Window) with null record) do define (Self'unchecked_Access, Name, use_Window); end return; end to_Applet; function new_Applet (Name : in String; use_Window : in gel.Window.view) return View is Self : constant View := new Item' (to_Applet (Name, use_Window)); begin return Self; end new_Applet; end Forge; function sim_World (Self : in Item) return gel.World.view is begin return Self.World (sim_world_Id); end sim_World; function sim_Camera (Self : in Item) return gel.Camera.view is begin return Self.Camera (sim_world_Id, sim_camera_Id); end sim_Camera; function gui_World (Self : in Item) return gel.World.view is begin return Self.World (gui_world_Id); end gui_World; function gui_Camera (Self : in Item) return gel.Camera.view is begin return Self.Camera (gui_world_Id, gui_camera_Id); end gui_Camera; end gel.Applet.gui_and_sim_world;
-- -- Copyright 2018 The wookey project team <wookey@ssi.gouv.fr> -- - Ryad Benadjila -- - Arnauld Michelizza -- - Mathieu Renard -- - Philippe Thierry -- - Philippe Trebuchet -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. -- -- with interfaces; use interfaces; with types; use types; with ada.unchecked_conversion; with m4.cpu; package ewok with spark_mode => on is type t_stack_frame is record R4, R5, R6, R7 : unsigned_32; R8, R9, R10, R11 : unsigned_32; exc_return : unsigned_32; R0, R1, R2, R3 : unsigned_32; R12 : unsigned_32; LR : system_address; PC : system_address; PSR : m4.cpu.t_PSR_register; end record with size => 17 * 32; type t_stack_frame_access is access t_stack_frame; function to_stack_frame_access is new ada.unchecked_conversion (system_address, t_stack_frame_access); function to_system_address is new ada.unchecked_conversion (t_stack_frame_access, system_address); type t_parameters is array (1 .. 4) of unsigned_32 with pack; type t_parameters_access is access t_parameters; function to_parameters_access is new ada.unchecked_conversion (system_address, t_parameters_access); end ewok;
-- Hello World worker -- Connects REP socket to tcp://localhost:5560 -- Expects "Hello" from client, replies with "World" with Ada.Command_Line; with Ada.Text_IO; with GNAT.Formatted_String; with Ada.Calendar; with ZMQ; procedure RRWorker is use type Ada.Calendar.Time; use type GNAT.Formatted_String.Formatted_String; function Main return Ada.Command_Line.Exit_Status is Context : ZMQ.Context_Type := ZMQ.New_Context; -- Socket to talk to clients Responder : ZMQ.Socket_Type'Class := Context.New_Socket (ZMQ.ZMQ_REP); begin Responder.Connect ("tcp://localhost:5560"); loop declare Msg : String := Responder.Recv; begin Ada.Text_IO.Put_Line (-(+("Received reply [%s]")&Msg)); end; -- Do some 'work' delay 1.0; -- Send reply back to client Responder.Send ("World"); end loop; -- We never get here, but clean up anyhow Responder.Close; Context.Term; return 0; end Main; begin Ada.Command_Line.Set_Exit_Status (Main); end RRWorker;
-- Définition de structures de données associatives sous forme d'un arbre -- binaire de recherche (ABR). generic type T_Cle is private; type T_Donnee is private; with function "<" (Gauche, Droite : in T_Cle) return Boolean; package ABR is type T_ABR is limited private; -- Initialiser une Sda. La Sda est vide. procedure Initialiser(Sda: out T_ABR) with Post => Est_Vide (Sda); -- Est-ce qu'une Sda est vide ? function Est_Vide (Sda : T_ABR) return Boolean; -- Obtenir le nombre d'éléments d'une Sda. function Taille (Sda : in T_ABR) return Integer with Post => Taille'Result >= 0 and (Taille'Result = 0) = Est_Vide (Sda); -- Enregistrer une Donnée associée à une Clé dans une Sda. -- Si la clé est déjà présente dans la Sda, sa donnée est changée. procedure Enregistrer (Sda : in out T_ABR ; Cle : in T_Cle ; Donnee : in T_Donnee) with Post => (La_Donnee (Sda, Cle) = Donnee), -- donnée insérée Contract_Cases => (others => (Taille (Sda) = Taille (Sda)'Old or Taille (Sda) = Taille (Sda)'Old + 1)); -- Supprimer la Donnée associée à une Clé dans une Sda. -- Exception : Cle_Absente_Exception si Clé n'est pas utilisée dans la Sda procedure Supprimer (Sda : in out T_ABR ; Cle : in T_Cle) with Post => Taille (Sda) = Taille (Sda)'Old - 1; -- un élément de moins -- Obtenir la donnée associée à une Cle dans la Sda. -- Exception : Cle_Absente_Exception si Clé n'est pas utilisée dans l'Sda function La_Donnee (Sda : in T_ABR ; Cle : in T_Cle) return T_Donnee; -- Supprimer tous les éléments d'une Sda. procedure Vider (Sda : in out T_ABR) with Post => Est_Vide (Sda); -- Appliquer un traitement (Traiter) pour chaque couple d'une Sda. -- Le parcours est infixe : on traite le sous-arbre gauche, puis le -- noeud, puis le sous-arbre droit. generic with procedure Traiter (Cle : in T_Cle; Donnee: in T_Donnee); procedure Pour_Chaque (Sda : in T_ABR); -- Afficher l'arbre. generic with procedure Afficher_Couple (Cle : in T_Cle; Donnee: in T_Donnee); procedure Afficher_SDA (Sda: in T_ABR; Niv: in Integer := 1); private type T_Noeud; type T_ABR is access T_Noeud; type T_Noeud is record Cle: T_Cle; Donnee : T_Donnee; Sous_Arbre_Gauche : T_ABR; Sous_Arbre_Droit : T_ABR; -- Invariant -- Pour tout noeud N dans Sous_Arbre_Gauche, N.Cle < Cle -- Pour tout noeud N dans Sous_Arbre_Droit, N.Cle > Cle end record; end ABR;
with Ada.Calendar; package body JSA.Intermediate_Backups is In_A_Loop : Boolean := False; Save_Time : Duration; Loop_Start : Ada.Calendar.Time; Saved : Boolean; procedure Begin_Loop is begin In_A_Loop := True; Save_Time := 0.0; Saved := False; Loop_Start := Ada.Calendar.Clock; end Begin_Loop; procedure End_Loop is begin if not Saved then Save_State; Saved := True; end if; In_A_Loop := False; end End_Loop; procedure End_Of_Iteration is use Ada.Calendar; Total_Time : constant Float := Float (Clock - Loop_Start); Timestamp : Time; begin if Fraction * Total_Time > Float (Save_Time) then Timestamp := Ada.Calendar.Clock; Save_State; Save_Time := Save_Time + (Clock - Timestamp); Saved := True; else Saved := False; end if; end End_Of_Iteration; function In_Loop return Boolean is begin return In_A_Loop; end In_Loop; end JSA.Intermediate_Backups;
-- The MIT License (MIT) -- Copyright (c) 2015 Pavel Zhukov <landgraf@fedoraproject.org> -- Permission is hereby granted, free of charge, to any person obtaining a copy -- of this software and associated documentation files (the "Software"), to deal -- in the Software without restriction, including without limitation the rights -- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -- copies of the Software, and to permit persons to whom the Software is -- furnished to do so, subject to the following conditions: -- The above copyright notice and this permission notice shall be included in all -- copies or substantial portions of the Software. -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -- SOFTWARE. with Nanomsg.Domains; with Nanomsg.Messages; with Nanomsg.Sockopt; package Nanomsg.Socket is Socket_Exception : exception; type Socket_T is tagged private; type Socket_Access_T is access all Socket_T; function Is_Null (Obj : in Socket_T) return Boolean; procedure Init (Obj : out Socket_T; Domain : in Nanomsg.Domains.Domain_T; Protocol : Protocol_T ) with Post => not Obj.Is_Null; procedure Close (Obj : in out Socket_T) with Post => Obj.Is_Null; procedure Bind (Obj : in out Socket_T; Address : in String) with Pre => not Obj.Is_Null; procedure Connect (Obj : in out Socket_T; Address : in String) with Pre => not Obj.Is_Null; function Get_Fd (Obj : in Socket_T) return Integer; procedure Send (Obj : in Socket_T; Message : Nanomsg.Messages.Message_T); procedure Receive (Obj : in out Socket_T; Message : out Nanomsg.Messages.Message_T; Non_Blocking : in Boolean := False); function Receive (Obj : in out Socket_T; Message : out Nanomsg.Messages.Message_T; Non_Blocking : in Boolean := False) return Natural; procedure Delete_Endpoint (Obj : in out Socket_T); function Get_Option (Obj : in Socket_T; Level : in Nanomsg.Sockopt.Option_Level_T; Name : in Nanomsg.Sockopt.Option_Type_T) return String; function Get_Option (Obj : in Socket_T; Level : in Nanomsg.Sockopt.Option_Level_T; Name : in Nanomsg.Sockopt.Option_Type_T) return Natural; procedure Set_Option (Obj : in out Socket_T; Level : in Nanomsg.Sockopt.Option_Level_T; Name : in Nanomsg.Sockopt.Option_Type_T; Value : in Natural); procedure Set_Option (Obj : in out Socket_T; Level : in Nanomsg.Sockopt.Option_Level_T; Name : in Nanomsg.Sockopt.Option_Type_T; Value : in String); function Is_Ready (Obj : in Socket_T; To_Send : Boolean := False; To_Receive : Boolean := True) return Boolean; function "=" (Left, Right : in Socket_T) return Boolean; private type Socket_T is tagged record Fd : Integer := -1; -- File Descriptor Domain : Nanomsg.Domains.Domain_T; Protocol : Protocol_T; Endpoint : Integer := -1; end record; end Nanomsg.Socket;
with Ada.Text_IO; use Ada.Text_IO; procedure Test is procedure P is begin x := 0; end; begin P; end;
with Interfaces.C, System; package body FLTK.Devices.Graphics is function fl_graphics_driver_color (G : in System.Address) return Interfaces.C.unsigned; pragma Import (C, fl_graphics_driver_color, "fl_graphics_driver_color"); pragma Inline (fl_graphics_driver_color); function fl_graphics_driver_descent (G : in System.Address) return Interfaces.C.int; pragma Import (C, fl_graphics_driver_descent, "fl_graphics_driver_descent"); pragma Inline (fl_graphics_driver_descent); function fl_graphics_driver_height (G : in System.Address) return Interfaces.C.int; pragma Import (C, fl_graphics_driver_height, "fl_graphics_driver_height"); pragma Inline (fl_graphics_driver_height); function fl_graphics_driver_width (G : in System.Address; C : in Interfaces.C.unsigned) return Interfaces.C.double; pragma Import (C, fl_graphics_driver_width, "fl_graphics_driver_width"); pragma Inline (fl_graphics_driver_width); function fl_graphics_driver_width2 (G : in System.Address; S : in Interfaces.C.char_array; L : in Interfaces.C.int) return Interfaces.C.double; pragma Import (C, fl_graphics_driver_width2, "fl_graphics_driver_width2"); pragma Inline (fl_graphics_driver_width2); function fl_graphics_driver_get_font (G : in System.Address) return Interfaces.C.int; pragma Import (C, fl_graphics_driver_get_font, "fl_graphics_driver_get_font"); pragma Inline (fl_graphics_driver_get_font); function fl_graphics_driver_size (G : in System.Address) return Interfaces.C.int; pragma Import (C, fl_graphics_driver_size, "fl_graphics_driver_size"); pragma Inline (fl_graphics_driver_size); procedure fl_graphics_driver_set_font (G : in System.Address; K, S : in Interfaces.C.int); pragma Import (C, fl_graphics_driver_set_font, "fl_graphics_driver_set_font"); pragma Inline (fl_graphics_driver_set_font); procedure fl_graphics_driver_draw_scaled (G, I : in System.Address; X, Y, W, H : in Interfaces.C.int); pragma Import (C, fl_graphics_driver_draw_scaled, "fl_graphics_driver_draw_scaled"); pragma Inline (fl_graphics_driver_draw_scaled); function Get_Color (This : in Graphics_Driver) return Color is begin return Color (fl_graphics_driver_color (This.Void_Ptr)); end Get_Color; function Get_Text_Descent (This : in Graphics_Driver) return Integer is begin return Integer (fl_graphics_driver_descent (This.Void_Ptr)); end Get_Text_Descent; function Get_Line_Height (This : in Graphics_Driver) return Integer is begin return Integer (fl_graphics_driver_height (This.Void_Ptr)); end Get_Line_Height; function Get_Width (This : in Graphics_Driver; Char : in Character) return Long_Float is begin return Long_Float (fl_graphics_driver_width (This.Void_Ptr, Character'Pos (Char))); end Get_Width; function Get_Width (This : in Graphics_Driver; Str : in String) return Long_Float is begin return Long_Float (fl_graphics_driver_width2 (This.Void_Ptr, Interfaces.C.To_C (Str), Str'Length)); end Get_Width; function Get_Font_Kind (This : in Graphics_Driver) return Font_Kind is begin return Font_Kind'Val (fl_graphics_driver_get_font (This.Void_Ptr)); end Get_Font_Kind; function Get_Font_Size (This : in Graphics_Driver) return Font_Size is begin return Font_Size (fl_graphics_driver_size (This.Void_Ptr)); end Get_Font_Size; procedure Set_Font (This : in Graphics_Driver; Face : in Font_Kind; Size : in Font_Size) is begin fl_graphics_driver_set_font (This.Void_Ptr, Font_Kind'Pos (Face), Interfaces.C.int (Size)); end Set_Font; procedure Draw_Scaled_Image (This : in Graphics_Driver; Img : in FLTK.Images.Image'Class; X, Y, W, H : in Integer) is begin fl_graphics_driver_draw_scaled (This.Void_Ptr, Wrapper (Img).Void_Ptr, Interfaces.C.int (X), Interfaces.C.int (Y), Interfaces.C.int (W), Interfaces.C.int (H)); end Draw_Scaled_Image; end FLTK.Devices.Graphics;
------------------------------------------------------------------------------- -- This file is part of libsparkcrypto. -- -- Copyright (C) 2012, Stefan Berghofer -- Copyright (C) 2012, secunet Security Networks AG -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- -- * Redistributions of source code must retain the above copyright notice, -- this list of conditions and the following disclaimer. -- -- * Redistributions in binary form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. -- -- * Neither the name of the author nor the names of its contributors may be -- used to endorse or promote products derived from this software without -- specific prior written permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS -- BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -- POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------- with LSC.Internal.Types; with LSC.Internal.Bignum; with LSC.Internal.Math_Int; use type LSC.Internal.Math_Int.Math_Int; use type LSC.Internal.Types.Word32; package LSC.Internal.EC is pragma Pure; Max_Coord_Length : constant := 20; subtype Coord_Index is Natural range 0 .. Max_Coord_Length - 1; subtype Coord is Bignum.Big_Int (Coord_Index); One : constant Coord := Coord'(1, others => 0); function Point_Double_Spec (M, A, X1, Y1, Z1, X2, Y2, Z2 : Math_Int.Math_Int) return Boolean with Ghost, Import, Global => null; procedure Point_Double (X1 : in Bignum.Big_Int; X1_First : in Natural; X1_Last : in Natural; Y1 : in Bignum.Big_Int; Y1_First : in Natural; Z1 : in Bignum.Big_Int; Z1_First : in Natural; X2 : out Bignum.Big_Int; X2_First : in Natural; Y2 : out Bignum.Big_Int; Y2_First : in Natural; Z2 : out Bignum.Big_Int; Z2_First : in Natural; A : in Bignum.Big_Int; A_First : in Natural; M : in Bignum.Big_Int; M_First : in Natural; M_Inv : in Types.Word32) with Depends => (X2 =>+ (X1, X1_First, X1_Last, Y1, Y1_First, Z1, Z1_First, X2_First, A, A_First, M, M_First, M_Inv), Y2 =>+ (X1, X1_First, X1_Last, Y1, Y1_First, Z1, Z1_First, Y2_First, A, A_First, M, M_First, M_Inv), Z2 =>+ (X1_First, X1_Last, Y1, Y1_First, Z1, Z1_First, Z2_First, M, M_First, M_Inv)), Pre => X1_First in X1'Range and then X1_Last in X1'Range and then X1_First < X1_Last and then X1_Last - X1_First < Max_Coord_Length and then Y1_First in Y1'Range and then Y1_First + (X1_Last - X1_First) in Y1'Range and then Z1_First in Z1'Range and then Z1_First + (X1_Last - X1_First) in Z1'Range and then X2_First in X2'Range and then X2_First + (X1_Last - X1_First) in X2'Range and then Y2_First in Y2'Range and then Y2_First + (X1_Last - X1_First) in Y2'Range and then Z2_First in Z2'Range and then Z2_First + (X1_Last - X1_First) in Z2'Range and then A_First in A'Range and then A_First + (X1_Last - X1_First) in A'Range and then M_First in M'Range and then M_First + (X1_Last - X1_First) in M'Range and then Bignum.Num_Of_Big_Int (X1, X1_First, X1_Last - X1_First + 1) < Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1) and then Bignum.Num_Of_Big_Int (Y1, Y1_First, X1_Last - X1_First + 1) < Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1) and then Bignum.Num_Of_Big_Int (Z1, Z1_First, X1_Last - X1_First + 1) < Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1) and then Bignum.Num_Of_Big_Int (A, A_First, X1_Last - X1_First + 1) < Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1) and then Math_Int.From_Word32 (1) < Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1) and then 1 + M_Inv * M (M_First) = 0, Post => Bignum.Num_Of_Big_Int (X2, X2_First, X1_Last - X1_First + 1) < Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1) and Bignum.Num_Of_Big_Int (Y2, Y2_First, X1_Last - X1_First + 1) < Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1) and Bignum.Num_Of_Big_Int (Z2, Z2_First, X1_Last - X1_First + 1) < Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1) and Point_Double_Spec (Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1), Bignum.Num_Of_Big_Int (A, A_First, X1_Last - X1_First + 1) * Bignum.Inverse (Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1), Bignum.Base) ** (X1_Last - X1_First + 1), Bignum.Num_Of_Big_Int (X1, X1_First, X1_Last - X1_First + 1), Bignum.Num_Of_Big_Int (Y1, Y1_First, X1_Last - X1_First + 1), Bignum.Num_Of_Big_Int (Z1, Z1_First, X1_Last - X1_First + 1), Bignum.Num_Of_Big_Int (X2, X2_First, X1_Last - X1_First + 1), Bignum.Num_Of_Big_Int (Y2, Y2_First, X1_Last - X1_First + 1), Bignum.Num_Of_Big_Int (Z2, Z2_First, X1_Last - X1_First + 1)); function Point_Add_Spec (M, A, X1, Y1, Z1, X2, Y2, Z2, X3, Y3, Z3 : Math_Int.Math_Int) return Boolean with Ghost, Import, Global => null; procedure Point_Add (X1 : in Bignum.Big_Int; X1_First : in Natural; X1_Last : in Natural; Y1 : in Bignum.Big_Int; Y1_First : in Natural; Z1 : in Bignum.Big_Int; Z1_First : in Natural; X2 : in Bignum.Big_Int; X2_First : in Natural; Y2 : in Bignum.Big_Int; Y2_First : in Natural; Z2 : in Bignum.Big_Int; Z2_First : in Natural; X3 : out Bignum.Big_Int; X3_First : in Natural; Y3 : out Bignum.Big_Int; Y3_First : in Natural; Z3 : out Bignum.Big_Int; Z3_First : in Natural; A : in Bignum.Big_Int; A_First : in Natural; M : in Bignum.Big_Int; M_First : in Natural; M_Inv : in Types.Word32) with Depends => (X3 =>+ (X1, X1_First, X1_Last, Y1, Y1_First, Z1, Z1_First, X2, X2_First, Y2, Y2_First, Z2, Z2_First, X3_First, A, A_First, M, M_First, M_Inv), Y3 =>+ (X1, X1_First, X1_Last, Y1, Y1_First, Z1, Z1_First, X2, X2_First, Y2, Y2_First, Z2, Z2_First, Y3_First, A, A_First, M, M_First, M_Inv), Z3 =>+ (X1, X1_First, X1_Last, Y1, Y1_First, Z1, Z1_First, X2, X2_First, Y2, Y2_First, Z2, Z2_First, Z3_First, M, M_First, M_Inv)), Pre => X1_First in X1'Range and then X1_Last in X1'Range and then X1_First < X1_Last and then X1_Last - X1_First < Max_Coord_Length and then Y1_First in Y1'Range and then Y1_First + (X1_Last - X1_First) in Y1'Range and then Z1_First in Z1'Range and then Z1_First + (X1_Last - X1_First) in Z1'Range and then X2_First in X2'Range and then X2_First + (X1_Last - X1_First) in X2'Range and then Y2_First in Y2'Range and then Y2_First + (X1_Last - X1_First) in Y2'Range and then Z2_First in Z2'Range and then Z2_First + (X1_Last - X1_First) in Z2'Range and then X3_First in X3'Range and then X3_First + (X1_Last - X1_First) in X3'Range and then Y3_First in Y3'Range and then Y3_First + (X1_Last - X1_First) in Y3'Range and then Z3_First in Z3'Range and then Z3_First + (X1_Last - X1_First) in Z3'Range and then A_First in A'Range and then A_First + (X1_Last - X1_First) in A'Range and then M_First in M'Range and then M_First + (X1_Last - X1_First) in M'Range and then Bignum.Num_Of_Big_Int (X1, X1_First, X1_Last - X1_First + 1) < Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1) and then Bignum.Num_Of_Big_Int (Y1, Y1_First, X1_Last - X1_First + 1) < Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1) and then Bignum.Num_Of_Big_Int (Z1, Z1_First, X1_Last - X1_First + 1) < Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1) and then Bignum.Num_Of_Big_Int (X2, X2_First, X1_Last - X1_First + 1) < Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1) and then Bignum.Num_Of_Big_Int (Y2, Y2_First, X1_Last - X1_First + 1) < Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1) and then Bignum.Num_Of_Big_Int (Z2, Z2_First, X1_Last - X1_First + 1) < Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1) and then Bignum.Num_Of_Big_Int (A, A_First, X1_Last - X1_First + 1) < Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1) and then Math_Int.From_Word32 (1) < Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1) and then 1 + M_Inv * M (M_First) = 0, Post => Bignum.Num_Of_Big_Int (X3, X3_First, X1_Last - X1_First + 1) < Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1) and Bignum.Num_Of_Big_Int (Y3, Y3_First, X1_Last - X1_First + 1) < Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1) and Bignum.Num_Of_Big_Int (Z3, Z3_First, X1_Last - X1_First + 1) < Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1) and Point_Add_Spec (Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1), Bignum.Num_Of_Big_Int (A, A_First, X1_Last - X1_First + 1) * Bignum.Inverse (Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1), Bignum.Base) ** (X1_Last - X1_First + 1), Bignum.Num_Of_Big_Int (X1, X1_First, X1_Last - X1_First + 1), Bignum.Num_Of_Big_Int (Y1, Y1_First, X1_Last - X1_First + 1), Bignum.Num_Of_Big_Int (Z1, Z1_First, X1_Last - X1_First + 1), Bignum.Num_Of_Big_Int (X2, X2_First, X1_Last - X1_First + 1), Bignum.Num_Of_Big_Int (Y2, Y2_First, X1_Last - X1_First + 1), Bignum.Num_Of_Big_Int (Z2, Z2_First, X1_Last - X1_First + 1), Bignum.Num_Of_Big_Int (X3, X3_First, X1_Last - X1_First + 1), Bignum.Num_Of_Big_Int (Y3, Y3_First, X1_Last - X1_First + 1), Bignum.Num_Of_Big_Int (Z3, Z3_First, X1_Last - X1_First + 1)); function Point_Mult_Spec (M, A, X1, Y1, Z1, E, X2, Y2, Z2 : Math_Int.Math_Int) return Boolean with Ghost, Import, Global => null; procedure Point_Mult (X1 : in Bignum.Big_Int; X1_First : in Natural; X1_Last : in Natural; Y1 : in Bignum.Big_Int; Y1_First : in Natural; Z1 : in Bignum.Big_Int; Z1_First : in Natural; E : in Bignum.Big_Int; E_First : in Natural; E_Last : in Natural; X2 : out Bignum.Big_Int; X2_First : in Natural; Y2 : out Bignum.Big_Int; Y2_First : in Natural; Z2 : out Bignum.Big_Int; Z2_First : in Natural; A : in Bignum.Big_Int; A_First : in Natural; M : in Bignum.Big_Int; M_First : in Natural; M_Inv : in Types.Word32) with Depends => ((X2, Y2, Z2) => (X1, X1_First, X1_Last, Y1, Y1_First, Z1, Z1_First, X2, X2_First, Y2, Y2_First, Z2, Z2_First, E, E_First, E_Last, A, A_First, M, M_First, M_Inv)), Pre => X1_First in X1'Range and then X1_Last in X1'Range and then X1_First < X1_Last and then X1_Last - X1_First < Max_Coord_Length and then Y1_First in Y1'Range and then Y1_First + (X1_Last - X1_First) in Y1'Range and then Z1_First in Z1'Range and then Z1_First + (X1_Last - X1_First) in Z1'Range and then X2_First in X2'Range and then X2_First + (X1_Last - X1_First) in X2'Range and then Y2_First in Y2'Range and then Y2_First + (X1_Last - X1_First) in Y2'Range and then Z2_First in Z2'Range and then Z2_First + (X1_Last - X1_First) in Z2'Range and then A_First in A'Range and then A_First + (X1_Last - X1_First) in A'Range and then M_First in M'Range and then M_First + (X1_Last - X1_First) in M'Range and then E_First in E'Range and then E_Last in E'Range and then E_First <= E_Last and then Bignum.Num_Of_Big_Int (X1, X1_First, X1_Last - X1_First + 1) < Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1) and then Bignum.Num_Of_Big_Int (Y1, Y1_First, X1_Last - X1_First + 1) < Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1) and then Bignum.Num_Of_Big_Int (Z1, Z1_First, X1_Last - X1_First + 1) < Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1) and then Bignum.Num_Of_Big_Int (A, A_First, X1_Last - X1_First + 1) < Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1) and then Math_Int.From_Word32 (1) < Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1) and then 1 + M_Inv * M (M_First) = 0, Post => Bignum.Num_Of_Big_Int (X2, X2_First, X1_Last - X1_First + 1) < Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1) and Bignum.Num_Of_Big_Int (Y2, Y2_First, X1_Last - X1_First + 1) < Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1) and Bignum.Num_Of_Big_Int (Z2, Z2_First, X1_Last - X1_First + 1) < Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1) and Point_Mult_Spec (Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1), Bignum.Num_Of_Big_Int (A, A_First, X1_Last - X1_First + 1) * Bignum.Inverse (Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1), Bignum.Base) ** (X1_Last - X1_First + 1), Bignum.Num_Of_Big_Int (X1, X1_First, X1_Last - X1_First + 1), Bignum.Num_Of_Big_Int (Y1, Y1_First, X1_Last - X1_First + 1), Bignum.Num_Of_Big_Int (Z1, Z1_First, X1_Last - X1_First + 1), Bignum.Num_Of_Big_Int (E, E_First, E_Last - E_First + 1), Bignum.Num_Of_Big_Int (X2, X2_First, X1_Last - X1_First + 1), Bignum.Num_Of_Big_Int (Y2, Y2_First, X1_Last - X1_First + 1), Bignum.Num_Of_Big_Int (Z2, Z2_First, X1_Last - X1_First + 1)); function Two_Point_Mult_Spec (M, A, X1, Y1, Z1, E1, X2, Y2, Z2, E2, X3, Y3, Z3 : Math_Int.Math_Int) return Boolean with Ghost, Import, Global => null; procedure Two_Point_Mult (X1 : in Bignum.Big_Int; X1_First : in Natural; X1_Last : in Natural; Y1 : in Bignum.Big_Int; Y1_First : in Natural; Z1 : in Bignum.Big_Int; Z1_First : in Natural; E1 : in Bignum.Big_Int; E1_First : in Natural; E1_Last : in Natural; X2 : in Bignum.Big_Int; X2_First : in Natural; Y2 : in Bignum.Big_Int; Y2_First : in Natural; Z2 : in Bignum.Big_Int; Z2_First : in Natural; E2 : in Bignum.Big_Int; E2_First : in Natural; X3 : out Bignum.Big_Int; X3_First : in Natural; Y3 : out Bignum.Big_Int; Y3_First : in Natural; Z3 : out Bignum.Big_Int; Z3_First : in Natural; A : in Bignum.Big_Int; A_First : in Natural; M : in Bignum.Big_Int; M_First : in Natural; M_Inv : in Types.Word32) with Depends => ((X3, Y3, Z3) => (X1, X1_First, X1_Last, Y1, Y1_First, Z1, Z1_First, X2, X2_First, Y2, Y2_First, Z2, Z2_First, X3, X3_First, Y3, Y3_First, Z3, Z3_First, E1, E1_First, E1_Last, E2, E2_First, A, A_First, M, M_First, M_Inv)), Pre => X1_First in X1'Range and then X1_Last in X1'Range and then X1_First < X1_Last and then X1_Last - X1_First < Max_Coord_Length and then Y1_First in Y1'Range and then Y1_First + (X1_Last - X1_First) in Y1'Range and then Z1_First in Z1'Range and then Z1_First + (X1_Last - X1_First) in Z1'Range and then X2_First in X2'Range and then X2_First + (X1_Last - X1_First) in X2'Range and then Y2_First in Y2'Range and then Y2_First + (X1_Last - X1_First) in Y2'Range and then Z2_First in Z2'Range and then Z2_First + (X1_Last - X1_First) in Z2'Range and then X3_First in X3'Range and then X3_First + (X1_Last - X1_First) in X3'Range and then Y3_First in Y3'Range and then Y3_First + (X1_Last - X1_First) in Y3'Range and then Z3_First in Z3'Range and then Z3_First + (X1_Last - X1_First) in Z3'Range and then A_First in A'Range and then A_First + (X1_Last - X1_First) in A'Range and then M_First in M'Range and then M_First + (X1_Last - X1_First) in M'Range and then E1_First in E1'Range and then E1_Last in E1'Range and then E1_First <= E1_Last and then E2_First in E2'Range and then E2_First + (E1_Last - E1_First) in E2'Range and then Bignum.Num_Of_Big_Int (X1, X1_First, X1_Last - X1_First + 1) < Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1) and then Bignum.Num_Of_Big_Int (Y1, Y1_First, X1_Last - X1_First + 1) < Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1) and then Bignum.Num_Of_Big_Int (Z1, Z1_First, X1_Last - X1_First + 1) < Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1) and then Bignum.Num_Of_Big_Int (X2, X2_First, X1_Last - X1_First + 1) < Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1) and then Bignum.Num_Of_Big_Int (Y2, Y2_First, X1_Last - X1_First + 1) < Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1) and then Bignum.Num_Of_Big_Int (Z2, Z2_First, X1_Last - X1_First + 1) < Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1) and then Bignum.Num_Of_Big_Int (A, A_First, X1_Last - X1_First + 1) < Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1) and then Math_Int.From_Word32 (1) < Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1) and then 1 + M_Inv * M (M_First) = 0, Post => Bignum.Num_Of_Big_Int (X3, X3_First, X1_Last - X1_First + 1) < Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1) and Bignum.Num_Of_Big_Int (Y3, Y3_First, X1_Last - X1_First + 1) < Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1) and Bignum.Num_Of_Big_Int (Z3, Z3_First, X1_Last - X1_First + 1) < Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1) and Two_Point_Mult_Spec (Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1), Bignum.Num_Of_Big_Int (A, A_First, X1_Last - X1_First + 1) * Bignum.Inverse (Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1), Bignum.Base) ** (X1_Last - X1_First + 1), Bignum.Num_Of_Big_Int (X1, X1_First, X1_Last - X1_First + 1), Bignum.Num_Of_Big_Int (Y1, Y1_First, X1_Last - X1_First + 1), Bignum.Num_Of_Big_Int (Z1, Z1_First, X1_Last - X1_First + 1), Bignum.Num_Of_Big_Int (E1, E1_First, E1_Last - E1_First + 1), Bignum.Num_Of_Big_Int (X2, X2_First, X1_Last - X1_First + 1), Bignum.Num_Of_Big_Int (Y2, Y2_First, X1_Last - X1_First + 1), Bignum.Num_Of_Big_Int (Z2, Z2_First, X1_Last - X1_First + 1), Bignum.Num_Of_Big_Int (E2, E2_First, E1_Last - E1_First + 1), Bignum.Num_Of_Big_Int (X3, X3_First, X1_Last - X1_First + 1), Bignum.Num_Of_Big_Int (Y3, Y3_First, X1_Last - X1_First + 1), Bignum.Num_Of_Big_Int (Z3, Z3_First, X1_Last - X1_First + 1)); procedure Make_Affine (X1 : in Bignum.Big_Int; X1_First : in Natural; X1_Last : in Natural; Y1 : in Bignum.Big_Int; Y1_First : in Natural; Z1 : in Bignum.Big_Int; Z1_First : in Natural; X2 : out Bignum.Big_Int; X2_First : in Natural; Y2 : out Bignum.Big_Int; Y2_First : in Natural; R : in Bignum.Big_Int; R_First : in Natural; M : in Bignum.Big_Int; M_First : in Natural; M_Inv : in Types.Word32) with Depends => (X2 =>+ (X1, X1_First, X1_Last, X2_First, Z1, Z1_First, R, R_First, M, M_First, M_Inv), Y2 =>+ (X1_First, X1_Last, Y1, Y1_First, Z1, Z1_First, Y2_First, R, R_First, M, M_First, M_Inv)), Pre => X1_First in X1'Range and then X1_Last in X1'Range and then X1_First < X1_Last and then X1_Last - X1_First < Max_Coord_Length and then Y1_First in Y1'Range and then Y1_First + (X1_Last - X1_First) in Y1'Range and then Z1_First in Z1'Range and then Z1_First + (X1_Last - X1_First) in Z1'Range and then X2_First in X2'Range and then X2_First + (X1_Last - X1_First) in X2'Range and then Y2_First in Y2'Range and then Y2_First + (X1_Last - X1_First) in Y2'Range and then R_First in R'Range and then R_First + (X1_Last - X1_First) in R'Range and then M_First in M'Range and then M_First + (X1_Last - X1_First) in M'Range and then Bignum.Num_Of_Big_Int (X1, X1_First, X1_Last - X1_First + 1) < Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1) and then Bignum.Num_Of_Big_Int (Y1, Y1_First, X1_Last - X1_First + 1) < Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1) and then Bignum.Num_Of_Big_Int (Z1, Z1_First, X1_Last - X1_First + 1) < Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1) and then Bignum.Num_Of_Big_Int (R, R_First, X1_Last - X1_First + 1) = Bignum.Base ** (Math_Int.From_Integer (2) * Math_Int.From_Integer (X1_Last - X1_First + 1)) mod Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1) and then Math_Int.From_Word32 (1) < Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1) and then 1 + M_Inv * M (M_First) = 0, Post => Bignum.Num_Of_Big_Int (X2, X2_First, X1_Last - X1_First + 1) < Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1) and Bignum.Num_Of_Big_Int (Y2, Y2_First, X1_Last - X1_First + 1) < Bignum.Num_Of_Big_Int (M, M_First, X1_Last - X1_First + 1); procedure Invert (A : in Bignum.Big_Int; A_First : in Natural; A_Last : in Natural; B : out Bignum.Big_Int; B_First : in Natural; R : in Bignum.Big_Int; R_First : in Natural; M : in Bignum.Big_Int; M_First : in Natural; M_Inv : in Types.Word32) with Depends => (B =>+ (A, A_First, A_Last, B_First, R, R_First, M, M_First, M_Inv)), Pre => A_First in A'Range and then A_Last in A'Range and then A_First < A_Last and then A_Last - A_First < Max_Coord_Length and then B_First in B'Range and then B_First + (A_Last - A_First) in B'Range and then R_First in R'Range and then R_First + (A_Last - A_First) in R'Range and then M_First in M'Range and then M_First + (A_Last - A_First) in M'Range and then Bignum.Num_Of_Big_Int (R, R_First, A_Last - A_First + 1) = Bignum.Base ** (Math_Int.From_Integer (2) * Math_Int.From_Integer (A_Last - A_First + 1)) mod Bignum.Num_Of_Big_Int (M, M_First, A_Last - A_First + 1) and then Math_Int.From_Word32 (1) < Bignum.Num_Of_Big_Int (M, M_First, A_Last - A_First + 1) and then 1 + M_Inv * M (M_First) = 0, Post => Bignum.Num_Of_Big_Int (B, B_First, A_Last - A_First + 1) < Bignum.Num_Of_Big_Int (M, M_First, A_Last - A_First + 1); function On_Curve (X : Bignum.Big_Int; X_First : Natural; X_Last : Natural; Y : Bignum.Big_Int; Y_First : Natural; A : Bignum.Big_Int; A_First : Natural; B : Bignum.Big_Int; B_First : Natural; R : Bignum.Big_Int; R_First : Natural; M : Bignum.Big_Int; M_First : Natural; M_Inv : Types.Word32) return Boolean with Pre => X_First in X'Range and then X_Last in X'Range and then X_First < X_Last and then X_Last - X_First < Max_Coord_Length and then Y_First in Y'Range and then Y_First + (X_Last - X_First) in Y'Range and then A_First in A'Range and then A_First + (X_Last - X_First) in A'Range and then B_First in B'Range and then B_First + (X_Last - X_First) in B'Range and then R_First in R'Range and then R_First + (X_Last - X_First) in R'Range and then M_First in M'Range and then M_First + (X_Last - X_First) in M'Range and then Bignum.Num_Of_Big_Int (A, A_First, X_Last - X_First + 1) < Bignum.Num_Of_Big_Int (M, M_First, X_Last - X_First + 1) and then Bignum.Num_Of_Big_Int (B, B_First, X_Last - X_First + 1) < Bignum.Num_Of_Big_Int (M, M_First, X_Last - X_First + 1) and then Bignum.Num_Of_Big_Int (R, R_First, X_Last - X_First + 1) = Bignum.Base ** (Math_Int.From_Integer (2) * Math_Int.From_Integer (X_Last - X_First + 1)) mod Bignum.Num_Of_Big_Int (M, M_First, X_Last - X_First + 1) and then Math_Int.From_Word32 (1) < Bignum.Num_Of_Big_Int (M, M_First, X_Last - X_First + 1) and then 1 + M_Inv * M (M_First) = 0; procedure Uncompress_Point (X : in Bignum.Big_Int; X_First : in Natural; X_Last : in Natural; Even : in Boolean; A : in Bignum.Big_Int; A_First : in Natural; B : in Bignum.Big_Int; B_First : in Natural; R : in Bignum.Big_Int; R_First : in Natural; M : in Bignum.Big_Int; M_First : in Natural; M_Inv : in Types.Word32; Y : out Bignum.Big_Int; Y_First : in Natural; Success : out Boolean) with Depends => ((Y, Success) => (X, X_First, X_Last, Even, A, A_First, B, B_First, R, R_First, M, M_First, M_Inv, Y, Y_First)), Pre => X_First in X'Range and then X_Last in X'Range and then X_First < X_Last and then X_Last - X_First < Max_Coord_Length and then Y_First in Y'Range and then Y_First + (X_Last - X_First) in Y'Range and then A_First in A'Range and then A_First + (X_Last - X_First) in A'Range and then B_First in B'Range and then B_First + (X_Last - X_First) in B'Range and then R_First in R'Range and then R_First + (X_Last - X_First) in R'Range and then M_First in M'Range and then M_First + (X_Last - X_First) in M'Range and then Bignum.Num_Of_Big_Int (A, A_First, X_Last - X_First + 1) < Bignum.Num_Of_Big_Int (M, M_First, X_Last - X_First + 1) and then Bignum.Num_Of_Big_Int (B, B_First, X_Last - X_First + 1) < Bignum.Num_Of_Big_Int (M, M_First, X_Last - X_First + 1) and then Bignum.Num_Of_Big_Int (R, R_First, X_Last - X_First + 1) = Bignum.Base ** (Math_Int.From_Integer (2) * Math_Int.From_Integer (X_Last - X_First + 1)) mod Bignum.Num_Of_Big_Int (M, M_First, X_Last - X_First + 1) and then Math_Int.From_Word32 (1) < Bignum.Num_Of_Big_Int (M, M_First, X_Last - X_First + 1) and then 1 + M_Inv * M (M_First) = 0, Post => Bignum.Num_Of_Big_Int (Y, Y_First, X_Last - X_First + 1) < Bignum.Num_Of_Big_Int (M, M_First, X_Last - X_First + 1); end LSC.Internal.EC;
with ada.text_io; use ada.text_io; package body help is procedure show_help is begin put_line(help_text); end; end help;
pragma License (Unrestricted); -- implementation unit specialized for Windows with C.winnt; package System.Zero_Terminated_WStrings is pragma Preelaborate; -- This package targets at not Wide_String in Ada, not wchar_t in C -- but LPWSTR in Windows. -- convert from zero-terminated LPWSTR to UTF-8 String function Value (Item : not null access constant C.winnt.WCHAR) return String; function Value ( Item : not null access constant C.winnt.WCHAR; Length : C.size_t) return String; -- convert from UTF-8 String to zero-terminated LPWSTR procedure To_C (Source : String; Result : not null access C.winnt.WCHAR); procedure To_C ( Source : String; Result : not null access C.winnt.WCHAR; Result_Length : out C.size_t); Expanding : constant := 1; -- same as Expanding_From_8_To_16 end System.Zero_Terminated_WStrings;
with Ada.Text_IO; use Ada.Text_IO; procedure Test_SEDOL is subtype SEDOL_String is String (1..6); type SEDOL_Sum is range 0..9; function Check (SEDOL : SEDOL_String) return SEDOL_Sum is Weight : constant array (SEDOL_String'Range) of Integer := (1,3,1,7,3,9); Sum : Integer := 0; Item : Integer; begin for Index in SEDOL'Range loop Item := Character'Pos (SEDOL (Index)); case Item is when Character'Pos ('0')..Character'Pos ('9') => Item := Item - Character'Pos ('0'); when Character'Pos ('B')..Character'Pos ('D') | Character'Pos ('F')..Character'Pos ('H') | Character'Pos ('J')..Character'Pos ('N') | Character'Pos ('P')..Character'Pos ('T') | Character'Pos ('V')..Character'Pos ('Z') => Item := Item - Character'Pos ('A') + 10; when others => raise Constraint_Error; end case; Sum := Sum + Item * Weight (Index); end loop; return SEDOL_Sum ((-Sum) mod 10); end Check; Test : constant array (1..10) of SEDOL_String := ( "710889", "B0YBKJ", "406566", "B0YBLH", "228276", "B0YBKL", "557910", "B0YBKR", "585284", "B0YBKT" ); begin for Index in Test'Range loop Put_Line (Test (Index) & Character'Val (Character'Pos ('0') + Check (Test (Index)))); end loop; end Test_SEDOL;
with Ada.Integer_Text_IO; use Ada.Integer_Text_IO; with Ada.Long_Float_Text_IO; use Ada.Long_Float_Text_IO; with Ada.Text_IO; use Ada.Text_IO; with System; with PortAudioAda; use PortAudioAda; procedure PA_Devices is procedure Print_Supported_Standard_Sample_Rates (inputParameters : access PA_Stream_Parameters; outputParameters : access PA_Stream_Parameters); procedure Print_Supported_Standard_Sample_Rates (inputParameters : access PA_Stream_Parameters; outputParameters : access PA_Stream_Parameters) is standardSampleRates : constant array (Natural range <>) of Long_Float := (8000.0, 9600.0, 11025.0, 12000.0, 16000.0, 22050.0, 24000.0, 32000.0, 44100.0, 48000.0, 88200.0, 96000.0, 192000.0 ); printCount : Integer; err : PA_Error; begin printCount := 0; for i in standardSampleRates'Range loop err := PA_Is_Format_Supported (inputParameters, outputParameters, standardSampleRates (i)); if err = paFormatIsSupported then if printCount = 0 then Put (ASCII.HT); Put (standardSampleRates (i), 8, 2, 0); printCount := 1; elsif printCount = 4 then Put (","); New_Line; Put (ASCII.HT); Put (standardSampleRates (i), 8, 2, 0); printCount := 1; else Put (", "); Put (standardSampleRates (i), 8, 2, 0); printCount := printCount + 1; end if; end if; end loop; if printCount = 0 then Put_Line ("None"); else New_Line; end if; end Print_Supported_Standard_Sample_Rates; err : PA_Error; numHostApi : PA_Host_Api_Index; numDevices : PA_Device_Index; begin err := PA_Initialize; New_Line; if err /= paNoError then Put_Line ("ERROR: PA_Initialize returned " & err'Image); raise PortAudio_Exception; end if; Put_Line ("PortAudio version: " & PA_Get_Version); numHostApi := PA_Get_Host_API_Count; if numHostApi < 0 then Put_Line ("ERROR: Get_API_Count returned " & numHostApi'Image); raise PortAudio_Exception; end if; Put_Line ("Number of Host API:" & numHostApi'Image); numDevices := PA_Get_Device_Count; if numDevices < 0 then Put_Line ("ERROR: Get_Device_Count returned " & numDevices'Image); raise PortAudio_Exception; end if; Put_Line ("Number of devices:" & numDevices'Image); for i in 0 .. numDevices - 1 loop declare deviceInfo : constant PA_Device_Info := PA_Get_Device_Info (i); defaultDisplayed : Boolean := False; inputParameters, outputParameters : aliased PA_Stream_Parameters; begin Put_Line ("--------------------------------------- device #" & i'Image); -- Mark global and API specific default devices if i = PA_Get_Default_Input_Device then Put ("[ Default Input"); defaultDisplayed := True; elsif i = PA_Get_Host_Api_Info (deviceInfo.hostApi).defaultInputDevice then declare hostInfo : constant PA_Host_Api_Info := PA_Get_Host_Api_Info (deviceInfo.hostApi); begin Put ("[ Default " & hostInfo.name & " Input"); defaultDisplayed := True; end; end if; if i = PA_Get_Default_Output_Device then Put ((if defaultDisplayed then "," else "[")); Put (" Default Output"); defaultDisplayed := True; elsif i = PA_Get_Host_Api_Info (deviceInfo.hostApi).defaultOutputDevice then declare hostInfo : constant PA_Host_Api_Info := PA_Get_Host_Api_Info (deviceInfo.hostApi); begin Put ((if defaultDisplayed then "," else "[")); Put (" Default " & hostInfo.name & " Output"); defaultDisplayed := True; end; end if; if defaultDisplayed then Put_Line (" ]"); end if; -- print device info fields Put_Line ("Name = " & deviceInfo.name); Put_Line ("Host API = " & PA_Get_Host_Api_Info (deviceInfo.hostApi).name); Put ("Max inputs = " & deviceInfo.maxInputChannels'Image); Put_Line (", Max outputs = " & deviceInfo.maxOutputChannels'Image); Put ("Default low input latency = "); Put (Long_Float (deviceInfo.defaultLowInputLatency), 8, 4, 0); New_Line; Put ("Default low output latency = "); Put (Long_Float (deviceInfo.defaultLowOutputLatency), 8, 4, 0); New_Line; Put ("Default high input latency = "); Put (Long_Float (deviceInfo.defaultHighInputLatency), 8, 4, 0); New_Line; Put ("Default high output latency = "); Put (Long_Float (deviceInfo.defaultHighOutputLatency), 8, 4, 0); New_Line; Put ("Default sample rate = "); Put (Long_Float (deviceInfo.defaultSampleRate), 8, 2, 0); New_Line; -- poll for standard sample rates inputParameters.device := i; inputParameters.channelCount := deviceInfo.maxInputChannels; inputParameters.sampleFormat := paInt16; inputParameters.suggestedLatency := 0.0; inputParameters.hostApiSpecificStreamInfo := System.Null_Address; outputParameters.device := i; outputParameters.channelCount := deviceInfo.maxOutputChannels; outputParameters.sampleFormat := paInt16; outputParameters.suggestedLatency := 0.0; outputParameters.hostApiSpecificStreamInfo := System.Null_Address; if inputParameters.channelCount > 0 then Put_Line ("Supported standard sample rates"); Put (" for half-duplex 16 bit "); Put (inputParameters.channelCount, 0); Put_Line (" channel input = "); Print_Supported_Standard_Sample_Rates (inputParameters'Unchecked_Access, null); end if; if outputParameters.channelCount > 0 then Put_Line ("Supported standard sample rates"); Put (" for half-duplex 16 bit "); Put (outputParameters.channelCount, 0); Put_Line (" channel output = "); Print_Supported_Standard_Sample_Rates (null, outputParameters'Unchecked_Access); end if; if inputParameters.channelCount > 0 and then outputParameters.channelCount > 0 then Put_Line ("Supported standard sample rates"); Put (" for full-duplex 16 bit "); Put (inputParameters.channelCount, 0); Put (" channel input, "); Put (outputParameters.channelCount, 0); Put_Line (" channel output = "); Print_Supported_Standard_Sample_Rates (inputParameters'Unchecked_Access, outputParameters'Unchecked_Access); end if; end; end loop; err := PA_Terminate; exception when PortAudio_Exception => err := PA_Terminate; Put_Line ("Error number: " & err'Image); Put_Line ("Error message: " & PA_Get_Error_Text (err)); end PA_Devices;
package body Threadsafe_Containers is -- Implementation protected body Threadsafe_Circbuf is -- Blocks if full entry Insert (Value : in Integer) when (Length < Size) is begin Buffer(Tail) := Value; Tail := (Tail mod Size) + 1; Length := Length + 1; end Insert; -- Blocks if empty entry Remove (Value : out Integer) when (Length > 0) is begin Value := Buffer(Head); Head := (Head mod Size) + 1; Length := Length - 1; end Remove; end Threadsafe_Circbuf; end Threadsafe_Containers;
pragma Ada_2012; package body DDS.Request_Reply.Replier.Impl is ----------------------- -- Wait_For_Requests -- ----------------------- procedure Wait_For_Requests (Self : not null access Ref; Min_Count : DDS.Integer; Max_Wait : DDS.Duration_T) is begin Self.Wait_For_Any_Sample (Max_Wait => Max_Wait , Min_Sample_Count => Min_Count); end Wait_For_Requests; -------------------------------- -- Configure_Params_For_Reply -- -------------------------------- procedure Configure_Params_For_Reply (Self : not null access Ref; Params : in out WriteParams_T; Related_Request_Info : DDS.SampleIdentity_T) is begin if Related_Request_Info = AUTO_SAMPLE_IDENTITY then raise BAD_PARAMETER with "AUTO_SAMPLE_IDENTITY not allowed"; end if; Params.Related_Sample_Identity := Related_Request_Info; end Configure_Params_For_Reply; procedure send_sample (Self : not null access Ref; data : System.Address; Params : in out WriteParams_T; Related_Request_Info : DDS.SampleIdentity_T) is begin self.configure_params_for_reply (Params, related_request_info); -- self.Writer.Write_W_Params (data, params); end; end DDS.Request_Reply.Replier.Impl;
with AUnit.Assertions; use AUnit.Assertions; with Libadalang.Analysis; use Libadalang.Analysis; with Rejuvenation.Match_Patterns; use Rejuvenation.Match_Patterns; with Rejuvenation.Simple_Factory; use Rejuvenation.Simple_Factory; package body Assert_AST is function Assert_AST (AST : String; Rule : Grammar_Rule; Message : String) return Analysis_Unit; function Assert_AST (AST : String; Rule : Grammar_Rule; Message : String) return Analysis_Unit is begin return Analyze_Fragment (AST, Rule); exception when others => Assert (Condition => False, Message => Message & ASCII.LF & "AST = " & AST & ASCII.LF & "Rule = " & Rule'Image); return No_Analysis_Unit; end Assert_AST; procedure Assert_Equal_AST (Expected_String, Actual_String : String; Rule : Grammar_Rule; Message : String) is Expected_AST : constant Analysis_Unit := Assert_AST (Expected_String, Rule, "Assert_Equal_AST - Expected_String is not an AST"); Actual_AST : constant Analysis_Unit := Assert_AST (Actual_String, Rule, "Assert_Equal_AST - Actual_String is not an AST"); MP : Match_Pattern; Match : constant Boolean := Match_Full (MP, Expected_AST.Root, Actual_AST.Root); begin Assert (Condition => Match, Message => Message & ASCII.LF & "Actual = " & Actual_String & ASCII.LF & "Expected = " & Expected_String & ASCII.LF); Assert (Condition => not MP.Get_Nodes.Is_Empty, Message => "Match so nodes expected"); end Assert_Equal_AST; end Assert_AST;
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- XML Processor -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2013-2014, Vadim Godunko <vgodunko@gmail.com> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with League.Characters.Latin; with League.Holders.Booleans; with League.Holders.JSON_Objects; with League.JSON.Objects; with League.JSON.Values; package body XML.Templates.Processors.Parser is type Token_Kinds is (Token_Identifier, Token_Full_Stop, Token_Is, Token_Of, Token_Not, Token_Null, Token_End_Of_Expression); subtype Keyword_Token is Token_Kinds range Token_Is .. Token_Null; type Scanner_Type is tagged record Text : League.Strings.Universal_String; Current : Positive := 1; Token : Token_Kinds; First : Positive; Last : Natural; end record; function Next_Token (Self : in out Scanner_Type'Class) return Token_Kinds; function Token_Image (Self : Scanner_Type'Class) return League.Strings.Universal_String; procedure Evaluate_Simple_Expression (Scanner : in out Scanner_Type'Class; Context : String_Holder_Maps.Map; Value : out League.Holders.Holder; Success : out Boolean); Keywords : constant array (Keyword_Token) of League.Strings.Universal_String := (Token_Is => League.Strings.To_Universal_String ("is"), Token_Of => League.Strings.To_Universal_String ("of"), Token_Not => League.Strings.To_Universal_String ("not"), Token_Null => League.Strings.To_Universal_String ("null")); --------------------------------- -- Evaluate_Boolean_Expression -- --------------------------------- procedure Evaluate_Boolean_Expression (Text : League.Strings.Universal_String; Context : String_Holder_Maps.Map; Value : out Boolean; Success : out Boolean) is Scanner : Scanner_Type; Holder : League.Holders.Holder; Invert : Boolean := False; Save : Positive := 1; -- Position of scanner after last 'not' begin Scanner.Text := Text; -- Process leading 'not' keywords loop case Scanner.Next_Token is when Token_Not => Invert := not Invert; Save := Scanner.Current; when others => -- Rewind scanner to the beginning of text Scanner.Current := Save; exit; end case; end loop; Scanner.Evaluate_Simple_Expression (Context, Holder, Success); if Success then case Scanner.Token is when Token_End_Of_Expression => if League.Holders.Has_Tag (Holder, League.Holders.Booleans.Value_Tag) then Value := League.Holders.Booleans.Element (Holder); else -- Only Boolean result is allowed in boolean expression Success := False; end if; when Token_Is => case Scanner.Next_Token is when Token_Null => Value := League.Holders.Is_Empty (Holder); when Token_Not => Value := not League.Holders.Is_Empty (Holder); if Scanner.Next_Token /= Token_Null then Success := False; end if; when others => Success := False; end case; if Scanner.Next_Token /= Token_End_Of_Expression then Success := False; end if; when others => Success := False; end case; Value := Value xor Invert; end if; end Evaluate_Boolean_Expression; ----------------------------- -- Evaluate_For_Expression -- ----------------------------- procedure Evaluate_For_Expression (Text : League.Strings.Universal_String; Context : String_Holder_Maps.Map; Variable : out League.Strings.Universal_String; Value : out League.Holders.Holder; Success : out Boolean) is Scanner : Scanner_Type; begin Scanner.Text := Text; -- Lookup for identifier. case Scanner.Next_Token is when Token_Identifier => Variable := Scanner.Token_Image.To_Casefold; Success := True; when others => League.Holders.Clear (Value); Success := False; return; end case; -- Lookup for 'Of' keyword. case Scanner.Next_Token is when Token_Of => null; when others => League.Holders.Clear (Value); Success := False; return; end case; -- Evaluate rest of expression. Scanner.Evaluate_Simple_Expression (Context, Value, Success); Success := Success and then Scanner.Token = Token_End_Of_Expression; end Evaluate_For_Expression; -------------------------------- -- Evaluate_Simple_Expression -- -------------------------------- procedure Evaluate_Simple_Expression (Text : League.Strings.Universal_String; Context : String_Holder_Maps.Map; Value : out League.Holders.Holder; Success : out Boolean) is Scanner : Scanner_Type; begin Scanner.Text := Text; Scanner.Evaluate_Simple_Expression (Context, Value, Success); Success := Success and then Scanner.Token = Token_End_Of_Expression; end Evaluate_Simple_Expression; -------------------------------- -- Evaluate_Simple_Expression -- -------------------------------- procedure Evaluate_Simple_Expression (Scanner : in out Scanner_Type'Class; Context : String_Holder_Maps.Map; Value : out League.Holders.Holder; Success : out Boolean) is begin -- Lookup for identifier loop case Scanner.Next_Token is when Token_Identifier => Value := Context (Scanner.Token_Image.To_Casefold); Success := True; exit; when others => League.Holders.Clear (Value); Success := False; return; end case; end loop; loop -- Lookup for full stop or end of expression. case Scanner.Next_Token is when Token_End_Of_Expression => exit; when Token_Full_Stop => null; when others => -- Return on end of expression or any other token return; end case; -- Lookup for identifier. case Scanner.Next_Token is when Token_Identifier => if League.Holders.Has_Tag (Value, League.Holders.JSON_Objects.Value_Tag) then declare JS_Object : constant League.JSON.Objects.JSON_Object := League.Holders.JSON_Objects.Element (Value); begin if not JS_Object.Contains (Scanner.Token_Image) then League.Holders.Clear (Value); Success := False; return; end if; Value := League.JSON.Values.To_Holder (JS_Object.Value (Scanner.Token_Image)); end; else League.Holders.Component (Value, Scanner.Token_Image, Value, Success); if not Success then return; end if; end if; when others => League.Holders.Clear (Value); Success := False; return; end case; end loop; end Evaluate_Simple_Expression; ---------------- -- Next_Token -- ---------------- function Next_Token (Self : in out Scanner_Type'Class) return Token_Kinds is use type League.Characters.Universal_Character; use type League.Strings.Universal_String; begin Self.First := Self.Current; -- Skip white spaces while Self.Current <= Self.Text.Length loop exit when not Self.Text (Self.Current).Is_White_Space; Self.Current := Self.Current + 1; Self.First := Self.Current; end loop; if Self.First > Self.Text.Length then Self.Token := Token_End_Of_Expression; -- Extract identifier elsif Self.Text (Self.First).Is_ID_Start then Self.Current := Self.Current + 1; while Self.Current <= Self.Text.Length loop exit when not Self.Text (Self.Current).Is_ID_Continue; Self.Current := Self.Current + 1; end loop; Self.Last := Self.Current - 1; Self.Token := Token_Identifier; for J in Keywords'Range loop if Self.Last - Self.First + 1 = Keywords (J).Length and then Self.Token_Image = Keywords (J) then Self.Token := J; exit; end if; end loop; elsif Self.Text (Self.First) = League.Characters.Latin.Full_Stop then Self.Current := Self.Current + 1; Self.Token := Token_Full_Stop; else raise Constraint_Error with "Syntax error"; end if; return Self.Token; end Next_Token; ----------------- -- Token_Image -- ----------------- function Token_Image (Self : Scanner_Type'Class) return League.Strings.Universal_String is begin return Self.Text.Slice (Self.First, Self.Last); end Token_Image; end XML.Templates.Processors.Parser;
with Ada.Characters.Conversions; package body GNAT.Encode_String is function Encode_Wide_Wide_String (S : Wide_Wide_String) return String is begin case Encoding_Method is when System.WCh_Con.WCEM_UTF8 => return Ada.Characters.Conversions.To_String (S); -- String is UTF-8 in drake. when others => raise Program_Error; -- unimplemented end case; end Encode_Wide_Wide_String; end GNAT.Encode_String;
------------------------------------------------------------------------------ -- G P S -- -- -- -- Copyright (C) 2002-2016, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. This software is distributed in the hope that it will be useful, -- -- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- -- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- -- License for more details. You should have received a copy of the GNU -- -- General Public License distributed with this software; see file -- -- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- -- of the license. -- ------------------------------------------------------------------------------ with Generic_Stack; package Indent_Stack is type Indent_Type is record Level : Integer; Align_Arrow : Natural; -- The column on which to align arrow delimiters Line : Natural; Continuation_Val : Natural; end record; package Stack is new Generic_Stack (Indent_Type); end Indent_Stack;
------------------------------------------------------------------------------ -- ZLib for Ada thick binding. -- -- -- -- Copyright (C) 2002-2004 Dmitriy Anisimkov -- -- -- -- This library is free software; you can redistribute it and/or modify -- -- it under the terms of the GNU General Public License as published by -- -- the Free Software Foundation; either version 2 of the License, or (at -- -- your option) any later version. -- -- -- -- This library is distributed in the hope that it will be useful, but -- -- WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- General Public License for more details. -- -- -- -- You should have received a copy of the GNU General Public License -- -- along with this library; if not, write to the Free Software Foundation, -- -- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- ------------------------------------------------------------------------------
with Interfaces.C, System; use type System.Address; package body FLTK.Widgets.Buttons.Enter is procedure return_button_set_draw_hook (W, D : in System.Address); pragma Import (C, return_button_set_draw_hook, "return_button_set_draw_hook"); pragma Inline (return_button_set_draw_hook); procedure return_button_set_handle_hook (W, H : in System.Address); pragma Import (C, return_button_set_handle_hook, "return_button_set_handle_hook"); pragma Inline (return_button_set_handle_hook); function new_fl_return_button (X, Y, W, H : in Interfaces.C.int; Text : in Interfaces.C.char_array) return System.Address; pragma Import (C, new_fl_return_button, "new_fl_return_button"); pragma Inline (new_fl_return_button); procedure free_fl_return_button (B : in System.Address); pragma Import (C, free_fl_return_button, "free_fl_return_button"); pragma Inline (free_fl_return_button); procedure fl_return_button_draw (W : in System.Address); pragma Import (C, fl_return_button_draw, "fl_return_button_draw"); pragma Inline (fl_return_button_draw); function fl_return_button_handle (W : in System.Address; E : in Interfaces.C.int) return Interfaces.C.int; pragma Import (C, fl_return_button_handle, "fl_return_button_handle"); pragma Inline (fl_return_button_handle); procedure Finalize (This : in out Enter_Button) is begin if This.Void_Ptr /= System.Null_Address and then This in Enter_Button'Class then free_fl_return_button (This.Void_Ptr); This.Void_Ptr := System.Null_Address; end if; Finalize (Button (This)); end Finalize; package body Forge is function Create (X, Y, W, H : in Integer; Text : in String) return Enter_Button is begin return This : Enter_Button do This.Void_Ptr := new_fl_return_button (Interfaces.C.int (X), Interfaces.C.int (Y), Interfaces.C.int (W), Interfaces.C.int (H), Interfaces.C.To_C (Text)); fl_widget_set_user_data (This.Void_Ptr, Widget_Convert.To_Address (This'Unchecked_Access)); return_button_set_draw_hook (This.Void_Ptr, Draw_Hook'Address); return_button_set_handle_hook (This.Void_Ptr, Handle_Hook'Address); end return; end Create; end Forge; procedure Draw (This : in out Enter_Button) is begin fl_return_button_draw (This.Void_Ptr); end Draw; function Handle (This : in out Enter_Button; Event : in Event_Kind) return Event_Outcome is begin return Event_Outcome'Val (fl_return_button_handle (This.Void_Ptr, Event_Kind'Pos (Event))); end Handle; end FLTK.Widgets.Buttons.Enter;
pragma License (Unrestricted); -- extended unit with Ada.Strings.Generic_Functions; package Ada.Strings.Wide_Functions is new Generic_Functions ( Character_Type => Wide_Character, String_Type => Wide_String, Space => Wide_Space); pragma Preelaborate (Ada.Strings.Wide_Functions);
-- part of OpenGLAda, (c) 2017 Felix Krause -- released under the terms of the MIT license, see the file "COPYING" with GL.Types.Colors; private package GL.Helpers is pragma Preelaborate; use GL.Types; function Float_Array (Value : Colors.Color) return Single_Array; function Color (Value : Single_Array) return Colors.Color; end GL.Helpers;
with VisitFailurePackage, EnvironmentPackage; use VisitFailurePackage, EnvironmentPackage; with Ada.Text_IO; use Ada.Text_IO; package body AbstractStrategyBasicPackage is ---------------------------------------------------------------------------- -- Strategy implementation ---------------------------------------------------------------------------- overriding function visit(str: access AbstractStrategyBasic; i: access Introspector'Class) return Integer is obj: ObjectPtr := null; begin obj := visitLight(StrategyPtr(str) , getSubject(str.env.all), i); EnvironmentPackage.setSubject( str.env.all, obj); return EnvironmentPackage.SUCCESS; exception when VisitFailure => return EnvironmentPackage.FAILURE; end; ---------------------------------------------------------------------------- -- Visitable implementation ---------------------------------------------------------------------------- overriding function getChildCount(v : access AbstractStrategyBasic) return Integer is begin return 1; end; overriding function setChildren(v: access AbstractStrategyBasic ; children : ObjectPtrArrayPtr) return VisitablePtr is begin v.any := StrategyPtr(children(children'First)); return VisitablePtr(v); end; overriding function getChildren(v: access AbstractStrategyBasic) return ObjectPtrArrayPtr is begin return new ObjectPtrArray'( 0 => ObjectPtr(v.any) ); end; overriding function getChildAt(v: access AbstractStrategyBasic; i : Integer) return VisitablePtr is IndexOutOfBoundsException : exception; begin if i = 0 then return VisitablePtr(v.any); else raise IndexOutOfBoundsException; end if; end; overriding function setChildAt(v: access AbstractStrategyBasic; i: in Integer; child: in VisitablePtr) return VisitablePtr is IndexOutOfBoundsException : exception; begin if i = 0 then v.any := StrategyPtr(child); else raise IndexOutOfBoundsException; end if; return VisitablePtr(v); end; ---------------------------------------------------------------------------- procedure makeAbstractStrategyBasic(asb : in out AbstractStrategyBasic'Class; s: StrategyPtr) is begin if s = null then asb.any := null; else asb.any := s; end if; end; ---------------------------------------------------------------------------- end AbstractStrategyBasicPackage;
-- { dg-do compile } -- { dg-options "-gnato" } procedure Dynamic_Bound is procedure Define (Count : Integer) is type Count_T is new Integer range 0 .. Count * 1000; type Obj_T is record Count : Count_T; end record; type T is access Obj_T ; procedure Create (S : in out T) is begin S := new Obj_T'(Count => 0); end; procedure Add (To : in out T) is begin To.Count := To.Count + 1; end; My_T : T; begin Create (My_T); end; begin Define (1); end;
with System.Formatting; with System.Long_Long_Integer_Types; package body System.Wid_LLI is use type Long_Long_Integer_Types.Long_Long_Unsigned; subtype Word_Unsigned is Long_Long_Integer_Types.Word_Unsigned; subtype Long_Long_Unsigned is Long_Long_Integer_Types.Long_Long_Unsigned; -- implementation function Width_Long_Long_Integer (Lo, Hi : Long_Long_Integer) return Natural is begin if Lo > Hi then return 0; else declare Max_Abs : Long_Long_Unsigned; Digits_Width : Natural; begin if Hi <= 0 then Max_Abs := -Long_Long_Unsigned'Mod (Lo); elsif Lo >= 0 then Max_Abs := Long_Long_Unsigned (Hi); else -- Lo < 0 and then Hi > 0 Max_Abs := Long_Long_Unsigned'Max ( -Long_Long_Unsigned'Mod (Lo), Long_Long_Unsigned (Hi)); end if; if Long_Long_Integer'Size <= Standard'Word_Size then Digits_Width := Formatting.Digits_Width (Word_Unsigned (Max_Abs)); else Digits_Width := Formatting.Digits_Width (Max_Abs); end if; return Digits_Width + 1; -- sign end; end if; end Width_Long_Long_Integer; end System.Wid_LLI;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- -- S Y S T E M . T A S K _ P R I M I T I V E S . O P E R A T I O N S -- -- -- -- B o d y -- -- -- -- Copyright (C) 1992-2006, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNARL is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNARL; see file COPYING. If not, write -- -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- -- Boston, MA 02110-1301, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNARL was developed by the GNARL team at Florida State University. -- -- Extensive contributions were provided by Ada Core Technologies, Inc. -- -- -- ------------------------------------------------------------------------------ -- This is the VxWorks version of this package -- This package contains all the GNULL primitives that interface directly -- with the underlying OS. pragma Polling (Off); -- Turn off polling, we do not want ATC polling to take place during -- tasking operations. It causes infinite loops and other problems. with System.Tasking.Debug; -- used for Known_Tasks with System.Interrupt_Management; -- used for Keep_Unmasked -- Abort_Task_Signal -- Signal_ID -- Initialize_Interrupts with Interfaces.C; with System.Soft_Links; -- used for Abort_Defer/Undefer -- We use System.Soft_Links instead of System.Tasking.Initialization -- because the later is a higher level package that we shouldn't depend on. -- For example when using the restricted run time, it is replaced by -- System.Tasking.Restricted.Stages. with Unchecked_Conversion; with Unchecked_Deallocation; package body System.Task_Primitives.Operations is package SSL renames System.Soft_Links; use System.Tasking.Debug; use System.Tasking; use System.OS_Interface; use System.Parameters; use type Interfaces.C.int; subtype int is System.OS_Interface.int; Relative : constant := 0; ---------------- -- Local Data -- ---------------- -- The followings are logically constants, but need to be initialized at -- run time. Single_RTS_Lock : aliased RTS_Lock; -- This is a lock to allow only one thread of control in the RTS at a -- time; it is used to execute in mutual exclusion from all other tasks. -- Used mainly in Single_Lock mode, but also to protect All_Tasks_List Environment_Task_Id : Task_Id; -- A variable to hold Task_Id for the environment task Unblocked_Signal_Mask : aliased sigset_t; -- The set of signals that should unblocked in all tasks -- The followings are internal configuration constants needed Time_Slice_Val : Integer; pragma Import (C, Time_Slice_Val, "__gl_time_slice_val"); Locking_Policy : Character; pragma Import (C, Locking_Policy, "__gl_locking_policy"); Dispatching_Policy : Character; pragma Import (C, Dispatching_Policy, "__gl_task_dispatching_policy"); Mutex_Protocol : Priority_Type; Foreign_Task_Elaborated : aliased Boolean := True; -- Used to identified fake tasks (i.e., non-Ada Threads) -------------------- -- Local Packages -- -------------------- package Specific is procedure Initialize; pragma Inline (Initialize); -- Initialize task specific data function Is_Valid_Task return Boolean; pragma Inline (Is_Valid_Task); -- Does executing thread have a TCB? procedure Set (Self_Id : Task_Id); pragma Inline (Set); -- Set the self id for the current task procedure Delete; pragma Inline (Delete); -- Delete the task specific data associated with the current task function Self return Task_Id; pragma Inline (Self); -- Return a pointer to the Ada Task Control Block of the calling task end Specific; package body Specific is separate; -- The body of this package is target specific --------------------------------- -- Support for foreign threads -- --------------------------------- function Register_Foreign_Thread (Thread : Thread_Id) return Task_Id; -- Allocate and Initialize a new ATCB for the current Thread function Register_Foreign_Thread (Thread : Thread_Id) return Task_Id is separate; ----------------------- -- Local Subprograms -- ----------------------- procedure Abort_Handler (signo : Signal); -- Handler for the abort (SIGABRT) signal to handle asynchronous abort procedure Install_Signal_Handlers; -- Install the default signal handlers for the current task function To_Address is new Unchecked_Conversion (Task_Id, System.Address); ------------------- -- Abort_Handler -- ------------------- procedure Abort_Handler (signo : Signal) is pragma Unreferenced (signo); Self_ID : constant Task_Id := Self; Result : int; Old_Set : aliased sigset_t; begin -- It is not safe to raise an exception when using ZCX and the GCC -- exception handling mechanism. if ZCX_By_Default and then GCC_ZCX_Support then return; end if; if Self_ID.Deferral_Level = 0 and then Self_ID.Pending_ATC_Level < Self_ID.ATC_Nesting_Level and then not Self_ID.Aborting then Self_ID.Aborting := True; -- Make sure signals used for RTS internal purpose are unmasked Result := pthread_sigmask (SIG_UNBLOCK, Unblocked_Signal_Mask'Unchecked_Access, Old_Set'Unchecked_Access); pragma Assert (Result = 0); raise Standard'Abort_Signal; end if; end Abort_Handler; ----------------- -- Stack_Guard -- ----------------- procedure Stack_Guard (T : ST.Task_Id; On : Boolean) is pragma Unreferenced (T); pragma Unreferenced (On); begin -- Nothing needed (why not???) null; end Stack_Guard; ------------------- -- Get_Thread_Id -- ------------------- function Get_Thread_Id (T : ST.Task_Id) return OSI.Thread_Id is begin return T.Common.LL.Thread; end Get_Thread_Id; ---------- -- Self -- ---------- function Self return Task_Id renames Specific.Self; ----------------------------- -- Install_Signal_Handlers -- ----------------------------- procedure Install_Signal_Handlers is act : aliased struct_sigaction; old_act : aliased struct_sigaction; Tmp_Set : aliased sigset_t; Result : int; begin act.sa_flags := 0; act.sa_handler := Abort_Handler'Address; Result := sigemptyset (Tmp_Set'Access); pragma Assert (Result = 0); act.sa_mask := Tmp_Set; Result := sigaction (Signal (Interrupt_Management.Abort_Task_Signal), act'Unchecked_Access, old_act'Unchecked_Access); pragma Assert (Result = 0); Interrupt_Management.Initialize_Interrupts; end Install_Signal_Handlers; --------------------- -- Initialize_Lock -- --------------------- procedure Initialize_Lock (Prio : System.Any_Priority; L : access Lock) is begin L.Mutex := semMCreate (SEM_Q_PRIORITY + SEM_INVERSION_SAFE); L.Prio_Ceiling := int (Prio); L.Protocol := Mutex_Protocol; pragma Assert (L.Mutex /= 0); end Initialize_Lock; procedure Initialize_Lock (L : access RTS_Lock; Level : Lock_Level) is pragma Unreferenced (Level); begin L.Mutex := semMCreate (SEM_Q_PRIORITY + SEM_INVERSION_SAFE); L.Prio_Ceiling := int (System.Any_Priority'Last); L.Protocol := Mutex_Protocol; pragma Assert (L.Mutex /= 0); end Initialize_Lock; ------------------- -- Finalize_Lock -- ------------------- procedure Finalize_Lock (L : access Lock) is Result : int; begin Result := semDelete (L.Mutex); pragma Assert (Result = 0); end Finalize_Lock; procedure Finalize_Lock (L : access RTS_Lock) is Result : int; begin Result := semDelete (L.Mutex); pragma Assert (Result = 0); end Finalize_Lock; ---------------- -- Write_Lock -- ---------------- procedure Write_Lock (L : access Lock; Ceiling_Violation : out Boolean) is Result : int; begin if L.Protocol = Prio_Protect and then int (Self.Common.Current_Priority) > L.Prio_Ceiling then Ceiling_Violation := True; return; else Ceiling_Violation := False; end if; Result := semTake (L.Mutex, WAIT_FOREVER); pragma Assert (Result = 0); end Write_Lock; procedure Write_Lock (L : access RTS_Lock; Global_Lock : Boolean := False) is Result : int; begin if not Single_Lock or else Global_Lock then Result := semTake (L.Mutex, WAIT_FOREVER); pragma Assert (Result = 0); end if; end Write_Lock; procedure Write_Lock (T : Task_Id) is Result : int; begin if not Single_Lock then Result := semTake (T.Common.LL.L.Mutex, WAIT_FOREVER); pragma Assert (Result = 0); end if; end Write_Lock; --------------- -- Read_Lock -- --------------- procedure Read_Lock (L : access Lock; Ceiling_Violation : out Boolean) is begin Write_Lock (L, Ceiling_Violation); end Read_Lock; ------------ -- Unlock -- ------------ procedure Unlock (L : access Lock) is Result : int; begin Result := semGive (L.Mutex); pragma Assert (Result = 0); end Unlock; procedure Unlock (L : access RTS_Lock; Global_Lock : Boolean := False) is Result : int; begin if not Single_Lock or else Global_Lock then Result := semGive (L.Mutex); pragma Assert (Result = 0); end if; end Unlock; procedure Unlock (T : Task_Id) is Result : int; begin if not Single_Lock then Result := semGive (T.Common.LL.L.Mutex); pragma Assert (Result = 0); end if; end Unlock; ----------- -- Sleep -- ----------- procedure Sleep (Self_ID : Task_Id; Reason : System.Tasking.Task_States) is pragma Unreferenced (Reason); Result : int; begin pragma Assert (Self_ID = Self); -- Release the mutex before sleeping if Single_Lock then Result := semGive (Single_RTS_Lock.Mutex); else Result := semGive (Self_ID.Common.LL.L.Mutex); end if; pragma Assert (Result = 0); -- Perform a blocking operation to take the CV semaphore. Note that a -- blocking operation in VxWorks will reenable task scheduling. When we -- are no longer blocked and control is returned, task scheduling will -- again be disabled. Result := semTake (Self_ID.Common.LL.CV, WAIT_FOREVER); pragma Assert (Result = 0); -- Take the mutex back if Single_Lock then Result := semTake (Single_RTS_Lock.Mutex, WAIT_FOREVER); else Result := semTake (Self_ID.Common.LL.L.Mutex, WAIT_FOREVER); end if; pragma Assert (Result = 0); end Sleep; ----------------- -- Timed_Sleep -- ----------------- -- This is for use within the run-time system, so abort is assumed to be -- already deferred, and the caller should be holding its own ATCB lock. procedure Timed_Sleep (Self_ID : Task_Id; Time : Duration; Mode : ST.Delay_Modes; Reason : System.Tasking.Task_States; Timedout : out Boolean; Yielded : out Boolean) is pragma Unreferenced (Reason); Orig : constant Duration := Monotonic_Clock; Absolute : Duration; Ticks : int; Result : int; Wakeup : Boolean := False; begin Timedout := False; Yielded := True; if Mode = Relative then Absolute := Orig + Time; -- Systematically add one since the first tick will delay *at most* -- 1 / Rate_Duration seconds, so we need to add one to be on the -- safe side. Ticks := To_Clock_Ticks (Time); if Ticks > 0 and then Ticks < int'Last then Ticks := Ticks + 1; end if; else Absolute := Time; Ticks := To_Clock_Ticks (Time - Monotonic_Clock); end if; if Ticks > 0 then loop -- Release the mutex before sleeping if Single_Lock then Result := semGive (Single_RTS_Lock.Mutex); else Result := semGive (Self_ID.Common.LL.L.Mutex); end if; pragma Assert (Result = 0); -- Perform a blocking operation to take the CV semaphore. Note -- that a blocking operation in VxWorks will reenable task -- scheduling. When we are no longer blocked and control is -- returned, task scheduling will again be disabled. Result := semTake (Self_ID.Common.LL.CV, Ticks); if Result = 0 then -- Somebody may have called Wakeup for us Wakeup := True; else if errno /= S_objLib_OBJ_TIMEOUT then Wakeup := True; else -- If Ticks = int'last, it was most probably truncated so -- let's make another round after recomputing Ticks from -- the the absolute time. if Ticks /= int'Last then Timedout := True; else Ticks := To_Clock_Ticks (Absolute - Monotonic_Clock); if Ticks < 0 then Timedout := True; end if; end if; end if; end if; -- Take the mutex back if Single_Lock then Result := semTake (Single_RTS_Lock.Mutex, WAIT_FOREVER); else Result := semTake (Self_ID.Common.LL.L.Mutex, WAIT_FOREVER); end if; pragma Assert (Result = 0); exit when Timedout or Wakeup; end loop; else Timedout := True; -- Should never hold a lock while yielding if Single_Lock then Result := semGive (Single_RTS_Lock.Mutex); taskDelay (0); Result := semTake (Single_RTS_Lock.Mutex, WAIT_FOREVER); else Result := semGive (Self_ID.Common.LL.L.Mutex); taskDelay (0); Result := semTake (Self_ID.Common.LL.L.Mutex, WAIT_FOREVER); end if; end if; end Timed_Sleep; ----------------- -- Timed_Delay -- ----------------- -- This is for use in implementing delay statements, so we assume the -- caller is holding no locks. procedure Timed_Delay (Self_ID : Task_Id; Time : Duration; Mode : ST.Delay_Modes) is Orig : constant Duration := Monotonic_Clock; Absolute : Duration; Ticks : int; Timedout : Boolean; Result : int; Aborted : Boolean := False; begin if Mode = Relative then Absolute := Orig + Time; Ticks := To_Clock_Ticks (Time); if Ticks > 0 and then Ticks < int'Last then -- First tick will delay anytime between 0 and 1 / sysClkRateGet -- seconds, so we need to add one to be on the safe side. Ticks := Ticks + 1; end if; else Absolute := Time; Ticks := To_Clock_Ticks (Time - Orig); end if; if Ticks > 0 then -- Modifying State and Pending_Priority_Change, locking the TCB if Single_Lock then Result := semTake (Single_RTS_Lock.Mutex, WAIT_FOREVER); else Result := semTake (Self_ID.Common.LL.L.Mutex, WAIT_FOREVER); end if; pragma Assert (Result = 0); Self_ID.Common.State := Delay_Sleep; Timedout := False; loop if Self_ID.Pending_Priority_Change then Self_ID.Pending_Priority_Change := False; Self_ID.Common.Base_Priority := Self_ID.New_Base_Priority; Set_Priority (Self_ID, Self_ID.Common.Base_Priority); end if; Aborted := Self_ID.Pending_ATC_Level < Self_ID.ATC_Nesting_Level; -- Release the TCB before sleeping if Single_Lock then Result := semGive (Single_RTS_Lock.Mutex); else Result := semGive (Self_ID.Common.LL.L.Mutex); end if; pragma Assert (Result = 0); exit when Aborted; Result := semTake (Self_ID.Common.LL.CV, Ticks); if Result /= 0 then -- If Ticks = int'last, it was most probably truncated -- so let's make another round after recomputing Ticks -- from the the absolute time. if errno = S_objLib_OBJ_TIMEOUT and then Ticks /= int'Last then Timedout := True; else Ticks := To_Clock_Ticks (Absolute - Monotonic_Clock); if Ticks < 0 then Timedout := True; end if; end if; end if; -- Take back the lock after having slept, to protect further -- access to Self_ID. if Single_Lock then Result := semTake (Single_RTS_Lock.Mutex, WAIT_FOREVER); else Result := semTake (Self_ID.Common.LL.L.Mutex, WAIT_FOREVER); end if; pragma Assert (Result = 0); exit when Timedout; end loop; Self_ID.Common.State := Runnable; if Single_Lock then Result := semGive (Single_RTS_Lock.Mutex); else Result := semGive (Self_ID.Common.LL.L.Mutex); end if; else taskDelay (0); end if; end Timed_Delay; --------------------- -- Monotonic_Clock -- --------------------- function Monotonic_Clock return Duration is TS : aliased timespec; Result : int; begin Result := clock_gettime (CLOCK_REALTIME, TS'Unchecked_Access); pragma Assert (Result = 0); return To_Duration (TS); end Monotonic_Clock; ------------------- -- RT_Resolution -- ------------------- function RT_Resolution return Duration is begin return 1.0 / Duration (sysClkRateGet); end RT_Resolution; ------------ -- Wakeup -- ------------ procedure Wakeup (T : Task_Id; Reason : System.Tasking.Task_States) is pragma Unreferenced (Reason); Result : int; begin Result := semGive (T.Common.LL.CV); pragma Assert (Result = 0); end Wakeup; ----------- -- Yield -- ----------- procedure Yield (Do_Yield : Boolean := True) is pragma Unreferenced (Do_Yield); Result : int; pragma Unreferenced (Result); begin Result := taskDelay (0); end Yield; ------------------ -- Set_Priority -- ------------------ type Prio_Array_Type is array (System.Any_Priority) of Integer; pragma Atomic_Components (Prio_Array_Type); Prio_Array : Prio_Array_Type; -- Global array containing the id of the currently running task for -- each priority. Note that we assume that we are on a single processor -- with run-till-blocked scheduling. procedure Set_Priority (T : Task_Id; Prio : System.Any_Priority; Loss_Of_Inheritance : Boolean := False) is Array_Item : Integer; Result : int; begin Result := taskPrioritySet (T.Common.LL.Thread, To_VxWorks_Priority (int (Prio))); pragma Assert (Result = 0); if Dispatching_Policy = 'F' then -- Annex D requirement [RM D.2.2 par. 9]: -- If the task drops its priority due to the loss of inherited -- priority, it is added at the head of the ready queue for its -- new active priority. if Loss_Of_Inheritance and then Prio < T.Common.Current_Priority then Array_Item := Prio_Array (T.Common.Base_Priority) + 1; Prio_Array (T.Common.Base_Priority) := Array_Item; loop -- Give some processes a chance to arrive taskDelay (0); -- Then wait for our turn to proceed exit when Array_Item = Prio_Array (T.Common.Base_Priority) or else Prio_Array (T.Common.Base_Priority) = 1; end loop; Prio_Array (T.Common.Base_Priority) := Prio_Array (T.Common.Base_Priority) - 1; end if; end if; T.Common.Current_Priority := Prio; end Set_Priority; ------------------ -- Get_Priority -- ------------------ function Get_Priority (T : Task_Id) return System.Any_Priority is begin return T.Common.Current_Priority; end Get_Priority; ---------------- -- Enter_Task -- ---------------- procedure Enter_Task (Self_ID : Task_Id) is procedure Init_Float; pragma Import (C, Init_Float, "__gnat_init_float"); -- Properly initializes the FPU for PPC/MIPS systems begin Self_ID.Common.LL.Thread := taskIdSelf; Specific.Set (Self_ID); Init_Float; -- Install the signal handlers -- This is called for each task since there is no signal inheritance -- between VxWorks tasks. Install_Signal_Handlers; Lock_RTS; for J in Known_Tasks'Range loop if Known_Tasks (J) = null then Known_Tasks (J) := Self_ID; Self_ID.Known_Tasks_Index := J; exit; end if; end loop; Unlock_RTS; end Enter_Task; -------------- -- New_ATCB -- -------------- function New_ATCB (Entry_Num : Task_Entry_Index) return Task_Id is begin return new Ada_Task_Control_Block (Entry_Num); end New_ATCB; ------------------- -- Is_Valid_Task -- ------------------- function Is_Valid_Task return Boolean renames Specific.Is_Valid_Task; ----------------------------- -- Register_Foreign_Thread -- ----------------------------- function Register_Foreign_Thread return Task_Id is begin if Is_Valid_Task then return Self; else return Register_Foreign_Thread (taskIdSelf); end if; end Register_Foreign_Thread; -------------------- -- Initialize_TCB -- -------------------- procedure Initialize_TCB (Self_ID : Task_Id; Succeeded : out Boolean) is begin Self_ID.Common.LL.CV := semBCreate (SEM_Q_PRIORITY, SEM_EMPTY); Self_ID.Common.LL.Thread := 0; if Self_ID.Common.LL.CV = 0 then Succeeded := False; else Succeeded := True; if not Single_Lock then Initialize_Lock (Self_ID.Common.LL.L'Access, ATCB_Level); end if; end if; end Initialize_TCB; ----------------- -- Create_Task -- ----------------- procedure Create_Task (T : Task_Id; Wrapper : System.Address; Stack_Size : System.Parameters.Size_Type; Priority : System.Any_Priority; Succeeded : out Boolean) is Adjusted_Stack_Size : size_t; begin -- Ask for four extra bytes of stack space so that the ATCB pointer can -- be stored below the stack limit, plus extra space for the frame of -- Task_Wrapper. This is so the user gets the amount of stack requested -- exclusive of the needs. -- We also have to allocate n more bytes for the task name storage and -- enough space for the Wind Task Control Block which is around 0x778 -- bytes. VxWorks also seems to carve out additional space, so use 2048 -- as a nice round number. We might want to increment to the nearest -- page size in case we ever support VxVMI. -- ??? - we should come back and visit this so we can set the task name -- to something appropriate. Adjusted_Stack_Size := size_t (Stack_Size) + 2048; -- Since the initial signal mask of a thread is inherited from the -- creator, and the Environment task has all its signals masked, we do -- not need to manipulate caller's signal mask at this point. All tasks -- in RTS will have All_Tasks_Mask initially. if T.Common.Task_Image_Len = 0 then T.Common.LL.Thread := taskSpawn (System.Null_Address, To_VxWorks_Priority (int (Priority)), VX_FP_TASK, Adjusted_Stack_Size, Wrapper, To_Address (T)); else declare Name : aliased String (1 .. T.Common.Task_Image_Len + 1); begin Name (1 .. Name'Last - 1) := T.Common.Task_Image (1 .. T.Common.Task_Image_Len); Name (Name'Last) := ASCII.NUL; T.Common.LL.Thread := taskSpawn (Name'Address, To_VxWorks_Priority (int (Priority)), VX_FP_TASK, Adjusted_Stack_Size, Wrapper, To_Address (T)); end; end if; if T.Common.LL.Thread = -1 then Succeeded := False; else Succeeded := True; end if; Task_Creation_Hook (T.Common.LL.Thread); Set_Priority (T, Priority); end Create_Task; ------------------ -- Finalize_TCB -- ------------------ procedure Finalize_TCB (T : Task_Id) is Result : int; Tmp : Task_Id := T; Is_Self : constant Boolean := (T = Self); procedure Free is new Unchecked_Deallocation (Ada_Task_Control_Block, Task_Id); begin if not Single_Lock then Result := semDelete (T.Common.LL.L.Mutex); pragma Assert (Result = 0); end if; T.Common.LL.Thread := 0; Result := semDelete (T.Common.LL.CV); pragma Assert (Result = 0); if T.Known_Tasks_Index /= -1 then Known_Tasks (T.Known_Tasks_Index) := null; end if; Free (Tmp); if Is_Self then Specific.Delete; end if; end Finalize_TCB; --------------- -- Exit_Task -- --------------- procedure Exit_Task is begin Specific.Set (null); end Exit_Task; ---------------- -- Abort_Task -- ---------------- procedure Abort_Task (T : Task_Id) is Result : int; begin Result := kill (T.Common.LL.Thread, Signal (Interrupt_Management.Abort_Task_Signal)); pragma Assert (Result = 0); end Abort_Task; ---------------- -- Initialize -- ---------------- procedure Initialize (S : in out Suspension_Object) is begin -- Initialize internal state. It is always initialized to False (ARM -- D.10 par. 6). S.State := False; S.Waiting := False; -- Initialize internal mutex -- Use simpler binary semaphore instead of VxWorks -- mutual exclusion semaphore, because we don't need -- the fancier semantics and their overhead. S.L := semBCreate (SEM_Q_FIFO, SEM_FULL); -- Initialize internal condition variable S.CV := semBCreate (SEM_Q_FIFO, SEM_EMPTY); end Initialize; -------------- -- Finalize -- -------------- procedure Finalize (S : in out Suspension_Object) is Result : STATUS; begin -- Destroy internal mutex Result := semDelete (S.L); pragma Assert (Result = OK); -- Destroy internal condition variable Result := semDelete (S.CV); pragma Assert (Result = OK); end Finalize; ------------------- -- Current_State -- ------------------- function Current_State (S : Suspension_Object) return Boolean is begin -- We do not want to use lock on this read operation. State is marked -- as Atomic so that we ensure that the value retrieved is correct. return S.State; end Current_State; --------------- -- Set_False -- --------------- procedure Set_False (S : in out Suspension_Object) is Result : STATUS; begin SSL.Abort_Defer.all; Result := semTake (S.L, WAIT_FOREVER); pragma Assert (Result = OK); S.State := False; Result := semGive (S.L); pragma Assert (Result = OK); SSL.Abort_Undefer.all; end Set_False; -------------- -- Set_True -- -------------- procedure Set_True (S : in out Suspension_Object) is Result : STATUS; begin SSL.Abort_Defer.all; Result := semTake (S.L, WAIT_FOREVER); pragma Assert (Result = OK); -- If there is already a task waiting on this suspension object then -- we resume it, leaving the state of the suspension object to False, -- as it is specified in ARM D.10 par. 9. Otherwise, it just leaves -- the state to True. if S.Waiting then S.Waiting := False; S.State := False; Result := semGive (S.CV); pragma Assert (Result = OK); else S.State := True; end if; Result := semGive (S.L); pragma Assert (Result = OK); SSL.Abort_Undefer.all; end Set_True; ------------------------ -- Suspend_Until_True -- ------------------------ procedure Suspend_Until_True (S : in out Suspension_Object) is Result : STATUS; begin SSL.Abort_Defer.all; Result := semTake (S.L, WAIT_FOREVER); if S.Waiting then -- Program_Error must be raised upon calling Suspend_Until_True -- if another task is already waiting on that suspension object -- (ARM D.10 par. 10). Result := semGive (S.L); pragma Assert (Result = OK); SSL.Abort_Undefer.all; raise Program_Error; else -- Suspend the task if the state is False. Otherwise, the task -- continues its execution, and the state of the suspension object -- is set to False (ARM D.10 par. 9). if S.State then S.State := False; Result := semGive (S.L); pragma Assert (Result = 0); SSL.Abort_Undefer.all; else S.Waiting := True; -- Release the mutex before sleeping Result := semGive (S.L); pragma Assert (Result = OK); SSL.Abort_Undefer.all; Result := semTake (S.CV, WAIT_FOREVER); pragma Assert (Result = 0); end if; end if; end Suspend_Until_True; ---------------- -- Check_Exit -- ---------------- -- Dummy version function Check_Exit (Self_ID : ST.Task_Id) return Boolean is pragma Unreferenced (Self_ID); begin return True; end Check_Exit; -------------------- -- Check_No_Locks -- -------------------- function Check_No_Locks (Self_ID : ST.Task_Id) return Boolean is pragma Unreferenced (Self_ID); begin return True; end Check_No_Locks; ---------------------- -- Environment_Task -- ---------------------- function Environment_Task return Task_Id is begin return Environment_Task_Id; end Environment_Task; -------------- -- Lock_RTS -- -------------- procedure Lock_RTS is begin Write_Lock (Single_RTS_Lock'Access, Global_Lock => True); end Lock_RTS; ---------------- -- Unlock_RTS -- ---------------- procedure Unlock_RTS is begin Unlock (Single_RTS_Lock'Access, Global_Lock => True); end Unlock_RTS; ------------------ -- Suspend_Task -- ------------------ function Suspend_Task (T : ST.Task_Id; Thread_Self : Thread_Id) return Boolean is begin if T.Common.LL.Thread /= 0 and then T.Common.LL.Thread /= Thread_Self then return taskSuspend (T.Common.LL.Thread) = 0; else return True; end if; end Suspend_Task; ----------------- -- Resume_Task -- ----------------- function Resume_Task (T : ST.Task_Id; Thread_Self : Thread_Id) return Boolean is begin if T.Common.LL.Thread /= 0 and then T.Common.LL.Thread /= Thread_Self then return taskResume (T.Common.LL.Thread) = 0; else return True; end if; end Resume_Task; ---------------- -- Initialize -- ---------------- procedure Initialize (Environment_Task : Task_Id) is Result : int; begin Environment_Task_Id := Environment_Task; Interrupt_Management.Initialize; Specific.Initialize; if Locking_Policy = 'C' then Mutex_Protocol := Prio_Protect; elsif Locking_Policy = 'I' then Mutex_Protocol := Prio_Inherit; else Mutex_Protocol := Prio_None; end if; if Time_Slice_Val > 0 then Result := Set_Time_Slice (To_Clock_Ticks (Duration (Time_Slice_Val) / Duration (1_000_000.0))); end if; Result := sigemptyset (Unblocked_Signal_Mask'Access); pragma Assert (Result = 0); for J in Interrupt_Management.Signal_ID loop if System.Interrupt_Management.Keep_Unmasked (J) then Result := sigaddset (Unblocked_Signal_Mask'Access, Signal (J)); pragma Assert (Result = 0); end if; end loop; -- Initialize the lock used to synchronize chain of all ATCBs Initialize_Lock (Single_RTS_Lock'Access, RTS_Lock_Level); Enter_Task (Environment_Task); end Initialize; end System.Task_Primitives.Operations;
-- Standard Ada library specification -- Copyright (c) 2003-2018 Maxim Reznik <reznikmm@gmail.com> -- Copyright (c) 2004-2016 AXE Consultants -- Copyright (c) 2004, 2005, 2006 Ada-Europe -- Copyright (c) 2000 The MITRE Corporation, Inc. -- Copyright (c) 1992, 1993, 1994, 1995 Intermetrics, Inc. -- SPDX-License-Identifier: BSD-3-Clause and LicenseRef-AdaReferenceManual --------------------------------------------------------------------------- with Ada.Calendar; with Ada.IO_Exceptions; package Ada.Directories is -- Directory and file operations: function Current_Directory return String; procedure Set_Directory (Directory : in String); procedure Create_Directory (New_Directory : in String; Form : in String := ""); procedure Delete_Directory (Directory : in String); procedure Create_Path (New_Directory : in String; Form : in String := ""); procedure Delete_Tree (Directory : in String); procedure Delete_File (Name : in String); procedure Rename (Old_Name : in String; New_Name : in String); procedure Copy_File (Source_Name : in String; Target_Name : in String; Form : in String := ""); -- File and directory name operations: function Full_Name (Name : in String) return String; function Simple_Name (Name : in String) return String; function Containing_Directory (Name : in String) return String; function Extension (Name : in String) return String; function Base_Name (Name : in String) return String; function Compose (Containing_Directory : in String := ""; Name : in String; Extension : in String := "") return String; type Name_Case_Kind is (Unknown, Case_Sensitive, Case_Insensitive, Case_Preserving); function Name_Case_Equivalence (Name : in String) return Name_Case_Kind; -- File and directory queries: type File_Kind is (Directory, Ordinary_File, Special_File); type File_Size is range 0 .. implementation_defined; function Exists (Name : in String) return Boolean; function Kind (Name : in String) return File_Kind; function Size (Name : in String) return File_Size; function Modification_Time (Name : in String) return Ada.Calendar.Time; -- Directory searching: type Directory_Entry_Type is limited private; type Filter_Type is array (File_Kind) of Boolean; type Search_Type is limited private; procedure Start_Search (Search : in out Search_Type; Directory : in String; Pattern : in String; Filter : in Filter_Type := (others => True)); procedure End_Search (Search : in out Search_Type); function More_Entries (Search : in Search_Type) return Boolean; procedure Get_Next_Entry (Search : in out Search_Type; Directory_Entry : out Directory_Entry_Type); procedure Search (Directory : in String; Pattern : in String; Filter : in Filter_Type := (others => True); Process : not null access procedure (Directory_Entry : in Directory_Entry_Type)); -- Operations on Directory Entries: function Simple_Name (Directory_Entry : in Directory_Entry_Type) return String; function Full_Name (Directory_Entry : in Directory_Entry_Type) return String; function Kind (Directory_Entry : in Directory_Entry_Type) return File_Kind; function Size (Directory_Entry : in Directory_Entry_Type) return File_Size; function Modification_Time (Directory_Entry : in Directory_Entry_Type) return Ada.Calendar.Time; Status_Error : exception renames Ada.IO_Exceptions.Status_Error; Name_Error : exception renames Ada.IO_Exceptions.Name_Error; Use_Error : exception renames Ada.IO_Exceptions.Use_Error; Device_Error : exception renames Ada.IO_Exceptions.Device_Error; private pragma Import (Ada, Directory_Entry_Type); pragma Import (Ada, Search_Type); end Ada.Directories;
------------------------------------------------------------------------------ -- -- -- GNAT SYSTEM UTILITIES -- -- -- -- X E I N F O -- -- -- -- B o d y -- -- -- -- $Revision$ -- -- -- Copyright (C) 1992-2001 Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- Program to construct C header file a-einfo.h (C version of einfo.ads spec) -- for use by Gigi. This header file contaInF all definitions and access -- functions, but does not contain set procedures, since Gigi is not allowed -- to modify the GNAT tree) -- Input files: -- einfo.ads spec of Einfo package -- einfo.adb body of Einfo package -- Output files: -- a-einfo.h Corresponding c header file -- Note: It is assumed that the input files have been compiled without errors -- An optional argument allows the specification of an output file name to -- override the default a-einfo.h file name for the generated output file. -- Most, but not all of the functions in Einfo can be inlined in the C header. -- They are the functions identified by pragma Inline in the spec. Functions -- that cannot be inlined are simply defined in the header. with Ada.Command_Line; use Ada.Command_Line; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Strings.Unbounded.Text_IO; use Ada.Strings.Unbounded.Text_IO; with Ada.Strings.Maps; use Ada.Strings.Maps; with Ada.Strings.Maps.Constants; use Ada.Strings.Maps.Constants; with Ada.Text_IO; use Ada.Text_IO; with GNAT.Spitbol; use GNAT.Spitbol; with GNAT.Spitbol.Patterns; use GNAT.Spitbol.Patterns; with GNAT.Spitbol.Table_Boolean; use GNAT.Spitbol.Table_Boolean; procedure XEinfo is package TB renames GNAT.Spitbol.Table_Boolean; Err : exception; A : VString := Nul; B : VString := Nul; C : VString := Nul; Einfobrev : VString := Nul; Einfosrev : VString := Nul; Expr : VString := Nul; Filler : VString := Nul; Fline : VString := Nul; Formal : VString := Nul; Formaltyp : VString := Nul; FN : VString := Nul; Line : VString := Nul; N : VString := Nul; N1 : VString := Nul; N2 : VString := Nul; N3 : VString := Nul; Nam : VString := Nul; Name : VString := Nul; NewS : VString := Nul; Nextlin : VString := Nul; OldS : VString := Nul; Rtn : VString := Nul; Term : VString := Nul; XEinforev : VString := Nul; InB : File_Type; -- Used to read initial header from body InF : File_Type; -- Used to read full text of both spec and body Ofile : File_Type; -- Used to write output file wsp : Pattern := NSpan (' ' & ASCII.HT); Get_BRev : Pattern := BreakX ('$') & "$Rev" & "ision: " & Break (' ') * Einfobrev; Get_SRev : Pattern := BreakX ('$') & "$Rev" & "ision: " & Break (' ') * Einfosrev; Comment : Pattern := wsp & "--"; For_Rep : Pattern := wsp & "for"; Get_Func : Pattern := wsp * A & "function" & wsp & Break (' ') * Name; Inline : Pattern := wsp & "pragma Inline (" & Break (')') * Name; Get_Pack : Pattern := wsp & "package "; Get_Enam : Pattern := wsp & Break (',') * N & ','; Find_Fun : Pattern := wsp & "function"; F_Subtyp : Pattern := wsp * A & "subtype " & Break (' ') * N; G_Subtyp : Pattern := wsp & "subtype" & wsp & Break (' ') * NewS & wsp & "is" & wsp & Break (" ;") * OldS & wsp & ';' & wsp & Rtab (0); F_Typ : Pattern := wsp * A & "type " & Break (' ') * N & " is ("; Get_Nam : Pattern := wsp * A & Break (",)") * Nam & Len (1) * Term; Get_Styp : Pattern := wsp * A & "subtype " & Break (' ') * N; Get_N1 : Pattern := wsp & Break (' ') * N1; Get_N2 : Pattern := wsp & "-- " & Rest * N2; Get_N3 : Pattern := wsp & Break (';') * N3; Get_FN : Pattern := wsp * C & "function" & wsp & Break (" (") * FN; Is_Rturn : Pattern := BreakX ('r') & "return"; Is_Begin : Pattern := wsp & "begin"; Get_Asrt : Pattern := wsp & "pragma Assert"; Semicoln : Pattern := BreakX (';'); Get_Cmnt : Pattern := BreakX ('-') * A & "--"; Get_Expr : Pattern := wsp & "return " & Break (';') * Expr; Chek_End : Pattern := wsp & "end" & BreakX (';') & ';'; Get_B1 : Pattern := BreakX (' ') * A & " in " & Rest * B; Get_B2 : Pattern := BreakX (' ') * A & " = " & Rest * B; Get_B3 : Pattern := BreakX (' ') * A & " /= " & Rest * B; To_Paren : Pattern := wsp * Filler & '('; Get_Fml : Pattern := Break (" :") * Formal & wsp & ':' & wsp & BreakX (" );") * Formaltyp; Nxt_Fml : Pattern := wsp & "; "; Get_Rtn : Pattern := wsp & "return" & wsp & BreakX (" ;") * Rtn; Rem_Prn : Pattern := wsp & ')'; M : Match_Result; Lineno : Natural := 0; -- Line number in spec V : Natural; Ctr : Natural; Inlined : TB.Table (200); -- Inlined<N> = True for inlined function, False otherwise Lastinlined : Boolean; procedure Badfunc; -- Signal bad function in body function Getlin return VString; -- Get non-comment line (comment lines skipped, also skips FOR rep clauses) -- Fatal error (raises End_Error exception) if end of file encountered procedure Must (B : Boolean); -- Raises Err if the argument (a Match) call, returns False procedure Sethead (Line : in out VString; Term : String); -- Process function header into C ------------- -- Badfunc -- ------------- procedure Badfunc is begin Put_Line (Standard_Error, "Body for function " & FN & " does not meet requirements"); raise Err; end Badfunc; ------------- -- Getlin -- ------------- function Getlin return VString is Lin : VString; begin loop Lin := Get_Line (InF); Lineno := Lineno + 1; if Lin /= "" and then not Match (Lin, Comment) and then not Match (Lin, For_Rep) then return Lin; end if; end loop; end Getlin; ---------- -- Must -- ---------- procedure Must (B : Boolean) is begin if not B then raise Err; end if; end Must; ------------- -- Sethead -- ------------- procedure Sethead (Line : in out VString; Term : String) is Args : VString; begin Must (Match (Line, Get_Func, "")); Args := Nul; if Match (Line, To_Paren, "") then Args := Filler & '('; loop Must (Match (Line, Get_Fml, "")); Append (Args, Formaltyp & ' ' & Formal); exit when not Match (Line, Nxt_Fml); Append (Args, ","); end loop; Match (Line, Rem_Prn, ""); Append (Args, ')'); end if; Must (Match (Line, Get_Rtn)); if Present (Inlined, Name) then Put_Line (Ofile, A & "INLINE " & Rtn & ' ' & Name & Args & Term); else Put_Line (Ofile, A & Rtn & ' ' & Name & Args & Term); end if; end Sethead; -- Start of processing for XEinfo begin Anchored_Mode := True; Match ("$Revision$", "$Rev" & "ision: " & Break (' ') * XEinforev); if Argument_Count > 0 then Create (Ofile, Out_File, Argument (1)); else Create (Ofile, Out_File, "a-einfo.h"); end if; Open (InB, In_File, "einfo.adb"); Open (InF, In_File, "einfo.ads"); Lineno := 0; -- Get einfo revs and write header to output file loop Line := Get_Line (InB); if Line = "" then raise Err; end if; exit when Match (Line, Get_BRev); end loop; loop Line := Get_Line (InF); Lineno := Lineno + 1; exit when Line = ""; if Match (Line, Get_SRev) then Put_Line (Ofile, "/* Generated by xeinfo revision " & XEinforev & " using */"); Put_Line (Ofile, "/* einfo.ads revision " & Einfosrev & " */"); Put_Line (Ofile, "/* einfo.adb revision " & Einfobrev & " */"); else Match (Line, "-- S p e c ", "-- C Header File "); Match (Line, "--", "/*"); Match (Line, Rtab (2) * A & "--", M); Replace (M, A & "*/"); Put_Line (Ofile, Line); end if; end loop; Put_Line (Ofile, ""); -- Find and record pragma Inlines loop Line := Get_Line (InF); exit when Match (Line, " -- END XEINFO INLINES"); if Match (Line, Inline) then Set (Inlined, Name, True); end if; end loop; -- Skip to package line Reset (InF, In_File); Lineno := 0; loop Line := Getlin; exit when Match (Line, Get_Pack); end loop; V := 0; Line := Getlin; Must (Match (Line, wsp & "type Entity_Kind")); -- Process entity kind code definitions loop Line := Getlin; exit when not Match (Line, Get_Enam); Put_Line (Ofile, " #define " & Rpad (N, 32) & " " & V); V := V + 1; end loop; Must (Match (Line, wsp & Rest * N)); Put_Line (Ofile, " #define " & Rpad (N, 32) & ' ' & V); Line := Getlin; Must (Match (Line, wsp & ");")); Put_Line (Ofile, ""); -- Loop through subtype and type declarations loop Line := Getlin; exit when Match (Line, Find_Fun); -- Case of a subtype declaration if Match (Line, F_Subtyp) then -- Case of a subtype declaration that is an abbreviation of the -- form subtype x is y, and if so generate the appropriate typedef if Match (Line, G_Subtyp) then Put_Line (Ofile, A & "typedef " & OldS & ' ' & NewS & ';'); -- Otherwise the subtype must be declaring a subrange of Entity_Id else Must (Match (Line, Get_Styp)); Line := Getlin; Must (Match (Line, Get_N1)); loop Line := Get_Line (InF); Lineno := Lineno + 1; exit when not Match (Line, Get_N2); end loop; Must (Match (Line, Get_N3)); Put_Line (Ofile, A & "SUBTYPE (" & N & ", Entity_Kind, "); Put_Line (Ofile, A & " " & N1 & ", " & N3 & ')'); Put_Line (Ofile, ""); end if; -- Case of type declaration elsif Match (Line, F_Typ) then -- Process type declaration (must be enumeration type) Ctr := 0; Put_Line (Ofile, A & "typedef char " & N & ';'); loop Line := Getlin; Must (Match (Line, Get_Nam)); Put_Line (Ofile, A & "#define " & Rpad (Nam, 25) & Ctr); Ctr := Ctr + 1; exit when Term /= ","; end loop; Put_Line (Ofile, ""); -- Neither subtype nor type declaration else raise Err; end if; end loop; -- Process function declarations -- Note: Lastinlined used to control blank lines Put_Line (Ofile, ""); Lastinlined := True; -- Loop through function declarations while Match (Line, Get_FN) loop -- Non-inlined function if not Present (Inlined, FN) then Put_Line (Ofile, ""); Put_Line (Ofile, " #define " & FN & " einfo__" & Translate (FN, Lower_Case_Map)); -- Inlined function else if not Lastinlined then Put_Line (Ofile, ""); end if; end if; -- Merge here to output spec Sethead (Line, ";"); Lastinlined := Get (Inlined, FN); Line := Getlin; end loop; Put_Line (Ofile, ""); -- Read body to find inlined functions Close (InB); Close (InF); Open (InF, In_File, "einfo.adb"); Lineno := 0; -- Loop through input lines to find bodies of inlined functions while not End_Of_File (InF) loop Fline := Get_Line (InF); if Match (Fline, Get_FN) and then Get (Inlined, FN) then -- Here we have an inlined function if not Match (Fline, Is_Rturn) then Line := Fline; Badfunc; end if; Line := Getlin; if not Match (Line, Is_Begin) then Badfunc; end if; -- Skip past pragma Asserts loop Line := Getlin; exit when not Match (Line, Get_Asrt); -- Pragma asser found, get its continuation lines loop exit when Match (Line, Semicoln); Line := Getlin; end loop; end loop; -- Process return statement Match (Line, Get_Cmnt, M); Replace (M, A); -- Get continuations of return statemnt while not Match (Line, Semicoln) loop Nextlin := Getlin; Match (Nextlin, wsp, " "); Append (Line, Nextlin); end loop; if not Match (Line, Get_Expr) then Badfunc; end if; Line := Getlin; if not Match (Line, Chek_End) then Badfunc; end if; Match (Expr, Get_B1, M); Replace (M, "IN (" & A & ", " & B & ')'); Match (Expr, Get_B2, M); Replace (M, A & " == " & B); Match (Expr, Get_B3, M); Replace (M, A & " != " & B); Put_Line (Ofile, ""); Sethead (Fline, ""); Put_Line (Ofile, C & " { return " & Expr & "; }"); end if; end loop; Put_Line (Ofile, ""); Put_Line (Ofile, "/* End of einfo.h (C version of Einfo package specification) */"); exception when Err => Put_Line (Standard_Error, Lineno & ". " & Line); Put_Line (Standard_Error, "**** fatal error ****"); Set_Exit_Status (1); when End_Error => Put_Line (Standard_Error, "unexpected end of file"); Put_Line (Standard_Error, "**** fatal error ****"); end XEinfo;
-- ----------------------------------------------------------------------------- -- Copyright (C) 2003-2019 Stichting Mapcode Foundation (http://www.mapcode.com) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. -- ----------------------------------------------------------------------------- -- Various utilities on strings package Mapcode_Utils.Str_Tools is -- Convert the characters of Str into upper char function Upper_Str (Str : String) return String; -- Convert the characters of Str: -- Any letter that follows a letter is lower char -- Any other letter (including the first letter) is UPPER char function Mixed_Str (Str : String) return String; -- Locate the Nth occurence of a fragment within a string, -- between a given index (first/last if 0) and the end/beginning of the -- string, searching forward or backward -- Return the index in Within of the char matching the start of Fragment -- Return 0 if Index not in Within, if Within or Fragment is empty, -- or if not found -- Locate Nth occurence of a fragment within a string, -- between a given index (first/last if 0) and the end/beginning of string, -- searching forward or backward -- Returns index in Within of char matching start of Fragment -- or 0 if not found or if Within or Fragment is empty function Locate (Within : String; Fragment : String; From_Index : Natural := 0; Forward : Boolean := True; Occurence : Positive := 1) return Natural; end Mapcode_Utils.Str_Tools;
with Ada.Numerics.Discrete_Random; package Tree_Naive_Pointers is type Node is private; type NodePtr is access Node; type Tree is private; procedure initialize; function hasValue(t: in out Tree; x: Integer) return Boolean; procedure insert(t: in out Tree; x: Integer); procedure erase(t: in out Tree; x: Integer); private function merge(lower, greater: NodePtr) return NodePtr; function merge(lower, equal, greater: NodePtr) return NodePtr; procedure split(orig: NodePtr; lower, greaterOrEqual: in out NodePtr; val: Integer); procedure split(orig: NodePtr; lower, equal, greater: in out NodePtr; val: Integer); procedure make_node(n: out NodePtr; x: Integer); type Tree is record root: NodePtr := null; end record; package Integer_Random is new Ada.Numerics.Discrete_Random(Integer); use Integer_Random; g: Generator; type Node is record left, right: NodePtr; x: Integer := 0; y: Integer := Random(g); end record; end Tree_Naive_Pointers;
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- B C H E C K -- -- -- -- B o d y -- -- -- -- $Revision$ -- -- -- Copyright (C) 1992-2001 Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with ALI; use ALI; with ALI.Util; use ALI.Util; with Binderr; use Binderr; with Butil; use Butil; with Casing; use Casing; with Debug; use Debug; with Fname; use Fname; with Namet; use Namet; with Opt; use Opt; with Osint; with Output; use Output; with Rident; use Rident; with Types; use Types; package body Bcheck is -- Local subprograms -- The following checking subprograms make up the parts -- of the configuration consistency check. procedure Check_Consistent_Dynamic_Elaboration_Checking; procedure Check_Consistent_Floating_Point_Format; procedure Check_Consistent_Locking_Policy; procedure Check_Consistent_Normalize_Scalars; procedure Check_Consistent_Queuing_Policy; procedure Check_Consistent_Zero_Cost_Exception_Handling; procedure Check_Partition_Restrictions; procedure Consistency_Error_Msg (Msg : String); -- Produce an error or a warning message, depending on whether -- an inconsistent configuration is permitted or not. ------------------------------------ -- Check_Consistent_Configuration -- ------------------------------------ procedure Check_Configuration_Consistency is begin if Float_Format_Specified /= ' ' then Check_Consistent_Floating_Point_Format; end if; if Queuing_Policy_Specified /= ' ' then Check_Consistent_Queuing_Policy; end if; if Locking_Policy_Specified /= ' ' then Check_Consistent_Locking_Policy; end if; if Zero_Cost_Exceptions_Specified then Check_Consistent_Zero_Cost_Exception_Handling; end if; Check_Consistent_Normalize_Scalars; Check_Consistent_Dynamic_Elaboration_Checking; Check_Partition_Restrictions; end Check_Configuration_Consistency; --------------------------------------------------- -- Check_Consistent_Dynamic_Elaboration_Checking -- --------------------------------------------------- -- The rule here is that if a unit has dynamic elaboration checks, -- then any unit it withs must meeting one of the following criteria: -- 1. There is a pragma Elaborate_All for the with'ed unit -- 2. The with'ed unit was compiled with dynamic elaboration checks -- 3. The with'ed unit has pragma Preelaborate or Pure -- 4. It is an internal GNAT unit (including children of GNAT) procedure Check_Consistent_Dynamic_Elaboration_Checking is begin if Dynamic_Elaboration_Checks_Specified then for U in First_Unit_Entry .. Units.Last loop declare UR : Unit_Record renames Units.Table (U); begin if UR.Dynamic_Elab then for W in UR.First_With .. UR.Last_With loop declare WR : With_Record renames Withs.Table (W); begin if Get_Name_Table_Info (WR.Uname) /= 0 then declare WU : Unit_Record renames Units.Table (Unit_Id (Get_Name_Table_Info (WR.Uname))); begin -- Case 1. Elaborate_All for with'ed unit if WR.Elaborate_All then null; -- Case 2. With'ed unit has dynamic elab checks elsif WU.Dynamic_Elab then null; -- Case 3. With'ed unit is Preelaborate or Pure elsif WU.Preelab or WU.Pure then null; -- Case 4. With'ed unit is internal file elsif Is_Internal_File_Name (WU.Sfile) then null; -- Issue warning, not one of the safe cases else Error_Msg_Name_1 := UR.Sfile; Error_Msg ("?% has dynamic elaboration checks " & "and with's"); Error_Msg_Name_1 := WU.Sfile; Error_Msg ("? % which has static elaboration " & "checks"); Warnings_Detected := Warnings_Detected - 1; end if; end; end if; end; end loop; end if; end; end loop; end if; end Check_Consistent_Dynamic_Elaboration_Checking; -------------------------------------------- -- Check_Consistent_Floating_Point_Format -- -------------------------------------------- -- The rule is that all files must be compiled with the same setting -- for the floating-point format. procedure Check_Consistent_Floating_Point_Format is begin -- First search for a unit specifying a floating-point format and then -- check all remaining units against it. Find_Format : for A1 in ALIs.First .. ALIs.Last loop if ALIs.Table (A1).Float_Format /= ' ' then Check_Format : declare Format : constant Character := ALIs.Table (A1).Float_Format; begin for A2 in A1 + 1 .. ALIs.Last loop if ALIs.Table (A2).Float_Format /= Format then Error_Msg_Name_1 := ALIs.Table (A1).Sfile; Error_Msg_Name_2 := ALIs.Table (A2).Sfile; Consistency_Error_Msg ("% and % compiled with different " & "floating-point representations"); exit Find_Format; end if; end loop; end Check_Format; exit Find_Format; end if; end loop Find_Format; end Check_Consistent_Floating_Point_Format; ------------------------------------- -- Check_Consistent_Locking_Policy -- ------------------------------------- -- The rule is that all files for which the locking policy is -- significant must be compiled with the same setting. procedure Check_Consistent_Locking_Policy is begin -- First search for a unit specifying a policy and then -- check all remaining units against it. Find_Policy : for A1 in ALIs.First .. ALIs.Last loop if ALIs.Table (A1).Locking_Policy /= ' ' then Check_Policy : declare Policy : constant Character := ALIs.Table (A1).Locking_Policy; begin for A2 in A1 + 1 .. ALIs.Last loop if ALIs.Table (A2).Locking_Policy /= ' ' and ALIs.Table (A2).Locking_Policy /= Policy then Error_Msg_Name_1 := ALIs.Table (A1).Sfile; Error_Msg_Name_2 := ALIs.Table (A2).Sfile; Consistency_Error_Msg ("% and % compiled with different locking policies"); exit Find_Policy; end if; end loop; end Check_Policy; exit Find_Policy; end if; end loop Find_Policy; end Check_Consistent_Locking_Policy; ---------------------------------------- -- Check_Consistent_Normalize_Scalars -- ---------------------------------------- -- The rule is that if any unit is compiled with Normalized_Scalars, -- then all other units in the partition must also be compiled with -- Normalized_Scalars in effect. -- There is some issue as to whether this consistency check is -- desirable, it is certainly required at the moment by the RM. -- We should keep a watch on the ARG and HRG deliberations here. -- GNAT no longer depends on this consistency (it used to do so, -- but that has been corrected in the latest version, since the -- Initialize_Scalars pragma does not require consistency. procedure Check_Consistent_Normalize_Scalars is begin if Normalize_Scalars_Specified and No_Normalize_Scalars_Specified then Consistency_Error_Msg ("some but not all files compiled with Normalize_Scalars"); Write_Eol; Write_Str ("files compiled with Normalize_Scalars"); Write_Eol; for A1 in ALIs.First .. ALIs.Last loop if ALIs.Table (A1).Normalize_Scalars then Write_Str (" "); Write_Name (ALIs.Table (A1).Sfile); Write_Eol; end if; end loop; Write_Eol; Write_Str ("files compiled without Normalize_Scalars"); Write_Eol; for A1 in ALIs.First .. ALIs.Last loop if not ALIs.Table (A1).Normalize_Scalars then Write_Str (" "); Write_Name (ALIs.Table (A1).Sfile); Write_Eol; end if; end loop; end if; end Check_Consistent_Normalize_Scalars; ------------------------------------- -- Check_Consistent_Queuing_Policy -- ------------------------------------- -- The rule is that all files for which the queuing policy is -- significant must be compiled with the same setting. procedure Check_Consistent_Queuing_Policy is begin -- First search for a unit specifying a policy and then -- check all remaining units against it. Find_Policy : for A1 in ALIs.First .. ALIs.Last loop if ALIs.Table (A1).Queuing_Policy /= ' ' then Check_Policy : declare Policy : constant Character := ALIs.Table (A1).Queuing_Policy; begin for A2 in A1 + 1 .. ALIs.Last loop if ALIs.Table (A2).Queuing_Policy /= ' ' and then ALIs.Table (A2).Queuing_Policy /= Policy then Error_Msg_Name_1 := ALIs.Table (A1).Sfile; Error_Msg_Name_2 := ALIs.Table (A2).Sfile; Consistency_Error_Msg ("% and % compiled with different queuing policies"); exit Find_Policy; end if; end loop; end Check_Policy; exit Find_Policy; end if; end loop Find_Policy; end Check_Consistent_Queuing_Policy; --------------------------------------------------- -- Check_Consistent_Zero_Cost_Exception_Handling -- --------------------------------------------------- -- Check consistent zero cost exception handling. The rule is that -- all units must have the same exception handling mechanism. procedure Check_Consistent_Zero_Cost_Exception_Handling is begin Check_Mechanism : for A1 in ALIs.First + 1 .. ALIs.Last loop if ALIs.Table (A1).Zero_Cost_Exceptions /= ALIs.Table (ALIs.First).Zero_Cost_Exceptions then Error_Msg_Name_1 := ALIs.Table (A1).Sfile; Error_Msg_Name_2 := ALIs.Table (ALIs.First).Sfile; Consistency_Error_Msg ("% and % compiled with different " & "exception handling mechanisms"); end if; end loop Check_Mechanism; end Check_Consistent_Zero_Cost_Exception_Handling; ---------------------------------- -- Check_Partition_Restrictions -- ---------------------------------- -- The rule is that if a restriction is specified in any unit, -- then all units must obey the restriction. The check applies -- only to restrictions which require partition wide consistency, -- and not to internal units. -- The check is done in two steps. First for every restriction -- a unit specifying that restriction is found, if any. -- Second, all units are verified against the specified restrictions. procedure Check_Partition_Restrictions is R : array (Partition_Restrictions) of ALI_Id := (others => No_ALI_Id); -- Record the first unit specifying each partition restriction V : array (Partition_Restrictions) of ALI_Id := (others => No_ALI_Id); -- Record the last unit violating each partition restriction procedure List_Applicable_Restrictions; -- Output a list of restrictions that may be applied to the partition, -- without causing bind errors. ---------------------------------- -- List_Applicable_Restrictions -- ---------------------------------- procedure List_Applicable_Restrictions is Additional_Restrictions_Listed : Boolean := False; begin -- List any restrictions which were not violated and not specified for J in Partition_Restrictions loop if V (J) = No_ALI_Id and R (J) = No_ALI_Id then if not Additional_Restrictions_Listed then Write_Str ("The following additional restrictions may be" & " applied to this partition:"); Write_Eol; Additional_Restrictions_Listed := True; end if; Write_Str ("pragma Restrictions ("); declare S : constant String := Restriction_Id'Image (J); begin Name_Len := S'Length; Name_Buffer (1 .. Name_Len) := S; end; Set_Casing (Mixed_Case); Write_Str (Name_Buffer (1 .. Name_Len)); Write_Str (");"); Write_Eol; end if; end loop; end List_Applicable_Restrictions; -- Start of processing for Check_Partition_Restrictions begin Find_Restrictions : for A in ALIs.First .. ALIs.Last loop for J in Partition_Restrictions loop if R (J) = No_ALI_Id and ALIs.Table (A).Restrictions (J) = 'r' then R (J) := A; end if; end loop; end loop Find_Restrictions; Find_Violations : for A in ALIs.First .. ALIs.Last loop for J in Partition_Restrictions loop if ALIs.Table (A).Restrictions (J) = 'v' and then not Is_Internal_File_Name (ALIs.Table (A).Sfile) then -- A violation of a restriction was found, so check whether -- that restriction was actually in effect. If so, give an -- error message. -- Note that all such violations found are reported. V (J) := A; if R (J) /= No_ALI_Id then Report_Violated_Restriction : declare M1 : constant String := "% has Restriction ("; S : constant String := Restriction_Id'Image (J); M2 : String (1 .. M1'Length + S'Length + 1); begin Name_Buffer (1 .. S'Length) := S; Name_Len := S'Length; Set_Casing (Units.Table (ALIs.Table (R (J)).First_Unit).Icasing); M2 (M1'Range) := M1; M2 (M1'Length + 1 .. M2'Last - 1) := Name_Buffer (1 .. S'Length); M2 (M2'Last) := ')'; Error_Msg_Name_1 := ALIs.Table (R (J)).Sfile; Consistency_Error_Msg (M2); Error_Msg_Name_1 := ALIs.Table (A).Sfile; Consistency_Error_Msg ("but file % violates this restriction"); end Report_Violated_Restriction; end if; end if; end loop; end loop Find_Violations; if Debug_Flag_R then List_Applicable_Restrictions; end if; end Check_Partition_Restrictions; ----------------------- -- Check_Consistency -- ----------------------- procedure Check_Consistency is Src : Source_Id; -- Source file Id for this Sdep entry begin -- First, we go through the source table to see if there are any cases -- in which we should go after source files and compute checksums of -- the source files. We need to do this for any file for which we have -- mismatching time stamps and (so far) matching checksums. for S in Source.First .. Source.Last loop -- If all time stamps for a file match, then there is nothing to -- do, since we will not be checking checksums in that case anyway if Source.Table (S).All_Timestamps_Match then null; -- If we did not find the source file, then we can't compute its -- checksum anyway. Note that when we have a time stamp mismatch, -- we try to find the source file unconditionally (i.e. if -- Check_Source_Files is False). elsif not Source.Table (S).Source_Found then null; -- If we already have non-matching or missing checksums, then no -- need to try going after source file, since we won't trust the -- checksums in any case. elsif not Source.Table (S).All_Checksums_Match then null; -- Now we have the case where we have time stamp mismatches, and -- the source file is around, but so far all checksums match. This -- is the case where we need to compute the checksum from the source -- file, since otherwise we would ignore the time stamp mismatches, -- and that is wrong if the checksum of the source does not agree -- with the checksums in the ALI files. elsif Check_Source_Files then if not Checksums_Match (Source.Table (S).Checksum, Get_File_Checksum (Source.Table (S).Sfile)) then Source.Table (S).All_Checksums_Match := False; end if; end if; end loop; -- Loop through ALI files ALIs_Loop : for A in ALIs.First .. ALIs.Last loop -- Loop through Sdep entries in one ALI file Sdep_Loop : for D in ALIs.Table (A).First_Sdep .. ALIs.Table (A).Last_Sdep loop if Sdep.Table (D).Dummy_Entry then goto Continue; end if; Src := Source_Id (Get_Name_Table_Info (Sdep.Table (D).Sfile)); -- If the time stamps match, or all checksums match, then we -- are OK, otherwise we have a definite error. if Sdep.Table (D).Stamp /= Source.Table (Src).Stamp and then not Source.Table (Src).All_Checksums_Match then Error_Msg_Name_1 := ALIs.Table (A).Sfile; Error_Msg_Name_2 := Sdep.Table (D).Sfile; -- Two styles of message, depending on whether or not -- the updated file is the one that must be recompiled if Error_Msg_Name_1 = Error_Msg_Name_2 then if Tolerate_Consistency_Errors then Error_Msg ("?% has been modified and should be recompiled"); else Error_Msg ("% has been modified and must be recompiled"); end if; else if Tolerate_Consistency_Errors then Error_Msg ("?% should be recompiled (% has been modified)"); else Error_Msg ("% must be recompiled (% has been modified)"); end if; end if; if (not Tolerate_Consistency_Errors) and Verbose_Mode then declare Msg : constant String := "file % has time stamp "; Buf : String (1 .. Msg'Length + Time_Stamp_Length); begin Buf (1 .. Msg'Length) := Msg; Buf (Msg'Length + 1 .. Buf'Length) := String (Source.Table (Src).Stamp); Error_Msg_Name_1 := ALIs.Table (A).Sfile; Error_Msg (Buf); Buf (Msg'Length + 1 .. Buf'Length) := String (Sdep.Table (D).Stamp); Error_Msg_Name_1 := Sdep.Table (D).Sfile; Error_Msg (Buf); end; end if; -- Exit from the loop through Sdep entries once we find one -- that does not match. exit Sdep_Loop; end if; <<Continue>> null; end loop Sdep_Loop; end loop ALIs_Loop; end Check_Consistency; ------------------------------- -- Check_Duplicated_Subunits -- ------------------------------- procedure Check_Duplicated_Subunits is begin for J in Sdep.First .. Sdep.Last loop if Sdep.Table (J).Subunit_Name /= No_Name then Get_Decoded_Name_String (Sdep.Table (J).Subunit_Name); Name_Len := Name_Len + 2; Name_Buffer (Name_Len - 1) := '%'; -- See if there is a body or spec with the same name for K in Boolean loop if K then Name_Buffer (Name_Len) := 'b'; else Name_Buffer (Name_Len) := 's'; end if; declare Info : constant Int := Get_Name_Table_Info (Name_Find); begin if Info /= 0 then Set_Standard_Error; Write_Str ("error: subunit """); Write_Name_Decoded (Sdep.Table (J).Subunit_Name); Write_Str (""" in file """); Write_Name_Decoded (Sdep.Table (J).Sfile); Write_Char ('"'); Write_Eol; Write_Str (" has same name as unit """); Write_Unit_Name (Units.Table (Unit_Id (Info)).Uname); Write_Str (""" found in file """); Write_Name_Decoded (Units.Table (Unit_Id (Info)).Sfile); Write_Char ('"'); Write_Eol; Write_Str (" this is not allowed within a single " & "partition (RM 10.2(19))"); Write_Eol; Osint.Exit_Program (Osint.E_Fatal); end if; end; end loop; end if; end loop; end Check_Duplicated_Subunits; -------------------- -- Check_Versions -- -------------------- procedure Check_Versions is VL : constant Natural := ALIs.Table (ALIs.First).Ver_Len; begin for A in ALIs.First .. ALIs.Last loop if ALIs.Table (A).Ver_Len /= VL or else ALIs.Table (A).Ver (1 .. VL) /= ALIs.Table (ALIs.First).Ver (1 .. VL) then Error_Msg_Name_1 := ALIs.Table (A).Sfile; Error_Msg_Name_2 := ALIs.Table (ALIs.First).Sfile; Consistency_Error_Msg ("% and % compiled with different GNAT versions"); end if; end loop; end Check_Versions; --------------------------- -- Consistency_Error_Msg -- --------------------------- procedure Consistency_Error_Msg (Msg : String) is begin if Tolerate_Consistency_Errors then -- If consistency errors are tolerated, -- output the message as a warning. declare Warning_Msg : String (1 .. Msg'Length + 1); begin Warning_Msg (1) := '?'; Warning_Msg (2 .. Warning_Msg'Last) := Msg; Error_Msg (Warning_Msg); end; -- Otherwise the consistency error is a true error else Error_Msg (Msg); end if; end Consistency_Error_Msg; end Bcheck;
with System; -- ============================================================================= -- Package AVR.WATCHDOG -- -- Implements watchdog mechanisms for the MCU micro-controller. -- ============================================================================= package AVR.WATCHDOG is type Watchdog_Timer_Control_Register_Type is record WPD0 : Boolean; -- Watchdog Timer Prescaler Bit 0 WPD1 : Boolean; -- Watchdog Timer Prescaler Bit 1 WPD2 : Boolean; -- Watchdog Timer Prescaler Bit 2 WDE : Boolean; -- Watchdog System Reset Enable WDCE : Boolean; -- Watchdog Change Enable WDP3 : Boolean; -- Watchdog Timer Prescaler Bit 3 WDIE : Boolean; -- Watchdog Interrupt Enable WDIF : Boolean; -- Watchdog Interrupt Flag end record; pragma Pack (Watchdog_Timer_Control_Register_Type); for Watchdog_Timer_Control_Register_Type'Size use BYTE_SIZE; Reg_WDTCSR : Watchdog_Timer_Control_Register_Type; for Reg_WDTCSR'Address use System'To_Address (16#60#); procedure Watchdog_Reset; end AVR.WATCHDOG;
package Private_Type_Definition is type Type_1 is private; type Type_2 is tagged private; type Type_3 is abstract tagged limited private; type Parent_Type_1 is tagged record Component_1 : Integer; end record; type Type_4 is new Parent_Type_1 with private; private type Type_1 is new Integer; type Type_2 is tagged null record; type Type_3 is abstract tagged limited null record; type Type_4 is new Parent_Type_1 with record Component_2 : Float; end record; end Private_Type_Definition;
with kv.avm.Control; with kv.avm.Executables; with kv.avm.Actor_References; package kv.avm.Executable_Lists is type Cursor_Type is new Natural; subtype Index_Type is Cursor_Type range 1 .. Cursor_Type'LAST; type Executable_Handle_Type is tagged private; type Executable_Handle_Access is access Executable_Handle_Type; function Get_List(Self : Executable_Handle_Type) return kv.avm.Control.Status_Type; function Get_Cursor(Self : Executable_Handle_Type) return Cursor_Type; function Get_Reference(Self : Executable_Handle_Type) return kv.avm.Actor_References.Actor_Reference_Type; function Get_Executable(Self : Executable_Handle_Type) return kv.avm.Executables.Executable_Access; type Executable_Holder_Type is tagged private; procedure Initialize (Self : in out Executable_Holder_Type; Kind : in kv.avm.Control.Status_Type); procedure Add (Self : in out Executable_Holder_Type; This : in kv.avm.Executables.Executable_Access; Ref : in kv.avm.Actor_References.Actor_Reference_Type); function Find(Self : Executable_Holder_Type; Executable : kv.avm.Executables.Executable_Access) return Cursor_Type; function Is_In(Self : Executable_Holder_Type; Executable : kv.avm.Executables.Executable_Access) return Boolean; function Get(Self : Executable_Holder_Type; Position : Cursor_Type) return kv.avm.Executables.Executable_Access; procedure Delete -- deallocate the handle (Self : in out Executable_Holder_Type; This : in Cursor_Type); procedure Drop -- just remove the handle from the list (Self : in out Executable_Holder_Type; This : in Cursor_Type); procedure Drop (Self : in out Executable_Holder_Type; This : in kv.avm.Executables.Executable_Access); procedure Acquire_From (Self : in out Executable_Holder_Type; Place : in Cursor_Type; From : in out Executable_Holder_Type); function Get_Handle (Self : Executable_Holder_Type; Position : Cursor_Type) return Executable_Handle_Access; function Get_Last (Self : Executable_Holder_Type) return Cursor_Type; private type Executable_Handle_Type is tagged record Executable : kv.avm.Executables.Executable_Access; Reference : kv.avm.Actor_References.Actor_Reference_Type; Status : kv.avm.Control.Status_Type; -- This is also the list that holds the executable Position : Cursor_Type; -- Zero means that this executable isn't in a list end record; type Executable_Array_Type is array (Index_Type range <>) of Executable_Handle_Access; type Executable_Array_Access is access Executable_Array_Type; type Executable_Holder_Type is tagged record List : Executable_Array_Access; Count : Cursor_Type; Kind : kv.avm.Control.Status_Type; end record; procedure Add (Self : in out Executable_Holder_Type; This : in Executable_Handle_Access); end kv.avm.Executable_Lists;
package AOC.AOC_2019.Day08 is type Day_08 is new Day.Day with null record; overriding procedure Init (D : in out Day_08; Root : String); overriding function Part_1 (D : Day_08) return String; overriding function Part_2 (D : Day_08) return String; end AOC.AOC_2019.Day08;
pragma Ada_2012; with Interfaces; use Interfaces; package body BitOperations.Shift with SPARK_Mode => Off is ----------------- -- Logic_Right -- ----------------- function Logic_Right (Value : Modular; Amount : Natural) return Modular is (case Modular'Size is when 1 .. 8 => Modular (Shift_Right (Unsigned_8 (Value), Amount)), when 9 .. 16 => Modular (Shift_Right (Unsigned_16 (Value), Amount)), when 17 .. 32 => Modular (Shift_Right (Unsigned_32 (Value), Amount)), when others => Modular (Shift_Right (Unsigned_64 (Value), Amount))); ---------------- -- Logic_Left -- ---------------- function Logic_Left (Value : Modular; Amount : Natural) return Modular is (case Modular'Size is when 1 .. 8 => Modular'Mod (Shift_Left (Unsigned_8 (Value), Amount)), when 9 .. 16 => Modular'Mod (Shift_Left (Unsigned_16 (Value), Amount)), when 17 .. 32 => Modular'Mod (Shift_Left (Unsigned_32 (Value), Amount)), when others => Modular'Mod (Shift_Left (Unsigned_64 (Value), Amount))); end BitOperations.Shift;