CombinedText stringlengths 4 3.42M |
|---|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- A D A . E X E C U T I O N _ T I M E --
-- --
-- S p e c --
-- --
-- Copyright (C) 2007-2015, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
-- apply solely to the contents of the part following the private keyword. --
-- --
-- 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. --
-- --
------------------------------------------------------------------------------
with Ada.Task_Identification;
with Ada.Real_Time;
package Ada.Execution_Time with
SPARK_Mode
is
type CPU_Time is private;
CPU_Time_First : constant CPU_Time;
CPU_Time_Last : constant CPU_Time;
CPU_Time_Unit : constant := Ada.Real_Time.Time_Unit;
CPU_Tick : constant Ada.Real_Time.Time_Span;
use type Ada.Task_Identification.Task_Id;
function Clock
(T : Ada.Task_Identification.Task_Id :=
Ada.Task_Identification.Current_Task)
return CPU_Time
with
Volatile_Function,
Global => Ada.Real_Time.Clock_Time,
Pre => T /= Ada.Task_Identification.Null_Task_Id;
function "+"
(Left : CPU_Time;
Right : Ada.Real_Time.Time_Span) return CPU_Time
with
Global => null;
function "+"
(Left : Ada.Real_Time.Time_Span;
Right : CPU_Time) return CPU_Time
with
Global => null;
function "-"
(Left : CPU_Time;
Right : Ada.Real_Time.Time_Span) return CPU_Time
with
Global => null;
function "-"
(Left : CPU_Time;
Right : CPU_Time) return Ada.Real_Time.Time_Span
with
Global => null;
function "<" (Left, Right : CPU_Time) return Boolean with
Global => null;
function "<=" (Left, Right : CPU_Time) return Boolean with
Global => null;
function ">" (Left, Right : CPU_Time) return Boolean with
Global => null;
function ">=" (Left, Right : CPU_Time) return Boolean with
Global => null;
procedure Split
(T : CPU_Time;
SC : out Ada.Real_Time.Seconds_Count;
TS : out Ada.Real_Time.Time_Span)
with
Global => null;
function Time_Of
(SC : Ada.Real_Time.Seconds_Count;
TS : Ada.Real_Time.Time_Span := Ada.Real_Time.Time_Span_Zero)
return CPU_Time
with
Global => null;
Interrupt_Clocks_Supported : constant Boolean := False;
Separate_Interrupt_Clocks_Supported : constant Boolean := False;
pragma Warnings (Off, "check will fail at run time");
function Clock_For_Interrupts return CPU_Time with
Volatile_Function,
Global => Ada.Real_Time.Clock_Time,
Pre => Interrupt_Clocks_Supported;
pragma Warnings (On, "check will fail at run time");
private
pragma SPARK_Mode (Off);
type CPU_Time is new Ada.Real_Time.Time;
CPU_Time_First : constant CPU_Time := CPU_Time (Ada.Real_Time.Time_First);
CPU_Time_Last : constant CPU_Time := CPU_Time (Ada.Real_Time.Time_Last);
CPU_Tick : constant Ada.Real_Time.Time_Span := Ada.Real_Time.Tick;
pragma Import (Intrinsic, "<");
pragma Import (Intrinsic, "<=");
pragma Import (Intrinsic, ">");
pragma Import (Intrinsic, ">=");
end Ada.Execution_Time;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- A D A . T E X T _ I O --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2005, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
-- apply solely to the contents of the part following the private keyword. --
-- --
-- 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. --
-- --
-- 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. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- Note: the generic subpackages of Text_IO (Integer_IO, Float_IO, Fixed_IO,
-- Modular_IO, Decimal_IO and Enumeration_IO) appear as private children in
-- GNAT. These children are with'ed automatically if they are referenced, so
-- this rearrangement is invisible to user programs, but has the advantage
-- that only the needed parts of Text_IO are processed and loaded.
with Ada.IO_Exceptions;
with Ada.Streams;
with System;
with System.File_Control_Block;
package Ada.Text_IO is
pragma Elaborate_Body;
type File_Type is limited private;
type File_Mode is (In_File, Out_File, Append_File);
-- The following representation clause allows the use of unchecked
-- conversion for rapid translation between the File_Mode type
-- used in this package and System.File_IO.
for File_Mode use
(In_File => 0, -- System.FIle_IO.File_Mode'Pos (In_File)
Out_File => 2, -- System.File_IO.File_Mode'Pos (Out_File)
Append_File => 3); -- System.File_IO.File_Mode'Pos (Append_File)
type Count is range 0 .. Natural'Last;
-- The value of Count'Last must be large enough so that the assumption
-- enough so that the assumption that the Line, Column and Page
-- counts can never exceed this value is a valid assumption.
subtype Positive_Count is Count range 1 .. Count'Last;
Unbounded : constant Count := 0;
-- Line and page length
subtype Field is Integer range 0 .. 255;
-- Note: if for any reason, there is a need to increase this value,
-- then it will be necessary to change the corresponding value in
-- System.Img_Real in file s-imgrea.adb.
subtype Number_Base is Integer range 2 .. 16;
type Type_Set is (Lower_Case, Upper_Case);
---------------------
-- File Management --
---------------------
procedure Create
(File : in out File_Type;
Mode : File_Mode := Out_File;
Name : String := "";
Form : String := "");
procedure Open
(File : in out File_Type;
Mode : File_Mode;
Name : String;
Form : String := "");
procedure Close (File : in out File_Type);
procedure Delete (File : in out File_Type);
procedure Reset (File : in out File_Type; Mode : File_Mode);
procedure Reset (File : in out File_Type);
function Mode (File : File_Type) return File_Mode;
function Name (File : File_Type) return String;
function Form (File : File_Type) return String;
function Is_Open (File : File_Type) return Boolean;
------------------------------------------------------
-- Control of default input, output and error files --
------------------------------------------------------
procedure Set_Input (File : File_Type);
procedure Set_Output (File : File_Type);
procedure Set_Error (File : File_Type);
function Standard_Input return File_Type;
function Standard_Output return File_Type;
function Standard_Error return File_Type;
function Current_Input return File_Type;
function Current_Output return File_Type;
function Current_Error return File_Type;
type File_Access is access constant File_Type;
function Standard_Input return File_Access;
function Standard_Output return File_Access;
function Standard_Error return File_Access;
function Current_Input return File_Access;
function Current_Output return File_Access;
function Current_Error return File_Access;
--------------------
-- Buffer control --
--------------------
-- Note: The parameter file is IN OUT in the RM, but this is clearly
-- an oversight, and was intended to be IN, see AI95-00057.
procedure Flush (File : File_Type);
procedure Flush;
--------------------------------------------
-- Specification of line and page lengths --
--------------------------------------------
procedure Set_Line_Length (File : File_Type; To : Count);
procedure Set_Line_Length (To : Count);
procedure Set_Page_Length (File : File_Type; To : Count);
procedure Set_Page_Length (To : Count);
function Line_Length (File : File_Type) return Count;
function Line_Length return Count;
function Page_Length (File : File_Type) return Count;
function Page_Length return Count;
------------------------------------
-- Column, Line, and Page Control --
------------------------------------
procedure New_Line (File : File_Type; Spacing : Positive_Count := 1);
procedure New_Line (Spacing : Positive_Count := 1);
procedure Skip_Line (File : File_Type; Spacing : Positive_Count := 1);
procedure Skip_Line (Spacing : Positive_Count := 1);
function End_Of_Line (File : File_Type) return Boolean;
function End_Of_Line return Boolean;
procedure New_Page (File : File_Type);
procedure New_Page;
procedure Skip_Page (File : File_Type);
procedure Skip_Page;
function End_Of_Page (File : File_Type) return Boolean;
function End_Of_Page return Boolean;
function End_Of_File (File : File_Type) return Boolean;
function End_Of_File return Boolean;
procedure Set_Col (File : File_Type; To : Positive_Count);
procedure Set_Col (To : Positive_Count);
procedure Set_Line (File : File_Type; To : Positive_Count);
procedure Set_Line (To : Positive_Count);
function Col (File : File_Type) return Positive_Count;
function Col return Positive_Count;
function Line (File : File_Type) return Positive_Count;
function Line return Positive_Count;
function Page (File : File_Type) return Positive_Count;
function Page return Positive_Count;
----------------------------
-- Character Input-Output --
----------------------------
procedure Get (File : File_Type; Item : out Character);
procedure Get (Item : out Character);
procedure Put (File : File_Type; Item : Character);
procedure Put (Item : Character);
procedure Look_Ahead
(File : File_Type;
Item : out Character;
End_Of_Line : out Boolean);
procedure Look_Ahead
(Item : out Character;
End_Of_Line : out Boolean);
procedure Get_Immediate
(File : File_Type;
Item : out Character);
procedure Get_Immediate
(Item : out Character);
procedure Get_Immediate
(File : File_Type;
Item : out Character;
Available : out Boolean);
procedure Get_Immediate
(Item : out Character;
Available : out Boolean);
-------------------------
-- String Input-Output --
-------------------------
procedure Get (File : File_Type; Item : out String);
procedure Get (Item : out String);
procedure Put (File : File_Type; Item : String);
procedure Put (Item : String);
procedure Get_Line
(File : File_Type;
Item : out String;
Last : out Natural);
procedure Get_Line
(Item : out String;
Last : out Natural);
function Get_Line (File : File_Type) return String;
pragma Ada_05 (Get_Line);
function Get_Line return String;
pragma Ada_05 (Get_Line);
procedure Put_Line
(File : File_Type;
Item : String);
procedure Put_Line
(Item : String);
---------------------------------------
-- Generic packages for Input-Output --
---------------------------------------
-- The generic packages:
-- Ada.Text_IO.Integer_IO
-- Ada.Text_IO.Modular_IO
-- Ada.Text_IO.Float_IO
-- Ada.Text_IO.Fixed_IO
-- Ada.Text_IO.Decimal_IO
-- Ada.Text_IO.Enumeration_IO
-- are implemented as separate child packages in GNAT, so the
-- spec and body of these packages are to be found in separate
-- child units. This implementation detail is hidden from the
-- Ada programmer by special circuitry in the compiler that
-- treats these child packages as though they were nested in
-- Text_IO. The advantage of this special processing is that
-- the subsidiary routines needed if these generics are used
-- are not loaded when they are not used.
----------------
-- Exceptions --
----------------
Status_Error : exception renames IO_Exceptions.Status_Error;
Mode_Error : exception renames IO_Exceptions.Mode_Error;
Name_Error : exception renames IO_Exceptions.Name_Error;
Use_Error : exception renames IO_Exceptions.Use_Error;
Device_Error : exception renames IO_Exceptions.Device_Error;
End_Error : exception renames IO_Exceptions.End_Error;
Data_Error : exception renames IO_Exceptions.Data_Error;
Layout_Error : exception renames IO_Exceptions.Layout_Error;
private
-----------------------------------
-- Handling of Format Characters --
-----------------------------------
-- Line marks are represented by the single character ASCII.LF (16#0A#).
-- In DOS and similar systems, underlying file translation takes care
-- of translating this to and from the standard CR/LF sequences used in
-- these operating systems to mark the end of a line. On output there is
-- always a line mark at the end of the last line, but on input, this
-- line mark can be omitted, and is implied by the end of file.
-- Page marks are represented by the single character ASCII.FF (16#0C#),
-- The page mark at the end of the file may be omitted, and is normally
-- omitted on output unless an explicit New_Page call is made before
-- closing the file. No page mark is added when a file is appended to,
-- so, in accordance with the permission in (RM A.10.2(4)), there may
-- or may not be a page mark separating preexising text in the file
-- from the new text to be written.
-- A file mark is marked by the physical end of file. In DOS translation
-- mode on input, an EOF character (SUB = 16#1A#) gets translated to the
-- physical end of file, so in effect this character is recognized as
-- marking the end of file in DOS and similar systems.
LM : constant := Character'Pos (ASCII.LF);
-- Used as line mark
PM : constant := Character'Pos (ASCII.FF);
-- Used as page mark, except at end of file where it is implied
--------------------------------
-- Text_IO File Control Block --
--------------------------------
package FCB renames System.File_Control_Block;
type Text_AFCB;
type File_Type is access all Text_AFCB;
type Text_AFCB is new FCB.AFCB with record
Page : Count := 1;
Line : Count := 1;
Col : Count := 1;
Line_Length : Count := 0;
Page_Length : Count := 0;
Self : aliased File_Type;
-- Set to point to the containing Text_AFCB block. This is used to
-- implement the Current_{Error,Input,Ouput} functions which return
-- a File_Access, the file access value returned is a pointer to
-- the Self field of the corresponding file.
Before_LM : Boolean := False;
-- This flag is used to deal with the anomolies introduced by the
-- peculiar definition of End_Of_File and End_Of_Page in Ada. These
-- functions require looking ahead more than one character. Since
-- there is no convenient way of backing up more than one character,
-- what we do is to leave ourselves positioned past the LM, but set
-- this flag, so that we know that from an Ada point of view we are
-- in front of the LM, not after it. A bit of a kludge, but it works!
Before_LM_PM : Boolean := False;
-- This flag similarly handles the case of being physically positioned
-- after a LM-PM sequence when logically we are before the LM-PM. This
-- flag can only be set if Before_LM is also set.
end record;
function AFCB_Allocate (Control_Block : Text_AFCB) return FCB.AFCB_Ptr;
procedure AFCB_Close (File : access Text_AFCB);
procedure AFCB_Free (File : access Text_AFCB);
procedure Read
(File : in out Text_AFCB;
Item : out Ada.Streams.Stream_Element_Array;
Last : out Ada.Streams.Stream_Element_Offset);
-- Read operation used when Text_IO file is treated directly as Stream
procedure Write
(File : in out Text_AFCB;
Item : Ada.Streams.Stream_Element_Array);
-- Write operation used when Text_IO file is treated directly as Stream
------------------------
-- The Standard Files --
------------------------
Null_Str : aliased constant String := "";
-- Used as name and form of standard files
Standard_Err_AFCB : aliased Text_AFCB;
Standard_In_AFCB : aliased Text_AFCB;
Standard_Out_AFCB : aliased Text_AFCB;
Standard_Err : aliased File_Type := Standard_Err_AFCB'Access;
Standard_In : aliased File_Type := Standard_In_AFCB'Access;
Standard_Out : aliased File_Type := Standard_Out_AFCB'Access;
-- Standard files
Current_In : aliased File_Type := Standard_In;
Current_Out : aliased File_Type := Standard_Out;
Current_Err : aliased File_Type := Standard_Err;
-- Current files
-----------------------
-- Local Subprograms --
-----------------------
-- These subprograms are in the private part of the spec so that they can
-- be shared by the routines in the body of Ada.Text_IO.Wide_Text_IO.
-- Note: we use Integer in these declarations instead of the more accurate
-- Interfaces.C_Streams.int, because we do not want to drag in the spec of
-- this interfaces package with the spec of Ada.Text_IO, and we know that
-- in fact these types are identical
function EOF_Char return Integer;
-- Returns the system-specific character indicating the end of a text file.
-- This is exported for use by child packages such as Enumeration_Aux to
-- eliminate their needing to depend directly on Interfaces.C_Streams.
function Getc (File : File_Type) return Integer;
-- Gets next character from file, which has already been checked for
-- being in read status, and returns the character read if no error
-- occurs. The result is EOF if the end of file was read.
function Nextc (File : File_Type) return Integer;
-- Returns next character from file without skipping past it (i.e. it
-- is a combination of Getc followed by an Ungetc).
procedure Putc (ch : Integer; File : File_Type);
-- Outputs the given character to the file, which has already been
-- checked for being in output status. Device_Error is raised if the
-- character cannot be written.
procedure Terminate_Line (File : File_Type);
-- If the file is in Write_File or Append_File mode, and the current
-- line is not terminated, then a line terminator is written using
-- New_Line. Note that there is no Terminate_Page routine, because
-- the page mark at the end of the file is implied if necessary.
procedure Ungetc (ch : Integer; File : File_Type);
-- Pushes back character into stream, using ungetc. The caller has
-- checked that the file is in read status. Device_Error is raised
-- if the character cannot be pushed back. An attempt to push back
-- and end of file character (EOF) is ignored.
end Ada.Text_IO;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- G N A T . D I R E C T O R Y _ O P E R A T I O N S . I T E R A T I O N --
-- --
-- B o d y --
-- --
-- Copyright (C) 2001-2020, 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. --
-- --
------------------------------------------------------------------------------
with Ada.Characters.Handling;
with Ada.Strings.Fixed;
with Ada.Strings.Maps;
with GNAT.OS_Lib;
with GNAT.Regexp;
package body GNAT.Directory_Operations.Iteration is
use Ada;
----------
-- Find --
----------
procedure Find
(Root_Directory : Dir_Name_Str;
File_Pattern : String)
is
File_Regexp : constant Regexp.Regexp := Regexp.Compile (File_Pattern);
Index : Natural := 0;
Quit : Boolean;
procedure Read_Directory (Directory : Dir_Name_Str);
-- Open Directory and read all entries. This routine is called
-- recursively for each sub-directories.
function Make_Pathname (Dir, File : String) return String;
-- Returns the pathname for File by adding Dir as prefix
-------------------
-- Make_Pathname --
-------------------
function Make_Pathname (Dir, File : String) return String is
begin
if Dir (Dir'Last) = '/' or else Dir (Dir'Last) = '\' then
return Dir & File;
else
return Dir & Dir_Separator & File;
end if;
end Make_Pathname;
--------------------
-- Read_Directory --
--------------------
procedure Read_Directory (Directory : Dir_Name_Str) is
Buffer : String (1 .. 2_048);
Last : Natural;
Dir : Dir_Type;
pragma Warnings (Off, Dir);
begin
Open (Dir, Directory);
loop
Read (Dir, Buffer, Last);
exit when Last = 0;
declare
Dir_Entry : constant String := Buffer (1 .. Last);
Pathname : constant String :=
Make_Pathname (Directory, Dir_Entry);
begin
if Regexp.Match (Dir_Entry, File_Regexp) then
Index := Index + 1;
begin
Action (Pathname, Index, Quit);
exception
when others =>
Close (Dir);
raise;
end;
exit when Quit;
end if;
-- Recursively call for sub-directories, except for . and ..
if not (Dir_Entry = "." or else Dir_Entry = "..")
and then OS_Lib.Is_Directory (Pathname)
then
Read_Directory (Pathname);
exit when Quit;
end if;
end;
end loop;
Close (Dir);
end Read_Directory;
begin
Quit := False;
Read_Directory (Root_Directory);
end Find;
-----------------------
-- Wildcard_Iterator --
-----------------------
procedure Wildcard_Iterator (Path : Path_Name) is
Index : Natural := 0;
procedure Read
(Directory : String;
File_Pattern : String;
Suffix_Pattern : String);
-- Read entries in Directory and call user's callback if the entry match
-- File_Pattern and Suffix_Pattern is empty; otherwise go down one more
-- directory level by calling Next_Level routine below.
procedure Next_Level
(Current_Path : String;
Suffix_Path : String);
-- Extract next File_Pattern from Suffix_Path and call Read routine
-- above.
----------------
-- Next_Level --
----------------
procedure Next_Level
(Current_Path : String;
Suffix_Path : String)
is
DS : Natural;
SP : String renames Suffix_Path;
begin
if SP'Length > 2
and then SP (SP'First) = '.'
and then Strings.Maps.Is_In (SP (SP'First + 1), Dir_Seps)
then
-- Starting with "./"
DS := Strings.Fixed.Index
(SP (SP'First + 2 .. SP'Last),
Dir_Seps);
if DS = 0 then
-- We have "./"
Read (Current_Path & ".", "*", "");
else
-- We have "./dir"
Read (Current_Path & ".",
SP (SP'First + 2 .. DS - 1),
SP (DS .. SP'Last));
end if;
elsif SP'Length > 3
and then SP (SP'First .. SP'First + 1) = ".."
and then Strings.Maps.Is_In (SP (SP'First + 2), Dir_Seps)
then
-- Starting with "../"
DS := Strings.Fixed.Index
(SP (SP'First + 3 .. SP'Last), Dir_Seps);
if DS = 0 then
-- We have "../"
Read (Current_Path & "..", "*", "");
else
-- We have "../dir"
Read (Current_Path & "..",
SP (SP'First + 3 .. DS - 1),
SP (DS .. SP'Last));
end if;
elsif Current_Path = ""
and then SP'Length > 1
and then Characters.Handling.Is_Letter (SP (SP'First))
and then SP (SP'First + 1) = ':'
then
-- Starting with "<drive>:"
if SP'Length > 2
and then Strings.Maps.Is_In (SP (SP'First + 2), Dir_Seps)
then
-- Starting with "<drive>:\"
DS := Strings.Fixed.Index
(SP (SP'First + 3 .. SP'Last), Dir_Seps);
if DS = 0 then
-- We have "<drive>:\dir"
Read (SP (SP'First .. SP'First + 2),
SP (SP'First + 3 .. SP'Last),
"");
else
-- We have "<drive>:\dir\kkk"
Read (SP (SP'First .. SP'First + 2),
SP (SP'First + 3 .. DS - 1),
SP (DS .. SP'Last));
end if;
else
-- Starting with "<drive>:" and the drive letter not followed
-- by a directory separator. The proper semantic on Windows is
-- to read the content of the current selected directory on
-- this drive. For example, if drive C current selected
-- directory is c:\temp the suffix pattern "c:m*" is
-- equivalent to c:\temp\m*.
DS := Strings.Fixed.Index
(SP (SP'First + 2 .. SP'Last), Dir_Seps);
if DS = 0 then
-- We have "<drive>:dir"
Read (SP, "", "");
else
-- We have "<drive>:dir/kkk"
Read (SP (SP'First .. DS - 1), "", SP (DS .. SP'Last));
end if;
end if;
elsif Strings.Maps.Is_In (SP (SP'First), Dir_Seps) then
-- Starting with a /
DS := Strings.Fixed.Index
(SP (SP'First + 1 .. SP'Last), Dir_Seps);
if DS = 0 then
-- We have "/dir"
Read (Current_Path, SP (SP'First + 1 .. SP'Last), "");
else
-- We have "/dir/kkk"
Read (Current_Path,
SP (SP'First + 1 .. DS - 1),
SP (DS .. SP'Last));
end if;
else
-- Starting with a name
DS := Strings.Fixed.Index (SP, Dir_Seps);
if DS = 0 then
-- We have "dir"
Read (Current_Path & '.', SP, "");
else
-- We have "dir/kkk"
Read (Current_Path & '.',
SP (SP'First .. DS - 1),
SP (DS .. SP'Last));
end if;
end if;
end Next_Level;
----------
-- Read --
----------
Quit : Boolean := False;
-- Global state to be able to exit all recursive calls
procedure Read
(Directory : String;
File_Pattern : String;
Suffix_Pattern : String)
is
File_Regexp : constant Regexp.Regexp :=
Regexp.Compile (File_Pattern, Glob => True);
Dir : Dir_Type;
pragma Warnings (Off, Dir);
Buffer : String (1 .. 2_048);
Last : Natural;
begin
if OS_Lib.Is_Directory (Directory & Dir_Separator) then
Open (Dir, Directory & Dir_Separator);
Dir_Iterator : loop
Read (Dir, Buffer, Last);
exit Dir_Iterator when Last = 0;
declare
Dir_Entry : constant String := Buffer (1 .. Last);
Pathname : constant String :=
Directory & Dir_Separator & Dir_Entry;
begin
-- Handle "." and ".." only if explicit use in the
-- File_Pattern.
if not
((Dir_Entry = "." and then File_Pattern /= ".")
or else
(Dir_Entry = ".." and then File_Pattern /= ".."))
then
if Regexp.Match (Dir_Entry, File_Regexp) then
if Suffix_Pattern = "" then
-- No more matching needed, call user's callback
Index := Index + 1;
begin
Action (Pathname, Index, Quit);
exception
when others =>
Close (Dir);
raise;
end;
else
-- Down one level
Next_Level
(Directory & Dir_Separator & Dir_Entry,
Suffix_Pattern);
end if;
end if;
end if;
end;
-- Exit if Quit set by call to Action, either at this level
-- or at some lower recursive call to Next_Level.
exit Dir_Iterator when Quit;
end loop Dir_Iterator;
Close (Dir);
end if;
end Read;
-- Start of processing for Wildcard_Iterator
begin
if Path = "" then
return;
end if;
Next_Level ("", Path);
end Wildcard_Iterator;
end GNAT.Directory_Operations.Iteration;
|
with impact.d2.Shape.circle,
impact.d2.Shape.polygon,
impact.d2.Collision,
impact.d2.Math;
package impact.d2.Colliders
--
--
--
is
use impact.d2.Shape.circle,
impact.d2.Shape.polygon,
impact.d2.Math;
-- Compute the collision manifold between two circles.
--
procedure b2CollideCircles (manifold : access collision.b2Manifold; circleA : access constant b2CircleShape'Class; xfA : in b2Transform;
circleB : access constant b2CircleShape'Class; xfB : in b2Transform);
-- Compute the collision manifold between a polygon and a circle.
--
procedure b2CollidePolygonAndCircle (manifold : access collision.b2Manifold; polygon : access constant b2PolygonShape'Class; xfA : in b2Transform;
circle : access constant b2CircleShape'Class; xfB : in b2Transform);
-- Compute the collision manifold between two polygons.
--
procedure b2CollidePolygons (manifold : access collision.b2Manifold; polygonA : access constant b2PolygonShape'Class; xfA : in b2Transform;
polygonB : access constant b2PolygonShape'Class; xfB : in b2Transform);
-- void b2CollidePolygons(b2Manifold* manifold,
-- const b2PolygonShape* polygon1, const b2Transform& xf1,
-- const b2PolygonShape* polygon2, const b2Transform& xf2);
-- Determine if two generic shapes overlap.
--
function b2TestOverlap (shapeA, shapeB : in impact.d2.Shape.view;
xfA, xfB : in b2Transform ) return Boolean;
end impact.d2.Colliders;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . R E S P O N S E _ F I L E --
-- --
-- S p e c --
-- --
-- Copyright (C) 2007-2019, 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 provides facilities for getting command-line arguments from
-- a text file, called a "response file".
--
-- Using a response file allow passing a set of arguments to an executable
-- longer than the maximum allowed by the system on the command line.
pragma Compiler_Unit_Warning;
with System.Strings;
package System.Response_File is
subtype String_Access is System.Strings.String_Access;
-- type String_Access is access all String;
procedure Free (S : in out String_Access) renames System.Strings.Free;
-- To deallocate a String
subtype Argument_List is System.Strings.String_List;
-- type String_List is array (Positive range <>) of String_Access;
Max_Line_Length : constant := 4096;
-- The maximum length of lines in a response file
File_Does_Not_Exist : exception;
-- Raise by Arguments_From when a response file cannot be found
Line_Too_Long : exception;
-- Raise by Arguments_From when a line in the response file is longer than
-- Max_Line_Length.
No_Closing_Quote : exception;
-- Raise by Arguments_From when a quoted string does not end before the
-- end of the line.
Circularity_Detected : exception;
-- Raise by Arguments_From when Recursive is True and the same response
-- file is reading itself, either directly or indirectly.
function Arguments_From
(Response_File_Name : String;
Recursive : Boolean := False;
Ignore_Non_Existing_Files : Boolean := False)
return Argument_List;
-- Read response file with name Response_File_Name and return the argument
-- it contains as an Argument_List. It is the responsibility of the caller
-- to deallocate the strings in the Argument_List if desired. When
-- Recursive is True, any argument of the form @file_name indicates the
-- name of another response file and is replaced by the arguments in this
-- response file.
--
-- Each nonempty line of the response file contains one or several
-- arguments separated by white space. Empty lines or lines containing only
-- white space are ignored. Arguments containing white space or a double
-- quote ('"')must be quoted. A double quote inside a quote string is
-- indicated by two consecutive double quotes. Example: "-Idir with quote
-- "" and spaces". Non-white-space characters immediately before or after a
-- quoted string are part of the same argument. Ex: -Idir" with "spaces
--
-- When a response file cannot be found, exception File_Does_Not_Exist is
-- raised if Ignore_Non_Existing_Files is False, otherwise the response
-- file is ignored. Exception Line_Too_Long is raised when a line of a
-- response file is longer than Max_Line_Length. Exception No_Closing_Quote
-- is raised when a quoted argument is not closed before the end of the
-- line. Exception Circularity_Detected is raised when a Recursive is True
-- and a response file is reading itself, either directly or indirectly.
end System.Response_File;
|
pragma Ada_2005;
pragma Style_Checks (Off);
pragma Warnings (Off);
with Interfaces.C; use Interfaces.C;
with glib;
with glib.Values;
with System;
-- limited with GStreamer.GST_Low_Level.glib_2_0_glib_garray_h;
with System;
with GStreamer.GST_Low_Level.gstreamer_0_10_gst_sdp_gstsdp_h;
with GLIB; -- with GStreamer.GST_Low_Level.glibconfig_h;
package GStreamer.GST_Low_Level.gstreamer_0_10_gst_sdp_gstsdpmessage_h is
GST_SDP_BWTYPE_CT : aliased constant String := "CT" & ASCII.NUL; -- gst/sdp/gstsdpmessage.h:103
GST_SDP_BWTYPE_AS : aliased constant String := "AS" & ASCII.NUL; -- gst/sdp/gstsdpmessage.h:109
GST_SDP_BWTYPE_EXT_PREFIX : aliased constant String := "X-" & ASCII.NUL; -- gst/sdp/gstsdpmessage.h:115
GST_SDP_BWTYPE_RS : aliased constant String := "RS" & ASCII.NUL; -- gst/sdp/gstsdpmessage.h:124
GST_SDP_BWTYPE_RR : aliased constant String := "RR" & ASCII.NUL; -- gst/sdp/gstsdpmessage.h:132
GST_SDP_BWTYPE_TIAS : aliased constant String := "TIAS" & ASCII.NUL; -- gst/sdp/gstsdpmessage.h:140
-- GStreamer
-- * Copyright (C) <2005,2006> Wim Taymans <wim@fluendo.com>
-- *
-- * This library is free software; you can redistribute it and/or
-- * modify it under the terms of the GNU Library 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
-- * Library General Public License for more details.
-- *
-- * You should have received a copy of the GNU Library 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.
--
-- * Unless otherwise indicated, Source Code is licensed under MIT license.
-- * See further explanation attached in License Statement (distributed in the file
-- * LICENSE).
-- *
-- * 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.
--
--*
-- * GstSDPOrigin:
-- * @username: the user's login on the originating host, or it is "-"
-- * if the originating host does not support the concept of user ids.
-- * @sess_id: is a numeric string such that the tuple of @username, @sess_id,
-- * @nettype, @addrtype and @addr form a globally unique identifier for the
-- * session.
-- * @sess_version: a version number for this announcement
-- * @nettype: the type of network. "IN" is defined to have the meaning
-- * "Internet".
-- * @addrtype: the type of @addr.
-- * @addr: the globally unique address of the machine from which the session was
-- * created.
-- *
-- * The contents of the SDP "o=" field which gives the originator of the session
-- * (their username and the address of the user's host) plus a session id and
-- * session version number.
--
type GstSDPOrigin is record
username : access GLIB.gchar; -- gst/sdp/gstsdpmessage.h:71
sess_id : access GLIB.gchar; -- gst/sdp/gstsdpmessage.h:72
sess_version : access GLIB.gchar; -- gst/sdp/gstsdpmessage.h:73
nettype : access GLIB.gchar; -- gst/sdp/gstsdpmessage.h:74
addrtype : access GLIB.gchar; -- gst/sdp/gstsdpmessage.h:75
addr : access GLIB.gchar; -- gst/sdp/gstsdpmessage.h:76
end record;
pragma Convention (C_Pass_By_Copy, GstSDPOrigin); -- gst/sdp/gstsdpmessage.h:77
-- skipped anonymous struct anon_335
--*
-- * GstSDPConnection:
-- * @nettype: the type of network. "IN" is defined to have the meaning
-- * "Internet".
-- * @addrtype: the type of @address.
-- * @address: the address
-- * @ttl: the time to live of the address
-- * @addr_number: the number of layers
-- *
-- * The contents of the SDP "c=" field which contains connection data.
--
type GstSDPConnection is record
nettype : access GLIB.gchar; -- gst/sdp/gstsdpmessage.h:91
addrtype : access GLIB.gchar; -- gst/sdp/gstsdpmessage.h:92
address : access GLIB.gchar; -- gst/sdp/gstsdpmessage.h:93
ttl : aliased GLIB.guint; -- gst/sdp/gstsdpmessage.h:94
addr_number : aliased GLIB.guint; -- gst/sdp/gstsdpmessage.h:95
end record;
pragma Convention (C_Pass_By_Copy, GstSDPConnection); -- gst/sdp/gstsdpmessage.h:96
-- skipped anonymous struct anon_336
--*
-- * GST_SDP_BWTYPE_CT:
-- *
-- * The Conference Total bandwidth modifier.
--
--*
-- * GST_SDP_BWTYPE_AS:
-- *
-- * The Application-Specific Maximum bandwidth modifier.
--
--*
-- * GST_SDP_BWTYPE_EXT_PREFIX:
-- *
-- * The extension prefix bandwidth modifier.
--
--*
-- * GST_SDP_BWTYPE_RS:
-- *
-- * RTCP bandwidth allocated to active data senders (RFC 3556).
-- *
-- * Since: 0.10.15
--
--*
-- * GST_SDP_BWTYPE_RR:
-- *
-- * RTCP bandwidth allocated to data receivers (RFC 3556).
-- *
-- * Since: 0.10.15
--
--*
-- * GST_SDP_BWTYPE_TIAS:
-- *
-- * Transport Independent Application Specific Maximum bandwidth (RFC 3890).
-- *
-- * Since: 0.10.30
--
--*
-- * GstSDPBandwidth:
-- * @bwtype: the bandwidth modifier type
-- * @bandwidth: the bandwidth in kilobits per second
-- *
-- * The contents of the SDP "b=" field which specifies the proposed bandwidth to
-- * be used by the session or media.
--
type GstSDPBandwidth is record
bwtype : access GLIB.gchar; -- gst/sdp/gstsdpmessage.h:152
bandwidth : aliased GLIB.guint; -- gst/sdp/gstsdpmessage.h:153
end record;
pragma Convention (C_Pass_By_Copy, GstSDPBandwidth); -- gst/sdp/gstsdpmessage.h:154
-- skipped anonymous struct anon_337
--*
-- * GstSDPTime:
-- * @start: start time for the conference. The value is the decimal
-- * representation of Network Time Protocol (NTP) time values in seconds
-- * @stop: stop time for the conference. The value is the decimal
-- * representation of Network Time Protocol (NTP) time values in seconds
-- * @repeat: repeat times for a session
-- *
-- * The contents of the SDP "t=" field which specify the start and stop times for
-- * a conference session.
--
type GstSDPTime is record
start : access GLIB.gchar; -- gst/sdp/gstsdpmessage.h:168
stop : access GLIB.gchar; -- gst/sdp/gstsdpmessage.h:169
repeat : System.Address; -- access GStreamer.GST_Low_Level.glib_2_0_glib_garray_h.GArray -- gst/sdp/gstsdpmessage.h:170
end record;
pragma Convention (C_Pass_By_Copy, GstSDPTime); -- gst/sdp/gstsdpmessage.h:171
-- skipped anonymous struct anon_338
--*
-- * GstSDPZone:
-- * @time: the NTP time that a time zone adjustment happens
-- * @typed_time: the offset from the time when the session was first scheduled
-- *
-- * The contents of the SDP "z=" field which allows the sender to
-- * specify a list of time zone adjustments and offsets from the base
-- * time.
--
type GstSDPZone is record
time : access GLIB.gchar; -- gst/sdp/gstsdpmessage.h:183
typed_time : access GLIB.gchar; -- gst/sdp/gstsdpmessage.h:184
end record;
pragma Convention (C_Pass_By_Copy, GstSDPZone); -- gst/sdp/gstsdpmessage.h:185
-- skipped anonymous struct anon_339
--*
-- * GstSDPKey:
-- * @type: the encryption type
-- * @data: the encryption data
-- *
-- * The contents of the SDP "k=" field which is used to convey encryption
-- * keys.
--
type GstSDPKey is record
c_type : access GLIB.gchar; -- gst/sdp/gstsdpmessage.h:196
data : access GLIB.gchar; -- gst/sdp/gstsdpmessage.h:197
end record;
pragma Convention (C_Pass_By_Copy, GstSDPKey); -- gst/sdp/gstsdpmessage.h:198
-- skipped anonymous struct anon_340
--*
-- * GstSDPAttribute:
-- * @key: the attribute key
-- * @value: the attribute value or NULL when it was a property attribute
-- *
-- * The contents of the SDP "a=" field which contains a key/value pair.
--
type GstSDPAttribute is record
key : access GLIB.gchar; -- gst/sdp/gstsdpmessage.h:208
value : access GLIB.gchar; -- gst/sdp/gstsdpmessage.h:209
end record;
pragma Convention (C_Pass_By_Copy, GstSDPAttribute); -- gst/sdp/gstsdpmessage.h:210
-- skipped anonymous struct anon_341
--*
-- * GstSDPMedia:
-- * @media: the media type
-- * @port: the transport port to which the media stream will be sent
-- * @num_ports: the number of ports or -1 if only one port was specified
-- * @proto: the transport protocol
-- * @fmts: an array of #gchar formats
-- * @information: the media title
-- * @connections: array of #GstSDPConnection with media connection information
-- * @bandwidths: array of #GstSDPBandwidth with media bandwidth information
-- * @key: the encryption key
-- * @attributes: array of #GstSDPAttribute with the additional media attributes
-- *
-- * The contents of the SDP "m=" field with all related fields.
--
type GstSDPMedia is record
media : access GLIB.gchar; -- gst/sdp/gstsdpmessage.h:228
port : aliased GLIB.guint; -- gst/sdp/gstsdpmessage.h:229
num_ports : aliased GLIB.guint; -- gst/sdp/gstsdpmessage.h:230
proto : access GLIB.gchar; -- gst/sdp/gstsdpmessage.h:231
fmts : System.Address; -- access GStreamer.GST_Low_Level.glib_2_0_glib_garray_h.GArray -- gst/sdp/gstsdpmessage.h:232
information : access GLIB.gchar; -- gst/sdp/gstsdpmessage.h:233
connections : System.Address; -- access GStreamer.GST_Low_Level.glib_2_0_glib_garray_h.GArray -- gst/sdp/gstsdpmessage.h:234
bandwidths : System.Address; -- access GStreamer.GST_Low_Level.glib_2_0_glib_garray_h.GArray -- gst/sdp/gstsdpmessage.h:235
key : aliased GstSDPKey; -- gst/sdp/gstsdpmessage.h:236
attributes : System.Address; -- access GStreamer.GST_Low_Level.glib_2_0_glib_garray_h.GArray -- gst/sdp/gstsdpmessage.h:237
end record;
pragma Convention (C_Pass_By_Copy, GstSDPMedia); -- gst/sdp/gstsdpmessage.h:238
-- skipped anonymous struct anon_342
--*
-- * GstSDPMessage:
-- * @version: the protocol version
-- * @origin: owner/creator and session identifier
-- * @session_name: session name
-- * @information: session information
-- * @uri: URI of description
-- * @emails: array of #gchar with email addresses
-- * @phones: array of #gchar with phone numbers
-- * @connection: connection information for the session
-- * @bandwidths: array of #GstSDPBandwidth with bandwidth information
-- * @times: array of #GstSDPTime with time descriptions
-- * @zones: array of #GstSDPZone with time zone adjustments
-- * @key: encryption key
-- * @attributes: array of #GstSDPAttribute with session attributes
-- * @medias: array of #GstSDPMedia with media descriptions
-- *
-- * The contents of the SDP message.
--
type GstSDPMessage is record
version : access GLIB.gchar; -- gst/sdp/gstsdpmessage.h:260
origin : aliased GstSDPOrigin; -- gst/sdp/gstsdpmessage.h:261
session_name : access GLIB.gchar; -- gst/sdp/gstsdpmessage.h:262
information : access GLIB.gchar; -- gst/sdp/gstsdpmessage.h:263
uri : access GLIB.gchar; -- gst/sdp/gstsdpmessage.h:264
emails : System.Address; -- access GStreamer.GST_Low_Level.glib_2_0_glib_garray_h.GArray -- gst/sdp/gstsdpmessage.h:265
phones : System.Address; -- access GStreamer.GST_Low_Level.glib_2_0_glib_garray_h.GArray -- gst/sdp/gstsdpmessage.h:266
connection : aliased GstSDPConnection; -- gst/sdp/gstsdpmessage.h:267
bandwidths : System.Address; -- access GStreamer.GST_Low_Level.glib_2_0_glib_garray_h.GArray -- gst/sdp/gstsdpmessage.h:268
times : System.Address; -- access GStreamer.GST_Low_Level.glib_2_0_glib_garray_h.GArray -- gst/sdp/gstsdpmessage.h:269
zones : System.Address; -- access GStreamer.GST_Low_Level.glib_2_0_glib_garray_h.GArray -- gst/sdp/gstsdpmessage.h:270
key : aliased GstSDPKey; -- gst/sdp/gstsdpmessage.h:271
attributes : System.Address; -- access GStreamer.GST_Low_Level.glib_2_0_glib_garray_h.GArray -- gst/sdp/gstsdpmessage.h:272
medias : System.Address; -- access GStreamer.GST_Low_Level.glib_2_0_glib_garray_h.GArray -- gst/sdp/gstsdpmessage.h:273
end record;
pragma Convention (C_Pass_By_Copy, GstSDPMessage); -- gst/sdp/gstsdpmessage.h:274
-- skipped anonymous struct anon_343
-- Session descriptions
function gst_sdp_message_new (msg : System.Address) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_sdp_gstsdp_h.GstSDPResult; -- gst/sdp/gstsdpmessage.h:277
pragma Import (C, gst_sdp_message_new, "gst_sdp_message_new");
function gst_sdp_message_init (msg : access GstSDPMessage) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_sdp_gstsdp_h.GstSDPResult; -- gst/sdp/gstsdpmessage.h:278
pragma Import (C, gst_sdp_message_init, "gst_sdp_message_init");
function gst_sdp_message_uninit (msg : access GstSDPMessage) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_sdp_gstsdp_h.GstSDPResult; -- gst/sdp/gstsdpmessage.h:279
pragma Import (C, gst_sdp_message_uninit, "gst_sdp_message_uninit");
function gst_sdp_message_free (msg : access GstSDPMessage) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_sdp_gstsdp_h.GstSDPResult; -- gst/sdp/gstsdpmessage.h:280
pragma Import (C, gst_sdp_message_free, "gst_sdp_message_free");
function gst_sdp_message_parse_buffer
(data : access GLIB.guint8;
size : GLIB.guint;
msg : access GstSDPMessage) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_sdp_gstsdp_h.GstSDPResult; -- gst/sdp/gstsdpmessage.h:282
pragma Import (C, gst_sdp_message_parse_buffer, "gst_sdp_message_parse_buffer");
function gst_sdp_message_as_text (msg : access constant GstSDPMessage) return access GLIB.gchar; -- gst/sdp/gstsdpmessage.h:283
pragma Import (C, gst_sdp_message_as_text, "gst_sdp_message_as_text");
-- convert from/to uri
function gst_sdp_message_parse_uri (uri : access GLIB.gchar; msg : access GstSDPMessage) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_sdp_gstsdp_h.GstSDPResult; -- gst/sdp/gstsdpmessage.h:286
pragma Import (C, gst_sdp_message_parse_uri, "gst_sdp_message_parse_uri");
function gst_sdp_message_as_uri (scheme : access GLIB.gchar; msg : access constant GstSDPMessage) return access GLIB.gchar; -- gst/sdp/gstsdpmessage.h:287
pragma Import (C, gst_sdp_message_as_uri, "gst_sdp_message_as_uri");
-- utils
function gst_sdp_address_is_multicast
(nettype : access GLIB.gchar;
addrtype : access GLIB.gchar;
addr : access GLIB.gchar) return GLIB.gboolean; -- gst/sdp/gstsdpmessage.h:290
pragma Import (C, gst_sdp_address_is_multicast, "gst_sdp_address_is_multicast");
-- v=..
function gst_sdp_message_get_version (msg : access constant GstSDPMessage) return access GLIB.gchar; -- gst/sdp/gstsdpmessage.h:293
pragma Import (C, gst_sdp_message_get_version, "gst_sdp_message_get_version");
function gst_sdp_message_set_version (msg : access GstSDPMessage; version : access GLIB.gchar) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_sdp_gstsdp_h.GstSDPResult; -- gst/sdp/gstsdpmessage.h:294
pragma Import (C, gst_sdp_message_set_version, "gst_sdp_message_set_version");
-- o=<username> <sess-id> <sess-version> <nettype> <addrtype> <unicast-address>
function gst_sdp_message_get_origin (msg : access constant GstSDPMessage) return access constant GstSDPOrigin; -- gst/sdp/gstsdpmessage.h:297
pragma Import (C, gst_sdp_message_get_origin, "gst_sdp_message_get_origin");
function gst_sdp_message_set_origin
(msg : access GstSDPMessage;
username : access GLIB.gchar;
sess_id : access GLIB.gchar;
sess_version : access GLIB.gchar;
nettype : access GLIB.gchar;
addrtype : access GLIB.gchar;
addr : access GLIB.gchar) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_sdp_gstsdp_h.GstSDPResult; -- gst/sdp/gstsdpmessage.h:298
pragma Import (C, gst_sdp_message_set_origin, "gst_sdp_message_set_origin");
-- s=<session name>
function gst_sdp_message_get_session_name (msg : access constant GstSDPMessage) return access GLIB.gchar; -- gst/sdp/gstsdpmessage.h:304
pragma Import (C, gst_sdp_message_get_session_name, "gst_sdp_message_get_session_name");
function gst_sdp_message_set_session_name (msg : access GstSDPMessage; session_name : access GLIB.gchar) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_sdp_gstsdp_h.GstSDPResult; -- gst/sdp/gstsdpmessage.h:305
pragma Import (C, gst_sdp_message_set_session_name, "gst_sdp_message_set_session_name");
-- i=<session description>
function gst_sdp_message_get_information (msg : access constant GstSDPMessage) return access GLIB.gchar; -- gst/sdp/gstsdpmessage.h:308
pragma Import (C, gst_sdp_message_get_information, "gst_sdp_message_get_information");
function gst_sdp_message_set_information (msg : access GstSDPMessage; information : access GLIB.gchar) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_sdp_gstsdp_h.GstSDPResult; -- gst/sdp/gstsdpmessage.h:309
pragma Import (C, gst_sdp_message_set_information, "gst_sdp_message_set_information");
-- u=<uri>
function gst_sdp_message_get_uri (msg : access constant GstSDPMessage) return access GLIB.gchar; -- gst/sdp/gstsdpmessage.h:312
pragma Import (C, gst_sdp_message_get_uri, "gst_sdp_message_get_uri");
function gst_sdp_message_set_uri (msg : access GstSDPMessage; uri : access GLIB.gchar) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_sdp_gstsdp_h.GstSDPResult; -- gst/sdp/gstsdpmessage.h:313
pragma Import (C, gst_sdp_message_set_uri, "gst_sdp_message_set_uri");
-- e=<email-address>
function gst_sdp_message_emails_len (msg : access constant GstSDPMessage) return GLIB.guint; -- gst/sdp/gstsdpmessage.h:316
pragma Import (C, gst_sdp_message_emails_len, "gst_sdp_message_emails_len");
function gst_sdp_message_get_email (msg : access constant GstSDPMessage; idx : GLIB.guint) return access GLIB.gchar; -- gst/sdp/gstsdpmessage.h:317
pragma Import (C, gst_sdp_message_get_email, "gst_sdp_message_get_email");
function gst_sdp_message_add_email (msg : access GstSDPMessage; email : access GLIB.gchar) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_sdp_gstsdp_h.GstSDPResult; -- gst/sdp/gstsdpmessage.h:318
pragma Import (C, gst_sdp_message_add_email, "gst_sdp_message_add_email");
-- p=<phone-number>
function gst_sdp_message_phones_len (msg : access constant GstSDPMessage) return GLIB.guint; -- gst/sdp/gstsdpmessage.h:321
pragma Import (C, gst_sdp_message_phones_len, "gst_sdp_message_phones_len");
function gst_sdp_message_get_phone (msg : access constant GstSDPMessage; idx : GLIB.guint) return access GLIB.gchar; -- gst/sdp/gstsdpmessage.h:322
pragma Import (C, gst_sdp_message_get_phone, "gst_sdp_message_get_phone");
function gst_sdp_message_add_phone (msg : access GstSDPMessage; phone : access GLIB.gchar) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_sdp_gstsdp_h.GstSDPResult; -- gst/sdp/gstsdpmessage.h:323
pragma Import (C, gst_sdp_message_add_phone, "gst_sdp_message_add_phone");
-- c=<nettype> <addrtype> <connection-address>[/<ttl>][/<number of addresses>]
function gst_sdp_message_get_connection (msg : access constant GstSDPMessage) return access constant GstSDPConnection; -- gst/sdp/gstsdpmessage.h:326
pragma Import (C, gst_sdp_message_get_connection, "gst_sdp_message_get_connection");
function gst_sdp_message_set_connection
(msg : access GstSDPMessage;
nettype : access GLIB.gchar;
addrtype : access GLIB.gchar;
address : access GLIB.gchar;
ttl : GLIB.guint;
addr_number : GLIB.guint) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_sdp_gstsdp_h.GstSDPResult; -- gst/sdp/gstsdpmessage.h:327
pragma Import (C, gst_sdp_message_set_connection, "gst_sdp_message_set_connection");
-- b=<bwtype>:<bandwidth>
function gst_sdp_message_bandwidths_len (msg : access constant GstSDPMessage) return GLIB.guint; -- gst/sdp/gstsdpmessage.h:331
pragma Import (C, gst_sdp_message_bandwidths_len, "gst_sdp_message_bandwidths_len");
function gst_sdp_message_get_bandwidth (msg : access constant GstSDPMessage; idx : GLIB.guint) return access constant GstSDPBandwidth; -- gst/sdp/gstsdpmessage.h:332
pragma Import (C, gst_sdp_message_get_bandwidth, "gst_sdp_message_get_bandwidth");
function gst_sdp_message_add_bandwidth
(msg : access GstSDPMessage;
bwtype : access GLIB.gchar;
bandwidth : GLIB.guint) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_sdp_gstsdp_h.GstSDPResult; -- gst/sdp/gstsdpmessage.h:333
pragma Import (C, gst_sdp_message_add_bandwidth, "gst_sdp_message_add_bandwidth");
-- t=<start-time> <stop-time> and
-- * r=<repeat interval> <active duration> <offsets from start-time>
function gst_sdp_message_times_len (msg : access constant GstSDPMessage) return GLIB.guint; -- gst/sdp/gstsdpmessage.h:337
pragma Import (C, gst_sdp_message_times_len, "gst_sdp_message_times_len");
function gst_sdp_message_get_time (msg : access constant GstSDPMessage; idx : GLIB.guint) return access constant GstSDPTime; -- gst/sdp/gstsdpmessage.h:338
pragma Import (C, gst_sdp_message_get_time, "gst_sdp_message_get_time");
function gst_sdp_message_add_time
(msg : access GstSDPMessage;
start : access GLIB.gchar;
stop : access GLIB.gchar;
repeat : System.Address) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_sdp_gstsdp_h.GstSDPResult; -- gst/sdp/gstsdpmessage.h:339
pragma Import (C, gst_sdp_message_add_time, "gst_sdp_message_add_time");
-- z=<adjustment time> <offset> <adjustment time> <offset> ....
function gst_sdp_message_zones_len (msg : access constant GstSDPMessage) return GLIB.guint; -- gst/sdp/gstsdpmessage.h:342
pragma Import (C, gst_sdp_message_zones_len, "gst_sdp_message_zones_len");
function gst_sdp_message_get_zone (msg : access constant GstSDPMessage; idx : GLIB.guint) return access constant GstSDPZone; -- gst/sdp/gstsdpmessage.h:343
pragma Import (C, gst_sdp_message_get_zone, "gst_sdp_message_get_zone");
function gst_sdp_message_add_zone
(msg : access GstSDPMessage;
adj_time : access GLIB.gchar;
typed_time : access GLIB.gchar) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_sdp_gstsdp_h.GstSDPResult; -- gst/sdp/gstsdpmessage.h:344
pragma Import (C, gst_sdp_message_add_zone, "gst_sdp_message_add_zone");
-- k=<method>[:<encryption key>]
function gst_sdp_message_get_key (msg : access constant GstSDPMessage) return access constant GstSDPKey; -- gst/sdp/gstsdpmessage.h:348
pragma Import (C, gst_sdp_message_get_key, "gst_sdp_message_get_key");
function gst_sdp_message_set_key
(msg : access GstSDPMessage;
c_type : access GLIB.gchar;
data : access GLIB.gchar) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_sdp_gstsdp_h.GstSDPResult; -- gst/sdp/gstsdpmessage.h:349
pragma Import (C, gst_sdp_message_set_key, "gst_sdp_message_set_key");
-- a=...
function gst_sdp_message_attributes_len (msg : access constant GstSDPMessage) return GLIB.guint; -- gst/sdp/gstsdpmessage.h:352
pragma Import (C, gst_sdp_message_attributes_len, "gst_sdp_message_attributes_len");
function gst_sdp_message_get_attribute (msg : access constant GstSDPMessage; idx : GLIB.guint) return access constant GstSDPAttribute; -- gst/sdp/gstsdpmessage.h:353
pragma Import (C, gst_sdp_message_get_attribute, "gst_sdp_message_get_attribute");
function gst_sdp_message_get_attribute_val (msg : access constant GstSDPMessage; key : access GLIB.gchar) return access GLIB.gchar; -- gst/sdp/gstsdpmessage.h:354
pragma Import (C, gst_sdp_message_get_attribute_val, "gst_sdp_message_get_attribute_val");
function gst_sdp_message_get_attribute_val_n
(msg : access constant GstSDPMessage;
key : access GLIB.gchar;
nth : GLIB.guint) return access GLIB.gchar; -- gst/sdp/gstsdpmessage.h:355
pragma Import (C, gst_sdp_message_get_attribute_val_n, "gst_sdp_message_get_attribute_val_n");
function gst_sdp_message_add_attribute
(msg : access GstSDPMessage;
key : access GLIB.gchar;
value : access GLIB.gchar) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_sdp_gstsdp_h.GstSDPResult; -- gst/sdp/gstsdpmessage.h:357
pragma Import (C, gst_sdp_message_add_attribute, "gst_sdp_message_add_attribute");
-- m=.. sections
function gst_sdp_message_medias_len (msg : access constant GstSDPMessage) return GLIB.guint; -- gst/sdp/gstsdpmessage.h:361
pragma Import (C, gst_sdp_message_medias_len, "gst_sdp_message_medias_len");
function gst_sdp_message_get_media (msg : access constant GstSDPMessage; idx : GLIB.guint) return access constant GstSDPMedia; -- gst/sdp/gstsdpmessage.h:362
pragma Import (C, gst_sdp_message_get_media, "gst_sdp_message_get_media");
function gst_sdp_message_add_media (msg : access GstSDPMessage; media : access GstSDPMedia) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_sdp_gstsdp_h.GstSDPResult; -- gst/sdp/gstsdpmessage.h:363
pragma Import (C, gst_sdp_message_add_media, "gst_sdp_message_add_media");
function gst_sdp_message_dump (msg : access constant GstSDPMessage) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_sdp_gstsdp_h.GstSDPResult; -- gst/sdp/gstsdpmessage.h:365
pragma Import (C, gst_sdp_message_dump, "gst_sdp_message_dump");
-- Media descriptions
function gst_sdp_media_new (media : System.Address) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_sdp_gstsdp_h.GstSDPResult; -- gst/sdp/gstsdpmessage.h:368
pragma Import (C, gst_sdp_media_new, "gst_sdp_media_new");
function gst_sdp_media_init (media : access GstSDPMedia) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_sdp_gstsdp_h.GstSDPResult; -- gst/sdp/gstsdpmessage.h:369
pragma Import (C, gst_sdp_media_init, "gst_sdp_media_init");
function gst_sdp_media_uninit (media : access GstSDPMedia) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_sdp_gstsdp_h.GstSDPResult; -- gst/sdp/gstsdpmessage.h:370
pragma Import (C, gst_sdp_media_uninit, "gst_sdp_media_uninit");
function gst_sdp_media_free (media : access GstSDPMedia) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_sdp_gstsdp_h.GstSDPResult; -- gst/sdp/gstsdpmessage.h:371
pragma Import (C, gst_sdp_media_free, "gst_sdp_media_free");
function gst_sdp_media_as_text (media : access constant GstSDPMedia) return access GLIB.gchar; -- gst/sdp/gstsdpmessage.h:373
pragma Import (C, gst_sdp_media_as_text, "gst_sdp_media_as_text");
-- m=<media> <port>/<number of ports> <proto> <fmt> ...
function gst_sdp_media_get_media (media : access constant GstSDPMedia) return access GLIB.gchar; -- gst/sdp/gstsdpmessage.h:376
pragma Import (C, gst_sdp_media_get_media, "gst_sdp_media_get_media");
function gst_sdp_media_set_media (media : access GstSDPMedia; med : access GLIB.gchar) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_sdp_gstsdp_h.GstSDPResult; -- gst/sdp/gstsdpmessage.h:377
pragma Import (C, gst_sdp_media_set_media, "gst_sdp_media_set_media");
function gst_sdp_media_get_port (media : access constant GstSDPMedia) return GLIB.guint; -- gst/sdp/gstsdpmessage.h:379
pragma Import (C, gst_sdp_media_get_port, "gst_sdp_media_get_port");
function gst_sdp_media_get_num_ports (media : access constant GstSDPMedia) return GLIB.guint; -- gst/sdp/gstsdpmessage.h:380
pragma Import (C, gst_sdp_media_get_num_ports, "gst_sdp_media_get_num_ports");
function gst_sdp_media_set_port_info
(media : access GstSDPMedia;
port : GLIB.guint;
num_ports : GLIB.guint) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_sdp_gstsdp_h.GstSDPResult; -- gst/sdp/gstsdpmessage.h:381
pragma Import (C, gst_sdp_media_set_port_info, "gst_sdp_media_set_port_info");
function gst_sdp_media_get_proto (media : access constant GstSDPMedia) return access GLIB.gchar; -- gst/sdp/gstsdpmessage.h:384
pragma Import (C, gst_sdp_media_get_proto, "gst_sdp_media_get_proto");
function gst_sdp_media_set_proto (media : access GstSDPMedia; proto : access GLIB.gchar) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_sdp_gstsdp_h.GstSDPResult; -- gst/sdp/gstsdpmessage.h:385
pragma Import (C, gst_sdp_media_set_proto, "gst_sdp_media_set_proto");
function gst_sdp_media_formats_len (media : access constant GstSDPMedia) return GLIB.guint; -- gst/sdp/gstsdpmessage.h:387
pragma Import (C, gst_sdp_media_formats_len, "gst_sdp_media_formats_len");
function gst_sdp_media_get_format (media : access constant GstSDPMedia; idx : GLIB.guint) return access GLIB.gchar; -- gst/sdp/gstsdpmessage.h:388
pragma Import (C, gst_sdp_media_get_format, "gst_sdp_media_get_format");
function gst_sdp_media_add_format (media : access GstSDPMedia; format : access GLIB.gchar) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_sdp_gstsdp_h.GstSDPResult; -- gst/sdp/gstsdpmessage.h:389
pragma Import (C, gst_sdp_media_add_format, "gst_sdp_media_add_format");
-- i=<session description>
function gst_sdp_media_get_information (media : access constant GstSDPMedia) return access GLIB.gchar; -- gst/sdp/gstsdpmessage.h:392
pragma Import (C, gst_sdp_media_get_information, "gst_sdp_media_get_information");
function gst_sdp_media_set_information (media : access GstSDPMedia; information : access GLIB.gchar) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_sdp_gstsdp_h.GstSDPResult; -- gst/sdp/gstsdpmessage.h:393
pragma Import (C, gst_sdp_media_set_information, "gst_sdp_media_set_information");
-- c=<nettype> <addrtype> <connection-address>[/<ttl>][/<number of addresses>]
function gst_sdp_media_connections_len (media : access constant GstSDPMedia) return GLIB.guint; -- gst/sdp/gstsdpmessage.h:396
pragma Import (C, gst_sdp_media_connections_len, "gst_sdp_media_connections_len");
function gst_sdp_media_get_connection (media : access constant GstSDPMedia; idx : GLIB.guint) return access constant GstSDPConnection; -- gst/sdp/gstsdpmessage.h:397
pragma Import (C, gst_sdp_media_get_connection, "gst_sdp_media_get_connection");
function gst_sdp_media_add_connection
(media : access GstSDPMedia;
nettype : access GLIB.gchar;
addrtype : access GLIB.gchar;
address : access GLIB.gchar;
ttl : GLIB.guint;
addr_number : GLIB.guint) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_sdp_gstsdp_h.GstSDPResult; -- gst/sdp/gstsdpmessage.h:398
pragma Import (C, gst_sdp_media_add_connection, "gst_sdp_media_add_connection");
-- b=<bwtype>:<bandwidth>
function gst_sdp_media_bandwidths_len (media : access constant GstSDPMedia) return GLIB.guint; -- gst/sdp/gstsdpmessage.h:403
pragma Import (C, gst_sdp_media_bandwidths_len, "gst_sdp_media_bandwidths_len");
function gst_sdp_media_get_bandwidth (media : access constant GstSDPMedia; idx : GLIB.guint) return access constant GstSDPBandwidth; -- gst/sdp/gstsdpmessage.h:404
pragma Import (C, gst_sdp_media_get_bandwidth, "gst_sdp_media_get_bandwidth");
function gst_sdp_media_add_bandwidth
(media : access GstSDPMedia;
bwtype : access GLIB.gchar;
bandwidth : GLIB.guint) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_sdp_gstsdp_h.GstSDPResult; -- gst/sdp/gstsdpmessage.h:405
pragma Import (C, gst_sdp_media_add_bandwidth, "gst_sdp_media_add_bandwidth");
-- k=<method>:<encryption key>
function gst_sdp_media_get_key (media : access constant GstSDPMedia) return access constant GstSDPKey; -- gst/sdp/gstsdpmessage.h:409
pragma Import (C, gst_sdp_media_get_key, "gst_sdp_media_get_key");
function gst_sdp_media_set_key
(media : access GstSDPMedia;
c_type : access GLIB.gchar;
data : access GLIB.gchar) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_sdp_gstsdp_h.GstSDPResult; -- gst/sdp/gstsdpmessage.h:410
pragma Import (C, gst_sdp_media_set_key, "gst_sdp_media_set_key");
-- a=...
function gst_sdp_media_attributes_len (media : access constant GstSDPMedia) return GLIB.guint; -- gst/sdp/gstsdpmessage.h:413
pragma Import (C, gst_sdp_media_attributes_len, "gst_sdp_media_attributes_len");
function gst_sdp_media_get_attribute (media : access constant GstSDPMedia; idx : GLIB.guint) return access constant GstSDPAttribute; -- gst/sdp/gstsdpmessage.h:414
pragma Import (C, gst_sdp_media_get_attribute, "gst_sdp_media_get_attribute");
function gst_sdp_media_get_attribute_val (media : access constant GstSDPMedia; key : access GLIB.gchar) return access GLIB.gchar; -- gst/sdp/gstsdpmessage.h:415
pragma Import (C, gst_sdp_media_get_attribute_val, "gst_sdp_media_get_attribute_val");
function gst_sdp_media_get_attribute_val_n
(media : access constant GstSDPMedia;
key : access GLIB.gchar;
nth : GLIB.guint) return access GLIB.gchar; -- gst/sdp/gstsdpmessage.h:416
pragma Import (C, gst_sdp_media_get_attribute_val_n, "gst_sdp_media_get_attribute_val_n");
function gst_sdp_media_add_attribute
(media : access GstSDPMedia;
key : access GLIB.gchar;
value : access GLIB.gchar) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_sdp_gstsdp_h.GstSDPResult; -- gst/sdp/gstsdpmessage.h:418
pragma Import (C, gst_sdp_media_add_attribute, "gst_sdp_media_add_attribute");
end GStreamer.GST_Low_Level.gstreamer_0_10_gst_sdp_gstsdpmessage_h;
|
-- Stnd Binary Rank Test.
with text_io; use text_io;
with Binary_Rank;
with Disorderly.Random; use Disorderly.Random;
with Disorderly.Random.Clock_Entropy;
with Ada.Numerics.Discrete_Random;
with Chi_Gaussian_CDF;
procedure rank_tst_1 is
type Real is digits 15;
Bits_per_Random_Word : constant := 32;
pragma Assert (Bits_per_Random_Word > 31 and Bits_per_Random_Word < 62);
-- 32 bits for general tests.
package Rank_Matrix is new Binary_Rank
(No_of_Bits_per_Segment => Bits_per_Random_Word,
Segments_per_Vector => 1); -- can't change from 1
use Rank_Matrix;
r : Binary_Matrix;
Max_Row, Max_Col : constant Matrix_Index := Matrix_Index'Last;
-- Matrix_Index goes from 1 .. Bits_per_Vector.
-- all array start at 1, since that's the way Marsaglia's diehard does it.
-- Notice that we can do sub blocks of the full matrix by changing above.
-- VARIABLES FOR CHI-SQUARE TEST:
package chi_cdf is new Chi_Gaussian_CDF (Real);
--Sample_Size : constant := 2**13; -- for quick demo, 2**12 is min. acceptable.
Sample_Size : constant := 2**27; -- 2**27 is good
-- Usually, the best way to make the Chi-Square as strong as possible is
-- to make the Sample_Size as large as possible.
x : Random_Int;
Stream_1 : State;
Rank : Integer;
Outcome_id : Matrix_Index;
ave_chi, ave_p, ave_normalized_var_of_p : Real := 0.0;
True_Degrees_of_Freedom : constant := 3;
subtype Range_of_Possible_Outcomes is
Matrix_Index range Max_Col-True_Degrees_of_Freedom .. Max_Col;
type Statistical_Data is array (Range_of_Possible_Outcomes) of Real;
Observed_Count : Statistical_Data := (others => 0.0);
Expected_Count : Statistical_Data := (others => 0.0);
Expected_Frequency : constant Statistical_Data :=
-- FOR 31 bits and greater:
-- True_Degrees_of_Freedom : constant := 2;
--(0.13363571467, 0.57757619017, 0.28878809515);
-- True_Degrees_of_Freedom : constant := 3;
(0.00528545025, 0.12835026442, 0.57757619017, 0.28878809515);
-- True_Degrees_of_Freedom : constant := 4;
--(4.66639518324E-05, 0.0052387863054, 0.1283502644829,
-- 0.577576190173205, 0.2887880950866);
-- True_Degrees_of_Freedom : constant := 5;
-- (9.6962450869E-08, 4.65669893816E-05, 0.0052387863054,
-- 0.12835026448293, 0.577576190173205, 0.2887880950866);
-- from known analytical distribution (true asymptotically also):
-- expected rank_freq
-- rank probability
-- <=29 0.00528545025
-- 30 0.12835026442
-- 31 0.57757619017
-- 32 0.28878809515
--
-- 58 4.66639518324322E-05
-- 59 5.23878630542589E-03
-- 60 1.28350264482934E-01
-- 61 5.77576190173205E-01
-- 62 2.88788095086602E-01
-- 57 9.69624508687517E-08
-- 58 4.65669893815635E-05
-- 59 5.23878630542589E-03
-- 60 1.28350264482934E-01
-- 61 5.77576190173205E-01
-- 62 2.88788095086602E-01
-- 61 bits:
--
-- 56 9.69624508687517E-08
-- 57 4.65669893815635E-05
-- 58 5.23878630542589E-03
-- 59 1.28350264482934E-01
-- 60 5.77576190173205E-01
-- 61 2.88788095086602E-01
--
-- 57 4.66639518324322E-05 and all < 57
-- 58 5.23878630542589E-03
-- 59 1.28350264482934E-01
-- 60 5.77576190173205E-01
-- 61 2.88788095086602E-01
--25 6.05558642701658E-15
--26 4.88352774683776E-11
--27 9.69136088580580E-08
--28 4.65669892297724E-05
--29 5.23878629810739E-03
--30 1.28350264423167E-01
--31 5.77576190173205E-01
--32 2.88788095153841E-01
--------------------
-- Get_Random_Stnd -
--------------------
-- Compiler's native random number generator.
type Unsigned_Stnd is mod 2**Bits_per_Random_Word;
package rnd is new Ada.Numerics.Discrete_Random (Unsigned_Stnd);
Stream_Stnd : rnd.Generator;
procedure Get_Random_Stnd(X : out Random_Int; S : in rnd.Generator)
is
begin
X := Random_Int (rnd.Random (S));
end Get_Random_Stnd;
pragma Inline (Get_Random_Stnd);
begin
for i in Range_of_Possible_Outcomes loop
Expected_Count (i) := Expected_Frequency (i) * Real(Sample_Size);
end loop;
-- Init array of expected counts: same really for 31 bit to 64 bit nums.
-- True_Degrees_of_Freedom : constant := 3; These 4 sum to 1.0
rnd.Reset (Stream_Stnd);
-- compiler's PRNG; Initialize the stream even if you don't use it.
Clock_Entropy.Reset (Stream_1);
-- Init Stream_1 for calls to Get_Random(x, Stream_1);
-- do 1 chi-sqr test per Chi_Test_id value:
for Chi_Test_id in Long_Integer range 1..2**28 loop -- forever really
Observed_Count := (others => 0.0);
for Draw_id in Long_Integer range 1 .. Sample_Size loop
for Col_id in Matrix_Index range Matrix_Index'First .. Max_Col loop
for Seg_id in Segments loop
Get_Random_Stnd (X, Stream_Stnd);
--Get_Random(X, Stream_1);
r(Col_id)(Seg_id) := Unsigned_Segment(X mod 2**Bits_per_Random_Word);
end loop;
end loop;
Get_Rank(r, Max_Row, Max_Col, Rank);
--text_io.put(integer'Image(Max_Col - Rank));
if Matrix_Index(Rank) > Range_of_Possible_Outcomes'First then
Outcome_id := Matrix_Index(Rank);
else
Outcome_id := Range_of_Possible_Outcomes'First;
end if;
Observed_Count(Outcome_id) := Observed_Count(Outcome_id) + 1.0;
end loop;
declare
chi, e, s, normalized_variance_of_p, p_val : Real;
Degrees_of_Freedom : constant Real := Real (True_Degrees_of_Freedom);
begin
chi := 0.0;
for Outcome in Range_of_Possible_Outcomes loop
e := Expected_Count(Outcome);
s := (Observed_Count(Outcome) - e)**2 / e;
chi := chi + s;
end loop;
p_val := chi_cdf.Chi_Squared_CDF (Degrees_of_Freedom, chi);
normalized_variance_of_p := (p_val - 0.5)**2 / (0.25/3.0);
ave_chi := ave_chi + chi;
ave_p := ave_p + p_val;
ave_normalized_var_of_p := ave_normalized_var_of_p + normalized_variance_of_p;
end;
new_line(1);
Put ("p-val average (should be 0.5, after 1000's of iterations):");
put (Real'Image (ave_p / Real (Chi_Test_id)));
new_line;
Put ("p-val variance (should be 1.0, after 1000's of iterations):");
put (Real'Image (ave_normalized_var_of_p / (Real (Chi_Test_id))));
new_line;
end loop;
end;
|
-- protected_refcounted_kvflyweights.ads
-- A package for ensuring resources are not duplicated in a manner similar
-- to the C++ Boost flyweight classes. This package provides a task-safe
-- implementation that uses reference counting to release resources when the
-- last reference is released. Resources are associated with a key that can
-- be used to create them if they have not already been created.
-- Copyright (c) 2016, James Humphry
--
-- Permission to use, copy, modify, and/or 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.
pragma Profile (No_Implementation_Extensions);
with Ada.Containers;
with KVFlyweights.Refcounted_Lists;
with KVFlyweights.Protected_Hashtables;
with KVFlyweights.Refcounted_Ptrs;
generic
type Key(<>) is private;
type Value(<>) is limited private;
type Value_Access is access Value;
with function Factory (K : in Key) return Value_Access;
with function Hash (K : in Key) return Ada.Containers.Hash_Type;
Capacity : Ada.Containers.Hash_Type := 256;
with function "=" (Left, Right : in Key) return Boolean is <>;
package Protected_Refcounted_KVFlyweights is
type Key_Access is access Key;
package Lists is
new KVFlyweights.Refcounted_Lists(Key => Key,
Key_Access => Key_Access,
Value => Value,
Value_Access => Value_Access,
Factory => Factory,
"=" => "=");
package Hashtables is
new KVFlyweights.Protected_Hashtables(Key => Key,
Key_Access => Key_Access,
Value => Value,
Value_Access => Value_Access,
Hash => Hash,
KVLists_Spec => Lists.Lists_Spec,
Capacity => Capacity);
package Ptrs is
new KVFlyweights.Refcounted_Ptrs(Key => Key,
Key_Access => Key_Access,
Value => Value,
Value_Access => Value_Access,
KVFlyweight_Hashtables => Hashtables.Hashtables_Spec);
subtype KVFlyweight is Hashtables.KVFlyweight;
-- This KVFlyweight type is an implementation of the key-value flyweight
-- pattern, which helps prevent the resource usage caused by the storage of
-- duplicate values. Reference counting is used to release resources when
-- they are no longer required. This implementation is protected so it
-- is safe to use even if multiple tasks could attempt to add or remove
-- resources simultaneously.
subtype V_Ref is Ptrs.V_Ref;
-- This is a generic generalised reference type which is used to make
-- Value_Ptr easier to use and which should not be stored or reused.
subtype Value_Ptr is Ptrs.Refcounted_Value_Ptr;
-- The Value_Ptr type points to a resource inside a Flyweight. It is
-- reference-counted (shared with Value_Ref) so that when the last Value_Ptr
-- or Value_Ref pointing to a resource is destroyed, the resource will be
-- deallocated as well. The 'Get' function returns an access value to the
-- resource.
use type Ptrs.Refcounted_Value_Ptr;
subtype Value_Ref is Ptrs.Refcounted_Value_Ref;
-- The Value_Ref type points to a resource inside a Flyweight. It is
-- reference-counted (shared with Value_Ptr) so that when the last Value_Ptr
-- or Value_Ref pointing to a resource is destroyed, the resource will be
-- deallocated as well. The Value_Ref type can be implicitly derefenced to
-- return the resource.
use type Ptrs.Refcounted_Value_Ref;
function P (P : Ptrs.Refcounted_Value_Ptr) return V_Ref
renames Ptrs.P;
-- P returns an V_Ref which is a generalised reference to the stored value.
-- This is an alternative to calling the Get function and dereferencing the
-- access value returned with '.all'.
function Get (P : Ptrs.Refcounted_Value_Ptr) return Value_Access
renames Ptrs.Get;
-- Get returns an access value that points to a resource inside a Flyweight.
function Get (P : Ptrs.Refcounted_Value_Ref) return Value_Access
renames Ptrs.Get;
-- Get returns an access value that points to a resource inside a Flyweight.
function Make_Ref (P : Ptrs.Refcounted_Value_Ptr'Class)
return Ptrs.Refcounted_Value_Ref
renames Ptrs.Make_Ref;
-- Make_Ref converts a Refcounted_Value_Ptr into a Refcounted_Value_Ref.
function Insert_Ptr (F : aliased in out Hashtables.KVFlyweight;
K : in Key)
return Ptrs.Refcounted_Value_Ptr
renames Ptrs.Insert_Ptr;
-- Insert_Ref looks to see if the Key K already exists inside the KVFlyweight
-- F. If not, F makes a new value from K using the specified Factory function
-- and stores it for future use. A Refcounted_Value_Ptr is returned.
function Make_Ptr (R : Ptrs.Refcounted_Value_Ref'Class)
return Ptrs.Refcounted_Value_Ptr
renames Ptrs.Make_Ptr;
-- Make_Ref converts a Refcounted_Value_Ref into a Refcounted_Value_Ptr.
function Insert_Ref (F : aliased in out Hashtables.KVFlyweight;
K : in Key)
return Ptrs.Refcounted_Value_Ref
renames Ptrs.Insert_Ref;
-- Insert_Ref looks to see if the Key K already exists inside the KVFlyweight
-- F. If not, F makes a new value from K using the specified Factory function
-- and stores it for future use. A Refcounted_Value_Ref is returned.
-- Note - ideally Insert_Ptr and Insert_Ref could both be overloadings of
-- Insert. However this seems to cause problems for GNAT GPL 2015 so for now
-- the type is suffixed to the name.
end Protected_Refcounted_KVFlyweights;
|
-- Copyright 2015-2021 Free Software Foundation, Inc.
--
-- This program 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 3 of the License, or
-- (at your option) any later version.
--
-- This program 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 program. If not, see <http://www.gnu.org/licenses/>.
with Pck; use Pck;
procedure Bar is
M : Integer := 35;
subtype Int is Integer range 0 .. M;
type Variant_Type (N : Int := 0) is record
F : String(1 .. N) := (others => 'x');
end record;
type Variant_Type_Access is access all Variant_Type;
VTA : Variant_Type_Access;
begin
Do_Nothing (VTA'Address); -- STOP
end Bar;
|
--
-- The following is based on John Maddock's extended precision
-- (Boost Library) gamma function. It uses the gamma rational
-- poly functions (for the range x = 1 to 3) worked out by John Maddock,
-- so his Copyright will be retained.
--
--------------------------------------------------------------------------
-- (C) Copyright John Maddock 2006.
-- Use, modification and distribution are subject to the
-- Boost Software License, Version 1.0. (See accompanying file
-- LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
--
--Boost Software License - Version 1.0 - August 17th, 2003
--
--Permission is hereby granted, free of charge, to any person or organization
--obtaining a copy of the software and accompanying documentation covered by
--this license (the "Software") to use, reproduce, display, distribute,
--execute, and transmit the Software, and to prepare derivative works of the
--Software, and to permit third-parties to whom the Software is furnished to
--do so, all subject to the following:
--
--The copyright notices in the Software and this entire statement, including
--the above license grant, this restriction and the following disclaimer,
--must be included in all copies of the Software, in whole or in part, and
--all derivative works of the Software, unless such copies or derivative
--works are solely in the form of machine-executable object code generated by
--a source language processor.
--
--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, TITLE AND NON-INFRINGEMENT. IN NO EVENT
--SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
--FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
--ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
--DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------
--
-- Natural logarithm of Gamma function for positive real arguments.
--
generic
type Real is digits <>;
package Gamma_1_to_3 is
pragma Pure(Gamma_1_to_3);
function Log_Gamma_1_to_3 (x : in Real) return Real;
-- Only good for 1 < x < 3
private
Real_Epsilon : constant Real := (+0.125) * Real'Epsilon;
-- have to modify this if Real is abstract
end Gamma_1_to_3;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . B Y T E _ S W A P P I N G --
-- --
-- S p e c --
-- --
-- Copyright (C) 2006-2021, 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. --
-- --
-- --
-- --
-- --
-- --
-- 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. --
-- --
------------------------------------------------------------------------------
-- Intrinsic routines for byte swapping. These are used by the expanded code
-- (supporting alternative byte ordering), and by the GNAT.Byte_Swapping run
-- time package which provides user level routines for byte swapping.
with Interfaces;
package System.Byte_Swapping is
pragma Pure;
subtype U16 is Interfaces.Unsigned_16;
subtype U32 is Interfaces.Unsigned_32;
subtype U64 is Interfaces.Unsigned_64;
subtype U128 is Interfaces.Unsigned_128;
function Bswap_16 (X : U16) return U16;
pragma Import (Intrinsic, Bswap_16, "__builtin_bswap16");
function Bswap_32 (X : U32) return U32;
pragma Import (Intrinsic, Bswap_32, "__builtin_bswap32");
function Bswap_64 (X : U64) return U64;
pragma Import (Intrinsic, Bswap_64, "__builtin_bswap64");
function Bswap_128 (X : U128) return U128;
pragma Import (Intrinsic, Bswap_128, "__builtin_bswap128");
end System.Byte_Swapping;
|
procedure typeclass is
begin
case Integer'Type_Class is
when others => null;
end case;
end;
|
--Types
package Types is
pragma Elaborate_Body;
type Miles_T is digits 6;
-- Create types for at least two distance measurements (feet, meters, etc)
type Hours_T is digits 6;
-- Create types for at least two time measurements (seconds, minutes, etc)
-- Create "/" operator functions to divide distance by time to return MPH_T
-- Create helper functions to convert distance to miles and time to hours
end Types;
|
------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Forms.Form_User_Data --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998 Free Software Foundation, Inc. --
-- --
-- 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, distribute with modifications, 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 ABOVE 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. --
-- --
-- Except as contained in this notice, the name(s) of the above copyright --
-- holders shall not be used in advertising or otherwise to promote the --
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.12 $
-- Binding Version 01.00
------------------------------------------------------------------------------
-- |
-- |=====================================================================
-- | man page form__userptr.3x
-- |=====================================================================
-- |
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
package body Terminal_Interface.Curses.Forms.Form_User_Data is
use type Interfaces.C.int;
-- |
-- |
-- |
procedure Set_User_Data (Frm : in Form;
Data : in User_Access)
is
function Set_Form_Userptr (Frm : Form;
Data : User_Access) return C_Int;
pragma Import (C, Set_Form_Userptr, "set_form_userptr");
Res : constant Eti_Error := Set_Form_Userptr (Frm, Data);
begin
if Res /= E_Ok then
Eti_Exception (Res);
end if;
end Set_User_Data;
-- |
-- |
-- |
function Get_User_Data (Frm : in Form) return User_Access
is
function Form_Userptr (Frm : Form) return User_Access;
pragma Import (C, Form_Userptr, "form_userptr");
begin
return Form_Userptr (Frm);
end Get_User_Data;
procedure Get_User_Data (Frm : in Form;
Data : out User_Access)
is
begin
Data := Get_User_Data (Frm);
end Get_User_Data;
end Terminal_Interface.Curses.Forms.Form_User_Data;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- G N A T . R E G E X P --
-- --
-- S p e c --
-- --
-- Copyright (C) 1998-2019, 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. --
-- --
------------------------------------------------------------------------------
-- Simple Regular expression matching
-- This package provides a simple implementation of a regular expression
-- pattern matching algorithm, using a subset of the syntax of regular
-- expressions copied from familiar Unix style utilities.
-- See file s-regexp.ads for full documentation of the interface
------------------------------------------------------------
-- Summary of Pattern Matching Packages in GNAT Hierarchy --
------------------------------------------------------------
-- There are three related packages that perform pattern matching functions.
-- the following is an outline of these packages, to help you determine
-- which is best for your needs.
-- GNAT.Regexp (files g-regexp.ads/s-regexp.ads/s-regexp.adb)
-- This is a simple package providing Unix-style regular expression
-- matching with the restriction that it matches entire strings. It
-- is particularly useful for file name matching, and in particular
-- it provides "globbing patterns" that are useful in implementing
-- unix or DOS style wild card matching for file names.
-- GNAT.Regpat (files g-regpat.ads/s-regpat.ads/g-regpat.adb)
-- This is a more complete implementation of Unix-style regular
-- expressions, copied from the original V7 style regular expression
-- library written in C by Henry Spencer. It is functionally the
-- same as this library, and uses the same internal data structures
-- stored in a binary compatible manner.
-- GNAT.Spitbol.Patterns (files g-spipat.ads/g-spipat.adb)
-- This is a completely general pattern matching package based on the
-- pattern language of SNOBOL4, as implemented in SPITBOL. The pattern
-- language is modeled on context free grammars, with context sensitive
-- extensions that provide full (type 0) computational capabilities.
with System.Regexp;
package GNAT.Regexp renames System.Regexp;
|
package Tk.TtkLabelFrame.Test_Data is
end Tk.TtkLabelFrame.Test_Data;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- G N A T . C G I . C O O K I E --
-- --
-- B o d y --
-- --
-- Copyright (C) 2000-2005, 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 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. --
-- --
-- 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. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with Ada.Strings.Fixed;
with Ada.Strings.Maps;
with Ada.Text_IO;
with Ada.Integer_Text_IO;
with GNAT.Table;
package body GNAT.CGI.Cookie is
use Ada;
Valid_Environment : Boolean := False;
-- This boolean will be set to True if the initialization was fine
Header_Sent : Boolean := False;
-- Will be set to True when the header will be sent
-- Cookie data that has been added
type String_Access is access String;
type Cookie_Data is record
Key : String_Access;
Value : String_Access;
Comment : String_Access;
Domain : String_Access;
Max_Age : Natural;
Path : String_Access;
Secure : Boolean := False;
end record;
type Key_Value is record
Key, Value : String_Access;
end record;
package Cookie_Table is new Table (Cookie_Data, Positive, 1, 5, 50);
-- This is the table to keep all cookies to be sent back to the server
package Key_Value_Table is new Table (Key_Value, Positive, 1, 1, 50);
-- This is the table to keep all cookies received from the server
procedure Check_Environment;
pragma Inline (Check_Environment);
-- This procedure will raise Data_Error if Valid_Environment is False
procedure Initialize;
-- Initialize CGI package by reading the runtime environment. This
-- procedure is called during elaboration. All exceptions raised during
-- this procedure are deferred.
-----------------------
-- Check_Environment --
-----------------------
procedure Check_Environment is
begin
if not Valid_Environment then
raise Data_Error;
end if;
end Check_Environment;
-----------
-- Count --
-----------
function Count return Natural is
begin
return Key_Value_Table.Last;
end Count;
------------
-- Exists --
------------
function Exists (Key : String) return Boolean is
begin
Check_Environment;
for K in 1 .. Key_Value_Table.Last loop
if Key_Value_Table.Table (K).Key.all = Key then
return True;
end if;
end loop;
return False;
end Exists;
----------------------
-- For_Every_Cookie --
----------------------
procedure For_Every_Cookie is
Quit : Boolean;
begin
Check_Environment;
for K in 1 .. Key_Value_Table.Last loop
Quit := False;
Action (Key_Value_Table.Table (K).Key.all,
Key_Value_Table.Table (K).Value.all,
K,
Quit);
exit when Quit;
end loop;
end For_Every_Cookie;
----------------
-- Initialize --
----------------
procedure Initialize is
HTTP_COOKIE : constant String := Metavariable (CGI.HTTP_Cookie);
procedure Set_Parameter_Table (Data : String);
-- Parse Data and insert information in Key_Value_Table
-------------------------
-- Set_Parameter_Table --
-------------------------
procedure Set_Parameter_Table (Data : String) is
procedure Add_Parameter (K : Positive; P : String);
-- Add a single parameter into the table at index K. The parameter
-- format is "key=value".
Count : constant Positive :=
1 + Strings.Fixed.Count (Data, Strings.Maps.To_Set (";"));
-- Count is the number of parameters in the string. Parameters are
-- separated by ampersand character.
Index : Positive := Data'First;
Sep : Natural;
-------------------
-- Add_Parameter --
-------------------
procedure Add_Parameter (K : Positive; P : String) is
Equal : constant Natural := Strings.Fixed.Index (P, "=");
begin
if Equal = 0 then
raise Data_Error;
else
Key_Value_Table.Table (K) :=
Key_Value'(new String'(Decode (P (P'First .. Equal - 1))),
new String'(Decode (P (Equal + 1 .. P'Last))));
end if;
end Add_Parameter;
-- Start of processing for Set_Parameter_Table
begin
Key_Value_Table.Set_Last (Count);
for K in 1 .. Count - 1 loop
Sep := Strings.Fixed.Index (Data (Index .. Data'Last), ";");
Add_Parameter (K, Data (Index .. Sep - 1));
Index := Sep + 2;
end loop;
-- Add last parameter
Add_Parameter (Count, Data (Index .. Data'Last));
end Set_Parameter_Table;
-- Start of processing for Initialize
begin
if HTTP_COOKIE /= "" then
Set_Parameter_Table (HTTP_COOKIE);
end if;
Valid_Environment := True;
exception
when others =>
Valid_Environment := False;
end Initialize;
---------
-- Key --
---------
function Key (Position : Positive) return String is
begin
Check_Environment;
if Position <= Key_Value_Table.Last then
return Key_Value_Table.Table (Position).Key.all;
else
raise Cookie_Not_Found;
end if;
end Key;
--------
-- Ok --
--------
function Ok return Boolean is
begin
return Valid_Environment;
end Ok;
----------------
-- Put_Header --
----------------
procedure Put_Header
(Header : String := Default_Header;
Force : Boolean := False)
is
procedure Output_Cookies;
-- Iterate through the list of cookies to be sent to the server
-- and output them.
--------------------
-- Output_Cookies --
--------------------
procedure Output_Cookies is
procedure Output_One_Cookie
(Key : String;
Value : String;
Comment : String;
Domain : String;
Max_Age : Natural;
Path : String;
Secure : Boolean);
-- Output one cookie in the CGI header
-----------------------
-- Output_One_Cookie --
-----------------------
procedure Output_One_Cookie
(Key : String;
Value : String;
Comment : String;
Domain : String;
Max_Age : Natural;
Path : String;
Secure : Boolean)
is
begin
Text_IO.Put ("Set-Cookie: ");
Text_IO.Put (Key & '=' & Value);
if Comment /= "" then
Text_IO.Put ("; Comment=" & Comment);
end if;
if Domain /= "" then
Text_IO.Put ("; Domain=" & Domain);
end if;
if Max_Age /= Natural'Last then
Text_IO.Put ("; Max-Age=");
Integer_Text_IO.Put (Max_Age, Width => 0);
end if;
if Path /= "" then
Text_IO.Put ("; Path=" & Path);
end if;
if Secure then
Text_IO.Put ("; Secure");
end if;
Text_IO.New_Line;
end Output_One_Cookie;
-- Start of processing for Output_Cookies
begin
for C in 1 .. Cookie_Table.Last loop
Output_One_Cookie (Cookie_Table.Table (C).Key.all,
Cookie_Table.Table (C).Value.all,
Cookie_Table.Table (C).Comment.all,
Cookie_Table.Table (C).Domain.all,
Cookie_Table.Table (C).Max_Age,
Cookie_Table.Table (C).Path.all,
Cookie_Table.Table (C).Secure);
end loop;
end Output_Cookies;
-- Start of processing for Put_Header
begin
if Header_Sent = False or else Force then
Check_Environment;
Text_IO.Put_Line (Header);
Output_Cookies;
Text_IO.New_Line;
Header_Sent := True;
end if;
end Put_Header;
---------
-- Set --
---------
procedure Set
(Key : String;
Value : String;
Comment : String := "";
Domain : String := "";
Max_Age : Natural := Natural'Last;
Path : String := "/";
Secure : Boolean := False)
is
begin
Cookie_Table.Increment_Last;
Cookie_Table.Table (Cookie_Table.Last) :=
Cookie_Data'(new String'(Key),
new String'(Value),
new String'(Comment),
new String'(Domain),
Max_Age,
new String'(Path),
Secure);
end Set;
-----------
-- Value --
-----------
function Value
(Key : String;
Required : Boolean := False) return String
is
begin
Check_Environment;
for K in 1 .. Key_Value_Table.Last loop
if Key_Value_Table.Table (K).Key.all = Key then
return Key_Value_Table.Table (K).Value.all;
end if;
end loop;
if Required then
raise Cookie_Not_Found;
else
return "";
end if;
end Value;
function Value (Position : Positive) return String is
begin
Check_Environment;
if Position <= Key_Value_Table.Last then
return Key_Value_Table.Table (Position).Value.all;
else
raise Cookie_Not_Found;
end if;
end Value;
-- Elaboration code for package
begin
-- Initialize unit by reading the HTTP_COOKIE metavariable and fill
-- Key_Value_Table structure.
Initialize;
end GNAT.CGI.Cookie;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- ADA.STRINGS.WIDE_WIDE_MAPS.WIDE_WIDE_CONSTANTS --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2021, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
-- apply solely to the contents of the part following the private keyword. --
-- --
-- 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. --
-- --
-- --
-- --
-- --
-- --
-- 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. --
-- --
------------------------------------------------------------------------------
with Ada.Characters.Wide_Wide_Latin_1;
package Ada.Strings.Wide_Wide_Maps.Wide_Wide_Constants is
pragma Preelaborate;
Control_Set : constant Wide_Wide_Maps.Wide_Wide_Character_Set;
Graphic_Set : constant Wide_Wide_Maps.Wide_Wide_Character_Set;
Letter_Set : constant Wide_Wide_Maps.Wide_Wide_Character_Set;
Lower_Set : constant Wide_Wide_Maps.Wide_Wide_Character_Set;
Upper_Set : constant Wide_Wide_Maps.Wide_Wide_Character_Set;
Basic_Set : constant Wide_Wide_Maps.Wide_Wide_Character_Set;
Decimal_Digit_Set : constant Wide_Wide_Maps.Wide_Wide_Character_Set;
Hexadecimal_Digit_Set : constant Wide_Wide_Maps.Wide_Wide_Character_Set;
Alphanumeric_Set : constant Wide_Wide_Maps.Wide_Wide_Character_Set;
Special_Graphic_Set : constant Wide_Wide_Maps.Wide_Wide_Character_Set;
ISO_646_Set : constant Wide_Wide_Maps.Wide_Wide_Character_Set;
Character_Set : constant Wide_Wide_Maps.Wide_Wide_Character_Set;
Lower_Case_Map : constant Wide_Wide_Maps.Wide_Wide_Character_Mapping;
-- Maps to lower case for letters, else identity
Upper_Case_Map : constant Wide_Wide_Maps.Wide_Wide_Character_Mapping;
-- Maps to upper case for letters, else identity
Basic_Map : constant Wide_Wide_Maps.Wide_Wide_Character_Mapping;
-- Maps to basic letter for letters, else identity
private
package W renames Ada.Characters.Wide_Wide_Latin_1;
subtype WC is Wide_Wide_Character;
Control_Ranges : aliased constant Wide_Wide_Character_Ranges :=
((W.NUL, W.US),
(W.DEL, W.APC));
Control_Set : constant Wide_Wide_Character_Set :=
(AF.Controlled with
Control_Ranges'Unrestricted_Access);
Graphic_Ranges : aliased constant Wide_Wide_Character_Ranges :=
((W.Space, W.Tilde),
(WC'Val (256), WC'Last));
Graphic_Set : constant Wide_Wide_Character_Set :=
(AF.Controlled with
Graphic_Ranges'Unrestricted_Access);
Letter_Ranges : aliased constant Wide_Wide_Character_Ranges :=
(('A', 'Z'),
(W.LC_A, W.LC_Z),
(W.UC_A_Grave, W.UC_O_Diaeresis),
(W.UC_O_Oblique_Stroke, W.LC_O_Diaeresis),
(W.LC_O_Oblique_Stroke, W.LC_Y_Diaeresis));
Letter_Set : constant Wide_Wide_Character_Set :=
(AF.Controlled with
Letter_Ranges'Unrestricted_Access);
Lower_Ranges : aliased constant Wide_Wide_Character_Ranges :=
(1 => (W.LC_A, W.LC_Z),
2 => (W.LC_German_Sharp_S, W.LC_O_Diaeresis),
3 => (W.LC_O_Oblique_Stroke, W.LC_Y_Diaeresis));
Lower_Set : constant Wide_Wide_Character_Set :=
(AF.Controlled with
Lower_Ranges'Unrestricted_Access);
Upper_Ranges : aliased constant Wide_Wide_Character_Ranges :=
(1 => ('A', 'Z'),
2 => (W.UC_A_Grave, W.UC_O_Diaeresis),
3 => (W.UC_O_Oblique_Stroke, W.UC_Icelandic_Thorn));
Upper_Set : constant Wide_Wide_Character_Set :=
(AF.Controlled with
Upper_Ranges'Unrestricted_Access);
Basic_Ranges : aliased constant Wide_Wide_Character_Ranges :=
(1 => ('A', 'Z'),
2 => (W.LC_A, W.LC_Z),
3 => (W.UC_AE_Diphthong, W.UC_AE_Diphthong),
4 => (W.LC_AE_Diphthong, W.LC_AE_Diphthong),
5 => (W.LC_German_Sharp_S, W.LC_German_Sharp_S),
6 => (W.UC_Icelandic_Thorn, W.UC_Icelandic_Thorn),
7 => (W.LC_Icelandic_Thorn, W.LC_Icelandic_Thorn),
8 => (W.UC_Icelandic_Eth, W.UC_Icelandic_Eth),
9 => (W.LC_Icelandic_Eth, W.LC_Icelandic_Eth));
Basic_Set : constant Wide_Wide_Character_Set :=
(AF.Controlled with
Basic_Ranges'Unrestricted_Access);
Decimal_Digit_Ranges : aliased constant Wide_Wide_Character_Ranges :=
(1 => ('0', '9'));
Decimal_Digit_Set : constant Wide_Wide_Character_Set :=
(AF.Controlled with
Decimal_Digit_Ranges'Unrestricted_Access);
Hexadecimal_Digit_Ranges : aliased constant Wide_Wide_Character_Ranges :=
(1 => ('0', '9'),
2 => ('A', 'F'),
3 => (W.LC_A, W.LC_F));
Hexadecimal_Digit_Set : constant Wide_Wide_Character_Set :=
(AF.Controlled with
Hexadecimal_Digit_Ranges'Unrestricted_Access);
Alphanumeric_Ranges : aliased constant Wide_Wide_Character_Ranges :=
(1 => ('0', '9'),
2 => ('A', 'Z'),
3 => (W.LC_A, W.LC_Z),
4 => (W.UC_A_Grave, W.UC_O_Diaeresis),
5 => (W.UC_O_Oblique_Stroke, W.LC_O_Diaeresis),
6 => (W.LC_O_Oblique_Stroke, W.LC_Y_Diaeresis));
Alphanumeric_Set : constant Wide_Wide_Character_Set :=
(AF.Controlled with
Alphanumeric_Ranges'Unrestricted_Access);
Special_Graphic_Ranges : aliased constant Wide_Wide_Character_Ranges :=
(1 => (Wide_Wide_Space, W.Solidus),
2 => (W.Colon, W.Commercial_At),
3 => (W.Left_Square_Bracket, W.Grave),
4 => (W.Left_Curly_Bracket, W.Tilde),
5 => (W.No_Break_Space, W.Inverted_Question),
6 => (W.Multiplication_Sign, W.Multiplication_Sign),
7 => (W.Division_Sign, W.Division_Sign));
Special_Graphic_Set : constant Wide_Wide_Character_Set :=
(AF.Controlled with
Special_Graphic_Ranges'Unrestricted_Access);
ISO_646_Ranges : aliased constant Wide_Wide_Character_Ranges :=
(1 => (W.NUL, W.DEL));
ISO_646_Set : constant Wide_Wide_Character_Set :=
(AF.Controlled with
ISO_646_Ranges'Unrestricted_Access);
Character_Ranges : aliased constant Wide_Wide_Character_Ranges :=
(1 => (W.NUL, WC'Val (255)));
Character_Set : constant Wide_Wide_Character_Set :=
(AF.Controlled with
Character_Ranges'Unrestricted_Access);
Lower_Case_Mapping : aliased constant Wide_Wide_Character_Mapping_Values :=
(Length => 56,
Domain =>
"ABCDEFGHIJKLMNOPQRSTUVWXYZ" &
W.UC_A_Grave &
W.UC_A_Acute &
W.UC_A_Circumflex &
W.UC_A_Tilde &
W.UC_A_Diaeresis &
W.UC_A_Ring &
W.UC_AE_Diphthong &
W.UC_C_Cedilla &
W.UC_E_Grave &
W.UC_E_Acute &
W.UC_E_Circumflex &
W.UC_E_Diaeresis &
W.UC_I_Grave &
W.UC_I_Acute &
W.UC_I_Circumflex &
W.UC_I_Diaeresis &
W.UC_Icelandic_Eth &
W.UC_N_Tilde &
W.UC_O_Grave &
W.UC_O_Acute &
W.UC_O_Circumflex &
W.UC_O_Tilde &
W.UC_O_Diaeresis &
W.UC_O_Oblique_Stroke &
W.UC_U_Grave &
W.UC_U_Acute &
W.UC_U_Circumflex &
W.UC_U_Diaeresis &
W.UC_Y_Acute &
W.UC_Icelandic_Thorn,
Rangev =>
"abcdefghijklmnopqrstuvwxyz" &
W.LC_A_Grave &
W.LC_A_Acute &
W.LC_A_Circumflex &
W.LC_A_Tilde &
W.LC_A_Diaeresis &
W.LC_A_Ring &
W.LC_AE_Diphthong &
W.LC_C_Cedilla &
W.LC_E_Grave &
W.LC_E_Acute &
W.LC_E_Circumflex &
W.LC_E_Diaeresis &
W.LC_I_Grave &
W.LC_I_Acute &
W.LC_I_Circumflex &
W.LC_I_Diaeresis &
W.LC_Icelandic_Eth &
W.LC_N_Tilde &
W.LC_O_Grave &
W.LC_O_Acute &
W.LC_O_Circumflex &
W.LC_O_Tilde &
W.LC_O_Diaeresis &
W.LC_O_Oblique_Stroke &
W.LC_U_Grave &
W.LC_U_Acute &
W.LC_U_Circumflex &
W.LC_U_Diaeresis &
W.LC_Y_Acute &
W.LC_Icelandic_Thorn);
Lower_Case_Map : constant Wide_Wide_Character_Mapping :=
(AF.Controlled with
Map => Lower_Case_Mapping'Unrestricted_Access);
Upper_Case_Mapping : aliased constant Wide_Wide_Character_Mapping_Values :=
(Length => 56,
Domain =>
"abcdefghijklmnopqrstuvwxyz" &
W.LC_A_Grave &
W.LC_A_Acute &
W.LC_A_Circumflex &
W.LC_A_Tilde &
W.LC_A_Diaeresis &
W.LC_A_Ring &
W.LC_AE_Diphthong &
W.LC_C_Cedilla &
W.LC_E_Grave &
W.LC_E_Acute &
W.LC_E_Circumflex &
W.LC_E_Diaeresis &
W.LC_I_Grave &
W.LC_I_Acute &
W.LC_I_Circumflex &
W.LC_I_Diaeresis &
W.LC_Icelandic_Eth &
W.LC_N_Tilde &
W.LC_O_Grave &
W.LC_O_Acute &
W.LC_O_Circumflex &
W.LC_O_Tilde &
W.LC_O_Diaeresis &
W.LC_O_Oblique_Stroke &
W.LC_U_Grave &
W.LC_U_Acute &
W.LC_U_Circumflex &
W.LC_U_Diaeresis &
W.LC_Y_Acute &
W.LC_Icelandic_Thorn,
Rangev =>
"ABCDEFGHIJKLMNOPQRSTUVWXYZ" &
W.UC_A_Grave &
W.UC_A_Acute &
W.UC_A_Circumflex &
W.UC_A_Tilde &
W.UC_A_Diaeresis &
W.UC_A_Ring &
W.UC_AE_Diphthong &
W.UC_C_Cedilla &
W.UC_E_Grave &
W.UC_E_Acute &
W.UC_E_Circumflex &
W.UC_E_Diaeresis &
W.UC_I_Grave &
W.UC_I_Acute &
W.UC_I_Circumflex &
W.UC_I_Diaeresis &
W.UC_Icelandic_Eth &
W.UC_N_Tilde &
W.UC_O_Grave &
W.UC_O_Acute &
W.UC_O_Circumflex &
W.UC_O_Tilde &
W.UC_O_Diaeresis &
W.UC_O_Oblique_Stroke &
W.UC_U_Grave &
W.UC_U_Acute &
W.UC_U_Circumflex &
W.UC_U_Diaeresis &
W.UC_Y_Acute &
W.UC_Icelandic_Thorn);
Upper_Case_Map : constant Wide_Wide_Character_Mapping :=
(AF.Controlled with
Upper_Case_Mapping'Unrestricted_Access);
Basic_Mapping : aliased constant Wide_Wide_Character_Mapping_Values :=
(Length => 55,
Domain =>
W.UC_A_Grave &
W.UC_A_Acute &
W.UC_A_Circumflex &
W.UC_A_Tilde &
W.UC_A_Diaeresis &
W.UC_A_Ring &
W.UC_C_Cedilla &
W.UC_E_Grave &
W.UC_E_Acute &
W.UC_E_Circumflex &
W.UC_E_Diaeresis &
W.UC_I_Grave &
W.UC_I_Acute &
W.UC_I_Circumflex &
W.UC_I_Diaeresis &
W.UC_N_Tilde &
W.UC_O_Grave &
W.UC_O_Acute &
W.UC_O_Circumflex &
W.UC_O_Tilde &
W.UC_O_Diaeresis &
W.UC_O_Oblique_Stroke &
W.UC_U_Grave &
W.UC_U_Acute &
W.UC_U_Circumflex &
W.UC_U_Diaeresis &
W.UC_Y_Acute &
W.LC_A_Grave &
W.LC_A_Acute &
W.LC_A_Circumflex &
W.LC_A_Tilde &
W.LC_A_Diaeresis &
W.LC_A_Ring &
W.LC_C_Cedilla &
W.LC_E_Grave &
W.LC_E_Acute &
W.LC_E_Circumflex &
W.LC_E_Diaeresis &
W.LC_I_Grave &
W.LC_I_Acute &
W.LC_I_Circumflex &
W.LC_I_Diaeresis &
W.LC_N_Tilde &
W.LC_O_Grave &
W.LC_O_Acute &
W.LC_O_Circumflex &
W.LC_O_Tilde &
W.LC_O_Diaeresis &
W.LC_O_Oblique_Stroke &
W.LC_U_Grave &
W.LC_U_Acute &
W.LC_U_Circumflex &
W.LC_U_Diaeresis &
W.LC_Y_Acute &
W.LC_Y_Diaeresis,
Rangev =>
'A' & -- UC_A_Grave
'A' & -- UC_A_Acute
'A' & -- UC_A_Circumflex
'A' & -- UC_A_Tilde
'A' & -- UC_A_Diaeresis
'A' & -- UC_A_Ring
'C' & -- UC_C_Cedilla
'E' & -- UC_E_Grave
'E' & -- UC_E_Acute
'E' & -- UC_E_Circumflex
'E' & -- UC_E_Diaeresis
'I' & -- UC_I_Grave
'I' & -- UC_I_Acute
'I' & -- UC_I_Circumflex
'I' & -- UC_I_Diaeresis
'N' & -- UC_N_Tilde
'O' & -- UC_O_Grave
'O' & -- UC_O_Acute
'O' & -- UC_O_Circumflex
'O' & -- UC_O_Tilde
'O' & -- UC_O_Diaeresis
'O' & -- UC_O_Oblique_Stroke
'U' & -- UC_U_Grave
'U' & -- UC_U_Acute
'U' & -- UC_U_Circumflex
'U' & -- UC_U_Diaeresis
'Y' & -- UC_Y_Acute
'a' & -- LC_A_Grave
'a' & -- LC_A_Acute
'a' & -- LC_A_Circumflex
'a' & -- LC_A_Tilde
'a' & -- LC_A_Diaeresis
'a' & -- LC_A_Ring
'c' & -- LC_C_Cedilla
'e' & -- LC_E_Grave
'e' & -- LC_E_Acute
'e' & -- LC_E_Circumflex
'e' & -- LC_E_Diaeresis
'i' & -- LC_I_Grave
'i' & -- LC_I_Acute
'i' & -- LC_I_Circumflex
'i' & -- LC_I_Diaeresis
'n' & -- LC_N_Tilde
'o' & -- LC_O_Grave
'o' & -- LC_O_Acute
'o' & -- LC_O_Circumflex
'o' & -- LC_O_Tilde
'o' & -- LC_O_Diaeresis
'o' & -- LC_O_Oblique_Stroke
'u' & -- LC_U_Grave
'u' & -- LC_U_Acute
'u' & -- LC_U_Circumflex
'u' & -- LC_U_Diaeresis
'y' & -- LC_Y_Acute
'y'); -- LC_Y_Diaeresis
Basic_Map : constant Wide_Wide_Character_Mapping :=
(AF.Controlled with
Basic_Mapping'Unrestricted_Access);
end Ada.Strings.Wide_Wide_Maps.Wide_Wide_Constants;
|
with Ada.Streams; use Ada.Streams;
package RT1 is
pragma Remote_Types;
type Ptr is private;
procedure Read (X : access Root_Stream_Type'Class; V : out Ptr) is null;
procedure Write (X : access Root_Stream_Type'Class; V : Ptr) is null;
for Ptr'Read use Read;
for Ptr'Write use Write;
procedure P (S : access Root_Stream_Type'Class);
private
type Ptr is not null access all Integer;
end RT1;
|
-- Copyright (c) 2019 Maxim Reznik <reznikmm@gmail.com>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
with League.IRIs;
with League.Strings;
package Torrent.Trackers is
type Announcement_Kind is
(Started, Completed, Stopped, Regular);
function Event_URL
(Tracker : League.IRIs.IRI;
Info_Hash : SHA1;
Peer_Id : SHA1;
Port : Positive;
Uploaded : Ada.Streams.Stream_Element_Count;
Downloaded : Ada.Streams.Stream_Element_Count;
Left : Ada.Streams.Stream_Element_Count;
Event : Announcement_Kind) return League.IRIs.IRI;
-- Construct an URL to request a tracker.
type Response (<>) is tagged private;
function Parse (Data : Ada.Streams.Stream_Element_Array) return Response;
-- Decode tracker's response. Constraint_Error is raised if it fails.
function Is_Failure (Self : Response'Class) return Boolean;
-- If the query failed.
function Failure_Reason
(Self : Response'Class) return League.Strings.Universal_String;
-- A human readable string which explains why the query failed.
function Interval (Self : Response'Class) return Duration;
-- The number of seconds the downloader should wait between regular
-- rerequests.
function Peer_Count (Self : Response'Class) return Natural;
-- Length of peer lists.
function Peer_Id
(Self : Response'Class;
Index : Positive) return SHA1;
-- The peer's self-selected ID
function Peer_Address
(Self : Response'Class;
Index : Positive) return League.Strings.Universal_String;
-- The peer's IP address or DNS name.
function Peer_Port
(Self : Response'Class;
Index : Positive) return Natural;
-- The peer's port number.
private
type Peer is record
Id : SHA1;
Address : League.Strings.Universal_String;
Port : Natural;
end record;
type Peer_Array is array (Positive range <>) of Peer;
type Response (Peer_Count : Natural) is tagged record
Is_Failure : Boolean;
Failure_Reason : League.Strings.Universal_String;
Interval : Duration;
Peers : Peer_Array (1 .. Peer_Count);
end record;
end Torrent.Trackers;
|
-- This spec has been automatically generated from STM32F40x.svd
pragma Restrictions (No_Elaboration_Code);
pragma Ada_2012;
with HAL;
with System;
package STM32_SVD.DAC is
pragma Preelaborate;
---------------
-- Registers --
---------------
-----------------
-- CR_Register --
-----------------
subtype CR_TSEL1_Field is HAL.UInt3;
subtype CR_WAVE1_Field is HAL.UInt2;
subtype CR_MAMP1_Field is HAL.UInt4;
subtype CR_TSEL2_Field is HAL.UInt3;
subtype CR_WAVE2_Field is HAL.UInt2;
subtype CR_MAMP2_Field is HAL.UInt4;
-- control register
type CR_Register is record
-- DAC channel1 enable
EN1 : Boolean := False;
-- DAC channel1 output buffer disable
BOFF1 : Boolean := False;
-- DAC channel1 trigger enable
TEN1 : Boolean := False;
-- DAC channel1 trigger selection
TSEL1 : CR_TSEL1_Field := 16#0#;
-- DAC channel1 noise/triangle wave generation enable
WAVE1 : CR_WAVE1_Field := 16#0#;
-- DAC channel1 mask/amplitude selector
MAMP1 : CR_MAMP1_Field := 16#0#;
-- DAC channel1 DMA enable
DMAEN1 : Boolean := False;
-- DAC channel1 DMA Underrun Interrupt enable
DMAUDRIE1 : Boolean := False;
-- unspecified
Reserved_14_15 : HAL.UInt2 := 16#0#;
-- DAC channel2 enable
EN2 : Boolean := False;
-- DAC channel2 output buffer disable
BOFF2 : Boolean := False;
-- DAC channel2 trigger enable
TEN2 : Boolean := False;
-- DAC channel2 trigger selection
TSEL2 : CR_TSEL2_Field := 16#0#;
-- DAC channel2 noise/triangle wave generation enable
WAVE2 : CR_WAVE2_Field := 16#0#;
-- DAC channel2 mask/amplitude selector
MAMP2 : CR_MAMP2_Field := 16#0#;
-- DAC channel2 DMA enable
DMAEN2 : Boolean := False;
-- DAC channel2 DMA underrun interrupt enable
DMAUDRIE2 : Boolean := False;
-- unspecified
Reserved_30_31 : HAL.UInt2 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CR_Register use record
EN1 at 0 range 0 .. 0;
BOFF1 at 0 range 1 .. 1;
TEN1 at 0 range 2 .. 2;
TSEL1 at 0 range 3 .. 5;
WAVE1 at 0 range 6 .. 7;
MAMP1 at 0 range 8 .. 11;
DMAEN1 at 0 range 12 .. 12;
DMAUDRIE1 at 0 range 13 .. 13;
Reserved_14_15 at 0 range 14 .. 15;
EN2 at 0 range 16 .. 16;
BOFF2 at 0 range 17 .. 17;
TEN2 at 0 range 18 .. 18;
TSEL2 at 0 range 19 .. 21;
WAVE2 at 0 range 22 .. 23;
MAMP2 at 0 range 24 .. 27;
DMAEN2 at 0 range 28 .. 28;
DMAUDRIE2 at 0 range 29 .. 29;
Reserved_30_31 at 0 range 30 .. 31;
end record;
----------------------
-- SWTRIGR_Register --
----------------------
--------------------
-- SWTRIGR.SWTRIG --
--------------------
-- SWTRIGR_SWTRIG array
type SWTRIGR_SWTRIG_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for SWTRIGR_SWTRIG
type SWTRIGR_SWTRIG_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- SWTRIG as a value
Val : HAL.UInt2;
when True =>
-- SWTRIG as an array
Arr : SWTRIGR_SWTRIG_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for SWTRIGR_SWTRIG_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- software trigger register
type SWTRIGR_Register is record
-- Write-only. DAC channel1 software trigger
SWTRIG : SWTRIGR_SWTRIG_Field :=
(As_Array => False, Val => 16#0#);
-- unspecified
Reserved_2_31 : HAL.UInt30 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for SWTRIGR_Register use record
SWTRIG at 0 range 0 .. 1;
Reserved_2_31 at 0 range 2 .. 31;
end record;
----------------------
-- DHR12R1_Register --
----------------------
subtype DHR12R1_DACC1DHR_Field is HAL.UInt12;
-- channel1 12-bit right-aligned data holding register
type DHR12R1_Register is record
-- DAC channel1 12-bit right-aligned data
DACC1DHR : DHR12R1_DACC1DHR_Field := 16#0#;
-- unspecified
Reserved_12_31 : HAL.UInt20 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DHR12R1_Register use record
DACC1DHR at 0 range 0 .. 11;
Reserved_12_31 at 0 range 12 .. 31;
end record;
----------------------
-- DHR12L1_Register --
----------------------
subtype DHR12L1_DACC1DHR_Field is HAL.UInt12;
-- channel1 12-bit left aligned data holding register
type DHR12L1_Register is record
-- unspecified
Reserved_0_3 : HAL.UInt4 := 16#0#;
-- DAC channel1 12-bit left-aligned data
DACC1DHR : DHR12L1_DACC1DHR_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.Short := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DHR12L1_Register use record
Reserved_0_3 at 0 range 0 .. 3;
DACC1DHR at 0 range 4 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
---------------------
-- DHR8R1_Register --
---------------------
subtype DHR8R1_DACC1DHR_Field is HAL.Byte;
-- channel1 8-bit right aligned data holding register
type DHR8R1_Register is record
-- DAC channel1 8-bit right-aligned data
DACC1DHR : DHR8R1_DACC1DHR_Field := 16#0#;
-- unspecified
Reserved_8_31 : HAL.UInt24 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DHR8R1_Register use record
DACC1DHR at 0 range 0 .. 7;
Reserved_8_31 at 0 range 8 .. 31;
end record;
----------------------
-- DHR12R2_Register --
----------------------
subtype DHR12R2_DACC2DHR_Field is HAL.UInt12;
-- channel2 12-bit right aligned data holding register
type DHR12R2_Register is record
-- DAC channel2 12-bit right-aligned data
DACC2DHR : DHR12R2_DACC2DHR_Field := 16#0#;
-- unspecified
Reserved_12_31 : HAL.UInt20 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DHR12R2_Register use record
DACC2DHR at 0 range 0 .. 11;
Reserved_12_31 at 0 range 12 .. 31;
end record;
----------------------
-- DHR12L2_Register --
----------------------
subtype DHR12L2_DACC2DHR_Field is HAL.UInt12;
-- channel2 12-bit left aligned data holding register
type DHR12L2_Register is record
-- unspecified
Reserved_0_3 : HAL.UInt4 := 16#0#;
-- DAC channel2 12-bit left-aligned data
DACC2DHR : DHR12L2_DACC2DHR_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.Short := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DHR12L2_Register use record
Reserved_0_3 at 0 range 0 .. 3;
DACC2DHR at 0 range 4 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
---------------------
-- DHR8R2_Register --
---------------------
subtype DHR8R2_DACC2DHR_Field is HAL.Byte;
-- channel2 8-bit right-aligned data holding register
type DHR8R2_Register is record
-- DAC channel2 8-bit right-aligned data
DACC2DHR : DHR8R2_DACC2DHR_Field := 16#0#;
-- unspecified
Reserved_8_31 : HAL.UInt24 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DHR8R2_Register use record
DACC2DHR at 0 range 0 .. 7;
Reserved_8_31 at 0 range 8 .. 31;
end record;
----------------------
-- DHR12RD_Register --
----------------------
subtype DHR12RD_DACC1DHR_Field is HAL.UInt12;
subtype DHR12RD_DACC2DHR_Field is HAL.UInt12;
-- Dual DAC 12-bit right-aligned data holding register
type DHR12RD_Register is record
-- DAC channel1 12-bit right-aligned data
DACC1DHR : DHR12RD_DACC1DHR_Field := 16#0#;
-- unspecified
Reserved_12_15 : HAL.UInt4 := 16#0#;
-- DAC channel2 12-bit right-aligned data
DACC2DHR : DHR12RD_DACC2DHR_Field := 16#0#;
-- unspecified
Reserved_28_31 : HAL.UInt4 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DHR12RD_Register use record
DACC1DHR at 0 range 0 .. 11;
Reserved_12_15 at 0 range 12 .. 15;
DACC2DHR at 0 range 16 .. 27;
Reserved_28_31 at 0 range 28 .. 31;
end record;
----------------------
-- DHR12LD_Register --
----------------------
subtype DHR12LD_DACC1DHR_Field is HAL.UInt12;
subtype DHR12LD_DACC2DHR_Field is HAL.UInt12;
-- DUAL DAC 12-bit left aligned data holding register
type DHR12LD_Register is record
-- unspecified
Reserved_0_3 : HAL.UInt4 := 16#0#;
-- DAC channel1 12-bit left-aligned data
DACC1DHR : DHR12LD_DACC1DHR_Field := 16#0#;
-- unspecified
Reserved_16_19 : HAL.UInt4 := 16#0#;
-- DAC channel2 12-bit left-aligned data
DACC2DHR : DHR12LD_DACC2DHR_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DHR12LD_Register use record
Reserved_0_3 at 0 range 0 .. 3;
DACC1DHR at 0 range 4 .. 15;
Reserved_16_19 at 0 range 16 .. 19;
DACC2DHR at 0 range 20 .. 31;
end record;
---------------------
-- DHR8RD_Register --
---------------------
subtype DHR8RD_DACC1DHR_Field is HAL.Byte;
subtype DHR8RD_DACC2DHR_Field is HAL.Byte;
-- DUAL DAC 8-bit right aligned data holding register
type DHR8RD_Register is record
-- DAC channel1 8-bit right-aligned data
DACC1DHR : DHR8RD_DACC1DHR_Field := 16#0#;
-- DAC channel2 8-bit right-aligned data
DACC2DHR : DHR8RD_DACC2DHR_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.Short := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DHR8RD_Register use record
DACC1DHR at 0 range 0 .. 7;
DACC2DHR at 0 range 8 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
-------------------
-- DOR1_Register --
-------------------
subtype DOR1_DACC1DOR_Field is HAL.UInt12;
-- channel1 data output register
type DOR1_Register is record
-- Read-only. DAC channel1 data output
DACC1DOR : DOR1_DACC1DOR_Field;
-- unspecified
Reserved_12_31 : HAL.UInt20;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DOR1_Register use record
DACC1DOR at 0 range 0 .. 11;
Reserved_12_31 at 0 range 12 .. 31;
end record;
-------------------
-- DOR2_Register --
-------------------
subtype DOR2_DACC2DOR_Field is HAL.UInt12;
-- channel2 data output register
type DOR2_Register is record
-- Read-only. DAC channel2 data output
DACC2DOR : DOR2_DACC2DOR_Field;
-- unspecified
Reserved_12_31 : HAL.UInt20;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DOR2_Register use record
DACC2DOR at 0 range 0 .. 11;
Reserved_12_31 at 0 range 12 .. 31;
end record;
-----------------
-- SR_Register --
-----------------
-- status register
type SR_Register is record
-- unspecified
Reserved_0_12 : HAL.UInt13 := 16#0#;
-- DAC channel1 DMA underrun flag
DMAUDR1 : Boolean := False;
-- unspecified
Reserved_14_28 : HAL.UInt15 := 16#0#;
-- DAC channel2 DMA underrun flag
DMAUDR2 : Boolean := False;
-- unspecified
Reserved_30_31 : HAL.UInt2 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for SR_Register use record
Reserved_0_12 at 0 range 0 .. 12;
DMAUDR1 at 0 range 13 .. 13;
Reserved_14_28 at 0 range 14 .. 28;
DMAUDR2 at 0 range 29 .. 29;
Reserved_30_31 at 0 range 30 .. 31;
end record;
-----------------
-- Peripherals --
-----------------
-- Digital-to-analog converter
type DAC_Peripheral is record
-- control register
CR : CR_Register;
-- software trigger register
SWTRIGR : SWTRIGR_Register;
-- channel1 12-bit right-aligned data holding register
DHR12R1 : DHR12R1_Register;
-- channel1 12-bit left aligned data holding register
DHR12L1 : DHR12L1_Register;
-- channel1 8-bit right aligned data holding register
DHR8R1 : DHR8R1_Register;
-- channel2 12-bit right aligned data holding register
DHR12R2 : DHR12R2_Register;
-- channel2 12-bit left aligned data holding register
DHR12L2 : DHR12L2_Register;
-- channel2 8-bit right-aligned data holding register
DHR8R2 : DHR8R2_Register;
-- Dual DAC 12-bit right-aligned data holding register
DHR12RD : DHR12RD_Register;
-- DUAL DAC 12-bit left aligned data holding register
DHR12LD : DHR12LD_Register;
-- DUAL DAC 8-bit right aligned data holding register
DHR8RD : DHR8RD_Register;
-- channel1 data output register
DOR1 : DOR1_Register;
-- channel2 data output register
DOR2 : DOR2_Register;
-- status register
SR : SR_Register;
end record
with Volatile;
for DAC_Peripheral use record
CR at 0 range 0 .. 31;
SWTRIGR at 4 range 0 .. 31;
DHR12R1 at 8 range 0 .. 31;
DHR12L1 at 12 range 0 .. 31;
DHR8R1 at 16 range 0 .. 31;
DHR12R2 at 20 range 0 .. 31;
DHR12L2 at 24 range 0 .. 31;
DHR8R2 at 28 range 0 .. 31;
DHR12RD at 32 range 0 .. 31;
DHR12LD at 36 range 0 .. 31;
DHR8RD at 40 range 0 .. 31;
DOR1 at 44 range 0 .. 31;
DOR2 at 48 range 0 .. 31;
SR at 52 range 0 .. 31;
end record;
-- Digital-to-analog converter
DAC_Periph : aliased DAC_Peripheral
with Import, Address => DAC_Base;
end STM32_SVD.DAC;
|
------------------------------------------------------------------------------
-- --
-- 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 file is generated, don't edit it.
------------------------------------------------------------------------------
with League.Holders.Generic_Enumerations;
package AMF.UML.Holders.Expansion_Kinds is
new League.Holders.Generic_Enumerations
(AMF.UML.UML_Expansion_Kind);
pragma Preelaborate (AMF.UML.Holders.Expansion_Kinds);
|
------------------------------------------------------------------------------
-- --
-- GNAT RUNTIME COMPONENTS --
-- --
-- S Y S T E M . V E R S I O N _ C O N T R O L --
-- --
-- B o d y --
-- --
-- $Revision$
-- --
-- Copyright (C) 1992,1993,1994,1995 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. --
-- --
-- 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. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with System.Unsigned_Types; use System.Unsigned_Types;
package body System.Version_Control is
------------------------
-- Get_Version_String --
------------------------
function Get_Version_String
(V : System.Unsigned_Types.Unsigned)
return Version_String
is
S : Version_String;
D : Unsigned := V;
H : array (Unsigned range 0 .. 15) of Character := "0123456789abcdef";
begin
for J in reverse 1 .. 8 loop
S (J) := H (D mod 16);
D := D / 16;
end loop;
return S;
end Get_Version_String;
end System.Version_Control;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- G N A T . H E A P _ S O R T _ A --
-- --
-- S p e c --
-- --
-- Copyright (C) 1995-2010, 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. --
-- --
-- --
-- --
-- --
-- --
-- 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. --
-- --
------------------------------------------------------------------------------
-- Heapsort using access to procedure parameters
-- This package provides a heap sort routine that works with access to
-- subprogram parameters, so that it can be used with different types with
-- shared sorting code. It is considered obsoleted by GNAT.Heap_Sort which
-- offers a similar routine with a more convenient interface.
-- This heapsort algorithm uses approximately N*log(N) compares in the
-- worst case and is in place with no additional storage required. See
-- the body for exact details of the algorithm used.
pragma Compiler_Unit;
package GNAT.Heap_Sort_A is
pragma Preelaborate;
-- The data to be sorted is assumed to be indexed by integer values from
-- 1 to N, where N is the number of items to be sorted. In addition, the
-- index value zero is used for a temporary location used during the sort.
type Move_Procedure is access procedure (From : Natural; To : Natural);
-- A pointer to a procedure that moves the data item with index From to
-- the data item with index To. An index value of zero is used for moves
-- from and to the single temporary location used by the sort.
type Lt_Function is access function (Op1, Op2 : Natural) return Boolean;
-- A pointer to a function that compares two items and returns True if
-- the item with index Op1 is less than the item with index Op2, and False
-- if the Op1 item is greater than or equal to the Op2 item.
procedure Sort (N : Natural; Move : Move_Procedure; Lt : Lt_Function);
-- This procedures sorts items in the range from 1 to N into ascending
-- order making calls to Lt to do required comparisons, and Move to move
-- items around. Note that, as described above, both Move and Lt use a
-- single temporary location with index value zero. This sort is not
-- stable, i.e. the order of equal elements in the input is not preserved.
end GNAT.Heap_Sort_A;
|
-- Copyright 2013-2015 Free Software Foundation, Inc.
--
-- This program 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 3 of the License, or
-- (at your option) any later version.
--
-- This program 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 program. If not, see <http://www.gnu.org/licenses/>.
with IO; use IO;
package body Callee is
procedure Increment (Val : in out Float; Msg: String) is
begin
if Val > 200.0 then
Put_Line (Msg);
end if;
Val := Val + 1.0;
end Increment;
end Callee;
|
------------------------------------------------------------------------------
-- --
-- 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_00FC is
pragma Preelaborate;
Group_00FC : aliased constant Core_Second_Stage
:= (16#5E# .. 16#63# => -- FC5E .. FC63
(Other_Letter, Neutral,
Other, A_Letter, O_Letter, Alphabetic,
(Alphabetic
| Grapheme_Base
| ID_Continue
| ID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
others =>
(Other_Letter, Neutral,
Other, A_Letter, O_Letter, Alphabetic,
(Alphabetic
| Grapheme_Base
| ID_Continue
| ID_Start
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)));
end Matreshka.Internals.Unicode.Ucd.Core_00FC;
|
--
-- (c) Copyright 1993,1994,1995,1996 Silicon Graphics, Inc.
-- ALL RIGHTS RESERVED
-- Permission to use, copy, modify, and distribute this software for
-- any purpose and without fee is hereby granted, provided that the above
-- copyright notice appear in all copies and that both the copyright notice
-- and this permission notice appear in supporting documentation, and that
-- the name of Silicon Graphics, Inc. not be used in advertising
-- or publicity pertaining to distribution of the software without specific,
-- written prior permission.
--
-- THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
-- AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
-- INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
-- FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-- GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
-- SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
-- KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
-- LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
-- THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN
-- ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
-- ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
-- POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
--
-- US Government Users Restricted Rights
-- Use, duplication, or disclosure by the Government is subject to
-- restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
-- (c)(1)(ii) of the Rights in Technical Data and Computer Software
-- clause at DFARS 252.227-7013 and/or in similar or successor
-- clauses in the FAR or the DOD or NASA FAR Supplement.
-- Unpublished-- rights reserved under the copyright laws of the
-- United States. Contractor/manufacturer is Silicon Graphics,
-- Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311.
--
-- OpenGL(TM) is a trademark of Silicon Graphics, Inc.
--
with GL; use GL;
with Glut; use Glut;
package body Scenebamb_Procs is
procedure DoInit is
ambient : array (0 .. 3) of aliased GLfloat :=
(0.0, 0.0, 1.0, 1.0);
diffuse : array (0 .. 3) of aliased GLfloat :=
(1.0, 1.0, 1.0, 1.0);
specular : array (0 .. 3) of aliased GLfloat :=
(1.0, 1.0, 1.0, 1.0);
position : array (0 .. 3) of aliased GLfloat :=
(1.0, 1.0, 1.0, 0.0);
begin
glLightfv (GL_LIGHT0, GL_AMBIENT, ambient (0)'access);
glLightfv (GL_LIGHT0, GL_DIFFUSE, diffuse (0)'access);
glLightfv (GL_LIGHT0, GL_POSITION, position (0)'access);
glEnable (GL_LIGHTING);
glEnable (GL_LIGHT0);
glEnable (GL_DEPTH_TEST);
glDepthFunc (GL_LESS);
end DoInit;
procedure DoDisplay is
begin
-- 16#4100# = GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT
glClear (GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT);
glPushMatrix;
glRotatef (20.0, 1.0, 0.0, 0.0);
glPushMatrix;
glTranslatef (-0.75, 0.5, 0.0);
glRotatef (90.0, 1.0, 0.0, 0.0);
glutSolidTorus (0.275, 0.85, 15, 15);
glPopMatrix;
glPushMatrix;
glTranslatef (-0.75, -0.5, 0.0);
glRotatef (270.0, 1.0, 0.0, 0.0);
glutSolidCone (1.0, 2.0, 15, 15);
glPopMatrix;
glPushMatrix;
glTranslatef (0.75, 0.0, -1.0);
glutSolidSphere (1.0, 15, 15);
glPopMatrix;
glPopMatrix;
glFlush;
end DoDisplay;
procedure ReshapeCallback (w : Integer; h : Integer) is
begin
glViewport (0, 0, GLsizei(w), GLsizei(h));
glMatrixMode (GL_PROJECTION);
glLoadIdentity;
if w <= h then
glOrtho (-2.5, 2.5, GLdouble (-2.5*Float (h)/ Float (w)),
GLdouble (2.5*Float (h)/Float (w)), -10.0, 10.0);
else
glOrtho (GLdouble (-2.5*Float (w)/Float (h)),
GLdouble (2.5*Float (w)/Float (h)), -2.5, 2.5, -10.0, 10.0);
end if;
glMatrixMode (GL_MODELVIEW);
end ReshapeCallback;
end Scenebamb_Procs;
|
------------------------------------------------------------------------------
-- A d a r u n - t i m e s p e c i f i c a t i o n --
-- ASIS implementation for Gela project, a portable Ada compiler --
-- http://gela.ada-ru.org --
-- - - - - - - - - - - - - - - - --
-- Read copyright and license at the end of ada.ads file --
------------------------------------------------------------------------------
-- $Revision: 209 $ $Date: 2013-11-30 21:03:24 +0200 (Сб., 30 нояб. 2013) $
with Ada.Strings.Wide_Wide_Maps;
package Ada.Strings.Wide_Wide_Bounded is
pragma Preelaborate (Wide_Wide_Bounded);
generic
Max : Positive; -- Maximum length of a Bounded_Wide_Wide_String
package Generic_Bounded_Length is
Max_Length : constant Positive := Max;
type Bounded_Wide_Wide_String is private;
Null_Bounded_Wide_Wide_String : constant Bounded_Wide_Wide_String;
subtype Length_Range is Natural range 0 .. Max_Length;
function Length (Source : in Bounded_Wide_Wide_String)
return Length_Range;
-- Conversion, Concatenation, and Selection functions
function To_Bounded_Wide_Wide_String (Source : in Wide_Wide_String;
Drop : in Truncation := Error)
return Bounded_Wide_Wide_String;
function To_Wide_Wide_String (Source : in Bounded_Wide_Wide_String)
return Wide_Wide_String;
procedure Set_Bounded_Wide_Wide_String
(Target : out Bounded_Wide_Wide_String;
Source : in Wide_Wide_String;
Drop : in Truncation := Error);
function Append (Left, Right : in Bounded_Wide_Wide_String;
Drop : in Truncation := Error)
return Bounded_Wide_Wide_String;
function Append (Left : in Bounded_Wide_Wide_String;
Right : in Wide_Wide_String;
Drop : in Truncation := Error)
return Bounded_Wide_Wide_String;
function Append (Left : in Wide_Wide_String;
Right : in Bounded_Wide_Wide_String;
Drop : in Truncation := Error)
return Bounded_Wide_Wide_String;
function Append (Left : in Bounded_Wide_Wide_String;
Right : in Wide_Wide_Character;
Drop : in Truncation := Error)
return Bounded_Wide_Wide_String;
function Append (Left : in Wide_Wide_Character;
Right : in Bounded_Wide_Wide_String;
Drop : in Truncation := Error)
return Bounded_Wide_Wide_String;
procedure Append (Source : in out Bounded_Wide_Wide_String;
New_Item : in Bounded_Wide_Wide_String;
Drop : in Truncation := Error);
procedure Append (Source : in out Bounded_Wide_Wide_String;
New_Item : in Wide_Wide_String;
Drop : in Truncation := Error);
procedure Append (Source : in out Bounded_Wide_Wide_String;
New_Item : in Wide_Wide_Character;
Drop : in Truncation := Error);
function "&" (Left, Right : in Bounded_Wide_Wide_String)
return Bounded_Wide_Wide_String;
function "&" (Left : in Bounded_Wide_Wide_String;
Right : in Wide_Wide_String)
return Bounded_Wide_Wide_String;
function "&" (Left : in Wide_Wide_String;
Right : in Bounded_Wide_Wide_String)
return Bounded_Wide_Wide_String;
function "&" (Left : in Bounded_Wide_Wide_String;
Right : in Wide_Wide_Character)
return Bounded_Wide_Wide_String;
function "&" (Left : in Wide_Wide_Character;
Right : in Bounded_Wide_Wide_String)
return Bounded_Wide_Wide_String;
function Element (Source : in Bounded_Wide_Wide_String;
Index : in Positive)
return Wide_Wide_Character;
procedure Replace_Element (Source : in out Bounded_Wide_Wide_String;
Index : in Positive;
By : in Wide_Wide_Character);
function Slice (Source : in Bounded_Wide_Wide_String;
Low : in Positive;
High : in Natural)
return Wide_Wide_String;
function Bounded_Slice
(Source : in Bounded_Wide_Wide_String;
Low : in Positive;
High : in Natural)
return Bounded_Wide_Wide_String;
procedure Bounded_Slice
(Source : in Bounded_Wide_Wide_String;
Target : out Bounded_Wide_Wide_String;
Low : in Positive;
High : in Natural);
function "=" (Left, Right : in Bounded_Wide_Wide_String) return Boolean;
function "=" (Left : in Bounded_Wide_Wide_String;
Right : in Wide_Wide_String)
return Boolean;
function "=" (Left : in Wide_Wide_String;
Right : in Bounded_Wide_Wide_String)
return Boolean;
function "<" (Left, Right : in Bounded_Wide_Wide_String) return Boolean;
function "<" (Left : in Bounded_Wide_Wide_String;
Right : in Wide_Wide_String)
return Boolean;
function "<" (Left : in Wide_Wide_String;
Right : in Bounded_Wide_Wide_String)
return Boolean;
function "<=" (Left, Right : in Bounded_Wide_Wide_String) return Boolean;
function "<=" (Left : in Bounded_Wide_Wide_String;
Right : in Wide_Wide_String)
return Boolean;
function "<=" (Left : in Wide_Wide_String;
Right : in Bounded_Wide_Wide_String)
return Boolean;
function ">" (Left, Right : in Bounded_Wide_Wide_String) return Boolean;
function ">" (Left : in Bounded_Wide_Wide_String;
Right : in Wide_Wide_String)
return Boolean;
function ">" (Left : in Wide_Wide_String;
Right : in Bounded_Wide_Wide_String)
return Boolean;
function ">=" (Left, Right : in Bounded_Wide_Wide_String) return Boolean;
function ">=" (Left : in Bounded_Wide_Wide_String;
Right : in Wide_Wide_String)
return Boolean;
function ">=" (Left : in Wide_Wide_String;
Right : in Bounded_Wide_Wide_String)
return Boolean;
-- Search subprograms
function Index (Source : in Bounded_Wide_Wide_String;
Pattern : in Wide_Wide_String;
From : in Positive;
Going : in Direction := Forward;
Mapping : in Wide_Wide_Maps.Wide_Wide_Character_Mapping
:= Wide_Wide_Maps.Identity)
return Natural;
function Index
(Source : in Bounded_Wide_Wide_String;
Pattern : in Wide_Wide_String;
From : in Positive;
Going : in Direction := Forward;
Mapping : in Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function)
return Natural;
function Index (Source : in Bounded_Wide_Wide_String;
Pattern : in Wide_Wide_String;
Going : in Direction := Forward;
Mapping : in Wide_Wide_Maps.Wide_Wide_Character_Mapping
:= Wide_Wide_Maps.Identity)
return Natural;
function Index
(Source : in Bounded_Wide_Wide_String;
Pattern : in Wide_Wide_String;
Going : in Direction := Forward;
Mapping : in Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function)
return Natural;
function Index (Source : in Bounded_Wide_Wide_String;
Set : in Wide_Wide_Maps.Wide_Wide_Character_Set;
From : in Positive;
Test : in Membership := Inside;
Going : in Direction := Forward)
return Natural;
function Index (Source : in Bounded_Wide_Wide_String;
Set : in Wide_Wide_Maps.Wide_Wide_Character_Set;
Test : in Membership := Inside;
Going : in Direction := Forward)
return Natural;
function Index_Non_Blank (Source : in Bounded_Wide_Wide_String;
From : in Positive;
Going : in Direction := Forward)
return Natural;
function Index_Non_Blank (Source : in Bounded_Wide_Wide_String;
Going : in Direction := Forward)
return Natural;
function Count (Source : in Bounded_Wide_Wide_String;
Pattern : in Wide_Wide_String;
Mapping : in Wide_Wide_Maps.Wide_Wide_Character_Mapping
:= Wide_Wide_Maps.Identity)
return Natural;
function Count
(Source : in Bounded_Wide_Wide_String;
Pattern : in Wide_Wide_String;
Mapping : in Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function)
return Natural;
function Count (Source : in Bounded_Wide_Wide_String;
Set : in Wide_Wide_Maps.Wide_Wide_Character_Set)
return Natural;
procedure Find_Token (Source : in Bounded_Wide_Wide_String;
Set : in Wide_Wide_Maps.Wide_Wide_Character_Set;
Test : in Membership;
First : out Positive;
Last : out Natural);
-- Wide_Wide_String translation subprograms
function Translate
(Source : in Bounded_Wide_Wide_String;
Mapping : in Wide_Wide_Maps.Wide_Wide_Character_Mapping)
return Bounded_Wide_Wide_String;
procedure Translate
(Source : in out Bounded_Wide_Wide_String;
Mapping : in Wide_Wide_Maps.Wide_Wide_Character_Mapping);
function Translate
(Source : in Bounded_Wide_Wide_String;
Mapping : in Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function)
return Bounded_Wide_Wide_String;
procedure Translate
(Source : in out Bounded_Wide_Wide_String;
Mapping : in Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function);
-- Wide_Wide_String transformation subprograms
function Replace_Slice (Source : in Bounded_Wide_Wide_String;
Low : in Positive;
High : in Natural;
By : in Wide_Wide_String;
Drop : in Truncation := Error)
return Bounded_Wide_Wide_String;
procedure Replace_Slice (Source : in out Bounded_Wide_Wide_String;
Low : in Positive;
High : in Natural;
By : in Wide_Wide_String;
Drop : in Truncation := Error);
function Insert (Source : in Bounded_Wide_Wide_String;
Before : in Positive;
New_Item : in Wide_Wide_String;
Drop : in Truncation := Error)
return Bounded_Wide_Wide_String;
procedure Insert (Source : in out Bounded_Wide_Wide_String;
Before : in Positive;
New_Item : in Wide_Wide_String;
Drop : in Truncation := Error);
function Overwrite (Source : in Bounded_Wide_Wide_String;
Position : in Positive;
New_Item : in Wide_Wide_String;
Drop : in Truncation := Error)
return Bounded_Wide_Wide_String;
procedure Overwrite (Source : in out Bounded_Wide_Wide_String;
Position : in Positive;
New_Item : in Wide_Wide_String;
Drop : in Truncation := Error);
function Delete (Source : in Bounded_Wide_Wide_String;
From : in Positive;
Through : in Natural)
return Bounded_Wide_Wide_String;
procedure Delete (Source : in out Bounded_Wide_Wide_String;
From : in Positive;
Through : in Natural);
-- Wide_Wide_String selector subprograms
function Trim (Source : in Bounded_Wide_Wide_String;
Side : in Trim_End)
return Bounded_Wide_Wide_String;
procedure Trim (Source : in out Bounded_Wide_Wide_String;
Side : in Trim_End);
function Trim (Source : in Bounded_Wide_Wide_String;
Left : in Wide_Wide_Maps.Wide_Wide_Character_Set;
Right : in Wide_Wide_Maps.Wide_Wide_Character_Set)
return Bounded_Wide_Wide_String;
procedure Trim (Source : in out Bounded_Wide_Wide_String;
Left : in Wide_Wide_Maps.Wide_Wide_Character_Set;
Right : in Wide_Wide_Maps.Wide_Wide_Character_Set);
function Head (Source : in Bounded_Wide_Wide_String;
Count : in Natural;
Pad : in Wide_Wide_Character := Wide_Wide_Space;
Drop : in Truncation := Error)
return Bounded_Wide_Wide_String;
procedure Head (Source : in out Bounded_Wide_Wide_String;
Count : in Natural;
Pad : in Wide_Wide_Character := Wide_Wide_Space;
Drop : in Truncation := Error);
function Tail (Source : in Bounded_Wide_Wide_String;
Count : in Natural;
Pad : in Wide_Wide_Character := Wide_Wide_Space;
Drop : in Truncation := Error)
return Bounded_Wide_Wide_String;
procedure Tail (Source : in out Bounded_Wide_Wide_String;
Count : in Natural;
Pad : in Wide_Wide_Character := Wide_Wide_Space;
Drop : in Truncation := Error);
-- Wide_Wide_String constructor subprograms
function "*" (Left : in Natural;
Right : in Wide_Wide_Character)
return Bounded_Wide_Wide_String;
function "*" (Left : in Natural;
Right : in Wide_Wide_String)
return Bounded_Wide_Wide_String;
function "*" (Left : in Natural;
Right : in Bounded_Wide_Wide_String)
return Bounded_Wide_Wide_String;
function Replicate (Count : in Natural;
Item : in Wide_Wide_Character;
Drop : in Truncation := Error)
return Bounded_Wide_Wide_String;
function Replicate (Count : in Natural;
Item : in Wide_Wide_String;
Drop : in Truncation := Error)
return Bounded_Wide_Wide_String;
function Replicate (Count : in Natural;
Item : in Bounded_Wide_Wide_String;
Drop : in Truncation := Error)
return Bounded_Wide_Wide_String;
private
type Bounded_Wide_Wide_String is null record;
Null_Bounded_Wide_Wide_String : constant Bounded_Wide_Wide_String
:= (null record);
end Generic_Bounded_Length;
end Ada.Strings.Wide_Wide_Bounded;
|
with GA_Maths;
with Multivectors; use Multivectors;
package E3GA_Utilities is
-- special exp() for 3D bivectors
function exp (BV : Bivector) return Rotor;
-- special log() for 3D rotors
function log (R : Rotor) return Bivector;
procedure Print_Rotor (Name : String; R : Rotor);
-- procedure Print_Vector (Name : String; aVector : E2GA.Vector);
-- procedure Print_Vector (Name : String; aVector : E3GA.Vector);
procedure Rotor_To_Matrix (R : Rotor; M : out GA_Maths.GA_Matrix3);
function Rotor_Vector_To_Vector (From_V1, To_V2 : Multivectors.M_Vector)
return Rotor;
end E3GA_Utilities;
|
with Ada.Unchecked_Conversion;
with Interfaces.C.Strings;
with ZMQ_Constants;
package body ZMQ is
use type System.Address;
use type Interfaces.C.int;
use type Interfaces.C.size_t;
use type Interfaces.C.unsigned;
-- Conversion
function Convert is new Ada.Unchecked_Conversion
(Source => Interfaces.C.size_t,
Target => Interfaces.C.unsigned_long);
function Convert is new Ada.Unchecked_Conversion
(Source => System.Address,
Target => Interfaces.C.Strings.chars_ptr);
function Convert is new Ada.Unchecked_Conversion
(Source => Interfaces.C.Strings.chars_ptr,
Target => System.Address);
function Convert (Value : Context_Type'Class) return System.Address is (Value.Impl_Ptr);
function Convert (Value : Context_Option_Names) return Interfaces.C.int
is
begin
case Value is
when ZMQ_IO_THREADS => return ZMQ_Constants.ZMQ_IO_THREADS;
when ZMQ_MAX_SOCKETS => return ZMQ_Constants.ZMQ_MAX_SOCKETS;
when ZMQ_IPV6 => return ZMQ_Constants.ZMQ_IPV6;
end case;
end Convert;
function Convert (Value : Socket_Type'Class) return System.Address is (Value.Impl_Ptr);
function Convert (Value : Socket_Types) return Interfaces.C.int
is
begin
case Value is
when ZMQ_PAIR => return ZMQ_Constants.ZMQ_PAIR;
when ZMQ_PUB => return ZMQ_Constants.ZMQ_PUB;
when ZMQ_SUB => return ZMQ_Constants.ZMQ_SUB;
when ZMQ_REQ => return ZMQ_Constants.ZMQ_REQ;
when ZMQ_REP => return ZMQ_Constants.ZMQ_REP;
when ZMQ_DEALER => return ZMQ_Constants.ZMQ_DEALER;
when ZMQ_ROUTER => return ZMQ_Constants.ZMQ_ROUTER;
when ZMQ_PULL => return ZMQ_Constants.ZMQ_PULL;
when ZMQ_PUSH => return ZMQ_Constants.ZMQ_PUSH;
when ZMQ_XPUB => return ZMQ_Constants.ZMQ_XPUB;
when ZMQ_XSUB => return ZMQ_Constants.ZMQ_XSUB;
when ZMQ_STREAM => return ZMQ_Constants.ZMQ_STREAM;
end case;
end Convert;
function Convert (Value : Socket_Option_Names) return Interfaces.C.int
is
begin
case Value is
when ZMQ_AFFINITY => return ZMQ_Constants.ZMQ_AFFINITY;
when ZMQ_IDENTITY => return ZMQ_Constants.ZMQ_IDENTITY;
when ZMQ_SUBSCRIBE => return ZMQ_Constants.ZMQ_SUBSCRIBE;
when ZMQ_UNSUBSCRIBE => return ZMQ_Constants.ZMQ_UNSUBSCRIBE;
when ZMQ_RATE => return ZMQ_Constants.ZMQ_RATE;
when ZMQ_RECOVERY_IVL => return ZMQ_Constants.ZMQ_RECOVERY_IVL;
when ZMQ_SNDBUF => return ZMQ_Constants.ZMQ_SNDBUF;
when ZMQ_RCVBUF => return ZMQ_Constants.ZMQ_RCVBUF;
when ZMQ_RCVMORE => return ZMQ_Constants.ZMQ_RCVMORE;
when ZMQ_FD => return ZMQ_Constants.ZMQ_FD;
when ZMQ_EVENTS => return ZMQ_Constants.ZMQ_EVENTS;
when ZMQ_TYPE => return ZMQ_Constants.ZMQ_TYPE;
when ZMQ_LINGER => return ZMQ_Constants.ZMQ_LINGER;
when ZMQ_RECONNECT_IVL => return ZMQ_Constants.ZMQ_RECONNECT_IVL;
when ZMQ_BACKLOG => return ZMQ_Constants.ZMQ_BACKLOG;
when ZMQ_RECONNECT_IVL_MAX => return ZMQ_Constants.ZMQ_RECONNECT_IVL_MAX;
when ZMQ_MAXMSGSIZE => return ZMQ_Constants.ZMQ_MAXMSGSIZE;
when ZMQ_SNDHWM => return ZMQ_Constants.ZMQ_SNDHWM;
when ZMQ_RCVHWM => return ZMQ_Constants.ZMQ_RCVHWM;
when ZMQ_MULTICAST_HOPS => return ZMQ_Constants.ZMQ_MULTICAST_HOPS;
when ZMQ_RCVTIMEO => return ZMQ_Constants.ZMQ_RCVTIMEO;
when ZMQ_SNDTIMEO => return ZMQ_Constants.ZMQ_SNDTIMEO;
when ZMQ_LAST_ENDPOINT => return ZMQ_Constants.ZMQ_LAST_ENDPOINT;
when ZMQ_ROUTER_MANDATORY => return ZMQ_Constants.ZMQ_ROUTER_MANDATORY;
when ZMQ_TCP_KEEPALIVE => return ZMQ_Constants.ZMQ_TCP_KEEPALIVE;
when ZMQ_TCP_KEEPALIVE_CNT => return ZMQ_Constants.ZMQ_TCP_KEEPALIVE_CNT;
when ZMQ_TCP_KEEPALIVE_IDLE => return ZMQ_Constants.ZMQ_TCP_KEEPALIVE_IDLE;
when ZMQ_TCP_KEEPALIVE_INTVL => return ZMQ_Constants.ZMQ_TCP_KEEPALIVE_INTVL;
when ZMQ_TCP_ACCEPT_FILTER => return ZMQ_Constants.ZMQ_TCP_ACCEPT_FILTER;
when ZMQ_IMMEDIATE => return ZMQ_Constants.ZMQ_IMMEDIATE;
when ZMQ_XPUB_VERBOSE => return ZMQ_Constants.ZMQ_XPUB_VERBOSE;
when ZMQ_ROUTER_RAW => return ZMQ_Constants.ZMQ_ROUTER_RAW;
when ZMQ_IPV6 => return ZMQ_Constants.ZMQ_IPV6;
when ZMQ_MECHANISM => return ZMQ_Constants.ZMQ_MECHANISM;
when ZMQ_PLAIN_SERVER => return ZMQ_Constants.ZMQ_PLAIN_SERVER;
when ZMQ_PLAIN_USERNAME => return ZMQ_Constants.ZMQ_PLAIN_USERNAME;
when ZMQ_PLAIN_PASSWORD => return ZMQ_Constants.ZMQ_PLAIN_PASSWORD;
when ZMQ_CURVE_SERVER => return ZMQ_Constants.ZMQ_CURVE_SERVER;
when ZMQ_CURVE_PUBLICKEY => return ZMQ_Constants.ZMQ_CURVE_PUBLICKEY;
when ZMQ_CURVE_SECRETKEY => return ZMQ_Constants.ZMQ_CURVE_SECRETKEY;
when ZMQ_CURVE_SERVERKEY => return ZMQ_Constants.ZMQ_CURVE_SERVERKEY;
when ZMQ_PROBE_ROUTER => return ZMQ_Constants.ZMQ_PROBE_ROUTER;
when ZMQ_REQ_CORRELATE => return ZMQ_Constants.ZMQ_REQ_CORRELATE;
when ZMQ_REQ_RELAXED => return ZMQ_Constants.ZMQ_REQ_RELAXED;
when ZMQ_CONFLATE => return ZMQ_Constants.ZMQ_CONFLATE;
when ZMQ_ZAP_DOMAIN => return ZMQ_Constants.ZMQ_ZAP_DOMAIN;
end case;
end Convert;
procedure Version (Major : out Natural; Minor : out Natural; Patch : out Natural)
is
c_major : aliased Interfaces.C.int;
c_minor : aliased Interfaces.C.int;
c_patch : aliased Interfaces.C.int;
begin
ZMQ_Thin.zmq_version (c_major'Access, c_minor'Access, c_patch'Access);
Major := Natural (c_major);
Minor := Natural (c_minor);
Patch := Natural (c_patch);
end Version;
function Errno return Integer
is
begin
return Integer (ZMQ_Thin.zmq_errno);
end Errno;
function Strerror (Err_Num : Integer) return String
is
c_errnum : constant Interfaces.C.int := Interfaces.C.int (Err_Num);
c_strerror : constant Interfaces.C.Strings.chars_ptr := ZMQ_Thin.zmq_strerror (c_errnum);
begin
return Interfaces.C.Strings.Value (c_strerror);
end Strerror;
procedure Raise_Errno is
Error_Number : constant Integer := Errno;
begin
raise ZMQ_Error with "[" & Error_Number'Img & "] " & Strerror (Error_Number);
end Raise_Errno;
pragma No_Return (Raise_Errno);
-- Context
-- ------------------------------------------------------------------------
overriding procedure Initialize (Cxt : in out Context_Type) is
begin
Setup (Cxt);
end Initialize;
overriding procedure Finalize (Cxt : in out Context_Type) is
begin
if Cxt.Impl_Ptr /= System.Null_Address then
Term (Cxt);
end if;
end Finalize;
procedure Setup (Cxt : in out Context_Type) is
c_cxt : constant System.Address := ZMQ_Thin.zmq_ctx_new;
begin
if c_cxt /= System.Null_Address then
Cxt.Impl_Ptr := c_cxt;
else
Raise_Errno;
end if;
end Setup;
function New_Context return Context_Type
is
begin
return Cxt : Context_Type do
Setup (Cxt);
end return;
end New_Context;
procedure Term (Context : in out Context_Type)
is
c_res : Interfaces.C.int;
begin
c_res := ZMQ_Thin.zmq_ctx_term (Convert (Context));
if c_res = 0 then
Context.Impl_Ptr := System.Null_Address;
return;
else
Raise_Errno;
end if;
end Term;
procedure Shutdown (Context : Context_Type)
is
c_res : Interfaces.C.int;
begin
c_res := ZMQ_Thin.zmq_ctx_shutdown (Convert (Context));
if c_res = 0 then
return;
else
Raise_Errno;
end if;
end Shutdown;
procedure Set (Context : Context_Type; Name : Context_Option_Names; Value : Natural)
is
c_res : Interfaces.C.int;
begin
c_res := ZMQ_Thin.zmq_ctx_set (Convert (Context), Convert (Name), Interfaces.C.int (Value));
if c_res = 0 then
return;
else
Raise_Errno;
end if;
end Set;
function Get (Context : Context_Type; Name : Context_Option_Names) return Natural
is
c_res : Interfaces.C.int;
begin
c_res := ZMQ_Thin.zmq_ctx_get (Convert (Context), Convert (Name));
if c_res >= 0 then
return Natural (c_res);
else
Raise_Errno;
end if;
end Get;
function New_Socket (Context : Context_Type; Instance_Type : Socket_Types) return Socket_Type'Class
is
begin
return S : Socket_Type do
Setup (S, Context, Instance_Type);
end return;
end New_Socket;
-- Message_Type
-- ------------------------------------------------------------------------
overriding procedure Initialize (M : in out Message_Type) is
begin
M.Msg_Internals.u_u := (others => 0);
Setup (M);
end Initialize;
overriding procedure Finalize (M : in out Message_Type) is
begin
Close (M);
end Finalize;
procedure Setup (M : in out Message_Type; Size : Integer := 0)
is
c_size : constant Interfaces.C.size_t := Interfaces.C.size_t (Size);
c_res : Interfaces.C.int;
begin
c_res := ZMQ_Thin.zmq_msg_init_size (M.Msg_Internals'Access, c_size);
if c_res = 0 then
return;
else
Raise_Errno;
end if;
end Setup;
function Create_Message (Size : Integer := 0) return Message_Type
is
begin
return M : Message_Type do
M.Msg_Internals.u_u := (others => 0);
Setup (M, Size);
end return;
end Create_Message;
procedure Setup (M : in out Message_Type; Value : String)
is
c_size : constant Interfaces.C.size_t := Interfaces.C.size_t (Value'Length);
c_res : Interfaces.C.int;
c_data : System.Address;
begin
c_res := ZMQ_Thin.zmq_msg_init_size (M.Msg_Internals'Access, c_size);
if c_res /= 0 then
Raise_Errno;
end if;
c_data := ZMQ_Thin.zmq_msg_data (M.Msg_Internals'Access);
if c_data = System.Null_Address then
Raise_Errno;
end if;
declare
Data_String : String (1 .. Value'Length);
for Data_String'Address use c_data;
begin
Data_String (1 .. Value'Length) := Value (Value'First .. Value'Last);
end;
end Setup;
function Create_Message (Value : String) return Message_Type
is
begin
return M : Message_Type do
M.Msg_Internals.u_u := (others => 0);
Setup (M, Value);
end return;
end Create_Message;
procedure Send (M : in out Message_Type; S : Socket_Type'Class; Do_Not_Wait : Boolean := False; Send_More : Boolean := False)
is
Expected_Length : constant Integer := Size (M);
c_flags : Interfaces.C.unsigned := 0;
c_res : Interfaces.C.int;
begin
c_flags := 0;
if Do_Not_Wait then
c_flags := c_flags or ZMQ_Constants.ZMQ_DONTWAIT;
end if;
if Send_More then
c_flags := c_flags or ZMQ_Constants.ZMQ_SNDMORE;
end if;
c_res := ZMQ_Thin.zmq_msg_send (M.Msg_Internals'Access, Convert (S), c_flags);
if c_res >= 0 and then Interfaces.C.int (Expected_Length) = c_res then
return;
elsif c_res >= 0 then
raise ZMQ_Error with "Entire Message_Type wasn't sent.";
else
Raise_Errno;
end if;
end Send;
procedure Recv (M : in out Message_Type; S : Socket_Type'Class; Do_Not_Wait : Boolean := False)
is
c_flags : Interfaces.C.unsigned := 0;
c_res : Interfaces.C.int;
begin
c_flags := 0;
if Do_Not_Wait then
c_flags := c_flags or ZMQ_Constants.ZMQ_DONTWAIT;
end if;
c_res := ZMQ_Thin.zmq_msg_recv (M.Msg_Internals'Access, Convert (S), c_flags);
if c_res >= 0 then
return;
else
Raise_Errno;
end if;
end Recv;
procedure Close (M : in out Message_Type)
is
c_res : Interfaces.C.int;
begin
c_res := ZMQ_Thin.zmq_msg_close (M.Msg_Internals'Access);
if c_res = 0 then
return;
else
Raise_Errno;
end if;
end Close;
procedure Move (Dest : in out Message_Type; Src : in out Message_Type)
is
c_res : Interfaces.C.int;
begin
c_res := ZMQ_Thin.zmq_msg_move (Dest.Msg_Internals'Access, Src.Msg_Internals'Access);
if c_res = 0 then
return;
else
Raise_Errno;
end if;
end Move;
procedure Copy (Dest : in out Message_Type; Src : in out Message_Type)
is
c_res : Interfaces.C.int;
begin
c_res := ZMQ_Thin.zmq_msg_copy (Dest.Msg_Internals'Access, Src.Msg_Internals'Access);
if c_res = 0 then
return;
else
Raise_Errno;
end if;
end Copy;
-- TODO date returning other types..
function Data (M : in out Message_Type) return String
is
c_data : System.Address;
c_size : Interfaces.C.size_t;
begin
c_data := ZMQ_Thin.zmq_msg_data (M.Msg_Internals'Access);
if c_data = System.Null_Address then
Raise_Errno;
end if;
c_size := ZMQ_Thin.zmq_msg_size (M.Msg_Internals'Access);
declare
Result_Str : String (1 .. Integer (c_size));
for Result_Str'Address use c_data;
begin
return Result_Str;
end;
end Data;
function Size (M : in out Message_Type) return Natural
is
c_res : Interfaces.C.size_t;
begin
c_res := ZMQ_Thin.zmq_msg_size (M.Msg_Internals'Access);
return Natural (c_res);
end Size;
function More (M : in out Message_Type) return Boolean
is
c_res : Interfaces.C.int;
begin
c_res := ZMQ_Thin.zmq_msg_more (M.Msg_Internals'Access);
return c_res /= 0;
end More;
function Src_FD (M : in out Message_Type) return Integer
is
c_res : Interfaces.C.int;
begin
c_res := ZMQ_Thin.zmq_msg_get (M.Msg_Internals'Access, ZMQ_Constants.ZMQ_SRCFD);
if c_res >= 0 then
return Integer (c_res);
else
Raise_Errno;
end if;
end Src_FD;
function Shared (M : in out Message_Type) return Boolean
is
c_res : Interfaces.C.int;
begin
c_res := ZMQ_Thin.zmq_msg_get (M.Msg_Internals'Access, ZMQ_Constants.ZMQ_SHARED);
if c_res >= 0 then
return c_res /= 0;
else
Raise_Errno;
end if;
end Shared;
-- Socket
-- ------------------------------------------------------------------------
overriding procedure Initialize (S : in out Socket_Type)
is
begin
S.Impl_Ptr := System.Null_Address;
end Initialize;
overriding procedure Finalize (S : in out Socket_Type)
is
begin
if S.Impl_Ptr /= System.Null_Address then
Close (S);
end if;
end Finalize;
procedure Setup (S : in out Socket_Type; Context : Context_Type'Class; Instance_Type : Socket_Types)
is
c_socket : System.Address;
begin
c_socket := ZMQ_Thin.zmq_socket (Convert (Context), Convert (Instance_Type));
if c_socket /= System.Null_Address then
S.Impl_Ptr := c_socket;
else
Raise_Errno;
end if;
end Setup;
procedure Close (S : in out Socket_Type)
is
c_res : Interfaces.C.int;
begin
c_res := ZMQ_Thin.zmq_close (Convert (S));
if c_res = 0 then
S.Impl_Ptr := System.Null_Address;
return;
else
Raise_Errno;
end if;
end Close;
procedure Set_Sock_Opt (S : Socket_Type; Option : Socket_Option_Names; Option_Value : Integer)
is
c_optval : constant Interfaces.C.int := Interfaces.C.int (Option_Value);
c_optval_ptr : constant System.Address := c_optval'Address;
c_optvallen : constant Interfaces.C.size_t := c_optval'Size / 8;
c_res : Interfaces.C.int;
begin
c_res := ZMQ_Thin.zmq_setsockopt (Convert (S), Convert (Option), c_optval_ptr, c_optvallen);
if c_res = 0 then
return;
else
Raise_Errno;
end if;
end Set_Sock_Opt;
procedure Set_Sock_Opt (S : Socket_Type; Option : Socket_Option_Names; Option_Value : Long_Long_Integer)
is
c_optval : constant Interfaces.C.long := Interfaces.C.long (Option_Value);
c_optval_ptr : constant System.Address := c_optval'Address;
c_optvallen : constant Interfaces.C.size_t := c_optval'Size / 8;
c_res : Interfaces.C.int;
begin
c_res := ZMQ_Thin.zmq_setsockopt (Convert (S), Convert (Option), c_optval_ptr, c_optvallen);
if c_res = 0 then
return;
else
Raise_Errno;
end if;
end Set_Sock_Opt;
procedure Set_Sock_Opt (S : Socket_Type; Option : Socket_Option_Names; Option_Value : String)
is
c_optval : Interfaces.C.Strings.chars_ptr := Interfaces.C.Strings.New_String (Option_Value);
c_optvallen : constant Interfaces.C.size_t := Option_Value'Length;
c_res : Interfaces.C.int;
begin
c_res := ZMQ_Thin.zmq_setsockopt (Convert (S), Convert (Option), Convert (c_optval), c_optvallen);
Interfaces.C.Strings.Free (c_optval);
if c_res = 0 then
return;
else
Raise_Errno;
end if;
end Set_Sock_Opt;
-- function zmq_getsockopt (s : System.Address; option : Interfaces.C.int; optval : System.Address; optvallen : access Interfaces.C.size_t) return Interfaces.C.int;
function Get_Sock_Opt (S : Socket_Type; Option : Socket_Option_Names) return Integer
is
c_optval : aliased Interfaces.C.int;
c_optval_ptr : constant System.Address := c_optval'Address;
c_optvallen : aliased Interfaces.C.size_t := c_optval'Size / 8;
c_res : Interfaces.C.int;
begin
c_res := ZMQ_Thin.zmq_getsockopt (Convert (S), Convert (Option), c_optval_ptr, c_optvallen'Access);
if c_res = 0 then
return Integer (c_optval);
else
Raise_Errno;
end if;
end Get_Sock_Opt;
function Get_Sock_Opt (S : Socket_Type; Option : Socket_Option_Names) return Long_Long_Integer
is
c_optval : aliased Interfaces.C.long;
c_optval_ptr : constant System.Address := c_optval'Address;
c_optvallen : aliased Interfaces.C.size_t := c_optval'Size / 8;
c_res : Interfaces.C.int;
begin
c_res := ZMQ_Thin.zmq_getsockopt (Convert (S), Convert (Option), c_optval_ptr, c_optvallen'Access);
if c_res = 0 then
return Long_Long_Integer (c_optval);
else
Raise_Errno;
end if;
end Get_Sock_Opt;
function Get_Sock_Opt (S : Socket_Type; Option : Socket_Option_Names) return String
is
Buf_Size : constant Integer := 4096;
c_optval : aliased String (1.. Buf_Size);
c_optval_ptr : constant System.Address := c_optval'Address;
c_optvallen : aliased Interfaces.C.size_t := c_optval'Length;
c_res : Interfaces.C.int;
begin
c_res := ZMQ_Thin.zmq_getsockopt (Convert (S), Convert (Option), c_optval_ptr, c_optvallen'Access);
if c_optvallen >= Interfaces.C.size_t (Buf_Size) then
raise ZMQ_Error with "string option too large.";
end if;
if c_res = 0 then
return c_optval (1 .. Integer (c_optvallen));
else
Raise_Errno;
end if;
end Get_Sock_Opt;
procedure Bind (S : Socket_Type; Address : String)
is
c_addr : Interfaces.C.Strings.chars_ptr := Interfaces.C.Strings.New_String (Address);
c_res : Interfaces.C.int;
begin
c_res := ZMQ_Thin.zmq_bind (Convert (S), c_addr);
Interfaces.C.Strings.Free (c_addr);
if c_res = 0 then
return;
else
Raise_Errno;
end if;
end Bind;
procedure Connect (S : Socket_Type; Address : String)
is
c_addr : Interfaces.C.Strings.chars_ptr := Interfaces.C.Strings.New_String (Address);
c_res : Interfaces.C.int;
begin
c_res := ZMQ_Thin.zmq_connect (Convert (S), c_addr);
Interfaces.C.Strings.Free (c_addr);
if c_res = 0 then
return;
else
Raise_Errno;
end if;
end Connect;
procedure Unbind (S : Socket_Type; Address : String)
is
c_addr : Interfaces.C.Strings.chars_ptr := Interfaces.C.Strings.New_String (Address);
c_res : Interfaces.C.int;
begin
c_res := ZMQ_Thin.zmq_unbind (Convert (S), c_addr);
Interfaces.C.Strings.Free (c_addr);
if c_res = 0 then
return;
else
Raise_Errno;
end if;
end Unbind;
procedure Disconnect (S : Socket_Type; Address : String)
is
c_addr : Interfaces.C.Strings.chars_ptr := Interfaces.C.Strings.New_String (Address);
c_res : Interfaces.C.int;
begin
c_res := ZMQ_Thin.zmq_disconnect (Convert (S), c_addr);
Interfaces.C.Strings.Free (c_addr);
if c_res = 0 then
return;
else
Raise_Errno;
end if;
end Disconnect;
-- TODO: What about an array of flags?
procedure Send (S : Socket_Type; Buf : String; Do_Not_Wait : Boolean := False; Send_More : Boolean := False)
is
c_buf : constant System.Address := Buf'Address; -- TODO is this okay? or ptr to first item better?
c_len : constant Interfaces.C.size_t := Buf'Length;
c_flags : Interfaces.C.unsigned := 0;
c_res : Interfaces.C.int;
begin
c_flags := 0;
if Do_Not_Wait then
c_flags := c_flags or ZMQ_Constants.ZMQ_DONTWAIT;
end if;
if Send_More then
c_flags := c_flags or ZMQ_Constants.ZMQ_SNDMORE;
end if;
c_res := ZMQ_Thin.zmq_send (Convert (S), c_buf, c_len, c_flags);
if c_res >= 0 and then Interfaces.C.size_t (c_res) = c_len then
return;
elsif c_res >= 0 then
raise ZMQ_Error with "Entire Message_Type wasn't sent.";
else
Raise_Errno;
end if;
end Send;
function Recv (S : Socket_Type; Do_Not_Wait : Boolean := False) return String
is
Buf_Size : constant Integer := 32*1024;
Buf : String (1 .. Buf_Size);
c_buf : constant System.Address := Buf (Buf'First)'Address;
c_len : constant Interfaces.C.size_t := Buf'Length;
c_flags : Interfaces.C.unsigned := 0;
c_res : Interfaces.C.int;
begin
c_flags := 0;
if Do_Not_Wait then
c_flags := c_flags or ZMQ_Constants.ZMQ_DONTWAIT;
end if;
c_res := ZMQ_Thin.zmq_recv (Convert (S), c_buf, c_len, c_flags);
if c_res >= 0 and then c_res /= Interfaces.C.int (Buf_Size) then
return Buf (1 .. Integer (c_res));
elsif c_res >= 0 then
raise ZMQ_Error with "Received Message_Type was truncated.";
else
Raise_Errno;
end if;
end Recv;
-- Polling
-- ------------------------------------------------------------------------
procedure Setup (PE : in out Poll_Item_Type; S : Socket_Type'Class; Poll_In : Boolean := False; Poll_Out : Boolean := False)
is
begin
PE.S_Impl_Ptr := S.Impl_Ptr;
PE.FD := 0;
PE.Poll_In := Poll_In;
PE.Poll_Out := Poll_Out;
PE.Poll_Error := False;
PE.Result_In := False;
PE.Result_Out := False;
PE.Result_Error := False;
end Setup;
function New_Poll_Item (S : Socket_Type'Class; Poll_In : Boolean := False; Poll_Out : Boolean := False) return Poll_Item_Type
is
begin
return PE : Poll_Item_Type do
Setup (PE, S, Poll_In, Poll_Out);
end return;
end New_Poll_Item;
procedure Setup (PE : in out Poll_Item_Type; FD : Integer; Poll_In : Boolean := False; Poll_Out : Boolean := False; Poll_Error : Boolean := False)
is
begin
PE.S_Impl_Ptr := System.Null_Address;
PE.FD := Interfaces.C.int (FD);
PE.Poll_In := Poll_In;
PE.Poll_Out := Poll_Out;
PE.Poll_Error := Poll_Error;
PE.Result_In := False;
PE.Result_Out := False;
PE.Result_Error := False;
end Setup;
function New_Poll_Item (FD : Integer; Poll_In : Boolean := False; Poll_Out : Boolean := False; Poll_Error : Boolean := False) return Poll_Item_Type
is
begin
return PE : Poll_Item_Type do
Setup (PE, FD, Poll_In, Poll_Out, Poll_Error);
end return;
end New_Poll_Item;
function Is_Readable (PE : Poll_Item_Type) return Boolean is (PE.Result_In);
function Is_Writable (PE : Poll_Item_Type) return Boolean is (PE.Result_Out);
function Has_Error (PE : Poll_Item_Type) return Boolean is (PE.Result_Error);
type C_Poll_Item_Array is array (Natural range <>) of aliased ZMQ_Thin.zmq_pollitem_t;
pragma Convention (C, C_Poll_Item_Array);
function Convert (PE : Poll_Item_Type) return ZMQ_Thin.zmq_pollitem_t
is
begin
return Result : ZMQ_Thin.zmq_pollitem_t do
Result.socket := PE.S_Impl_Ptr;
Result.fd := PE.FD;
Result.events := 0;
if PE.Poll_In then
Result.events := Interfaces.C.short (Interfaces.C.unsigned (Result.events) or ZMQ_Constants.ZMQ_POLLIN);
end if;
if PE.Poll_Out then
Result.events := Interfaces.C.short (Interfaces.C.unsigned (Result.events) or ZMQ_Constants.ZMQ_POLLOUT);
end if;
if PE.Poll_Error then
Result.events := Interfaces.C.short (Interfaces.C.unsigned (Result.events) or ZMQ_Constants.ZMQ_POLLERR);
end if;
end return;
end Convert;
procedure Transfer_Result (Dest : in out Poll_Item_Type; Src : ZMQ_Thin.zmq_pollitem_t)
is
begin
Dest.Result_In := (Interfaces.C.unsigned(Src.revents) and ZMQ_Constants.ZMQ_POLLIN) /= 0;
Dest.Result_Out := (Interfaces.C.unsigned(Src.revents) and ZMQ_Constants.ZMQ_POLLOUT) /= 0;
end;
function Poll (Entries : in out Poll_Item_Array_Type; Timeout : Long_Long_Integer := -1) return Natural
is
c_items : aliased C_Poll_Item_Array (Entries'First .. Entries'Last);
c_items_ptr : constant access ZMQ_Thin.zmq_pollitem_t := c_items (c_items'First)'Access;
c_nitems : constant Interfaces.C.int := Interfaces.C.int (Entries'Length);
c_timeout : constant Interfaces.C.long := Interfaces.C.long (Timeout);
c_res : Interfaces.C.int;
begin
for I in Entries'Range loop
c_items (I) := Convert (Entries (I));
end loop;
c_res := ZMQ_Thin.zmq_poll (c_items_ptr, c_nitems, c_timeout);
if c_res < 0 then
Raise_Errno;
end if;
for I in Entries'Range loop
Transfer_Result (Entries (I), c_items (I));
end loop;
return Natural (c_res);
end Poll;
procedure Poll (Entries : in out Poll_Item_Array_Type; Timeout : Long_Long_Integer := -1)
is
Dummy : Natural;
begin
Dummy := Poll (Entries, Timeout);
end Poll;
-- Proxy
-- ------------------------------------------------------------------------
-- TODO, merge these? using the optional parameters?
procedure Proxy (Frontend : Socket_Type'Class; Backend : Socket_Type'Class; Capture : Socket_Type'Class := ZMQ.No_Socket)
is
c_res : Interfaces.C.int;
begin
c_res := ZMQ_Thin.zmq_proxy (Convert (Frontend), Convert (Backend), Convert (Capture));
-- proxy is expected to always return an error.
if c_res = 0 then
return;
else
Raise_Errno;
end if;
end Proxy;
procedure Proxy_Steerable (Frontend : Socket_Type'Class; Backend : Socket_Type'Class; Capture : Socket_Type'Class := ZMQ.No_Socket; Control : Socket_Type'Class := ZMQ.No_Socket)
is
c_res : Interfaces.C.int;
begin
c_res := ZMQ_Thin.zmq_proxy_steerable (Convert (Frontend), Convert (Backend), Convert (Capture), Convert (Control));
-- proxy_steerable can terminate cleanly
if c_res = 0 then
return;
else
Raise_Errno;
end if;
end Proxy_Steerable;
end ZMQ;
|
-------------------------------------------------------------------------------
-- Copyright (c) 2017 Daniel King
--
-- 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 Ada.Real_Time; use Ada.Real_Time;
with Configurations;
with DecaDriver.Core; use DecaDriver.Core;
with DecaDriver.Tx;
with DW1000.Driver; use DW1000.Driver;
with DW1000.Types; use DW1000.Types;
with EVB1000_Tx_Power;
with EVB1000.LCD;
procedure Transmitter
is
Inter_Frame_Period : constant
array (DW1000.Driver.Data_Rates)
of Ada.Real_Time.Time_Span :=
(Data_Rate_110k => Microseconds (15_625), -- 64 pkt/s
Data_Rate_850k => Microseconds (5_000), -- 200 pkt/s
Data_Rate_6M8 => Microseconds (4_000)); -- 250 pkt/s
Tx_Packet : DW1000.Types.Byte_Array (1 .. 125);
Current_Config : DecaDriver.Core.Configuration_Type;
New_Config : DecaDriver.Core.Configuration_Type;
Next_Tx_Time : Ada.Real_Time.Time;
procedure Update_LCD
is
Channel_Number_Str : constant array (Positive range 1 .. 7) of Character :=
(1 => '1',
2 => '2',
3 => '3',
4 => '4',
5 => '5',
6 => '6',
7 => '7');
PRF_Str : constant array (PRF_Type) of String (1 .. 5) :=
(PRF_16MHz => "16MHz",
PRF_64MHz => "64MHz");
Data_Rate_Str : constant array (Data_Rates) of String (1 .. 4) :=
(Data_Rate_110k => "110K",
Data_Rate_850k => "850K",
Data_Rate_6M8 => "6.8M");
begin
EVB1000.LCD.Driver.Put
(Text_1 => ("Ch" & Channel_Number_Str (Positive (Current_Config.Channel))
& ' ' & PRF_Str (Current_Config.PRF)
& ' ' & Data_Rate_Str (Current_Config.Data_Rate)),
Text_2 => "");
end Update_LCD;
procedure Build_Packet
is
begin
Tx_Packet (1) := Bits_8 (Data_Rates'Pos (Current_Config.Data_Rate));
Tx_Packet (2) := Bits_8 (PRF_Type'Pos (Current_Config.PRF));
Tx_Packet (3) := Bits_8 (Current_Config.Channel);
Tx_Packet (4 .. 5) := (others => 0);
for I in 1 .. (Tx_Packet'Length / 5) loop
Tx_Packet (I * 5 .. I * 5 + 4) := Tx_Packet (1 .. 5);
end loop;
end Build_Packet;
begin
Configurations.Get_Switches_Config (Current_Config);
DecaDriver.Core.Driver.Initialize
(Load_Antenna_Delay => False,
Load_XTAL_Trim => True,
Load_UCode_From_ROM => True);
DecaDriver.Core.Driver.Configure (Current_Config);
DecaDriver.Tx.Transmitter.Configure_Tx_Power
(EVB1000_Tx_Power.Manual_Tx_Power_Table
(Positive (Current_Config.Channel), Current_Config.PRF));
DecaDriver.Core.Driver.Configure_LEDs
(Tx_LED_Enable => True,
Rx_LED_Enable => False,
Rx_OK_LED_Enable => False,
SFD_LED_Enable => False,
Test_Flash => True);
Update_LCD;
Next_Tx_Time := Ada.Real_Time.Clock;
loop
-- Check if the configuration has changed.
Configurations.Get_Switches_Config (New_Config);
if New_Config /= Current_Config then
-- Configuration has changed. Use new configuration.
Current_Config := New_Config;
DecaDriver.Core.Driver.Configure (New_Config);
DecaDriver.Tx.Transmitter.Configure_Tx_Power
(EVB1000_Tx_Power.Manual_Tx_Power_Table
(Positive (Current_Config.Channel), Current_Config.PRF));
Build_Packet;
DecaDriver.Tx.Transmitter.Set_Tx_Data
(Data => Tx_Packet,
Offset => 0);
Update_LCD;
end if;
delay until Next_Tx_Time;
Next_Tx_Time := Next_Tx_Time + Inter_Frame_Period (Current_Config.Data_Rate);
DecaDriver.Tx.Transmitter.Set_Tx_Frame_Length
(Length => Tx_Packet'Length + 2, -- 2 extra bytes for FCS
Offset => 0);
DecaDriver.Tx.Transmitter.Start_Tx_Immediate (Rx_After_Tx => False,
Auto_Append_FCS => True);
DecaDriver.Tx.Transmitter.Wait_For_Tx_Complete;
end loop;
end Transmitter;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- G N A T . T I M E _ S T A M P --
-- --
-- B o d y --
-- --
-- Copyright (C) 2008-2014, 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. --
-- --
------------------------------------------------------------------------------
with Interfaces.C; use Interfaces.C;
package body GNAT.Time_Stamp is
subtype time_stamp is char_array (0 .. 22);
type time_stamp_ptr is access all time_stamp;
-- The desired ISO 8601 string format has exactly 22 characters. We add
-- one additional character for '\0'. The indexing starts from zero to
-- accommodate the C layout.
procedure gnat_current_time_string (Value : time_stamp_ptr);
pragma Import (C, gnat_current_time_string, "__gnat_current_time_string");
------------------
-- Current_Time --
------------------
function Current_Time return String is
Result : aliased time_stamp;
begin
gnat_current_time_string (Result'Unchecked_Access);
Result (22) := nul;
return To_Ada (Result);
end Current_Time;
end GNAT.Time_Stamp;
|
-----------------------------------------------------------------------
-- asf-views-facelets -- Facelets representation and management
-- Copyright (C) 2009, 2010, 2011, 2014, 2015, 2017, 2019, 2020 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.Exceptions;
with Ada.Directories;
with Ada.Unchecked_Deallocation;
with ASF.Views.Nodes.Reader;
with Input_Sources.File;
with Sax.Readers;
with EL.Contexts.Default;
with Util.Files;
with Util.Log.Loggers;
package body ASF.Views.Facelets is
use ASF.Views.Nodes;
use Util.Log;
-- The logger
Log : constant Loggers.Logger := Loggers.Create ("ASF.Views.Facelets");
procedure Free is
new Ada.Unchecked_Deallocation (Object => ASF.Views.File_Info,
Name => ASF.Views.File_Info_Access);
procedure Free is
new Ada.Unchecked_Deallocation (Object => Facelet_Type,
Name => Facelet_Access);
-- Find in the factory for the facelet with the given name.
procedure Find (Factory : in out Facelet_Factory;
Name : in String;
Result : out Facelet);
-- Load the facelet node tree by reading the facelet XHTML file.
procedure Load (Factory : in out Facelet_Factory;
Name : in String;
Context : in ASF.Contexts.Facelets.Facelet_Context'Class;
Result : out Facelet);
-- Update the factory to store the facelet node tree
procedure Update (Factory : in out Facelet_Factory;
Facelet : in Facelet_Access);
-- ------------------------------
-- Returns True if the facelet is null/empty.
-- ------------------------------
function Is_Null (F : Facelet) return Boolean is
begin
return F.Facelet = null;
end Is_Null;
-- ------------------------------
-- Get the facelet identified by the given name. If the facelet is already
-- loaded, the cached value is returned. The facelet file is searched in
-- a set of directories configured in the facelet factory.
-- ------------------------------
procedure Find_Facelet (Factory : in out Facelet_Factory;
Name : in String;
Context : in ASF.Contexts.Facelets.Facelet_Context'Class;
Result : out Facelet) is
begin
Log.Debug ("Find facelet {0}", Name);
Find (Factory, Name, Result);
if Result.Facelet = null then
Load (Factory, Name, Context, Result);
if Result.Facelet = null then
return;
end if;
Update (Factory, Result.Facelet);
end if;
end Find_Facelet;
-- ------------------------------
-- Create the component tree from the facelet view.
-- ------------------------------
procedure Build_View (View : in Facelet;
Context : in out ASF.Contexts.Facelets.Facelet_Context'Class;
Root : in ASF.Components.Base.UIComponent_Access) is
Old : Unbounded_String;
begin
if View.Facelet /= null then
Context.Set_Relative_Path (Path => ASF.Views.Relative_Path (View.Facelet.File.all),
Previous => Old);
View.Facelet.Root.Build_Children (Parent => Root, Context => Context);
Context.Set_Relative_Path (Path => Old);
end if;
end Build_View;
-- ------------------------------
-- Initialize the facelet factory.
-- Set the search directories for facelet files.
-- Set the ignore white space configuration when reading XHTML files.
-- Set the ignore empty lines configuration when reading XHTML files.
-- Set the escape unknown tags configuration when reading XHTML files.
-- ------------------------------
procedure Initialize (Factory : in out Facelet_Factory;
Components : access ASF.Factory.Component_Factory;
Paths : in String;
Ignore_White_Spaces : in Boolean;
Ignore_Empty_Lines : in Boolean;
Escape_Unknown_Tags : in Boolean) is
begin
Log.Info ("Set facelet search directory to: '{0}'", Paths);
Factory.Factory := Components;
Factory.Paths := To_Unbounded_String (Paths);
Factory.Ignore_White_Spaces := Ignore_White_Spaces;
Factory.Ignore_Empty_Lines := Ignore_Empty_Lines;
Factory.Escape_Unknown_Tags := Escape_Unknown_Tags;
end Initialize;
-- ------------------------------
-- Find the facelet file in one of the facelet directories.
-- Returns the path to be used for reading the facelet file.
-- ------------------------------
function Find_Facelet_Path (Factory : Facelet_Factory;
Name : String) return String is
begin
return Util.Files.Find_File_Path (Name, To_String (Factory.Paths));
end Find_Facelet_Path;
-- ------------------------------
-- Find in the factory for the facelet with the given name.
-- ------------------------------
procedure Find (Factory : in out Facelet_Factory;
Name : in String;
Result : out Facelet) is
use Ada.Directories;
use Ada.Calendar;
begin
Result.Facelet := Factory.Map.Find (Name);
if Result.Facelet /= null then
declare
Now : constant Ada.Calendar.Time := Ada.Calendar.Clock;
begin
if Result.Facelet.Check_Time < Now then
if Modification_Time (Result.Facelet.File.Path) > Result.Facelet.Modify_Time then
Log.Info ("Ignoring cache because file '{0}' was modified",
Result.Facelet.File.Path);
Result.Facelet := null;
else
Result.Facelet.Check_Time := Now + CHECK_FILE_DELAY;
end if;
end if;
end;
end if;
end Find;
-- ------------------------------
-- Load the facelet node tree by reading the facelet XHTML file.
-- ------------------------------
procedure Load (Factory : in out Facelet_Factory;
Name : in String;
Context : in ASF.Contexts.Facelets.Facelet_Context'Class;
Result : out Facelet) is
Path : constant String := Find_Facelet_Path (Factory, Name);
begin
if Path = "" or else not Ada.Directories.Exists (Path) then
Log.Warn ("Cannot read '{0}': file does not exist", Path);
Result.Facelet := null;
return;
end if;
declare
use type Ada.Calendar.Time;
Pos : constant Integer := Path'Last - Name'Length + 1;
Now : constant Ada.Calendar.Time := Ada.Calendar.Clock + CHECK_FILE_DELAY;
File : File_Info_Access;
Reader : ASF.Views.Nodes.Reader.Xhtml_Reader;
Read : Input_Sources.File.File_Input;
Mtime : Ada.Calendar.Time;
Ctx : aliased EL.Contexts.Default.Default_Context;
Root : ASF.Views.Nodes.Tag_Node_Access;
begin
if Pos <= Path'First then
File := Create_File_Info (Path, Path'First);
else
File := Create_File_Info (Path, Pos);
end if;
Log.Info ("Loading facelet: '{0}' - {1} - {2}", Path, Name,
Natural'Image (File.Relative_Pos));
Ctx.Set_Function_Mapper (Context.Get_Function_Mapper);
Mtime := Ada.Directories.Modification_Time (Path);
Input_Sources.File.Open (Path, Read);
-- If True, xmlns:* attributes will be reported in Start_Element
Reader.Set_Feature (Sax.Readers.Namespace_Prefixes_Feature, False);
Reader.Set_Feature (Sax.Readers.Validation_Feature, False);
Reader.Set_Ignore_White_Spaces (Factory.Ignore_White_Spaces);
Reader.Set_Escape_Unknown_Tags (Factory.Escape_Unknown_Tags);
Reader.Set_Ignore_Empty_Lines (Factory.Ignore_Empty_Lines);
begin
Reader.Parse (File, Read, Factory.Factory, Ctx'Unchecked_Access);
exception
when ASF.Views.Nodes.Reader.Parsing_Error =>
Free (File);
when E : others =>
Free (File);
Log.Error ("Unexpected exception while reading: '{0}': {1}: {2}", Path,
Ada.Exceptions.Exception_Name (E), Ada.Exceptions.Exception_Message (E));
end;
Root := Reader.Get_Root;
if File = null then
if Root /= null then
Root.Delete;
end if;
Result.Facelet := null;
else
Result.Facelet := new Facelet_Type '(Util.Refs.Ref_Entity with
Len => Name'Length,
Root => Root,
File => File,
Modify_Time => Mtime,
Check_Time => Now,
Name => Name);
end if;
Input_Sources.File.Close (Read);
end;
end Load;
-- ------------------------------
-- Update the factory to store the facelet node tree
-- ------------------------------
procedure Update (Factory : in out Facelet_Factory;
Facelet : in Facelet_Access) is
begin
Factory.Map.Insert (Facelet);
end Update;
-- ------------------------------
-- Clear the facelet cache
-- ------------------------------
procedure Clear_Cache (Factory : in out Facelet_Factory) is
begin
Log.Info ("Clearing facelet cache");
Factory.Map.Clear;
end Clear_Cache;
protected body Facelet_Cache is
-- ------------------------------
-- Find the facelet entry associated with the given name.
-- ------------------------------
function Find (Name : in String) return Facelet_Access is
Key : aliased Facelet_Type := Facelet_Type '(Util.Refs.Ref_Entity with
Len => Name'Length,
Name => Name,
others => <>);
Pos : constant Facelet_Sets.Cursor := Map.Find (Key'Unchecked_Access);
begin
if Facelet_Sets.Has_Element (Pos) then
return Element (Pos);
else
return null;
end if;
end Find;
-- ------------------------------
-- Insert or replace the facelet entry associated with the given name.
-- ------------------------------
procedure Insert (Facelet : in Facelet_Access) is
begin
Map.Include (Facelet);
end Insert;
-- ------------------------------
-- Clear the cache.
-- ------------------------------
procedure Clear is
begin
loop
declare
Pos : Facelet_Sets.Cursor := Map.First;
Node : Facelet_Access;
begin
exit when not Has_Element (Pos);
Node := Element (Pos);
Map.Delete (Pos);
Free (Node.File);
ASF.Views.Nodes.Destroy (Node.Root);
Free (Node);
end;
end loop;
end Clear;
end Facelet_Cache;
-- ------------------------------
-- Free the storage held by the factory cache.
-- ------------------------------
overriding
procedure Finalize (Factory : in out Facelet_Factory) is
begin
Factory.Clear_Cache;
end Finalize;
end ASF.Views.Facelets;
|
-----------------------------------------------------------------------
-- util-beans-lists -- Beans implementing the List interface
-- Copyright (C) 2013 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.
-----------------------------------------------------------------------
package Util.Beans.Lists is
pragma Preelaborate;
end Util.Beans.Lists;
|
pragma Ada_2005;
pragma Style_Checks (Off);
with Interfaces.C; use Interfaces.C;
with System;
with stddef_h;
with SDL_stdinc_h;
with Interfaces.C.Strings;
package SDL_rwops_h is
SDL_RWOPS_UNKNOWN : constant := 0; -- ..\SDL2_tmp\SDL_rwops.h:42
SDL_RWOPS_WINFILE : constant := 1; -- ..\SDL2_tmp\SDL_rwops.h:43
SDL_RWOPS_STDFILE : constant := 2; -- ..\SDL2_tmp\SDL_rwops.h:44
SDL_RWOPS_JNIFILE : constant := 3; -- ..\SDL2_tmp\SDL_rwops.h:45
SDL_RWOPS_MEMORY : constant := 4; -- ..\SDL2_tmp\SDL_rwops.h:46
SDL_RWOPS_MEMORY_RO : constant := 5; -- ..\SDL2_tmp\SDL_rwops.h:47
RW_SEEK_SET : constant := 0; -- ..\SDL2_tmp\SDL_rwops.h:174
RW_SEEK_CUR : constant := 1; -- ..\SDL2_tmp\SDL_rwops.h:175
RW_SEEK_END : constant := 2; -- ..\SDL2_tmp\SDL_rwops.h:176
-- arg-macro: function SDL_RWsize (ctx)
-- return ctx).size(ctx;
-- arg-macro: function SDL_RWseek (ctx, offset, whence)
-- return ctx).seek(ctx, offset, whence;
-- arg-macro: function SDL_RWtell (ctx)
-- return ctx).seek(ctx, 0, RW_SEEK_CUR;
-- arg-macro: function SDL_RWread (ctx, ptr, size, n)
-- return ctx).read(ctx, ptr, size, n;
-- arg-macro: function SDL_RWwrite (ctx, ptr, size, n)
-- return ctx).write(ctx, ptr, size, n;
-- arg-macro: function SDL_RWclose (ctx)
-- return ctx).close(ctx;
-- arg-macro: procedure SDL_LoadFile (file, datasize)
-- SDL_LoadFile_RW(SDL_RWFromFile(file, "rb"), datasize, 1)
-- Simple DirectMedia Layer
-- Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
-- This software is provided 'as-is', without any express or implied
-- warranty. In no event will the authors be held liable for any damages
-- arising from the use of this software.
-- Permission is granted to anyone to use this software for any purpose,
-- including commercial applications, and to alter it and redistribute it
-- freely, subject to the following restrictions:
-- 1. The origin of this software must not be misrepresented; you must not
-- claim that you wrote the original software. If you use this software
-- in a product, an acknowledgment in the product documentation would be
-- appreciated but is not required.
-- 2. Altered source versions must be plainly marked as such, and must not be
-- misrepresented as being the original software.
-- 3. This notice may not be removed or altered from any source distribution.
--
--*
-- * \file SDL_rwops.h
-- *
-- * This file provides a general interface for SDL to read and write
-- * data streams. It can easily be extended to files, memory, etc.
--
-- Set up for C function definitions, even when using C++
-- RWops Types
--*
-- * This is the read/write operation structure -- very basic.
--
--*
-- * Return the size of the file in this rwops, or -1 if unknown
--
type anon_11 is record
data : System.Address; -- ..\SDL2_tmp\SDL_rwops.h:116
size : aliased stddef_h.size_t; -- ..\SDL2_tmp\SDL_rwops.h:117
left : aliased stddef_h.size_t; -- ..\SDL2_tmp\SDL_rwops.h:118
end record;
pragma Convention (C_Pass_By_Copy, anon_11);
type anon_10 is record
append : aliased SDL_stdinc_h.SDL_bool; -- ..\SDL2_tmp\SDL_rwops.h:112
h : System.Address; -- ..\SDL2_tmp\SDL_rwops.h:113
buffer : aliased anon_11; -- ..\SDL2_tmp\SDL_rwops.h:119
end record;
pragma Convention (C_Pass_By_Copy, anon_10);
type anon_12 is record
base : access SDL_stdinc_h.Uint8; -- ..\SDL2_tmp\SDL_rwops.h:132
here : access SDL_stdinc_h.Uint8; -- ..\SDL2_tmp\SDL_rwops.h:133
stop : access SDL_stdinc_h.Uint8; -- ..\SDL2_tmp\SDL_rwops.h:134
end record;
pragma Convention (C_Pass_By_Copy, anon_12);
type anon_13 is record
data1 : System.Address; -- ..\SDL2_tmp\SDL_rwops.h:138
data2 : System.Address; -- ..\SDL2_tmp\SDL_rwops.h:139
end record;
pragma Convention (C_Pass_By_Copy, anon_13);
type anon_9 (discr : unsigned := 0) is record
case discr is
when 0 =>
windowsio : aliased anon_10; -- ..\SDL2_tmp\SDL_rwops.h:120
when 1 =>
mem : aliased anon_12; -- ..\SDL2_tmp\SDL_rwops.h:135
when others =>
unknown : aliased anon_13; -- ..\SDL2_tmp\SDL_rwops.h:140
end case;
end record;
pragma Convention (C_Pass_By_Copy, anon_9);
pragma Unchecked_Union (anon_9);type SDL_RWops;
type SDL_RWops is record
size : access function (arg1 : access SDL_RWops) return SDL_stdinc_h.Sint64; -- ..\SDL2_tmp\SDL_rwops.h:57
seek : access function
(arg1 : access SDL_RWops;
arg2 : SDL_stdinc_h.Sint64;
arg3 : int) return SDL_stdinc_h.Sint64; -- ..\SDL2_tmp\SDL_rwops.h:66
read : access function
(arg1 : access SDL_RWops;
arg2 : System.Address;
arg3 : stddef_h.size_t;
arg4 : stddef_h.size_t) return stddef_h.size_t; -- ..\SDL2_tmp\SDL_rwops.h:75
write : access function
(arg1 : access SDL_RWops;
arg2 : System.Address;
arg3 : stddef_h.size_t;
arg4 : stddef_h.size_t) return stddef_h.size_t; -- ..\SDL2_tmp\SDL_rwops.h:84
close : access function (arg1 : access SDL_RWops) return int; -- ..\SDL2_tmp\SDL_rwops.h:91
c_type : aliased SDL_stdinc_h.Uint32; -- ..\SDL2_tmp\SDL_rwops.h:93
hidden : aliased anon_9; -- ..\SDL2_tmp\SDL_rwops.h:141
end record;
pragma Convention (C_Pass_By_Copy, SDL_RWops); -- ..\SDL2_tmp\SDL_rwops.h:52
--*
-- * Seek to \c offset relative to \c whence, one of stdio's whence values:
-- * RW_SEEK_SET, RW_SEEK_CUR, RW_SEEK_END
-- *
-- * \return the final offset in the data stream, or -1 on error.
--
--*
-- * Read up to \c maxnum objects each of size \c size from the data
-- * stream to the area pointed at by \c ptr.
-- *
-- * \return the number of objects read, or 0 at error or end of file.
--
--*
-- * Write exactly \c num objects each of size \c size from the area
-- * pointed at by \c ptr to data stream.
-- *
-- * \return the number of objects written, or 0 at error or end of file.
--
--*
-- * Close and free an allocated SDL_RWops structure.
-- *
-- * \return 0 if successful or -1 on write error when flushing data.
--
--*
-- * \name RWFrom functions
-- *
-- * Functions to create SDL_RWops structures from various data streams.
--
-- @{
function SDL_RWFromFile (file : Interfaces.C.Strings.chars_ptr; mode : Interfaces.C.Strings.chars_ptr) return access SDL_RWops; -- ..\SDL2_tmp\SDL_rwops.h:153
pragma Import (C, SDL_RWFromFile, "SDL_RWFromFile");
function SDL_RWFromFP (fp : System.Address; autoclose : SDL_stdinc_h.SDL_bool) return access SDL_RWops; -- ..\SDL2_tmp\SDL_rwops.h:160
pragma Import (C, SDL_RWFromFP, "SDL_RWFromFP");
function SDL_RWFromMem (mem : System.Address; size : int) return access SDL_RWops; -- ..\SDL2_tmp\SDL_rwops.h:164
pragma Import (C, SDL_RWFromMem, "SDL_RWFromMem");
function SDL_RWFromConstMem (mem : System.Address; size : int) return access SDL_RWops; -- ..\SDL2_tmp\SDL_rwops.h:165
pragma Import (C, SDL_RWFromConstMem, "SDL_RWFromConstMem");
-- @}
-- RWFrom functions
function SDL_AllocRW return access SDL_RWops; -- ..\SDL2_tmp\SDL_rwops.h:171
pragma Import (C, SDL_AllocRW, "SDL_AllocRW");
procedure SDL_FreeRW (area : access SDL_RWops); -- ..\SDL2_tmp\SDL_rwops.h:172
pragma Import (C, SDL_FreeRW, "SDL_FreeRW");
--*
-- * \name Read/write macros
-- *
-- * Macros to easily read and write from an SDL_RWops structure.
--
-- @{
-- @}
-- Read/write macros
--*
-- * Load all the data from an SDL data stream.
-- *
-- * The data is allocated with a zero byte at the end (null terminated)
-- *
-- * If \c datasize is not NULL, it is filled with the size of the data read.
-- *
-- * If \c freesrc is non-zero, the stream will be closed after being read.
-- *
-- * The data should be freed with SDL_free().
-- *
-- * \return the data, or NULL if there was an error.
--
function SDL_LoadFile_RW
(src : access SDL_RWops;
datasize : access stddef_h.size_t;
freesrc : int) return System.Address; -- ..\SDL2_tmp\SDL_rwops.h:206
pragma Import (C, SDL_LoadFile_RW, "SDL_LoadFile_RW");
--*
-- * Load an entire file.
-- *
-- * Convenience macro.
--
--*
-- * \name Read endian functions
-- *
-- * Read an item of the specified endianness and return in native format.
--
-- @{
function SDL_ReadU8 (src : access SDL_RWops) return SDL_stdinc_h.Uint8; -- ..\SDL2_tmp\SDL_rwops.h:222
pragma Import (C, SDL_ReadU8, "SDL_ReadU8");
function SDL_ReadLE16 (src : access SDL_RWops) return SDL_stdinc_h.Uint16; -- ..\SDL2_tmp\SDL_rwops.h:223
pragma Import (C, SDL_ReadLE16, "SDL_ReadLE16");
function SDL_ReadBE16 (src : access SDL_RWops) return SDL_stdinc_h.Uint16; -- ..\SDL2_tmp\SDL_rwops.h:224
pragma Import (C, SDL_ReadBE16, "SDL_ReadBE16");
function SDL_ReadLE32 (src : access SDL_RWops) return SDL_stdinc_h.Uint32; -- ..\SDL2_tmp\SDL_rwops.h:225
pragma Import (C, SDL_ReadLE32, "SDL_ReadLE32");
function SDL_ReadBE32 (src : access SDL_RWops) return SDL_stdinc_h.Uint32; -- ..\SDL2_tmp\SDL_rwops.h:226
pragma Import (C, SDL_ReadBE32, "SDL_ReadBE32");
function SDL_ReadLE64 (src : access SDL_RWops) return SDL_stdinc_h.Uint64; -- ..\SDL2_tmp\SDL_rwops.h:227
pragma Import (C, SDL_ReadLE64, "SDL_ReadLE64");
function SDL_ReadBE64 (src : access SDL_RWops) return SDL_stdinc_h.Uint64; -- ..\SDL2_tmp\SDL_rwops.h:228
pragma Import (C, SDL_ReadBE64, "SDL_ReadBE64");
-- @}
-- Read endian functions
--*
-- * \name Write endian functions
-- *
-- * Write an item of native format to the specified endianness.
--
-- @{
function SDL_WriteU8 (dst : access SDL_RWops; value : SDL_stdinc_h.Uint8) return stddef_h.size_t; -- ..\SDL2_tmp\SDL_rwops.h:237
pragma Import (C, SDL_WriteU8, "SDL_WriteU8");
function SDL_WriteLE16 (dst : access SDL_RWops; value : SDL_stdinc_h.Uint16) return stddef_h.size_t; -- ..\SDL2_tmp\SDL_rwops.h:238
pragma Import (C, SDL_WriteLE16, "SDL_WriteLE16");
function SDL_WriteBE16 (dst : access SDL_RWops; value : SDL_stdinc_h.Uint16) return stddef_h.size_t; -- ..\SDL2_tmp\SDL_rwops.h:239
pragma Import (C, SDL_WriteBE16, "SDL_WriteBE16");
function SDL_WriteLE32 (dst : access SDL_RWops; value : SDL_stdinc_h.Uint32) return stddef_h.size_t; -- ..\SDL2_tmp\SDL_rwops.h:240
pragma Import (C, SDL_WriteLE32, "SDL_WriteLE32");
function SDL_WriteBE32 (dst : access SDL_RWops; value : SDL_stdinc_h.Uint32) return stddef_h.size_t; -- ..\SDL2_tmp\SDL_rwops.h:241
pragma Import (C, SDL_WriteBE32, "SDL_WriteBE32");
function SDL_WriteLE64 (dst : access SDL_RWops; value : SDL_stdinc_h.Uint64) return stddef_h.size_t; -- ..\SDL2_tmp\SDL_rwops.h:242
pragma Import (C, SDL_WriteLE64, "SDL_WriteLE64");
function SDL_WriteBE64 (dst : access SDL_RWops; value : SDL_stdinc_h.Uint64) return stddef_h.size_t; -- ..\SDL2_tmp\SDL_rwops.h:243
pragma Import (C, SDL_WriteBE64, "SDL_WriteBE64");
-- @}
-- Write endian functions
-- Ends C function definitions when using C++
-- vi: set ts=4 sw=4 expandtab:
end SDL_rwops_h;
|
-- SipHash.Discrete
-- Implementing SipHash over a generic (relatively small) discrete type
-- Copyright (c) 2015, James Humphry - see LICENSE file for details
with Interfaces;
use all type Interfaces.Unsigned_64;
function SipHash.Discrete (m : T_Array) return Hash_Type is
subtype T_Array_8 is T_Array(T_Index'First..T_Index'First+7);
T_Offset : constant Integer := T'Pos(T'First);
function T_Array_8_to_U64_LE (S : in T_Array_8) return U64 with Inline;
function T_Array_Tail_to_U64_LE (S : in T_Array)
return U64
with Inline, Pre => (S'Length <= 7 and then S'Length > 0);
function T_Array_8_to_U64_LE (S : in T_Array_8) return U64 is
(U64(T'Pos(S(S'First)) - T_Offset)
or Shift_Left(U64(T'Pos(S(S'First+1)) - T_Offset), 8)
or Shift_Left(U64(T'Pos(S(S'First+2)) - T_Offset), 16)
or Shift_Left(U64(T'Pos(S(S'First+3)) - T_Offset), 24)
or Shift_Left(U64(T'Pos(S(S'First+4)) - T_Offset), 32)
or Shift_Left(U64(T'Pos(S(S'First+5)) - T_Offset), 40)
or Shift_Left(U64(T'Pos(S(S'First+6)) - T_Offset), 48)
or Shift_Left(U64(T'Pos(S(S'First+7)) - T_Offset), 56));
function T_Array_Tail_to_U64_LE (S : in T_Array)
return U64 is
R : U64 := 0;
Shift : Natural := 0;
T_I : T;
begin
for I in 0..S'Length-1 loop
pragma Loop_Invariant (Shift = I * 8);
T_I := S(S'First + T_Index'Base(I));
R := R or Shift_Left(U64(T'Pos(T_I) - T_Offset), Shift);
Shift := Shift + 8;
end loop;
return R;
end T_Array_Tail_to_U64_LE;
m_pos : T_Index'Base := 0;
m_i : U64;
v : SipHash_State := Get_Initial_State;
w : constant Natural := (m'Length / 8) + 1;
begin
-- This compile-time check is useful for GNAT but in GNATprove it currently
-- just generates a warning that it can not yet prove them correct.
pragma Warnings (GNATprove, Off, "Compile_Time_Error");
pragma Compile_Time_Error ((T'Size > 8),
"SipHash.Discrete only works for discrete " &
"types which fit into one byte.");
pragma Warnings (GNATprove, On, "Compile_Time_Error");
for I in 1..w-1 loop
pragma Loop_Invariant (m_pos = T_Index'Base(I - 1) * 8);
m_i := T_Array_8_to_U64_LE(m(m'First + m_pos..m'First + m_pos + 7));
v(3) := v(3) xor m_i;
for J in 1..c_rounds loop
Sip_Round(v);
end loop;
v(0) := v(0) xor m_i;
m_pos := m_pos + 8;
end loop;
if m_pos < m'Length then
m_i := T_Array_Tail_to_U64_LE(m(m'First + m_pos .. m'Last));
else
m_i := 0;
end if;
m_i := m_i or Shift_Left(U64(m'Length mod 256), 56);
v(3) := v(3) xor m_i;
for J in 1..c_rounds loop
Sip_Round(v);
end loop;
v(0) := v(0) xor m_i;
return Hash_Type'Mod(Sip_Finalization(v));
end SipHash.Discrete;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- A D A . S T R I N G S . B O U N D E D --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2019, 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. --
-- --
------------------------------------------------------------------------------
package body Ada.Strings.Bounded is
package body Generic_Bounded_Length is
-- The subprograms in this body are those for which there is no
-- Bounded_String input, and hence no implicit information on the
-- maximum size. This means that the maximum size has to be passed
-- explicitly to the routine in Superbounded.
---------
-- "*" --
---------
function "*"
(Left : Natural;
Right : Character) return Bounded_String
is
begin
return Times (Left, Right, Max_Length);
end "*";
function "*"
(Left : Natural;
Right : String) return Bounded_String
is
begin
return Times (Left, Right, Max_Length);
end "*";
-----------------
-- From_String --
-----------------
function From_String (Source : String) return Bounded_String is
begin
return To_Super_String (Source, Max_Length, Error);
end From_String;
---------------
-- Replicate --
---------------
function Replicate
(Count : Natural;
Item : Character;
Drop : Strings.Truncation := Strings.Error) return Bounded_String
is
begin
return Super_Replicate (Count, Item, Drop, Max_Length);
end Replicate;
function Replicate
(Count : Natural;
Item : String;
Drop : Strings.Truncation := Strings.Error) return Bounded_String
is
begin
return Super_Replicate (Count, Item, Drop, Max_Length);
end Replicate;
-----------------------
-- To_Bounded_String --
-----------------------
function To_Bounded_String
(Source : String;
Drop : Strings.Truncation := Strings.Error) return Bounded_String
is
begin
return To_Super_String (Source, Max_Length, Drop);
end To_Bounded_String;
end Generic_Bounded_Length;
end Ada.Strings.Bounded;
|
-- Copyright (c) 2019 Maxim Reznik <reznikmm@gmail.com>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
package body Program.Nodes.Discrete_Range_Attribute_References is
function Create
(Range_Attribute : not null Program.Elements
.Attribute_References.Attribute_Reference_Access;
Is_Discrete_Subtype_Definition : Boolean := False)
return Discrete_Range_Attribute_Reference is
begin
return Result : Discrete_Range_Attribute_Reference :=
(Range_Attribute => Range_Attribute,
Is_Discrete_Subtype_Definition => Is_Discrete_Subtype_Definition,
Enclosing_Element => null)
do
Initialize (Result);
end return;
end Create;
function Create
(Range_Attribute : not null Program.Elements
.Attribute_References.Attribute_Reference_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False;
Is_Discrete_Subtype_Definition : Boolean := False)
return Implicit_Discrete_Range_Attribute_Reference is
begin
return Result : Implicit_Discrete_Range_Attribute_Reference :=
(Range_Attribute => Range_Attribute,
Is_Part_Of_Implicit => Is_Part_Of_Implicit,
Is_Part_Of_Inherited => Is_Part_Of_Inherited,
Is_Part_Of_Instance => Is_Part_Of_Instance,
Is_Discrete_Subtype_Definition => Is_Discrete_Subtype_Definition,
Enclosing_Element => null)
do
Initialize (Result);
end return;
end Create;
overriding function Range_Attribute
(Self : Base_Discrete_Range_Attribute_Reference)
return not null Program.Elements.Attribute_References
.Attribute_Reference_Access is
begin
return Self.Range_Attribute;
end Range_Attribute;
overriding function Is_Discrete_Subtype_Definition
(Self : Base_Discrete_Range_Attribute_Reference)
return Boolean is
begin
return Self.Is_Discrete_Subtype_Definition;
end Is_Discrete_Subtype_Definition;
overriding function Is_Part_Of_Implicit
(Self : Implicit_Discrete_Range_Attribute_Reference)
return Boolean is
begin
return Self.Is_Part_Of_Implicit;
end Is_Part_Of_Implicit;
overriding function Is_Part_Of_Inherited
(Self : Implicit_Discrete_Range_Attribute_Reference)
return Boolean is
begin
return Self.Is_Part_Of_Inherited;
end Is_Part_Of_Inherited;
overriding function Is_Part_Of_Instance
(Self : Implicit_Discrete_Range_Attribute_Reference)
return Boolean is
begin
return Self.Is_Part_Of_Instance;
end Is_Part_Of_Instance;
procedure Initialize
(Self : aliased in out Base_Discrete_Range_Attribute_Reference'Class) is
begin
Set_Enclosing_Element (Self.Range_Attribute, Self'Unchecked_Access);
null;
end Initialize;
overriding function Is_Discrete_Range_Attribute_Reference_Element
(Self : Base_Discrete_Range_Attribute_Reference)
return Boolean is
pragma Unreferenced (Self);
begin
return True;
end Is_Discrete_Range_Attribute_Reference_Element;
overriding function Is_Discrete_Range_Element
(Self : Base_Discrete_Range_Attribute_Reference)
return Boolean is
pragma Unreferenced (Self);
begin
return True;
end Is_Discrete_Range_Element;
overriding function Is_Definition_Element
(Self : Base_Discrete_Range_Attribute_Reference)
return Boolean is
pragma Unreferenced (Self);
begin
return True;
end Is_Definition_Element;
overriding procedure Visit
(Self : not null access Base_Discrete_Range_Attribute_Reference;
Visitor : in out Program.Element_Visitors.Element_Visitor'Class) is
begin
Visitor.Discrete_Range_Attribute_Reference (Self);
end Visit;
overriding function To_Discrete_Range_Attribute_Reference_Text
(Self : aliased in out Discrete_Range_Attribute_Reference)
return Program.Elements.Discrete_Range_Attribute_References
.Discrete_Range_Attribute_Reference_Text_Access is
begin
return Self'Unchecked_Access;
end To_Discrete_Range_Attribute_Reference_Text;
overriding function To_Discrete_Range_Attribute_Reference_Text
(Self : aliased in out Implicit_Discrete_Range_Attribute_Reference)
return Program.Elements.Discrete_Range_Attribute_References
.Discrete_Range_Attribute_Reference_Text_Access is
pragma Unreferenced (Self);
begin
return null;
end To_Discrete_Range_Attribute_Reference_Text;
end Program.Nodes.Discrete_Range_Attribute_References;
|
------------------------------------------------------------------------------
-- --
-- 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 file is generated, don't edit it.
------------------------------------------------------------------------------
-- An execution specification is a specification of the execution of a unit
-- of behavior or action within the lifeline. The duration of an execution
-- specification is represented by two cccurrence specifications, the start
-- occurrence specification and the finish occurrence specification.
------------------------------------------------------------------------------
with AMF.UML.Interaction_Fragments;
limited with AMF.UML.Occurrence_Specifications;
package AMF.UML.Execution_Specifications is
pragma Preelaborate;
type UML_Execution_Specification is limited interface
and AMF.UML.Interaction_Fragments.UML_Interaction_Fragment;
type UML_Execution_Specification_Access is
access all UML_Execution_Specification'Class;
for UML_Execution_Specification_Access'Storage_Size use 0;
not overriding function Get_Finish
(Self : not null access constant UML_Execution_Specification)
return AMF.UML.Occurrence_Specifications.UML_Occurrence_Specification_Access is abstract;
-- Getter of ExecutionSpecification::finish.
--
-- References the OccurrenceSpecification that designates the finish of
-- the Action or Behavior.
not overriding procedure Set_Finish
(Self : not null access UML_Execution_Specification;
To : AMF.UML.Occurrence_Specifications.UML_Occurrence_Specification_Access) is abstract;
-- Setter of ExecutionSpecification::finish.
--
-- References the OccurrenceSpecification that designates the finish of
-- the Action or Behavior.
not overriding function Get_Start
(Self : not null access constant UML_Execution_Specification)
return AMF.UML.Occurrence_Specifications.UML_Occurrence_Specification_Access is abstract;
-- Getter of ExecutionSpecification::start.
--
-- References the OccurrenceSpecification that designates the start of the
-- Action or Behavior
not overriding procedure Set_Start
(Self : not null access UML_Execution_Specification;
To : AMF.UML.Occurrence_Specifications.UML_Occurrence_Specification_Access) is abstract;
-- Setter of ExecutionSpecification::start.
--
-- References the OccurrenceSpecification that designates the start of the
-- Action or Behavior
end AMF.UML.Execution_Specifications;
|
package body Renaming2_Pkg4 is
package body Inner is
function Next_Value return Value_T is
Next_Value : Value_T renames Value (Next);
begin
return Next_Value;
end Next_Value;
end Inner;
end Renaming2_Pkg4;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- G N A T . B Y T E _ S W A P P I N G --
-- --
-- S p e c --
-- --
-- Copyright (C) 2006-2011, 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. --
-- --
-- --
-- --
-- --
-- --
-- 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. --
-- --
------------------------------------------------------------------------------
-- Simple routines for swapping the bytes of 16-, 32-, and 64-bit objects
-- The generic functions should be instantiated with types that are of a size
-- in bytes corresponding to the name of the generic. For example, a 2-byte
-- integer type would be compatible with Swapped2, 4-byte integer with
-- Swapped4, and so on. Failure to do so will result in a warning when
-- compiling the instantiation; this warning should be heeded. Ignoring this
-- warning can result in unexpected results.
-- An example of proper usage follows:
-- declare
-- type Short_Integer is range -32768 .. 32767;
-- for Short_Integer'Size use 16; -- for confirmation
-- X : Short_Integer := 16#7FFF#;
-- function Swapped is new Byte_Swapping.Swapped2 (Short_Integer);
-- begin
-- Put_Line (X'Img);
-- X := Swapped (X);
-- Put_Line (X'Img);
-- end;
-- Note that the generic actual types need not be scalars, but must be
-- 'definite' types. They can, for example, be constrained subtypes of
-- unconstrained array types as long as the size is correct. For instance,
-- a subtype of String with length of 4 would be compatible with the
-- Swapped4 generic:
-- declare
-- subtype String4 is String (1 .. 4);
-- function Swapped is new Byte_Swapping.Swapped4 (String4);
-- S : String4 := "ABCD";
-- for S'Alignment use 4;
-- begin
-- Put_Line (S);
-- S := Swapped (S);
-- Put_Line (S);
-- end;
-- Similarly, a constrained array type is also acceptable:
-- declare
-- type Mask is array (0 .. 15) of Boolean;
-- for Mask'Alignment use 2;
-- for Mask'Component_Size use Boolean'Size;
-- X : Mask := (0 .. 7 => True, others => False);
-- function Swapped is new Byte_Swapping.Swapped2 (Mask);
-- begin
-- ...
-- X := Swapped (X);
-- ...
-- end;
-- A properly-sized record type will also be acceptable, and so forth
-- However, as described, a size mismatch must be avoided. In the following we
-- instantiate one of the generics with a type that is too large. The result
-- of the function call is undefined, such that assignment to an object can
-- result in garbage values.
-- Wrong: declare
-- subtype String16 is String (1 .. 16);
-- function Swapped is new Byte_Swapping.Swapped8 (String16);
-- -- Instantiation generates a compiler warning about
-- -- mismatched sizes
-- S : String16;
-- begin
-- S := "ABCDEFGHDEADBEEF";
--
-- Put_Line (S);
--
-- -- the following assignment results in garbage in S after the
-- -- first 8 bytes
--
-- S := Swapped (S);
--
-- Put_Line (S);
-- end Wrong;
-- When the size of the type is larger than 8 bytes, the use of the non-
-- generic procedures is an alternative because no function result is
-- involved; manipulation of the object is direct.
-- The procedures are passed the address of an object to manipulate. They will
-- swap the first N bytes of that object corresponding to the name of the
-- procedure. For example:
-- declare
-- S2 : String := "AB";
-- for S2'Alignment use 2;
-- S4 : String := "ABCD";
-- for S4'Alignment use 4;
-- S8 : String := "ABCDEFGH";
-- for S8'Alignment use 8;
-- begin
-- Swap2 (S2'Address);
-- Put_Line (S2);
-- Swap4 (S4'Address);
-- Put_Line (S4);
-- Swap8 (S8'Address);
-- Put_Line (S8);
-- end;
-- If an object of a type larger than N is passed, the remaining bytes of the
-- object are undisturbed. For example:
-- declare
-- subtype String16 is String (1 .. 16);
-- S : String16;
-- for S'Alignment use 8;
-- begin
-- S := "ABCDEFGHDEADBEEF";
-- Put_Line (S);
-- Swap8 (S'Address);
-- Put_Line (S);
-- end;
with System;
package GNAT.Byte_Swapping is
pragma Pure;
-- NB: all the routines in this package treat the application objects as
-- unsigned (modular) types of a size in bytes corresponding to the routine
-- name. For example, the generic function Swapped2 manipulates the object
-- passed to the formal parameter Input as a value of an unsigned type that
-- is 2 bytes long. Therefore clients are responsible for the compatibility
-- of application types manipulated by these routines and these modular
-- types, in terms of both size and alignment. This requirement applies to
-- the generic actual type passed to the generic formal type Item in the
-- generic functions, as well as to the type of the object implicitly
-- designated by the address passed to the non-generic procedures. Use of
-- incompatible types can result in implementation- defined effects.
generic
type Item is limited private;
function Swapped2 (Input : Item) return Item;
-- Return the 2-byte value of Input with the bytes swapped
generic
type Item is limited private;
function Swapped4 (Input : Item) return Item;
-- Return the 4-byte value of Input with the bytes swapped
generic
type Item is limited private;
function Swapped8 (Input : Item) return Item;
-- Return the 8-byte value of Input with the bytes swapped
procedure Swap2 (Location : System.Address);
-- Swap the first 2 bytes of the object starting at the address specified
-- by Location.
procedure Swap4 (Location : System.Address);
-- Swap the first 4 bytes of the object starting at the address specified
-- by Location.
procedure Swap8 (Location : System.Address);
-- Swap the first 8 bytes of the object starting at the address specified
-- by Location.
pragma Inline (Swap2, Swap4, Swap8, Swapped2, Swapped4, Swapped8);
end GNAT.Byte_Swapping;
|
-- SPDX-FileCopyrightText: 2019 Max Reznik <reznikmm@gmail.com>
--
-- SPDX-License-Identifier: MIT
-------------------------------------------------------------
with Program.Elements.Statements;
with Program.Elements.Defining_Identifiers;
with Program.Lexical_Elements;
with Program.Elements.Loop_Parameter_Specifications;
with Program.Elements.Generalized_Iterator_Specifications;
with Program.Elements.Element_Iterator_Specifications;
with Program.Element_Vectors;
with Program.Elements.Identifiers;
package Program.Elements.For_Loop_Statements is
pragma Pure (Program.Elements.For_Loop_Statements);
type For_Loop_Statement is
limited interface and Program.Elements.Statements.Statement;
type For_Loop_Statement_Access is access all For_Loop_Statement'Class
with Storage_Size => 0;
not overriding function Statement_Identifier
(Self : For_Loop_Statement)
return Program.Elements.Defining_Identifiers.Defining_Identifier_Access
is abstract;
not overriding function Loop_Parameter
(Self : For_Loop_Statement)
return Program.Elements.Loop_Parameter_Specifications
.Loop_Parameter_Specification_Access is abstract;
not overriding function Generalized_Iterator
(Self : For_Loop_Statement)
return Program.Elements.Generalized_Iterator_Specifications
.Generalized_Iterator_Specification_Access is abstract;
not overriding function Element_Iterator
(Self : For_Loop_Statement)
return Program.Elements.Element_Iterator_Specifications
.Element_Iterator_Specification_Access is abstract;
not overriding function Statements
(Self : For_Loop_Statement)
return not null Program.Element_Vectors.Element_Vector_Access
is abstract;
not overriding function End_Statement_Identifier
(Self : For_Loop_Statement)
return Program.Elements.Identifiers.Identifier_Access is abstract;
type For_Loop_Statement_Text is limited interface;
type For_Loop_Statement_Text_Access is
access all For_Loop_Statement_Text'Class with Storage_Size => 0;
not overriding function To_For_Loop_Statement_Text
(Self : in out For_Loop_Statement)
return For_Loop_Statement_Text_Access is abstract;
not overriding function Colon_Token
(Self : For_Loop_Statement_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function For_Token
(Self : For_Loop_Statement_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
not overriding function Loop_Token
(Self : For_Loop_Statement_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
not overriding function End_Token
(Self : For_Loop_Statement_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
not overriding function Loop_Token_2
(Self : For_Loop_Statement_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
not overriding function Semicolon_Token
(Self : For_Loop_Statement_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
end Program.Elements.For_Loop_Statements;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- A D A . S T R I N G S . S U P E R B O U N D E D --
-- --
-- B o d y --
-- --
-- Copyright (C) 2003-2015, 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. --
-- --
------------------------------------------------------------------------------
with Ada.Strings.Maps; use Ada.Strings.Maps;
with Ada.Strings.Search;
package body Ada.Strings.Superbounded is
------------
-- Concat --
------------
function Concat
(Left : Super_String;
Right : Super_String) return Super_String
is
begin
return Result : Super_String (Left.Max_Length) do
declare
Llen : constant Natural := Left.Current_Length;
Rlen : constant Natural := Right.Current_Length;
Nlen : constant Natural := Llen + Rlen;
begin
if Nlen > Left.Max_Length then
raise Ada.Strings.Length_Error;
end if;
Result.Current_Length := Nlen;
Result.Data (1 .. Llen) := Left.Data (1 .. Llen);
Result.Data (Llen + 1 .. Nlen) := Right.Data (1 .. Rlen);
end;
end return;
end Concat;
function Concat
(Left : Super_String;
Right : String) return Super_String
is
begin
return Result : Super_String (Left.Max_Length) do
declare
Llen : constant Natural := Left.Current_Length;
Nlen : constant Natural := Llen + Right'Length;
begin
if Nlen > Left.Max_Length then
raise Ada.Strings.Length_Error;
end if;
Result.Current_Length := Nlen;
Result.Data (1 .. Llen) := Left.Data (1 .. Llen);
Result.Data (Llen + 1 .. Nlen) := Right;
end;
end return;
end Concat;
function Concat
(Left : String;
Right : Super_String) return Super_String
is
begin
return Result : Super_String (Right.Max_Length) do
declare
Llen : constant Natural := Left'Length;
Rlen : constant Natural := Right.Current_Length;
Nlen : constant Natural := Llen + Rlen;
begin
if Nlen > Right.Max_Length then
raise Ada.Strings.Length_Error;
end if;
Result.Current_Length := Nlen;
Result.Data (1 .. Llen) := Left;
Result.Data (Llen + 1 .. Nlen) := Right.Data (1 .. Rlen);
end;
end return;
end Concat;
function Concat
(Left : Super_String;
Right : Character) return Super_String
is
begin
return Result : Super_String (Left.Max_Length) do
declare
Llen : constant Natural := Left.Current_Length;
begin
if Llen = Left.Max_Length then
raise Ada.Strings.Length_Error;
end if;
Result.Current_Length := Llen + 1;
Result.Data (1 .. Llen) := Left.Data (1 .. Llen);
Result.Data (Result.Current_Length) := Right;
end;
end return;
end Concat;
function Concat
(Left : Character;
Right : Super_String) return Super_String
is
begin
return Result : Super_String (Right.Max_Length) do
declare
Rlen : constant Natural := Right.Current_Length;
begin
if Rlen = Right.Max_Length then
raise Ada.Strings.Length_Error;
end if;
Result.Current_Length := Rlen + 1;
Result.Data (1) := Left;
Result.Data (2 .. Result.Current_Length) :=
Right.Data (1 .. Rlen);
end;
end return;
end Concat;
-----------
-- Equal --
-----------
function "="
(Left : Super_String;
Right : Super_String) return Boolean
is
begin
return Left.Current_Length = Right.Current_Length
and then Left.Data (1 .. Left.Current_Length) =
Right.Data (1 .. Right.Current_Length);
end "=";
function Equal
(Left : Super_String;
Right : String) return Boolean
is
begin
return Left.Current_Length = Right'Length
and then Left.Data (1 .. Left.Current_Length) = Right;
end Equal;
function Equal
(Left : String;
Right : Super_String) return Boolean
is
begin
return Left'Length = Right.Current_Length
and then Left = Right.Data (1 .. Right.Current_Length);
end Equal;
-------------
-- Greater --
-------------
function Greater
(Left : Super_String;
Right : Super_String) return Boolean
is
begin
return Left.Data (1 .. Left.Current_Length) >
Right.Data (1 .. Right.Current_Length);
end Greater;
function Greater
(Left : Super_String;
Right : String) return Boolean
is
begin
return Left.Data (1 .. Left.Current_Length) > Right;
end Greater;
function Greater
(Left : String;
Right : Super_String) return Boolean
is
begin
return Left > Right.Data (1 .. Right.Current_Length);
end Greater;
----------------------
-- Greater_Or_Equal --
----------------------
function Greater_Or_Equal
(Left : Super_String;
Right : Super_String) return Boolean
is
begin
return Left.Data (1 .. Left.Current_Length) >=
Right.Data (1 .. Right.Current_Length);
end Greater_Or_Equal;
function Greater_Or_Equal
(Left : Super_String;
Right : String) return Boolean
is
begin
return Left.Data (1 .. Left.Current_Length) >= Right;
end Greater_Or_Equal;
function Greater_Or_Equal
(Left : String;
Right : Super_String) return Boolean
is
begin
return Left >= Right.Data (1 .. Right.Current_Length);
end Greater_Or_Equal;
----------
-- Less --
----------
function Less
(Left : Super_String;
Right : Super_String) return Boolean
is
begin
return Left.Data (1 .. Left.Current_Length) <
Right.Data (1 .. Right.Current_Length);
end Less;
function Less
(Left : Super_String;
Right : String) return Boolean
is
begin
return Left.Data (1 .. Left.Current_Length) < Right;
end Less;
function Less
(Left : String;
Right : Super_String) return Boolean
is
begin
return Left < Right.Data (1 .. Right.Current_Length);
end Less;
-------------------
-- Less_Or_Equal --
-------------------
function Less_Or_Equal
(Left : Super_String;
Right : Super_String) return Boolean
is
begin
return Left.Data (1 .. Left.Current_Length) <=
Right.Data (1 .. Right.Current_Length);
end Less_Or_Equal;
function Less_Or_Equal
(Left : Super_String;
Right : String) return Boolean
is
begin
return Left.Data (1 .. Left.Current_Length) <= Right;
end Less_Or_Equal;
function Less_Or_Equal
(Left : String;
Right : Super_String) return Boolean
is
begin
return Left <= Right.Data (1 .. Right.Current_Length);
end Less_Or_Equal;
----------------------
-- Set_Super_String --
----------------------
procedure Set_Super_String
(Target : out Super_String;
Source : String;
Drop : Truncation := Error)
is
Slen : constant Natural := Source'Length;
Max_Length : constant Positive := Target.Max_Length;
begin
if Slen <= Max_Length then
Target.Current_Length := Slen;
Target.Data (1 .. Slen) := Source;
else
case Drop is
when Strings.Right =>
Target.Current_Length := Max_Length;
Target.Data (1 .. Max_Length) :=
Source (Source'First .. Source'First - 1 + Max_Length);
when Strings.Left =>
Target.Current_Length := Max_Length;
Target.Data (1 .. Max_Length) :=
Source (Source'Last - (Max_Length - 1) .. Source'Last);
when Strings.Error =>
raise Ada.Strings.Length_Error;
end case;
end if;
end Set_Super_String;
------------------
-- Super_Append --
------------------
-- Case of Super_String and Super_String
function Super_Append
(Left : Super_String;
Right : Super_String;
Drop : Truncation := Error) return Super_String
is
Max_Length : constant Positive := Left.Max_Length;
Result : Super_String (Max_Length);
Llen : constant Natural := Left.Current_Length;
Rlen : constant Natural := Right.Current_Length;
Nlen : constant Natural := Llen + Rlen;
begin
if Nlen <= Max_Length then
Result.Current_Length := Nlen;
Result.Data (1 .. Llen) := Left.Data (1 .. Llen);
Result.Data (Llen + 1 .. Nlen) := Right.Data (1 .. Rlen);
else
Result.Current_Length := Max_Length;
case Drop is
when Strings.Right =>
if Llen >= Max_Length then -- only case is Llen = Max_Length
Result.Data := Left.Data;
else
Result.Data (1 .. Llen) := Left.Data (1 .. Llen);
Result.Data (Llen + 1 .. Max_Length) :=
Right.Data (1 .. Max_Length - Llen);
end if;
when Strings.Left =>
if Rlen >= Max_Length then -- only case is Rlen = Max_Length
Result.Data := Right.Data;
else
Result.Data (1 .. Max_Length - Rlen) :=
Left.Data (Llen - (Max_Length - Rlen - 1) .. Llen);
Result.Data (Max_Length - Rlen + 1 .. Max_Length) :=
Right.Data (1 .. Rlen);
end if;
when Strings.Error =>
raise Ada.Strings.Length_Error;
end case;
end if;
return Result;
end Super_Append;
procedure Super_Append
(Source : in out Super_String;
New_Item : Super_String;
Drop : Truncation := Error)
is
Max_Length : constant Positive := Source.Max_Length;
Llen : constant Natural := Source.Current_Length;
Rlen : constant Natural := New_Item.Current_Length;
Nlen : constant Natural := Llen + Rlen;
begin
if Nlen <= Max_Length then
Source.Current_Length := Nlen;
Source.Data (Llen + 1 .. Nlen) := New_Item.Data (1 .. Rlen);
else
Source.Current_Length := Max_Length;
case Drop is
when Strings.Right =>
if Llen < Max_Length then
Source.Data (Llen + 1 .. Max_Length) :=
New_Item.Data (1 .. Max_Length - Llen);
end if;
when Strings.Left =>
if Rlen >= Max_Length then -- only case is Rlen = Max_Length
Source.Data := New_Item.Data;
else
Source.Data (1 .. Max_Length - Rlen) :=
Source.Data (Llen - (Max_Length - Rlen - 1) .. Llen);
Source.Data (Max_Length - Rlen + 1 .. Max_Length) :=
New_Item.Data (1 .. Rlen);
end if;
when Strings.Error =>
raise Ada.Strings.Length_Error;
end case;
end if;
end Super_Append;
-- Case of Super_String and String
function Super_Append
(Left : Super_String;
Right : String;
Drop : Strings.Truncation := Strings.Error) return Super_String
is
Max_Length : constant Positive := Left.Max_Length;
Result : Super_String (Max_Length);
Llen : constant Natural := Left.Current_Length;
Rlen : constant Natural := Right'Length;
Nlen : constant Natural := Llen + Rlen;
begin
if Nlen <= Max_Length then
Result.Current_Length := Nlen;
Result.Data (1 .. Llen) := Left.Data (1 .. Llen);
Result.Data (Llen + 1 .. Nlen) := Right;
else
Result.Current_Length := Max_Length;
case Drop is
when Strings.Right =>
if Llen >= Max_Length then -- only case is Llen = Max_Length
Result.Data := Left.Data;
else
Result.Data (1 .. Llen) := Left.Data (1 .. Llen);
Result.Data (Llen + 1 .. Max_Length) :=
Right (Right'First .. Right'First - 1 +
Max_Length - Llen);
end if;
when Strings.Left =>
if Rlen >= Max_Length then
Result.Data (1 .. Max_Length) :=
Right (Right'Last - (Max_Length - 1) .. Right'Last);
else
Result.Data (1 .. Max_Length - Rlen) :=
Left.Data (Llen - (Max_Length - Rlen - 1) .. Llen);
Result.Data (Max_Length - Rlen + 1 .. Max_Length) :=
Right;
end if;
when Strings.Error =>
raise Ada.Strings.Length_Error;
end case;
end if;
return Result;
end Super_Append;
procedure Super_Append
(Source : in out Super_String;
New_Item : String;
Drop : Truncation := Error)
is
Max_Length : constant Positive := Source.Max_Length;
Llen : constant Natural := Source.Current_Length;
Rlen : constant Natural := New_Item'Length;
Nlen : constant Natural := Llen + Rlen;
begin
if Nlen <= Max_Length then
Source.Current_Length := Nlen;
Source.Data (Llen + 1 .. Nlen) := New_Item;
else
Source.Current_Length := Max_Length;
case Drop is
when Strings.Right =>
if Llen < Max_Length then
Source.Data (Llen + 1 .. Max_Length) :=
New_Item (New_Item'First ..
New_Item'First - 1 + Max_Length - Llen);
end if;
when Strings.Left =>
if Rlen >= Max_Length then
Source.Data (1 .. Max_Length) :=
New_Item (New_Item'Last - (Max_Length - 1) ..
New_Item'Last);
else
Source.Data (1 .. Max_Length - Rlen) :=
Source.Data (Llen - (Max_Length - Rlen - 1) .. Llen);
Source.Data (Max_Length - Rlen + 1 .. Max_Length) :=
New_Item;
end if;
when Strings.Error =>
raise Ada.Strings.Length_Error;
end case;
end if;
end Super_Append;
-- Case of String and Super_String
function Super_Append
(Left : String;
Right : Super_String;
Drop : Strings.Truncation := Strings.Error) return Super_String
is
Max_Length : constant Positive := Right.Max_Length;
Result : Super_String (Max_Length);
Llen : constant Natural := Left'Length;
Rlen : constant Natural := Right.Current_Length;
Nlen : constant Natural := Llen + Rlen;
begin
if Nlen <= Max_Length then
Result.Current_Length := Nlen;
Result.Data (1 .. Llen) := Left;
Result.Data (Llen + 1 .. Llen + Rlen) := Right.Data (1 .. Rlen);
else
Result.Current_Length := Max_Length;
case Drop is
when Strings.Right =>
if Llen >= Max_Length then
Result.Data (1 .. Max_Length) :=
Left (Left'First .. Left'First + (Max_Length - 1));
else
Result.Data (1 .. Llen) := Left;
Result.Data (Llen + 1 .. Max_Length) :=
Right.Data (1 .. Max_Length - Llen);
end if;
when Strings.Left =>
if Rlen >= Max_Length then
Result.Data (1 .. Max_Length) :=
Right.Data (Rlen - (Max_Length - 1) .. Rlen);
else
Result.Data (1 .. Max_Length - Rlen) :=
Left (Left'Last - (Max_Length - Rlen - 1) .. Left'Last);
Result.Data (Max_Length - Rlen + 1 .. Max_Length) :=
Right.Data (1 .. Rlen);
end if;
when Strings.Error =>
raise Ada.Strings.Length_Error;
end case;
end if;
return Result;
end Super_Append;
-- Case of Super_String and Character
function Super_Append
(Left : Super_String;
Right : Character;
Drop : Strings.Truncation := Strings.Error) return Super_String
is
Max_Length : constant Positive := Left.Max_Length;
Result : Super_String (Max_Length);
Llen : constant Natural := Left.Current_Length;
begin
if Llen < Max_Length then
Result.Current_Length := Llen + 1;
Result.Data (1 .. Llen) := Left.Data (1 .. Llen);
Result.Data (Llen + 1) := Right;
return Result;
else
case Drop is
when Strings.Right =>
return Left;
when Strings.Left =>
Result.Current_Length := Max_Length;
Result.Data (1 .. Max_Length - 1) :=
Left.Data (2 .. Max_Length);
Result.Data (Max_Length) := Right;
return Result;
when Strings.Error =>
raise Ada.Strings.Length_Error;
end case;
end if;
end Super_Append;
procedure Super_Append
(Source : in out Super_String;
New_Item : Character;
Drop : Truncation := Error)
is
Max_Length : constant Positive := Source.Max_Length;
Llen : constant Natural := Source.Current_Length;
begin
if Llen < Max_Length then
Source.Current_Length := Llen + 1;
Source.Data (Llen + 1) := New_Item;
else
Source.Current_Length := Max_Length;
case Drop is
when Strings.Right =>
null;
when Strings.Left =>
Source.Data (1 .. Max_Length - 1) :=
Source.Data (2 .. Max_Length);
Source.Data (Max_Length) := New_Item;
when Strings.Error =>
raise Ada.Strings.Length_Error;
end case;
end if;
end Super_Append;
-- Case of Character and Super_String
function Super_Append
(Left : Character;
Right : Super_String;
Drop : Strings.Truncation := Strings.Error) return Super_String
is
Max_Length : constant Positive := Right.Max_Length;
Result : Super_String (Max_Length);
Rlen : constant Natural := Right.Current_Length;
begin
if Rlen < Max_Length then
Result.Current_Length := Rlen + 1;
Result.Data (1) := Left;
Result.Data (2 .. Rlen + 1) := Right.Data (1 .. Rlen);
return Result;
else
case Drop is
when Strings.Right =>
Result.Current_Length := Max_Length;
Result.Data (1) := Left;
Result.Data (2 .. Max_Length) :=
Right.Data (1 .. Max_Length - 1);
return Result;
when Strings.Left =>
return Right;
when Strings.Error =>
raise Ada.Strings.Length_Error;
end case;
end if;
end Super_Append;
-----------------
-- Super_Count --
-----------------
function Super_Count
(Source : Super_String;
Pattern : String;
Mapping : Maps.Character_Mapping := Maps.Identity) return Natural
is
begin
return
Search.Count
(Source.Data (1 .. Source.Current_Length), Pattern, Mapping);
end Super_Count;
function Super_Count
(Source : Super_String;
Pattern : String;
Mapping : Maps.Character_Mapping_Function) return Natural
is
begin
return
Search.Count
(Source.Data (1 .. Source.Current_Length), Pattern, Mapping);
end Super_Count;
function Super_Count
(Source : Super_String;
Set : Maps.Character_Set) return Natural
is
begin
return Search.Count (Source.Data (1 .. Source.Current_Length), Set);
end Super_Count;
------------------
-- Super_Delete --
------------------
function Super_Delete
(Source : Super_String;
From : Positive;
Through : Natural) return Super_String
is
Result : Super_String (Source.Max_Length);
Slen : constant Natural := Source.Current_Length;
Num_Delete : constant Integer := Through - From + 1;
begin
if Num_Delete <= 0 then
return Source;
elsif From > Slen + 1 then
raise Ada.Strings.Index_Error;
elsif Through >= Slen then
Result.Current_Length := From - 1;
Result.Data (1 .. From - 1) := Source.Data (1 .. From - 1);
return Result;
else
Result.Current_Length := Slen - Num_Delete;
Result.Data (1 .. From - 1) := Source.Data (1 .. From - 1);
Result.Data (From .. Result.Current_Length) :=
Source.Data (Through + 1 .. Slen);
return Result;
end if;
end Super_Delete;
procedure Super_Delete
(Source : in out Super_String;
From : Positive;
Through : Natural)
is
Slen : constant Natural := Source.Current_Length;
Num_Delete : constant Integer := Through - From + 1;
begin
if Num_Delete <= 0 then
return;
elsif From > Slen + 1 then
raise Ada.Strings.Index_Error;
elsif Through >= Slen then
Source.Current_Length := From - 1;
else
Source.Current_Length := Slen - Num_Delete;
Source.Data (From .. Source.Current_Length) :=
Source.Data (Through + 1 .. Slen);
end if;
end Super_Delete;
-------------------
-- Super_Element --
-------------------
function Super_Element
(Source : Super_String;
Index : Positive) return Character
is
begin
if Index <= Source.Current_Length then
return Source.Data (Index);
else
raise Strings.Index_Error;
end if;
end Super_Element;
----------------------
-- Super_Find_Token --
----------------------
procedure Super_Find_Token
(Source : Super_String;
Set : Maps.Character_Set;
From : Positive;
Test : Strings.Membership;
First : out Positive;
Last : out Natural)
is
begin
Search.Find_Token
(Source.Data (From .. Source.Current_Length), Set, Test, First, Last);
end Super_Find_Token;
procedure Super_Find_Token
(Source : Super_String;
Set : Maps.Character_Set;
Test : Strings.Membership;
First : out Positive;
Last : out Natural)
is
begin
Search.Find_Token
(Source.Data (1 .. Source.Current_Length), Set, Test, First, Last);
end Super_Find_Token;
----------------
-- Super_Head --
----------------
function Super_Head
(Source : Super_String;
Count : Natural;
Pad : Character := Space;
Drop : Strings.Truncation := Strings.Error) return Super_String
is
Max_Length : constant Positive := Source.Max_Length;
Result : Super_String (Max_Length);
Slen : constant Natural := Source.Current_Length;
Npad : constant Integer := Count - Slen;
begin
if Npad <= 0 then
Result.Current_Length := Count;
Result.Data (1 .. Count) := Source.Data (1 .. Count);
elsif Count <= Max_Length then
Result.Current_Length := Count;
Result.Data (1 .. Slen) := Source.Data (1 .. Slen);
Result.Data (Slen + 1 .. Count) := (others => Pad);
else
Result.Current_Length := Max_Length;
case Drop is
when Strings.Right =>
Result.Data (1 .. Slen) := Source.Data (1 .. Slen);
Result.Data (Slen + 1 .. Max_Length) := (others => Pad);
when Strings.Left =>
if Npad >= Max_Length then
Result.Data := (others => Pad);
else
Result.Data (1 .. Max_Length - Npad) :=
Source.Data (Count - Max_Length + 1 .. Slen);
Result.Data (Max_Length - Npad + 1 .. Max_Length) :=
(others => Pad);
end if;
when Strings.Error =>
raise Ada.Strings.Length_Error;
end case;
end if;
return Result;
end Super_Head;
procedure Super_Head
(Source : in out Super_String;
Count : Natural;
Pad : Character := Space;
Drop : Truncation := Error)
is
Max_Length : constant Positive := Source.Max_Length;
Slen : constant Natural := Source.Current_Length;
Npad : constant Integer := Count - Slen;
Temp : String (1 .. Max_Length);
begin
if Npad <= 0 then
Source.Current_Length := Count;
elsif Count <= Max_Length then
Source.Current_Length := Count;
Source.Data (Slen + 1 .. Count) := (others => Pad);
else
Source.Current_Length := Max_Length;
case Drop is
when Strings.Right =>
Source.Data (Slen + 1 .. Max_Length) := (others => Pad);
when Strings.Left =>
if Npad > Max_Length then
Source.Data := (others => Pad);
else
Temp := Source.Data;
Source.Data (1 .. Max_Length - Npad) :=
Temp (Count - Max_Length + 1 .. Slen);
for J in Max_Length - Npad + 1 .. Max_Length loop
Source.Data (J) := Pad;
end loop;
end if;
when Strings.Error =>
raise Ada.Strings.Length_Error;
end case;
end if;
end Super_Head;
-----------------
-- Super_Index --
-----------------
function Super_Index
(Source : Super_String;
Pattern : String;
Going : Strings.Direction := Strings.Forward;
Mapping : Maps.Character_Mapping := Maps.Identity) return Natural
is
begin
return Search.Index
(Source.Data (1 .. Source.Current_Length), Pattern, Going, Mapping);
end Super_Index;
function Super_Index
(Source : Super_String;
Pattern : String;
Going : Direction := Forward;
Mapping : Maps.Character_Mapping_Function) return Natural
is
begin
return Search.Index
(Source.Data (1 .. Source.Current_Length), Pattern, Going, Mapping);
end Super_Index;
function Super_Index
(Source : Super_String;
Set : Maps.Character_Set;
Test : Strings.Membership := Strings.Inside;
Going : Strings.Direction := Strings.Forward) return Natural
is
begin
return Search.Index
(Source.Data (1 .. Source.Current_Length), Set, Test, Going);
end Super_Index;
function Super_Index
(Source : Super_String;
Pattern : String;
From : Positive;
Going : Direction := Forward;
Mapping : Maps.Character_Mapping := Maps.Identity) return Natural
is
begin
return Search.Index
(Source.Data (1 .. Source.Current_Length),
Pattern, From, Going, Mapping);
end Super_Index;
function Super_Index
(Source : Super_String;
Pattern : String;
From : Positive;
Going : Direction := Forward;
Mapping : Maps.Character_Mapping_Function) return Natural
is
begin
return Search.Index
(Source.Data (1 .. Source.Current_Length),
Pattern, From, Going, Mapping);
end Super_Index;
function Super_Index
(Source : Super_String;
Set : Maps.Character_Set;
From : Positive;
Test : Membership := Inside;
Going : Direction := Forward) return Natural
is
begin
return Search.Index
(Source.Data (1 .. Source.Current_Length), Set, From, Test, Going);
end Super_Index;
---------------------------
-- Super_Index_Non_Blank --
---------------------------
function Super_Index_Non_Blank
(Source : Super_String;
Going : Strings.Direction := Strings.Forward) return Natural
is
begin
return
Search.Index_Non_Blank
(Source.Data (1 .. Source.Current_Length), Going);
end Super_Index_Non_Blank;
function Super_Index_Non_Blank
(Source : Super_String;
From : Positive;
Going : Direction := Forward) return Natural
is
begin
return
Search.Index_Non_Blank
(Source.Data (1 .. Source.Current_Length), From, Going);
end Super_Index_Non_Blank;
------------------
-- Super_Insert --
------------------
function Super_Insert
(Source : Super_String;
Before : Positive;
New_Item : String;
Drop : Strings.Truncation := Strings.Error) return Super_String
is
Max_Length : constant Positive := Source.Max_Length;
Result : Super_String (Max_Length);
Slen : constant Natural := Source.Current_Length;
Nlen : constant Natural := New_Item'Length;
Tlen : constant Natural := Slen + Nlen;
Blen : constant Natural := Before - 1;
Alen : constant Integer := Slen - Blen;
Droplen : constant Integer := Tlen - Max_Length;
-- Tlen is the length of the total string before possible truncation.
-- Blen, Alen are the lengths of the before and after pieces of the
-- source string.
begin
if Alen < 0 then
raise Ada.Strings.Index_Error;
elsif Droplen <= 0 then
Result.Current_Length := Tlen;
Result.Data (1 .. Blen) := Source.Data (1 .. Blen);
Result.Data (Before .. Before + Nlen - 1) := New_Item;
Result.Data (Before + Nlen .. Tlen) :=
Source.Data (Before .. Slen);
else
Result.Current_Length := Max_Length;
case Drop is
when Strings.Right =>
Result.Data (1 .. Blen) := Source.Data (1 .. Blen);
if Droplen > Alen then
Result.Data (Before .. Max_Length) :=
New_Item (New_Item'First
.. New_Item'First + Max_Length - Before);
else
Result.Data (Before .. Before + Nlen - 1) := New_Item;
Result.Data (Before + Nlen .. Max_Length) :=
Source.Data (Before .. Slen - Droplen);
end if;
when Strings.Left =>
Result.Data (Max_Length - (Alen - 1) .. Max_Length) :=
Source.Data (Before .. Slen);
if Droplen >= Blen then
Result.Data (1 .. Max_Length - Alen) :=
New_Item (New_Item'Last - (Max_Length - Alen) + 1
.. New_Item'Last);
else
Result.Data
(Blen - Droplen + 1 .. Max_Length - Alen) :=
New_Item;
Result.Data (1 .. Blen - Droplen) :=
Source.Data (Droplen + 1 .. Blen);
end if;
when Strings.Error =>
raise Ada.Strings.Length_Error;
end case;
end if;
return Result;
end Super_Insert;
procedure Super_Insert
(Source : in out Super_String;
Before : Positive;
New_Item : String;
Drop : Strings.Truncation := Strings.Error)
is
begin
-- We do a double copy here because this is one of the situations
-- in which we move data to the right, and at least at the moment,
-- GNAT is not handling such cases correctly ???
Source := Super_Insert (Source, Before, New_Item, Drop);
end Super_Insert;
------------------
-- Super_Length --
------------------
function Super_Length (Source : Super_String) return Natural is
begin
return Source.Current_Length;
end Super_Length;
---------------------
-- Super_Overwrite --
---------------------
function Super_Overwrite
(Source : Super_String;
Position : Positive;
New_Item : String;
Drop : Strings.Truncation := Strings.Error) return Super_String
is
Max_Length : constant Positive := Source.Max_Length;
Result : Super_String (Max_Length);
Endpos : constant Natural := Position + New_Item'Length - 1;
Slen : constant Natural := Source.Current_Length;
Droplen : Natural;
begin
if Position > Slen + 1 then
raise Ada.Strings.Index_Error;
elsif New_Item'Length = 0 then
return Source;
elsif Endpos <= Slen then
Result.Current_Length := Source.Current_Length;
Result.Data (1 .. Slen) := Source.Data (1 .. Slen);
Result.Data (Position .. Endpos) := New_Item;
return Result;
elsif Endpos <= Max_Length then
Result.Current_Length := Endpos;
Result.Data (1 .. Position - 1) := Source.Data (1 .. Position - 1);
Result.Data (Position .. Endpos) := New_Item;
return Result;
else
Result.Current_Length := Max_Length;
Droplen := Endpos - Max_Length;
case Drop is
when Strings.Right =>
Result.Data (1 .. Position - 1) :=
Source.Data (1 .. Position - 1);
Result.Data (Position .. Max_Length) :=
New_Item (New_Item'First .. New_Item'Last - Droplen);
return Result;
when Strings.Left =>
if New_Item'Length >= Max_Length then
Result.Data (1 .. Max_Length) :=
New_Item (New_Item'Last - Max_Length + 1 ..
New_Item'Last);
return Result;
else
Result.Data (1 .. Max_Length - New_Item'Length) :=
Source.Data (Droplen + 1 .. Position - 1);
Result.Data
(Max_Length - New_Item'Length + 1 .. Max_Length) :=
New_Item;
return Result;
end if;
when Strings.Error =>
raise Ada.Strings.Length_Error;
end case;
end if;
end Super_Overwrite;
procedure Super_Overwrite
(Source : in out Super_String;
Position : Positive;
New_Item : String;
Drop : Strings.Truncation := Strings.Error)
is
Max_Length : constant Positive := Source.Max_Length;
Endpos : constant Positive := Position + New_Item'Length - 1;
Slen : constant Natural := Source.Current_Length;
Droplen : Natural;
begin
if Position > Slen + 1 then
raise Ada.Strings.Index_Error;
elsif Endpos <= Slen then
Source.Data (Position .. Endpos) := New_Item;
elsif Endpos <= Max_Length then
Source.Data (Position .. Endpos) := New_Item;
Source.Current_Length := Endpos;
else
Source.Current_Length := Max_Length;
Droplen := Endpos - Max_Length;
case Drop is
when Strings.Right =>
Source.Data (Position .. Max_Length) :=
New_Item (New_Item'First .. New_Item'Last - Droplen);
when Strings.Left =>
if New_Item'Length > Max_Length then
Source.Data (1 .. Max_Length) :=
New_Item (New_Item'Last - Max_Length + 1 ..
New_Item'Last);
else
Source.Data (1 .. Max_Length - New_Item'Length) :=
Source.Data (Droplen + 1 .. Position - 1);
Source.Data
(Max_Length - New_Item'Length + 1 .. Max_Length) :=
New_Item;
end if;
when Strings.Error =>
raise Ada.Strings.Length_Error;
end case;
end if;
end Super_Overwrite;
---------------------------
-- Super_Replace_Element --
---------------------------
procedure Super_Replace_Element
(Source : in out Super_String;
Index : Positive;
By : Character)
is
begin
if Index <= Source.Current_Length then
Source.Data (Index) := By;
else
raise Ada.Strings.Index_Error;
end if;
end Super_Replace_Element;
-------------------------
-- Super_Replace_Slice --
-------------------------
function Super_Replace_Slice
(Source : Super_String;
Low : Positive;
High : Natural;
By : String;
Drop : Strings.Truncation := Strings.Error) return Super_String
is
Max_Length : constant Positive := Source.Max_Length;
Slen : constant Natural := Source.Current_Length;
begin
if Low > Slen + 1 then
raise Strings.Index_Error;
elsif High < Low then
return Super_Insert (Source, Low, By, Drop);
else
declare
Blen : constant Natural := Natural'Max (0, Low - 1);
Alen : constant Natural := Natural'Max (0, Slen - High);
Tlen : constant Natural := Blen + By'Length + Alen;
Droplen : constant Integer := Tlen - Max_Length;
Result : Super_String (Max_Length);
-- Tlen is the total length of the result string before any
-- truncation. Blen and Alen are the lengths of the pieces
-- of the original string that end up in the result string
-- before and after the replaced slice.
begin
if Droplen <= 0 then
Result.Current_Length := Tlen;
Result.Data (1 .. Blen) := Source.Data (1 .. Blen);
Result.Data (Low .. Low + By'Length - 1) := By;
Result.Data (Low + By'Length .. Tlen) :=
Source.Data (High + 1 .. Slen);
else
Result.Current_Length := Max_Length;
case Drop is
when Strings.Right =>
Result.Data (1 .. Blen) := Source.Data (1 .. Blen);
if Droplen > Alen then
Result.Data (Low .. Max_Length) :=
By (By'First .. By'First + Max_Length - Low);
else
Result.Data (Low .. Low + By'Length - 1) := By;
Result.Data (Low + By'Length .. Max_Length) :=
Source.Data (High + 1 .. Slen - Droplen);
end if;
when Strings.Left =>
Result.Data (Max_Length - (Alen - 1) .. Max_Length) :=
Source.Data (High + 1 .. Slen);
if Droplen >= Blen then
Result.Data (1 .. Max_Length - Alen) :=
By (By'Last - (Max_Length - Alen) + 1 .. By'Last);
else
Result.Data
(Blen - Droplen + 1 .. Max_Length - Alen) := By;
Result.Data (1 .. Blen - Droplen) :=
Source.Data (Droplen + 1 .. Blen);
end if;
when Strings.Error =>
raise Ada.Strings.Length_Error;
end case;
end if;
return Result;
end;
end if;
end Super_Replace_Slice;
procedure Super_Replace_Slice
(Source : in out Super_String;
Low : Positive;
High : Natural;
By : String;
Drop : Strings.Truncation := Strings.Error)
is
begin
-- We do a double copy here because this is one of the situations
-- in which we move data to the right, and at least at the moment,
-- GNAT is not handling such cases correctly ???
Source := Super_Replace_Slice (Source, Low, High, By, Drop);
end Super_Replace_Slice;
---------------------
-- Super_Replicate --
---------------------
function Super_Replicate
(Count : Natural;
Item : Character;
Drop : Truncation := Error;
Max_Length : Positive) return Super_String
is
Result : Super_String (Max_Length);
begin
if Count <= Max_Length then
Result.Current_Length := Count;
elsif Drop = Strings.Error then
raise Ada.Strings.Length_Error;
else
Result.Current_Length := Max_Length;
end if;
Result.Data (1 .. Result.Current_Length) := (others => Item);
return Result;
end Super_Replicate;
function Super_Replicate
(Count : Natural;
Item : String;
Drop : Truncation := Error;
Max_Length : Positive) return Super_String
is
Length : constant Integer := Count * Item'Length;
Result : Super_String (Max_Length);
Indx : Positive;
begin
if Length <= Max_Length then
Result.Current_Length := Length;
if Length > 0 then
Indx := 1;
for J in 1 .. Count loop
Result.Data (Indx .. Indx + Item'Length - 1) := Item;
Indx := Indx + Item'Length;
end loop;
end if;
else
Result.Current_Length := Max_Length;
case Drop is
when Strings.Right =>
Indx := 1;
while Indx + Item'Length <= Max_Length + 1 loop
Result.Data (Indx .. Indx + Item'Length - 1) := Item;
Indx := Indx + Item'Length;
end loop;
Result.Data (Indx .. Max_Length) :=
Item (Item'First .. Item'First + Max_Length - Indx);
when Strings.Left =>
Indx := Max_Length;
while Indx - Item'Length >= 1 loop
Result.Data (Indx - (Item'Length - 1) .. Indx) := Item;
Indx := Indx - Item'Length;
end loop;
Result.Data (1 .. Indx) :=
Item (Item'Last - Indx + 1 .. Item'Last);
when Strings.Error =>
raise Ada.Strings.Length_Error;
end case;
end if;
return Result;
end Super_Replicate;
function Super_Replicate
(Count : Natural;
Item : Super_String;
Drop : Strings.Truncation := Strings.Error) return Super_String
is
begin
return
Super_Replicate
(Count,
Item.Data (1 .. Item.Current_Length),
Drop,
Item.Max_Length);
end Super_Replicate;
-----------------
-- Super_Slice --
-----------------
function Super_Slice
(Source : Super_String;
Low : Positive;
High : Natural) return String
is
begin
-- Note: test of High > Length is in accordance with AI95-00128
return R : String (Low .. High) do
if Low > Source.Current_Length + 1
or else High > Source.Current_Length
then
raise Index_Error;
end if;
-- Note: in this case, superflat bounds are not a problem, we just
-- get the null string in accordance with normal Ada slice rules.
R := Source.Data (Low .. High);
end return;
end Super_Slice;
function Super_Slice
(Source : Super_String;
Low : Positive;
High : Natural) return Super_String
is
begin
return Result : Super_String (Source.Max_Length) do
if Low > Source.Current_Length + 1
or else High > Source.Current_Length
then
raise Index_Error;
end if;
-- Note: the Max operation here deals with the superflat case
Result.Current_Length := Integer'Max (0, High - Low + 1);
Result.Data (1 .. Result.Current_Length) := Source.Data (Low .. High);
end return;
end Super_Slice;
procedure Super_Slice
(Source : Super_String;
Target : out Super_String;
Low : Positive;
High : Natural)
is
begin
if Low > Source.Current_Length + 1
or else High > Source.Current_Length
then
raise Index_Error;
end if;
-- Note: the Max operation here deals with the superflat case
Target.Current_Length := Integer'Max (0, High - Low + 1);
Target.Data (1 .. Target.Current_Length) := Source.Data (Low .. High);
end Super_Slice;
----------------
-- Super_Tail --
----------------
function Super_Tail
(Source : Super_String;
Count : Natural;
Pad : Character := Space;
Drop : Strings.Truncation := Strings.Error) return Super_String
is
Max_Length : constant Positive := Source.Max_Length;
Result : Super_String (Max_Length);
Slen : constant Natural := Source.Current_Length;
Npad : constant Integer := Count - Slen;
begin
if Npad <= 0 then
Result.Current_Length := Count;
Result.Data (1 .. Count) :=
Source.Data (Slen - (Count - 1) .. Slen);
elsif Count <= Max_Length then
Result.Current_Length := Count;
Result.Data (1 .. Npad) := (others => Pad);
Result.Data (Npad + 1 .. Count) := Source.Data (1 .. Slen);
else
Result.Current_Length := Max_Length;
case Drop is
when Strings.Right =>
if Npad >= Max_Length then
Result.Data := (others => Pad);
else
Result.Data (1 .. Npad) := (others => Pad);
Result.Data (Npad + 1 .. Max_Length) :=
Source.Data (1 .. Max_Length - Npad);
end if;
when Strings.Left =>
Result.Data (1 .. Max_Length - Slen) := (others => Pad);
Result.Data (Max_Length - Slen + 1 .. Max_Length) :=
Source.Data (1 .. Slen);
when Strings.Error =>
raise Ada.Strings.Length_Error;
end case;
end if;
return Result;
end Super_Tail;
procedure Super_Tail
(Source : in out Super_String;
Count : Natural;
Pad : Character := Space;
Drop : Truncation := Error)
is
Max_Length : constant Positive := Source.Max_Length;
Slen : constant Natural := Source.Current_Length;
Npad : constant Integer := Count - Slen;
Temp : constant String (1 .. Max_Length) := Source.Data;
begin
if Npad <= 0 then
Source.Current_Length := Count;
Source.Data (1 .. Count) :=
Temp (Slen - (Count - 1) .. Slen);
elsif Count <= Max_Length then
Source.Current_Length := Count;
Source.Data (1 .. Npad) := (others => Pad);
Source.Data (Npad + 1 .. Count) := Temp (1 .. Slen);
else
Source.Current_Length := Max_Length;
case Drop is
when Strings.Right =>
if Npad >= Max_Length then
Source.Data := (others => Pad);
else
Source.Data (1 .. Npad) := (others => Pad);
Source.Data (Npad + 1 .. Max_Length) :=
Temp (1 .. Max_Length - Npad);
end if;
when Strings.Left =>
for J in 1 .. Max_Length - Slen loop
Source.Data (J) := Pad;
end loop;
Source.Data (Max_Length - Slen + 1 .. Max_Length) :=
Temp (1 .. Slen);
when Strings.Error =>
raise Ada.Strings.Length_Error;
end case;
end if;
end Super_Tail;
---------------------
-- Super_To_String --
---------------------
function Super_To_String (Source : Super_String) return String is
begin
return R : String (1 .. Source.Current_Length) do
R := Source.Data (1 .. Source.Current_Length);
end return;
end Super_To_String;
---------------------
-- Super_Translate --
---------------------
function Super_Translate
(Source : Super_String;
Mapping : Maps.Character_Mapping) return Super_String
is
Result : Super_String (Source.Max_Length);
begin
Result.Current_Length := Source.Current_Length;
for J in 1 .. Source.Current_Length loop
Result.Data (J) := Value (Mapping, Source.Data (J));
end loop;
return Result;
end Super_Translate;
procedure Super_Translate
(Source : in out Super_String;
Mapping : Maps.Character_Mapping)
is
begin
for J in 1 .. Source.Current_Length loop
Source.Data (J) := Value (Mapping, Source.Data (J));
end loop;
end Super_Translate;
function Super_Translate
(Source : Super_String;
Mapping : Maps.Character_Mapping_Function) return Super_String
is
Result : Super_String (Source.Max_Length);
begin
Result.Current_Length := Source.Current_Length;
for J in 1 .. Source.Current_Length loop
Result.Data (J) := Mapping.all (Source.Data (J));
end loop;
return Result;
end Super_Translate;
procedure Super_Translate
(Source : in out Super_String;
Mapping : Maps.Character_Mapping_Function)
is
begin
for J in 1 .. Source.Current_Length loop
Source.Data (J) := Mapping.all (Source.Data (J));
end loop;
end Super_Translate;
----------------
-- Super_Trim --
----------------
function Super_Trim
(Source : Super_String;
Side : Trim_End) return Super_String
is
Result : Super_String (Source.Max_Length);
Last : Natural := Source.Current_Length;
First : Positive := 1;
begin
if Side = Left or else Side = Both then
while First <= Last and then Source.Data (First) = ' ' loop
First := First + 1;
end loop;
end if;
if Side = Right or else Side = Both then
while Last >= First and then Source.Data (Last) = ' ' loop
Last := Last - 1;
end loop;
end if;
Result.Current_Length := Last - First + 1;
Result.Data (1 .. Result.Current_Length) := Source.Data (First .. Last);
return Result;
end Super_Trim;
procedure Super_Trim
(Source : in out Super_String;
Side : Trim_End)
is
Max_Length : constant Positive := Source.Max_Length;
Last : Natural := Source.Current_Length;
First : Positive := 1;
Temp : String (1 .. Max_Length);
begin
Temp (1 .. Last) := Source.Data (1 .. Last);
if Side = Left or else Side = Both then
while First <= Last and then Temp (First) = ' ' loop
First := First + 1;
end loop;
end if;
if Side = Right or else Side = Both then
while Last >= First and then Temp (Last) = ' ' loop
Last := Last - 1;
end loop;
end if;
Source.Current_Length := Last - First + 1;
Source.Data (1 .. Source.Current_Length) := Temp (First .. Last);
end Super_Trim;
function Super_Trim
(Source : Super_String;
Left : Maps.Character_Set;
Right : Maps.Character_Set) return Super_String
is
Result : Super_String (Source.Max_Length);
begin
for First in 1 .. Source.Current_Length loop
if not Is_In (Source.Data (First), Left) then
for Last in reverse First .. Source.Current_Length loop
if not Is_In (Source.Data (Last), Right) then
Result.Current_Length := Last - First + 1;
Result.Data (1 .. Result.Current_Length) :=
Source.Data (First .. Last);
return Result;
end if;
end loop;
end if;
end loop;
Result.Current_Length := 0;
return Result;
end Super_Trim;
procedure Super_Trim
(Source : in out Super_String;
Left : Maps.Character_Set;
Right : Maps.Character_Set)
is
begin
for First in 1 .. Source.Current_Length loop
if not Is_In (Source.Data (First), Left) then
for Last in reverse First .. Source.Current_Length loop
if not Is_In (Source.Data (Last), Right) then
if First = 1 then
Source.Current_Length := Last;
return;
else
Source.Current_Length := Last - First + 1;
Source.Data (1 .. Source.Current_Length) :=
Source.Data (First .. Last);
return;
end if;
end if;
end loop;
Source.Current_Length := 0;
return;
end if;
end loop;
Source.Current_Length := 0;
end Super_Trim;
-----------
-- Times --
-----------
function Times
(Left : Natural;
Right : Character;
Max_Length : Positive) return Super_String
is
Result : Super_String (Max_Length);
begin
if Left > Max_Length then
raise Ada.Strings.Length_Error;
else
Result.Current_Length := Left;
for J in 1 .. Left loop
Result.Data (J) := Right;
end loop;
end if;
return Result;
end Times;
function Times
(Left : Natural;
Right : String;
Max_Length : Positive) return Super_String
is
Result : Super_String (Max_Length);
Pos : Positive := 1;
Rlen : constant Natural := Right'Length;
Nlen : constant Natural := Left * Rlen;
begin
if Nlen > Max_Length then
raise Ada.Strings.Length_Error;
else
Result.Current_Length := Nlen;
if Nlen > 0 then
for J in 1 .. Left loop
Result.Data (Pos .. Pos + Rlen - 1) := Right;
Pos := Pos + Rlen;
end loop;
end if;
end if;
return Result;
end Times;
function Times
(Left : Natural;
Right : Super_String) return Super_String
is
Result : Super_String (Right.Max_Length);
Pos : Positive := 1;
Rlen : constant Natural := Right.Current_Length;
Nlen : constant Natural := Left * Rlen;
begin
if Nlen > Right.Max_Length then
raise Ada.Strings.Length_Error;
else
Result.Current_Length := Nlen;
if Nlen > 0 then
for J in 1 .. Left loop
Result.Data (Pos .. Pos + Rlen - 1) :=
Right.Data (1 .. Rlen);
Pos := Pos + Rlen;
end loop;
end if;
end if;
return Result;
end Times;
---------------------
-- To_Super_String --
---------------------
function To_Super_String
(Source : String;
Max_Length : Natural;
Drop : Truncation := Error) return Super_String
is
Result : Super_String (Max_Length);
Slen : constant Natural := Source'Length;
begin
if Slen <= Max_Length then
Result.Current_Length := Slen;
Result.Data (1 .. Slen) := Source;
else
case Drop is
when Strings.Right =>
Result.Current_Length := Max_Length;
Result.Data (1 .. Max_Length) :=
Source (Source'First .. Source'First - 1 + Max_Length);
when Strings.Left =>
Result.Current_Length := Max_Length;
Result.Data (1 .. Max_Length) :=
Source (Source'Last - (Max_Length - 1) .. Source'Last);
when Strings.Error =>
raise Ada.Strings.Length_Error;
end case;
end if;
return Result;
end To_Super_String;
end Ada.Strings.Superbounded;
|
-- This spec has been automatically generated from STM32L4x5.svd
pragma Restrictions (No_Elaboration_Code);
pragma Ada_2012;
pragma Style_Checks (Off);
with HAL;
with System;
package STM32_SVD.OPAMP is
pragma Preelaborate;
---------------
-- Registers --
---------------
subtype OPAMP1_CSR_OPAMODE_Field is HAL.UInt2;
subtype OPAMP1_CSR_PGA_GAIN_Field is HAL.UInt2;
subtype OPAMP1_CSR_VM_SEL_Field is HAL.UInt2;
-- OPAMP1 control/status register
type OPAMP1_CSR_Register is record
-- Operational amplifier Enable
OPAEN : Boolean := False;
-- Operational amplifier Low Power Mode
OPALPM : Boolean := False;
-- Operational amplifier PGA mode
OPAMODE : OPAMP1_CSR_OPAMODE_Field := 16#0#;
-- Operational amplifier Programmable amplifier gain value
PGA_GAIN : OPAMP1_CSR_PGA_GAIN_Field := 16#0#;
-- unspecified
Reserved_6_7 : HAL.UInt2 := 16#0#;
-- Inverting input selection
VM_SEL : OPAMP1_CSR_VM_SEL_Field := 16#0#;
-- Non inverted input selection
VP_SEL : Boolean := False;
-- unspecified
Reserved_11_11 : HAL.Bit := 16#0#;
-- Calibration mode enabled
CALON : Boolean := False;
-- Calibration selection
CALSEL : Boolean := False;
-- allows to switch from AOP offset trimmed values to AOP offset
USERTRIM : Boolean := False;
-- Operational amplifier calibration output
CALOUT : Boolean := False;
-- unspecified
Reserved_16_30 : HAL.UInt15 := 16#0#;
-- Operational amplifier power supply range for stability
OPA_RANGE : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for OPAMP1_CSR_Register use record
OPAEN at 0 range 0 .. 0;
OPALPM at 0 range 1 .. 1;
OPAMODE at 0 range 2 .. 3;
PGA_GAIN at 0 range 4 .. 5;
Reserved_6_7 at 0 range 6 .. 7;
VM_SEL at 0 range 8 .. 9;
VP_SEL at 0 range 10 .. 10;
Reserved_11_11 at 0 range 11 .. 11;
CALON at 0 range 12 .. 12;
CALSEL at 0 range 13 .. 13;
USERTRIM at 0 range 14 .. 14;
CALOUT at 0 range 15 .. 15;
Reserved_16_30 at 0 range 16 .. 30;
OPA_RANGE at 0 range 31 .. 31;
end record;
subtype OPAMP1_OTR_TRIMOFFSETN_Field is HAL.UInt5;
subtype OPAMP1_OTR_TRIMOFFSETP_Field is HAL.UInt5;
-- OPAMP1 offset trimming register in normal mode
type OPAMP1_OTR_Register is record
-- Trim for NMOS differential pairs
TRIMOFFSETN : OPAMP1_OTR_TRIMOFFSETN_Field := 16#0#;
-- unspecified
Reserved_5_7 : HAL.UInt3 := 16#0#;
-- Trim for PMOS differential pairs
TRIMOFFSETP : OPAMP1_OTR_TRIMOFFSETP_Field := 16#0#;
-- unspecified
Reserved_13_31 : HAL.UInt19 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for OPAMP1_OTR_Register use record
TRIMOFFSETN at 0 range 0 .. 4;
Reserved_5_7 at 0 range 5 .. 7;
TRIMOFFSETP at 0 range 8 .. 12;
Reserved_13_31 at 0 range 13 .. 31;
end record;
subtype OPAMP1_LPOTR_TRIMLPOFFSETN_Field is HAL.UInt5;
subtype OPAMP1_LPOTR_TRIMLPOFFSETP_Field is HAL.UInt5;
-- OPAMP1 offset trimming register in low-power mode
type OPAMP1_LPOTR_Register is record
-- Trim for NMOS differential pairs
TRIMLPOFFSETN : OPAMP1_LPOTR_TRIMLPOFFSETN_Field := 16#0#;
-- unspecified
Reserved_5_7 : HAL.UInt3 := 16#0#;
-- Trim for PMOS differential pairs
TRIMLPOFFSETP : OPAMP1_LPOTR_TRIMLPOFFSETP_Field := 16#0#;
-- unspecified
Reserved_13_31 : HAL.UInt19 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for OPAMP1_LPOTR_Register use record
TRIMLPOFFSETN at 0 range 0 .. 4;
Reserved_5_7 at 0 range 5 .. 7;
TRIMLPOFFSETP at 0 range 8 .. 12;
Reserved_13_31 at 0 range 13 .. 31;
end record;
subtype OPAMP2_CSR_OPAMODE_Field is HAL.UInt2;
subtype OPAMP2_CSR_PGA_GAIN_Field is HAL.UInt2;
subtype OPAMP2_CSR_VM_SEL_Field is HAL.UInt2;
-- OPAMP2 control/status register
type OPAMP2_CSR_Register is record
-- Operational amplifier Enable
OPAEN : Boolean := False;
-- Operational amplifier Low Power Mode
OPALPM : Boolean := False;
-- Operational amplifier PGA mode
OPAMODE : OPAMP2_CSR_OPAMODE_Field := 16#0#;
-- Operational amplifier Programmable amplifier gain value
PGA_GAIN : OPAMP2_CSR_PGA_GAIN_Field := 16#0#;
-- unspecified
Reserved_6_7 : HAL.UInt2 := 16#0#;
-- Inverting input selection
VM_SEL : OPAMP2_CSR_VM_SEL_Field := 16#0#;
-- Non inverted input selection
VP_SEL : Boolean := False;
-- unspecified
Reserved_11_11 : HAL.Bit := 16#0#;
-- Calibration mode enabled
CALON : Boolean := False;
-- Calibration selection
CALSEL : Boolean := False;
-- allows to switch from AOP offset trimmed values to AOP offset
USERTRIM : Boolean := False;
-- Operational amplifier calibration output
CALOUT : Boolean := False;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for OPAMP2_CSR_Register use record
OPAEN at 0 range 0 .. 0;
OPALPM at 0 range 1 .. 1;
OPAMODE at 0 range 2 .. 3;
PGA_GAIN at 0 range 4 .. 5;
Reserved_6_7 at 0 range 6 .. 7;
VM_SEL at 0 range 8 .. 9;
VP_SEL at 0 range 10 .. 10;
Reserved_11_11 at 0 range 11 .. 11;
CALON at 0 range 12 .. 12;
CALSEL at 0 range 13 .. 13;
USERTRIM at 0 range 14 .. 14;
CALOUT at 0 range 15 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype OPAMP2_OTR_TRIMOFFSETN_Field is HAL.UInt5;
subtype OPAMP2_OTR_TRIMOFFSETP_Field is HAL.UInt5;
-- OPAMP2 offset trimming register in normal mode
type OPAMP2_OTR_Register is record
-- Trim for NMOS differential pairs
TRIMOFFSETN : OPAMP2_OTR_TRIMOFFSETN_Field := 16#0#;
-- unspecified
Reserved_5_7 : HAL.UInt3 := 16#0#;
-- Trim for PMOS differential pairs
TRIMOFFSETP : OPAMP2_OTR_TRIMOFFSETP_Field := 16#0#;
-- unspecified
Reserved_13_31 : HAL.UInt19 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for OPAMP2_OTR_Register use record
TRIMOFFSETN at 0 range 0 .. 4;
Reserved_5_7 at 0 range 5 .. 7;
TRIMOFFSETP at 0 range 8 .. 12;
Reserved_13_31 at 0 range 13 .. 31;
end record;
subtype OPAMP2_LPOTR_TRIMLPOFFSETN_Field is HAL.UInt5;
subtype OPAMP2_LPOTR_TRIMLPOFFSETP_Field is HAL.UInt5;
-- OPAMP2 offset trimming register in low-power mode
type OPAMP2_LPOTR_Register is record
-- Trim for NMOS differential pairs
TRIMLPOFFSETN : OPAMP2_LPOTR_TRIMLPOFFSETN_Field := 16#0#;
-- unspecified
Reserved_5_7 : HAL.UInt3 := 16#0#;
-- Trim for PMOS differential pairs
TRIMLPOFFSETP : OPAMP2_LPOTR_TRIMLPOFFSETP_Field := 16#0#;
-- unspecified
Reserved_13_31 : HAL.UInt19 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for OPAMP2_LPOTR_Register use record
TRIMLPOFFSETN at 0 range 0 .. 4;
Reserved_5_7 at 0 range 5 .. 7;
TRIMLPOFFSETP at 0 range 8 .. 12;
Reserved_13_31 at 0 range 13 .. 31;
end record;
-----------------
-- Peripherals --
-----------------
-- Operational amplifiers
type OPAMP_Peripheral is record
-- OPAMP1 control/status register
OPAMP1_CSR : aliased OPAMP1_CSR_Register;
-- OPAMP1 offset trimming register in normal mode
OPAMP1_OTR : aliased OPAMP1_OTR_Register;
-- OPAMP1 offset trimming register in low-power mode
OPAMP1_LPOTR : aliased OPAMP1_LPOTR_Register;
-- OPAMP2 control/status register
OPAMP2_CSR : aliased OPAMP2_CSR_Register;
-- OPAMP2 offset trimming register in normal mode
OPAMP2_OTR : aliased OPAMP2_OTR_Register;
-- OPAMP2 offset trimming register in low-power mode
OPAMP2_LPOTR : aliased OPAMP2_LPOTR_Register;
end record
with Volatile;
for OPAMP_Peripheral use record
OPAMP1_CSR at 16#0# range 0 .. 31;
OPAMP1_OTR at 16#4# range 0 .. 31;
OPAMP1_LPOTR at 16#8# range 0 .. 31;
OPAMP2_CSR at 16#10# range 0 .. 31;
OPAMP2_OTR at 16#14# range 0 .. 31;
OPAMP2_LPOTR at 16#18# range 0 .. 31;
end record;
-- Operational amplifiers
OPAMP_Periph : aliased OPAMP_Peripheral
with Import, Address => System'To_Address (16#40007800#);
end STM32_SVD.OPAMP;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . S E Q U E N T I A L _ I O --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2006, 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. --
-- --
-- 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. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with System.File_IO;
with Unchecked_Deallocation;
package body System.Sequential_IO is
subtype AP is FCB.AFCB_Ptr;
package FIO renames System.File_IO;
-------------------
-- AFCB_Allocate --
-------------------
function AFCB_Allocate
(Control_Block : Sequential_AFCB) return FCB.AFCB_Ptr
is
pragma Warnings (Off, Control_Block);
begin
return new Sequential_AFCB;
end AFCB_Allocate;
----------------
-- AFCB_Close --
----------------
-- No special processing required for Sequential_IO close
procedure AFCB_Close (File : access Sequential_AFCB) is
pragma Warnings (Off, File);
begin
null;
end AFCB_Close;
---------------
-- AFCB_Free --
---------------
procedure AFCB_Free (File : access Sequential_AFCB) is
type FCB_Ptr is access all Sequential_AFCB;
FT : FCB_Ptr := FCB_Ptr (File);
procedure Free is new
Unchecked_Deallocation (Sequential_AFCB, FCB_Ptr);
begin
Free (FT);
end AFCB_Free;
------------
-- Create --
------------
procedure Create
(File : in out File_Type;
Mode : FCB.File_Mode := FCB.Out_File;
Name : String := "";
Form : String := "")
is
Dummy_File_Control_Block : Sequential_AFCB;
pragma Warnings (Off, Dummy_File_Control_Block);
-- Yes, we know this is never assigned a value, only the tag
-- is used for dispatching purposes, so that's expected.
begin
FIO.Open (File_Ptr => AP (File),
Dummy_FCB => Dummy_File_Control_Block,
Mode => Mode,
Name => Name,
Form => Form,
Amethod => 'Q',
Creat => True,
Text => False);
end Create;
----------
-- Open --
----------
procedure Open
(File : in out File_Type;
Mode : FCB.File_Mode;
Name : String;
Form : String := "")
is
Dummy_File_Control_Block : Sequential_AFCB;
pragma Warnings (Off, Dummy_File_Control_Block);
-- Yes, we know this is never assigned a value, only the tag
-- is used for dispatching purposes, so that's expected.
begin
FIO.Open (File_Ptr => AP (File),
Dummy_FCB => Dummy_File_Control_Block,
Mode => Mode,
Name => Name,
Form => Form,
Amethod => 'Q',
Creat => False,
Text => False);
end Open;
----------
-- Read --
----------
-- Not used, since Sequential_IO files are not used as streams
procedure Read
(File : in out Sequential_AFCB;
Item : out Ada.Streams.Stream_Element_Array;
Last : out Ada.Streams.Stream_Element_Offset)
is
begin
raise Program_Error;
end Read;
-----------
-- Write --
-----------
-- Not used, since Sequential_IO files are not used as streams
procedure Write
(File : in out Sequential_AFCB;
Item : Ada.Streams.Stream_Element_Array)
is
begin
raise Program_Error;
end Write;
end System.Sequential_IO;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S Y S T E M . P O O L _ G L O B A L --
-- --
-- S p e c --
-- --
-- $Revision$
-- --
-- Copyright (C) 1992,1993,1994 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. --
-- --
-- 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. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with System;
with System.Storage_Pools;
with System.Storage_Elements;
package System.Pool_Global is
pragma Elaborate_Body;
-- Needed to ensure that library routines can execute allocators
-- Allocation strategy:
-- Call to malloc/free for each Allocate/Deallocate
-- no user specifiable size
-- no automatic reclaim
-- minimal overhead
-- Default pool in the compiler for access types globally declared
type Unbounded_No_Reclaim_Pool is new
System.Storage_Pools.Root_Storage_Pool with null record;
function Storage_Size
(Pool : Unbounded_No_Reclaim_Pool)
return System.Storage_Elements.Storage_Count;
procedure Allocate
(Pool : in out Unbounded_No_Reclaim_Pool;
Address : out System.Address;
Storage_Size : System.Storage_Elements.Storage_Count;
Alignment : System.Storage_Elements.Storage_Count);
procedure Deallocate
(Pool : in out Unbounded_No_Reclaim_Pool;
Address : System.Address;
Storage_Size : System.Storage_Elements.Storage_Count;
Alignment : System.Storage_Elements.Storage_Count);
-- Pool object for the compiler
Global_Pool_Object : Unbounded_No_Reclaim_Pool;
end System.Pool_Global;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- A D A . E X C E P T I O N S . C A L L _ C H A I N --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2021, 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. --
-- --
-- --
-- --
-- --
-- --
-- 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 version is for the AE653 Level A run time and for bare board targets
pragma Warnings (Off);
-- Allow withing of non-Preelaborated units in Ada 2005 mode where this
-- package will be categorized as Preelaborate. See AI-362 for details.
-- It is safe in the context of the run-time to violate the rules.
with System.Traceback;
with Ada.Exceptions.Traceback;
pragma Warnings (On);
separate (Ada.Exceptions)
procedure Call_Chain (Excep : EOA) is
Exception_Tracebacks : Integer;
pragma Import (C, Exception_Tracebacks, "__gl_exception_tracebacks");
-- Boolean indicating whether tracebacks should be stored in exception
-- occurrences.
Local_Traceback : Traceback.Tracebacks_Array (1 .. Max_Tracebacks);
-- Introduce an intermediate copy of the traceback. The call to Call_Chain
-- requires a parameter of type Ada.Exceptions.Traceback.Tracebacks_Array,
-- and the result must be stored in an exception occurrence that has a
-- component of type Ada.Exceptions.Tracebacks_Array. View conversions
-- between these two types are not allowed by Ada 2005 (see RM 4.6 par.
-- 24) because these types have a component of private type (Address).
-- Hence we need to do explicit type conversions.
-- ???This conversion should no longer be necessary.
begin
if Exception_Tracebacks /= 0 and then Excep.Num_Tracebacks = 0 then
-- If Exception_Tracebacks = 0 then the program was not compiled for
-- storing tracebacks in exception occurrences (-bargs -E switch) so
-- that we do not generate them. If Num_Tracebacks > 0 then this is
-- a reraise, so we should not regenerate the traceback.
-- We ask System.Traceback.Call_Chain to skip 5 frames to ensure that
-- itself, ourselves and our caller and its caller are not part of the
-- result. Our caller is always an exception propagation actor that we
-- don't want to see, and it may be part of a separate subunit which
-- pulls it outside the AAA/ZZZ range.
System.Traceback.Call_Chain
(Traceback => Local_Traceback,
Max_Len => Max_Tracebacks,
Len => Excep.Num_Tracebacks,
Exclude_Min => Code_Address_For_AAA,
Exclude_Max => Code_Address_For_ZZZ,
Skip_Frames => 5);
-- Copy the resulting traceback to the exception occurrence
Excep.Tracebacks (1 .. Excep.Num_Tracebacks) :=
Ada.Exceptions.Tracebacks_Array
(Local_Traceback (1 .. Excep.Num_Tracebacks));
end if;
end Call_Chain;
|
-------------------------------------------------------------------------------
-- 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 Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Ada.Text_IO;
with Ada.Unchecked_Deallocation;
with Interfaces; use Interfaces;
with Keccak.Types;
with Test_Vectors; use Test_Vectors;
package body Duplex_Runner
is
procedure Free is new Ada.Unchecked_Deallocation
(Object => Keccak.Types.Byte_Array,
Name => Byte_Array_Access);
procedure Run_Tests (File_Name : in String;
Capacity : in Positive;
Num_Passed : out Natural;
Num_Failed : out Natural)
is
use type Keccak.Types.Byte_Array;
package Integer_IO is new Ada.Text_IO.Integer_IO(Integer);
InLen_Key : constant Unbounded_String := To_Unbounded_String("InLen");
In_Key : constant Unbounded_String := To_Unbounded_String("In");
OutLen_Key : constant Unbounded_String := To_Unbounded_String("OutLen");
Out_Key : constant Unbounded_String := To_Unbounded_String("Out");
Schema : Test_Vectors.Schema_Maps.Map;
Tests : Test_Vectors.Lists.List;
Ctx : Duplex.Context;
Output : Byte_Array_Access;
OutLen : Natural;
begin
Num_Passed := 0;
Num_Failed := 0;
-- Setup schema
Schema.Insert (Key => InLen_Key,
New_Item => Schema_Entry'(VType => Integer_Type,
Required => True,
Is_List => False));
Schema.Insert (Key => In_Key,
New_Item => Schema_Entry'(VType => Hex_Array_Type,
Required => True,
Is_List => False));
Schema.Insert (Key => OutLen_Key,
New_Item => Schema_Entry'(VType => Integer_Type,
Required => True,
Is_List => False));
Schema.Insert (Key => Out_Key,
New_Item => Schema_Entry'(VType => Hex_Array_Type,
Required => True,
Is_List => False));
-- Load the test file using the file name given on the command line
Ada.Text_IO.Put_Line("Loading file: " & File_Name);
Test_Vectors.Load (File_Name => File_Name,
Schema => Schema,
Vectors_List => Tests);
Ada.Text_IO.Put ("Running ");
Integer_IO.Put (Integer (Tests.Length), Width => 0);
Ada.Text_IO.Put_Line (" tests ...");
Duplex.Init (Ctx => Ctx,
Capacity => Capacity);
-- Run each test.
--
-- Note: The tests must be executed in the correct order, since each
-- KAT test continues from the state of the previous test.
-- This is why the context is only initialized once before the
-- tests start (see above).
for C of Tests loop
Output := new Keccak.Types.Byte_Array (C.Element (Out_Key).First_Element.Hex.all'Range);
Duplex.Duplex (Ctx => Ctx,
In_Data => C.Element (In_Key).First_Element.Hex.all,
In_Data_Bit_Length => C.Element (InLen_Key).First_Element.Int,
Out_Data => Output.all,
Out_Data_Bit_Length => C.Element (OutLen_Key).First_Element.Int);
-- Mask any unused bits from the output.
OutLen := C.Element (OutLen_Key).First_Element.Int;
if OutLen mod 8 /= 0 then
Output.all(Output.all'Last) := Output.all(Output.all'Last) and Keccak.Types.Byte((2**(OutLen mod 8)) - 1);
end if;
-- Check output
if Output.all = C.Element(Out_Key).First_Element.Hex.all then
Num_Passed := Num_Passed + 1;
else
Num_Failed := Num_Failed + 1;
-- Display a message on failure to help with debugging.
Ada.Text_IO.Put("FAILURE (Input bit-len: ");
Integer_IO.Put(C.Element (InLen_Key).First_Element.Int, Width => 0);
Ada.Text_IO.Put_Line(")");
Ada.Text_IO.Put(" Expected MD: ");
Ada.Text_IO.Put(Byte_Array_To_String (C.Element(Out_Key).First_Element.Hex.all));
Ada.Text_IO.New_Line;
Ada.Text_IO.Put(" Actual MD: ");
Ada.Text_IO.Put(Byte_Array_To_String(Output.all));
Ada.Text_IO.New_Line;
end if;
Free (Output);
end loop;
end Run_Tests;
end Duplex_Runner;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S E M _ C H 2 --
-- --
-- B o d y --
-- --
-- $Revision$
-- --
-- Copyright (C) 1992-1999, 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 Atree; use Atree;
with Opt; use Opt;
with Restrict; use Restrict;
with Sem_Ch8; use Sem_Ch8;
with Sinfo; use Sinfo;
with Stand; use Stand;
package body Sem_Ch2 is
-------------------------------
-- Analyze_Character_Literal --
-------------------------------
procedure Analyze_Character_Literal (N : Node_Id) is
begin
-- The type is eventually inherited from the context. If expansion
-- has already established the proper type, do not modify it.
if No (Etype (N)) then
Set_Etype (N, Any_Character);
end if;
Set_Is_Static_Expression (N);
if Comes_From_Source (N)
and then not In_Character_Range (Char_Literal_Value (N))
then
Check_Restriction (No_Wide_Characters, N);
end if;
end Analyze_Character_Literal;
------------------------
-- Analyze_Identifier --
------------------------
procedure Analyze_Identifier (N : Node_Id) is
begin
Find_Direct_Name (N);
end Analyze_Identifier;
-----------------------------
-- Analyze_Integer_Literal --
-----------------------------
procedure Analyze_Integer_Literal (N : Node_Id) is
begin
Set_Etype (N, Universal_Integer);
Set_Is_Static_Expression (N);
end Analyze_Integer_Literal;
--------------------------
-- Analyze_Real_Literal --
--------------------------
procedure Analyze_Real_Literal (N : Node_Id) is
begin
Set_Etype (N, Universal_Real);
Set_Is_Static_Expression (N);
end Analyze_Real_Literal;
----------------------------
-- Analyze_String_Literal --
----------------------------
procedure Analyze_String_Literal (N : Node_Id) is
begin
-- The type is eventually inherited from the context. If expansion
-- has already established the proper type, do not modify it.
if No (Etype (N)) then
Set_Etype (N, Any_String);
end if;
-- String literals are static in Ada 95. Note that if the subtype
-- turns out to be non-static, then the Is_Static_Expression flag
-- will be reset in Eval_String_Literal.
if Ada_95 then
Set_Is_Static_Expression (N);
end if;
if Comes_From_Source (N) and then Has_Wide_Character (N) then
Check_Restriction (No_Wide_Characters, N);
end if;
end Analyze_String_Literal;
end Sem_Ch2;
|
--------------------------------------------------------------------------------------------------------------------
-- Copyright (c) 2013-2020, Luke A. Guest
--
-- This software is provided 'as-is', without any express or implied
-- warranty. In no event will the authors be held liable for any damages
-- arising from the use of this software.
--
-- Permission is granted to anyone to use this software for any purpose,
-- including commercial applications, and to alter it and redistribute it
-- freely, subject to the following restrictions:
--
-- 1. The origin of this software must not be misrepresented; you must not
-- claim that you wrote the original software. If you use this software
-- in a product, an acknowledgment in the product documentation would be
-- appreciated but is not required.
--
-- 2. Altered source versions must be plainly marked as such, and must not be
-- misrepresented as being the original software.
--
-- 3. This notice may not be removed or altered from any source
-- distribution.
--------------------------------------------------------------------------------------------------------------------
-- SDL.Video.Displays
--
-- Access to display information including video displays and resolutions.
--------------------------------------------------------------------------------------------------------------------
with Interfaces.C;
with SDL.Video.Pixel_Formats;
with SDL.Video.Rectangles;
with System;
package SDL.Video.Displays is
pragma Preelaborate;
package C renames Interfaces.C;
type Refresh_Rates is range 0 .. 400 with
Convention => C;
type Mode is
record
Format : SDL.Video.Pixel_Formats.Pixel_Format_Names;
Width : C.int;
Height : C.int;
Refresh_Rate : Refresh_Rates;
Driver_Data : System.Address; -- TODO: Somehow make this a real type.
end record with
Convention => C;
type Access_Mode is access all Mode with
Convention => C;
-- Video displays.
type Display_Indices is new Positive;
function Total return Display_Indices;
function Closest_Mode (Display : in Display_Indices; Wanted : in Mode; Target : out Mode) return Boolean;
function Current_Mode (Display : in Display_Indices; Target : out Mode) return Boolean;
function Desktop_Mode (Display : in Display_Indices; Target : out Mode) return Boolean;
function Display_Mode (Display : in Display_Indices; Index : in Natural; Target : out Mode) return Boolean;
function Total_Display_Modes (Display : in Display_Indices; Total : out Positive) return Boolean;
function Display_Bounds (Display : in Display_Indices; Bounds : out Rectangles.Rectangle) return Boolean;
end SDL.Video.Displays;
|
with Ada.Directories.Equal_File_Names;
with Ada.Directories.Hierarchical_File_Names;
with Ada.Directories.Less_File_Names;
with Ada.Directories.Volumes;
with Ada.Hierarchical_File_Names;
procedure filename is
Windows : constant Boolean := Ada.Hierarchical_File_Names.Is_Path_Delimiter ('\');
package AD renames Ada.Directories;
package ADH renames Ada.Directories.Hierarchical_File_Names;
package AH renames Ada.Hierarchical_File_Names;
begin
pragma Assert (AH.Unchecked_Containing_Directory ("") = "");
pragma Assert (AH.Unchecked_Containing_Directory ("A") = "");
pragma Assert (AH.Unchecked_Containing_Directory ("A/") = "A");
pragma Assert (AD.Containing_Directory ("A/B") = "A");
pragma Assert (AH.Unchecked_Containing_Directory ("A/B/") = "A/B");
pragma Assert (Windows or else AD.Containing_Directory ("A//B") = "A");
pragma Assert (AH.Unchecked_Containing_Directory ("/") = "/");
pragma Assert (Windows or else AH.Unchecked_Containing_Directory ("//") = "/");
pragma Assert (AD.Containing_Directory ("/A") = "/");
pragma Assert (AD.Containing_Directory ("/A/B") = "/A");
pragma Assert (AH.Unchecked_Containing_Directory ("/A/B/") = "/A/B");
pragma Assert (Windows or else AD.Containing_Directory ("/A//B") = "/A");
if Windows then
pragma Assert (AH.Unchecked_Containing_Directory ("C:") = "C:");
pragma Assert (AH.Unchecked_Containing_Directory ("C:\") = "C:\");
pragma Assert (AD.Containing_Directory ("C:A") = "C:");
pragma Assert (AD.Containing_Directory ("C:\A") = "C:\");
pragma Assert (AH.Unchecked_Containing_Directory ("\\HOST\S") = "\\HOST\S");
pragma Assert (AH.Unchecked_Containing_Directory ("\\HOST\S\") = "\\HOST\S\");
pragma Assert (AD.Containing_Directory ("\\HOST\S\A") = "\\HOST\S\");
null;
end if;
pragma Assert (AH.Unchecked_Simple_Name ("") = "");
pragma Assert (AD.Simple_Name ("A") = "A");
pragma Assert (AH.Unchecked_Simple_Name ("A/") = "");
pragma Assert (AD.Simple_Name ("A/B") = "B");
pragma Assert (AH.Unchecked_Simple_Name ("A/B/") = "");
pragma Assert (AD.Simple_Name ("A//B") = "B");
pragma Assert (AH.Unchecked_Simple_Name ("/") = "");
pragma Assert (AH.Unchecked_Simple_Name ("//") = "");
pragma Assert (AD.Simple_Name ("/A") = "A");
pragma Assert (AD.Simple_Name ("/A/B") = "B");
pragma Assert (AH.Unchecked_Simple_Name ("/A/B/") = "");
pragma Assert (AD.Simple_Name ("/A//B") = "B");
if Windows then
pragma Assert (AH.Unchecked_Simple_Name ("C:") = "");
pragma Assert (AD.Simple_Name ("C:A") = "A");
pragma Assert (AD.Simple_Name ("C:\A") = "A");
pragma Assert (AH.Unchecked_Simple_Name ("\\HOST\S") = "");
pragma Assert (AD.Simple_Name ("\\HOST\S\A") = "A");
null;
end if;
pragma Assert (AD.Base_Name ("README") = "README");
pragma Assert (AD.Base_Name ("README.") = "README.");
pragma Assert (AD.Base_Name ("README.TXT") = "README");
pragma Assert (AD.Base_Name (".TXT") = ".TXT");
pragma Assert (AD.Base_Name ("DIR/.TXT") = ".TXT");
pragma Assert (AD.Base_Name (".") = ".");
pragma Assert (AD.Base_Name ("..") = "..");
if Windows then
pragma Assert (AD.Base_Name ("C:.TXT") = ".TXT");
null;
end if;
pragma Assert (AD.Extension ("README") = "");
pragma Assert (AD.Extension ("README.") = "");
pragma Assert (AD.Extension ("README.TXT") = "TXT");
pragma Assert (AD.Extension (".TXT") = "");
pragma Assert (AD.Extension ("DIR/.TXT") = "");
pragma Assert (AD.Extension (".") = "");
pragma Assert (AD.Extension ("..") = "");
if Windows then
pragma Assert (AD.Extension ("C:.TXT") = "");
null;
end if;
pragma Assert (ADH.Initial_Directory ("") = "");
pragma Assert (ADH.Initial_Directory ("A") = "A");
pragma Assert (ADH.Initial_Directory ("A/") = "A");
pragma Assert (ADH.Initial_Directory ("A/B") = "A");
pragma Assert (ADH.Initial_Directory ("A/B/") = "A");
pragma Assert (ADH.Initial_Directory ("A//B") = "A");
pragma Assert (ADH.Initial_Directory ("/") = "/");
pragma Assert (Windows or else ADH.Initial_Directory ("//") = "/");
pragma Assert (ADH.Initial_Directory ("/A") = "/");
pragma Assert (ADH.Initial_Directory ("/A/B") = "/");
pragma Assert (ADH.Initial_Directory ("/A/B/") = "/");
pragma Assert (ADH.Initial_Directory ("/A//B") = "/");
pragma Assert (AH.Unchecked_Relative_Name ("") = "");
pragma Assert (AH.Unchecked_Relative_Name ("A") = "");
pragma Assert (AH.Unchecked_Relative_Name ("A/") = "");
pragma Assert (ADH.Relative_Name ("A/B") = "B");
pragma Assert (ADH.Relative_Name ("A/B/") = "B/");
pragma Assert (Windows or else ADH.Relative_Name ("A//B") = "B");
pragma Assert (AH.Unchecked_Relative_Name ("/") = "");
pragma Assert (Windows or else AH.Unchecked_Relative_Name ("//") = "");
pragma Assert (ADH.Relative_Name ("/A") = "A");
pragma Assert (ADH.Relative_Name ("/A/B") = "A/B");
pragma Assert (ADH.Relative_Name ("/A/B/") = "A/B/");
pragma Assert (ADH.Relative_Name ("/A//B") = "A//B");
begin
declare
Dummy : constant String := AD.Compose ("A", "B/C");
begin
raise Program_Error; -- NG
end;
exception
when AD.Name_Error => null; -- OK
end;
pragma Assert (ADH.Compose ("", "", "") = "");
pragma Assert (ADH.Compose ("", "../A") = "../A");
pragma Assert (ADH.Compose ("/", "../A") = "/../A");
pragma Assert (ADH.Compose ("./", "../A") = "./../A");
if Windows then
pragma Assert (ADH.Compose ("A", "B", "C") = "A\B.C");
pragma Assert (ADH.Compose ("A", "../B") = "A\../B");
pragma Assert (ADH.Compose ("A/B", "../C") = "A/B\../C");
null;
else
pragma Assert (ADH.Compose ("A", "B", "C") = "A/B.C");
pragma Assert (ADH.Compose ("A", "../B") = "A/../B");
pragma Assert (ADH.Compose ("A/B", "../C") = "A/B/../C");
null;
end if;
pragma Assert (AH.Normalized_Compose ("", "", "") = "");
pragma Assert (AH.Normalized_Compose (".", "A") = "A");
pragma Assert (AH.Normalized_Compose ("./", "A") = "A");
pragma Assert (AH.Normalized_Compose ("A", "..") = ".");
pragma Assert (AH.Normalized_Compose ("A", "../B") = "B");
if Windows then
pragma Assert (AH.Normalized_Compose ("", "../A") = "..\A");
pragma Assert (AH.Normalized_Compose ("A", "B", "C") = "A\B.C");
pragma Assert (AH.Normalized_Compose ("A/B", "../C") = "A\C");
pragma Assert (AH.Normalized_Compose ("/", "../A") = "/..\A");
null;
else
pragma Assert (AH.Normalized_Compose ("", "../A") = "../A");
pragma Assert (AH.Normalized_Compose ("A", "B", "C") = "A/B.C");
pragma Assert (AH.Normalized_Compose ("A/B", "../C") = "A/C");
pragma Assert (AH.Normalized_Compose ("/", "../A") = "/../A");
null;
end if;
pragma Assert (AH.Relative_Name ("A", "A") = ".");
pragma Assert (AH.Relative_Name ("A/B", "A") = "B");
pragma Assert (AH.Relative_Name ("/A", "/A") = ".");
pragma Assert (AH.Relative_Name ("/A/B", "/A") = "B");
pragma Assert (AH.Relative_Name ("A", "") = "A");
pragma Assert (AH.Relative_Name ("A", ".") = "A");
pragma Assert (AH.Relative_Name ("", "") = ".");
pragma Assert (AH.Relative_Name ("", ".") = ".");
pragma Assert (AH.Relative_Name ("", "A") = "..");
pragma Assert (AH.Relative_Name (".", "A") = "..");
if Windows then
pragma Assert (AH.Relative_Name ("A", "B") = "..\A");
pragma Assert (AH.Relative_Name ("A/B", "A/C") = "..\B");
pragma Assert (AH.Relative_Name ("/A", "/B") = "..\A");
pragma Assert (AH.Relative_Name ("/A/B", "/A/C") = "..\B");
pragma Assert (AH.Relative_Name ("../A", "B") = "..\../A");
pragma Assert (AH.Relative_Name ("../A", "../B") = "..\A");
pragma Assert (AH.Relative_Name ("A", "B/C") = "..\..\A");
null;
else
pragma Assert (AH.Relative_Name ("A", "B") = "../A");
pragma Assert (AH.Relative_Name ("A/B", "A/C") = "../B");
pragma Assert (AH.Relative_Name ("/A", "/B") = "../A");
pragma Assert (AH.Relative_Name ("/A/B", "/A/C") = "../B");
pragma Assert (AH.Relative_Name ("../A", "B") = "../../A");
pragma Assert (AH.Relative_Name ("../A", "../B") = "../A");
pragma Assert (AH.Relative_Name ("A", "B/C") = "../../A");
null;
end if;
begin
declare
Dummy : constant String := AH.Relative_Name ("A", "..");
begin
raise Program_Error; -- NG
end;
exception
when AD.Use_Error => null; -- OK
end;
if not Windows then
pragma Assert (AH.Relative_Name ("A/B", "C/../D") = "../A/B");
Ada.Debug.Put (AH.Relative_Name ("A/B", "C/../A")); -- "../A/B", it should be normalized to "B" ?
end if;
if Windows then
-- drive letters
Ada.Debug.Put ("test for drive letter");
pragma Assert (ADH.Is_Full_Name ("C:\"));
pragma Assert (ADH.Is_Full_Name ("C:\autoexec.bat"));
pragma Assert (ADH.Is_Full_Name ("\\host\share\"));
pragma Assert (ADH.Is_Full_Name ("\\host\share\filename"));
pragma Assert (ADH.Is_Root_Directory_Name ("C:\"));
pragma Assert (not ADH.Is_Root_Directory_Name ("C:\autoexec.bat"));
pragma Assert (ADH.Is_Root_Directory_Name ("\\host\share\"));
pragma Assert (not ADH.Is_Root_Directory_Name ("\\host\share\filename"));
pragma Assert (ADH.Initial_Directory ("C:\") = "C:\");
pragma Assert (ADH.Initial_Directory ("C:\autoexec.bat") = "C:\");
pragma Assert (ADH.Initial_Directory ("\\host\share\") = "\\host\share\");
pragma Assert (ADH.Initial_Directory ("\\host\share\filename") = "\\host\share\");
pragma Assert (AH.Unchecked_Relative_Name ("C:\") = "");
pragma Assert (ADH.Relative_Name ("C:\autoexec.bat") = "autoexec.bat");
pragma Assert (AH.Unchecked_Relative_Name ("\\host\share\") = "");
pragma Assert (ADH.Relative_Name ("\\host\share\filename") = "filename");
pragma Assert (AH.Relative_Name ("C:\A", "D:\B") = "C:\A");
end if;
pragma Assert (AH.Parent_Directory ("A") = ".");
pragma Assert (AH.Parent_Directory ("A/") = ".");
pragma Assert (AH.Parent_Directory ("A/.") = ".");
pragma Assert (AH.Parent_Directory ("A/B") = "A");
pragma Assert (AH.Parent_Directory ("A/B/") = "A");
pragma Assert (AH.Parent_Directory ("A/B/.") = "A");
pragma Assert (AH.Parent_Directory ("A/B/C/..") = "A");
pragma Assert (AH.Parent_Directory ("A/B/C/D/../..") = "A");
pragma Assert (AH.Parent_Directory ("") = "..");
pragma Assert (AH.Parent_Directory (".") = "..");
if Windows then
pragma Assert (AH.Parent_Directory ("..") = "..\..");
pragma Assert (AH.Parent_Directory ("./..") = "..\..");
null;
else
pragma Assert (AH.Parent_Directory ("..") = "../..");
pragma Assert (AH.Parent_Directory ("./..") = "../..");
null;
end if;
pragma Assert (AH.Parent_Directory ("/") = "/..");
declare
FS : Ada.Directories.Volumes.File_System :=
Ada.Directories.Volumes.Where ("/");
FS_Name : constant String := Ada.Directories.Volumes.Format_Name (FS);
subtype C is Character;
Full_Width_Upper_A : constant String := (
C'Val (16#ef#), C'Val (16#bc#), C'Val (16#a1#));
Full_Width_Lower_A : constant String := (
C'Val (16#ef#), C'Val (16#bd#), C'Val (16#81#));
Full_Width_Upper_B : constant String := (
C'Val (16#ef#), C'Val (16#bc#), C'Val (16#a2#));
Full_Width_Lower_B : constant String := (
C'Val (16#ef#), C'Val (16#bd#), C'Val (16#82#));
KA_Dakuten : constant String := (
C'Val (16#e3#), C'Val (16#81#), C'Val (16#8b#), C'Val (16#e3#), C'Val (16#82#), C'Val (16#99#));
GA : constant String := (
C'Val (16#e3#), C'Val (16#81#), C'Val (16#8c#));
A_DIAERESIS_DOTBELOW : constant String := (
'A', C'Val (16#cc#), C'Val (16#88#), C'Val (16#cc#), C'Val (16#a3#));
A_DOTBELOW_DIAERESIS : constant String := (
'A', C'Val (16#cc#), C'Val (16#a3#), C'Val (16#cc#), C'Val (16#88#));
begin
Ada.Debug.Put (FS_Name);
if FS_Name = "hfs" then
Ada.Debug.Put ("test for comparing HFS+ filenames");
pragma Assert (AD.Equal_File_Names (FS, "", ""));
pragma Assert (not AD.Equal_File_Names (FS, "", "#"));
pragma Assert (not AD.Equal_File_Names (FS, "#", ""));
pragma Assert (AD.Equal_File_Names (FS, "#", "#"));
pragma Assert (AD.Equal_File_Names (FS, "A", "A"));
pragma Assert (AD.Equal_File_Names (FS, "a", "A"));
pragma Assert (AD.Equal_File_Names (FS, Full_Width_Lower_A, Full_Width_Upper_A));
pragma Assert (not AD.Less_File_Names (FS, "", ""));
pragma Assert (AD.Less_File_Names (FS, "", "#"));
pragma Assert (not AD.Less_File_Names (FS, "#", ""));
pragma Assert (not AD.Less_File_Names (FS, "#", "#"));
pragma Assert (AD.Less_File_Names (FS, Full_Width_Upper_A, Full_Width_Lower_B));
pragma Assert (AD.Less_File_Names (FS, Full_Width_Lower_A, Full_Width_Upper_B));
pragma Assert (AD.Equal_File_Names (FS, (1 => C'Val (16#80#)), "%80"));
pragma Assert (AD.Equal_File_Names (FS, KA_Dakuten, GA));
pragma Assert (AD.Equal_File_Names (FS, A_DIAERESIS_DOTBELOW, A_DOTBELOW_DIAERESIS));
elsif FS_Name = "NTFS" then
Ada.Debug.Put ("test for comparing NTFS filenames");
pragma Assert (AD.Equal_File_Names (FS, "", ""));
pragma Assert (not AD.Equal_File_Names (FS, "", "#"));
pragma Assert (not AD.Equal_File_Names (FS, "#", ""));
pragma Assert (AD.Equal_File_Names (FS, "#", "#"));
pragma Assert (AD.Equal_File_Names (FS, "A", "A"));
pragma Assert (AD.Equal_File_Names (FS, "a", "A"));
pragma Assert (AD.Equal_File_Names (FS, Full_Width_Lower_A, Full_Width_Upper_A));
pragma Assert (not AD.Less_File_Names (FS, "", ""));
pragma Assert (AD.Less_File_Names (FS, "", "#"));
pragma Assert (not AD.Less_File_Names (FS, "#", ""));
pragma Assert (not AD.Less_File_Names (FS, "#", "#"));
pragma Assert (AD.Less_File_Names (FS, Full_Width_Upper_A, Full_Width_Lower_B));
pragma Assert (AD.Less_File_Names (FS, Full_Width_Lower_A, Full_Width_Upper_B));
pragma Assert (not AD.Equal_File_Names (FS, (1 => C'Val (16#80#)), "%80"));
pragma Assert (not AD.Equal_File_Names (FS, KA_Dakuten, GA));
pragma Assert (not AD.Equal_File_Names (FS, A_DIAERESIS_DOTBELOW, A_DOTBELOW_DIAERESIS));
end if;
end;
pragma Debug (Ada.Debug.Put ("OK"));
end filename;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . P A C K _ 0 5 --
-- --
-- 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. --
-- --
------------------------------------------------------------------------------
-- Handling of packed arrays with Component_Size = 5
package System.Pack_05 is
pragma Preelaborate;
Bits : constant := 5;
type Bits_05 is mod 2 ** Bits;
for Bits_05'Size use Bits;
function Get_05 (Arr : System.Address; N : Natural) return Bits_05;
-- Arr is the address of the packed array, N is the zero-based
-- subscript. This element is extracted and returned.
procedure Set_05 (Arr : System.Address; N : Natural; E : Bits_05);
-- Arr is the address of the packed array, N is the zero-based
-- subscript. This element is set to the given value.
end System.Pack_05;
|
with ada.text_io, ada.integer_text_io;
use ada.text_io, ada.integer_text_io;
with diviporrestas;
procedure prueba_diviporrestas is
dividendo, divisor, resto, resultado :integer:=0;
begin
-- caso de prueba 1:
dividendo:=7;
divisor:=3;
put("El resultado de la division es 2 y el resto 1:");
new_line;
put("Y tu programa dice que es:");
diviporrestas(dividendo, divisor, resultado, resto);
put(resultado);
put(resto);
new_line;
-- caso de prueba 2:
dividendo:=0;
divisor:=4;
put("El resultado de la division es 0 y el resto 0:");
new_line;
put("Y tu programa dice que es:");
diviporrestas(dividendo, divisor, resultado, resto);
put(resultado);
put(resto);
new_line;
-- caso de prueba 3:
dividendo:=100;
divisor:=10;
put("El resultado de la division es 10 y el resto 0:");
new_line;
put("Y tu programa dice que es:");
diviporrestas(dividendo, divisor, resultado, resto);
put(resultado);
put(resto);
new_line;
-- caso de prueba 4:
dividendo:=50;
divisor:=11;
put("El resultado de la division es 4 y el resto 6:");
new_line;
put("Y tu programa dice que es:");
diviporrestas(dividendo, divisor, resultado, resto);
put(resultado);
put(resto);
new_line;
-- caso de prueba 5:
dividendo:=50;
divisor:=50;
put("El resultado de la division es 1 y el resto 0:");
new_line;
put("Y tu programa dice que es:");
diviporrestas(dividendo, divisor, resultado, resto);
put(resultado);
put(resto);
new_line;
end prueba_diviporrestas;
|
-------------------------------------------------------------------------------
-- This file is part of libsparkcrypto.
--
-- Copyright (C) 2010, Alexander Senier
-- Copyright (C) 2010, 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 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 Interfaces;
with LSC.Internal.Ops32;
with LSC.Internal.Byteorder32;
with LSC.Internal.AES.Tables;
with LSC.Internal.AES.Print;
with LSC.Internal.Debug;
pragma Unreferenced (LSC.Internal.Debug);
package body LSC.Internal.AES is
----------------------------------------------------------------------------
function Sub_Word (Value : Types.Word32) return Types.Word32
with Pre => True; -- FIXME: Workaround for [N916-032]
function Sub_Word (Value : Types.Word32) return Types.Word32
is
Temp : Types.Byte_Array32_Type;
begin
Temp := Types.Word32_To_Byte_Array32 (Value);
return Ops32.Bytes_To_Word (Byte0 => Tables.S (Temp (3)),
Byte1 => Tables.S (Temp (2)),
Byte2 => Tables.S (Temp (1)),
Byte3 => Tables.S (Temp (0)));
end Sub_Word;
----------------------------------------------------------------------------
function Rot_Word (Value : Types.Word32) return Types.Word32;
function Rot_Word (Value : Types.Word32) return Types.Word32
is
begin
return Interfaces.Rotate_Left (Value, 8);
end Rot_Word;
----------------------------------------------------------------------------
function Enc_Key_Expansion (Key : Key_Type;
Nk : Nk_Type;
Nr : Nr_Type) return Schedule_Type
with
Pre => Key'Length = Nk;
function Enc_Key_Expansion (Key : Key_Type;
Nk : Nk_Type;
Nr : Nr_Type) return Schedule_Type
is
Temp : Types.Word32;
Rot_Temp : Types.Word32;
Sub_Temp : Types.Word32;
Result : Schedule_Type := Null_Schedule;
begin
for I in Key_Index range Key'First .. Key'Last
loop
Result (I) := Byteorder32.Native_To_BE (Key (I));
end loop;
pragma Debug (LSC.Internal.AES.Print.Header (Result));
for I in Schedule_Index range Nk .. Nb * (Nr + 1) - 1
loop
pragma Debug (LSC.Internal.AES.Print.Index (I));
Temp := Result (I - 1);
pragma Debug (LSC.Internal.AES.Print.Row (Temp));
if I mod Nk = 0 then
pragma Assert_And_Cut
(I mod Nk = 0 and
I / Nk in Tables.Rcon_Index);
Rot_Temp := Rot_Word (Temp);
Sub_Temp := Sub_Word (Rot_Temp);
Temp := Ops32.XOR2 (Sub_Temp, Tables.Rcon (I / Nk));
pragma Debug (LSC.Internal.AES.Print.Row (Rot_Temp));
pragma Debug (LSC.Internal.AES.Print.Row (Sub_Temp));
pragma Debug (LSC.Internal.AES.Print.Row (Tables.Rcon (I / Nk)));
pragma Debug (LSC.Internal.AES.Print.Row (Temp));
elsif Nk > 6 and I mod Nk = Nb then
pragma Debug (LSC.Internal.AES.Print.Empty (1));
Temp := Sub_Word (Temp);
pragma Debug (LSC.Internal.AES.Print.Row (Temp));
pragma Debug (LSC.Internal.AES.Print.Empty (2));
else
pragma Debug (LSC.Internal.AES.Print.Empty (4));
null;
end if;
pragma Loop_Invariant
(I - Nk in Schedule_Index and
I in Schedule_Index);
Result (I) := Ops32.XOR2 (Result (I - Nk), Temp);
pragma Debug (LSC.Internal.AES.Print.Row (Result (I - Nk)));
pragma Debug (LSC.Internal.AES.Print.Row (Result (I)));
pragma Debug (LSC.Internal.Debug.New_Line);
end loop;
pragma Debug (LSC.Internal.AES.Print.Footer (Result));
return Result;
end Enc_Key_Expansion;
----------------------------------------------------------------------------
function Dec_Key_Expansion (Key : Key_Type;
Nk : Nk_Type;
Nr : Nr_Type) return Schedule_Type
with
Pre =>
Key'Length = Nk and
Nk < (Nb * (Nr + 1) - 1);
function Dec_Key_Expansion (Key : Key_Type;
Nk : Nk_Type;
Nr : Nr_Type) return Schedule_Type
is
Result : Schedule_Type;
begin
Result := Enc_Key_Expansion (Key, Nk, Nr);
for Round in Schedule_Index range 1 .. Nr - 1
loop
pragma Loop_Invariant (Nb * Round in Schedule_Index);
Result (Nb * Round) :=
Ops32.XOR4 (Tables.U1 (Ops32.Byte0 (Result (Nb * Round))),
Tables.U2 (Ops32.Byte1 (Result (Nb * Round))),
Tables.U3 (Ops32.Byte2 (Result (Nb * Round))),
Tables.U4 (Ops32.Byte3 (Result (Nb * Round))));
end loop;
for Round in Schedule_Index range 1 .. Nr - 1
loop
pragma Loop_Invariant (Nb * Round + 1 in Schedule_Index);
Result (Nb * Round + 1) :=
Ops32.XOR4 (Tables.U1 (Ops32.Byte0 (Result (Nb * Round + 1))),
Tables.U2 (Ops32.Byte1 (Result (Nb * Round + 1))),
Tables.U3 (Ops32.Byte2 (Result (Nb * Round + 1))),
Tables.U4 (Ops32.Byte3 (Result (Nb * Round + 1))));
end loop;
for Round in Schedule_Index range 1 .. Nr - 1
loop
pragma Loop_Invariant (Nb * Round + 2 in Schedule_Index);
Result (Nb * Round + 2) :=
Ops32.XOR4 (Tables.U1 (Ops32.Byte0 (Result (Nb * Round + 2))),
Tables.U2 (Ops32.Byte1 (Result (Nb * Round + 2))),
Tables.U3 (Ops32.Byte2 (Result (Nb * Round + 2))),
Tables.U4 (Ops32.Byte3 (Result (Nb * Round + 2))));
end loop;
for Round in Schedule_Index range 1 .. Nr - 1
loop
pragma Loop_Invariant (Nb * Round + 3 in Schedule_Index);
Result (Nb * Round + 3) :=
Ops32.XOR4 (Tables.U1 (Ops32.Byte0 (Result (Nb * Round + 3))),
Tables.U2 (Ops32.Byte1 (Result (Nb * Round + 3))),
Tables.U3 (Ops32.Byte2 (Result (Nb * Round + 3))),
Tables.U4 (Ops32.Byte3 (Result (Nb * Round + 3))));
end loop;
pragma Debug (LSC.Internal.AES.Print.Footer (Result));
return Result;
end Dec_Key_Expansion;
----------------------------------------------------------------------------
function Encrypt (Context : AES_Enc_Context;
Plaintext : Block_Type) return Block_Type
is
A0, A1, A2, A3 : Types.Word32;
C0, C1, C2, C3 : Types.Word32;
begin
pragma Debug (AES.Print.Block ("PLAINTEXT: ", "input ", Plaintext, Schedule_Index'(0)));
C0 := Byteorder32.Native_To_BE (Plaintext (0)) xor
Context.Schedule (0);
C1 := Byteorder32.Native_To_BE (Plaintext (1)) xor
Context.Schedule (1);
C2 := Byteorder32.Native_To_BE (Plaintext (2)) xor
Context.Schedule (2);
C3 := Byteorder32.Native_To_BE (Plaintext (3)) xor
Context.Schedule (3);
for Round in Schedule_Index range 1 .. Context.Nr - 1
loop
pragma Loop_Invariant
(Round <= Context.Nr - 1 and
Schedule_Index'First <= Nb * Round and
Nb * Round + 3 <= Schedule_Index'Last);
pragma Debug (Print.Print_Round ("start ", Round, Block_Type'(C0, C1, C2, C3)));
A0 := Ops32.XOR5 (Tables.T1 (Ops32.Byte0 (C0)),
Tables.T2 (Ops32.Byte1 (C1)),
Tables.T3 (Ops32.Byte2 (C2)),
Tables.T4 (Ops32.Byte3 (C3)),
Context.Schedule (Nb * Round));
A1 := Ops32.XOR5 (Tables.T1 (Ops32.Byte0 (C1)),
Tables.T2 (Ops32.Byte1 (C2)),
Tables.T3 (Ops32.Byte2 (C3)),
Tables.T4 (Ops32.Byte3 (C0)),
Context.Schedule (Nb * Round + 1));
A2 := Ops32.XOR5 (Tables.T1 (Ops32.Byte0 (C2)),
Tables.T2 (Ops32.Byte1 (C3)),
Tables.T3 (Ops32.Byte2 (C0)),
Tables.T4 (Ops32.Byte3 (C1)),
Context.Schedule (Nb * Round + 2));
A3 := Ops32.XOR5 (Tables.T1 (Ops32.Byte0 (C3)),
Tables.T2 (Ops32.Byte1 (C0)),
Tables.T3 (Ops32.Byte2 (C1)),
Tables.T4 (Ops32.Byte3 (C2)),
Context.Schedule (Nb * Round + 3));
pragma Assert_And_Cut
(Round <= Context.Nr - 1 and
Schedule_Index'First <= Nb * Round and
Nb * Round + 3 <= Schedule_Index'Last);
C0 := A0;
C1 := A1;
C2 := A2;
C3 := A3;
end loop;
pragma Debug (Print.Print_Round ("start ", Context.Nr, Block_Type'(C0, C1, C2, C3)));
A0 := Ops32.Bytes_To_Word
(Tables.S (Ops32.Byte0 (C0)),
Tables.S (Ops32.Byte1 (C1)),
Tables.S (Ops32.Byte2 (C2)),
Tables.S (Ops32.Byte3 (C3))) xor
Context.Schedule (Nb * Context.Nr);
A1 := Ops32.Bytes_To_Word
(Tables.S (Ops32.Byte0 (C1)),
Tables.S (Ops32.Byte1 (C2)),
Tables.S (Ops32.Byte2 (C3)),
Tables.S (Ops32.Byte3 (C0))) xor
Context.Schedule (Nb * Context.Nr + 1);
A2 := Ops32.Bytes_To_Word
(Tables.S (Ops32.Byte0 (C2)),
Tables.S (Ops32.Byte1 (C3)),
Tables.S (Ops32.Byte2 (C0)),
Tables.S (Ops32.Byte3 (C1))) xor
Context.Schedule (Nb * Context.Nr + 2);
A3 := Ops32.Bytes_To_Word
(Tables.S (Ops32.Byte0 (C3)),
Tables.S (Ops32.Byte1 (C0)),
Tables.S (Ops32.Byte2 (C1)),
Tables.S (Ops32.Byte3 (C2))) xor
Context.Schedule (Nb * Context.Nr + 3);
pragma Debug (Print.Print_Round ("output", Context.Nr, Block_Type'(A0, A1, A2, A3)));
return Block_Type'(Byteorder32.BE_To_Native (A0),
Byteorder32.BE_To_Native (A1),
Byteorder32.BE_To_Native (A2),
Byteorder32.BE_To_Native (A3));
end Encrypt;
----------------------------------------------------------------------------
function Create_AES128_Enc_Context
(Key : AES128_Key_Type) return AES_Enc_Context
is
begin
return AES_Enc_Context'
(Schedule => Enc_Key_Expansion (Key => Key,
Nk => 4,
Nr => 10),
Nr => 10);
end Create_AES128_Enc_Context;
----------------------------------------------------------------------------
function Create_AES192_Enc_Context
(Key : AES192_Key_Type) return AES_Enc_Context
is
begin
return AES_Enc_Context'
(Schedule => Enc_Key_Expansion (Key => Key,
Nk => 6,
Nr => 12),
Nr => 12);
end Create_AES192_Enc_Context;
----------------------------------------------------------------------------
function Create_AES256_Enc_Context
(Key : AES256_Key_Type) return AES_Enc_Context
is
begin
return AES_Enc_Context'
(Schedule => Enc_Key_Expansion (Key => Key,
Nk => 8,
Nr => 14),
Nr => 14);
end Create_AES256_Enc_Context;
----------------------------------------------------------------------------
function Create_AES128_Dec_Context
(Key : AES128_Key_Type) return AES_Dec_Context
is
begin
return AES_Dec_Context'
(Schedule => Dec_Key_Expansion (Key => Key,
Nk => 4,
Nr => 10),
Nr => 10);
end Create_AES128_Dec_Context;
----------------------------------------------------------------------------
function Create_AES192_Dec_Context
(Key : AES192_Key_Type) return AES_Dec_Context
is
begin
return AES_Dec_Context'
(Schedule => Dec_Key_Expansion (Key => Key,
Nk => 6,
Nr => 12),
Nr => 12);
end Create_AES192_Dec_Context;
----------------------------------------------------------------------------
function Create_AES256_Dec_Context
(Key : AES256_Key_Type) return AES_Dec_Context
is
begin
return AES_Dec_Context'
(Schedule => Dec_Key_Expansion (Key => Key,
Nk => 8,
Nr => 14),
Nr => 14);
end Create_AES256_Dec_Context;
----------------------------------------------------------------------------
function Decrypt (Context : AES_Dec_Context;
Ciphertext : Block_Type) return Block_Type
is
A0, A1, A2, A3 : Types.Word32;
C0, C1, C2, C3 : Types.Word32;
begin
pragma Debug (AES.Print.Block ("CIPHERTEXT: ", "iinput", Ciphertext, Schedule_Index'(Context.Nr)));
C0 := Byteorder32.Native_To_BE (Ciphertext (0)) xor
Context.Schedule (Nb * Context.Nr);
C1 := Byteorder32.Native_To_BE (Ciphertext (1)) xor
Context.Schedule (Nb * Context.Nr + 1);
C2 := Byteorder32.Native_To_BE (Ciphertext (2)) xor
Context.Schedule (Nb * Context.Nr + 2);
C3 := Byteorder32.Native_To_BE (Ciphertext (3)) xor
Context.Schedule (Nb * Context.Nr + 3);
for Round in reverse Schedule_Index range 1 .. Context.Nr - 1
loop
pragma Loop_Invariant
(Round <= Context.Nr - 1 and
Schedule_Index'First <= Nb * Round and
Nb * Round + 3 <= Schedule_Index'Last);
pragma Debug (Print.Print_Round ("istart", Round, Block_Type'(C0, C1, C2, C3)));
A0 := Ops32.XOR5 (Tables.T5 (Ops32.Byte0 (C0)),
Tables.T6 (Ops32.Byte1 (C3)),
Tables.T7 (Ops32.Byte2 (C2)),
Tables.T8 (Ops32.Byte3 (C1)),
Context.Schedule (Nb * Round));
A1 := Ops32.XOR5 (Tables.T5 (Ops32.Byte0 (C1)),
Tables.T6 (Ops32.Byte1 (C0)),
Tables.T7 (Ops32.Byte2 (C3)),
Tables.T8 (Ops32.Byte3 (C2)),
Context.Schedule (Nb * Round + 1));
A2 := Ops32.XOR5 (Tables.T5 (Ops32.Byte0 (C2)),
Tables.T6 (Ops32.Byte1 (C1)),
Tables.T7 (Ops32.Byte2 (C0)),
Tables.T8 (Ops32.Byte3 (C3)),
Context.Schedule (Nb * Round + 2));
A3 := Ops32.XOR5 (Tables.T5 (Ops32.Byte0 (C3)),
Tables.T6 (Ops32.Byte1 (C2)),
Tables.T7 (Ops32.Byte2 (C1)),
Tables.T8 (Ops32.Byte3 (C0)),
Context.Schedule (Nb * Round + 3));
C0 := A0;
C1 := A1;
C2 := A2;
C3 := A3;
end loop;
pragma Debug (Print.Print_Round ("istart", 0, Block_Type'(C0, C1, C2, C3)));
A0 := Ops32.Bytes_To_Word
(Tables.Si (Ops32.Byte0 (C0)),
Tables.Si (Ops32.Byte1 (C3)),
Tables.Si (Ops32.Byte2 (C2)),
Tables.Si (Ops32.Byte3 (C1))) xor
Context.Schedule (0);
A1 := Ops32.Bytes_To_Word
(Tables.Si (Ops32.Byte0 (C1)),
Tables.Si (Ops32.Byte1 (C0)),
Tables.Si (Ops32.Byte2 (C3)),
Tables.Si (Ops32.Byte3 (C2))) xor
Context.Schedule (1);
A2 := Ops32.Bytes_To_Word
(Tables.Si (Ops32.Byte0 (C2)),
Tables.Si (Ops32.Byte1 (C1)),
Tables.Si (Ops32.Byte2 (C0)),
Tables.Si (Ops32.Byte3 (C3))) xor
Context.Schedule (2);
A3 := Ops32.Bytes_To_Word
(Tables.Si (Ops32.Byte0 (C3)),
Tables.Si (Ops32.Byte1 (C2)),
Tables.Si (Ops32.Byte2 (C1)),
Tables.Si (Ops32.Byte3 (C0))) xor
Context.Schedule (3);
pragma Debug (Print.Print_Round ("ioutpt", 0, Block_Type'(A0, A1, A2, A3)));
return Block_Type'(Byteorder32.BE_To_Native (A0),
Byteorder32.BE_To_Native (A1),
Byteorder32.BE_To_Native (A2),
Byteorder32.BE_To_Native (A3));
end Decrypt;
end LSC.Internal.AES;
|
pragma Warnings (Off);
pragma Ada_95;
pragma Source_File_Name (ada_main, Spec_File_Name => "b__planificador_ciclico.ads");
pragma Source_File_Name (ada_main, Body_File_Name => "b__planificador_ciclico.adb");
pragma Suppress (Overflow_Check);
with Ada.Exceptions;
package body ada_main is
E072 : Short_Integer; pragma Import (Ada, E072, "system__os_lib_E");
E008 : Short_Integer; pragma Import (Ada, E008, "ada__exceptions_E");
E013 : Short_Integer; pragma Import (Ada, E013, "system__soft_links_E");
E025 : Short_Integer; pragma Import (Ada, E025, "system__exception_table_E");
E040 : Short_Integer; pragma Import (Ada, E040, "ada__containers_E");
E068 : Short_Integer; pragma Import (Ada, E068, "ada__io_exceptions_E");
E052 : Short_Integer; pragma Import (Ada, E052, "ada__strings_E");
E054 : Short_Integer; pragma Import (Ada, E054, "ada__strings__maps_E");
E058 : Short_Integer; pragma Import (Ada, E058, "ada__strings__maps__constants_E");
E078 : Short_Integer; pragma Import (Ada, E078, "interfaces__c_E");
E027 : Short_Integer; pragma Import (Ada, E027, "system__exceptions_E");
E080 : Short_Integer; pragma Import (Ada, E080, "system__object_reader_E");
E047 : Short_Integer; pragma Import (Ada, E047, "system__dwarf_lines_E");
E021 : Short_Integer; pragma Import (Ada, E021, "system__soft_links__initialize_E");
E039 : Short_Integer; pragma Import (Ada, E039, "system__traceback__symbolic_E");
E110 : Short_Integer; pragma Import (Ada, E110, "ada__tags_E");
E108 : Short_Integer; pragma Import (Ada, E108, "ada__streams_E");
E122 : Short_Integer; pragma Import (Ada, E122, "system__file_control_block_E");
E121 : Short_Integer; pragma Import (Ada, E121, "system__finalization_root_E");
E119 : Short_Integer; pragma Import (Ada, E119, "ada__finalization_E");
E118 : Short_Integer; pragma Import (Ada, E118, "system__file_io_E");
E006 : Short_Integer; pragma Import (Ada, E006, "ada__calendar_E");
E104 : Short_Integer; pragma Import (Ada, E104, "ada__calendar__delays_E");
E106 : Short_Integer; pragma Import (Ada, E106, "ada__text_io_E");
Sec_Default_Sized_Stacks : array (1 .. 1) of aliased System.Secondary_Stack.SS_Stack (System.Parameters.Runtime_Default_Sec_Stack_Size);
Local_Priority_Specific_Dispatching : constant String := "";
Local_Interrupt_States : constant String := "";
Is_Elaborated : Boolean := False;
procedure finalize_library is
begin
E106 := E106 - 1;
declare
procedure F1;
pragma Import (Ada, F1, "ada__text_io__finalize_spec");
begin
F1;
end;
declare
procedure F2;
pragma Import (Ada, F2, "system__file_io__finalize_body");
begin
E118 := E118 - 1;
F2;
end;
declare
procedure Reraise_Library_Exception_If_Any;
pragma Import (Ada, Reraise_Library_Exception_If_Any, "__gnat_reraise_library_exception_if_any");
begin
Reraise_Library_Exception_If_Any;
end;
end finalize_library;
procedure adafinal is
procedure s_stalib_adafinal;
pragma Import (Ada, s_stalib_adafinal, "system__standard_library__adafinal");
procedure Runtime_Finalize;
pragma Import (C, Runtime_Finalize, "__gnat_runtime_finalize");
begin
if not Is_Elaborated then
return;
end if;
Is_Elaborated := False;
Runtime_Finalize;
s_stalib_adafinal;
end adafinal;
type No_Param_Proc is access procedure;
pragma Favor_Top_Level (No_Param_Proc);
procedure adainit is
Main_Priority : Integer;
pragma Import (C, Main_Priority, "__gl_main_priority");
Time_Slice_Value : Integer;
pragma Import (C, Time_Slice_Value, "__gl_time_slice_val");
WC_Encoding : Character;
pragma Import (C, WC_Encoding, "__gl_wc_encoding");
Locking_Policy : Character;
pragma Import (C, Locking_Policy, "__gl_locking_policy");
Queuing_Policy : Character;
pragma Import (C, Queuing_Policy, "__gl_queuing_policy");
Task_Dispatching_Policy : Character;
pragma Import (C, Task_Dispatching_Policy, "__gl_task_dispatching_policy");
Priority_Specific_Dispatching : System.Address;
pragma Import (C, Priority_Specific_Dispatching, "__gl_priority_specific_dispatching");
Num_Specific_Dispatching : Integer;
pragma Import (C, Num_Specific_Dispatching, "__gl_num_specific_dispatching");
Main_CPU : Integer;
pragma Import (C, Main_CPU, "__gl_main_cpu");
Interrupt_States : System.Address;
pragma Import (C, Interrupt_States, "__gl_interrupt_states");
Num_Interrupt_States : Integer;
pragma Import (C, Num_Interrupt_States, "__gl_num_interrupt_states");
Unreserve_All_Interrupts : Integer;
pragma Import (C, Unreserve_All_Interrupts, "__gl_unreserve_all_interrupts");
Detect_Blocking : Integer;
pragma Import (C, Detect_Blocking, "__gl_detect_blocking");
Default_Stack_Size : Integer;
pragma Import (C, Default_Stack_Size, "__gl_default_stack_size");
Default_Secondary_Stack_Size : System.Parameters.Size_Type;
pragma Import (C, Default_Secondary_Stack_Size, "__gnat_default_ss_size");
Bind_Env_Addr : System.Address;
pragma Import (C, Bind_Env_Addr, "__gl_bind_env_addr");
procedure Runtime_Initialize (Install_Handler : Integer);
pragma Import (C, Runtime_Initialize, "__gnat_runtime_initialize");
Finalize_Library_Objects : No_Param_Proc;
pragma Import (C, Finalize_Library_Objects, "__gnat_finalize_library_objects");
Binder_Sec_Stacks_Count : Natural;
pragma Import (Ada, Binder_Sec_Stacks_Count, "__gnat_binder_ss_count");
Default_Sized_SS_Pool : System.Address;
pragma Import (Ada, Default_Sized_SS_Pool, "__gnat_default_ss_pool");
begin
if Is_Elaborated then
return;
end if;
Is_Elaborated := True;
Main_Priority := -1;
Time_Slice_Value := -1;
WC_Encoding := 'b';
Locking_Policy := ' ';
Queuing_Policy := ' ';
Task_Dispatching_Policy := ' ';
Priority_Specific_Dispatching :=
Local_Priority_Specific_Dispatching'Address;
Num_Specific_Dispatching := 0;
Main_CPU := -1;
Interrupt_States := Local_Interrupt_States'Address;
Num_Interrupt_States := 0;
Unreserve_All_Interrupts := 0;
Detect_Blocking := 0;
Default_Stack_Size := -1;
ada_main'Elab_Body;
Default_Secondary_Stack_Size := System.Parameters.Runtime_Default_Sec_Stack_Size;
Binder_Sec_Stacks_Count := 1;
Default_Sized_SS_Pool := Sec_Default_Sized_Stacks'Address;
Runtime_Initialize (1);
Finalize_Library_Objects := finalize_library'access;
Ada.Exceptions'Elab_Spec;
System.Soft_Links'Elab_Spec;
System.Exception_Table'Elab_Body;
E025 := E025 + 1;
Ada.Containers'Elab_Spec;
E040 := E040 + 1;
Ada.Io_Exceptions'Elab_Spec;
E068 := E068 + 1;
Ada.Strings'Elab_Spec;
E052 := E052 + 1;
Ada.Strings.Maps'Elab_Spec;
E054 := E054 + 1;
Ada.Strings.Maps.Constants'Elab_Spec;
E058 := E058 + 1;
Interfaces.C'Elab_Spec;
E078 := E078 + 1;
System.Exceptions'Elab_Spec;
E027 := E027 + 1;
System.Object_Reader'Elab_Spec;
E080 := E080 + 1;
System.Dwarf_Lines'Elab_Spec;
E047 := E047 + 1;
System.Os_Lib'Elab_Body;
E072 := E072 + 1;
System.Soft_Links.Initialize'Elab_Body;
E021 := E021 + 1;
E013 := E013 + 1;
System.Traceback.Symbolic'Elab_Body;
E039 := E039 + 1;
E008 := E008 + 1;
Ada.Tags'Elab_Spec;
Ada.Tags'Elab_Body;
E110 := E110 + 1;
Ada.Streams'Elab_Spec;
E108 := E108 + 1;
System.File_Control_Block'Elab_Spec;
E122 := E122 + 1;
System.Finalization_Root'Elab_Spec;
E121 := E121 + 1;
Ada.Finalization'Elab_Spec;
E119 := E119 + 1;
System.File_Io'Elab_Body;
E118 := E118 + 1;
Ada.Calendar'Elab_Spec;
Ada.Calendar'Elab_Body;
E006 := E006 + 1;
Ada.Calendar.Delays'Elab_Body;
E104 := E104 + 1;
Ada.Text_Io'Elab_Spec;
Ada.Text_Io'Elab_Body;
E106 := E106 + 1;
end adainit;
procedure Ada_Main_Program;
pragma Import (Ada, Ada_Main_Program, "_ada_planificador_ciclico");
function main
(argc : Integer;
argv : System.Address;
envp : System.Address)
return Integer
is
procedure Initialize (Addr : System.Address);
pragma Import (C, Initialize, "__gnat_initialize");
procedure Finalize;
pragma Import (C, Finalize, "__gnat_finalize");
SEH : aliased array (1 .. 2) of Integer;
Ensure_Reference : aliased System.Address := Ada_Main_Program_Name'Address;
pragma Volatile (Ensure_Reference);
begin
if gnat_argc = 0 then
gnat_argc := argc;
gnat_argv := argv;
end if;
gnat_envp := envp;
Initialize (SEH'Address);
adainit;
Ada_Main_Program;
adafinal;
Finalize;
return (gnat_exit_status);
end;
-- BEGIN Object file/option list
-- Z:\Documents\Programacion Concurrente y de Tiempo Real\Tiempo Real\Practicas\P03_Planificador_Ciclico\obj\planificador_ciclico.o
-- -LZ:\Documents\Programacion Concurrente y de Tiempo Real\Tiempo Real\Practicas\P03_Planificador_Ciclico\obj\
-- -LZ:\Documents\Programacion Concurrente y de Tiempo Real\Tiempo Real\Practicas\P03_Planificador_Ciclico\obj\
-- -LC:/gnat/2020/lib/gcc/x86_64-pc-mingw32/9.3.1/adalib/
-- -static
-- -lgnat
-- -Wl,--stack=0x2000000
-- END Object file/option list
end ada_main;
|
with Ada.Containers.Functional_Vectors;
with Ada.Containers.Functional_Sets;
with Ada.Containers.Functional_Maps;
with Ada.Strings;
with Ada.Strings.Maps;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Interfaces;
package Common with SPARK_Mode is
type UInt32 is new Interfaces.Unsigned_32;
type Int64 is new Interfaces.Integer_64;
type Real32 is new Interfaces.IEEE_Float_32;
type Real64 is new Interfaces.IEEE_Float_64;
function Get_TaskID (TaskOptionID : Int64) return Int64 is (TaskOptionID / 100_000) with
Pre => TaskOptionID in 0 .. 9_999_999_999;
-- Retrieve the TaskId from a TaskOptionId
function Get_OptionID (TaskOptionID : Int64) return Int64 is (TaskOptionID rem 100_000) with
Pre => TaskOptionID in 0 .. 9_999_999_999;
-- Retrieve the OptionId from a TaskOptionId
function Get_TaskOptionID (TaskID, OptionID : Int64) return Int64 is (TaskID * 100_000 + OptionID)
with Pre => TaskID in 0 .. 99_999 and then OptionID in 0 .. 99_999;
-- Generate TaskOptionID from TaskID and OptionID
function Int64_Hash (X : Int64) return Ada.Containers.Hash_Type is
(Ada.Containers.Hash_Type'Mod (X));
package Int64_Sequences is new Ada.Containers.Functional_Vectors
(Index_Type => Positive,
Element_Type => Int64);
type Int64_Seq is new Int64_Sequences.Sequence;
package Int64_Sets is new Ada.Containers.Functional_Sets (Int64);
type Int64_Set is new Int64_Sets.Set;
package Int64_Maps is new Ada.Containers.Functional_Maps
(Int64, Int64);
type Int64_Map is new Int64_Maps.Map;
-- Messages are unbounded strings. To avoid having to prove that messages
-- do not overflow Integer'Last, we use a procedure which will truncate
-- the message if it is too long. We can justify that this should not
-- happen in practice.
procedure Append_To_Msg
(Msg : in out Unbounded_String;
Tail : String);
procedure Append_To_Msg
(Msg : in out Unbounded_String;
Tail : Unbounded_String);
procedure Append_To_Msg
(Msg : in out Unbounded_String;
Tail : Character);
-- Append Tail to Msg if there is enough room in the unbounded string
package Unbounded_Strings_Subprograms is
function To_Unbounded_String
(Source : String) return Unbounded_String
with
Post =>
Length (To_Unbounded_String'Result) = Source'Length
and then
(for all J in 1 .. Source'Length =>
(Source (Source'First - 1 + J)
= Element (To_Unbounded_String'Result, J))),
Global => null;
function Index
(Source : Unbounded_String;
Pattern : String;
Going : Ada.Strings.Direction := Ada.Strings.Forward;
Mapping : Ada.Strings.Maps.Character_Mapping := Ada.Strings.Maps.Identity) return Natural
with
Pre => Pattern'Length /= 0,
Post => Index'Result in 1 .. Length (Source) - Pattern'Length + 1,
Global => null;
function Index
(Source : Unbounded_String;
Pattern : String;
From : Positive;
Going : Ada.Strings.Direction := Ada.Strings.Forward;
Mapping : Ada.Strings.Maps.Character_Mapping := Ada.Strings.Maps.Identity) return Natural
with
Pre =>
(if Length (Source) /= 0
then From <= Length (Source))
and then Pattern'Length /= 0,
Post => Index'Result in 0 |
From .. Length (Source) - Pattern'Length + 1,
Global => null;
function Slice
(Source : Unbounded_String;
Low : Positive;
High : Natural) return String
with
Pre => Low - 1 <= Length (Source) and then High <= Length (Source),
Post =>
Slice'Result'Length = Natural'Max (0, High - Low + 1)
and then Slice'Result'First = 1
and then (for all J in Slice'Result'Range =>
(Element (Source, Low - 1 + J) = Slice'Result (J))),
Global => null;
private
pragma SPARK_Mode (Off);
function To_Unbounded_String
(Source : String) return Unbounded_String
renames Ada.Strings.Unbounded.To_Unbounded_String;
function Index
(Source : Unbounded_String;
Pattern : String;
Going : Ada.Strings.Direction := Ada.Strings.Forward;
Mapping : Ada.Strings.Maps.Character_Mapping := Ada.Strings.Maps.Identity) return Natural
renames Ada.Strings.Unbounded.Index;
function Index
(Source : Unbounded_String;
Pattern : String;
From : Positive;
Going : Ada.Strings.Direction := Ada.Strings.Forward;
Mapping : Ada.Strings.Maps.Character_Mapping := Ada.Strings.Maps.Identity) return Natural
renames Ada.Strings.Unbounded.Index;
function Slice
(Source : Unbounded_String;
Low : Positive;
High : Natural) return String
renames Ada.Strings.Unbounded.Slice;
end Unbounded_Strings_Subprograms;
end Common;
|
------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Sample.Menu_Demo.Aux --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc. --
-- --
-- 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, distribute with modifications, 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 ABOVE 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. --
-- --
-- Except as contained in this notice, the name(s) of the above copyright --
-- holders shall not be used in advertising or otherwise to promote the --
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.10 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels;
with Terminal_Interface.Curses.Menus; use Terminal_Interface.Curses.Menus;
package Sample.Menu_Demo.Aux is
procedure Geometry (M : Menu;
L : out Line_Count;
C : out Column_Count;
Y : out Line_Position;
X : out Column_Position);
-- Calculate the geometry for a panel beeing able to be used to display
-- the menu.
function Create (M : Menu;
Title : String;
Lin : Line_Position;
Col : Column_Position) return Panel;
-- Create a panel decorated with a frame and the title at the specified
-- position. The dimension of the panel is derived from the menus layout.
procedure Destroy (M : Menu;
P : in out Panel);
-- Destroy all the windowing structures associated with this menu and
-- panel.
function Get_Request (M : Menu; P : Panel) return Key_Code;
-- Centralized request driver for all menus in this sample. This
-- gives us a common key binding for all menus.
end Sample.Menu_Demo.Aux;
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012-2013, 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 file is generated, don't edit it.
------------------------------------------------------------------------------
with AMF.Generic_Collections;
package AMF.OCL.Let_Exps.Collections is
pragma Preelaborate;
package OCL_Let_Exp_Collections is
new AMF.Generic_Collections
(OCL_Let_Exp,
OCL_Let_Exp_Access);
type Set_Of_OCL_Let_Exp is
new OCL_Let_Exp_Collections.Set with null record;
Empty_Set_Of_OCL_Let_Exp : constant Set_Of_OCL_Let_Exp;
type Ordered_Set_Of_OCL_Let_Exp is
new OCL_Let_Exp_Collections.Ordered_Set with null record;
Empty_Ordered_Set_Of_OCL_Let_Exp : constant Ordered_Set_Of_OCL_Let_Exp;
type Bag_Of_OCL_Let_Exp is
new OCL_Let_Exp_Collections.Bag with null record;
Empty_Bag_Of_OCL_Let_Exp : constant Bag_Of_OCL_Let_Exp;
type Sequence_Of_OCL_Let_Exp is
new OCL_Let_Exp_Collections.Sequence with null record;
Empty_Sequence_Of_OCL_Let_Exp : constant Sequence_Of_OCL_Let_Exp;
private
Empty_Set_Of_OCL_Let_Exp : constant Set_Of_OCL_Let_Exp
:= (OCL_Let_Exp_Collections.Set with null record);
Empty_Ordered_Set_Of_OCL_Let_Exp : constant Ordered_Set_Of_OCL_Let_Exp
:= (OCL_Let_Exp_Collections.Ordered_Set with null record);
Empty_Bag_Of_OCL_Let_Exp : constant Bag_Of_OCL_Let_Exp
:= (OCL_Let_Exp_Collections.Bag with null record);
Empty_Sequence_Of_OCL_Let_Exp : constant Sequence_Of_OCL_Let_Exp
:= (OCL_Let_Exp_Collections.Sequence with null record);
end AMF.OCL.Let_Exps.Collections;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUNTIME COMPONENTS --
-- --
-- S Y S T E M . P A C K _ 5 7 --
-- --
-- S p e c --
-- --
-- $Revision$
-- --
-- Copyright (C) 1992-1999 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-5707, 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. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- Handling of packed arrays with Component_Size = 57
package System.Pack_57 is
pragma Preelaborate (Pack_57);
Bits : constant := 57;
type Bits_57 is mod 2 ** Bits;
for Bits_57'Size use Bits;
function Get_57 (Arr : System.Address; N : Natural) return Bits_57;
-- Arr is the address of the packed array, N is the zero-based
-- subscript. This element is extracted and returned.
procedure Set_57 (Arr : System.Address; N : Natural; E : Bits_57);
-- Arr is the address of the packed array, N is the zero-based
-- subscript. This element is set to the given value.
end System.Pack_57;
|
-- 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.Iterator_Interfaces;
generic
type Element_Type (<>) is private;
with function "<" (Left, Right : Element_Type) return Boolean is <>;
with function "=" (Left, Right : Element_Type) return Boolean is <>;
package Ada.Containers.Ordered_Sets is
pragma Preelaborate(Ordered_Sets);
pragma Remote_Types(Ordered_Sets);
function Equivalent_Elements (Left, Right : Element_Type) return Boolean;
type Set is tagged private
with Constant_Indexing => Constant_Reference,
Default_Iterator => Iterate,
Iterator_Element => Element_Type;
pragma Preelaborable_Initialization(Set);
type Cursor is private;
pragma Preelaborable_Initialization(Cursor);
Empty_Set : constant Set;
No_Element : constant Cursor;
function Has_Element (Position : Cursor) return Boolean;
package Set_Iterator_Interfaces is new
Ada.Iterator_Interfaces (Cursor, Has_Element);
function "=" (Left, Right : Set) return Boolean;
function Equivalent_Sets (Left, Right : Set) return Boolean;
function To_Set (New_Item : Element_Type) return Set;
function Length (Container : Set) return Count_Type;
function Is_Empty (Container : Set) return Boolean;
procedure Clear (Container : in out Set);
function Element (Position : Cursor) return Element_Type;
procedure Replace_Element (Container : in out Set;
Position : in Cursor;
New_Item : in Element_Type);
procedure Query_Element
(Position : in Cursor;
Process : not null access procedure (Element : in Element_Type));
type Constant_Reference_Type
(Element : not null access constant Element_Type) is private
with Implicit_Dereference => Element;
function Constant_Reference (Container : aliased in Set;
Position : in Cursor)
return Constant_Reference_Type;
procedure Assign (Target : in out Set; Source : in Set);
function Copy (Source : Set) return Set;
procedure Move (Target : in out Set;
Source : in out Set);
procedure Insert (Container : in out Set;
New_Item : in Element_Type;
Position : out Cursor;
Inserted : out Boolean);
procedure Insert (Container : in out Set;
New_Item : in Element_Type);
procedure Include (Container : in out Set;
New_Item : in Element_Type);
procedure Replace (Container : in out Set;
New_Item : in Element_Type);
procedure Exclude (Container : in out Set;
Item : in Element_Type);
procedure Delete (Container : in out Set;
Item : in Element_Type);
procedure Delete (Container : in out Set;
Position : in out Cursor);
procedure Delete_First (Container : in out Set);
procedure Delete_Last (Container : in out Set);
procedure Union (Target : in out Set;
Source : in Set);
function Union (Left, Right : Set) return Set;
function "or" (Left, Right : Set) return Set renames Union;
procedure Intersection (Target : in out Set;
Source : in Set);
function Intersection (Left, Right : Set) return Set;
function "and" (Left, Right : Set) return Set renames Intersection;
procedure Difference (Target : in out Set;
Source : in Set);
function Difference (Left, Right : Set) return Set;
function "-" (Left, Right : Set) return Set renames Difference;
procedure Symmetric_Difference (Target : in out Set;
Source : in Set);
function Symmetric_Difference (Left, Right : Set) return Set;
function "xor" (Left, Right : Set) return Set renames
Symmetric_Difference;
function Overlap (Left, Right : Set) return Boolean;
function Is_Subset (Subset : Set;
Of_Set : Set) return Boolean;
function First (Container : Set) return Cursor;
function First_Element (Container : Set) return Element_Type;
function Last (Container : Set) return Cursor;
function Last_Element (Container : Set) return Element_Type;
function Next (Position : Cursor) return Cursor;
procedure Next (Position : in out Cursor);
function Previous (Position : Cursor) return Cursor;
procedure Previous (Position : in out Cursor);
function Find (Container : Set;
Item : Element_Type)
return Cursor;
function Floor (Container : Set;
Item : Element_Type)
return Cursor;
function Ceiling (Container : Set;
Item : Element_Type)
return Cursor;
function Contains (Container : Set;
Item : Element_Type) return Boolean;
function "<" (Left, Right : Cursor) return Boolean;
function ">" (Left, Right : Cursor) return Boolean;
function "<" (Left : Cursor; Right : Element_Type)
return Boolean;
function ">" (Left : Cursor; Right : Element_Type)
return Boolean;
function "<" (Left : Element_Type; Right : Cursor)
return Boolean;
function ">" (Left : Element_Type; Right : Cursor)
return Boolean;
procedure Iterate
(Container : in Set;
Process : not null access procedure (Position : in Cursor));
procedure Reverse_Iterate
(Container : in Set;
Process : not null access procedure (Position : in Cursor));
function Iterate (Container : in Set)
return Set_Iterator_Interfaces.Reversible_Iterator'Class;
function Iterate (Container : in Set; Start : in Cursor)
return Set_Iterator_Interfaces.Reversible_Iterator'Class;
generic
type Key_Type (<>) is private;
with function Key (Element : Element_Type) return Key_Type;
with function "<" (Left, Right : Key_Type)
return Boolean is <>;
package Generic_Keys is
function Equivalent_Keys (Left, Right : Key_Type)
return Boolean;
function Key (Position : Cursor) return Key_Type;
function Element (Container : Set;
Key : Key_Type)
return Element_Type;
procedure Replace (Container : in out Set;
Key : in Key_Type;
New_Item : in Element_Type);
procedure Exclude (Container : in out Set;
Key : in Key_Type);
procedure Delete (Container : in out Set;
Key : in Key_Type);
function Find (Container : Set;
Key : Key_Type)
return Cursor;
function Floor (Container : Set;
Key : Key_Type)
return Cursor;
function Ceiling (Container : Set;
Key : Key_Type)
return Cursor;
function Contains (Container : Set;
Key : Key_Type) return Boolean;
procedure Update_Element_Preserving_Key
(Container : in out Set;
Position : in Cursor;
Process : not null access procedure
(Element : in out Element_Type));
type Reference_Type
(Element : not null access Element_Type) is private
with Implicit_Dereference => Element;
function Reference_Preserving_Key (Container : aliased in out Set;
Position : in Cursor)
return Reference_Type;
function Constant_Reference (Container : aliased in Set;
Key : in Key_Type)
return Constant_Reference_Type;
function Reference_Preserving_Key (Container : aliased in out Set;
Key : in Key_Type)
return Reference_Type;
end Generic_Keys;
private
-- not specified by the language
end Ada.Containers.Ordered_Sets;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- E X P _ D I S P --
-- --
-- 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 contains routines involved in tagged types and dynamic
-- dispatching expansion.
with Types; use Types;
package Exp_Disp is
-------------------------------------
-- Predefined primitive operations --
-------------------------------------
-- The predefined primitive operations (PPOs) are subprograms generated
-- by GNAT for a particular tagged type. Their role is to provide support
-- for different Ada language features such as the attribute 'Size or
-- handling of dispatching triggers in select statements. PPOs are created
-- when a tagged type is expanded or frozen. These subprograms are later
-- collected and inserted into the dispatch table of a tagged type at
-- fixed positions. Some of the PPOs that manipulate data in tagged objects
-- require the generation of thunks.
-- List of predefined primitive operations
-- Leading underscores designate reserved names. Bracketed numerical
-- values represent dispatch table slot numbers.
-- _Size (1) - implementation of the attribute 'Size for any tagged
-- type. Constructs of the form Prefix'Size are converted into
-- Prefix._Size.
-- _Alignment (2) - implementation of the attribute 'Alignment for
-- any tagged type. Constructs of the form Prefix'Alignment are
-- converted into Prefix._Alignment.
-- TSS_Stream_Read (3) - implementation of the stream attribute Read
-- for any tagged type.
-- TSS_Stream_Write (4) - implementation of the stream attribute Write
-- for any tagged type.
-- TSS_Stream_Input (5) - implementation of the stream attribute Input
-- for any tagged type.
-- TSS_Stream_Output (6) - implementation of the stream attribute
-- Output for any tagged type.
-- Op_Eq (7) - implementation of the equality operator for any non-
-- limited tagged type.
-- _Assign (8) - implementation of the assignment operator for any
-- non-limited tagged type.
-- TSS_Deep_Adjust (9) - implementation of the finalization operation
-- Adjust for any non-limited tagged type.
-- TSS_Deep_Finalize (10) - implementation of the finalization
-- operation Finalize for any non-limited tagged type.
-- _Disp_Asynchronous_Select (11) - used in the expansion of ATC with
-- dispatching triggers. Null implementation for limited interfaces,
-- full body generation for types that implement limited interfaces,
-- not generated for the rest of the cases. See Expand_N_Asynchronous_
-- Select in Exp_Ch9 for more information.
-- _Disp_Conditional_Select (12) - used in the expansion of conditional
-- selects with dispatching triggers. Null implementation for limited
-- interfaces, full body generation for types that implement limited
-- interfaces, not generated for the rest of the cases. See Expand_N_
-- Conditional_Entry_Call in Exp_Ch9 for more information.
-- _Disp_Get_Prim_Op_Kind (13) - helper routine used in the expansion
-- of ATC with dispatching triggers. Null implementation for limited
-- interfaces, full body generation for types that implement limited
-- interfaces, not generated for the rest of the cases.
-- _Disp_Get_Task_Id (14) - helper routine used in the expansion of
-- Abort, attributes 'Callable and 'Terminated for task interface
-- class-wide types. Full body generation for task types, null
-- implementation for limited interfaces, not generated for the rest
-- of the cases. See Expand_N_Attribute_Reference in Exp_Attr and
-- Expand_N_Abort_Statement in Exp_Ch9 for more information.
-- _Disp_Timed_Select (15) - used in the expansion of timed selects
-- with dispatching triggers. Null implementation for limited
-- interfaces, full body generation for types that implement limited
-- interfaces, not generated for the rest of the cases. See Expand_N_
-- Timed_Entry_Call for more information.
-- Lifecycle of predefined primitive operations
-- The specifications and bodies of the PPOs are created by
-- Make_Predefined_Primitive_Specs and Predefined_Primitive_Bodies
-- in Exp_Ch3. The generated specifications are immediately analyzed,
-- while the bodies are left as freeze actions to the tagged type for
-- which they are created.
-- PPOs are collected and added to the Primitive_Operations list of
-- a type by the regular analysis mechanism.
-- PPOs are frozen in Predefined_Primitive_Freeze in Exp_Ch3.
-- Thunks for PPOs are created in Freeze_Subprogram in Exp_Ch6, by a
-- call to Register_Predefined_DT_Entry, also in Exp_Ch6.
-- Dispatch table positions of PPOs are set in Set_All_DT_Position in
-- Exp_Disp.
-- Calls to PPOs procede as regular dispatching calls. If the PPO
-- has a thunk, a call procedes as a regular dispatching call with
-- a thunk.
-- Guidelines for addition of new predefined primitive operations
-- Update the value of constant Default_Prim_Op_Count in A-Tags.ads
-- to reflect the new number of PPOs.
-- Introduce a new predefined name for the new PPO in Snames.ads and
-- Snames.adb.
-- Categorize the new PPO name as predefined by adding an entry in
-- Is_Predefined_Dispatching_Operation in Exp_Util.adb.
-- Generate the specification of the new PPO in Make_Predefined_
-- Primitive_Spec in Exp_Ch3.adb. The Is_Internal flag of the defining
-- identifier of the specification must be set to True.
-- Generate the body of the new PPO in Predefined_Primitive_Bodies in
-- Exp_Ch3.adb. The Is_Internal flag of the defining identifier of the
-- specification must be set to True.
-- If the new PPO requires a thunk, add an entry in Freeze_Subprogram
-- in Exp_Ch6.adb.
-- When generating calls to a PPO, use Find_Prim_Op from Exp_Util.ads
-- to retrieve the entity of the operation directly.
-- Number of predefined primitive operations added by the Expander
-- for a tagged type. If more predefined primitive operations are
-- added, the following items must be changed:
-- Ada.Tags.Defailt_Prim_Op_Count - indirect use
-- Exp_Disp.Default_Prim_Op_Position - indirect use
-- Exp_Disp.Set_All_DT_Position - direct use
type DT_Access_Action is
(CW_Membership,
IW_Membership,
DT_Entry_Size,
DT_Prologue_Size,
Get_Access_Level,
Get_Entry_Index,
Get_External_Tag,
Get_Predefined_Prim_Op_Address,
Get_Prim_Op_Address,
Get_Prim_Op_Kind,
Get_RC_Offset,
Get_Remotely_Callable,
Get_Tagged_Kind,
Inherit_DT,
Inherit_TSD,
Register_Interface_Tag,
Register_Tag,
Set_Access_Level,
Set_Entry_Index,
Set_Expanded_Name,
Set_External_Tag,
Set_Interface_Table,
Set_Offset_Index,
Set_OSD,
Set_Predefined_Prim_Op_Address,
Set_Prim_Op_Address,
Set_Prim_Op_Kind,
Set_RC_Offset,
Set_Remotely_Callable,
Set_Signature,
Set_SSD,
Set_TSD,
Set_Tagged_Kind,
TSD_Entry_Size,
TSD_Prologue_Size);
procedure Expand_Dispatching_Call (Call_Node : Node_Id);
-- Expand the call to the operation through the dispatch table and perform
-- the required tag checks when appropriate. For CPP types the call is
-- done through the Vtable (tag checks are not relevant)
procedure Expand_Interface_Actuals (Call_Node : Node_Id);
-- Ada 2005 (AI-251): Displace all the actuals corresponding to class-wide
-- interfaces to reference the interface tag of the actual object
procedure Expand_Interface_Conversion
(N : Node_Id;
Is_Static : Boolean := True);
-- Ada 2005 (AI-251): N is a type-conversion node. Reference the base of
-- the object to give access to the interface tag associated with the
-- secondary dispatch table.
function Expand_Interface_Thunk
(N : Node_Id;
Thunk_Alias : Node_Id;
Thunk_Id : Entity_Id) return Node_Id;
-- Ada 2005 (AI-251): When a tagged type implements abstract interfaces we
-- generate additional subprograms (thunks) to have a layout compatible
-- with the C++ ABI. The thunk modifies the value of the first actual of
-- the call (that is, the pointer to the object) before transferring
-- control to the target function.
function Fill_DT_Entry
(Loc : Source_Ptr;
Prim : Entity_Id) return Node_Id;
-- Generate the code necessary to fill the appropriate entry of the
-- dispatch table of Prim's controlling type with Prim's address.
function Fill_Secondary_DT_Entry
(Loc : Source_Ptr;
Prim : Entity_Id;
Thunk_Id : Entity_Id;
Iface_DT_Ptr : Entity_Id) return Node_Id;
-- (Ada 2005): Generate the code necessary to fill the appropriate entry of
-- the secondary dispatch table of Prim's controlling type with Thunk_Id's
-- address.
function Get_Remotely_Callable (Obj : Node_Id) return Node_Id;
-- Return an expression that holds True if the object can be transmitted
-- onto another partition according to E.4 (18)
function Init_Predefined_Interface_Primitives
(Typ : Entity_Id) return List_Id;
-- Ada 2005 (AI-251): Initialize the entries associated with predefined
-- primitives in all the secondary dispatch tables of Typ.
function Make_DT_Access_Action
(Typ : Entity_Id;
Action : DT_Access_Action;
Args : List_Id) return Node_Id;
-- Generate a call to one of the Dispatch Table Access Subprograms defined
-- in Ada.Tags or in Interfaces.Cpp
function Make_DT (Typ : Entity_Id) return List_Id;
-- Expand the declarations for the Dispatch Table (or the Vtable in
-- the case of type whose ancestor is a CPP_Class)
function Make_Disp_Asynchronous_Select_Body
(Typ : Entity_Id) return Node_Id;
-- Ada 2005 (AI-345): Generate the body of the primitive operation of type
-- Typ used for dispatching in asynchronous selects. Generate a null body
-- if Typ is an interface type.
function Make_Disp_Asynchronous_Select_Spec
(Typ : Entity_Id) return Node_Id;
-- Ada 2005 (AI-345): Generate the specification of the primitive operation
-- of type Typ used for dispatching in asynchronous selects.
function Make_Disp_Conditional_Select_Body
(Typ : Entity_Id) return Node_Id;
-- Ada 2005 (AI-345): Generate the body of the primitive operation of type
-- Typ used for dispatching in conditional selects. Generate a null body
-- if Typ is an interface type.
function Make_Disp_Conditional_Select_Spec
(Typ : Entity_Id) return Node_Id;
-- Ada 2005 (AI-345): Generate the specification of the primitive operation
-- of type Typ used for dispatching in conditional selects.
function Make_Disp_Get_Prim_Op_Kind_Body
(Typ : Entity_Id) return Node_Id;
-- Ada 2005 (AI-345): Generate the body of the primitive operation of type
-- Typ used for retrieving the callable entity kind during dispatching in
-- asynchronous selects. Generate a null body if Typ is an interface type.
function Make_Disp_Get_Prim_Op_Kind_Spec
(Typ : Entity_Id) return Node_Id;
-- Ada 2005 (AI-345): Generate the specification of the primitive operation
-- of the type Typ use for retrieving the callable entity kind during
-- dispatching in asynchronous selects.
function Make_Disp_Get_Task_Id_Body
(Typ : Entity_Id) return Node_Id;
-- Ada 2005 (AI-345): Generate the body of the primitive operation of type
-- Typ used for retrieving the _task_id field of a task interface class-
-- wide type. Generate a null body if Typ is an interface or a non-task
-- type.
function Make_Disp_Get_Task_Id_Spec
(Typ : Entity_Id) return Node_Id;
-- Ada 2005 (AI-345): Generate the specification of the primitive operation
-- of type Typ used for retrieving the _task_id field of a task interface
-- class-wide type.
function Make_Disp_Timed_Select_Body
(Typ : Entity_Id) return Node_Id;
-- Ada 2005 (AI-345): Generate the body of the primitive operation of type
-- Typ used for dispatching in timed selects. Generate a null body if Nul
-- is an interface type.
function Make_Disp_Timed_Select_Spec
(Typ : Entity_Id) return Node_Id;
-- Ada 2005 (AI-345): Generate the specification of the primitive operation
-- of type Typ used for dispatching in timed selects.
function Make_Select_Specific_Data_Table
(Typ : Entity_Id) return List_Id;
-- Ada 2005 (AI-345): Create and populate the auxiliary table in the TSD
-- of Typ used for dispatching in asynchronous, conditional and timed
-- selects. Generate code to set the primitive operation kinds and entry
-- indices of primitive operations and primitive wrappers.
procedure Make_Secondary_DT
(Typ : Entity_Id;
Ancestor_Typ : Entity_Id;
Suffix_Index : Int;
Iface : Entity_Id;
AI_Tag : Entity_Id;
Acc_Disp_Tables : in out Elist_Id;
Result : out List_Id);
-- Ada 2005 (AI-251): Expand the declarations for the Secondary Dispatch
-- Table of Typ associated with Iface (each abstract interface implemented
-- by Typ has a secondary dispatch table). The arguments Typ, Ancestor_Typ
-- and Suffix_Index are used to generate an unique external name which
-- is added at the end of Acc_Disp_Tables; this external name will be
-- used later by the subprogram Exp_Ch3.Build_Init_Procedure.
procedure Set_All_DT_Position (Typ : Entity_Id);
-- Set the DT_Position field for each primitive operation. In the CPP
-- Class case check that no pragma CPP_Virtual is missing and that the
-- DT_Position are coherent
procedure Set_Default_Constructor (Typ : Entity_Id);
-- Typ is a CPP_Class type. Create the Init procedure of that type to
-- be the default constructor (i.e. the function returning this type,
-- having a pragma CPP_Constructor and no parameter)
procedure Write_DT (Typ : Entity_Id);
pragma Export (Ada, Write_DT);
-- Debugging procedure (to be called within gdb)
end Exp_Disp;
|
-- Copyright 2013-2021 Free Software Foundation, Inc.
--
-- This program 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 3 of the License, or
-- (at your option) any later version.
--
-- This program 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 program. If not, see <http://www.gnu.org/licenses/>.
pragma Initialize_Scalars;
with Pck; use Pck;
procedure Foo is
A : Integer;
begin
Do_Nothing (A'Address);
end Foo;
|
--
-- 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 system; use system;
with soc.rcc;
package body soc.exti
with spark_mode => off
is
procedure init
is
begin
for line in t_exti_line_index'range loop
clear_pending(line);
disable(line);
end loop;
soc.rcc.RCC.APB2ENR.SYSCFGEN := true;
end init;
function is_line_pending
(line : t_exti_line_index)
return boolean
is
begin
return (EXTI.PR.line(line) = PENDING_REQUEST);
end is_line_pending;
procedure clear_pending
(line : in t_exti_line_index)
is
begin
EXTI.PR.line(line) := CLEAR_REQUEST;
end clear_pending;
procedure enable
(line : in t_exti_line_index)
is
begin
EXTI.IMR.line(line) := NOT_MASKED; -- interrupt is unmasked
end enable;
procedure disable
(line : in t_exti_line_index)
is
begin
EXTI.IMR.line(line) := MASKED; -- interrupt is masked
end disable;
function is_enabled (line : in t_exti_line_index)
return boolean
is
begin
return EXTI.IMR.line(line) = NOT_MASKED;
end;
end soc.exti;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- A D A . S T R I N G S . B O U N D E D --
-- --
-- S p e c --
-- --
-- $Revision$
-- --
-- Copyright (C) 1992-2000 Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
-- apply solely to the contents of the part following the private keyword. --
-- --
-- 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. --
-- --
-- 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. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with Ada.Strings.Maps;
package Ada.Strings.Bounded is
pragma Preelaborate (Bounded);
generic
Max : Positive;
-- Maximum length of a Bounded_String
package Generic_Bounded_Length is
Max_Length : constant Positive := Max;
type Bounded_String is private;
Null_Bounded_String : constant Bounded_String;
subtype Length_Range is Natural range 0 .. Max_Length;
function Length (Source : in Bounded_String) return Length_Range;
--------------------------------------------------------
-- Conversion, Concatenation, and Selection Functions --
--------------------------------------------------------
function To_Bounded_String
(Source : in String;
Drop : in Truncation := Error)
return Bounded_String;
function To_String (Source : in Bounded_String) return String;
function Append
(Left, Right : in Bounded_String;
Drop : in Truncation := Error)
return Bounded_String;
function Append
(Left : in Bounded_String;
Right : in String;
Drop : in Truncation := Error)
return Bounded_String;
function Append
(Left : in String;
Right : in Bounded_String;
Drop : in Truncation := Error)
return Bounded_String;
function Append
(Left : in Bounded_String;
Right : in Character;
Drop : in Truncation := Error)
return Bounded_String;
function Append
(Left : in Character;
Right : in Bounded_String;
Drop : in Truncation := Error)
return Bounded_String;
procedure Append
(Source : in out Bounded_String;
New_Item : in Bounded_String;
Drop : in Truncation := Error);
procedure Append
(Source : in out Bounded_String;
New_Item : in String;
Drop : in Truncation := Error);
procedure Append
(Source : in out Bounded_String;
New_Item : in Character;
Drop : in Truncation := Error);
function "&"
(Left, Right : in Bounded_String)
return Bounded_String;
function "&"
(Left : in Bounded_String;
Right : in String)
return Bounded_String;
function "&"
(Left : in String;
Right : in Bounded_String)
return Bounded_String;
function "&"
(Left : in Bounded_String;
Right : in Character)
return Bounded_String;
function "&"
(Left : in Character;
Right : in Bounded_String)
return Bounded_String;
function Element
(Source : in Bounded_String;
Index : in Positive)
return Character;
procedure Replace_Element
(Source : in out Bounded_String;
Index : in Positive;
By : in Character);
function Slice
(Source : in Bounded_String;
Low : in Positive;
High : in Natural)
return String;
function "=" (Left, Right : in Bounded_String) return Boolean;
function "="
(Left : in Bounded_String;
Right : in String)
return Boolean;
function "="
(Left : in String;
Right : in Bounded_String)
return Boolean;
function "<" (Left, Right : in Bounded_String) return Boolean;
function "<"
(Left : in Bounded_String;
Right : in String)
return Boolean;
function "<"
(Left : in String;
Right : in Bounded_String)
return Boolean;
function "<=" (Left, Right : in Bounded_String) return Boolean;
function "<="
(Left : in Bounded_String;
Right : in String)
return Boolean;
function "<="
(Left : in String;
Right : in Bounded_String)
return Boolean;
function ">" (Left, Right : in Bounded_String) return Boolean;
function ">"
(Left : in Bounded_String;
Right : in String)
return Boolean;
function ">"
(Left : in String;
Right : in Bounded_String)
return Boolean;
function ">=" (Left, Right : in Bounded_String) return Boolean;
function ">="
(Left : in Bounded_String;
Right : in String)
return Boolean;
function ">="
(Left : in String;
Right : in Bounded_String)
return Boolean;
----------------------
-- Search Functions --
----------------------
function Index
(Source : in Bounded_String;
Pattern : in String;
Going : in Direction := Forward;
Mapping : in Maps.Character_Mapping := Maps.Identity)
return Natural;
function Index
(Source : in Bounded_String;
Pattern : in String;
Going : in Direction := Forward;
Mapping : in Maps.Character_Mapping_Function)
return Natural;
function Index
(Source : in Bounded_String;
Set : in Maps.Character_Set;
Test : in Membership := Inside;
Going : in Direction := Forward)
return Natural;
function Index_Non_Blank
(Source : in Bounded_String;
Going : in Direction := Forward)
return Natural;
function Count
(Source : in Bounded_String;
Pattern : in String;
Mapping : in Maps.Character_Mapping := Maps.Identity)
return Natural;
function Count
(Source : in Bounded_String;
Pattern : in String;
Mapping : in Maps.Character_Mapping_Function)
return Natural;
function Count
(Source : in Bounded_String;
Set : in Maps.Character_Set)
return Natural;
procedure Find_Token
(Source : in Bounded_String;
Set : in Maps.Character_Set;
Test : in Membership;
First : out Positive;
Last : out Natural);
------------------------------------
-- String Translation Subprograms --
------------------------------------
function Translate
(Source : in Bounded_String;
Mapping : in Maps.Character_Mapping)
return Bounded_String;
procedure Translate
(Source : in out Bounded_String;
Mapping : in Maps.Character_Mapping);
function Translate
(Source : in Bounded_String;
Mapping : in Maps.Character_Mapping_Function)
return Bounded_String;
procedure Translate
(Source : in out Bounded_String;
Mapping : in Maps.Character_Mapping_Function);
---------------------------------------
-- String Transformation Subprograms --
---------------------------------------
function Replace_Slice
(Source : in Bounded_String;
Low : in Positive;
High : in Natural;
By : in String;
Drop : in Truncation := Error)
return Bounded_String;
procedure Replace_Slice
(Source : in out Bounded_String;
Low : in Positive;
High : in Natural;
By : in String;
Drop : in Truncation := Error);
function Insert
(Source : in Bounded_String;
Before : in Positive;
New_Item : in String;
Drop : in Truncation := Error)
return Bounded_String;
procedure Insert
(Source : in out Bounded_String;
Before : in Positive;
New_Item : in String;
Drop : in Truncation := Error);
function Overwrite
(Source : in Bounded_String;
Position : in Positive;
New_Item : in String;
Drop : in Truncation := Error)
return Bounded_String;
procedure Overwrite
(Source : in out Bounded_String;
Position : in Positive;
New_Item : in String;
Drop : in Truncation := Error);
function Delete
(Source : in Bounded_String;
From : in Positive;
Through : in Natural)
return Bounded_String;
procedure Delete
(Source : in out Bounded_String;
From : in Positive;
Through : in Natural);
---------------------------------
-- String Selector Subprograms --
---------------------------------
function Trim
(Source : in Bounded_String;
Side : in Trim_End)
return Bounded_String;
procedure Trim
(Source : in out Bounded_String;
Side : in Trim_End);
function Trim
(Source : in Bounded_String;
Left : in Maps.Character_Set;
Right : in Maps.Character_Set)
return Bounded_String;
procedure Trim
(Source : in out Bounded_String;
Left : in Maps.Character_Set;
Right : in Maps.Character_Set);
function Head
(Source : in Bounded_String;
Count : in Natural;
Pad : in Character := Space;
Drop : in Truncation := Error)
return Bounded_String;
procedure Head
(Source : in out Bounded_String;
Count : in Natural;
Pad : in Character := Space;
Drop : in Truncation := Error);
function Tail
(Source : in Bounded_String;
Count : in Natural;
Pad : in Character := Space;
Drop : in Truncation := Error)
return Bounded_String;
procedure Tail
(Source : in out Bounded_String;
Count : in Natural;
Pad : in Character := Space;
Drop : in Truncation := Error);
------------------------------------
-- String Constructor Subprograms --
------------------------------------
function "*"
(Left : in Natural;
Right : in Character)
return Bounded_String;
function "*"
(Left : in Natural;
Right : in String)
return Bounded_String;
function "*"
(Left : in Natural;
Right : in Bounded_String)
return Bounded_String;
function Replicate
(Count : in Natural;
Item : in Character;
Drop : in Truncation := Error)
return Bounded_String;
function Replicate
(Count : in Natural;
Item : in String;
Drop : in Truncation := Error)
return Bounded_String;
function Replicate
(Count : in Natural;
Item : in Bounded_String;
Drop : in Truncation := Error)
return Bounded_String;
private
type Bounded_String is record
Length : Length_Range := 0;
Data : String (1 .. Max_Length) := (1 .. Max_Length => ASCII.NUL);
end record;
Null_Bounded_String : constant Bounded_String :=
(Length => 0, Data => (1 .. Max_Length => ASCII.NUL));
-- Pragma Inline declarations (GNAT specific additions)
pragma Inline ("=");
pragma Inline ("<");
pragma Inline ("<=");
pragma Inline (">");
pragma Inline (">=");
pragma Inline ("&");
pragma Inline (Count);
pragma Inline (Element);
pragma Inline (Find_Token);
pragma Inline (Index);
pragma Inline (Index_Non_Blank);
pragma Inline (Length);
pragma Inline (Replace_Element);
pragma Inline (Slice);
pragma Inline (To_Bounded_String);
pragma Inline (To_String);
end Generic_Bounded_Length;
end Ada.Strings.Bounded;
|
------------------------------------------------------------------------------
-- Copyright (c) 2011, 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. --
------------------------------------------------------------------------------
-----------------------------------------------------------------------
-- Test_All is a binary gathering all tests from Natools components. --
-----------------------------------------------------------------------
with Ada.Command_Line;
with Ada.Text_IO;
with Natools.Chunked_Strings.Tests;
with Natools.Constant_Indefinite_Ordered_Map_Tests;
with Natools.Cron.Tests;
with Natools.Getopt_Long_Tests;
with Natools.HMAC_Tests;
with Natools.Reference_Tests;
with Natools.Reference_Tests.Pools;
with Natools.S_Expressions.Atom_Buffers.Tests;
with Natools.S_Expressions.Cache_Tests;
with Natools.S_Expressions.Conditionals.Tests;
with Natools.S_Expressions.Dynamic_Interpreter_Tests;
with Natools.S_Expressions.Encodings.Tests;
with Natools.S_Expressions.Enumeration_IO.Tests;
with Natools.S_Expressions.File_RW_Tests;
with Natools.S_Expressions.Interpreter_Tests;
with Natools.S_Expressions.Lockable.Tests;
with Natools.S_Expressions.Parsers.Tests;
with Natools.S_Expressions.Printers.Tests;
with Natools.S_Expressions.Printers.Pretty.Tests;
with Natools.S_Expressions.Printers.Pretty.Config.Tests;
with Natools.S_Expressions.Templates.Tests;
with Natools.Smaz.Tests;
with Natools.Smaz_Tests;
with Natools.Static_Hash_Maps.S_Expressions.Tests;
with Natools.String_Slice_Set_Tests;
with Natools.String_Slice_Tests;
with Natools.Time_IO.Tests;
with Natools.Time_Keys.Tests;
with Natools.Time_Statistics.Tests;
with Natools.Tests.Text_IO;
procedure Test_All is
package Uneven_Chunked_Strings is new Natools.Chunked_Strings
(Default_Allocation_Unit => 7,
Default_Chunk_Size => 15);
package Uneven_Chunked_Strings_Tests is new Uneven_Chunked_Strings.Tests;
package Even_Chunked_Strings is new Natools.Chunked_Strings
(Default_Allocation_Unit => 6,
Default_Chunk_Size => 18);
package Even_Chunked_Strings_Tests is new Even_Chunked_Strings.Tests;
package Single_Chunked_Strings is new Natools.Chunked_Strings
(Default_Allocation_Unit => 10,
Default_Chunk_Size => 10);
package Single_Chunked_Strings_Tests is new Single_Chunked_Strings.Tests;
Report : Natools.Tests.Text_IO.Text_Reporter;
begin
Ada.Text_IO.Set_Line_Length (80);
Report.Section ("All Tests");
Report.Section ("Chunked_String with uneven allocation unit");
Uneven_Chunked_Strings_Tests.All_Tests (Report);
Report.End_Section;
Report.Section ("Chunked_String with even allocation unit");
Even_Chunked_Strings_Tests.All_Tests (Report);
Report.End_Section;
Report.Section ("Chunked_String with single allocation unit");
Single_Chunked_Strings_Tests.All_Tests (Report);
Report.End_Section;
Report.Section ("Constant_Indefinite_Ordered_Maps");
Natools.Constant_Indefinite_Ordered_Map_Tests.All_Tests (Report);
Report.End_Section;
Report.Section ("Cron");
Natools.Cron.Tests.All_Tests (Report);
Report.End_Section;
Report.Section ("Getopt_Long");
Natools.Getopt_Long_Tests.All_Tests (Report);
Report.End_Section;
Report.Section ("HMAC and GNAT_HMAC");
Natools.HMAC_Tests.All_Tests (Report);
Report.End_Section;
Report.Section ("References");
Natools.Reference_Tests.All_Tests (Report);
Natools.Reference_Tests.Test_Task_Safety (Report);
Report.End_Section;
Report.Section ("References.Pools");
Natools.Reference_Tests.Pools.All_Tests (Report);
Report.End_Section;
Report.Section ("S_Expressions.Atom_Buffers");
Natools.S_Expressions.Atom_Buffers.Tests.All_Tests (Report);
Report.End_Section;
Report.Section ("S_Expressions.Caches");
Natools.S_Expressions.Cache_Tests.All_Tests (Report);
Report.End_Section;
Report.Section ("S_Expressions.Conditionals");
Natools.S_Expressions.Conditionals.Tests.All_Tests (Report);
Report.End_Section;
Report.Section ("S_Expressions.Dynamic_Interpreters");
Natools.S_Expressions.Dynamic_Interpreter_Tests.All_Tests (Report);
Report.End_Section;
Report.Section ("S_Expressions.Encodings");
Natools.S_Expressions.Encodings.Tests.All_Tests (Report);
Report.End_Section;
Report.Section ("S_Expressions.Enumeration_IO");
Natools.S_Expressions.Enumeration_IO.Tests.All_Tests (Report);
Report.End_Section;
Report.Section ("S_Expressions.File_Readers and File_Writers");
Natools.S_Expressions.File_RW_Tests.All_Tests (Report);
Report.End_Section;
Report.Section ("S_Expressions.Interpreters");
Natools.S_Expressions.Interpreter_Tests.All_Tests (Report);
Report.End_Section;
Report.Section ("S_Expressions.Lockable");
Natools.S_Expressions.Lockable.Tests.All_Tests (Report);
Report.End_Section;
Report.Section ("S_Expressions.Parsers");
Natools.S_Expressions.Parsers.Tests.All_Tests (Report);
Report.End_Section;
Report.Section ("S_Expressions.Printers");
Natools.S_Expressions.Printers.Tests.All_Tests (Report);
Report.End_Section;
Report.Section ("S_Expressions.Printers.Pretty");
Natools.S_Expressions.Printers.Pretty.Tests.All_Tests (Report);
Report.End_Section;
Report.Section ("S_Expressions.Printers.Pretty.Config");
Natools.S_Expressions.Printers.Pretty.Config.Tests.All_Tests (Report);
Report.End_Section;
Report.Section ("S_Expressions.Templates");
Natools.S_Expressions.Templates.Tests.All_Tests (Report);
Report.End_Section;
Report.Section ("Smaz");
Natools.Smaz_Tests.All_Tests (Report);
Report.End_Section;
Report.Section ("Smaz (superseded)");
Natools.Smaz.Tests.All_Tests (Report);
Report.End_Section;
Report.Section ("Static_Hash_Maps.S_Expressions");
Natools.Static_Hash_Maps.S_Expressions.Tests.All_Tests (Report);
Report.End_Section;
Report.Section ("String_Slices");
Natools.String_Slice_Tests.All_Tests (Report);
Report.End_Section;
Report.Section ("String_Slices.Slice_Sets");
Natools.String_Slice_Set_Tests.All_Tests (Report);
Report.End_Section;
Report.Section ("Time_IO");
Natools.Time_IO.Tests.All_Tests (Report);
Report.End_Section;
Report.Section ("Time_Keys");
Natools.Time_Keys.Tests.All_Tests (Report);
Report.End_Section;
Report.Section ("Time_Statistics");
Natools.Time_Statistics.Tests.All_Tests (Report);
Report.End_Section;
Natools.Tests.Text_IO.Print_Results (Report.Total_Results);
declare
Results : constant Natools.Tests.Result_Summary := Report.Total_Results;
begin
if Results (Natools.Tests.Fail) > 0 or
Results (Natools.Tests.Error) > 0
then
Ada.Command_Line.Set_Exit_Status (Ada.Command_Line.Failure);
else
Ada.Command_Line.Set_Exit_Status (Ada.Command_Line.Success);
end if;
end;
Report.End_Section;
end Test_All;
|
package p2 is
end p2;
|
-- CE3303A.ADA
-- Grant of Unlimited Rights
--
-- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
-- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
-- unlimited rights in the software and documentation contained herein.
-- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
-- this public release, the Government intends to confer upon all
-- recipients unlimited rights equal to those held by the Government.
-- These rights include rights to use, duplicate, release or disclose the
-- released technical data and computer software in whole or in part, in
-- any manner and for any purpose whatsoever, and to have or permit others
-- to do so.
--
-- DISCLAIMER
--
-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
-- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
-- PARTICULAR PURPOSE OF SAID MATERIAL.
--*
-- OBJECTIVE:
-- CHECK THAT SET_LINE_LENGTH, SET_PAGE_LENGTH, LINE_LENGTH, AND
-- PAGE_LENGTH RAISE STATUS_ERROR WHEN APPLIED TO A CLOSED FILE.
-- HISTORY:
-- ABW 08/26/82
-- SPS 09/16/82
-- JLH 08/19/87 ADDED AN ATTEMPT TO CREATE AN EXTERNAL FILE;
-- ADDED CHECKS TO THE SAME FOUR CASES WHICH EXIST
-- IN TEST AGAINST ATTEMPTED CREATE.
WITH REPORT;
USE REPORT;
WITH TEXT_IO;
USE TEXT_IO;
PROCEDURE CE3303A IS
FILE : FILE_TYPE;
FIVE : COUNT := COUNT(IDENT_INT(5));
C : COUNT;
ITEM : CHARACTER := 'A';
BEGIN
TEST ("CE3303A" , "CHECK THAT SET_LINE_LENGTH, " &
"SET_PAGE_LENGTH, LINE_LENGTH, AND " &
"PAGE_LENGTH RAISE STATUS_ERROR " &
"WHEN APPLIED TO A CLOSED FILE");
-- FILE NONEXISTANT
BEGIN
SET_LINE_LENGTH (FILE, FIVE);
FAILED ("STATUS_ERROR NOT RAISED FOR SET_LINE_LENGTH - 1");
EXCEPTION
WHEN STATUS_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ("OTHER EXCEPTION RAISED FOR SET_LINE_LENGTH " &
"- 1");
END;
BEGIN
SET_PAGE_LENGTH (FILE, FIVE);
FAILED ("STATUS_ERROR NOT RAISED FOR SET_PAGE_LENGTH - 1");
EXCEPTION
WHEN STATUS_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ("OTHER EXCEPTION RAISED FOR SET_PAGE_LENGTH " &
"- 1");
END;
BEGIN
C := LINE_LENGTH (FILE);
FAILED ("STATUS_ERROR NOT RAISED FOR LINE_LENGTH - 1");
EXCEPTION
WHEN STATUS_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ("OTHER EXCEPTION RAISED FOR LINE_LENGTH - 1");
END;
BEGIN
C := PAGE_LENGTH (FILE);
FAILED ("STATUS_ERROR NOT RAISED FOR PAGE_LENGTH - 1");
EXCEPTION
WHEN STATUS_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ("OTHER EXCEPTION RAISED FOR PAGE_LENGTH - 1");
END;
BEGIN
CREATE (FILE, OUT_FILE);
PUT (FILE, ITEM);
CLOSE (FILE);
EXCEPTION
WHEN USE_ERROR =>
NULL;
END;
BEGIN
SET_LINE_LENGTH (FILE, FIVE);
FAILED ("STATUS_ERROR NOT RAISED FOR SET_LINE_LENGTH - 2");
EXCEPTION
WHEN STATUS_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ("OTHER EXCEPTION RAISED FOR SET_LINE_LENGTH " &
"- 2");
END;
BEGIN
SET_PAGE_LENGTH (FILE, FIVE);
FAILED ("STATUS_ERROR NOT RAISED FOR SET_PAGE_LENGTH - 2");
EXCEPTION
WHEN STATUS_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ("OTHER EXCEPTION RAISED FOR SET_PAGE_LENGTH " &
"- 2");
END;
BEGIN
C := LINE_LENGTH (FILE);
FAILED ("STATUS_ERROR NOT RAISED FOR LINE_LENGTH - 2");
EXCEPTION
WHEN STATUS_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ("OTHER EXCEPTION RAISED FOR LINE_LENGTH - 2");
END;
BEGIN
C := PAGE_LENGTH (FILE);
FAILED ("STATUS_ERROR NOT RAISED FOR PAGE_LENGTH - 2");
EXCEPTION
WHEN STATUS_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ("OTHER EXCEPTION RAISED FOR PAGE_LENGTH - 2");
END;
RESULT;
END CE3303A;
|
-- Auto_Counters_Suite.Refcounted_KVFlyweights_Tests
-- Unit tests for Auto_Counters Refcounted KVFlyweights packages
-- Copyright (c) 2016, James Humphry - see LICENSE file for details
with Ada.Containers, Ada.Finalization;
with AUnit.Assertions;
with Basic_Refcounted_KVFlyweights;
with Protected_Refcounted_KVFlyweights;
package body Auto_Counters_Suite.Refcounted_KVFlyweights_Tests is
subtype Hash_Type is Ada.Containers.Hash_Type;
use type Ada.Containers.Hash_Type;
use AUnit.Assertions;
Resources_Released : Natural := 0;
subtype TestKey_Type is Hash_Type;
type TestValue_Type is new Ada.Finalization.Controlled with
record
Value : Hash_Type;
end record;
type TestValue_Access is access TestValue_Type;
function Hash (E : TestKey_Type) return Ada.Containers.Hash_Type is (E);
pragma Warnings (Off, "not dispatching");
function Factory (E : in TestKey_Type) return TestValue_Access is
(new TestValue_Type'(Ada.Finalization.Controlled with Value => E));
pragma Warnings (On, "not dispatching");
overriding procedure Finalize (Object : in out TestValue_Type) is
begin
Resources_Released := Resources_Released + 1;
Object.Value := 999;
end Finalize;
package TestObj_Basic_KVFlyweights is
new Basic_Refcounted_KVFlyweights(Key => TestKey_Type,
Value => TestValue_Type,
Value_Access => TestValue_Access,
Factory => Factory,
Hash => Hash,
Capacity => 4);
use type TestObj_Basic_KVFlyweights.Value_Ptr;
use type TestObj_Basic_KVFlyweights.Value_Ref;
package TestObj_Protected_KVFlyweights is
new Protected_Refcounted_KVFlyweights(Key => TestKey_Type,
Value => TestValue_Type,
Value_Access => TestValue_Access,
Factory => Factory,
Hash => Hash,
Capacity => 4);
use type TestObj_Protected_KVFlyweights.Value_Ptr;
use type TestObj_Protected_KVFlyweights.Value_Ref;
--------------------
-- Register_Tests --
--------------------
procedure Register_Tests (T: in out Refcounted_KVFlyweights_Test) is
use AUnit.Test_Cases.Registration;
begin
Register_Routine (T, Check_Basic_Usage'Access,
"Check Basic_Refcounted_KVFlyweights");
Register_Routine (T, Check_Basic_Refs_Usage'Access,
"Check Basic_Refcounted_KVFlyweights Element_Refs");
Register_Routine (T, Check_Protected_Usage'Access,
"Check Protected_Refcounted_KVFlyweights");
Register_Routine (T, Check_Protected_Refs_Usage'Access,
"Check Protected_Refcounted_KVFlyweights Element_Refs");
end Register_Tests;
----------
-- Name --
----------
function Name (T : Refcounted_KVFlyweights_Test) return Test_String is
pragma Unreferenced (T);
begin
return Format ("Tests of Refcounted FKVlyweights packages");
end Name;
------------
-- Set_Up --
------------
procedure Set_Up (T : in out Refcounted_KVFlyweights_Test) is
begin
null;
end Set_Up;
-----------------------
-- Check_Basic_Usage --
-----------------------
procedure Check_Basic_Usage (T : in out Test_Cases.Test_Case'Class) is
pragma Unreferenced(T);
use TestObj_Basic_KVFlyweights;
F : aliased KVFlyweight;
P : array (Integer range 0..3) of Value_Ptr;
begin
-- Tests where elements are spread between buckets.
Resources_Released := 0;
for I in 0..3 loop
P(I) := Insert_Ptr(F => F,
K => Hash_Type(I));
end loop;
Assert(Resources_Released = 0,
"Resources being released on insertion into an empty KVFlyweight.");
for I in 0..3 loop
Assert(P(I).Get.Value = Hash_Type(I),
"Flyweight not storing values correctly.");
Assert(P(I).P.Value = Hash_Type(I),
"Flyweight not storing values correctly.");
end loop;
Resources_Released := 0;
declare
Q : Value_Ptr := Insert_Ptr(F, 0);
pragma Unreferenced(Q);
begin
Assert(Resources_Released = 0,
"Resources being released on inserting duplicate key into a " &
"KVFlyweight.");
end;
Resources_Released := 0;
declare
R : Value_Ptr := Insert_Ptr(F, 4);
pragma Unreferenced (R);
begin
Assert(Resources_Released = 0,
"Resources being released on inserting resource into a " &
"KVFlyweight despite it not being a duplicate key.");
end;
Assert(Resources_Released = 1,
"Resources not being released when last pointer is destroyed.");
Resources_Released := 0;
declare
Q : constant Value_Ptr := Insert_Ptr(F, P(1).Get.Value);
begin
Assert(Q = P(1),
"Inserting a key value that is already in the KVFlyweight " &
"does not return the same Element_Ptr as already exists.");
Assert(Resources_Released = 0,
"Inserting a key value that is already in the KVFlyweight " &
"deallocates something.");
end;
-- Tests where all values hit same hash bucket
for I in 0..3 loop
P(I) := Insert_Ptr(F, Hash_Type(I * 4));
end loop;
for I in 0..3 loop
Assert(P(I).P.Value = Hash_Type(I * 4),
"Flyweight not storing values correctly.");
end loop;
Resources_Released := 0;
declare
Q : Value_Ptr := Insert_Ptr(F, 0);
pragma Unreferenced(Q);
begin
Assert(Resources_Released = 0,
"Resources being released on inserting duplicate key into a " &
"KVFlyweight.");
end;
Resources_Released := 0;
declare
R : Value_Ptr := Insert_Ptr(F, 99);
pragma Unreferenced (R);
begin
Assert(Resources_Released = 0,
"Resources being released on inserting resource into a " &
"KVFlyweight despite it not being a duplicate key.");
end;
Assert(Resources_Released = 1,
"Resources not being released when last pointer is destroyed.");
Resources_Released := 0;
declare
Q : constant Value_Ptr := Insert_Ptr(F,P(1).Get.Value);
begin
Assert(Q = P(1),
"Inserting a key value that is already in the KVFlyweight " &
"does not return the same Value_Ptr as already exists.");
Assert(Resources_Released = 0,
"Inserting a key value that is already in the KVFlyweight " &
"deallocates something.");
end;
end Check_Basic_Usage;
----------------------------
-- Check_Basic_Refs_Usage --
----------------------------
procedure Check_Basic_Refs_Usage (T : in out Test_Cases.Test_Case'Class) is
pragma Unreferenced(T);
use TestObj_Basic_KVFlyweights;
F : aliased KVFlyweight;
begin
declare
P1 : constant Value_Ptr := Insert_Ptr(F, 0);
R1 : constant Value_Ref := Make_Ref(P1);
begin
Assert(P1.Get = R1.Get,
"Value_Ref created from Value_Ptr does not point to the" &
"same value");
Assert(P1.Get.all = R1,
"Value_Ref created from Value_Ptr does not dereference to " &
"the same value");
end;
declare
R2 : constant Value_Ref := Insert_Ref(F, 1);
P2 : constant Value_Ptr := Make_Ptr(R2);
begin
Assert(P2.Get = R2.Get,
"Value_Ptr created from Value_Ref does not point to the" &
"same value");
Assert(P2.Get.all = R2,
"Value_Ptr created from Value_Ref does not dereference to " &
"the same value");
end;
Resources_Released := 0;
declare
R : Value_Ref := Insert_Ref(F, 4);
pragma Unreferenced (R);
begin
Assert(Resources_Released = 0,
"Resources being released on inserting resource into " &
"KVFlyweight despite it not being a duplicate.");
end;
Assert(Resources_Released = 1,
"Resources not being released when last Value_Ref is destroyed.");
end Check_Basic_Refs_Usage;
---------------------------
-- Check_Protected_Usage --
---------------------------
procedure Check_Protected_Usage (T : in out Test_Cases.Test_Case'Class) is
pragma Unreferenced(T);
use TestObj_Protected_KVFlyweights;
F : aliased KVFlyweight;
P : array (Integer range 0..3) of Value_Ptr;
begin
-- Tests where elements are spread between buckets.
Resources_Released := 0;
for I in 0..3 loop
P(I) := Insert_Ptr(F => F,
K => Hash_Type(I));
end loop;
Assert(Resources_Released = 0,
"Resources being released on insertion into an empty KVFlyweight.");
for I in 0..3 loop
Assert(P(I).Get.Value = Hash_Type(I),
"Flyweight not storing values correctly.");
Assert(P(I).P.Value = Hash_Type(I),
"Flyweight not storing values correctly.");
end loop;
Resources_Released := 0;
declare
Q : Value_Ptr := Insert_Ptr(F, 0);
pragma Unreferenced(Q);
begin
Assert(Resources_Released = 0,
"Resources being released on inserting duplicate key into a " &
"KVFlyweight.");
end;
Resources_Released := 0;
declare
R : Value_Ptr := Insert_Ptr(F, 4);
pragma Unreferenced (R);
begin
Assert(Resources_Released = 0,
"Resources being released on inserting resource into a " &
"KVFlyweight despite it not being a duplicate key.");
end;
Assert(Resources_Released = 1,
"Resources not being released when last pointer is destroyed.");
Resources_Released := 0;
declare
Q : constant Value_Ptr := Insert_Ptr(F, P(1).Get.Value);
begin
Assert(Q = P(1),
"Inserting a key value that is already in the KVFlyweight " &
"does not return the same Element_Ptr as already exists.");
Assert(Resources_Released = 0,
"Inserting a key value that is already in the KVFlyweight " &
"deallocates something.");
end;
-- Tests where all values hit same hash bucket
for I in 0..3 loop
P(I) := Insert_Ptr(F, Hash_Type(I * 4));
end loop;
for I in 0..3 loop
Assert(P(I).P.Value = Hash_Type(I * 4),
"Flyweight not storing values correctly.");
end loop;
Resources_Released := 0;
declare
Q : Value_Ptr := Insert_Ptr(F, 0);
pragma Unreferenced(Q);
begin
Assert(Resources_Released = 0,
"Resources being released on inserting duplicate key into a " &
"KVFlyweight.");
end;
Resources_Released := 0;
declare
R : Value_Ptr := Insert_Ptr(F, 99);
pragma Unreferenced (R);
begin
Assert(Resources_Released = 0,
"Resources being released on inserting resource into a " &
"KVFlyweight despite it not being a duplicate key.");
end;
Assert(Resources_Released = 1,
"Resources not being released when last pointer is destroyed.");
Resources_Released := 0;
declare
Q : constant Value_Ptr := Insert_Ptr(F,P(1).Get.Value);
begin
Assert(Q = P(1),
"Inserting a key value that is already in the KVFlyweight " &
"does not return the same Value_Ptr as already exists.");
Assert(Resources_Released = 0,
"Inserting a key value that is already in the KVFlyweight " &
"deallocates something.");
end;
end Check_Protected_Usage;
--------------------------------
-- Check_Protected_Refs_Usage --
--------------------------------
procedure Check_Protected_Refs_Usage (T : in out Test_Cases.Test_Case'Class) is
pragma Unreferenced(T);
use TestObj_Protected_KVFlyweights;
F : aliased KVFlyweight;
begin
declare
P1 : constant Value_Ptr := Insert_Ptr(F, 0);
R1 : constant Value_Ref := Make_Ref(P1);
begin
Assert(P1.Get = R1.Get,
"Value_Ref created from Value_Ptr does not point to the" &
"same value");
Assert(P1.Get.all = R1,
"Value_Ref created from Value_Ptr does not dereference to " &
"the same value");
end;
declare
R2 : constant Value_Ref := Insert_Ref(F, 1);
P2 : constant Value_Ptr := Make_Ptr(R2);
begin
Assert(P2.Get = R2.Get,
"Value_Ptr created from Value_Ref does not point to the" &
"same value");
Assert(P2.Get.all = R2,
"Value_Ptr created from Value_Ref does not dereference to " &
"the same value");
end;
Resources_Released := 0;
declare
R : Value_Ref := Insert_Ref(F, 4);
pragma Unreferenced (R);
begin
Assert(Resources_Released = 0,
"Resources being released on inserting resource into " &
"KVFlyweight despite it not being a duplicate.");
end;
Assert(Resources_Released = 1,
"Resources not being released when last Value_Ref is destroyed.");
end Check_Protected_Refs_Usage;
end Auto_Counters_Suite.Refcounted_KVFlyweights_Tests;
|
with System; use System;
with Interfaces.C; use Interfaces.C;
with Ada.Text_IO; use Ada.Text_IO;
package body Reference_QOI is
------------------
-- Check_Encode --
------------------
function Check_Encode (Pix : Storage_Array;
Desc : QOI.QOI_Desc;
Output : Storage_Array)
return Boolean
is
Ref_Output_Ptr : System.Address;
R_Desc : aliased Ref_Desc;
Ref_Out_Len : aliased Interfaces.C.int;
begin
R_Desc.Width := unsigned (Desc.Width);
R_Desc.height := unsigned (Desc.Height);
R_Desc.channels := char'Enum_Val (Desc.Channels);
R_Desc.colorspace := char'Enum_Val (Desc.Colorspace'Enum_Rep);
Ref_Output_Ptr := Encode (Data => Pix'Address,
Desc => R_Desc'Unrestricted_Access,
Out_Len => Ref_Out_Len'Access);
if Ref_Output_Ptr = System.Null_Address then
Put_Line ("Ref QOI failed to encode");
return False;
end if;
declare
Ref_Output : Storage_Array (1 .. Storage_Count (Ref_Out_Len))
with Address => Ref_Output_Ptr;
To_Compare : Storage_Count :=
Storage_Count'Min (Ref_Output'Length, Output'Length);
begin
if Ref_Output /= Output then
if Ref_Output'Length > Output'Length then
Put_Line ("Ref QOI output bigger (" &
Ref_Output'Length'Img & ")" &
" than ours (" & Output'Length'Img & ")");
elsif Ref_Output'Length < Output'Length then
Put_Line ("Ref QOI output smaller (" &
Ref_Output'Length'Img & ")" &
" than ours (" & Output'Length'Img & ")");
end if;
for Offset in 0 .. To_Compare - 1 loop
declare
A : constant Storage_Element :=
Ref_Output (Ref_Output'First + Offset);
B : constant Storage_Element :=
Output (Output'First + Offset);
begin
if A /= B then
Put_Line ("Byte diff" & Offset'Img &
" Ref:" & A'Img &
" Act:" & B'Img);
return False;
end if;
end;
end loop;
return False;
end if;
end;
return True;
end Check_Encode;
------------------
-- Check_Decode --
------------------
function Check_Decode (Data : Storage_Array;
Out_Desc : QOI.QOI_Desc;
Out_Data : Storage_Array)
return Boolean
is
Ref_Output_Ptr : System.Address;
R_Desc : aliased Ref_Desc;
begin
Ref_Output_Ptr := Decode (Data => Data'Address,
Size => Data'Length,
Desc => R_Desc'Unchecked_Access,
Channels => 0);
if Ref_Output_Ptr = System.Null_Address then
Put_Line ("Ref QOI failed to decode");
return False;
end if;
if R_Desc.width /= unsigned (Out_Desc.Width) then
Put_Line ("Ref width (" & R_Desc.width'Img & ") diff from ours " &
"(" & Out_Desc.Width'Img & ")");
return False;
end if;
if R_Desc.height /= unsigned (Out_Desc.Height) then
Put_Line ("Ref height (" & R_Desc.height'Img & ") diff from ours " &
"(" & Out_Desc.Height'Img & ")");
return False;
end if;
if R_Desc.channels /= char'Enum_Val (Out_Desc.Channels) then
Put_Line ("Ref channels (" & R_Desc.channels'Enum_Rep'Img &
") diff from ours " &
"(" & Out_Desc.Channels'Img & ")");
return False;
end if;
if R_Desc.colorspace /= char'Enum_Val (Out_Desc.Colorspace'Enum_Rep)
then
Put_Line ("Ref colorspace (" & R_Desc.colorspace'Enum_Rep'Img &
") diff from ours " &
"(" & Out_Desc.Colorspace'Enum_Rep'Img & ")");
return False;
end if;
declare
Ref_Out_Len : constant Storage_Count :=
Storage_Count (R_Desc.width *
R_Desc.height *
R_Desc.channels'Enum_Rep);
Ref_Output : Storage_Array (1 .. Storage_Count (Ref_Out_Len))
with Address => Ref_Output_Ptr;
To_Compare : Storage_Count :=
Storage_Count'Min (Ref_Output'Length, Out_Data'Length);
begin
if Ref_Output /= Out_Data then
if Ref_Output'Length > Out_Data'Length then
Put_Line ("Ref QOI decode output bigger (" &
Ref_Output'Length'Img & ")" &
" than ours (" & Out_Data'Length'Img & ")");
elsif Ref_Output'Length < Out_Data'Length then
Put_Line ("Ref QOI decode output smaller (" &
Ref_Output'Length'Img & ")" &
" than ours (" & Out_Data'Length'Img & ")");
end if;
for Offset in 0 .. To_Compare - 1 loop
declare
A : constant Storage_Element :=
Ref_Output (Ref_Output'First + Offset);
B : constant Storage_Element :=
Out_Data (Out_Data'First + Offset);
begin
if A /= B then
Put_Line ("Byte diff" & Offset'Img &
" Ref:" & A'Img &
" Act:" & B'Img);
return False;
end if;
end;
end loop;
return False;
end if;
end;
return True;
end Check_Decode;
end Reference_QOI;
|
package GESTE_Fonts.FreeSerifBoldItalic5pt7b is
Font : constant Bitmap_Font_Ref;
private
FreeSerifBoldItalic5pt7bBitmaps : aliased constant Font_Bitmap := (
16#00#, 16#00#, 16#00#, 16#00#, 16#03#, 16#01#, 16#80#, 16#80#, 16#40#,
16#40#, 16#00#, 16#10#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#02#, 16#82#, 16#41#, 16#20#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#02#, 16#81#, 16#41#, 16#E0#,
16#A0#, 16#F0#, 16#50#, 16#28#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#07#, 16#03#, 16#41#, 16#80#, 16#60#, 16#50#, 16#68#, 16#18#,
16#08#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#06#, 16#02#, 16#E3#,
16#60#, 16#DE#, 16#15#, 16#12#, 16#89#, 16#80#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#01#, 16#81#, 16#A0#, 16#E0#, 16#EC#, 16#94#, 16#6C#,
16#1B#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#06#, 16#02#,
16#01#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#02#, 16#02#, 16#01#, 16#01#, 16#00#, 16#80#,
16#40#, 16#20#, 16#10#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#04#,
16#02#, 16#00#, 16#80#, 16#40#, 16#20#, 16#20#, 16#10#, 16#10#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#02#, 16#03#, 16#C0#, 16#80#, 16#F0#,
16#20#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#40#, 16#F8#, 16#10#, 16#08#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#20#, 16#10#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#E0#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#20#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#01#, 16#01#, 16#00#, 16#80#, 16#80#, 16#40#, 16#20#,
16#20#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#03#, 16#03#,
16#41#, 16#21#, 16#B0#, 16#90#, 16#58#, 16#18#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#01#, 16#03#, 16#80#, 16#C0#, 16#40#, 16#20#,
16#30#, 16#3C#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#03#,
16#02#, 16#C0#, 16#60#, 16#20#, 16#20#, 16#20#, 16#3C#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#03#, 16#00#, 16#C0#, 16#40#, 16#E0#,
16#10#, 16#08#, 16#38#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#80#, 16#C0#, 16#C1#, 16#A0#, 16#F8#, 16#18#, 16#08#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#03#, 16#82#, 16#01#, 16#C0#,
16#20#, 16#10#, 16#08#, 16#38#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#01#, 16#81#, 16#81#, 16#C1#, 16#A0#, 16#D0#, 16#48#, 16#18#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#07#, 16#80#, 16#40#,
16#40#, 16#20#, 16#20#, 16#20#, 16#10#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#03#, 16#02#, 16#41#, 16#A0#, 16#60#, 16#D0#, 16#48#,
16#18#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#03#, 16#02#,
16#41#, 16#20#, 16#B0#, 16#70#, 16#10#, 16#30#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#01#, 16#80#, 16#00#, 16#00#,
16#00#, 16#30#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#01#, 16#80#, 16#00#, 16#00#, 16#00#, 16#30#, 16#08#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#20#, 16#E0#,
16#C0#, 16#18#, 16#02#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#F8#, 16#00#, 16#3E#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#01#, 16#00#,
16#70#, 16#0C#, 16#18#, 16#10#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#07#, 16#00#, 16#C0#, 16#60#, 16#20#, 16#60#, 16#00#, 16#10#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#03#, 16#C3#, 16#51#,
16#54#, 16#AA#, 16#55#, 16#3F#, 16#0F#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#80#, 16#40#, 16#E0#, 16#50#, 16#7C#, 16#26#,
16#33#, 16#80#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#07#, 16#C1#,
16#20#, 16#90#, 16#F0#, 16#6C#, 16#26#, 16#3E#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#01#, 16#E3#, 16#01#, 16#01#, 16#80#, 16#C0#,
16#22#, 16#0E#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#07#,
16#C1#, 16#90#, 16#88#, 16#C4#, 16#66#, 16#26#, 16#3E#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#07#, 16#E1#, 16#10#, 16#80#, 16#F0#,
16#68#, 16#22#, 16#3F#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#07#, 16#E1#, 16#20#, 16#80#, 16#F0#, 16#68#, 16#20#, 16#38#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#01#, 16#C1#, 16#11#, 16#80#,
16#9C#, 16#C6#, 16#22#, 16#0E#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#07#, 16#F1#, 16#10#, 16#88#, 16#FC#, 16#66#, 16#22#, 16#3B#,
16#80#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#07#, 16#01#, 16#80#,
16#80#, 16#C0#, 16#60#, 16#20#, 16#38#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#01#, 16#C0#, 16#C0#, 16#60#, 16#20#, 16#10#, 16#18#,
16#08#, 16#1C#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#07#, 16#E1#,
16#A0#, 16#A0#, 16#E0#, 16#78#, 16#26#, 16#3B#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#07#, 16#81#, 16#80#, 16#80#, 16#C0#, 16#60#,
16#22#, 16#3F#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#07#,
16#19#, 16#9D#, 16#54#, 16#AA#, 16#5B#, 16#49#, 16#B5#, 16#C0#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#07#, 16#31#, 16#91#, 16#48#, 16#B8#,
16#4C#, 16#46#, 16#32#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#01#, 16#C1#, 16#31#, 16#89#, 16#8C#, 16#C4#, 16#26#, 16#1E#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#07#, 16#C1#, 16#20#, 16#90#,
16#F8#, 16#60#, 16#20#, 16#38#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#01#, 16#C1#, 16#31#, 16#88#, 16#8C#, 16#C6#, 16#66#, 16#12#,
16#0E#, 16#40#, 16#00#, 16#00#, 16#00#, 16#00#, 16#07#, 16#C1#, 16#20#,
16#90#, 16#F0#, 16#78#, 16#24#, 16#3B#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#03#, 16#02#, 16#41#, 16#80#, 16#60#, 16#18#, 16#4C#,
16#1C#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#07#, 16#E2#,
16#D0#, 16#40#, 16#20#, 16#30#, 16#18#, 16#1C#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#07#, 16#31#, 16#10#, 16#88#, 16#C8#, 16#64#,
16#22#, 16#0E#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#07#,
16#31#, 16#90#, 16#D0#, 16#68#, 16#18#, 16#08#, 16#04#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#07#, 16#69#, 16#34#, 16#DA#, 16#76#,
16#33#, 16#09#, 16#08#, 16#80#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#07#, 16#61#, 16#A0#, 16#60#, 16#20#, 16#38#, 16#24#, 16#37#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#07#, 16#61#, 16#A0#, 16#E0#,
16#30#, 16#10#, 16#18#, 16#1E#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#07#, 16#C2#, 16#40#, 16#60#, 16#60#, 16#60#, 16#24#, 16#3E#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#03#, 16#02#, 16#01#,
16#00#, 16#80#, 16#40#, 16#40#, 16#20#, 16#10#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#04#, 16#02#, 16#00#, 16#80#, 16#40#, 16#20#, 16#08#,
16#04#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#06#, 16#01#,
16#00#, 16#80#, 16#40#, 16#40#, 16#20#, 16#10#, 16#08#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#02#, 16#01#, 16#81#, 16#40#, 16#90#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#02#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#E0#, 16#B0#, 16#D0#, 16#48#, 16#3C#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#06#, 16#01#, 16#01#, 16#E0#,
16#90#, 16#58#, 16#28#, 16#18#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#C0#, 16#80#, 16#C0#, 16#68#, 16#18#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#01#, 16#80#, 16#40#,
16#E0#, 16#B0#, 16#D0#, 16#48#, 16#3C#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#C0#, 16#A0#, 16#E0#, 16#68#,
16#18#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#03#, 16#03#, 16#01#,
16#01#, 16#C0#, 16#40#, 16#60#, 16#20#, 16#10#, 16#08#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#01#, 16#E0#, 16#A0#, 16#50#,
16#38#, 16#38#, 16#12#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#06#,
16#01#, 16#01#, 16#E0#, 16#D0#, 16#58#, 16#28#, 16#36#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#02#, 16#00#, 16#01#, 16#00#, 16#80#,
16#40#, 16#30#, 16#30#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#01#, 16#00#, 16#01#, 16#80#, 16#40#, 16#20#, 16#10#, 16#10#, 16#08#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#06#, 16#01#, 16#01#, 16#E0#,
16#A0#, 16#60#, 16#38#, 16#34#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#06#, 16#01#, 16#01#, 16#80#, 16#80#, 16#40#, 16#30#, 16#30#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#01#,
16#78#, 16#D4#, 16#5A#, 16#2B#, 16#25#, 16#80#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#01#, 16#60#, 16#D0#, 16#58#, 16#68#,
16#26#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#C0#, 16#B0#, 16#D8#, 16#48#, 16#18#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#01#, 16#60#, 16#D0#, 16#58#,
16#68#, 16#38#, 16#10#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#E0#, 16#B0#, 16#D0#, 16#48#, 16#3C#, 16#04#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#01#, 16#40#, 16#C0#,
16#40#, 16#20#, 16#20#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#01#, 16#80#, 16#80#, 16#60#, 16#50#, 16#18#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#01#, 16#01#, 16#80#,
16#80#, 16#40#, 16#70#, 16#30#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#01#, 16#20#, 16#B0#, 16#50#, 16#78#, 16#34#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#01#,
16#40#, 16#A0#, 16#50#, 16#30#, 16#10#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#01#, 16#50#, 16#A8#, 16#54#, 16#3C#,
16#14#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#01#, 16#60#, 16#C0#, 16#20#, 16#70#, 16#2C#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#01#, 16#40#, 16#A0#, 16#70#,
16#10#, 16#08#, 16#08#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#01#, 16#C0#, 16#40#, 16#40#, 16#40#, 16#30#, 16#06#, 16#00#,
16#00#, 16#00#, 16#00#, 16#02#, 16#02#, 16#01#, 16#00#, 16#80#, 16#80#,
16#80#, 16#20#, 16#10#, 16#10#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#04#, 16#02#, 16#01#, 16#00#, 16#80#, 16#40#, 16#20#, 16#10#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#08#, 16#02#, 16#01#, 16#01#, 16#80#,
16#80#, 16#20#, 16#20#, 16#20#, 16#10#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#60#, 16#0C#, 16#00#,
16#00#, 16#00#);
Font_D : aliased constant Bitmap_Font :=
(
Bytes_Per_Glyph => 14,
Glyph_Width => 9,
Glyph_Height => 12,
Data => FreeSerifBoldItalic5pt7bBitmaps'Access);
Font : constant Bitmap_Font_Ref := Font_D'Access;
end GESTE_Fonts.FreeSerifBoldItalic5pt7b;
|
-- This spec has been automatically generated from STM32F429x.svd
pragma Restrictions (No_Elaboration_Code);
pragma Ada_2012;
pragma Style_Checks (Off);
with HAL;
with System;
package STM32_SVD.USB_OTG_FS is
pragma Preelaborate;
---------------
-- Registers --
---------------
subtype FS_DCFG_DSPD_Field is HAL.UInt2;
subtype FS_DCFG_DAD_Field is HAL.UInt7;
subtype FS_DCFG_PFIVL_Field is HAL.UInt2;
-- OTG_FS device configuration register (OTG_FS_DCFG)
type FS_DCFG_Register is record
-- Device speed
DSPD : FS_DCFG_DSPD_Field := 16#0#;
-- Non-zero-length status OUT handshake
NZLSOHSK : Boolean := False;
-- unspecified
Reserved_3_3 : HAL.Bit := 16#0#;
-- Device address
DAD : FS_DCFG_DAD_Field := 16#0#;
-- Periodic frame interval
PFIVL : FS_DCFG_PFIVL_Field := 16#0#;
-- unspecified
Reserved_13_31 : HAL.UInt19 := 16#1100#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_DCFG_Register use record
DSPD at 0 range 0 .. 1;
NZLSOHSK at 0 range 2 .. 2;
Reserved_3_3 at 0 range 3 .. 3;
DAD at 0 range 4 .. 10;
PFIVL at 0 range 11 .. 12;
Reserved_13_31 at 0 range 13 .. 31;
end record;
subtype FS_DCTL_TCTL_Field is HAL.UInt3;
-- OTG_FS device control register (OTG_FS_DCTL)
type FS_DCTL_Register is record
-- Remote wakeup signaling
RWUSIG : Boolean := False;
-- Soft disconnect
SDIS : Boolean := False;
-- Read-only. Global IN NAK status
GINSTS : Boolean := False;
-- Read-only. Global OUT NAK status
GONSTS : Boolean := False;
-- Test control
TCTL : FS_DCTL_TCTL_Field := 16#0#;
-- Set global IN NAK
SGINAK : Boolean := False;
-- Clear global IN NAK
CGINAK : Boolean := False;
-- Set global OUT NAK
SGONAK : Boolean := False;
-- Clear global OUT NAK
CGONAK : Boolean := False;
-- Power-on programming done
POPRGDNE : Boolean := False;
-- unspecified
Reserved_12_31 : HAL.UInt20 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_DCTL_Register use record
RWUSIG at 0 range 0 .. 0;
SDIS at 0 range 1 .. 1;
GINSTS at 0 range 2 .. 2;
GONSTS at 0 range 3 .. 3;
TCTL at 0 range 4 .. 6;
SGINAK at 0 range 7 .. 7;
CGINAK at 0 range 8 .. 8;
SGONAK at 0 range 9 .. 9;
CGONAK at 0 range 10 .. 10;
POPRGDNE at 0 range 11 .. 11;
Reserved_12_31 at 0 range 12 .. 31;
end record;
subtype FS_DSTS_ENUMSPD_Field is HAL.UInt2;
subtype FS_DSTS_FNSOF_Field is HAL.UInt14;
-- OTG_FS device status register (OTG_FS_DSTS)
type FS_DSTS_Register is record
-- Read-only. Suspend status
SUSPSTS : Boolean;
-- Read-only. Enumerated speed
ENUMSPD : FS_DSTS_ENUMSPD_Field;
-- Read-only. Erratic error
EERR : Boolean;
-- unspecified
Reserved_4_7 : HAL.UInt4;
-- Read-only. Frame number of the received SOF
FNSOF : FS_DSTS_FNSOF_Field;
-- unspecified
Reserved_22_31 : HAL.UInt10;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_DSTS_Register use record
SUSPSTS at 0 range 0 .. 0;
ENUMSPD at 0 range 1 .. 2;
EERR at 0 range 3 .. 3;
Reserved_4_7 at 0 range 4 .. 7;
FNSOF at 0 range 8 .. 21;
Reserved_22_31 at 0 range 22 .. 31;
end record;
-- OTG_FS device IN endpoint common interrupt mask register
-- (OTG_FS_DIEPMSK)
type FS_DIEPMSK_Register is record
-- Transfer completed interrupt mask
XFRCM : Boolean := False;
-- Endpoint disabled interrupt mask
EPDM : Boolean := False;
-- unspecified
Reserved_2_2 : HAL.Bit := 16#0#;
-- Timeout condition mask (Non-isochronous endpoints)
TOM : Boolean := False;
-- IN token received when TxFIFO empty mask
ITTXFEMSK : Boolean := False;
-- IN token received with EP mismatch mask
INEPNMM : Boolean := False;
-- IN endpoint NAK effective mask
INEPNEM : Boolean := False;
-- unspecified
Reserved_7_31 : HAL.UInt25 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_DIEPMSK_Register use record
XFRCM at 0 range 0 .. 0;
EPDM at 0 range 1 .. 1;
Reserved_2_2 at 0 range 2 .. 2;
TOM at 0 range 3 .. 3;
ITTXFEMSK at 0 range 4 .. 4;
INEPNMM at 0 range 5 .. 5;
INEPNEM at 0 range 6 .. 6;
Reserved_7_31 at 0 range 7 .. 31;
end record;
-- OTG_FS device OUT endpoint common interrupt mask register
-- (OTG_FS_DOEPMSK)
type FS_DOEPMSK_Register is record
-- Transfer completed interrupt mask
XFRCM : Boolean := False;
-- Endpoint disabled interrupt mask
EPDM : Boolean := False;
-- unspecified
Reserved_2_2 : HAL.Bit := 16#0#;
-- SETUP phase done mask
STUPM : Boolean := False;
-- OUT token received when endpoint disabled mask
OTEPDM : Boolean := False;
-- unspecified
Reserved_5_31 : HAL.UInt27 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_DOEPMSK_Register use record
XFRCM at 0 range 0 .. 0;
EPDM at 0 range 1 .. 1;
Reserved_2_2 at 0 range 2 .. 2;
STUPM at 0 range 3 .. 3;
OTEPDM at 0 range 4 .. 4;
Reserved_5_31 at 0 range 5 .. 31;
end record;
subtype FS_DAINT_IEPINT_Field is HAL.UInt16;
subtype FS_DAINT_OEPINT_Field is HAL.UInt16;
-- OTG_FS device all endpoints interrupt register (OTG_FS_DAINT)
type FS_DAINT_Register is record
-- Read-only. IN endpoint interrupt bits
IEPINT : FS_DAINT_IEPINT_Field;
-- Read-only. OUT endpoint interrupt bits
OEPINT : FS_DAINT_OEPINT_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_DAINT_Register use record
IEPINT at 0 range 0 .. 15;
OEPINT at 0 range 16 .. 31;
end record;
subtype FS_DAINTMSK_IEPM_Field is HAL.UInt16;
subtype FS_DAINTMSK_OEPM_Field is HAL.UInt16;
-- OTG_FS all endpoints interrupt mask register (OTG_FS_DAINTMSK)
type FS_DAINTMSK_Register is record
-- IN EP interrupt mask bits
IEPM : FS_DAINTMSK_IEPM_Field := 16#0#;
-- OUT EP interrupt mask bits
OEPM : FS_DAINTMSK_OEPM_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_DAINTMSK_Register use record
IEPM at 0 range 0 .. 15;
OEPM at 0 range 16 .. 31;
end record;
subtype DVBUSDIS_VBUSDT_Field is HAL.UInt16;
-- OTG_FS device VBUS discharge time register
type DVBUSDIS_Register is record
-- Device VBUS discharge time
VBUSDT : DVBUSDIS_VBUSDT_Field := 16#17D7#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DVBUSDIS_Register use record
VBUSDT at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype DVBUSPULSE_DVBUSP_Field is HAL.UInt12;
-- OTG_FS device VBUS pulsing time register
type DVBUSPULSE_Register is record
-- Device VBUS pulsing time
DVBUSP : DVBUSPULSE_DVBUSP_Field := 16#5B8#;
-- unspecified
Reserved_12_31 : HAL.UInt20 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DVBUSPULSE_Register use record
DVBUSP at 0 range 0 .. 11;
Reserved_12_31 at 0 range 12 .. 31;
end record;
subtype DIEPEMPMSK_INEPTXFEM_Field is HAL.UInt16;
-- OTG_FS device IN endpoint FIFO empty interrupt mask register
type DIEPEMPMSK_Register is record
-- IN EP Tx FIFO empty interrupt mask bits
INEPTXFEM : DIEPEMPMSK_INEPTXFEM_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DIEPEMPMSK_Register use record
INEPTXFEM at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype FS_DIEPCTL0_MPSIZ_Field is HAL.UInt2;
subtype FS_DIEPCTL0_EPTYP_Field is HAL.UInt2;
subtype FS_DIEPCTL0_TXFNUM_Field is HAL.UInt4;
-- OTG_FS device control IN endpoint 0 control register (OTG_FS_DIEPCTL0)
type FS_DIEPCTL0_Register is record
-- Maximum packet size
MPSIZ : FS_DIEPCTL0_MPSIZ_Field := 16#0#;
-- unspecified
Reserved_2_14 : HAL.UInt13 := 16#0#;
-- Read-only. USB active endpoint
USBAEP : Boolean := False;
-- unspecified
Reserved_16_16 : HAL.Bit := 16#0#;
-- Read-only. NAK status
NAKSTS : Boolean := False;
-- Read-only. Endpoint type
EPTYP : FS_DIEPCTL0_EPTYP_Field := 16#0#;
-- unspecified
Reserved_20_20 : HAL.Bit := 16#0#;
-- STALL handshake
STALL : Boolean := False;
-- TxFIFO number
TXFNUM : FS_DIEPCTL0_TXFNUM_Field := 16#0#;
-- Write-only. Clear NAK
CNAK : Boolean := False;
-- Write-only. Set NAK
SNAK : Boolean := False;
-- unspecified
Reserved_28_29 : HAL.UInt2 := 16#0#;
-- Read-only. Endpoint disable
EPDIS : Boolean := False;
-- Read-only. Endpoint enable
EPENA : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_DIEPCTL0_Register use record
MPSIZ at 0 range 0 .. 1;
Reserved_2_14 at 0 range 2 .. 14;
USBAEP at 0 range 15 .. 15;
Reserved_16_16 at 0 range 16 .. 16;
NAKSTS at 0 range 17 .. 17;
EPTYP at 0 range 18 .. 19;
Reserved_20_20 at 0 range 20 .. 20;
STALL at 0 range 21 .. 21;
TXFNUM at 0 range 22 .. 25;
CNAK at 0 range 26 .. 26;
SNAK at 0 range 27 .. 27;
Reserved_28_29 at 0 range 28 .. 29;
EPDIS at 0 range 30 .. 30;
EPENA at 0 range 31 .. 31;
end record;
-- device endpoint-x interrupt register
type DIEPINT_Register is record
-- XFRC
XFRC : Boolean := False;
-- EPDISD
EPDISD : Boolean := False;
-- unspecified
Reserved_2_2 : HAL.Bit := 16#0#;
-- TOC
TOC : Boolean := False;
-- ITTXFE
ITTXFE : Boolean := False;
-- unspecified
Reserved_5_5 : HAL.Bit := 16#0#;
-- INEPNE
INEPNE : Boolean := False;
-- Read-only. TXFE
TXFE : Boolean := True;
-- unspecified
Reserved_8_31 : HAL.UInt24 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DIEPINT_Register use record
XFRC at 0 range 0 .. 0;
EPDISD at 0 range 1 .. 1;
Reserved_2_2 at 0 range 2 .. 2;
TOC at 0 range 3 .. 3;
ITTXFE at 0 range 4 .. 4;
Reserved_5_5 at 0 range 5 .. 5;
INEPNE at 0 range 6 .. 6;
TXFE at 0 range 7 .. 7;
Reserved_8_31 at 0 range 8 .. 31;
end record;
subtype DIEPTSIZ0_XFRSIZ_Field is HAL.UInt7;
subtype DIEPTSIZ0_PKTCNT_Field is HAL.UInt2;
-- device endpoint-0 transfer size register
type DIEPTSIZ0_Register is record
-- Transfer size
XFRSIZ : DIEPTSIZ0_XFRSIZ_Field := 16#0#;
-- unspecified
Reserved_7_18 : HAL.UInt12 := 16#0#;
-- Packet count
PKTCNT : DIEPTSIZ0_PKTCNT_Field := 16#0#;
-- unspecified
Reserved_21_31 : HAL.UInt11 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DIEPTSIZ0_Register use record
XFRSIZ at 0 range 0 .. 6;
Reserved_7_18 at 0 range 7 .. 18;
PKTCNT at 0 range 19 .. 20;
Reserved_21_31 at 0 range 21 .. 31;
end record;
subtype DTXFSTS_INEPTFSAV_Field is HAL.UInt16;
-- OTG_FS device IN endpoint transmit FIFO status register
type DTXFSTS_Register is record
-- Read-only. IN endpoint TxFIFO space available
INEPTFSAV : DTXFSTS_INEPTFSAV_Field;
-- unspecified
Reserved_16_31 : HAL.UInt16;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DTXFSTS_Register use record
INEPTFSAV at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype DIEPCTL1_MPSIZ_Field is HAL.UInt11;
subtype DIEPCTL1_EPTYP_Field is HAL.UInt2;
subtype DIEPCTL1_TXFNUM_Field is HAL.UInt4;
-- OTG device endpoint-1 control register
type DIEPCTL1_Register is record
-- MPSIZ
MPSIZ : DIEPCTL1_MPSIZ_Field := 16#0#;
-- unspecified
Reserved_11_14 : HAL.UInt4 := 16#0#;
-- USBAEP
USBAEP : Boolean := False;
-- Read-only. EONUM/DPID
EONUM_DPID : Boolean := False;
-- Read-only. NAKSTS
NAKSTS : Boolean := False;
-- EPTYP
EPTYP : DIEPCTL1_EPTYP_Field := 16#0#;
-- unspecified
Reserved_20_20 : HAL.Bit := 16#0#;
-- Stall
Stall : Boolean := False;
-- TXFNUM
TXFNUM : DIEPCTL1_TXFNUM_Field := 16#0#;
-- Write-only. CNAK
CNAK : Boolean := False;
-- Write-only. SNAK
SNAK : Boolean := False;
-- Write-only. SD0PID/SEVNFRM
SD0PID_SEVNFRM : Boolean := False;
-- Write-only. SODDFRM/SD1PID
SODDFRM_SD1PID : Boolean := False;
-- EPDIS
EPDIS : Boolean := False;
-- EPENA
EPENA : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DIEPCTL1_Register use record
MPSIZ at 0 range 0 .. 10;
Reserved_11_14 at 0 range 11 .. 14;
USBAEP at 0 range 15 .. 15;
EONUM_DPID at 0 range 16 .. 16;
NAKSTS at 0 range 17 .. 17;
EPTYP at 0 range 18 .. 19;
Reserved_20_20 at 0 range 20 .. 20;
Stall at 0 range 21 .. 21;
TXFNUM at 0 range 22 .. 25;
CNAK at 0 range 26 .. 26;
SNAK at 0 range 27 .. 27;
SD0PID_SEVNFRM at 0 range 28 .. 28;
SODDFRM_SD1PID at 0 range 29 .. 29;
EPDIS at 0 range 30 .. 30;
EPENA at 0 range 31 .. 31;
end record;
subtype DIEPTSIZ_XFRSIZ_Field is HAL.UInt19;
subtype DIEPTSIZ_PKTCNT_Field is HAL.UInt10;
subtype DIEPTSIZ_MCNT_Field is HAL.UInt2;
-- device endpoint-1 transfer size register
type DIEPTSIZ_Register is record
-- Transfer size
XFRSIZ : DIEPTSIZ_XFRSIZ_Field := 16#0#;
-- Packet count
PKTCNT : DIEPTSIZ_PKTCNT_Field := 16#0#;
-- Multi count
MCNT : DIEPTSIZ_MCNT_Field := 16#0#;
-- unspecified
Reserved_31_31 : HAL.Bit := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DIEPTSIZ_Register use record
XFRSIZ at 0 range 0 .. 18;
PKTCNT at 0 range 19 .. 28;
MCNT at 0 range 29 .. 30;
Reserved_31_31 at 0 range 31 .. 31;
end record;
subtype DIEPCTL_MPSIZ_Field is HAL.UInt11;
subtype DIEPCTL_EPTYP_Field is HAL.UInt2;
subtype DIEPCTL_TXFNUM_Field is HAL.UInt4;
-- OTG device endpoint-2 control register
type DIEPCTL_Register is record
-- MPSIZ
MPSIZ : DIEPCTL_MPSIZ_Field := 16#0#;
-- unspecified
Reserved_11_14 : HAL.UInt4 := 16#0#;
-- USBAEP
USBAEP : Boolean := False;
-- Read-only. EONUM/DPID
EONUM_DPID : Boolean := False;
-- Read-only. NAKSTS
NAKSTS : Boolean := False;
-- EPTYP
EPTYP : DIEPCTL_EPTYP_Field := 16#0#;
-- unspecified
Reserved_20_20 : HAL.Bit := 16#0#;
-- Stall
Stall : Boolean := False;
-- TXFNUM
TXFNUM : DIEPCTL_TXFNUM_Field := 16#0#;
-- Write-only. CNAK
CNAK : Boolean := False;
-- Write-only. SNAK
SNAK : Boolean := False;
-- Write-only. SD0PID/SEVNFRM
SD0PID_SEVNFRM : Boolean := False;
-- Write-only. SODDFRM
SODDFRM : Boolean := False;
-- EPDIS
EPDIS : Boolean := False;
-- EPENA
EPENA : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DIEPCTL_Register use record
MPSIZ at 0 range 0 .. 10;
Reserved_11_14 at 0 range 11 .. 14;
USBAEP at 0 range 15 .. 15;
EONUM_DPID at 0 range 16 .. 16;
NAKSTS at 0 range 17 .. 17;
EPTYP at 0 range 18 .. 19;
Reserved_20_20 at 0 range 20 .. 20;
Stall at 0 range 21 .. 21;
TXFNUM at 0 range 22 .. 25;
CNAK at 0 range 26 .. 26;
SNAK at 0 range 27 .. 27;
SD0PID_SEVNFRM at 0 range 28 .. 28;
SODDFRM at 0 range 29 .. 29;
EPDIS at 0 range 30 .. 30;
EPENA at 0 range 31 .. 31;
end record;
subtype DOEPCTL0_MPSIZ_Field is HAL.UInt2;
subtype DOEPCTL0_EPTYP_Field is HAL.UInt2;
-- device endpoint-0 control register
type DOEPCTL0_Register is record
-- Read-only. MPSIZ
MPSIZ : DOEPCTL0_MPSIZ_Field := 16#0#;
-- unspecified
Reserved_2_14 : HAL.UInt13 := 16#0#;
-- Read-only. USBAEP
USBAEP : Boolean := True;
-- unspecified
Reserved_16_16 : HAL.Bit := 16#0#;
-- Read-only. NAKSTS
NAKSTS : Boolean := False;
-- Read-only. EPTYP
EPTYP : DOEPCTL0_EPTYP_Field := 16#0#;
-- SNPM
SNPM : Boolean := False;
-- Stall
Stall : Boolean := False;
-- unspecified
Reserved_22_25 : HAL.UInt4 := 16#0#;
-- Write-only. CNAK
CNAK : Boolean := False;
-- Write-only. SNAK
SNAK : Boolean := False;
-- unspecified
Reserved_28_29 : HAL.UInt2 := 16#0#;
-- Read-only. EPDIS
EPDIS : Boolean := False;
-- Write-only. EPENA
EPENA : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DOEPCTL0_Register use record
MPSIZ at 0 range 0 .. 1;
Reserved_2_14 at 0 range 2 .. 14;
USBAEP at 0 range 15 .. 15;
Reserved_16_16 at 0 range 16 .. 16;
NAKSTS at 0 range 17 .. 17;
EPTYP at 0 range 18 .. 19;
SNPM at 0 range 20 .. 20;
Stall at 0 range 21 .. 21;
Reserved_22_25 at 0 range 22 .. 25;
CNAK at 0 range 26 .. 26;
SNAK at 0 range 27 .. 27;
Reserved_28_29 at 0 range 28 .. 29;
EPDIS at 0 range 30 .. 30;
EPENA at 0 range 31 .. 31;
end record;
-- device endpoint-0 interrupt register
type DOEPINT_Register is record
-- XFRC
XFRC : Boolean := False;
-- EPDISD
EPDISD : Boolean := False;
-- unspecified
Reserved_2_2 : HAL.Bit := 16#0#;
-- STUP
STUP : Boolean := False;
-- OTEPDIS
OTEPDIS : Boolean := False;
-- unspecified
Reserved_5_5 : HAL.Bit := 16#0#;
-- B2BSTUP
B2BSTUP : Boolean := False;
-- unspecified
Reserved_7_31 : HAL.UInt25 := 16#1#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DOEPINT_Register use record
XFRC at 0 range 0 .. 0;
EPDISD at 0 range 1 .. 1;
Reserved_2_2 at 0 range 2 .. 2;
STUP at 0 range 3 .. 3;
OTEPDIS at 0 range 4 .. 4;
Reserved_5_5 at 0 range 5 .. 5;
B2BSTUP at 0 range 6 .. 6;
Reserved_7_31 at 0 range 7 .. 31;
end record;
subtype DOEPTSIZ0_XFRSIZ_Field is HAL.UInt7;
subtype DOEPTSIZ0_STUPCNT_Field is HAL.UInt2;
-- device OUT endpoint-0 transfer size register
type DOEPTSIZ0_Register is record
-- Transfer size
XFRSIZ : DOEPTSIZ0_XFRSIZ_Field := 16#0#;
-- unspecified
Reserved_7_18 : HAL.UInt12 := 16#0#;
-- Packet count
PKTCNT : Boolean := False;
-- unspecified
Reserved_20_28 : HAL.UInt9 := 16#0#;
-- SETUP packet count
STUPCNT : DOEPTSIZ0_STUPCNT_Field := 16#0#;
-- unspecified
Reserved_31_31 : HAL.Bit := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DOEPTSIZ0_Register use record
XFRSIZ at 0 range 0 .. 6;
Reserved_7_18 at 0 range 7 .. 18;
PKTCNT at 0 range 19 .. 19;
Reserved_20_28 at 0 range 20 .. 28;
STUPCNT at 0 range 29 .. 30;
Reserved_31_31 at 0 range 31 .. 31;
end record;
subtype DOEPCTL_MPSIZ_Field is HAL.UInt11;
subtype DOEPCTL_EPTYP_Field is HAL.UInt2;
-- device endpoint-1 control register
type DOEPCTL_Register is record
-- MPSIZ
MPSIZ : DOEPCTL_MPSIZ_Field := 16#0#;
-- unspecified
Reserved_11_14 : HAL.UInt4 := 16#0#;
-- USBAEP
USBAEP : Boolean := False;
-- Read-only. EONUM/DPID
EONUM_DPID : Boolean := False;
-- Read-only. NAKSTS
NAKSTS : Boolean := False;
-- EPTYP
EPTYP : DOEPCTL_EPTYP_Field := 16#0#;
-- SNPM
SNPM : Boolean := False;
-- Stall
Stall : Boolean := False;
-- unspecified
Reserved_22_25 : HAL.UInt4 := 16#0#;
-- Write-only. CNAK
CNAK : Boolean := False;
-- Write-only. SNAK
SNAK : Boolean := False;
-- Write-only. SD0PID/SEVNFRM
SD0PID_SEVNFRM : Boolean := False;
-- Write-only. SODDFRM
SODDFRM : Boolean := False;
-- EPDIS
EPDIS : Boolean := False;
-- EPENA
EPENA : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DOEPCTL_Register use record
MPSIZ at 0 range 0 .. 10;
Reserved_11_14 at 0 range 11 .. 14;
USBAEP at 0 range 15 .. 15;
EONUM_DPID at 0 range 16 .. 16;
NAKSTS at 0 range 17 .. 17;
EPTYP at 0 range 18 .. 19;
SNPM at 0 range 20 .. 20;
Stall at 0 range 21 .. 21;
Reserved_22_25 at 0 range 22 .. 25;
CNAK at 0 range 26 .. 26;
SNAK at 0 range 27 .. 27;
SD0PID_SEVNFRM at 0 range 28 .. 28;
SODDFRM at 0 range 29 .. 29;
EPDIS at 0 range 30 .. 30;
EPENA at 0 range 31 .. 31;
end record;
subtype DOEPTSIZ_XFRSIZ_Field is HAL.UInt19;
subtype DOEPTSIZ_PKTCNT_Field is HAL.UInt10;
subtype DOEPTSIZ_RXDPID_STUPCNT_Field is HAL.UInt2;
-- device OUT endpoint-1 transfer size register
type DOEPTSIZ_Register is record
-- Transfer size
XFRSIZ : DOEPTSIZ_XFRSIZ_Field := 16#0#;
-- Packet count
PKTCNT : DOEPTSIZ_PKTCNT_Field := 16#0#;
-- Received data PID/SETUP packet count
RXDPID_STUPCNT : DOEPTSIZ_RXDPID_STUPCNT_Field := 16#0#;
-- unspecified
Reserved_31_31 : HAL.Bit := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DOEPTSIZ_Register use record
XFRSIZ at 0 range 0 .. 18;
PKTCNT at 0 range 19 .. 28;
RXDPID_STUPCNT at 0 range 29 .. 30;
Reserved_31_31 at 0 range 31 .. 31;
end record;
-- OTG_FS control and status register (OTG_FS_GOTGCTL)
type FS_GOTGCTL_Register is record
-- Read-only. Session request success
SRQSCS : Boolean := False;
-- Session request
SRQ : Boolean := False;
-- unspecified
Reserved_2_7 : HAL.UInt6 := 16#0#;
-- Read-only. Host negotiation success
HNGSCS : Boolean := False;
-- HNP request
HNPRQ : Boolean := False;
-- Host set HNP enable
HSHNPEN : Boolean := False;
-- Device HNP enabled
DHNPEN : Boolean := True;
-- unspecified
Reserved_12_15 : HAL.UInt4 := 16#0#;
-- Read-only. Connector ID status
CIDSTS : Boolean := False;
-- Read-only. Long/short debounce time
DBCT : Boolean := False;
-- Read-only. A-session valid
ASVLD : Boolean := False;
-- Read-only. B-session valid
BSVLD : Boolean := False;
-- unspecified
Reserved_20_31 : HAL.UInt12 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_GOTGCTL_Register use record
SRQSCS at 0 range 0 .. 0;
SRQ at 0 range 1 .. 1;
Reserved_2_7 at 0 range 2 .. 7;
HNGSCS at 0 range 8 .. 8;
HNPRQ at 0 range 9 .. 9;
HSHNPEN at 0 range 10 .. 10;
DHNPEN at 0 range 11 .. 11;
Reserved_12_15 at 0 range 12 .. 15;
CIDSTS at 0 range 16 .. 16;
DBCT at 0 range 17 .. 17;
ASVLD at 0 range 18 .. 18;
BSVLD at 0 range 19 .. 19;
Reserved_20_31 at 0 range 20 .. 31;
end record;
-- OTG_FS interrupt register (OTG_FS_GOTGINT)
type FS_GOTGINT_Register is record
-- unspecified
Reserved_0_1 : HAL.UInt2 := 16#0#;
-- Session end detected
SEDET : Boolean := False;
-- unspecified
Reserved_3_7 : HAL.UInt5 := 16#0#;
-- Session request success status change
SRSSCHG : Boolean := False;
-- Host negotiation success status change
HNSSCHG : Boolean := False;
-- unspecified
Reserved_10_16 : HAL.UInt7 := 16#0#;
-- Host negotiation detected
HNGDET : Boolean := False;
-- A-device timeout change
ADTOCHG : Boolean := False;
-- Debounce done
DBCDNE : Boolean := False;
-- unspecified
Reserved_20_31 : HAL.UInt12 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_GOTGINT_Register use record
Reserved_0_1 at 0 range 0 .. 1;
SEDET at 0 range 2 .. 2;
Reserved_3_7 at 0 range 3 .. 7;
SRSSCHG at 0 range 8 .. 8;
HNSSCHG at 0 range 9 .. 9;
Reserved_10_16 at 0 range 10 .. 16;
HNGDET at 0 range 17 .. 17;
ADTOCHG at 0 range 18 .. 18;
DBCDNE at 0 range 19 .. 19;
Reserved_20_31 at 0 range 20 .. 31;
end record;
-- OTG_FS AHB configuration register (OTG_FS_GAHBCFG)
type FS_GAHBCFG_Register is record
-- Global interrupt mask
GINT : Boolean := False;
-- unspecified
Reserved_1_6 : HAL.UInt6 := 16#0#;
-- TxFIFO empty level
TXFELVL : Boolean := False;
-- Periodic TxFIFO empty level
PTXFELVL : Boolean := False;
-- unspecified
Reserved_9_31 : HAL.UInt23 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_GAHBCFG_Register use record
GINT at 0 range 0 .. 0;
Reserved_1_6 at 0 range 1 .. 6;
TXFELVL at 0 range 7 .. 7;
PTXFELVL at 0 range 8 .. 8;
Reserved_9_31 at 0 range 9 .. 31;
end record;
subtype FS_GUSBCFG_TOCAL_Field is HAL.UInt3;
subtype FS_GUSBCFG_TRDT_Field is HAL.UInt4;
-- OTG_FS USB configuration register (OTG_FS_GUSBCFG)
type FS_GUSBCFG_Register is record
-- FS timeout calibration
TOCAL : FS_GUSBCFG_TOCAL_Field := 16#0#;
-- unspecified
Reserved_3_5 : HAL.UInt3 := 16#0#;
-- Write-only. Full Speed serial transceiver select
PHYSEL : Boolean := False;
-- unspecified
Reserved_7_7 : HAL.Bit := 16#0#;
-- SRP-capable
SRPCAP : Boolean := False;
-- HNP-capable
HNPCAP : Boolean := True;
-- USB turnaround time
TRDT : FS_GUSBCFG_TRDT_Field := 16#2#;
-- unspecified
Reserved_14_28 : HAL.UInt15 := 16#0#;
-- Force host mode
FHMOD : Boolean := False;
-- Force device mode
FDMOD : Boolean := False;
-- Corrupt Tx packet
CTXPKT : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_GUSBCFG_Register use record
TOCAL at 0 range 0 .. 2;
Reserved_3_5 at 0 range 3 .. 5;
PHYSEL at 0 range 6 .. 6;
Reserved_7_7 at 0 range 7 .. 7;
SRPCAP at 0 range 8 .. 8;
HNPCAP at 0 range 9 .. 9;
TRDT at 0 range 10 .. 13;
Reserved_14_28 at 0 range 14 .. 28;
FHMOD at 0 range 29 .. 29;
FDMOD at 0 range 30 .. 30;
CTXPKT at 0 range 31 .. 31;
end record;
subtype FS_GRSTCTL_TXFNUM_Field is HAL.UInt5;
-- OTG_FS reset register (OTG_FS_GRSTCTL)
type FS_GRSTCTL_Register is record
-- Core soft reset
CSRST : Boolean := False;
-- HCLK soft reset
HSRST : Boolean := False;
-- Host frame counter reset
FCRST : Boolean := False;
-- unspecified
Reserved_3_3 : HAL.Bit := 16#0#;
-- RxFIFO flush
RXFFLSH : Boolean := False;
-- TxFIFO flush
TXFFLSH : Boolean := False;
-- TxFIFO number
TXFNUM : FS_GRSTCTL_TXFNUM_Field := 16#0#;
-- unspecified
Reserved_11_30 : HAL.UInt20 := 16#40000#;
-- Read-only. AHB master idle
AHBIDL : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_GRSTCTL_Register use record
CSRST at 0 range 0 .. 0;
HSRST at 0 range 1 .. 1;
FCRST at 0 range 2 .. 2;
Reserved_3_3 at 0 range 3 .. 3;
RXFFLSH at 0 range 4 .. 4;
TXFFLSH at 0 range 5 .. 5;
TXFNUM at 0 range 6 .. 10;
Reserved_11_30 at 0 range 11 .. 30;
AHBIDL at 0 range 31 .. 31;
end record;
-- OTG_FS core interrupt register (OTG_FS_GINTSTS)
type FS_GINTSTS_Register is record
-- Read-only. Current mode of operation
CMOD : Boolean := False;
-- Mode mismatch interrupt
MMIS : Boolean := False;
-- Read-only. OTG interrupt
OTGINT : Boolean := False;
-- Start of frame
SOF : Boolean := False;
-- Read-only. RxFIFO non-empty
RXFLVL : Boolean := False;
-- Read-only. Non-periodic TxFIFO empty
NPTXFE : Boolean := True;
-- Read-only. Global IN non-periodic NAK effective
GINAKEFF : Boolean := False;
-- Read-only. Global OUT NAK effective
GOUTNAKEFF : Boolean := False;
-- unspecified
Reserved_8_9 : HAL.UInt2 := 16#0#;
-- Early suspend
ESUSP : Boolean := False;
-- USB suspend
USBSUSP : Boolean := False;
-- USB reset
USBRST : Boolean := False;
-- Enumeration done
ENUMDNE : Boolean := False;
-- Isochronous OUT packet dropped interrupt
ISOODRP : Boolean := False;
-- End of periodic frame interrupt
EOPF : Boolean := False;
-- unspecified
Reserved_16_17 : HAL.UInt2 := 16#0#;
-- Read-only. IN endpoint interrupt
IEPINT : Boolean := False;
-- Read-only. OUT endpoint interrupt
OEPINT : Boolean := False;
-- Incomplete isochronous IN transfer
IISOIXFR : Boolean := False;
-- Incomplete periodic transfer(Host mode)/Incomplete isochronous OUT
-- transfer(Device mode)
IPXFR_INCOMPISOOUT : Boolean := False;
-- unspecified
Reserved_22_23 : HAL.UInt2 := 16#0#;
-- Read-only. Host port interrupt
HPRTINT : Boolean := False;
-- Read-only. Host channels interrupt
HCINT : Boolean := False;
-- Read-only. Periodic TxFIFO empty
PTXFE : Boolean := True;
-- unspecified
Reserved_27_27 : HAL.Bit := 16#0#;
-- Connector ID status change
CIDSCHG : Boolean := False;
-- Disconnect detected interrupt
DISCINT : Boolean := False;
-- Session request/new session detected interrupt
SRQINT : Boolean := False;
-- Resume/remote wakeup detected interrupt
WKUPINT : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_GINTSTS_Register use record
CMOD at 0 range 0 .. 0;
MMIS at 0 range 1 .. 1;
OTGINT at 0 range 2 .. 2;
SOF at 0 range 3 .. 3;
RXFLVL at 0 range 4 .. 4;
NPTXFE at 0 range 5 .. 5;
GINAKEFF at 0 range 6 .. 6;
GOUTNAKEFF at 0 range 7 .. 7;
Reserved_8_9 at 0 range 8 .. 9;
ESUSP at 0 range 10 .. 10;
USBSUSP at 0 range 11 .. 11;
USBRST at 0 range 12 .. 12;
ENUMDNE at 0 range 13 .. 13;
ISOODRP at 0 range 14 .. 14;
EOPF at 0 range 15 .. 15;
Reserved_16_17 at 0 range 16 .. 17;
IEPINT at 0 range 18 .. 18;
OEPINT at 0 range 19 .. 19;
IISOIXFR at 0 range 20 .. 20;
IPXFR_INCOMPISOOUT at 0 range 21 .. 21;
Reserved_22_23 at 0 range 22 .. 23;
HPRTINT at 0 range 24 .. 24;
HCINT at 0 range 25 .. 25;
PTXFE at 0 range 26 .. 26;
Reserved_27_27 at 0 range 27 .. 27;
CIDSCHG at 0 range 28 .. 28;
DISCINT at 0 range 29 .. 29;
SRQINT at 0 range 30 .. 30;
WKUPINT at 0 range 31 .. 31;
end record;
-- OTG_FS interrupt mask register (OTG_FS_GINTMSK)
type FS_GINTMSK_Register is record
-- unspecified
Reserved_0_0 : HAL.Bit := 16#0#;
-- Mode mismatch interrupt mask
MMISM : Boolean := False;
-- OTG interrupt mask
OTGINT : Boolean := False;
-- Start of frame mask
SOFM : Boolean := False;
-- Receive FIFO non-empty mask
RXFLVLM : Boolean := False;
-- Non-periodic TxFIFO empty mask
NPTXFEM : Boolean := False;
-- Global non-periodic IN NAK effective mask
GINAKEFFM : Boolean := False;
-- Global OUT NAK effective mask
GONAKEFFM : Boolean := False;
-- unspecified
Reserved_8_9 : HAL.UInt2 := 16#0#;
-- Early suspend mask
ESUSPM : Boolean := False;
-- USB suspend mask
USBSUSPM : Boolean := False;
-- USB reset mask
USBRST : Boolean := False;
-- Enumeration done mask
ENUMDNEM : Boolean := False;
-- Isochronous OUT packet dropped interrupt mask
ISOODRPM : Boolean := False;
-- End of periodic frame interrupt mask
EOPFM : Boolean := False;
-- unspecified
Reserved_16_16 : HAL.Bit := 16#0#;
-- Endpoint mismatch interrupt mask
EPMISM : Boolean := False;
-- IN endpoints interrupt mask
IEPINT : Boolean := False;
-- OUT endpoints interrupt mask
OEPINT : Boolean := False;
-- Incomplete isochronous IN transfer mask
IISOIXFRM : Boolean := False;
-- Incomplete periodic transfer mask(Host mode)/Incomplete isochronous
-- OUT transfer mask(Device mode)
IPXFRM_IISOOXFRM : Boolean := False;
-- unspecified
Reserved_22_23 : HAL.UInt2 := 16#0#;
-- Read-only. Host port interrupt mask
PRTIM : Boolean := False;
-- Host channels interrupt mask
HCIM : Boolean := False;
-- Periodic TxFIFO empty mask
PTXFEM : Boolean := False;
-- unspecified
Reserved_27_27 : HAL.Bit := 16#0#;
-- Connector ID status change mask
CIDSCHGM : Boolean := False;
-- Disconnect detected interrupt mask
DISCINT : Boolean := False;
-- Session request/new session detected interrupt mask
SRQIM : Boolean := False;
-- Resume/remote wakeup detected interrupt mask
WUIM : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_GINTMSK_Register use record
Reserved_0_0 at 0 range 0 .. 0;
MMISM at 0 range 1 .. 1;
OTGINT at 0 range 2 .. 2;
SOFM at 0 range 3 .. 3;
RXFLVLM at 0 range 4 .. 4;
NPTXFEM at 0 range 5 .. 5;
GINAKEFFM at 0 range 6 .. 6;
GONAKEFFM at 0 range 7 .. 7;
Reserved_8_9 at 0 range 8 .. 9;
ESUSPM at 0 range 10 .. 10;
USBSUSPM at 0 range 11 .. 11;
USBRST at 0 range 12 .. 12;
ENUMDNEM at 0 range 13 .. 13;
ISOODRPM at 0 range 14 .. 14;
EOPFM at 0 range 15 .. 15;
Reserved_16_16 at 0 range 16 .. 16;
EPMISM at 0 range 17 .. 17;
IEPINT at 0 range 18 .. 18;
OEPINT at 0 range 19 .. 19;
IISOIXFRM at 0 range 20 .. 20;
IPXFRM_IISOOXFRM at 0 range 21 .. 21;
Reserved_22_23 at 0 range 22 .. 23;
PRTIM at 0 range 24 .. 24;
HCIM at 0 range 25 .. 25;
PTXFEM at 0 range 26 .. 26;
Reserved_27_27 at 0 range 27 .. 27;
CIDSCHGM at 0 range 28 .. 28;
DISCINT at 0 range 29 .. 29;
SRQIM at 0 range 30 .. 30;
WUIM at 0 range 31 .. 31;
end record;
subtype FS_GRXSTSR_Device_EPNUM_Field is HAL.UInt4;
subtype FS_GRXSTSR_Device_BCNT_Field is HAL.UInt11;
subtype FS_GRXSTSR_Device_DPID_Field is HAL.UInt2;
subtype FS_GRXSTSR_Device_PKTSTS_Field is HAL.UInt4;
subtype FS_GRXSTSR_Device_FRMNUM_Field is HAL.UInt4;
-- OTG_FS Receive status debug read(Device mode)
type FS_GRXSTSR_Device_Register is record
-- Read-only. Endpoint number
EPNUM : FS_GRXSTSR_Device_EPNUM_Field;
-- Read-only. Byte count
BCNT : FS_GRXSTSR_Device_BCNT_Field;
-- Read-only. Data PID
DPID : FS_GRXSTSR_Device_DPID_Field;
-- Read-only. Packet status
PKTSTS : FS_GRXSTSR_Device_PKTSTS_Field;
-- Read-only. Frame number
FRMNUM : FS_GRXSTSR_Device_FRMNUM_Field;
-- unspecified
Reserved_25_31 : HAL.UInt7;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_GRXSTSR_Device_Register use record
EPNUM at 0 range 0 .. 3;
BCNT at 0 range 4 .. 14;
DPID at 0 range 15 .. 16;
PKTSTS at 0 range 17 .. 20;
FRMNUM at 0 range 21 .. 24;
Reserved_25_31 at 0 range 25 .. 31;
end record;
subtype FS_GRXSTSR_Host_EPNUM_Field is HAL.UInt4;
subtype FS_GRXSTSR_Host_BCNT_Field is HAL.UInt11;
subtype FS_GRXSTSR_Host_DPID_Field is HAL.UInt2;
subtype FS_GRXSTSR_Host_PKTSTS_Field is HAL.UInt4;
subtype FS_GRXSTSR_Host_FRMNUM_Field is HAL.UInt4;
-- OTG_FS Receive status debug read(Host mode)
type FS_GRXSTSR_Host_Register is record
-- Read-only. Endpoint number
EPNUM : FS_GRXSTSR_Host_EPNUM_Field;
-- Read-only. Byte count
BCNT : FS_GRXSTSR_Host_BCNT_Field;
-- Read-only. Data PID
DPID : FS_GRXSTSR_Host_DPID_Field;
-- Read-only. Packet status
PKTSTS : FS_GRXSTSR_Host_PKTSTS_Field;
-- Read-only. Frame number
FRMNUM : FS_GRXSTSR_Host_FRMNUM_Field;
-- unspecified
Reserved_25_31 : HAL.UInt7;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_GRXSTSR_Host_Register use record
EPNUM at 0 range 0 .. 3;
BCNT at 0 range 4 .. 14;
DPID at 0 range 15 .. 16;
PKTSTS at 0 range 17 .. 20;
FRMNUM at 0 range 21 .. 24;
Reserved_25_31 at 0 range 25 .. 31;
end record;
subtype FS_GRXFSIZ_RXFD_Field is HAL.UInt16;
-- OTG_FS Receive FIFO size register (OTG_FS_GRXFSIZ)
type FS_GRXFSIZ_Register is record
-- RxFIFO depth
RXFD : FS_GRXFSIZ_RXFD_Field := 16#200#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_GRXFSIZ_Register use record
RXFD at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype FS_GNPTXFSIZ_Device_TX0FSA_Field is HAL.UInt16;
subtype FS_GNPTXFSIZ_Device_TX0FD_Field is HAL.UInt16;
-- OTG_FS non-periodic transmit FIFO size register (Device mode)
type FS_GNPTXFSIZ_Device_Register is record
-- Endpoint 0 transmit RAM start address
TX0FSA : FS_GNPTXFSIZ_Device_TX0FSA_Field := 16#200#;
-- Endpoint 0 TxFIFO depth
TX0FD : FS_GNPTXFSIZ_Device_TX0FD_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_GNPTXFSIZ_Device_Register use record
TX0FSA at 0 range 0 .. 15;
TX0FD at 0 range 16 .. 31;
end record;
subtype FS_GNPTXFSIZ_Host_NPTXFSA_Field is HAL.UInt16;
subtype FS_GNPTXFSIZ_Host_NPTXFD_Field is HAL.UInt16;
-- OTG_FS non-periodic transmit FIFO size register (Host mode)
type FS_GNPTXFSIZ_Host_Register is record
-- Non-periodic transmit RAM start address
NPTXFSA : FS_GNPTXFSIZ_Host_NPTXFSA_Field := 16#200#;
-- Non-periodic TxFIFO depth
NPTXFD : FS_GNPTXFSIZ_Host_NPTXFD_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_GNPTXFSIZ_Host_Register use record
NPTXFSA at 0 range 0 .. 15;
NPTXFD at 0 range 16 .. 31;
end record;
subtype FS_GNPTXSTS_NPTXFSAV_Field is HAL.UInt16;
subtype FS_GNPTXSTS_NPTQXSAV_Field is HAL.UInt8;
subtype FS_GNPTXSTS_NPTXQTOP_Field is HAL.UInt7;
-- OTG_FS non-periodic transmit FIFO/queue status register
-- (OTG_FS_GNPTXSTS)
type FS_GNPTXSTS_Register is record
-- Read-only. Non-periodic TxFIFO space available
NPTXFSAV : FS_GNPTXSTS_NPTXFSAV_Field;
-- Read-only. Non-periodic transmit request queue space available
NPTQXSAV : FS_GNPTXSTS_NPTQXSAV_Field;
-- Read-only. Top of the non-periodic transmit request queue
NPTXQTOP : FS_GNPTXSTS_NPTXQTOP_Field;
-- unspecified
Reserved_31_31 : HAL.Bit;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_GNPTXSTS_Register use record
NPTXFSAV at 0 range 0 .. 15;
NPTQXSAV at 0 range 16 .. 23;
NPTXQTOP at 0 range 24 .. 30;
Reserved_31_31 at 0 range 31 .. 31;
end record;
-- OTG_FS general core configuration register (OTG_FS_GCCFG)
type FS_GCCFG_Register is record
-- unspecified
Reserved_0_15 : HAL.UInt16 := 16#0#;
-- Power down
PWRDWN : Boolean := False;
-- unspecified
Reserved_17_17 : HAL.Bit := 16#0#;
-- Enable the VBUS sensing device
VBUSASEN : Boolean := False;
-- Enable the VBUS sensing device
VBUSBSEN : Boolean := False;
-- SOF output enable
SOFOUTEN : Boolean := False;
-- unspecified
Reserved_21_31 : HAL.UInt11 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_GCCFG_Register use record
Reserved_0_15 at 0 range 0 .. 15;
PWRDWN at 0 range 16 .. 16;
Reserved_17_17 at 0 range 17 .. 17;
VBUSASEN at 0 range 18 .. 18;
VBUSBSEN at 0 range 19 .. 19;
SOFOUTEN at 0 range 20 .. 20;
Reserved_21_31 at 0 range 21 .. 31;
end record;
subtype FS_HPTXFSIZ_PTXSA_Field is HAL.UInt16;
subtype FS_HPTXFSIZ_PTXFSIZ_Field is HAL.UInt16;
-- OTG_FS Host periodic transmit FIFO size register (OTG_FS_HPTXFSIZ)
type FS_HPTXFSIZ_Register is record
-- Host periodic TxFIFO start address
PTXSA : FS_HPTXFSIZ_PTXSA_Field := 16#600#;
-- Host periodic TxFIFO depth
PTXFSIZ : FS_HPTXFSIZ_PTXFSIZ_Field := 16#200#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_HPTXFSIZ_Register use record
PTXSA at 0 range 0 .. 15;
PTXFSIZ at 0 range 16 .. 31;
end record;
subtype FS_DIEPTXF_INEPTXSA_Field is HAL.UInt16;
subtype FS_DIEPTXF_INEPTXFD_Field is HAL.UInt16;
-- OTG_FS device IN endpoint transmit FIFO size register (OTG_FS_DIEPTXF2)
type FS_DIEPTXF_Register is record
-- IN endpoint FIFO2 transmit RAM start address
INEPTXSA : FS_DIEPTXF_INEPTXSA_Field := 16#400#;
-- IN endpoint TxFIFO depth
INEPTXFD : FS_DIEPTXF_INEPTXFD_Field := 16#200#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_DIEPTXF_Register use record
INEPTXSA at 0 range 0 .. 15;
INEPTXFD at 0 range 16 .. 31;
end record;
subtype FS_HCFG_FSLSPCS_Field is HAL.UInt2;
-- OTG_FS host configuration register (OTG_FS_HCFG)
type FS_HCFG_Register is record
-- FS/LS PHY clock select
FSLSPCS : FS_HCFG_FSLSPCS_Field := 16#0#;
-- Read-only. FS- and LS-only support
FSLSS : Boolean := False;
-- unspecified
Reserved_3_31 : HAL.UInt29 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_HCFG_Register use record
FSLSPCS at 0 range 0 .. 1;
FSLSS at 0 range 2 .. 2;
Reserved_3_31 at 0 range 3 .. 31;
end record;
subtype HFIR_FRIVL_Field is HAL.UInt16;
-- OTG_FS Host frame interval register
type HFIR_Register is record
-- Frame interval
FRIVL : HFIR_FRIVL_Field := 16#EA60#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for HFIR_Register use record
FRIVL at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype FS_HFNUM_FRNUM_Field is HAL.UInt16;
subtype FS_HFNUM_FTREM_Field is HAL.UInt16;
-- OTG_FS host frame number/frame time remaining register (OTG_FS_HFNUM)
type FS_HFNUM_Register is record
-- Read-only. Frame number
FRNUM : FS_HFNUM_FRNUM_Field;
-- Read-only. Frame time remaining
FTREM : FS_HFNUM_FTREM_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_HFNUM_Register use record
FRNUM at 0 range 0 .. 15;
FTREM at 0 range 16 .. 31;
end record;
subtype FS_HPTXSTS_PTXFSAVL_Field is HAL.UInt16;
subtype FS_HPTXSTS_PTXQSAV_Field is HAL.UInt8;
subtype FS_HPTXSTS_PTXQTOP_Field is HAL.UInt8;
-- OTG_FS_Host periodic transmit FIFO/queue status register
-- (OTG_FS_HPTXSTS)
type FS_HPTXSTS_Register is record
-- Periodic transmit data FIFO space available
PTXFSAVL : FS_HPTXSTS_PTXFSAVL_Field := 16#100#;
-- Read-only. Periodic transmit request queue space available
PTXQSAV : FS_HPTXSTS_PTXQSAV_Field := 16#8#;
-- Read-only. Top of the periodic transmit request queue
PTXQTOP : FS_HPTXSTS_PTXQTOP_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_HPTXSTS_Register use record
PTXFSAVL at 0 range 0 .. 15;
PTXQSAV at 0 range 16 .. 23;
PTXQTOP at 0 range 24 .. 31;
end record;
subtype HAINT_HAINT_Field is HAL.UInt16;
-- OTG_FS Host all channels interrupt register
type HAINT_Register is record
-- Read-only. Channel interrupts
HAINT : HAINT_HAINT_Field;
-- unspecified
Reserved_16_31 : HAL.UInt16;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for HAINT_Register use record
HAINT at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype HAINTMSK_HAINTM_Field is HAL.UInt16;
-- OTG_FS host all channels interrupt mask register
type HAINTMSK_Register is record
-- Channel interrupt mask
HAINTM : HAINTMSK_HAINTM_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for HAINTMSK_Register use record
HAINTM at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype FS_HPRT_PLSTS_Field is HAL.UInt2;
subtype FS_HPRT_PTCTL_Field is HAL.UInt4;
subtype FS_HPRT_PSPD_Field is HAL.UInt2;
-- OTG_FS host port control and status register (OTG_FS_HPRT)
type FS_HPRT_Register is record
-- Read-only. Port connect status
PCSTS : Boolean := False;
-- Port connect detected
PCDET : Boolean := False;
-- Port enable
PENA : Boolean := False;
-- Port enable/disable change
PENCHNG : Boolean := False;
-- Read-only. Port overcurrent active
POCA : Boolean := False;
-- Port overcurrent change
POCCHNG : Boolean := False;
-- Port resume
PRES : Boolean := False;
-- Port suspend
PSUSP : Boolean := False;
-- Port reset
PRST : Boolean := False;
-- unspecified
Reserved_9_9 : HAL.Bit := 16#0#;
-- Read-only. Port line status
PLSTS : FS_HPRT_PLSTS_Field := 16#0#;
-- Port power
PPWR : Boolean := False;
-- Port test control
PTCTL : FS_HPRT_PTCTL_Field := 16#0#;
-- Read-only. Port speed
PSPD : FS_HPRT_PSPD_Field := 16#0#;
-- unspecified
Reserved_19_31 : HAL.UInt13 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_HPRT_Register use record
PCSTS at 0 range 0 .. 0;
PCDET at 0 range 1 .. 1;
PENA at 0 range 2 .. 2;
PENCHNG at 0 range 3 .. 3;
POCA at 0 range 4 .. 4;
POCCHNG at 0 range 5 .. 5;
PRES at 0 range 6 .. 6;
PSUSP at 0 range 7 .. 7;
PRST at 0 range 8 .. 8;
Reserved_9_9 at 0 range 9 .. 9;
PLSTS at 0 range 10 .. 11;
PPWR at 0 range 12 .. 12;
PTCTL at 0 range 13 .. 16;
PSPD at 0 range 17 .. 18;
Reserved_19_31 at 0 range 19 .. 31;
end record;
subtype FS_HCCHAR_MPSIZ_Field is HAL.UInt11;
subtype FS_HCCHAR_EPNUM_Field is HAL.UInt4;
subtype FS_HCCHAR_EPTYP_Field is HAL.UInt2;
subtype FS_HCCHAR_MCNT_Field is HAL.UInt2;
subtype FS_HCCHAR_DAD_Field is HAL.UInt7;
-- OTG_FS host channel-0 characteristics register (OTG_FS_HCCHAR0)
type FS_HCCHAR_Register is record
-- Maximum packet size
MPSIZ : FS_HCCHAR_MPSIZ_Field := 16#0#;
-- Endpoint number
EPNUM : FS_HCCHAR_EPNUM_Field := 16#0#;
-- Endpoint direction
EPDIR : Boolean := False;
-- unspecified
Reserved_16_16 : HAL.Bit := 16#0#;
-- Low-speed device
LSDEV : Boolean := False;
-- Endpoint type
EPTYP : FS_HCCHAR_EPTYP_Field := 16#0#;
-- Multicount
MCNT : FS_HCCHAR_MCNT_Field := 16#0#;
-- Device address
DAD : FS_HCCHAR_DAD_Field := 16#0#;
-- Odd frame
ODDFRM : Boolean := False;
-- Channel disable
CHDIS : Boolean := False;
-- Channel enable
CHENA : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_HCCHAR_Register use record
MPSIZ at 0 range 0 .. 10;
EPNUM at 0 range 11 .. 14;
EPDIR at 0 range 15 .. 15;
Reserved_16_16 at 0 range 16 .. 16;
LSDEV at 0 range 17 .. 17;
EPTYP at 0 range 18 .. 19;
MCNT at 0 range 20 .. 21;
DAD at 0 range 22 .. 28;
ODDFRM at 0 range 29 .. 29;
CHDIS at 0 range 30 .. 30;
CHENA at 0 range 31 .. 31;
end record;
-- OTG_FS host channel-0 interrupt register (OTG_FS_HCINT0)
type FS_HCINT_Register is record
-- Transfer completed
XFRC : Boolean := False;
-- Channel halted
CHH : Boolean := False;
-- unspecified
Reserved_2_2 : HAL.Bit := 16#0#;
-- STALL response received interrupt
STALL : Boolean := False;
-- NAK response received interrupt
NAK : Boolean := False;
-- ACK response received/transmitted interrupt
ACK : Boolean := False;
-- unspecified
Reserved_6_6 : HAL.Bit := 16#0#;
-- Transaction error
TXERR : Boolean := False;
-- Babble error
BBERR : Boolean := False;
-- Frame overrun
FRMOR : Boolean := False;
-- Data toggle error
DTERR : Boolean := False;
-- unspecified
Reserved_11_31 : HAL.UInt21 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_HCINT_Register use record
XFRC at 0 range 0 .. 0;
CHH at 0 range 1 .. 1;
Reserved_2_2 at 0 range 2 .. 2;
STALL at 0 range 3 .. 3;
NAK at 0 range 4 .. 4;
ACK at 0 range 5 .. 5;
Reserved_6_6 at 0 range 6 .. 6;
TXERR at 0 range 7 .. 7;
BBERR at 0 range 8 .. 8;
FRMOR at 0 range 9 .. 9;
DTERR at 0 range 10 .. 10;
Reserved_11_31 at 0 range 11 .. 31;
end record;
-- OTG_FS host channel-0 mask register (OTG_FS_HCINTMSK0)
type FS_HCINTMSK_Register is record
-- Transfer completed mask
XFRCM : Boolean := False;
-- Channel halted mask
CHHM : Boolean := False;
-- unspecified
Reserved_2_2 : HAL.Bit := 16#0#;
-- STALL response received interrupt mask
STALLM : Boolean := False;
-- NAK response received interrupt mask
NAKM : Boolean := False;
-- ACK response received/transmitted interrupt mask
ACKM : Boolean := False;
-- response received interrupt mask
NYET : Boolean := False;
-- Transaction error mask
TXERRM : Boolean := False;
-- Babble error mask
BBERRM : Boolean := False;
-- Frame overrun mask
FRMORM : Boolean := False;
-- Data toggle error mask
DTERRM : Boolean := False;
-- unspecified
Reserved_11_31 : HAL.UInt21 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_HCINTMSK_Register use record
XFRCM at 0 range 0 .. 0;
CHHM at 0 range 1 .. 1;
Reserved_2_2 at 0 range 2 .. 2;
STALLM at 0 range 3 .. 3;
NAKM at 0 range 4 .. 4;
ACKM at 0 range 5 .. 5;
NYET at 0 range 6 .. 6;
TXERRM at 0 range 7 .. 7;
BBERRM at 0 range 8 .. 8;
FRMORM at 0 range 9 .. 9;
DTERRM at 0 range 10 .. 10;
Reserved_11_31 at 0 range 11 .. 31;
end record;
subtype FS_HCTSIZ_XFRSIZ_Field is HAL.UInt19;
subtype FS_HCTSIZ_PKTCNT_Field is HAL.UInt10;
subtype FS_HCTSIZ_DPID_Field is HAL.UInt2;
-- OTG_FS host channel-0 transfer size register
type FS_HCTSIZ_Register is record
-- Transfer size
XFRSIZ : FS_HCTSIZ_XFRSIZ_Field := 16#0#;
-- Packet count
PKTCNT : FS_HCTSIZ_PKTCNT_Field := 16#0#;
-- Data PID
DPID : FS_HCTSIZ_DPID_Field := 16#0#;
-- unspecified
Reserved_31_31 : HAL.Bit := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_HCTSIZ_Register use record
XFRSIZ at 0 range 0 .. 18;
PKTCNT at 0 range 19 .. 28;
DPID at 0 range 29 .. 30;
Reserved_31_31 at 0 range 31 .. 31;
end record;
-- OTG_FS power and clock gating control register (OTG_FS_PCGCCTL)
type FS_PCGCCTL_Register is record
-- Stop PHY clock
STPPCLK : Boolean := False;
-- Gate HCLK
GATEHCLK : Boolean := False;
-- unspecified
Reserved_2_3 : HAL.UInt2 := 16#0#;
-- PHY Suspended
PHYSUSP : Boolean := False;
-- unspecified
Reserved_5_31 : HAL.UInt27 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_PCGCCTL_Register use record
STPPCLK at 0 range 0 .. 0;
GATEHCLK at 0 range 1 .. 1;
Reserved_2_3 at 0 range 2 .. 3;
PHYSUSP at 0 range 4 .. 4;
Reserved_5_31 at 0 range 5 .. 31;
end record;
-----------------
-- Peripherals --
-----------------
-- USB on the go full speed
type OTG_FS_DEVICE_Peripheral is record
-- OTG_FS device configuration register (OTG_FS_DCFG)
FS_DCFG : aliased FS_DCFG_Register;
-- OTG_FS device control register (OTG_FS_DCTL)
FS_DCTL : aliased FS_DCTL_Register;
-- OTG_FS device status register (OTG_FS_DSTS)
FS_DSTS : aliased FS_DSTS_Register;
-- OTG_FS device IN endpoint common interrupt mask register
-- (OTG_FS_DIEPMSK)
FS_DIEPMSK : aliased FS_DIEPMSK_Register;
-- OTG_FS device OUT endpoint common interrupt mask register
-- (OTG_FS_DOEPMSK)
FS_DOEPMSK : aliased FS_DOEPMSK_Register;
-- OTG_FS device all endpoints interrupt register (OTG_FS_DAINT)
FS_DAINT : aliased FS_DAINT_Register;
-- OTG_FS all endpoints interrupt mask register (OTG_FS_DAINTMSK)
FS_DAINTMSK : aliased FS_DAINTMSK_Register;
-- OTG_FS device VBUS discharge time register
DVBUSDIS : aliased DVBUSDIS_Register;
-- OTG_FS device VBUS pulsing time register
DVBUSPULSE : aliased DVBUSPULSE_Register;
-- OTG_FS device IN endpoint FIFO empty interrupt mask register
DIEPEMPMSK : aliased DIEPEMPMSK_Register;
-- OTG_FS device control IN endpoint 0 control register
-- (OTG_FS_DIEPCTL0)
FS_DIEPCTL0 : aliased FS_DIEPCTL0_Register;
-- device endpoint-x interrupt register
DIEPINT0 : aliased DIEPINT_Register;
-- device endpoint-0 transfer size register
DIEPTSIZ0 : aliased DIEPTSIZ0_Register;
-- OTG_FS device IN endpoint transmit FIFO status register
DTXFSTS0 : aliased DTXFSTS_Register;
-- OTG device endpoint-1 control register
DIEPCTL1 : aliased DIEPCTL1_Register;
-- device endpoint-1 interrupt register
DIEPINT1 : aliased DIEPINT_Register;
-- device endpoint-1 transfer size register
DIEPTSIZ1 : aliased DIEPTSIZ_Register;
-- OTG_FS device IN endpoint transmit FIFO status register
DTXFSTS1 : aliased DTXFSTS_Register;
-- OTG device endpoint-2 control register
DIEPCTL2 : aliased DIEPCTL_Register;
-- device endpoint-2 interrupt register
DIEPINT2 : aliased DIEPINT_Register;
-- device endpoint-2 transfer size register
DIEPTSIZ2 : aliased DIEPTSIZ_Register;
-- OTG_FS device IN endpoint transmit FIFO status register
DTXFSTS2 : aliased DTXFSTS_Register;
-- OTG device endpoint-3 control register
DIEPCTL3 : aliased DIEPCTL_Register;
-- device endpoint-3 interrupt register
DIEPINT3 : aliased DIEPINT_Register;
-- device endpoint-3 transfer size register
DIEPTSIZ3 : aliased DIEPTSIZ_Register;
-- OTG_FS device IN endpoint transmit FIFO status register
DTXFSTS3 : aliased DTXFSTS_Register;
-- device endpoint-0 control register
DOEPCTL0 : aliased DOEPCTL0_Register;
-- device endpoint-0 interrupt register
DOEPINT0 : aliased DOEPINT_Register;
-- device OUT endpoint-0 transfer size register
DOEPTSIZ0 : aliased DOEPTSIZ0_Register;
-- device endpoint-1 control register
DOEPCTL1 : aliased DOEPCTL_Register;
-- device endpoint-1 interrupt register
DOEPINT1 : aliased DOEPINT_Register;
-- device OUT endpoint-1 transfer size register
DOEPTSIZ1 : aliased DOEPTSIZ_Register;
-- device endpoint-2 control register
DOEPCTL2 : aliased DOEPCTL_Register;
-- device endpoint-2 interrupt register
DOEPINT2 : aliased DOEPINT_Register;
-- device OUT endpoint-2 transfer size register
DOEPTSIZ2 : aliased DOEPTSIZ_Register;
-- device endpoint-3 control register
DOEPCTL3 : aliased DOEPCTL_Register;
-- device endpoint-3 interrupt register
DOEPINT3 : aliased DOEPINT_Register;
-- device OUT endpoint-3 transfer size register
DOEPTSIZ3 : aliased DOEPTSIZ_Register;
end record
with Volatile;
for OTG_FS_DEVICE_Peripheral use record
FS_DCFG at 16#0# range 0 .. 31;
FS_DCTL at 16#4# range 0 .. 31;
FS_DSTS at 16#8# range 0 .. 31;
FS_DIEPMSK at 16#10# range 0 .. 31;
FS_DOEPMSK at 16#14# range 0 .. 31;
FS_DAINT at 16#18# range 0 .. 31;
FS_DAINTMSK at 16#1C# range 0 .. 31;
DVBUSDIS at 16#28# range 0 .. 31;
DVBUSPULSE at 16#2C# range 0 .. 31;
DIEPEMPMSK at 16#34# range 0 .. 31;
FS_DIEPCTL0 at 16#100# range 0 .. 31;
DIEPINT0 at 16#108# range 0 .. 31;
DIEPTSIZ0 at 16#110# range 0 .. 31;
DTXFSTS0 at 16#118# range 0 .. 31;
DIEPCTL1 at 16#120# range 0 .. 31;
DIEPINT1 at 16#128# range 0 .. 31;
DIEPTSIZ1 at 16#130# range 0 .. 31;
DTXFSTS1 at 16#138# range 0 .. 31;
DIEPCTL2 at 16#140# range 0 .. 31;
DIEPINT2 at 16#148# range 0 .. 31;
DIEPTSIZ2 at 16#150# range 0 .. 31;
DTXFSTS2 at 16#158# range 0 .. 31;
DIEPCTL3 at 16#160# range 0 .. 31;
DIEPINT3 at 16#168# range 0 .. 31;
DIEPTSIZ3 at 16#170# range 0 .. 31;
DTXFSTS3 at 16#178# range 0 .. 31;
DOEPCTL0 at 16#300# range 0 .. 31;
DOEPINT0 at 16#308# range 0 .. 31;
DOEPTSIZ0 at 16#310# range 0 .. 31;
DOEPCTL1 at 16#320# range 0 .. 31;
DOEPINT1 at 16#328# range 0 .. 31;
DOEPTSIZ1 at 16#330# range 0 .. 31;
DOEPCTL2 at 16#340# range 0 .. 31;
DOEPINT2 at 16#348# range 0 .. 31;
DOEPTSIZ2 at 16#350# range 0 .. 31;
DOEPCTL3 at 16#360# range 0 .. 31;
DOEPINT3 at 16#368# range 0 .. 31;
DOEPTSIZ3 at 16#370# range 0 .. 31;
end record;
-- USB on the go full speed
OTG_FS_DEVICE_Periph : aliased OTG_FS_DEVICE_Peripheral
with Import, Address => System'To_Address (16#50000800#);
type OTG_FS_GLOBAL_Disc is
(
Device,
Host);
-- USB on the go full speed
type OTG_FS_GLOBAL_Peripheral
(Discriminent : OTG_FS_GLOBAL_Disc := Device)
is record
-- OTG_FS control and status register (OTG_FS_GOTGCTL)
FS_GOTGCTL : aliased FS_GOTGCTL_Register;
-- OTG_FS interrupt register (OTG_FS_GOTGINT)
FS_GOTGINT : aliased FS_GOTGINT_Register;
-- OTG_FS AHB configuration register (OTG_FS_GAHBCFG)
FS_GAHBCFG : aliased FS_GAHBCFG_Register;
-- OTG_FS USB configuration register (OTG_FS_GUSBCFG)
FS_GUSBCFG : aliased FS_GUSBCFG_Register;
-- OTG_FS reset register (OTG_FS_GRSTCTL)
FS_GRSTCTL : aliased FS_GRSTCTL_Register;
-- OTG_FS core interrupt register (OTG_FS_GINTSTS)
FS_GINTSTS : aliased FS_GINTSTS_Register;
-- OTG_FS interrupt mask register (OTG_FS_GINTMSK)
FS_GINTMSK : aliased FS_GINTMSK_Register;
-- OTG_FS Receive FIFO size register (OTG_FS_GRXFSIZ)
FS_GRXFSIZ : aliased FS_GRXFSIZ_Register;
-- OTG_FS non-periodic transmit FIFO/queue status register
-- (OTG_FS_GNPTXSTS)
FS_GNPTXSTS : aliased FS_GNPTXSTS_Register;
-- OTG_FS general core configuration register (OTG_FS_GCCFG)
FS_GCCFG : aliased FS_GCCFG_Register;
-- core ID register
FS_CID : aliased HAL.UInt32;
-- OTG_FS Host periodic transmit FIFO size register (OTG_FS_HPTXFSIZ)
FS_HPTXFSIZ : aliased FS_HPTXFSIZ_Register;
-- OTG_FS device IN endpoint transmit FIFO size register
-- (OTG_FS_DIEPTXF2)
FS_DIEPTXF1 : aliased FS_DIEPTXF_Register;
-- OTG_FS device IN endpoint transmit FIFO size register
-- (OTG_FS_DIEPTXF3)
FS_DIEPTXF2 : aliased FS_DIEPTXF_Register;
-- OTG_FS device IN endpoint transmit FIFO size register
-- (OTG_FS_DIEPTXF4)
FS_DIEPTXF3 : aliased FS_DIEPTXF_Register;
case Discriminent is
when Device =>
-- OTG_FS Receive status debug read(Device mode)
FS_GRXSTSR_Device : aliased FS_GRXSTSR_Device_Register;
-- OTG_FS non-periodic transmit FIFO size register (Device mode)
FS_GNPTXFSIZ_Device : aliased FS_GNPTXFSIZ_Device_Register;
when Host =>
-- OTG_FS Receive status debug read(Host mode)
FS_GRXSTSR_Host : aliased FS_GRXSTSR_Host_Register;
-- OTG_FS non-periodic transmit FIFO size register (Host mode)
FS_GNPTXFSIZ_Host : aliased FS_GNPTXFSIZ_Host_Register;
end case;
end record
with Unchecked_Union, Volatile;
for OTG_FS_GLOBAL_Peripheral use record
FS_GOTGCTL at 16#0# range 0 .. 31;
FS_GOTGINT at 16#4# range 0 .. 31;
FS_GAHBCFG at 16#8# range 0 .. 31;
FS_GUSBCFG at 16#C# range 0 .. 31;
FS_GRSTCTL at 16#10# range 0 .. 31;
FS_GINTSTS at 16#14# range 0 .. 31;
FS_GINTMSK at 16#18# range 0 .. 31;
FS_GRXFSIZ at 16#24# range 0 .. 31;
FS_GNPTXSTS at 16#2C# range 0 .. 31;
FS_GCCFG at 16#38# range 0 .. 31;
FS_CID at 16#3C# range 0 .. 31;
FS_HPTXFSIZ at 16#100# range 0 .. 31;
FS_DIEPTXF1 at 16#104# range 0 .. 31;
FS_DIEPTXF2 at 16#108# range 0 .. 31;
FS_DIEPTXF3 at 16#10C# range 0 .. 31;
FS_GRXSTSR_Device at 16#1C# range 0 .. 31;
FS_GNPTXFSIZ_Device at 16#28# range 0 .. 31;
FS_GRXSTSR_Host at 16#1C# range 0 .. 31;
FS_GNPTXFSIZ_Host at 16#28# range 0 .. 31;
end record;
-- USB on the go full speed
OTG_FS_GLOBAL_Periph : aliased OTG_FS_GLOBAL_Peripheral
with Import, Address => System'To_Address (16#50000000#);
-- USB on the go full speed
type OTG_FS_HOST_Peripheral is record
-- OTG_FS host configuration register (OTG_FS_HCFG)
FS_HCFG : aliased FS_HCFG_Register;
-- OTG_FS Host frame interval register
HFIR : aliased HFIR_Register;
-- OTG_FS host frame number/frame time remaining register (OTG_FS_HFNUM)
FS_HFNUM : aliased FS_HFNUM_Register;
-- OTG_FS_Host periodic transmit FIFO/queue status register
-- (OTG_FS_HPTXSTS)
FS_HPTXSTS : aliased FS_HPTXSTS_Register;
-- OTG_FS Host all channels interrupt register
HAINT : aliased HAINT_Register;
-- OTG_FS host all channels interrupt mask register
HAINTMSK : aliased HAINTMSK_Register;
-- OTG_FS host port control and status register (OTG_FS_HPRT)
FS_HPRT : aliased FS_HPRT_Register;
-- OTG_FS host channel-0 characteristics register (OTG_FS_HCCHAR0)
FS_HCCHAR0 : aliased FS_HCCHAR_Register;
-- OTG_FS host channel-0 interrupt register (OTG_FS_HCINT0)
FS_HCINT0 : aliased FS_HCINT_Register;
-- OTG_FS host channel-0 mask register (OTG_FS_HCINTMSK0)
FS_HCINTMSK0 : aliased FS_HCINTMSK_Register;
-- OTG_FS host channel-0 transfer size register
FS_HCTSIZ0 : aliased FS_HCTSIZ_Register;
-- OTG_FS host channel-1 characteristics register (OTG_FS_HCCHAR1)
FS_HCCHAR1 : aliased FS_HCCHAR_Register;
-- OTG_FS host channel-1 interrupt register (OTG_FS_HCINT1)
FS_HCINT1 : aliased FS_HCINT_Register;
-- OTG_FS host channel-1 mask register (OTG_FS_HCINTMSK1)
FS_HCINTMSK1 : aliased FS_HCINTMSK_Register;
-- OTG_FS host channel-1 transfer size register
FS_HCTSIZ1 : aliased FS_HCTSIZ_Register;
-- OTG_FS host channel-2 characteristics register (OTG_FS_HCCHAR2)
FS_HCCHAR2 : aliased FS_HCCHAR_Register;
-- OTG_FS host channel-2 interrupt register (OTG_FS_HCINT2)
FS_HCINT2 : aliased FS_HCINT_Register;
-- OTG_FS host channel-2 mask register (OTG_FS_HCINTMSK2)
FS_HCINTMSK2 : aliased FS_HCINTMSK_Register;
-- OTG_FS host channel-2 transfer size register
FS_HCTSIZ2 : aliased FS_HCTSIZ_Register;
-- OTG_FS host channel-3 characteristics register (OTG_FS_HCCHAR3)
FS_HCCHAR3 : aliased FS_HCCHAR_Register;
-- OTG_FS host channel-3 interrupt register (OTG_FS_HCINT3)
FS_HCINT3 : aliased FS_HCINT_Register;
-- OTG_FS host channel-3 mask register (OTG_FS_HCINTMSK3)
FS_HCINTMSK3 : aliased FS_HCINTMSK_Register;
-- OTG_FS host channel-3 transfer size register
FS_HCTSIZ3 : aliased FS_HCTSIZ_Register;
-- OTG_FS host channel-4 characteristics register (OTG_FS_HCCHAR4)
FS_HCCHAR4 : aliased FS_HCCHAR_Register;
-- OTG_FS host channel-4 interrupt register (OTG_FS_HCINT4)
FS_HCINT4 : aliased FS_HCINT_Register;
-- OTG_FS host channel-4 mask register (OTG_FS_HCINTMSK4)
FS_HCINTMSK4 : aliased FS_HCINTMSK_Register;
-- OTG_FS host channel-x transfer size register
FS_HCTSIZ4 : aliased FS_HCTSIZ_Register;
-- OTG_FS host channel-5 characteristics register (OTG_FS_HCCHAR5)
FS_HCCHAR5 : aliased FS_HCCHAR_Register;
-- OTG_FS host channel-5 interrupt register (OTG_FS_HCINT5)
FS_HCINT5 : aliased FS_HCINT_Register;
-- OTG_FS host channel-5 mask register (OTG_FS_HCINTMSK5)
FS_HCINTMSK5 : aliased FS_HCINTMSK_Register;
-- OTG_FS host channel-5 transfer size register
FS_HCTSIZ5 : aliased FS_HCTSIZ_Register;
-- OTG_FS host channel-6 characteristics register (OTG_FS_HCCHAR6)
FS_HCCHAR6 : aliased FS_HCCHAR_Register;
-- OTG_FS host channel-6 interrupt register (OTG_FS_HCINT6)
FS_HCINT6 : aliased FS_HCINT_Register;
-- OTG_FS host channel-6 mask register (OTG_FS_HCINTMSK6)
FS_HCINTMSK6 : aliased FS_HCINTMSK_Register;
-- OTG_FS host channel-6 transfer size register
FS_HCTSIZ6 : aliased FS_HCTSIZ_Register;
-- OTG_FS host channel-7 characteristics register (OTG_FS_HCCHAR7)
FS_HCCHAR7 : aliased FS_HCCHAR_Register;
-- OTG_FS host channel-7 interrupt register (OTG_FS_HCINT7)
FS_HCINT7 : aliased FS_HCINT_Register;
-- OTG_FS host channel-7 mask register (OTG_FS_HCINTMSK7)
FS_HCINTMSK7 : aliased FS_HCINTMSK_Register;
-- OTG_FS host channel-7 transfer size register
FS_HCTSIZ7 : aliased FS_HCTSIZ_Register;
end record
with Volatile;
for OTG_FS_HOST_Peripheral use record
FS_HCFG at 16#0# range 0 .. 31;
HFIR at 16#4# range 0 .. 31;
FS_HFNUM at 16#8# range 0 .. 31;
FS_HPTXSTS at 16#10# range 0 .. 31;
HAINT at 16#14# range 0 .. 31;
HAINTMSK at 16#18# range 0 .. 31;
FS_HPRT at 16#40# range 0 .. 31;
FS_HCCHAR0 at 16#100# range 0 .. 31;
FS_HCINT0 at 16#108# range 0 .. 31;
FS_HCINTMSK0 at 16#10C# range 0 .. 31;
FS_HCTSIZ0 at 16#110# range 0 .. 31;
FS_HCCHAR1 at 16#120# range 0 .. 31;
FS_HCINT1 at 16#128# range 0 .. 31;
FS_HCINTMSK1 at 16#12C# range 0 .. 31;
FS_HCTSIZ1 at 16#130# range 0 .. 31;
FS_HCCHAR2 at 16#140# range 0 .. 31;
FS_HCINT2 at 16#148# range 0 .. 31;
FS_HCINTMSK2 at 16#14C# range 0 .. 31;
FS_HCTSIZ2 at 16#150# range 0 .. 31;
FS_HCCHAR3 at 16#160# range 0 .. 31;
FS_HCINT3 at 16#168# range 0 .. 31;
FS_HCINTMSK3 at 16#16C# range 0 .. 31;
FS_HCTSIZ3 at 16#170# range 0 .. 31;
FS_HCCHAR4 at 16#180# range 0 .. 31;
FS_HCINT4 at 16#188# range 0 .. 31;
FS_HCINTMSK4 at 16#18C# range 0 .. 31;
FS_HCTSIZ4 at 16#190# range 0 .. 31;
FS_HCCHAR5 at 16#1A0# range 0 .. 31;
FS_HCINT5 at 16#1A8# range 0 .. 31;
FS_HCINTMSK5 at 16#1AC# range 0 .. 31;
FS_HCTSIZ5 at 16#1B0# range 0 .. 31;
FS_HCCHAR6 at 16#1C0# range 0 .. 31;
FS_HCINT6 at 16#1C8# range 0 .. 31;
FS_HCINTMSK6 at 16#1CC# range 0 .. 31;
FS_HCTSIZ6 at 16#1D0# range 0 .. 31;
FS_HCCHAR7 at 16#1E0# range 0 .. 31;
FS_HCINT7 at 16#1E8# range 0 .. 31;
FS_HCINTMSK7 at 16#1EC# range 0 .. 31;
FS_HCTSIZ7 at 16#1F0# range 0 .. 31;
end record;
-- USB on the go full speed
OTG_FS_HOST_Periph : aliased OTG_FS_HOST_Peripheral
with Import, Address => System'To_Address (16#50000400#);
-- USB on the go full speed
type OTG_FS_PWRCLK_Peripheral is record
-- OTG_FS power and clock gating control register (OTG_FS_PCGCCTL)
FS_PCGCCTL : aliased FS_PCGCCTL_Register;
end record
with Volatile;
for OTG_FS_PWRCLK_Peripheral use record
FS_PCGCCTL at 0 range 0 .. 31;
end record;
-- USB on the go full speed
OTG_FS_PWRCLK_Periph : aliased OTG_FS_PWRCLK_Peripheral
with Import, Address => System'To_Address (16#50000E00#);
end STM32_SVD.USB_OTG_FS;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . B B . B O A R D _ S U P P O R T --
-- --
-- B o d y --
-- --
-- Copyright (C) 1999-2002 Universidad Politecnica de Madrid --
-- Copyright (C) 2003-2005 The European Space Agency --
-- Copyright (C) 2003-2017, 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. --
-- --
-- The port of GNARL to bare board targets was initially developed by the --
-- Real-Time Systems Group at the Technical University of Madrid. --
-- --
------------------------------------------------------------------------------
with System.Machine_Code;
with System.BB.Parameters; use System.BB.Parameters;
with System.BB.CPU_Primitives;
package body System.BB.Board_Support is
use CPU_Primitives, BB.Interrupts, Machine_Code, Time;
Sys_Tick_Vector : constant Vector_Id := 15;
Interrupt_Request_Vector : constant Vector_Id := 16;
-- See vector definitions in ARMv7-M version of System.BB.CPU_Primitives.
-- Defined by ARMv7-M specifications.
Alarm_Time : Time.Timer_Interval;
pragma Volatile (Alarm_Time);
pragma Export (C, Alarm_Time, "__gnat_alarm_time");
Alarm_Interrupt_ID : constant Interrupt_ID := -1;
-- Return the interrupt level to use for the alarm clock handler. Note
-- that we use a "fake" Interrupt_ID for the alarm interrupt, as it is
-- handled specially (not through the NVIC).
---------------------------
-- System control and ID --
---------------------------
ICSR : Word with Volatile, Address => 16#E000_ED04#;
-- Interrupt Control State (part of the System Control Block - SCB)
ICSR_Pend_ST_Set : constant := 2**26; -- Set pending Sys_Tick (RW)
ICSR_Pend_ST_Clr : constant := 2**25; -- Clear pending Sys_Tick (W)
-----------------------
-- Sys_Tick Handling --
-----------------------
-- We use the Sys_Tick timer as a periodic timer with 1 kHz rate. This
-- is a trade-off between accurate delays, limited overhead and maximum
-- time that interrupts may be disabled.
Tick_Period : constant Time.Timer_Interval := Clock_Frequency / 1000;
type Sys_Tick_Registers is record
SYST_CSR : Word;
SYST_RVR : Word;
SYST_CVR : Word;
SYST_CALIB : Word;
end record;
CSR_Count_Flag : constant := 2**16;
CSR_Clk_Source : constant := 2**2;
CSR_Tick_Int : constant := 2**1;
CSR_Enable : constant := 2**0;
RVR_Last : constant := 2**24 - 1;
pragma Assert (Tick_Period <= RVR_Last + 1);
SYST : Sys_Tick_Registers with Volatile, Address => 16#E000_E010#;
-- SysTick control and status register (Part of SYST).
Next_Tick_Time : Timer_Interval with Volatile;
-- Time when systick will expire. This gives the high digits of the time
----------------------------------------------
-- New Vectored Interrupt Controller (NVIC) --
----------------------------------------------
NVIC_Base : constant := 16#E000_E000#;
-- Nested Vectored Interrupt Controller (NVIC) base.
NVIC_ISER0 : constant Address := NVIC_Base + 16#100#;
-- Writing a bit mask to this register enables the corresponding interrupts
type PRI is mod 2**8;
-- Type for ARMv7-M interrupt priorities. Note that 0 is the highest
-- priority, which is reserved for the kernel and has no corresponding
-- Interrupt_Priority value, and 255 is the lowest. We assume the PRIGROUP
-- setting is such that the 4 most significant bits determine the priority
-- group used for preemption. However, if less bits are implemented, this
-- should still work.
function To_PRI (P : Integer) return PRI is
(if P not in Interrupt_Priority then 0
else PRI (Interrupt_Priority'Last - P + 1) * 16);
-- Return the BASEPRI mask for the given Ada priority. Note that the zero
-- value here means no mask, so no interrupts are masked.
function To_Priority (P : PRI) return Interrupt_Priority is
(if P = 0 then Interrupt_Priority'Last
else (Interrupt_Priority'Last - Any_Priority'Base (P / 16) + 1));
-- Given an ARM interrupt priority (PRI value), determine the Ada priority
-- While the value 0 is reserved for the kernel and has no Ada priority
-- that represents it, Interrupt_Priority'Last is closest.
IP : array (0 .. Interrupt_ID'Last) of PRI
with Volatile, Address => 16#E000_E400#;
-- Local utility functions
procedure Enable_Interrupt_Request
(Interrupt : Interrupt_ID;
Prio : Interrupt_Priority);
-- Enable interrupt requests for the given interrupt
procedure Interrupt_Handler;
procedure Timer_Interrupt_Handler;
-- Low-level interrupt handlers
----------------------
-- Initialize_Board --
----------------------
procedure Initialize_Board is
begin
-- Mask interrupts
Disable_Interrupts;
-- Because we operate the SysTick clock as a periodic timer, and 24 bits
-- at 168 MHz is sufficient for that, use the unscaled system clock.
-- To initialize the Sys_Tick timer, first disable the clock, then
-- program it and finally enable it. This way an accidentally
-- misconfigured timer will not cause pending interrupt while
-- reprogramming.
SYST.SYST_CSR := CSR_Clk_Source; -- disable clock
SYST.SYST_RVR := Word (Tick_Period - 1);
SYST.SYST_CVR := 0;
SYST.SYST_CSR := CSR_Clk_Source or CSR_Enable;
Next_Tick_Time := Tick_Period;
Time.Set_Alarm (Timer_Interval'Last);
Time.Clear_Alarm_Interrupt;
Install_Trap_Handler
(Timer_Interrupt_Handler'Address, Sys_Tick_Vector);
Install_Trap_Handler
(Interrupt_Handler'Address, Interrupt_Request_Vector);
Enable_Interrupts (Priority'Last);
end Initialize_Board;
package body Time is
------------------------
-- Max_Timer_Interval --
------------------------
function Max_Timer_Interval return Timer_Interval is (2**32 - 1);
----------------
-- Read_Clock --
----------------
function Read_Clock return BB.Time.Time is
PRIMASK : Word;
Flag : Boolean;
Count : Timer_Interval;
Res : Timer_Interval;
begin
-- As several registers and variables need to be read or modified, do
-- it atomically.
Asm ("mrs %0, PRIMASK",
Outputs => Word'Asm_Output ("=&r", PRIMASK),
Volatile => True);
Asm ("msr PRIMASK, %0",
Inputs => Word'Asm_Input ("r", 1),
Volatile => True);
-- We must read the counter register before the flag
Count := Timer_Interval (SYST.SYST_CVR);
-- If we read the flag first, a reload can occur just after the read
-- and the count register would wrap around. We'd end up with a Count
-- value close to the Tick_Period value but a flag at zero and
-- therefore miss the reload and return a wrong clock value.
-- This flag is set when the counter has reached zero. Next_Tick_Time
-- has to be incremented. This will trigger an interrupt very soon
-- (or has just triggered the interrupt), so count is either zero or
-- not far from Tick_Period.
Flag := (SYST.SYST_CSR and CSR_Count_Flag) /= 0;
if Flag then
-- Systick counter has just reached zero, pretend it is still zero
-- This function is called by the interrupt handler that is
-- executed when the counter reaches zero. Therefore, we signal
-- that the next interrupt will happen within a period. Note that
-- reading the Control and Status register (SYST_CSR) clears the
-- COUNTFLAG bit, so even if we have sequential calls to this
-- function, the increment of Next_Tick_Time will happen only
-- once.
Res := Next_Tick_Time;
Next_Tick_Time := Next_Tick_Time + Tick_Period;
else
-- The counter is decremented, so compute the actual time
Res := Next_Tick_Time - Count;
end if;
-- Restore interrupt mask
Asm ("msr PRIMASK, %0",
Inputs => Word'Asm_Input ("r", PRIMASK),
Volatile => True);
return BB.Time.Time (Res);
end Read_Clock;
---------------------------
-- Clear_Alarm_Interrupt --
---------------------------
procedure Clear_Alarm_Interrupt is
begin
ICSR := ICSR_Pend_ST_Clr;
end Clear_Alarm_Interrupt;
---------------
-- Set_Alarm --
---------------
procedure Set_Alarm (Ticks : Timer_Interval) is
Now : constant Timer_Interval := Timer_Interval (Read_Clock);
begin
-- As we will have periodic interrupts for alarms regardless, the
-- only thing to do is force an interrupt if the alarm has already
-- expired.
Alarm_Time :=
Now + Timer_Interval'Min (Timer_Interval'Last / 2, Ticks);
if Ticks = 0 then
ICSR := ICSR_Pend_ST_Set;
end if;
end Set_Alarm;
---------------------------
-- Install_Alarm_Handler --
---------------------------
procedure Install_Alarm_Handler
(Handler : BB.Interrupts.Interrupt_Handler) is
begin
BB.Interrupts.Attach_Handler
(Handler, Alarm_Interrupt_ID, Interrupt_Priority'Last);
end Install_Alarm_Handler;
end Time;
package body Multiprocessors is separate;
-----------------------------
-- Timer_Interrupt_Handler --
-----------------------------
procedure Timer_Interrupt_Handler is
begin
Interrupt_Wrapper (Alarm_Interrupt_ID);
end Timer_Interrupt_Handler;
-----------------------
-- Interrupt_Handler --
-----------------------
procedure Interrupt_Handler is
Id : Interrupt_ID;
Res : Word;
begin
-- The exception number is read from the IPSR
Asm ("mrs %0, ipsr",
Word'Asm_Output ("=r", Res),
Volatile => True);
Res := Res and 16#FF#;
-- Convert it to IRQ number by substracting 16 (number of cpu
-- exceptions).
Id := Interrupt_ID'Base (Res) - 16;
Interrupt_Wrapper (Id);
end Interrupt_Handler;
------------------------------
-- Enable_Interrupt_Request --
------------------------------
procedure Enable_Interrupt_Request
(Interrupt : Interrupt_ID;
Prio : Interrupt_Priority)
is
begin
if Interrupt = Alarm_Interrupt_ID then
-- Consistency check with Priority_Of_Interrupt
pragma Assert (Prio = Interrupt_Priority'Last);
Time.Clear_Alarm_Interrupt;
SYST.SYST_CSR := SYST.SYST_CSR or CSR_Tick_Int;
else
declare
pragma Assert (Interrupt >= 0);
IRQ : constant Natural := Interrupt;
Regofs : constant Natural := IRQ / 32;
Regbit : constant Word := 2** (IRQ mod 32);
NVIC_ISER : array (0 .. 15) of Word
with Volatile, Address => NVIC_ISER0;
-- Many NVIC registers use 16 words of 32 bits each to serve as a
-- bitmap for all interrupt channels. Regofs indicates register
-- offset (0 .. 15), and Regbit indicates the mask required for
-- addressing the bit.
begin
NVIC_ISER (Regofs) := Regbit;
end;
end if;
end Enable_Interrupt_Request;
package body Interrupts is
-------------------------------
-- Install_Interrupt_Handler --
-------------------------------
procedure Install_Interrupt_Handler
(Interrupt : Interrupt_ID;
Prio : Interrupt_Priority)
is
begin
if Interrupt /= Alarm_Interrupt_ID then
IP (Interrupt) := To_PRI (Prio);
end if;
Enable_Interrupt_Request (Interrupt, Prio);
end Install_Interrupt_Handler;
---------------------------
-- Priority_Of_Interrupt --
---------------------------
function Priority_Of_Interrupt
(Interrupt : Interrupt_ID) return Any_Priority
is
(if Interrupt = Alarm_Interrupt_ID then Interrupt_Priority'Last
else To_Priority (IP (Interrupt)));
----------------
-- Power_Down --
----------------
procedure Power_Down is
begin
Asm ("wfi", Volatile => True);
end Power_Down;
--------------------------
-- Set_Current_Priority --
--------------------------
procedure Set_Current_Priority (Priority : Integer) is
begin
-- Writing a 0 to BASEPRI disables interrupt masking, while values
-- 15 .. 1 correspond to interrupt priorities 255 .. 241 in that
-- order.
Asm ("msr BASEPRI, %0",
Inputs => PRI'Asm_Input ("r", To_PRI (Priority)),
Volatile => True);
end Set_Current_Priority;
end Interrupts;
end System.BB.Board_Support;
|
package DECL_CTX_Def is
X : exception;
end;
|
------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Termcap --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000 Free Software Foundation, Inc. --
-- --
-- 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, distribute with modifications, 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 ABOVE 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. --
-- --
-- Except as contained in this notice, the name(s) of the above copyright --
-- holders shall not be used in advertising or otherwise to promote the --
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.3 $
-- Binding Version 01.00
------------------------------------------------------------------------------
package Terminal_Interface.Curses.Termcap is
pragma Preelaborate (Terminal_Interface.Curses.Termcap);
-- |=====================================================================
-- | Man page curs_termcap.3x
-- |=====================================================================
-- Not implemented: tputs (see curs_terminfo)
type Termcap_String is new String;
-- |
function TGoto (Cap : String;
Col : Column_Position;
Row : Line_Position) return Termcap_String;
-- AKA: tgoto()
-- |
function Get_Entry (Name : String) return Boolean;
-- AKA: tgetent()
-- |
function Get_Flag (Name : String) return Boolean;
-- AKA: tgetflag()
-- |
procedure Get_Number (Name : String;
Value : out Integer;
Result : out Boolean);
-- AKA: tgetnum()
-- |
procedure Get_String (Name : String;
Value : out String;
Result : out Boolean);
function Get_String (Name : String) return Boolean;
-- Returns True if the string is found.
-- AKA: tgetstr()
end Terminal_Interface.Curses.Termcap;
|
with system.Storage_Elements;
package Counter
with SPARK_Mode => On
-- Small external state tutorial exercise
--
-- This package uses an external counter which is incremented
-- by one every time:
-- A. its clock ticks,
-- B. it is read.
--
-- It has one query procedure Bump_And_Monitor to check if the
-- counter has reached its limit.
is
Port : Integer with volatile,
async_writers,
effective_reads,
address => system.storage_elements.to_address ( 16#1234ABCD# );
Limit : constant Integer := 3_000_000;
procedure Bump_And_Monitor (Alarm : out Boolean)
with Global => (in_out => port), depends => (alarm => port, port => port);
end Counter;
|
-- Copyright 2007-2019 Free Software Foundation, Inc.
--
-- This program 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 3 of the License, or
-- (at your option) any later version.
--
-- This program 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 program. If not, see <http://www.gnu.org/licenses/>.
package Pck is
Procedure_Result : Character := ' ';
procedure Same (C : Character);
-- Set Procedure_Result to C.
procedure Next (C : in out Character);
-- Increment C (if C is the last character, then set C to the first
-- character). Set Procedure_Result to the new value of C.
end Pck;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . R E S P O N S E _ F I L E --
-- --
-- B o d y --
-- --
-- Copyright (C) 2007-2019, 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. --
-- --
------------------------------------------------------------------------------
pragma Compiler_Unit_Warning;
with Ada.Unchecked_Deallocation;
with System.OS_Lib; use System.OS_Lib;
package body System.Response_File is
type File_Rec;
type File_Ptr is access File_Rec;
type File_Rec is record
Name : String_Access;
Next : File_Ptr;
Prev : File_Ptr;
end record;
-- To build a stack of response file names
procedure Free is new Ada.Unchecked_Deallocation (File_Rec, File_Ptr);
type Argument_List_Access is access Argument_List;
procedure Free is new Ada.Unchecked_Deallocation
(Argument_List, Argument_List_Access);
-- Free only the allocated Argument_List, not allocated String components
--------------------
-- Arguments_From --
--------------------
function Arguments_From
(Response_File_Name : String;
Recursive : Boolean := False;
Ignore_Non_Existing_Files : Boolean := False)
return Argument_List
is
First_File : File_Ptr := null;
Last_File : File_Ptr := null;
-- The stack of response files
Arguments : Argument_List_Access := new Argument_List (1 .. 4);
Last_Arg : Natural := 0;
procedure Add_Argument (Arg : String);
-- Add argument Arg to argument list Arguments, increasing Arguments
-- if necessary.
procedure Recurse (File_Name : String);
-- Get the arguments from the file and call itself recursively if one of
-- the arguments starts with character '@'.
------------------
-- Add_Argument --
------------------
procedure Add_Argument (Arg : String) is
begin
if Last_Arg = Arguments'Last then
declare
New_Arguments : constant Argument_List_Access :=
new Argument_List (1 .. Arguments'Last * 2);
begin
New_Arguments (Arguments'Range) := Arguments.all;
Arguments.all := (others => null);
Free (Arguments);
Arguments := New_Arguments;
end;
end if;
Last_Arg := Last_Arg + 1;
Arguments (Last_Arg) := new String'(Arg);
end Add_Argument;
-------------
-- Recurse --
-------------
procedure Recurse (File_Name : String) is
-- Open the response file. If not found, fail or report a warning,
-- depending on the value of Ignore_Non_Existing_Files.
FD : constant File_Descriptor := Open_Read (File_Name, Text);
Buffer_Size : constant := 1500;
Buffer : String (1 .. Buffer_Size);
Buffer_Length : Natural;
Buffer_Cursor : Natural;
End_Of_File_Reached : Boolean;
Line : String (1 .. Max_Line_Length + 1);
Last : Natural;
First_Char : Positive;
-- Index of the first character of an argument in Line
Last_Char : Natural;
-- Index of the last character of an argument in Line
In_String : Boolean;
-- True when inside a quoted string
Arg : Positive;
function End_Of_File return Boolean;
-- True when the end of the response file has been reached
procedure Get_Buffer;
-- Read one buffer from the response file
procedure Get_Line;
-- Get one line from the response file
-----------------
-- End_Of_File --
-----------------
function End_Of_File return Boolean is
begin
return End_Of_File_Reached and then Buffer_Cursor > Buffer_Length;
end End_Of_File;
----------------
-- Get_Buffer --
----------------
procedure Get_Buffer is
begin
Buffer_Length := Read (FD, Buffer (1)'Address, Buffer'Length);
End_Of_File_Reached := Buffer_Length < Buffer'Length;
Buffer_Cursor := 1;
end Get_Buffer;
--------------
-- Get_Line --
--------------
procedure Get_Line is
Ch : Character;
begin
Last := 0;
if End_Of_File then
return;
end if;
loop
Ch := Buffer (Buffer_Cursor);
exit when Ch = ASCII.CR or else
Ch = ASCII.LF or else
Ch = ASCII.FF;
Last := Last + 1;
Line (Last) := Ch;
if Last = Line'Last then
return;
end if;
Buffer_Cursor := Buffer_Cursor + 1;
if Buffer_Cursor > Buffer_Length then
Get_Buffer;
if End_Of_File then
return;
end if;
end if;
end loop;
loop
Ch := Buffer (Buffer_Cursor);
exit when Ch /= ASCII.HT and then
Ch /= ASCII.LF and then
Ch /= ASCII.FF;
Buffer_Cursor := Buffer_Cursor + 1;
if Buffer_Cursor > Buffer_Length then
Get_Buffer;
if End_Of_File then
return;
end if;
end if;
end loop;
end Get_Line;
-- Start of processing for Recurse
begin
Last_Arg := 0;
if FD = Invalid_FD then
if Ignore_Non_Existing_Files then
return;
else
raise File_Does_Not_Exist;
end if;
end if;
-- Put the response file name on the stack
if First_File = null then
First_File :=
new File_Rec'
(Name => new String'(File_Name),
Next => null,
Prev => null);
Last_File := First_File;
else
declare
Current : File_Ptr := First_File;
begin
loop
if Current.Name.all = File_Name then
raise Circularity_Detected;
end if;
Current := Current.Next;
exit when Current = null;
end loop;
Last_File.Next :=
new File_Rec'
(Name => new String'(File_Name),
Next => null,
Prev => Last_File);
Last_File := Last_File.Next;
end;
end if;
End_Of_File_Reached := False;
Get_Buffer;
-- Read the response file line by line
Line_Loop :
while not End_Of_File loop
Get_Line;
if Last = Line'Last then
raise Line_Too_Long;
end if;
First_Char := 1;
-- Get each argument on the line
Arg_Loop :
loop
-- First, skip any white space
while First_Char <= Last loop
exit when Line (First_Char) /= ' ' and then
Line (First_Char) /= ASCII.HT;
First_Char := First_Char + 1;
end loop;
exit Arg_Loop when First_Char > Last;
Last_Char := First_Char;
In_String := False;
-- Get the character one by one
Character_Loop :
while Last_Char <= Last loop
-- Inside a string, check only for '"'
if In_String then
if Line (Last_Char) = '"' then
-- Remove the '"'
Line (Last_Char .. Last - 1) :=
Line (Last_Char + 1 .. Last);
Last := Last - 1;
-- End of string is end of argument
if Last_Char > Last or else
Line (Last_Char) = ' ' or else
Line (Last_Char) = ASCII.HT
then
In_String := False;
Last_Char := Last_Char - 1;
exit Character_Loop;
else
-- If there are two consecutive '"', the quoted
-- string is not closed
In_String := Line (Last_Char) = '"';
if In_String then
Last_Char := Last_Char + 1;
end if;
end if;
else
Last_Char := Last_Char + 1;
end if;
elsif Last_Char = Last then
-- An opening '"' at the end of the line is an error
if Line (Last) = '"' then
raise No_Closing_Quote;
else
-- The argument ends with the line
exit Character_Loop;
end if;
elsif Line (Last_Char) = '"' then
-- Entering a quoted string: remove the '"'
In_String := True;
Line (Last_Char .. Last - 1) :=
Line (Last_Char + 1 .. Last);
Last := Last - 1;
else
-- Outside quoted strings, white space ends the argument
exit Character_Loop
when Line (Last_Char + 1) = ' ' or else
Line (Last_Char + 1) = ASCII.HT;
Last_Char := Last_Char + 1;
end if;
end loop Character_Loop;
-- It is an error to not close a quoted string before the end
-- of the line.
if In_String then
raise No_Closing_Quote;
end if;
-- Add the argument to the list
declare
Arg : String (1 .. Last_Char - First_Char + 1);
begin
Arg := Line (First_Char .. Last_Char);
Add_Argument (Arg);
end;
-- Next argument, if line is not finished
First_Char := Last_Char + 1;
end loop Arg_Loop;
end loop Line_Loop;
Close (FD);
-- If Recursive is True, check for any argument starting with '@'
if Recursive then
Arg := 1;
while Arg <= Last_Arg loop
if Arguments (Arg)'Length > 0 and then
Arguments (Arg) (1) = '@'
then
-- Ignore argument '@' with no file name
if Arguments (Arg)'Length = 1 then
Arguments (Arg .. Last_Arg - 1) :=
Arguments (Arg + 1 .. Last_Arg);
Last_Arg := Last_Arg - 1;
else
-- Save the current arguments and get those in the new
-- response file.
declare
Inc_File_Name : constant String :=
Arguments (Arg) (2 .. Arguments (Arg)'Last);
Current_Arguments : constant Argument_List :=
Arguments (1 .. Last_Arg);
begin
Recurse (Inc_File_Name);
-- Insert the new arguments where the new response
-- file was imported.
declare
New_Arguments : constant Argument_List :=
Arguments (1 .. Last_Arg);
New_Last_Arg : constant Positive :=
Current_Arguments'Length +
New_Arguments'Length - 1;
begin
-- Grow Arguments if it is not large enough
if Arguments'Last < New_Last_Arg then
Last_Arg := Arguments'Last;
Free (Arguments);
while Last_Arg < New_Last_Arg loop
Last_Arg := Last_Arg * 2;
end loop;
Arguments := new Argument_List (1 .. Last_Arg);
end if;
Last_Arg := New_Last_Arg;
Arguments (1 .. Last_Arg) :=
Current_Arguments (1 .. Arg - 1) &
New_Arguments &
Current_Arguments
(Arg + 1 .. Current_Arguments'Last);
Arg := Arg + New_Arguments'Length;
end;
end;
end if;
else
Arg := Arg + 1;
end if;
end loop;
end if;
-- Remove the response file name from the stack
if First_File = Last_File then
System.Strings.Free (First_File.Name);
Free (First_File);
First_File := null;
Last_File := null;
else
System.Strings.Free (Last_File.Name);
Last_File := Last_File.Prev;
Free (Last_File.Next);
end if;
exception
when others =>
Close (FD);
raise;
end Recurse;
-- Start of processing for Arguments_From
begin
-- The job is done by procedure Recurse
Recurse (Response_File_Name);
-- Free Arguments before returning the result
declare
Result : constant Argument_List := Arguments (1 .. Last_Arg);
begin
Free (Arguments);
return Result;
end;
exception
when others =>
-- When an exception occurs, deallocate everything
Free (Arguments);
while First_File /= null loop
Last_File := First_File.Next;
System.Strings.Free (First_File.Name);
Free (First_File);
First_File := Last_File;
end loop;
raise;
end Arguments_From;
end System.Response_File;
|
with Ada.Colors;
with Ada.Text_IO.Terminal.Colors.Names;
procedure tty_color is
use type Ada.Text_IO.Terminal.Colors.Color_Parameter;
package CN
renames Ada.Text_IO.Terminal.Colors.Names;
System_Colors : constant array (0 .. 15) of Ada.Text_IO.Terminal.Colors.Color := (
CN.Black,
CN.Dark_Blue,
CN.Dark_Green,
CN.Dark_Cyan,
CN.Dark_Red,
CN.Dark_Magenta,
CN.Dark_Yellow,
CN.Gray,
CN.Dark_Gray,
CN.Blue,
CN.Green,
CN.Cyan,
CN.Red,
CN.Magenta,
CN.Yellow,
CN.White);
Fullwidth_A : constant String := (
Character'Val (16#EF#),
Character'Val (16#BC#),
Character'Val (16#A1#));
Output : Ada.Text_IO.File_Type
renames Ada.Text_IO.Standard_Output.all;
begin
for I in System_Colors'Range loop
Ada.Text_IO.Terminal.Colors.Set_Color (Output,
Foreground => +System_Colors (System_Colors'Last - I),
Background => +System_Colors (I));
Ada.Text_IO.Put (Output, Fullwidth_A);
end loop;
Ada.Text_IO.Terminal.Colors.Reset_Color (Output);
Ada.Text_IO.New_Line (Output, Spacing => 2);
for R1 in 0 .. 1 loop -- large Y block
for G in 0 .. 7 loop -- Y
for R2 in 0 .. 3 loop -- large X block
for B in 0 .. 7 loop -- X
declare
C : constant Ada.Text_IO.Terminal.Colors.Color :=
Ada.Text_IO.Terminal.Colors.To_Color (
Ada.Colors.RGB'(
Red => Float (R1 * 4 + R2) / 7.0,
Blue => Float (B) / 7.0,
Green => Float (G) / 7.0));
begin
Ada.Text_IO.Terminal.Colors.Set_Color (Output, Background => +C);
Ada.Text_IO.Put (Output, " ");
end;
end loop;
Ada.Text_IO.Terminal.Colors.Reset_Color (Output);
if R2 < 3 then
Ada.Text_IO.Put (Output, " ");
end if;
end loop;
Ada.Text_IO.New_Line (Output);
end loop;
Ada.Text_IO.New_Line (Output);
end loop;
for L in 0 .. 25 loop -- grayscale
declare
C : constant Ada.Text_IO.Terminal.Colors.Color :=
Ada.Text_IO.Terminal.Colors.To_Grayscale_Color (Float (L) / 25.0);
begin
Ada.Text_IO.Terminal.Colors.Set_Color (Output, Background => +C);
Ada.Text_IO.Put (Output, " ");
end;
end loop;
Ada.Text_IO.Terminal.Colors.Reset_Color (Output);
Ada.Text_IO.New_Line;
end tty_color;
|
------------------------------------------------------------------------------
-- --
-- GNAT LIBRARY COMPONENTS --
-- --
-- ADA.CONTAINERS.UNBOUNDED_SYNCHRONIZED_QUEUES --
-- --
-- S p e c --
-- --
-- Copyright (C) 2011, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
-- apply solely to the contents of the part following the private keyword. --
-- --
-- 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. --
-- --
-- --
-- --
-- --
-- --
-- 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/>. --
-- --
-- This unit was originally developed by Matthew J Heaney. --
------------------------------------------------------------------------------
with System;
with Ada.Containers.Synchronized_Queue_Interfaces;
with Ada.Finalization;
generic
with package Queue_Interfaces is
new Ada.Containers.Synchronized_Queue_Interfaces (<>);
Default_Ceiling : System.Any_Priority := System.Priority'Last;
package Ada.Containers.Unbounded_Synchronized_Queues is
pragma Preelaborate;
package Implementation is
-- All identifiers in this unit are implementation defined
pragma Implementation_Defined;
type List_Type is tagged limited private;
procedure Enqueue
(List : in out List_Type;
New_Item : Queue_Interfaces.Element_Type);
procedure Dequeue
(List : in out List_Type;
Element : out Queue_Interfaces.Element_Type);
function Length (List : List_Type) return Count_Type;
function Max_Length (List : List_Type) return Count_Type;
private
type Node_Type;
type Node_Access is access Node_Type;
type Node_Type is limited record
Element : Queue_Interfaces.Element_Type;
Next : Node_Access;
end record;
type List_Type is new Ada.Finalization.Limited_Controlled with record
First, Last : Node_Access;
Length : Count_Type := 0;
Max_Length : Count_Type := 0;
end record;
overriding
procedure Finalize (List : in out List_Type);
end Implementation;
protected type Queue (Ceiling : System.Any_Priority := Default_Ceiling)
with Priority => Ceiling is new Queue_Interfaces.Queue with
overriding
entry Enqueue (New_Item : Queue_Interfaces.Element_Type);
overriding
entry Dequeue (Element : out Queue_Interfaces.Element_Type);
overriding
function Current_Use return Count_Type;
overriding
function Peak_Use return Count_Type;
private
List : Implementation.List_Type;
end Queue;
end Ada.Containers.Unbounded_Synchronized_Queues;
|
-- { dg-do run }
-- { dg-options "-gnatws" }
procedure Alignment13 is
type Rec is record
I1 : aliased Short_Integer;
I2 : Integer;
end record;
for Rec use record
I1 at 0 range 0 .. 15;
end record;
R : Rec;
begin
if R.I2'Bit_Position /= 32 then
raise Program_Error;
end if;
end;
|
------------------------------------------------------------------------------
-- --
-- GNU ADA 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 --
-- --
-- S p e c --
-- --
-- $Revision$
-- --
-- Copyright (C) 1992-2000, 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, 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. --
-- --
-- GNARL was developed by the GNARL team at Florida State University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This is a Solaris version of this package.
-- It was created by hand for use with new "checked"
-- GNULLI primitives.
-- This package provides low-level support for most tasking features.
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.OS_Interface;
-- used for mutex_t
-- cond_t
-- thread_t
package System.Task_Primitives is
pragma Preelaborate;
type Lock is limited private;
type Lock_Ptr is access all Lock;
-- Should be used for implementation of protected objects.
type RTS_Lock is limited private;
type RTS_Lock_Ptr is access all RTS_Lock;
-- Should be used inside the runtime system.
-- The difference between Lock and the RTS_Lock is that the later
-- one serves only as a semaphore so that do not check for
-- ceiling violations.
type Task_Body_Access is access procedure;
-- Pointer to the task body's entry point (or possibly a wrapper
-- declared local to the GNARL).
type Private_Data is limited private;
-- Any information that the GNULLI needs maintained on a per-task
-- basis. A component of this type is guaranteed to be included
-- in the Ada_Task_Control_Block.
private
type Private_Task_Serial_Number is mod 2 ** 64;
-- Used to give each task a unique serial number.
type Base_Lock is new System.OS_Interface.mutex_t;
type Owner_Int is new Integer;
for Owner_Int'Alignment use Standard'Maximum_Alignment;
type Owner_ID is access all Owner_Int;
type Lock is record
L : aliased Base_Lock;
Ceiling : System.Any_Priority := System.Any_Priority'First;
Saved_Priority : System.Any_Priority := System.Any_Priority'First;
Owner : Owner_ID;
Next : Lock_Ptr;
Level : Private_Task_Serial_Number := 0;
Buddy : Owner_ID;
Frozen : Boolean := False;
end record;
type RTS_Lock is new Lock;
-- Note that task support on gdb relies on the fact that the first
-- 2 fields of Private_Data are Thread and LWP.
type Private_Data is record
Thread : aliased System.OS_Interface.thread_t;
pragma Atomic (Thread);
-- Thread field may be updated by two different threads of control.
-- (See, Enter_Task and Create_Task in s-taprop.adb).
-- They put the same value (thr_self value). We do not want to
-- use lock on those operations and the only thing we have to
-- make sure is that they are updated in atomic fashion.
LWP : System.OS_Interface.lwpid_t;
-- The LWP id of the thread. Set by self in Enter_Task.
CV : aliased System.OS_Interface.cond_t;
L : aliased RTS_Lock;
-- protection for all components is lock L
Active_Priority : System.Any_Priority := System.Any_Priority'First;
-- Simulated active priority,
-- used only if Priority_Ceiling_Support is True.
Locking : Lock_Ptr;
Locks : Lock_Ptr;
Wakeups : Natural := 0;
end record;
end System.Task_Primitives;
|
package Inline6_Pkg is
procedure Test (I : Integer);
pragma Inline (Test);
end Inline6_Pkg;
|
--------------------------------------------------------------------------------
-- * Body name ctfft.adb
-- * Project name ctffttest
-- *
-- * Version 1.0
-- * Last update 11/5/08
-- *
-- * Created by Adrian Hoe on 11/5/08.
-- * Copyright (c) 2008 AdaStar Informatics http://adastarinformatics.com
-- * All rights reserved.
-- *
--------------------------------------------------------------------------------
with Ada.Text_Io, Ada.Integer_Text_Io;
use Ada.Text_Io, Ada.Integer_Text_Io;
with Ada.Numerics, Ada.Numerics.Generic_Elementary_Functions;
use Ada.Numerics;
with Vector;
use Vector, Vector.Complex_Types;
package body Ctfft is
package Math is new Ada.Numerics.Generic_Elementary_Functions (Real_Number);
use Math;
Two_Pi : constant := 2.0 * Pi;
procedure Swap (A, B : in out Complex_Number) is
T : Complex_Number;
begin
T := A;
A := B;
B := T;
end Swap;
procedure Scramble (Xc : in out Complex_Vector_Type) is
N, J, K : Integer;
begin
N := Xc'Length;
J := 1;
for I in 1 .. N - 1 loop
if I < J then
Put (I); Put (","); Put (J);
New_Line;
Swap (Xc (I), Xc (J));
end if;
K := N / 2;
while K < J loop
J := J - K;
K := K / 2;
end loop;
J := J + K;
end loop;
end Scramble;
procedure Compute_Fft (Xc : in out Complex_Vector_Type) is
M, N, I : Integer;
Xt, ω : Complex_Number;
φ : Real_Number;
begin
N := Xc'Length;
M := 1;
Put_Line (" M J I I+M");
Put_Line ("---------- ------------ ----------- -----------");
while M < N loop
for J in 1 .. M loop
φ := Two_Pi * Real_Number (J - 1) / Real_Number (2 * M);
ω := (Cos (φ), -Sin (φ));
I := J;
while I < N loop
Put (M); Put (","); Put (J); Put (","); Put (I); Put (","); Put (I + M);
New_Line;
Xt := Xc (I + M) * ω;
Xc (I + M) := Xc (I) - Xt;
Xc (I) := Xc (I) + Xt;
I := I + M * 2;
end loop;
end loop;
M := M * 2;
end loop;
end Compute_Fft;
procedure Fft (X : in out Real_Vector_Type) is
Xc : Complex_Vector_Type (X'Range);
R : constant Complex_Number := (1.0, 0.0);
begin
for I in X'Range loop
Xc (I) := R * X (I);
end loop;
Scramble (Xc);
Compute_Fft (Xc);
for I in X'Range loop
X (I) := abs Xc (I);
end loop;
end Fft;
end Ctfft;
|
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE boost_serialization>
<boost_serialization signature="serialization::archive" version="15">
<syndb class_id="0" tracking_level="0" version="0">
<userIPLatency>-1</userIPLatency>
<userIPName></userIPName>
<cdfg class_id="1" tracking_level="1" version="0" object_id="_0">
<name>checkAxis_2</name>
<ret_bitwidth>64</ret_bitwidth>
<ports class_id="2" tracking_level="0" version="0">
<count>6</count>
<item_version>0</item_version>
<item class_id="3" tracking_level="1" version="0" object_id="_1">
<Value class_id="4" tracking_level="0" version="0">
<Obj class_id="5" tracking_level="0" version="0">
<type>1</type>
<id>1</id>
<name>edge_p1_x</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo class_id="6" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<direction>0</direction>
<if_type>0</if_type>
<array_size>0</array_size>
<bit_vecs class_id="7" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_2">
<Value>
<Obj>
<type>1</type>
<id>2</id>
<name>edge_p1_y</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<direction>0</direction>
<if_type>0</if_type>
<array_size>0</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_3">
<Value>
<Obj>
<type>1</type>
<id>3</id>
<name>edge_p1_z</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<direction>0</direction>
<if_type>0</if_type>
<array_size>0</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_4">
<Value>
<Obj>
<type>1</type>
<id>4</id>
<name>edge_p2_x</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<direction>0</direction>
<if_type>0</if_type>
<array_size>0</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_5">
<Value>
<Obj>
<type>1</type>
<id>5</id>
<name>edge_p2_y</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<direction>0</direction>
<if_type>0</if_type>
<array_size>0</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_6">
<Value>
<Obj>
<type>1</type>
<id>6</id>
<name>edge_p2_z</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<direction>0</direction>
<if_type>0</if_type>
<array_size>0</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
</ports>
<nodes class_id="8" tracking_level="0" version="0">
<count>84</count>
<item_version>0</item_version>
<item class_id="9" tracking_level="1" version="0" object_id="_7">
<Value>
<Obj>
<type>0</type>
<id>8</id>
<name>edge_p2_z_read</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>108</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item class_id="10" tracking_level="0" version="0">
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second class_id="11" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="12" tracking_level="0" version="0">
<first class_id="13" tracking_level="0" version="0">
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>108</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>102</item>
<item>103</item>
</oprand_edges>
<opcode>read</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>1</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_8">
<Value>
<Obj>
<type>0</type>
<id>9</id>
<name>edge_p2_y_read</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>108</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>108</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>104</item>
<item>105</item>
</oprand_edges>
<opcode>read</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>2</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_9">
<Value>
<Obj>
<type>0</type>
<id>10</id>
<name>edge_p2_x_read</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>108</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>108</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>106</item>
<item>107</item>
</oprand_edges>
<opcode>read</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>3</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_10">
<Value>
<Obj>
<type>0</type>
<id>11</id>
<name>edge_p1_z_read</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>108</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>108</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>108</item>
<item>109</item>
</oprand_edges>
<opcode>read</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>4</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_11">
<Value>
<Obj>
<type>0</type>
<id>12</id>
<name>edge_p1_y_read</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>108</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>108</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>110</item>
<item>111</item>
</oprand_edges>
<opcode>read</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>5</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_12">
<Value>
<Obj>
<type>0</type>
<id>13</id>
<name>edge_p1_x_read</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>108</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>108</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>112</item>
<item>113</item>
</oprand_edges>
<opcode>read</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>6</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_13">
<Value>
<Obj>
<type>0</type>
<id>14</id>
<name>call_ret5</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>108</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>108</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>96</bitwidth>
</Value>
<oprand_edges>
<count>8</count>
<item_version>0</item_version>
<item>115</item>
<item>116</item>
<item>117</item>
<item>118</item>
<item>119</item>
<item>120</item>
<item>121</item>
<item>123</item>
</oprand_edges>
<opcode>call</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>8.58</m_delay>
<m_topoIndex>7</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_14">
<Value>
<Obj>
<type>0</type>
<id>15</id>
<name>p_0</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>108</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>108</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>124</item>
</oprand_edges>
<opcode>extractvalue</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>11</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_15">
<Value>
<Obj>
<type>0</type>
<id>16</id>
<name>p_1</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>108</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>108</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>125</item>
</oprand_edges>
<opcode>extractvalue</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>12</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_16">
<Value>
<Obj>
<type>0</type>
<id>17</id>
<name>p_2</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>108</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>108</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>126</item>
</oprand_edges>
<opcode>extractvalue</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>13</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_17">
<Value>
<Obj>
<type>0</type>
<id>18</id>
<name>tmp_s</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>109</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>109</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>10</count>
<item_version>0</item_version>
<item>128</item>
<item>129</item>
<item>130</item>
<item>131</item>
<item>132</item>
<item>133</item>
<item>134</item>
<item>135</item>
<item>136</item>
<item>137</item>
</oprand_edges>
<opcode>call</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>4.19</m_delay>
<m_topoIndex>23</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_18">
<Value>
<Obj>
<type>0</type>
<id>19</id>
<name>_ln109</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>109</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>109</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>138</item>
<item>139</item>
<item>140</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.46</m_delay>
<m_topoIndex>27</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_19">
<Value>
<Obj>
<type>0</type>
<id>21</id>
<name>i_assign</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>111</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>111</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>i</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>142</item>
<item>143</item>
</oprand_edges>
<opcode>call</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>7.59</m_delay>
<m_topoIndex>28</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_20">
<Value>
<Obj>
<type>0</type>
<id>22</id>
<name>j_assign</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>111</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>111</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>j</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>144</item>
<item>145</item>
</oprand_edges>
<opcode>call</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>7.59</m_delay>
<m_topoIndex>29</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_21">
<Value>
<Obj>
<type>0</type>
<id>23</id>
<name>shl_ln80</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>80</lineNumber>
<contextFuncName>shiftAmount</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>111</second>
</item>
<item>
<first>
<first>src/honeybee.c</first>
<second>shiftAmount</second>
</first>
<second>80</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>146</item>
<item>148</item>
</oprand_edges>
<opcode>shl</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>39</m_topoIndex>
<m_clusterGroupNumber>1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_22">
<Value>
<Obj>
<type>0</type>
<id>24</id>
<name>add_ln80</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>80</lineNumber>
<contextFuncName>shiftAmount</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>111</second>
</item>
<item>
<first>
<first>src/honeybee.c</first>
<second>shiftAmount</second>
</first>
<second>80</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>149</item>
<item>150</item>
</oprand_edges>
<opcode>add</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>1.89</m_delay>
<m_topoIndex>40</m_topoIndex>
<m_clusterGroupNumber>1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_23">
<Value>
<Obj>
<type>0</type>
<id>25</id>
<name>zext_ln111</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>111</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>111</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>151</item>
</oprand_edges>
<opcode>zext</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>41</m_topoIndex>
<m_clusterGroupNumber>2</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_24">
<Value>
<Obj>
<type>0</type>
<id>26</id>
<name>shl_ln111</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>111</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>111</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>153</item>
<item>154</item>
</oprand_edges>
<opcode>shl</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>42</m_topoIndex>
<m_clusterGroupNumber>2</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_25">
<Value>
<Obj>
<type>0</type>
<id>27</id>
<name>add_ln80_1</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>80</lineNumber>
<contextFuncName>shiftAmount</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>112</second>
</item>
<item>
<first>
<first>src/honeybee.c</first>
<second>shiftAmount</second>
</first>
<second>80</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>156</item>
<item>157</item>
</oprand_edges>
<opcode>add</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>1.89</m_delay>
<m_topoIndex>43</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_26">
<Value>
<Obj>
<type>0</type>
<id>28</id>
<name>zext_ln112</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>112</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>112</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>158</item>
</oprand_edges>
<opcode>zext</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>44</m_topoIndex>
<m_clusterGroupNumber>2</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_27">
<Value>
<Obj>
<type>0</type>
<id>29</id>
<name>shl_ln112</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>112</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>112</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>159</item>
<item>160</item>
</oprand_edges>
<opcode>shl</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>45</m_topoIndex>
<m_clusterGroupNumber>2</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_28">
<Value>
<Obj>
<type>0</type>
<id>30</id>
<name>or_ln112</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>112</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>112</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>161</item>
<item>162</item>
</oprand_edges>
<opcode>or</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>2.93</m_delay>
<m_topoIndex>46</m_topoIndex>
<m_clusterGroupNumber>2</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_29">
<Value>
<Obj>
<type>0</type>
<id>31</id>
<name>_ln113</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>113</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>113</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>163</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.46</m_delay>
<m_topoIndex>47</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_30">
<Value>
<Obj>
<type>0</type>
<id>33</id>
<name>collisions_load_0</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>112</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>112</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>164</item>
<item>165</item>
<item>167</item>
<item>168</item>
</oprand_edges>
<opcode>phi</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>48</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_31">
<Value>
<Obj>
<type>0</type>
<id>34</id>
<name>call_ret5_1</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>108</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>108</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>96</bitwidth>
</Value>
<oprand_edges>
<count>8</count>
<item_version>0</item_version>
<item>169</item>
<item>170</item>
<item>171</item>
<item>172</item>
<item>173</item>
<item>174</item>
<item>175</item>
<item>177</item>
</oprand_edges>
<opcode>call</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>8.58</m_delay>
<m_topoIndex>8</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_32">
<Value>
<Obj>
<type>0</type>
<id>35</id>
<name>p_0_0_1</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>108</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>108</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>178</item>
</oprand_edges>
<opcode>extractvalue</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>14</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_33">
<Value>
<Obj>
<type>0</type>
<id>36</id>
<name>p_1_0_1</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>108</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>108</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>179</item>
</oprand_edges>
<opcode>extractvalue</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>15</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_34">
<Value>
<Obj>
<type>0</type>
<id>37</id>
<name>p_2_0_1</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>108</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>108</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>180</item>
</oprand_edges>
<opcode>extractvalue</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>16</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_35">
<Value>
<Obj>
<type>0</type>
<id>38</id>
<name>tmp_1</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>109</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>109</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>10</count>
<item_version>0</item_version>
<item>181</item>
<item>182</item>
<item>183</item>
<item>184</item>
<item>185</item>
<item>186</item>
<item>187</item>
<item>188</item>
<item>189</item>
<item>190</item>
</oprand_edges>
<opcode>call</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>4.19</m_delay>
<m_topoIndex>24</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_36">
<Value>
<Obj>
<type>0</type>
<id>39</id>
<name>_ln109</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>109</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>109</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>191</item>
<item>192</item>
<item>193</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.46</m_delay>
<m_topoIndex>30</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_37">
<Value>
<Obj>
<type>0</type>
<id>41</id>
<name>i_assign_1</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>111</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>111</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>i</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>194</item>
<item>195</item>
</oprand_edges>
<opcode>call</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>7.59</m_delay>
<m_topoIndex>31</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_38">
<Value>
<Obj>
<type>0</type>
<id>42</id>
<name>j_assign_1</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>111</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>111</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>j</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>196</item>
<item>197</item>
</oprand_edges>
<opcode>call</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>7.59</m_delay>
<m_topoIndex>32</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_39">
<Value>
<Obj>
<type>0</type>
<id>43</id>
<name>shl_ln80_1</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>80</lineNumber>
<contextFuncName>shiftAmount</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>111</second>
</item>
<item>
<first>
<first>src/honeybee.c</first>
<second>shiftAmount</second>
</first>
<second>80</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>198</item>
<item>199</item>
</oprand_edges>
<opcode>shl</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>49</m_topoIndex>
<m_clusterGroupNumber>3</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_40">
<Value>
<Obj>
<type>0</type>
<id>44</id>
<name>add_ln80_2</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>80</lineNumber>
<contextFuncName>shiftAmount</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>111</second>
</item>
<item>
<first>
<first>src/honeybee.c</first>
<second>shiftAmount</second>
</first>
<second>80</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>200</item>
<item>201</item>
</oprand_edges>
<opcode>add</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>1.89</m_delay>
<m_topoIndex>50</m_topoIndex>
<m_clusterGroupNumber>3</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_41">
<Value>
<Obj>
<type>0</type>
<id>45</id>
<name>add_ln80_3</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>80</lineNumber>
<contextFuncName>shiftAmount</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>111</second>
</item>
<item>
<first>
<first>src/honeybee.c</first>
<second>shiftAmount</second>
</first>
<second>80</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>203</item>
<item>204</item>
</oprand_edges>
<opcode>add</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>1.89</m_delay>
<m_topoIndex>51</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_42">
<Value>
<Obj>
<type>0</type>
<id>46</id>
<name>zext_ln111_1</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>111</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>111</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>205</item>
</oprand_edges>
<opcode>zext</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>52</m_topoIndex>
<m_clusterGroupNumber>4</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_43">
<Value>
<Obj>
<type>0</type>
<id>47</id>
<name>shl_ln111_1</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>111</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>111</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>206</item>
<item>207</item>
</oprand_edges>
<opcode>shl</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>53</m_topoIndex>
<m_clusterGroupNumber>4</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_44">
<Value>
<Obj>
<type>0</type>
<id>48</id>
<name>zext_ln112_1</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>112</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>112</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>208</item>
</oprand_edges>
<opcode>zext</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>54</m_topoIndex>
<m_clusterGroupNumber>4</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_45">
<Value>
<Obj>
<type>0</type>
<id>49</id>
<name>shl_ln112_1</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>112</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>112</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>209</item>
<item>210</item>
</oprand_edges>
<opcode>shl</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>55</m_topoIndex>
<m_clusterGroupNumber>4</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_46">
<Value>
<Obj>
<type>0</type>
<id>50</id>
<name>or_ln112_1</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>112</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>112</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>211</item>
<item>212</item>
</oprand_edges>
<opcode>or</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>2.93</m_delay>
<m_topoIndex>56</m_topoIndex>
<m_clusterGroupNumber>4</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_47">
<Value>
<Obj>
<type>0</type>
<id>51</id>
<name>_ln113</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>113</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>113</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>213</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.46</m_delay>
<m_topoIndex>57</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_48">
<Value>
<Obj>
<type>0</type>
<id>53</id>
<name>collisions_load_1</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>112</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>112</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>214</item>
<item>215</item>
<item>216</item>
<item>217</item>
</oprand_edges>
<opcode>phi</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>58</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_49">
<Value>
<Obj>
<type>0</type>
<id>54</id>
<name>call_ret5_2</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>108</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>108</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>96</bitwidth>
</Value>
<oprand_edges>
<count>8</count>
<item_version>0</item_version>
<item>218</item>
<item>219</item>
<item>220</item>
<item>221</item>
<item>222</item>
<item>223</item>
<item>224</item>
<item>226</item>
</oprand_edges>
<opcode>call</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>8.58</m_delay>
<m_topoIndex>9</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_50">
<Value>
<Obj>
<type>0</type>
<id>55</id>
<name>p_0_0_2</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>108</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>108</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>227</item>
</oprand_edges>
<opcode>extractvalue</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>17</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_51">
<Value>
<Obj>
<type>0</type>
<id>56</id>
<name>p_1_0_2</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>108</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>108</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>228</item>
</oprand_edges>
<opcode>extractvalue</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>18</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_52">
<Value>
<Obj>
<type>0</type>
<id>57</id>
<name>p_2_0_2</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>108</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>108</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>229</item>
</oprand_edges>
<opcode>extractvalue</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>19</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_53">
<Value>
<Obj>
<type>0</type>
<id>58</id>
<name>tmp_2</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>109</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>109</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>10</count>
<item_version>0</item_version>
<item>230</item>
<item>231</item>
<item>232</item>
<item>233</item>
<item>234</item>
<item>235</item>
<item>236</item>
<item>237</item>
<item>238</item>
<item>239</item>
</oprand_edges>
<opcode>call</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>4.19</m_delay>
<m_topoIndex>25</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_54">
<Value>
<Obj>
<type>0</type>
<id>59</id>
<name>_ln109</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>109</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>109</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>240</item>
<item>241</item>
<item>242</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.46</m_delay>
<m_topoIndex>33</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_55">
<Value>
<Obj>
<type>0</type>
<id>61</id>
<name>i_assign_2</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>111</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>111</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>i</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>243</item>
<item>244</item>
</oprand_edges>
<opcode>call</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>7.59</m_delay>
<m_topoIndex>34</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_56">
<Value>
<Obj>
<type>0</type>
<id>62</id>
<name>j_assign_2</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>111</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>111</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>j</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>245</item>
<item>246</item>
</oprand_edges>
<opcode>call</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>7.59</m_delay>
<m_topoIndex>35</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_57">
<Value>
<Obj>
<type>0</type>
<id>63</id>
<name>shl_ln80_2</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>80</lineNumber>
<contextFuncName>shiftAmount</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>111</second>
</item>
<item>
<first>
<first>src/honeybee.c</first>
<second>shiftAmount</second>
</first>
<second>80</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>247</item>
<item>248</item>
</oprand_edges>
<opcode>shl</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>59</m_topoIndex>
<m_clusterGroupNumber>5</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_58">
<Value>
<Obj>
<type>0</type>
<id>64</id>
<name>add_ln80_4</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>80</lineNumber>
<contextFuncName>shiftAmount</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>111</second>
</item>
<item>
<first>
<first>src/honeybee.c</first>
<second>shiftAmount</second>
</first>
<second>80</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>249</item>
<item>250</item>
</oprand_edges>
<opcode>add</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>1.89</m_delay>
<m_topoIndex>60</m_topoIndex>
<m_clusterGroupNumber>5</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_59">
<Value>
<Obj>
<type>0</type>
<id>65</id>
<name>add_ln80_5</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>80</lineNumber>
<contextFuncName>shiftAmount</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>111</second>
</item>
<item>
<first>
<first>src/honeybee.c</first>
<second>shiftAmount</second>
</first>
<second>80</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>252</item>
<item>253</item>
</oprand_edges>
<opcode>add</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>1.89</m_delay>
<m_topoIndex>61</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_60">
<Value>
<Obj>
<type>0</type>
<id>66</id>
<name>zext_ln111_2</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>111</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>111</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>254</item>
</oprand_edges>
<opcode>zext</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>62</m_topoIndex>
<m_clusterGroupNumber>6</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_61">
<Value>
<Obj>
<type>0</type>
<id>67</id>
<name>shl_ln111_2</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>111</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>111</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>255</item>
<item>256</item>
</oprand_edges>
<opcode>shl</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>63</m_topoIndex>
<m_clusterGroupNumber>6</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_62">
<Value>
<Obj>
<type>0</type>
<id>68</id>
<name>add_ln80_6</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>80</lineNumber>
<contextFuncName>shiftAmount</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>112</second>
</item>
<item>
<first>
<first>src/honeybee.c</first>
<second>shiftAmount</second>
</first>
<second>80</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>257</item>
<item>258</item>
</oprand_edges>
<opcode>add</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>1.89</m_delay>
<m_topoIndex>64</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_63">
<Value>
<Obj>
<type>0</type>
<id>69</id>
<name>zext_ln112_2</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>112</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>112</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>259</item>
</oprand_edges>
<opcode>zext</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>65</m_topoIndex>
<m_clusterGroupNumber>6</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_64">
<Value>
<Obj>
<type>0</type>
<id>70</id>
<name>shl_ln112_2</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>112</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>112</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>260</item>
<item>261</item>
</oprand_edges>
<opcode>shl</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>66</m_topoIndex>
<m_clusterGroupNumber>6</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_65">
<Value>
<Obj>
<type>0</type>
<id>71</id>
<name>or_ln112_2</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>112</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>112</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>262</item>
<item>263</item>
</oprand_edges>
<opcode>or</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>2.93</m_delay>
<m_topoIndex>67</m_topoIndex>
<m_clusterGroupNumber>6</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_66">
<Value>
<Obj>
<type>0</type>
<id>72</id>
<name>_ln113</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>113</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>113</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>264</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.46</m_delay>
<m_topoIndex>68</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_67">
<Value>
<Obj>
<type>0</type>
<id>74</id>
<name>collisions_load_2</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>112</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>112</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>276</item>
<item>277</item>
<item>278</item>
<item>279</item>
</oprand_edges>
<opcode>phi</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>69</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_68">
<Value>
<Obj>
<type>0</type>
<id>75</id>
<name>call_ret5_3</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>108</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>108</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>96</bitwidth>
</Value>
<oprand_edges>
<count>8</count>
<item_version>0</item_version>
<item>280</item>
<item>281</item>
<item>282</item>
<item>283</item>
<item>284</item>
<item>285</item>
<item>286</item>
<item>288</item>
</oprand_edges>
<opcode>call</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>8.58</m_delay>
<m_topoIndex>10</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_69">
<Value>
<Obj>
<type>0</type>
<id>76</id>
<name>p_0_0_3</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>108</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>108</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>289</item>
</oprand_edges>
<opcode>extractvalue</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>20</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_70">
<Value>
<Obj>
<type>0</type>
<id>77</id>
<name>p_1_0_3</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>108</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>108</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>290</item>
</oprand_edges>
<opcode>extractvalue</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>21</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_71">
<Value>
<Obj>
<type>0</type>
<id>78</id>
<name>p_2_0_3</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>108</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>108</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>291</item>
</oprand_edges>
<opcode>extractvalue</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>22</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_72">
<Value>
<Obj>
<type>0</type>
<id>79</id>
<name>tmp_3</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>109</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>109</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>10</count>
<item_version>0</item_version>
<item>292</item>
<item>293</item>
<item>294</item>
<item>295</item>
<item>296</item>
<item>297</item>
<item>298</item>
<item>299</item>
<item>300</item>
<item>301</item>
</oprand_edges>
<opcode>call</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>4.19</m_delay>
<m_topoIndex>26</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_73">
<Value>
<Obj>
<type>0</type>
<id>80</id>
<name>_ln109</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>109</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>109</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>302</item>
<item>303</item>
<item>304</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.46</m_delay>
<m_topoIndex>36</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_74">
<Value>
<Obj>
<type>0</type>
<id>82</id>
<name>i_assign_3</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>111</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>111</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>i</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>305</item>
<item>306</item>
</oprand_edges>
<opcode>call</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>7.59</m_delay>
<m_topoIndex>37</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_75">
<Value>
<Obj>
<type>0</type>
<id>83</id>
<name>j_assign_3</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>111</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>111</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>j</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>307</item>
<item>308</item>
</oprand_edges>
<opcode>call</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>7.59</m_delay>
<m_topoIndex>38</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_76">
<Value>
<Obj>
<type>0</type>
<id>84</id>
<name>shl_ln80_3</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>80</lineNumber>
<contextFuncName>shiftAmount</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>111</second>
</item>
<item>
<first>
<first>src/honeybee.c</first>
<second>shiftAmount</second>
</first>
<second>80</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>309</item>
<item>310</item>
</oprand_edges>
<opcode>shl</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>70</m_topoIndex>
<m_clusterGroupNumber>7</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_77">
<Value>
<Obj>
<type>0</type>
<id>85</id>
<name>add_ln80_7</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>80</lineNumber>
<contextFuncName>shiftAmount</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>111</second>
</item>
<item>
<first>
<first>src/honeybee.c</first>
<second>shiftAmount</second>
</first>
<second>80</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>311</item>
<item>312</item>
</oprand_edges>
<opcode>add</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>1.89</m_delay>
<m_topoIndex>71</m_topoIndex>
<m_clusterGroupNumber>7</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_78">
<Value>
<Obj>
<type>0</type>
<id>86</id>
<name>add_ln80_8</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>80</lineNumber>
<contextFuncName>shiftAmount</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>111</second>
</item>
<item>
<first>
<first>src/honeybee.c</first>
<second>shiftAmount</second>
</first>
<second>80</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>314</item>
<item>315</item>
</oprand_edges>
<opcode>add</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>1.89</m_delay>
<m_topoIndex>72</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_79">
<Value>
<Obj>
<type>0</type>
<id>87</id>
<name>zext_ln111_3</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>111</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>111</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>316</item>
</oprand_edges>
<opcode>zext</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>73</m_topoIndex>
<m_clusterGroupNumber>8</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_80">
<Value>
<Obj>
<type>0</type>
<id>88</id>
<name>shl_ln111_3</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>111</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>111</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>317</item>
<item>318</item>
</oprand_edges>
<opcode>shl</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>74</m_topoIndex>
<m_clusterGroupNumber>8</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_81">
<Value>
<Obj>
<type>0</type>
<id>89</id>
<name>add_ln80_9</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>80</lineNumber>
<contextFuncName>shiftAmount</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>112</second>
</item>
<item>
<first>
<first>src/honeybee.c</first>
<second>shiftAmount</second>
</first>
<second>80</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>319</item>
<item>320</item>
</oprand_edges>
<opcode>add</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>1.89</m_delay>
<m_topoIndex>75</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_82">
<Value>
<Obj>
<type>0</type>
<id>90</id>
<name>zext_ln112_3</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>112</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>112</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>321</item>
</oprand_edges>
<opcode>zext</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>76</m_topoIndex>
<m_clusterGroupNumber>8</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_83">
<Value>
<Obj>
<type>0</type>
<id>91</id>
<name>shl_ln112_3</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>112</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>112</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>322</item>
<item>323</item>
</oprand_edges>
<opcode>shl</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>77</m_topoIndex>
<m_clusterGroupNumber>8</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_84">
<Value>
<Obj>
<type>0</type>
<id>92</id>
<name>or_ln112_3</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>112</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>112</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>324</item>
<item>325</item>
</oprand_edges>
<opcode>or</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>2.93</m_delay>
<m_topoIndex>78</m_topoIndex>
<m_clusterGroupNumber>8</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_85">
<Value>
<Obj>
<type>0</type>
<id>93</id>
<name>_ln113</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>113</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>113</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>326</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.46</m_delay>
<m_topoIndex>79</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_86">
<Value>
<Obj>
<type>0</type>
<id>95</id>
<name>collisions_load_3</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>112</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>112</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>265</item>
<item>266</item>
<item>267</item>
<item>268</item>
</oprand_edges>
<opcode>phi</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>80</m_topoIndex>
<m_clusterGroupNumber>9</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_87">
<Value>
<Obj>
<type>0</type>
<id>96</id>
<name>or_ln139</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>139</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>139</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>269</item>
<item>270</item>
</oprand_edges>
<opcode>or</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>81</m_topoIndex>
<m_clusterGroupNumber>9</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_88">
<Value>
<Obj>
<type>0</type>
<id>97</id>
<name>or_ln139_1</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>139</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>139</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>271</item>
<item>272</item>
</oprand_edges>
<opcode>or</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>82</m_topoIndex>
<m_clusterGroupNumber>9</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_89">
<Value>
<Obj>
<type>0</type>
<id>98</id>
<name>or_ln139_2</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>139</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>139</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>273</item>
<item>274</item>
</oprand_edges>
<opcode>or</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.80</m_delay>
<m_topoIndex>83</m_topoIndex>
<m_clusterGroupNumber>9</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_90">
<Value>
<Obj>
<type>0</type>
<id>99</id>
<name>_ln141</name>
<fileName>src/honeybee.c</fileName>
<fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory>
<lineNumber>141</lineNumber>
<contextFuncName>checkAxis</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/hgfs/Thesis/HoneyBee</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/honeybee.c</first>
<second>checkAxis</second>
</first>
<second>141</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>275</item>
</oprand_edges>
<opcode>ret</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>84</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
</nodes>
<consts class_id="15" tracking_level="0" version="0">
<count>14</count>
<item_version>0</item_version>
<item class_id="16" tracking_level="1" version="0" object_id="_91">
<Value>
<Obj>
<type>2</type>
<id>114</id>
<name>lineIntersectsPlane</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>96</bitwidth>
</Value>
<const_type>6</const_type>
<content><constant:lineIntersectsPlane></content>
</item>
<item class_id_reference="16" object_id="_92">
<Value>
<Obj>
<type>2</type>
<id>122</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<const_type>1</const_type>
<content>0</content>
</item>
<item class_id_reference="16" object_id="_93">
<Value>
<Obj>
<type>2</type>
<id>127</id>
<name>pointOnSegment</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<const_type>6</const_type>
<content><constant:pointOnSegment></content>
</item>
<item class_id_reference="16" object_id="_94">
<Value>
<Obj>
<type>2</type>
<id>141</id>
<name>p_hls_fptosi_float_i</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<const_type>6</const_type>
<content><constant:__hls_fptosi_float_i></content>
</item>
<item class_id_reference="16" object_id="_95">
<Value>
<Obj>
<type>2</type>
<id>147</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>2</content>
</item>
<item class_id_reference="16" object_id="_96">
<Value>
<Obj>
<type>2</type>
<id>152</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<const_type>0</const_type>
<content>1</content>
</item>
<item class_id_reference="16" object_id="_97">
<Value>
<Obj>
<type>2</type>
<id>155</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>4294967280</content>
</item>
<item class_id_reference="16" object_id="_98">
<Value>
<Obj>
<type>2</type>
<id>166</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<const_type>0</const_type>
<content>0</content>
</item>
<item class_id_reference="16" object_id="_99">
<Value>
<Obj>
<type>2</type>
<id>176</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<const_type>1</const_type>
<content>1</content>
</item>
<item class_id_reference="16" object_id="_100">
<Value>
<Obj>
<type>2</type>
<id>202</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>16</content>
</item>
<item class_id_reference="16" object_id="_101">
<Value>
<Obj>
<type>2</type>
<id>225</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<const_type>1</const_type>
<content>2</content>
</item>
<item class_id_reference="16" object_id="_102">
<Value>
<Obj>
<type>2</type>
<id>251</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>32</content>
</item>
<item class_id_reference="16" object_id="_103">
<Value>
<Obj>
<type>2</type>
<id>287</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<const_type>1</const_type>
<content>3</content>
</item>
<item class_id_reference="16" object_id="_104">
<Value>
<Obj>
<type>2</type>
<id>313</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>48</content>
</item>
</consts>
<blocks class_id="17" tracking_level="0" version="0">
<count>9</count>
<item_version>0</item_version>
<item class_id="18" tracking_level="1" version="0" object_id="_105">
<Obj>
<type>3</type>
<id>20</id>
<name>meminst.0</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>12</count>
<item_version>0</item_version>
<item>8</item>
<item>9</item>
<item>10</item>
<item>11</item>
<item>12</item>
<item>13</item>
<item>14</item>
<item>15</item>
<item>16</item>
<item>17</item>
<item>18</item>
<item>19</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_106">
<Obj>
<type>3</type>
<id>32</id>
<name></name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>11</count>
<item_version>0</item_version>
<item>21</item>
<item>22</item>
<item>23</item>
<item>24</item>
<item>25</item>
<item>26</item>
<item>27</item>
<item>28</item>
<item>29</item>
<item>30</item>
<item>31</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_107">
<Obj>
<type>3</type>
<id>40</id>
<name>._crit_edge20.0</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>7</count>
<item_version>0</item_version>
<item>33</item>
<item>34</item>
<item>35</item>
<item>36</item>
<item>37</item>
<item>38</item>
<item>39</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_108">
<Obj>
<type>3</type>
<id>52</id>
<name></name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>11</count>
<item_version>0</item_version>
<item>41</item>
<item>42</item>
<item>43</item>
<item>44</item>
<item>45</item>
<item>46</item>
<item>47</item>
<item>48</item>
<item>49</item>
<item>50</item>
<item>51</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_109">
<Obj>
<type>3</type>
<id>60</id>
<name>._crit_edge20.1</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>7</count>
<item_version>0</item_version>
<item>53</item>
<item>54</item>
<item>55</item>
<item>56</item>
<item>57</item>
<item>58</item>
<item>59</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_110">
<Obj>
<type>3</type>
<id>73</id>
<name></name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>12</count>
<item_version>0</item_version>
<item>61</item>
<item>62</item>
<item>63</item>
<item>64</item>
<item>65</item>
<item>66</item>
<item>67</item>
<item>68</item>
<item>69</item>
<item>70</item>
<item>71</item>
<item>72</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_111">
<Obj>
<type>3</type>
<id>81</id>
<name>._crit_edge20.2</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>7</count>
<item_version>0</item_version>
<item>74</item>
<item>75</item>
<item>76</item>
<item>77</item>
<item>78</item>
<item>79</item>
<item>80</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_112">
<Obj>
<type>3</type>
<id>94</id>
<name></name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>12</count>
<item_version>0</item_version>
<item>82</item>
<item>83</item>
<item>84</item>
<item>85</item>
<item>86</item>
<item>87</item>
<item>88</item>
<item>89</item>
<item>90</item>
<item>91</item>
<item>92</item>
<item>93</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_113">
<Obj>
<type>3</type>
<id>100</id>
<name>.preheader.preheader</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>5</count>
<item_version>0</item_version>
<item>95</item>
<item>96</item>
<item>97</item>
<item>98</item>
<item>99</item>
</node_objs>
</item>
</blocks>
<edges class_id="19" tracking_level="0" version="0">
<count>217</count>
<item_version>0</item_version>
<item class_id="20" tracking_level="1" version="0" object_id="_114">
<id>103</id>
<edge_type>1</edge_type>
<source_obj>6</source_obj>
<sink_obj>8</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_115">
<id>105</id>
<edge_type>1</edge_type>
<source_obj>5</source_obj>
<sink_obj>9</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_116">
<id>107</id>
<edge_type>1</edge_type>
<source_obj>4</source_obj>
<sink_obj>10</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_117">
<id>109</id>
<edge_type>1</edge_type>
<source_obj>3</source_obj>
<sink_obj>11</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_118">
<id>111</id>
<edge_type>1</edge_type>
<source_obj>2</source_obj>
<sink_obj>12</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_119">
<id>113</id>
<edge_type>1</edge_type>
<source_obj>1</source_obj>
<sink_obj>13</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_120">
<id>115</id>
<edge_type>1</edge_type>
<source_obj>114</source_obj>
<sink_obj>14</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_121">
<id>116</id>
<edge_type>1</edge_type>
<source_obj>13</source_obj>
<sink_obj>14</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_122">
<id>117</id>
<edge_type>1</edge_type>
<source_obj>12</source_obj>
<sink_obj>14</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_123">
<id>118</id>
<edge_type>1</edge_type>
<source_obj>11</source_obj>
<sink_obj>14</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_124">
<id>119</id>
<edge_type>1</edge_type>
<source_obj>10</source_obj>
<sink_obj>14</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_125">
<id>120</id>
<edge_type>1</edge_type>
<source_obj>9</source_obj>
<sink_obj>14</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_126">
<id>121</id>
<edge_type>1</edge_type>
<source_obj>8</source_obj>
<sink_obj>14</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_127">
<id>123</id>
<edge_type>1</edge_type>
<source_obj>122</source_obj>
<sink_obj>14</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_128">
<id>124</id>
<edge_type>1</edge_type>
<source_obj>14</source_obj>
<sink_obj>15</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_129">
<id>125</id>
<edge_type>1</edge_type>
<source_obj>14</source_obj>
<sink_obj>16</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_130">
<id>126</id>
<edge_type>1</edge_type>
<source_obj>14</source_obj>
<sink_obj>17</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_131">
<id>128</id>
<edge_type>1</edge_type>
<source_obj>127</source_obj>
<sink_obj>18</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_132">
<id>129</id>
<edge_type>1</edge_type>
<source_obj>15</source_obj>
<sink_obj>18</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_133">
<id>130</id>
<edge_type>1</edge_type>
<source_obj>16</source_obj>
<sink_obj>18</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_134">
<id>131</id>
<edge_type>1</edge_type>
<source_obj>17</source_obj>
<sink_obj>18</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_135">
<id>132</id>
<edge_type>1</edge_type>
<source_obj>13</source_obj>
<sink_obj>18</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_136">
<id>133</id>
<edge_type>1</edge_type>
<source_obj>12</source_obj>
<sink_obj>18</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_137">
<id>134</id>
<edge_type>1</edge_type>
<source_obj>11</source_obj>
<sink_obj>18</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_138">
<id>135</id>
<edge_type>1</edge_type>
<source_obj>10</source_obj>
<sink_obj>18</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_139">
<id>136</id>
<edge_type>1</edge_type>
<source_obj>9</source_obj>
<sink_obj>18</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_140">
<id>137</id>
<edge_type>1</edge_type>
<source_obj>8</source_obj>
<sink_obj>18</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_141">
<id>138</id>
<edge_type>1</edge_type>
<source_obj>18</source_obj>
<sink_obj>19</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_142">
<id>139</id>
<edge_type>2</edge_type>
<source_obj>40</source_obj>
<sink_obj>19</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_143">
<id>140</id>
<edge_type>2</edge_type>
<source_obj>32</source_obj>
<sink_obj>19</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_144">
<id>142</id>
<edge_type>1</edge_type>
<source_obj>141</source_obj>
<sink_obj>21</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_145">
<id>143</id>
<edge_type>1</edge_type>
<source_obj>15</source_obj>
<sink_obj>21</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_146">
<id>144</id>
<edge_type>1</edge_type>
<source_obj>141</source_obj>
<sink_obj>22</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_147">
<id>145</id>
<edge_type>1</edge_type>
<source_obj>16</source_obj>
<sink_obj>22</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_148">
<id>146</id>
<edge_type>1</edge_type>
<source_obj>22</source_obj>
<sink_obj>23</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_149">
<id>148</id>
<edge_type>1</edge_type>
<source_obj>147</source_obj>
<sink_obj>23</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_150">
<id>149</id>
<edge_type>1</edge_type>
<source_obj>23</source_obj>
<sink_obj>24</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_151">
<id>150</id>
<edge_type>1</edge_type>
<source_obj>21</source_obj>
<sink_obj>24</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_152">
<id>151</id>
<edge_type>1</edge_type>
<source_obj>24</source_obj>
<sink_obj>25</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_153">
<id>153</id>
<edge_type>1</edge_type>
<source_obj>152</source_obj>
<sink_obj>26</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_154">
<id>154</id>
<edge_type>1</edge_type>
<source_obj>25</source_obj>
<sink_obj>26</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_155">
<id>156</id>
<edge_type>1</edge_type>
<source_obj>155</source_obj>
<sink_obj>27</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_156">
<id>157</id>
<edge_type>1</edge_type>
<source_obj>24</source_obj>
<sink_obj>27</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_157">
<id>158</id>
<edge_type>1</edge_type>
<source_obj>27</source_obj>
<sink_obj>28</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_158">
<id>159</id>
<edge_type>1</edge_type>
<source_obj>152</source_obj>
<sink_obj>29</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_159">
<id>160</id>
<edge_type>1</edge_type>
<source_obj>28</source_obj>
<sink_obj>29</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_160">
<id>161</id>
<edge_type>1</edge_type>
<source_obj>29</source_obj>
<sink_obj>30</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_161">
<id>162</id>
<edge_type>1</edge_type>
<source_obj>26</source_obj>
<sink_obj>30</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_162">
<id>163</id>
<edge_type>2</edge_type>
<source_obj>40</source_obj>
<sink_obj>31</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_163">
<id>164</id>
<edge_type>1</edge_type>
<source_obj>30</source_obj>
<sink_obj>33</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_164">
<id>165</id>
<edge_type>2</edge_type>
<source_obj>32</source_obj>
<sink_obj>33</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_165">
<id>167</id>
<edge_type>1</edge_type>
<source_obj>166</source_obj>
<sink_obj>33</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_166">
<id>168</id>
<edge_type>2</edge_type>
<source_obj>20</source_obj>
<sink_obj>33</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_167">
<id>169</id>
<edge_type>1</edge_type>
<source_obj>114</source_obj>
<sink_obj>34</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_168">
<id>170</id>
<edge_type>1</edge_type>
<source_obj>13</source_obj>
<sink_obj>34</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_169">
<id>171</id>
<edge_type>1</edge_type>
<source_obj>12</source_obj>
<sink_obj>34</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_170">
<id>172</id>
<edge_type>1</edge_type>
<source_obj>11</source_obj>
<sink_obj>34</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_171">
<id>173</id>
<edge_type>1</edge_type>
<source_obj>10</source_obj>
<sink_obj>34</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_172">
<id>174</id>
<edge_type>1</edge_type>
<source_obj>9</source_obj>
<sink_obj>34</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_173">
<id>175</id>
<edge_type>1</edge_type>
<source_obj>8</source_obj>
<sink_obj>34</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_174">
<id>177</id>
<edge_type>1</edge_type>
<source_obj>176</source_obj>
<sink_obj>34</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_175">
<id>178</id>
<edge_type>1</edge_type>
<source_obj>34</source_obj>
<sink_obj>35</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_176">
<id>179</id>
<edge_type>1</edge_type>
<source_obj>34</source_obj>
<sink_obj>36</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_177">
<id>180</id>
<edge_type>1</edge_type>
<source_obj>34</source_obj>
<sink_obj>37</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_178">
<id>181</id>
<edge_type>1</edge_type>
<source_obj>127</source_obj>
<sink_obj>38</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_179">
<id>182</id>
<edge_type>1</edge_type>
<source_obj>35</source_obj>
<sink_obj>38</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_180">
<id>183</id>
<edge_type>1</edge_type>
<source_obj>36</source_obj>
<sink_obj>38</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_181">
<id>184</id>
<edge_type>1</edge_type>
<source_obj>37</source_obj>
<sink_obj>38</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_182">
<id>185</id>
<edge_type>1</edge_type>
<source_obj>13</source_obj>
<sink_obj>38</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_183">
<id>186</id>
<edge_type>1</edge_type>
<source_obj>12</source_obj>
<sink_obj>38</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_184">
<id>187</id>
<edge_type>1</edge_type>
<source_obj>11</source_obj>
<sink_obj>38</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_185">
<id>188</id>
<edge_type>1</edge_type>
<source_obj>10</source_obj>
<sink_obj>38</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_186">
<id>189</id>
<edge_type>1</edge_type>
<source_obj>9</source_obj>
<sink_obj>38</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_187">
<id>190</id>
<edge_type>1</edge_type>
<source_obj>8</source_obj>
<sink_obj>38</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_188">
<id>191</id>
<edge_type>1</edge_type>
<source_obj>38</source_obj>
<sink_obj>39</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_189">
<id>192</id>
<edge_type>2</edge_type>
<source_obj>60</source_obj>
<sink_obj>39</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_190">
<id>193</id>
<edge_type>2</edge_type>
<source_obj>52</source_obj>
<sink_obj>39</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_191">
<id>194</id>
<edge_type>1</edge_type>
<source_obj>141</source_obj>
<sink_obj>41</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_192">
<id>195</id>
<edge_type>1</edge_type>
<source_obj>35</source_obj>
<sink_obj>41</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_193">
<id>196</id>
<edge_type>1</edge_type>
<source_obj>141</source_obj>
<sink_obj>42</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_194">
<id>197</id>
<edge_type>1</edge_type>
<source_obj>36</source_obj>
<sink_obj>42</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_195">
<id>198</id>
<edge_type>1</edge_type>
<source_obj>42</source_obj>
<sink_obj>43</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_196">
<id>199</id>
<edge_type>1</edge_type>
<source_obj>147</source_obj>
<sink_obj>43</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_197">
<id>200</id>
<edge_type>1</edge_type>
<source_obj>43</source_obj>
<sink_obj>44</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_198">
<id>201</id>
<edge_type>1</edge_type>
<source_obj>41</source_obj>
<sink_obj>44</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_199">
<id>203</id>
<edge_type>1</edge_type>
<source_obj>202</source_obj>
<sink_obj>45</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_200">
<id>204</id>
<edge_type>1</edge_type>
<source_obj>44</source_obj>
<sink_obj>45</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_201">
<id>205</id>
<edge_type>1</edge_type>
<source_obj>45</source_obj>
<sink_obj>46</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_202">
<id>206</id>
<edge_type>1</edge_type>
<source_obj>152</source_obj>
<sink_obj>47</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_203">
<id>207</id>
<edge_type>1</edge_type>
<source_obj>46</source_obj>
<sink_obj>47</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_204">
<id>208</id>
<edge_type>1</edge_type>
<source_obj>44</source_obj>
<sink_obj>48</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_205">
<id>209</id>
<edge_type>1</edge_type>
<source_obj>152</source_obj>
<sink_obj>49</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_206">
<id>210</id>
<edge_type>1</edge_type>
<source_obj>48</source_obj>
<sink_obj>49</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_207">
<id>211</id>
<edge_type>1</edge_type>
<source_obj>49</source_obj>
<sink_obj>50</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_208">
<id>212</id>
<edge_type>1</edge_type>
<source_obj>47</source_obj>
<sink_obj>50</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_209">
<id>213</id>
<edge_type>2</edge_type>
<source_obj>60</source_obj>
<sink_obj>51</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_210">
<id>214</id>
<edge_type>1</edge_type>
<source_obj>50</source_obj>
<sink_obj>53</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_211">
<id>215</id>
<edge_type>2</edge_type>
<source_obj>52</source_obj>
<sink_obj>53</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_212">
<id>216</id>
<edge_type>1</edge_type>
<source_obj>166</source_obj>
<sink_obj>53</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_213">
<id>217</id>
<edge_type>2</edge_type>
<source_obj>40</source_obj>
<sink_obj>53</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_214">
<id>218</id>
<edge_type>1</edge_type>
<source_obj>114</source_obj>
<sink_obj>54</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_215">
<id>219</id>
<edge_type>1</edge_type>
<source_obj>13</source_obj>
<sink_obj>54</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_216">
<id>220</id>
<edge_type>1</edge_type>
<source_obj>12</source_obj>
<sink_obj>54</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_217">
<id>221</id>
<edge_type>1</edge_type>
<source_obj>11</source_obj>
<sink_obj>54</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_218">
<id>222</id>
<edge_type>1</edge_type>
<source_obj>10</source_obj>
<sink_obj>54</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_219">
<id>223</id>
<edge_type>1</edge_type>
<source_obj>9</source_obj>
<sink_obj>54</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_220">
<id>224</id>
<edge_type>1</edge_type>
<source_obj>8</source_obj>
<sink_obj>54</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_221">
<id>226</id>
<edge_type>1</edge_type>
<source_obj>225</source_obj>
<sink_obj>54</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_222">
<id>227</id>
<edge_type>1</edge_type>
<source_obj>54</source_obj>
<sink_obj>55</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_223">
<id>228</id>
<edge_type>1</edge_type>
<source_obj>54</source_obj>
<sink_obj>56</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_224">
<id>229</id>
<edge_type>1</edge_type>
<source_obj>54</source_obj>
<sink_obj>57</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_225">
<id>230</id>
<edge_type>1</edge_type>
<source_obj>127</source_obj>
<sink_obj>58</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_226">
<id>231</id>
<edge_type>1</edge_type>
<source_obj>55</source_obj>
<sink_obj>58</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_227">
<id>232</id>
<edge_type>1</edge_type>
<source_obj>56</source_obj>
<sink_obj>58</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_228">
<id>233</id>
<edge_type>1</edge_type>
<source_obj>57</source_obj>
<sink_obj>58</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_229">
<id>234</id>
<edge_type>1</edge_type>
<source_obj>13</source_obj>
<sink_obj>58</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_230">
<id>235</id>
<edge_type>1</edge_type>
<source_obj>12</source_obj>
<sink_obj>58</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_231">
<id>236</id>
<edge_type>1</edge_type>
<source_obj>11</source_obj>
<sink_obj>58</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_232">
<id>237</id>
<edge_type>1</edge_type>
<source_obj>10</source_obj>
<sink_obj>58</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_233">
<id>238</id>
<edge_type>1</edge_type>
<source_obj>9</source_obj>
<sink_obj>58</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_234">
<id>239</id>
<edge_type>1</edge_type>
<source_obj>8</source_obj>
<sink_obj>58</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_235">
<id>240</id>
<edge_type>1</edge_type>
<source_obj>58</source_obj>
<sink_obj>59</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_236">
<id>241</id>
<edge_type>2</edge_type>
<source_obj>81</source_obj>
<sink_obj>59</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_237">
<id>242</id>
<edge_type>2</edge_type>
<source_obj>73</source_obj>
<sink_obj>59</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_238">
<id>243</id>
<edge_type>1</edge_type>
<source_obj>141</source_obj>
<sink_obj>61</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_239">
<id>244</id>
<edge_type>1</edge_type>
<source_obj>55</source_obj>
<sink_obj>61</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_240">
<id>245</id>
<edge_type>1</edge_type>
<source_obj>141</source_obj>
<sink_obj>62</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_241">
<id>246</id>
<edge_type>1</edge_type>
<source_obj>56</source_obj>
<sink_obj>62</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_242">
<id>247</id>
<edge_type>1</edge_type>
<source_obj>62</source_obj>
<sink_obj>63</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_243">
<id>248</id>
<edge_type>1</edge_type>
<source_obj>147</source_obj>
<sink_obj>63</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_244">
<id>249</id>
<edge_type>1</edge_type>
<source_obj>63</source_obj>
<sink_obj>64</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_245">
<id>250</id>
<edge_type>1</edge_type>
<source_obj>61</source_obj>
<sink_obj>64</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_246">
<id>252</id>
<edge_type>1</edge_type>
<source_obj>251</source_obj>
<sink_obj>65</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_247">
<id>253</id>
<edge_type>1</edge_type>
<source_obj>64</source_obj>
<sink_obj>65</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_248">
<id>254</id>
<edge_type>1</edge_type>
<source_obj>65</source_obj>
<sink_obj>66</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_249">
<id>255</id>
<edge_type>1</edge_type>
<source_obj>152</source_obj>
<sink_obj>67</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_250">
<id>256</id>
<edge_type>1</edge_type>
<source_obj>66</source_obj>
<sink_obj>67</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_251">
<id>257</id>
<edge_type>1</edge_type>
<source_obj>202</source_obj>
<sink_obj>68</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_252">
<id>258</id>
<edge_type>1</edge_type>
<source_obj>64</source_obj>
<sink_obj>68</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_253">
<id>259</id>
<edge_type>1</edge_type>
<source_obj>68</source_obj>
<sink_obj>69</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_254">
<id>260</id>
<edge_type>1</edge_type>
<source_obj>152</source_obj>
<sink_obj>70</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_255">
<id>261</id>
<edge_type>1</edge_type>
<source_obj>69</source_obj>
<sink_obj>70</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_256">
<id>262</id>
<edge_type>1</edge_type>
<source_obj>70</source_obj>
<sink_obj>71</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_257">
<id>263</id>
<edge_type>1</edge_type>
<source_obj>67</source_obj>
<sink_obj>71</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_258">
<id>264</id>
<edge_type>2</edge_type>
<source_obj>81</source_obj>
<sink_obj>72</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_259">
<id>265</id>
<edge_type>1</edge_type>
<source_obj>92</source_obj>
<sink_obj>95</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_260">
<id>266</id>
<edge_type>2</edge_type>
<source_obj>94</source_obj>
<sink_obj>95</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_261">
<id>267</id>
<edge_type>1</edge_type>
<source_obj>166</source_obj>
<sink_obj>95</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_262">
<id>268</id>
<edge_type>2</edge_type>
<source_obj>81</source_obj>
<sink_obj>95</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_263">
<id>269</id>
<edge_type>1</edge_type>
<source_obj>53</source_obj>
<sink_obj>96</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_264">
<id>270</id>
<edge_type>1</edge_type>
<source_obj>33</source_obj>
<sink_obj>96</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_265">
<id>271</id>
<edge_type>1</edge_type>
<source_obj>74</source_obj>
<sink_obj>97</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_266">
<id>272</id>
<edge_type>1</edge_type>
<source_obj>95</source_obj>
<sink_obj>97</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_267">
<id>273</id>
<edge_type>1</edge_type>
<source_obj>97</source_obj>
<sink_obj>98</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_268">
<id>274</id>
<edge_type>1</edge_type>
<source_obj>96</source_obj>
<sink_obj>98</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_269">
<id>275</id>
<edge_type>1</edge_type>
<source_obj>98</source_obj>
<sink_obj>99</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_270">
<id>276</id>
<edge_type>1</edge_type>
<source_obj>71</source_obj>
<sink_obj>74</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_271">
<id>277</id>
<edge_type>2</edge_type>
<source_obj>73</source_obj>
<sink_obj>74</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_272">
<id>278</id>
<edge_type>1</edge_type>
<source_obj>166</source_obj>
<sink_obj>74</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_273">
<id>279</id>
<edge_type>2</edge_type>
<source_obj>60</source_obj>
<sink_obj>74</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_274">
<id>280</id>
<edge_type>1</edge_type>
<source_obj>114</source_obj>
<sink_obj>75</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_275">
<id>281</id>
<edge_type>1</edge_type>
<source_obj>13</source_obj>
<sink_obj>75</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_276">
<id>282</id>
<edge_type>1</edge_type>
<source_obj>12</source_obj>
<sink_obj>75</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_277">
<id>283</id>
<edge_type>1</edge_type>
<source_obj>11</source_obj>
<sink_obj>75</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_278">
<id>284</id>
<edge_type>1</edge_type>
<source_obj>10</source_obj>
<sink_obj>75</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_279">
<id>285</id>
<edge_type>1</edge_type>
<source_obj>9</source_obj>
<sink_obj>75</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_280">
<id>286</id>
<edge_type>1</edge_type>
<source_obj>8</source_obj>
<sink_obj>75</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_281">
<id>288</id>
<edge_type>1</edge_type>
<source_obj>287</source_obj>
<sink_obj>75</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_282">
<id>289</id>
<edge_type>1</edge_type>
<source_obj>75</source_obj>
<sink_obj>76</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_283">
<id>290</id>
<edge_type>1</edge_type>
<source_obj>75</source_obj>
<sink_obj>77</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_284">
<id>291</id>
<edge_type>1</edge_type>
<source_obj>75</source_obj>
<sink_obj>78</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_285">
<id>292</id>
<edge_type>1</edge_type>
<source_obj>127</source_obj>
<sink_obj>79</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_286">
<id>293</id>
<edge_type>1</edge_type>
<source_obj>76</source_obj>
<sink_obj>79</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_287">
<id>294</id>
<edge_type>1</edge_type>
<source_obj>77</source_obj>
<sink_obj>79</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_288">
<id>295</id>
<edge_type>1</edge_type>
<source_obj>78</source_obj>
<sink_obj>79</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_289">
<id>296</id>
<edge_type>1</edge_type>
<source_obj>13</source_obj>
<sink_obj>79</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_290">
<id>297</id>
<edge_type>1</edge_type>
<source_obj>12</source_obj>
<sink_obj>79</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_291">
<id>298</id>
<edge_type>1</edge_type>
<source_obj>11</source_obj>
<sink_obj>79</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_292">
<id>299</id>
<edge_type>1</edge_type>
<source_obj>10</source_obj>
<sink_obj>79</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_293">
<id>300</id>
<edge_type>1</edge_type>
<source_obj>9</source_obj>
<sink_obj>79</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_294">
<id>301</id>
<edge_type>1</edge_type>
<source_obj>8</source_obj>
<sink_obj>79</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_295">
<id>302</id>
<edge_type>1</edge_type>
<source_obj>79</source_obj>
<sink_obj>80</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_296">
<id>303</id>
<edge_type>2</edge_type>
<source_obj>100</source_obj>
<sink_obj>80</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_297">
<id>304</id>
<edge_type>2</edge_type>
<source_obj>94</source_obj>
<sink_obj>80</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_298">
<id>305</id>
<edge_type>1</edge_type>
<source_obj>141</source_obj>
<sink_obj>82</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_299">
<id>306</id>
<edge_type>1</edge_type>
<source_obj>76</source_obj>
<sink_obj>82</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_300">
<id>307</id>
<edge_type>1</edge_type>
<source_obj>141</source_obj>
<sink_obj>83</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_301">
<id>308</id>
<edge_type>1</edge_type>
<source_obj>77</source_obj>
<sink_obj>83</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_302">
<id>309</id>
<edge_type>1</edge_type>
<source_obj>83</source_obj>
<sink_obj>84</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_303">
<id>310</id>
<edge_type>1</edge_type>
<source_obj>147</source_obj>
<sink_obj>84</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_304">
<id>311</id>
<edge_type>1</edge_type>
<source_obj>84</source_obj>
<sink_obj>85</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_305">
<id>312</id>
<edge_type>1</edge_type>
<source_obj>82</source_obj>
<sink_obj>85</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_306">
<id>314</id>
<edge_type>1</edge_type>
<source_obj>313</source_obj>
<sink_obj>86</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_307">
<id>315</id>
<edge_type>1</edge_type>
<source_obj>85</source_obj>
<sink_obj>86</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_308">
<id>316</id>
<edge_type>1</edge_type>
<source_obj>86</source_obj>
<sink_obj>87</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_309">
<id>317</id>
<edge_type>1</edge_type>
<source_obj>152</source_obj>
<sink_obj>88</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_310">
<id>318</id>
<edge_type>1</edge_type>
<source_obj>87</source_obj>
<sink_obj>88</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_311">
<id>319</id>
<edge_type>1</edge_type>
<source_obj>251</source_obj>
<sink_obj>89</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_312">
<id>320</id>
<edge_type>1</edge_type>
<source_obj>85</source_obj>
<sink_obj>89</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_313">
<id>321</id>
<edge_type>1</edge_type>
<source_obj>89</source_obj>
<sink_obj>90</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_314">
<id>322</id>
<edge_type>1</edge_type>
<source_obj>152</source_obj>
<sink_obj>91</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_315">
<id>323</id>
<edge_type>1</edge_type>
<source_obj>90</source_obj>
<sink_obj>91</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_316">
<id>324</id>
<edge_type>1</edge_type>
<source_obj>91</source_obj>
<sink_obj>92</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_317">
<id>325</id>
<edge_type>1</edge_type>
<source_obj>88</source_obj>
<sink_obj>92</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_318">
<id>326</id>
<edge_type>2</edge_type>
<source_obj>100</source_obj>
<sink_obj>93</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_319">
<id>339</id>
<edge_type>2</edge_type>
<source_obj>20</source_obj>
<sink_obj>32</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_320">
<id>340</id>
<edge_type>2</edge_type>
<source_obj>20</source_obj>
<sink_obj>40</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_321">
<id>341</id>
<edge_type>2</edge_type>
<source_obj>32</source_obj>
<sink_obj>40</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_322">
<id>342</id>
<edge_type>2</edge_type>
<source_obj>40</source_obj>
<sink_obj>52</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_323">
<id>343</id>
<edge_type>2</edge_type>
<source_obj>40</source_obj>
<sink_obj>60</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_324">
<id>344</id>
<edge_type>2</edge_type>
<source_obj>52</source_obj>
<sink_obj>60</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_325">
<id>345</id>
<edge_type>2</edge_type>
<source_obj>60</source_obj>
<sink_obj>73</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_326">
<id>346</id>
<edge_type>2</edge_type>
<source_obj>60</source_obj>
<sink_obj>81</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_327">
<id>347</id>
<edge_type>2</edge_type>
<source_obj>73</source_obj>
<sink_obj>81</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_328">
<id>348</id>
<edge_type>2</edge_type>
<source_obj>81</source_obj>
<sink_obj>94</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_329">
<id>349</id>
<edge_type>2</edge_type>
<source_obj>81</source_obj>
<sink_obj>100</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_330">
<id>350</id>
<edge_type>2</edge_type>
<source_obj>94</source_obj>
<sink_obj>100</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
</edges>
</cdfg>
<cdfg_regions class_id="21" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="22" tracking_level="1" version="0" object_id="_331">
<mId>1</mId>
<mTag>checkAxis.2</mTag>
<mType>0</mType>
<sub_regions>
<count>0</count>
<item_version>0</item_version>
</sub_regions>
<basic_blocks>
<count>9</count>
<item_version>0</item_version>
<item>20</item>
<item>32</item>
<item>40</item>
<item>52</item>
<item>60</item>
<item>73</item>
<item>81</item>
<item>94</item>
<item>100</item>
</basic_blocks>
<mII>1</mII>
<mDepth>52</mDepth>
<mMinTripCount>-1</mMinTripCount>
<mMaxTripCount>-1</mMaxTripCount>
<mMinLatency>51</mMinLatency>
<mMaxLatency>51</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"></mDfPipe>
</item>
</cdfg_regions>
<fsm class_id="-1"></fsm>
<res class_id="-1"></res>
<node_label_latency class_id="26" tracking_level="0" version="0">
<count>84</count>
<item_version>0</item_version>
<item class_id="27" tracking_level="0" version="0">
<first>8</first>
<second class_id="28" tracking_level="0" version="0">
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>9</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>10</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>11</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>12</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>13</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>14</first>
<second>
<first>0</first>
<second>45</second>
</second>
</item>
<item>
<first>15</first>
<second>
<first>45</first>
<second>0</second>
</second>
</item>
<item>
<first>16</first>
<second>
<first>45</first>
<second>0</second>
</second>
</item>
<item>
<first>17</first>
<second>
<first>45</first>
<second>0</second>
</second>
</item>
<item>
<first>18</first>
<second>
<first>46</first>
<second>4</second>
</second>
</item>
<item>
<first>19</first>
<second>
<first>50</first>
<second>0</second>
</second>
</item>
<item>
<first>21</first>
<second>
<first>50</first>
<second>0</second>
</second>
</item>
<item>
<first>22</first>
<second>
<first>50</first>
<second>0</second>
</second>
</item>
<item>
<first>23</first>
<second>
<first>51</first>
<second>0</second>
</second>
</item>
<item>
<first>24</first>
<second>
<first>51</first>
<second>0</second>
</second>
</item>
<item>
<first>25</first>
<second>
<first>51</first>
<second>0</second>
</second>
</item>
<item>
<first>26</first>
<second>
<first>51</first>
<second>0</second>
</second>
</item>
<item>
<first>27</first>
<second>
<first>51</first>
<second>0</second>
</second>
</item>
<item>
<first>28</first>
<second>
<first>51</first>
<second>0</second>
</second>
</item>
<item>
<first>29</first>
<second>
<first>51</first>
<second>0</second>
</second>
</item>
<item>
<first>30</first>
<second>
<first>51</first>
<second>0</second>
</second>
</item>
<item>
<first>31</first>
<second>
<first>51</first>
<second>0</second>
</second>
</item>
<item>
<first>33</first>
<second>
<first>51</first>
<second>0</second>
</second>
</item>
<item>
<first>34</first>
<second>
<first>0</first>
<second>45</second>
</second>
</item>
<item>
<first>35</first>
<second>
<first>45</first>
<second>0</second>
</second>
</item>
<item>
<first>36</first>
<second>
<first>45</first>
<second>0</second>
</second>
</item>
<item>
<first>37</first>
<second>
<first>45</first>
<second>0</second>
</second>
</item>
<item>
<first>38</first>
<second>
<first>46</first>
<second>4</second>
</second>
</item>
<item>
<first>39</first>
<second>
<first>50</first>
<second>0</second>
</second>
</item>
<item>
<first>41</first>
<second>
<first>50</first>
<second>0</second>
</second>
</item>
<item>
<first>42</first>
<second>
<first>50</first>
<second>0</second>
</second>
</item>
<item>
<first>43</first>
<second>
<first>51</first>
<second>0</second>
</second>
</item>
<item>
<first>44</first>
<second>
<first>51</first>
<second>0</second>
</second>
</item>
<item>
<first>45</first>
<second>
<first>51</first>
<second>0</second>
</second>
</item>
<item>
<first>46</first>
<second>
<first>51</first>
<second>0</second>
</second>
</item>
<item>
<first>47</first>
<second>
<first>51</first>
<second>0</second>
</second>
</item>
<item>
<first>48</first>
<second>
<first>51</first>
<second>0</second>
</second>
</item>
<item>
<first>49</first>
<second>
<first>51</first>
<second>0</second>
</second>
</item>
<item>
<first>50</first>
<second>
<first>51</first>
<second>0</second>
</second>
</item>
<item>
<first>51</first>
<second>
<first>51</first>
<second>0</second>
</second>
</item>
<item>
<first>53</first>
<second>
<first>51</first>
<second>0</second>
</second>
</item>
<item>
<first>54</first>
<second>
<first>0</first>
<second>45</second>
</second>
</item>
<item>
<first>55</first>
<second>
<first>45</first>
<second>0</second>
</second>
</item>
<item>
<first>56</first>
<second>
<first>45</first>
<second>0</second>
</second>
</item>
<item>
<first>57</first>
<second>
<first>45</first>
<second>0</second>
</second>
</item>
<item>
<first>58</first>
<second>
<first>46</first>
<second>4</second>
</second>
</item>
<item>
<first>59</first>
<second>
<first>50</first>
<second>0</second>
</second>
</item>
<item>
<first>61</first>
<second>
<first>50</first>
<second>0</second>
</second>
</item>
<item>
<first>62</first>
<second>
<first>50</first>
<second>0</second>
</second>
</item>
<item>
<first>63</first>
<second>
<first>51</first>
<second>0</second>
</second>
</item>
<item>
<first>64</first>
<second>
<first>51</first>
<second>0</second>
</second>
</item>
<item>
<first>65</first>
<second>
<first>51</first>
<second>0</second>
</second>
</item>
<item>
<first>66</first>
<second>
<first>51</first>
<second>0</second>
</second>
</item>
<item>
<first>67</first>
<second>
<first>51</first>
<second>0</second>
</second>
</item>
<item>
<first>68</first>
<second>
<first>51</first>
<second>0</second>
</second>
</item>
<item>
<first>69</first>
<second>
<first>51</first>
<second>0</second>
</second>
</item>
<item>
<first>70</first>
<second>
<first>51</first>
<second>0</second>
</second>
</item>
<item>
<first>71</first>
<second>
<first>51</first>
<second>0</second>
</second>
</item>
<item>
<first>72</first>
<second>
<first>51</first>
<second>0</second>
</second>
</item>
<item>
<first>74</first>
<second>
<first>51</first>
<second>0</second>
</second>
</item>
<item>
<first>75</first>
<second>
<first>0</first>
<second>45</second>
</second>
</item>
<item>
<first>76</first>
<second>
<first>45</first>
<second>0</second>
</second>
</item>
<item>
<first>77</first>
<second>
<first>45</first>
<second>0</second>
</second>
</item>
<item>
<first>78</first>
<second>
<first>45</first>
<second>0</second>
</second>
</item>
<item>
<first>79</first>
<second>
<first>46</first>
<second>4</second>
</second>
</item>
<item>
<first>80</first>
<second>
<first>50</first>
<second>0</second>
</second>
</item>
<item>
<first>82</first>
<second>
<first>50</first>
<second>0</second>
</second>
</item>
<item>
<first>83</first>
<second>
<first>50</first>
<second>0</second>
</second>
</item>
<item>
<first>84</first>
<second>
<first>51</first>
<second>0</second>
</second>
</item>
<item>
<first>85</first>
<second>
<first>51</first>
<second>0</second>
</second>
</item>
<item>
<first>86</first>
<second>
<first>51</first>
<second>0</second>
</second>
</item>
<item>
<first>87</first>
<second>
<first>51</first>
<second>0</second>
</second>
</item>
<item>
<first>88</first>
<second>
<first>51</first>
<second>0</second>
</second>
</item>
<item>
<first>89</first>
<second>
<first>51</first>
<second>0</second>
</second>
</item>
<item>
<first>90</first>
<second>
<first>51</first>
<second>0</second>
</second>
</item>
<item>
<first>91</first>
<second>
<first>51</first>
<second>0</second>
</second>
</item>
<item>
<first>92</first>
<second>
<first>51</first>
<second>0</second>
</second>
</item>
<item>
<first>93</first>
<second>
<first>51</first>
<second>0</second>
</second>
</item>
<item>
<first>95</first>
<second>
<first>51</first>
<second>0</second>
</second>
</item>
<item>
<first>96</first>
<second>
<first>51</first>
<second>0</second>
</second>
</item>
<item>
<first>97</first>
<second>
<first>51</first>
<second>0</second>
</second>
</item>
<item>
<first>98</first>
<second>
<first>51</first>
<second>0</second>
</second>
</item>
<item>
<first>99</first>
<second>
<first>51</first>
<second>0</second>
</second>
</item>
</node_label_latency>
<bblk_ent_exit class_id="29" tracking_level="0" version="0">
<count>9</count>
<item_version>0</item_version>
<item class_id="30" tracking_level="0" version="0">
<first>20</first>
<second class_id="31" tracking_level="0" version="0">
<first>0</first>
<second>51</second>
</second>
</item>
<item>
<first>32</first>
<second>
<first>50</first>
<second>51</second>
</second>
</item>
<item>
<first>40</first>
<second>
<first>0</first>
<second>51</second>
</second>
</item>
<item>
<first>52</first>
<second>
<first>50</first>
<second>51</second>
</second>
</item>
<item>
<first>60</first>
<second>
<first>0</first>
<second>51</second>
</second>
</item>
<item>
<first>73</first>
<second>
<first>50</first>
<second>51</second>
</second>
</item>
<item>
<first>81</first>
<second>
<first>0</first>
<second>51</second>
</second>
</item>
<item>
<first>94</first>
<second>
<first>50</first>
<second>51</second>
</second>
</item>
<item>
<first>100</first>
<second>
<first>51</first>
<second>51</second>
</second>
</item>
</bblk_ent_exit>
<regions class_id="32" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="33" tracking_level="1" version="0" object_id="_332">
<region_name>checkAxis.2</region_name>
<basic_blocks>
<count>9</count>
<item_version>0</item_version>
<item>20</item>
<item>32</item>
<item>40</item>
<item>52</item>
<item>60</item>
<item>73</item>
<item>81</item>
<item>94</item>
<item>100</item>
</basic_blocks>
<nodes>
<count>0</count>
<item_version>0</item_version>
</nodes>
<anchor_node>-1</anchor_node>
<region_type>8</region_type>
<interval>1</interval>
<pipe_depth>52</pipe_depth>
</item>
</regions>
<dp_fu_nodes class_id="34" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_fu_nodes>
<dp_fu_nodes_expression class_id="35" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_fu_nodes_expression>
<dp_fu_nodes_module>
<count>0</count>
<item_version>0</item_version>
</dp_fu_nodes_module>
<dp_fu_nodes_io>
<count>0</count>
<item_version>0</item_version>
</dp_fu_nodes_io>
<return_ports>
<count>0</count>
<item_version>0</item_version>
</return_ports>
<dp_mem_port_nodes class_id="36" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_mem_port_nodes>
<dp_reg_nodes>
<count>0</count>
<item_version>0</item_version>
</dp_reg_nodes>
<dp_regname_nodes>
<count>0</count>
<item_version>0</item_version>
</dp_regname_nodes>
<dp_reg_phi>
<count>0</count>
<item_version>0</item_version>
</dp_reg_phi>
<dp_regname_phi>
<count>0</count>
<item_version>0</item_version>
</dp_regname_phi>
<dp_port_io_nodes class_id="37" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_port_io_nodes>
<port2core class_id="38" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</port2core>
<node2core>
<count>0</count>
<item_version>0</item_version>
</node2core>
</syndb>
</boost_serialization>
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . P A C K _ 6 1 --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2019, 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. --
-- --
------------------------------------------------------------------------------
with System.Storage_Elements;
with System.Unsigned_Types;
package body System.Pack_61 is
subtype Bit_Order is System.Bit_Order;
Reverse_Bit_Order : constant Bit_Order :=
Bit_Order'Val (1 - Bit_Order'Pos (System.Default_Bit_Order));
subtype Ofs is System.Storage_Elements.Storage_Offset;
subtype Uns is System.Unsigned_Types.Unsigned;
subtype N07 is System.Unsigned_Types.Unsigned range 0 .. 7;
use type System.Storage_Elements.Storage_Offset;
use type System.Unsigned_Types.Unsigned;
type Cluster is record
E0, E1, E2, E3, E4, E5, E6, E7 : Bits_61;
end record;
for Cluster use record
E0 at 0 range 0 * Bits .. 0 * Bits + Bits - 1;
E1 at 0 range 1 * Bits .. 1 * Bits + Bits - 1;
E2 at 0 range 2 * Bits .. 2 * Bits + Bits - 1;
E3 at 0 range 3 * Bits .. 3 * Bits + Bits - 1;
E4 at 0 range 4 * Bits .. 4 * Bits + Bits - 1;
E5 at 0 range 5 * Bits .. 5 * Bits + Bits - 1;
E6 at 0 range 6 * Bits .. 6 * Bits + Bits - 1;
E7 at 0 range 7 * Bits .. 7 * Bits + Bits - 1;
end record;
for Cluster'Size use Bits * 8;
for Cluster'Alignment use Integer'Min (Standard'Maximum_Alignment,
1 +
1 * Boolean'Pos (Bits mod 2 = 0) +
2 * Boolean'Pos (Bits mod 4 = 0));
-- Use maximum possible alignment, given the bit field size, since this
-- will result in the most efficient code possible for the field.
type Cluster_Ref is access Cluster;
type Rev_Cluster is new Cluster
with Bit_Order => Reverse_Bit_Order,
Scalar_Storage_Order => Reverse_Bit_Order;
type Rev_Cluster_Ref is access Rev_Cluster;
------------
-- Get_61 --
------------
function Get_61
(Arr : System.Address;
N : Natural;
Rev_SSO : Boolean) return Bits_61
is
A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8);
C : Cluster_Ref with Address => A'Address, Import;
RC : Rev_Cluster_Ref with Address => A'Address, Import;
begin
if Rev_SSO then
case N07 (Uns (N) mod 8) is
when 0 => return RC.E0;
when 1 => return RC.E1;
when 2 => return RC.E2;
when 3 => return RC.E3;
when 4 => return RC.E4;
when 5 => return RC.E5;
when 6 => return RC.E6;
when 7 => return RC.E7;
end case;
else
case N07 (Uns (N) mod 8) is
when 0 => return C.E0;
when 1 => return C.E1;
when 2 => return C.E2;
when 3 => return C.E3;
when 4 => return C.E4;
when 5 => return C.E5;
when 6 => return C.E6;
when 7 => return C.E7;
end case;
end if;
end Get_61;
------------
-- Set_61 --
------------
procedure Set_61
(Arr : System.Address;
N : Natural;
E : Bits_61;
Rev_SSO : Boolean)
is
A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8);
C : Cluster_Ref with Address => A'Address, Import;
RC : Rev_Cluster_Ref with Address => A'Address, Import;
begin
if Rev_SSO then
case N07 (Uns (N) mod 8) is
when 0 => RC.E0 := E;
when 1 => RC.E1 := E;
when 2 => RC.E2 := E;
when 3 => RC.E3 := E;
when 4 => RC.E4 := E;
when 5 => RC.E5 := E;
when 6 => RC.E6 := E;
when 7 => RC.E7 := E;
end case;
else
case N07 (Uns (N) mod 8) is
when 0 => C.E0 := E;
when 1 => C.E1 := E;
when 2 => C.E2 := E;
when 3 => C.E3 := E;
when 4 => C.E4 := E;
when 5 => C.E5 := E;
when 6 => C.E6 := E;
when 7 => C.E7 := E;
end case;
end if;
end Set_61;
end System.Pack_61;
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2010-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 file is generated, don't edit it.
------------------------------------------------------------------------------
package AMF.Internals.Tables.UTP_Constructors is
function Create_Utp_Coding_Rule return AMF.Internals.AMF_Element;
function Create_Utp_Data_Partition return AMF.Internals.AMF_Element;
function Create_Utp_Data_Pool return AMF.Internals.AMF_Element;
function Create_Utp_Data_Selector return AMF.Internals.AMF_Element;
function Create_Utp_Default return AMF.Internals.AMF_Element;
function Create_Utp_Default_Application return AMF.Internals.AMF_Element;
function Create_Utp_Determ_Alt return AMF.Internals.AMF_Element;
function Create_Utp_Finish_Action return AMF.Internals.AMF_Element;
function Create_Utp_Get_Timezone_Action return AMF.Internals.AMF_Element;
function Create_Utp_Literal_Any return AMF.Internals.AMF_Element;
function Create_Utp_Literal_Any_Or_Null return AMF.Internals.AMF_Element;
function Create_Utp_Log_Action return AMF.Internals.AMF_Element;
function Create_Utp_Managed_Element return AMF.Internals.AMF_Element;
function Create_Utp_Read_Timer_Action return AMF.Internals.AMF_Element;
function Create_Utp_SUT return AMF.Internals.AMF_Element;
function Create_Utp_Set_Timezone_Action return AMF.Internals.AMF_Element;
function Create_Utp_Start_Timer_Action return AMF.Internals.AMF_Element;
function Create_Utp_Stop_Timer_Action return AMF.Internals.AMF_Element;
function Create_Utp_Test_Case return AMF.Internals.AMF_Element;
function Create_Utp_Test_Component return AMF.Internals.AMF_Element;
function Create_Utp_Test_Context return AMF.Internals.AMF_Element;
function Create_Utp_Test_Log return AMF.Internals.AMF_Element;
function Create_Utp_Test_Log_Application return AMF.Internals.AMF_Element;
function Create_Utp_Test_Objective return AMF.Internals.AMF_Element;
function Create_Utp_Test_Suite return AMF.Internals.AMF_Element;
function Create_Utp_Time_Out return AMF.Internals.AMF_Element;
function Create_Utp_Time_Out_Action return AMF.Internals.AMF_Element;
function Create_Utp_Time_Out_Message return AMF.Internals.AMF_Element;
function Create_Utp_Timer_Running_Action return AMF.Internals.AMF_Element;
function Create_Utp_Validation_Action return AMF.Internals.AMF_Element;
end AMF.Internals.Tables.UTP_Constructors;
|
with PixelArray; use PixelArray;
with ImageRegions;
with Ada.Text_IO;
with Ada.Numerics.Generic_Elementary_Functions;
with Ada.Containers.Generic_Sort;
package body ImageMoments is
package FloatFunctions is new Ada.Numerics.Generic_Elementary_Functions(Float_Type => Float);
use FloatFunctions;
generic
with function op(p1, p2: Float) return Float;
function match_helper(ha, hb: HuMoments) return Float;
function match_helper(ha, hb: HuMoments) return Float is
begin
return op(ha.h1, hb.h1) + op(ha.h2, hb.h2) + op(ha.h3, hb.h3) + op(ha.h4, hb.h4) + op(ha.h5, hb.h5) + op(ha.h6, hb.h6) + op(ha.h7, hb.h7);
end match_helper;
function match_I1(a, b: HuMoments) return Float is
function optmp(p1, p2: Float) return Float is (abs(1.0 / p1 - 1.0 / p2));
function tmp is new match_helper(op => optmp);
begin
return tmp(a, b);
end match_I1;
function match_I2(a, b: HuMoments) return Float is
function optmp(p1, p2: Float) return Float is (abs(p1 - p2));
function tmp is new match_helper(op => optmp);
begin
return tmp(a, b);
end match_I2;
function match_I3(a, b: HuMoments) return Float is
function optmp(p1, p2: Float) return Float is (abs((p1 - p2) / p1));
function tmp is new match_helper(op => optmp);
begin
return tmp(a, b);
end match_I3;
function match_rms(a, b: HuMoments) return Float is
function optmp(p1, p2: Float) return Float is ((p1 - p2) ** 2);
function tmp is new match_helper(op => optmp);
begin
return Sqrt(tmp(a, b));
end match_rms;
function moment(image: PixelArray.ImagePlane; region: ImageRegions.Region; p, q: Natural) return Float is
result: Float;
begin
result := 0.0;
for py in region.area.y .. region.area.y + region.area.height loop
for px in region.area.x .. region.area.x + region.area.width loop
if PixelArray.Pixel(region.label) = image.get(px, py) then
result := result + Float((px - region.area.x) ** p) * Float((py - region.area.y) ** q);
end if;
end loop;
end loop;
return result;
end moment;
function centralMoment(image: PixelArray.ImagePlane; region: ImageRegions.Region; p, q: Natural) return Float is
result: Float;
cx, cy: Float;
begin
result := 0.0;
cx := moment(image, region, 1, 0) / Float(region.pixelCount);
cy := moment(image, region, 0, 1) / Float(region.pixelCount);
for py in region.area.y .. region.area.y + region.area.height loop
for px in region.area.x .. region.area.x + region.area.width loop
if PixelArray.Pixel(region.label) = image.get(px, py) then
result := result + Float((Float(px - region.area.x) - cx) ** p) * Float((Float(py - region.area.y) - cy) ** q);
end if;
end loop;
end loop;
return result;
end centralMoment;
function normalCentralMoment(image: PixelArray.ImagePlane; region: ImageRegions.Region; p, q: Natural) return Float is
norm: Float;
begin
norm := Float(region.pixelCount) ** ((p + q + 2) / 2);
return centralMoment(image, region, p, q) / norm;
end normalCentralMoment;
function getH1(image: PixelArray.ImagePlane; region: ImageRegions.Region) return Float is
begin
return normalCentralMoment(image, region, 2, 0) + normalCentralMoment(image, region, 0, 2);
end getH1;
function getH2(image: PixelArray.ImagePlane; region: ImageRegions.Region) return Float is
begin
return (normalCentralMoment(image, region, 2, 0) - normalCentralMoment(image, region, 0, 2)) ** 2 + 4.0 * (normalCentralMoment(image, region, 1, 1) ** 2);
end getH2;
function getH3(image: PixelArray.ImagePlane; region: ImageRegions.Region) return Float is
begin
return (normalCentralMoment(image, region, 3, 0) - 3.0 * normalCentralMoment(image, region, 1, 2)) ** 2 + (3.0 * normalCentralMoment(image, region, 2, 1) - normalCentralMoment(image, region, 0, 3)) ** 2;
end getH3;
function getH4(image: PixelArray.ImagePlane; region: ImageRegions.Region) return Float is
begin
return (normalCentralMoment(image, region, 3, 0) + normalCentralMoment(image, region, 1, 2)) ** 2 + (normalCentralMoment(image, region, 2, 1) + normalCentralMoment(image, region, 0, 3)) ** 2;
end getH4;
function getH5(image: PixelArray.ImagePlane; region: ImageRegions.Region) return Float is
u30, u12, u21, u03: Float;
begin
u30 := normalCentralMoment(image, region, 3, 0);
u03 := normalCentralMoment(image, region, 0, 3);
u12 := normalCentralMoment(image, region, 1, 2);
u21 := normalCentralMoment(image, region, 2, 1);
return (u30 - 3.0 * u12) * (u30 + u12) * ((u30 + u12) ** 2 - 3.0 * ((u21 + u03) ** 2))
+ (3.0 * u21 - u03) * (3.0 * ((u30 + u12) ** 2) - (u21 + u03) ** 2);
end getH5;
function getH6(image: PixelArray.ImagePlane; region: ImageRegions.Region) return Float is
u20, u02, u30, u12, u21, u03, u11: Float;
begin
u11 := normalCentralMoment(image, region, 1, 1);
u20 := normalCentralMoment(image, region, 2, 0);
u02 := normalCentralMoment(image, region, 0, 2);
u12 := normalCentralMoment(image, region, 1, 2);
u21 := normalCentralMoment(image, region, 2, 1);
u30 := normalCentralMoment(image, region, 3, 0);
u03 := normalCentralMoment(image, region, 0, 3);
return (u20 - u02) * ((u30 + u12) ** 2 - (u21 + u03) ** 2
+ 4.0 * u11 * (u30 + u12) * (u21 + u03));
end getH6;
function getH7(image: PixelArray.ImagePlane; region: ImageRegions.Region) return Float is
u30, u12, u21, u03: Float;
begin
u12 := normalCentralMoment(image, region, 1, 2);
u21 := normalCentralMoment(image, region, 2, 1);
u30 := normalCentralMoment(image, region, 3, 0);
u03 := normalCentralMoment(image, region, 0, 3);
return (3.0 * u21 - u03) * (u30 + u12) * ((u30 + u12) ** 2 - 3.0 * ((u21 + u03) ** 2))
+ (3.0 * u12 - u30) * (u21 + u03) * (3.0 * ((u30 + u12) ** 2) - (u21 + u03) ** 2);
end getH7;
function logOf(value: Float) return Float is
begin
return Log(abs(value), 10.0) * (if value < 0.0 then -1.0 else 1.0);
end logOf;
function calculateMoments(image: PixelArray.ImagePlane; region: ImageRegions.Region) return HuMoments is
begin
return HuMoments'(h1 => logOf(getH1(image, region)),
h2 => logOf(getH2(image, region)),
h3 => logOf(getH3(image, region)),
h4 => logOf(getH4(image, region)),
h5 => logOf(getH5(image, region)),
h6 => logOf(getH6(image, region)),
h7 => logOf(getH7(image, region)));
end calculateMoments;
function orientationAngle(image: PixelArray.ImagePlane; region: ImageRegions.Region) return Float is
d: Float;
begin
d := centralMoment(image, region, 2, 0) - centralMoment(image, region, 0, 2);
if d /= 0.0 then
return Arctan(Y => 2.0 * centralMoment(image, region, 1, 1),
X => d) / 2.0;
else
return 0.0;
end if;
end orientationAngle;
end ImageMoments;
|
------------------------------------------------------------------------------
-- --
-- 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 --
-- --
-- S p e c --
-- --
-- Copyright (C) 1991-2019, 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 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/>. --
-- --
-- GNARL was developed by the GNARL team at Florida State University. --
-- Extensive contributions were provided by Ada Core Technologies, Inc. --
-- --
------------------------------------------------------------------------------
-- This is a NT (native) version of this package
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.OS_Interface;
with System.Win32;
package System.Task_Primitives is
pragma Preelaborate;
type Lock is limited private;
-- Should be used for implementation of protected objects
type RTS_Lock is limited private;
-- Should be used inside the runtime system. The difference between Lock
-- and the RTS_Lock is that the later one serves only as a semaphore so
-- that do not check for ceiling violations.
type Suspension_Object is limited private;
-- Should be used for the implementation of Ada.Synchronous_Task_Control
type Task_Body_Access is access procedure;
-- Pointer to the task body's entry point (or possibly a wrapper
-- declared local to the GNARL).
type Private_Data is limited private;
-- Any information that the GNULLI needs maintained on a per-task basis.
-- A component of this type is guaranteed to be included in the
-- Ada_Task_Control_Block.
subtype Task_Address is System.Address;
Task_Address_Size : constant := Standard'Address_Size;
-- Type used for task addresses and its size
Alternate_Stack_Size : constant := 0;
-- No alternate signal stack is used on this platform
private
type Lock is record
Mutex : aliased System.OS_Interface.CRITICAL_SECTION;
Priority : Integer;
Owner_Priority : Integer;
end record;
type Condition_Variable is new System.Win32.HANDLE;
type RTS_Lock is new System.OS_Interface.CRITICAL_SECTION;
type Suspension_Object is record
State : Boolean;
pragma Atomic (State);
-- Boolean that indicates whether the object is open. This field is
-- marked Atomic to ensure that we can read its value without locking
-- the access to the Suspension_Object.
Waiting : Boolean;
-- Flag showing if there is a task already suspended on this object
L : aliased System.OS_Interface.CRITICAL_SECTION;
-- Protection for ensuring mutual exclusion on the Suspension_Object
CV : aliased Win32.HANDLE;
-- Condition variable used to queue threads until condition is signaled
end record;
type Private_Data is limited record
Thread : aliased Win32.HANDLE;
pragma Atomic (Thread);
-- Thread field may be updated by two different threads of control.
-- (See, Enter_Task and Create_Task in s-taprop.adb).
-- They put the same value (thr_self value). We do not want to
-- use lock on those operations and the only thing we have to
-- make sure is that they are updated in atomic fashion.
Thread_Id : aliased Win32.DWORD;
-- Used to provide a better tasking support in gdb
CV : aliased Condition_Variable;
-- Condition Variable used to implement Sleep/Wakeup
L : aliased RTS_Lock;
-- Protection for all components is lock L
end record;
end System.Task_Primitives;
|
------------------------------------------------------------------------------
-- 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 Ada.Streams;
with Interfaces;
package ZLib is
ZLib_Error : exception;
Status_Error : exception;
type Compression_Level is new Integer range -1 .. 9;
type Flush_Mode is private;
type Compression_Method is private;
type Window_Bits_Type is new Integer range 8 .. 15;
type Memory_Level_Type is new Integer range 1 .. 9;
type Unsigned_32 is new Interfaces.Unsigned_32;
type Strategy_Type is private;
type Header_Type is (None, Auto, Default, GZip);
-- Header type usage have a some limitation for inflate.
-- See comment for Inflate_Init.
subtype Count is Ada.Streams.Stream_Element_Count;
Default_Memory_Level : constant Memory_Level_Type := 8;
Default_Window_Bits : constant Window_Bits_Type := 15;
----------------------------------
-- Compression method constants --
----------------------------------
Deflated : constant Compression_Method;
-- Only one method allowed in this ZLib version
---------------------------------
-- Compression level constants --
---------------------------------
No_Compression : constant Compression_Level := 0;
Best_Speed : constant Compression_Level := 1;
Best_Compression : constant Compression_Level := 9;
Default_Compression : constant Compression_Level := -1;
--------------------------
-- Flush mode constants --
--------------------------
No_Flush : constant Flush_Mode;
-- Regular way for compression, no flush
Partial_Flush : constant Flush_Mode;
-- Will be removed, use Z_SYNC_FLUSH instead
Sync_Flush : constant Flush_Mode;
-- All pending output is flushed to the output buffer and the output
-- is aligned on a byte boundary, so that the decompressor can get all
-- input data available so far. (In particular avail_in is zero after the
-- call if enough output space has been provided before the call.)
-- Flushing may degrade compression for some compression algorithms and so
-- it should be used only when necessary.
Block_Flush : constant Flush_Mode;
-- Z_BLOCK requests that inflate() stop
-- if and when it get to the next deflate block boundary. When decoding the
-- zlib or gzip format, this will cause inflate() to return immediately
-- after the header and before the first block. When doing a raw inflate,
-- inflate() will go ahead and process the first block, and will return
-- when it gets to the end of that block, or when it runs out of data.
Full_Flush : constant Flush_Mode;
-- All output is flushed as with SYNC_FLUSH, and the compression state
-- is reset so that decompression can restart from this point if previous
-- compressed data has been damaged or if random access is desired. Using
-- Full_Flush too often can seriously degrade the compression.
Finish : constant Flush_Mode;
-- Just for tell the compressor that input data is complete.
------------------------------------
-- Compression strategy constants --
------------------------------------
-- RLE stategy could be used only in version 1.2.0 and later.
Filtered : constant Strategy_Type;
Huffman_Only : constant Strategy_Type;
RLE : constant Strategy_Type;
Default_Strategy : constant Strategy_Type;
Default_Buffer_Size : constant := 4096;
type Filter_Type is tagged limited private;
-- The filter is for compression and for decompression.
-- The usage of the type is depend of its initialization.
function Version return String;
pragma Inline (Version);
-- Return string representation of the ZLib version.
procedure Deflate_Init
(Filter : in out Filter_Type;
Level : in Compression_Level := Default_Compression;
Strategy : in Strategy_Type := Default_Strategy;
Method : in Compression_Method := Deflated;
Window_Bits : in Window_Bits_Type := Default_Window_Bits;
Memory_Level : in Memory_Level_Type := Default_Memory_Level;
Header : in Header_Type := Default);
-- Compressor initialization.
-- When Header parameter is Auto or Default, then default zlib header
-- would be provided for compressed data.
-- When Header is GZip, then gzip header would be set instead of
-- default header.
-- When Header is None, no header would be set for compressed data.
procedure Inflate_Init
(Filter : in out Filter_Type;
Window_Bits : in Window_Bits_Type := Default_Window_Bits;
Header : in Header_Type := Default);
-- Decompressor initialization.
-- Default header type mean that ZLib default header is expecting in the
-- input compressed stream.
-- Header type None mean that no header is expecting in the input stream.
-- GZip header type mean that GZip header is expecting in the
-- input compressed stream.
-- Auto header type mean that header type (GZip or Native) would be
-- detected automatically in the input stream.
-- Note that header types parameter values None, GZip and Auto are
-- supported for inflate routine only in ZLib versions 1.2.0.2 and later.
-- Deflate_Init is supporting all header types.
function Is_Open (Filter : in Filter_Type) return Boolean;
pragma Inline (Is_Open);
-- Is the filter opened for compression or decompression.
procedure Close
(Filter : in out Filter_Type;
Ignore_Error : in Boolean := False);
-- Closing the compression or decompressor.
-- If stream is closing before the complete and Ignore_Error is False,
-- The exception would be raised.
generic
with procedure Data_In
(Item : out Ada.Streams.Stream_Element_Array;
Last : out Ada.Streams.Stream_Element_Offset);
with procedure Data_Out
(Item : in Ada.Streams.Stream_Element_Array);
procedure Generic_Translate
(Filter : in out Filter_Type;
In_Buffer_Size : in Integer := Default_Buffer_Size;
Out_Buffer_Size : in Integer := Default_Buffer_Size);
-- Compress/decompress data fetch from Data_In routine and pass the result
-- to the Data_Out routine. User should provide Data_In and Data_Out
-- for compression/decompression data flow.
-- Compression or decompression depend on Filter initialization.
function Total_In (Filter : in Filter_Type) return Count;
pragma Inline (Total_In);
-- Returns total number of input bytes read so far
function Total_Out (Filter : in Filter_Type) return Count;
pragma Inline (Total_Out);
-- Returns total number of bytes output so far
function CRC32
(CRC : in Unsigned_32;
Data : in Ada.Streams.Stream_Element_Array)
return Unsigned_32;
pragma Inline (CRC32);
-- Compute CRC32, it could be necessary for make gzip format
procedure CRC32
(CRC : in out Unsigned_32;
Data : in Ada.Streams.Stream_Element_Array);
pragma Inline (CRC32);
-- Compute CRC32, it could be necessary for make gzip format
-------------------------------------------------
-- Below is more complex low level routines. --
-------------------------------------------------
procedure Translate
(Filter : in out Filter_Type;
In_Data : in Ada.Streams.Stream_Element_Array;
In_Last : out Ada.Streams.Stream_Element_Offset;
Out_Data : out Ada.Streams.Stream_Element_Array;
Out_Last : out Ada.Streams.Stream_Element_Offset;
Flush : in Flush_Mode);
-- Compress/decompress the In_Data buffer and place the result into
-- Out_Data. In_Last is the index of last element from In_Data accepted by
-- the Filter. Out_Last is the last element of the received data from
-- Filter. To tell the filter that incoming data are complete put the
-- Flush parameter to Finish.
function Stream_End (Filter : in Filter_Type) return Boolean;
pragma Inline (Stream_End);
-- Return the true when the stream is complete.
procedure Flush
(Filter : in out Filter_Type;
Out_Data : out Ada.Streams.Stream_Element_Array;
Out_Last : out Ada.Streams.Stream_Element_Offset;
Flush : in Flush_Mode);
pragma Inline (Flush);
-- Flushing the data from the compressor.
generic
with procedure Write
(Item : in Ada.Streams.Stream_Element_Array);
-- User should provide this routine for accept
-- compressed/decompressed data.
Buffer_Size : in Ada.Streams.Stream_Element_Offset
:= Default_Buffer_Size;
-- Buffer size for Write user routine.
procedure Write
(Filter : in out Filter_Type;
Item : in Ada.Streams.Stream_Element_Array;
Flush : in Flush_Mode := No_Flush);
-- Compress/Decompress data from Item to the generic parameter procedure
-- Write. Output buffer size could be set in Buffer_Size generic parameter.
generic
with procedure Read
(Item : out Ada.Streams.Stream_Element_Array;
Last : out Ada.Streams.Stream_Element_Offset);
-- User should provide data for compression/decompression
-- thru this routine.
Buffer : in out Ada.Streams.Stream_Element_Array;
-- Buffer for keep remaining data from the previous
-- back read.
Rest_First, Rest_Last : in out Ada.Streams.Stream_Element_Offset;
-- Rest_First have to be initialized to Buffer'Last + 1
-- Rest_Last have to be initialized to Buffer'Last
-- before usage.
Allow_Read_Some : in Boolean := False;
-- Is it allowed to return Last < Item'Last before end of data.
procedure Read
(Filter : in out Filter_Type;
Item : out Ada.Streams.Stream_Element_Array;
Last : out Ada.Streams.Stream_Element_Offset;
Flush : in Flush_Mode := No_Flush);
-- Compress/Decompress data from generic parameter procedure Read to the
-- Item. User should provide Buffer and initialized Rest_First, Rest_Last
-- indicators. If Allow_Read_Some is True, Read routines could return
-- Last < Item'Last only at end of stream.
private
use Ada.Streams;
pragma Assert (Ada.Streams.Stream_Element'Size = 8);
pragma Assert (Ada.Streams.Stream_Element'Modulus = 2**8);
type Flush_Mode is new Integer range 0 .. 5;
type Compression_Method is new Integer range 8 .. 8;
type Strategy_Type is new Integer range 0 .. 3;
No_Flush : constant Flush_Mode := 0;
Partial_Flush : constant Flush_Mode := 1;
Sync_Flush : constant Flush_Mode := 2;
Full_Flush : constant Flush_Mode := 3;
Finish : constant Flush_Mode := 4;
Block_Flush : constant Flush_Mode := 5;
Filtered : constant Strategy_Type := 1;
Huffman_Only : constant Strategy_Type := 2;
RLE : constant Strategy_Type := 3;
Default_Strategy : constant Strategy_Type := 0;
Deflated : constant Compression_Method := 8;
type Z_Stream;
type Z_Stream_Access is access all Z_Stream;
type Filter_Type is tagged limited record
Strm : Z_Stream_Access;
Compression : Boolean;
Stream_End : Boolean;
Header : Header_Type;
CRC : Unsigned_32;
Offset : Stream_Element_Offset;
-- Offset for gzip header/footer output.
end record;
end ZLib;
|
package ARM_Input is
--
-- Ada reference manual formatter (ARM_Form).
--
-- This package contains the abstract definition of reading an input file
-- or other entity, and routines to lex the input entities.
--
-- ---------------------------------------
-- Copyright 2000, 2002, 2004, 2011
-- AXE Consultants. All rights reserved.
-- P.O. Box 1512, Madison WI 53701
-- E-Mail: randy@rrsoftware.com
--
-- ARM_Form is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License version 3
-- as published by the Free Software Foundation.
--
-- AXE CONSULTANTS MAKES THIS TOOL AND SOURCE CODE AVAILABLE ON AN "AS IS"
-- BASIS AND MAKES NO WARRANTY, EXPRESS OR IMPLIED, AS TO THE ACCURACY,
-- CAPABILITY, EFFICIENCY, MERCHANTABILITY, OR FUNCTIONING OF THIS TOOL.
-- IN NO EVENT WILL AXE CONSULTANTS BE LIABLE FOR ANY GENERAL,
-- CONSEQUENTIAL, INDIRECT, INCIDENTAL, EXEMPLARY, OR SPECIAL DAMAGES,
-- EVEN IF AXE CONSULTANTS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-- DAMAGES.
--
-- A copy of the GNU General Public License is available in the file
-- gpl-3-0.txt in the standard distribution of the ARM_Form tool.
-- Otherwise, see <http://www.gnu.org/licenses/>.
--
-- If the GPLv3 license is not satisfactory for your needs, a commercial
-- use license is available for this tool. Contact Randy at AXE Consultants
-- for more information.
--
-- ---------------------------------------
--
-- Edit History:
--
-- 5/15/00 - RLB - Created base package.
-- 7/18/02 - RLB - Added Check_One_of_Parameter_Names.
-- 12/06/04 - RLB - Expanded Check_One_of_Parameter_Names to take up to
-- five names.
-- 10/18/11 - RLB - Changed to GPLv3 license.
type Input_Type is abstract tagged limited null record;
MAX_RECORDING_SIZE : constant := 4000;
Not_Valid_Error : exception; -- The Input_Object is not valid.
-- procedure Open (Input_Object : in out Input_Type;
-- -- Other parameters) is abstract;
-- Open an input object for an entity.
-- Each concrete type has its own Open routine, with possibly
-- different parameters.
procedure Close (Input_Object : in out Input_Type) is abstract;
-- Close the input object (entity).
-- May propagate exceptions from the underlying implementation
-- (that is, I/O exceptions).
procedure Get_Char (Input_Object : in out Input_Type;
Char : out Character) is abstract;
-- We represent end of line by Ascii.LF, and end of file by
-- Ascii.SUB.
-- Raises: Not_Valid_Error if Input_Object is not valid (open).
procedure Replace_Char (Input_Object : in out Input_Type) is abstract;
-- Replaces the last character read (with Get_Char); the next call
-- to Get_Char will return it.
-- Raises: Not_Valid_Error if Input_Object is not valid (open).
function Line_String (Input_Object : in Input_Type) return String is abstract;
-- Returns a string representing the line number and entity.
-- Usually used in error messages.
-- Raises: Not_Valid_Error if Input_Object is not valid (open).
procedure Start_Recording (Input_Object : in out Input_Type) is abstract;
-- Start recording all characters read into a local buffer.
-- Use this when text needs to be formatted into the output
-- file *and* be saved for future use.
-- Raises: Not_Valid_Error if Input_Object is not valid (open).
procedure Stop_Recording_and_Read_Result
(Input_Object : in out Input_Type; Result : out String;
Len : out Natural) is abstract;
-- Stop recording characters read. Put the result into Result,
-- and the number of characters written into Len.
-- Raises: Not_Valid_Error if Input_Object is not valid (open).
-- Lexical routines:
subtype Command_Name_Type is String (1 .. 40);
function Is_Open_Char (Open_Char : in Character) return Boolean;
-- Return True if character is a parameter opening character
-- ('<', '[', '{', '('), and False otherwise.
function Get_Close_Char (Open_Char : in Character) return Character;
-- Return the parameter closing character for an opening character.
-- Raises Not_Valid_Error if Open_Char is not an opening character
-- ('<', '[', '{', '(').
function Get_Open_Char (Close_Char : in Character) return Character;
-- Return the parameter opening character for an closing character.
-- Raises Not_Valid_Error if Open_Char is not an closing character
-- ('>', ']', '}', ')').
procedure Get_Name (Input_Object : in out Input_Type'Class;
Name : out ARM_Input.Command_Name_Type;
Null_Name_Allowed : in Boolean := False);
-- Get a name from the Input_Object. "Names" are sequences of
-- alphanumeric characters. If Null_Name_Allowed is False,
-- an error is produced if no name is found.
procedure Copy_to_String_until_Close_Char
(Input_Object : in out Input_Type'Class;
Close_Char : in Character;
Buffer : out String;
Len : out Natural);
-- Copy text from Input_Object to Buffer until the matching
-- Close_Char is found. Len is the number of characters copied.
-- Use this when we only need a string; use recording when we
-- need the string *and* we still must process the type.
procedure Skip_until_Close_Char
(Input_Object : in out Input_Type'Class;
Close_Char : in Character);
-- Skip text from Input_Object until the matching Close_Char is found.
procedure Check_Parameter_Name (Input_Object : in out Input_Type'Class;
Param_Name : in ARM_Input.Command_Name_Type;
Is_First : in Boolean;
Param_Close_Bracket : out Character);
-- Check that the name of a parameter (if any) is Param_Name.
-- This is the first parameter is Is_First is True; otherwise
-- it is a later parameter. (For a later parameter, we'll skip
-- the comma and any whitespace.)
-- If the parameter has an argument, the opening character will
-- be read, and the closing character will be returned in
-- in Param_Close_Bracket. If the parameter wasn't found, an
-- error message will be produced, and Param_Close_Bracket will
-- be set to ' '.
subtype Param_Num is Natural range 0 .. 5;
procedure Check_One_of_Parameter_Names (
Input_Object : in out Input_Type'Class;
Param_Name_1 : in ARM_Input.Command_Name_Type;
Param_Name_2 : in ARM_Input.Command_Name_Type;
Param_Name_3 : in ARM_Input.Command_Name_Type := (others => ' ');
Param_Name_4 : in ARM_Input.Command_Name_Type := (others => ' ');
Param_Name_5 : in ARM_Input.Command_Name_Type := (others => ' ');
Is_First : in Boolean;
Param_Close_Bracket : out Character;
Param_Found : out Param_Num);
-- Check that the name of a parameter (if any) is one of the given
-- names. If the parameter is set to all blanks, it is not used.
-- This is the first parameter is Is_First is True;
-- otherwise it is a later parameter. (For a later parameter, we'll
-- skip the comma and any whitespace.)
-- Param_Found will be set to the number of the parameter that was
-- found.
-- If the parameter has an argument, the opening character will
-- be read, and the closing character will be returned in
-- in Param_Close_Bracket. If the parameter wasn't found, an
-- error message will be produced, Param_Close_Bracket will
-- be set to ' ', and Param_Found will be set to 0.
end ARM_Input;
|
with MSP430_SVD.USCI_A0_SPI_MODE; use MSP430_SVD.USCI_A0_SPI_MODE;
with MSP430_SVD.USCI_B0_SPI_MODE; use MSP430_SVD.USCI_B0_SPI_MODE;
with MSP430_SVD.SPECIAL_FUNCTION; use MSP430_SVD.SPECIAL_FUNCTION;
package body MSPGD.SPI.Peripheral is
procedure Init is
use MSPGD.Clock;
Baud_Rate_Div : constant UInt32 := UInt32 (Clock.Frequency) / Speed;
begin
case Module is
when USCI_A =>
USCI_A0_SPI_MODE_Periph.UCA0CTL1_SPI.UCSWRST := 1;
case Clock.Source is
when ACLK => USCI_A0_SPI_MODE_Periph.UCA0CTL1_SPI.UCSSEL := UCSSEL_1;
when SMCLK => USCI_A0_SPI_MODE_Periph.UCA0CTL1_SPI.UCSSEL := UCSSEL_2;
when others => null;
end case;
USCI_A0_SPI_MODE_Periph.UCA0BR0_SPI := Byte (Baud_Rate_Div mod 256);
USCI_A0_SPI_MODE_Periph.UCA0BR1_SPI := Byte ((Baud_Rate_Div / 256) mod 256);
USCI_A0_SPI_MODE_Periph.UCA0CTL0_SPI := (
UCMSB => 1,
UCMST => 1,
UCSYNC => 1,
UCCKPH => (if Mode = Mode_0 or else Mode = Mode_2 then 1 else 0),
UCCKPL => (if Mode = Mode_1 or else Mode = Mode_3 then 1 else 0),
UCMODE => Ucmode_0,
others => 0
);
USCI_A0_SPI_MODE_Periph.UCA0CTL1_SPI.UCSWRST := 0;
when USCI_B =>
USCI_B0_SPI_MODE_Periph.UCB0CTL1_SPI.UCSWRST := 1;
case Clock.Source is
when ACLK => USCI_B0_SPI_MODE_Periph.UCB0CTL1_SPI.UCSSEL := UCSSEL_1;
when SMCLK => USCI_B0_SPI_MODE_Periph.UCB0CTL1_SPI.UCSSEL := UCSSEL_2;
when others => null;
end case;
USCI_B0_SPI_MODE_Periph.UCB0BR0_SPI := Byte (Baud_Rate_Div mod 256);
USCI_B0_SPI_MODE_Periph.UCB0BR1_SPI := Byte ((Baud_Rate_Div / 256) mod 256);
USCI_B0_SPI_MODE_Periph.UCB0CTL0_SPI := (
UCMSB => 1,
UCMST => 1,
UCSYNC => 1,
UCCKPH => (if Mode = Mode_0 or else Mode = Mode_2 then 1 else 0),
UCCKPL => (if Mode = Mode_1 or else Mode = Mode_3 then 1 else 0),
UCMODE => Ucmode_0,
others => 0
);
USCI_B0_SPI_MODE_Periph.UCB0CTL1_SPI.UCSWRST := 0;
end case;
end Init;
procedure Wait_For_TX_Complete is
begin
case Module is
when USCI_A => while SPECIAL_FUNCTION_Periph.IFG2.UCA0TXIFG = 0 loop null; end loop;
when USCI_B => while SPECIAL_FUNCTION_Periph.IFG2.UCB0TXIFG = 0 loop null; end loop;
end case;
end Wait_For_TX_Complete;
procedure Wait_For_RX_Complete is
begin
case Module is
when USCI_A => while SPECIAL_FUNCTION_Periph.IFG2.UCA0RXIFG = 0 loop null; end loop;
when USCI_B => while SPECIAL_FUNCTION_Periph.IFG2.UCB0RXIFG = 0 loop null; end loop;
end case;
end Wait_For_RX_Complete;
procedure Transfer (Data : in out Unsigned_8) is
begin
Wait_For_TX_Complete;
case Module is
when USCI_A => USCI_A0_SPI_MODE_Periph.UCA0TXBUF_SPI := Byte (Data);
when USCI_B => USCI_B0_SPI_MODE_Periph.UCB0TXBUF_SPI := Byte (Data);
end case;
Wait_For_RX_Complete;
case Module is
when USCI_A => Data := Unsigned_8 (USCI_A0_SPI_MODE_Periph.UCA0RXBUF_SPI);
when USCI_B => Data := Unsigned_8 (USCI_B0_SPI_MODE_Periph.UCB0RXBUF_SPI);
end case;
end Transfer;
procedure Transfer (Data : in out Buffer_Type) is
begin
for I in Data'Range loop
Transfer (Data (I));
end loop;
end Transfer;
procedure Send (Data : in Unsigned_8) is
D : Unsigned_8 := Data;
begin
Transfer (D);
end Send;
procedure Send (Data : in Buffer_Type) is
begin
for D of Data loop
Send (D);
end loop;
end Send;
procedure Receive (Data : out Unsigned_8) is
D : Unsigned_8 := 0;
begin
Transfer (D);
Data := D;
end Receive;
procedure Receive (Data : out Buffer_Type) is
begin
for I in Data'Range loop
Receive (Data (I));
end loop;
end Receive;
end MSPGD.SPI.Peripheral;
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Localization, Internationalization, Globalization for Ada --
-- --
-- Tools Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2010, 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 Ada.Containers.Vectors;
with Ada.Strings.Wide_Unbounded;
with Asis;
package Parser_Extractor is
package Unbounded_Wide_String_Vectors is
new Ada.Containers.Vectors
(Positive,
Ada.Strings.Wide_Unbounded.Unbounded_Wide_String,
Ada.Strings.Wide_Unbounded."=");
type Choice_Information (Is_Empty : Boolean := True) is record
case Is_Empty is
when True =>
null;
when False =>
Choice : Positive;
Line : Positive;
File : Ada.Strings.Wide_Unbounded.Unbounded_Wide_String;
Text : Unbounded_Wide_String_Vectors.Vector;
end case;
end record;
package Choice_Vectors is
new Ada.Containers.Vectors (Positive, Choice_Information);
type Pair is record
First : Integer;
Second : Integer;
end record;
subtype Pairs_Index is Integer range -1 .. Integer'Last;
package Pair_Vectors is new Ada.Containers.Vectors (Pairs_Index, Pair);
package Integer_Vectors is
new Ada.Containers.Vectors (Natural, Integer);
YY_Goto_Matrix : Pair_Vectors.Vector;
YY_Goto_Offset : Integer_Vectors.Vector;
YY_Rule_Length : Integer_Vectors.Vector;
YY_Get_LHS_Rule : Integer_Vectors.Vector;
YY_Shift_Reduce_Matrix : Pair_Vectors.Vector;
YY_Shift_Reduce_Offset : Integer_Vectors.Vector;
YY_Default : Integer;
YY_First_Shift_Entry : Integer;
YY_Accept_Code : Integer;
YY_Error_Code : Integer;
Choices : Choice_Vectors.Vector;
procedure Extract (Element : Asis.Element);
end Parser_Extractor;
|
with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;
procedure euler52 is
type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PInt(i : in Integer) is
begin
String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;
function chiffre_sort(a : in Integer) return Integer is
e : Integer;
d : Integer;
c : Integer;
b : Integer;
begin
if a < 10
then
return a;
else
b := chiffre_sort(a / 10);
c := a rem 10;
d := b rem 10;
e := b / 10;
if c < d
then
return c + b * 10;
else
return d + chiffre_sort(c + e * 10) * 10;
end if;
end if;
end;
function same_numbers(a : in Integer; b : in Integer; c : in Integer; d : in Integer; e : in Integer; f : in Integer) return Boolean is
ca : Integer;
begin
ca := chiffre_sort(a);
return (((ca = chiffre_sort(b) and then ca = chiffre_sort(c)) and then ca = chiffre_sort(d)) and then ca = chiffre_sort(e)) and then ca = chiffre_sort(f);
end;
num : Integer;
begin
num := 142857;
if same_numbers(num, num * 2, num * 3, num * 4, num * 6, num * 5)
then
PInt(num);
PString(new char_array'( To_C(" ")));
PInt(num * 2);
PString(new char_array'( To_C(" ")));
PInt(num * 3);
PString(new char_array'( To_C(" ")));
PInt(num * 4);
PString(new char_array'( To_C(" ")));
PInt(num * 5);
PString(new char_array'( To_C(" ")));
PInt(num * 6);
PString(new char_array'( To_C("" & Character'Val(10))));
end if;
end;
|
----------------------------------------------------------------
-- ZLib for Ada thick binding. --
-- --
-- Copyright (C) 2002-2003 Dmitriy Anisimkov --
-- --
-- Open source license information is in the zlib.ads file. --
----------------------------------------------------------------
-- $Id: zlib-thin.adb,v 1.8 2003/12/14 18:27:31 vagul Exp $
package body ZLib.Thin is
ZLIB_VERSION : constant Chars_Ptr := zlibVersion;
Z_Stream_Size : constant Int := Z_Stream'Size / System.Storage_Unit;
--------------
-- Avail_In --
--------------
function Avail_In (Strm : in Z_Stream) return UInt is
begin
return Strm.Avail_In;
end Avail_In;
---------------
-- Avail_Out --
---------------
function Avail_Out (Strm : in Z_Stream) return UInt is
begin
return Strm.Avail_Out;
end Avail_Out;
------------------
-- Deflate_Init --
------------------
function Deflate_Init
(strm : Z_Streamp;
level : Int;
method : Int;
windowBits : Int;
memLevel : Int;
strategy : Int)
return Int is
begin
return deflateInit2
(strm,
level,
method,
windowBits,
memLevel,
strategy,
ZLIB_VERSION,
Z_Stream_Size);
end Deflate_Init;
------------------
-- Inflate_Init --
------------------
function Inflate_Init (strm : Z_Streamp; windowBits : Int) return Int is
begin
return inflateInit2 (strm, windowBits, ZLIB_VERSION, Z_Stream_Size);
end Inflate_Init;
------------------------
-- Last_Error_Message --
------------------------
function Last_Error_Message (Strm : in Z_Stream) return String is
use Interfaces.C.Strings;
begin
if Strm.msg = Null_Ptr then
return "";
else
return Value (Strm.msg);
end if;
end Last_Error_Message;
------------
-- Set_In --
------------
procedure Set_In
(Strm : in out Z_Stream;
Buffer : in Voidp;
Size : in UInt) is
begin
Strm.Next_In := Buffer;
Strm.Avail_In := Size;
end Set_In;
------------------
-- Set_Mem_Func --
------------------
procedure Set_Mem_Func
(Strm : in out Z_Stream;
Opaque : in Voidp;
Alloc : in alloc_func;
Free : in free_func) is
begin
Strm.opaque := Opaque;
Strm.zalloc := Alloc;
Strm.zfree := Free;
end Set_Mem_Func;
-------------
-- Set_Out --
-------------
procedure Set_Out
(Strm : in out Z_Stream;
Buffer : in Voidp;
Size : in UInt) is
begin
Strm.Next_Out := Buffer;
Strm.Avail_Out := Size;
end Set_Out;
--------------
-- Total_In --
--------------
function Total_In (Strm : in Z_Stream) return ULong is
begin
return Strm.Total_In;
end Total_In;
---------------
-- Total_Out --
---------------
function Total_Out (Strm : in Z_Stream) return ULong is
begin
return Strm.Total_Out;
end Total_Out;
end ZLib.Thin;
|
package body Test_Subtypes.Write is
File_Name : constant String := "tmp/test-subtypes-write.sf";
procedure Initialize (T : in out Test) is
begin
Set_Name (T, "Test_Subtypes.Write");
Ahven.Framework.Add_Test_Routine (T, Check_Types'Access, "read written subtypes");
Ahven.Framework.Add_Test_Routine (T, Check_Fields_A'Access, "a: all fields are self-references");
Ahven.Framework.Add_Test_Routine (T, Check_Fields_B'Access, "b: all fields are self-references");
Ahven.Framework.Add_Test_Routine (T, Check_Fields_C'Access, "c: all fields are self-references");
Ahven.Framework.Add_Test_Routine (T, Check_Fields_D'Access, "d: all fields are self-references");
end Initialize;
procedure Set_Up (T : in out Test) is
State : access Skill_State := new Skill_State;
begin
Skill.Read (State, "resources/localBasePoolStartIndex.sf");
Skill.Write (State, File_Name);
end Set_Up;
procedure Tear_Down (T : in out Test) is
begin
Ada.Directories.Delete_File (File_Name);
end Tear_Down;
procedure Check_Types (T : in out Ahven.Framework.Test_Case'Class) is
use Ada.Characters.Handling;
use Ada.Strings.Fixed;
use Ada.Tags;
State : access Skill_State := new Skill_State;
begin
Skill.Read (State, File_Name);
declare
Types : constant String := "aaabbbbbdddcc";
begin
for I in Types'Range loop
declare
Object : Skill_Type'Class := Get_A (State, I).all;
C : Character := To_Lower (Expanded_Name (Object'Tag)(10));
begin
Ahven.Assert (Types (I) = C, "index " & Trim (I'Img, Ada.Strings.Left));
end;
end loop;
end;
end Check_Types;
procedure Check_Fields_A (T : in out Ahven.Framework.Test_Case'Class) is
use Ada.Strings.Fixed;
State : access Skill_State := new Skill_State;
begin
Skill.Read (State, File_Name);
for I in 1 .. As_Size (State) loop
declare
X : A_Type_Access := Get_A (State, I);
begin
Ahven.Assert (X = X.Get_A, "index " & Trim (I'Img, Ada.Strings.Left));
end;
end loop;
end Check_Fields_A;
procedure Check_Fields_B (T : in out Ahven.Framework.Test_Case'Class) is
use Ada.Strings.Fixed;
State : access Skill_State := new Skill_State;
begin
Skill.Read (State, File_Name);
for I in 1 .. Bs_Size (State) loop
declare
X : B_Type_Access := Get_B (State, I);
begin
Ahven.Assert (X = X.Get_B, "index " & Trim (I'Img, Ada.Strings.Left));
end;
end loop;
end Check_Fields_B;
procedure Check_Fields_C (T : in out Ahven.Framework.Test_Case'Class) is
use Ada.Strings.Fixed;
State : access Skill_State := new Skill_State;
begin
Skill.Read (State, File_Name);
for I in 1 .. Cs_Size (State) loop
declare
X : C_Type_Access := Get_C (State, I);
begin
Ahven.Assert (X = X.Get_C, "index " & Trim (I'Img, Ada.Strings.Left));
end;
end loop;
end Check_Fields_C;
procedure Check_Fields_D (T : in out Ahven.Framework.Test_Case'Class) is
use Ada.Strings.Fixed;
State : access Skill_State := new Skill_State;
begin
Skill.Read (State, File_Name);
for I in 1 .. Ds_Size (State) loop
declare
X : D_Type_Access := Get_D (State, I);
begin
Ahven.Assert (X = X.Get_D, "index " & Trim (I'Img, Ada.Strings.Left));
end;
end loop;
end Check_Fields_D;
end Test_Subtypes.Write;
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 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 file is generated, don't edit it.
------------------------------------------------------------------------------
with AMF.CMOF.Associations;
with AMF.CMOF.Classes;
with AMF.CMOF.Data_Types;
with AMF.Factories.Utp_Factories;
with AMF.Links;
with AMF.Utp.Coding_Rules;
with AMF.Utp.Data_Partitions;
with AMF.Utp.Data_Pools;
with AMF.Utp.Data_Selectors;
with AMF.Utp.Default_Applications;
with AMF.Utp.Defaults;
with AMF.Utp.Determ_Alts;
with AMF.Utp.Finish_Actions;
with AMF.Utp.Get_Timezone_Actions;
with AMF.Utp.Literal_Anies;
with AMF.Utp.Literal_Any_Or_Nulls;
with AMF.Utp.Log_Actions;
with AMF.Utp.Managed_Elements;
with AMF.Utp.Read_Timer_Actions;
with AMF.Utp.SUTs;
with AMF.Utp.Set_Timezone_Actions;
with AMF.Utp.Start_Timer_Actions;
with AMF.Utp.Stop_Timer_Actions;
with AMF.Utp.Test_Cases;
with AMF.Utp.Test_Components;
with AMF.Utp.Test_Contexts;
with AMF.Utp.Test_Log_Applications;
with AMF.Utp.Test_Logs;
with AMF.Utp.Test_Objectives;
with AMF.Utp.Test_Suites;
with AMF.Utp.Time_Out_Actions;
with AMF.Utp.Time_Out_Messages;
with AMF.Utp.Time_Outs;
with AMF.Utp.Timer_Running_Actions;
with AMF.Utp.Validation_Actions;
with League.Holders;
package AMF.Internals.Factories.Utp_Factories is
type Utp_Factory is
limited new AMF.Internals.Factories.Metamodel_Factory_Base
and AMF.Factories.Utp_Factories.Utp_Factory with null record;
overriding function Convert_To_String
(Self : not null access Utp_Factory;
Data_Type : not null access AMF.CMOF.Data_Types.CMOF_Data_Type'Class;
Value : League.Holders.Holder) return League.Strings.Universal_String;
overriding function Create
(Self : not null access Utp_Factory;
Meta_Class : not null access AMF.CMOF.Classes.CMOF_Class'Class)
return not null AMF.Elements.Element_Access;
overriding function Create_From_String
(Self : not null access Utp_Factory;
Data_Type : not null access AMF.CMOF.Data_Types.CMOF_Data_Type'Class;
Image : League.Strings.Universal_String) return League.Holders.Holder;
overriding function Create_Link
(Self : not null access Utp_Factory;
Association :
not null access AMF.CMOF.Associations.CMOF_Association'Class;
First_Element : not null AMF.Elements.Element_Access;
Second_Element : not null AMF.Elements.Element_Access)
return not null AMF.Links.Link_Access;
overriding function Get_Package
(Self : not null access constant Utp_Factory)
return AMF.CMOF.Packages.Collections.Set_Of_CMOF_Package;
function Constructor
(Extent : AMF.Internals.AMF_Extent)
return not null AMF.Factories.Factory_Access;
function Get_Package return not null AMF.CMOF.Packages.CMOF_Package_Access;
function Create_Coding_Rule
(Self : not null access Utp_Factory)
return AMF.Utp.Coding_Rules.Utp_Coding_Rule_Access;
function Create_Data_Partition
(Self : not null access Utp_Factory)
return AMF.Utp.Data_Partitions.Utp_Data_Partition_Access;
function Create_Data_Pool
(Self : not null access Utp_Factory)
return AMF.Utp.Data_Pools.Utp_Data_Pool_Access;
function Create_Data_Selector
(Self : not null access Utp_Factory)
return AMF.Utp.Data_Selectors.Utp_Data_Selector_Access;
function Create_Default
(Self : not null access Utp_Factory)
return AMF.Utp.Defaults.Utp_Default_Access;
function Create_Default_Application
(Self : not null access Utp_Factory)
return AMF.Utp.Default_Applications.Utp_Default_Application_Access;
function Create_Determ_Alt
(Self : not null access Utp_Factory)
return AMF.Utp.Determ_Alts.Utp_Determ_Alt_Access;
function Create_Finish_Action
(Self : not null access Utp_Factory)
return AMF.Utp.Finish_Actions.Utp_Finish_Action_Access;
function Create_Get_Timezone_Action
(Self : not null access Utp_Factory)
return AMF.Utp.Get_Timezone_Actions.Utp_Get_Timezone_Action_Access;
function Create_Literal_Any
(Self : not null access Utp_Factory)
return AMF.Utp.Literal_Anies.Utp_Literal_Any_Access;
function Create_Literal_Any_Or_Null
(Self : not null access Utp_Factory)
return AMF.Utp.Literal_Any_Or_Nulls.Utp_Literal_Any_Or_Null_Access;
function Create_Log_Action
(Self : not null access Utp_Factory)
return AMF.Utp.Log_Actions.Utp_Log_Action_Access;
function Create_Managed_Element
(Self : not null access Utp_Factory)
return AMF.Utp.Managed_Elements.Utp_Managed_Element_Access;
function Create_Read_Timer_Action
(Self : not null access Utp_Factory)
return AMF.Utp.Read_Timer_Actions.Utp_Read_Timer_Action_Access;
function Create_SUT
(Self : not null access Utp_Factory)
return AMF.Utp.SUTs.Utp_SUT_Access;
function Create_Set_Timezone_Action
(Self : not null access Utp_Factory)
return AMF.Utp.Set_Timezone_Actions.Utp_Set_Timezone_Action_Access;
function Create_Start_Timer_Action
(Self : not null access Utp_Factory)
return AMF.Utp.Start_Timer_Actions.Utp_Start_Timer_Action_Access;
function Create_Stop_Timer_Action
(Self : not null access Utp_Factory)
return AMF.Utp.Stop_Timer_Actions.Utp_Stop_Timer_Action_Access;
function Create_Test_Case
(Self : not null access Utp_Factory)
return AMF.Utp.Test_Cases.Utp_Test_Case_Access;
function Create_Test_Component
(Self : not null access Utp_Factory)
return AMF.Utp.Test_Components.Utp_Test_Component_Access;
function Create_Test_Context
(Self : not null access Utp_Factory)
return AMF.Utp.Test_Contexts.Utp_Test_Context_Access;
function Create_Test_Log
(Self : not null access Utp_Factory)
return AMF.Utp.Test_Logs.Utp_Test_Log_Access;
function Create_Test_Log_Application
(Self : not null access Utp_Factory)
return AMF.Utp.Test_Log_Applications.Utp_Test_Log_Application_Access;
function Create_Test_Objective
(Self : not null access Utp_Factory)
return AMF.Utp.Test_Objectives.Utp_Test_Objective_Access;
function Create_Test_Suite
(Self : not null access Utp_Factory)
return AMF.Utp.Test_Suites.Utp_Test_Suite_Access;
function Create_Time_Out
(Self : not null access Utp_Factory)
return AMF.Utp.Time_Outs.Utp_Time_Out_Access;
function Create_Time_Out_Action
(Self : not null access Utp_Factory)
return AMF.Utp.Time_Out_Actions.Utp_Time_Out_Action_Access;
function Create_Time_Out_Message
(Self : not null access Utp_Factory)
return AMF.Utp.Time_Out_Messages.Utp_Time_Out_Message_Access;
function Create_Timer_Running_Action
(Self : not null access Utp_Factory)
return AMF.Utp.Timer_Running_Actions.Utp_Timer_Running_Action_Access;
function Create_Validation_Action
(Self : not null access Utp_Factory)
return AMF.Utp.Validation_Actions.Utp_Validation_Action_Access;
end AMF.Internals.Factories.Utp_Factories;
|
-----------------------------------------------------------------------
-- Util-texts -- Various Text Transformation Utilities
-- Copyright (C) 2001, 2002, 2003, 2009, 2010 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.
-----------------------------------------------------------------------
generic
type Stream is limited private;
type Char is (<>);
type Input is array (Positive range <>) of Char;
with procedure Put (Buffer : in out Stream; C : in Character);
with function To_Upper (C : Char) return Char;
with function To_Lower (C : Char) return Char;
with function To_Input (S : Stream) return Input;
package Util.Texts.Transforms is
pragma Preelaborate;
-- Capitalize the string into the result stream.
procedure Capitalize (Content : in Input;
Into : in out Stream);
-- Capitalize the string
function Capitalize (Content : Input) return Input;
-- Translate the input string into an upper case string in the result stream.
procedure To_Upper_Case (Content : in Input;
Into : in out Stream);
-- Translate the input string into an upper case string.
function To_Upper_Case (Content : Input) return Input;
-- Translate the input string into a lower case string in the result stream.
procedure To_Lower_Case (Content : in Input;
Into : in out Stream);
function To_Lower_Case (Content : Input) return Input;
-- Write in the output stream the value as a \uNNNN encoding form.
procedure To_Hex (Into : in out Stream;
Value : in Char);
pragma Inline_Always (To_Hex);
-- Escape the content into the result stream using the JavaScript
-- escape rules.
procedure Escape_Java_Script (Content : in Input;
Into : in out Stream);
function Escape_Java_Script (Content : Input) return Input;
-- Escape the content into the result stream using the Java
-- escape rules.
procedure Escape_Java (Content : in Input;
Into : in out Stream);
function Escape_Java (Content : Input) return Input;
-- Escape the content into the result stream using the XML
-- escape rules:
-- '<' -> '<'
-- '>' -> '>'
-- ''' -> '''
-- '&' -> '&'
-- -> '&#nnn;' if Character'Pos >= 128
procedure Escape_Xml (Content : in Input;
Into : in out Stream);
function Escape_Xml (Content : Input) return Input;
-- Translate the XML entity represented by <tt>Entity</tt> into an UTF-8 sequence
-- in the output stream.
procedure Translate_Xml_Entity (Entity : in Input;
Into : in out Stream);
-- Unescape the XML entities from the content into the result stream.
-- For each XML entity found, call the <tt>Translator</tt> procedure who is responsible
-- for writing the result in the stream. The XML entity starts with '&' and ends with ';'.
-- The '&' and ';' are part of the entity when given to the translator. If the trailing
-- ';' is not part of the entity, it means the entity was truncated or the end of input
-- stream is reached.
procedure Unescape_Xml (Content : in Input;
Translator : not null access
procedure (Entity : in Input;
Into : in out Stream) := Translate_Xml_Entity'Access;
Into : in out Stream);
private
procedure Put (Into : in out Stream;
Value : in String);
procedure Escape_Java (Content : in Input;
Escape_Single_Quote : in Boolean;
Into : in out Stream);
end Util.Texts.Transforms;
|
-- Copyright 2014-2021 Free Software Foundation, Inc.
--
-- This program 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 3 of the License, or
-- (at your option) any later version.
--
-- This program 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 program. If not, see <http://www.gnu.org/licenses/>.
package body Pck is
procedure Increment (I : in out Integer) is
begin
I := I + 1;
end Increment;
end Pck;
|
with Ada.Numerics.Generic_Elementary_Functions;
package body Math is
package Float_Elementary_Functions is new Ada.Numerics.Generic_Elementary_Functions (Float);
use Float_Elementary_Functions;
function Hypot(P : Point2D) return Float is
X : constant Float := abs P(P'First);
Y : constant Float := abs P(P'Last);
Min_Coord : constant Float := Float'Min(X, Y);
Max_Coord : constant Float := Float'Max(X, Y);
Ratio : constant Float := Min_Coord / Max_Coord;
begin
return Max_Coord * Sqrt (1.0 + Ratio ** 2);
end;
end;
|
with Ada.Numerics.Generic_Elementary_Functions;
package body Planets is
package EF is new Ada.Numerics.Generic_Elementary_Functions (Orka.Float_64);
function Get_Vector
(Latitude, Longitude : Orka.Float_64) return Matrices.Vectors.Vector4
is
Lon_Rad : constant Orka.Float_64 := Matrices.Vectors.To_Radians (Longitude);
Lat_Rad : constant Orka.Float_64 := Matrices.Vectors.To_Radians (Latitude);
XY : constant Orka.Float_64 := EF.Cos (Lat_Rad);
X : constant Orka.Float_64 := XY * EF.Cos (Lon_Rad);
Y : constant Orka.Float_64 := XY * EF.Sin (Lon_Rad);
Z : constant Orka.Float_64 := EF.Sin (Lat_Rad);
begin
pragma Assert (Matrices.Vectors.Normalized ((X, Y, Z, 0.0)));
return (X, Y, Z, 1.0);
end Get_Vector;
function Flattened_Vector
(Planet : Planet_Characteristics;
Direction : Matrices.Vector4;
Altitude : Orka.Float_64) return Matrices.Vectors.Vector4
is
E2 : constant Orka.Float_64 := 2.0 * Planet.Flattening - Planet.Flattening**2;
N : constant Orka.Float_64 := Planet.Semi_Major_Axis /
EF.Sqrt (1.0 - E2 * Direction (Orka.Z)**2);
begin
return
(Direction (Orka.X) * (N + Altitude),
Direction (Orka.Y) * (N + Altitude),
Direction (Orka.Z) * (N * (1.0 - E2) + Altitude),
1.0);
end Flattened_Vector;
function Geodetic_To_ECEF
(Planet : Planet_Characteristics;
Latitude, Longitude, Altitude : Orka.Float_64) return Matrices.Vector4 is
begin
return Flattened_Vector (Planet, Get_Vector (Latitude, Longitude), Altitude);
end Geodetic_To_ECEF;
function Radius
(Planet : Planet_Characteristics;
Direction : Matrices.Vector4) return Orka.Float_64 is
begin
return Matrices.Vectors.Length (Flattened_Vector (Planet, Direction, 0.0));
end Radius;
function Radius
(Planet : Planet_Characteristics;
Latitude, Longitude : Orka.Float_64) return Orka.Float_64 is
begin
return Radius (Planet, Get_Vector (Latitude, Longitude));
end Radius;
end Planets;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.