CombinedText stringlengths 4 3.42M |
|---|
------------------------------------------------------------------------------
-- --
-- GNAT EXAMPLE --
-- --
-- Copyright (C) 2013, 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 Warnings (Off);
with System.STM32F4; use System.STM32F4;
pragma Warnings (On);
procedure Leds is
-- Bit definitions for RCC AHB1ENR register
RCC_AHB1ENR_GPIOD : constant Word := 16#08#;
GPIOD_Base : constant := AHB1_Peripheral_Base + 16#0C00#;
GPIOD : GPIO_Registers with Volatile,
Address => System'To_Address (GPIOD_Base);
pragma Import (Ada, GPIOD);
procedure Wait is
begin
for I in 1 .. 16#f_ffff# loop
null;
end loop;
end Wait;
begin
-- Enable clock for GPIO-D
RCC.AHB1ENR := RCC.AHB1ENR or RCC_AHB1ENR_GPIOD;
-- Configure PD12-15
declare
use GPIO;
begin
GPIOD.MODER (12 .. 15) := (others => Mode_OUT);
GPIOD.OTYPER (12 .. 15) := (others => Type_PP);
GPIOD.OSPEEDR (12 .. 15) := (others => Speed_100MHz);
GPIOD.PUPDR (12 .. 15) := (others => No_Pull);
end;
loop
-- On
GPIOD.BSRR := 16#f000#;
Wait;
-- Off
GPIOD.BSRR := 16#f000_0000#;
Wait;
end loop;
end Leds;
|
-- ////////////////////////////////////////////////////////////
-- //
-- // SFML - Simple and Fast Multimedia Library
-- // Copyright (C) 2007-2009 Laurent Gomila (laurent.gom@gmail.com)
-- //
-- // 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.
-- //
-- ////////////////////////////////////////////////////////////
package Sf.Network.SocketStatus is
-- ////////////////////////////////////////////////////////////
-- /// Define the status that can be returned by the socket
-- /// functions
-- ////////////////////////////////////////////////////////////
type sfSocketStatus is (sfSocketDone, sfSocketNotReady, sfSocketDisconnected, sfSocketError);
private
pragma Convention (C, sfSocketStatus);
end Sf.Network.SocketStatus;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . M U L T I P R O C E S S O R S . F A I R _ L O C K S --
-- --
-- B o d y --
-- --
-- Copyright (C) 2010, AdaCore --
-- --
-- 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. 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. --
-- --
-- --
-- --
-- --
-- --
-- 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/>. --
-- --
------------------------------------------------------------------------------
with System.OS_Interface;
package body System.Multiprocessors.Fair_Locks is
use System.Multiprocessors.Spin_Locks;
Multiprocessor : constant Boolean := CPU'Range_Length /= 1;
-- Set true if on multiprocessor (more than one CPU)
function Next_Spinning (Flock : Fair_Lock) return CPU;
pragma Inline (Next_Spinning);
-- Search for the next spinning CPU. If no one is spinning return the
-- current CPU.
----------------
-- Initialize --
----------------
procedure Initialize (Flock : in out Fair_Lock) is
begin
Unlock (Flock.Lock);
Flock.Spinning := (others => False);
end Initialize;
----------
-- Lock --
----------
procedure Lock (Flock : in out Fair_Lock) is
CPU_Id : constant CPU := System.OS_Interface.Current_CPU;
Succeeded : Boolean;
begin
-- Notify we are waiting for the lock
Flock.Spinning (CPU_Id) := True;
loop
Try_Lock (Flock.Lock, Succeeded);
if Succeeded then
-- We have the lock
Flock.Spinning (CPU_Id) := False;
return;
else
loop
if not Flock.Spinning (CPU_Id) then
-- Lock's owner gives us the lock
return;
end if;
-- Lock's owner left but didn't wake us up, retry to get lock
exit when not Locked (Flock.Lock);
end loop;
end if;
end loop;
end Lock;
------------
-- Locked --
------------
function Locked (Flock : Fair_Lock) return Boolean is
begin
return Locked (Flock.Lock);
end Locked;
-------------------
-- Next_Spinning --
-------------------
function Next_Spinning (Flock : Fair_Lock) return CPU is
Current : constant CPU := System.OS_Interface.Current_CPU;
CPU_Id : CPU := Current;
begin
if Multiprocessor then
-- Only for multiprocessor
loop
if CPU_Id = CPU'Last then
CPU_Id := CPU'First;
else
CPU_Id := CPU_Id + 1;
end if;
exit when Flock.Spinning (CPU_Id) or else CPU_Id = Current;
end loop;
end if;
return CPU_Id;
end Next_Spinning;
--------------
-- Try_Lock --
--------------
procedure Try_Lock (Flock : in out Fair_Lock; Succeeded : out Boolean) is
begin
Try_Lock (Flock.Lock, Succeeded);
end Try_Lock;
------------
-- Unlock --
------------
procedure Unlock (Flock : in out Fair_Lock) is
CPU_Id : constant CPU := Next_Spinning (Flock);
begin
if CPU_Id /= System.OS_Interface.Current_CPU then
-- Wake up the next spinning CPU
Flock.Spinning (CPU_Id) := False;
else
-- Nobody is waiting for the Lock
Unlock (Flock.Lock);
end if;
end Unlock;
end System.Multiprocessors.Fair_Locks;
|
-- Copyright 2007-2016 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 Foo is
I : Integer := 1;
begin
Call_Me (Int => 1, Flt => 2.0, Bln => True, Ary => (1, 4, 8), Chr => 'j',
Sad => I'Address, Rec => (A => 3, B => 7));
end Foo;
|
-- AOC 2020, Day 16
with Ada.Text_IO; use Ada.Text_IO;
with Day; use Day;
procedure main is
input : constant Tickets := load_file("input.txt");
error_rate : constant Natural := sum_error_rate(input);
depart : constant Long_Integer := departure_fields(input);
begin
put_line("Part 1: " & error_rate'IMAGE);
put_line("Part 2: " & depart'IMAGE);
end main;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . W C H _ W T S --
-- --
-- S p e c --
-- --
-- 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. --
-- --
------------------------------------------------------------------------------
-- This package contains the routine used to convert wide strings and wide
-- wide strings to strings for use by wide and wide wide character attributes
-- (value, image etc.) and also by the numeric IO subpackages of
-- Ada.Text_IO.Wide_Text_IO and Ada.Text_IO.Wide_Wide_Text_IO.
with System.WCh_Con;
package System.WCh_WtS is
pragma Pure;
function Wide_String_To_String
(S : Wide_String;
EM : System.WCh_Con.WC_Encoding_Method) return String;
-- This routine simply takes its argument and converts it to a string,
-- using the internal compiler escape sequence convention (defined in
-- package Widechar) to translate characters that are out of range
-- of type String. In the context of the Wide_Value attribute, the
-- argument is the original attribute argument, and the result is used
-- in a call to the corresponding Value attribute function. If the method
-- for encoding is a shift-in, shift-out convention, then it is assumed
-- that normal (non-wide character) mode holds at the start and end of
-- the result string. EM indicates the wide character encoding method.
-- Note: in the WCEM_Brackets case, we only use the brackets encoding
-- for characters greater than 16#FF#. The lowest index of the returned
-- String is equal to S'First.
function Wide_Wide_String_To_String
(S : Wide_Wide_String;
EM : System.WCh_Con.WC_Encoding_Method) return String;
-- Same processing, except for Wide_Wide_String
end System.WCh_WtS;
|
with Tkmrpc.Types;
package Tkmrpc.Contexts.ae
is
type ae_State_Type is
(clean,
-- Initial clean state.
invalid,
-- Error state.
stale,
-- AE context is stale.
unauth,
-- AE context is unauthenticated.
loc_auth,
-- Local identity of AE is authenticated.
authenticated,
-- AE is authenticated.
active
-- AE is authenticated and in use.
);
function Get_State
(Id : Types.ae_id_type)
return ae_State_Type
with
Pre => Is_Valid (Id);
function Is_Valid (Id : Types.ae_id_type) return Boolean;
-- Returns True if the given id has a valid value.
function Has_authag_id
(Id : Types.ae_id_type;
authag_id : Types.authag_id_type)
return Boolean
with
Pre => Is_Valid (Id);
-- Returns True if the context specified by id has the given
-- authag_id value.
function Has_ca_id
(Id : Types.ae_id_type;
ca_id : Types.ca_id_type)
return Boolean
with
Pre => Is_Valid (Id);
-- Returns True if the context specified by id has the given
-- ca_id value.
function Has_cc_not_after
(Id : Types.ae_id_type;
cc_not_after : Types.abs_time_type)
return Boolean
with
Pre => Is_Valid (Id);
-- Returns True if the context specified by id has the given
-- cc_not_after value.
function Has_cc_not_before
(Id : Types.ae_id_type;
cc_not_before : Types.abs_time_type)
return Boolean
with
Pre => Is_Valid (Id);
-- Returns True if the context specified by id has the given
-- cc_not_before value.
function Has_creation_time
(Id : Types.ae_id_type;
creation_time : Types.rel_time_type)
return Boolean
with
Pre => Is_Valid (Id);
-- Returns True if the context specified by id has the given
-- creation_time value.
function Has_dhag_id
(Id : Types.ae_id_type;
dhag_id : Types.dhag_id_type)
return Boolean
with
Pre => Is_Valid (Id);
-- Returns True if the context specified by id has the given
-- dhag_id value.
function Has_iag_id
(Id : Types.ae_id_type;
iag_id : Types.iag_id_type)
return Boolean
with
Pre => Is_Valid (Id);
-- Returns True if the context specified by id has the given
-- iag_id value.
function Has_initiator
(Id : Types.ae_id_type;
initiator : Types.init_type)
return Boolean
with
Pre => Is_Valid (Id);
-- Returns True if the context specified by id has the given
-- initiator value.
function Has_lc_id
(Id : Types.ae_id_type;
lc_id : Types.lc_id_type)
return Boolean
with
Pre => Is_Valid (Id);
-- Returns True if the context specified by id has the given
-- lc_id value.
function Has_nonce_loc
(Id : Types.ae_id_type;
nonce_loc : Types.nonce_type)
return Boolean
with
Pre => Is_Valid (Id);
-- Returns True if the context specified by id has the given
-- nonce_loc value.
function Has_nonce_rem
(Id : Types.ae_id_type;
nonce_rem : Types.nonce_type)
return Boolean
with
Pre => Is_Valid (Id);
-- Returns True if the context specified by id has the given
-- nonce_rem value.
function Has_ri_id
(Id : Types.ae_id_type;
ri_id : Types.ri_id_type)
return Boolean
with
Pre => Is_Valid (Id);
-- Returns True if the context specified by id has the given
-- ri_id value.
function Has_sk_ike_auth_loc
(Id : Types.ae_id_type;
sk_ike_auth_loc : Types.key_type)
return Boolean
with
Pre => Is_Valid (Id);
-- Returns True if the context specified by id has the given
-- sk_ike_auth_loc value.
function Has_sk_ike_auth_rem
(Id : Types.ae_id_type;
sk_ike_auth_rem : Types.key_type)
return Boolean
with
Pre => Is_Valid (Id);
-- Returns True if the context specified by id has the given
-- sk_ike_auth_rem value.
function Has_State
(Id : Types.ae_id_type;
State : ae_State_Type)
return Boolean
with
Pre => Is_Valid (Id);
-- Returns True if the context specified by id has the given
-- State value.
procedure activate
(Id : Types.ae_id_type)
with
Pre => Is_Valid (Id) and then
(Has_State (Id, authenticated)),
Post => Has_State (Id, active);
procedure authenticate
(Id : Types.ae_id_type;
ca_context : Types.ca_id_type;
authag_id : Types.authag_id_type;
ri_id : Types.ri_id_type;
not_before : Types.abs_time_type;
not_after : Types.abs_time_type)
with
Pre => Is_Valid (Id) and then
(Has_State (Id, loc_auth)),
Post => Has_State (Id, authenticated) and
Has_ca_id (Id, ca_context) and
Has_authag_id (Id, authag_id) and
Has_ri_id (Id, ri_id) and
Has_cc_not_before (Id, not_before) and
Has_cc_not_after (Id, not_after);
procedure create
(Id : Types.ae_id_type;
iag_id : Types.iag_id_type;
dhag_id : Types.dhag_id_type;
creation_time : Types.rel_time_type;
initiator : Types.init_type;
sk_ike_auth_loc : Types.key_type;
sk_ike_auth_rem : Types.key_type;
nonce_loc : Types.nonce_type;
nonce_rem : Types.nonce_type)
with
Pre => Is_Valid (Id) and then
(Has_State (Id, clean)),
Post => Has_State (Id, unauth) and
Has_iag_id (Id, iag_id) and
Has_dhag_id (Id, dhag_id) and
Has_creation_time (Id, creation_time) and
Has_initiator (Id, initiator) and
Has_sk_ike_auth_loc (Id, sk_ike_auth_loc) and
Has_sk_ike_auth_rem (Id, sk_ike_auth_rem) and
Has_nonce_loc (Id, nonce_loc) and
Has_nonce_rem (Id, nonce_rem);
function get_lc_id
(Id : Types.ae_id_type)
return Types.lc_id_type
with
Pre => Is_Valid (Id) and then
(Has_State (Id, authenticated) or
Has_State (Id, active)),
Post => Has_lc_id (Id, get_lc_id'Result);
function get_nonce_loc
(Id : Types.ae_id_type)
return Types.nonce_type
with
Pre => Is_Valid (Id) and then
(Has_State (Id, authenticated) or
Has_State (Id, loc_auth)),
Post => Has_nonce_loc (Id, get_nonce_loc'Result);
function get_nonce_rem
(Id : Types.ae_id_type)
return Types.nonce_type
with
Pre => Is_Valid (Id) and then
(Has_State (Id, authenticated) or
Has_State (Id, unauth)),
Post => Has_nonce_rem (Id, get_nonce_rem'Result);
function get_ri_id
(Id : Types.ae_id_type)
return Types.ri_id_type
with
Pre => Is_Valid (Id) and then
(Has_State (Id, authenticated) or
Has_State (Id, active)),
Post => Has_ri_id (Id, get_ri_id'Result);
function get_sk_ike_auth_loc
(Id : Types.ae_id_type)
return Types.key_type
with
Pre => Is_Valid (Id) and then
(Has_State (Id, unauth)),
Post => Has_sk_ike_auth_loc (Id, get_sk_ike_auth_loc'Result);
function get_sk_ike_auth_rem
(Id : Types.ae_id_type)
return Types.key_type
with
Pre => Is_Valid (Id) and then
(Has_State (Id, loc_auth)),
Post => Has_sk_ike_auth_rem (Id, get_sk_ike_auth_rem'Result);
procedure invalidate
(Id : Types.ae_id_type)
with
Pre => Is_Valid (Id),
Post => Has_State (Id, invalid);
function is_initiator
(Id : Types.ae_id_type)
return Types.init_type
with
Pre => Is_Valid (Id) and then
(Has_State (Id, authenticated)),
Post => Has_initiator (Id, is_initiator'Result);
procedure reset
(Id : Types.ae_id_type)
with
Pre => Is_Valid (Id),
Post => Has_State (Id, clean);
procedure sign
(Id : Types.ae_id_type;
lc_id : Types.lc_id_type)
with
Pre => Is_Valid (Id) and then
(Has_State (Id, unauth)),
Post => Has_State (Id, loc_auth) and
Has_lc_id (Id, lc_id);
end Tkmrpc.Contexts.ae;
|
-----------------------------------------------------------------------
-- AWA.Counters.Models -- AWA.Counters.Models
-----------------------------------------------------------------------
-- File generated by ada-gen DO NOT MODIFY
-- Template used: templates/model/package-body.xhtml
-- Ada Generator: https://ada-gen.googlecode.com/svn/trunk Revision 1095
-----------------------------------------------------------------------
-- Copyright (C) 2017 Stephane Carrez
-- Written by Stephane Carrez (Stephane.Carrez@gmail.com)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Unchecked_Deallocation;
with Util.Beans.Objects.Time;
with ASF.Events.Faces.Actions;
package body AWA.Counters.Models is
use type ADO.Objects.Object_Record_Access;
use type ADO.Objects.Object_Ref;
use type ADO.Objects.Object_Record;
pragma Warnings (Off, "formal parameter * is not referenced");
function Counter_Key (Id : in ADO.Identifier) return ADO.Objects.Object_Key is
Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER,
Of_Class => COUNTER_DEF'Access);
begin
ADO.Objects.Set_Value (Result, Id);
return Result;
end Counter_Key;
function Counter_Key (Id : in String) return ADO.Objects.Object_Key is
Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER,
Of_Class => COUNTER_DEF'Access);
begin
ADO.Objects.Set_Value (Result, Id);
return Result;
end Counter_Key;
function "=" (Left, Right : Counter_Ref'Class) return Boolean is
begin
return ADO.Objects.Object_Ref'Class (Left) = ADO.Objects.Object_Ref'Class (Right);
end "=";
procedure Set_Field (Object : in out Counter_Ref'Class;
Impl : out Counter_Access) is
Result : ADO.Objects.Object_Record_Access;
begin
Object.Prepare_Modify (Result);
Impl := Counter_Impl (Result.all)'Access;
end Set_Field;
-- Internal method to allocate the Object_Record instance
procedure Allocate (Object : in out Counter_Ref) is
Impl : Counter_Access;
begin
Impl := new Counter_Impl;
Impl.Object_Id := ADO.NO_IDENTIFIER;
Impl.Date := ADO.DEFAULT_TIME;
Impl.Counter := 0;
ADO.Objects.Set_Object (Object, Impl.all'Access);
end Allocate;
-- ----------------------------------------
-- Data object: Counter
-- ----------------------------------------
procedure Set_Object_Id (Object : in out Counter_Ref;
Value : in ADO.Identifier) is
Impl : Counter_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Identifier (Impl.all, 1, Impl.Object_Id, Value);
end Set_Object_Id;
function Get_Object_Id (Object : in Counter_Ref)
return ADO.Identifier is
Impl : constant Counter_Access
:= Counter_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Object_Id;
end Get_Object_Id;
procedure Set_Date (Object : in out Counter_Ref;
Value : in Ada.Calendar.Time) is
Impl : Counter_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Time (Impl.all, 2, Impl.Date, Value);
end Set_Date;
function Get_Date (Object : in Counter_Ref)
return Ada.Calendar.Time is
Impl : constant Counter_Access
:= Counter_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Date;
end Get_Date;
procedure Set_Counter (Object : in out Counter_Ref;
Value : in Integer) is
Impl : Counter_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Integer (Impl.all, 3, Impl.Counter, Value);
end Set_Counter;
function Get_Counter (Object : in Counter_Ref)
return Integer is
Impl : constant Counter_Access
:= Counter_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Counter;
end Get_Counter;
procedure Set_Definition_Id (Object : in out Counter_Ref;
Value : in ADO.Identifier) is
Impl : Counter_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Key_Value (Impl.all, 4, Value);
end Set_Definition_Id;
function Get_Definition_Id (Object : in Counter_Ref)
return ADO.Identifier is
Impl : constant Counter_Access
:= Counter_Impl (Object.Get_Object.all)'Access;
begin
return Impl.Get_Key_Value;
end Get_Definition_Id;
-- Copy of the object.
procedure Copy (Object : in Counter_Ref;
Into : in out Counter_Ref) is
Result : Counter_Ref;
begin
if not Object.Is_Null then
declare
Impl : constant Counter_Access
:= Counter_Impl (Object.Get_Load_Object.all)'Access;
Copy : constant Counter_Access
:= new Counter_Impl;
begin
ADO.Objects.Set_Object (Result, Copy.all'Access);
Copy.Copy (Impl.all);
Copy.Object_Id := Impl.Object_Id;
Copy.Date := Impl.Date;
Copy.Counter := Impl.Counter;
end;
end if;
Into := Result;
end Copy;
procedure Find (Object : in out Counter_Ref;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean) is
Impl : constant Counter_Access := new Counter_Impl;
begin
Impl.Find (Session, Query, Found);
if Found then
ADO.Objects.Set_Object (Object, Impl.all'Access);
else
ADO.Objects.Set_Object (Object, null);
Destroy (Impl);
end if;
end Find;
procedure Load (Object : in out Counter_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier) is
Impl : constant Counter_Access := new Counter_Impl;
Found : Boolean;
Query : ADO.SQL.Query;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("definition_id = ?");
Impl.Find (Session, Query, Found);
if not Found then
Destroy (Impl);
raise ADO.Objects.NOT_FOUND;
end if;
ADO.Objects.Set_Object (Object, Impl.all'Access);
end Load;
procedure Load (Object : in out Counter_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier;
Found : out Boolean) is
Impl : constant Counter_Access := new Counter_Impl;
Query : ADO.SQL.Query;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("definition_id = ?");
Impl.Find (Session, Query, Found);
if not Found then
Destroy (Impl);
else
ADO.Objects.Set_Object (Object, Impl.all'Access);
end if;
end Load;
procedure Save (Object : in out Counter_Ref;
Session : in out ADO.Sessions.Master_Session'Class) is
Impl : ADO.Objects.Object_Record_Access := Object.Get_Object;
begin
if Impl = null then
Impl := new Counter_Impl;
ADO.Objects.Set_Object (Object, Impl);
end if;
if not ADO.Objects.Is_Created (Impl.all) then
Impl.Create (Session);
else
Impl.Save (Session);
end if;
end Save;
procedure Delete (Object : in out Counter_Ref;
Session : in out ADO.Sessions.Master_Session'Class) is
Impl : constant ADO.Objects.Object_Record_Access := Object.Get_Object;
begin
if Impl /= null then
Impl.Delete (Session);
end if;
end Delete;
-- --------------------
-- Free the object
-- --------------------
procedure Destroy (Object : access Counter_Impl) is
type Counter_Impl_Ptr is access all Counter_Impl;
procedure Unchecked_Free is new Ada.Unchecked_Deallocation
(Counter_Impl, Counter_Impl_Ptr);
pragma Warnings (Off, "*redundant conversion*");
Ptr : Counter_Impl_Ptr := Counter_Impl (Object.all)'Access;
pragma Warnings (On, "*redundant conversion*");
begin
Unchecked_Free (Ptr);
end Destroy;
procedure Find (Object : in out Counter_Impl;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean) is
Stmt : ADO.Statements.Query_Statement
:= Session.Create_Statement (Query, COUNTER_DEF'Access);
begin
Stmt.Execute;
if Stmt.Has_Elements then
Object.Load (Stmt, Session);
Stmt.Next;
Found := not Stmt.Has_Elements;
else
Found := False;
end if;
end Find;
overriding
procedure Load (Object : in out Counter_Impl;
Session : in out ADO.Sessions.Session'Class) is
Found : Boolean;
Query : ADO.SQL.Query;
Id : constant ADO.Identifier := Object.Get_Key_Value;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("definition_id = ?");
Object.Find (Session, Query, Found);
if not Found then
raise ADO.Objects.NOT_FOUND;
end if;
end Load;
procedure Save (Object : in out Counter_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Stmt : ADO.Statements.Update_Statement
:= Session.Create_Statement (COUNTER_DEF'Access);
begin
if Object.Is_Modified (1) then
Stmt.Save_Field (Name => COL_0_1_NAME, -- object_id
Value => Object.Object_Id);
Object.Clear_Modified (1);
end if;
if Object.Is_Modified (2) then
Stmt.Save_Field (Name => COL_1_1_NAME, -- date
Value => Object.Date);
Object.Clear_Modified (2);
end if;
if Object.Is_Modified (3) then
Stmt.Save_Field (Name => COL_2_1_NAME, -- counter
Value => Object.Counter);
Object.Clear_Modified (3);
end if;
if Object.Is_Modified (4) then
Stmt.Save_Field (Name => COL_3_1_NAME, -- definition_id
Value => Object.Get_Key);
Object.Clear_Modified (4);
end if;
if Stmt.Has_Save_Fields then
Stmt.Set_Filter (Filter => "definition_id = ? AND object_id = ? AND date = ?");
Stmt.Add_Param (Value => Object.Get_Key);
Stmt.Add_Param (Value => Object.Object_Id);
Stmt.Add_Param (Value => Object.Date);
declare
Result : Integer;
begin
Stmt.Execute (Result);
if Result /= 1 then
if Result /= 0 then
raise ADO.Objects.UPDATE_ERROR;
end if;
end if;
end;
end if;
end Save;
procedure Create (Object : in out Counter_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Query : ADO.Statements.Insert_Statement
:= Session.Create_Statement (COUNTER_DEF'Access);
Result : Integer;
begin
Query.Save_Field (Name => COL_0_1_NAME, -- object_id
Value => Object.Object_Id);
Query.Save_Field (Name => COL_1_1_NAME, -- date
Value => Object.Date);
Query.Save_Field (Name => COL_2_1_NAME, -- counter
Value => Object.Counter);
Query.Save_Field (Name => COL_3_1_NAME, -- definition_id
Value => Object.Get_Key);
Query.Execute (Result);
if Result /= 1 then
raise ADO.Objects.INSERT_ERROR;
end if;
ADO.Objects.Set_Created (Object);
end Create;
procedure Delete (Object : in out Counter_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Stmt : ADO.Statements.Delete_Statement
:= Session.Create_Statement (COUNTER_DEF'Access);
begin
Stmt.Set_Filter (Filter => "definition_id = ?");
Stmt.Add_Param (Value => Object.Get_Key);
Stmt.Execute;
end Delete;
-- ------------------------------
-- Get the bean attribute identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in Counter_Ref;
Name : in String) return Util.Beans.Objects.Object is
Obj : ADO.Objects.Object_Record_Access;
Impl : access Counter_Impl;
begin
if From.Is_Null then
return Util.Beans.Objects.Null_Object;
end if;
Obj := From.Get_Load_Object;
Impl := Counter_Impl (Obj.all)'Access;
if Name = "object_id" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (Impl.Object_Id));
elsif Name = "date" then
return Util.Beans.Objects.Time.To_Object (Impl.Date);
elsif Name = "counter" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (Impl.Counter));
elsif Name = "definition_id" then
return ADO.Objects.To_Object (Impl.Get_Key);
end if;
return Util.Beans.Objects.Null_Object;
end Get_Value;
-- ------------------------------
-- Load the object from current iterator position
-- ------------------------------
procedure Load (Object : in out Counter_Impl;
Stmt : in out ADO.Statements.Query_Statement'Class;
Session : in out ADO.Sessions.Session'Class) is
begin
Object.Object_Id := Stmt.Get_Identifier (0);
Object.Date := Stmt.Get_Time (1);
Object.Counter := Stmt.Get_Integer (2);
Object.Set_Key_Value (Stmt.Get_Identifier (3));
ADO.Objects.Set_Created (Object);
end Load;
function Counter_Definition_Key (Id : in ADO.Identifier) return ADO.Objects.Object_Key is
Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER,
Of_Class => COUNTER_DEFINITION_DEF'Access);
begin
ADO.Objects.Set_Value (Result, Id);
return Result;
end Counter_Definition_Key;
function Counter_Definition_Key (Id : in String) return ADO.Objects.Object_Key is
Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER,
Of_Class => COUNTER_DEFINITION_DEF'Access);
begin
ADO.Objects.Set_Value (Result, Id);
return Result;
end Counter_Definition_Key;
function "=" (Left, Right : Counter_Definition_Ref'Class) return Boolean is
begin
return ADO.Objects.Object_Ref'Class (Left) = ADO.Objects.Object_Ref'Class (Right);
end "=";
procedure Set_Field (Object : in out Counter_Definition_Ref'Class;
Impl : out Counter_Definition_Access) is
Result : ADO.Objects.Object_Record_Access;
begin
Object.Prepare_Modify (Result);
Impl := Counter_Definition_Impl (Result.all)'Access;
end Set_Field;
-- Internal method to allocate the Object_Record instance
procedure Allocate (Object : in out Counter_Definition_Ref) is
Impl : Counter_Definition_Access;
begin
Impl := new Counter_Definition_Impl;
Impl.Entity_Type.Is_Null := True;
ADO.Objects.Set_Object (Object, Impl.all'Access);
end Allocate;
-- ----------------------------------------
-- Data object: Counter_Definition
-- ----------------------------------------
procedure Set_Name (Object : in out Counter_Definition_Ref;
Value : in String) is
Impl : Counter_Definition_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_String (Impl.all, 1, Impl.Name, Value);
end Set_Name;
procedure Set_Name (Object : in out Counter_Definition_Ref;
Value : in Ada.Strings.Unbounded.Unbounded_String) is
Impl : Counter_Definition_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Unbounded_String (Impl.all, 1, Impl.Name, Value);
end Set_Name;
function Get_Name (Object : in Counter_Definition_Ref)
return String is
begin
return Ada.Strings.Unbounded.To_String (Object.Get_Name);
end Get_Name;
function Get_Name (Object : in Counter_Definition_Ref)
return Ada.Strings.Unbounded.Unbounded_String is
Impl : constant Counter_Definition_Access
:= Counter_Definition_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Name;
end Get_Name;
procedure Set_Id (Object : in out Counter_Definition_Ref;
Value : in ADO.Identifier) is
Impl : Counter_Definition_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Key_Value (Impl.all, 2, Value);
end Set_Id;
function Get_Id (Object : in Counter_Definition_Ref)
return ADO.Identifier is
Impl : constant Counter_Definition_Access
:= Counter_Definition_Impl (Object.Get_Object.all)'Access;
begin
return Impl.Get_Key_Value;
end Get_Id;
procedure Set_Entity_Type (Object : in out Counter_Definition_Ref;
Value : in ADO.Nullable_Entity_Type) is
Impl : Counter_Definition_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Entity_Type (Impl.all, 3, Impl.Entity_Type, Value);
end Set_Entity_Type;
function Get_Entity_Type (Object : in Counter_Definition_Ref)
return ADO.Nullable_Entity_Type is
Impl : constant Counter_Definition_Access
:= Counter_Definition_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Entity_Type;
end Get_Entity_Type;
-- Copy of the object.
procedure Copy (Object : in Counter_Definition_Ref;
Into : in out Counter_Definition_Ref) is
Result : Counter_Definition_Ref;
begin
if not Object.Is_Null then
declare
Impl : constant Counter_Definition_Access
:= Counter_Definition_Impl (Object.Get_Load_Object.all)'Access;
Copy : constant Counter_Definition_Access
:= new Counter_Definition_Impl;
begin
ADO.Objects.Set_Object (Result, Copy.all'Access);
Copy.Copy (Impl.all);
Copy.Name := Impl.Name;
Copy.Entity_Type := Impl.Entity_Type;
end;
end if;
Into := Result;
end Copy;
procedure Find (Object : in out Counter_Definition_Ref;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean) is
Impl : constant Counter_Definition_Access := new Counter_Definition_Impl;
begin
Impl.Find (Session, Query, Found);
if Found then
ADO.Objects.Set_Object (Object, Impl.all'Access);
else
ADO.Objects.Set_Object (Object, null);
Destroy (Impl);
end if;
end Find;
procedure Load (Object : in out Counter_Definition_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier) is
Impl : constant Counter_Definition_Access := new Counter_Definition_Impl;
Found : Boolean;
Query : ADO.SQL.Query;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Impl.Find (Session, Query, Found);
if not Found then
Destroy (Impl);
raise ADO.Objects.NOT_FOUND;
end if;
ADO.Objects.Set_Object (Object, Impl.all'Access);
end Load;
procedure Load (Object : in out Counter_Definition_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier;
Found : out Boolean) is
Impl : constant Counter_Definition_Access := new Counter_Definition_Impl;
Query : ADO.SQL.Query;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Impl.Find (Session, Query, Found);
if not Found then
Destroy (Impl);
else
ADO.Objects.Set_Object (Object, Impl.all'Access);
end if;
end Load;
procedure Save (Object : in out Counter_Definition_Ref;
Session : in out ADO.Sessions.Master_Session'Class) is
Impl : ADO.Objects.Object_Record_Access := Object.Get_Object;
begin
if Impl = null then
Impl := new Counter_Definition_Impl;
ADO.Objects.Set_Object (Object, Impl);
end if;
if not ADO.Objects.Is_Created (Impl.all) then
Impl.Create (Session);
else
Impl.Save (Session);
end if;
end Save;
procedure Delete (Object : in out Counter_Definition_Ref;
Session : in out ADO.Sessions.Master_Session'Class) is
Impl : constant ADO.Objects.Object_Record_Access := Object.Get_Object;
begin
if Impl /= null then
Impl.Delete (Session);
end if;
end Delete;
-- --------------------
-- Free the object
-- --------------------
procedure Destroy (Object : access Counter_Definition_Impl) is
type Counter_Definition_Impl_Ptr is access all Counter_Definition_Impl;
procedure Unchecked_Free is new Ada.Unchecked_Deallocation
(Counter_Definition_Impl, Counter_Definition_Impl_Ptr);
pragma Warnings (Off, "*redundant conversion*");
Ptr : Counter_Definition_Impl_Ptr := Counter_Definition_Impl (Object.all)'Access;
pragma Warnings (On, "*redundant conversion*");
begin
Unchecked_Free (Ptr);
end Destroy;
procedure Find (Object : in out Counter_Definition_Impl;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean) is
Stmt : ADO.Statements.Query_Statement
:= Session.Create_Statement (Query, COUNTER_DEFINITION_DEF'Access);
begin
Stmt.Execute;
if Stmt.Has_Elements then
Object.Load (Stmt, Session);
Stmt.Next;
Found := not Stmt.Has_Elements;
else
Found := False;
end if;
end Find;
overriding
procedure Load (Object : in out Counter_Definition_Impl;
Session : in out ADO.Sessions.Session'Class) is
Found : Boolean;
Query : ADO.SQL.Query;
Id : constant ADO.Identifier := Object.Get_Key_Value;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Object.Find (Session, Query, Found);
if not Found then
raise ADO.Objects.NOT_FOUND;
end if;
end Load;
procedure Save (Object : in out Counter_Definition_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Stmt : ADO.Statements.Update_Statement
:= Session.Create_Statement (COUNTER_DEFINITION_DEF'Access);
begin
if Object.Is_Modified (1) then
Stmt.Save_Field (Name => COL_0_2_NAME, -- name
Value => Object.Name);
Object.Clear_Modified (1);
end if;
if Object.Is_Modified (2) then
Stmt.Save_Field (Name => COL_1_2_NAME, -- id
Value => Object.Get_Key);
Object.Clear_Modified (2);
end if;
if Object.Is_Modified (3) then
Stmt.Save_Field (Name => COL_2_2_NAME, -- entity_type
Value => Object.Entity_Type);
Object.Clear_Modified (3);
end if;
if Stmt.Has_Save_Fields then
Stmt.Set_Filter (Filter => "id = ?");
Stmt.Add_Param (Value => Object.Get_Key);
declare
Result : Integer;
begin
Stmt.Execute (Result);
if Result /= 1 then
if Result /= 0 then
raise ADO.Objects.UPDATE_ERROR;
end if;
end if;
end;
end if;
end Save;
procedure Create (Object : in out Counter_Definition_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Query : ADO.Statements.Insert_Statement
:= Session.Create_Statement (COUNTER_DEFINITION_DEF'Access);
Result : Integer;
begin
Query.Save_Field (Name => COL_0_2_NAME, -- name
Value => Object.Name);
Session.Allocate (Id => Object);
Query.Save_Field (Name => COL_1_2_NAME, -- id
Value => Object.Get_Key);
Query.Save_Field (Name => COL_2_2_NAME, -- entity_type
Value => Object.Entity_Type);
Query.Execute (Result);
if Result /= 1 then
raise ADO.Objects.INSERT_ERROR;
end if;
ADO.Objects.Set_Created (Object);
end Create;
procedure Delete (Object : in out Counter_Definition_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Stmt : ADO.Statements.Delete_Statement
:= Session.Create_Statement (COUNTER_DEFINITION_DEF'Access);
begin
Stmt.Set_Filter (Filter => "id = ?");
Stmt.Add_Param (Value => Object.Get_Key);
Stmt.Execute;
end Delete;
-- ------------------------------
-- Get the bean attribute identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in Counter_Definition_Ref;
Name : in String) return Util.Beans.Objects.Object is
Obj : ADO.Objects.Object_Record_Access;
Impl : access Counter_Definition_Impl;
begin
if From.Is_Null then
return Util.Beans.Objects.Null_Object;
end if;
Obj := From.Get_Load_Object;
Impl := Counter_Definition_Impl (Obj.all)'Access;
if Name = "name" then
return Util.Beans.Objects.To_Object (Impl.Name);
elsif Name = "id" then
return ADO.Objects.To_Object (Impl.Get_Key);
elsif Name = "entity_type" then
if Impl.Entity_Type.Is_Null then
return Util.Beans.Objects.Null_Object;
else
return Util.Beans.Objects.To_Object (Long_Long_Integer (Impl.Entity_Type.Value));
end if;
end if;
return Util.Beans.Objects.Null_Object;
end Get_Value;
-- ------------------------------
-- Load the object from current iterator position
-- ------------------------------
procedure Load (Object : in out Counter_Definition_Impl;
Stmt : in out ADO.Statements.Query_Statement'Class;
Session : in out ADO.Sessions.Session'Class) is
begin
Object.Name := Stmt.Get_Unbounded_String (0);
Object.Set_Key_Value (Stmt.Get_Identifier (1));
Object.Entity_Type := Stmt.Get_Nullable_Entity_Type (2);
ADO.Objects.Set_Created (Object);
end Load;
function Visit_Key (Id : in ADO.Identifier) return ADO.Objects.Object_Key is
Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER,
Of_Class => VISIT_DEF'Access);
begin
ADO.Objects.Set_Value (Result, Id);
return Result;
end Visit_Key;
function Visit_Key (Id : in String) return ADO.Objects.Object_Key is
Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER,
Of_Class => VISIT_DEF'Access);
begin
ADO.Objects.Set_Value (Result, Id);
return Result;
end Visit_Key;
function "=" (Left, Right : Visit_Ref'Class) return Boolean is
begin
return ADO.Objects.Object_Ref'Class (Left) = ADO.Objects.Object_Ref'Class (Right);
end "=";
procedure Set_Field (Object : in out Visit_Ref'Class;
Impl : out Visit_Access) is
Result : ADO.Objects.Object_Record_Access;
begin
Object.Prepare_Modify (Result);
Impl := Visit_Impl (Result.all)'Access;
end Set_Field;
-- Internal method to allocate the Object_Record instance
procedure Allocate (Object : in out Visit_Ref) is
Impl : Visit_Access;
begin
Impl := new Visit_Impl;
Impl.Object_Id := ADO.NO_IDENTIFIER;
Impl.Counter := 0;
Impl.Date := ADO.DEFAULT_TIME;
Impl.User := ADO.NO_IDENTIFIER;
ADO.Objects.Set_Object (Object, Impl.all'Access);
end Allocate;
-- ----------------------------------------
-- Data object: Visit
-- ----------------------------------------
procedure Set_Object_Id (Object : in out Visit_Ref;
Value : in ADO.Identifier) is
Impl : Visit_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Identifier (Impl.all, 1, Impl.Object_Id, Value);
end Set_Object_Id;
function Get_Object_Id (Object : in Visit_Ref)
return ADO.Identifier is
Impl : constant Visit_Access
:= Visit_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Object_Id;
end Get_Object_Id;
procedure Set_Counter (Object : in out Visit_Ref;
Value : in Integer) is
Impl : Visit_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Integer (Impl.all, 2, Impl.Counter, Value);
end Set_Counter;
function Get_Counter (Object : in Visit_Ref)
return Integer is
Impl : constant Visit_Access
:= Visit_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Counter;
end Get_Counter;
procedure Set_Date (Object : in out Visit_Ref;
Value : in Ada.Calendar.Time) is
Impl : Visit_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Time (Impl.all, 3, Impl.Date, Value);
end Set_Date;
function Get_Date (Object : in Visit_Ref)
return Ada.Calendar.Time is
Impl : constant Visit_Access
:= Visit_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Date;
end Get_Date;
procedure Set_User (Object : in out Visit_Ref;
Value : in ADO.Identifier) is
Impl : Visit_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Identifier (Impl.all, 4, Impl.User, Value);
end Set_User;
function Get_User (Object : in Visit_Ref)
return ADO.Identifier is
Impl : constant Visit_Access
:= Visit_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.User;
end Get_User;
procedure Set_Definition_Id (Object : in out Visit_Ref;
Value : in ADO.Identifier) is
Impl : Visit_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Key_Value (Impl.all, 5, Value);
end Set_Definition_Id;
function Get_Definition_Id (Object : in Visit_Ref)
return ADO.Identifier is
Impl : constant Visit_Access
:= Visit_Impl (Object.Get_Object.all)'Access;
begin
return Impl.Get_Key_Value;
end Get_Definition_Id;
-- Copy of the object.
procedure Copy (Object : in Visit_Ref;
Into : in out Visit_Ref) is
Result : Visit_Ref;
begin
if not Object.Is_Null then
declare
Impl : constant Visit_Access
:= Visit_Impl (Object.Get_Load_Object.all)'Access;
Copy : constant Visit_Access
:= new Visit_Impl;
begin
ADO.Objects.Set_Object (Result, Copy.all'Access);
Copy.Copy (Impl.all);
Copy.Object_Id := Impl.Object_Id;
Copy.Counter := Impl.Counter;
Copy.Date := Impl.Date;
Copy.User := Impl.User;
end;
end if;
Into := Result;
end Copy;
procedure Find (Object : in out Visit_Ref;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean) is
Impl : constant Visit_Access := new Visit_Impl;
begin
Impl.Find (Session, Query, Found);
if Found then
ADO.Objects.Set_Object (Object, Impl.all'Access);
else
ADO.Objects.Set_Object (Object, null);
Destroy (Impl);
end if;
end Find;
procedure Load (Object : in out Visit_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier) is
Impl : constant Visit_Access := new Visit_Impl;
Found : Boolean;
Query : ADO.SQL.Query;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("definition_id = ?");
Impl.Find (Session, Query, Found);
if not Found then
Destroy (Impl);
raise ADO.Objects.NOT_FOUND;
end if;
ADO.Objects.Set_Object (Object, Impl.all'Access);
end Load;
procedure Load (Object : in out Visit_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier;
Found : out Boolean) is
Impl : constant Visit_Access := new Visit_Impl;
Query : ADO.SQL.Query;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("definition_id = ?");
Impl.Find (Session, Query, Found);
if not Found then
Destroy (Impl);
else
ADO.Objects.Set_Object (Object, Impl.all'Access);
end if;
end Load;
procedure Save (Object : in out Visit_Ref;
Session : in out ADO.Sessions.Master_Session'Class) is
Impl : ADO.Objects.Object_Record_Access := Object.Get_Object;
begin
if Impl = null then
Impl := new Visit_Impl;
ADO.Objects.Set_Object (Object, Impl);
end if;
if not ADO.Objects.Is_Created (Impl.all) then
Impl.Create (Session);
else
Impl.Save (Session);
end if;
end Save;
procedure Delete (Object : in out Visit_Ref;
Session : in out ADO.Sessions.Master_Session'Class) is
Impl : constant ADO.Objects.Object_Record_Access := Object.Get_Object;
begin
if Impl /= null then
Impl.Delete (Session);
end if;
end Delete;
-- --------------------
-- Free the object
-- --------------------
procedure Destroy (Object : access Visit_Impl) is
type Visit_Impl_Ptr is access all Visit_Impl;
procedure Unchecked_Free is new Ada.Unchecked_Deallocation
(Visit_Impl, Visit_Impl_Ptr);
pragma Warnings (Off, "*redundant conversion*");
Ptr : Visit_Impl_Ptr := Visit_Impl (Object.all)'Access;
pragma Warnings (On, "*redundant conversion*");
begin
Unchecked_Free (Ptr);
end Destroy;
procedure Find (Object : in out Visit_Impl;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean) is
Stmt : ADO.Statements.Query_Statement
:= Session.Create_Statement (Query, VISIT_DEF'Access);
begin
Stmt.Execute;
if Stmt.Has_Elements then
Object.Load (Stmt, Session);
Stmt.Next;
Found := not Stmt.Has_Elements;
else
Found := False;
end if;
end Find;
overriding
procedure Load (Object : in out Visit_Impl;
Session : in out ADO.Sessions.Session'Class) is
Found : Boolean;
Query : ADO.SQL.Query;
Id : constant ADO.Identifier := Object.Get_Key_Value;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("definition_id = ?");
Object.Find (Session, Query, Found);
if not Found then
raise ADO.Objects.NOT_FOUND;
end if;
end Load;
procedure Save (Object : in out Visit_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Stmt : ADO.Statements.Update_Statement
:= Session.Create_Statement (VISIT_DEF'Access);
begin
if Object.Is_Modified (1) then
Stmt.Save_Field (Name => COL_0_3_NAME, -- object_id
Value => Object.Object_Id);
Object.Clear_Modified (1);
end if;
if Object.Is_Modified (2) then
Stmt.Save_Field (Name => COL_1_3_NAME, -- counter
Value => Object.Counter);
Object.Clear_Modified (2);
end if;
if Object.Is_Modified (3) then
Stmt.Save_Field (Name => COL_2_3_NAME, -- date
Value => Object.Date);
Object.Clear_Modified (3);
end if;
if Object.Is_Modified (4) then
Stmt.Save_Field (Name => COL_3_3_NAME, -- user
Value => Object.User);
Object.Clear_Modified (4);
end if;
if Object.Is_Modified (5) then
Stmt.Save_Field (Name => COL_4_3_NAME, -- definition_id
Value => Object.Get_Key);
Object.Clear_Modified (5);
end if;
if Stmt.Has_Save_Fields then
Stmt.Set_Filter (Filter => "definition_id = ? AND object_id = ? AND user = ?");
Stmt.Add_Param (Value => Object.Get_Key);
Stmt.Add_Param (Value => Object.Object_Id);
Stmt.Add_Param (Value => Object.User);
declare
Result : Integer;
begin
Stmt.Execute (Result);
if Result /= 1 then
if Result /= 0 then
raise ADO.Objects.UPDATE_ERROR;
end if;
end if;
end;
end if;
end Save;
procedure Create (Object : in out Visit_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Query : ADO.Statements.Insert_Statement
:= Session.Create_Statement (VISIT_DEF'Access);
Result : Integer;
begin
Query.Save_Field (Name => COL_0_3_NAME, -- object_id
Value => Object.Object_Id);
Query.Save_Field (Name => COL_1_3_NAME, -- counter
Value => Object.Counter);
Query.Save_Field (Name => COL_2_3_NAME, -- date
Value => Object.Date);
Query.Save_Field (Name => COL_3_3_NAME, -- user
Value => Object.User);
Query.Save_Field (Name => COL_4_3_NAME, -- definition_id
Value => Object.Get_Key);
Query.Execute (Result);
if Result /= 1 then
raise ADO.Objects.INSERT_ERROR;
end if;
ADO.Objects.Set_Created (Object);
end Create;
procedure Delete (Object : in out Visit_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Stmt : ADO.Statements.Delete_Statement
:= Session.Create_Statement (VISIT_DEF'Access);
begin
Stmt.Set_Filter (Filter => "definition_id = ?");
Stmt.Add_Param (Value => Object.Get_Key);
Stmt.Execute;
end Delete;
-- ------------------------------
-- Get the bean attribute identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in Visit_Ref;
Name : in String) return Util.Beans.Objects.Object is
Obj : ADO.Objects.Object_Record_Access;
Impl : access Visit_Impl;
begin
if From.Is_Null then
return Util.Beans.Objects.Null_Object;
end if;
Obj := From.Get_Load_Object;
Impl := Visit_Impl (Obj.all)'Access;
if Name = "object_id" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (Impl.Object_Id));
elsif Name = "counter" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (Impl.Counter));
elsif Name = "date" then
return Util.Beans.Objects.Time.To_Object (Impl.Date);
elsif Name = "user" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (Impl.User));
elsif Name = "definition_id" then
return ADO.Objects.To_Object (Impl.Get_Key);
end if;
return Util.Beans.Objects.Null_Object;
end Get_Value;
procedure List (Object : in out Visit_Vector;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class) is
Stmt : ADO.Statements.Query_Statement
:= Session.Create_Statement (Query, VISIT_DEF'Access);
begin
Stmt.Execute;
Visit_Vectors.Clear (Object);
while Stmt.Has_Elements loop
declare
Item : Visit_Ref;
Impl : constant Visit_Access := new Visit_Impl;
begin
Impl.Load (Stmt, Session);
ADO.Objects.Set_Object (Item, Impl.all'Access);
Object.Append (Item);
end;
Stmt.Next;
end loop;
end List;
-- ------------------------------
-- Load the object from current iterator position
-- ------------------------------
procedure Load (Object : in out Visit_Impl;
Stmt : in out ADO.Statements.Query_Statement'Class;
Session : in out ADO.Sessions.Session'Class) is
begin
Object.Object_Id := Stmt.Get_Identifier (0);
Object.Counter := Stmt.Get_Integer (1);
Object.Date := Stmt.Get_Time (2);
Object.User := Stmt.Get_Identifier (3);
Object.Set_Key_Value (Stmt.Get_Identifier (4));
ADO.Objects.Set_Created (Object);
end Load;
-- ------------------------------
-- Get the bean attribute identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in Stat_Info;
Name : in String) return Util.Beans.Objects.Object is
begin
if Name = "date" then
return Util.Beans.Objects.Time.To_Object (From.Date);
elsif Name = "count" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Count));
end if;
return Util.Beans.Objects.Null_Object;
end Get_Value;
-- ------------------------------
-- Set the value identified by the name
-- ------------------------------
overriding
procedure Set_Value (Item : in out Stat_Info;
Name : in String;
Value : in Util.Beans.Objects.Object) is
begin
if Name = "date" then
Item.Date := Util.Beans.Objects.Time.To_Time (Value);
elsif Name = "count" then
Item.Count := Util.Beans.Objects.To_Integer (Value);
end if;
end Set_Value;
-- --------------------
-- Run the query controlled by <b>Context</b> and append the list in <b>Object</b>.
-- --------------------
procedure List (Object : in out Stat_Info_List_Bean'Class;
Session : in out ADO.Sessions.Session'Class;
Context : in out ADO.Queries.Context'Class) is
begin
List (Object.List, Session, Context);
end List;
-- --------------------
-- The month statistics.
-- --------------------
procedure List (Object : in out Stat_Info_Vector;
Session : in out ADO.Sessions.Session'Class;
Context : in out ADO.Queries.Context'Class) is
procedure Read (Into : in out Stat_Info);
Stmt : ADO.Statements.Query_Statement
:= Session.Create_Statement (Context);
Pos : Natural := 0;
procedure Read (Into : in out Stat_Info) is
begin
Into.Date := Stmt.Get_Time (0);
Into.Count := Stmt.Get_Natural (1);
end Read;
begin
Stmt.Execute;
Stat_Info_Vectors.Clear (Object);
while Stmt.Has_Elements loop
Object.Insert_Space (Before => Pos);
Object.Update_Element (Index => Pos, Process => Read'Access);
Pos := Pos + 1;
Stmt.Next;
end loop;
end List;
procedure Op_Load (Bean : in out Stat_List_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String);
procedure Op_Load (Bean : in out Stat_List_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is
begin
Stat_List_Bean'Class (Bean).Load (Outcome);
end Op_Load;
package Binding_Stat_List_Bean_1 is
new ASF.Events.Faces.Actions.Action_Method.Bind (Bean => Stat_List_Bean,
Method => Op_Load,
Name => "load");
Binding_Stat_List_Bean_Array : aliased constant Util.Beans.Methods.Method_Binding_Array
:= (1 => Binding_Stat_List_Bean_1.Proxy'Access
);
-- ------------------------------
-- This bean provides some methods that can be used in a Method_Expression.
-- ------------------------------
overriding
function Get_Method_Bindings (From : in Stat_List_Bean)
return Util.Beans.Methods.Method_Binding_Array_Access is
pragma Unreferenced (From);
begin
return Binding_Stat_List_Bean_Array'Access;
end Get_Method_Bindings;
-- ------------------------------
-- Get the bean attribute identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in Stat_List_Bean;
Name : in String) return Util.Beans.Objects.Object is
begin
if Name = "entity_type" then
return Util.Beans.Objects.To_Object (From.Entity_Type);
elsif Name = "first_date" then
return Util.Beans.Objects.To_Object (From.First_Date);
elsif Name = "last_date" then
return Util.Beans.Objects.To_Object (From.Last_Date);
elsif Name = "entity_id" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Entity_Id));
elsif Name = "counter_name" then
return Util.Beans.Objects.To_Object (From.Counter_Name);
elsif Name = "query_name" then
return Util.Beans.Objects.To_Object (From.Query_Name);
end if;
return Util.Beans.Objects.Null_Object;
end Get_Value;
-- ------------------------------
-- Set the value identified by the name
-- ------------------------------
overriding
procedure Set_Value (Item : in out Stat_List_Bean;
Name : in String;
Value : in Util.Beans.Objects.Object) is
begin
if Name = "entity_type" then
Item.Entity_Type := Util.Beans.Objects.To_Unbounded_String (Value);
elsif Name = "first_date" then
Item.First_Date := Util.Beans.Objects.To_Unbounded_String (Value);
elsif Name = "last_date" then
Item.Last_Date := Util.Beans.Objects.To_Unbounded_String (Value);
elsif Name = "entity_id" then
Item.Entity_Id := ADO.Identifier (Util.Beans.Objects.To_Long_Long_Integer (Value));
elsif Name = "counter_name" then
Item.Counter_Name := Util.Beans.Objects.To_Unbounded_String (Value);
elsif Name = "query_name" then
Item.Query_Name := Util.Beans.Objects.To_Unbounded_String (Value);
end if;
end Set_Value;
end AWA.Counters.Models;
|
pragma License (Unrestricted);
-- optional runtime unit specialized for Windows
package System.Wide_Startup is
pragma Preelaborate;
pragma Linker_Options ("-municode");
wargc : Integer
with Export, Convention => C, External_Name => "__drake_wargc";
wargv : Address
with Export, Convention => C, External_Name => "__drake_wargv";
wenvp : Address
with Export, Convention => C, External_Name => "__drake_wenvp";
function wmain (argc : Integer; argv : Address; envp : Address)
return Integer
with Export, Convention => C, External_Name => "wmain";
end System.Wide_Startup;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- A D A . R E A L _ T I M E . D E L A Y S --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2005, Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNARL; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNARL was developed by the GNARL team at Florida State University. --
-- Extensive contributions were provided by Ada Core Technologies, Inc. --
-- --
------------------------------------------------------------------------------
-- Implements Real_Time.Time absolute delays
-- Note: the compiler generates direct calls to this interface, in the
-- processing of time types.
package Ada.Real_Time.Delays is
function To_Duration (T : Real_Time.Time) return Duration;
-- Convert Time to Duration
procedure Delay_Until (T : Time);
-- Delay until Clock has reached (at least) time T,
-- or the task is aborted to at least the current ATC nesting level.
-- The body of this procedure must perform all the processing
-- required for an abort point.
end Ada.Real_Time.Delays;
|
------------------------------------------------------------------------------
-- --
-- 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.OCL.Literal_Exps;
limited with AMF.OCL.Tuple_Literal_Parts.Collections;
package AMF.OCL.Tuple_Literal_Exps is
pragma Preelaborate;
type OCL_Tuple_Literal_Exp is limited interface
and AMF.OCL.Literal_Exps.OCL_Literal_Exp;
type OCL_Tuple_Literal_Exp_Access is
access all OCL_Tuple_Literal_Exp'Class;
for OCL_Tuple_Literal_Exp_Access'Storage_Size use 0;
not overriding function Get_Part
(Self : not null access constant OCL_Tuple_Literal_Exp)
return AMF.OCL.Tuple_Literal_Parts.Collections.Ordered_Set_Of_OCL_Tuple_Literal_Part is abstract;
-- Getter of TupleLiteralExp::part.
--
end AMF.OCL.Tuple_Literal_Exps;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- ADA.NUMERICS.LONG_COMPLEX.ELEMENTARY_FUNCTIONS --
-- --
-- S p e c --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. In accordance with the copyright of that document, you can freely --
-- copy and modify this specification, provided that if you redistribute a --
-- modified version, any changes that you have made are clearly indicated. --
-- --
------------------------------------------------------------------------------
with Ada.Numerics.Long_Complex_Types;
with Ada.Numerics.Generic_Complex_Elementary_Functions;
package Ada.Numerics.Long_Complex_Elementary_Functions is
new Ada.Numerics.Generic_Complex_Elementary_Functions
(Ada.Numerics.Long_Complex_Types);
pragma Pure (Ada.Numerics.Long_Complex_Elementary_Functions);
|
-- This spec has been automatically generated from STM32WB55x.svd
pragma Restrictions (No_Elaboration_Code);
pragma Ada_2012;
pragma Style_Checks (Off);
with HAL;
with System;
package STM32_SVD.IPCC is
pragma Preelaborate;
---------------
-- Registers --
---------------
type C1CR_Register is record
RXOIE : Boolean := False;
-- unspecified
Reserved_1_15 : HAL.UInt15 := 16#0#;
TXFIE : Boolean := False;
-- unspecified
Reserved_17_31 : HAL.UInt15 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for C1CR_Register use record
RXOIE at 0 range 0 .. 0;
Reserved_1_15 at 0 range 1 .. 15;
TXFIE at 0 range 16 .. 16;
Reserved_17_31 at 0 range 17 .. 31;
end record;
-- C1MR_CHOM array
type C1MR_CHOM_Field_Array is array (1 .. 6) of Boolean
with Component_Size => 1, Size => 6;
-- Type definition for C1MR_CHOM
type C1MR_CHOM_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- CHOM as a value
Val : HAL.UInt6;
when True =>
-- CHOM as an array
Arr : C1MR_CHOM_Field_Array;
end case;
end record
with Unchecked_Union, Size => 6;
for C1MR_CHOM_Field use record
Val at 0 range 0 .. 5;
Arr at 0 range 0 .. 5;
end record;
-- C1MR_CHFM array
type C1MR_CHFM_Field_Array is array (1 .. 6) of Boolean
with Component_Size => 1, Size => 6;
-- Type definition for C1MR_CHFM
type C1MR_CHFM_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- CHFM as a value
Val : HAL.UInt6;
when True =>
-- CHFM as an array
Arr : C1MR_CHFM_Field_Array;
end case;
end record
with Unchecked_Union, Size => 6;
for C1MR_CHFM_Field use record
Val at 0 range 0 .. 5;
Arr at 0 range 0 .. 5;
end record;
type C1MR_Register is record
CHOM : C1MR_CHOM_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_6_15 : HAL.UInt10 := 16#0#;
CHFM : C1MR_CHFM_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_22_31 : HAL.UInt10 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for C1MR_Register use record
CHOM at 0 range 0 .. 5;
Reserved_6_15 at 0 range 6 .. 15;
CHFM at 0 range 16 .. 21;
Reserved_22_31 at 0 range 22 .. 31;
end record;
-- C1SCR_CHC array
type C1SCR_CHC_Field_Array is array (1 .. 6) of Boolean
with Component_Size => 1, Size => 6;
-- Type definition for C1SCR_CHC
type C1SCR_CHC_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- CHC as a value
Val : HAL.UInt6;
when True =>
-- CHC as an array
Arr : C1SCR_CHC_Field_Array;
end case;
end record
with Unchecked_Union, Size => 6;
for C1SCR_CHC_Field use record
Val at 0 range 0 .. 5;
Arr at 0 range 0 .. 5;
end record;
-- C1SCR_CHS array
type C1SCR_CHS_Field_Array is array (1 .. 6) of Boolean
with Component_Size => 1, Size => 6;
-- Type definition for C1SCR_CHS
type C1SCR_CHS_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- CHS as a value
Val : HAL.UInt6;
when True =>
-- CHS as an array
Arr : C1SCR_CHS_Field_Array;
end case;
end record
with Unchecked_Union, Size => 6;
for C1SCR_CHS_Field use record
Val at 0 range 0 .. 5;
Arr at 0 range 0 .. 5;
end record;
type C1SCR_Register is record
CHC : C1SCR_CHC_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_6_15 : HAL.UInt10 := 16#0#;
CHS : C1SCR_CHS_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_22_31 : HAL.UInt10 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for C1SCR_Register use record
CHC at 0 range 0 .. 5;
Reserved_6_15 at 0 range 6 .. 15;
CHS at 0 range 16 .. 21;
Reserved_22_31 at 0 range 22 .. 31;
end record;
-- C1TOC2SR_CHF array
type C1TOC2SR_CHF_Field_Array is array (1 .. 6) of Boolean
with Component_Size => 1, Size => 6;
-- Type definition for C1TOC2SR_CHF
type C1TOC2SR_CHF_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- CHF as a value
Val : HAL.UInt6;
when True =>
-- CHF as an array
Arr : C1TOC2SR_CHF_Field_Array;
end case;
end record
with Unchecked_Union, Size => 6;
for C1TOC2SR_CHF_Field use record
Val at 0 range 0 .. 5;
Arr at 0 range 0 .. 5;
end record;
type C1TOC2SR_Register is record
CHF : C1TOC2SR_CHF_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_6_31 : HAL.UInt26 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for C1TOC2SR_Register use record
CHF at 0 range 0 .. 5;
Reserved_6_31 at 0 range 6 .. 31;
end record;
type C2CR_Register is record
RXOIE : Boolean := False;
-- unspecified
Reserved_1_15 : HAL.UInt15 := 16#0#;
TXFIE : Boolean := False;
-- unspecified
Reserved_17_31 : HAL.UInt15 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for C2CR_Register use record
RXOIE at 0 range 0 .. 0;
Reserved_1_15 at 0 range 1 .. 15;
TXFIE at 0 range 16 .. 16;
Reserved_17_31 at 0 range 17 .. 31;
end record;
-- C2MR_CHOM array
type C2MR_CHOM_Field_Array is array (1 .. 6) of Boolean
with Component_Size => 1, Size => 6;
-- Type definition for C2MR_CHOM
type C2MR_CHOM_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- CHOM as a value
Val : HAL.UInt6;
when True =>
-- CHOM as an array
Arr : C2MR_CHOM_Field_Array;
end case;
end record
with Unchecked_Union, Size => 6;
for C2MR_CHOM_Field use record
Val at 0 range 0 .. 5;
Arr at 0 range 0 .. 5;
end record;
-- C2MR_CHFM array
type C2MR_CHFM_Field_Array is array (1 .. 6) of Boolean
with Component_Size => 1, Size => 6;
-- Type definition for C2MR_CHFM
type C2MR_CHFM_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- CHFM as a value
Val : HAL.UInt6;
when True =>
-- CHFM as an array
Arr : C2MR_CHFM_Field_Array;
end case;
end record
with Unchecked_Union, Size => 6;
for C2MR_CHFM_Field use record
Val at 0 range 0 .. 5;
Arr at 0 range 0 .. 5;
end record;
type C2MR_Register is record
CHOM : C2MR_CHOM_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_6_15 : HAL.UInt10 := 16#0#;
CHFM : C2MR_CHFM_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_22_31 : HAL.UInt10 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for C2MR_Register use record
CHOM at 0 range 0 .. 5;
Reserved_6_15 at 0 range 6 .. 15;
CHFM at 0 range 16 .. 21;
Reserved_22_31 at 0 range 22 .. 31;
end record;
-- C2SCR_CHC array
type C2SCR_CHC_Field_Array is array (1 .. 6) of Boolean
with Component_Size => 1, Size => 6;
-- Type definition for C2SCR_CHC
type C2SCR_CHC_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- CHC as a value
Val : HAL.UInt6;
when True =>
-- CHC as an array
Arr : C2SCR_CHC_Field_Array;
end case;
end record
with Unchecked_Union, Size => 6;
for C2SCR_CHC_Field use record
Val at 0 range 0 .. 5;
Arr at 0 range 0 .. 5;
end record;
-- C2SCR_CHS array
type C2SCR_CHS_Field_Array is array (1 .. 6) of Boolean
with Component_Size => 1, Size => 6;
-- Type definition for C2SCR_CHS
type C2SCR_CHS_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- CHS as a value
Val : HAL.UInt6;
when True =>
-- CHS as an array
Arr : C2SCR_CHS_Field_Array;
end case;
end record
with Unchecked_Union, Size => 6;
for C2SCR_CHS_Field use record
Val at 0 range 0 .. 5;
Arr at 0 range 0 .. 5;
end record;
type C2SCR_Register is record
CHC : C2SCR_CHC_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_6_15 : HAL.UInt10 := 16#0#;
CHS : C2SCR_CHS_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_22_31 : HAL.UInt10 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for C2SCR_Register use record
CHC at 0 range 0 .. 5;
Reserved_6_15 at 0 range 6 .. 15;
CHS at 0 range 16 .. 21;
Reserved_22_31 at 0 range 22 .. 31;
end record;
-- C2TOC1SR_CHF array
type C2TOC1SR_CHF_Field_Array is array (1 .. 6) of Boolean
with Component_Size => 1, Size => 6;
-- Type definition for C2TOC1SR_CHF
type C2TOC1SR_CHF_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- CHF as a value
Val : HAL.UInt6;
when True =>
-- CHF as an array
Arr : C2TOC1SR_CHF_Field_Array;
end case;
end record
with Unchecked_Union, Size => 6;
for C2TOC1SR_CHF_Field use record
Val at 0 range 0 .. 5;
Arr at 0 range 0 .. 5;
end record;
type C2TOC1SR_Register is record
CHF : C2TOC1SR_CHF_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_6_31 : HAL.UInt26 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for C2TOC1SR_Register use record
CHF at 0 range 0 .. 5;
Reserved_6_31 at 0 range 6 .. 31;
end record;
-----------------
-- Peripherals --
-----------------
type IPCC_Peripheral is record
C1CR : aliased C1CR_Register;
C1MR : aliased C1MR_Register;
C1SCR : aliased C1SCR_Register;
C1TOC2SR : aliased C1TOC2SR_Register;
C2CR : aliased C2CR_Register;
C2MR : aliased C2MR_Register;
C2SCR : aliased C2SCR_Register;
C2TOC1SR : aliased C2TOC1SR_Register;
end record
with Volatile;
for IPCC_Peripheral use record
C1CR at 16#0# range 0 .. 31;
C1MR at 16#4# range 0 .. 31;
C1SCR at 16#8# range 0 .. 31;
C1TOC2SR at 16#C# range 0 .. 31;
C2CR at 16#10# range 0 .. 31;
C2MR at 16#14# range 0 .. 31;
C2SCR at 16#18# range 0 .. 31;
C2TOC1SR at 16#1C# range 0 .. 31;
end record;
IPCC_Periph : aliased IPCC_Peripheral
with Import, Address => System'To_Address (16#58000C00#);
end STM32_SVD.IPCC;
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- SQL Database Access --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012-2014, Vadim Godunko <vgodunko@gmail.com> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with System.Storage_Elements;
with Interfaces;
with League.Calendars;
package Matreshka.Internals.SQL_Drivers.Oracle.Utils is
subtype Storage_Array is System.Storage_Elements.Storage_Array (1 .. 22);
function Decode_Number (Buffer : Storage_Array) return String;
procedure Encode_Number
(Image : String;
Buffer : in out Storage_Array);
type OCIDate is record
Year : Interfaces.Integer_16;
Month : Interfaces.Unsigned_8;
Day : Interfaces.Unsigned_8;
HH : Interfaces.Unsigned_8;
MM : Interfaces.Unsigned_8;
SS : Interfaces.Unsigned_8;
end record
with Pack, Convention => C;
function Encode_Date (Value : League.Calendars.Date) return OCIDate;
function Decode_Date (Buffer : OCIDate) return League.Calendars.Date;
end Matreshka.Internals.SQL_Drivers.Oracle.Utils;
|
package PrimitivePropertyTypes is
type SomeClass is record
someInteger : Integer := 1;
someNatural : Natural := 2;
someBoolean : Boolean := False;
someString : String(1 .. 5) := "hello";
someFloat : Float := 1.1;
end record;
end PrimitivePropertyTypes;
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Web Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2010-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$
------------------------------------------------------------------------------
with FastCGI.Handlers.Responder;
with FastCGI.Requests;
with FastCGI.Replies;
package FastCGI.Application is
type Callback is
not null access procedure
(Request : FastCGI.Requests.Request;
Reply : out FastCGI.Replies.Reply;
Status : out Integer);
type Responder_Factory is
not null access function
return FastCGI.Handlers.Responder.Responder_Access;
procedure Initialize;
-- Initializes module.
procedure Execute (Handler : FastCGI.Application.Callback);
-- Executes main loop.
procedure Execute
(Responder_Factory : FastCGI.Application.Responder_Factory);
-- Executes main loop.
procedure Finalize;
end FastCGI.Application;
|
-- Example_Userdata
-- A simple example of an Ada type turned into a Lua userdata type
-- Copyright (c) 2015, James Humphry - see LICENSE for terms
with Lua, Lua.Userdata;
use Lua;
package Example_Userdata is
type Grandparent is abstract tagged
record
Flag : Boolean;
end record;
type Parent is new Grandparent with null record;
type Child is new Parent with
record
Counter : Integer := 0;
end record;
package Grandparent_Userdata is new Lua.Userdata(T => Grandparent);
package Child_Userdata is new Lua.Userdata(T => Child);
function Toggle (L : Lua_State'Class) return Natural;
function Increment (L : Lua_State'Class) return Natural;
procedure Register_Operations(L : Lua_State'Class);
end Example_Userdata;
|
-- { dg-do compile }
-- { dg-options "-O -gnatn -Winline" }
with Inline10_Pkg; use Inline10_Pkg;
procedure Inline10 is
begin
Test (0);
end;
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Web Framework --
-- --
-- Tools Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 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$
------------------------------------------------------------------------------
with Asis.Elements;
with Asis.Statements;
with Properties.Tools;
package body Properties.Statements.Case_Statement is
----------
-- Code --
----------
function Code
(Engine : access Engines.Contexts.Context;
Element : Asis.Expression;
Name : Engines.Text_Property) return League.Strings.Universal_String
is
use type Asis.Path_Kinds;
use type Asis.Definition_Kinds;
use type Asis.Element_Kinds;
List : constant Asis.Path_List :=
Asis.Statements.Statement_Paths (Element);
Text : League.Strings.Universal_String;
Down : League.Strings.Universal_String;
begin
Text.Append ("switch (");
Down := Engine.Text.Get_Property
(Asis.Statements.Case_Expression (Element), Name);
Text.Append (Down);
Text.Append (") {");
for J in List'Range loop
pragma Assert
(Asis.Elements.Path_Kind (List (J)) = Asis.A_Case_Path);
declare
Nested : constant Asis.Statement_List :=
Asis.Statements.Sequence_Of_Statements (List (J));
Alt : constant Asis.Element_List :=
Asis.Statements.Case_Path_Alternative_Choices (List (J));
begin
for K in Alt'Range loop
if Asis.Elements.Element_Kind (Alt (K)) =
Asis.An_Expression
then
Down := Engine.Text.Get_Property (Alt (K), Name);
Text.Append ("case ");
Text.Append (Down);
Text.Append (" : ");
elsif Asis.Elements.Definition_Kind (Alt (K)) =
Asis.An_Others_Choice
then
Text.Append ("default: ");
else
raise Constraint_Error;
end if;
Down := Engine.Text.Get_Property
(List => Nested,
Name => Name,
Empty => League.Strings.Empty_Universal_String,
Sum => Properties.Tools.Join'Access);
Text.Append (Down);
Text.Append ("break;");
end loop;
end;
end loop;
Text.Append ("};");
return Text;
end Code;
end Properties.Statements.Case_Statement;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- C L E A N --
-- --
-- B o d y --
-- --
-- Copyright (C) 2003-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. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with ALI; use ALI;
with Csets;
with Gnatvsn; use Gnatvsn;
with Makeutl;
with MLib.Tgt; use MLib.Tgt;
with Namet; use Namet;
with Opt; use Opt;
with Osint; use Osint;
with Osint.M; use Osint.M;
with Prj; use Prj;
with Prj.Env;
with Prj.Ext;
with Prj.Pars;
with Prj.Util; use Prj.Util;
with Snames;
with Table;
with Targparm; use Targparm;
with Types; use Types;
with Ada.Command_Line; use Ada.Command_Line;
with GNAT.Directory_Operations; use GNAT.Directory_Operations;
with GNAT.IO; use GNAT.IO;
with GNAT.OS_Lib; use GNAT.OS_Lib;
package body Clean is
Initialized : Boolean := False;
-- Set to True by the first call to Initialize.
-- To avoid reinitialization of some packages.
-- Suffixes of various files
Assembly_Suffix : constant String := ".s";
ALI_Suffix : constant String := ".ali";
Tree_Suffix : constant String := ".adt";
Object_Suffix : constant String := Get_Target_Object_Suffix.all;
Debug_Suffix : String := ".dg";
-- Changed to "_dg" for VMS in the body of the package
Repinfo_Suffix : String := ".rep";
-- Changed to "_rep" for VMS in the body of the package
B_Start : String_Ptr := new String'("b~");
-- Prefix of binder generated file, and number of actual characters used.
-- Changed to "b__" for VMS in the body of the package.
Object_Directory_Path : String_Access := null;
-- The path name of the object directory, set with switch -D
Force_Deletions : Boolean := False;
-- Set to True by switch -f. When True, attempts to delete non writable
-- files will be done.
Do_Nothing : Boolean := False;
-- Set to True when switch -n is specified. When True, no file is deleted.
-- gnatclean only lists the files that would have been deleted if the
-- switch -n had not been specified.
File_Deleted : Boolean := False;
-- Set to True if at least one file has been deleted
Copyright_Displayed : Boolean := False;
Usage_Displayed : Boolean := False;
Project_File_Name : String_Access := null;
Project_Tree : constant Prj.Project_Tree_Ref := new Prj.Project_Tree_Data;
Main_Project : Prj.Project_Id := Prj.No_Project;
All_Projects : Boolean := False;
-- Packages of project files where unknown attributes are errors
Naming_String : aliased String := "naming";
Builder_String : aliased String := "builder";
Compiler_String : aliased String := "compiler";
Binder_String : aliased String := "binder";
Linker_String : aliased String := "linker";
Gnatmake_Packages : aliased String_List :=
(Naming_String 'Access,
Builder_String 'Access,
Compiler_String 'Access,
Binder_String 'Access,
Linker_String 'Access);
Packages_To_Check_By_Gnatmake : constant String_List_Access :=
Gnatmake_Packages'Access;
package Processed_Projects is new Table.Table
(Table_Component_Type => Project_Id,
Table_Index_Type => Natural,
Table_Low_Bound => 0,
Table_Initial => 10,
Table_Increment => 10,
Table_Name => "Clean.Processed_Projects");
-- Table to keep track of what project files have been processed, when
-- switch -r is specified.
package Sources is new Table.Table
(Table_Component_Type => File_Name_Type,
Table_Index_Type => Natural,
Table_Low_Bound => 0,
Table_Initial => 10,
Table_Increment => 10,
Table_Name => "Clean.Processed_Projects");
-- Table to store all the source files of a library unit: spec, body and
-- subunits, to detect .dg files and delete them.
----------------------------
-- Queue (Q) manipulation --
----------------------------
procedure Init_Q;
-- Must be called to initialize the Q
procedure Insert_Q (Lib_File : File_Name_Type);
-- If Lib_File is not marked, inserts it at the end of Q and mark it
function Empty_Q return Boolean;
-- Returns True if Q is empty
procedure Extract_From_Q (Lib_File : out File_Name_Type);
-- Extracts the first element from the Q
Q_Front : Natural;
-- Points to the first valid element in the Q
package Q is new Table.Table (
Table_Component_Type => File_Name_Type,
Table_Index_Type => Natural,
Table_Low_Bound => 0,
Table_Initial => 4000,
Table_Increment => 100,
Table_Name => "Clean.Q");
-- This is the actual queue
-----------------------------
-- Other local subprograms --
-----------------------------
procedure Add_Source_Dir (N : String);
-- Call Add_Src_Search_Dir.
-- Output one line when in verbose mode.
procedure Add_Source_Directories is
new Prj.Env.For_All_Source_Dirs (Action => Add_Source_Dir);
procedure Add_Object_Dir (N : String);
-- Call Add_Lib_Search_Dir.
-- Output one line when in verbose mode.
procedure Add_Object_Directories is
new Prj.Env.For_All_Object_Dirs (Action => Add_Object_Dir);
function ALI_File_Name (Source : Name_Id) return String;
-- Returns the name of the ALI file corresponding to Source
function Assembly_File_Name (Source : Name_Id) return String;
-- Returns the assembly file name corresponding to Source
procedure Clean_Archive (Project : Project_Id);
-- Delete a global archive or a fake library project archive and the
-- dependency file, if they exist.
procedure Clean_Executables;
-- Do the cleaning work when no project file is specified
procedure Clean_Interface_Copy_Directory (Project : Project_Id);
-- Delete files in an interface coy directory directory: any file that is
-- a copy of a source of the project.
procedure Clean_Library_Directory (Project : Project_Id);
-- Delete the library file in a library directory and any ALI file
-- of a source of the project in a library ALI directory.
procedure Clean_Project (Project : Project_Id);
-- Do the cleaning work when a project file is specified.
-- This procedure calls itself recursively when there are several
-- project files in the tree rooted at the main project file and switch -r
-- has been specified.
function Debug_File_Name (Source : Name_Id) return String;
-- Name of the expanded source file corresponding to Source
procedure Delete (In_Directory : String; File : String);
-- Delete one file, or list the file name if switch -n is specified
procedure Delete_Binder_Generated_Files (Dir : String; Source : Name_Id);
-- Delete the binder generated file in directory Dir for Source, if they
-- exist: for Unix these are b~<source>.ads, b~<source>.adb,
-- b~<source>.ali and b~<source>.o.
procedure Display_Copyright;
-- Display the Copyright notice.
-- If called several times, display the Copyright notice only the first
-- time.
procedure Initialize;
-- Call the necessary package initializations
function Object_File_Name (Source : Name_Id) return String;
-- Returns the object file name corresponding to Source
procedure Parse_Cmd_Line;
-- Parse the command line
function Repinfo_File_Name (Source : Name_Id) return String;
-- Returns the repinfo file name corresponding to Source
function Tree_File_Name (Source : Name_Id) return String;
-- Returns the tree file name corresponding to Source
function In_Extension_Chain
(Of_Project : Project_Id;
Prj : Project_Id) return Boolean;
-- Returns True iff Prj is an extension of Of_Project or if Of_Project is
-- an extension of Prj.
function Ultimate_Extension_Of (Project : Project_Id) return Project_Id;
-- Returns either Project, if it is not extended by another project, or
-- the project that extends Project, directly or indirectly, and that is
-- not itself extended. Returns No_Project if Project is No_Project.
procedure Usage;
-- Display the usage.
-- If called several times, the usage is displayed only the first time.
--------------------
-- Add_Object_Dir --
--------------------
procedure Add_Object_Dir (N : String) is
begin
Add_Lib_Search_Dir (N);
if Opt.Verbose_Mode then
Put ("Adding object directory """);
Put (N);
Put (""".");
New_Line;
end if;
end Add_Object_Dir;
--------------------
-- Add_Source_Dir --
--------------------
procedure Add_Source_Dir (N : String) is
begin
Add_Src_Search_Dir (N);
if Opt.Verbose_Mode then
Put ("Adding source directory """);
Put (N);
Put (""".");
New_Line;
end if;
end Add_Source_Dir;
-------------------
-- ALI_File_Name --
-------------------
function ALI_File_Name (Source : Name_Id) return String is
Src : constant String := Get_Name_String (Source);
begin
-- If the source name has an extension, then replace it with
-- the ALI suffix.
for Index in reverse Src'First + 1 .. Src'Last loop
if Src (Index) = '.' then
return Src (Src'First .. Index - 1) & ALI_Suffix;
end if;
end loop;
-- If there is no dot, or if it is the first character, just add the
-- ALI suffix.
return Src & ALI_Suffix;
end ALI_File_Name;
------------------------
-- Assembly_File_Name --
------------------------
function Assembly_File_Name (Source : Name_Id) return String is
Src : constant String := Get_Name_String (Source);
begin
-- If the source name has an extension, then replace it with
-- the assembly suffix.
for Index in reverse Src'First + 1 .. Src'Last loop
if Src (Index) = '.' then
return Src (Src'First .. Index - 1) & Assembly_Suffix;
end if;
end loop;
-- If there is no dot, or if it is the first character, just add the
-- assembly suffix.
return Src & Assembly_Suffix;
end Assembly_File_Name;
-------------------
-- Clean_Archive --
-------------------
procedure Clean_Archive (Project : Project_Id) is
Current_Dir : constant Dir_Name_Str := Get_Current_Dir;
Data : constant Project_Data :=
Project_Tree.Projects.Table (Project);
Archive_Name : constant String :=
"lib" & Get_Name_String (Data.Name) & '.' & Archive_Ext;
-- The name of the archive file for this project
Archive_Dep_Name : constant String :=
"lib" & Get_Name_String (Data.Name) & ".deps";
-- The name of the archive dependency file for this project
Obj_Dir : constant String := Get_Name_String (Data.Object_Directory);
begin
Change_Dir (Obj_Dir);
if Is_Regular_File (Archive_Name) then
Delete (Obj_Dir, Archive_Name);
end if;
if Is_Regular_File (Archive_Dep_Name) then
Delete (Obj_Dir, Archive_Dep_Name);
end if;
Change_Dir (Current_Dir);
end Clean_Archive;
-----------------------
-- Clean_Executables --
-----------------------
procedure Clean_Executables is
Main_Source_File : File_Name_Type;
-- Current main source
Main_Lib_File : File_Name_Type;
-- ALI file of the current main
Lib_File : File_Name_Type;
-- Current ALI file
Full_Lib_File : File_Name_Type;
-- Full name of the current ALI file
Text : Text_Buffer_Ptr;
The_ALI : ALI_Id;
begin
Init_Q;
-- It does not really matter if there is or not an object file
-- corresponding to an ALI file: if there is one, it will be deleted.
Opt.Check_Object_Consistency := False;
-- Proceed each executable one by one. Each source is marked as it is
-- processed, so common sources between executables will not be
-- processed several times.
for N_File in 1 .. Osint.Number_Of_Files loop
Main_Source_File := Next_Main_Source;
Main_Lib_File := Osint.Lib_File_Name
(Main_Source_File, Current_File_Index);
Insert_Q (Main_Lib_File);
while not Empty_Q loop
Sources.Set_Last (0);
Extract_From_Q (Lib_File);
Full_Lib_File := Osint.Full_Lib_File_Name (Lib_File);
-- If we have existing ALI file that is not read-only, process it
if Full_Lib_File /= No_File
and then not Is_Readonly_Library (Full_Lib_File)
then
Text := Read_Library_Info (Lib_File);
if Text /= null then
The_ALI :=
Scan_ALI (Lib_File, Text, Ignore_ED => False, Err => True);
Free (Text);
-- If no error was produced while loading this ALI file,
-- insert into the queue all the unmarked withed sources.
if The_ALI /= No_ALI_Id then
for J in ALIs.Table (The_ALI).First_Unit ..
ALIs.Table (The_ALI).Last_Unit
loop
Sources.Increment_Last;
Sources.Table (Sources.Last) :=
ALI.Units.Table (J).Sfile;
for K in ALI.Units.Table (J).First_With ..
ALI.Units.Table (J).Last_With
loop
Insert_Q (Withs.Table (K).Afile);
end loop;
end loop;
-- Look for subunits and put them in the Sources table
for J in ALIs.Table (The_ALI).First_Sdep ..
ALIs.Table (The_ALI).Last_Sdep
loop
if Sdep.Table (J).Subunit_Name /= No_Name then
Sources.Increment_Last;
Sources.Table (Sources.Last) :=
Sdep.Table (J).Sfile;
end if;
end loop;
end if;
end if;
-- Now delete all existing files corresponding to this ALI file
declare
Obj_Dir : constant String :=
Dir_Name (Get_Name_String (Full_Lib_File));
Obj : constant String := Object_File_Name (Lib_File);
Adt : constant String := Tree_File_Name (Lib_File);
Asm : constant String := Assembly_File_Name (Lib_File);
begin
Delete (Obj_Dir, Get_Name_String (Lib_File));
if Is_Regular_File (Obj_Dir & Dir_Separator & Obj) then
Delete (Obj_Dir, Obj);
end if;
if Is_Regular_File (Obj_Dir & Dir_Separator & Adt) then
Delete (Obj_Dir, Adt);
end if;
if Is_Regular_File (Obj_Dir & Dir_Separator & Asm) then
Delete (Obj_Dir, Asm);
end if;
-- Delete expanded source files (.dg) and/or repinfo files
-- (.rep) if any
for J in 1 .. Sources.Last loop
declare
Deb : constant String :=
Debug_File_Name (Sources.Table (J));
Rep : constant String :=
Repinfo_File_Name (Sources.Table (J));
begin
if Is_Regular_File (Obj_Dir & Dir_Separator & Deb) then
Delete (Obj_Dir, Deb);
end if;
if Is_Regular_File (Obj_Dir & Dir_Separator & Rep) then
Delete (Obj_Dir, Rep);
end if;
end;
end loop;
end;
end if;
end loop;
-- Delete the executable, if it exists, and the binder generated
-- files, if any.
if not Compile_Only then
declare
Source : constant Name_Id := Strip_Suffix (Main_Lib_File);
Executable : constant String := Get_Name_String
(Executable_Name (Source));
begin
if Is_Regular_File (Executable) then
Delete ("", Executable);
end if;
Delete_Binder_Generated_Files (Get_Current_Dir, Source);
end;
end if;
end loop;
end Clean_Executables;
------------------------------------
-- Clean_Interface_Copy_Directory --
------------------------------------
procedure Clean_Interface_Copy_Directory (Project : Project_Id) is
Current : constant String := Get_Current_Dir;
Data : constant Project_Data := Project_Tree.Projects.Table (Project);
Direc : Dir_Type;
Name : String (1 .. 200);
Last : Natural;
Delete_File : Boolean;
Unit : Unit_Data;
begin
if Data.Library and then Data.Library_Src_Dir /= No_Name then
declare
Directory : constant String :=
Get_Name_String (Data.Library_Src_Dir);
begin
Change_Dir (Get_Name_String (Data.Library_Src_Dir));
Open (Direc, ".");
-- For each regular file in the directory, if switch -n has not
-- been specified, make it writable and delete the file if it is
-- a copy of a source of the project.
loop
Read (Direc, Name, Last);
exit when Last = 0;
if Is_Regular_File (Name (1 .. Last)) then
Canonical_Case_File_Name (Name (1 .. Last));
Delete_File := False;
-- Compare with source file names of the project
for Index in 1 .. Unit_Table.Last (Project_Tree.Units) loop
Unit := Project_Tree.Units.Table (Index);
if Ultimate_Extension_Of
(Unit.File_Names (Body_Part).Project) = Project
and then
Get_Name_String
(Unit.File_Names (Body_Part).Name) =
Name (1 .. Last)
then
Delete_File := True;
exit;
end if;
if Ultimate_Extension_Of
(Unit.File_Names (Specification).Project) = Project
and then
Get_Name_String
(Unit.File_Names (Specification).Name) =
Name (1 .. Last)
then
Delete_File := True;
exit;
end if;
end loop;
if Delete_File then
if not Do_Nothing then
Set_Writable (Name (1 .. Last));
end if;
Delete (Directory, Name (1 .. Last));
end if;
end if;
end loop;
Close (Direc);
-- Restore the initial working directory
Change_Dir (Current);
end;
end if;
end Clean_Interface_Copy_Directory;
-----------------------------
-- Clean_Library_Directory --
-----------------------------
procedure Clean_Library_Directory (Project : Project_Id) is
Current : constant String := Get_Current_Dir;
Data : constant Project_Data := Project_Tree.Projects.Table (Project);
Lib_Filename : constant String := Get_Name_String (Data.Library_Name);
DLL_Name : constant String :=
DLL_Prefix & Lib_Filename & "." & DLL_Ext;
Archive_Name : constant String :=
"lib" & Lib_Filename & "." & Archive_Ext;
Direc : Dir_Type;
Name : String (1 .. 200);
Last : Natural;
Delete_File : Boolean;
begin
if Data.Library then
declare
Lib_Directory : constant String :=
Get_Name_String (Data.Library_Dir);
Lib_ALI_Directory : constant String :=
Get_Name_String (Data.Library_ALI_Dir);
begin
Change_Dir (Lib_Directory);
Open (Direc, ".");
-- For each regular file in the directory, if switch -n has not
-- been specified, make it writable and delete the file if it is
-- the library file.
loop
Read (Direc, Name, Last);
exit when Last = 0;
if Is_Regular_File (Name (1 .. Last)) then
Canonical_Case_File_Name (Name (1 .. Last));
Delete_File := False;
if (Data.Library_Kind = Static and then
Name (1 .. Last) = Archive_Name)
or else
((Data.Library_Kind = Dynamic or else
Data.Library_Kind = Relocatable)
and then
Name (1 .. Last) = DLL_Name)
then
if not Do_Nothing then
Set_Writable (Name (1 .. Last));
end if;
Delete (Lib_Directory, Name (1 .. Last));
exit;
end if;
end if;
end loop;
Close (Direc);
Change_Dir (Lib_ALI_Directory);
Open (Direc, ".");
-- For each regular file in the directory, if switch -n has not
-- been specified, make it writable and delete the file if it is
-- any ALI file of a source of the project.
loop
Read (Direc, Name, Last);
exit when Last = 0;
if Is_Regular_File (Name (1 .. Last)) then
Canonical_Case_File_Name (Name (1 .. Last));
Delete_File := False;
if Last > 4 and then Name (Last - 3 .. Last) = ".ali" then
declare
Unit : Unit_Data;
begin
-- Compare with ALI file names of the project
for
Index in 1 .. Unit_Table.Last (Project_Tree.Units)
loop
Unit := Project_Tree.Units.Table (Index);
if Unit.File_Names (Body_Part).Project /=
No_Project
then
if Ultimate_Extension_Of
(Unit.File_Names (Body_Part).Project) =
Project
then
Get_Name_String
(Unit.File_Names (Body_Part).Name);
Name_Len := Name_Len -
File_Extension
(Name (1 .. Name_Len))'Length;
if Name_Buffer (1 .. Name_Len) =
Name (1 .. Last - 4)
then
Delete_File := True;
exit;
end if;
end if;
elsif Ultimate_Extension_Of
(Unit.File_Names (Specification).Project) =
Project
then
Get_Name_String
(Unit.File_Names (Specification).Name);
Name_Len := Name_Len -
File_Extension
(Name (1 .. Name_Len))'Length;
if Name_Buffer (1 .. Name_Len) =
Name (1 .. Last - 4)
then
Delete_File := True;
exit;
end if;
end if;
end loop;
end;
end if;
if Delete_File then
if not Do_Nothing then
Set_Writable (Name (1 .. Last));
end if;
Delete (Lib_ALI_Directory, Name (1 .. Last));
end if;
end if;
end loop;
Close (Direc);
-- Restore the initial working directory
Change_Dir (Current);
end;
end if;
end Clean_Library_Directory;
-------------------
-- Clean_Project --
-------------------
procedure Clean_Project (Project : Project_Id) is
Main_Source_File : File_Name_Type;
-- Name of executable on the command line without directory info
Executable : Name_Id;
-- Name of the executable file
Current_Dir : constant Dir_Name_Str := Get_Current_Dir;
Data : constant Project_Data :=
Project_Tree.Projects.Table (Project);
U_Data : Unit_Data;
File_Name1 : Name_Id;
Index1 : Int;
File_Name2 : Name_Id;
Index2 : Int;
Lib_File : File_Name_Type;
Source_Id : Other_Source_Id;
Source : Other_Source;
Global_Archive : Boolean := False;
begin
-- Check that we don't specify executable on the command line for
-- a main library project.
if Project = Main_Project
and then Osint.Number_Of_Files /= 0
and then Data.Library
then
Osint.Fail
("Cannot specify executable(s) for a Library Project File");
end if;
-- Nothing to clean in an externally built project
if Data.Externally_Built then
if Verbose_Mode then
Put ("Nothing to do to clean externally built project """);
Put (Get_Name_String (Data.Name));
Put_Line ("""");
end if;
else
if Verbose_Mode then
Put ("Cleaning project """);
Put (Get_Name_String (Data.Name));
Put_Line ("""");
end if;
-- Add project to the list of processed projects
Processed_Projects.Increment_Last;
Processed_Projects.Table (Processed_Projects.Last) := Project;
if Data.Object_Directory /= No_Name then
declare
Obj_Dir : constant String :=
Get_Name_String (Data.Object_Directory);
begin
Change_Dir (Obj_Dir);
-- First, deal with Ada
-- Look through the units to find those that are either
-- immediate sources or inherited sources of the project.
-- Extending projects may have no language specified, if
-- Source_Dirs or Source_Files is specified as an empty list,
-- so always look for Ada units in extending projects.
if Data.Languages (Ada_Language_Index)
or else Data.Extends /= No_Project
then
for Unit in Unit_Table.First ..
Unit_Table.Last (Project_Tree.Units)
loop
U_Data := Project_Tree.Units.Table (Unit);
File_Name1 := No_Name;
File_Name2 := No_Name;
-- If either the spec or the body is a source of the
-- project, check for the corresponding ALI file in the
-- object directory.
if In_Extension_Chain
(U_Data.File_Names (Body_Part).Project, Project)
or else
In_Extension_Chain
(U_Data.File_Names (Specification).Project, Project)
then
File_Name1 := U_Data.File_Names (Body_Part).Name;
Index1 := U_Data.File_Names (Body_Part).Index;
File_Name2 := U_Data.File_Names (Specification).Name;
Index2 := U_Data.File_Names (Specification).Index;
-- If there is no body file name, then there may be
-- only a spec.
if File_Name1 = No_Name then
File_Name1 := File_Name2;
Index1 := Index2;
File_Name2 := No_Name;
Index2 := 0;
end if;
end if;
-- If there is either a spec or a body, look for files
-- in the object directory.
if File_Name1 /= No_Name then
Lib_File := Osint.Lib_File_Name (File_Name1, Index1);
declare
Asm : constant String :=
Assembly_File_Name (Lib_File);
ALI : constant String :=
ALI_File_Name (Lib_File);
Obj : constant String :=
Object_File_Name (Lib_File);
Adt : constant String :=
Tree_File_Name (Lib_File);
Deb : constant String :=
Debug_File_Name (File_Name1);
Rep : constant String :=
Repinfo_File_Name (File_Name1);
Del : Boolean := True;
begin
-- If the ALI file exists and is read-only, no file
-- is deleted.
if Is_Regular_File (ALI) then
if Is_Writable_File (ALI) then
Delete (Obj_Dir, ALI);
else
Del := False;
if Verbose_Mode then
Put ('"');
Put (Obj_Dir);
if Obj_Dir (Obj_Dir'Last) /=
Dir_Separator
then
Put (Dir_Separator);
end if;
Put (ALI);
Put_Line (""" is read-only");
end if;
end if;
end if;
if Del then
-- Object file
if Is_Regular_File (Obj) then
Delete (Obj_Dir, Obj);
end if;
-- Assembly file
if Is_Regular_File (Asm) then
Delete (Obj_Dir, Asm);
end if;
-- Tree file
if Is_Regular_File (Adt) then
Delete (Obj_Dir, Adt);
end if;
-- First expanded source file
if Is_Regular_File (Deb) then
Delete (Obj_Dir, Deb);
end if;
-- Repinfo file
if Is_Regular_File (Rep) then
Delete (Obj_Dir, Rep);
end if;
-- Second expanded source file
if File_Name2 /= No_Name then
declare
Deb : constant String :=
Debug_File_Name (File_Name2);
Rep : constant String :=
Repinfo_File_Name (File_Name2);
begin
if Is_Regular_File (Deb) then
Delete (Obj_Dir, Deb);
end if;
if Is_Regular_File (Rep) then
Delete (Obj_Dir, Rep);
end if;
end;
end if;
end if;
end;
end if;
end loop;
end if;
-- Check if a global archive and it dependency file could have
-- been created and, if they exist, delete them.
if Project = Main_Project and then not Data.Library then
Global_Archive := False;
for Proj in Project_Table.First ..
Project_Table.Last (Project_Tree.Projects)
loop
if Project_Tree.Projects.Table
(Proj).Other_Sources_Present
then
Global_Archive := True;
exit;
end if;
end loop;
if Global_Archive then
Clean_Archive (Project);
end if;
end if;
if Data.Other_Sources_Present then
-- There is non-Ada code: delete the object files and
-- the dependency files if they exist.
Source_Id := Data.First_Other_Source;
while Source_Id /= No_Other_Source loop
Source :=
Project_Tree.Other_Sources.Table (Source_Id);
if Is_Regular_File
(Get_Name_String (Source.Object_Name))
then
Delete (Obj_Dir, Get_Name_String (Source.Object_Name));
end if;
if
Is_Regular_File (Get_Name_String (Source.Dep_Name))
then
Delete (Obj_Dir, Get_Name_String (Source.Dep_Name));
end if;
Source_Id := Source.Next;
end loop;
-- If it is a library with only non Ada sources, delete
-- the fake archive and the dependency file, if they exist.
if Data.Library
and then not Data.Languages (Ada_Language_Index)
then
Clean_Archive (Project);
end if;
end if;
end;
end if;
-- If this is a library project, clean the library directory, the
-- interface copy dir and, for a Stand-Alone Library, the binder
-- generated files of the library.
-- The directories are cleaned only if switch -c is not specified
if Data.Library then
if not Compile_Only then
Clean_Library_Directory (Project);
if Data.Library_Src_Dir /= No_Name then
Clean_Interface_Copy_Directory (Project);
end if;
end if;
if Data.Standalone_Library and then
Data.Object_Directory /= No_Name
then
Delete_Binder_Generated_Files
(Get_Name_String (Data.Object_Directory), Data.Library_Name);
end if;
end if;
if Verbose_Mode then
New_Line;
end if;
end if;
-- If switch -r is specified, call Clean_Project recursively for the
-- imported projects and the project being extended.
if All_Projects then
declare
Imported : Project_List := Data.Imported_Projects;
Element : Project_Element;
Process : Boolean;
begin
-- For each imported project, call Clean_Project if the project
-- has not been processed already.
while Imported /= Empty_Project_List loop
Element := Project_Tree.Project_Lists.Table (Imported);
Imported := Element.Next;
Process := True;
for
J in Processed_Projects.First .. Processed_Projects.Last
loop
if Element.Project = Processed_Projects.Table (J) then
Process := False;
exit;
end if;
end loop;
if Process then
Clean_Project (Element.Project);
end if;
end loop;
-- If this project extends another project, call Clean_Project for
-- the project being extended. It is guaranteed that it has not
-- called before, because no other project may import or extend
-- this project.
if Data.Extends /= No_Project then
Clean_Project (Data.Extends);
end if;
end;
end if;
-- For the main project, delete the executables and the binder
-- generated files.
-- The executables are deleted only if switch -c is not specified
if Project = Main_Project and then Data.Exec_Directory /= No_Name then
declare
Exec_Dir : constant String :=
Get_Name_String (Data.Exec_Directory);
begin
Change_Dir (Exec_Dir);
for N_File in 1 .. Osint.Number_Of_Files loop
Main_Source_File := Next_Main_Source;
if not Compile_Only then
Executable :=
Executable_Of
(Main_Project,
Project_Tree,
Main_Source_File,
Current_File_Index);
declare
Exec_File_Name : constant String :=
Get_Name_String (Executable);
begin
if Is_Absolute_Path (Name => Exec_File_Name) then
if Is_Regular_File (Exec_File_Name) then
Delete ("", Exec_File_Name);
end if;
else
if Is_Regular_File (Exec_File_Name) then
Delete (Exec_Dir, Exec_File_Name);
end if;
end if;
end;
end if;
if Data.Object_Directory /= No_Name then
Delete_Binder_Generated_Files
(Get_Name_String
(Data.Object_Directory),
Strip_Suffix (Main_Source_File));
end if;
end loop;
end;
end if;
-- Change back to previous directory
Change_Dir (Current_Dir);
end Clean_Project;
---------------------
-- Debug_File_Name --
---------------------
function Debug_File_Name (Source : Name_Id) return String is
begin
return Get_Name_String (Source) & Debug_Suffix;
end Debug_File_Name;
------------
-- Delete --
------------
procedure Delete (In_Directory : String; File : String) is
Full_Name : String (1 .. In_Directory'Length + File'Length + 1);
Last : Natural := 0;
Success : Boolean;
begin
-- Indicate that at least one file is deleted or is to be deleted
File_Deleted := True;
-- Build the path name of the file to delete
Last := In_Directory'Length;
Full_Name (1 .. Last) := In_Directory;
if Last > 0 and then Full_Name (Last) /= Directory_Separator then
Last := Last + 1;
Full_Name (Last) := Directory_Separator;
end if;
Full_Name (Last + 1 .. Last + File'Length) := File;
Last := Last + File'Length;
-- If switch -n was used, simply output the path name
if Do_Nothing then
Put_Line (Full_Name (1 .. Last));
-- Otherwise, delete the file if it is writable
else
if Force_Deletions
or else Is_Writable_File (Full_Name (1 .. Last))
then
Delete_File (Full_Name (1 .. Last), Success);
else
Success := False;
end if;
if Verbose_Mode or else not Quiet_Output then
if not Success then
Put ("Warning: """);
Put (Full_Name (1 .. Last));
Put_Line (""" could not be deleted");
else
Put ("""");
Put (Full_Name (1 .. Last));
Put_Line (""" has been deleted");
end if;
end if;
end if;
end Delete;
-----------------------------------
-- Delete_Binder_Generated_Files --
-----------------------------------
procedure Delete_Binder_Generated_Files (Dir : String; Source : Name_Id) is
Source_Name : constant String := Get_Name_String (Source);
Current : constant String := Get_Current_Dir;
Last : constant Positive := B_Start'Length + Source_Name'Length;
File_Name : String (1 .. Last + 4);
begin
Change_Dir (Dir);
-- Build the file name (before the extension)
File_Name (1 .. B_Start'Length) := B_Start.all;
File_Name (B_Start'Length + 1 .. Last) := Source_Name;
-- Spec
File_Name (Last + 1 .. Last + 4) := ".ads";
if Is_Regular_File (File_Name (1 .. Last + 4)) then
Delete (Dir, File_Name (1 .. Last + 4));
end if;
-- Body
File_Name (Last + 1 .. Last + 4) := ".adb";
if Is_Regular_File (File_Name (1 .. Last + 4)) then
Delete (Dir, File_Name (1 .. Last + 4));
end if;
-- ALI file
File_Name (Last + 1 .. Last + 4) := ".ali";
if Is_Regular_File (File_Name (1 .. Last + 4)) then
Delete (Dir, File_Name (1 .. Last + 4));
end if;
-- Object file
File_Name (Last + 1 .. Last + Object_Suffix'Length) := Object_Suffix;
if Is_Regular_File (File_Name (1 .. Last + Object_Suffix'Length)) then
Delete (Dir, File_Name (1 .. Last + Object_Suffix'Length));
end if;
-- Change back to previous directory
Change_Dir (Current);
end Delete_Binder_Generated_Files;
-----------------------
-- Display_Copyright --
-----------------------
procedure Display_Copyright is
begin
if not Copyright_Displayed then
Copyright_Displayed := True;
Put_Line
("GNATCLEAN " & Gnatvsn.Gnat_Version_String
& " Copyright 2003-"
& Current_Year
& " Free Software Foundation, Inc.");
end if;
end Display_Copyright;
-------------
-- Empty_Q --
-------------
function Empty_Q return Boolean is
begin
return Q_Front >= Q.Last;
end Empty_Q;
--------------------
-- Extract_From_Q --
--------------------
procedure Extract_From_Q (Lib_File : out File_Name_Type) is
Lib : constant File_Name_Type := Q.Table (Q_Front);
begin
Q_Front := Q_Front + 1;
Lib_File := Lib;
end Extract_From_Q;
---------------
-- Gnatclean --
---------------
procedure Gnatclean is
begin
-- Do the necessary initializations
Clean.Initialize;
-- Parse the command line, getting the switches and the executable names
Parse_Cmd_Line;
if Verbose_Mode then
Display_Copyright;
end if;
if Project_File_Name /= null then
-- A project file was specified by a -P switch
if Opt.Verbose_Mode then
New_Line;
Put ("Parsing Project File """);
Put (Project_File_Name.all);
Put_Line (""".");
New_Line;
end if;
-- Set the project parsing verbosity to whatever was specified
-- by a possible -vP switch.
Prj.Pars.Set_Verbosity (To => Current_Verbosity);
-- Parse the project file. If there is an error, Main_Project
-- will still be No_Project.
Prj.Pars.Parse
(Project => Main_Project,
In_Tree => Project_Tree,
Project_File_Name => Project_File_Name.all,
Packages_To_Check => Packages_To_Check_By_Gnatmake);
if Main_Project = No_Project then
Fail ("""" & Project_File_Name.all & """ processing failed");
end if;
if Opt.Verbose_Mode then
New_Line;
Put ("Parsing of Project File """);
Put (Project_File_Name.all);
Put (""" is finished.");
New_Line;
end if;
-- Add source directories and object directories to the search paths
Add_Source_Directories (Main_Project, Project_Tree);
Add_Object_Directories (Main_Project, Project_Tree);
end if;
Osint.Add_Default_Search_Dirs;
-- If a project file was specified, but no executable name, put all
-- the mains of the project file (if any) as if there were on the
-- command line.
if Main_Project /= No_Project and then Osint.Number_Of_Files = 0 then
declare
Value : String_List_Id :=
Project_Tree.Projects.Table (Main_Project).Mains;
Main : String_Element;
begin
while Value /= Prj.Nil_String loop
Main := Project_Tree.String_Elements.Table (Value);
Osint.Add_File
(File_Name => Get_Name_String (Main.Value),
Index => Main.Index);
Value := Main.Next;
end loop;
end;
end if;
-- If neither a project file nor an executable were specified,
-- output the usage and exit.
if Main_Project = No_Project and then Osint.Number_Of_Files = 0 then
Usage;
return;
end if;
if Verbose_Mode then
New_Line;
end if;
if Main_Project /= No_Project then
-- If a project file has been specified, call Clean_Project with the
-- project id of this project file, after resetting the list of
-- processed projects.
Processed_Projects.Init;
Clean_Project (Main_Project);
else
-- If no project file has been specified, the work is done in
-- Clean_Executables.
Clean_Executables;
end if;
-- In verbose mode, if Delete has not been called, indicate that
-- no file needs to be deleted.
if Verbose_Mode and (not File_Deleted) then
New_Line;
if Do_Nothing then
Put_Line ("No file needs to be deleted");
else
Put_Line ("No file has been deleted");
end if;
end if;
end Gnatclean;
------------------------
-- In_Extension_Chain --
------------------------
function In_Extension_Chain
(Of_Project : Project_Id;
Prj : Project_Id) return Boolean
is
Data : Project_Data;
begin
if Prj = No_Project or else Of_Project = No_Project then
return False;
end if;
if Of_Project = Prj then
return True;
end if;
Data := Project_Tree.Projects.Table (Of_Project);
while Data.Extends /= No_Project loop
if Data.Extends = Prj then
return True;
end if;
Data := Project_Tree.Projects.Table (Data.Extends);
end loop;
Data := Project_Tree.Projects.Table (Prj);
while Data.Extends /= No_Project loop
if Data.Extends = Of_Project then
return True;
end if;
Data := Project_Tree.Projects.Table (Data.Extends);
end loop;
return False;
end In_Extension_Chain;
------------
-- Init_Q --
------------
procedure Init_Q is
begin
Q_Front := Q.First;
Q.Set_Last (Q.First);
end Init_Q;
----------------
-- Initialize --
----------------
procedure Initialize is
begin
if not Initialized then
Initialized := True;
-- Get default search directories to locate system.ads when calling
-- Targparm.Get_Target_Parameters.
Osint.Add_Default_Search_Dirs;
-- Initialize some packages
Csets.Initialize;
Namet.Initialize;
Snames.Initialize;
Prj.Initialize (Project_Tree);
-- Check if the platform is VMS and, if it is, change some variables
Targparm.Get_Target_Parameters;
if OpenVMS_On_Target then
Debug_Suffix (Debug_Suffix'First) := '_';
Repinfo_Suffix (Repinfo_Suffix'First) := '_';
B_Start := new String'("b__");
end if;
end if;
-- Reset global variables
Free (Object_Directory_Path);
Do_Nothing := False;
File_Deleted := False;
Copyright_Displayed := False;
Usage_Displayed := False;
Free (Project_File_Name);
Main_Project := Prj.No_Project;
All_Projects := False;
end Initialize;
--------------
-- Insert_Q --
--------------
procedure Insert_Q (Lib_File : File_Name_Type) is
begin
-- Do not insert an empty name or an already marked source
if Lib_File /= No_Name and then not Makeutl.Is_Marked (Lib_File) then
Q.Table (Q.Last) := Lib_File;
Q.Increment_Last;
-- Mark the source that has been just added to the Q
Makeutl.Mark (Lib_File);
end if;
end Insert_Q;
----------------------
-- Object_File_Name --
----------------------
function Object_File_Name (Source : Name_Id) return String is
Src : constant String := Get_Name_String (Source);
begin
-- If the source name has an extension, then replace it with
-- the Object suffix.
for Index in reverse Src'First + 1 .. Src'Last loop
if Src (Index) = '.' then
return Src (Src'First .. Index - 1) & Object_Suffix;
end if;
end loop;
-- If there is no dot, or if it is the first character, just add the
-- ALI suffix.
return Src & Object_Suffix;
end Object_File_Name;
--------------------
-- Parse_Cmd_Line --
--------------------
procedure Parse_Cmd_Line is
Source_Index : Int := 0;
Index : Positive := 1;
Last : constant Natural := Argument_Count;
begin
while Index <= Last loop
declare
Arg : constant String := Argument (Index);
procedure Bad_Argument;
-- Signal bad argument
------------------
-- Bad_Argument --
------------------
procedure Bad_Argument is
begin
Fail ("invalid argument """, Arg, """");
end Bad_Argument;
begin
if Arg'Length /= 0 then
if Arg (1) = '-' then
if Arg'Length = 1 then
Bad_Argument;
end if;
case Arg (2) is
when 'a' =>
if Arg'Length < 4 or else Arg (3) /= 'O' then
Bad_Argument;
end if;
Add_Lib_Search_Dir (Arg (3 .. Arg'Last));
when 'c' =>
Compile_Only := True;
when 'D' =>
if Object_Directory_Path /= null then
Fail ("duplicate -D switch");
elsif Project_File_Name /= null then
Fail ("-P and -D cannot be used simultaneously");
end if;
if Arg'Length > 2 then
declare
Dir : constant String := Arg (3 .. Arg'Last);
begin
if not Is_Directory (Dir) then
Fail (Dir, " is not a directory");
else
Add_Lib_Search_Dir (Dir);
end if;
end;
else
if Index = Last then
Fail ("no directory specified after -D");
end if;
Index := Index + 1;
declare
Dir : constant String := Argument (Index);
begin
if not Is_Directory (Dir) then
Fail (Dir, " is not a directory");
else
Add_Lib_Search_Dir (Dir);
end if;
end;
end if;
when 'f' =>
Force_Deletions := True;
when 'F' =>
Full_Path_Name_For_Brief_Errors := True;
when 'h' =>
Usage;
when 'i' =>
if Arg'Length = 2 then
Bad_Argument;
end if;
Source_Index := 0;
for J in 3 .. Arg'Last loop
if Arg (J) not in '0' .. '9' then
Bad_Argument;
end if;
Source_Index :=
(20 * Source_Index) +
(Character'Pos (Arg (J)) - Character'Pos ('0'));
end loop;
when 'I' =>
if Arg = "-I-" then
Opt.Look_In_Primary_Dir := False;
else
if Arg'Length = 2 then
Bad_Argument;
end if;
Add_Lib_Search_Dir (Arg (3 .. Arg'Last));
end if;
when 'n' =>
Do_Nothing := True;
when 'P' =>
if Project_File_Name /= null then
Fail ("multiple -P switches");
elsif Object_Directory_Path /= null then
Fail ("-D and -P cannot be used simultaneously");
end if;
if Arg'Length > 2 then
declare
Prj : constant String := Arg (3 .. Arg'Last);
begin
if Prj'Length > 1 and then
Prj (Prj'First) = '='
then
Project_File_Name :=
new String'
(Prj (Prj'First + 1 .. Prj'Last));
else
Project_File_Name := new String'(Prj);
end if;
end;
else
if Index = Last then
Fail ("no project specified after -P");
end if;
Index := Index + 1;
Project_File_Name := new String'(Argument (Index));
end if;
when 'q' =>
Quiet_Output := True;
when 'r' =>
All_Projects := True;
when 'v' =>
if Arg = "-v" then
Verbose_Mode := True;
elsif Arg = "-vP0" then
Current_Verbosity := Prj.Default;
elsif Arg = "-vP1" then
Current_Verbosity := Prj.Medium;
elsif Arg = "-vP2" then
Current_Verbosity := Prj.High;
else
Bad_Argument;
end if;
when 'X' =>
if Arg'Length = 2 then
Bad_Argument;
end if;
declare
Ext_Asgn : constant String := Arg (3 .. Arg'Last);
Start : Positive := Ext_Asgn'First;
Stop : Natural := Ext_Asgn'Last;
Equal_Pos : Natural;
OK : Boolean := True;
begin
if Ext_Asgn (Start) = '"' then
if Ext_Asgn (Stop) = '"' then
Start := Start + 1;
Stop := Stop - 1;
else
OK := False;
end if;
end if;
Equal_Pos := Start;
while Equal_Pos <= Stop
and then Ext_Asgn (Equal_Pos) /= '='
loop
Equal_Pos := Equal_Pos + 1;
end loop;
if Equal_Pos = Start or else Equal_Pos > Stop then
OK := False;
end if;
if OK then
Prj.Ext.Add
(External_Name =>
Ext_Asgn (Start .. Equal_Pos - 1),
Value =>
Ext_Asgn (Equal_Pos + 1 .. Stop));
else
Fail
("illegal external assignment '",
Ext_Asgn, "'");
end if;
end;
when others =>
Bad_Argument;
end case;
else
Add_File (Arg, Source_Index);
end if;
end if;
end;
Index := Index + 1;
end loop;
end Parse_Cmd_Line;
-----------------------
-- Repinfo_File_Name --
-----------------------
function Repinfo_File_Name (Source : Name_Id) return String is
begin
return Get_Name_String (Source) & Repinfo_Suffix;
end Repinfo_File_Name;
--------------------
-- Tree_File_Name --
--------------------
function Tree_File_Name (Source : Name_Id) return String is
Src : constant String := Get_Name_String (Source);
begin
-- If the source name has an extension, then replace it with
-- the tree suffix.
for Index in reverse Src'First + 1 .. Src'Last loop
if Src (Index) = '.' then
return Src (Src'First .. Index - 1) & Tree_Suffix;
end if;
end loop;
-- If there is no dot, or if it is the first character, just add the
-- tree suffix.
return Src & Tree_Suffix;
end Tree_File_Name;
---------------------------
-- Ultimate_Extension_Of --
---------------------------
function Ultimate_Extension_Of (Project : Project_Id) return Project_Id is
Result : Project_Id := Project;
Data : Project_Data;
begin
if Project /= No_Project then
loop
Data := Project_Tree.Projects.Table (Result);
exit when Data.Extended_By = No_Project;
Result := Data.Extended_By;
end loop;
end if;
return Result;
end Ultimate_Extension_Of;
-----------
-- Usage --
-----------
procedure Usage is
begin
if not Usage_Displayed then
Usage_Displayed := True;
Display_Copyright;
Put_Line ("Usage: gnatclean [switches] {[-innn] name}");
New_Line;
Put_Line (" names is one or more file names from which " &
"the .adb or .ads suffix may be omitted");
Put_Line (" names may be omitted if -P<project> is specified");
New_Line;
Put_Line (" -c Only delete compiler generated files");
Put_Line (" -D dir Specify dir as the object library");
Put_Line (" -f Force deletions of unwritable files");
Put_Line (" -F Full project path name " &
"in brief error messages");
Put_Line (" -h Display this message");
Put_Line (" -innn Index of unit in source for following names");
Put_Line (" -n Nothing to do: only list files to delete");
Put_Line (" -Pproj Use GNAT Project File proj");
Put_Line (" -q Be quiet/terse");
Put_Line (" -r Clean all projects recursively");
Put_Line (" -v Verbose mode");
Put_Line (" -vPx Specify verbosity when parsing " &
"GNAT Project Files");
Put_Line (" -Xnm=val Specify an external reference " &
"for GNAT Project Files");
New_Line;
Put_Line (" -aOdir Specify ALI/object files search path");
Put_Line (" -Idir Like -aOdir");
Put_Line (" -I- Don't look for source/library files " &
"in the default directory");
New_Line;
end if;
end Usage;
end Clean;
|
-- Copyright 2010-2014 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 Pack; use Pack;
procedure P is
begin
Print (4, 5);
end P;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- G N A T M A K E --
-- --
-- B o d y --
-- --
-- $Revision$
-- --
-- Copyright (C) 1992-1997 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- Gnatmake usage: please consult the gnat documentation
with Gnatvsn;
with Make;
procedure Gnatmake is
pragma Ident (Gnatvsn.Gnat_Version_String);
begin
-- The real work is done in Package Make. Gnatmake used to be a standalone
-- routine. Now Gnatmake's facilities have been placed in a package
-- because a number of gnatmake's services may be useful to others.
Make.Gnatmake;
end Gnatmake;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- A D A . C A L E N D A R . C O N V E R S I O N S --
-- --
-- S p e c --
-- --
-- Copyright (C) 2008-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 various routines for conversion between Ada and Unix
-- time models - Time, Duration, struct tm and struct timespec.
with Interfaces.C;
with Interfaces.C.Extensions;
package Ada.Calendar.Conversions is
function To_Ada_Time (Unix_Time : Interfaces.C.long) return Time;
-- Convert a time value represented as number of seconds since the
-- Unix Epoch to a time value relative to an Ada implementation-defined
-- Epoch. The units of the result are nanoseconds on all targets. Raises
-- Time_Error if the result cannot fit into a Time value.
function To_Ada_Time
(tm_year : Interfaces.C.int;
tm_mon : Interfaces.C.int;
tm_day : Interfaces.C.int;
tm_hour : Interfaces.C.int;
tm_min : Interfaces.C.int;
tm_sec : Interfaces.C.int;
tm_isdst : Interfaces.C.int) return Time;
-- Convert a time value expressed in Unix-like fields of struct tm into
-- a Time value relative to the Ada Epoch. The ranges of the formals are
-- as follows:
-- tm_year -- years since 1900
-- tm_mon -- months since January [0 .. 11]
-- tm_day -- day of the month [1 .. 31]
-- tm_hour -- hours since midnight [0 .. 24]
-- tm_min -- minutes after the hour [0 .. 59]
-- tm_sec -- seconds after the minute [0 .. 60]
-- tm_isdst -- Daylight Savings Time flag [-1 .. 1]
-- The returned value is in UTC and may or may not contain leap seconds
-- depending on whether binder flag "-y" was used. Raises Time_Error if
-- the input values are out of the defined ranges or if tm_sec equals 60
-- and the instance in time is not a leap second occurrence.
function To_Duration
(tv_sec : Interfaces.C.long;
tv_nsec : Interfaces.C.long) return Duration;
-- Convert an elapsed time value expressed in Unix-like fields of struct
-- timespec into a Duration value. The expected ranges are:
-- tv_sec - seconds
-- tv_nsec - nanoseconds
procedure To_Struct_Timespec
(D : Duration;
tv_sec : out Interfaces.C.long;
tv_nsec : out Interfaces.C.long);
-- Convert a Duration value into the constituents of struct timespec.
-- Formal tv_sec denotes seconds and tv_nsecs denotes nanoseconds.
procedure To_Struct_Tm
(T : Time;
tm_year : out Interfaces.C.int;
tm_mon : out Interfaces.C.int;
tm_day : out Interfaces.C.int;
tm_hour : out Interfaces.C.int;
tm_min : out Interfaces.C.int;
tm_sec : out Interfaces.C.int);
-- Convert a Time value set in the Ada Epoch into the constituents of
-- struct tm. The ranges of the out formals are as follows:
-- tm_year -- years since 1900
-- tm_mon -- months since January [0 .. 11]
-- tm_day -- day of the month [1 .. 31]
-- tm_hour -- hours since midnight [0 .. 24]
-- tm_min -- minutes after the hour [0 .. 59]
-- tm_sec -- seconds after the minute [0 .. 60]
-- tm_isdst -- Daylight Savings Time flag [-1 .. 1]
-- The input date is considered to be in UTC
function To_Unix_Time (Ada_Time : Time) return Interfaces.C.long;
-- Convert a time value represented as number of time units since the Ada
-- implementation-defined Epoch to a value relative to the Unix Epoch. The
-- units of the result are seconds. Raises Time_Error if the result cannot
-- fit into a Time value.
function To_Unix_Nano_Time
(Ada_Time : Time) return Interfaces.C.Extensions.long_long;
-- Convert a time value represented as number of time units since the Ada
-- implementation-defined Epoch to a value relative to the Unix Epoch. The
-- units of the result are nanoseconds. Raises Time_Error if the result
-- cannot fit into a Time value.
end Ada.Calendar.Conversions;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . U N S I G N E D _ T Y P E S --
-- --
-- S p e c --
-- --
-- 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. --
-- --
------------------------------------------------------------------------------
-- This package contains definitions of standard unsigned types that
-- correspond in size to the standard signed types declared in Standard,
-- and (unlike the types in Interfaces) have corresponding names. It
-- also contains some related definitions for other specialized types
-- used by the compiler in connection with packed array types.
pragma Compiler_Unit_Warning;
package System.Unsigned_Types is
pragma Pure;
pragma No_Elaboration_Code_All;
type Short_Short_Unsigned is mod 2 ** Short_Short_Integer'Size;
type Short_Unsigned is mod 2 ** Short_Integer'Size;
type Unsigned is mod 2 ** Integer'Size;
type Long_Unsigned is mod 2 ** Long_Integer'Size;
type Long_Long_Unsigned is mod 2 ** Long_Long_Integer'Size;
type Float_Unsigned is mod 2 ** Float'Size;
-- Used in the implementation of Is_Negative intrinsic (see Exp_Intr)
type Packed_Byte is mod 2 ** 8;
pragma Universal_Aliasing (Packed_Byte);
for Packed_Byte'Size use 8;
-- Component type for Packed_Bytes1, Packed_Bytes2 and Packed_Byte4 arrays.
-- As this type is used by the compiler to implement operations on user
-- packed array, it needs to be able to alias any type.
type Packed_Bytes1 is array (Natural range <>) of aliased Packed_Byte;
for Packed_Bytes1'Alignment use 1;
for Packed_Bytes1'Component_Size use Packed_Byte'Size;
pragma Suppress_Initialization (Packed_Bytes1);
-- This is the type used to implement packed arrays where no alignment
-- is required. This includes the cases of 1,2,4 (where we use direct
-- masking operations), and all odd component sizes (where the clusters
-- are not aligned anyway, see, e.g. System.Pack_07 in file s-pack07
-- for details.
type Packed_Bytes2 is new Packed_Bytes1;
for Packed_Bytes2'Alignment use Integer'Min (2, Standard'Maximum_Alignment);
pragma Suppress_Initialization (Packed_Bytes2);
-- This is the type used to implement packed arrays where an alignment
-- of 2 (is possible) is helpful for maximum efficiency of the get and
-- set routines in the corresponding library unit. This is true of all
-- component sizes that are even but not divisible by 4 (other than 2 for
-- which we use direct masking operations). In such cases, the clusters
-- can be assumed to be 2-byte aligned if the array is aligned. See for
-- example System.Pack_10 in file s-pack10).
type Packed_Bytes4 is new Packed_Bytes1;
for Packed_Bytes4'Alignment use Integer'Min (4, Standard'Maximum_Alignment);
pragma Suppress_Initialization (Packed_Bytes4);
-- This is the type used to implement packed arrays where an alignment
-- of 4 (if possible) is helpful for maximum efficiency of the get and
-- set routines in the corresponding library unit. This is true of all
-- component sizes that are divisible by 4 (other than powers of 2, which
-- are either handled by direct masking or not packed at all). In such
-- cases the clusters can be assumed to be 4-byte aligned if the array
-- is aligned (see System.Pack_12 in file s-pack12 as an example).
type Bits_1 is mod 2**1;
type Bits_2 is mod 2**2;
type Bits_4 is mod 2**4;
-- Types used for packed array conversions
subtype Bytes_F is Packed_Bytes4 (1 .. Float'Size / 8);
-- Type used in implementation of Is_Negative intrinsic (see Exp_Intr)
function Shift_Left
(Value : Short_Short_Unsigned;
Amount : Natural) return Short_Short_Unsigned;
function Shift_Right
(Value : Short_Short_Unsigned;
Amount : Natural) return Short_Short_Unsigned;
function Shift_Right_Arithmetic
(Value : Short_Short_Unsigned;
Amount : Natural) return Short_Short_Unsigned;
function Rotate_Left
(Value : Short_Short_Unsigned;
Amount : Natural) return Short_Short_Unsigned;
function Rotate_Right
(Value : Short_Short_Unsigned;
Amount : Natural) return Short_Short_Unsigned;
function Shift_Left
(Value : Short_Unsigned;
Amount : Natural) return Short_Unsigned;
function Shift_Right
(Value : Short_Unsigned;
Amount : Natural) return Short_Unsigned;
function Shift_Right_Arithmetic
(Value : Short_Unsigned;
Amount : Natural) return Short_Unsigned;
function Rotate_Left
(Value : Short_Unsigned;
Amount : Natural) return Short_Unsigned;
function Rotate_Right
(Value : Short_Unsigned;
Amount : Natural) return Short_Unsigned;
function Shift_Left
(Value : Unsigned;
Amount : Natural) return Unsigned;
function Shift_Right
(Value : Unsigned;
Amount : Natural) return Unsigned;
function Shift_Right_Arithmetic
(Value : Unsigned;
Amount : Natural) return Unsigned;
function Rotate_Left
(Value : Unsigned;
Amount : Natural) return Unsigned;
function Rotate_Right
(Value : Unsigned;
Amount : Natural) return Unsigned;
function Shift_Left
(Value : Long_Unsigned;
Amount : Natural) return Long_Unsigned;
function Shift_Right
(Value : Long_Unsigned;
Amount : Natural) return Long_Unsigned;
function Shift_Right_Arithmetic
(Value : Long_Unsigned;
Amount : Natural) return Long_Unsigned;
function Rotate_Left
(Value : Long_Unsigned;
Amount : Natural) return Long_Unsigned;
function Rotate_Right
(Value : Long_Unsigned;
Amount : Natural) return Long_Unsigned;
function Shift_Left
(Value : Long_Long_Unsigned;
Amount : Natural) return Long_Long_Unsigned;
function Shift_Right
(Value : Long_Long_Unsigned;
Amount : Natural) return Long_Long_Unsigned;
function Shift_Right_Arithmetic
(Value : Long_Long_Unsigned;
Amount : Natural) return Long_Long_Unsigned;
function Rotate_Left
(Value : Long_Long_Unsigned;
Amount : Natural) return Long_Long_Unsigned;
function Rotate_Right
(Value : Long_Long_Unsigned;
Amount : Natural) return Long_Long_Unsigned;
pragma Import (Intrinsic, Shift_Left);
pragma Import (Intrinsic, Shift_Right);
pragma Import (Intrinsic, Shift_Right_Arithmetic);
pragma Import (Intrinsic, Rotate_Left);
pragma Import (Intrinsic, Rotate_Right);
-- The following definitions are obsolescent. They were needed by the
-- previous version of the compiler and runtime, but are not needed
-- by the current version. We retain them to help with bootstrap path
-- problems. Also they seem harmless, and if any user programs have
-- been using these types, why discombobulate them?
subtype Packed_Bytes is Packed_Bytes4;
subtype Packed_Bytes_Unaligned is Packed_Bytes1;
end System.Unsigned_Types;
|
package agar.gui.widget.radio is
use type c.unsigned;
type flags_t is new c.unsigned;
RADIO_HFILL : constant flags_t := 16#01#;
RADIO_VFILL : constant flags_t := 16#02#;
RADIO_EXPAND : constant flags_t := RADIO_HFILL or RADIO_VFILL;
type radio_t is limited private;
type radio_access_t is access all radio_t;
pragma convention (c, radio_access_t);
type item_t is limited private;
type item_access_t is access all item_t;
pragma convention (c, item_access_t);
type item_text_t is new string;
type item_text_access_t is access constant item_text_t;
type item_text_array_t is array (positive range <>) of item_text_access_t;
-- API
function allocate
(parent : widget_access_t;
flags : flags_t) return radio_access_t;
pragma inline (allocate);
function add_item
(radio : radio_access_t;
text : string) return boolean;
pragma inline (add_item);
function add_item_hotkey
(radio : radio_access_t;
key : c.int;
text : string) return boolean;
pragma inline (add_item_hotkey);
procedure clear_items (radio : radio_access_t);
pragma import (c, clear_items, "AG_RadioClearItems");
function widget (radio : radio_access_t) return widget_access_t;
pragma inline (widget);
private
type text_t is array (1 .. 128) of aliased c.char;
pragma convention (c, text_t);
type item_t is record
text : text_t;
surface : c.int;
hotkey : c.int;
end record;
pragma convention (c, item_t);
type radio_t is record
widget : aliased widget_t;
flags : flags_t;
value : c.int;
items : item_access_t;
nitems : c.int;
sel_item : c.int;
max_w : c.int;
oversel : c.int;
x_padding : c.int;
y_padding : c.int;
x_spacing : c.int;
y_spacing : c.int;
radius : c.int;
r : agar.gui.rect.rect_t;
end record;
pragma convention (c, radio_t);
end agar.gui.widget.radio;
|
-- { dg-do run }
with sort1;
procedure sort2 is
begin
if Sort1 ("hello world") /= " dehllloorw" then
raise Program_Error;
end if;
end sort2;
|
------------------------------------------------------------------------------
-- --
-- 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 AMF.Generic_Collections;
package AMF.UML.Object_Flows.Collections is
pragma Preelaborate;
package UML_Object_Flow_Collections is
new AMF.Generic_Collections
(UML_Object_Flow,
UML_Object_Flow_Access);
type Set_Of_UML_Object_Flow is
new UML_Object_Flow_Collections.Set with null record;
Empty_Set_Of_UML_Object_Flow : constant Set_Of_UML_Object_Flow;
type Ordered_Set_Of_UML_Object_Flow is
new UML_Object_Flow_Collections.Ordered_Set with null record;
Empty_Ordered_Set_Of_UML_Object_Flow : constant Ordered_Set_Of_UML_Object_Flow;
type Bag_Of_UML_Object_Flow is
new UML_Object_Flow_Collections.Bag with null record;
Empty_Bag_Of_UML_Object_Flow : constant Bag_Of_UML_Object_Flow;
type Sequence_Of_UML_Object_Flow is
new UML_Object_Flow_Collections.Sequence with null record;
Empty_Sequence_Of_UML_Object_Flow : constant Sequence_Of_UML_Object_Flow;
private
Empty_Set_Of_UML_Object_Flow : constant Set_Of_UML_Object_Flow
:= (UML_Object_Flow_Collections.Set with null record);
Empty_Ordered_Set_Of_UML_Object_Flow : constant Ordered_Set_Of_UML_Object_Flow
:= (UML_Object_Flow_Collections.Ordered_Set with null record);
Empty_Bag_Of_UML_Object_Flow : constant Bag_Of_UML_Object_Flow
:= (UML_Object_Flow_Collections.Bag with null record);
Empty_Sequence_Of_UML_Object_Flow : constant Sequence_Of_UML_Object_Flow
:= (UML_Object_Flow_Collections.Sequence with null record);
end AMF.UML.Object_Flows.Collections;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUNTIME COMPONENTS --
-- --
-- S Y S T E M . E X P _ L F L T --
-- --
-- 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. --
-- --
------------------------------------------------------------------------------
-- Long_Float exponentiation (checks on)
with System.Exp_Gen;
package System.Exp_LFlt is
pragma Pure (Exp_LFlt);
function Exp_Long_Float is
new System.Exp_Gen.Exp_Float_Type (Long_Float);
end System.Exp_LFlt;
|
-----------------------------------------------------------------------
-- awa-events-dispatchers-tasks -- AWA Event Dispatchers
-- Copyright (C) 2012, 2015, 2017 Stephane Carrez
-- Written by Stephane Carrez (Stephane.Carrez@gmail.com)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Unchecked_Deallocation;
with Util.Log.Loggers;
with AWA.Services.Contexts;
package body AWA.Events.Dispatchers.Tasks is
use Util.Log;
use Ada.Strings.Unbounded;
Log : constant Loggers.Logger := Loggers.Create ("AWA.Events.Dispatchers.Tasks");
-- ------------------------------
-- Start the dispatcher.
-- ------------------------------
overriding
procedure Start (Manager : in out Task_Dispatcher) is
begin
if Manager.Queues.Get_Count > 0 then
Log.Info ("Starting the tasks");
if Manager.Workers = null then
Manager.Workers := new Consumer_Array (1 .. Manager.Task_Count);
end if;
for I in Manager.Workers'Range loop
Manager.Workers (I).Start (Manager'Unchecked_Access);
end loop;
else
Log.Info ("No event dispatcher task started (no event queue to poll)");
end if;
end Start;
-- ------------------------------
-- Stop the dispatcher.
-- ------------------------------
overriding
procedure Stop (Manager : in out Task_Dispatcher) is
procedure Free is
new Ada.Unchecked_Deallocation (Object => Consumer_Array,
Name => Consumer_Array_Access);
begin
if Manager.Workers /= null then
Log.Info ("Stopping the event dispatcher tasks");
for I in Manager.Workers'Range loop
if Manager.Workers (I)'Callable then
Manager.Workers (I).Stop;
else
Log.Error ("Event consumer task terminated abnormally");
end if;
end loop;
Free (Manager.Workers);
end if;
end Stop;
procedure Add_Queue (Manager : in out Task_Dispatcher;
Queue : in AWA.Events.Queues.Queue_Ref;
Added : out Boolean) is
begin
Log.Info ("Adding queue {0} to the task dispatcher", Queue.Get_Name);
Manager.Queues.Enqueue (Queue);
Added := True;
end Add_Queue;
function Create_Dispatcher (Service : in AWA.Events.Services.Event_Manager_Access;
Match : in String;
Count : in Positive;
Priority : in Positive) return Dispatcher_Access is
Result : constant Task_Dispatcher_Access := new Task_Dispatcher;
begin
Result.Task_Count := Count;
Result.Priority := Priority;
Result.Match := To_Unbounded_String (Match);
Result.Manager := Service.all'Access;
return Result.all'Access;
end Create_Dispatcher;
task body Consumer is
Dispatcher : Task_Dispatcher_Access;
Time : Duration := 0.01;
Do_Work : Boolean := True;
Context : AWA.Services.Contexts.Service_Context;
begin
Log.Info ("Event consumer is ready");
select
accept Start (D : in Task_Dispatcher_Access) do
Dispatcher := D;
end Start;
Log.Info ("Event consumer is started");
-- Set the service context.
Context.Set_Context (Application => Dispatcher.Manager.Get_Application.all'Access,
Principal => null);
while Do_Work loop
declare
Nb_Queues : constant Natural := Dispatcher.Queues.Get_Count;
Queue : AWA.Events.Queues.Queue_Ref;
Nb_Events : Natural := 0;
begin
-- We can have several tasks that dispatch events from several queues.
-- Each queue in the list must be given the same polling quota.
-- Pick a queue and dispatch some pending events.
-- Put back the queue in the fifo.
for I in 1 .. Nb_Queues loop
Dispatcher.Queues.Dequeue (Queue);
begin
Dispatcher.Dispatch (Queue, Nb_Events);
exception
when E : others =>
Log.Error ("Exception when dispatching events", E, True);
end;
Dispatcher.Queues.Enqueue (Queue);
end loop;
-- If we processed something, reset the timeout delay and continue polling.
-- Otherwise, double the sleep time.
if Nb_Events /= 0 then
Time := 0.01;
else
Log.Debug ("Sleeping {0} seconds", Duration'Image (Time));
select
accept Stop do
Do_Work := False;
end Stop;
or
accept Start (D : in Task_Dispatcher_Access) do
Dispatcher := D;
end Start;
or
delay Time;
end select;
if Time < 60.0 then
Time := Time * 2.0;
end if;
end if;
end;
end loop;
or
terminate;
end select;
end Consumer;
end AWA.Events.Dispatchers.Tasks;
|
-- Steps for decoding a JPEG image
--
-- 1. Huffman decompression
-- 2. Inverse quantization
-- 3. Inverse cosine transform
-- 4. Upsampling
-- 5. Color transformation
-- 6. Image reconstruction
--
-- The JPEG decoder is largely inspired
-- by the NanoJPEG code by Martin J. Fiedler.
-- With the author's permission. Many thanks!
--
-- Other informations:
-- http://en.wikipedia.org/wiki/JPEG
-- !! ** Some optimizations to consider **
-- !! ssx, ssy ,ssxmax, ssymax
-- as generic parameters + specialized instances
-- !! consider only power-of-two upsampling factors ?
-- !! simplify upsampling loops in case of power-of-two upsampling factors
-- using Shift_Right
-- !! Col_IDCT output direct to "flat", or something similar to NanoJPEG
with GID.Buffering;
with Ada.Text_IO, Ada.Integer_Text_IO, Ada.IO_Exceptions;
package body GID.Decoding_JPG is
use GID.Buffering;
use Ada.Text_IO;
generic
type Number is mod <>;
procedure Big_endian_number(
from : in out Input_buffer;
n : out Number
);
pragma Inline(Big_endian_number);
procedure Big_endian_number(
from : in out Input_buffer;
n : out Number
)
is
b: U8;
begin
n:= 0;
for i in 1..Number'Size/8 loop
Get_Byte(from, b);
n:= n * 256 + Number(b);
end loop;
end Big_endian_number;
procedure Big_endian is new Big_endian_number( U16 );
procedure Read( image: in out Image_descriptor; sh: out Segment_head) is
b: U8;
id: constant array(JPEG_marker) of U8:=
( SOI => 16#D8#,
--
SOF_0 => 16#C0#, SOF_1 => 16#C1#, SOF_2 => 16#C2#, SOF_3 => 16#C3#,
SOF_5 => 16#C5#, SOF_6 => 16#C6#, SOF_7 => 16#C7#, SOF_8 => 16#C8#,
SOF_9 => 16#C9#, SOF_10 => 16#CA#, SOF_11 => 16#CB#, SOF_13 => 16#CD#,
SOF_14 => 16#CE#, SOF_15 => 16#CF#,
--
DHT => 16#C4#,
DAC => 16#CC#,
DQT => 16#DB#,
DRI => 16#DD#,
--
APP_0 => 16#E0#, APP_1 => 16#E1#, APP_2 => 16#E2#, APP_3 => 16#E3#,
APP_4 => 16#E4#, APP_5 => 16#E5#, APP_6 => 16#E6#, APP_7 => 16#E7#,
APP_8 => 16#E8#, APP_9 => 16#E9#, APP_10 => 16#EA#, APP_11 => 16#EB#,
APP_12 => 16#EC#, APP_13 => 16#ED#, APP_14 => 16#EE#,
--
COM => 16#FE#,
SOS => 16#DA#,
EOI => 16#D9#
);
begin
Get_Byte(image.buffer, b);
if b /= 16#FF# then
raise error_in_image_data with "JPEG: expected marker here";
end if;
Get_Byte(image.buffer, b);
for m in id'Range loop
if id(m)= b then
sh.kind:= m;
Big_endian(image.buffer, sh.length);
sh.length:= sh.length - 2;
-- We consider length of contents, without the FFxx marker.
if some_trace then
Put_Line(
"Segment [" & JPEG_marker'Image(sh.kind) &
"], length:" & U16'Image(sh.length));
end if;
return;
end if;
end loop;
raise error_in_image_data with "JPEG: unknown marker here: FF, " & U8'Image(b);
end Read;
shift_arg: constant array(0..15) of Integer:=
(1 => 0, 2 => 1, 4 => 2, 8 => 3, others => -1);
-- SOF - Start Of Frame (the real header)
procedure Read_SOF(image: in out Image_descriptor; sh: Segment_head) is
use Bounded_255;
b, bits_pp_primary, id_base: U8;
w, h: U16;
compo: JPEG_defs.Component;
begin
case sh.kind is
when SOF_0 =>
image.detailed_format:= To_Bounded_String("JPEG, Baseline DCT (SOF_0)");
when SOF_2 =>
image.detailed_format:= To_Bounded_String("JPEG, Progressive DCT (SOF_2)");
image.interlaced:= True;
when others =>
raise unsupported_image_subformat with
"JPEG: image type not yet supported: " & JPEG_marker'Image(sh.kind);
end case;
Get_Byte(image.buffer, bits_pp_primary);
if bits_pp_primary /= 8 then
raise unsupported_image_subformat with
"JPEG: bits per primary color=" & U8'Image(bits_pp_primary) & " (not supported)";
end if;
image.bits_per_pixel:= 3 * Positive(bits_pp_primary);
Big_endian(image.buffer, h);
Big_endian(image.buffer, w);
if w = 0 then
raise error_in_image_data with "JPEG: zero image width";
end if;
if h = 0 then
raise error_in_image_data with "JPEG: zero image height";
end if;
image.width := Positive_32 (w);
image.height := Positive_32 (h);
-- Number of components:
Get_Byte(image.buffer, b);
image.subformat_id:= Integer(b);
--
image.JPEG_stuff.max_samples_hor:= 0;
image.JPEG_stuff.max_samples_ver:= 0;
id_base := 1;
-- For each component: 3 bytes information: ID, sampling factors, quantization table number
for i in 1..image.subformat_id loop
-- Component ID (1 = Y, 2 = Cb, 3 = Cr, 4 = I, 5 = Q)
Get_Byte(image.buffer, b);
if b = 0 then
-- Workaround for a bug in some encoders, for instance Intel(R) JPEG Library,
-- version [2.0.18.50] as in some Photoshop versions : IDs are numbered 0, 1, 2.
id_base := 0;
end if;
if b - id_base > Component'Pos(Component'Last) then
raise error_in_image_data with "JPEG: SOF: invalid component ID: " & U8'Image(b);
end if;
compo:= JPEG_defs.Component'Val(b - id_base);
image.JPEG_stuff.components(compo):= True;
declare
stuff: JPEG_stuff_type renames image.JPEG_stuff;
info: JPEG_defs.Info_per_component_A renames stuff.info(compo);
begin
-- Sampling factors (bit 0-3 vert., 4-7 hor.)
Get_Byte(image.buffer, b);
info.samples_ver:= Natural(b mod 16);
info.samples_hor:= Natural(b / 16);
stuff.max_samples_hor:=
Integer'Max(stuff.max_samples_hor, info.samples_hor);
stuff.max_samples_ver:=
Integer'Max(stuff.max_samples_ver, info.samples_ver);
-- Quantization table number
Get_Byte(image.buffer, b);
info.qt_assoc:= Natural(b);
end;
end loop;
for c in Component loop
if image.JPEG_stuff.components(c) then
declare
stuff: JPEG_stuff_type renames image.JPEG_stuff;
info: JPEG_defs.Info_per_component_A renames stuff.info(c);
begin
info.up_factor_x:= stuff.max_samples_hor / info.samples_hor;
info.up_factor_y:= stuff.max_samples_ver / info.samples_ver;
info.shift_x:= shift_arg(info.up_factor_x);
info.shift_y:= shift_arg(info.up_factor_y);
end;
end if;
end loop;
if Natural(sh.length) < 6 + 3 * image.subformat_id then
raise error_in_image_data with "JPEG: SOF segment too short";
end if;
if some_trace then
Put_Line("Frame has following components:");
for c in JPEG_defs.Component loop
Put_Line(
JPEG_defs.Component'Image(c) & " -> " &
Boolean'Image(image.JPEG_stuff.components(c))
);
end loop;
end if;
if image.JPEG_stuff.components = YCbCr_set then
image.JPEG_stuff.color_space:= YCbCr;
elsif image.JPEG_stuff.components = Y_Grey_set then
image.JPEG_stuff.color_space:= Y_Grey;
image.greyscale:= True;
elsif image.JPEG_stuff.components = CMYK_set then
image.JPEG_stuff.color_space:= CMYK;
else
raise unsupported_image_subformat with
"JPEG: only YCbCr, Y_Grey and CMYK color spaces are currently supported";
end if;
image.detailed_format:= image.detailed_format & ", " &
JPEG_defs.Supported_color_space'Image(image.JPEG_stuff.color_space);
if some_trace then
Put_Line(
"Color space: " &
JPEG_defs.Supported_color_space'Image(image.JPEG_stuff.color_space)
);
end if;
if image.JPEG_stuff.color_space = CMYK then
raise unsupported_image_subformat with
"JPEG: CMYK color space is currently not properly decoded";
end if;
end Read_SOF;
procedure Read_DHT(image: in out Image_descriptor; data_length: Natural) is
remaining: Integer_M32:= Integer_M32(data_length); -- data remaining in segment
b: U8;
ht_idx: Natural;
kind: AC_DC;
counts: array(1..16) of Integer_M32;
idx: Natural;
currcnt, spread, remain_vlc: Integer_M32;
begin
multi_tables:
loop
Get_Byte(image.buffer, b);
remaining:= remaining - 1;
if b >= 8 then
kind:= AC;
else
kind:= DC;
end if;
ht_idx:= Natural(b and 7);
if some_trace then
Put_Line(
"Huffman Table (HT) #" &
Natural'Image(ht_idx) & ", " & AC_DC'Image(kind)
);
end if;
if image.JPEG_stuff.vlc_defs(kind, ht_idx) = null then
image.JPEG_stuff.vlc_defs(kind, ht_idx):= new VLC_table;
end if;
for i in counts'Range loop
Get_Byte(image.buffer, b);
remaining:= remaining - 1;
counts(i):= Integer_M32(b);
end loop;
remain_vlc:= 65_536;
spread:= 65_536;
idx:= 0;
for codelen in counts'Range loop
spread:= spread / 2;
currcnt:= counts(codelen);
if currcnt > 0 then
if remaining < currcnt then
raise error_in_image_data with "JPEG: DHT data too short";
end if;
remain_vlc:= remain_vlc - currcnt * spread;
if remain_vlc < 0 then
raise error_in_image_data with "JPEG: DHT table too short for data";
end if;
for i in reverse 1..currcnt loop
Get_Byte(image.buffer, b);
for j in reverse 1..spread loop
image.JPEG_stuff.vlc_defs(kind, ht_idx)(idx):=
(bits => U8(codelen), code => b);
idx:= idx + 1;
end loop;
end loop;
remaining:= remaining - currcnt;
end if;
end loop;
while remain_vlc > 0 loop
remain_vlc:= remain_vlc - 1;
image.JPEG_stuff.vlc_defs(kind, ht_idx)(idx).bits:= 0;
idx:= idx + 1;
end loop;
exit multi_tables when remaining <= 0;
end loop multi_tables;
end Read_DHT;
procedure Read_DQT(image: in out Image_descriptor; data_length: Natural) is
remaining: Integer:= data_length; -- data remaining in segment
b, q8: U8; q16: U16;
qt_idx: Natural;
high_prec: Boolean;
begin
multi_tables:
loop
Get_Byte(image.buffer, b);
remaining:= remaining - 1;
high_prec:= b >= 8;
qt_idx:= Natural(b and 7);
if some_trace then
Put_Line("Quantization Table (QT) #" & U8'Image(b));
end if;
for i in QT'Range loop
if high_prec then
Big_endian(image.buffer, q16);
remaining:= remaining - 2;
image.JPEG_stuff.qt_list(qt_idx)(i):= Natural(q16);
else
Get_Byte(image.buffer, q8);
remaining:= remaining - 1;
image.JPEG_stuff.qt_list(qt_idx)(i):= Natural(q8);
end if;
end loop;
exit multi_tables when remaining <= 0;
end loop multi_tables;
end Read_DQT;
procedure Read_DRI(image: in out Image_descriptor) is
ri: U16;
begin
Big_endian(image.buffer, ri);
if some_trace then
Put_Line(" Restart interval set to:" & U16'Image(ri));
end if;
image.JPEG_stuff.restart_interval:= Natural(ri);
end Read_DRI;
procedure Read_EXIF(image: in out Image_descriptor; data_length: Natural) is
b, orientation_value: U8;
x, ifd0_entries: Natural;
Exif_signature: constant String:= "Exif" & ASCII.NUL & ASCII.NUL;
signature: String(1..6);
IFD_tag: U16;
endianness: Character;
-- 'M' (Motorola) or 'I' (Intel): EXIF chunks may have different endiannesses,
-- even though the whole JPEG format has a fixed endianness!
begin
if some_trace then
Put_Line("APP1");
end if;
if data_length < 6 then
-- Skip segment data
for i in 1..data_length loop
Get_Byte(image.buffer, b);
end loop;
else
for i in 1..6 loop
Get_Byte(image.buffer, b);
signature(i):= Character'Val(b);
end loop;
if signature /= Exif_signature then
for i in 7..data_length loop -- Skip remaining of APP1 data
Get_Byte(image.buffer, b); -- since we don't know how to use it.
end loop;
if some_trace then
Put_Line("APP1 is not Exif");
end if;
return;
end if;
Get_Byte(image.buffer, b); -- TIFF 6.0 header (1st of 8 bytes)
endianness:= Character'Val(b);
if some_trace then
Put_Line("APP1 is Exif; endianness is " & endianness);
end if;
for i in 8..14 loop -- TIFF 6.0 header (2-8 of 8 bytes)
Get_Byte(image.buffer, b);
end loop;
-- Number of IFD0 entries (2 bytes)
ifd0_entries:= 0;
Get_Byte(image.buffer, b);
ifd0_entries:= Natural(b);
Get_Byte(image.buffer, b);
if endianness = 'I' then
ifd0_entries:= ifd0_entries + 16#100# * Natural(b);
else
ifd0_entries:= Natural(b) + 16#100# * ifd0_entries;
end if;
if some_trace then
Put_Line("EXIF's IFD0 has" & Natural'Image(ifd0_entries) & " entries.");
end if;
x:= 17;
while x <= data_length - 12 loop
Get_Byte(image.buffer, b);
IFD_tag:= U16(b);
Get_Byte(image.buffer, b);
if endianness = 'I' then
IFD_tag:= IFD_tag + 16#100# * U16(b);
else
IFD_tag:= U16(b) + 16#100# * IFD_tag;
end if;
if some_trace then
Put("IFD tag:"); Ada.Integer_Text_IO.Put(Natural(IFD_tag), Base => 16); New_Line;
end if;
for i in 3..8 loop
Get_Byte(image.buffer, b);
end loop;
if endianness = 'I' then
Get_Byte(image.buffer, orientation_value);
for i in 10..12 loop
Get_Byte(image.buffer, b);
end loop;
else
Get_Byte(image.buffer, b);
Get_Byte(image.buffer, orientation_value);
Get_Byte(image.buffer, b);
Get_Byte(image.buffer, b);
end if;
x:= x + 12;
if IFD_tag = 16#112# then
case orientation_value is
when 1 =>
image.display_orientation:= Unchanged;
when 8 =>
image.display_orientation:= Rotation_90;
when 3 =>
image.display_orientation:= Rotation_180;
when 6 =>
image.display_orientation:= Rotation_270;
when others =>
image.display_orientation:= Unchanged;
end case;
if some_trace then
Put_Line(
"IFD tag 0112: Orientation set to: " &
Orientation'Image(image.display_orientation)
);
end if;
exit;
end if;
end loop;
-- Skip rest of data
for i in x..data_length loop
Get_Byte(image.buffer, b);
end loop;
end if;
end Read_EXIF;
--------------------
-- Image decoding --
--------------------
procedure Load (
image : in out Image_descriptor;
next_frame: out Ada.Calendar.Day_Duration
)
is
--
-- Bit buffer
--
buf: U32:= 0;
bufbits: Natural:= 0;
function Show_bits(bits: Natural) return Natural is
newbyte, marker: U8;
begin
if bits=0 then
return 0;
end if;
while bufbits < bits loop
begin
Get_Byte(image.buffer, newbyte);
bufbits:= bufbits + 8;
buf:= buf * 256 + U32(newbyte);
if newbyte = 16#FF# then
Get_Byte(image.buffer, marker);
case marker is
when 0 =>
null;
when 16#D8# => -- SOI here ?
null;
-- 2015-04-26: occured in one (of many) picture
-- taken by an Olympus VG120,D705. See test/img/bcase_1.jpg
when 16#D9# => -- EOI here ?
null; -- !! signal end
when 16#D0# .. 16#D7# =>
bufbits:= bufbits + 8;
buf:= buf * 256 + U32(marker);
when others =>
raise error_in_image_data with
"JPEG: Invalid code (bit buffer): " & U8'Image(marker);
end case;
end if;
exception
when Ada.IO_Exceptions.End_Error =>
newbyte:= 16#FF#;
bufbits:= bufbits + 8;
buf:= buf * 256 + U32(newbyte);
end;
end loop;
return Natural(
Shift_Right(buf, bufbits - bits)
and
(Shift_Left(1, bits)-1)
);
end Show_bits;
procedure Skip_bits(bits: Natural) is
pragma Inline(Skip_bits);
dummy: Integer;
pragma Warnings(off, dummy);
begin
if bufbits < bits then
dummy:= Show_bits(bits);
end if;
bufbits:= bufbits - bits;
end Skip_bits;
function Get_bits(bits: Natural) return Integer is
pragma Inline(Get_bits);
res: constant Integer:= Show_bits(bits);
begin
Skip_bits(bits);
return res;
end Get_bits;
--
type Info_per_component_B is record
ht_idx_AC : Natural;
ht_idx_DC : Natural;
width, height, stride: Natural;
dcpred: Integer:= 0;
end record;
info_A: Component_info_A renames image.JPEG_stuff.info;
info_B: array(Component) of Info_per_component_B;
procedure Get_VLC(
vlc: VLC_table;
code: out U8;
value_ret: out Integer
)
is
-- Step 1 happens here: Huffman decompression
value: Integer:= Show_bits(16);
bits : Natural:= Natural(vlc(value).bits);
begin
if bits = 0 then
raise error_in_image_data with "JPEG: VLC table: bits = 0";
end if;
Skip_bits(bits);
value:= Integer(vlc(value).code);
code:= U8(value);
bits:= Natural(U32(value) and 15);
value_ret:= 0;
if bits /= 0 then
value:= Get_bits(bits);
if value < Integer(Shift_Left(U32'(1), bits - 1)) then
value:= value + 1 - Integer(Shift_Left(U32'(1), bits));
end if;
value_ret:= value;
end if;
end Get_VLC;
function Clip(x: Integer) return Integer is
pragma Inline(Clip);
begin
if x < 0 then
return 0;
elsif x > 255 then
return 255;
else
return x;
end if;
end Clip;
type Block_8x8 is array(0..63) of Integer;
-- Ordering within a 8x8 block, in zig-zag
zig_zag: constant Block_8x8:=
( 0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18,
11, 4, 5, 12, 19, 26, 33, 40, 48, 41, 34, 27, 20,
13, 6, 7, 14, 21, 28, 35, 42, 49, 56, 57, 50, 43,
36, 29, 22, 15, 23, 30, 37, 44, 51, 58, 59, 52, 45,
38, 31, 39, 46, 53, 60, 61, 54, 47, 55, 62, 63 );
procedure Decode_Block(c: Component; block: in out Block_8x8) is
value, coef: Integer;
code: U8;
qt: JPEG_defs.QT renames image.JPEG_stuff.qt_list(info_A(c).qt_assoc);
--
W1: constant:= 2841;
W2: constant:= 2676;
W3: constant:= 2408;
W5: constant:= 1609;
W6: constant:= 1108;
W7: constant:= 565;
--
procedure Row_IDCT(start: Integer) is
pragma Inline(Row_IDCT);
x0, x1, x2, x3, x4, x5, x6, x7, x8, val: Integer;
begin
x1:= block(start + 4) * 2**11;
x2:= block(start + 6);
x3:= block(start + 2);
x4:= block(start + 1);
x5:= block(start + 7);
x6:= block(start + 5);
x7:= block(start + 3);
if x1=0 and x2=0 and x3=0 and x4=0 and x5=0 and x6=0 and x7=0 then
val:= block(start + 0) * 8;
block(start + 0 .. start + 7):= (others => val);
else
x0:= (block(start + 0) * 2**11) + 128;
x8:= W7 * (x4 + x5);
x4:= x8 + (W1 - W7) * x4;
x5:= x8 - (W1 + W7) * x5;
x8:= W3 * (x6 + x7);
x6:= x8 - (W3 - W5) * x6;
x7:= x8 - (W3 + W5) * x7;
x8:= x0 + x1;
x0:= x0 - x1;
x1:= W6 * (x3 + x2);
x2:= x1 - (W2 + W6) * x2;
x3:= x1 + (W2 - W6) * x3;
x1:= x4 + x6;
x4:= x4 - x6;
x6:= x5 + x7;
x5:= x5 - x7;
x7:= x8 + x3;
x8:= x8 - x3;
x3:= x0 + x2;
x0:= x0 - x2;
x2:= (181 * (x4 + x5) + 128) / 256;
x4:= (181 * (x4 - x5) + 128) / 256;
block(start + 0):= (x7 + x1) / 256;
block(start + 1):= (x3 + x2) / 256;
block(start + 2):= (x0 + x4) / 256;
block(start + 3):= (x8 + x6) / 256;
block(start + 4):= (x8 - x6) / 256;
block(start + 5):= (x0 - x4) / 256;
block(start + 6):= (x3 - x2) / 256;
block(start + 7):= (x7 - x1) / 256;
end if;
end Row_IDCT;
procedure Col_IDCT(start: Integer) is
pragma Inline(Col_IDCT);
x0, x1, x2, x3, x4, x5, x6, x7, x8, val: Integer;
begin
x1:= block(start + 8*4) * 256;
x2:= block(start + 8*6);
x3:= block(start + 8*2);
x4:= block(start + 8*1);
x5:= block(start + 8*7);
x6:= block(start + 8*5);
x7:= block(start + 8*3);
if x1=0 and x2=0 and x3=0 and x4=0 and x5=0 and x6=0 and x7=0 then
val:= Clip(((block(start) + 32) / 2**6) + 128);
for row in reverse 0..7 loop
block(start + row * 8):= val;
end loop;
else
x0:= (block(start) * 256) + 8192;
x8:= W7 * (x4 + x5) + 4;
x4:= (x8 + (W1 - W7) * x4) / 8;
x5:= (x8 - (W1 + W7) * x5) / 8;
x8:= W3 * (x6 + x7) + 4;
x6:= (x8 - (W3 - W5) * x6) / 8;
x7:= (x8 - (W3 + W5) * x7) / 8;
x8:= x0 + x1;
x0:= x0 - x1;
x1:= W6 * (x3 + x2) + 4;
x2:= (x1 - (W2 + W6) * x2) / 8;
x3:= (x1 + (W2 - W6) * x3) / 8;
x1:= x4 + x6;
x4:= x4 - x6;
x6:= x5 + x7;
x5:= x5 - x7;
x7:= x8 + x3;
x8:= x8 - x3;
x3:= x0 + x2;
x0:= x0 - x2;
x2:= (181 * (x4 + x5) + 128) / 256;
x4:= (181 * (x4 - x5) + 128) / 256;
block(start + 8*0):= Clip(((x7 + x1) / 2**14) + 128);
block(start + 8*1):= Clip(((x3 + x2) / 2**14) + 128);
block(start + 8*2):= Clip(((x0 + x4) / 2**14) + 128);
block(start + 8*3):= Clip(((x8 + x6) / 2**14) + 128);
block(start + 8*4):= Clip(((x8 - x6) / 2**14) + 128);
block(start + 8*5):= Clip(((x0 - x4) / 2**14) + 128);
block(start + 8*6):= Clip(((x3 - x2) / 2**14) + 128);
block(start + 8*7):= Clip(((x7 - x1) / 2**14) + 128);
end if;
end Col_IDCT;
begin -- Decode_Block
--
-- Step 2 happens here: Inverse quantization
Get_VLC(image.JPEG_stuff.vlc_defs(DC, info_B(c).ht_idx_DC).all, code, value);
-- First value in block (0: top left) uses a predictor.
info_B(c).dcpred:= info_B(c).dcpred + value;
block:= (0 => info_B(c).dcpred * qt(0), others => 0);
coef:= 0;
loop
Get_VLC(image.JPEG_stuff.vlc_defs(AC, info_B(c).ht_idx_AC).all, code, value);
exit when code = 0; -- EOB
if (code and 16#0F#) = 0 and code /= 16#F0# then
raise error_in_image_data with "JPEG: error in VLC AC code for de-quantization";
end if;
coef:= coef + Integer(Shift_Right(code, 4)) + 1;
if coef > 63 then
raise error_in_image_data with "JPEG: coefficient for de-quantization is > 63";
end if;
block(zig_zag(coef)):= value * qt(coef);
exit when coef = 63;
end loop;
-- Step 3 happens here: Inverse cosine transform
for row in 0..7 loop
Row_IDCT(row * 8);
end loop;
for col in 0..7 loop
Col_IDCT(col);
end loop;
end Decode_Block;
type Macro_block is array(
Component range <>, -- component
Positive range <>, -- x sample range
Positive range <> -- y sample range
) of Block_8x8;
procedure Out_Pixel_8(br, bg, bb: U8) is
pragma Inline(Out_Pixel_8);
function Times_257(x: Primary_color_range) return Primary_color_range is
pragma Inline(Times_257);
begin
return 16 * (16 * x) + x; -- this is 257 * x, = 16#0101# * x
-- Numbers 8-bit -> no OA warning at instanciation. Returns x if type Primary_color_range is mod 2**8.
end Times_257;
full_opaque: constant Primary_color_range:= Primary_color_range'Last;
begin
case Primary_color_range'Modulus is
when 256 =>
Put_Pixel(
Primary_color_range(br),
Primary_color_range(bg),
Primary_color_range(bb),
full_opaque
);
when 65_536 =>
Put_Pixel(
Times_257(Primary_color_range(br)),
Times_257(Primary_color_range(bg)),
Times_257(Primary_color_range(bb)),
full_opaque
-- Times_257 makes max intensity FF go to FFFF
);
when others =>
raise invalid_primary_color_range with "JPEG: color range not supported";
end case;
end Out_Pixel_8;
-- !! might be generic parameters
ssxmax: constant Natural:= image.JPEG_stuff.max_samples_hor;
ssymax: constant Natural:= image.JPEG_stuff.max_samples_ver;
procedure Upsampling_and_output(
m: Macro_block;
x0, y0: Natural
)
is
flat: array(Component, 0..8*ssxmax-1, 0..8*ssymax-1) of Integer;
generic
color_space: Supported_color_space;
procedure Color_transformation_and_output;
--
procedure Color_transformation_and_output is
y_val, cb_val, cr_val, c_val, m_val, w_val: Integer;
y_val_8: U8;
begin
for ymb in flat'Range(3) loop
exit when y0+ymb >= Integer (image.height);
Set_X_Y(x0, Integer (image.height) - 1 - (y0+ymb));
for xmb in flat'Range(2) loop
exit when x0+xmb >= Integer (image.width);
case color_space is
when YCbCr =>
y_val := flat(Y, xmb, ymb) * 256;
cb_val:= flat(Cb, xmb, ymb) - 128;
cr_val:= flat(Cr, xmb, ymb) - 128;
Out_Pixel_8(
br => U8(Clip((y_val + 359 * cr_val + 128) / 256)),
bg => U8(Clip((y_val - 88 * cb_val - 183 * cr_val + 128) / 256)),
bb => U8(Clip((y_val + 454 * cb_val + 128) / 256))
);
when Y_Grey =>
y_val_8:= U8(flat(Y, xmb, ymb));
Out_Pixel_8(y_val_8, y_val_8, y_val_8);
when CMYK =>
-- !! find a working conversion formula.
-- perhaps it is more complicated (APP_2
-- color profile must be used ?)
c_val:= flat(Y, xmb, ymb);
m_val:= flat(Cb, xmb, ymb);
y_val:= flat(Cr, xmb, ymb);
w_val:= flat(I, xmb, ymb)-255;
Out_Pixel_8(
br => U8(255-Clip(c_val+w_val)),
bg => U8(255-Clip(m_val+w_val)),
bb => U8(255-Clip(y_val+w_val))
);
end case;
end loop;
end loop;
end Color_transformation_and_output;
--
procedure Ct_YCbCr is new Color_transformation_and_output(YCbCr);
procedure Ct_Y_Grey is new Color_transformation_and_output(Y_Grey);
procedure Ct_CMYK is new Color_transformation_and_output(CMYK);
blk_idx: Integer;
upsx, upsy: Natural;
begin
-- Step 4 happens here: Upsampling
for c in Component loop
if image.JPEG_stuff.components(c) then
upsx:= info_A(c).up_factor_x;
upsy:= info_A(c).up_factor_y;
for x in reverse 1..info_A(c).samples_hor loop
for y in reverse 1..info_A(c).samples_ver loop
-- We are at the 8x8 block level
blk_idx:= 63;
for y8 in reverse 0..7 loop
for x8 in reverse 0..7 loop
declare
val: constant Integer:= m(c,x,y)(blk_idx);
big_pixel_x: constant Natural:= upsx * (x8 + 8*(x-1));
big_pixel_y: constant Natural:= upsy * (y8 + 8*(y-1));
begin
-- Repeat pixels for component c, sample (x,y),
-- position (x8,y8).
for rx in reverse 0..upsx-1 loop
for ry in reverse 0..upsy-1 loop
flat(c, rx + big_pixel_x, ry + big_pixel_y):= val;
end loop;
end loop;
end;
blk_idx:= blk_idx - 1;
end loop;
end loop;
end loop;
end loop;
end if;
end loop;
-- Step 5 and 6 happen here: Color transformation and output
case image.JPEG_stuff.color_space is
when YCbCr =>
Ct_YCbCr;
when Y_Grey =>
Ct_Y_Grey;
when CMYK =>
Ct_CMYK;
end case;
end Upsampling_and_output;
-- Start Of Scan (and image data which follow)
--
procedure Read_SOS is
components, b, id_base: U8;
compo: Component:= Component'First;
mbx, mby: Natural:= 0;
mbsizex, mbsizey, mbwidth, mbheight: Natural;
rstcount: Natural:= image.JPEG_stuff.restart_interval;
nextrst: U16:= 0;
w: U16;
start_spectral_selection,
end_spectral_selection,
successive_approximation: U8;
begin
Get_Byte(image.buffer, components);
if some_trace then
Put_Line(
"Start of Scan (SOS), with" & U8'Image(components) & " components"
);
end if;
if image.subformat_id /= Natural(components) then
raise error_in_image_data with "JPEG: components mismatch in Scan segment";
end if;
id_base := 1;
for i in 1..components loop
Get_Byte(image.buffer, b);
if b = 0 then
-- Workaround for bugged encoder (see above)
id_base := 0;
end if;
if b - id_base > Component'Pos(Component'Last) then
raise error_in_image_data with "JPEG: Scan: invalid ID: " & U8'Image(b);
end if;
compo:= Component'Val(b - id_base);
if not image.JPEG_stuff.components(compo) then
raise error_in_image_data with
"JPEG: component " & Component'Image(compo) &
" has not been defined in the header (SOF) segment";
end if;
-- Huffman table selection
Get_Byte(image.buffer, b);
info_B(compo).ht_idx_AC:= Natural(b mod 16);
info_B(compo).ht_idx_DC:= Natural(b / 16);
end loop;
-- Parameters for progressive display format (SOF_2)
Get_Byte(image.buffer, start_spectral_selection);
Get_Byte(image.buffer, end_spectral_selection);
Get_Byte(image.buffer, successive_approximation);
--
-- End of SOS segment, image data follow.
--
mbsizex:= ssxmax * 8; -- pixels in a row of a macro-block
mbsizey:= ssymax * 8; -- pixels in a column of a macro-block
mbwidth := (Integer (image.width) + mbsizex - 1) / mbsizex;
-- width in macro-blocks
mbheight := (Integer (image.height) + mbsizey - 1) / mbsizey;
-- height in macro-blocks
if some_trace then
Put_Line(" mbsizex = " & Integer'Image(mbsizex));
Put_Line(" mbsizey = " & Integer'Image(mbsizey));
Put_Line(" mbwidth = " & Integer'Image(mbwidth));
Put_Line(" mbheight = " & Integer'Image(mbheight));
end if;
for c in Component loop
if image.JPEG_stuff.components(c) then
info_B(c).width := (Integer (image.width) * info_A(c).samples_hor + ssxmax - 1) / ssxmax;
info_B(c).height:= (Integer (image.height) * info_A(c).samples_ver + ssymax - 1) / ssymax;
info_B(c).stride:= (mbwidth * mbsizex * info_A(c).samples_hor) / ssxmax;
if some_trace then
Put_Line(" Details for component " & Component'Image(c));
Put_Line(" samples in x " & Integer'Image(info_A(c).samples_hor));
Put_Line(" samples in y " & Integer'Image(info_A(c).samples_ver));
Put_Line(" width " & Integer'Image(info_B(c).width));
Put_Line(" height " & Integer'Image(info_B(c).height));
Put_Line(" stride " & Integer'Image(info_B(c).stride));
Put_Line(
" AC/DC table index " &
Integer'Image(info_B(compo).ht_idx_AC) & ", " &
Integer'Image(info_B(compo).ht_idx_DC)
);
end if;
if (info_B(c).width < 3 and info_A(c).samples_hor /= ssxmax) or
(info_B(c).height < 3 and info_A(c).samples_ver /= ssymax)
then
raise error_in_image_data with
"JPEG: component " & Component'Image(c) & ": sample dimension mismatch";
end if;
end if;
end loop;
--
if image.interlaced then
raise unsupported_image_subformat with "JPEG: progressive format not yet functional";
end if;
declare
mb: Macro_block(Component, 1..ssxmax, 1..ssymax);
x0, y0: Integer:= 0;
begin
macro_blocks_loop:
loop
components_loop:
for c in Component loop
if image.JPEG_stuff.components(c) then
samples_y_loop:
for sby in 1..info_A(c).samples_ver loop
samples_x_loop:
for sbx in 1..info_A(c).samples_hor loop
Decode_Block(c, mb(c, sbx, sby));
end loop samples_x_loop;
end loop samples_y_loop;
end if;
end loop components_loop;
-- All components of the current macro-block are decoded.
-- Step 4, 5, 6 happen here: Upsampling, color transformation, output
Upsampling_and_output(mb, x0, y0);
--
mbx:= mbx + 1;
x0:= x0 + ssxmax * 8;
if mbx >= mbwidth then
mbx:= 0;
x0:= 0;
mby:= mby + 1;
y0:= y0 + ssymax * 8;
Feedback((100*mby)/mbheight);
exit macro_blocks_loop when mby >= mbheight;
end if;
if image.JPEG_stuff.restart_interval > 0 then
rstcount:= rstcount - 1;
if rstcount = 0 then
-- Here begins the restart.
bufbits:= Natural(U32(bufbits) and 16#F8#); -- byte alignment
-- Now the restart marker. We expect a
w:= U16(Get_bits(16));
if some_trace then
Put_Line(
" Restart #" & U16'Image(nextrst) &
" Code " & U16'Image(w) &
" after" & Natural'Image(image.JPEG_stuff.restart_interval) &
" macro blocks"
);
end if;
if w not in 16#FFD0# .. 16#FFD7# or (w and 7) /= nextrst then
raise error_in_image_data with
"JPEG: expected RST (restart) marker Nb " & U16'Image(nextrst);
end if;
nextrst:= (nextrst + 1) and 7;
rstcount:= image.JPEG_stuff.restart_interval;
-- Block-to-block predictor variables are reset.
for c in Component loop
info_B(c).dcpred:= 0;
end loop;
end if;
end if;
end loop macro_blocks_loop;
end;
end Read_SOS;
--
sh: Segment_head;
b: U8;
begin -- Load
loop
Read(image, sh);
case sh.kind is
when DQT => -- Quantization Table
Read_DQT(image, Natural(sh.length));
when DHT => -- Huffman Table
Read_DHT(image, Natural(sh.length));
when DRI => -- Restart Interval
Read_DRI(image);
when EOI => -- End Of Input
exit;
when SOS => -- Start Of Scan
Read_SOS;
exit;
when others =>
-- Skip segment data
for i in 1..sh.length loop
Get_Byte(image.buffer, b);
end loop;
end case;
end loop;
next_frame:= 0.0; -- still picture
end Load;
end GID.Decoding_JPG;
|
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE boost_serialization>
<boost_serialization signature="serialization::archive" version="11">
<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>duc</name>
<ret_bitwidth>0</ret_bitwidth>
<ports class_id="2" tracking_level="0" version="0">
<count>4</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>din_i</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>din_i</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>18</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>freq</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>freq</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</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>dout_i</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>dout_i</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>18</bitwidth>
</Value>
<direction>1</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>dout_q</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>dout_q</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>18</bitwidth>
</Value>
<direction>1</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>93</count>
<item_version>0</item_version>
<item class_id="9" tracking_level="1" version="0" object_id="_5">
<Value>
<Obj>
<type>0</type>
<id>45</id>
<name>freq_read</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>freq</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>152</item>
<item>153</item>
</oprand_edges>
<opcode>read</opcode>
</item>
<item class_id_reference="9" object_id="_6">
<Value>
<Obj>
<type>0</type>
<id>46</id>
<name>din_i_read</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>din_i</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>18</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>155</item>
<item>156</item>
</oprand_edges>
<opcode>read</opcode>
</item>
<item class_id_reference="9" object_id="_7">
<Value>
<Obj>
<type>0</type>
<id>47</id>
<name>i_load</name>
<fileName>srrc.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>20</lineNumber>
<contextFuncName>srrc</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item class_id="11" tracking_level="0" version="0">
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second class_id="12" tracking_level="0" version="0">
<count>2</count>
<item_version>0</item_version>
<item class_id="13" tracking_level="0" version="0">
<first class_id="14" tracking_level="0" version="0">
<first>duc.c</first>
<second>duc</second>
</first>
<second>29</second>
</item>
<item>
<first>
<first>srrc.c</first>
<second>srrc</second>
</first>
<second>20</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>6</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>157</item>
</oprand_edges>
<opcode>load</opcode>
</item>
<item class_id_reference="9" object_id="_8">
<Value>
<Obj>
<type>0</type>
<id>48</id>
<name>tmp_i</name>
<fileName>srrc.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>20</lineNumber>
<contextFuncName>srrc</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>29</second>
</item>
<item>
<first>
<first>srrc.c</first>
<second>srrc</second>
</first>
<second>20</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>158</item>
<item>160</item>
</oprand_edges>
<opcode>icmp</opcode>
</item>
<item class_id_reference="9" object_id="_9">
<Value>
<Obj>
<type>0</type>
<id>49</id>
<name></name>
<fileName>srrc.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>20</lineNumber>
<contextFuncName>srrc</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>29</second>
</item>
<item>
<first>
<first>srrc.c</first>
<second>srrc</second>
</first>
<second>20</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>161</item>
<item>162</item>
<item>163</item>
</oprand_edges>
<opcode>br</opcode>
</item>
<item class_id_reference="9" object_id="_10">
<Value>
<Obj>
<type>0</type>
<id>51</id>
<name></name>
<fileName>srrc.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>20</lineNumber>
<contextFuncName>srrc</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>29</second>
</item>
<item>
<first>
<first>srrc.c</first>
<second>srrc</second>
</first>
<second>20</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>164</item>
<item>165</item>
</oprand_edges>
<opcode>store</opcode>
</item>
<item class_id_reference="9" object_id="_11">
<Value>
<Obj>
<type>0</type>
<id>52</id>
<name></name>
<fileName>srrc.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>20</lineNumber>
<contextFuncName>srrc</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>29</second>
</item>
<item>
<first>
<first>srrc.c</first>
<second>srrc</second>
</first>
<second>20</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>166</item>
</oprand_edges>
<opcode>br</opcode>
</item>
<item class_id_reference="9" object_id="_12">
<Value>
<Obj>
<type>0</type>
<id>54</id>
<name>inc</name>
<fileName>srrc.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>21</lineNumber>
<contextFuncName>srrc</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>29</second>
</item>
<item>
<first>
<first>srrc.c</first>
<second>srrc</second>
</first>
<second>21</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>inc</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>6</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>167</item>
<item>169</item>
</oprand_edges>
<opcode>add</opcode>
</item>
<item class_id_reference="9" object_id="_13">
<Value>
<Obj>
<type>0</type>
<id>55</id>
<name>tmp_2_i</name>
<fileName>srrc.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>23</lineNumber>
<contextFuncName>srrc</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>29</second>
</item>
<item>
<first>
<first>srrc.c</first>
<second>srrc</second>
</first>
<second>23</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>170</item>
</oprand_edges>
<opcode>zext</opcode>
</item>
<item class_id_reference="9" object_id="_14">
<Value>
<Obj>
<type>0</type>
<id>56</id>
<name>c_addr</name>
<fileName>srrc.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>23</lineNumber>
<contextFuncName>srrc</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>29</second>
</item>
<item>
<first>
<first>srrc.c</first>
<second>srrc</second>
</first>
<second>23</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>6</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>171</item>
<item>173</item>
<item>174</item>
</oprand_edges>
<opcode>getelementptr</opcode>
</item>
<item class_id_reference="9" object_id="_15">
<Value>
<Obj>
<type>0</type>
<id>57</id>
<name>c_load</name>
<fileName>srrc.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>23</lineNumber>
<contextFuncName>srrc</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>29</second>
</item>
<item>
<first>
<first>srrc.c</first>
<second>srrc</second>
</first>
<second>23</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>c</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>18</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>175</item>
</oprand_edges>
<opcode>load</opcode>
</item>
<item class_id_reference="9" object_id="_16">
<Value>
<Obj>
<type>0</type>
<id>58</id>
<name>in_load</name>
<fileName>srrc.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>23</lineNumber>
<contextFuncName>srrc</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>29</second>
</item>
<item>
<first>
<first>srrc.c</first>
<second>srrc</second>
</first>
<second>23</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>d</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>18</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>176</item>
<item>410</item>
</oprand_edges>
<opcode>load</opcode>
</item>
<item class_id_reference="9" object_id="_17">
<Value>
<Obj>
<type>0</type>
<id>59</id>
<name>init_load</name>
<fileName>srrc.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>23</lineNumber>
<contextFuncName>srrc</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>29</second>
</item>
<item>
<first>
<first>srrc.c</first>
<second>srrc</second>
</first>
<second>23</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>177</item>
</oprand_edges>
<opcode>load</opcode>
</item>
<item class_id_reference="9" object_id="_18">
<Value>
<Obj>
<type>0</type>
<id>60</id>
<name>ch_load</name>
<fileName>srrc.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>23</lineNumber>
<contextFuncName>srrc</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>29</second>
</item>
<item>
<first>
<first>srrc.c</first>
<second>srrc</second>
</first>
<second>23</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>178</item>
</oprand_edges>
<opcode>load</opcode>
</item>
<item class_id_reference="9" object_id="_19">
<Value>
<Obj>
<type>0</type>
<id>61</id>
<name>tmp_2</name>
<fileName>srrc.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>21</lineNumber>
<contextFuncName>srrc</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>29</second>
</item>
<item>
<first>
<first>srrc.c</first>
<second>srrc</second>
</first>
<second>21</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>7</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>180</item>
<item>181</item>
<item>182</item>
</oprand_edges>
<opcode>bitconcatenate</opcode>
</item>
<item class_id_reference="9" object_id="_20">
<Value>
<Obj>
<type>0</type>
<id>62</id>
<name>tmp_3</name>
<fileName>srrc.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>23</lineNumber>
<contextFuncName>srrc</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>29</second>
</item>
<item>
<first>
<first>srrc.c</first>
<second>srrc</second>
</first>
<second>23</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>183</item>
</oprand_edges>
<opcode>zext</opcode>
</item>
<item class_id_reference="9" object_id="_21">
<Value>
<Obj>
<type>0</type>
<id>63</id>
<name>shift_reg_p_addr</name>
<fileName>srrc.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>23</lineNumber>
<contextFuncName>srrc</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>29</second>
</item>
<item>
<first>
<first>srrc.c</first>
<second>srrc</second>
</first>
<second>23</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>7</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>184</item>
<item>185</item>
<item>186</item>
</oprand_edges>
<opcode>getelementptr</opcode>
</item>
<item class_id_reference="9" object_id="_22">
<Value>
<Obj>
<type>0</type>
<id>64</id>
<name>shift_reg_p_load</name>
<fileName>srrc.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>23</lineNumber>
<contextFuncName>srrc</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>29</second>
</item>
<item>
<first>
<first>srrc.c</first>
<second>srrc</second>
</first>
<second>23</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>38</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>187</item>
</oprand_edges>
<opcode>load</opcode>
</item>
<item class_id_reference="9" object_id="_23">
<Value>
<Obj>
<type>0</type>
<id>65</id>
<name>sel_tmp1_i</name>
<fileName>srrc.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>23</lineNumber>
<contextFuncName>srrc</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>29</second>
</item>
<item>
<first>
<first>srrc.c</first>
<second>srrc</second>
</first>
<second>23</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>188</item>
<item>190</item>
</oprand_edges>
<opcode>icmp</opcode>
</item>
<item class_id_reference="9" object_id="_24">
<Value>
<Obj>
<type>0</type>
<id>66</id>
<name>sel_tmp2_i</name>
<fileName>srrc.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>23</lineNumber>
<contextFuncName>srrc</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>29</second>
</item>
<item>
<first>
<first>srrc.c</first>
<second>srrc</second>
</first>
<second>23</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>191</item>
<item>193</item>
</oprand_edges>
<opcode>icmp</opcode>
</item>
<item class_id_reference="9" object_id="_25">
<Value>
<Obj>
<type>0</type>
<id>67</id>
<name>sel_tmp3_i</name>
<fileName>srrc.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>23</lineNumber>
<contextFuncName>srrc</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>29</second>
</item>
<item>
<first>
<first>srrc.c</first>
<second>srrc</second>
</first>
<second>23</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>194</item>
<item>196</item>
</oprand_edges>
<opcode>xor</opcode>
</item>
<item class_id_reference="9" object_id="_26">
<Value>
<Obj>
<type>0</type>
<id>68</id>
<name>sel_tmp4_i</name>
<fileName>srrc.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>23</lineNumber>
<contextFuncName>srrc</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>29</second>
</item>
<item>
<first>
<first>srrc.c</first>
<second>srrc</second>
</first>
<second>23</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>197</item>
<item>198</item>
</oprand_edges>
<opcode>or</opcode>
</item>
<item class_id_reference="9" object_id="_27">
<Value>
<Obj>
<type>0</type>
<id>69</id>
<name>sel_tmp5_i</name>
<fileName>srrc.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>23</lineNumber>
<contextFuncName>srrc</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>29</second>
</item>
<item>
<first>
<first>srrc.c</first>
<second>srrc</second>
</first>
<second>23</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>199</item>
<item>200</item>
</oprand_edges>
<opcode>and</opcode>
</item>
<item class_id_reference="9" object_id="_28">
<Value>
<Obj>
<type>0</type>
<id>70</id>
<name>tmp</name>
<fileName>srrc.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>23</lineNumber>
<contextFuncName>srrc</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>29</second>
</item>
<item>
<first>
<first>srrc.c</first>
<second>srrc</second>
</first>
<second>23</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>201</item>
<item>202</item>
</oprand_edges>
<opcode>or</opcode>
</item>
<item class_id_reference="9" object_id="_29">
<Value>
<Obj>
<type>0</type>
<id>71</id>
<name>tmp_5_i</name>
<fileName>srrc.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>23</lineNumber>
<contextFuncName>srrc</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>29</second>
</item>
<item>
<first>
<first>srrc.c</first>
<second>srrc</second>
</first>
<second>23</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>38</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>203</item>
<item>205</item>
<item>206</item>
</oprand_edges>
<opcode>select</opcode>
</item>
<item class_id_reference="9" object_id="_30">
<Value>
<Obj>
<type>0</type>
<id>72</id>
<name>tmp_i_i</name>
<fileName>mac.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>16</lineNumber>
<contextFuncName>srrc_mac</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>29</second>
</item>
<item>
<first>
<first>mac.c</first>
<second>srrc_mac</second>
</first>
<second>16</second>
</item>
<item>
<first>
<first>srrc.c</first>
<second>srrc</second>
</first>
<second>23</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>36</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>207</item>
</oprand_edges>
<opcode>sext</opcode>
</item>
<item class_id_reference="9" object_id="_31">
<Value>
<Obj>
<type>0</type>
<id>73</id>
<name>tmp_i_i_10</name>
<fileName>mac.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>16</lineNumber>
<contextFuncName>srrc_mac</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>29</second>
</item>
<item>
<first>
<first>mac.c</first>
<second>srrc_mac</second>
</first>
<second>16</second>
</item>
<item>
<first>
<first>srrc.c</first>
<second>srrc</second>
</first>
<second>23</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>36</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>208</item>
</oprand_edges>
<opcode>sext</opcode>
</item>
<item class_id_reference="9" object_id="_32">
<Value>
<Obj>
<type>0</type>
<id>74</id>
<name>m</name>
<fileName>mac.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>16</lineNumber>
<contextFuncName>srrc_mac</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>29</second>
</item>
<item>
<first>
<first>mac.c</first>
<second>srrc_mac</second>
</first>
<second>16</second>
</item>
<item>
<first>
<first>srrc.c</first>
<second>srrc</second>
</first>
<second>23</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>m</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>36</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>209</item>
<item>210</item>
</oprand_edges>
<opcode>mul</opcode>
</item>
<item class_id_reference="9" object_id="_33">
<Value>
<Obj>
<type>0</type>
<id>75</id>
<name>tmp_54_i_i</name>
<fileName>mac.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>17</lineNumber>
<contextFuncName>srrc_mac</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>29</second>
</item>
<item>
<first>
<first>mac.c</first>
<second>srrc_mac</second>
</first>
<second>17</second>
</item>
<item>
<first>
<first>srrc.c</first>
<second>srrc</second>
</first>
<second>23</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>38</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>211</item>
</oprand_edges>
<opcode>sext</opcode>
</item>
<item class_id_reference="9" object_id="_34">
<Value>
<Obj>
<type>0</type>
<id>76</id>
<name>acc_1</name>
<fileName>mac.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>18</lineNumber>
<contextFuncName>srrc_mac</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>29</second>
</item>
<item>
<first>
<first>mac.c</first>
<second>srrc_mac</second>
</first>
<second>18</second>
</item>
<item>
<first>
<first>srrc.c</first>
<second>srrc</second>
</first>
<second>23</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>acc</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>38</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>212</item>
<item>213</item>
</oprand_edges>
<opcode>add</opcode>
</item>
<item class_id_reference="9" object_id="_35">
<Value>
<Obj>
<type>0</type>
<id>77</id>
<name>tmp_4</name>
<fileName>srrc.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>20</lineNumber>
<contextFuncName>srrc</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>29</second>
</item>
<item>
<first>
<first>srrc.c</first>
<second>srrc</second>
</first>
<second>20</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>7</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>214</item>
<item>215</item>
<item>216</item>
</oprand_edges>
<opcode>bitconcatenate</opcode>
</item>
<item class_id_reference="9" object_id="_36">
<Value>
<Obj>
<type>0</type>
<id>78</id>
<name>tmp_5</name>
<fileName>srrc.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>25</lineNumber>
<contextFuncName>srrc</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>29</second>
</item>
<item>
<first>
<first>srrc.c</first>
<second>srrc</second>
</first>
<second>25</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>217</item>
</oprand_edges>
<opcode>zext</opcode>
</item>
<item class_id_reference="9" object_id="_37">
<Value>
<Obj>
<type>0</type>
<id>79</id>
<name>shift_reg_p_addr_1</name>
<fileName>srrc.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>25</lineNumber>
<contextFuncName>srrc</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>29</second>
</item>
<item>
<first>
<first>srrc.c</first>
<second>srrc</second>
</first>
<second>25</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>7</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>218</item>
<item>219</item>
<item>220</item>
</oprand_edges>
<opcode>getelementptr</opcode>
</item>
<item class_id_reference="9" object_id="_38">
<Value>
<Obj>
<type>0</type>
<id>80</id>
<name></name>
<fileName>srrc.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>25</lineNumber>
<contextFuncName>srrc</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>29</second>
</item>
<item>
<first>
<first>srrc.c</first>
<second>srrc</second>
</first>
<second>25</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>221</item>
<item>222</item>
<item>406</item>
</oprand_edges>
<opcode>store</opcode>
</item>
<item class_id_reference="9" object_id="_39">
<Value>
<Obj>
<type>0</type>
<id>81</id>
<name></name>
<fileName>srrc.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>26</lineNumber>
<contextFuncName>srrc</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>29</second>
</item>
<item>
<first>
<first>srrc.c</first>
<second>srrc</second>
</first>
<second>26</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>223</item>
<item>224</item>
<item>225</item>
</oprand_edges>
<opcode>br</opcode>
</item>
<item class_id_reference="9" object_id="_40">
<Value>
<Obj>
<type>0</type>
<id>83</id>
<name></name>
<fileName>srrc.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>27</lineNumber>
<contextFuncName>srrc</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>29</second>
</item>
<item>
<first>
<first>srrc.c</first>
<second>srrc</second>
</first>
<second>27</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>226</item>
<item>227</item>
<item>228</item>
</oprand_edges>
<opcode>br</opcode>
</item>
<item class_id_reference="9" object_id="_41">
<Value>
<Obj>
<type>0</type>
<id>85</id>
<name></name>
<fileName>srrc.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>27</lineNumber>
<contextFuncName>srrc</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>29</second>
</item>
<item>
<first>
<first>srrc.c</first>
<second>srrc</second>
</first>
<second>27</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>230</item>
<item>231</item>
<item>411</item>
</oprand_edges>
<opcode>store</opcode>
</item>
<item class_id_reference="9" object_id="_42">
<Value>
<Obj>
<type>0</type>
<id>86</id>
<name></name>
<fileName>srrc.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>27</lineNumber>
<contextFuncName>srrc</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>29</second>
</item>
<item>
<first>
<first>srrc.c</first>
<second>srrc</second>
</first>
<second>27</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>232</item>
</oprand_edges>
<opcode>br</opcode>
</item>
<item class_id_reference="9" object_id="_43">
<Value>
<Obj>
<type>0</type>
<id>88</id>
<name>tmp_i_11</name>
<fileName>srrc.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>28</lineNumber>
<contextFuncName>srrc</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>29</second>
</item>
<item>
<first>
<first>srrc.c</first>
<second>srrc</second>
</first>
<second>28</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>233</item>
<item>234</item>
</oprand_edges>
<opcode>xor</opcode>
</item>
<item class_id_reference="9" object_id="_44">
<Value>
<Obj>
<type>0</type>
<id>89</id>
<name></name>
<fileName>srrc.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>28</lineNumber>
<contextFuncName>srrc</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>29</second>
</item>
<item>
<first>
<first>srrc.c</first>
<second>srrc</second>
</first>
<second>28</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>235</item>
<item>236</item>
<item>412</item>
</oprand_edges>
<opcode>store</opcode>
</item>
<item class_id_reference="9" object_id="_45">
<Value>
<Obj>
<type>0</type>
<id>90</id>
<name></name>
<fileName>srrc.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>29</lineNumber>
<contextFuncName>srrc</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>29</second>
</item>
<item>
<first>
<first>srrc.c</first>
<second>srrc</second>
</first>
<second>29</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>237</item>
</oprand_edges>
<opcode>br</opcode>
</item>
<item class_id_reference="9" object_id="_46">
<Value>
<Obj>
<type>0</type>
<id>92</id>
<name>srrc_o</name>
<fileName>srrc.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>33</lineNumber>
<contextFuncName>srrc</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>29</second>
</item>
<item>
<first>
<first>srrc.c</first>
<second>srrc</second>
</first>
<second>33</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>y</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>18</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>239</item>
<item>240</item>
<item>242</item>
<item>244</item>
</oprand_edges>
<opcode>partselect</opcode>
</item>
<item class_id_reference="9" object_id="_47">
<Value>
<Obj>
<type>0</type>
<id>93</id>
<name>inc_1</name>
<fileName>srrc.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>35</lineNumber>
<contextFuncName>srrc</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>29</second>
</item>
<item>
<first>
<first>srrc.c</first>
<second>srrc</second>
</first>
<second>35</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>inc</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>6</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>245</item>
<item>246</item>
<item>247</item>
</oprand_edges>
<opcode>select</opcode>
</item>
<item class_id_reference="9" object_id="_48">
<Value>
<Obj>
<type>0</type>
<id>94</id>
<name></name>
<fileName>srrc.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>35</lineNumber>
<contextFuncName>srrc</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>29</second>
</item>
<item>
<first>
<first>srrc.c</first>
<second>srrc</second>
</first>
<second>35</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>248</item>
<item>249</item>
<item>409</item>
</oprand_edges>
<opcode>store</opcode>
</item>
<item class_id_reference="9" object_id="_49">
<Value>
<Obj>
<type>0</type>
<id>95</id>
<name>i_1_load</name>
<fileName>imf1.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>24</lineNumber>
<contextFuncName>imf1</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>31</second>
</item>
<item>
<first>
<first>imf1.c</first>
<second>imf1</second>
</first>
<second>24</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>5</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>250</item>
</oprand_edges>
<opcode>load</opcode>
</item>
<item class_id_reference="9" object_id="_50">
<Value>
<Obj>
<type>0</type>
<id>96</id>
<name>tmp_i1</name>
<fileName>imf1.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>24</lineNumber>
<contextFuncName>imf1</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>31</second>
</item>
<item>
<first>
<first>imf1.c</first>
<second>imf1</second>
</first>
<second>24</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>251</item>
<item>253</item>
</oprand_edges>
<opcode>icmp</opcode>
</item>
<item class_id_reference="9" object_id="_51">
<Value>
<Obj>
<type>0</type>
<id>97</id>
<name></name>
<fileName>imf1.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>24</lineNumber>
<contextFuncName>imf1</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>31</second>
</item>
<item>
<first>
<first>imf1.c</first>
<second>imf1</second>
</first>
<second>24</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>254</item>
<item>255</item>
<item>256</item>
</oprand_edges>
<opcode>br</opcode>
</item>
<item class_id_reference="9" object_id="_52">
<Value>
<Obj>
<type>0</type>
<id>99</id>
<name></name>
<fileName>imf1.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>25</lineNumber>
<contextFuncName>imf1</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>31</second>
</item>
<item>
<first>
<first>imf1.c</first>
<second>imf1</second>
</first>
<second>25</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>257</item>
<item>258</item>
</oprand_edges>
<opcode>store</opcode>
</item>
<item class_id_reference="9" object_id="_53">
<Value>
<Obj>
<type>0</type>
<id>100</id>
<name></name>
<fileName>imf1.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>26</lineNumber>
<contextFuncName>imf1</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>31</second>
</item>
<item>
<first>
<first>imf1.c</first>
<second>imf1</second>
</first>
<second>26</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>259</item>
</oprand_edges>
<opcode>br</opcode>
</item>
<item class_id_reference="9" object_id="_54">
<Value>
<Obj>
<type>0</type>
<id>102</id>
<name>inc_2</name>
<fileName>imf1.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>27</lineNumber>
<contextFuncName>imf1</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>31</second>
</item>
<item>
<first>
<first>imf1.c</first>
<second>imf1</second>
</first>
<second>27</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>inc</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>5</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>260</item>
<item>262</item>
</oprand_edges>
<opcode>add</opcode>
</item>
<item class_id_reference="9" object_id="_55">
<Value>
<Obj>
<type>0</type>
<id>103</id>
<name>tmp_i3</name>
<fileName>imf1.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>30</lineNumber>
<contextFuncName>imf1</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>31</second>
</item>
<item>
<first>
<first>imf1.c</first>
<second>imf1</second>
</first>
<second>30</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>263</item>
</oprand_edges>
<opcode>zext</opcode>
</item>
<item class_id_reference="9" object_id="_56">
<Value>
<Obj>
<type>0</type>
<id>104</id>
<name>c_1_addr</name>
<fileName>imf1.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>30</lineNumber>
<contextFuncName>imf1</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>31</second>
</item>
<item>
<first>
<first>imf1.c</first>
<second>imf1</second>
</first>
<second>30</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>5</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>264</item>
<item>265</item>
<item>266</item>
</oprand_edges>
<opcode>getelementptr</opcode>
</item>
<item class_id_reference="9" object_id="_57">
<Value>
<Obj>
<type>0</type>
<id>105</id>
<name>c_1_load</name>
<fileName>imf1.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>30</lineNumber>
<contextFuncName>imf1</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>31</second>
</item>
<item>
<first>
<first>imf1.c</first>
<second>imf1</second>
</first>
<second>30</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>c</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>18</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>267</item>
</oprand_edges>
<opcode>load</opcode>
</item>
<item class_id_reference="9" object_id="_58">
<Value>
<Obj>
<type>0</type>
<id>106</id>
<name>in_1_load</name>
<fileName>imf1.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>30</lineNumber>
<contextFuncName>imf1</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>31</second>
</item>
<item>
<first>
<first>imf1.c</first>
<second>imf1</second>
</first>
<second>30</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>d</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>18</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>268</item>
<item>414</item>
</oprand_edges>
<opcode>load</opcode>
</item>
<item class_id_reference="9" object_id="_59">
<Value>
<Obj>
<type>0</type>
<id>107</id>
<name>init_1_load</name>
<fileName>imf1.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>30</lineNumber>
<contextFuncName>imf1</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>31</second>
</item>
<item>
<first>
<first>imf1.c</first>
<second>imf1</second>
</first>
<second>30</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>269</item>
</oprand_edges>
<opcode>load</opcode>
</item>
<item class_id_reference="9" object_id="_60">
<Value>
<Obj>
<type>0</type>
<id>108</id>
<name>ch_1_load</name>
<fileName>imf1.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>30</lineNumber>
<contextFuncName>imf1</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>31</second>
</item>
<item>
<first>
<first>imf1.c</first>
<second>imf1</second>
</first>
<second>30</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>270</item>
</oprand_edges>
<opcode>load</opcode>
</item>
<item class_id_reference="9" object_id="_61">
<Value>
<Obj>
<type>0</type>
<id>109</id>
<name>tmp_6</name>
<fileName>imf1.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>27</lineNumber>
<contextFuncName>imf1</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>31</second>
</item>
<item>
<first>
<first>imf1.c</first>
<second>imf1</second>
</first>
<second>27</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>6</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>272</item>
<item>273</item>
<item>274</item>
</oprand_edges>
<opcode>bitconcatenate</opcode>
</item>
<item class_id_reference="9" object_id="_62">
<Value>
<Obj>
<type>0</type>
<id>110</id>
<name>tmp_7</name>
<fileName>imf1.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>30</lineNumber>
<contextFuncName>imf1</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>31</second>
</item>
<item>
<first>
<first>imf1.c</first>
<second>imf1</second>
</first>
<second>30</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>275</item>
</oprand_edges>
<opcode>zext</opcode>
</item>
<item class_id_reference="9" object_id="_63">
<Value>
<Obj>
<type>0</type>
<id>111</id>
<name>shift_reg_p_1_addr</name>
<fileName>imf1.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>30</lineNumber>
<contextFuncName>imf1</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>31</second>
</item>
<item>
<first>
<first>imf1.c</first>
<second>imf1</second>
</first>
<second>30</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>6</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>276</item>
<item>277</item>
<item>278</item>
</oprand_edges>
<opcode>getelementptr</opcode>
</item>
<item class_id_reference="9" object_id="_64">
<Value>
<Obj>
<type>0</type>
<id>112</id>
<name>shift_reg_p_1_load</name>
<fileName>imf1.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>30</lineNumber>
<contextFuncName>imf1</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>31</second>
</item>
<item>
<first>
<first>imf1.c</first>
<second>imf1</second>
</first>
<second>30</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>38</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>279</item>
</oprand_edges>
<opcode>load</opcode>
</item>
<item class_id_reference="9" object_id="_65">
<Value>
<Obj>
<type>0</type>
<id>113</id>
<name>sel_tmp1_i9</name>
<fileName>imf1.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>30</lineNumber>
<contextFuncName>imf1</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>31</second>
</item>
<item>
<first>
<first>imf1.c</first>
<second>imf1</second>
</first>
<second>30</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>280</item>
<item>282</item>
</oprand_edges>
<opcode>icmp</opcode>
</item>
<item class_id_reference="9" object_id="_66">
<Value>
<Obj>
<type>0</type>
<id>114</id>
<name>sel_tmp2_i1</name>
<fileName>imf1.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>30</lineNumber>
<contextFuncName>imf1</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>31</second>
</item>
<item>
<first>
<first>imf1.c</first>
<second>imf1</second>
</first>
<second>30</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>283</item>
<item>285</item>
</oprand_edges>
<opcode>icmp</opcode>
</item>
<item class_id_reference="9" object_id="_67">
<Value>
<Obj>
<type>0</type>
<id>115</id>
<name>sel_tmp3_i1</name>
<fileName>imf1.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>30</lineNumber>
<contextFuncName>imf1</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>31</second>
</item>
<item>
<first>
<first>imf1.c</first>
<second>imf1</second>
</first>
<second>30</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>286</item>
<item>287</item>
</oprand_edges>
<opcode>xor</opcode>
</item>
<item class_id_reference="9" object_id="_68">
<Value>
<Obj>
<type>0</type>
<id>116</id>
<name>sel_tmp4_i1</name>
<fileName>imf1.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>30</lineNumber>
<contextFuncName>imf1</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>31</second>
</item>
<item>
<first>
<first>imf1.c</first>
<second>imf1</second>
</first>
<second>30</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>288</item>
<item>289</item>
</oprand_edges>
<opcode>or</opcode>
</item>
<item class_id_reference="9" object_id="_69">
<Value>
<Obj>
<type>0</type>
<id>117</id>
<name>sel_tmp5_i1</name>
<fileName>imf1.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>30</lineNumber>
<contextFuncName>imf1</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>31</second>
</item>
<item>
<first>
<first>imf1.c</first>
<second>imf1</second>
</first>
<second>30</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>290</item>
<item>291</item>
</oprand_edges>
<opcode>and</opcode>
</item>
<item class_id_reference="9" object_id="_70">
<Value>
<Obj>
<type>0</type>
<id>118</id>
<name>tmp_1</name>
<fileName>imf1.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>30</lineNumber>
<contextFuncName>imf1</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>31</second>
</item>
<item>
<first>
<first>imf1.c</first>
<second>imf1</second>
</first>
<second>30</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>292</item>
<item>293</item>
</oprand_edges>
<opcode>or</opcode>
</item>
<item class_id_reference="9" object_id="_71">
<Value>
<Obj>
<type>0</type>
<id>119</id>
<name>s_assign</name>
<fileName>imf1.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>30</lineNumber>
<contextFuncName>imf1</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>31</second>
</item>
<item>
<first>
<first>imf1.c</first>
<second>imf1</second>
</first>
<second>30</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>s</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>38</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>294</item>
<item>295</item>
<item>296</item>
</oprand_edges>
<opcode>select</opcode>
</item>
<item class_id_reference="9" object_id="_72">
<Value>
<Obj>
<type>0</type>
<id>120</id>
<name>tmp_i_i1</name>
<fileName>mac.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>26</lineNumber>
<contextFuncName>mac1</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>31</second>
</item>
<item>
<first>
<first>imf1.c</first>
<second>imf1</second>
</first>
<second>30</second>
</item>
<item>
<first>
<first>mac.c</first>
<second>mac1</second>
</first>
<second>26</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>36</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>297</item>
</oprand_edges>
<opcode>sext</opcode>
</item>
<item class_id_reference="9" object_id="_73">
<Value>
<Obj>
<type>0</type>
<id>121</id>
<name>tmp_i_i1_12</name>
<fileName>mac.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>26</lineNumber>
<contextFuncName>mac1</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>31</second>
</item>
<item>
<first>
<first>imf1.c</first>
<second>imf1</second>
</first>
<second>30</second>
</item>
<item>
<first>
<first>mac.c</first>
<second>mac1</second>
</first>
<second>26</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>36</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>298</item>
</oprand_edges>
<opcode>sext</opcode>
</item>
<item class_id_reference="9" object_id="_74">
<Value>
<Obj>
<type>0</type>
<id>122</id>
<name>m_1</name>
<fileName>mac.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>26</lineNumber>
<contextFuncName>mac1</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>31</second>
</item>
<item>
<first>
<first>imf1.c</first>
<second>imf1</second>
</first>
<second>30</second>
</item>
<item>
<first>
<first>mac.c</first>
<second>mac1</second>
</first>
<second>26</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>m</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>36</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>299</item>
<item>300</item>
</oprand_edges>
<opcode>mul</opcode>
</item>
<item class_id_reference="9" object_id="_75">
<Value>
<Obj>
<type>0</type>
<id>123</id>
<name>tmp_57_i_i</name>
<fileName>mac.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>27</lineNumber>
<contextFuncName>mac1</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>31</second>
</item>
<item>
<first>
<first>imf1.c</first>
<second>imf1</second>
</first>
<second>30</second>
</item>
<item>
<first>
<first>mac.c</first>
<second>mac1</second>
</first>
<second>27</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>38</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>301</item>
</oprand_edges>
<opcode>sext</opcode>
</item>
<item class_id_reference="9" object_id="_76">
<Value>
<Obj>
<type>0</type>
<id>124</id>
<name>sum</name>
<fileName>mac.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>27</lineNumber>
<contextFuncName>mac1</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>31</second>
</item>
<item>
<first>
<first>imf1.c</first>
<second>imf1</second>
</first>
<second>30</second>
</item>
<item>
<first>
<first>mac.c</first>
<second>mac1</second>
</first>
<second>27</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>sum</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>38</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>302</item>
<item>303</item>
</oprand_edges>
<opcode>add</opcode>
</item>
<item class_id_reference="9" object_id="_77">
<Value>
<Obj>
<type>0</type>
<id>125</id>
<name>tmp_8</name>
<fileName>imf1.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>24</lineNumber>
<contextFuncName>imf1</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>31</second>
</item>
<item>
<first>
<first>imf1.c</first>
<second>imf1</second>
</first>
<second>24</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>6</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>304</item>
<item>305</item>
<item>306</item>
</oprand_edges>
<opcode>bitconcatenate</opcode>
</item>
<item class_id_reference="9" object_id="_78">
<Value>
<Obj>
<type>0</type>
<id>126</id>
<name>tmp_9</name>
<fileName>imf1.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>32</lineNumber>
<contextFuncName>imf1</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>31</second>
</item>
<item>
<first>
<first>imf1.c</first>
<second>imf1</second>
</first>
<second>32</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>307</item>
</oprand_edges>
<opcode>zext</opcode>
</item>
<item class_id_reference="9" object_id="_79">
<Value>
<Obj>
<type>0</type>
<id>127</id>
<name>shift_reg_p_1_addr_1</name>
<fileName>imf1.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>32</lineNumber>
<contextFuncName>imf1</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>31</second>
</item>
<item>
<first>
<first>imf1.c</first>
<second>imf1</second>
</first>
<second>32</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>6</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>308</item>
<item>309</item>
<item>310</item>
</oprand_edges>
<opcode>getelementptr</opcode>
</item>
<item class_id_reference="9" object_id="_80">
<Value>
<Obj>
<type>0</type>
<id>128</id>
<name></name>
<fileName>imf1.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>32</lineNumber>
<contextFuncName>imf1</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>31</second>
</item>
<item>
<first>
<first>imf1.c</first>
<second>imf1</second>
</first>
<second>32</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>311</item>
<item>312</item>
<item>407</item>
</oprand_edges>
<opcode>store</opcode>
</item>
<item class_id_reference="9" object_id="_81">
<Value>
<Obj>
<type>0</type>
<id>129</id>
<name></name>
<fileName>imf1.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>33</lineNumber>
<contextFuncName>imf1</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>31</second>
</item>
<item>
<first>
<first>imf1.c</first>
<second>imf1</second>
</first>
<second>33</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>313</item>
<item>314</item>
<item>315</item>
</oprand_edges>
<opcode>br</opcode>
</item>
<item class_id_reference="9" object_id="_82">
<Value>
<Obj>
<type>0</type>
<id>131</id>
<name></name>
<fileName>imf1.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>34</lineNumber>
<contextFuncName>imf1</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>31</second>
</item>
<item>
<first>
<first>imf1.c</first>
<second>imf1</second>
</first>
<second>34</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>316</item>
<item>317</item>
<item>318</item>
</oprand_edges>
<opcode>br</opcode>
</item>
<item class_id_reference="9" object_id="_83">
<Value>
<Obj>
<type>0</type>
<id>133</id>
<name></name>
<fileName>imf1.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>34</lineNumber>
<contextFuncName>imf1</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>31</second>
</item>
<item>
<first>
<first>imf1.c</first>
<second>imf1</second>
</first>
<second>34</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>319</item>
<item>320</item>
<item>415</item>
</oprand_edges>
<opcode>store</opcode>
</item>
<item class_id_reference="9" object_id="_84">
<Value>
<Obj>
<type>0</type>
<id>134</id>
<name></name>
<fileName>imf1.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>34</lineNumber>
<contextFuncName>imf1</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>31</second>
</item>
<item>
<first>
<first>imf1.c</first>
<second>imf1</second>
</first>
<second>34</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>321</item>
</oprand_edges>
<opcode>br</opcode>
</item>
<item class_id_reference="9" object_id="_85">
<Value>
<Obj>
<type>0</type>
<id>136</id>
<name>cnt_load</name>
<fileName>imf1.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>35</lineNumber>
<contextFuncName>imf1</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>31</second>
</item>
<item>
<first>
<first>imf1.c</first>
<second>imf1</second>
</first>
<second>35</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>322</item>
</oprand_edges>
<opcode>load</opcode>
</item>
<item class_id_reference="9" object_id="_86">
<Value>
<Obj>
<type>0</type>
<id>137</id>
<name>tmp_6_i</name>
<fileName>imf1.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>35</lineNumber>
<contextFuncName>imf1</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>31</second>
</item>
<item>
<first>
<first>imf1.c</first>
<second>imf1</second>
</first>
<second>35</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>323</item>
<item>324</item>
</oprand_edges>
<opcode>xor</opcode>
</item>
<item class_id_reference="9" object_id="_87">
<Value>
<Obj>
<type>0</type>
<id>138</id>
<name></name>
<fileName>imf1.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>35</lineNumber>
<contextFuncName>imf1</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>31</second>
</item>
<item>
<first>
<first>imf1.c</first>
<second>imf1</second>
</first>
<second>35</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>325</item>
<item>326</item>
<item>416</item>
</oprand_edges>
<opcode>store</opcode>
</item>
<item class_id_reference="9" object_id="_88">
<Value>
<Obj>
<type>0</type>
<id>139</id>
<name>tmp_7_i</name>
<fileName>imf1.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>36</lineNumber>
<contextFuncName>imf1</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>31</second>
</item>
<item>
<first>
<first>imf1.c</first>
<second>imf1</second>
</first>
<second>36</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>327</item>
<item>328</item>
</oprand_edges>
<opcode>xor</opcode>
</item>
<item class_id_reference="9" object_id="_89">
<Value>
<Obj>
<type>0</type>
<id>140</id>
<name></name>
<fileName>imf1.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>36</lineNumber>
<contextFuncName>imf1</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>31</second>
</item>
<item>
<first>
<first>imf1.c</first>
<second>imf1</second>
</first>
<second>36</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>329</item>
<item>330</item>
<item>408</item>
</oprand_edges>
<opcode>store</opcode>
</item>
<item class_id_reference="9" object_id="_90">
<Value>
<Obj>
<type>0</type>
<id>141</id>
<name></name>
<fileName>imf1.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>37</lineNumber>
<contextFuncName>imf1</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>31</second>
</item>
<item>
<first>
<first>imf1.c</first>
<second>imf1</second>
</first>
<second>37</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>331</item>
</oprand_edges>
<opcode>br</opcode>
</item>
<item class_id_reference="9" object_id="_91">
<Value>
<Obj>
<type>0</type>
<id>143</id>
<name>imf1_o</name>
<fileName>imf1.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>41</lineNumber>
<contextFuncName>imf1</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>31</second>
</item>
<item>
<first>
<first>imf1.c</first>
<second>imf1</second>
</first>
<second>41</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>y</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>18</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>332</item>
<item>333</item>
<item>334</item>
<item>335</item>
</oprand_edges>
<opcode>partselect</opcode>
</item>
<item class_id_reference="9" object_id="_92">
<Value>
<Obj>
<type>0</type>
<id>144</id>
<name>inc_3</name>
<fileName>imf1.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>44</lineNumber>
<contextFuncName>imf1</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>31</second>
</item>
<item>
<first>
<first>imf1.c</first>
<second>imf1</second>
</first>
<second>44</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>inc</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>5</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>336</item>
<item>337</item>
<item>338</item>
</oprand_edges>
<opcode>select</opcode>
</item>
<item class_id_reference="9" object_id="_93">
<Value>
<Obj>
<type>0</type>
<id>145</id>
<name></name>
<fileName>imf1.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>44</lineNumber>
<contextFuncName>imf1</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>31</second>
</item>
<item>
<first>
<first>imf1.c</first>
<second>imf1</second>
</first>
<second>44</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>339</item>
<item>340</item>
<item>413</item>
</oprand_edges>
<opcode>store</opcode>
</item>
<item class_id_reference="9" object_id="_94">
<Value>
<Obj>
<type>0</type>
<id>146</id>
<name>imf2_o</name>
<fileName>duc.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>33</lineNumber>
<contextFuncName>duc</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>33</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>imf2_o</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>18</bitwidth>
</Value>
<oprand_edges>
<count>9</count>
<item_version>0</item_version>
<item>342</item>
<item>343</item>
<item>353</item>
<item>354</item>
<item>355</item>
<item>356</item>
<item>357</item>
<item>358</item>
<item>359</item>
</oprand_edges>
<opcode>call</opcode>
</item>
<item class_id_reference="9" object_id="_95">
<Value>
<Obj>
<type>0</type>
<id>147</id>
<name>imf3_o</name>
<fileName>duc.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>35</lineNumber>
<contextFuncName>duc</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>35</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>imf3_o</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>18</bitwidth>
</Value>
<oprand_edges>
<count>10</count>
<item_version>0</item_version>
<item>345</item>
<item>346</item>
<item>360</item>
<item>361</item>
<item>362</item>
<item>363</item>
<item>364</item>
<item>365</item>
<item>366</item>
<item>367</item>
</oprand_edges>
<opcode>call</opcode>
</item>
<item class_id_reference="9" object_id="_96">
<Value>
<Obj>
<type>0</type>
<id>148</id>
<name></name>
<fileName>duc.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>37</lineNumber>
<contextFuncName>duc</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>37</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>12</count>
<item_version>0</item_version>
<item>348</item>
<item>349</item>
<item>350</item>
<item>351</item>
<item>352</item>
<item>368</item>
<item>369</item>
<item>370</item>
<item>371</item>
<item>372</item>
<item>373</item>
<item>374</item>
</oprand_edges>
<opcode>call</opcode>
</item>
<item class_id_reference="9" object_id="_97">
<Value>
<Obj>
<type>0</type>
<id>149</id>
<name></name>
<fileName>duc.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</fileDirectory>
<lineNumber>39</lineNumber>
<contextFuncName>duc</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>duc.c</first>
<second>duc</second>
</first>
<second>39</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>0</count>
<item_version>0</item_version>
</oprand_edges>
<opcode>ret</opcode>
</item>
</nodes>
<consts class_id="15" tracking_level="0" version="0">
<count>17</count>
<item_version>0</item_version>
<item class_id="16" tracking_level="1" version="0" object_id="_98">
<Value>
<Obj>
<type>2</type>
<id>159</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>6</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>168</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>6</bitwidth>
</Value>
<const_type>0</const_type>
<content>1</content>
</item>
<item class_id_reference="16" object_id="_100">
<Value>
<Obj>
<type>2</type>
<id>172</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="_101">
<Value>
<Obj>
<type>2</type>
<id>189</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>6</bitwidth>
</Value>
<const_type>0</const_type>
<content>47</content>
</item>
<item class_id_reference="16" object_id="_102">
<Value>
<Obj>
<type>2</type>
<id>192</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>6</bitwidth>
</Value>
<const_type>0</const_type>
<content>23</content>
</item>
<item class_id_reference="16" object_id="_103">
<Value>
<Obj>
<type>2</type>
<id>195</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>1</bitwidth>
</Value>
<const_type>0</const_type>
<content>1</content>
</item>
<item class_id_reference="16" object_id="_104">
<Value>
<Obj>
<type>2</type>
<id>204</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>38</bitwidth>
</Value>
<const_type>0</const_type>
<content>0</content>
</item>
<item class_id_reference="16" object_id="_105">
<Value>
<Obj>
<type>2</type>
<id>229</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>1</bitwidth>
</Value>
<const_type>0</const_type>
<content>0</content>
</item>
<item class_id_reference="16" object_id="_106">
<Value>
<Obj>
<type>2</type>
<id>241</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>17</content>
</item>
<item class_id_reference="16" object_id="_107">
<Value>
<Obj>
<type>2</type>
<id>243</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>34</content>
</item>
<item class_id_reference="16" object_id="_108">
<Value>
<Obj>
<type>2</type>
<id>252</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>5</bitwidth>
</Value>
<const_type>0</const_type>
<content>0</content>
</item>
<item class_id_reference="16" object_id="_109">
<Value>
<Obj>
<type>2</type>
<id>261</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>5</bitwidth>
</Value>
<const_type>0</const_type>
<content>1</content>
</item>
<item class_id_reference="16" object_id="_110">
<Value>
<Obj>
<type>2</type>
<id>281</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>5</bitwidth>
</Value>
<const_type>0</const_type>
<content>23</content>
</item>
<item class_id_reference="16" object_id="_111">
<Value>
<Obj>
<type>2</type>
<id>284</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>5</bitwidth>
</Value>
<const_type>0</const_type>
<content>11</content>
</item>
<item class_id_reference="16" object_id="_112">
<Value>
<Obj>
<type>2</type>
<id>341</id>
<name>duc_imf2</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>18</bitwidth>
</Value>
<const_type>6</const_type>
<content><constant:duc_imf2></content>
</item>
<item class_id_reference="16" object_id="_113">
<Value>
<Obj>
<type>2</type>
<id>344</id>
<name>duc_imf3</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>18</bitwidth>
</Value>
<const_type>6</const_type>
<content><constant:duc_imf3></content>
</item>
<item class_id_reference="16" object_id="_114">
<Value>
<Obj>
<type>2</type>
<id>347</id>
<name>duc_mixer</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>0</bitwidth>
</Value>
<const_type>6</const_type>
<content><constant:duc_mixer></content>
</item>
</consts>
<blocks class_id="17" tracking_level="0" version="0">
<count>13</count>
<item_version>0</item_version>
<item class_id="18" tracking_level="1" version="0" object_id="_115">
<Obj>
<type>3</type>
<id>50</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>5</count>
<item_version>0</item_version>
<item>45</item>
<item>46</item>
<item>47</item>
<item>48</item>
<item>49</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_116">
<Obj>
<type>3</type>
<id>53</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>2</count>
<item_version>0</item_version>
<item>51</item>
<item>52</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_117">
<Obj>
<type>3</type>
<id>82</id>
<name>._crit_edge_ifconv.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>
<node_objs>
<count>28</count>
<item_version>0</item_version>
<item>54</item>
<item>55</item>
<item>56</item>
<item>57</item>
<item>58</item>
<item>59</item>
<item>60</item>
<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>
<item>73</item>
<item>74</item>
<item>75</item>
<item>76</item>
<item>77</item>
<item>78</item>
<item>79</item>
<item>80</item>
<item>81</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_118">
<Obj>
<type>3</type>
<id>84</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>1</count>
<item_version>0</item_version>
<item>83</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_119">
<Obj>
<type>3</type>
<id>87</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>2</count>
<item_version>0</item_version>
<item>85</item>
<item>86</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_120">
<Obj>
<type>3</type>
<id>91</id>
<name>._crit_edge9.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>
<node_objs>
<count>3</count>
<item_version>0</item_version>
<item>88</item>
<item>89</item>
<item>90</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_121">
<Obj>
<type>3</type>
<id>98</id>
<name>srrc.exit</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>6</count>
<item_version>0</item_version>
<item>92</item>
<item>93</item>
<item>94</item>
<item>95</item>
<item>96</item>
<item>97</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_122">
<Obj>
<type>3</type>
<id>101</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>2</count>
<item_version>0</item_version>
<item>99</item>
<item>100</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_123">
<Obj>
<type>3</type>
<id>130</id>
<name>._crit_edge_ifconv.i17</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>28</count>
<item_version>0</item_version>
<item>102</item>
<item>103</item>
<item>104</item>
<item>105</item>
<item>106</item>
<item>107</item>
<item>108</item>
<item>109</item>
<item>110</item>
<item>111</item>
<item>112</item>
<item>113</item>
<item>114</item>
<item>115</item>
<item>116</item>
<item>117</item>
<item>118</item>
<item>119</item>
<item>120</item>
<item>121</item>
<item>122</item>
<item>123</item>
<item>124</item>
<item>125</item>
<item>126</item>
<item>127</item>
<item>128</item>
<item>129</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_124">
<Obj>
<type>3</type>
<id>132</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>1</count>
<item_version>0</item_version>
<item>131</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_125">
<Obj>
<type>3</type>
<id>135</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>2</count>
<item_version>0</item_version>
<item>133</item>
<item>134</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_126">
<Obj>
<type>3</type>
<id>142</id>
<name>._crit_edge9.i18</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>6</count>
<item_version>0</item_version>
<item>136</item>
<item>137</item>
<item>138</item>
<item>139</item>
<item>140</item>
<item>141</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_127">
<Obj>
<type>3</type>
<id>150</id>
<name>imf1.exit</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>143</item>
<item>144</item>
<item>145</item>
<item>146</item>
<item>147</item>
<item>148</item>
<item>149</item>
</node_objs>
</item>
</blocks>
<edges class_id="19" tracking_level="0" version="0">
<count>223</count>
<item_version>0</item_version>
<item class_id="20" tracking_level="1" version="0" object_id="_128">
<id>153</id>
<edge_type>1</edge_type>
<source_obj>2</source_obj>
<sink_obj>45</sink_obj>
</item>
<item class_id_reference="20" object_id="_129">
<id>156</id>
<edge_type>1</edge_type>
<source_obj>1</source_obj>
<sink_obj>46</sink_obj>
</item>
<item class_id_reference="20" object_id="_130">
<id>157</id>
<edge_type>1</edge_type>
<source_obj>5</source_obj>
<sink_obj>47</sink_obj>
</item>
<item class_id_reference="20" object_id="_131">
<id>158</id>
<edge_type>1</edge_type>
<source_obj>47</source_obj>
<sink_obj>48</sink_obj>
</item>
<item class_id_reference="20" object_id="_132">
<id>160</id>
<edge_type>1</edge_type>
<source_obj>159</source_obj>
<sink_obj>48</sink_obj>
</item>
<item class_id_reference="20" object_id="_133">
<id>161</id>
<edge_type>1</edge_type>
<source_obj>48</source_obj>
<sink_obj>49</sink_obj>
</item>
<item class_id_reference="20" object_id="_134">
<id>162</id>
<edge_type>2</edge_type>
<source_obj>82</source_obj>
<sink_obj>49</sink_obj>
</item>
<item class_id_reference="20" object_id="_135">
<id>163</id>
<edge_type>2</edge_type>
<source_obj>53</source_obj>
<sink_obj>49</sink_obj>
</item>
<item class_id_reference="20" object_id="_136">
<id>164</id>
<edge_type>1</edge_type>
<source_obj>46</source_obj>
<sink_obj>51</sink_obj>
</item>
<item class_id_reference="20" object_id="_137">
<id>165</id>
<edge_type>1</edge_type>
<source_obj>6</source_obj>
<sink_obj>51</sink_obj>
</item>
<item class_id_reference="20" object_id="_138">
<id>166</id>
<edge_type>2</edge_type>
<source_obj>82</source_obj>
<sink_obj>52</sink_obj>
</item>
<item class_id_reference="20" object_id="_139">
<id>167</id>
<edge_type>1</edge_type>
<source_obj>47</source_obj>
<sink_obj>54</sink_obj>
</item>
<item class_id_reference="20" object_id="_140">
<id>169</id>
<edge_type>1</edge_type>
<source_obj>168</source_obj>
<sink_obj>54</sink_obj>
</item>
<item class_id_reference="20" object_id="_141">
<id>170</id>
<edge_type>1</edge_type>
<source_obj>47</source_obj>
<sink_obj>55</sink_obj>
</item>
<item class_id_reference="20" object_id="_142">
<id>171</id>
<edge_type>1</edge_type>
<source_obj>7</source_obj>
<sink_obj>56</sink_obj>
</item>
<item class_id_reference="20" object_id="_143">
<id>173</id>
<edge_type>1</edge_type>
<source_obj>172</source_obj>
<sink_obj>56</sink_obj>
</item>
<item class_id_reference="20" object_id="_144">
<id>174</id>
<edge_type>1</edge_type>
<source_obj>55</source_obj>
<sink_obj>56</sink_obj>
</item>
<item class_id_reference="20" object_id="_145">
<id>175</id>
<edge_type>1</edge_type>
<source_obj>56</source_obj>
<sink_obj>57</sink_obj>
</item>
<item class_id_reference="20" object_id="_146">
<id>176</id>
<edge_type>1</edge_type>
<source_obj>6</source_obj>
<sink_obj>58</sink_obj>
</item>
<item class_id_reference="20" object_id="_147">
<id>177</id>
<edge_type>1</edge_type>
<source_obj>8</source_obj>
<sink_obj>59</sink_obj>
</item>
<item class_id_reference="20" object_id="_148">
<id>178</id>
<edge_type>1</edge_type>
<source_obj>9</source_obj>
<sink_obj>60</sink_obj>
</item>
<item class_id_reference="20" object_id="_149">
<id>181</id>
<edge_type>1</edge_type>
<source_obj>54</source_obj>
<sink_obj>61</sink_obj>
</item>
<item class_id_reference="20" object_id="_150">
<id>182</id>
<edge_type>1</edge_type>
<source_obj>60</source_obj>
<sink_obj>61</sink_obj>
</item>
<item class_id_reference="20" object_id="_151">
<id>183</id>
<edge_type>1</edge_type>
<source_obj>61</source_obj>
<sink_obj>62</sink_obj>
</item>
<item class_id_reference="20" object_id="_152">
<id>184</id>
<edge_type>1</edge_type>
<source_obj>10</source_obj>
<sink_obj>63</sink_obj>
</item>
<item class_id_reference="20" object_id="_153">
<id>185</id>
<edge_type>1</edge_type>
<source_obj>172</source_obj>
<sink_obj>63</sink_obj>
</item>
<item class_id_reference="20" object_id="_154">
<id>186</id>
<edge_type>1</edge_type>
<source_obj>62</source_obj>
<sink_obj>63</sink_obj>
</item>
<item class_id_reference="20" object_id="_155">
<id>187</id>
<edge_type>1</edge_type>
<source_obj>63</source_obj>
<sink_obj>64</sink_obj>
</item>
<item class_id_reference="20" object_id="_156">
<id>188</id>
<edge_type>1</edge_type>
<source_obj>47</source_obj>
<sink_obj>65</sink_obj>
</item>
<item class_id_reference="20" object_id="_157">
<id>190</id>
<edge_type>1</edge_type>
<source_obj>189</source_obj>
<sink_obj>65</sink_obj>
</item>
<item class_id_reference="20" object_id="_158">
<id>191</id>
<edge_type>1</edge_type>
<source_obj>47</source_obj>
<sink_obj>66</sink_obj>
</item>
<item class_id_reference="20" object_id="_159">
<id>193</id>
<edge_type>1</edge_type>
<source_obj>192</source_obj>
<sink_obj>66</sink_obj>
</item>
<item class_id_reference="20" object_id="_160">
<id>194</id>
<edge_type>1</edge_type>
<source_obj>59</source_obj>
<sink_obj>67</sink_obj>
</item>
<item class_id_reference="20" object_id="_161">
<id>196</id>
<edge_type>1</edge_type>
<source_obj>195</source_obj>
<sink_obj>67</sink_obj>
</item>
<item class_id_reference="20" object_id="_162">
<id>197</id>
<edge_type>1</edge_type>
<source_obj>65</source_obj>
<sink_obj>68</sink_obj>
</item>
<item class_id_reference="20" object_id="_163">
<id>198</id>
<edge_type>1</edge_type>
<source_obj>66</source_obj>
<sink_obj>68</sink_obj>
</item>
<item class_id_reference="20" object_id="_164">
<id>199</id>
<edge_type>1</edge_type>
<source_obj>68</source_obj>
<sink_obj>69</sink_obj>
</item>
<item class_id_reference="20" object_id="_165">
<id>200</id>
<edge_type>1</edge_type>
<source_obj>67</source_obj>
<sink_obj>69</sink_obj>
</item>
<item class_id_reference="20" object_id="_166">
<id>201</id>
<edge_type>1</edge_type>
<source_obj>69</source_obj>
<sink_obj>70</sink_obj>
</item>
<item class_id_reference="20" object_id="_167">
<id>202</id>
<edge_type>1</edge_type>
<source_obj>59</source_obj>
<sink_obj>70</sink_obj>
</item>
<item class_id_reference="20" object_id="_168">
<id>203</id>
<edge_type>1</edge_type>
<source_obj>70</source_obj>
<sink_obj>71</sink_obj>
</item>
<item class_id_reference="20" object_id="_169">
<id>205</id>
<edge_type>1</edge_type>
<source_obj>204</source_obj>
<sink_obj>71</sink_obj>
</item>
<item class_id_reference="20" object_id="_170">
<id>206</id>
<edge_type>1</edge_type>
<source_obj>64</source_obj>
<sink_obj>71</sink_obj>
</item>
<item class_id_reference="20" object_id="_171">
<id>207</id>
<edge_type>1</edge_type>
<source_obj>57</source_obj>
<sink_obj>72</sink_obj>
</item>
<item class_id_reference="20" object_id="_172">
<id>208</id>
<edge_type>1</edge_type>
<source_obj>58</source_obj>
<sink_obj>73</sink_obj>
</item>
<item class_id_reference="20" object_id="_173">
<id>209</id>
<edge_type>1</edge_type>
<source_obj>72</source_obj>
<sink_obj>74</sink_obj>
</item>
<item class_id_reference="20" object_id="_174">
<id>210</id>
<edge_type>1</edge_type>
<source_obj>73</source_obj>
<sink_obj>74</sink_obj>
</item>
<item class_id_reference="20" object_id="_175">
<id>211</id>
<edge_type>1</edge_type>
<source_obj>74</source_obj>
<sink_obj>75</sink_obj>
</item>
<item class_id_reference="20" object_id="_176">
<id>212</id>
<edge_type>1</edge_type>
<source_obj>75</source_obj>
<sink_obj>76</sink_obj>
</item>
<item class_id_reference="20" object_id="_177">
<id>213</id>
<edge_type>1</edge_type>
<source_obj>71</source_obj>
<sink_obj>76</sink_obj>
</item>
<item class_id_reference="20" object_id="_178">
<id>215</id>
<edge_type>1</edge_type>
<source_obj>47</source_obj>
<sink_obj>77</sink_obj>
</item>
<item class_id_reference="20" object_id="_179">
<id>216</id>
<edge_type>1</edge_type>
<source_obj>60</source_obj>
<sink_obj>77</sink_obj>
</item>
<item class_id_reference="20" object_id="_180">
<id>217</id>
<edge_type>1</edge_type>
<source_obj>77</source_obj>
<sink_obj>78</sink_obj>
</item>
<item class_id_reference="20" object_id="_181">
<id>218</id>
<edge_type>1</edge_type>
<source_obj>10</source_obj>
<sink_obj>79</sink_obj>
</item>
<item class_id_reference="20" object_id="_182">
<id>219</id>
<edge_type>1</edge_type>
<source_obj>172</source_obj>
<sink_obj>79</sink_obj>
</item>
<item class_id_reference="20" object_id="_183">
<id>220</id>
<edge_type>1</edge_type>
<source_obj>78</source_obj>
<sink_obj>79</sink_obj>
</item>
<item class_id_reference="20" object_id="_184">
<id>221</id>
<edge_type>1</edge_type>
<source_obj>76</source_obj>
<sink_obj>80</sink_obj>
</item>
<item class_id_reference="20" object_id="_185">
<id>222</id>
<edge_type>1</edge_type>
<source_obj>79</source_obj>
<sink_obj>80</sink_obj>
</item>
<item class_id_reference="20" object_id="_186">
<id>223</id>
<edge_type>1</edge_type>
<source_obj>65</source_obj>
<sink_obj>81</sink_obj>
</item>
<item class_id_reference="20" object_id="_187">
<id>224</id>
<edge_type>2</edge_type>
<source_obj>98</source_obj>
<sink_obj>81</sink_obj>
</item>
<item class_id_reference="20" object_id="_188">
<id>225</id>
<edge_type>2</edge_type>
<source_obj>84</source_obj>
<sink_obj>81</sink_obj>
</item>
<item class_id_reference="20" object_id="_189">
<id>226</id>
<edge_type>1</edge_type>
<source_obj>60</source_obj>
<sink_obj>83</sink_obj>
</item>
<item class_id_reference="20" object_id="_190">
<id>227</id>
<edge_type>2</edge_type>
<source_obj>91</source_obj>
<sink_obj>83</sink_obj>
</item>
<item class_id_reference="20" object_id="_191">
<id>228</id>
<edge_type>2</edge_type>
<source_obj>87</source_obj>
<sink_obj>83</sink_obj>
</item>
<item class_id_reference="20" object_id="_192">
<id>230</id>
<edge_type>1</edge_type>
<source_obj>229</source_obj>
<sink_obj>85</sink_obj>
</item>
<item class_id_reference="20" object_id="_193">
<id>231</id>
<edge_type>1</edge_type>
<source_obj>8</source_obj>
<sink_obj>85</sink_obj>
</item>
<item class_id_reference="20" object_id="_194">
<id>232</id>
<edge_type>2</edge_type>
<source_obj>91</source_obj>
<sink_obj>86</sink_obj>
</item>
<item class_id_reference="20" object_id="_195">
<id>233</id>
<edge_type>1</edge_type>
<source_obj>60</source_obj>
<sink_obj>88</sink_obj>
</item>
<item class_id_reference="20" object_id="_196">
<id>234</id>
<edge_type>1</edge_type>
<source_obj>195</source_obj>
<sink_obj>88</sink_obj>
</item>
<item class_id_reference="20" object_id="_197">
<id>235</id>
<edge_type>1</edge_type>
<source_obj>88</source_obj>
<sink_obj>89</sink_obj>
</item>
<item class_id_reference="20" object_id="_198">
<id>236</id>
<edge_type>1</edge_type>
<source_obj>9</source_obj>
<sink_obj>89</sink_obj>
</item>
<item class_id_reference="20" object_id="_199">
<id>237</id>
<edge_type>2</edge_type>
<source_obj>98</source_obj>
<sink_obj>90</sink_obj>
</item>
<item class_id_reference="20" object_id="_200">
<id>240</id>
<edge_type>1</edge_type>
<source_obj>76</source_obj>
<sink_obj>92</sink_obj>
</item>
<item class_id_reference="20" object_id="_201">
<id>242</id>
<edge_type>1</edge_type>
<source_obj>241</source_obj>
<sink_obj>92</sink_obj>
</item>
<item class_id_reference="20" object_id="_202">
<id>244</id>
<edge_type>1</edge_type>
<source_obj>243</source_obj>
<sink_obj>92</sink_obj>
</item>
<item class_id_reference="20" object_id="_203">
<id>245</id>
<edge_type>1</edge_type>
<source_obj>65</source_obj>
<sink_obj>93</sink_obj>
</item>
<item class_id_reference="20" object_id="_204">
<id>246</id>
<edge_type>1</edge_type>
<source_obj>159</source_obj>
<sink_obj>93</sink_obj>
</item>
<item class_id_reference="20" object_id="_205">
<id>247</id>
<edge_type>1</edge_type>
<source_obj>54</source_obj>
<sink_obj>93</sink_obj>
</item>
<item class_id_reference="20" object_id="_206">
<id>248</id>
<edge_type>1</edge_type>
<source_obj>93</source_obj>
<sink_obj>94</sink_obj>
</item>
<item class_id_reference="20" object_id="_207">
<id>249</id>
<edge_type>1</edge_type>
<source_obj>5</source_obj>
<sink_obj>94</sink_obj>
</item>
<item class_id_reference="20" object_id="_208">
<id>250</id>
<edge_type>1</edge_type>
<source_obj>11</source_obj>
<sink_obj>95</sink_obj>
</item>
<item class_id_reference="20" object_id="_209">
<id>251</id>
<edge_type>1</edge_type>
<source_obj>95</source_obj>
<sink_obj>96</sink_obj>
</item>
<item class_id_reference="20" object_id="_210">
<id>253</id>
<edge_type>1</edge_type>
<source_obj>252</source_obj>
<sink_obj>96</sink_obj>
</item>
<item class_id_reference="20" object_id="_211">
<id>254</id>
<edge_type>1</edge_type>
<source_obj>96</source_obj>
<sink_obj>97</sink_obj>
</item>
<item class_id_reference="20" object_id="_212">
<id>255</id>
<edge_type>2</edge_type>
<source_obj>130</source_obj>
<sink_obj>97</sink_obj>
</item>
<item class_id_reference="20" object_id="_213">
<id>256</id>
<edge_type>2</edge_type>
<source_obj>101</source_obj>
<sink_obj>97</sink_obj>
</item>
<item class_id_reference="20" object_id="_214">
<id>257</id>
<edge_type>1</edge_type>
<source_obj>92</source_obj>
<sink_obj>99</sink_obj>
</item>
<item class_id_reference="20" object_id="_215">
<id>258</id>
<edge_type>1</edge_type>
<source_obj>12</source_obj>
<sink_obj>99</sink_obj>
</item>
<item class_id_reference="20" object_id="_216">
<id>259</id>
<edge_type>2</edge_type>
<source_obj>130</source_obj>
<sink_obj>100</sink_obj>
</item>
<item class_id_reference="20" object_id="_217">
<id>260</id>
<edge_type>1</edge_type>
<source_obj>95</source_obj>
<sink_obj>102</sink_obj>
</item>
<item class_id_reference="20" object_id="_218">
<id>262</id>
<edge_type>1</edge_type>
<source_obj>261</source_obj>
<sink_obj>102</sink_obj>
</item>
<item class_id_reference="20" object_id="_219">
<id>263</id>
<edge_type>1</edge_type>
<source_obj>95</source_obj>
<sink_obj>103</sink_obj>
</item>
<item class_id_reference="20" object_id="_220">
<id>264</id>
<edge_type>1</edge_type>
<source_obj>13</source_obj>
<sink_obj>104</sink_obj>
</item>
<item class_id_reference="20" object_id="_221">
<id>265</id>
<edge_type>1</edge_type>
<source_obj>172</source_obj>
<sink_obj>104</sink_obj>
</item>
<item class_id_reference="20" object_id="_222">
<id>266</id>
<edge_type>1</edge_type>
<source_obj>103</source_obj>
<sink_obj>104</sink_obj>
</item>
<item class_id_reference="20" object_id="_223">
<id>267</id>
<edge_type>1</edge_type>
<source_obj>104</source_obj>
<sink_obj>105</sink_obj>
</item>
<item class_id_reference="20" object_id="_224">
<id>268</id>
<edge_type>1</edge_type>
<source_obj>12</source_obj>
<sink_obj>106</sink_obj>
</item>
<item class_id_reference="20" object_id="_225">
<id>269</id>
<edge_type>1</edge_type>
<source_obj>14</source_obj>
<sink_obj>107</sink_obj>
</item>
<item class_id_reference="20" object_id="_226">
<id>270</id>
<edge_type>1</edge_type>
<source_obj>15</source_obj>
<sink_obj>108</sink_obj>
</item>
<item class_id_reference="20" object_id="_227">
<id>273</id>
<edge_type>1</edge_type>
<source_obj>102</source_obj>
<sink_obj>109</sink_obj>
</item>
<item class_id_reference="20" object_id="_228">
<id>274</id>
<edge_type>1</edge_type>
<source_obj>108</source_obj>
<sink_obj>109</sink_obj>
</item>
<item class_id_reference="20" object_id="_229">
<id>275</id>
<edge_type>1</edge_type>
<source_obj>109</source_obj>
<sink_obj>110</sink_obj>
</item>
<item class_id_reference="20" object_id="_230">
<id>276</id>
<edge_type>1</edge_type>
<source_obj>16</source_obj>
<sink_obj>111</sink_obj>
</item>
<item class_id_reference="20" object_id="_231">
<id>277</id>
<edge_type>1</edge_type>
<source_obj>172</source_obj>
<sink_obj>111</sink_obj>
</item>
<item class_id_reference="20" object_id="_232">
<id>278</id>
<edge_type>1</edge_type>
<source_obj>110</source_obj>
<sink_obj>111</sink_obj>
</item>
<item class_id_reference="20" object_id="_233">
<id>279</id>
<edge_type>1</edge_type>
<source_obj>111</source_obj>
<sink_obj>112</sink_obj>
</item>
<item class_id_reference="20" object_id="_234">
<id>280</id>
<edge_type>1</edge_type>
<source_obj>95</source_obj>
<sink_obj>113</sink_obj>
</item>
<item class_id_reference="20" object_id="_235">
<id>282</id>
<edge_type>1</edge_type>
<source_obj>281</source_obj>
<sink_obj>113</sink_obj>
</item>
<item class_id_reference="20" object_id="_236">
<id>283</id>
<edge_type>1</edge_type>
<source_obj>95</source_obj>
<sink_obj>114</sink_obj>
</item>
<item class_id_reference="20" object_id="_237">
<id>285</id>
<edge_type>1</edge_type>
<source_obj>284</source_obj>
<sink_obj>114</sink_obj>
</item>
<item class_id_reference="20" object_id="_238">
<id>286</id>
<edge_type>1</edge_type>
<source_obj>107</source_obj>
<sink_obj>115</sink_obj>
</item>
<item class_id_reference="20" object_id="_239">
<id>287</id>
<edge_type>1</edge_type>
<source_obj>195</source_obj>
<sink_obj>115</sink_obj>
</item>
<item class_id_reference="20" object_id="_240">
<id>288</id>
<edge_type>1</edge_type>
<source_obj>113</source_obj>
<sink_obj>116</sink_obj>
</item>
<item class_id_reference="20" object_id="_241">
<id>289</id>
<edge_type>1</edge_type>
<source_obj>114</source_obj>
<sink_obj>116</sink_obj>
</item>
<item class_id_reference="20" object_id="_242">
<id>290</id>
<edge_type>1</edge_type>
<source_obj>116</source_obj>
<sink_obj>117</sink_obj>
</item>
<item class_id_reference="20" object_id="_243">
<id>291</id>
<edge_type>1</edge_type>
<source_obj>115</source_obj>
<sink_obj>117</sink_obj>
</item>
<item class_id_reference="20" object_id="_244">
<id>292</id>
<edge_type>1</edge_type>
<source_obj>117</source_obj>
<sink_obj>118</sink_obj>
</item>
<item class_id_reference="20" object_id="_245">
<id>293</id>
<edge_type>1</edge_type>
<source_obj>107</source_obj>
<sink_obj>118</sink_obj>
</item>
<item class_id_reference="20" object_id="_246">
<id>294</id>
<edge_type>1</edge_type>
<source_obj>118</source_obj>
<sink_obj>119</sink_obj>
</item>
<item class_id_reference="20" object_id="_247">
<id>295</id>
<edge_type>1</edge_type>
<source_obj>204</source_obj>
<sink_obj>119</sink_obj>
</item>
<item class_id_reference="20" object_id="_248">
<id>296</id>
<edge_type>1</edge_type>
<source_obj>112</source_obj>
<sink_obj>119</sink_obj>
</item>
<item class_id_reference="20" object_id="_249">
<id>297</id>
<edge_type>1</edge_type>
<source_obj>105</source_obj>
<sink_obj>120</sink_obj>
</item>
<item class_id_reference="20" object_id="_250">
<id>298</id>
<edge_type>1</edge_type>
<source_obj>106</source_obj>
<sink_obj>121</sink_obj>
</item>
<item class_id_reference="20" object_id="_251">
<id>299</id>
<edge_type>1</edge_type>
<source_obj>120</source_obj>
<sink_obj>122</sink_obj>
</item>
<item class_id_reference="20" object_id="_252">
<id>300</id>
<edge_type>1</edge_type>
<source_obj>121</source_obj>
<sink_obj>122</sink_obj>
</item>
<item class_id_reference="20" object_id="_253">
<id>301</id>
<edge_type>1</edge_type>
<source_obj>122</source_obj>
<sink_obj>123</sink_obj>
</item>
<item class_id_reference="20" object_id="_254">
<id>302</id>
<edge_type>1</edge_type>
<source_obj>123</source_obj>
<sink_obj>124</sink_obj>
</item>
<item class_id_reference="20" object_id="_255">
<id>303</id>
<edge_type>1</edge_type>
<source_obj>119</source_obj>
<sink_obj>124</sink_obj>
</item>
<item class_id_reference="20" object_id="_256">
<id>305</id>
<edge_type>1</edge_type>
<source_obj>95</source_obj>
<sink_obj>125</sink_obj>
</item>
<item class_id_reference="20" object_id="_257">
<id>306</id>
<edge_type>1</edge_type>
<source_obj>108</source_obj>
<sink_obj>125</sink_obj>
</item>
<item class_id_reference="20" object_id="_258">
<id>307</id>
<edge_type>1</edge_type>
<source_obj>125</source_obj>
<sink_obj>126</sink_obj>
</item>
<item class_id_reference="20" object_id="_259">
<id>308</id>
<edge_type>1</edge_type>
<source_obj>16</source_obj>
<sink_obj>127</sink_obj>
</item>
<item class_id_reference="20" object_id="_260">
<id>309</id>
<edge_type>1</edge_type>
<source_obj>172</source_obj>
<sink_obj>127</sink_obj>
</item>
<item class_id_reference="20" object_id="_261">
<id>310</id>
<edge_type>1</edge_type>
<source_obj>126</source_obj>
<sink_obj>127</sink_obj>
</item>
<item class_id_reference="20" object_id="_262">
<id>311</id>
<edge_type>1</edge_type>
<source_obj>124</source_obj>
<sink_obj>128</sink_obj>
</item>
<item class_id_reference="20" object_id="_263">
<id>312</id>
<edge_type>1</edge_type>
<source_obj>127</source_obj>
<sink_obj>128</sink_obj>
</item>
<item class_id_reference="20" object_id="_264">
<id>313</id>
<edge_type>1</edge_type>
<source_obj>113</source_obj>
<sink_obj>129</sink_obj>
</item>
<item class_id_reference="20" object_id="_265">
<id>314</id>
<edge_type>2</edge_type>
<source_obj>150</source_obj>
<sink_obj>129</sink_obj>
</item>
<item class_id_reference="20" object_id="_266">
<id>315</id>
<edge_type>2</edge_type>
<source_obj>132</source_obj>
<sink_obj>129</sink_obj>
</item>
<item class_id_reference="20" object_id="_267">
<id>316</id>
<edge_type>1</edge_type>
<source_obj>108</source_obj>
<sink_obj>131</sink_obj>
</item>
<item class_id_reference="20" object_id="_268">
<id>317</id>
<edge_type>2</edge_type>
<source_obj>142</source_obj>
<sink_obj>131</sink_obj>
</item>
<item class_id_reference="20" object_id="_269">
<id>318</id>
<edge_type>2</edge_type>
<source_obj>135</source_obj>
<sink_obj>131</sink_obj>
</item>
<item class_id_reference="20" object_id="_270">
<id>319</id>
<edge_type>1</edge_type>
<source_obj>229</source_obj>
<sink_obj>133</sink_obj>
</item>
<item class_id_reference="20" object_id="_271">
<id>320</id>
<edge_type>1</edge_type>
<source_obj>14</source_obj>
<sink_obj>133</sink_obj>
</item>
<item class_id_reference="20" object_id="_272">
<id>321</id>
<edge_type>2</edge_type>
<source_obj>142</source_obj>
<sink_obj>134</sink_obj>
</item>
<item class_id_reference="20" object_id="_273">
<id>322</id>
<edge_type>1</edge_type>
<source_obj>17</source_obj>
<sink_obj>136</sink_obj>
</item>
<item class_id_reference="20" object_id="_274">
<id>323</id>
<edge_type>1</edge_type>
<source_obj>108</source_obj>
<sink_obj>137</sink_obj>
</item>
<item class_id_reference="20" object_id="_275">
<id>324</id>
<edge_type>1</edge_type>
<source_obj>136</source_obj>
<sink_obj>137</sink_obj>
</item>
<item class_id_reference="20" object_id="_276">
<id>325</id>
<edge_type>1</edge_type>
<source_obj>137</source_obj>
<sink_obj>138</sink_obj>
</item>
<item class_id_reference="20" object_id="_277">
<id>326</id>
<edge_type>1</edge_type>
<source_obj>15</source_obj>
<sink_obj>138</sink_obj>
</item>
<item class_id_reference="20" object_id="_278">
<id>327</id>
<edge_type>1</edge_type>
<source_obj>136</source_obj>
<sink_obj>139</sink_obj>
</item>
<item class_id_reference="20" object_id="_279">
<id>328</id>
<edge_type>1</edge_type>
<source_obj>195</source_obj>
<sink_obj>139</sink_obj>
</item>
<item class_id_reference="20" object_id="_280">
<id>329</id>
<edge_type>1</edge_type>
<source_obj>139</source_obj>
<sink_obj>140</sink_obj>
</item>
<item class_id_reference="20" object_id="_281">
<id>330</id>
<edge_type>1</edge_type>
<source_obj>17</source_obj>
<sink_obj>140</sink_obj>
</item>
<item class_id_reference="20" object_id="_282">
<id>331</id>
<edge_type>2</edge_type>
<source_obj>150</source_obj>
<sink_obj>141</sink_obj>
</item>
<item class_id_reference="20" object_id="_283">
<id>333</id>
<edge_type>1</edge_type>
<source_obj>124</source_obj>
<sink_obj>143</sink_obj>
</item>
<item class_id_reference="20" object_id="_284">
<id>334</id>
<edge_type>1</edge_type>
<source_obj>241</source_obj>
<sink_obj>143</sink_obj>
</item>
<item class_id_reference="20" object_id="_285">
<id>335</id>
<edge_type>1</edge_type>
<source_obj>243</source_obj>
<sink_obj>143</sink_obj>
</item>
<item class_id_reference="20" object_id="_286">
<id>336</id>
<edge_type>1</edge_type>
<source_obj>113</source_obj>
<sink_obj>144</sink_obj>
</item>
<item class_id_reference="20" object_id="_287">
<id>337</id>
<edge_type>1</edge_type>
<source_obj>252</source_obj>
<sink_obj>144</sink_obj>
</item>
<item class_id_reference="20" object_id="_288">
<id>338</id>
<edge_type>1</edge_type>
<source_obj>102</source_obj>
<sink_obj>144</sink_obj>
</item>
<item class_id_reference="20" object_id="_289">
<id>339</id>
<edge_type>1</edge_type>
<source_obj>144</source_obj>
<sink_obj>145</sink_obj>
</item>
<item class_id_reference="20" object_id="_290">
<id>340</id>
<edge_type>1</edge_type>
<source_obj>11</source_obj>
<sink_obj>145</sink_obj>
</item>
<item class_id_reference="20" object_id="_291">
<id>342</id>
<edge_type>1</edge_type>
<source_obj>341</source_obj>
<sink_obj>146</sink_obj>
</item>
<item class_id_reference="20" object_id="_292">
<id>343</id>
<edge_type>1</edge_type>
<source_obj>143</source_obj>
<sink_obj>146</sink_obj>
</item>
<item class_id_reference="20" object_id="_293">
<id>345</id>
<edge_type>1</edge_type>
<source_obj>344</source_obj>
<sink_obj>147</sink_obj>
</item>
<item class_id_reference="20" object_id="_294">
<id>346</id>
<edge_type>1</edge_type>
<source_obj>146</source_obj>
<sink_obj>147</sink_obj>
</item>
<item class_id_reference="20" object_id="_295">
<id>348</id>
<edge_type>1</edge_type>
<source_obj>347</source_obj>
<sink_obj>148</sink_obj>
</item>
<item class_id_reference="20" object_id="_296">
<id>349</id>
<edge_type>1</edge_type>
<source_obj>45</source_obj>
<sink_obj>148</sink_obj>
</item>
<item class_id_reference="20" object_id="_297">
<id>350</id>
<edge_type>1</edge_type>
<source_obj>147</source_obj>
<sink_obj>148</sink_obj>
</item>
<item class_id_reference="20" object_id="_298">
<id>351</id>
<edge_type>1</edge_type>
<source_obj>3</source_obj>
<sink_obj>148</sink_obj>
</item>
<item class_id_reference="20" object_id="_299">
<id>352</id>
<edge_type>1</edge_type>
<source_obj>4</source_obj>
<sink_obj>148</sink_obj>
</item>
<item class_id_reference="20" object_id="_300">
<id>353</id>
<edge_type>1</edge_type>
<source_obj>18</source_obj>
<sink_obj>146</sink_obj>
</item>
<item class_id_reference="20" object_id="_301">
<id>354</id>
<edge_type>1</edge_type>
<source_obj>19</source_obj>
<sink_obj>146</sink_obj>
</item>
<item class_id_reference="20" object_id="_302">
<id>355</id>
<edge_type>1</edge_type>
<source_obj>20</source_obj>
<sink_obj>146</sink_obj>
</item>
<item class_id_reference="20" object_id="_303">
<id>356</id>
<edge_type>1</edge_type>
<source_obj>21</source_obj>
<sink_obj>146</sink_obj>
</item>
<item class_id_reference="20" object_id="_304">
<id>357</id>
<edge_type>1</edge_type>
<source_obj>22</source_obj>
<sink_obj>146</sink_obj>
</item>
<item class_id_reference="20" object_id="_305">
<id>358</id>
<edge_type>1</edge_type>
<source_obj>23</source_obj>
<sink_obj>146</sink_obj>
</item>
<item class_id_reference="20" object_id="_306">
<id>359</id>
<edge_type>1</edge_type>
<source_obj>24</source_obj>
<sink_obj>146</sink_obj>
</item>
<item class_id_reference="20" object_id="_307">
<id>360</id>
<edge_type>1</edge_type>
<source_obj>25</source_obj>
<sink_obj>147</sink_obj>
</item>
<item class_id_reference="20" object_id="_308">
<id>361</id>
<edge_type>1</edge_type>
<source_obj>26</source_obj>
<sink_obj>147</sink_obj>
</item>
<item class_id_reference="20" object_id="_309">
<id>362</id>
<edge_type>1</edge_type>
<source_obj>27</source_obj>
<sink_obj>147</sink_obj>
</item>
<item class_id_reference="20" object_id="_310">
<id>363</id>
<edge_type>1</edge_type>
<source_obj>28</source_obj>
<sink_obj>147</sink_obj>
</item>
<item class_id_reference="20" object_id="_311">
<id>364</id>
<edge_type>1</edge_type>
<source_obj>29</source_obj>
<sink_obj>147</sink_obj>
</item>
<item class_id_reference="20" object_id="_312">
<id>365</id>
<edge_type>1</edge_type>
<source_obj>30</source_obj>
<sink_obj>147</sink_obj>
</item>
<item class_id_reference="20" object_id="_313">
<id>366</id>
<edge_type>1</edge_type>
<source_obj>31</source_obj>
<sink_obj>147</sink_obj>
</item>
<item class_id_reference="20" object_id="_314">
<id>367</id>
<edge_type>1</edge_type>
<source_obj>32</source_obj>
<sink_obj>147</sink_obj>
</item>
<item class_id_reference="20" object_id="_315">
<id>368</id>
<edge_type>1</edge_type>
<source_obj>33</source_obj>
<sink_obj>148</sink_obj>
</item>
<item class_id_reference="20" object_id="_316">
<id>369</id>
<edge_type>1</edge_type>
<source_obj>34</source_obj>
<sink_obj>148</sink_obj>
</item>
<item class_id_reference="20" object_id="_317">
<id>370</id>
<edge_type>1</edge_type>
<source_obj>35</source_obj>
<sink_obj>148</sink_obj>
</item>
<item class_id_reference="20" object_id="_318">
<id>371</id>
<edge_type>1</edge_type>
<source_obj>36</source_obj>
<sink_obj>148</sink_obj>
</item>
<item class_id_reference="20" object_id="_319">
<id>372</id>
<edge_type>1</edge_type>
<source_obj>37</source_obj>
<sink_obj>148</sink_obj>
</item>
<item class_id_reference="20" object_id="_320">
<id>373</id>
<edge_type>1</edge_type>
<source_obj>38</source_obj>
<sink_obj>148</sink_obj>
</item>
<item class_id_reference="20" object_id="_321">
<id>374</id>
<edge_type>1</edge_type>
<source_obj>39</source_obj>
<sink_obj>148</sink_obj>
</item>
<item class_id_reference="20" object_id="_322">
<id>388</id>
<edge_type>2</edge_type>
<source_obj>50</source_obj>
<sink_obj>53</sink_obj>
</item>
<item class_id_reference="20" object_id="_323">
<id>389</id>
<edge_type>2</edge_type>
<source_obj>50</source_obj>
<sink_obj>82</sink_obj>
</item>
<item class_id_reference="20" object_id="_324">
<id>390</id>
<edge_type>2</edge_type>
<source_obj>53</source_obj>
<sink_obj>82</sink_obj>
</item>
<item class_id_reference="20" object_id="_325">
<id>391</id>
<edge_type>2</edge_type>
<source_obj>82</source_obj>
<sink_obj>84</sink_obj>
</item>
<item class_id_reference="20" object_id="_326">
<id>392</id>
<edge_type>2</edge_type>
<source_obj>82</source_obj>
<sink_obj>98</sink_obj>
</item>
<item class_id_reference="20" object_id="_327">
<id>393</id>
<edge_type>2</edge_type>
<source_obj>84</source_obj>
<sink_obj>87</sink_obj>
</item>
<item class_id_reference="20" object_id="_328">
<id>394</id>
<edge_type>2</edge_type>
<source_obj>84</source_obj>
<sink_obj>91</sink_obj>
</item>
<item class_id_reference="20" object_id="_329">
<id>395</id>
<edge_type>2</edge_type>
<source_obj>87</source_obj>
<sink_obj>91</sink_obj>
</item>
<item class_id_reference="20" object_id="_330">
<id>396</id>
<edge_type>2</edge_type>
<source_obj>91</source_obj>
<sink_obj>98</sink_obj>
</item>
<item class_id_reference="20" object_id="_331">
<id>397</id>
<edge_type>2</edge_type>
<source_obj>98</source_obj>
<sink_obj>101</sink_obj>
</item>
<item class_id_reference="20" object_id="_332">
<id>398</id>
<edge_type>2</edge_type>
<source_obj>98</source_obj>
<sink_obj>130</sink_obj>
</item>
<item class_id_reference="20" object_id="_333">
<id>399</id>
<edge_type>2</edge_type>
<source_obj>101</source_obj>
<sink_obj>130</sink_obj>
</item>
<item class_id_reference="20" object_id="_334">
<id>400</id>
<edge_type>2</edge_type>
<source_obj>130</source_obj>
<sink_obj>132</sink_obj>
</item>
<item class_id_reference="20" object_id="_335">
<id>401</id>
<edge_type>2</edge_type>
<source_obj>130</source_obj>
<sink_obj>150</sink_obj>
</item>
<item class_id_reference="20" object_id="_336">
<id>402</id>
<edge_type>2</edge_type>
<source_obj>132</source_obj>
<sink_obj>135</sink_obj>
</item>
<item class_id_reference="20" object_id="_337">
<id>403</id>
<edge_type>2</edge_type>
<source_obj>132</source_obj>
<sink_obj>142</sink_obj>
</item>
<item class_id_reference="20" object_id="_338">
<id>404</id>
<edge_type>2</edge_type>
<source_obj>135</source_obj>
<sink_obj>142</sink_obj>
</item>
<item class_id_reference="20" object_id="_339">
<id>405</id>
<edge_type>2</edge_type>
<source_obj>142</source_obj>
<sink_obj>150</sink_obj>
</item>
<item class_id_reference="20" object_id="_340">
<id>406</id>
<edge_type>4</edge_type>
<source_obj>64</source_obj>
<sink_obj>80</sink_obj>
</item>
<item class_id_reference="20" object_id="_341">
<id>407</id>
<edge_type>4</edge_type>
<source_obj>112</source_obj>
<sink_obj>128</sink_obj>
</item>
<item class_id_reference="20" object_id="_342">
<id>408</id>
<edge_type>4</edge_type>
<source_obj>136</source_obj>
<sink_obj>140</sink_obj>
</item>
<item class_id_reference="20" object_id="_343">
<id>409</id>
<edge_type>4</edge_type>
<source_obj>47</source_obj>
<sink_obj>94</sink_obj>
</item>
<item class_id_reference="20" object_id="_344">
<id>410</id>
<edge_type>4</edge_type>
<source_obj>51</source_obj>
<sink_obj>58</sink_obj>
</item>
<item class_id_reference="20" object_id="_345">
<id>411</id>
<edge_type>4</edge_type>
<source_obj>59</source_obj>
<sink_obj>85</sink_obj>
</item>
<item class_id_reference="20" object_id="_346">
<id>412</id>
<edge_type>4</edge_type>
<source_obj>60</source_obj>
<sink_obj>89</sink_obj>
</item>
<item class_id_reference="20" object_id="_347">
<id>413</id>
<edge_type>4</edge_type>
<source_obj>95</source_obj>
<sink_obj>145</sink_obj>
</item>
<item class_id_reference="20" object_id="_348">
<id>414</id>
<edge_type>4</edge_type>
<source_obj>99</source_obj>
<sink_obj>106</sink_obj>
</item>
<item class_id_reference="20" object_id="_349">
<id>415</id>
<edge_type>4</edge_type>
<source_obj>107</source_obj>
<sink_obj>133</sink_obj>
</item>
<item class_id_reference="20" object_id="_350">
<id>416</id>
<edge_type>4</edge_type>
<source_obj>108</source_obj>
<sink_obj>138</sink_obj>
</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="_351">
<mId>1</mId>
<mTag>duc</mTag>
<mType>0</mType>
<sub_regions>
<count>0</count>
<item_version>0</item_version>
</sub_regions>
<basic_blocks>
<count>13</count>
<item_version>0</item_version>
<item>50</item>
<item>53</item>
<item>82</item>
<item>84</item>
<item>87</item>
<item>91</item>
<item>98</item>
<item>101</item>
<item>130</item>
<item>132</item>
<item>135</item>
<item>142</item>
<item>150</item>
</basic_blocks>
<mII>-1</mII>
<mDepth>-1</mDepth>
<mMinTripCount>-1</mMinTripCount>
<mMaxTripCount>-1</mMaxTripCount>
<mMinLatency>38</mMinLatency>
<mMaxLatency>-1</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"></mDfPipe>
</item>
</cdfg_regions>
<fsm class_id="24" tracking_level="1" version="0" object_id="_352">
<states class_id="25" tracking_level="0" version="0">
<count>17</count>
<item_version>0</item_version>
<item class_id="26" tracking_level="1" version="0" object_id="_353">
<id>1</id>
<operations class_id="27" tracking_level="0" version="0">
<count>16</count>
<item_version>0</item_version>
<item class_id="28" tracking_level="1" version="0" object_id="_354">
<id>40</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_355">
<id>41</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_356">
<id>42</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_357">
<id>43</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_358">
<id>44</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_359">
<id>45</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_360">
<id>46</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_361">
<id>47</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_362">
<id>48</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_363">
<id>49</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_364">
<id>51</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_365">
<id>52</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_366">
<id>54</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_367">
<id>55</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_368">
<id>56</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_369">
<id>57</id>
<stage>2</stage>
<latency>2</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_370">
<id>2</id>
<operations>
<count>8</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_371">
<id>57</id>
<stage>1</stage>
<latency>2</latency>
</item>
<item class_id_reference="28" object_id="_372">
<id>60</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_373">
<id>61</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_374">
<id>62</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_375">
<id>63</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_376">
<id>64</id>
<stage>2</stage>
<latency>2</latency>
</item>
<item class_id_reference="28" object_id="_377">
<id>65</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_378">
<id>66</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_379">
<id>3</id>
<operations>
<count>9</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_380">
<id>58</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_381">
<id>59</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_382">
<id>64</id>
<stage>1</stage>
<latency>2</latency>
</item>
<item class_id_reference="28" object_id="_383">
<id>67</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_384">
<id>68</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_385">
<id>69</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_386">
<id>72</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_387">
<id>73</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_388">
<id>74</id>
<stage>3</stage>
<latency>3</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_389">
<id>4</id>
<operations>
<count>3</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_390">
<id>70</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_391">
<id>71</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_392">
<id>74</id>
<stage>2</stage>
<latency>3</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_393">
<id>5</id>
<operations>
<count>3</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_394">
<id>74</id>
<stage>1</stage>
<latency>3</latency>
</item>
<item class_id_reference="28" object_id="_395">
<id>75</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_396">
<id>76</id>
<stage>2</stage>
<latency>2</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_397">
<id>6</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_398">
<id>76</id>
<stage>1</stage>
<latency>2</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_399">
<id>7</id>
<operations>
<count>23</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_400">
<id>77</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_401">
<id>78</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_402">
<id>79</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_403">
<id>80</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_404">
<id>81</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_405">
<id>83</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_406">
<id>85</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_407">
<id>86</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_408">
<id>88</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_409">
<id>89</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_410">
<id>90</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_411">
<id>92</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_412">
<id>93</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_413">
<id>94</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_414">
<id>95</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_415">
<id>96</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_416">
<id>97</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_417">
<id>99</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_418">
<id>100</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_419">
<id>102</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_420">
<id>103</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_421">
<id>104</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_422">
<id>105</id>
<stage>2</stage>
<latency>2</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_423">
<id>8</id>
<operations>
<count>8</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_424">
<id>105</id>
<stage>1</stage>
<latency>2</latency>
</item>
<item class_id_reference="28" object_id="_425">
<id>108</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_426">
<id>109</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_427">
<id>110</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_428">
<id>111</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_429">
<id>112</id>
<stage>2</stage>
<latency>2</latency>
</item>
<item class_id_reference="28" object_id="_430">
<id>113</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_431">
<id>114</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_432">
<id>9</id>
<operations>
<count>9</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_433">
<id>106</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_434">
<id>107</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_435">
<id>112</id>
<stage>1</stage>
<latency>2</latency>
</item>
<item class_id_reference="28" object_id="_436">
<id>115</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_437">
<id>116</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_438">
<id>117</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_439">
<id>120</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_440">
<id>121</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_441">
<id>122</id>
<stage>3</stage>
<latency>3</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_442">
<id>10</id>
<operations>
<count>3</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_443">
<id>118</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_444">
<id>119</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_445">
<id>122</id>
<stage>2</stage>
<latency>3</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_446">
<id>11</id>
<operations>
<count>3</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_447">
<id>122</id>
<stage>1</stage>
<latency>3</latency>
</item>
<item class_id_reference="28" object_id="_448">
<id>123</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_449">
<id>124</id>
<stage>2</stage>
<latency>2</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_450">
<id>12</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_451">
<id>124</id>
<stage>1</stage>
<latency>2</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_452">
<id>13</id>
<operations>
<count>18</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_453">
<id>125</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_454">
<id>126</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_455">
<id>127</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_456">
<id>128</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_457">
<id>129</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_458">
<id>131</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_459">
<id>133</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_460">
<id>134</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_461">
<id>136</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_462">
<id>137</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_463">
<id>138</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_464">
<id>139</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_465">
<id>140</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_466">
<id>141</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_467">
<id>143</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_468">
<id>144</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_469">
<id>145</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_470">
<id>146</id>
<stage>2</stage>
<latency>2</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_471">
<id>14</id>
<operations>
<count>2</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_472">
<id>146</id>
<stage>1</stage>
<latency>2</latency>
</item>
<item class_id_reference="28" object_id="_473">
<id>147</id>
<stage>2</stage>
<latency>2</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_474">
<id>15</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_475">
<id>147</id>
<stage>1</stage>
<latency>2</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_476">
<id>16</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_477">
<id>148</id>
<stage>2</stage>
<latency>2</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_478">
<id>17</id>
<operations>
<count>2</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_479">
<id>148</id>
<stage>1</stage>
<latency>2</latency>
</item>
<item class_id_reference="28" object_id="_480">
<id>149</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
</states>
<transitions class_id="29" tracking_level="0" version="0">
<count>16</count>
<item_version>0</item_version>
<item class_id="30" tracking_level="1" version="0" object_id="_481">
<inState>1</inState>
<outState>2</outState>
<condition class_id="31" tracking_level="0" version="0">
<id>47</id>
<sop class_id="32" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="33" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</item>
</sop>
</condition>
</item>
<item class_id_reference="30" object_id="_482">
<inState>2</inState>
<outState>3</outState>
<condition>
<id>50</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>0</count>
<item_version>0</item_version>
</item>
</sop>
</condition>
</item>
<item class_id_reference="30" object_id="_483">
<inState>3</inState>
<outState>4</outState>
<condition>
<id>51</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>0</count>
<item_version>0</item_version>
</item>
</sop>
</condition>
</item>
<item class_id_reference="30" object_id="_484">
<inState>4</inState>
<outState>5</outState>
<condition>
<id>52</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>0</count>
<item_version>0</item_version>
</item>
</sop>
</condition>
</item>
<item class_id_reference="30" object_id="_485">
<inState>5</inState>
<outState>6</outState>
<condition>
<id>53</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>0</count>
<item_version>0</item_version>
</item>
</sop>
</condition>
</item>
<item class_id_reference="30" object_id="_486">
<inState>6</inState>
<outState>7</outState>
<condition>
<id>54</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>0</count>
<item_version>0</item_version>
</item>
</sop>
</condition>
</item>
<item class_id_reference="30" object_id="_487">
<inState>7</inState>
<outState>8</outState>
<condition>
<id>55</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>0</count>
<item_version>0</item_version>
</item>
</sop>
</condition>
</item>
<item class_id_reference="30" object_id="_488">
<inState>8</inState>
<outState>9</outState>
<condition>
<id>58</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>0</count>
<item_version>0</item_version>
</item>
</sop>
</condition>
</item>
<item class_id_reference="30" object_id="_489">
<inState>9</inState>
<outState>10</outState>
<condition>
<id>59</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>0</count>
<item_version>0</item_version>
</item>
</sop>
</condition>
</item>
<item class_id_reference="30" object_id="_490">
<inState>10</inState>
<outState>11</outState>
<condition>
<id>60</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>0</count>
<item_version>0</item_version>
</item>
</sop>
</condition>
</item>
<item class_id_reference="30" object_id="_491">
<inState>11</inState>
<outState>12</outState>
<condition>
<id>61</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>0</count>
<item_version>0</item_version>
</item>
</sop>
</condition>
</item>
<item class_id_reference="30" object_id="_492">
<inState>12</inState>
<outState>13</outState>
<condition>
<id>62</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>0</count>
<item_version>0</item_version>
</item>
</sop>
</condition>
</item>
<item class_id_reference="30" object_id="_493">
<inState>13</inState>
<outState>14</outState>
<condition>
<id>63</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>0</count>
<item_version>0</item_version>
</item>
</sop>
</condition>
</item>
<item class_id_reference="30" object_id="_494">
<inState>14</inState>
<outState>15</outState>
<condition>
<id>66</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>0</count>
<item_version>0</item_version>
</item>
</sop>
</condition>
</item>
<item class_id_reference="30" object_id="_495">
<inState>15</inState>
<outState>16</outState>
<condition>
<id>67</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>0</count>
<item_version>0</item_version>
</item>
</sop>
</condition>
</item>
<item class_id_reference="30" object_id="_496">
<inState>16</inState>
<outState>17</outState>
<condition>
<id>68</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>0</count>
<item_version>0</item_version>
</item>
</sop>
</condition>
</item>
</transitions>
</fsm>
<res class_id="34" tracking_level="1" version="0" object_id="_497">
<dp_component_resource class_id="35" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_component_resource>
<dp_expression_resource>
<count>0</count>
<item_version>0</item_version>
</dp_expression_resource>
<dp_fifo_resource>
<count>0</count>
<item_version>0</item_version>
</dp_fifo_resource>
<dp_memory_resource>
<count>0</count>
<item_version>0</item_version>
</dp_memory_resource>
<dp_multiplexer_resource>
<count>0</count>
<item_version>0</item_version>
</dp_multiplexer_resource>
<dp_register_resource>
<count>0</count>
<item_version>0</item_version>
</dp_register_resource>
<dp_component_map class_id="36" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_component_map>
<dp_expression_map>
<count>0</count>
<item_version>0</item_version>
</dp_expression_map>
<dp_fifo_map>
<count>0</count>
<item_version>0</item_version>
</dp_fifo_map>
<dp_memory_map>
<count>0</count>
<item_version>0</item_version>
</dp_memory_map>
</res>
<node_label_latency class_id="37" tracking_level="0" version="0">
<count>93</count>
<item_version>0</item_version>
<item class_id="38" tracking_level="0" version="0">
<first>45</first>
<second class_id="39" tracking_level="0" version="0">
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>46</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>47</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>48</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>49</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>51</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>52</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>54</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>55</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>56</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>57</first>
<second>
<first>0</first>
<second>1</second>
</second>
</item>
<item>
<first>58</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>59</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>60</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>61</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>62</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>63</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>64</first>
<second>
<first>1</first>
<second>1</second>
</second>
</item>
<item>
<first>65</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>66</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>67</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>68</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>69</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>70</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>71</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>72</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>73</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>74</first>
<second>
<first>2</first>
<second>2</second>
</second>
</item>
<item>
<first>75</first>
<second>
<first>4</first>
<second>0</second>
</second>
</item>
<item>
<first>76</first>
<second>
<first>4</first>
<second>1</second>
</second>
</item>
<item>
<first>77</first>
<second>
<first>6</first>
<second>0</second>
</second>
</item>
<item>
<first>78</first>
<second>
<first>6</first>
<second>0</second>
</second>
</item>
<item>
<first>79</first>
<second>
<first>6</first>
<second>0</second>
</second>
</item>
<item>
<first>80</first>
<second>
<first>6</first>
<second>0</second>
</second>
</item>
<item>
<first>81</first>
<second>
<first>6</first>
<second>0</second>
</second>
</item>
<item>
<first>83</first>
<second>
<first>6</first>
<second>0</second>
</second>
</item>
<item>
<first>85</first>
<second>
<first>6</first>
<second>0</second>
</second>
</item>
<item>
<first>86</first>
<second>
<first>6</first>
<second>0</second>
</second>
</item>
<item>
<first>88</first>
<second>
<first>6</first>
<second>0</second>
</second>
</item>
<item>
<first>89</first>
<second>
<first>6</first>
<second>0</second>
</second>
</item>
<item>
<first>90</first>
<second>
<first>6</first>
<second>0</second>
</second>
</item>
<item>
<first>92</first>
<second>
<first>6</first>
<second>0</second>
</second>
</item>
<item>
<first>93</first>
<second>
<first>6</first>
<second>0</second>
</second>
</item>
<item>
<first>94</first>
<second>
<first>6</first>
<second>0</second>
</second>
</item>
<item>
<first>95</first>
<second>
<first>6</first>
<second>0</second>
</second>
</item>
<item>
<first>96</first>
<second>
<first>6</first>
<second>0</second>
</second>
</item>
<item>
<first>97</first>
<second>
<first>6</first>
<second>0</second>
</second>
</item>
<item>
<first>99</first>
<second>
<first>6</first>
<second>0</second>
</second>
</item>
<item>
<first>100</first>
<second>
<first>6</first>
<second>0</second>
</second>
</item>
<item>
<first>102</first>
<second>
<first>6</first>
<second>0</second>
</second>
</item>
<item>
<first>103</first>
<second>
<first>6</first>
<second>0</second>
</second>
</item>
<item>
<first>104</first>
<second>
<first>6</first>
<second>0</second>
</second>
</item>
<item>
<first>105</first>
<second>
<first>6</first>
<second>1</second>
</second>
</item>
<item>
<first>106</first>
<second>
<first>8</first>
<second>0</second>
</second>
</item>
<item>
<first>107</first>
<second>
<first>8</first>
<second>0</second>
</second>
</item>
<item>
<first>108</first>
<second>
<first>7</first>
<second>0</second>
</second>
</item>
<item>
<first>109</first>
<second>
<first>7</first>
<second>0</second>
</second>
</item>
<item>
<first>110</first>
<second>
<first>7</first>
<second>0</second>
</second>
</item>
<item>
<first>111</first>
<second>
<first>7</first>
<second>0</second>
</second>
</item>
<item>
<first>112</first>
<second>
<first>7</first>
<second>1</second>
</second>
</item>
<item>
<first>113</first>
<second>
<first>7</first>
<second>0</second>
</second>
</item>
<item>
<first>114</first>
<second>
<first>7</first>
<second>0</second>
</second>
</item>
<item>
<first>115</first>
<second>
<first>8</first>
<second>0</second>
</second>
</item>
<item>
<first>116</first>
<second>
<first>8</first>
<second>0</second>
</second>
</item>
<item>
<first>117</first>
<second>
<first>8</first>
<second>0</second>
</second>
</item>
<item>
<first>118</first>
<second>
<first>9</first>
<second>0</second>
</second>
</item>
<item>
<first>119</first>
<second>
<first>9</first>
<second>0</second>
</second>
</item>
<item>
<first>120</first>
<second>
<first>8</first>
<second>0</second>
</second>
</item>
<item>
<first>121</first>
<second>
<first>8</first>
<second>0</second>
</second>
</item>
<item>
<first>122</first>
<second>
<first>8</first>
<second>2</second>
</second>
</item>
<item>
<first>123</first>
<second>
<first>10</first>
<second>0</second>
</second>
</item>
<item>
<first>124</first>
<second>
<first>10</first>
<second>1</second>
</second>
</item>
<item>
<first>125</first>
<second>
<first>12</first>
<second>0</second>
</second>
</item>
<item>
<first>126</first>
<second>
<first>12</first>
<second>0</second>
</second>
</item>
<item>
<first>127</first>
<second>
<first>12</first>
<second>0</second>
</second>
</item>
<item>
<first>128</first>
<second>
<first>12</first>
<second>0</second>
</second>
</item>
<item>
<first>129</first>
<second>
<first>12</first>
<second>0</second>
</second>
</item>
<item>
<first>131</first>
<second>
<first>12</first>
<second>0</second>
</second>
</item>
<item>
<first>133</first>
<second>
<first>12</first>
<second>0</second>
</second>
</item>
<item>
<first>134</first>
<second>
<first>12</first>
<second>0</second>
</second>
</item>
<item>
<first>136</first>
<second>
<first>12</first>
<second>0</second>
</second>
</item>
<item>
<first>137</first>
<second>
<first>12</first>
<second>0</second>
</second>
</item>
<item>
<first>138</first>
<second>
<first>12</first>
<second>0</second>
</second>
</item>
<item>
<first>139</first>
<second>
<first>12</first>
<second>0</second>
</second>
</item>
<item>
<first>140</first>
<second>
<first>12</first>
<second>0</second>
</second>
</item>
<item>
<first>141</first>
<second>
<first>12</first>
<second>0</second>
</second>
</item>
<item>
<first>143</first>
<second>
<first>12</first>
<second>0</second>
</second>
</item>
<item>
<first>144</first>
<second>
<first>12</first>
<second>0</second>
</second>
</item>
<item>
<first>145</first>
<second>
<first>12</first>
<second>0</second>
</second>
</item>
<item>
<first>146</first>
<second>
<first>12</first>
<second>1</second>
</second>
</item>
<item>
<first>147</first>
<second>
<first>13</first>
<second>1</second>
</second>
</item>
<item>
<first>148</first>
<second>
<first>15</first>
<second>1</second>
</second>
</item>
<item>
<first>149</first>
<second>
<first>16</first>
<second>0</second>
</second>
</item>
</node_label_latency>
<bblk_ent_exit class_id="40" tracking_level="0" version="0">
<count>13</count>
<item_version>0</item_version>
<item class_id="41" tracking_level="0" version="0">
<first>50</first>
<second class_id="42" tracking_level="0" version="0">
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>53</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>82</first>
<second>
<first>0</first>
<second>6</second>
</second>
</item>
<item>
<first>84</first>
<second>
<first>6</first>
<second>6</second>
</second>
</item>
<item>
<first>87</first>
<second>
<first>6</first>
<second>6</second>
</second>
</item>
<item>
<first>91</first>
<second>
<first>6</first>
<second>6</second>
</second>
</item>
<item>
<first>98</first>
<second>
<first>6</first>
<second>6</second>
</second>
</item>
<item>
<first>101</first>
<second>
<first>6</first>
<second>6</second>
</second>
</item>
<item>
<first>130</first>
<second>
<first>6</first>
<second>12</second>
</second>
</item>
<item>
<first>132</first>
<second>
<first>12</first>
<second>12</second>
</second>
</item>
<item>
<first>135</first>
<second>
<first>12</first>
<second>12</second>
</second>
</item>
<item>
<first>142</first>
<second>
<first>12</first>
<second>12</second>
</second>
</item>
<item>
<first>150</first>
<second>
<first>12</first>
<second>16</second>
</second>
</item>
</bblk_ent_exit>
<regions class_id="43" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</regions>
<dp_fu_nodes class_id="44" tracking_level="0" version="0">
<count>74</count>
<item_version>0</item_version>
<item class_id="45" tracking_level="0" version="0">
<first>128</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>45</item>
</second>
</item>
<item>
<first>134</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>46</item>
</second>
</item>
<item>
<first>140</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>56</item>
</second>
</item>
<item>
<first>147</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>57</item>
<item>57</item>
</second>
</item>
<item>
<first>152</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>63</item>
</second>
</item>
<item>
<first>159</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>64</item>
<item>64</item>
<item>80</item>
</second>
</item>
<item>
<first>164</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>79</item>
</second>
</item>
<item>
<first>172</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>104</item>
</second>
</item>
<item>
<first>179</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>105</item>
<item>105</item>
</second>
</item>
<item>
<first>184</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>111</item>
</second>
</item>
<item>
<first>191</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>112</item>
<item>112</item>
<item>128</item>
</second>
</item>
<item>
<first>196</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>127</item>
</second>
</item>
<item>
<first>204</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>147</item>
<item>147</item>
</second>
</item>
<item>
<first>225</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>148</item>
<item>148</item>
</second>
</item>
<item>
<first>249</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>146</item>
<item>146</item>
</second>
</item>
<item>
<first>269</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>47</item>
</second>
</item>
<item>
<first>273</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>48</item>
</second>
</item>
<item>
<first>279</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>51</item>
</second>
</item>
<item>
<first>285</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>54</item>
</second>
</item>
<item>
<first>291</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>55</item>
</second>
</item>
<item>
<first>296</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>60</item>
</second>
</item>
<item>
<first>300</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>61</item>
</second>
</item>
<item>
<first>307</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>62</item>
</second>
</item>
<item>
<first>312</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>65</item>
</second>
</item>
<item>
<first>317</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>66</item>
</second>
</item>
<item>
<first>322</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>58</item>
</second>
</item>
<item>
<first>326</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>59</item>
</second>
</item>
<item>
<first>330</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>67</item>
</second>
</item>
<item>
<first>336</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>68</item>
</second>
</item>
<item>
<first>340</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>69</item>
</second>
</item>
<item>
<first>346</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>72</item>
</second>
</item>
<item>
<first>349</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>73</item>
</second>
</item>
<item>
<first>353</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>70</item>
</second>
</item>
<item>
<first>357</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>71</item>
</second>
</item>
<item>
<first>364</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>77</item>
</second>
</item>
<item>
<first>370</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>78</item>
</second>
</item>
<item>
<first>375</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>85</item>
</second>
</item>
<item>
<first>381</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>88</item>
</second>
</item>
<item>
<first>386</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>89</item>
</second>
</item>
<item>
<first>392</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>92</item>
</second>
</item>
<item>
<first>401</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>93</item>
</second>
</item>
<item>
<first>407</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>94</item>
</second>
</item>
<item>
<first>413</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>95</item>
</second>
</item>
<item>
<first>417</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>96</item>
</second>
</item>
<item>
<first>423</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>99</item>
</second>
</item>
<item>
<first>429</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>102</item>
</second>
</item>
<item>
<first>435</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>103</item>
</second>
</item>
<item>
<first>440</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>108</item>
</second>
</item>
<item>
<first>444</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>109</item>
</second>
</item>
<item>
<first>451</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>110</item>
</second>
</item>
<item>
<first>456</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>113</item>
</second>
</item>
<item>
<first>461</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>114</item>
</second>
</item>
<item>
<first>466</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>106</item>
</second>
</item>
<item>
<first>470</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>107</item>
</second>
</item>
<item>
<first>474</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>115</item>
</second>
</item>
<item>
<first>480</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>116</item>
</second>
</item>
<item>
<first>484</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>117</item>
</second>
</item>
<item>
<first>490</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>120</item>
</second>
</item>
<item>
<first>493</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>121</item>
</second>
</item>
<item>
<first>497</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>118</item>
</second>
</item>
<item>
<first>501</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>119</item>
</second>
</item>
<item>
<first>508</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>125</item>
</second>
</item>
<item>
<first>514</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>126</item>
</second>
</item>
<item>
<first>519</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>133</item>
</second>
</item>
<item>
<first>525</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>136</item>
</second>
</item>
<item>
<first>529</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>137</item>
</second>
</item>
<item>
<first>534</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>138</item>
</second>
</item>
<item>
<first>540</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>139</item>
</second>
</item>
<item>
<first>546</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>140</item>
</second>
</item>
<item>
<first>552</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>143</item>
</second>
</item>
<item>
<first>562</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>144</item>
</second>
</item>
<item>
<first>568</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>145</item>
</second>
</item>
<item>
<first>574</first>
<second>
<count>6</count>
<item_version>0</item_version>
<item>74</item>
<item>74</item>
<item>74</item>
<item>76</item>
<item>76</item>
<item>75</item>
</second>
</item>
<item>
<first>581</first>
<second>
<count>6</count>
<item_version>0</item_version>
<item>122</item>
<item>122</item>
<item>122</item>
<item>124</item>
<item>124</item>
<item>123</item>
</second>
</item>
</dp_fu_nodes>
<dp_fu_nodes_expression class_id="47" tracking_level="0" version="0">
<count>45</count>
<item_version>0</item_version>
<item class_id="48" tracking_level="0" version="0">
<first>c_1_addr_gep_fu_172</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>104</item>
</second>
</item>
<item>
<first>c_addr_gep_fu_140</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>56</item>
</second>
</item>
<item>
<first>imf1_o_fu_552</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>143</item>
</second>
</item>
<item>
<first>inc_1_fu_401</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>93</item>
</second>
</item>
<item>
<first>inc_2_fu_429</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>102</item>
</second>
</item>
<item>
<first>inc_3_fu_562</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>144</item>
</second>
</item>
<item>
<first>inc_fu_285</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>54</item>
</second>
</item>
<item>
<first>s_assign_fu_501</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>119</item>
</second>
</item>
<item>
<first>sel_tmp1_i9_fu_456</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>113</item>
</second>
</item>
<item>
<first>sel_tmp1_i_fu_312</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>65</item>
</second>
</item>
<item>
<first>sel_tmp2_i1_fu_461</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>114</item>
</second>
</item>
<item>
<first>sel_tmp2_i_fu_317</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>66</item>
</second>
</item>
<item>
<first>sel_tmp3_i1_fu_474</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>115</item>
</second>
</item>
<item>
<first>sel_tmp3_i_fu_330</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>67</item>
</second>
</item>
<item>
<first>sel_tmp4_i1_fu_480</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>116</item>
</second>
</item>
<item>
<first>sel_tmp4_i_fu_336</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>68</item>
</second>
</item>
<item>
<first>sel_tmp5_i1_fu_484</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>117</item>
</second>
</item>
<item>
<first>sel_tmp5_i_fu_340</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>69</item>
</second>
</item>
<item>
<first>shift_reg_p_1_addr_1_gep_fu_196</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>127</item>
</second>
</item>
<item>
<first>shift_reg_p_1_addr_gep_fu_184</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>111</item>
</second>
</item>
<item>
<first>shift_reg_p_addr_1_gep_fu_164</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>79</item>
</second>
</item>
<item>
<first>shift_reg_p_addr_gep_fu_152</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>63</item>
</second>
</item>
<item>
<first>srrc_o_fu_392</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>92</item>
</second>
</item>
<item>
<first>tmp_1_fu_497</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>118</item>
</second>
</item>
<item>
<first>tmp_2_fu_300</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>61</item>
</second>
</item>
<item>
<first>tmp_2_i_fu_291</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>55</item>
</second>
</item>
<item>
<first>tmp_3_fu_307</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>62</item>
</second>
</item>
<item>
<first>tmp_4_fu_364</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>77</item>
</second>
</item>
<item>
<first>tmp_5_fu_370</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>78</item>
</second>
</item>
<item>
<first>tmp_5_i_fu_357</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>71</item>
</second>
</item>
<item>
<first>tmp_6_fu_444</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>109</item>
</second>
</item>
<item>
<first>tmp_6_i_fu_529</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>137</item>
</second>
</item>
<item>
<first>tmp_7_fu_451</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>110</item>
</second>
</item>
<item>
<first>tmp_7_i_fu_540</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>139</item>
</second>
</item>
<item>
<first>tmp_8_fu_508</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>125</item>
</second>
</item>
<item>
<first>tmp_9_fu_514</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>126</item>
</second>
</item>
<item>
<first>tmp_fu_353</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>70</item>
</second>
</item>
<item>
<first>tmp_i1_fu_417</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>96</item>
</second>
</item>
<item>
<first>tmp_i3_fu_435</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>103</item>
</second>
</item>
<item>
<first>tmp_i_11_fu_381</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>88</item>
</second>
</item>
<item>
<first>tmp_i_fu_273</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>48</item>
</second>
</item>
<item>
<first>tmp_i_i1_12_fu_493</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>121</item>
</second>
</item>
<item>
<first>tmp_i_i1_fu_490</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>120</item>
</second>
</item>
<item>
<first>tmp_i_i_10_fu_349</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>73</item>
</second>
</item>
<item>
<first>tmp_i_i_fu_346</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>72</item>
</second>
</item>
</dp_fu_nodes_expression>
<dp_fu_nodes_module>
<count>5</count>
<item_version>0</item_version>
<item>
<first>grp_duc_imf2_fu_249</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>146</item>
<item>146</item>
</second>
</item>
<item>
<first>grp_duc_imf3_fu_204</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>147</item>
<item>147</item>
</second>
</item>
<item>
<first>grp_duc_mixer_fu_225</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>148</item>
<item>148</item>
</second>
</item>
<item>
<first>grp_fu_574</first>
<second>
<count>6</count>
<item_version>0</item_version>
<item>74</item>
<item>74</item>
<item>74</item>
<item>76</item>
<item>76</item>
<item>75</item>
</second>
</item>
<item>
<first>grp_fu_581</first>
<second>
<count>6</count>
<item_version>0</item_version>
<item>122</item>
<item>122</item>
<item>122</item>
<item>124</item>
<item>124</item>
<item>123</item>
</second>
</item>
</dp_fu_nodes_module>
<dp_fu_nodes_io>
<count>20</count>
<item_version>0</item_version>
<item>
<first>ch_1_load_load_fu_440</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>108</item>
</second>
</item>
<item>
<first>ch_load_load_fu_296</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>60</item>
</second>
</item>
<item>
<first>cnt_load_load_fu_525</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>136</item>
</second>
</item>
<item>
<first>din_i_read_read_fu_134</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>46</item>
</second>
</item>
<item>
<first>freq_read_read_fu_128</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>45</item>
</second>
</item>
<item>
<first>i_1_load_load_fu_413</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>95</item>
</second>
</item>
<item>
<first>i_load_load_fu_269</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>47</item>
</second>
</item>
<item>
<first>in_1_load_load_fu_466</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>106</item>
</second>
</item>
<item>
<first>in_load_load_fu_322</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>58</item>
</second>
</item>
<item>
<first>init_1_load_load_fu_470</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>107</item>
</second>
</item>
<item>
<first>init_load_load_fu_326</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>59</item>
</second>
</item>
<item>
<first>stg_111_store_fu_519</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>133</item>
</second>
</item>
<item>
<first>stg_115_store_fu_534</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>138</item>
</second>
</item>
<item>
<first>stg_117_store_fu_546</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>140</item>
</second>
</item>
<item>
<first>stg_121_store_fu_568</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>145</item>
</second>
</item>
<item>
<first>stg_28_store_fu_279</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>51</item>
</second>
</item>
<item>
<first>stg_64_store_fu_375</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>85</item>
</second>
</item>
<item>
<first>stg_67_store_fu_386</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>89</item>
</second>
</item>
<item>
<first>stg_71_store_fu_407</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>94</item>
</second>
</item>
<item>
<first>stg_75_store_fu_423</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>99</item>
</second>
</item>
</dp_fu_nodes_io>
<return_ports>
<count>0</count>
<item_version>0</item_version>
</return_ports>
<dp_mem_port_nodes class_id="49" tracking_level="0" version="0">
<count>12</count>
<item_version>0</item_version>
<item class_id="50" tracking_level="0" version="0">
<first class_id="51" tracking_level="0" version="0">
<first>DI_cache</first>
<second>100</second>
</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>148</item>
</second>
</item>
<item>
<first>
<first>c</first>
<second>0</second>
</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>57</item>
<item>57</item>
</second>
</item>
<item>
<first>
<first>c_1</first>
<second>0</second>
</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>105</item>
<item>105</item>
</second>
</item>
<item>
<first>
<first>c_2</first>
<second>100</second>
</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>146</item>
</second>
</item>
<item>
<first>
<first>c_3_0</first>
<second>100</second>
</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>147</item>
</second>
</item>
<item>
<first>
<first>c_3_1</first>
<second>100</second>
</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>147</item>
</second>
</item>
<item>
<first>
<first>dds_table</first>
<second>100</second>
</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>148</item>
</second>
</item>
<item>
<first>
<first>shift_reg_p</first>
<second>0</second>
</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>64</item>
<item>64</item>
<item>80</item>
</second>
</item>
<item>
<first>
<first>shift_reg_p0</first>
<second>100</second>
</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>147</item>
</second>
</item>
<item>
<first>
<first>shift_reg_p1</first>
<second>100</second>
</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>147</item>
</second>
</item>
<item>
<first>
<first>shift_reg_p_1</first>
<second>0</second>
</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>112</item>
<item>112</item>
<item>128</item>
</second>
</item>
<item>
<first>
<first>shift_reg_p_2</first>
<second>100</second>
</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>146</item>
</second>
</item>
</dp_mem_port_nodes>
<dp_reg_nodes>
<count>34</count>
<item_version>0</item_version>
<item>
<first>588</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>45</item>
</second>
</item>
<item>
<first>593</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>47</item>
</second>
</item>
<item>
<first>603</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>54</item>
</second>
</item>
<item>
<first>609</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>56</item>
</second>
</item>
<item>
<first>614</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>57</item>
</second>
</item>
<item>
<first>619</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>60</item>
</second>
</item>
<item>
<first>625</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>63</item>
</second>
</item>
<item>
<first>630</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>65</item>
</second>
</item>
<item>
<first>636</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>66</item>
</second>
</item>
<item>
<first>641</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>59</item>
</second>
</item>
<item>
<first>646</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>64</item>
</second>
</item>
<item>
<first>651</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>69</item>
</second>
</item>
<item>
<first>656</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>72</item>
</second>
</item>
<item>
<first>661</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>73</item>
</second>
</item>
<item>
<first>666</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>71</item>
</second>
</item>
<item>
<first>671</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>76</item>
</second>
</item>
<item>
<first>677</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>95</item>
</second>
</item>
<item>
<first>687</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>102</item>
</second>
</item>
<item>
<first>693</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>104</item>
</second>
</item>
<item>
<first>698</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>105</item>
</second>
</item>
<item>
<first>703</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>108</item>
</second>
</item>
<item>
<first>709</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>111</item>
</second>
</item>
<item>
<first>714</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>113</item>
</second>
</item>
<item>
<first>720</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>114</item>
</second>
</item>
<item>
<first>725</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>107</item>
</second>
</item>
<item>
<first>730</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>112</item>
</second>
</item>
<item>
<first>735</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>117</item>
</second>
</item>
<item>
<first>740</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>120</item>
</second>
</item>
<item>
<first>745</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>121</item>
</second>
</item>
<item>
<first>750</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>119</item>
</second>
</item>
<item>
<first>755</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>124</item>
</second>
</item>
<item>
<first>761</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>143</item>
</second>
</item>
<item>
<first>766</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>146</item>
</second>
</item>
<item>
<first>771</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>147</item>
</second>
</item>
</dp_reg_nodes>
<dp_regname_nodes>
<count>34</count>
<item_version>0</item_version>
<item>
<first>acc_1_reg_671</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>76</item>
</second>
</item>
<item>
<first>c_1_addr_reg_693</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>104</item>
</second>
</item>
<item>
<first>c_1_load_reg_698</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>105</item>
</second>
</item>
<item>
<first>c_addr_reg_609</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>56</item>
</second>
</item>
<item>
<first>c_load_reg_614</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>57</item>
</second>
</item>
<item>
<first>ch_1_load_reg_703</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>108</item>
</second>
</item>
<item>
<first>ch_load_reg_619</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>60</item>
</second>
</item>
<item>
<first>freq_read_reg_588</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>45</item>
</second>
</item>
<item>
<first>i_1_load_reg_677</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>95</item>
</second>
</item>
<item>
<first>i_load_reg_593</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>47</item>
</second>
</item>
<item>
<first>imf1_o_reg_761</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>143</item>
</second>
</item>
<item>
<first>imf2_o_reg_766</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>146</item>
</second>
</item>
<item>
<first>imf3_o_reg_771</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>147</item>
</second>
</item>
<item>
<first>inc_2_reg_687</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>102</item>
</second>
</item>
<item>
<first>inc_reg_603</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>54</item>
</second>
</item>
<item>
<first>init_1_load_reg_725</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>107</item>
</second>
</item>
<item>
<first>init_load_reg_641</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>59</item>
</second>
</item>
<item>
<first>s_assign_reg_750</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>119</item>
</second>
</item>
<item>
<first>sel_tmp1_i9_reg_714</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>113</item>
</second>
</item>
<item>
<first>sel_tmp1_i_reg_630</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>65</item>
</second>
</item>
<item>
<first>sel_tmp2_i1_reg_720</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>114</item>
</second>
</item>
<item>
<first>sel_tmp2_i_reg_636</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>66</item>
</second>
</item>
<item>
<first>sel_tmp5_i1_reg_735</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>117</item>
</second>
</item>
<item>
<first>sel_tmp5_i_reg_651</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>69</item>
</second>
</item>
<item>
<first>shift_reg_p_1_addr_reg_709</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>111</item>
</second>
</item>
<item>
<first>shift_reg_p_1_load_reg_730</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>112</item>
</second>
</item>
<item>
<first>shift_reg_p_addr_reg_625</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>63</item>
</second>
</item>
<item>
<first>shift_reg_p_load_reg_646</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>64</item>
</second>
</item>
<item>
<first>sum_reg_755</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>124</item>
</second>
</item>
<item>
<first>tmp_5_i_reg_666</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>71</item>
</second>
</item>
<item>
<first>tmp_i_i1_12_reg_745</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>121</item>
</second>
</item>
<item>
<first>tmp_i_i1_reg_740</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>120</item>
</second>
</item>
<item>
<first>tmp_i_i_10_reg_661</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>73</item>
</second>
</item>
<item>
<first>tmp_i_i_reg_656</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>72</item>
</second>
</item>
</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="52" tracking_level="0" version="0">
<count>4</count>
<item_version>0</item_version>
<item class_id="53" tracking_level="0" version="0">
<first>din_i</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>read</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>46</item>
</second>
</item>
</second>
</item>
<item>
<first>dout_i</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>call</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>148</item>
</second>
</item>
</second>
</item>
<item>
<first>dout_q</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>call</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>148</item>
</second>
</item>
</second>
</item>
<item>
<first>freq</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>read</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>45</item>
</second>
</item>
</second>
</item>
</dp_port_io_nodes>
<port2core class_id="54" 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>
|
Positional := H(A, F'Access);
Named := H(Int => A, Fun => F'Access);
Mixed := H(A, Fun=>F'Access);
|
-- Generated at 2016-07-04 19:19:16 +0000 by Natools.Static_Hash_Maps
-- from src/natools-web-comments-maps.sx
with Natools.Static_Maps.Web.Comments.Item_Commands;
with Natools.Static_Maps.Web.Comments.Item_Conditions;
with Natools.Static_Maps.Web.Comments.Item_Elements;
with Natools.Static_Maps.Web.Comments.Item_Forms;
with Natools.Static_Maps.Web.Comments.Item_Actions;
with Natools.Static_Maps.Web.Comments.List_Commands;
with Natools.Static_Maps.Web.Comments.List_Elements;
function Natools.Static_Maps.Web.Comments.T
return Boolean is
begin
for I in Map_1_Keys'Range loop
if Natools.Static_Maps.Web.Comments.Item_Commands.Hash
(Map_1_Keys (I).all) /= I
then
return False;
end if;
end loop;
for I in Map_2_Keys'Range loop
if Natools.Static_Maps.Web.Comments.Item_Conditions.Hash
(Map_2_Keys (I).all) /= I
then
return False;
end if;
end loop;
for I in Map_3_Keys'Range loop
if Natools.Static_Maps.Web.Comments.Item_Elements.Hash
(Map_3_Keys (I).all) /= I
then
return False;
end if;
end loop;
for I in Map_4_Keys'Range loop
if Natools.Static_Maps.Web.Comments.Item_Forms.Hash
(Map_4_Keys (I).all) /= I
then
return False;
end if;
end loop;
for I in Map_5_Keys'Range loop
if Natools.Static_Maps.Web.Comments.Item_Actions.Hash
(Map_5_Keys (I).all) /= I
then
return False;
end if;
end loop;
for I in Map_6_Keys'Range loop
if Natools.Static_Maps.Web.Comments.List_Commands.Hash
(Map_6_Keys (I).all) /= I
then
return False;
end if;
end loop;
for I in Map_7_Keys'Range loop
if Natools.Static_Maps.Web.Comments.List_Elements.Hash
(Map_7_Keys (I).all) /= I
then
return False;
end if;
end loop;
return True;
end Natools.Static_Maps.Web.Comments.T;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . P A C K _ 3 3 --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-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. --
-- --
------------------------------------------------------------------------------
-- Handling of packed arrays with Component_Size = 33
package System.Pack_33 is
pragma Preelaborate;
Bits : constant := 33;
type Bits_33 is mod 2 ** Bits;
for Bits_33'Size use Bits;
-- In all subprograms below, Rev_SSO is set True if the array has the
-- non-default scalar storage order.
function Get_33
(Arr : System.Address;
N : Natural;
Rev_SSO : Boolean) return Bits_33 with Inline;
-- Arr is the address of the packed array, N is the zero-based
-- subscript. This element is extracted and returned.
procedure Set_33
(Arr : System.Address;
N : Natural;
E : Bits_33;
Rev_SSO : Boolean) with Inline;
-- 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_33;
|
-- This spec has been automatically generated from STM32F7x9.svd
pragma Restrictions (No_Elaboration_Code);
pragma Ada_2012;
pragma Style_Checks (Off);
with HAL;
with System;
package STM32_SVD.FLASH is
pragma Preelaborate;
---------------
-- Registers --
---------------
subtype ACR_LATENCY_Field is HAL.UInt3;
-- Flash access control register
type ACR_Register is record
-- Latency
LATENCY : ACR_LATENCY_Field := 16#0#;
-- unspecified
Reserved_3_7 : HAL.UInt5 := 16#0#;
-- Prefetch enable
PRFTEN : Boolean := False;
-- Instruction cache enable
ICEN : Boolean := False;
-- Data cache enable
DCEN : Boolean := False;
-- Write-only. Instruction cache reset
ICRST : Boolean := False;
-- Data cache reset
DCRST : Boolean := False;
-- unspecified
Reserved_13_31 : HAL.UInt19 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for ACR_Register use record
LATENCY at 0 range 0 .. 2;
Reserved_3_7 at 0 range 3 .. 7;
PRFTEN at 0 range 8 .. 8;
ICEN at 0 range 9 .. 9;
DCEN at 0 range 10 .. 10;
ICRST at 0 range 11 .. 11;
DCRST at 0 range 12 .. 12;
Reserved_13_31 at 0 range 13 .. 31;
end record;
-- Status register
type SR_Register is record
-- End of operation
EOP : Boolean := False;
-- Operation error
OPERR : Boolean := False;
-- unspecified
Reserved_2_3 : HAL.UInt2 := 16#0#;
-- Write protection error
WRPERR : Boolean := False;
-- Programming alignment error
PGAERR : Boolean := False;
-- Programming parallelism error
PGPERR : Boolean := False;
-- Programming sequence error
PGSERR : Boolean := False;
-- unspecified
Reserved_8_15 : HAL.UInt8 := 16#0#;
-- Read-only. Busy
BSY : Boolean := False;
-- unspecified
Reserved_17_31 : HAL.UInt15 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for SR_Register use record
EOP at 0 range 0 .. 0;
OPERR at 0 range 1 .. 1;
Reserved_2_3 at 0 range 2 .. 3;
WRPERR at 0 range 4 .. 4;
PGAERR at 0 range 5 .. 5;
PGPERR at 0 range 6 .. 6;
PGSERR at 0 range 7 .. 7;
Reserved_8_15 at 0 range 8 .. 15;
BSY at 0 range 16 .. 16;
Reserved_17_31 at 0 range 17 .. 31;
end record;
subtype CR_SNB_Field is HAL.UInt5;
subtype CR_PSIZE_Field is HAL.UInt2;
-- Control register
type CR_Register is record
-- Programming
PG : Boolean := False;
-- Sector Erase
SER : Boolean := False;
-- Mass Erase of sectors 0 to 11
MER : Boolean := False;
-- Sector number
SNB : CR_SNB_Field := 16#0#;
-- Program size
PSIZE : CR_PSIZE_Field := 16#0#;
-- unspecified
Reserved_10_14 : HAL.UInt5 := 16#0#;
-- Mass Erase of sectors 12 to 23
MER1 : Boolean := False;
-- Start
STRT : Boolean := False;
-- unspecified
Reserved_17_23 : HAL.UInt7 := 16#0#;
-- End of operation interrupt enable
EOPIE : Boolean := False;
-- Error interrupt enable
ERRIE : Boolean := False;
-- unspecified
Reserved_26_30 : HAL.UInt5 := 16#0#;
-- Lock
LOCK : Boolean := True;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CR_Register use record
PG at 0 range 0 .. 0;
SER at 0 range 1 .. 1;
MER at 0 range 2 .. 2;
SNB at 0 range 3 .. 7;
PSIZE at 0 range 8 .. 9;
Reserved_10_14 at 0 range 10 .. 14;
MER1 at 0 range 15 .. 15;
STRT at 0 range 16 .. 16;
Reserved_17_23 at 0 range 17 .. 23;
EOPIE at 0 range 24 .. 24;
ERRIE at 0 range 25 .. 25;
Reserved_26_30 at 0 range 26 .. 30;
LOCK at 0 range 31 .. 31;
end record;
subtype OPTCR_BOR_LEV_Field is HAL.UInt2;
subtype OPTCR_RDP_Field is HAL.UInt8;
subtype OPTCR_nWRP_Field is HAL.UInt12;
-- Flash option control register
type OPTCR_Register is record
-- Option lock
OPTLOCK : Boolean := True;
-- Option start
OPTSTRT : Boolean := False;
-- BOR reset Level
BOR_LEV : OPTCR_BOR_LEV_Field := 16#3#;
-- unspecified
Reserved_4_4 : HAL.Bit := 16#0#;
-- WDG_SW User option bytes
WDG_SW : Boolean := True;
-- nRST_STOP User option bytes
nRST_STOP : Boolean := True;
-- nRST_STDBY User option bytes
nRST_STDBY : Boolean := True;
-- Read protect
RDP : OPTCR_RDP_Field := 16#AA#;
-- Not write protect
nWRP : OPTCR_nWRP_Field := 16#FFF#;
-- unspecified
Reserved_28_31 : HAL.UInt4 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for OPTCR_Register use record
OPTLOCK at 0 range 0 .. 0;
OPTSTRT at 0 range 1 .. 1;
BOR_LEV at 0 range 2 .. 3;
Reserved_4_4 at 0 range 4 .. 4;
WDG_SW at 0 range 5 .. 5;
nRST_STOP at 0 range 6 .. 6;
nRST_STDBY at 0 range 7 .. 7;
RDP at 0 range 8 .. 15;
nWRP at 0 range 16 .. 27;
Reserved_28_31 at 0 range 28 .. 31;
end record;
subtype OPTCR1_nWRP_Field is HAL.UInt12;
-- Flash option control register 1
type OPTCR1_Register is record
-- unspecified
Reserved_0_15 : HAL.UInt16 := 16#0#;
-- Not write protect
nWRP : OPTCR1_nWRP_Field := 16#FFF#;
-- unspecified
Reserved_28_31 : HAL.UInt4 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for OPTCR1_Register use record
Reserved_0_15 at 0 range 0 .. 15;
nWRP at 0 range 16 .. 27;
Reserved_28_31 at 0 range 28 .. 31;
end record;
-----------------
-- Peripherals --
-----------------
-- FLASH
type FLASH_Peripheral is record
-- Flash access control register
ACR : aliased ACR_Register;
-- Flash key register
KEYR : aliased HAL.UInt32;
-- Flash option key register
OPTKEYR : aliased HAL.UInt32;
-- Status register
SR : aliased SR_Register;
-- Control register
CR : aliased CR_Register;
-- Flash option control register
OPTCR : aliased OPTCR_Register;
-- Flash option control register 1
OPTCR1 : aliased OPTCR1_Register;
end record
with Volatile;
for FLASH_Peripheral use record
ACR at 16#0# range 0 .. 31;
KEYR at 16#4# range 0 .. 31;
OPTKEYR at 16#8# range 0 .. 31;
SR at 16#C# range 0 .. 31;
CR at 16#10# range 0 .. 31;
OPTCR at 16#14# range 0 .. 31;
OPTCR1 at 16#18# range 0 .. 31;
end record;
-- FLASH
FLASH_Periph : aliased FLASH_Peripheral
with Import, Address => System'To_Address (16#40023C00#);
end STM32_SVD.FLASH;
|
--****p* Fakedsp/Fakedsp
-- DESCRIPTION
-- The library fakedsp allows to write code with a DSP-style on a normal PC.
-- I wrote this to help my students in doing their lab activities.
--
-- The user of the library will be most probably interested in
-- the package Fakedsp.Card that provides the interface to the
-- "virtual DSP card."
--
-- Another package of interest is probably Fakedsp.Data_Streams.Files
-- that implement the Data_Source/Data_Destination interfaces
-- (defined in Fakedsp.Data_Streams) that represent the main abstraction
-- for data I/O.
--***
package Fakedsp is
--****t* Fakedsp/Sample_Type, Sample_Array
-- SOURCE
Sample_Size : constant := 16;
type Sample_Type is
range -(2 ** (Sample_Size - 1)) .. 2 ** (Sample_Size - 1)-1
with Size => 16;
type Sample_Array is array (Natural range <>) of Sample_Type;
-- DESCRIPTION
-- Type representing the sample read from the ADC/written to the DAC
--***
--****t* Fakedsp/Frequency_Hz, Unspecified_Frequency
-- SOURCE
type Frequency_Hz is delta 1.0 range 0.0 .. 1.0e6;
Unspecified_Frequency : constant Frequency_Hz := 0.0;
-- DESCRIPTION
-- Fixed point type (yes! Ada has fixed point... :-) used to represent
-- frequency
--***
end Fakedsp;
|
------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Text_IO.Float_IO --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- 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.11 $
-- Binding Version 01.00
------------------------------------------------------------------------------
generic
type Num is digits <>;
package Terminal_Interface.Curses.Text_IO.Float_IO is
Default_Fore : Field := 2;
Default_Aft : Field := Num'Digits - 1;
Default_Exp : Field := 3;
procedure Put
(Win : in Window;
Item : in Num;
Fore : in Field := Default_Fore;
Aft : in Field := Default_Aft;
Exp : in Field := Default_Exp);
procedure Put
(Item : in Num;
Fore : in Field := Default_Fore;
Aft : in Field := Default_Aft;
Exp : in Field := Default_Exp);
private
pragma Inline (Put);
end Terminal_Interface.Curses.Text_IO.Float_IO;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . I M G _ W C H A R --
-- --
-- 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. --
-- --
------------------------------------------------------------------------------
-- Wide_[Wide_]Character'Image
package System.Img_WChar is
pragma Pure;
function Image_Wide_Character
(V : Wide_Character;
Ada_2005 : Boolean) return String;
-- Computes Wide_Character'Image (V) and returns the computed result. The
-- parameter Ada_2005 is True if operating in Ada 2005 mode (or beyond).
-- This is needed for the annoying FFFE/FFFF incompatibility.
function Image_Wide_Wide_Character (V : Wide_Wide_Character) return String;
-- Computes Wide_Wide_Character'Image (V) and returns the computed result
end System.Img_WChar;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- A D A . A S S E R T --
-- --
-- B o d y --
-- --
-- Copyright (C) 2007-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. --
-- --
-- --
-- --
-- --
-- --
-- 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.Assertions with
SPARK_Mode
is
------------
-- Assert --
------------
procedure Assert (Check : Boolean) is
begin
if Check = False then
raise Ada.Assertions.Assertion_Error;
end if;
end Assert;
procedure Assert (Check : Boolean; Message : String) is
begin
if Check = False then
raise Ada.Assertions.Assertion_Error with Message;
end if;
end Assert;
end Ada.Assertions;
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Web 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$
------------------------------------------------------------------------------
with Ada.Containers.Hashed_Maps;
with Ada.Tags.Generic_Dispatching_Constructor;
with League.Strings.Hash;
package body Web_Services.SOAP.Payloads.Decoders.Registry is
function Create is
new Ada.Tags.Generic_Dispatching_Constructor
(Web_Services.SOAP.Payloads.Decoders.SOAP_Payload_Decoder,
League.Strings.Universal_String,
Web_Services.SOAP.Payloads.Decoders.Create);
package String_Tag_Maps is
new Ada.Containers.Hashed_Maps
(League.Strings.Universal_String,
Ada.Tags.Tag,
League.Strings.Hash,
League.Strings."=",
Ada.Tags."=");
Registry : String_Tag_Maps.Map;
--------------
-- Register --
--------------
procedure Register
(URI : League.Strings.Universal_String;
Tag : Ada.Tags.Tag) is
begin
Registry.Insert (URI, Tag);
end Register;
-------------
-- Resolve --
-------------
function Resolve
(URI : League.Strings.Universal_String)
return Web_Services.SOAP.Payloads.Decoders.SOAP_Payload_Decoder_Access
is
Position : constant String_Tag_Maps.Cursor := Registry.Find (URI);
Aux : aliased League.Strings.Universal_String := URI;
begin
if String_Tag_Maps.Has_Element (Position) then
return
new Web_Services.SOAP.Payloads.Decoders.SOAP_Payload_Decoder'Class'
(Create (String_Tag_Maps.Element (Position), Aux'Access));
else
return null;
end if;
end Resolve;
end Web_Services.SOAP.Payloads.Decoders.Registry;
|
-----------------------------------------------------------------------
-- akt-commands-info -- Info command to describe the current configuration
-- Copyright (C) 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.
-----------------------------------------------------------------------
package body AWA.Commands.Info is
use type AWA.Modules.Module_Access;
-- ------------------------------
-- Print the configuration identified by the given name.
-- ------------------------------
procedure Print (Command : in out Command_Type;
Name : in String;
Value : in String;
Default : in String;
Context : in out Context_Type) is
pragma Unreferenced (Default);
Pos : Natural;
begin
Context.Console.Start_Row;
Context.Console.Print_Field (1, Name);
Pos := Value'First;
while Pos <= Value'Last loop
if Value'Last - Pos > Command.Value_Length then
Context.Console.Print_Field (2, Value (Pos .. Pos + Command.Value_Length - 1));
Pos := Pos + Command.Value_Length;
Context.Console.End_Row;
Context.Console.Start_Row;
Context.Console.Print_Field (1, "");
else
Context.Console.Print_Field (2, Value (Pos .. Value'Last));
Pos := Pos + Value'Length;
end if;
end loop;
Context.Console.End_Row;
end Print;
procedure Print (Command : in out Command_Type;
Application : in out AWA.Applications.Application'Class;
Name : in String;
Default : in String;
Context : in out Context_Type) is
Value : constant String := Application.Get_Init_Parameter (Name, Default);
begin
Command.Print (Name, Value, Default, Context);
end Print;
procedure Print (Command : in out Command_Type;
Module : in AWA.Modules.Module'Class;
Name : in String;
Default : in String;
Context : in out Context_Type) is
Value : constant String := Module.Get_Config (Name, Default);
begin
Command.Print (Module.Get_Name & "." & Name, Value, Default, Context);
end Print;
-- ------------------------------
-- Print the configuration about the application.
-- ------------------------------
overriding
procedure Execute (Command : in out Command_Type;
Application : in out AWA.Applications.Application'Class;
Args : in Argument_List'Class;
Context : in out Context_Type) is
pragma Unreferenced (Args);
Module : AWA.Modules.Module_Access;
begin
if Command.Long_List then
Command.Value_Length := Natural'Last;
end if;
Application.Load_Bundle (Name => "commands",
Locale => "en",
Bundle => Command.Bundle);
Context.Console.Start_Title;
Context.Console.Print_Title (1, "", 30);
Context.Console.Print_Title (2, "", Command.Value_Length);
Context.Console.End_Title;
Context.Console.Notice (N_INFO, "Database configuration");
Context.Console.Notice (N_INFO, "----------------------");
Command.Print (Application, "database", "", Context);
Command.Print (Application, "ado.queries.paths", "", Context);
Command.Print (Application, "ado.queries.load", "", Context);
Command.Print (Application, "ado.drivers.load", "", Context);
Context.Console.Start_Title;
Context.Console.Print_Title (1, "", 30);
Context.Console.Print_Title (2, "", Command.Value_Length);
Context.Console.End_Title;
Context.Console.Notice (N_INFO, "Server faces configuration");
Context.Console.Notice (N_INFO, "--------------------------");
Command.Print (Application, "view.dir",
ASF.Applications.DEF_VIEW_DIR, Context);
Command.Print (Application, "view.escape_unknown_tags",
ASF.Applications.DEF_ESCAPE_UNKNOWN_TAGS, Context);
Command.Print (Application, "view.ext",
ASF.Applications.DEF_VIEW_EXT, Context);
Command.Print (Application, "view.file_ext",
ASF.Applications.DEF_VIEW_FILE_EXT, Context);
Command.Print (Application, "view.ignore_spaces",
ASF.Applications.DEF_IGNORE_WHITE_SPACES, Context);
Command.Print (Application, "view.ignore_empty_lines",
ASF.Applications.DEF_IGNORE_EMPTY_LINES, Context);
Command.Print (Application, "view.static.dir",
ASF.Applications.DEF_STATIC_DIR, Context);
Command.Print (Application, "bundle.dir", "bundles", Context);
Context.Console.Start_Title;
Context.Console.Print_Title (1, "", 30);
Context.Console.Print_Title (2, "", Command.Value_Length);
Context.Console.End_Title;
Context.Console.Notice (N_INFO, "AWA Application");
Context.Console.Notice (N_INFO, "--------------------------");
Command.Print (Application, "app_name", "", Context);
Command.Print (Application, "app_search_dirs", ".", Context);
Command.Print (Application, "app.modules.dir", "", Context);
Command.Print (Application, "app_url_base", "", Context);
Command.Print (Application, "awa_url_host", "", Context);
Command.Print (Application, "awa_url_port", "", Context);
Command.Print (Application, "awa_url_scheme", "", Context);
Command.Print (Application, "app.config", "awa.xml", Context);
Command.Print (Application, "app.config.plugins", "", Context);
Command.Print (Application, "contextPath", "", Context);
Command.Print (Application, "awa_dispatcher_count", "", Context);
Command.Print (Application, "awa_dispatcher_priority", "", Context);
Module := Application.Find_Module ("users");
if Module /= null then
Context.Console.Start_Title;
Context.Console.Print_Title (1, "", 30);
Context.Console.Print_Title (2, "", Command.Value_Length);
Context.Console.End_Title;
Context.Console.Notice (N_INFO, "Users Module");
Context.Console.Notice (N_INFO, "------------");
Command.Print (Application, "openid.realm", "", Context);
Command.Print (Application, "openid.callback_url", "", Context);
Command.Print (Application, "openid.success_url", "", Context);
Command.Print (Application, "auth.url.orange", "", Context);
Command.Print (Application, "auth.provider.orange", "", Context);
Command.Print (Application, "auth.url.yahoo", "", Context);
Command.Print (Application, "auth.provider.yahoo", "", Context);
Command.Print (Application, "auth.url.google", "", Context);
Command.Print (Application, "auth.provider.google", "", Context);
Command.Print (Application, "auth.url.facebook", "", Context);
Command.Print (Application, "auth.provider.facebook", "", Context);
Command.Print (Application, "auth.url.google-plus", "", Context);
Command.Print (Application, "auth.provider.google-plus", "", Context);
Command.Print (Application, "facebook.callback_url", "", Context);
Command.Print (Application, "facebook.request_url", "", Context);
Command.Print (Application, "facebook.scope", "", Context);
Command.Print (Application, "facebook.client_id", "", Context);
Command.Print (Application, "facebook.secret", "", Context);
Command.Print (Application, "google-plus.issuer", "", Context);
Command.Print (Application, "google-plus.callback_url", "", Context);
Command.Print (Application, "google-plus.request_url", "", Context);
Command.Print (Application, "google-plus.scope", "", Context);
Command.Print (Application, "google-plus.client_id", "", Context);
Command.Print (Application, "google-plus.secret", "", Context);
Command.Print (Application, "auth-filter.redirect", "", Context);
Command.Print (Application, "verify-filter.redirect", "", Context);
Command.Print (Application, "users.auth_key", "", Context);
Command.Print (Application, "users.server_id", "", Context);
end if;
Module := Application.Find_Module ("mail");
if Module /= null then
Context.Console.Start_Title;
Context.Console.Print_Title (1, "", 30);
Context.Console.Print_Title (2, "", Command.Value_Length);
Context.Console.End_Title;
Context.Console.Notice (N_INFO, "Mail Module");
Context.Console.Notice (N_INFO, "-----------");
Command.Print (Application, "mail.smtp.host", "", Context);
Command.Print (Application, "mail.smtp.port", "", Context);
Command.Print (Application, "mail.smtp.enable", "true", Context);
Command.Print (Application, "mail.mailer", "smtp", Context);
Command.Print (Application, "mail.file.maildir", "mail", Context);
Command.Print (Application, "app_mail_name", "", Context);
Command.Print (Application, "app_mail_from", "", Context);
end if;
Module := Application.Find_Module ("workspaces");
if Module /= null then
Context.Console.Start_Title;
Context.Console.Print_Title (1, "", 30);
Context.Console.Print_Title (2, "", Command.Value_Length);
Context.Console.End_Title;
Context.Console.Notice (N_INFO, "Workspace Module");
Context.Console.Notice (N_INFO, "----------------");
Command.Print (Module.all, "permissions_list", "", Context);
Command.Print (Module.all, "allow_workspace_create", "", Context);
end if;
Module := Application.Find_Module ("storages");
if Module /= null then
Context.Console.Start_Title;
Context.Console.Print_Title (1, "", 30);
Context.Console.Print_Title (2, "", Command.Value_Length);
Context.Console.End_Title;
Context.Console.Notice (N_INFO, "Storage Module");
Context.Console.Notice (N_INFO, "--------------------------");
Command.Print (Module.all, "database_max_size", "100000", Context);
Command.Print (Module.all, "storage_root", "storage", Context);
Command.Print (Module.all, "tmp_storage_root", "tmp", Context);
Module := Application.Find_Module ("images");
if Module /= null then
Command.Print (Module.all, "thumbnail_command", "", Context);
end if;
end if;
Module := Application.Find_Module ("wikis");
if Module /= null then
Context.Console.Start_Title;
Context.Console.Print_Title (1, "", 30);
Context.Console.Print_Title (2, "", Command.Value_Length);
Context.Console.End_Title;
Context.Console.Notice (N_INFO, "Wiki Module");
Context.Console.Notice (N_INFO, "-----------");
Command.Print (Module.all, "image_prefix", "", Context);
Command.Print (Module.all, "page_prefix", "", Context);
Command.Print (Module.all, "wiki_copy_list", "", Context);
Module := Application.Find_Module ("wiki_previews");
if Module /= null then
Command.Print (Module.all, "wiki_preview_tmp", "tmp", Context);
Command.Print (Module.all, "wiki_preview_dir", "web/preview", Context);
Command.Print (Module.all, "wiki_preview_template", "", Context);
Command.Print (Module.all, "wiki_preview_html", "", Context);
Command.Print (Module.all, "wiki_preview_command", "", Context);
end if;
end if;
Module := Application.Find_Module ("counters");
if Module /= null then
Context.Console.Start_Title;
Context.Console.Print_Title (1, "", 30);
Context.Console.Print_Title (2, "", Command.Value_Length);
Context.Console.End_Title;
Context.Console.Notice (N_INFO, "Counter Module");
Context.Console.Notice (N_INFO, "--------------");
Command.Print (Module.all, "counter_age_limit", "300", Context);
Command.Print (Module.all, "counter_limit", "1000", Context);
end if;
end Execute;
-- ------------------------------
-- Setup the command before parsing the arguments and executing it.
-- ------------------------------
overriding
procedure Setup (Command : in out Command_Type;
Config : in out GNAT.Command_Line.Command_Line_Configuration;
Context : in out Context_Type) is
begin
GC.Set_Usage (Config => Config,
Usage => Command.Get_Name & " [arguments]",
Help => Command.Get_Description);
Command_Drivers.Application_Command_Type (Command).Setup (Config, Context);
GC.Define_Switch (Config => Config,
Output => Command.Long_List'Access,
Switch => "-l",
Long_Switch => "--long-lines",
Help => -("Use long lines to print configuration values"));
end Setup;
-- ------------------------------
-- Write the help associated with the command.
-- ------------------------------
overriding
procedure Help (Command : in out Command_Type;
Name : in String;
Context : in out Context_Type) is
pragma Unreferenced (Command, Context);
begin
null;
end Help;
begin
Command_Drivers.Driver.Add_Command ("info",
-("report configuration information"),
Command'Access);
end AWA.Commands.Info;
|
package kv.avm.Line_Parser is
type Parse_Line_Interface is interface;
procedure Parse_Line
(Self : in out Parse_Line_Interface;
Line : in String) is abstract;
end kv.avm.Line_Parser;
|
with AUnit;
with AUnit.Test_Caller;
with AUnit.Test_Fixtures;
package Tests.Device is
type UDC_Stub_Fixture is new AUnit.Test_Fixtures.Test_Fixture with record
A : Integer;
end record;
overriding
procedure Set_Up (T : in out UDC_Stub_Fixture);
private
package UDC_Stub_Caller is new AUnit.Test_Caller (UDC_Stub_Fixture);
end Tests.Device;
|
-------------------------------------------------------------------------------
-- --
-- Coffee Clock --
-- --
-- Copyright (C) 2016-2017 Fabien Chouteau --
-- --
-- Coffee Clock 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. --
-- --
-- Coffee Clock 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 We Noise Maker. If not, see <http://www.gnu.org/licenses/>. --
-- --
-------------------------------------------------------------------------------
with Giza.Window; use Giza.Window;
with Giza.GUI;
package body Dialog_Window is
-------------
-- On_Init --
-------------
overriding procedure On_Init
(This : in out Instance)
is
-- Our real size
Size : constant Size_T := Get_Size (Parent (This));
begin
This.Top_Btn.Disable_Frame;
This.Bottom_Btn.Disable_Frame;
This.Icon.Disable_Frame;
This.Tile.Set_Size ((This.Panel_Size, Size.H));
This.Tile.Set_Child (1, This.Top_Btn'Unchecked_Access);
This.Tile.Set_Child (2, This.Icon'Unchecked_Access);
This.Tile.Set_Child (3, This.Bottom_Btn'Unchecked_Access);
This.Add_Child (This.Tile'Unchecked_Access,
(Size.W - This.Panel_Size, 0));
end On_Init;
-----------------------
-- On_Position_Event --
-----------------------
overriding function On_Position_Event
(This : in out Instance;
Evt : Position_Event_Ref;
Pos : Point_T)
return Boolean
is
begin
if On_Position_Event (Parent (This), Evt, Pos) then
if This.Top_Btn.Active then
This.Answer := Answer_Top;
Giza.GUI.Pop;
elsif This.Bottom_Btn.Active then
This.Answer := Answer_Bottom;
Giza.GUI.Pop;
else
This.Answer := Unknown_Answer;
end if;
This.Top_Btn.Set_Active (False);
This.Bottom_Btn.Set_Active (False);
return True;
else
return False;
end if;
end On_Position_Event;
--------------
-- Get_Size --
--------------
overriding function Get_Size
(This : Instance)
return Size_T
is
-- Our real size
Size : constant Size_T := Get_Size (Parent (This));
begin
-- Remove the size of side panel button
return Size - (Size.W / 10, 0);
end Get_Size;
----------------
-- Get_Answer --
----------------
function Get_Answer (This : Instance) return Answer_T is (This.Answer);
------------------
-- Clear_Answer --
------------------
procedure Clear_Answer (This : in out Instance) is
begin
This.Answer := Unknown_Answer;
end Clear_Answer;
-------------------
-- Set_Top_Image --
-------------------
procedure Set_Top_Image (This : in out Instance;
Img : Giza.Image.Ref)
is
begin
This.Top_Btn.Set_Image (Img);
end Set_Top_Image;
--------------------
-- Set_Icon_Image --
--------------------
procedure Set_Icon_Image (This : in out Instance;
Img : Giza.Image.Ref)
is
begin
This.Icon.Set_Image (Img);
end Set_Icon_Image;
----------------------
-- Set_Bottom_Image --
----------------------
procedure Set_Bottom_Image (This : in out Instance;
Img : Giza.Image.Ref)
is
begin
This.Bottom_Btn.Set_Image (Img);
end Set_Bottom_Image;
end Dialog_Window;
|
-----------------------------------------------------------------------
-- are-generator-go-tests -- Tests for Go generator
-- Copyright (C) 2021 Stephane Carrez
-- Written by Stephane Carrez (Stephane.Carrez@gmail.com)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Util.Tests;
with Are.Testsuite;
package Are.Generator.Go.Tests is
procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite);
type Test is new Are.Testsuite.Test with null record;
procedure Test_Generate_Go1 (T : in out Test);
procedure Test_Generate_Go2 (T : in out Test);
procedure Test_Generate_Go3 (T : in out Test);
end Are.Generator.Go.Tests;
|
------------------------------------------------------------------------------
-- --
-- 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$
------------------------------------------------------------------------------
with XML.SAX.Input_Sources;
with AMF.XMI.Document_Resolvers;
package AMF.Internals.XMI_Document_Resolvers is
type Default_Document_Resolver is
limited new AMF.XMI.Document_Resolvers.XMI_Document_Resolver
with private;
overriding function Error_String
(Self : Default_Document_Resolver) return League.Strings.Universal_String;
-- Returns error message for the last detected error.
overriding procedure Resolve_Document
(Self : in out Default_Document_Resolver;
URI : League.Strings.Universal_String;
Source : out XML.SAX.Input_Sources.SAX_Input_Source_Access;
Success : in out Boolean);
-- Resolves document URI, opens and returns its input source.
private
type Default_Document_Resolver is
limited new AMF.XMI.Document_Resolvers.XMI_Document_Resolver with
record
Error_String : League.Strings.Universal_String;
end record;
end AMF.Internals.XMI_Document_Resolvers;
|
------------------------------------------------------------------------------
-- --
-- Copyright (C) 2015, AdaCore --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- 2. 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. --
-- 3. Neither the name of STMicroelectronics nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
-- --
-- This file is based on: --
-- --
-- @file stm32f4xx_hal_spi.h --
-- @author MCD Application Team --
-- @version V1.1.0 --
-- @date 19-June-2014 --
-- @brief Header file of SPI HAL module. --
-- --
-- COPYRIGHT(c) 2014 STMicroelectronics --
------------------------------------------------------------------------------
-- This file provides definitions for the STM32G4 (ARM Cortex M4F
-- from ST Microelectronics) Serial Peripheral Interface (SPI) facility.
private with STM32_SVD.SPI;
with HAL.SPI;
with System;
package STM32.SPI is
type Internal_SPI_Port is private;
type SPI_Port (Periph : not null access Internal_SPI_Port) is
limited new HAL.SPI.SPI_Port with private;
type SPI_Data_Direction is
(D2Lines_FullDuplex,
D2Lines_RxOnly,
D1Line_Rx,
D1Line_Tx);
type SPI_Mode is (Master, Slave);
type SPI_Data_Size is
(Bits_4,
Bits_5,
Bits_6,
Bits_7,
Bits_8,
Bits_9,
Bits_10,
Bits_11,
Bits_12,
Bits_13,
Bits_14,
Bits_15,
Bits_16)
with Size => 4;
for SPI_Data_Size use
(Bits_4 => 2#0011#,
Bits_5 => 2#0100#,
Bits_6 => 2#0101#,
Bits_7 => 2#0110#,
Bits_8 => 2#0111#,
Bits_9 => 2#1000#,
Bits_10 => 2#1001#,
Bits_11 => 2#1010#,
Bits_12 => 2#1011#,
Bits_13 => 2#1100#,
Bits_14 => 2#1101#,
Bits_15 => 2#1110#,
Bits_16 => 2#1111#);
type SPI_Clock_Polarity is (High, Low);
type SPI_Clock_Phase is (P1Edge, P2Edge);
type SPI_Slave_Management is (Software_Managed, Hardware_Managed);
type SPI_Baud_Rate_Prescaler is
(BRP_2, BRP_4, BRP_8, BRP_16, BRP_32, BRP_64, BRP_128, BRP_256);
type SPI_First_Bit is (MSB, LSB);
type SPI_Configuration is record
Direction : SPI_Data_Direction;
Mode : SPI_Mode;
Data_Size : HAL.SPI.SPI_Data_Size;
Clock_Polarity : SPI_Clock_Polarity;
Clock_Phase : SPI_Clock_Phase;
Slave_Management : SPI_Slave_Management;
Baud_Rate_Prescaler : SPI_Baud_Rate_Prescaler;
First_Bit : SPI_First_Bit;
CRC_Poly : UInt16;
end record;
procedure Configure (This : in out SPI_Port; Conf : SPI_Configuration);
procedure Enable (This : in out SPI_Port);
procedure Disable (This : in out SPI_Port);
function Enabled (This : SPI_Port) return Boolean;
procedure Send (This : in out SPI_Port; Data : UInt16);
function Data (This : SPI_Port) return UInt16
with Inline;
procedure Send (This : in out SPI_Port; Data : UInt8);
function Data (This : SPI_Port) return UInt8
with Inline;
function Is_Busy (This : SPI_Port) return Boolean
with Inline;
function Rx_Is_Empty (This : SPI_Port) return Boolean
with Inline;
function Tx_Is_Empty (This : SPI_Port) return Boolean
with Inline;
function Busy (This : SPI_Port) return Boolean
with Inline;
function Underrun_Indicated (This : SPI_Port) return Boolean
with Inline;
function CRC_Error_Indicated (This : SPI_Port) return Boolean
with Inline;
function Mode_Fault_Indicated (This : SPI_Port) return Boolean
with Inline;
function Overrun_Indicated (This : SPI_Port) return Boolean
with Inline;
function Frame_Fmt_Error_Indicated (This : SPI_Port) return Boolean
with Inline;
procedure Clear_Overrun (This : SPI_Port);
procedure Reset_CRC (This : in out SPI_Port);
function CRC_Enabled (This : SPI_Port) return Boolean;
function Is_Data_Frame_16bit (This : SPI_Port) return Boolean;
function Current_Mode (This : SPI_Port) return SPI_Mode;
function Current_Data_Direction (This : SPI_Port) return SPI_Data_Direction;
-- The following I/O routines implement the higher level functionality for
-- CRC and data direction, among others.
type UInt8_Buffer is array (Natural range <>) of UInt8
with Alignment => 2;
-- The alignment is set to 2 because we treat component pairs as half_word
-- values when sending/receiving in 16-bit mode.
-- Blocking
overriding
function Data_Size (This : SPI_Port) return HAL.SPI.SPI_Data_Size;
overriding
procedure Transmit
(This : in out SPI_Port;
Data : HAL.SPI.SPI_Data_8b;
Status : out HAL.SPI.SPI_Status;
Timeout : Natural := 1000);
overriding
procedure Transmit
(This : in out SPI_Port;
Data : HAL.SPI.SPI_Data_16b;
Status : out HAL.SPI.SPI_Status;
Timeout : Natural := 1000);
procedure Transmit
(This : in out SPI_Port;
Outgoing : UInt8);
overriding
procedure Receive
(This : in out SPI_Port;
Data : out HAL.SPI.SPI_Data_8b;
Status : out HAL.SPI.SPI_Status;
Timeout : Natural := 1000);
overriding
procedure Receive
(This : in out SPI_Port;
Data : out HAL.SPI.SPI_Data_16b;
Status : out HAL.SPI.SPI_Status;
Timeout : Natural := 1000);
procedure Receive
(This : in out SPI_Port;
Incoming : out UInt8);
procedure Transmit_Receive
(This : in out SPI_Port;
Outgoing : UInt8_Buffer;
Incoming : out UInt8_Buffer;
Size : Positive);
procedure Transmit_Receive
(This : in out SPI_Port;
Outgoing : UInt8;
Incoming : out UInt8);
-- TODO: add the other higher-level HAL routines for interrupts and DMA
function Data_Register_Address
(This : SPI_Port)
return System.Address;
-- For DMA transfer
private
type Internal_SPI_Port is new STM32_SVD.SPI.SPI_Peripheral;
type SPI_Port (Periph : not null access Internal_SPI_Port) is
limited new HAL.SPI.SPI_Port with null record;
procedure Send_Receive_16bit_Mode
(This : in out SPI_Port;
Outgoing : UInt8_Buffer;
Incoming : out UInt8_Buffer;
Size : Positive);
procedure Send_Receive_8bit_Mode
(This : in out SPI_Port;
Outgoing : UInt8_Buffer;
Incoming : out UInt8_Buffer;
Size : Positive);
procedure Send_16bit_Mode
(This : in out SPI_Port;
Outgoing : HAL.SPI.SPI_Data_16b);
procedure Send_8bit_Mode
(This : in out SPI_Port;
Outgoing : HAL.SPI.SPI_Data_8b);
procedure Receive_16bit_Mode
(This : in out SPI_Port;
Incoming : out HAL.SPI.SPI_Data_16b);
procedure Receive_8bit_Mode
(This : in out SPI_Port;
Incoming : out HAL.SPI.SPI_Data_8b);
end STM32.SPI;
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Localization, Internationalization, Globalization for Ada --
-- --
-- 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$
------------------------------------------------------------------------------
with Matreshka.Atomics.Counters;
with Matreshka.Internals.Strings;
package Matreshka.Internals.String_Vectors is
pragma Preelaborate;
type String_Vector_Index is mod 2 ** 32;
for String_Vector_Index'Size use 32;
type Shared_String_Array is
array (String_Vector_Index range <>)
of Matreshka.Internals.Strings.Shared_String_Access;
type Shared_String_Vector (Last : String_Vector_Index) is limited record
Counter : Matreshka.Atomics.Counters.Counter;
-- Atomic reference counter.
Unused : String_Vector_Index := 0;
-- Length of the actual data.
Value : Shared_String_Array (0 .. Last);
end record;
type Shared_String_Vector_Access is access all Shared_String_Vector;
Empty_Shared_String_Vector : aliased Shared_String_Vector (0);
procedure Reference (Item : Shared_String_Vector_Access);
pragma Inline (Reference);
pragma Inline_Always (Reference);
-- Increment reference counter. Change of reference counter of
-- Empty_Shared_String_Vector object is prevented to provide speedup
-- and to allow to use it to initialize components of
-- Preelaborateable_Initialization types.
procedure Dereference (Item : in out Shared_String_Vector_Access);
-- Decrement reference counter and free resources if it reach zero value.
-- Self is setted to null. Decrement of reference counter and deallocation
-- of Empty_Shared_String_Vector object is prevented to provide minor
-- speedup and to allow use it to initialize components of
-- Preelaborateable_Initialization types.
function Allocate
(Size : String_Vector_Index) return not null Shared_String_Vector_Access;
-- Allocates new instance of string with specified size. Actual size of the
-- allocated string can be greater. This subprogram must not be called with
-- zero argument.
procedure Detach
(Item : in out Shared_String_Vector_Access;
Size : String_Vector_Index);
-- Detach specified shared string vector. If reference counter equal to
-- one, shared string vector is not an empty shared string vector object
-- and its current size is sufficient to store specified number of strings
-- then to nothing. Otherwise, allocates new shared string vector and
-- copy existing data.
procedure Append
(Item : in out Shared_String_Vector_Access;
String : not null Matreshka.Internals.Strings.Shared_String_Access);
-- Append string to the vector, reallocate vector then necessary. String's
-- reference counter is not incremented.
procedure Prepend
(Self : in out Shared_String_Vector_Access;
Vector : not null Shared_String_Vector_Access);
-- Prepends strings from vector to the vector, reallocates vector then
-- necessary. Both vectors are still valid after this operation, reference
-- counters of all prepended strings are incremented.
procedure Replace
(Self : in out Shared_String_Vector_Access;
Index : String_Vector_Index;
Item : not null Matreshka.Internals.Strings.Shared_String_Access);
-- Replace string at the specified position by another one.
procedure Insert
(Self : in out Shared_String_Vector_Access;
Index : String_Vector_Index;
Item : not null Matreshka.Internals.Strings.Shared_String_Access);
-- Inserts string into the specified position.
end Matreshka.Internals.String_Vectors;
|
------------------------------------------------------------------------------
-- --
-- GNAT LIBRARY COMPONENTS --
-- --
-- A D A . C O N T A I N E R S . --
-- G E N E R I C _ A N O N Y M O U S _ A R R A Y _ S O R T --
-- --
-- S p e c --
-- --
-- Copyright (C) 2004-2006, 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. --
-- --
-- This unit was originally developed by Matthew J Heaney. --
------------------------------------------------------------------------------
generic
type Index_Type is (<>);
with function Less (Left, Right : Index_Type) return Boolean is <>;
with procedure Swap (Left, Right : Index_Type) is <>;
procedure Ada.Containers.Generic_Anonymous_Array_Sort
(First, Last : Index_Type'Base);
pragma Pure (Ada.Containers.Generic_Anonymous_Array_Sort);
|
--
-- Copyright (c) 2015, John Leimon <jleimon@gmail.com>
--
-- 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 Ada_2005;
pragma Style_Checks (Off);
with Interfaces.C; use Interfaces.C;
with System;
with Interfaces.C.Strings;
package xlocale_h is
type uu_locale_struct_uu_locales_array is array (0 .. 12) of System.Address;
type uu_locale_struct_uu_names_array is array (0 .. 12) of Interfaces.C.Strings.chars_ptr;
type uu_locale_struct is record
uu_locales : aliased uu_locale_struct_uu_locales_array; -- /usr/include/xlocale.h:30
uu_ctype_b : access unsigned_short; -- /usr/include/xlocale.h:33
uu_ctype_tolower : access int; -- /usr/include/xlocale.h:34
uu_ctype_toupper : access int; -- /usr/include/xlocale.h:35
uu_names : aliased uu_locale_struct_uu_names_array; -- /usr/include/xlocale.h:38
end record;
pragma Convention (C_Pass_By_Copy, uu_locale_struct); -- /usr/include/xlocale.h:27
-- skipped empty struct uu_locale_data
type uu_locale_t is access all uu_locale_struct; -- /usr/include/xlocale.h:39
subtype locale_t is uu_locale_t; -- /usr/include/xlocale.h:42
end xlocale_h;
|
------------------------------------------------------------------------------
-- --
-- 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$
------------------------------------------------------------------------------
with AMF.Internals.Element_Collections;
with AMF.Internals.Helpers;
with AMF.Internals.Tables.UML_Attributes;
with AMF.Visitors.UML_Iterators;
with AMF.Visitors.UML_Visitors;
with League.Strings.Internals;
with Matreshka.Internals.Strings;
package body AMF.Internals.UML_Images is
-------------------
-- Enter_Element --
-------------------
overriding procedure Enter_Element
(Self : not null access constant UML_Image_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control) is
begin
if Visitor in AMF.Visitors.UML_Visitors.UML_Visitor'Class then
AMF.Visitors.UML_Visitors.UML_Visitor'Class
(Visitor).Enter_Image
(AMF.UML.Images.UML_Image_Access (Self),
Control);
end if;
end Enter_Element;
-------------------
-- Leave_Element --
-------------------
overriding procedure Leave_Element
(Self : not null access constant UML_Image_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control) is
begin
if Visitor in AMF.Visitors.UML_Visitors.UML_Visitor'Class then
AMF.Visitors.UML_Visitors.UML_Visitor'Class
(Visitor).Leave_Image
(AMF.UML.Images.UML_Image_Access (Self),
Control);
end if;
end Leave_Element;
-------------------
-- Visit_Element --
-------------------
overriding procedure Visit_Element
(Self : not null access constant UML_Image_Proxy;
Iterator : in out AMF.Visitors.Abstract_Iterator'Class;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control) is
begin
if Iterator in AMF.Visitors.UML_Iterators.UML_Iterator'Class then
AMF.Visitors.UML_Iterators.UML_Iterator'Class
(Iterator).Visit_Image
(Visitor,
AMF.UML.Images.UML_Image_Access (Self),
Control);
end if;
end Visit_Element;
-----------------
-- Get_Content --
-----------------
overriding function Get_Content
(Self : not null access constant UML_Image_Proxy)
return AMF.Optional_String is
begin
declare
use type Matreshka.Internals.Strings.Shared_String_Access;
Aux : constant Matreshka.Internals.Strings.Shared_String_Access
:= AMF.Internals.Tables.UML_Attributes.Internal_Get_Content (Self.Element);
begin
if Aux = null then
return (Is_Empty => True);
else
return (False, League.Strings.Internals.Create (Aux));
end if;
end;
end Get_Content;
-----------------
-- Set_Content --
-----------------
overriding procedure Set_Content
(Self : not null access UML_Image_Proxy;
To : AMF.Optional_String) is
begin
if To.Is_Empty then
AMF.Internals.Tables.UML_Attributes.Internal_Set_Content
(Self.Element, null);
else
AMF.Internals.Tables.UML_Attributes.Internal_Set_Content
(Self.Element,
League.Strings.Internals.Internal (To.Value));
end if;
end Set_Content;
----------------
-- Get_Format --
----------------
overriding function Get_Format
(Self : not null access constant UML_Image_Proxy)
return AMF.Optional_String is
begin
declare
use type Matreshka.Internals.Strings.Shared_String_Access;
Aux : constant Matreshka.Internals.Strings.Shared_String_Access
:= AMF.Internals.Tables.UML_Attributes.Internal_Get_Format (Self.Element);
begin
if Aux = null then
return (Is_Empty => True);
else
return (False, League.Strings.Internals.Create (Aux));
end if;
end;
end Get_Format;
----------------
-- Set_Format --
----------------
overriding procedure Set_Format
(Self : not null access UML_Image_Proxy;
To : AMF.Optional_String) is
begin
if To.Is_Empty then
AMF.Internals.Tables.UML_Attributes.Internal_Set_Format
(Self.Element, null);
else
AMF.Internals.Tables.UML_Attributes.Internal_Set_Format
(Self.Element,
League.Strings.Internals.Internal (To.Value));
end if;
end Set_Format;
------------------
-- Get_Location --
------------------
overriding function Get_Location
(Self : not null access constant UML_Image_Proxy)
return AMF.Optional_String is
begin
declare
use type Matreshka.Internals.Strings.Shared_String_Access;
Aux : constant Matreshka.Internals.Strings.Shared_String_Access
:= AMF.Internals.Tables.UML_Attributes.Internal_Get_Location (Self.Element);
begin
if Aux = null then
return (Is_Empty => True);
else
return (False, League.Strings.Internals.Create (Aux));
end if;
end;
end Get_Location;
------------------
-- Set_Location --
------------------
overriding procedure Set_Location
(Self : not null access UML_Image_Proxy;
To : AMF.Optional_String) is
begin
if To.Is_Empty then
AMF.Internals.Tables.UML_Attributes.Internal_Set_Location
(Self.Element, null);
else
AMF.Internals.Tables.UML_Attributes.Internal_Set_Location
(Self.Element,
League.Strings.Internals.Internal (To.Value));
end if;
end Set_Location;
end AMF.Internals.UML_Images;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . W I D _ E N U M --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2009, 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.Unchecked_Conversion;
package body System.Wid_Enum is
-------------------------
-- Width_Enumeration_8 --
-------------------------
function Width_Enumeration_8
(Names : String;
Indexes : System.Address;
Lo, Hi : Natural)
return Natural
is
pragma Warnings (Off, Names);
W : Natural;
type Natural_8 is range 0 .. 2 ** 7 - 1;
type Index_Table is array (Natural) of Natural_8;
type Index_Table_Ptr is access Index_Table;
function To_Index_Table_Ptr is
new Ada.Unchecked_Conversion (System.Address, Index_Table_Ptr);
IndexesT : constant Index_Table_Ptr := To_Index_Table_Ptr (Indexes);
begin
W := 0;
for J in Lo .. Hi loop
W := Natural'Max (W, Natural (IndexesT (J + 1) - IndexesT (J)));
end loop;
return W;
end Width_Enumeration_8;
--------------------------
-- Width_Enumeration_16 --
--------------------------
function Width_Enumeration_16
(Names : String;
Indexes : System.Address;
Lo, Hi : Natural)
return Natural
is
pragma Warnings (Off, Names);
W : Natural;
type Natural_16 is range 0 .. 2 ** 15 - 1;
type Index_Table is array (Natural) of Natural_16;
type Index_Table_Ptr is access Index_Table;
function To_Index_Table_Ptr is
new Ada.Unchecked_Conversion (System.Address, Index_Table_Ptr);
IndexesT : constant Index_Table_Ptr := To_Index_Table_Ptr (Indexes);
begin
W := 0;
for J in Lo .. Hi loop
W := Natural'Max (W, Natural (IndexesT (J + 1) - IndexesT (J)));
end loop;
return W;
end Width_Enumeration_16;
--------------------------
-- Width_Enumeration_32 --
--------------------------
function Width_Enumeration_32
(Names : String;
Indexes : System.Address;
Lo, Hi : Natural)
return Natural
is
pragma Warnings (Off, Names);
W : Natural;
type Natural_32 is range 0 .. 2 ** 31 - 1;
type Index_Table is array (Natural) of Natural_32;
type Index_Table_Ptr is access Index_Table;
function To_Index_Table_Ptr is
new Ada.Unchecked_Conversion (System.Address, Index_Table_Ptr);
IndexesT : constant Index_Table_Ptr := To_Index_Table_Ptr (Indexes);
begin
W := 0;
for J in Lo .. Hi loop
W := Natural'Max (W, Natural (IndexesT (J + 1) - IndexesT (J)));
end loop;
return W;
end Width_Enumeration_32;
end System.Wid_Enum;
|
-- Copyright (c) 2020-2021 Bartek thindil Jasicki <thindil@laeran.pl>
--
-- 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/>.
-- ****h* GameOptions/GameOptions
-- FUNCTION
-- Provide code to set the game options
-- SOURCE
package GameOptions is
-- ****
-- ****f* GameOptions/GameOptions.AddCommands
-- FUNCTION
-- Add Tcl commands related to the game options
-- SOURCE
procedure AddCommands;
-- ****
end GameOptions;
|
------------------------------------------------------------------------------
-- --
-- GNAT EXAMPLE --
-- --
-- Copyright (C) 2013, 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 Cache; use Cache;
with System.Machine_Code; use System.Machine_Code;
with Flash;
package body Memwrite is
Invalid_Addr : constant Unsigned_32 := 1;
-- An invalid address to mark the buffer as uninitialized.
Buffer_Addr : Unsigned_32 := Invalid_Addr;
-- Address at which the buffer must be written in memory. Use Invalid_Addr
-- to mark the address invalid (in that case the buffer is considered as
-- empty).
Buffer_Len : constant := 32;
Addr_Mask : constant Unsigned_32 := not (Buffer_Len - 1);
Buffer : Storage_Array (0 .. Storage_Count (Buffer_Len - 1));
for Buffer'Alignment use 4;
-- Buffer of data to be written at Buffer_Addr
procedure Init is
begin
Buffer_Addr := Invalid_Addr;
Buffer := (others => 16#ff#);
end Init;
procedure Flush is
use Flash;
Off : Unsigned_32;
Off1 : Storage_Count;
In_Flash : constant Boolean := Flash.In_Flash (Buffer_Addr);
begin
if In_Flash then
-- Invalidate corresponding cache entries (if any).
-- Note that the flash is cache inhibited when unlocked
Off := 0;
while Off < Buffer'Length loop
Asm ("dcbi 0,%0",
Inputs => Unsigned_32'Asm_Input ("r", Buffer_Addr + Off),
Volatile => True);
Off := Off + Cache.Cache_Line;
end loop;
Flash_Start_Prog;
end if;
-- Write buffer. Copy per word, for FLASH.
Off1 := 0;
while Off1 < Storage_Count (Buffer_Len) loop
declare
D : Unsigned_32;
for D'Address use
System'To_Address (Buffer_Addr + Unsigned_32 (Off1));
pragma Import (Ada, D);
pragma Volatile (D);
pragma Warnings (Off, "specified address*");
S : Unsigned_32;
for S'Address use Buffer (Off1)'Address;
pragma Warnings (On, "specified address*");
begin
D := S;
end;
Off1 := Off1 + 4;
end loop;
if In_Flash then
Flash_Wait_Prog;
end if;
Buffer := (others => 16#ff#);
-- Flush and sync caches
-- Not strictly needed on mpc5566, as the cache is unified
Cache.Cache_Flush_Range
(System'To_Address (Buffer_Addr),
System'To_Address (Buffer_Addr + Buffer_Len - 1));
end Flush;
procedure Write (Addr : Unsigned_32; Content : Storage_Array) is
Cur_Addr : Unsigned_32 := Addr;
begin
for I in Content'Range loop
if Buffer_Addr = Invalid_Addr then
Buffer_Addr := Cur_Addr and Addr_Mask;
elsif (Buffer_Addr and Addr_Mask) /= (Cur_Addr and Addr_Mask) then
Flush;
Buffer_Addr := Cur_Addr and Addr_Mask;
end if;
Buffer (Storage_Count (Cur_Addr and not Addr_Mask)) := Content (I);
Cur_Addr := Cur_Addr + 1;
end loop;
end Write;
end Memwrite;
|
WITH P_StepHandler;
USE P_StepHandler;
with P_StructuralTypes;
use P_StructuralTypes;
with Ada.Streams;
use Ada.Streams;
package P_StepHandler.InputHandler is
type InputHandler is new T_StepHandler with private;
type Ptr_InputHandler is access InputHandler;
--- CONSTRUCTOR ---
function Make (Self : in out InputHandler;
File_Name : in Unbounded_String) return InputHandler;
--- PROCEDURE ---
procedure Handle (Self : in out InputHandler);
--- GETTER ---
function Get_Input_Size (Self : in InputHandler) return Integer;
function Get_PaddingBitsNumber (Self : in InputHandler) return Integer;
procedure Set_Input_Length (Self : in out InputHandler;
Length : in Integer);
procedure Set_Input_Size (Self : in out InputHandler ; Size : in Integer);
PRIVATE
type InputHandler is new P_StepHandler.T_StepHandler with record
Key : T_Key;
Input_Length : Integer := 0;
Input_Size : Integer := 0;
Input_Name : Unbounded_String;
PaddingBitsNumber : Integer := 0;
end record;
end P_StepHandler.InputHandler;
|
with STM32_SVD.GPIO;
with STM32GD.EXTI;
with STM32GD.GPIO.Pin;
generic
with package Pin is new STM32GD.GPIO.Pin (<>);
package STM32GD.GPIO.IRQ is
pragma Preelaborate;
procedure Connect_External_Interrupt;
function Interrupt_Line_Number return STM32GD.EXTI.External_Line_Number;
procedure Configure_Trigger (Trigger : STM32GD.EXTI.External_Triggers);
procedure Wait_For_Trigger;
procedure Clear_Trigger;
function Triggered return Boolean;
procedure Cancel_Wait;
end STM32GD.GPIO.IRQ;
|
--------------------------------------------------------------------------------
-- Copyright (C) 2020 by Heisenbug Ltd. (gh+owm@heisenbug.eu)
--
-- This work is free. You can redistribute it and/or modify it under the
-- terms of the Do What The Fuck You Want To Public License, Version 2,
-- as published by Sam Hocevar. See the LICENSE file for more details.
--------------------------------------------------------------------------------
pragma License (Unrestricted);
with Ada.Characters.Latin_1;
with Ada.Text_IO;
with AWS.Client;
with AWS.Messages;
with AWS.Response;
with GNATCOLL.JSON;
package body Open_Weather_Map.API.Service is
My_Debug : constant not null GNATCOLL.Traces.Trace_Handle :=
GNATCOLL.Traces.Create (Unit_Name => "OWM.API.SERVICE");
use type Ada.Real_Time.Time;
-----------------------------------------------------------------------------
-- Initialize
-----------------------------------------------------------------------------
procedure Initialize
(Self : out T;
Configuration : in GNATCOLL.JSON.JSON_Value;
Connection : not null Client.T_Access;
Max_Cache_Interval : in Ada.Real_Time.Time_Span := Default_Cache_Interval;
For_API_Service : in API_Services) is
begin
My_Debug.all.Trace (Message => "Initialize");
-- inherited initialization
Query.T (Self).Initialize;
-- initialization of added fields
Self.Server_Connection := Connection;
Self.Cache_Interval := Max_Cache_Interval;
-- initialization of added fields.
Get_API_Key :
declare
pragma Assertion_Policy (Dynamic_Predicate => Check);
-- Force type predicate check on API key type.
begin
My_Debug.all.Trace (Message => "Initialize: Loading API key...");
Self.Key := Configuration.Get (Field => Config_Names.Field_API_Key);
My_Debug.all.Trace (Message => "Initialize: API key loaded.");
exception
when E : others =>
My_Debug.all.Trace
(E => E,
Msg => "Initialize: Error parsing configuration data: ");
Ada.Text_IO.Put_Line
(File => Ada.Text_IO.Standard_Error,
Item =>
"Warning: Missing or invalid JSON data, " &
"API key configuration is invalid.");
Self.Key := Invalid_API_Key;
-- Force API key to invalid, yet satisfy the type predicate.
end Get_API_Key;
Self.Service := For_API_Service;
end Initialize;
-----------------------------------------------------------------------------
-- Perform_Query
-----------------------------------------------------------------------------
overriding procedure Perform_Query (Self : in out T;
Current : in out Data_Set)
is
Now : constant Ada.Real_Time.Time := Ada.Real_Time.Clock;
URI : constant String := T'Class (Self).Service_URI;
begin
My_Debug.all.Trace (Message => "Query");
if
T'Class (Self).Last_Query + T'Class (Self).Cache_Interval < Now
then
My_Debug.all.Trace
(Message => "Query: Firing query: """ & API_Host & URI & """");
Do_HTTP_Query :
declare
Response : AWS.Response.Data;
begin
AWS.Client.Get
(Connection => Self.Server_Connection.all.Connection.all,
URI => URI & "&appid=" & T'Class (Self).Key,
Result => Response);
declare
Status_Code : constant AWS.Messages.Status_Code :=
AWS.Response.Status_Code (D => Response);
begin
if Status_Code in AWS.Messages.Success then
My_Debug.all.Trace
(Message =>
"Query: Succeeded (" &
AWS.Messages.Image (S => Status_Code) & "/" &
AWS.Messages.Reason_Phrase (S => Status_Code) & ")");
T'Class (Self).Set_Last_Query (Value => Now);
-- Mark retrieval of data.
-- Decode retrieved JSON data.
declare
Content : constant String :=
AWS.Response.Message_Body (D => Response);
begin
My_Debug.all.Trace
(Message =>
"Query: Received response: " &
Ada.Characters.Latin_1.LF &
"""" & Content & """");
declare
Read_Result : constant GNATCOLL.JSON.Read_Result :=
GNATCOLL.JSON.Read (Strm => Content);
begin
if Read_Result.Success then
Current :=
T'Class (Self).Decode_Response
(Root => Read_Result.Value);
else
Report_Error :
declare
Error_Msg : constant String :=
GNATCOLL.JSON.Format_Parsing_Error
(Error => Read_Result.Error);
begin
My_Debug.all.Trace
(Message => "Query: " & Error_Msg);
Ada.Text_IO.Put_Line
(File => Ada.Text_IO.Standard_Error,
Item =>
"Error parsing response: " & Error_Msg);
end Report_Error;
end if;
end;
end;
else
-- Error retrieving network data.
My_Debug.all.Trace
(Message =>
"Query: Failed (" & AWS.Messages.Image (Status_Code) &
"/" & AWS.Messages.Reason_Phrase (Status_Code) & ")");
Ada.Text_IO.Put_Line
(File => Ada.Text_IO.Standard_Error,
Item =>
"API query failed: " &
AWS.Messages.Image (Status_Code) & "/" &
AWS.Messages.Reason_Phrase (S => Status_Code) & ".");
end if;
end;
end Do_HTTP_Query;
else
My_Debug.all.Trace
(Message => "Query: Within cache interval, nothing to do.");
end if;
end Perform_Query;
-----------------------------------------------------------------------------
-- Service_URI
-----------------------------------------------------------------------------
function Service_URI (This : in T) return String
is
Result : constant String :=
API_Path & To_Service_Name (This.Service) & This.Parameters.URI_Format;
begin
My_Debug.all.Trace (Message => "Service_URI: " & Result);
return Result;
end Service_URI;
-----------------------------------------------------------------------------
-- Set_Cache_Interval
-----------------------------------------------------------------------------
procedure Set_Cache_Interval
(Self : in out T;
Max_Cache_Interval : in Ada.Real_Time.Time_Span) is
begin
My_Debug.all.Trace (Message => "Set_Cache_Interval");
Self.Cache_Interval := Max_Cache_Interval;
end Set_Cache_Interval;
end Open_Weather_Map.API.Service;
|
------------------------------------------------------------------------------
-- G E L A A S I S --
-- ASIS implementation for Gela project, a portable Ada compiler --
-- http://gela.ada-ru.org --
-- - - - - - - - - - - - - - - - --
-- Read copyright and license at the end of this file --
------------------------------------------------------------------------------
-- $Revision: 209 $ $Date: 2013-11-30 21:03:24 +0200 (Сб., 30 нояб. 2013) $
with Gela.Source_Buffers.Strings;
with Gela.Character_Class_Buffers;
package body Gela.Classificators.Fixed_Width_8 is
----------------
-- Initialize --
----------------
procedure Initialize
(Object : out Classificator;
Decoder : in Decoders.Decoder'Class)
is
use Gela.Source_Buffers;
Input : Strings.Source_Buffer;
Trivial : String (1 .. 256);
Plain : Wide_String (Trivial'Range);
Last : Natural;
From : Cursor;
To : Cursor;
begin
for J in Trivial'Range loop
Trivial (J) := Code_Unit'Val (J - 1);
end loop;
Strings.Initialize (Input, Trivial);
From := Strings.Buffer_Start (Input);
To := From;
loop
Next (To);
exit when Element (To) = End_Of_File;
end loop;
Decoders.Decode (Decoder, From, To, Plain, Last);
for J in Plain'Range loop
Object.Table (Code_Unit'Val (J - 1)) :=
To_Character_Class (Wide_Character'Pos (Plain (J)));
end loop;
Strings.Clear (Input);
end Initialize;
----------
-- Read --
----------
procedure Read
(Object : in out Classificator;
Input : in out Source_Buffers.Cursor;
Buffer : in out Character_Class_Buffers.Character_Class_Buffer)
is
use Gela.Source_Buffers;
use Gela.Character_Class_Buffers;
Full : Boolean;
Item : Code_Unit;
Class : Character_Class;
begin
loop
Item := Element (Input);
Class := Object.Table (Item);
Put (Buffer, Class, Full);
exit when Item = End_Of_File;
Next (Input);
if Full then
Put (Buffer, End_Of_Buffer, Full);
return;
end if;
end loop;
end Read;
end Gela.Classificators.Fixed_Width_8;
------------------------------------------------------------------------------
-- Copyright (c) 2008, Maxim Reznik
-- 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 Maxim Reznik, 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 OWNER 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.
--
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
-- --
-- Giza --
-- --
-- Copyright (C) 2016 Fabien Chouteau (chouteau@adacore.com) --
-- --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- 2. 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. --
-- 3. Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- This package provides Image bitmap implementation formated for STM32 DMA2D
-- hardware acceleration. A slow copy these bitmaps is supported in the
-- default backend so they can be used on any platform.
with Giza.Image;
with Giza.Colors;
package Giza.Image.DMA2D is
type Color_Mode is (RGB888, L8, L4);
type Unsigned_4 is mod 2**4 with Size => 4;
type Unsigned_8 is mod 2**8 with Size => 8;
type DMA2D_Color is record
R : Unsigned_8;
G : Unsigned_8;
B : Unsigned_8;
end record;
for DMA2D_Color use record
B at 0 range 0 .. 7;
G at 1 range 0 .. 7;
R at 2 range 0 .. 7;
end record;
type L8_CLUT_T is array (Unsigned_8) of DMA2D_Color with Pack;
type L4_CLUT_T is array (Unsigned_4) of DMA2D_Color with Pack;
type L8_CLUT_Acces_Const is access constant L8_CLUT_T;
type L4_CLUT_Acces_Const is access constant L4_CLUT_T;
type L8_Data_T is array (Natural range <>) of Unsigned_8 with Pack;
type L4_Data_T is array (Natural range <>) of Unsigned_8 with Pack;
type RGB888_Data_T is array (Natural range <>) of DMA2D_Color with Pack;
type L8_Data_Access_Const is access constant L8_Data_T;
type L4_Data_Access_Const is access constant L4_Data_T;
type RGB888_Data_Access_Const is access constant RGB888_Data_T;
subtype Parent is Giza.Image.Instance;
type Instance (Mode : Color_Mode;
Length, W, H : Natural) is new Parent with
record
case Mode is
when RGB888 =>
RGB888_Data : not null RGB888_Data_Access_Const;
when L4 =>
L4_CLUT : not null L4_CLUT_Acces_Const;
L4_Data : not null L4_Data_Access_Const;
when L8 =>
L8_CLUT : not null L8_CLUT_Acces_Const;
L8_Data : not null L8_Data_Access_Const;
end case;
end record;
subtype Class is Instance'Class;
type Ref is access all Class;
overriding
function Size (This : Instance) return Size_T;
function To_Giza_Color (C : DMA2D_Color) return Giza.Colors.Color
with Inline_Always;
function Get_Pixel (This : Instance; Pt : Point_T) return DMA2D_Color
with Pre => Pt.X in 0 .. (This.W - 1) and then Pt.Y in 0 .. (This.W - 1);
function Get_Pixel (This : Instance; Pt : Point_T) return Giza.Colors.Color
with Pre => Pt.X in 0 .. (This.W - 1) and then Pt.Y in 0 .. (This.W - 1);
end Giza.Image.DMA2D;
|
package body Hailstones is
function Create_Sequence (N : Positive) return Integer_Sequence is
begin
if N = 1 then
-- terminate
return (1 => N);
elsif N mod 2 = 0 then
-- even
return (1 => N) & Create_Sequence (N / 2);
else
-- odd
return (1 => N) & Create_Sequence (3 * N + 1);
end if;
end Create_Sequence;
end Hailstones;
|
-- Generated by a script from an "avr tools device file" (atdf)
with SAM.Port; use SAM.Port;
package SAM.Functions is
PA04_AC_AIN0 : constant Peripheral_Function := B;
PA05_AC_AIN1 : constant Peripheral_Function := B;
PA06_AC_AIN2 : constant Peripheral_Function := B;
PA07_AC_AIN3 : constant Peripheral_Function := B;
PA12_AC_CMP0 : constant Peripheral_Function := M;
PA18_AC_CMP0 : constant Peripheral_Function := M;
PA13_AC_CMP1 : constant Peripheral_Function := M;
PA19_AC_CMP1 : constant Peripheral_Function := M;
PA02_ADC0_AIN0 : constant Peripheral_Function := B;
PA03_ADC0_AIN1 : constant Peripheral_Function := B;
PB08_ADC0_AIN2 : constant Peripheral_Function := B;
PB09_ADC0_AIN3 : constant Peripheral_Function := B;
PA04_ADC0_AIN4 : constant Peripheral_Function := B;
PA05_ADC0_AIN5 : constant Peripheral_Function := B;
PA06_ADC0_AIN6 : constant Peripheral_Function := B;
PA07_ADC0_AIN7 : constant Peripheral_Function := B;
PA08_ADC0_AIN8 : constant Peripheral_Function := B;
PA09_ADC0_AIN9 : constant Peripheral_Function := B;
PA10_ADC0_AIN10 : constant Peripheral_Function := B;
PA11_ADC0_AIN11 : constant Peripheral_Function := B;
PB00_ADC0_AIN12 : constant Peripheral_Function := B;
PB01_ADC0_AIN13 : constant Peripheral_Function := B;
PB02_ADC0_AIN14 : constant Peripheral_Function := B;
PB03_ADC0_AIN15 : constant Peripheral_Function := B;
PA03_ADC0_X0 : constant Peripheral_Function := B;
PA03_ADC0_Y0 : constant Peripheral_Function := B;
PB08_ADC0_X1 : constant Peripheral_Function := B;
PB08_ADC0_Y1 : constant Peripheral_Function := B;
PB09_ADC0_X2 : constant Peripheral_Function := B;
PB09_ADC0_Y2 : constant Peripheral_Function := B;
PA04_ADC0_X3 : constant Peripheral_Function := B;
PA04_ADC0_Y3 : constant Peripheral_Function := B;
PA06_ADC0_X4 : constant Peripheral_Function := B;
PA06_ADC0_Y4 : constant Peripheral_Function := B;
PA07_ADC0_X5 : constant Peripheral_Function := B;
PA07_ADC0_Y5 : constant Peripheral_Function := B;
PA08_ADC0_X6 : constant Peripheral_Function := B;
PA08_ADC0_Y6 : constant Peripheral_Function := B;
PA09_ADC0_X7 : constant Peripheral_Function := B;
PA09_ADC0_Y7 : constant Peripheral_Function := B;
PA10_ADC0_X8 : constant Peripheral_Function := B;
PA10_ADC0_Y8 : constant Peripheral_Function := B;
PA11_ADC0_X9 : constant Peripheral_Function := B;
PA11_ADC0_Y9 : constant Peripheral_Function := B;
PA16_ADC0_X10 : constant Peripheral_Function := B;
PA16_ADC0_Y10 : constant Peripheral_Function := B;
PA17_ADC0_X11 : constant Peripheral_Function := B;
PA17_ADC0_Y11 : constant Peripheral_Function := B;
PA18_ADC0_X12 : constant Peripheral_Function := B;
PA18_ADC0_Y12 : constant Peripheral_Function := B;
PA19_ADC0_X13 : constant Peripheral_Function := B;
PA19_ADC0_Y13 : constant Peripheral_Function := B;
PA20_ADC0_X14 : constant Peripheral_Function := B;
PA20_ADC0_Y14 : constant Peripheral_Function := B;
PA21_ADC0_X15 : constant Peripheral_Function := B;
PA21_ADC0_Y15 : constant Peripheral_Function := B;
PA22_ADC0_X16 : constant Peripheral_Function := B;
PA22_ADC0_Y16 : constant Peripheral_Function := B;
PA23_ADC0_X17 : constant Peripheral_Function := B;
PA23_ADC0_Y17 : constant Peripheral_Function := B;
PA27_ADC0_X18 : constant Peripheral_Function := B;
PA27_ADC0_Y18 : constant Peripheral_Function := B;
PA30_ADC0_X19 : constant Peripheral_Function := B;
PA30_ADC0_Y19 : constant Peripheral_Function := B;
PB02_ADC0_X20 : constant Peripheral_Function := B;
PB02_ADC0_Y20 : constant Peripheral_Function := B;
PB03_ADC0_X21 : constant Peripheral_Function := B;
PB03_ADC0_Y21 : constant Peripheral_Function := B;
PB04_ADC0_X22 : constant Peripheral_Function := B;
PB04_ADC0_Y22 : constant Peripheral_Function := B;
PB05_ADC0_X23 : constant Peripheral_Function := B;
PB05_ADC0_Y23 : constant Peripheral_Function := B;
PB06_ADC0_X24 : constant Peripheral_Function := B;
PB06_ADC0_Y24 : constant Peripheral_Function := B;
PB07_ADC0_X25 : constant Peripheral_Function := B;
PB07_ADC0_Y25 : constant Peripheral_Function := B;
PB12_ADC0_X26 : constant Peripheral_Function := B;
PB12_ADC0_Y26 : constant Peripheral_Function := B;
PB13_ADC0_X27 : constant Peripheral_Function := B;
PB13_ADC0_Y27 : constant Peripheral_Function := B;
PB14_ADC0_X28 : constant Peripheral_Function := B;
PB14_ADC0_Y28 : constant Peripheral_Function := B;
PB15_ADC0_X29 : constant Peripheral_Function := B;
PB15_ADC0_Y29 : constant Peripheral_Function := B;
PB00_ADC0_X30 : constant Peripheral_Function := B;
PB00_ADC0_Y30 : constant Peripheral_Function := B;
PB01_ADC0_X31 : constant Peripheral_Function := B;
PB01_ADC0_Y31 : constant Peripheral_Function := B;
PB08_ADC1_AIN0 : constant Peripheral_Function := B;
PB09_ADC1_AIN1 : constant Peripheral_Function := B;
PA08_ADC1_AIN2 : constant Peripheral_Function := B;
PA09_ADC1_AIN3 : constant Peripheral_Function := B;
PB04_ADC1_AIN6 : constant Peripheral_Function := B;
PB05_ADC1_AIN7 : constant Peripheral_Function := B;
PB06_ADC1_AIN8 : constant Peripheral_Function := B;
PB07_ADC1_AIN9 : constant Peripheral_Function := B;
PA04_CCL_IN0 : constant Peripheral_Function := N;
PA16_CCL_IN0 : constant Peripheral_Function := N;
PB22_CCL_IN0 : constant Peripheral_Function := N;
PA05_CCL_IN1 : constant Peripheral_Function := N;
PA17_CCL_IN1 : constant Peripheral_Function := N;
PB00_CCL_IN1 : constant Peripheral_Function := N;
PA06_CCL_IN2 : constant Peripheral_Function := N;
PA18_CCL_IN2 : constant Peripheral_Function := N;
PB01_CCL_IN2 : constant Peripheral_Function := N;
PA08_CCL_IN3 : constant Peripheral_Function := N;
PA30_CCL_IN3 : constant Peripheral_Function := N;
PA09_CCL_IN4 : constant Peripheral_Function := N;
PA10_CCL_IN5 : constant Peripheral_Function := N;
PA22_CCL_IN6 : constant Peripheral_Function := N;
PB06_CCL_IN6 : constant Peripheral_Function := N;
PA23_CCL_IN7 : constant Peripheral_Function := N;
PB07_CCL_IN7 : constant Peripheral_Function := N;
PA24_CCL_IN8 : constant Peripheral_Function := N;
PB08_CCL_IN8 : constant Peripheral_Function := N;
PB14_CCL_IN9 : constant Peripheral_Function := N;
PB15_CCL_IN10 : constant Peripheral_Function := N;
PB10_CCL_IN11 : constant Peripheral_Function := N;
PB16_CCL_IN11 : constant Peripheral_Function := N;
PA07_CCL_OUT0 : constant Peripheral_Function := N;
PA19_CCL_OUT0 : constant Peripheral_Function := N;
PB02_CCL_OUT0 : constant Peripheral_Function := N;
PB23_CCL_OUT0 : constant Peripheral_Function := N;
PA11_CCL_OUT1 : constant Peripheral_Function := N;
PA31_CCL_OUT1 : constant Peripheral_Function := N;
PB11_CCL_OUT1 : constant Peripheral_Function := N;
PA25_CCL_OUT2 : constant Peripheral_Function := N;
PB09_CCL_OUT2 : constant Peripheral_Function := N;
PB17_CCL_OUT3 : constant Peripheral_Function := N;
PA02_DAC_VOUT0 : constant Peripheral_Function := B;
PA05_DAC_VOUT1 : constant Peripheral_Function := B;
PA00_EIC_EXTINT0 : constant Peripheral_Function := A;
PA16_EIC_EXTINT0 : constant Peripheral_Function := A;
PB00_EIC_EXTINT0 : constant Peripheral_Function := A;
PB16_EIC_EXTINT0 : constant Peripheral_Function := A;
PA01_EIC_EXTINT1 : constant Peripheral_Function := A;
PA17_EIC_EXTINT1 : constant Peripheral_Function := A;
PB01_EIC_EXTINT1 : constant Peripheral_Function := A;
PB17_EIC_EXTINT1 : constant Peripheral_Function := A;
PA02_EIC_EXTINT2 : constant Peripheral_Function := A;
PA18_EIC_EXTINT2 : constant Peripheral_Function := A;
PB02_EIC_EXTINT2 : constant Peripheral_Function := A;
PA03_EIC_EXTINT3 : constant Peripheral_Function := A;
PA19_EIC_EXTINT3 : constant Peripheral_Function := A;
PB03_EIC_EXTINT3 : constant Peripheral_Function := A;
PA04_EIC_EXTINT4 : constant Peripheral_Function := A;
PA20_EIC_EXTINT4 : constant Peripheral_Function := A;
PB04_EIC_EXTINT4 : constant Peripheral_Function := A;
PA05_EIC_EXTINT5 : constant Peripheral_Function := A;
PA21_EIC_EXTINT5 : constant Peripheral_Function := A;
PB05_EIC_EXTINT5 : constant Peripheral_Function := A;
PA06_EIC_EXTINT6 : constant Peripheral_Function := A;
PA22_EIC_EXTINT6 : constant Peripheral_Function := A;
PB06_EIC_EXTINT6 : constant Peripheral_Function := A;
PB22_EIC_EXTINT6 : constant Peripheral_Function := A;
PA07_EIC_EXTINT7 : constant Peripheral_Function := A;
PA23_EIC_EXTINT7 : constant Peripheral_Function := A;
PB07_EIC_EXTINT7 : constant Peripheral_Function := A;
PB23_EIC_EXTINT7 : constant Peripheral_Function := A;
PA24_EIC_EXTINT8 : constant Peripheral_Function := A;
PB08_EIC_EXTINT8 : constant Peripheral_Function := A;
PA09_EIC_EXTINT9 : constant Peripheral_Function := A;
PA25_EIC_EXTINT9 : constant Peripheral_Function := A;
PB09_EIC_EXTINT9 : constant Peripheral_Function := A;
PA10_EIC_EXTINT10 : constant Peripheral_Function := A;
PB10_EIC_EXTINT10 : constant Peripheral_Function := A;
PA11_EIC_EXTINT11 : constant Peripheral_Function := A;
PA27_EIC_EXTINT11 : constant Peripheral_Function := A;
PB11_EIC_EXTINT11 : constant Peripheral_Function := A;
PA12_EIC_EXTINT12 : constant Peripheral_Function := A;
PB12_EIC_EXTINT12 : constant Peripheral_Function := A;
PA13_EIC_EXTINT13 : constant Peripheral_Function := A;
PB13_EIC_EXTINT13 : constant Peripheral_Function := A;
PA30_EIC_EXTINT14 : constant Peripheral_Function := A;
PB14_EIC_EXTINT14 : constant Peripheral_Function := A;
PB30_EIC_EXTINT14 : constant Peripheral_Function := A;
PA14_EIC_EXTINT14 : constant Peripheral_Function := A;
PA15_EIC_EXTINT15 : constant Peripheral_Function := A;
PA31_EIC_EXTINT15 : constant Peripheral_Function := A;
PB15_EIC_EXTINT15 : constant Peripheral_Function := A;
PB31_EIC_EXTINT15 : constant Peripheral_Function := A;
PA08_EIC_NMI : constant Peripheral_Function := A;
PA30_GCLK_IO0 : constant Peripheral_Function := M;
PB14_GCLK_IO0 : constant Peripheral_Function := M;
PA14_GCLK_IO0 : constant Peripheral_Function := M;
PB22_GCLK_IO0 : constant Peripheral_Function := M;
PB15_GCLK_IO1 : constant Peripheral_Function := M;
PA15_GCLK_IO1 : constant Peripheral_Function := M;
PB23_GCLK_IO1 : constant Peripheral_Function := M;
PA27_GCLK_IO1 : constant Peripheral_Function := M;
PA16_GCLK_IO2 : constant Peripheral_Function := M;
PB16_GCLK_IO2 : constant Peripheral_Function := M;
PA17_GCLK_IO3 : constant Peripheral_Function := M;
PB17_GCLK_IO3 : constant Peripheral_Function := M;
PA10_GCLK_IO4 : constant Peripheral_Function := M;
PB10_GCLK_IO4 : constant Peripheral_Function := M;
PA11_GCLK_IO5 : constant Peripheral_Function := M;
PB11_GCLK_IO5 : constant Peripheral_Function := M;
PB12_GCLK_IO6 : constant Peripheral_Function := M;
PB13_GCLK_IO7 : constant Peripheral_Function := M;
PA09_I2S_FS0 : constant Peripheral_Function := J;
PA20_I2S_FS0 : constant Peripheral_Function := J;
PA23_I2S_FS1 : constant Peripheral_Function := J;
PB11_I2S_FS1 : constant Peripheral_Function := J;
PA08_I2S_MCK0 : constant Peripheral_Function := J;
PB17_I2S_MCK0 : constant Peripheral_Function := J;
PB13_I2S_MCK1 : constant Peripheral_Function := J;
PA10_I2S_SCK0 : constant Peripheral_Function := J;
PB16_I2S_SCK0 : constant Peripheral_Function := J;
PB12_I2S_SCK1 : constant Peripheral_Function := J;
PA22_I2S_SDI : constant Peripheral_Function := J;
PB10_I2S_SDI : constant Peripheral_Function := J;
PA11_I2S_SDO : constant Peripheral_Function := J;
PA21_I2S_SDO : constant Peripheral_Function := J;
PA14_PCC_CLK : constant Peripheral_Function := K;
PA16_PCC_DATA0 : constant Peripheral_Function := K;
PA17_PCC_DATA1 : constant Peripheral_Function := K;
PA18_PCC_DATA2 : constant Peripheral_Function := K;
PA19_PCC_DATA3 : constant Peripheral_Function := K;
PA20_PCC_DATA4 : constant Peripheral_Function := K;
PA21_PCC_DATA5 : constant Peripheral_Function := K;
PA22_PCC_DATA6 : constant Peripheral_Function := K;
PA23_PCC_DATA7 : constant Peripheral_Function := K;
PB14_PCC_DATA8 : constant Peripheral_Function := K;
PB15_PCC_DATA9 : constant Peripheral_Function := K;
PA12_PCC_DEN1 : constant Peripheral_Function := K;
PA13_PCC_DEN2 : constant Peripheral_Function := K;
PB23_PDEC_QDI0 : constant Peripheral_Function := G;
PA24_PDEC_QDI0 : constant Peripheral_Function := G;
PA25_PDEC_QDI1 : constant Peripheral_Function := G;
PB22_PDEC_QDI2 : constant Peripheral_Function := G;
PB11_QSPI_CS : constant Peripheral_Function := H;
PA08_QSPI_DATA0 : constant Peripheral_Function := H;
PA09_QSPI_DATA1 : constant Peripheral_Function := H;
PA10_QSPI_DATA2 : constant Peripheral_Function := H;
PA11_QSPI_DATA3 : constant Peripheral_Function := H;
PB10_QSPI_SCK : constant Peripheral_Function := H;
PA06_SDHC0_SDCD : constant Peripheral_Function := I;
PA12_SDHC0_SDCD : constant Peripheral_Function := I;
PB12_SDHC0_SDCD : constant Peripheral_Function := I;
PB11_SDHC0_SDCK : constant Peripheral_Function := I;
PA08_SDHC0_SDCMD : constant Peripheral_Function := I;
PA09_SDHC0_SDDAT0 : constant Peripheral_Function := I;
PA10_SDHC0_SDDAT1 : constant Peripheral_Function := I;
PA11_SDHC0_SDDAT2 : constant Peripheral_Function := I;
PB10_SDHC0_SDDAT3 : constant Peripheral_Function := I;
PA07_SDHC0_SDWP : constant Peripheral_Function := I;
PA13_SDHC0_SDWP : constant Peripheral_Function := I;
PB13_SDHC0_SDWP : constant Peripheral_Function := I;
PA04_SERCOM0_PAD0 : constant Peripheral_Function := D;
PA08_SERCOM0_PAD0 : constant Peripheral_Function := C;
PA05_SERCOM0_PAD1 : constant Peripheral_Function := D;
PA09_SERCOM0_PAD1 : constant Peripheral_Function := C;
PA06_SERCOM0_PAD2 : constant Peripheral_Function := D;
PA10_SERCOM0_PAD2 : constant Peripheral_Function := C;
PA07_SERCOM0_PAD3 : constant Peripheral_Function := D;
PA11_SERCOM0_PAD3 : constant Peripheral_Function := C;
PA00_SERCOM1_PAD0 : constant Peripheral_Function := D;
PA16_SERCOM1_PAD0 : constant Peripheral_Function := C;
PA01_SERCOM1_PAD1 : constant Peripheral_Function := D;
PA17_SERCOM1_PAD1 : constant Peripheral_Function := C;
PA30_SERCOM1_PAD2 : constant Peripheral_Function := D;
PA18_SERCOM1_PAD2 : constant Peripheral_Function := C;
PB22_SERCOM1_PAD2 : constant Peripheral_Function := C;
PA31_SERCOM1_PAD3 : constant Peripheral_Function := D;
PA19_SERCOM1_PAD3 : constant Peripheral_Function := C;
PB23_SERCOM1_PAD3 : constant Peripheral_Function := C;
PA09_SERCOM2_PAD0 : constant Peripheral_Function := D;
PA12_SERCOM2_PAD0 : constant Peripheral_Function := C;
PA08_SERCOM2_PAD1 : constant Peripheral_Function := D;
PA13_SERCOM2_PAD1 : constant Peripheral_Function := C;
PA10_SERCOM2_PAD2 : constant Peripheral_Function := D;
PA14_SERCOM2_PAD2 : constant Peripheral_Function := C;
PA11_SERCOM2_PAD3 : constant Peripheral_Function := D;
PA15_SERCOM2_PAD3 : constant Peripheral_Function := C;
PA17_SERCOM3_PAD0 : constant Peripheral_Function := D;
PA22_SERCOM3_PAD0 : constant Peripheral_Function := C;
PA16_SERCOM3_PAD1 : constant Peripheral_Function := D;
PA23_SERCOM3_PAD1 : constant Peripheral_Function := C;
PA18_SERCOM3_PAD2 : constant Peripheral_Function := D;
PA20_SERCOM3_PAD2 : constant Peripheral_Function := D;
PA24_SERCOM3_PAD2 : constant Peripheral_Function := C;
PA19_SERCOM3_PAD3 : constant Peripheral_Function := D;
PA21_SERCOM3_PAD3 : constant Peripheral_Function := D;
PA25_SERCOM3_PAD3 : constant Peripheral_Function := C;
PA13_SERCOM4_PAD0 : constant Peripheral_Function := D;
PB08_SERCOM4_PAD0 : constant Peripheral_Function := D;
PB12_SERCOM4_PAD0 : constant Peripheral_Function := C;
PA12_SERCOM4_PAD1 : constant Peripheral_Function := D;
PB09_SERCOM4_PAD1 : constant Peripheral_Function := D;
PB13_SERCOM4_PAD1 : constant Peripheral_Function := C;
PA14_SERCOM4_PAD2 : constant Peripheral_Function := D;
PB10_SERCOM4_PAD2 : constant Peripheral_Function := D;
PB14_SERCOM4_PAD2 : constant Peripheral_Function := C;
PB11_SERCOM4_PAD3 : constant Peripheral_Function := D;
PA15_SERCOM4_PAD3 : constant Peripheral_Function := D;
PB15_SERCOM4_PAD3 : constant Peripheral_Function := C;
PA23_SERCOM5_PAD0 : constant Peripheral_Function := D;
PB02_SERCOM5_PAD0 : constant Peripheral_Function := D;
PB31_SERCOM5_PAD0 : constant Peripheral_Function := D;
PB16_SERCOM5_PAD0 : constant Peripheral_Function := C;
PA22_SERCOM5_PAD1 : constant Peripheral_Function := D;
PB03_SERCOM5_PAD1 : constant Peripheral_Function := D;
PB30_SERCOM5_PAD1 : constant Peripheral_Function := D;
PB17_SERCOM5_PAD1 : constant Peripheral_Function := C;
PA24_SERCOM5_PAD2 : constant Peripheral_Function := D;
PB00_SERCOM5_PAD2 : constant Peripheral_Function := D;
PB22_SERCOM5_PAD2 : constant Peripheral_Function := D;
PA20_SERCOM5_PAD2 : constant Peripheral_Function := C;
PA25_SERCOM5_PAD3 : constant Peripheral_Function := D;
PB01_SERCOM5_PAD3 : constant Peripheral_Function := D;
PB23_SERCOM5_PAD3 : constant Peripheral_Function := D;
PA21_SERCOM5_PAD3 : constant Peripheral_Function := C;
PA04_TC0_WO0 : constant Peripheral_Function := E;
PA08_TC0_WO0 : constant Peripheral_Function := E;
PB30_TC0_WO0 : constant Peripheral_Function := E;
PA05_TC0_WO1 : constant Peripheral_Function := E;
PA09_TC0_WO1 : constant Peripheral_Function := E;
PB31_TC0_WO1 : constant Peripheral_Function := E;
PA06_TC1_WO0 : constant Peripheral_Function := E;
PA10_TC1_WO0 : constant Peripheral_Function := E;
PA07_TC1_WO1 : constant Peripheral_Function := E;
PA11_TC1_WO1 : constant Peripheral_Function := E;
PA12_TC2_WO0 : constant Peripheral_Function := E;
PA16_TC2_WO0 : constant Peripheral_Function := E;
PA00_TC2_WO0 : constant Peripheral_Function := E;
PA01_TC2_WO1 : constant Peripheral_Function := E;
PA13_TC2_WO1 : constant Peripheral_Function := E;
PA17_TC2_WO1 : constant Peripheral_Function := E;
PA18_TC3_WO0 : constant Peripheral_Function := E;
PA14_TC3_WO0 : constant Peripheral_Function := E;
PA15_TC3_WO1 : constant Peripheral_Function := E;
PA19_TC3_WO1 : constant Peripheral_Function := E;
PA22_TC4_WO0 : constant Peripheral_Function := E;
PB08_TC4_WO0 : constant Peripheral_Function := E;
PB12_TC4_WO0 : constant Peripheral_Function := E;
PA23_TC4_WO1 : constant Peripheral_Function := E;
PB09_TC4_WO1 : constant Peripheral_Function := E;
PB13_TC4_WO1 : constant Peripheral_Function := E;
PA24_TC5_WO0 : constant Peripheral_Function := E;
PB10_TC5_WO0 : constant Peripheral_Function := E;
PB14_TC5_WO0 : constant Peripheral_Function := E;
PA25_TC5_WO1 : constant Peripheral_Function := E;
PB11_TC5_WO1 : constant Peripheral_Function := E;
PB15_TC5_WO1 : constant Peripheral_Function := E;
PA20_TCC0_WO0 : constant Peripheral_Function := G;
PB12_TCC0_WO0 : constant Peripheral_Function := G;
PA08_TCC0_WO0 : constant Peripheral_Function := F;
PA21_TCC0_WO1 : constant Peripheral_Function := G;
PB13_TCC0_WO1 : constant Peripheral_Function := G;
PA09_TCC0_WO1 : constant Peripheral_Function := F;
PA22_TCC0_WO2 : constant Peripheral_Function := G;
PB14_TCC0_WO2 : constant Peripheral_Function := G;
PA10_TCC0_WO2 : constant Peripheral_Function := F;
PA23_TCC0_WO3 : constant Peripheral_Function := G;
PB15_TCC0_WO3 : constant Peripheral_Function := G;
PA11_TCC0_WO3 : constant Peripheral_Function := F;
PA16_TCC0_WO4 : constant Peripheral_Function := G;
PB16_TCC0_WO4 : constant Peripheral_Function := G;
PB10_TCC0_WO4 : constant Peripheral_Function := F;
PA17_TCC0_WO5 : constant Peripheral_Function := G;
PB17_TCC0_WO5 : constant Peripheral_Function := G;
PB11_TCC0_WO5 : constant Peripheral_Function := F;
PA18_TCC0_WO6 : constant Peripheral_Function := G;
PB30_TCC0_WO6 : constant Peripheral_Function := G;
PA12_TCC0_WO6 : constant Peripheral_Function := F;
PA19_TCC0_WO7 : constant Peripheral_Function := G;
PB31_TCC0_WO7 : constant Peripheral_Function := G;
PA13_TCC0_WO7 : constant Peripheral_Function := F;
PB10_TCC1_WO0 : constant Peripheral_Function := G;
PA16_TCC1_WO0 : constant Peripheral_Function := F;
PB11_TCC1_WO1 : constant Peripheral_Function := G;
PA17_TCC1_WO1 : constant Peripheral_Function := F;
PA12_TCC1_WO2 : constant Peripheral_Function := G;
PA14_TCC1_WO2 : constant Peripheral_Function := G;
PA18_TCC1_WO2 : constant Peripheral_Function := F;
PA13_TCC1_WO3 : constant Peripheral_Function := G;
PA15_TCC1_WO3 : constant Peripheral_Function := G;
PA19_TCC1_WO3 : constant Peripheral_Function := F;
PA08_TCC1_WO4 : constant Peripheral_Function := G;
PA20_TCC1_WO4 : constant Peripheral_Function := F;
PA09_TCC1_WO5 : constant Peripheral_Function := G;
PA21_TCC1_WO5 : constant Peripheral_Function := F;
PA10_TCC1_WO6 : constant Peripheral_Function := G;
PA22_TCC1_WO6 : constant Peripheral_Function := F;
PA11_TCC1_WO7 : constant Peripheral_Function := G;
PA23_TCC1_WO7 : constant Peripheral_Function := F;
PA14_TCC2_WO0 : constant Peripheral_Function := F;
PA30_TCC2_WO0 : constant Peripheral_Function := F;
PA15_TCC2_WO1 : constant Peripheral_Function := F;
PA31_TCC2_WO1 : constant Peripheral_Function := F;
PA24_TCC2_WO2 : constant Peripheral_Function := F;
PB02_TCC2_WO2 : constant Peripheral_Function := F;
PB12_TCC3_WO0 : constant Peripheral_Function := F;
PB16_TCC3_WO0 : constant Peripheral_Function := F;
PB13_TCC3_WO1 : constant Peripheral_Function := F;
PB17_TCC3_WO1 : constant Peripheral_Function := F;
PB14_TCC4_WO0 : constant Peripheral_Function := F;
PB30_TCC4_WO0 : constant Peripheral_Function := F;
PB15_TCC4_WO1 : constant Peripheral_Function := F;
PB31_TCC4_WO1 : constant Peripheral_Function := F;
PA24_USB_DM : constant Peripheral_Function := H;
PA25_USB_DP : constant Peripheral_Function := H;
PA23_USB_SOF_1KHZ : constant Peripheral_Function := H;
PB22_USB_SOF_1KHZ : constant Peripheral_Function := H;
end SAM.Functions;
|
------------------------------------------------------------------------------
-- --
-- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . O S _ I N T E R F A C E --
-- --
-- S p e c --
-- --
-- $Revision$
-- --
-- Copyright (C) 1997-2001 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 (native) version of this package
-- This package includes all direct interfaces to OS services
-- that are needed by children of System.
-- PLEASE DO NOT add any with-clauses to this package
-- or remove the pragma Elaborate_Body.
-- It is designed to be a bottom-level (leaf) package.
with Interfaces.C;
package System.OS_Interface is
pragma Preelaborate;
pragma Linker_Options ("-lposix4");
pragma Linker_Options ("-lthread");
subtype int is Interfaces.C.int;
subtype short is Interfaces.C.short;
subtype long is Interfaces.C.long;
subtype unsigned is Interfaces.C.unsigned;
subtype unsigned_short is Interfaces.C.unsigned_short;
subtype unsigned_long is Interfaces.C.unsigned_long;
subtype unsigned_char is Interfaces.C.unsigned_char;
subtype plain_char is Interfaces.C.plain_char;
subtype size_t is Interfaces.C.size_t;
-----------
-- Errno --
-----------
function errno return int;
pragma Import (C, errno, "__get_errno");
EAGAIN : constant := 11;
EINTR : constant := 4;
EINVAL : constant := 22;
ENOMEM : constant := 12;
ETIME : constant := 62;
ETIMEDOUT : constant := 145;
-------------
-- Signals --
-------------
Max_Interrupt : constant := 45;
type Signal is new int range 0 .. Max_Interrupt;
for Signal'Size use int'Size;
SIGHUP : constant := 1; -- hangup
SIGINT : constant := 2; -- interrupt (rubout)
SIGQUIT : constant := 3; -- quit (ASCD FS)
SIGILL : constant := 4; -- illegal instruction (not reset)
SIGTRAP : constant := 5; -- trace trap (not reset)
SIGIOT : constant := 6; -- IOT instruction
SIGABRT : constant := 6; -- used by abort, replace SIGIOT in the future
SIGEMT : constant := 7; -- EMT instruction
SIGFPE : constant := 8; -- floating point exception
SIGKILL : constant := 9; -- kill (cannot be caught or ignored)
SIGBUS : constant := 10; -- bus error
SIGSEGV : constant := 11; -- segmentation violation
SIGSYS : constant := 12; -- bad argument to system call
SIGPIPE : constant := 13; -- write on a pipe with no one to read it
SIGALRM : constant := 14; -- alarm clock
SIGTERM : constant := 15; -- software termination signal from kill
SIGUSR1 : constant := 16; -- user defined signal 1
SIGUSR2 : constant := 17; -- user defined signal 2
SIGCLD : constant := 18; -- alias for SIGCHLD
SIGCHLD : constant := 18; -- child status change
SIGPWR : constant := 19; -- power-fail restart
SIGWINCH : constant := 20; -- window size change
SIGURG : constant := 21; -- urgent condition on IO channel
SIGPOLL : constant := 22; -- pollable event occurred
SIGIO : constant := 22; -- I/O possible (Solaris SIGPOLL alias)
SIGSTOP : constant := 23; -- stop (cannot be caught or ignored)
SIGTSTP : constant := 24; -- user stop requested from tty
SIGCONT : constant := 25; -- stopped process has been continued
SIGTTIN : constant := 26; -- background tty read attempted
SIGTTOU : constant := 27; -- background tty write attempted
SIGVTALRM : constant := 28; -- virtual timer expired
SIGPROF : constant := 29; -- profiling timer expired
SIGXCPU : constant := 30; -- CPU time limit exceeded
SIGXFSZ : constant := 31; -- filesize limit exceeded
SIGWAITING : constant := 32; -- process's lwps blocked (Solaris)
SIGLWP : constant := 33; -- used by thread library (Solaris)
SIGFREEZE : constant := 34; -- used by CPR (Solaris)
SIGTHAW : constant := 35; -- used by CPR (Solaris)
SIGCANCEL : constant := 36; -- thread cancellation signal (libthread)
type Signal_Set is array (Natural range <>) of Signal;
Unmasked : constant Signal_Set := (SIGTRAP, SIGLWP, SIGPROF);
-- Following signals should not be disturbed.
-- See c-posix-signals.c in FLORIST
Reserved : constant Signal_Set := (SIGKILL, SIGSTOP, SIGWAITING, SIGCANCEL);
type sigset_t is private;
function sigaddset (set : access sigset_t; sig : Signal) return int;
pragma Import (C, sigaddset, "sigaddset");
function sigdelset (set : access sigset_t; sig : Signal) return int;
pragma Import (C, sigdelset, "sigdelset");
function sigfillset (set : access sigset_t) return int;
pragma Import (C, sigfillset, "sigfillset");
function sigismember (set : access sigset_t; sig : Signal) return int;
pragma Import (C, sigismember, "sigismember");
function sigemptyset (set : access sigset_t) return int;
pragma Import (C, sigemptyset, "sigemptyset");
type union_type_3 is new String (1 .. 116);
type siginfo_t is record
si_signo : int;
si_code : int;
si_errno : int;
X_data : union_type_3;
end record;
pragma Convention (C, siginfo_t);
-- The types mcontext_t and gregset_t are part of the ucontext_t
-- information, which is specific to Solaris2.4 for SPARC
-- The ucontext_t info seems to be used by the handler
-- for SIGSEGV to decide whether it is a Storage_Error (stack overflow) or
-- a Constraint_Error (bad pointer). The original code that did this
-- is suspect, so it is not clear whether we really need this part of
-- the signal context information, or perhaps something else.
-- More analysis is needed, after which these declarations may need to
-- be changed.
FPE_INTDIV : constant := 1; -- integer divide by zero
FPE_INTOVF : constant := 2; -- integer overflow
FPE_FLTDIV : constant := 3; -- floating point divide by zero
FPE_FLTOVF : constant := 4; -- floating point overflow
FPE_FLTUND : constant := 5; -- floating point underflow
FPE_FLTRES : constant := 6; -- floating point inexact result
FPE_FLTINV : constant := 7; -- invalid floating point operation
FPE_FLTSUB : constant := 8; -- subscript out of range
type greg_t is new int;
type gregset_t is array (0 .. 18) of greg_t;
type union_type_2 is new String (1 .. 128);
type record_type_1 is record
fpu_fr : union_type_2;
fpu_q : System.Address;
fpu_fsr : unsigned;
fpu_qcnt : unsigned_char;
fpu_q_entrysize : unsigned_char;
fpu_en : unsigned_char;
end record;
pragma Convention (C, record_type_1);
type array_type_7 is array (Integer range 0 .. 20) of long;
type mcontext_t is record
gregs : gregset_t;
gwins : System.Address;
fpregs : record_type_1;
filler : array_type_7;
end record;
pragma Convention (C, mcontext_t);
type record_type_2 is record
ss_sp : System.Address;
ss_size : int;
ss_flags : int;
end record;
pragma Convention (C, record_type_2);
type array_type_8 is array (Integer range 0 .. 22) of long;
type ucontext_t is record
uc_flags : unsigned_long;
uc_link : System.Address;
uc_sigmask : sigset_t;
uc_stack : record_type_2;
uc_mcontext : mcontext_t;
uc_filler : array_type_8;
end record;
pragma Convention (C, ucontext_t);
type Signal_Handler is access procedure
(signo : Signal;
info : access siginfo_t;
context : access ucontext_t);
type union_type_1 is new plain_char;
type array_type_2 is array (Integer range 0 .. 1) of int;
type struct_sigaction is record
sa_flags : int;
sa_handler : System.Address;
sa_mask : sigset_t;
sa_resv : array_type_2;
end record;
pragma Convention (C, struct_sigaction);
type struct_sigaction_ptr is access all struct_sigaction;
SIG_BLOCK : constant := 1;
SIG_UNBLOCK : constant := 2;
SIG_SETMASK : constant := 3;
SIG_DFL : constant := 0;
SIG_IGN : constant := 1;
function sigaction
(sig : Signal;
act : struct_sigaction_ptr;
oact : struct_sigaction_ptr) return int;
pragma Import (C, sigaction, "sigaction");
----------
-- Time --
----------
type timespec is private;
type clockid_t is private;
CLOCK_REALTIME : constant clockid_t;
function clock_gettime
(clock_id : clockid_t; tp : access timespec) return int;
pragma Import (C, clock_gettime, "clock_gettime");
function To_Duration (TS : timespec) return Duration;
pragma Inline (To_Duration);
function To_Timespec (D : Duration) return timespec;
pragma Inline (To_Timespec);
type struct_timeval is private;
-- This is needed on systems that do not have clock_gettime()
-- but do have gettimeofday().
function To_Duration (TV : struct_timeval) return Duration;
pragma Inline (To_Duration);
function To_Timeval (D : Duration) return struct_timeval;
pragma Inline (To_Timeval);
-------------
-- Process --
-------------
type pid_t is private;
function kill (pid : pid_t; sig : Signal) return int;
pragma Import (C, kill, "kill");
function getpid return pid_t;
pragma Import (C, getpid, "getpid");
-------------
-- Threads --
-------------
type Thread_Body is access
function (arg : System.Address) return System.Address;
THR_DETACHED : constant := 64;
THR_BOUND : constant := 1;
THR_NEW_LWP : constant := 2;
USYNC_THREAD : constant := 0;
type thread_t is private;
subtype Thread_Id is thread_t;
type mutex_t is limited private;
type cond_t is limited private;
type thread_key_t is private;
function thr_create
(stack_base : System.Address;
stack_size : size_t;
start_routine : Thread_Body;
arg : System.Address;
flags : int;
new_thread : access thread_t) return int;
pragma Import (C, thr_create, "thr_create");
function thr_min_stack return size_t;
pragma Import (C, thr_min_stack, "thr_min_stack");
function thr_self return thread_t;
pragma Import (C, thr_self, "thr_self");
function mutex_init
(mutex : access mutex_t;
mtype : int;
arg : System.Address) return int;
pragma Import (C, mutex_init, "mutex_init");
function mutex_destroy (mutex : access mutex_t) return int;
pragma Import (C, mutex_destroy, "mutex_destroy");
function mutex_lock (mutex : access mutex_t) return int;
pragma Import (C, mutex_lock, "mutex_lock");
function mutex_unlock (mutex : access mutex_t) return int;
pragma Import (C, mutex_unlock, "mutex_unlock");
function cond_init
(cond : access cond_t;
ctype : int;
arg : int) return int;
pragma Import (C, cond_init, "cond_init");
function cond_wait
(cond : access cond_t; mutex : access mutex_t) return int;
pragma Import (C, cond_wait, "cond_wait");
function cond_timedwait
(cond : access cond_t;
mutex : access mutex_t;
abstime : access timespec) return int;
pragma Import (C, cond_timedwait, "cond_timedwait");
function cond_signal (cond : access cond_t) return int;
pragma Import (C, cond_signal, "cond_signal");
function cond_destroy (cond : access cond_t) return int;
pragma Import (C, cond_destroy, "cond_destroy");
function thr_setspecific
(key : thread_key_t; value : System.Address) return int;
pragma Import (C, thr_setspecific, "thr_setspecific");
function thr_getspecific
(key : thread_key_t;
value : access System.Address) return int;
pragma Import (C, thr_getspecific, "thr_getspecific");
function thr_keycreate
(key : access thread_key_t; destructor : System.Address) return int;
pragma Import (C, thr_keycreate, "thr_keycreate");
function thr_setprio (thread : thread_t; priority : int) return int;
pragma Import (C, thr_setprio, "thr_setprio");
procedure thr_exit (status : System.Address);
pragma Import (C, thr_exit, "thr_exit");
function thr_setconcurrency (new_level : int) return int;
pragma Import (C, thr_setconcurrency, "thr_setconcurrency");
function sigwait (set : access sigset_t; sig : access Signal) return int;
pragma Import (C, sigwait, "__posix_sigwait");
function thr_kill (thread : thread_t; sig : Signal) return int;
pragma Import (C, thr_kill, "thr_kill");
type sigset_t_ptr is access all sigset_t;
function thr_sigsetmask
(how : int;
set : sigset_t_ptr;
oset : sigset_t_ptr) return int;
pragma Import (C, thr_sigsetmask, "thr_sigsetmask");
function pthread_sigmask
(how : int;
set : sigset_t_ptr;
oset : sigset_t_ptr) return int;
pragma Import (C, pthread_sigmask, "thr_sigsetmask");
function thr_suspend (target_thread : thread_t) return int;
pragma Import (C, thr_suspend, "thr_suspend");
function thr_continue (target_thread : thread_t) return int;
pragma Import (C, thr_continue, "thr_continue");
procedure thr_yield;
pragma Import (C, thr_yield, "thr_yield");
---------
-- LWP --
---------
P_PID : constant := 0;
P_LWPID : constant := 8;
PC_GETCID : constant := 0;
PC_GETCLINFO : constant := 1;
PC_SETPARMS : constant := 2;
PC_GETPARMS : constant := 3;
PC_ADMIN : constant := 4;
PC_CLNULL : constant := -1;
RT_NOCHANGE : constant := -1;
RT_TQINF : constant := -2;
RT_TQDEF : constant := -3;
PC_CLNMSZ : constant := 16;
PC_VERSION : constant := 1;
type lwpid_t is new int;
type pri_t is new short;
type id_t is new long;
P_MYID : constant := -1;
-- the specified LWP or process is the current one.
type struct_pcinfo is record
pc_cid : id_t;
pc_clname : String (1 .. PC_CLNMSZ);
rt_maxpri : short;
end record;
pragma Convention (C, struct_pcinfo);
type struct_pcparms is record
pc_cid : id_t;
rt_pri : pri_t;
rt_tqsecs : long;
rt_tqnsecs : long;
end record;
pragma Convention (C, struct_pcparms);
function priocntl
(ver : int;
id_type : int;
id : lwpid_t;
cmd : int;
arg : System.Address) return Interfaces.C.long;
pragma Import (C, priocntl, "__priocntl");
function lwp_self return lwpid_t;
pragma Import (C, lwp_self, "_lwp_self");
type processorid_t is new int;
type processorid_t_ptr is access all processorid_t;
-- Constants for function processor_bind
PBIND_QUERY : constant processorid_t := -2;
-- the processor bindings are not changed.
PBIND_NONE : constant processorid_t := -1;
-- the processor bindings of the specified LWPs are cleared.
-- Flags for function p_online
PR_OFFLINE : constant int := 1;
-- processor is offline, as quiet as possible
PR_ONLINE : constant int := 2;
-- processor online
PR_STATUS : constant int := 3;
-- value passed to p_online to request status
function p_online (processorid : processorid_t; flag : int) return int;
pragma Import (C, p_online, "p_online");
function processor_bind
(id_type : int;
id : id_t;
proc_id : processorid_t;
obind : processorid_t_ptr) return int;
pragma Import (C, processor_bind, "processor_bind");
procedure pthread_init;
-- dummy procedure to share s-intman.adb with other Solaris targets.
private
type array_type_1 is array (0 .. 3) of unsigned_long;
type sigset_t is record
X_X_sigbits : array_type_1;
end record;
pragma Convention (C, sigset_t);
type pid_t is new long;
type time_t is new long;
type timespec is record
tv_sec : time_t;
tv_nsec : long;
end record;
pragma Convention (C, timespec);
type clockid_t is new int;
CLOCK_REALTIME : constant clockid_t := 0;
type struct_timeval is record
tv_sec : long;
tv_usec : long;
end record;
pragma Convention (C, struct_timeval);
type thread_t is new unsigned;
type array_type_9 is array (0 .. 3) of unsigned_char;
type record_type_3 is record
flag : array_type_9;
Xtype : unsigned_long;
end record;
pragma Convention (C, record_type_3);
type mutex_t is record
flags : record_type_3;
lock : String (1 .. 8);
data : String (1 .. 8);
end record;
pragma Convention (C, mutex_t);
type cond_t is record
flag : array_type_9;
Xtype : unsigned_long;
data : String (1 .. 8);
end record;
pragma Convention (C, cond_t);
type thread_key_t is new unsigned;
end System.OS_Interface;
|
-------------------------------------------------------------------------------
-- Copyright (c) 2016 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 AUnit.Assertions; use AUnit.Assertions;
with Verhoeff; use Verhoeff;
package body Verhoeff_Tests
is
----------------------------------------------------------------------------
-- Test the example from Wikipedia: https://en.wikipedia.org/wiki/Verhoeff_algorithm
-- (accessed 10th February 2016 at 13:23:00)
--
-- Checks that the string 236 has the check digit 3, and that Is_Valid
-- accepts the check digit.
procedure Test_Case_1(T : in out Test)
is
Test_String : constant String := "236";
Computed_Check_Digit : Digit_Character;
begin
Computed_Check_Digit := Check_Digit(Test_String);
Assert(Computed_Check_Digit = '3',
"wrong check digit returned: " & Computed_Check_Digit);
Assert(Is_Valid(Test_String & Computed_Check_Digit),
"Is_Valid failed");
end Test_Case_1;
----------------------------------------------------------------------------
-- Test the example http://www.augustana.ab.ca/~mohrj/algorithms/checkdigit.html
-- (accessed 10th February 2016 at 13:23:00)
--
-- Checks that the string 12345 has the check digit 1, and that Is_Valid
-- accepts the check digit.
procedure Test_Case_2(T : in out Test)
is
Test_String : constant String := "12345";
Computed_Check_Digit : Digit_Character;
begin
Computed_Check_Digit := Check_Digit(Test_String);
Assert(Computed_Check_Digit = '1',
"wrong check digit returned: " & Computed_Check_Digit);
Assert(Is_Valid(Test_String & Computed_Check_Digit),
"Is_Valid failed");
end Test_Case_2;
----------------------------------------------------------------------------
-- Test that for every possible 6-digit string
-- the resulting check digit is accepted as valid by Is_Valid, and that
-- Is_Valid rejects any other (invalid) check digits.
--
-- This test basically checks the library against itself; that it accepts
-- the check digits it computes and rejects any others.
procedure Test_Symmetry(T : in out Test)
is
Test_String : String(1 .. 6);
Computed_Check_Digit : Digit_Character;
begin
for A in Digit_Character loop
for B in Digit_Character loop
for C in Digit_Character loop
for D in Digit_Character loop
for E in Digit_Character loop
for F in Digit_Character loop
Test_String := String'(A,B,C,D,E,F);
Computed_Check_Digit := Check_Digit(Test_String);
-- Check that the check digit is valid
Assert(Is_Valid(Test_String & Computed_Check_Digit),
"computed check digit is invalid:" &
Test_String & ' ' & Character(Computed_Check_Digit));
-- Check that all other check digits are invalid
Assert((for all Invalid_Check_Digit in Digit_Character'Range =>
(if Invalid_Check_Digit /= Computed_Check_Digit
then not Is_Valid(Test_String & Invalid_Check_Digit)
)
),
"Is_Valid does not reject invalid check digits for: " & Test_String);
end loop;
end loop;
end loop;
end loop;
end loop;
end loop;
end Test_Symmetry;
----------------------------------------------------------------------------
-- Test the check digit of the empty string.
--
-- The check digit of an empty string should be 0.
procedure Test_Empty(T : in out Test)
is
begin
Assert(Check_Digit("") = '0',
"check digit of an empty string is not 0");
Assert(Is_Valid("0"),
"Is_Valid failed");
end Test_Empty;
end Verhoeff_Tests;
|
package YAML.Abstract_Object is
type Instance is abstract tagged null record;
subtype Class is Instance'Class;
function Get (Item : in Instance;
Name : in String) return Class is abstract;
function Get (Item : in Instance;
Index : in Positive) return Class is abstract;
function Get (Item : in Instance;
Name : in String) return String is abstract;
function Get (Item : in Instance;
Index : in Positive) return String is abstract;
function Get (Item : in Instance;
Name : in String;
Default : in String) return String is abstract;
function Get (Item : in Instance;
Index : in Positive;
Default : in String) return String is abstract;
function Has (Item : in Instance;
Name : in String) return Boolean is (False);
function Has (Item : in Instance;
Index : in Positive) return Boolean is (False);
end YAML.Abstract_Object;
|
--
-- Copyright (C) 2017 secunet Security Networks AG
--
-- 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 2 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.
--
with HW.Debug;
with GNAT.Source_Info;
with HW.GFX.GMA.Config;
with HW.GFX.GMA.Registers;
with HW.GFX.GMA.DDI_Phy;
use HW.GFX.GMA.Registers;
package body HW.GFX.GMA.PLLs
with
Refined_State => (State => null)
is
-- DPLL clock equation:
-- 5 * Target_Dotclock = Ref_Clk * M1 * (M2 / 2^22) / N / (P1 * P2)
--
-- Where
-- M1 = 2,
-- Ref_Clk = 100MHz,
-- VCO = Ref_Clk * 2 * (M2 / 2^22),
-- N = 1 and
-- P = P1 * P2.
Ref_Clk : constant := 100_000_000;
M1 : constant := 2;
N : constant := 1;
-- i915 has a fixme for the M2 range. But the VCO range is very
-- limited, giving us a narrow range for M2: 24 .. 33.5
subtype VCO_Range is Pos64 range 4_800_000_000 .. 6_700_000_000;
subtype M2_Range is Pos64 range
N * VCO_Range'First * 2 ** 22 / Ref_Clk / M1 ..
N * VCO_Range'Last * 2 ** 22 / Ref_Clk / M1;
subtype N_Range is Pos64 range 1 .. 1;
subtype P1_Range is Pos64 range 2 .. 4;
subtype P2_Range is Pos64 range 1 .. 20;
subtype Clock_Range is Frequency_Type range
Frequency_Type'First .. 540_000_000;
subtype HDMI_Clock_Range is Clock_Range range
25_000_000 .. Config.HDMI_Max_Clock_24bpp;
subtype Clock_Gap is Clock_Range range 223_333_333 + 1 .. 240_000_000 - 1;
type Clock_Type is record
M2 : M2_Range;
P1 : P1_Range;
P2 : P2_Range;
VCO : VCO_Range;
Dotclock : Clock_Range;
end record;
Invalid_Clock : constant Clock_Type :=
(M2 => M2_Range'Last,
P1 => P1_Range'Last,
P2 => P2_Range'Last,
VCO => VCO_Range'Last,
Dotclock => Clock_Range'Last);
procedure Calculate_Clock_Parameters
(Target_Dotclock : in HDMI_Clock_Range;
Best_Clock : out Clock_Type;
Valid : out Boolean)
with
Pre => True
is
Target_Clock : constant Pos64 := 5 * Target_Dotclock;
M2, VCO, Current_Clock : Pos64;
P2 : P2_Range;
Valid_Clk : Boolean;
begin
pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity));
Valid := False;
Best_Clock := Invalid_Clock;
-- reverse loops as hardware prefers higher values
for P1 in reverse P1_Range loop
-- find the highest P2 that results in valid clock
P2 := P2_Range'Last;
loop
M2 := Div_Round_Closest
(Target_Clock * P2 * P1 * N * 2 ** 22, Ref_Clk * M1);
VCO := Div_Round_Closest (Ref_Clk * M1 * M2, 2 ** 22 * N);
Current_Clock := Div_Round_Closest (VCO, P1 * P2);
Valid_Clk := M2 in M2_Range and then
Div_Round_Closest (Current_Clock, 5) in Clock_Range;
if Valid_Clk then
-- the error is always below 2^-22, higher P takes precedence
if not Valid or P1 * P2 > Best_Clock.P1 * Best_Clock.P2 then
Best_Clock := Clock_Type'
(M2 => M2,
P1 => P1,
P2 => P2,
VCO => VCO,
Dotclock => Div_Round_Closest (Current_Clock, 5));
Valid := True;
end if;
end if;
-- Prefer higher P2 over marginal lower error. This is
-- just an optimization, since lower P2 values would get
-- filtered above anyway.
exit when Valid_Clk;
-- If M2 got too low, it won't get any better. Another
-- optimization.
exit when M2 < M2_Range'First;
exit when P2 = P2_Range'First;
if P2 > 10 then
P2 := P2 - 2;
else
P2 := P2 - 1;
end if;
end loop;
end loop;
pragma Debug (Valid, Debug.Put_Line ("Valid clock found."));
pragma Debug (Valid, Debug.Put ("M2 / P1 / P2: "));
pragma Debug (Valid, Debug.Put_Word32 (Word32 (Best_Clock.M2)));
pragma Debug (Valid, Debug.Put (" / "));
pragma Debug (Valid, Debug.Put_Int8 (Pos8 (Best_Clock.P1)));
pragma Debug (Valid, Debug.Put (" / "));
pragma Debug (Valid, Debug.Put_Int8 (Pos8 (Best_Clock.P2)));
pragma Debug (Valid, Debug.New_Line);
pragma Debug (Valid, Debug.Put ("Best / Target: "));
pragma Debug (Valid, Debug.Put_Int64 (Best_Clock.Dotclock));
pragma Debug (Valid, Debug.Put (" / "));
pragma Debug (Valid, Debug.Put_Int64 (Target_Dotclock));
pragma Debug (Valid, Debug.New_Line);
pragma Debug (not Valid, Debug.Put_Line ("No valid clock found."));
end Calculate_Clock_Parameters;
----------------------------------------------------------------------------
subtype Valid_PLLs is T range DPLL_A .. DPLL_C;
type Port_PLL_Regs is record
PLL_ENABLE : Registers_Index;
PLL_EBB_0 : Registers_Index;
PLL_EBB_4 : Registers_Index;
PLL_0 : Registers_Index;
PLL_1 : Registers_Index;
PLL_2 : Registers_Index;
PLL_3 : Registers_Index;
PLL_6 : Registers_Index;
PLL_8 : Registers_Index;
PLL_9 : Registers_Index;
PLL_10 : Registers_Index;
PCS_DW12_LN01 : Registers_Index;
PCS_DW12_GRP : Registers_Index;
end record;
type Port_PLL_Array is array (Valid_PLLs) of Port_PLL_Regs;
PORT : constant Port_PLL_Array :=
(DPLL_A =>
(PLL_ENABLE => BXT_PORT_PLL_ENABLE_A,
PLL_EBB_0 => BXT_PORT_PLL_EBB_0_A,
PLL_EBB_4 => BXT_PORT_PLL_EBB_4_A,
PLL_0 => BXT_PORT_PLL_0_A,
PLL_1 => BXT_PORT_PLL_1_A,
PLL_2 => BXT_PORT_PLL_2_A,
PLL_3 => BXT_PORT_PLL_3_A,
PLL_6 => BXT_PORT_PLL_6_A,
PLL_8 => BXT_PORT_PLL_8_A,
PLL_9 => BXT_PORT_PLL_9_A,
PLL_10 => BXT_PORT_PLL_10_A,
PCS_DW12_LN01 => BXT_PORT_PCS_DW12_01_A,
PCS_DW12_GRP => BXT_PORT_PCS_DW12_GRP_A),
DPLL_B =>
(PLL_ENABLE => BXT_PORT_PLL_ENABLE_B,
PLL_EBB_0 => BXT_PORT_PLL_EBB_0_B,
PLL_EBB_4 => BXT_PORT_PLL_EBB_4_B,
PLL_0 => BXT_PORT_PLL_0_B,
PLL_1 => BXT_PORT_PLL_1_B,
PLL_2 => BXT_PORT_PLL_2_B,
PLL_3 => BXT_PORT_PLL_3_B,
PLL_6 => BXT_PORT_PLL_6_B,
PLL_8 => BXT_PORT_PLL_8_B,
PLL_9 => BXT_PORT_PLL_9_B,
PLL_10 => BXT_PORT_PLL_10_B,
PCS_DW12_LN01 => BXT_PORT_PCS_DW12_01_B,
PCS_DW12_GRP => BXT_PORT_PCS_DW12_GRP_B),
DPLL_C =>
(PLL_ENABLE => BXT_PORT_PLL_ENABLE_C,
PLL_EBB_0 => BXT_PORT_PLL_EBB_0_C,
PLL_EBB_4 => BXT_PORT_PLL_EBB_4_C,
PLL_0 => BXT_PORT_PLL_0_C,
PLL_1 => BXT_PORT_PLL_1_C,
PLL_2 => BXT_PORT_PLL_2_C,
PLL_3 => BXT_PORT_PLL_3_C,
PLL_6 => BXT_PORT_PLL_6_C,
PLL_8 => BXT_PORT_PLL_8_C,
PLL_9 => BXT_PORT_PLL_9_C,
PLL_10 => BXT_PORT_PLL_10_C,
PCS_DW12_LN01 => BXT_PORT_PCS_DW12_01_C,
PCS_DW12_GRP => BXT_PORT_PCS_DW12_GRP_C));
PORT_PLL_ENABLE : constant := 1 * 2 ** 31;
PORT_PLL_ENABLE_LOCK : constant := 1 * 2 ** 30;
PORT_PLL_ENABLE_REF_SEL : constant := 1 * 2 ** 27;
PORT_PLL_EBB0_P1_SHIFT : constant := 13;
PORT_PLL_EBB0_P1_MASK : constant := 16#07# * 2 ** 13;
PORT_PLL_EBB0_P2_SHIFT : constant := 8;
PORT_PLL_EBB0_P2_MASK : constant := 16#1f# * 2 ** 8;
function PORT_PLL_EBB0_P1 (P1 : P1_Range) return Word32 is
begin
return Shift_Left (Word32 (P1), PORT_PLL_EBB0_P1_SHIFT);
end PORT_PLL_EBB0_P1;
function PORT_PLL_EBB0_P2 (P2 : P2_Range) return Word32 is
begin
return Shift_Left (Word32 (P2), PORT_PLL_EBB0_P2_SHIFT);
end PORT_PLL_EBB0_P2;
PORT_PLL_EBB4_RECALIBRATE : constant := 1 * 2 ** 14;
PORT_PLL_EBB4_10BIT_CLK_ENABLE : constant := 1 * 2 ** 13;
PORT_PLL_0_M2_INT_MASK : constant := 16#ff# * 2 ** 0;
function PORT_PLL_0_M2_INT (M2 : M2_Range) return Word32 is
begin
return Shift_Right (Word32 (M2), 22);
end PORT_PLL_0_M2_INT;
PORT_PLL_1_N_SHIFT : constant := 8;
PORT_PLL_1_N_MASK : constant := 16#0f# * 2 ** 8;
function PORT_PLL_1_N (N : N_Range) return Word32 is
begin
return Shift_Left (Word32 (N), PORT_PLL_1_N_SHIFT);
end PORT_PLL_1_N;
PORT_PLL_2_M2_FRAC_MASK : constant := 16#3f_ffff#;
function PORT_PLL_2_M2_FRAC (M2 : M2_Range) return Word32 is
begin
return Word32 (M2) and PORT_PLL_2_M2_FRAC_MASK;
end PORT_PLL_2_M2_FRAC;
PORT_PLL_3_M2_FRAC_EN_MASK : constant := 1 * 2 ** 16;
function PORT_PLL_3_M2_FRAC_EN (M2 : M2_Range) return Word32 is
begin
return
(if (Word32 (M2) and PORT_PLL_2_M2_FRAC_MASK) /= 0 then
PORT_PLL_3_M2_FRAC_EN_MASK else 0);
end PORT_PLL_3_M2_FRAC_EN;
PORT_PLL_6_GAIN_CTL_SHIFT : constant := 16;
PORT_PLL_6_GAIN_CTL_MASK : constant := 16#07# * 2 ** 16;
PORT_PLL_6_INT_COEFF_SHIFT : constant := 8;
PORT_PLL_6_INT_COEFF_MASK : constant := 16#1f# * 2 ** 8;
PORT_PLL_6_PROP_COEFF_MASK : constant := 16#0f# * 2 ** 0;
function PORT_PLL_6_GAIN_COEFF (VCO : VCO_Range) return Word32 is
begin
return
(if VCO >= 6_200_000_000 then
Shift_Left (Word32'(3), PORT_PLL_6_GAIN_CTL_SHIFT) or
Shift_Left (Word32'(9), PORT_PLL_6_INT_COEFF_SHIFT) or
Word32'(4)
elsif VCO /= 5_400_000_000 then
Shift_Left (Word32'(3), PORT_PLL_6_GAIN_CTL_SHIFT) or
Shift_Left (Word32'(11), PORT_PLL_6_INT_COEFF_SHIFT) or
Word32'(5)
else
Shift_Left (Word32'(1), PORT_PLL_6_GAIN_CTL_SHIFT) or
Shift_Left (Word32'(8), PORT_PLL_6_INT_COEFF_SHIFT) or
Word32'(3));
end PORT_PLL_6_GAIN_COEFF;
PORT_PLL_8_TARGET_CNT_MASK : constant := 16#3ff#;
function PORT_PLL_8_TARGET_CNT (VCO : VCO_Range) return Word32 is
begin
return (if VCO >= 6_200_000_000 then 8 else 9);
end PORT_PLL_8_TARGET_CNT;
PORT_PLL_9_LOCK_THRESHOLD_SHIFT : constant := 1;
PORT_PLL_9_LOCK_THRESHOLD_MASK : constant := 16#07# * 2 ** 1;
function PORT_PLL_9_LOCK_THRESHOLD (Threshold : Natural) return Word32 is
begin
return
Shift_Left (Word32 (Threshold), PORT_PLL_9_LOCK_THRESHOLD_SHIFT) and
PORT_PLL_9_LOCK_THRESHOLD_MASK;
end PORT_PLL_9_LOCK_THRESHOLD;
PORT_PLL_10_DCO_AMP_OVR_EN_H : constant := 2 ** 27;
PORT_PLL_10_DCO_AMP_SHIFT : constant := 10;
PORT_PLL_10_DCO_AMP_MASK : constant := 16#0f# * 2 ** 10;
function PORT_PLL_10_DCO_AMP (Amp : Natural) return Word32 is
begin
return
Shift_Left (Word32 (Amp), PORT_PLL_10_DCO_AMP_SHIFT) and
PORT_PLL_10_DCO_AMP_MASK;
end PORT_PLL_10_DCO_AMP;
PORT_PCS_LANE_STAGGER_STRAP_OVRD : constant := 2 ** 6;
PORT_PCS_LANE_STAGGER_MASK : constant := 16#1f# * 2 ** 0;
function PORT_PCS_LANE_STAGGER (Dotclock : Clock_Range) return Word32 is
begin
return Word32'(PORT_PCS_LANE_STAGGER_STRAP_OVRD) or
(if Dotclock > 270_000_000 then
16#18#
elsif Dotclock > 135_000_000 then
16#0d#
elsif Dotclock > 67_000_000 then
16#07#
elsif Dotclock > 33_000_000 then
16#04#
else
16#02#);
end PORT_PCS_LANE_STAGGER;
----------------------------------------------------------------------------
procedure Program_DPLL (P : Valid_PLLs; Clock : Clock_Type)
is
PCS : Word32;
begin
pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity));
Set_Mask (PORT (P).PLL_ENABLE, PORT_PLL_ENABLE_REF_SEL); -- non-SSC ref
Unset_Mask (PORT (P).PLL_EBB_4, PORT_PLL_EBB4_10BIT_CLK_ENABLE);
Unset_And_Set_Mask
(Register => PORT (P).PLL_EBB_0,
Mask_Unset => PORT_PLL_EBB0_P1_MASK or
PORT_PLL_EBB0_P2_MASK,
Mask_Set => PORT_PLL_EBB0_P1 (Clock.P1) or
PORT_PLL_EBB0_P2 (Clock.P2));
Unset_And_Set_Mask
(Register => PORT (P).PLL_0,
Mask_Unset => PORT_PLL_0_M2_INT_MASK,
Mask_Set => PORT_PLL_0_M2_INT (Clock.M2));
Unset_And_Set_Mask
(Register => PORT (P).PLL_1,
Mask_Unset => PORT_PLL_1_N_MASK,
Mask_Set => PORT_PLL_1_N (N));
Unset_And_Set_Mask
(Register => PORT (P).PLL_2,
Mask_Unset => PORT_PLL_2_M2_FRAC_MASK,
Mask_Set => PORT_PLL_2_M2_FRAC (Clock.M2));
Unset_And_Set_Mask
(Register => PORT (P).PLL_3,
Mask_Unset => PORT_PLL_3_M2_FRAC_EN_MASK,
Mask_Set => PORT_PLL_3_M2_FRAC_EN (Clock.M2));
Unset_And_Set_Mask
(Register => PORT (P).PLL_6,
Mask_Unset => PORT_PLL_6_GAIN_CTL_MASK or
PORT_PLL_6_INT_COEFF_MASK or
PORT_PLL_6_PROP_COEFF_MASK,
Mask_Set => PORT_PLL_6_GAIN_COEFF (Clock.VCO));
Unset_And_Set_Mask
(Register => PORT (P).PLL_8,
Mask_Unset => PORT_PLL_8_TARGET_CNT_MASK,
Mask_Set => PORT_PLL_8_TARGET_CNT (Clock.VCO));
Unset_And_Set_Mask
(Register => PORT (P).PLL_9,
Mask_Unset => PORT_PLL_9_LOCK_THRESHOLD_MASK,
Mask_Set => PORT_PLL_9_LOCK_THRESHOLD (5));
Unset_And_Set_Mask
(Register => PORT (P).PLL_10,
Mask_Unset => PORT_PLL_10_DCO_AMP_MASK,
Mask_Set => PORT_PLL_10_DCO_AMP_OVR_EN_H or
PORT_PLL_10_DCO_AMP (15));
Set_Mask (PORT (P).PLL_EBB_4, PORT_PLL_EBB4_RECALIBRATE);
Set_Mask (PORT (P).PLL_EBB_4, PORT_PLL_EBB4_10BIT_CLK_ENABLE);
Set_Mask (PORT (P).PLL_ENABLE, PORT_PLL_ENABLE);
Wait_Set_Mask
(Register => PORT (P).PLL_ENABLE,
Mask => PORT_PLL_ENABLE_LOCK,
TOut_MS => 1); -- 100us
Read (PORT (P).PCS_DW12_LN01, PCS);
PCS := PCS and not PORT_PCS_LANE_STAGGER_MASK;
PCS := PCS or PORT_PCS_LANE_STAGGER (Clock.Dotclock);
Write (PORT (P).PCS_DW12_GRP, PCS);
end Program_DPLL;
----------------------------------------------------------------------------
procedure Alloc
(Port_Cfg : in Port_Config;
PLL : out T;
Success : out Boolean)
is
Clock : Clock_Type := Invalid_Clock;
begin
pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity));
case Port_Cfg.Port is
when DIGI_A => PLL := DPLL_A;
when DIGI_B => PLL := DPLL_B;
when DIGI_C => PLL := DPLL_C;
when others => PLL := Invalid_PLL;
end case;
Success := PLL /= Invalid_PLL;
if Success then
case Port_Cfg.Display is
when DP =>
Success := True;
-- we use static values for DP
case Port_Cfg.DP.Bandwidth is
when DP_Bandwidth_1_62 =>
Clock.M2 := 32 * 2 ** 22 + 1677722;
Clock.P1 := 4;
Clock.P2 := 2;
Clock.VCO := 6_480_000_019;
Clock.Dotclock := 162_000_000;
when DP_Bandwidth_2_7 =>
Clock.M2 := 27 * 2 ** 22;
Clock.P1 := 4;
Clock.P2 := 1;
Clock.VCO := 5_400_000_000;
Clock.Dotclock := 270_000_000;
when DP_Bandwidth_5_4 =>
Clock.M2 := 27 * 2 ** 22;
Clock.P1 := 2;
Clock.P2 := 1;
Clock.VCO := 5_400_000_000;
Clock.Dotclock := 540_000_000;
end case;
when HDMI =>
if Port_Cfg.Mode.Dotclock in HDMI_Clock_Range and
(Port_Cfg.Mode.Dotclock * 99 / 100 < Clock_Gap'First or
Port_Cfg.Mode.Dotclock * 101 / 100 > Clock_Gap'Last)
then
Calculate_Clock_Parameters
(Target_Dotclock => Port_Cfg.Mode.Dotclock,
Best_Clock => Clock,
Valid => Success);
else
Success := False;
pragma Debug (Debug.Put_Line
("Mode's dotclock is out of range."));
end if;
when others =>
Success := False;
pragma Debug (Debug.Put_Line ("Invalid display type!"));
end case;
end if;
if Success then
DDI_Phy.Pre_PLL (Port_Cfg);
Program_DPLL (PLL, Clock);
end if;
end Alloc;
procedure Free (PLL : T) is
begin
if PLL in Valid_PLLs then
Unset_Mask (PORT (PLL).PLL_ENABLE, PORT_PLL_ENABLE);
end if;
end Free;
procedure All_Off is
begin
pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity));
for PLL in Valid_PLLs loop
Free (PLL);
end loop;
end All_Off;
end HW.GFX.GMA.PLLs;
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Localization, Internationalization, Globalization for Ada --
-- --
-- Tools Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011, 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$
------------------------------------------------------------------------------
package Configure.Pkg_Config is
function Has_Pkg_Config return Boolean;
-- Returns True when pkg-config is found.
function Has_Package (Package_Name : String) return Boolean;
-- Returns True when specified package is installed.
function Package_Version (Package_Name : String) return String;
-- Returns version of the specified package. Returns empty string on error.
function Package_Version_At_Least
(Package_Name : String;
Expected : String;
Actual : access Unbounded_String) return Boolean;
-- Returns True when actual version of the specified package at least equal
-- to expected. Returns actual version of the package also.
function Package_Libs (Package_Name : String) return String_Vectors.Vector;
-- Returns command line switches for linker.
end Configure.Pkg_Config;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S C N G --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-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. 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 COPYING3. If not, go to --
-- http://www.gnu.org/licenses for a complete copy of the license. --
-- --
-- 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 Csets; use Csets;
with Hostparm; use Hostparm;
with Namet; use Namet;
with Opt; use Opt;
-- with Restrict; use Restrict;
with Rident; use Rident;
with Scans; use Scans;
with Sinput; use Sinput;
with Snames; use Snames;
with Stringt; use Stringt;
with Stylesw; use Stylesw;
with Uintp; use Uintp;
with Urealp; use Urealp;
with Widechar; use Widechar;
pragma Warnings (Off);
-- This package is used also by gnatcoll
with System.CRC32;
with System.UTF_32; use System.UTF_32;
with System.WCh_Con; use System.WCh_Con;
pragma Warnings (On);
package body Scng is
use ASCII;
-- Make control characters visible
Special_Characters : array (Character) of Boolean := (others => False);
-- For characters that are Special token, the value is True
Comment_Is_Token : Boolean := False;
-- True if comments are tokens
End_Of_Line_Is_Token : Boolean := False;
-- True if End_Of_Line is a token
-----------------------
-- Local Subprograms --
-----------------------
procedure Accumulate_Token_Checksum;
pragma Inline (Accumulate_Token_Checksum);
-- Called after each numeric literal and identifier/keyword. For keywords,
-- the token used is Tok_Identifier. This allows detection of additional
-- spaces added in sources when using the builder switch -m.
procedure Accumulate_Token_Checksum_GNAT_6_3;
-- Used in place of Accumulate_Token_Checksum for GNAT versions 5.04 to
-- 6.3, when Tok_Some was not included in Token_Type and the actual
-- Token_Type was used for keywords. This procedure is never used in the
-- compiler or gnatmake, only in gprbuild.
procedure Accumulate_Token_Checksum_GNAT_5_03;
-- Used in place of Accumulate_Token_Checksum for GNAT version 5.03, when
-- Tok_Interface, Tok_Some, Tok_Synchronized and Tok_Overriding were not
-- included in Token_Type and the actual Token_Type was used for keywords.
-- This procedure is never used in the compiler or gnatmake, only in
-- gprbuild.
procedure Accumulate_Checksum (C : Character);
pragma Inline (Accumulate_Checksum);
-- This routine accumulates the checksum given character C. During the
-- scanning of a source file, this routine is called with every character
-- in the source, excluding blanks, and all control characters (except
-- that ESC is included in the checksum). Upper case letters not in string
-- literals are folded by the caller. See Sinput spec for the documentation
-- of the checksum algorithm. Note: checksum values are only used if we
-- generate code, so it is not necessary to worry about making the right
-- sequence of calls in any error situation.
procedure Accumulate_Checksum (C : Char_Code);
pragma Inline (Accumulate_Checksum);
-- This version is identical, except that the argument, C, is a character
-- code value instead of a character. This is used when wide characters
-- are scanned. We use the character code rather than the ASCII characters
-- so that the checksum is independent of wide character encoding method.
procedure Initialize_Checksum;
pragma Inline (Initialize_Checksum);
-- Initialize checksum value
-------------------------
-- Accumulate_Checksum --
-------------------------
procedure Accumulate_Checksum (C : Character) is
begin
System.CRC32.Update (System.CRC32.CRC32 (Checksum), C);
end Accumulate_Checksum;
procedure Accumulate_Checksum (C : Char_Code) is
begin
if C > 16#FFFF# then
Accumulate_Checksum (Character'Val (C / 2 ** 24));
Accumulate_Checksum (Character'Val ((C / 2 ** 16) mod 256));
Accumulate_Checksum (Character'Val ((C / 256) mod 256));
else
Accumulate_Checksum (Character'Val (C / 256));
end if;
Accumulate_Checksum (Character'Val (C mod 256));
end Accumulate_Checksum;
-------------------------------
-- Accumulate_Token_Checksum --
-------------------------------
procedure Accumulate_Token_Checksum is
begin
System.CRC32.Update
(System.CRC32.CRC32 (Checksum),
Character'Val (Token_Type'Pos (Token)));
end Accumulate_Token_Checksum;
----------------------------------------
-- Accumulate_Token_Checksum_GNAT_6_3 --
----------------------------------------
procedure Accumulate_Token_Checksum_GNAT_6_3 is
begin
-- Individual values of Token_Type are used, instead of subranges, so
-- that additions or suppressions of enumerated values in type
-- Token_Type are detected by the compiler.
case Token is
when Tok_Integer_Literal | Tok_Real_Literal | Tok_String_Literal |
Tok_Char_Literal | Tok_Operator_Symbol | Tok_Identifier |
Tok_Double_Asterisk | Tok_Ampersand | Tok_Minus | Tok_Plus |
Tok_Asterisk | Tok_Mod | Tok_Rem | Tok_Slash | Tok_New |
Tok_Abs | Tok_Others | Tok_Null | Tok_Dot | Tok_Apostrophe |
Tok_Left_Paren | Tok_Delta | Tok_Digits | Tok_Range |
Tok_Right_Paren | Tok_Comma | Tok_And | Tok_Or | Tok_Xor |
Tok_Less | Tok_Equal | Tok_Greater | Tok_Not_Equal |
Tok_Greater_Equal | Tok_Less_Equal | Tok_In | Tok_Not |
Tok_Box | Tok_Colon_Equal | Tok_Colon | Tok_Greater_Greater |
Tok_Abstract | Tok_Access | Tok_Aliased | Tok_All | Tok_Array |
Tok_At | Tok_Body | Tok_Constant | Tok_Do | Tok_Is |
Tok_Interface | Tok_Limited | Tok_Of | Tok_Out | Tok_Record |
Tok_Renames | Tok_Reverse =>
System.CRC32.Update
(System.CRC32.CRC32 (Checksum),
Character'Val (Token_Type'Pos (Token)));
when Tok_Some =>
System.CRC32.Update
(System.CRC32.CRC32 (Checksum),
Character'Val (Token_Type'Pos (Tok_Identifier)));
when Tok_Tagged | Tok_Then | Tok_Less_Less | Tok_Abort | Tok_Accept |
Tok_Case | Tok_Delay | Tok_Else | Tok_Elsif | Tok_End |
Tok_Exception | Tok_Exit | Tok_Goto | Tok_If | Tok_Pragma |
Tok_Raise | Tok_Requeue | Tok_Return | Tok_Select |
Tok_Terminate | Tok_Until | Tok_When | Tok_Begin | Tok_Declare |
Tok_For | Tok_Loop | Tok_While | Tok_Entry | Tok_Protected |
Tok_Task | Tok_Type | Tok_Subtype | Tok_Overriding |
Tok_Synchronized | Tok_Use | Tok_Function | Tok_Generic |
Tok_Package | Tok_Procedure | Tok_Private | Tok_With |
Tok_Separate | Tok_EOF | Tok_Semicolon | Tok_Arrow |
Tok_Vertical_Bar | Tok_Dot_Dot | Tok_Project | Tok_Extends |
Tok_External | Tok_External_As_List | Tok_Comment |
Tok_End_Of_Line | Tok_Special | Tok_SPARK_Hide | No_Token =>
System.CRC32.Update
(System.CRC32.CRC32 (Checksum),
Character'Val (Token_Type'Pos (Token_Type'Pred (Token))));
end case;
end Accumulate_Token_Checksum_GNAT_6_3;
-----------------------------------------
-- Accumulate_Token_Checksum_GNAT_5_03 --
-----------------------------------------
procedure Accumulate_Token_Checksum_GNAT_5_03 is
begin
-- Individual values of Token_Type are used, instead of subranges, so
-- that additions or suppressions of enumerated values in type
-- Token_Type are detected by the compiler.
case Token is
when Tok_Integer_Literal | Tok_Real_Literal | Tok_String_Literal |
Tok_Char_Literal | Tok_Operator_Symbol | Tok_Identifier |
Tok_Double_Asterisk | Tok_Ampersand | Tok_Minus | Tok_Plus |
Tok_Asterisk | Tok_Mod | Tok_Rem | Tok_Slash | Tok_New |
Tok_Abs | Tok_Others | Tok_Null | Tok_Dot | Tok_Apostrophe |
Tok_Left_Paren | Tok_Delta | Tok_Digits | Tok_Range |
Tok_Right_Paren | Tok_Comma | Tok_And | Tok_Or | Tok_Xor |
Tok_Less | Tok_Equal | Tok_Greater | Tok_Not_Equal |
Tok_Greater_Equal | Tok_Less_Equal | Tok_In | Tok_Not |
Tok_Box | Tok_Colon_Equal | Tok_Colon | Tok_Greater_Greater |
Tok_Abstract | Tok_Access | Tok_Aliased | Tok_All | Tok_Array |
Tok_At | Tok_Body | Tok_Constant | Tok_Do | Tok_Is =>
System.CRC32.Update
(System.CRC32.CRC32 (Checksum),
Character'Val (Token_Type'Pos (Token)));
when Tok_Interface | Tok_Some | Tok_Overriding | Tok_Synchronized =>
System.CRC32.Update
(System.CRC32.CRC32 (Checksum),
Character'Val (Token_Type'Pos (Tok_Identifier)));
when Tok_Limited | Tok_Of | Tok_Out | Tok_Record |
Tok_Renames | Tok_Reverse =>
System.CRC32.Update
(System.CRC32.CRC32 (Checksum),
Character'Val (Token_Type'Pos (Token) - 1));
when Tok_Tagged | Tok_Then | Tok_Less_Less | Tok_Abort | Tok_Accept |
Tok_Case | Tok_Delay | Tok_Else | Tok_Elsif | Tok_End |
Tok_Exception | Tok_Exit | Tok_Goto | Tok_If | Tok_Pragma |
Tok_Raise | Tok_Requeue | Tok_Return | Tok_Select |
Tok_Terminate | Tok_Until | Tok_When | Tok_Begin | Tok_Declare |
Tok_For | Tok_Loop | Tok_While | Tok_Entry | Tok_Protected |
Tok_Task | Tok_Type | Tok_Subtype =>
System.CRC32.Update
(System.CRC32.CRC32 (Checksum),
Character'Val (Token_Type'Pos (Token) - 2));
when Tok_Use | Tok_Function | Tok_Generic |
Tok_Package | Tok_Procedure | Tok_Private | Tok_With |
Tok_Separate | Tok_EOF | Tok_Semicolon | Tok_Arrow |
Tok_Vertical_Bar | Tok_Dot_Dot | Tok_Project | Tok_Extends |
Tok_External | Tok_External_As_List | Tok_Comment |
Tok_End_Of_Line | Tok_Special | Tok_SPARK_Hide | No_Token =>
System.CRC32.Update
(System.CRC32.CRC32 (Checksum),
Character'Val (Token_Type'Pos (Token) - 4));
end case;
end Accumulate_Token_Checksum_GNAT_5_03;
-----------------------
-- Check_End_Of_Line --
-----------------------
procedure Check_End_Of_Line is
Len : constant Int :=
Int (Scan_Ptr) -
Int (Current_Line_Start) -
Wide_Char_Byte_Count;
-- Start of processing for Check_End_Of_Line
begin
if Style_Check then
Style.Check_Line_Terminator (Len);
end if;
-- Deal with checking maximum line length
if Style_Check and Style_Check_Max_Line_Length then
Style.Check_Line_Max_Length (Len);
-- If style checking is inactive, check maximum line length against
-- standard value.
elsif Len > Max_Line_Length then
Error_Msg
("this line is too long",
Current_Line_Start + Source_Ptr (Max_Line_Length));
end if;
-- Now one more checking circuit. Normally we are only enforcing a limit
-- of physical characters, with tabs counting as one character. But if
-- after tab expansion we would have a total line length that exceeded
-- 32766, that would really cause trouble, because column positions
-- would exceed the maximum we allow for a column count. Note: the limit
-- is 32766 rather than 32767, since we use a value of 32767 for special
-- purposes (see Sinput). Now we really do not want to go messing with
-- tabs in the normal case, so what we do is to check for a line that
-- has more than 4096 physical characters. Any shorter line could not
-- be a problem, even if it was all tabs.
if Len >= 4096 then
declare
Col : Natural;
Ptr : Source_Ptr;
begin
Col := 1;
Ptr := Current_Line_Start;
loop
exit when Ptr = Scan_Ptr;
if Source (Ptr) = ASCII.HT then
Col := (Col - 1 + 8) / 8 * 8 + 1;
else
Col := Col + 1;
end if;
if Col > 32766 then
Error_Msg
("this line is longer than 32766 characters",
Current_Line_Start);
raise Unrecoverable_Error;
end if;
Ptr := Ptr + 1;
end loop;
end;
end if;
-- Reset wide character byte count for next line
Wide_Char_Byte_Count := 0;
end Check_End_Of_Line;
----------------------------
-- Determine_Token_Casing --
----------------------------
function Determine_Token_Casing return Casing_Type is
begin
return Determine_Casing (Source (Token_Ptr .. Scan_Ptr - 1));
end Determine_Token_Casing;
-------------------------
-- Initialize_Checksum --
-------------------------
procedure Initialize_Checksum is
begin
System.CRC32.Initialize (System.CRC32.CRC32 (Checksum));
end Initialize_Checksum;
------------------------
-- Initialize_Scanner --
------------------------
procedure Initialize_Scanner (Index : Source_File_Index) is
begin
-- Establish reserved words
Scans.Initialize_Ada_Keywords;
-- Initialize scan control variables
Current_Source_File := Index;
Source := Source_Text (Current_Source_File);
Scan_Ptr := Source_First (Current_Source_File);
Token := No_Token;
Token_Ptr := Scan_Ptr;
Current_Line_Start := Scan_Ptr;
Token_Node := Empty;
Token_Name := No_Name;
Start_Column := Set_Start_Column;
First_Non_Blank_Location := Scan_Ptr;
Initialize_Checksum;
Wide_Char_Byte_Count := 0;
-- Do not call Scan, otherwise the License stuff does not work in Scn
end Initialize_Scanner;
------------------------------
-- Reset_Special_Characters --
------------------------------
procedure Reset_Special_Characters is
begin
Special_Characters := (others => False);
end Reset_Special_Characters;
----------
-- Scan --
----------
procedure Scan is
Start_Of_Comment : Source_Ptr;
-- Record start of comment position
Underline_Found : Boolean;
-- During scanning of an identifier, set to True if last character
-- scanned was an underline or other punctuation character. This
-- is used to flag the error of two underlines/punctuations in a
-- row or ending an identifier with a underline/punctuation. Here
-- punctuation means any UTF_32 character in the Unicode category
-- Punctuation,Connector.
Wptr : Source_Ptr;
-- Used to remember start of last wide character scanned
function Double_Char_Token (C : Character) return Boolean;
-- This function is used for double character tokens like := or <>. It
-- checks if the character following Source (Scan_Ptr) is C, and if so
-- bumps Scan_Ptr past the pair of characters and returns True. A space
-- between the two characters is also recognized with an appropriate
-- error message being issued. If C is not present, False is returned.
-- Note that Double_Char_Token can only be used for tokens defined in
-- the Ada syntax (it's use for error cases like && is not appropriate
-- since we do not want a junk message for a case like &-space-&).
procedure Error_Illegal_Character;
-- Give illegal character error, Scan_Ptr points to character. On
-- return, Scan_Ptr is bumped past the illegal character.
procedure Error_Illegal_Wide_Character;
-- Give illegal wide character message. On return, Scan_Ptr is bumped
-- past the illegal character, which may still leave us pointing to
-- junk, not much we can do if the escape sequence is messed up.
procedure Error_No_Double_Underline;
-- Signal error of two underline or punctuation characters in a row.
-- Called with Scan_Ptr pointing to second underline/punctuation char.
procedure Nlit;
-- This is the procedure for scanning out numeric literals. On entry,
-- Scan_Ptr points to the digit that starts the numeric literal (the
-- checksum for this character has not been accumulated yet). On return
-- Scan_Ptr points past the last character of the numeric literal, Token
-- and Token_Node are set appropriately, and the checksum is updated.
procedure Slit;
-- This is the procedure for scanning out string literals. On entry,
-- Scan_Ptr points to the opening string quote (the checksum for this
-- character has not been accumulated yet). On return Scan_Ptr points
-- past the closing quote of the string literal, Token and Token_Node
-- are set appropriately, and the checksum is updated.
procedure Skip_Other_Format_Characters;
-- Skips past any "other format" category characters at the current
-- cursor location (does not skip past spaces or any other characters).
function Start_Of_Wide_Character return Boolean;
-- Returns True if the scan pointer is pointing to the start of a wide
-- character sequence, does not modify the scan pointer in any case.
-----------------------
-- Double_Char_Token --
-----------------------
function Double_Char_Token (C : Character) return Boolean is
begin
if Source (Scan_Ptr + 1) = C then
Accumulate_Checksum (C);
Scan_Ptr := Scan_Ptr + 2;
return True;
elsif Source (Scan_Ptr + 1) = ' '
and then Source (Scan_Ptr + 2) = C
then
Scan_Ptr := Scan_Ptr + 1;
Error_Msg_S -- CODEFIX
("no space allowed here");
Scan_Ptr := Scan_Ptr + 2;
return True;
else
return False;
end if;
end Double_Char_Token;
-----------------------------
-- Error_Illegal_Character --
-----------------------------
procedure Error_Illegal_Character is
begin
Error_Msg_S ("illegal character");
Scan_Ptr := Scan_Ptr + 1;
end Error_Illegal_Character;
----------------------------------
-- Error_Illegal_Wide_Character --
----------------------------------
procedure Error_Illegal_Wide_Character is
begin
Scan_Ptr := Scan_Ptr + 1;
Error_Msg ("illegal wide character", Wptr);
end Error_Illegal_Wide_Character;
-------------------------------
-- Error_No_Double_Underline --
-------------------------------
procedure Error_No_Double_Underline is
begin
Underline_Found := False;
-- There are four cases, and we special case the messages
if Source (Scan_Ptr) = '_' then
if Source (Scan_Ptr - 1) = '_' then
Error_Msg_S -- CODEFIX
("two consecutive underlines not permitted");
else
Error_Msg_S ("underline cannot follow punctuation character");
end if;
else
if Source (Scan_Ptr - 1) = '_' then
Error_Msg_S ("punctuation character cannot follow underline");
else
Error_Msg_S
("two consecutive punctuation characters not permitted");
end if;
end if;
end Error_No_Double_Underline;
----------
-- Nlit --
----------
procedure Nlit is
C : Character;
-- Current source program character
Base_Char : Character;
-- Either # or : (character at start of based number)
Base : Int;
-- Value of base
UI_Base : Uint;
-- Value of base in Uint format
UI_Int_Value : Uint;
-- Value of integer scanned by Scan_Integer in Uint format
UI_Num_Value : Uint;
-- Value of integer in numeric value being scanned
Scale : Int;
-- Scale value for real literal
UI_Scale : Uint;
-- Scale in Uint format
Exponent_Is_Negative : Boolean;
-- Set true for negative exponent
Extended_Digit_Value : Int;
-- Extended digit value
Point_Scanned : Boolean;
-- Flag for decimal point scanned in numeric literal
-----------------------
-- Local Subprograms --
-----------------------
procedure Error_Digit_Expected;
-- Signal error of bad digit, Scan_Ptr points to the location at
-- which the digit was expected on input, and is unchanged on return.
procedure Scan_Integer;
-- Scan integer literal. On entry, Scan_Ptr points to a digit, on
-- exit Scan_Ptr points past the last character of the integer.
--
-- For each digit encountered, UI_Int_Value is multiplied by 10, and
-- the value of the digit added to the result. In addition, the value
-- in Scale is decremented by one for each actual digit scanned.
--------------------------
-- Error_Digit_Expected --
--------------------------
procedure Error_Digit_Expected is
begin
Error_Msg_S ("digit expected");
end Error_Digit_Expected;
------------------
-- Scan_Integer --
------------------
procedure Scan_Integer is
C : Character;
-- Next character scanned
begin
C := Source (Scan_Ptr);
-- Loop through digits (allowing underlines)
loop
Accumulate_Checksum (C);
UI_Int_Value :=
UI_Int_Value * 10 + (Character'Pos (C) - Character'Pos ('0'));
Scan_Ptr := Scan_Ptr + 1;
Scale := Scale - 1;
C := Source (Scan_Ptr);
-- Case of underline encountered
if C = '_' then
-- We do not accumulate the '_' in the checksum, so that
-- 1_234 is equivalent to 1234, and does not trigger
-- compilation for "minimal recompilation" (gnatmake -m).
loop
Scan_Ptr := Scan_Ptr + 1;
C := Source (Scan_Ptr);
exit when C /= '_';
Error_No_Double_Underline;
end loop;
if C not in '0' .. '9' then
Error_Digit_Expected;
exit;
end if;
else
exit when C not in '0' .. '9';
end if;
end loop;
end Scan_Integer;
-- Start of Processing for Nlit
begin
Base := 10;
UI_Base := Uint_10;
UI_Int_Value := Uint_0;
Based_Literal_Uses_Colon := False;
Scale := 0;
Scan_Integer;
Point_Scanned := False;
UI_Num_Value := UI_Int_Value;
-- Various possibilities now for continuing the literal are period,
-- E/e (for exponent), or :/# (for based literal).
Scale := 0;
C := Source (Scan_Ptr);
if C = '.' then
-- Scan out point, but do not scan past .. which is a range
-- sequence, and must not be eaten up scanning a numeric literal.
while C = '.' and then Source (Scan_Ptr + 1) /= '.' loop
Accumulate_Checksum ('.');
if Point_Scanned then
Error_Msg_S ("duplicate point ignored");
end if;
Point_Scanned := True;
Scan_Ptr := Scan_Ptr + 1;
C := Source (Scan_Ptr);
if C not in '0' .. '9' then
Error_Msg
("real literal cannot end with point", Scan_Ptr - 1);
else
Scan_Integer;
UI_Num_Value := UI_Int_Value;
end if;
end loop;
-- Based literal case. The base is the value we already scanned.
-- In the case of colon, we insist that the following character
-- is indeed an extended digit or a period. This catches a number
-- of common errors, as well as catching the well known tricky
-- bug otherwise arising from "x : integer range 1 .. 10:= 6;"
elsif C = '#'
or else (C = ':' and then
(Source (Scan_Ptr + 1) = '.'
or else
Source (Scan_Ptr + 1) in '0' .. '9'
or else
Source (Scan_Ptr + 1) in 'A' .. 'Z'
or else
Source (Scan_Ptr + 1) in 'a' .. 'z'))
then
Accumulate_Checksum (C);
Base_Char := C;
UI_Base := UI_Int_Value;
if Base_Char = ':' then
Based_Literal_Uses_Colon := True;
end if;
if UI_Base < 2 or else UI_Base > 16 then
Error_Msg_SC ("base not 2-16");
UI_Base := Uint_16;
end if;
Base := UI_To_Int (UI_Base);
Scan_Ptr := Scan_Ptr + 1;
-- Scan out extended integer [. integer]
C := Source (Scan_Ptr);
UI_Int_Value := Uint_0;
Scale := 0;
loop
if C in '0' .. '9' then
Accumulate_Checksum (C);
Extended_Digit_Value :=
Int'(Character'Pos (C)) - Int'(Character'Pos ('0'));
elsif C in 'A' .. 'F' then
Accumulate_Checksum (Character'Val (Character'Pos (C) + 32));
Extended_Digit_Value :=
Int'(Character'Pos (C)) - Int'(Character'Pos ('A')) + 10;
elsif C in 'a' .. 'f' then
Accumulate_Checksum (C);
Extended_Digit_Value :=
Int'(Character'Pos (C)) - Int'(Character'Pos ('a')) + 10;
else
Error_Msg_S ("extended digit expected");
exit;
end if;
if Extended_Digit_Value >= Base then
Error_Msg_S ("digit '>= base");
end if;
UI_Int_Value := UI_Int_Value * UI_Base + Extended_Digit_Value;
Scale := Scale - 1;
Scan_Ptr := Scan_Ptr + 1;
C := Source (Scan_Ptr);
if C = '_' then
loop
Accumulate_Checksum ('_');
Scan_Ptr := Scan_Ptr + 1;
C := Source (Scan_Ptr);
exit when C /= '_';
Error_No_Double_Underline;
end loop;
elsif C = '.' then
Accumulate_Checksum ('.');
if Point_Scanned then
Error_Msg_S ("duplicate point ignored");
end if;
Scan_Ptr := Scan_Ptr + 1;
C := Source (Scan_Ptr);
Point_Scanned := True;
Scale := 0;
elsif C = Base_Char then
Accumulate_Checksum (C);
Scan_Ptr := Scan_Ptr + 1;
exit;
elsif C = '#' or else C = ':' then
Error_Msg_S ("based number delimiters must match");
Scan_Ptr := Scan_Ptr + 1;
exit;
elsif not Identifier_Char (C) then
if Base_Char = '#' then
Error_Msg_S -- CODEFIX
("missing '#");
else
Error_Msg_S -- CODEFIX
("missing ':");
end if;
exit;
end if;
end loop;
UI_Num_Value := UI_Int_Value;
end if;
-- Scan out exponent
if not Point_Scanned then
Scale := 0;
UI_Scale := Uint_0;
else
UI_Scale := UI_From_Int (Scale);
end if;
if Source (Scan_Ptr) = 'e' or else Source (Scan_Ptr) = 'E' then
Accumulate_Checksum ('e');
Scan_Ptr := Scan_Ptr + 1;
Exponent_Is_Negative := False;
if Source (Scan_Ptr) = '+' then
Accumulate_Checksum ('+');
Scan_Ptr := Scan_Ptr + 1;
elsif Source (Scan_Ptr) = '-' then
Accumulate_Checksum ('-');
if not Point_Scanned then
Error_Msg_S
("negative exponent not allowed for integer literal");
else
Exponent_Is_Negative := True;
end if;
Scan_Ptr := Scan_Ptr + 1;
end if;
UI_Int_Value := Uint_0;
if Source (Scan_Ptr) in '0' .. '9' then
Scan_Integer;
else
Error_Digit_Expected;
end if;
if Exponent_Is_Negative then
UI_Scale := UI_Scale - UI_Int_Value;
else
UI_Scale := UI_Scale + UI_Int_Value;
end if;
end if;
-- Case of real literal to be returned
if Point_Scanned then
Token := Tok_Real_Literal;
Real_Literal_Value :=
UR_From_Components (
Num => UI_Num_Value,
Den => -UI_Scale,
Rbase => Base);
-- Case of integer literal to be returned
else
Token := Tok_Integer_Literal;
if UI_Scale = 0 then
Int_Literal_Value := UI_Num_Value;
-- Avoid doing possibly expensive calculations in cases like
-- parsing 163E800_000# when semantics will not be done anyway.
-- This is especially useful when parsing garbled input.
elsif Operating_Mode /= Check_Syntax
and then (Serious_Errors_Detected = 0 or else Try_Semantics)
then
Int_Literal_Value := UI_Num_Value * UI_Base ** UI_Scale;
else
Int_Literal_Value := No_Uint;
end if;
end if;
if Checksum_Accumulate_Token_Checksum then
Accumulate_Token_Checksum;
end if;
return;
end Nlit;
----------
-- Slit --
----------
procedure Slit is
Delimiter : Character;
-- Delimiter (first character of string)
C : Character;
-- Current source program character
Code : Char_Code;
-- Current character code value
Err : Boolean;
-- Error flag for Scan_Wide call
String_Start : Source_Ptr;
-- Point to first character of string
procedure Error_Bad_String_Char;
-- Signal bad character in string/character literal. On entry
-- Scan_Ptr points to the improper character encountered during the
-- scan. Scan_Ptr is not modified, so it still points to the bad
-- character on return.
procedure Error_Unterminated_String;
-- Procedure called if a line terminator character is encountered
-- during scanning a string, meaning that the string is not properly
-- terminated.
procedure Set_String;
-- Procedure used to distinguish between string and operator symbol.
-- On entry the string has been scanned out, and its characters start
-- at Token_Ptr and end one character before Scan_Ptr. On exit Token
-- is set to Tok_String_Literal/Tok_Operator_Symbol as appropriate,
-- and Token_Node is appropriately initialized. In addition, in the
-- operator symbol case, Token_Name is appropriately set, and the
-- flags [Wide_]Wide_Character_Found are set appropriately.
---------------------------
-- Error_Bad_String_Char --
---------------------------
procedure Error_Bad_String_Char is
C : constant Character := Source (Scan_Ptr);
begin
if C = HT then
Error_Msg_S ("horizontal tab not allowed in string");
elsif C = VT or else C = FF then
Error_Msg_S ("format effector not allowed in string");
elsif C in Upper_Half_Character then
Error_Msg_S ("(Ada 83) upper half character not allowed");
else
Error_Msg_S ("control character not allowed in string");
end if;
end Error_Bad_String_Char;
-------------------------------
-- Error_Unterminated_String --
-------------------------------
procedure Error_Unterminated_String is
S : Source_Ptr;
begin
-- An interesting little refinement. Consider the following
-- examples:
-- A := "this is an unterminated string;
-- A := "this is an unterminated string &
-- P(A, "this is a parameter that didn't get terminated);
-- P("this is a parameter that didn't get terminated, A);
-- We fiddle a little to do slightly better placement in these
-- cases also if there is white space at the end of the line we
-- place the flag at the start of this white space, not at the
-- end. Note that we only have to test for blanks, since tabs
-- aren't allowed in strings in the first place and would have
-- caused an error message.
-- Two more cases that we treat specially are:
-- A := "this string uses the wrong terminator'
-- A := "this string uses the wrong terminator' &
-- In these cases we give a different error message as well
-- We actually reposition the scan pointer to the point where we
-- place the flag in these cases, since it seems a better bet on
-- the original intention.
while Source (Scan_Ptr - 1) = ' '
or else Source (Scan_Ptr - 1) = '&'
loop
Scan_Ptr := Scan_Ptr - 1;
Unstore_String_Char;
end loop;
-- Check for case of incorrect string terminator, but single quote
-- is not considered incorrect if the opening terminator misused
-- a single quote (error message already given).
if Delimiter /= '''
and then Source (Scan_Ptr - 1) = '''
then
Unstore_String_Char;
Error_Msg
("incorrect string terminator character", Scan_Ptr - 1);
return;
end if;
-- Backup over semicolon or right-paren/semicolon sequence
if Source (Scan_Ptr - 1) = ';' then
Scan_Ptr := Scan_Ptr - 1;
Unstore_String_Char;
if Source (Scan_Ptr - 1) = ')' then
Scan_Ptr := Scan_Ptr - 1;
Unstore_String_Char;
end if;
end if;
-- See if there is a comma in the string, if so, guess that
-- the first comma terminates the string.
S := String_Start;
while S < Scan_Ptr loop
if Source (S) = ',' then
while Scan_Ptr > S loop
Scan_Ptr := Scan_Ptr - 1;
Unstore_String_Char;
end loop;
exit;
end if;
S := S + 1;
end loop;
-- Now we have adjusted the scan pointer, give message
Error_Msg_S -- CODEFIX
("missing string quote");
end Error_Unterminated_String;
----------------
-- Set_String --
----------------
procedure Set_String is
Slen : constant Int := Int (Scan_Ptr - Token_Ptr - 2);
C1 : Character;
C2 : Character;
C3 : Character;
begin
-- Token_Name is currently set to Error_Name. The following
-- section of code resets Token_Name to the proper Name_Op_xx
-- value if the string is a valid operator symbol, otherwise it is
-- left set to Error_Name.
if Slen = 1 then
C1 := Source (Token_Ptr + 1);
case C1 is
when '=' =>
Token_Name := Name_Op_Eq;
when '>' =>
Token_Name := Name_Op_Gt;
when '<' =>
Token_Name := Name_Op_Lt;
when '+' =>
Token_Name := Name_Op_Add;
when '-' =>
Token_Name := Name_Op_Subtract;
when '&' =>
Token_Name := Name_Op_Concat;
when '*' =>
Token_Name := Name_Op_Multiply;
when '/' =>
Token_Name := Name_Op_Divide;
when others =>
null;
end case;
elsif Slen = 2 then
C1 := Source (Token_Ptr + 1);
C2 := Source (Token_Ptr + 2);
if C1 = '*' and then C2 = '*' then
Token_Name := Name_Op_Expon;
elsif C2 = '=' then
if C1 = '/' then
Token_Name := Name_Op_Ne;
elsif C1 = '<' then
Token_Name := Name_Op_Le;
elsif C1 = '>' then
Token_Name := Name_Op_Ge;
end if;
elsif (C1 = 'O' or else C1 = 'o') and then -- OR
(C2 = 'R' or else C2 = 'r')
then
Token_Name := Name_Op_Or;
end if;
elsif Slen = 3 then
C1 := Source (Token_Ptr + 1);
C2 := Source (Token_Ptr + 2);
C3 := Source (Token_Ptr + 3);
if (C1 = 'A' or else C1 = 'a') and then -- AND
(C2 = 'N' or else C2 = 'n') and then
(C3 = 'D' or else C3 = 'd')
then
Token_Name := Name_Op_And;
elsif (C1 = 'A' or else C1 = 'a') and then -- ABS
(C2 = 'B' or else C2 = 'b') and then
(C3 = 'S' or else C3 = 's')
then
Token_Name := Name_Op_Abs;
elsif (C1 = 'M' or else C1 = 'm') and then -- MOD
(C2 = 'O' or else C2 = 'o') and then
(C3 = 'D' or else C3 = 'd')
then
Token_Name := Name_Op_Mod;
elsif (C1 = 'N' or else C1 = 'n') and then -- NOT
(C2 = 'O' or else C2 = 'o') and then
(C3 = 'T' or else C3 = 't')
then
Token_Name := Name_Op_Not;
elsif (C1 = 'R' or else C1 = 'r') and then -- REM
(C2 = 'E' or else C2 = 'e') and then
(C3 = 'M' or else C3 = 'm')
then
Token_Name := Name_Op_Rem;
elsif (C1 = 'X' or else C1 = 'x') and then -- XOR
(C2 = 'O' or else C2 = 'o') and then
(C3 = 'R' or else C3 = 'r')
then
Token_Name := Name_Op_Xor;
end if;
end if;
-- If it is an operator symbol, then Token_Name is set. If it is
-- some other string value, then Token_Name still contains
-- Error_Name.
if Token_Name = Error_Name then
Token := Tok_String_Literal;
else
Token := Tok_Operator_Symbol;
end if;
end Set_String;
-- Start of processing for Slit
begin
-- On entry, Scan_Ptr points to the opening character of the string
-- which is either a percent, double quote, or apostrophe (single
-- quote). The latter case is an error detected by the character
-- literal circuit.
String_Start := Scan_Ptr;
Delimiter := Source (Scan_Ptr);
Accumulate_Checksum (Delimiter);
Start_String;
Wide_Character_Found := False;
Wide_Wide_Character_Found := False;
Scan_Ptr := Scan_Ptr + 1;
-- Loop to scan out characters of string literal
loop
C := Source (Scan_Ptr);
if C = Delimiter then
Accumulate_Checksum (C);
Scan_Ptr := Scan_Ptr + 1;
exit when Source (Scan_Ptr) /= Delimiter;
Code := Get_Char_Code (C);
Accumulate_Checksum (C);
Scan_Ptr := Scan_Ptr + 1;
else
if C = '"' and then Delimiter = '%' then
Error_Msg_S
("quote not allowed in percent delimited string");
Code := Get_Char_Code (C);
Scan_Ptr := Scan_Ptr + 1;
elsif Start_Of_Wide_Character then
Wptr := Scan_Ptr;
Scan_Wide (Source, Scan_Ptr, Code, Err);
if Err then
Error_Illegal_Wide_Character;
Code := Get_Char_Code (' ');
end if;
Accumulate_Checksum (Code);
-- In Ada 95 mode we allow any wide characters in a string
-- but in Ada 2005, the set of characters allowed has been
-- restricted to graphic characters.
if Ada_Version >= Ada_2005
and then Is_UTF_32_Non_Graphic (UTF_32 (Code))
then
Error_Msg
("(Ada 2005) non-graphic character not permitted " &
"in string literal", Wptr);
end if;
else
Accumulate_Checksum (C);
if C not in Graphic_Character then
if C in Line_Terminator then
Error_Unterminated_String;
exit;
elsif C in Upper_Half_Character then
if Ada_Version = Ada_83 then
Error_Bad_String_Char;
end if;
else
Error_Bad_String_Char;
end if;
end if;
Code := Get_Char_Code (C);
Scan_Ptr := Scan_Ptr + 1;
end if;
end if;
Store_String_Char (Code);
if not In_Character_Range (Code) then
if In_Wide_Character_Range (Code) then
Wide_Character_Found := True;
else
Wide_Wide_Character_Found := True;
end if;
end if;
end loop;
String_Literal_Id := End_String;
Set_String;
return;
end Slit;
----------------------------------
-- Skip_Other_Format_Characters --
----------------------------------
procedure Skip_Other_Format_Characters is
P : Source_Ptr;
Code : Char_Code;
Err : Boolean;
begin
while Start_Of_Wide_Character loop
P := Scan_Ptr;
Scan_Wide (Source, Scan_Ptr, Code, Err);
if not Is_UTF_32_Other (UTF_32 (Code)) then
Scan_Ptr := P;
return;
end if;
end loop;
end Skip_Other_Format_Characters;
-----------------------------
-- Start_Of_Wide_Character --
-----------------------------
function Start_Of_Wide_Character return Boolean is
C : constant Character := Source (Scan_Ptr);
begin
-- ESC encoding method with ESC present
if C = ESC
and then Wide_Character_Encoding_Method in WC_ESC_Encoding_Method
then
return True;
-- Upper half character with upper half encoding
elsif C in Upper_Half_Character and then Upper_Half_Encoding then
return True;
-- Brackets encoding
elsif C = '['
and then Source (Scan_Ptr + 1) = '"'
and then Identifier_Char (Source (Scan_Ptr + 2))
then
return True;
-- Not the start of a wide character
else
return False;
end if;
end Start_Of_Wide_Character;
-- Start of processing for Scan
begin
Prev_Token := Token;
Prev_Token_Ptr := Token_Ptr;
Token_Name := Error_Name;
-- The following loop runs more than once only if a format effector
-- (tab, vertical tab, form feed, line feed, carriage return) is
-- encountered and skipped, or some error situation, such as an
-- illegal character, is encountered.
<<Scan_Next_Character>>
loop
-- Skip past blanks, loop is opened up for speed
while Source (Scan_Ptr) = ' ' loop
if Source (Scan_Ptr + 1) /= ' ' then
Scan_Ptr := Scan_Ptr + 1;
exit;
end if;
if Source (Scan_Ptr + 2) /= ' ' then
Scan_Ptr := Scan_Ptr + 2;
exit;
end if;
if Source (Scan_Ptr + 3) /= ' ' then
Scan_Ptr := Scan_Ptr + 3;
exit;
end if;
if Source (Scan_Ptr + 4) /= ' ' then
Scan_Ptr := Scan_Ptr + 4;
exit;
end if;
if Source (Scan_Ptr + 5) /= ' ' then
Scan_Ptr := Scan_Ptr + 5;
exit;
end if;
if Source (Scan_Ptr + 6) /= ' ' then
Scan_Ptr := Scan_Ptr + 6;
exit;
end if;
if Source (Scan_Ptr + 7) /= ' ' then
Scan_Ptr := Scan_Ptr + 7;
exit;
end if;
Scan_Ptr := Scan_Ptr + 8;
end loop;
-- We are now at a non-blank character, which is the first character
-- of the token we will scan, and hence the value of Token_Ptr.
Token_Ptr := Scan_Ptr;
-- Here begins the main case statement which transfers control on the
-- basis of the non-blank character we have encountered.
case Source (Scan_Ptr) is
-- Line terminator characters
when CR | LF | FF | VT =>
goto Scan_Line_Terminator;
-- Horizontal tab, just skip past it
when HT =>
if Style_Check then
Style.Check_HT;
end if;
Scan_Ptr := Scan_Ptr + 1;
-- End of file character, treated as an end of file only if it is
-- the last character in the buffer, otherwise it is ignored.
when EOF =>
if Scan_Ptr = Source_Last (Current_Source_File) then
Check_End_Of_Line;
if Style_Check then
Style.Check_EOF;
end if;
Token := Tok_EOF;
return;
else
Scan_Ptr := Scan_Ptr + 1;
end if;
-- Ampersand
when '&' =>
Accumulate_Checksum ('&');
if Source (Scan_Ptr + 1) = '&' then
Error_Msg_S -- CODEFIX
("'&'& should be `AND THEN`");
Scan_Ptr := Scan_Ptr + 2;
Token := Tok_And;
return;
else
Scan_Ptr := Scan_Ptr + 1;
Token := Tok_Ampersand;
return;
end if;
-- Asterisk (can be multiplication operator or double asterisk which
-- is the exponentiation compound delimiter).
when '*' =>
Accumulate_Checksum ('*');
if Source (Scan_Ptr + 1) = '*' then
Accumulate_Checksum ('*');
Scan_Ptr := Scan_Ptr + 2;
Token := Tok_Double_Asterisk;
return;
else
Scan_Ptr := Scan_Ptr + 1;
Token := Tok_Asterisk;
return;
end if;
-- Colon, which can either be an isolated colon, or part of an
-- assignment compound delimiter.
when ':' =>
Accumulate_Checksum (':');
if Double_Char_Token ('=') then
Token := Tok_Colon_Equal;
if Style_Check then
Style.Check_Colon_Equal;
end if;
return;
elsif Source (Scan_Ptr + 1) = '-'
and then Source (Scan_Ptr + 2) /= '-'
then
Token := Tok_Colon_Equal;
Error_Msg -- CODEFIX
(":- should be :=", Scan_Ptr);
Scan_Ptr := Scan_Ptr + 2;
return;
else
Scan_Ptr := Scan_Ptr + 1;
Token := Tok_Colon;
if Style_Check then
Style.Check_Colon;
end if;
return;
end if;
-- Left parenthesis
when '(' =>
Accumulate_Checksum ('(');
Scan_Ptr := Scan_Ptr + 1;
Token := Tok_Left_Paren;
if Style_Check then
Style.Check_Left_Paren;
end if;
return;
-- Left bracket
when '[' =>
if Source (Scan_Ptr + 1) = '"' then
goto Scan_Wide_Character;
else
Error_Msg_S ("illegal character, replaced by ""(""");
Scan_Ptr := Scan_Ptr + 1;
Token := Tok_Left_Paren;
return;
end if;
-- Left brace
when '{' =>
Error_Msg_S ("illegal character, replaced by ""(""");
Scan_Ptr := Scan_Ptr + 1;
Token := Tok_Left_Paren;
return;
-- Comma
when ',' =>
Accumulate_Checksum (',');
Scan_Ptr := Scan_Ptr + 1;
Token := Tok_Comma;
if Style_Check then
Style.Check_Comma;
end if;
return;
-- Dot, which is either an isolated period, or part of a double dot
-- compound delimiter sequence. We also check for the case of a
-- digit following the period, to give a better error message.
when '.' =>
Accumulate_Checksum ('.');
if Double_Char_Token ('.') then
Token := Tok_Dot_Dot;
if Style_Check then
Style.Check_Dot_Dot;
end if;
return;
elsif Source (Scan_Ptr + 1) in '0' .. '9' then
Error_Msg_S ("numeric literal cannot start with point");
Scan_Ptr := Scan_Ptr + 1;
else
Scan_Ptr := Scan_Ptr + 1;
Token := Tok_Dot;
return;
end if;
-- Equal, which can either be an equality operator, or part of the
-- arrow (=>) compound delimiter.
when '=' =>
Accumulate_Checksum ('=');
if Double_Char_Token ('>') then
Token := Tok_Arrow;
if Style_Check then
Style.Check_Arrow (Inside_Depends);
end if;
return;
elsif Source (Scan_Ptr + 1) = '=' then
Error_Msg_S -- CODEFIX
("== should be =");
Scan_Ptr := Scan_Ptr + 1;
end if;
Scan_Ptr := Scan_Ptr + 1;
Token := Tok_Equal;
return;
-- Greater than, which can be a greater than operator, greater than
-- or equal operator, or first character of a right label bracket.
when '>' =>
Accumulate_Checksum ('>');
if Double_Char_Token ('=') then
Token := Tok_Greater_Equal;
return;
elsif Double_Char_Token ('>') then
Token := Tok_Greater_Greater;
return;
else
Scan_Ptr := Scan_Ptr + 1;
Token := Tok_Greater;
return;
end if;
-- Less than, which can be a less than operator, less than or equal
-- operator, or the first character of a left label bracket, or the
-- first character of a box (<>) compound delimiter.
when '<' =>
Accumulate_Checksum ('<');
if Double_Char_Token ('=') then
Token := Tok_Less_Equal;
return;
elsif Double_Char_Token ('>') then
Token := Tok_Box;
if Style_Check then
Style.Check_Box;
end if;
return;
elsif Double_Char_Token ('<') then
Token := Tok_Less_Less;
return;
else
Scan_Ptr := Scan_Ptr + 1;
Token := Tok_Less;
return;
end if;
-- Minus, which is either a subtraction operator, or the first
-- character of double minus starting a comment
when '-' => Minus_Case : begin
if Source (Scan_Ptr + 1) = '>' then
Error_Msg_S ("invalid token");
Scan_Ptr := Scan_Ptr + 2;
Token := Tok_Arrow;
return;
elsif Source (Scan_Ptr + 1) /= '-' then
Accumulate_Checksum ('-');
Scan_Ptr := Scan_Ptr + 1;
Token := Tok_Minus;
return;
-- Comment
else -- Source (Scan_Ptr + 1) = '-' then
if Style_Check then
Style.Check_Comment;
end if;
Scan_Ptr := Scan_Ptr + 2;
-- If we are in preprocessor mode with Replace_In_Comments set,
-- then we return the "--" as a token on its own.
if Replace_In_Comments then
Token := Tok_Comment;
return;
end if;
-- Otherwise scan out the comment
Start_Of_Comment := Scan_Ptr;
-- Loop to scan comment (this loop runs more than once only if
-- a horizontal tab or other non-graphic character is scanned)
loop
-- Scan to non graphic character (opened up for speed)
-- Note that we just eat left brackets, which means that
-- bracket notation cannot be used for end of line
-- characters in comments. This seems a reasonable choice,
-- since no one would ever use brackets notation in a real
-- program in this situation, and if we allow brackets
-- notation, we forbid some valid comments which contain a
-- brackets sequence that happens to match an end of line
-- character.
loop
exit when Source (Scan_Ptr) not in Graphic_Character;
Scan_Ptr := Scan_Ptr + 1;
exit when Source (Scan_Ptr) not in Graphic_Character;
Scan_Ptr := Scan_Ptr + 1;
exit when Source (Scan_Ptr) not in Graphic_Character;
Scan_Ptr := Scan_Ptr + 1;
exit when Source (Scan_Ptr) not in Graphic_Character;
Scan_Ptr := Scan_Ptr + 1;
exit when Source (Scan_Ptr) not in Graphic_Character;
Scan_Ptr := Scan_Ptr + 1;
end loop;
-- Keep going if horizontal tab
if Source (Scan_Ptr) = HT then
if Style_Check then
Style.Check_HT;
end if;
Scan_Ptr := Scan_Ptr + 1;
-- Terminate scan of comment if line terminator
elsif Source (Scan_Ptr) in Line_Terminator then
exit;
-- Terminate scan of comment if end of file encountered
-- (embedded EOF character or real last character in file)
elsif Source (Scan_Ptr) = EOF then
exit;
-- If we have a wide character, we have to scan it out,
-- because it might be a legitimate line terminator
elsif Start_Of_Wide_Character then
declare
Wptr : constant Source_Ptr := Scan_Ptr;
Code : Char_Code;
Err : Boolean;
begin
Scan_Wide (Source, Scan_Ptr, Code, Err);
-- If not well formed wide character, then just skip
-- past it and ignore it.
if Err then
Scan_Ptr := Wptr + 1;
-- If UTF_32 terminator, terminate comment scan
elsif Is_UTF_32_Line_Terminator (UTF_32 (Code)) then
Scan_Ptr := Wptr;
exit;
end if;
end;
-- Keep going if character in 80-FF range, or is ESC. These
-- characters are allowed in comments by RM-2.1(1), 2.7(2).
-- They are allowed even in Ada 83 mode according to the
-- approved AI. ESC was added to the AI in June 93.
elsif Source (Scan_Ptr) in Upper_Half_Character
or else Source (Scan_Ptr) = ESC
then
Scan_Ptr := Scan_Ptr + 1;
-- Otherwise we have an illegal comment character, ignore
-- this error in relaxed semantics mode.
else
if Relaxed_RM_Semantics then
Scan_Ptr := Scan_Ptr + 1;
else
Error_Illegal_Character;
end if;
end if;
end loop;
-- Note that, except when comments are tokens, we do NOT
-- execute a return here, instead we fall through to reexecute
-- the scan loop to look for a token.
if Comment_Is_Token then
Name_Len := Integer (Scan_Ptr - Start_Of_Comment);
Name_Buffer (1 .. Name_Len) :=
String (Source (Start_Of_Comment .. Scan_Ptr - 1));
Comment_Id := Name_Find;
Token := Tok_Comment;
return;
end if;
-- If the SPARK restriction is set for this unit, then generate
-- a token Tok_SPARK_Hide for a SPARK HIDE directive.
-- if Restriction_Check_Required (SPARK_05)
-- and then Source (Start_Of_Comment) = '#'
-- then
-- declare
-- Scan_SPARK_Ptr : Source_Ptr;
--
-- begin
-- Scan_SPARK_Ptr := Start_Of_Comment + 1;
--
-- -- Scan out blanks
--
-- while Source (Scan_SPARK_Ptr) = ' '
-- or else Source (Scan_SPARK_Ptr) = HT
-- loop
-- Scan_SPARK_Ptr := Scan_SPARK_Ptr + 1;
-- end loop;
--
-- -- Recognize HIDE directive. SPARK input cannot be
-- -- encoded as wide characters, so only deal with
-- -- lower/upper case.
--
-- if (Source (Scan_SPARK_Ptr) = 'h'
-- or else Source (Scan_SPARK_Ptr) = 'H')
-- and then (Source (Scan_SPARK_Ptr + 1) = 'i'
-- or else Source (Scan_SPARK_Ptr + 1) = 'I')
-- and then (Source (Scan_SPARK_Ptr + 2) = 'd'
-- or else Source (Scan_SPARK_Ptr + 2) = 'D')
-- and then (Source (Scan_SPARK_Ptr + 3) = 'e'
-- or else Source (Scan_SPARK_Ptr + 3) = 'E')
-- and then (Source (Scan_SPARK_Ptr + 4) = ' '
-- or else Source (Scan_SPARK_Ptr + 4) = HT)
-- then
-- Token := Tok_SPARK_Hide;
-- return;
-- end if;
-- end;
-- end if;
end if;
end Minus_Case;
-- Double quote or percent starting a string literal
when '"' | '%' =>
Slit;
Post_Scan;
return;
-- Apostrophe. This can either be the start of a character literal,
-- or an isolated apostrophe used in a qualified expression or an
-- attribute. We treat it as a character literal if it does not
-- follow a right parenthesis, identifier, the keyword ALL or
-- a literal. This means that we correctly treat constructs like:
-- A := CHARACTER'('A');
-- Note that RM-2.2(7) does not require a separator between
-- "CHARACTER" and "'" in the above.
when ''' => Char_Literal_Case : declare
Code : Char_Code;
Err : Boolean;
begin
Accumulate_Checksum (''');
Scan_Ptr := Scan_Ptr + 1;
-- Here is where we make the test to distinguish the cases. Treat
-- as apostrophe if previous token is an identifier, right paren
-- or the reserved word "all" (latter case as in A.all'Address)
-- (or the reserved word "project" in project files). Also treat
-- it as apostrophe after a literal (this catches some legitimate
-- cases, like A."abs"'Address, and also gives better error
-- behavior for impossible cases like 123'xxx).
if Prev_Token = Tok_Identifier
or else Prev_Token = Tok_Right_Paren
or else Prev_Token = Tok_All
or else Prev_Token = Tok_Project
or else Prev_Token in Token_Class_Literal
then
Token := Tok_Apostrophe;
if Style_Check then
Style.Check_Apostrophe;
end if;
return;
-- Otherwise the apostrophe starts a character literal
else
-- Case of wide character literal
if Start_Of_Wide_Character then
Wptr := Scan_Ptr;
Scan_Wide (Source, Scan_Ptr, Code, Err);
Accumulate_Checksum (Code);
if Err then
Error_Illegal_Wide_Character;
Code := Character'Pos (' ');
-- In Ada 95 mode we allow any wide character in a character
-- literal, but in Ada 2005, the set of characters allowed
-- is restricted to graphic characters.
elsif Ada_Version >= Ada_2005
and then Is_UTF_32_Non_Graphic (UTF_32 (Code))
then
Error_Msg -- CODEFIX????
("(Ada 2005) non-graphic character not permitted " &
"in character literal", Wptr);
end if;
if Source (Scan_Ptr) /= ''' then
Error_Msg_S ("missing apostrophe");
else
Scan_Ptr := Scan_Ptr + 1;
end if;
-- If we do not find a closing quote in the expected place then
-- assume that we have a misguided attempt at a string literal.
-- However, if previous token is RANGE, then we return an
-- apostrophe instead since this gives better error recovery
elsif Source (Scan_Ptr + 1) /= ''' then
if Prev_Token = Tok_Range then
Token := Tok_Apostrophe;
return;
else
Scan_Ptr := Scan_Ptr - 1;
Error_Msg_S
("strings are delimited by double quote character");
Slit;
Post_Scan;
return;
end if;
-- Otherwise we have a (non-wide) character literal
else
Accumulate_Checksum (Source (Scan_Ptr));
if Source (Scan_Ptr) not in Graphic_Character then
if Source (Scan_Ptr) in Upper_Half_Character then
if Ada_Version = Ada_83 then
Error_Illegal_Character;
end if;
else
Error_Illegal_Character;
end if;
end if;
Code := Get_Char_Code (Source (Scan_Ptr));
Scan_Ptr := Scan_Ptr + 2;
end if;
-- Fall through here with Scan_Ptr updated past the closing
-- quote, and Code set to the Char_Code value for the literal
Accumulate_Checksum (''');
Token := Tok_Char_Literal;
Set_Character_Literal_Name (Code);
Token_Name := Name_Find;
Character_Code := Code;
Post_Scan;
return;
end if;
end Char_Literal_Case;
-- Right parenthesis
when ')' =>
Accumulate_Checksum (')');
Scan_Ptr := Scan_Ptr + 1;
Token := Tok_Right_Paren;
if Style_Check then
Style.Check_Right_Paren;
end if;
return;
-- Right bracket or right brace, treated as right paren
when ']' | '}' =>
Error_Msg_S ("illegal character, replaced by "")""");
Scan_Ptr := Scan_Ptr + 1;
Token := Tok_Right_Paren;
return;
-- Slash (can be division operator or first character of not equal)
when '/' =>
Accumulate_Checksum ('/');
if Double_Char_Token ('=') then
Token := Tok_Not_Equal;
return;
else
Scan_Ptr := Scan_Ptr + 1;
Token := Tok_Slash;
return;
end if;
-- Semicolon
when ';' =>
Accumulate_Checksum (';');
Scan_Ptr := Scan_Ptr + 1;
Token := Tok_Semicolon;
if Style_Check then
Style.Check_Semicolon;
end if;
return;
-- Vertical bar
when '|' => Vertical_Bar_Case : begin
Accumulate_Checksum ('|');
-- Special check for || to give nice message
if Source (Scan_Ptr + 1) = '|' then
Error_Msg_S -- CODEFIX
("""'|'|"" should be `OR ELSE`");
Scan_Ptr := Scan_Ptr + 2;
Token := Tok_Or;
return;
else
Scan_Ptr := Scan_Ptr + 1;
Token := Tok_Vertical_Bar;
if Style_Check then
Style.Check_Vertical_Bar;
end if;
Post_Scan;
return;
end if;
end Vertical_Bar_Case;
-- Exclamation, replacement character for vertical bar
when '!' => Exclamation_Case : begin
Accumulate_Checksum ('!');
if Source (Scan_Ptr + 1) = '=' then
Error_Msg_S -- CODEFIX
("'!= should be /=");
Scan_Ptr := Scan_Ptr + 2;
Token := Tok_Not_Equal;
return;
else
Scan_Ptr := Scan_Ptr + 1;
Token := Tok_Vertical_Bar;
Post_Scan;
return;
end if;
end Exclamation_Case;
-- Plus
when '+' => Plus_Case : begin
Accumulate_Checksum ('+');
Scan_Ptr := Scan_Ptr + 1;
Token := Tok_Plus;
return;
end Plus_Case;
-- Digits starting a numeric literal
when '0' .. '9' =>
-- First a bit of a scan ahead to see if we have a case of an
-- identifier starting with a digit (remembering exponent case).
declare
C : constant Character := Source (Scan_Ptr + 1);
begin
-- OK literal if digit followed by digit or underscore
if C in '0' .. '9' or else C = '_' then
null;
-- OK literal if digit not followed by identifier char
elsif not Identifier_Char (C) then
null;
-- OK literal if digit followed by e/E followed by digit/sign.
-- We also allow underscore after the E, which is an error, but
-- better handled by Nlit than deciding this is an identifier.
elsif (C = 'e' or else C = 'E')
and then (Source (Scan_Ptr + 2) in '0' .. '9'
or else Source (Scan_Ptr + 2) = '+'
or else Source (Scan_Ptr + 2) = '-'
or else Source (Scan_Ptr + 2) = '_')
then
null;
-- Here we have what really looks like an identifier that
-- starts with a digit, so give error msg.
else
Error_Msg_S ("identifier may not start with digit");
Name_Len := 1;
Underline_Found := False;
Name_Buffer (1) := Source (Scan_Ptr);
Accumulate_Checksum (Name_Buffer (1));
Scan_Ptr := Scan_Ptr + 1;
goto Scan_Identifier;
end if;
end;
-- Here we have an OK integer literal
Nlit;
-- Check for proper delimiter, ignoring other format characters
Skip_Other_Format_Characters;
if Identifier_Char (Source (Scan_Ptr)) then
Error_Msg_S
("delimiter required between literal and identifier");
end if;
Post_Scan;
return;
-- Lower case letters
when 'a' .. 'z' =>
Name_Len := 1;
Underline_Found := False;
Name_Buffer (1) := Source (Scan_Ptr);
Accumulate_Checksum (Name_Buffer (1));
Scan_Ptr := Scan_Ptr + 1;
goto Scan_Identifier;
-- Upper case letters
when 'A' .. 'Z' =>
Name_Len := 1;
Underline_Found := False;
Name_Buffer (1) :=
Character'Val (Character'Pos (Source (Scan_Ptr)) + 32);
Accumulate_Checksum (Name_Buffer (1));
Scan_Ptr := Scan_Ptr + 1;
goto Scan_Identifier;
-- Underline character
when '_' =>
if Special_Characters ('_') then
Token_Ptr := Scan_Ptr;
Scan_Ptr := Scan_Ptr + 1;
Token := Tok_Special;
Special_Character := '_';
return;
end if;
Error_Msg_S ("identifier cannot start with underline");
Name_Len := 1;
Name_Buffer (1) := '_';
Scan_Ptr := Scan_Ptr + 1;
Underline_Found := False;
goto Scan_Identifier;
-- Space (not possible, because we scanned past blanks)
when ' ' =>
raise Program_Error;
-- Characters in top half of ASCII 8-bit chart
when Upper_Half_Character =>
-- Wide character case
if Upper_Half_Encoding then
goto Scan_Wide_Character;
-- Otherwise we have OK Latin-1 character
else
-- Upper half characters may possibly be identifier letters
-- but can never be digits, so Identifier_Char can be used to
-- test for a valid start of identifier character.
if Identifier_Char (Source (Scan_Ptr)) then
Name_Len := 0;
Underline_Found := False;
goto Scan_Identifier;
else
Error_Illegal_Character;
end if;
end if;
when ESC =>
-- ESC character, possible start of identifier if wide characters
-- using ESC encoding are allowed in identifiers, which we can
-- tell by looking at the Identifier_Char flag for ESC, which is
-- only true if these conditions are met. In Ada 2005 mode, may
-- also be valid UTF_32 space or line terminator character.
if Identifier_Char (ESC) then
Name_Len := 0;
goto Scan_Wide_Character;
else
Error_Illegal_Character;
end if;
-- Invalid control characters
when NUL | SOH | STX | ETX | EOT | ENQ | ACK | BEL | BS | ASCII.SO |
SI | DLE | DC1 | DC2 | DC3 | DC4 | NAK | SYN | ETB | CAN |
EM | FS | GS | RS | US | DEL
=>
Error_Illegal_Character;
-- Invalid graphic characters
when '#' | '$' | '?' | '@' | '`' | '\' | '^' | '~' =>
-- If Set_Special_Character has been called for this character,
-- set Scans.Special_Character and return a Special token.
if Special_Characters (Source (Scan_Ptr)) then
Token_Ptr := Scan_Ptr;
Token := Tok_Special;
Special_Character := Source (Scan_Ptr);
Scan_Ptr := Scan_Ptr + 1;
return;
-- Check for something looking like a preprocessor directive
elsif Source (Scan_Ptr) = '#'
and then (Source (Scan_Ptr + 1 .. Scan_Ptr + 2) = "if"
or else
Source (Scan_Ptr + 1 .. Scan_Ptr + 5) = "elsif"
or else
Source (Scan_Ptr + 1 .. Scan_Ptr + 4) = "else"
or else
Source (Scan_Ptr + 1 .. Scan_Ptr + 3) = "end")
then
Error_Msg_S
("preprocessor directive ignored, preprocessor not active");
-- Skip to end of line
loop
if Source (Scan_Ptr) in Graphic_Character
or else
Source (Scan_Ptr) = HT
then
Scan_Ptr := Scan_Ptr + 1;
-- Done if line terminator or EOF
elsif Source (Scan_Ptr) in Line_Terminator
or else
Source (Scan_Ptr) = EOF
then
exit;
-- If we have a wide character, we have to scan it out,
-- because it might be a legitimate line terminator
elsif Start_Of_Wide_Character then
declare
Wptr : constant Source_Ptr := Scan_Ptr;
Code : Char_Code;
Err : Boolean;
begin
Scan_Wide (Source, Scan_Ptr, Code, Err);
-- If not well formed wide character, then just skip
-- past it and ignore it.
if Err then
Scan_Ptr := Wptr + 1;
-- If UTF_32 terminator, terminate comment scan
elsif Is_UTF_32_Line_Terminator (UTF_32 (Code)) then
Scan_Ptr := Wptr;
exit;
end if;
end;
-- Else keep going (don't worry about bad comment chars
-- in this context, we just want to find the end of line.
else
Scan_Ptr := Scan_Ptr + 1;
end if;
end loop;
-- Otherwise, this is an illegal character
else
Error_Illegal_Character;
end if;
-- End switch on non-blank character
end case;
-- End loop past format effectors. The exit from this loop is by
-- executing a return statement following completion of token scan
-- (control never falls out of this loop to the code which follows)
end loop;
-- Wide_Character scanning routine. On entry we have encountered the
-- initial character of a wide character sequence.
<<Scan_Wide_Character>>
declare
Code : Char_Code;
Cat : Category;
Err : Boolean;
begin
Wptr := Scan_Ptr;
Scan_Wide (Source, Scan_Ptr, Code, Err);
-- If bad wide character, signal error and continue scan
if Err then
Error_Illegal_Wide_Character;
goto Scan_Next_Character;
end if;
Cat := Get_Category (UTF_32 (Code));
-- If OK letter, reset scan ptr and go scan identifier
if Is_UTF_32_Letter (Cat) then
Scan_Ptr := Wptr;
Name_Len := 0;
Underline_Found := False;
goto Scan_Identifier;
-- If OK wide space, ignore and keep scanning (we do not include
-- any ignored spaces in checksum)
elsif Is_UTF_32_Space (Cat) then
goto Scan_Next_Character;
-- If other format character, ignore and keep scanning (again we
-- do not include in the checksum) (this is for AI-0079).
elsif Is_UTF_32_Other (Cat) then
goto Scan_Next_Character;
-- If OK wide line terminator, terminate current line
elsif Is_UTF_32_Line_Terminator (UTF_32 (Code)) then
Scan_Ptr := Wptr;
goto Scan_Line_Terminator;
-- Punctuation is an error (at start of identifier)
elsif Is_UTF_32_Punctuation (Cat) then
Error_Msg ("identifier cannot start with punctuation", Wptr);
Scan_Ptr := Wptr;
Name_Len := 0;
Underline_Found := False;
goto Scan_Identifier;
-- Mark character is an error (at start of identifier)
elsif Is_UTF_32_Mark (Cat) then
Error_Msg ("identifier cannot start with mark character", Wptr);
Scan_Ptr := Wptr;
Name_Len := 0;
Underline_Found := False;
goto Scan_Identifier;
-- Extended digit character is an error. Could be bad start of
-- identifier or bad literal. Not worth doing too much to try to
-- distinguish these cases, but we will do a little bit.
elsif Is_UTF_32_Digit (Cat) then
Error_Msg
("identifier cannot start with digit character", Wptr);
Scan_Ptr := Wptr;
Name_Len := 0;
Underline_Found := False;
goto Scan_Identifier;
-- All other wide characters are illegal here
else
Error_Illegal_Wide_Character;
goto Scan_Next_Character;
end if;
end;
-- Routine to scan line terminator. On entry Scan_Ptr points to a
-- character which is one of FF,LR,CR,VT, or one of the wide characters
-- that is treated as a line terminator.
<<Scan_Line_Terminator>>
-- Check line too long
Check_End_Of_Line;
-- Set Token_Ptr, if End_Of_Line is a token, for the case when it is
-- a physical line.
if End_Of_Line_Is_Token then
Token_Ptr := Scan_Ptr;
end if;
declare
Physical : Boolean;
begin
Skip_Line_Terminators (Scan_Ptr, Physical);
-- If we are at start of physical line, update scan pointers to
-- reflect the start of the new line.
if Physical then
Current_Line_Start := Scan_Ptr;
Start_Column := Set_Start_Column;
First_Non_Blank_Location := Scan_Ptr;
-- If End_Of_Line is a token, we return it as it is a
-- physical line.
if End_Of_Line_Is_Token then
Token := Tok_End_Of_Line;
return;
end if;
end if;
end;
goto Scan_Next_Character;
-- Identifier scanning routine. On entry, some initial characters of
-- the identifier may have already been stored in Name_Buffer. If so,
-- Name_Len has the number of characters stored, otherwise Name_Len is
-- set to zero on entry. Underline_Found is also set False on entry.
<<Scan_Identifier>>
-- This loop scans as fast as possible past lower half letters and
-- digits, which we expect to be the most common characters.
loop
if Source (Scan_Ptr) in 'a' .. 'z'
or else Source (Scan_Ptr) in '0' .. '9'
then
Name_Buffer (Name_Len + 1) := Source (Scan_Ptr);
Accumulate_Checksum (Source (Scan_Ptr));
elsif Source (Scan_Ptr) in 'A' .. 'Z' then
Name_Buffer (Name_Len + 1) :=
Character'Val (Character'Pos (Source (Scan_Ptr)) + 32);
Accumulate_Checksum (Name_Buffer (Name_Len + 1));
else
exit;
end if;
Underline_Found := False;
Scan_Ptr := Scan_Ptr + 1;
Name_Len := Name_Len + 1;
end loop;
-- If we fall through, then we have encountered either an underline
-- character, or an extended identifier character (i.e. one from the
-- upper half), or a wide character, or an identifier terminator. The
-- initial test speeds us up in the most common case where we have
-- an identifier terminator. Note that ESC is an identifier character
-- only if a wide character encoding method that uses ESC encoding
-- is active, so if we find an ESC character we know that we have a
-- wide character.
if Identifier_Char (Source (Scan_Ptr))
or else (Source (Scan_Ptr) in Upper_Half_Character
and then Upper_Half_Encoding)
then
-- Case of underline
if Source (Scan_Ptr) = '_' then
Accumulate_Checksum ('_');
if Underline_Found then
Error_No_Double_Underline;
else
Underline_Found := True;
Name_Len := Name_Len + 1;
Name_Buffer (Name_Len) := '_';
end if;
Scan_Ptr := Scan_Ptr + 1;
goto Scan_Identifier;
-- Upper half character
elsif Source (Scan_Ptr) in Upper_Half_Character
and then not Upper_Half_Encoding
then
Accumulate_Checksum (Source (Scan_Ptr));
Store_Encoded_Character
(Get_Char_Code (Fold_Lower (Source (Scan_Ptr))));
Scan_Ptr := Scan_Ptr + 1;
Underline_Found := False;
goto Scan_Identifier;
-- Left bracket not followed by a quote terminates an identifier.
-- This is an error, but we don't want to give a junk error msg
-- about wide characters in this case.
elsif Source (Scan_Ptr) = '['
and then Source (Scan_Ptr + 1) /= '"'
then
null;
-- We know we have a wide character encoding here (the current
-- character is either ESC, left bracket, or an upper half
-- character depending on the encoding method).
else
-- Scan out the wide character and insert the appropriate
-- encoding into the name table entry for the identifier.
declare
Code : Char_Code;
Err : Boolean;
Chr : Character;
Cat : Category;
begin
Wptr := Scan_Ptr;
Scan_Wide (Source, Scan_Ptr, Code, Err);
-- If error, signal error
if Err then
Error_Illegal_Wide_Character;
-- If the character scanned is a normal identifier
-- character, then we treat it that way.
elsif In_Character_Range (Code)
and then Identifier_Char (Get_Character (Code))
then
Chr := Get_Character (Code);
Accumulate_Checksum (Chr);
Store_Encoded_Character
(Get_Char_Code (Fold_Lower (Chr)));
Underline_Found := False;
-- Here if not a normal identifier character
else
Cat := Get_Category (UTF_32 (Code));
-- Wide character in Unicode category "Other, Format"
-- is not accepted in an identifier. This is because it
-- it is considered a security risk (AI-0091).
-- However, it is OK for such a character to appear at
-- the end of an identifier.
if Is_UTF_32_Other (Cat) then
if not Identifier_Char (Source (Scan_Ptr)) then
goto Scan_Identifier_Complete;
else
Error_Msg
("identifier cannot contain other_format "
& "character", Wptr);
goto Scan_Identifier;
end if;
-- Wide character in category Separator,Space terminates
elsif Is_UTF_32_Space (Cat) then
goto Scan_Identifier_Complete;
end if;
-- Here if wide character is part of the identifier
-- Make sure we are allowing wide characters in
-- identifiers. Note that we allow wide character
-- notation for an OK identifier character. This in
-- particular allows bracket or other notation to be
-- used for upper half letters.
-- Wide characters are always allowed in Ada 2005
if Identifier_Character_Set /= 'w'
and then Ada_Version < Ada_2005
then
Error_Msg
("wide character not allowed in identifier", Wptr);
end if;
-- If OK letter, store it folding to upper case. Note
-- that we include the folded letter in the checksum.
if Is_UTF_32_Letter (Cat) then
Code :=
Char_Code (UTF_32_To_Upper_Case (UTF_32 (Code)));
Accumulate_Checksum (Code);
Store_Encoded_Character (Code);
Underline_Found := False;
-- If OK extended digit or mark, then store it
elsif Is_UTF_32_Digit (Cat)
or else Is_UTF_32_Mark (Cat)
then
Accumulate_Checksum (Code);
Store_Encoded_Character (Code);
Underline_Found := False;
-- Wide punctuation is also stored, but counts as an
-- underline character for error checking purposes.
elsif Is_UTF_32_Punctuation (Cat) then
Accumulate_Checksum (Code);
if Underline_Found then
declare
Cend : constant Source_Ptr := Scan_Ptr;
begin
Scan_Ptr := Wptr;
Error_No_Double_Underline;
Scan_Ptr := Cend;
end;
else
Store_Encoded_Character (Code);
Underline_Found := True;
end if;
-- Any other wide character is not acceptable
else
Error_Msg
("invalid wide character in identifier", Wptr);
end if;
end if;
goto Scan_Identifier;
end;
end if;
end if;
-- Scan of identifier is complete. The identifier is stored in
-- Name_Buffer, and Scan_Ptr points past the last character.
<<Scan_Identifier_Complete>>
Token_Name := Name_Find;
-- Check for identifier ending with underline or punctuation char
if Underline_Found then
Underline_Found := False;
if Source (Scan_Ptr - 1) = '_' then
Error_Msg
("identifier cannot end with underline", Scan_Ptr - 1);
else
Error_Msg
("identifier cannot end with punctuation character", Wptr);
end if;
end if;
-- We will assume it is an identifier, not a keyword, so that the
-- checksum is independent of the Ada version.
Token := Tok_Identifier;
-- Here is where we check if it was a keyword
if Is_Keyword_Name (Token_Name) then
if Opt.Checksum_GNAT_6_3 then
Token := Token_Type'Val (Get_Name_Table_Byte (Token_Name));
if Checksum_Accumulate_Token_Checksum then
if Checksum_GNAT_5_03 then
Accumulate_Token_Checksum_GNAT_5_03;
else
Accumulate_Token_Checksum_GNAT_6_3;
end if;
end if;
else
Accumulate_Token_Checksum;
Token := Token_Type'Val (Get_Name_Table_Byte (Token_Name));
end if;
-- Keyword style checks
if Style_Check then
-- Deal with possible style check for non-lower case keyword,
-- but we don't treat ACCESS, DELTA, DIGITS, RANGE as keywords
-- for this purpose if they appear as attribute designators.
-- Actually we only check the first character for speed.
-- Ada 2005 (AI-284): Do not apply the style check in case of
-- "pragma Interface"
-- Ada 2005 (AI-340): Do not apply the style check in case of
-- MOD attribute.
if Source (Token_Ptr) <= 'Z'
and then (Prev_Token /= Tok_Apostrophe
or else
(Token /= Tok_Access and then
Token /= Tok_Delta and then
Token /= Tok_Digits and then
Token /= Tok_Mod and then
Token /= Tok_Range))
and then (Token /= Tok_Interface
or else
(Token = Tok_Interface
and then Prev_Token /= Tok_Pragma))
then
Style.Non_Lower_Case_Keyword;
end if;
-- Check THEN/ELSE style rules. These do not apply to AND THEN
-- or OR ELSE, and do not apply in if expressions.
if (Token = Tok_Then and then Prev_Token /= Tok_And)
or else
(Token = Tok_Else and then Prev_Token /= Tok_Or)
then
if Inside_If_Expression = 0 then
Style.Check_Separate_Stmt_Lines;
end if;
end if;
end if;
-- We must reset Token_Name since this is not an identifier and
-- if we leave Token_Name set, the parser gets confused because
-- it thinks it is dealing with an identifier instead of the
-- corresponding keyword.
Token_Name := No_Name;
return;
-- It is an identifier after all
else
if Checksum_Accumulate_Token_Checksum then
Accumulate_Token_Checksum;
end if;
Post_Scan;
return;
end if;
end Scan;
--------------------------
-- Set_Comment_As_Token --
--------------------------
procedure Set_Comment_As_Token (Value : Boolean) is
begin
Comment_Is_Token := Value;
end Set_Comment_As_Token;
------------------------------
-- Set_End_Of_Line_As_Token --
------------------------------
procedure Set_End_Of_Line_As_Token (Value : Boolean) is
begin
End_Of_Line_Is_Token := Value;
end Set_End_Of_Line_As_Token;
---------------------------
-- Set_Special_Character --
---------------------------
procedure Set_Special_Character (C : Character) is
begin
case C is
when '#' | '$' | '_' | '?' | '@' | '`' | '\' | '^' | '~' =>
Special_Characters (C) := True;
when others =>
null;
end case;
end Set_Special_Character;
----------------------
-- Set_Start_Column --
----------------------
-- Note: it seems at first glance a little expensive to compute this value
-- for every source line (since it is certainly not used for all source
-- lines). On the other hand, it doesn't take much more work to skip past
-- the initial white space on the line counting the columns than it would
-- to scan past the white space using the standard scanning circuits.
function Set_Start_Column return Column_Number is
Start_Column : Column_Number := 0;
begin
-- Outer loop scans past horizontal tab characters
Tabs_Loop : loop
-- Inner loop scans past blanks as fast as possible, bumping Scan_Ptr
-- past the blanks and adjusting Start_Column to account for them.
Blanks_Loop : loop
if Source (Scan_Ptr) = ' ' then
if Source (Scan_Ptr + 1) = ' ' then
if Source (Scan_Ptr + 2) = ' ' then
if Source (Scan_Ptr + 3) = ' ' then
if Source (Scan_Ptr + 4) = ' ' then
if Source (Scan_Ptr + 5) = ' ' then
if Source (Scan_Ptr + 6) = ' ' then
Scan_Ptr := Scan_Ptr + 7;
Start_Column := Start_Column + 7;
else
Scan_Ptr := Scan_Ptr + 6;
Start_Column := Start_Column + 6;
exit Blanks_Loop;
end if;
else
Scan_Ptr := Scan_Ptr + 5;
Start_Column := Start_Column + 5;
exit Blanks_Loop;
end if;
else
Scan_Ptr := Scan_Ptr + 4;
Start_Column := Start_Column + 4;
exit Blanks_Loop;
end if;
else
Scan_Ptr := Scan_Ptr + 3;
Start_Column := Start_Column + 3;
exit Blanks_Loop;
end if;
else
Scan_Ptr := Scan_Ptr + 2;
Start_Column := Start_Column + 2;
exit Blanks_Loop;
end if;
else
Scan_Ptr := Scan_Ptr + 1;
Start_Column := Start_Column + 1;
exit Blanks_Loop;
end if;
else
exit Blanks_Loop;
end if;
end loop Blanks_Loop;
-- Outer loop keeps going only if a horizontal tab follows
if Source (Scan_Ptr) = HT then
if Style_Check then
Style.Check_HT;
end if;
Scan_Ptr := Scan_Ptr + 1;
Start_Column := (Start_Column / 8) * 8 + 8;
else
exit Tabs_Loop;
end if;
end loop Tabs_Loop;
return Start_Column;
-- A constraint error can happen only if we have a compiler with checks on
-- and a line with a ludicrous number of tabs or spaces at the start. In
-- such a case, we really don't care if Start_Column is right or not.
exception
when Constraint_Error =>
return Start_Column;
end Set_Start_Column;
end Scng;
|
with Ada.Containers.Functional_Vectors;
with TLSF.Proof.Util.Vectors;
package body TLSF.Proof.Test.Util with SPARK_Mode is
procedure Test_Util is
subtype Index_Type is Positive;
subtype Element_Type is Natural;
package V is new Ada.Containers.Functional_Vectors
(Index_Type, Element_Type);
package U is new TLSF.Proof.Util.Vectors(Element_Type, V);
use type V.Sequence;
T : V.Sequence;
begin
T := V.Add(T, 2);
pragma Assert(U.Find(T, 2) > 0);
pragma Assert(U.Find_Second(T, 2) = 0);
T := V.Add(T,2);
pragma Assert(U.Find(T, 2) > 0);
pragma Assert(U.Find_Second(T, 2) > 0);
T := V.Add(T, 3);
pragma Assert(U.Find_Second(T, 2) /= 0);
pragma Assert (U.At_Least_One(T,3));
pragma Assert (U.At_Most_One(T,3));
pragma Assert (U.At_Least_One(T,2));
pragma Assert (U.Find_Second(T, 2) /= 0);
pragma Assert (not U.At_Most_One(T,2));
pragma Assert (U.Exactly_One(T, 3));
pragma Assert (not U.Exactly_One(T, 2));
pragma Assert (U.At_Most_One(T, 4));
end Test_Util;
end TLSF.Proof.Test.Util;
|
------------------------------------------------------------------------------
-- --
-- Ada User Repository Annex (AURA) --
-- ANNEXI-STRAYLINE Reference Implementation --
-- --
-- Command Line Interface --
-- --
-- ------------------------------------------------------------------------ --
-- --
-- Copyright (C) 2019-2020, ANNEXI-STRAYLINE Trans-Human Ltd. --
-- All rights reserved. --
-- --
-- Original Contributors: --
-- * Richard Wai (ANNEXI-STRAYLINE) --
-- --
-- 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 copyright holder 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 --
-- OWNER 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 Ada.Directories;
-- This package should only be withed by Registrar.Executive.Unit_Entry and
-- children
package Registrar.Source_Files.Allocation is
function Open (Full_Name: String) return not null Source_File_Access;
-- Attempt to open an existing file at Path. Path should be a "full name" as
-- per File_Name
--
-- Status_Error is propegated (normally) if Source_File is already open
--
-- IO Exceptions related to opening the file may be propegated
function Create (Full_Name: String)
return not null Source_File_Access;
-- Attempt to create a file at Path. Path should be a "full name" as per
-- File_Name.
--
-- Status_Error is propegated (normally) if Source_File is already open
--
-- IO Exceptions related to creating the file may be propegated
procedure Discard (File : in out Source_File_Access;
Checkout: in out Source_Stream'Class);
-- Deallocates the handle File and disables the checked-out stream.
end Registrar.Source_Files.Allocation;
|
-- { dg-do compile }
-- { dg-options "-O2 -fdump-tree-optimized" }
function Volatile9 return Integer is
type A is array (1..4) of Integer;
pragma Volatile_Components (A);
V : A := (others => 0);
begin
for J in 1 .. 10 loop
V(1) := V(1) + 1;
end loop;
return V(1);
end;
-- { dg-final { scan-tree-dump "goto" "optimized" } }
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- L I B --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-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. --
-- --
------------------------------------------------------------------------------
pragma Style_Checks (All_Checks);
-- Subprogram ordering not enforced in this unit
-- (because of some logical groupings).
with Atree; use Atree;
with Csets; use Csets;
with Einfo; use Einfo;
with Fname; use Fname;
with Nlists; use Nlists;
with Output; use Output;
with Sinfo; use Sinfo;
with Sinput; use Sinput;
with Stand; use Stand;
with Stringt; use Stringt;
with Tree_IO; use Tree_IO;
with Uname; use Uname;
with Widechar; use Widechar;
package body Lib is
Switch_Storing_Enabled : Boolean := True;
-- Controlled by Enable_Switch_Storing/Disable_Switch_Storing
-----------------------
-- Local Subprograms --
-----------------------
type SEU_Result is (
Yes_Before, -- S1 is in same extended unit as S2 and appears before it
Yes_Same, -- S1 is in same extended unit as S2, Slocs are the same
Yes_After, -- S1 is in same extended unit as S2, and appears after it
No); -- S2 is not in same extended unit as S2
function Check_Same_Extended_Unit (S1, S2 : Source_Ptr) return SEU_Result;
-- Used by In_Same_Extended_Unit and Earlier_In_Extended_Unit. Returns
-- value as described above.
function Get_Code_Or_Source_Unit
(S : Source_Ptr;
Unwind_Instances : Boolean) return Unit_Number_Type;
-- Common code for Get_Code_Unit (get unit of instantiation for location)
-- and Get_Source_Unit (get unit of template for location).
--------------------------------------------
-- Access Functions for Unit Table Fields --
--------------------------------------------
function Cunit (U : Unit_Number_Type) return Node_Id is
begin
return Units.Table (U).Cunit;
end Cunit;
function Cunit_Entity (U : Unit_Number_Type) return Entity_Id is
begin
return Units.Table (U).Cunit_Entity;
end Cunit_Entity;
function Dependency_Num (U : Unit_Number_Type) return Nat is
begin
return Units.Table (U).Dependency_Num;
end Dependency_Num;
function Dynamic_Elab (U : Unit_Number_Type) return Boolean is
begin
return Units.Table (U).Dynamic_Elab;
end Dynamic_Elab;
function Error_Location (U : Unit_Number_Type) return Source_Ptr is
begin
return Units.Table (U).Error_Location;
end Error_Location;
function Expected_Unit (U : Unit_Number_Type) return Unit_Name_Type is
begin
return Units.Table (U).Expected_Unit;
end Expected_Unit;
function Fatal_Error (U : Unit_Number_Type) return Fatal_Type is
begin
return Units.Table (U).Fatal_Error;
end Fatal_Error;
function Generate_Code (U : Unit_Number_Type) return Boolean is
begin
return Units.Table (U).Generate_Code;
end Generate_Code;
function Has_RACW (U : Unit_Number_Type) return Boolean is
begin
return Units.Table (U).Has_RACW;
end Has_RACW;
function Ident_String (U : Unit_Number_Type) return Node_Id is
begin
return Units.Table (U).Ident_String;
end Ident_String;
function Loading (U : Unit_Number_Type) return Boolean is
begin
return Units.Table (U).Loading;
end Loading;
function Main_CPU (U : Unit_Number_Type) return Int is
begin
return Units.Table (U).Main_CPU;
end Main_CPU;
function Main_Priority (U : Unit_Number_Type) return Int is
begin
return Units.Table (U).Main_Priority;
end Main_Priority;
function Munit_Index (U : Unit_Number_Type) return Nat is
begin
return Units.Table (U).Munit_Index;
end Munit_Index;
function No_Elab_Code_All (U : Unit_Number_Type) return Boolean is
begin
return Units.Table (U).No_Elab_Code_All;
end No_Elab_Code_All;
function OA_Setting (U : Unit_Number_Type) return Character is
begin
return Units.Table (U).OA_Setting;
end OA_Setting;
function Source_Index (U : Unit_Number_Type) return Source_File_Index is
begin
return Units.Table (U).Source_Index;
end Source_Index;
function Unit_File_Name (U : Unit_Number_Type) return File_Name_Type is
begin
return Units.Table (U).Unit_File_Name;
end Unit_File_Name;
function Unit_Name (U : Unit_Number_Type) return Unit_Name_Type is
begin
return Units.Table (U).Unit_Name;
end Unit_Name;
------------------------------------------
-- Subprograms to Set Unit Table Fields --
------------------------------------------
procedure Set_Cunit (U : Unit_Number_Type; N : Node_Id) is
begin
Units.Table (U).Cunit := N;
end Set_Cunit;
procedure Set_Cunit_Entity (U : Unit_Number_Type; E : Entity_Id) is
begin
Units.Table (U).Cunit_Entity := E;
Set_Is_Compilation_Unit (E);
end Set_Cunit_Entity;
procedure Set_Dynamic_Elab (U : Unit_Number_Type; B : Boolean := True) is
begin
Units.Table (U).Dynamic_Elab := B;
end Set_Dynamic_Elab;
procedure Set_Error_Location (U : Unit_Number_Type; W : Source_Ptr) is
begin
Units.Table (U).Error_Location := W;
end Set_Error_Location;
procedure Set_Fatal_Error (U : Unit_Number_Type; V : Fatal_Type) is
begin
Units.Table (U).Fatal_Error := V;
end Set_Fatal_Error;
procedure Set_Generate_Code (U : Unit_Number_Type; B : Boolean := True) is
begin
Units.Table (U).Generate_Code := B;
end Set_Generate_Code;
procedure Set_Has_RACW (U : Unit_Number_Type; B : Boolean := True) is
begin
Units.Table (U).Has_RACW := B;
end Set_Has_RACW;
procedure Set_Ident_String (U : Unit_Number_Type; N : Node_Id) is
begin
Units.Table (U).Ident_String := N;
end Set_Ident_String;
procedure Set_Loading (U : Unit_Number_Type; B : Boolean := True) is
begin
Units.Table (U).Loading := B;
end Set_Loading;
procedure Set_Main_CPU (U : Unit_Number_Type; P : Int) is
begin
Units.Table (U).Main_CPU := P;
end Set_Main_CPU;
procedure Set_Main_Priority (U : Unit_Number_Type; P : Int) is
begin
Units.Table (U).Main_Priority := P;
end Set_Main_Priority;
procedure Set_No_Elab_Code_All
(U : Unit_Number_Type;
B : Boolean := True)
is
begin
Units.Table (U).No_Elab_Code_All := B;
end Set_No_Elab_Code_All;
procedure Set_OA_Setting (U : Unit_Number_Type; C : Character) is
begin
Units.Table (U).OA_Setting := C;
end Set_OA_Setting;
procedure Set_Unit_Name (U : Unit_Number_Type; N : Unit_Name_Type) is
begin
Units.Table (U).Unit_Name := N;
end Set_Unit_Name;
------------------------------
-- Check_Same_Extended_Unit --
------------------------------
function Check_Same_Extended_Unit (S1, S2 : Source_Ptr) return SEU_Result is
Sloc1 : Source_Ptr;
Sloc2 : Source_Ptr;
Sind1 : Source_File_Index;
Sind2 : Source_File_Index;
Inst1 : Source_Ptr;
Inst2 : Source_Ptr;
Unum1 : Unit_Number_Type;
Unum2 : Unit_Number_Type;
Unit1 : Node_Id;
Unit2 : Node_Id;
Depth1 : Nat;
Depth2 : Nat;
begin
if S1 = No_Location or else S2 = No_Location then
return No;
elsif S1 = Standard_Location then
if S2 = Standard_Location then
return Yes_Same;
else
return No;
end if;
elsif S2 = Standard_Location then
return No;
end if;
Sloc1 := S1;
Sloc2 := S2;
Unum1 := Get_Source_Unit (Sloc1);
Unum2 := Get_Source_Unit (Sloc2);
loop
-- Step 1: Check whether the two locations are in the same source
-- file.
Sind1 := Get_Source_File_Index (Sloc1);
Sind2 := Get_Source_File_Index (Sloc2);
if Sind1 = Sind2 then
if Sloc1 < Sloc2 then
return Yes_Before;
elsif Sloc1 > Sloc2 then
return Yes_After;
else
return Yes_Same;
end if;
end if;
-- Step 2: Check subunits. If a subunit is instantiated, follow the
-- instantiation chain rather than the stub chain.
Unit1 := Unit (Cunit (Unum1));
Unit2 := Unit (Cunit (Unum2));
Inst1 := Instantiation (Sind1);
Inst2 := Instantiation (Sind2);
if Nkind (Unit1) = N_Subunit
and then Present (Corresponding_Stub (Unit1))
and then Inst1 = No_Location
then
if Nkind (Unit2) = N_Subunit
and then Present (Corresponding_Stub (Unit2))
and then Inst2 = No_Location
then
-- Both locations refer to subunits which may have a common
-- ancestor. If they do, the deeper subunit must have a longer
-- unit name. Replace the deeper one with its corresponding
-- stub in order to find the nearest ancestor.
if Length_Of_Name (Unit_Name (Unum1)) <
Length_Of_Name (Unit_Name (Unum2))
then
Sloc2 := Sloc (Corresponding_Stub (Unit2));
Unum2 := Get_Source_Unit (Sloc2);
goto Continue;
else
Sloc1 := Sloc (Corresponding_Stub (Unit1));
Unum1 := Get_Source_Unit (Sloc1);
goto Continue;
end if;
-- Sloc1 in subunit, Sloc2 not
else
Sloc1 := Sloc (Corresponding_Stub (Unit1));
Unum1 := Get_Source_Unit (Sloc1);
goto Continue;
end if;
-- Sloc2 in subunit, Sloc1 not
elsif Nkind (Unit2) = N_Subunit
and then Present (Corresponding_Stub (Unit2))
and then Inst2 = No_Location
then
Sloc2 := Sloc (Corresponding_Stub (Unit2));
Unum2 := Get_Source_Unit (Sloc2);
goto Continue;
end if;
-- Step 3: Check instances. The two locations may yield a common
-- ancestor.
if Inst1 /= No_Location then
if Inst2 /= No_Location then
-- Both locations denote instantiations
Depth1 := Instantiation_Depth (Sloc1);
Depth2 := Instantiation_Depth (Sloc2);
if Depth1 < Depth2 then
Sloc2 := Inst2;
Unum2 := Get_Source_Unit (Sloc2);
goto Continue;
elsif Depth1 > Depth2 then
Sloc1 := Inst1;
Unum1 := Get_Source_Unit (Sloc1);
goto Continue;
else
Sloc1 := Inst1;
Sloc2 := Inst2;
Unum1 := Get_Source_Unit (Sloc1);
Unum2 := Get_Source_Unit (Sloc2);
goto Continue;
end if;
-- Sloc1 is an instantiation
else
Sloc1 := Inst1;
Unum1 := Get_Source_Unit (Sloc1);
goto Continue;
end if;
-- Sloc2 is an instantiation
elsif Inst2 /= No_Location then
Sloc2 := Inst2;
Unum2 := Get_Source_Unit (Sloc2);
goto Continue;
end if;
-- Step 4: One location in the spec, the other in the corresponding
-- body of the same unit. The location in the spec is considered
-- earlier.
if Nkind (Unit1) = N_Subprogram_Body
or else
Nkind (Unit1) = N_Package_Body
then
if Library_Unit (Cunit (Unum1)) = Cunit (Unum2) then
return Yes_After;
end if;
elsif Nkind (Unit2) = N_Subprogram_Body
or else
Nkind (Unit2) = N_Package_Body
then
if Library_Unit (Cunit (Unum2)) = Cunit (Unum1) then
return Yes_Before;
end if;
end if;
-- At this point it is certain that the two locations denote two
-- entirely separate units.
return No;
<<Continue>>
null;
end loop;
end Check_Same_Extended_Unit;
-------------------------------
-- Compilation_Switches_Last --
-------------------------------
function Compilation_Switches_Last return Nat is
begin
return Compilation_Switches.Last;
end Compilation_Switches_Last;
---------------------------
-- Enable_Switch_Storing --
---------------------------
procedure Enable_Switch_Storing is
begin
Switch_Storing_Enabled := True;
end Enable_Switch_Storing;
----------------------------
-- Disable_Switch_Storing --
----------------------------
procedure Disable_Switch_Storing is
begin
Switch_Storing_Enabled := False;
end Disable_Switch_Storing;
------------------------------
-- Earlier_In_Extended_Unit --
------------------------------
function Earlier_In_Extended_Unit (S1, S2 : Source_Ptr) return Boolean is
begin
return Check_Same_Extended_Unit (S1, S2) = Yes_Before;
end Earlier_In_Extended_Unit;
-----------------------
-- Exact_Source_Name --
-----------------------
function Exact_Source_Name (Loc : Source_Ptr) return String is
U : constant Unit_Number_Type := Get_Source_Unit (Loc);
Buf : constant Source_Buffer_Ptr := Source_Text (Source_Index (U));
Orig : constant Source_Ptr := Original_Location (Loc);
P : Source_Ptr;
WC : Char_Code;
Err : Boolean;
pragma Warnings (Off, WC);
pragma Warnings (Off, Err);
begin
-- Entity is character literal
if Buf (Orig) = ''' then
return String (Buf (Orig .. Orig + 2));
-- Entity is operator symbol
elsif Buf (Orig) = '"' or else Buf (Orig) = '%' then
P := Orig;
loop
P := P + 1;
exit when Buf (P) = Buf (Orig);
end loop;
return String (Buf (Orig .. P));
-- Entity is identifier
else
P := Orig;
loop
if Is_Start_Of_Wide_Char (Buf, P) then
Scan_Wide (Buf, P, WC, Err);
elsif not Identifier_Char (Buf (P)) then
exit;
else
P := P + 1;
end if;
end loop;
-- Write out the identifier by copying the exact source characters
-- used in its declaration. Note that this means wide characters will
-- be in their original encoded form.
return String (Buf (Orig .. P - 1));
end if;
end Exact_Source_Name;
----------------------------
-- Entity_Is_In_Main_Unit --
----------------------------
function Entity_Is_In_Main_Unit (E : Entity_Id) return Boolean is
S : Entity_Id;
begin
S := Scope (E);
while S /= Standard_Standard loop
if S = Main_Unit_Entity then
return True;
elsif Ekind (S) = E_Package and then Is_Child_Unit (S) then
return False;
else
S := Scope (S);
end if;
end loop;
return False;
end Entity_Is_In_Main_Unit;
--------------------------
-- Generic_May_Lack_ALI --
--------------------------
function Generic_May_Lack_ALI (Sfile : File_Name_Type) return Boolean is
begin
-- We allow internal generic units to be used without having a
-- corresponding ALI files to help bootstrapping with older compilers
-- that did not support generating ALIs for such generics. It is safe
-- to do so because the only thing the generated code would contain
-- is the elaboration boolean, and we are careful to elaborate all
-- predefined units first anyway.
return Is_Internal_File_Name
(Fname => Sfile,
Renamings_Included => True);
end Generic_May_Lack_ALI;
-----------------------------
-- Get_Code_Or_Source_Unit --
-----------------------------
function Get_Code_Or_Source_Unit
(S : Source_Ptr;
Unwind_Instances : Boolean) return Unit_Number_Type
is
begin
-- Search table unless we have No_Location, which can happen if the
-- relevant location has not been set yet. Happens for example when
-- we obtain Sloc (Cunit (Main_Unit)) before it is set.
if S /= No_Location then
declare
Source_File : Source_File_Index;
Source_Unit : Unit_Number_Type;
begin
Source_File := Get_Source_File_Index (S);
if Unwind_Instances then
while Template (Source_File) /= No_Source_File loop
Source_File := Template (Source_File);
end loop;
end if;
Source_Unit := Unit (Source_File);
if Source_Unit /= No_Unit then
return Source_Unit;
end if;
end;
end if;
-- If S was No_Location, or was not in the table, we must be in the main
-- source unit (and the value has not been placed in the table yet),
-- or in one of the configuration pragma files.
return Main_Unit;
end Get_Code_Or_Source_Unit;
-------------------
-- Get_Code_Unit --
-------------------
function Get_Code_Unit (S : Source_Ptr) return Unit_Number_Type is
begin
return Get_Code_Or_Source_Unit (Top_Level_Location (S),
Unwind_Instances => False);
end Get_Code_Unit;
function Get_Code_Unit (N : Node_Or_Entity_Id) return Unit_Number_Type is
begin
return Get_Code_Unit (Sloc (N));
end Get_Code_Unit;
----------------------------
-- Get_Compilation_Switch --
----------------------------
function Get_Compilation_Switch (N : Pos) return String_Ptr is
begin
if N <= Compilation_Switches.Last then
return Compilation_Switches.Table (N);
else
return null;
end if;
end Get_Compilation_Switch;
----------------------------------
-- Get_Cunit_Entity_Unit_Number --
----------------------------------
function Get_Cunit_Entity_Unit_Number
(E : Entity_Id) return Unit_Number_Type
is
begin
for U in Units.First .. Units.Last loop
if Cunit_Entity (U) = E then
return U;
end if;
end loop;
-- If not in the table, must be the main source unit, and we just
-- have not got it put into the table yet.
return Main_Unit;
end Get_Cunit_Entity_Unit_Number;
---------------------------
-- Get_Cunit_Unit_Number --
---------------------------
function Get_Cunit_Unit_Number (N : Node_Id) return Unit_Number_Type is
begin
for U in Units.First .. Units.Last loop
if Cunit (U) = N then
return U;
end if;
end loop;
-- If not in the table, must be a spec created for a main unit that is a
-- child subprogram body which we have not inserted into the table yet.
if N = Library_Unit (Cunit (Main_Unit)) then
return Main_Unit;
-- If it is anything else, something is seriously wrong, and we really
-- don't want to proceed, even if assertions are off, so we explicitly
-- raise an exception in this case to terminate compilation.
else
raise Program_Error;
end if;
end Get_Cunit_Unit_Number;
---------------------
-- Get_Source_Unit --
---------------------
function Get_Source_Unit (S : Source_Ptr) return Unit_Number_Type is
begin
return Get_Code_Or_Source_Unit (S, Unwind_Instances => True);
end Get_Source_Unit;
function Get_Source_Unit (N : Node_Or_Entity_Id) return Unit_Number_Type is
begin
return Get_Source_Unit (Sloc (N));
end Get_Source_Unit;
--------------------------------
-- In_Extended_Main_Code_Unit --
--------------------------------
function In_Extended_Main_Code_Unit
(N : Node_Or_Entity_Id) return Boolean
is
begin
if Sloc (N) = Standard_Location then
return False;
elsif Sloc (N) = No_Location then
return False;
-- Special case Itypes to test the Sloc of the associated node. The
-- reason we do this is for possible calls from gigi after -gnatD
-- processing is complete in sprint. This processing updates the
-- sloc fields of all nodes in the tree, but itypes are not in the
-- tree so their slocs do not get updated.
elsif Nkind (N) = N_Defining_Identifier
and then Is_Itype (N)
then
return In_Extended_Main_Code_Unit (Associated_Node_For_Itype (N));
-- Otherwise see if we are in the main unit
elsif Get_Code_Unit (Sloc (N)) = Get_Code_Unit (Cunit (Main_Unit)) then
return True;
-- Node may be in spec (or subunit etc) of main unit
else
return
In_Same_Extended_Unit (N, Cunit (Main_Unit));
end if;
end In_Extended_Main_Code_Unit;
function In_Extended_Main_Code_Unit (Loc : Source_Ptr) return Boolean is
begin
if Loc = Standard_Location then
return False;
elsif Loc = No_Location then
return False;
-- Otherwise see if we are in the main unit
elsif Get_Code_Unit (Loc) = Get_Code_Unit (Cunit (Main_Unit)) then
return True;
-- Location may be in spec (or subunit etc) of main unit
else
return
In_Same_Extended_Unit (Loc, Sloc (Cunit (Main_Unit)));
end if;
end In_Extended_Main_Code_Unit;
----------------------------------
-- In_Extended_Main_Source_Unit --
----------------------------------
function In_Extended_Main_Source_Unit
(N : Node_Or_Entity_Id) return Boolean
is
Nloc : constant Source_Ptr := Sloc (N);
Mloc : constant Source_Ptr := Sloc (Cunit (Main_Unit));
begin
-- If parsing, then use the global flag to indicate result
if Compiler_State = Parsing then
return Parsing_Main_Extended_Source;
-- Special value cases
elsif Nloc = Standard_Location then
return False;
elsif Nloc = No_Location then
return False;
-- Special case Itypes to test the Sloc of the associated node. The
-- reason we do this is for possible calls from gigi after -gnatD
-- processing is complete in sprint. This processing updates the
-- sloc fields of all nodes in the tree, but itypes are not in the
-- tree so their slocs do not get updated.
elsif Nkind (N) = N_Defining_Identifier
and then Is_Itype (N)
then
return In_Extended_Main_Source_Unit (Associated_Node_For_Itype (N));
-- Otherwise compare original locations to see if in same unit
else
return
In_Same_Extended_Unit
(Original_Location (Nloc), Original_Location (Mloc));
end if;
end In_Extended_Main_Source_Unit;
function In_Extended_Main_Source_Unit
(Loc : Source_Ptr) return Boolean
is
Mloc : constant Source_Ptr := Sloc (Cunit (Main_Unit));
begin
-- If parsing, then use the global flag to indicate result
if Compiler_State = Parsing then
return Parsing_Main_Extended_Source;
-- Special value cases
elsif Loc = Standard_Location then
return False;
elsif Loc = No_Location then
return False;
-- Otherwise compare original locations to see if in same unit
else
return
In_Same_Extended_Unit
(Original_Location (Loc), Original_Location (Mloc));
end if;
end In_Extended_Main_Source_Unit;
------------------------
-- In_Predefined_Unit --
------------------------
function In_Predefined_Unit (N : Node_Or_Entity_Id) return Boolean is
begin
return In_Predefined_Unit (Sloc (N));
end In_Predefined_Unit;
function In_Predefined_Unit (S : Source_Ptr) return Boolean is
Unit : constant Unit_Number_Type := Get_Source_Unit (S);
File : constant File_Name_Type := Unit_File_Name (Unit);
begin
return Is_Predefined_File_Name (File);
end In_Predefined_Unit;
-----------------------
-- In_Same_Code_Unit --
-----------------------
function In_Same_Code_Unit (N1, N2 : Node_Or_Entity_Id) return Boolean is
S1 : constant Source_Ptr := Sloc (N1);
S2 : constant Source_Ptr := Sloc (N2);
begin
if S1 = No_Location or else S2 = No_Location then
return False;
elsif S1 = Standard_Location then
return S2 = Standard_Location;
elsif S2 = Standard_Location then
return False;
end if;
return Get_Code_Unit (N1) = Get_Code_Unit (N2);
end In_Same_Code_Unit;
---------------------------
-- In_Same_Extended_Unit --
---------------------------
function In_Same_Extended_Unit
(N1, N2 : Node_Or_Entity_Id) return Boolean
is
begin
return Check_Same_Extended_Unit (Sloc (N1), Sloc (N2)) /= No;
end In_Same_Extended_Unit;
function In_Same_Extended_Unit (S1, S2 : Source_Ptr) return Boolean is
begin
return Check_Same_Extended_Unit (S1, S2) /= No;
end In_Same_Extended_Unit;
-------------------------
-- In_Same_Source_Unit --
-------------------------
function In_Same_Source_Unit (N1, N2 : Node_Or_Entity_Id) return Boolean is
S1 : constant Source_Ptr := Sloc (N1);
S2 : constant Source_Ptr := Sloc (N2);
begin
if S1 = No_Location or else S2 = No_Location then
return False;
elsif S1 = Standard_Location then
return S2 = Standard_Location;
elsif S2 = Standard_Location then
return False;
end if;
return Get_Source_Unit (N1) = Get_Source_Unit (N2);
end In_Same_Source_Unit;
-----------------------------
-- Increment_Serial_Number --
-----------------------------
function Increment_Serial_Number return Nat is
TSN : Int renames Units.Table (Current_Sem_Unit).Serial_Number;
begin
TSN := TSN + 1;
return TSN;
end Increment_Serial_Number;
----------------
-- Initialize --
----------------
procedure Initialize is
begin
Linker_Option_Lines.Init;
Notes.Init;
Load_Stack.Init;
Units.Init;
Compilation_Switches.Init;
end Initialize;
---------------
-- Is_Loaded --
---------------
function Is_Loaded (Uname : Unit_Name_Type) return Boolean is
begin
for Unum in Units.First .. Units.Last loop
if Uname = Unit_Name (Unum) then
return True;
end if;
end loop;
return False;
end Is_Loaded;
---------------
-- Last_Unit --
---------------
function Last_Unit return Unit_Number_Type is
begin
return Units.Last;
end Last_Unit;
----------
-- List --
----------
procedure List (File_Names_Only : Boolean := False) is separate;
----------
-- Lock --
----------
procedure Lock is
begin
Linker_Option_Lines.Locked := True;
Load_Stack.Locked := True;
Units.Locked := True;
Linker_Option_Lines.Release;
Load_Stack.Release;
Units.Release;
end Lock;
---------------
-- Num_Units --
---------------
function Num_Units return Nat is
begin
return Int (Units.Last) - Int (Main_Unit) + 1;
end Num_Units;
-----------------
-- Remove_Unit --
-----------------
procedure Remove_Unit (U : Unit_Number_Type) is
begin
if U = Units.Last then
Units.Decrement_Last;
end if;
end Remove_Unit;
----------------------------------
-- Replace_Linker_Option_String --
----------------------------------
procedure Replace_Linker_Option_String
(S : String_Id; Match_String : String)
is
begin
if Match_String'Length > 0 then
for J in 1 .. Linker_Option_Lines.Last loop
String_To_Name_Buffer (Linker_Option_Lines.Table (J).Option);
if Match_String = Name_Buffer (1 .. Match_String'Length) then
Linker_Option_Lines.Table (J).Option := S;
return;
end if;
end loop;
end if;
Store_Linker_Option_String (S);
end Replace_Linker_Option_String;
----------
-- Sort --
----------
procedure Sort (Tbl : in out Unit_Ref_Table) is separate;
------------------------------
-- Store_Compilation_Switch --
------------------------------
procedure Store_Compilation_Switch (Switch : String) is
begin
if Switch_Storing_Enabled then
Compilation_Switches.Increment_Last;
Compilation_Switches.Table (Compilation_Switches.Last) :=
new String'(Switch);
-- Fix up --RTS flag which has been transformed by the gcc driver
-- into -fRTS
if Switch'Last >= Switch'First + 4
and then Switch (Switch'First .. Switch'First + 4) = "-fRTS"
then
Compilation_Switches.Table
(Compilation_Switches.Last) (Switch'First + 1) := '-';
end if;
end if;
end Store_Compilation_Switch;
--------------------------------
-- Store_Linker_Option_String --
--------------------------------
procedure Store_Linker_Option_String (S : String_Id) is
begin
Linker_Option_Lines.Append ((Option => S, Unit => Current_Sem_Unit));
end Store_Linker_Option_String;
----------------
-- Store_Note --
----------------
procedure Store_Note (N : Node_Id) is
Sfile : constant Source_File_Index := Get_Source_File_Index (Sloc (N));
begin
-- Notes for a generic are emitted when processing the template, never
-- in instances.
if In_Extended_Main_Code_Unit (N)
and then Instance (Sfile) = No_Instance_Id
then
Notes.Append (N);
end if;
end Store_Note;
-------------------------------
-- Synchronize_Serial_Number --
-------------------------------
procedure Synchronize_Serial_Number is
TSN : Int renames Units.Table (Current_Sem_Unit).Serial_Number;
begin
TSN := TSN + 1;
end Synchronize_Serial_Number;
---------------
-- Tree_Read --
---------------
procedure Tree_Read is
N : Nat;
S : String_Ptr;
begin
Units.Tree_Read;
-- Read Compilation_Switches table. First release the memory occupied
-- by the previously loaded switches.
for J in Compilation_Switches.First .. Compilation_Switches.Last loop
Free (Compilation_Switches.Table (J));
end loop;
Tree_Read_Int (N);
Compilation_Switches.Set_Last (N);
for J in 1 .. N loop
Tree_Read_Str (S);
Compilation_Switches.Table (J) := S;
end loop;
end Tree_Read;
----------------
-- Tree_Write --
----------------
procedure Tree_Write is
begin
Units.Tree_Write;
-- Write Compilation_Switches table
Tree_Write_Int (Compilation_Switches.Last);
for J in 1 .. Compilation_Switches.Last loop
Tree_Write_Str (Compilation_Switches.Table (J));
end loop;
end Tree_Write;
------------
-- Unlock --
------------
procedure Unlock is
begin
Linker_Option_Lines.Locked := False;
Load_Stack.Locked := False;
Units.Locked := False;
end Unlock;
-----------------
-- Version_Get --
-----------------
function Version_Get (U : Unit_Number_Type) return Word_Hex_String is
begin
return Get_Hex_String (Units.Table (U).Version);
end Version_Get;
------------------------
-- Version_Referenced --
------------------------
procedure Version_Referenced (S : String_Id) is
begin
Version_Ref.Append (S);
end Version_Referenced;
---------------------
-- Write_Unit_Info --
---------------------
procedure Write_Unit_Info
(Unit_Num : Unit_Number_Type;
Item : Node_Id;
Prefix : String := "";
Withs : Boolean := False)
is
begin
Write_Str (Prefix);
Write_Unit_Name (Unit_Name (Unit_Num));
Write_Str (", unit ");
Write_Int (Int (Unit_Num));
Write_Str (", ");
Write_Int (Int (Item));
Write_Str ("=");
Write_Str (Node_Kind'Image (Nkind (Item)));
if Item /= Original_Node (Item) then
Write_Str (", orig = ");
Write_Int (Int (Original_Node (Item)));
Write_Str ("=");
Write_Str (Node_Kind'Image (Nkind (Original_Node (Item))));
end if;
Write_Eol;
-- Skip the rest if we're not supposed to print the withs
if not Withs then
return;
end if;
declare
Context_Item : Node_Id;
begin
Context_Item := First (Context_Items (Cunit (Unit_Num)));
while Present (Context_Item)
and then (Nkind (Context_Item) /= N_With_Clause
or else Limited_Present (Context_Item))
loop
Context_Item := Next (Context_Item);
end loop;
if Present (Context_Item) then
Indent;
Write_Line ("withs:");
Indent;
while Present (Context_Item) loop
if Nkind (Context_Item) = N_With_Clause
and then not Limited_Present (Context_Item)
then
pragma Assert (Present (Library_Unit (Context_Item)));
Write_Unit_Name
(Unit_Name
(Get_Cunit_Unit_Number (Library_Unit (Context_Item))));
if Implicit_With (Context_Item) then
Write_Str (" -- implicit");
end if;
Write_Eol;
end if;
Context_Item := Next (Context_Item);
end loop;
Outdent;
Write_Line ("end withs");
Outdent;
end if;
end;
end Write_Unit_Info;
end Lib;
|
with AUnit; use AUnit;
with AUnit.Test_Cases; use AUnit.Test_Cases;
package Test_Exercises_Navigate is
type Exercise_Navigate_Test_Case is
new Test_Case with null record;
overriding procedure Register_Tests
(T : in out Exercise_Navigate_Test_Case);
-- Register routines to be run
overriding function Name
(T : Exercise_Navigate_Test_Case)
return Message_String;
-- Provide name identifying the test case
end Test_Exercises_Navigate;
|
-- AoC 2020, Day 4
with Ada.Text_IO;
with Ada.Strings.Fixed; use Ada.Strings.Fixed;
with Ada.Characters.Handling; use Ada.Characters.Handling;
package body Day is
package TIO renames Ada.Text_IO;
type Key_Array is array(1..7) of String(1..3);
required_keys : constant Key_Array := Key_Array'("byr", "iyr", "eyr", "hgt", "hcl", "ecl", "pid");
type Eye_Color_Array is array(1..7) of String(1..3);
eye_colors : constant Eye_Color_Array := Eye_Color_Array'("amb", "blu", "brn", "gry", "grn", "hzl", "oth");
function valid_byr(s : in String) return Boolean is
value : constant Natural := Natural'Value(s);
begin
return value >= 1920 and value <= 2002;
end valid_byr;
function valid_iyr(s : in String) return Boolean is
value : constant Natural := Natural'Value(s);
begin
return value >= 2010 and value <= 2020;
end valid_iyr;
function valid_eyr(s : in String) return Boolean is
value : constant Natural := Natural'Value(s);
begin
return value >= 2020 and value <= 2030;
end valid_eyr;
function valid_hgt(s : in String) return Boolean is
suffix : constant String := s(s'last-1..s'last);
begin
if suffix = "in" then
declare
num : constant String := s(s'first..s'last-2);
value : constant Natural := Natural'Value(num);
begin
return value >= 59 and value <= 76;
end;
elsif suffix = "cm" then
declare
num : constant String := s(s'first..s'last-2);
value : constant Natural := Natural'Value(num);
begin
return value >= 150 and value <= 193;
end;
else
return false;
end if;
end valid_hgt;
function valid_hcl(s : in String) return Boolean is
prefix : constant Character := s(s'first);
begin
if prefix /= '#' then
return false;
end if;
if s'length /= 7 then
return false;
end if;
for c of s(s'first+1..s'last) loop
if not is_hexadecimal_digit(c) then
return false;
end if;
end loop;
return true;
end valid_hcl;
function valid_ecl(s : in String) return Boolean is
begin
for ec of eye_colors loop
if s = ec then
return true;
end if;
end loop;
return false;
end valid_ecl;
function valid_pid(s : in String) return Boolean is
begin
if s'length /= 9 then
return false;
end if;
for c of s loop
if not is_digit(c) then
return false;
end if;
end loop;
return true;
end valid_pid;
function valid(map : in Passport_Maps.Map) return Boolean is
use Passport_Maps;
begin
for elt in map.Iterate loop
declare
k : constant String := Key(elt);
v : constant String := map(k);
begin
if k = "byr" then
if not valid_byr(v) then
return false;
end if;
elsif k = "iyr" then
if not valid_iyr(v) then
return false;
end if;
elsif k = "eyr" then
if not valid_eyr(v) then
return false;
end if;
elsif k = "hgt" then
if not valid_hgt(v) then
return false;
end if;
elsif k = "hcl" then
if not valid_hcl(v) then
return false;
end if;
elsif k = "ecl" then
if not valid_ecl(v) then
return false;
end if;
elsif k = "pid" then
if not valid_pid(v) then
return false;
end if;
end if;
end;
end loop;
return true;
end valid;
function present(map : in Passport_Maps.Map) return Boolean is
begin
for k of required_keys loop
if not map.contains(k) then
return false;
end if;
end loop;
return true;
end present;
function present_count(batch : in Passport_Vectors.Vector) return Count_Type is
cnt : Natural := 0;
begin
for m of batch loop
if present(m) then
cnt := cnt + 1;
end if;
end loop;
return Count_Type(cnt);
end present_count;
function valid_count(batch : in Passport_Vectors.Vector) return Count_Type is
cnt : Natural := 0;
begin
for m of batch loop
if present(m) and valid(m) then
cnt := cnt + 1;
end if;
end loop;
return Count_Type(cnt);
end valid_count;
procedure parse_entry(line : in String; map : in out Passport_Maps.Map) is
idx : constant Natural := index(line, ":");
left : constant String := line(line'first .. idx-1);
right : constant String := line(idx+1 .. line'last);
begin
map.include(left, right);
end parse_entry;
procedure parse_line(line : in String; map : in out Passport_Maps.Map) is
idx : constant Natural := index(line, " ");
begin
if idx > 0 then
declare
left : constant String := line(line'first .. idx-1);
right : constant String := line(idx+1 .. line'last);
begin
parse_entry(left, map);
parse_line(right, map);
end;
else
parse_entry(line, map);
end if;
end parse_line;
function "="(Left, Right:Passport_Maps.Map) return Boolean
renames Passport_Maps."=";
function load_batch(filename : in String) return Passport_Vectors.Vector is
file : TIO.File_Type;
output : Passport_Vectors.Vector;
begin
TIO.open(File => file, Mode => TIO.In_File, Name => filename);
while not TIO.end_of_file(file) loop
declare
map : Passport_Maps.Map;
begin
loop
declare
line : constant String := TIO.get_line(file);
begin
if index_non_blank(line) = 0 then
exit;
else
parse_line(line, map);
if TIO.end_of_file(file) then
exit;
end if;
end if;
end;
end loop;
output.append(map);
end;
end loop;
TIO.close(file);
return output;
end load_batch;
end Day;
|
-- This spec has been automatically generated from STM32F46_79x.svd
pragma Restrictions (No_Elaboration_Code);
pragma Ada_2012;
pragma Style_Checks (Off);
with HAL;
with System;
package STM32_SVD.CRYP is
pragma Preelaborate;
---------------
-- Registers --
---------------
subtype CR_ALGOMODE0_Field is HAL.UInt3;
subtype CR_DATATYPE_Field is HAL.UInt2;
subtype CR_KEYSIZE_Field is HAL.UInt2;
subtype CR_GCM_CCMPH_Field is HAL.UInt2;
-- control register
type CR_Register is record
-- unspecified
Reserved_0_1 : HAL.UInt2 := 16#0#;
-- Algorithm direction
ALGODIR : Boolean := False;
-- Algorithm mode
ALGOMODE0 : CR_ALGOMODE0_Field := 16#0#;
-- Data type selection
DATATYPE : CR_DATATYPE_Field := 16#0#;
-- Key size selection (AES mode only)
KEYSIZE : CR_KEYSIZE_Field := 16#0#;
-- unspecified
Reserved_10_13 : HAL.UInt4 := 16#0#;
-- Write-only. FIFO flush
FFLUSH : Boolean := False;
-- Cryptographic processor enable
CRYPEN : Boolean := False;
-- GCM_CCMPH
GCM_CCMPH : CR_GCM_CCMPH_Field := 16#0#;
-- unspecified
Reserved_18_18 : HAL.Bit := 16#0#;
-- ALGOMODE
ALGOMODE3 : 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 CR_Register use record
Reserved_0_1 at 0 range 0 .. 1;
ALGODIR at 0 range 2 .. 2;
ALGOMODE0 at 0 range 3 .. 5;
DATATYPE at 0 range 6 .. 7;
KEYSIZE at 0 range 8 .. 9;
Reserved_10_13 at 0 range 10 .. 13;
FFLUSH at 0 range 14 .. 14;
CRYPEN at 0 range 15 .. 15;
GCM_CCMPH at 0 range 16 .. 17;
Reserved_18_18 at 0 range 18 .. 18;
ALGOMODE3 at 0 range 19 .. 19;
Reserved_20_31 at 0 range 20 .. 31;
end record;
-- status register
type SR_Register is record
-- Read-only. Input FIFO empty
IFEM : Boolean;
-- Read-only. Input FIFO not full
IFNF : Boolean;
-- Read-only. Output FIFO not empty
OFNE : Boolean;
-- Read-only. Output FIFO full
OFFU : Boolean;
-- Read-only. Busy bit
BUSY : Boolean;
-- unspecified
Reserved_5_31 : HAL.UInt27;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for SR_Register use record
IFEM at 0 range 0 .. 0;
IFNF at 0 range 1 .. 1;
OFNE at 0 range 2 .. 2;
OFFU at 0 range 3 .. 3;
BUSY at 0 range 4 .. 4;
Reserved_5_31 at 0 range 5 .. 31;
end record;
-- DMA control register
type DMACR_Register is record
-- DMA input enable
DIEN : Boolean := False;
-- DMA output enable
DOEN : Boolean := False;
-- unspecified
Reserved_2_31 : HAL.UInt30 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DMACR_Register use record
DIEN at 0 range 0 .. 0;
DOEN at 0 range 1 .. 1;
Reserved_2_31 at 0 range 2 .. 31;
end record;
-- interrupt mask set/clear register
type IMSCR_Register is record
-- Input FIFO service interrupt mask
INIM : Boolean := False;
-- Output FIFO service interrupt mask
OUTIM : Boolean := False;
-- unspecified
Reserved_2_31 : HAL.UInt30 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for IMSCR_Register use record
INIM at 0 range 0 .. 0;
OUTIM at 0 range 1 .. 1;
Reserved_2_31 at 0 range 2 .. 31;
end record;
-- raw interrupt status register
type RISR_Register is record
-- Read-only. Input FIFO service raw interrupt status
INRIS : Boolean;
-- Read-only. Output FIFO service raw interrupt status
OUTRIS : Boolean;
-- unspecified
Reserved_2_31 : HAL.UInt30;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for RISR_Register use record
INRIS at 0 range 0 .. 0;
OUTRIS at 0 range 1 .. 1;
Reserved_2_31 at 0 range 2 .. 31;
end record;
-- masked interrupt status register
type MISR_Register is record
-- Read-only. Input FIFO service masked interrupt status
INMIS : Boolean;
-- Read-only. Output FIFO service masked interrupt status
OUTMIS : Boolean;
-- unspecified
Reserved_2_31 : HAL.UInt30;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for MISR_Register use record
INMIS at 0 range 0 .. 0;
OUTMIS at 0 range 1 .. 1;
Reserved_2_31 at 0 range 2 .. 31;
end record;
-- K0LR_b array
type K0LR_b_Field_Array is array (224 .. 255) of Boolean
with Component_Size => 1, Size => 32;
-- key registers
type K0LR_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- b as a value
Val : HAL.UInt32;
when True =>
-- b as an array
Arr : K0LR_b_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for K0LR_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- K0RR_b array
type K0RR_b_Field_Array is array (192 .. 223) of Boolean
with Component_Size => 1, Size => 32;
-- key registers
type K0RR_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- b as a value
Val : HAL.UInt32;
when True =>
-- b as an array
Arr : K0RR_b_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for K0RR_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- K1LR_b array
type K1LR_b_Field_Array is array (160 .. 191) of Boolean
with Component_Size => 1, Size => 32;
-- key registers
type K1LR_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- b as a value
Val : HAL.UInt32;
when True =>
-- b as an array
Arr : K1LR_b_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for K1LR_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- K1RR_b array
type K1RR_b_Field_Array is array (128 .. 159) of Boolean
with Component_Size => 1, Size => 32;
-- key registers
type K1RR_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- b as a value
Val : HAL.UInt32;
when True =>
-- b as an array
Arr : K1RR_b_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for K1RR_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- K2LR_b array
type K2LR_b_Field_Array is array (96 .. 127) of Boolean
with Component_Size => 1, Size => 32;
-- key registers
type K2LR_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- b as a value
Val : HAL.UInt32;
when True =>
-- b as an array
Arr : K2LR_b_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for K2LR_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- K2RR_b array
type K2RR_b_Field_Array is array (64 .. 95) of Boolean
with Component_Size => 1, Size => 32;
-- key registers
type K2RR_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- b as a value
Val : HAL.UInt32;
when True =>
-- b as an array
Arr : K2RR_b_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for K2RR_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- K3LR_b array
type K3LR_b_Field_Array is array (32 .. 63) of Boolean
with Component_Size => 1, Size => 32;
-- key registers
type K3LR_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- b as a value
Val : HAL.UInt32;
when True =>
-- b as an array
Arr : K3LR_b_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for K3LR_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- K3RR_b array
type K3RR_b_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- key registers
type K3RR_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- b as a value
Val : HAL.UInt32;
when True =>
-- b as an array
Arr : K3RR_b_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for K3RR_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- initialization vector registers
type IV0LR_Register is record
-- IV31
IV31 : Boolean := False;
-- IV30
IV30 : Boolean := False;
-- IV29
IV29 : Boolean := False;
-- IV28
IV28 : Boolean := False;
-- IV27
IV27 : Boolean := False;
-- IV26
IV26 : Boolean := False;
-- IV25
IV25 : Boolean := False;
-- IV24
IV24 : Boolean := False;
-- IV23
IV23 : Boolean := False;
-- IV22
IV22 : Boolean := False;
-- IV21
IV21 : Boolean := False;
-- IV20
IV20 : Boolean := False;
-- IV19
IV19 : Boolean := False;
-- IV18
IV18 : Boolean := False;
-- IV17
IV17 : Boolean := False;
-- IV16
IV16 : Boolean := False;
-- IV15
IV15 : Boolean := False;
-- IV14
IV14 : Boolean := False;
-- IV13
IV13 : Boolean := False;
-- IV12
IV12 : Boolean := False;
-- IV11
IV11 : Boolean := False;
-- IV10
IV10 : Boolean := False;
-- IV9
IV9 : Boolean := False;
-- IV8
IV8 : Boolean := False;
-- IV7
IV7 : Boolean := False;
-- IV6
IV6 : Boolean := False;
-- IV5
IV5 : Boolean := False;
-- IV4
IV4 : Boolean := False;
-- IV3
IV3 : Boolean := False;
-- IV2
IV2 : Boolean := False;
-- IV1
IV1 : Boolean := False;
-- IV0
IV0 : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for IV0LR_Register use record
IV31 at 0 range 0 .. 0;
IV30 at 0 range 1 .. 1;
IV29 at 0 range 2 .. 2;
IV28 at 0 range 3 .. 3;
IV27 at 0 range 4 .. 4;
IV26 at 0 range 5 .. 5;
IV25 at 0 range 6 .. 6;
IV24 at 0 range 7 .. 7;
IV23 at 0 range 8 .. 8;
IV22 at 0 range 9 .. 9;
IV21 at 0 range 10 .. 10;
IV20 at 0 range 11 .. 11;
IV19 at 0 range 12 .. 12;
IV18 at 0 range 13 .. 13;
IV17 at 0 range 14 .. 14;
IV16 at 0 range 15 .. 15;
IV15 at 0 range 16 .. 16;
IV14 at 0 range 17 .. 17;
IV13 at 0 range 18 .. 18;
IV12 at 0 range 19 .. 19;
IV11 at 0 range 20 .. 20;
IV10 at 0 range 21 .. 21;
IV9 at 0 range 22 .. 22;
IV8 at 0 range 23 .. 23;
IV7 at 0 range 24 .. 24;
IV6 at 0 range 25 .. 25;
IV5 at 0 range 26 .. 26;
IV4 at 0 range 27 .. 27;
IV3 at 0 range 28 .. 28;
IV2 at 0 range 29 .. 29;
IV1 at 0 range 30 .. 30;
IV0 at 0 range 31 .. 31;
end record;
-- initialization vector registers
type IV0RR_Register is record
-- IV63
IV63 : Boolean := False;
-- IV62
IV62 : Boolean := False;
-- IV61
IV61 : Boolean := False;
-- IV60
IV60 : Boolean := False;
-- IV59
IV59 : Boolean := False;
-- IV58
IV58 : Boolean := False;
-- IV57
IV57 : Boolean := False;
-- IV56
IV56 : Boolean := False;
-- IV55
IV55 : Boolean := False;
-- IV54
IV54 : Boolean := False;
-- IV53
IV53 : Boolean := False;
-- IV52
IV52 : Boolean := False;
-- IV51
IV51 : Boolean := False;
-- IV50
IV50 : Boolean := False;
-- IV49
IV49 : Boolean := False;
-- IV48
IV48 : Boolean := False;
-- IV47
IV47 : Boolean := False;
-- IV46
IV46 : Boolean := False;
-- IV45
IV45 : Boolean := False;
-- IV44
IV44 : Boolean := False;
-- IV43
IV43 : Boolean := False;
-- IV42
IV42 : Boolean := False;
-- IV41
IV41 : Boolean := False;
-- IV40
IV40 : Boolean := False;
-- IV39
IV39 : Boolean := False;
-- IV38
IV38 : Boolean := False;
-- IV37
IV37 : Boolean := False;
-- IV36
IV36 : Boolean := False;
-- IV35
IV35 : Boolean := False;
-- IV34
IV34 : Boolean := False;
-- IV33
IV33 : Boolean := False;
-- IV32
IV32 : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for IV0RR_Register use record
IV63 at 0 range 0 .. 0;
IV62 at 0 range 1 .. 1;
IV61 at 0 range 2 .. 2;
IV60 at 0 range 3 .. 3;
IV59 at 0 range 4 .. 4;
IV58 at 0 range 5 .. 5;
IV57 at 0 range 6 .. 6;
IV56 at 0 range 7 .. 7;
IV55 at 0 range 8 .. 8;
IV54 at 0 range 9 .. 9;
IV53 at 0 range 10 .. 10;
IV52 at 0 range 11 .. 11;
IV51 at 0 range 12 .. 12;
IV50 at 0 range 13 .. 13;
IV49 at 0 range 14 .. 14;
IV48 at 0 range 15 .. 15;
IV47 at 0 range 16 .. 16;
IV46 at 0 range 17 .. 17;
IV45 at 0 range 18 .. 18;
IV44 at 0 range 19 .. 19;
IV43 at 0 range 20 .. 20;
IV42 at 0 range 21 .. 21;
IV41 at 0 range 22 .. 22;
IV40 at 0 range 23 .. 23;
IV39 at 0 range 24 .. 24;
IV38 at 0 range 25 .. 25;
IV37 at 0 range 26 .. 26;
IV36 at 0 range 27 .. 27;
IV35 at 0 range 28 .. 28;
IV34 at 0 range 29 .. 29;
IV33 at 0 range 30 .. 30;
IV32 at 0 range 31 .. 31;
end record;
-- initialization vector registers
type IV1LR_Register is record
-- IV95
IV95 : Boolean := False;
-- IV94
IV94 : Boolean := False;
-- IV93
IV93 : Boolean := False;
-- IV92
IV92 : Boolean := False;
-- IV91
IV91 : Boolean := False;
-- IV90
IV90 : Boolean := False;
-- IV89
IV89 : Boolean := False;
-- IV88
IV88 : Boolean := False;
-- IV87
IV87 : Boolean := False;
-- IV86
IV86 : Boolean := False;
-- IV85
IV85 : Boolean := False;
-- IV84
IV84 : Boolean := False;
-- IV83
IV83 : Boolean := False;
-- IV82
IV82 : Boolean := False;
-- IV81
IV81 : Boolean := False;
-- IV80
IV80 : Boolean := False;
-- IV79
IV79 : Boolean := False;
-- IV78
IV78 : Boolean := False;
-- IV77
IV77 : Boolean := False;
-- IV76
IV76 : Boolean := False;
-- IV75
IV75 : Boolean := False;
-- IV74
IV74 : Boolean := False;
-- IV73
IV73 : Boolean := False;
-- IV72
IV72 : Boolean := False;
-- IV71
IV71 : Boolean := False;
-- IV70
IV70 : Boolean := False;
-- IV69
IV69 : Boolean := False;
-- IV68
IV68 : Boolean := False;
-- IV67
IV67 : Boolean := False;
-- IV66
IV66 : Boolean := False;
-- IV65
IV65 : Boolean := False;
-- IV64
IV64 : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for IV1LR_Register use record
IV95 at 0 range 0 .. 0;
IV94 at 0 range 1 .. 1;
IV93 at 0 range 2 .. 2;
IV92 at 0 range 3 .. 3;
IV91 at 0 range 4 .. 4;
IV90 at 0 range 5 .. 5;
IV89 at 0 range 6 .. 6;
IV88 at 0 range 7 .. 7;
IV87 at 0 range 8 .. 8;
IV86 at 0 range 9 .. 9;
IV85 at 0 range 10 .. 10;
IV84 at 0 range 11 .. 11;
IV83 at 0 range 12 .. 12;
IV82 at 0 range 13 .. 13;
IV81 at 0 range 14 .. 14;
IV80 at 0 range 15 .. 15;
IV79 at 0 range 16 .. 16;
IV78 at 0 range 17 .. 17;
IV77 at 0 range 18 .. 18;
IV76 at 0 range 19 .. 19;
IV75 at 0 range 20 .. 20;
IV74 at 0 range 21 .. 21;
IV73 at 0 range 22 .. 22;
IV72 at 0 range 23 .. 23;
IV71 at 0 range 24 .. 24;
IV70 at 0 range 25 .. 25;
IV69 at 0 range 26 .. 26;
IV68 at 0 range 27 .. 27;
IV67 at 0 range 28 .. 28;
IV66 at 0 range 29 .. 29;
IV65 at 0 range 30 .. 30;
IV64 at 0 range 31 .. 31;
end record;
-- initialization vector registers
type IV1RR_Register is record
-- IV127
IV127 : Boolean := False;
-- IV126
IV126 : Boolean := False;
-- IV125
IV125 : Boolean := False;
-- IV124
IV124 : Boolean := False;
-- IV123
IV123 : Boolean := False;
-- IV122
IV122 : Boolean := False;
-- IV121
IV121 : Boolean := False;
-- IV120
IV120 : Boolean := False;
-- IV119
IV119 : Boolean := False;
-- IV118
IV118 : Boolean := False;
-- IV117
IV117 : Boolean := False;
-- IV116
IV116 : Boolean := False;
-- IV115
IV115 : Boolean := False;
-- IV114
IV114 : Boolean := False;
-- IV113
IV113 : Boolean := False;
-- IV112
IV112 : Boolean := False;
-- IV111
IV111 : Boolean := False;
-- IV110
IV110 : Boolean := False;
-- IV109
IV109 : Boolean := False;
-- IV108
IV108 : Boolean := False;
-- IV107
IV107 : Boolean := False;
-- IV106
IV106 : Boolean := False;
-- IV105
IV105 : Boolean := False;
-- IV104
IV104 : Boolean := False;
-- IV103
IV103 : Boolean := False;
-- IV102
IV102 : Boolean := False;
-- IV101
IV101 : Boolean := False;
-- IV100
IV100 : Boolean := False;
-- IV99
IV99 : Boolean := False;
-- IV98
IV98 : Boolean := False;
-- IV97
IV97 : Boolean := False;
-- IV96
IV96 : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for IV1RR_Register use record
IV127 at 0 range 0 .. 0;
IV126 at 0 range 1 .. 1;
IV125 at 0 range 2 .. 2;
IV124 at 0 range 3 .. 3;
IV123 at 0 range 4 .. 4;
IV122 at 0 range 5 .. 5;
IV121 at 0 range 6 .. 6;
IV120 at 0 range 7 .. 7;
IV119 at 0 range 8 .. 8;
IV118 at 0 range 9 .. 9;
IV117 at 0 range 10 .. 10;
IV116 at 0 range 11 .. 11;
IV115 at 0 range 12 .. 12;
IV114 at 0 range 13 .. 13;
IV113 at 0 range 14 .. 14;
IV112 at 0 range 15 .. 15;
IV111 at 0 range 16 .. 16;
IV110 at 0 range 17 .. 17;
IV109 at 0 range 18 .. 18;
IV108 at 0 range 19 .. 19;
IV107 at 0 range 20 .. 20;
IV106 at 0 range 21 .. 21;
IV105 at 0 range 22 .. 22;
IV104 at 0 range 23 .. 23;
IV103 at 0 range 24 .. 24;
IV102 at 0 range 25 .. 25;
IV101 at 0 range 26 .. 26;
IV100 at 0 range 27 .. 27;
IV99 at 0 range 28 .. 28;
IV98 at 0 range 29 .. 29;
IV97 at 0 range 30 .. 30;
IV96 at 0 range 31 .. 31;
end record;
-----------------
-- Peripherals --
-----------------
-- Cryptographic processor
type CRYP_Peripheral is record
-- control register
CR : aliased CR_Register;
-- status register
SR : aliased SR_Register;
-- data input register
DIN : aliased HAL.UInt32;
-- data output register
DOUT : aliased HAL.UInt32;
-- DMA control register
DMACR : aliased DMACR_Register;
-- interrupt mask set/clear register
IMSCR : aliased IMSCR_Register;
-- raw interrupt status register
RISR : aliased RISR_Register;
-- masked interrupt status register
MISR : aliased MISR_Register;
-- key registers
K0LR : aliased K0LR_Register;
-- key registers
K0RR : aliased K0RR_Register;
-- key registers
K1LR : aliased K1LR_Register;
-- key registers
K1RR : aliased K1RR_Register;
-- key registers
K2LR : aliased K2LR_Register;
-- key registers
K2RR : aliased K2RR_Register;
-- key registers
K3LR : aliased K3LR_Register;
-- key registers
K3RR : aliased K3RR_Register;
-- initialization vector registers
IV0LR : aliased IV0LR_Register;
-- initialization vector registers
IV0RR : aliased IV0RR_Register;
-- initialization vector registers
IV1LR : aliased IV1LR_Register;
-- initialization vector registers
IV1RR : aliased IV1RR_Register;
-- context swap register
CSGCMCCM0R : aliased HAL.UInt32;
-- context swap register
CSGCMCCM1R : aliased HAL.UInt32;
-- context swap register
CSGCMCCM2R : aliased HAL.UInt32;
-- context swap register
CSGCMCCM3R : aliased HAL.UInt32;
-- context swap register
CSGCMCCM4R : aliased HAL.UInt32;
-- context swap register
CSGCMCCM5R : aliased HAL.UInt32;
-- context swap register
CSGCMCCM6R : aliased HAL.UInt32;
-- context swap register
CSGCMCCM7R : aliased HAL.UInt32;
-- context swap register
CSGCM0R : aliased HAL.UInt32;
-- context swap register
CSGCM1R : aliased HAL.UInt32;
-- context swap register
CSGCM2R : aliased HAL.UInt32;
-- context swap register
CSGCM3R : aliased HAL.UInt32;
-- context swap register
CSGCM4R : aliased HAL.UInt32;
-- context swap register
CSGCM5R : aliased HAL.UInt32;
-- context swap register
CSGCM6R : aliased HAL.UInt32;
-- context swap register
CSGCM7R : aliased HAL.UInt32;
end record
with Volatile;
for CRYP_Peripheral use record
CR at 16#0# range 0 .. 31;
SR at 16#4# range 0 .. 31;
DIN at 16#8# range 0 .. 31;
DOUT at 16#C# range 0 .. 31;
DMACR at 16#10# range 0 .. 31;
IMSCR at 16#14# range 0 .. 31;
RISR at 16#18# range 0 .. 31;
MISR at 16#1C# range 0 .. 31;
K0LR at 16#20# range 0 .. 31;
K0RR at 16#24# range 0 .. 31;
K1LR at 16#28# range 0 .. 31;
K1RR at 16#2C# range 0 .. 31;
K2LR at 16#30# range 0 .. 31;
K2RR at 16#34# range 0 .. 31;
K3LR at 16#38# range 0 .. 31;
K3RR at 16#3C# range 0 .. 31;
IV0LR at 16#40# range 0 .. 31;
IV0RR at 16#44# range 0 .. 31;
IV1LR at 16#48# range 0 .. 31;
IV1RR at 16#4C# range 0 .. 31;
CSGCMCCM0R at 16#50# range 0 .. 31;
CSGCMCCM1R at 16#54# range 0 .. 31;
CSGCMCCM2R at 16#58# range 0 .. 31;
CSGCMCCM3R at 16#5C# range 0 .. 31;
CSGCMCCM4R at 16#60# range 0 .. 31;
CSGCMCCM5R at 16#64# range 0 .. 31;
CSGCMCCM6R at 16#68# range 0 .. 31;
CSGCMCCM7R at 16#6C# range 0 .. 31;
CSGCM0R at 16#70# range 0 .. 31;
CSGCM1R at 16#74# range 0 .. 31;
CSGCM2R at 16#78# range 0 .. 31;
CSGCM3R at 16#7C# range 0 .. 31;
CSGCM4R at 16#80# range 0 .. 31;
CSGCM5R at 16#84# range 0 .. 31;
CSGCM6R at 16#88# range 0 .. 31;
CSGCM7R at 16#8C# range 0 .. 31;
end record;
-- Cryptographic processor
CRYP_Periph : aliased CRYP_Peripheral
with Import, Address => System'To_Address (16#50060000#);
end STM32_SVD.CRYP;
|
-- This is a personal project that was conceived
-- from a lack of really quick Dungeons and
-- Dragons character creation tools.
-- The only content supported in this tool
-- is that which can be found in the
-- Systems Reference Document (SRD)
-- from Wizards of the Coast.
-- Created by Patrick M
-- Start Date: 8 March 2018
-- Major Updates: 24 April 2018
-- 14 January 2019
-- 7 February 2019
--------------- Support from ---------------
-- Kate A (Beta Tester/Ideas)
-- Rebecca N (Beta Tester/Ideas/Problem Solving)
-- Kim O (Beta Tester)
--------------------------------------------
With Ada.Text_IO; Use Ada.Text_IO;
With Ada.Integer_Text_IO; Use Ada.Integer_Text_IO;
Procedure NPC_Builder is
------------------------------------------------------
-- The purpose of this program is to allow DMs and --
-- players the ability to create NPCs and PCs, --
-- respectively, without having to crunch numbers. --
-- This program will also output the various --
-- character sheet information in easy-to-read --
-- text files for future reference and saving. --
------------------------------------------------------
Type Class_List is (Barbarian, Bard, Cleric, Druid, Fighter, Monk,
Paladin, Ranger, Rogue, Sorcerer, Warlock, Wizard);
Package Class_IO is new Ada.Text_IO.Enumeration_IO (Class_List);
Use Class_IO;
Type Subclass_List is (Berserker, Lore, Life, Land, Champion, OpenHand,
Devotion, Hunter, Thief, Draconic, Fiend, Evocation);
Package Subclass_IO is new Ada.Text_IO.Enumeration_IO (Subclass_List);
Use Subclass_IO;
Type Race_List is (Dragonborn, Dwarf, Elf, Gnome, HalfElf, Halfling, HalfOrc, Human, Tiefling);
Package Race_IO is new Ada.Text_IO.Enumeration_IO (Race_List);
Use Race_IO;
Type Subrace_List is (Hill, High, Lightfoot, Rock, None,
Calishite, Chondathan, Damaran, Illuskan,
Mulan, Rashemi, Shou, Tethyrian, Turami,
Black, Blue, Bronze, Brass, Copper,
Gold, Green, Red, Silver, White);
Package Subrace_IO is new Ada.Text_IO.Enumeration_IO (Subrace_List);
Use Subrace_IO;
Type Skills_List is (Acrobatics, Animal_Handling, Arcana, Athletics, Deception, History,
Insight, Intimidation, Investigation, Medicine, Nature, Perception,
Performance, Persuasion, Religion, Sleight_Of_Hand, Stealth, Survival);
Package Skills_IO is new Ada.Text_IO.Enumeration_IO (Skills_List);
Use Skills_IO;
Type Ability_Scores_List is (STR, DEX, CON, INT, WIS, CHA, NA);
Package Scores_IO is new Ada.Text_IO.Enumeration_IO (Ability_Scores_List);
Use Scores_IO;
Type Weapons_List is (Battleaxe, Blowgun, Club, Dagger, Dart, Flail, Glaive,
Greatclub, Greatsword, Halberd, Handaxe, HandCrossbow,
HeavyCrossbow, Javelin, Lance, LightCrossbow, LightHammer,
Longbow, Longsword, Mace, Maul, Morningstar, Net, Pike,
Quarterstaff, Rapier, Scimitar, Shortbow, Shortsword,
Sickle, Sling, Spear, Trident, Warhammer, Warpick, Whip);
Package Weapons_IO is new Ada.Text_IO.Enumeration_IO (Weapons_List);
Use Weapons_IO;
Type Weapon_Classification_List is (Simple, Martial);
Package Weapon_Classification_IO is new Ada.Text_IO.Enumeration_IO (Weapon_Classification_List);
Use Weapon_Classification_IO;
Type Proficient_Type is record
base : Integer := 0;
proficient : Boolean := false;
End Record;
Type Skills_Type is record
acrobatics : Proficient_Type;
animalHandling : Proficient_Type;
arcana : Proficient_Type;
athletics : Proficient_Type;
deception : Proficient_Type;
history : Proficient_Type;
insight : Proficient_Type;
intimidation : Proficient_Type;
investigation : Proficient_Type;
medicine : Proficient_Type;
nature : Proficient_Type;
perception : Proficient_Type;
performance : Proficient_Type;
persuasion : Proficient_Type;
religion : Proficient_Type;
sleightOfHand : Proficient_Type;
stealth : Proficient_Type;
survival : Proficient_Type;
End Record;
Type Class_Type is record
--features : Features_Array;
hitDice : Integer;
main : Class_List;
subclass : Subclass_List;
level : Integer;
skill : Skills_Type;
skillName : Skills_List;
proficiency : Integer;
End record;
Type Health_Type is record
current : Integer;
total : Integer;
End record;
Type Name_Type is record
name : String (1..25);
length : Integer;
End record;
Type Race_Type is record
main : Race_List;
subrace : Subrace_List;
size : Character;
speed : Integer;
End record;
Type Weapon_Info is record
classification : Weapon_Classification_List;
damageAbility : Ability_Scores_List;
die : Positive;
name : String (1..14);
nameLength : Positive := 5;
toHit : Integer;
proficient : Boolean;
End record;
Type Weapons_Type is array (Weapons_List) of Weapon_Info;
Type Ability_Score_Type is record
base : Integer;
modifier : Integer;
End record;
Type Stats_Type is record
STR : Ability_Score_Type;
DEX : Ability_Score_Type;
CON : Ability_Score_Type;
INT : Ability_Score_Type;
WIS : Ability_Score_Type;
CHA : Ability_Score_Type;
End record;
Type Combat_Type is record
STRbased : Integer;
DEXbased : Integer;
STRproficient : Integer;
DEXproficient : Integer;
unarmedAttack : Integer;
spellDC : Integer;
spellAttack : Integer;
spellStat : Ability_Scores_List;
attack : Weapons_Type;
End record;
Type Character_Type is record
class : Class_Type;
health : Health_Type;
name : Name_Type;
race : Race_Type;
stat : Stats_Type;
combat : Combat_Type;
End record;
THIRTY_THREE_DASHES : CONSTANT String := "---------------------------------";
TABLE_BORDER : CONSTANT String := "|----|---------------------------------";
--Subprograms
Procedure getUserInput(character : out Character_Type) is
choosingScoreImprovement : Boolean := True;
levelFlag : Boolean := True;
profFlag : Boolean := True;
scoresFlag : Boolean := True;
subraceFlag : Boolean := True;
Begin -- getUserInput
-- Name the character
Put ("Enter the character's name: ");
New_Line;
Put (">>> ");
Get_Line(character.name.name, character.name.length);
New_Line;
-- Select the character's race
Put ("Choose your character's race from the following list:");
New_Line;
Put ("Dragonborn, Dwarf, Elf, Gnome, HalfElf, Halfling, HalfOrc, Human, Tiefling: ");
--------Data Validation Loop--------
validRaceLoop:
Loop
raceInputBlock:
begin
New_Line;
Put (">>> ");
Race_IO.Get (character.race.main);
exit validRaceLoop;
exception
When Ada.Text_IO.DATA_ERROR =>
New_Line;
Put ("Dragonborn, Dwarf, Elf, Gnome, HalfElf, Halfling, HalfOrc, Human, Tiefling?");
Skip_Line;
End raceInputBlock;
End loop validRaceLoop;
--------Data Validation Loop--------
New_Line;
-- Select the character's subrace/nationality/ancestry.
Case character.race.main is
-- If the character is a Human, have them choose their nationality.
When Human => Put ("Choose your character's nationality from the following list:");
While subraceFlag Loop
New_Line;
Put ("Calishite, Chondathan, Damaran, Illuskan, Mulan,");
New_Line;
Put ("Rashemi, Shou, Tethyrian, or Turami");
validHumanLoop: -- Only allow valid human subrace
Loop
humanInputBlock:
begin
New_Line;
Put (">>> ");
Subrace_IO.Get (character.race.subrace);
If character.race.subrace = Calishite Then
subraceFlag := False;
Elsif character.race.subrace = Chondathan Then
subraceFlag := False;
Elsif character.race.subrace = Damaran Then
subraceFlag := False;
Elsif character.race.subrace = Illuskan Then
subraceFlag := False;
Elsif character.race.subrace = Mulan Then
subraceFlag := False;
Elsif character.race.subrace = Rashemi Then
subraceFlag := False;
Elsif character.race.subrace = Shou Then
subraceFlag := False;
Elsif character.race.subrace = Tethyrian Then
subraceFlag := False;
Elsif character.race.subrace = Turami Then
subraceFlag := False;
Else
subraceFlag := True;
End If;
exit validHumanLoop;
exception
When Ada.Text_IO.DATA_ERROR =>
New_Line;
Put ("Calishite, Chondathan, Damaran, Illuskan, Mulan,");
New_Line;
Put ("Rashemi, Shou, Tethyrian, or Turami");
Skip_Line;
End humanInputBlock;
End Loop validHumanLoop;
End Loop;
-- If the character is a Dragonborn, have them choose their Draconic Ancestry.
When Dragonborn => Put ("Choose your dragonborn's ancestry from the following list:");
While subraceFlag Loop
New_Line;
Put ("Black (Acid), Blue (Lightning), Brass (Fire), Bronze (Lightning), Copper (Acid),");
New_Line;
Put ("Gold (Fire), Green (Poison), Red (Fire), Silver (Cold), White (Cold)");
New_Line;
Put("Enter only the color.");
validDragonbornLoop: -- Only allow valid dragonborn subrace
Loop
dragonbornInputBlock:
begin
New_Line;
Put (">>> ");
Subrace_IO.Get (character.race.subrace);
If character.race.subrace = Black Then
subraceFlag := False;
Elsif character.race.subrace = Blue Then
subraceFlag := False;
Elsif character.race.subrace = Brass Then
subraceFlag := False;
Elsif character.race.subrace = Bronze Then
subraceFlag := False;
Elsif character.race.subrace = Copper Then
subraceFlag := False;
Elsif character.race.subrace = Gold Then
subraceFlag := False;
Elsif character.race.subrace = Green Then
subraceFlag := False;
Elsif character.race.subrace = Red Then
subraceFlag := False;
Elsif character.race.subrace = Silver Then
subraceFlag := False;
Elsif character.race.subrace = White Then
subraceFlag := False;
Else
subraceFlag := True;
End If;
exit validDragonbornLoop;
exception
When Ada.Text_IO.DATA_ERROR =>
New_Line;
Put ("Black, Blue, Bronze, Brass, Copper,");
New_Line;
Put ("Gold, Green, Red, Silver, White");
Skip_Line;
End dragonbornInputBlock;
End Loop validDragonbornLoop;
End Loop;
When others => null;
End Case;
New_Line;
Put ("Choose your character's class from the following list:");
New_Line;
Put ("Barbarian, Bard, Cleric, Druid, Fighter, Monk,");
New_Line;
Put ("Paladin, Ranger, Rogue, Sorcerer, Warlock, Wizard");
--------Data Validation Loop--------
validClassLoop:
Loop
classInputBlock:
begin
New_Line;
Put (">>> ");
Class_IO.Get (character.class.main);
Exit validClassLoop;
exception
When Ada.Text_IO.DATA_ERROR =>
New_Line;
Put ("Barbarian, Bard, Cleric, Druid, Fighter, Monk,");
New_Line;
Put ("Paladin, Ranger, Rogue, Sorcerer, Warlock, or Wizard?");
Skip_Line;
End classInputBlock;
End Loop validClassLoop;
--------Data Validation Loop--------
-- Set the character's subclass based on their main class
Case character.class.main is
When Barbarian => character.class.subclass := Berserker;
When Bard => character.class.subclass := Lore;
When Cleric => character.class.subclass := Life;
When Druid => character.class.subclass := Land;
When Fighter => character.class.subclass := Champion;
When Monk => character.class.subclass := OpenHand;
When Paladin => character.class.subclass := Devotion;
When Ranger => character.class.subclass := Hunter;
When Rogue => character.class.subclass := Thief;
When Sorcerer => character.class.subclass := Draconic;
When Warlock => character.class.subclass := Fiend;
When Wizard => character.class.subclass := Evocation;
End Case;
New_Line;
-- Have the user input their character's level.
-- Levels lesser than or equal to 0 are not valid.
-- Levels greater than 20 are not valid.
-- D&D 5th Edition does not have official character support for
-- levels outside of the valid range.
While levelFlag Loop
Put ("Note: Valid level range is 1-20.");
New_Line;
Put ("Enter the character's level: ");
New_Line;
Put (">>> ");
Get (character.class.level);
If character.class.level >= 1 and character.class.level <=20 Then
levelFlag := False;
Else
levelFlag := True;
End If;
Skip_Line;
New_Line;
End Loop;
-- Have the user input their raw ability score rolls.
-- This program calculates racial bonuses for the user.
While scoresFlag Loop
Put ("Note: Valid unmodified score range is 3-18.");
New_Line;
Put ("Please enter your unmodified scores, in the following order, and on one line: ");
New_Line;
Put ("STR, DEX, CON, INT, WIS, and CHA");
New_Line;
Put (">>> ");
Ada.Integer_Text_IO.Get (character.stat.STR.base);
Ada.Integer_Text_IO.Get (character.stat.DEX.base);
Ada.Integer_Text_IO.Get (character.stat.CON.base);
Ada.Integer_Text_IO.Get (character.stat.INT.base);
Ada.Integer_Text_IO.Get (character.stat.WIS.base);
Ada.Integer_Text_IO.Get (character.stat.CHA.base);
If character.stat.STR.base >= 3 and character.stat.STR.base <= 18 and
character.stat.DEX.base >= 3 and character.stat.DEX.base <= 18 and
character.stat.CON.base >= 3 and character.stat.CON.base <= 18 and
character.stat.INT.base >= 3 and character.stat.INT.base <= 18 and
character.stat.WIS.base >= 3 and character.stat.WIS.base <= 18 and
character.stat.CHA.base >= 3 and character.stat.CHA.base <= 18 Then
scoresFlag := False;
Else
scoresFlag := True;
End If;
Skip_Line;
New_Line;
End Loop;
-- Have the user input their character's total health.
-- No support for auto-calculating based on modifiers.
Put ("Please enter your character's total health: ");
New_Line;
Put (">>> ");
Get (character.health.total);
Skip_Line;
End getUserInput;
------------------------------------------------------------
Procedure caseClassInfo (character : in out Character_type) is
numSkillProfs : Integer := 2;
temp : Skills_List;
Begin -- caseClassInfo
-- Assign the character's hit dice based on their class.
Case character.class.main is
When Barbarian => character.class.hitDice := 12;
When Bard => character.class.hitDice := 8;
When Cleric => character.class.hitDice := 8;
When Druid => character.class.hitDice := 8;
When Fighter => character.class.hitDice := 10;
When Monk => character.class.hitDice := 8;
When Paladin => character.class.hitDice := 10;
When Ranger => character.class.hitDice := 10;
When Rogue => character.class.hitDice := 8;
When Sorcerer => character.class.hitDice := 6;
When Warlock => character.class.hitDice := 8;
When Wizard => character.class.hitDice := 6;
End Case;
-- Have the user select their proficiencies.
Case character.class.main is
When Barbarian => Put ("You can choose 2 skill proficiencies from the following list:");
New_Line;
Put ("Animal_Handling, Athletics, Intimidation, Nature, Perception");
New_Line;
When Bard => Put ("You can choose any 3 skill proficiencies. Your options are:");
New_Line;
Put ("Acrobatics, Animal_Handling, Arcana, Athletics, Deception, History,");
New_Line;
Put ("Insight, Intimidation, Investigation, Medicine, Nature, Perception,");
New_Line;
Put ("Performance, Persuasion, Religion, Sleight_of_Hand, Stealth, Survival");
New_Line;
numSkillProfs := 3;
When Cleric => Put ("You can choose 2 skill proficiencies from the following list:");
New_Line;
Put ("History, Insight, Medicine, Persuasion, Religion");
New_Line;
When Druid => Put ("You can choose 2 skill proficiencies from the following list:");
New_Line;
Put ("Arcana, Animal_Handling, Insight, Medicine, Nature, Perception, Religion, Survival");
New_Line;
When Fighter => Put ("You can choose 2 skill proficiencies from the following list:");
New_Line;
Put ("Acrobatics, Animal_Handling, Athletics, History,");
New_Line;
Put ("Insight, Intimidation, Perception, Survival");
New_Line;
When Monk => Put ("You can choose 2 skill proficiencies from the following list:");
New_Line;
Put ("Acrobatics, Athletics, History, Insight, Religion, Stealth");
New_Line;
When Paladin => Put ("You can choose 2 skill proficiencies from the following list:");
New_Line;
Put ("Athletics, Insight, Intimidation, Medicine, Persuasion, Religion");
New_Line;
When Ranger => Put ("You can choose 3 skill proficiencies from the following list:");
New_Line;
Put ("Animal_Handling, Athletics, Deception, Insight, Intimidation,");
New_Line;
Put ("Investigation, Perception, Persuasion, Sleight_of_Hand, Stealth");
New_Line;
numSkillProfs := 3;
When Rogue => Put ("You can choose 4 skill proficiencies from the following list:");
New_Line;
Put ("Acrobatics, Athletics, Deception, Insight, Intimidation,");
New_Line;
Put ("Investigation, Perception, Persuasion, Sleight_of_Hand, Stealth");
New_Line;
numSkillProfs := 4;
When Sorcerer => Put ("You can choose 2 skill proficiencies from the following list:");
New_Line;
Put ("Arcana, Deception, Insight, Intimidation, Persuasion, Religion");
New_Line;
When Warlock => Put ("You can choose 2 skill proficiencies from the following list:");
New_Line;
Put ("Arcana, Deception, History, Intimidation, Investigation, Nature, Religion");
New_Line;
When Wizard => Put ("You can choose 2 skill proficiencies from the following list:");
New_Line;
Put ("Arcana, History, Insight, Investigation, Medicine, Religion");
New_Line;
End Case;
-- Bards get 3 proficiencies
-- Ranger get 3 proficiencies
-- Rogues get 4 proficiencies
If character.class.main = Bard Then
numSkillProfs := 3;
Elsif character.class.main = Ranger Then
numSkillProfs := 3;
Elsif character.class.main = Rogue Then
numSkillProfs := 4;
Else
numSkillProfs := 2;
End If;
-- Proficiency selection loop
For i in 1..numSkillProfs Loop
Put (i, 1);
Put (". ");
Skills_IO.Get (character.class.skillName);
temp := character.class.skillName;
Case temp is
When Acrobatics => character.class.skill.acrobatics.proficient := True;
When Animal_Handling => character.class.skill.animalhandling.proficient := True;
When Arcana => character.class.skill.arcana.proficient := True;
When Athletics => character.class.skill.athletics.proficient := True;
When Deception => character.class.skill.deception.proficient := True;
When History => character.class.skill.history.proficient := True;
When Insight => character.class.skill.insight.proficient := True;
When Intimidation => character.class.skill.intimidation.proficient := True;
When Investigation => character.class.skill.investigation.proficient := True;
When Medicine => character.class.skill.medicine.proficient := True;
When Nature => character.class.skill.nature.proficient := True;
When Perception => character.class.skill.perception.proficient := True;
When Performance => character.class.skill.performance.proficient := True;
When Persuasion => character.class.skill.persuasion.proficient := True;
When Religion => character.class.skill.religion.proficient := True;
When Sleight_of_Hand => character.class.skill.sleightOfHand.proficient := True;
When Stealth => character.class.skill.stealth.proficient := True;
When Survival => character.class.skill.survival.proficient := True;
End Case;
End Loop;
Skip_Line;
-- Add character's proficiency to skills they selected
----------
If character.class.skill.acrobatics.proficient Then
character.class.skill.acrobatics.base := character.stat.DEX.modifier + character.class.proficiency;
Else
character.class.skill.acrobatics.base := character.stat.DEX.modifier;
End If;
----------
If character.class.skill.animalHandling.proficient Then
character.class.skill.animalHandling.base := character.stat.WIS.modifier + character.class.proficiency;
Else
character.class.skill.animalHandling.base := character.stat.WIS.modifier;
End If;
----------
If character.class.skill.arcana.proficient Then
character.class.skill.arcana.base := character.stat.INT.modifier + character.class.proficiency;
Else
character.class.skill.arcana.base := character.stat.INT.modifier;
End If;
----------
If character.class.skill.athletics.proficient Then
character.class.skill.athletics.base := character.stat.STR.modifier + character.class.proficiency;
Else
character.class.skill.athletics.base := character.stat.STR.modifier;
End If;
----------
If character.class.skill.deception.proficient Then
character.class.skill.deception.base := character.stat.CHA.modifier + character.class.proficiency;
Else
character.class.skill.deception.base := character.stat.CHA.modifier;
End If;
----------
If character.class.skill.history.proficient Then
character.class.skill.history.base := character.stat.INT.modifier + character.class.proficiency;
Else
character.class.skill.history.base := character.stat.INT.modifier;
End If;
----------
If character.class.skill.insight.proficient Then
character.class.skill.insight.base := character.stat.WIS.modifier + character.class.proficiency;
Else
character.class.skill.insight.base := character.stat.WIS.modifier;
End If;
----------
If character.class.skill.intimidation.proficient Then
character.class.skill.intimidation.base := character.stat.CHA.modifier + character.class.proficiency;
Else
character.class.skill.intimidation.base := character.stat.CHA.modifier;
End If;
----------
If character.class.skill.investigation.proficient Then
character.class.skill.investigation.base := character.stat.INT.modifier + character.class.proficiency;
Else
character.class.skill.investigation.base := character.stat.INT.modifier;
End If;
----------
If character.class.skill.medicine.proficient Then
character.class.skill.medicine.base := character.stat.WIS.modifier + character.class.proficiency;
Else
character.class.skill.medicine.base := character.stat.WIS.modifier;
End If;
----------
If character.class.skill.nature.proficient Then
character.class.skill.nature.base := character.stat.INT.modifier + character.class.proficiency;
Else
character.class.skill.nature.base := character.stat.INT.modifier;
End If;
----------
If character.class.skill.perception.proficient Then
character.class.skill.perception.base := character.stat.WIS.modifier + character.class.proficiency;
Else
character.class.skill.perception.base := character.stat.WIS.modifier;
End If;
----------
If character.class.skill.performance.proficient Then
character.class.skill.performance.base := character.stat.CHA.modifier + character.class.proficiency;
Else
character.class.skill.performance.base := character.stat.CHA.modifier;
End If;
----------
If character.class.skill.persuasion.proficient Then
character.class.skill.persuasion.base := character.stat.CHA.modifier + character.class.proficiency;
Else
character.class.skill.persuasion.base := character.stat.CHA.modifier;
End If;
----------
If character.class.skill.religion.proficient Then
character.class.skill.religion.base := character.stat.INT.modifier + character.class.proficiency;
Else
character.class.skill.religion.base := character.stat.INT.modifier;
End If;
----------
If character.class.skill.sleightOfHand.proficient Then
character.class.skill.sleightOfHand.base := character.stat.DEX.modifier + character.class.proficiency;
Else
character.class.skill.sleightOfHand.base := character.stat.DEX.modifier;
End If;
----------
If character.class.skill.stealth.proficient Then
character.class.skill.stealth.base := character.stat.DEX.modifier + character.class.proficiency;
Else
character.class.skill.stealth.base := character.stat.DEX.modifier;
End If;
----------
If character.class.skill.survival.proficient Then
character.class.skill.survival.base := character.stat.WIS.modifier + character.class.proficiency;
Else
character.class.skill.survival.base := character.stat.WIS.modifier;
End If;
----------
End caseClassInfo;
------------------------------------------------------------
Procedure caseAbilityScores (character : in out Character_Type) is
Begin -- caseAbilityScores
-- Assign modifiers to ability scores
Case character.stat.STR.base is
When 1 => character.stat.STR.modifier := -5;
When 2..3 => character.stat.STR.modifier := -4;
When 4..5 => character.stat.STR.modifier := -3;
When 6..7 => character.stat.STR.modifier := -2;
When 8..9 => character.stat.STR.modifier := -1;
When 10..11 => character.stat.STR.modifier := 0;
When 12..13 => character.stat.STR.modifier := 1;
When 14..15 => character.stat.STR.modifier := 2;
When 16..17 => character.stat.STR.modifier := 3;
When 18..19 => character.stat.STR.modifier := 4;
When 20 => character.stat.STR.modifier := 5;
When others => character.stat.STR.modifier := -99;
End Case;
Case character.stat.DEX.base is
When 1 => character.stat.DEX.modifier := -5;
When 2..3 => character.stat.DEX.modifier := -4;
When 4..5 => character.stat.DEX.modifier := -3;
When 6..7 => character.stat.DEX.modifier := -2;
When 8..9 => character.stat.DEX.modifier := -1;
When 10..11 => character.stat.DEX.modifier := 0;
When 12..13 => character.stat.DEX.modifier := 1;
When 14..15 => character.stat.DEX.modifier := 2;
When 16..17 => character.stat.DEX.modifier := 3;
When 18..19 => character.stat.DEX.modifier := 4;
When 20 => character.stat.DEX.modifier := 5;
When others => character.stat.DEX.modifier := -99;
End Case;
Case character.stat.CON.base is
When 1 => character.stat.CON.modifier := -5;
When 2..3 => character.stat.CON.modifier := -4;
When 4..5 => character.stat.CON.modifier := -3;
When 6..7 => character.stat.CON.modifier := -2;
When 8..9 => character.stat.CON.modifier := -1;
When 10..11 => character.stat.CON.modifier := 0;
When 12..13 => character.stat.CON.modifier := 1;
When 14..15 => character.stat.CON.modifier := 2;
When 16..17 => character.stat.CON.modifier := 3;
When 18..19 => character.stat.CON.modifier := 4;
When 20 => character.stat.CON.modifier := 5;
When others => character.stat.CON.modifier := -99;
End Case;
Case character.stat.INT.base is
When 1 => character.stat.INT.modifier := -5;
When 2..3 => character.stat.INT.modifier := -4;
When 4..5 => character.stat.INT.modifier := -3;
When 6..7 => character.stat.INT.modifier := -2;
When 8..9 => character.stat.INT.modifier := -1;
When 10..11 => character.stat.INT.modifier := 0;
When 12..13 => character.stat.INT.modifier := 1;
When 14..15 => character.stat.INT.modifier := 2;
When 16..17 => character.stat.INT.modifier := 3;
When 18..19 => character.stat.INT.modifier := 4;
When 20 => character.stat.INT.modifier := 5;
When others => character.stat.INT.modifier := -99;
End Case;
Case character.stat.WIS.base is
When 1 => character.stat.WIS.modifier := -5;
When 2..3 => character.stat.WIS.modifier := -4;
When 4..5 => character.stat.WIS.modifier := -3;
When 6..7 => character.stat.WIS.modifier := -2;
When 8..9 => character.stat.WIS.modifier := -1;
When 10..11 => character.stat.WIS.modifier := 0;
When 12..13 => character.stat.WIS.modifier := 1;
When 14..15 => character.stat.WIS.modifier := 2;
When 16..17 => character.stat.WIS.modifier := 3;
When 18..19 => character.stat.WIS.modifier := 4;
When 20 => character.stat.WIS.modifier := 5;
When others => character.stat.WIS.modifier := -99;
End Case;
Case character.stat.CHA.base is
When 1 => character.stat.CHA.modifier := -5;
When 2..3 => character.stat.CHA.modifier := -4;
When 4..5 => character.stat.CHA.modifier := -3;
When 6..7 => character.stat.CHA.modifier := -2;
When 8..9 => character.stat.CHA.modifier := -1;
When 10..11 => character.stat.CHA.modifier := 0;
When 12..13 => character.stat.CHA.modifier := 1;
When 14..15 => character.stat.CHA.modifier := 2;
When 16..17 => character.stat.CHA.modifier := 3;
When 18..19 => character.stat.CHA.modifier := 4;
When 20 => character.stat.CHA.modifier := 5;
When others => character.stat.CHA.modifier := -99;
End Case;
-- Assign the character's proficiency based on their level
Case character.class.level is
When 0..4 => character.class.proficiency := 2;
When 5..8 => character.class.proficiency := 3;
When 9..12 => character.class.proficiency := 4;
When 13..16 => character.class.proficiency := 5;
When 17..20 => character.class.proficiency := 6;
When others => character.class.proficiency := 0;
End Case;
End caseAbilityScores;
------------------------------------------------------------
Procedure caseRaceInfo (character : in out Character_Type) is
Begin --caseRaceInfo
-- Assign speed, size, and ability score
-- increases based on the character's race.
Case character.race.main is
When Dragonborn => character.race.speed := 30;
character.race.size := 'M';
character.stat.STR.base := character.stat.STR.base +2;
character.stat.CHA.base := character.stat.CHA.base +1;
When Dwarf => character.race.speed := 25;
character.race.size := 'M';
character.stat.CON.base := character.stat.CON.base +2;
character.race.subrace := Hill;
When Elf => character.race.speed := 30;
If character.race.subrace = High Then
character.race.speed := 35;
End if;
character.race.size := 'M';
character.stat.DEX.base := character.stat.DEX.base +2;
character.race.subrace := High;
When Gnome => character.race.speed := 25;
character.race.size := 'S';
character.stat.INT.base := character.stat.INT.base +2;
character.race.subrace := Rock;
When Halfling => character.race.speed := 25;
character.race.size := 'S';
character.stat.DEX.base := character.stat.DEX.base +2;
character.race.subrace := Lightfoot;
When Human => character.race.speed := 30;
character.race.size := 'M';
character.stat.STR.base := character.stat.STR.base +1;
character.stat.DEX.base := character.stat.DEX.base +1;
character.stat.CON.base := character.stat.CON.base +1;
character.stat.INT.base := character.stat.INT.base +1;
character.stat.WIS.base := character.stat.WIS.base +1;
character.stat.CHA.base := character.stat.CHA.base +1;
When HalfElf => character.race.speed := 30;
character.race.size := 'M';
character.stat.CHA.base := character.stat.CHA.base +2;
character.race.subrace := None;
When HalfOrc => character.race.speed := 30;
character.race.size := 'M';
character.stat.STR.base := character.stat.STR.base +2;
character.stat.CON.base := character.stat.CON.base +1;
character.race.subrace := None;
When Tiefling => character.race.speed := 30;
character.race.size := 'M';
character.stat.CHA.base := character.stat.CHA.base +2;
character.stat.INT.base := character.stat.INT.base +1;
character.race.subrace := None;
When others => null;
End Case;
-- Assign ability score increases based on the character's subrace
Case character.race.subrace is
When Hill => character.stat.WIS.base := character.stat.WIS.base +1;
When High => character.stat.INT.base := character.stat.INT.base +1;
When Lightfoot => character.stat.CHA.base := character.stat.CHA.base +1;
When Rock => character.stat.CON.base := character.stat.CON.base +1;
When others => null;
End Case;
End caseRaceInfo;
------------------------------------------------------------
Procedure halfElfAbilities (character : in out Character_Type) is
--------------------Identifiers--------------------
-- num_modified : An integer to keep track of
-- how many scores have been changed.
-- stat_temp : A variable that represents which
-- stat is being modified.
---------------------------------------------------
num_modified : Integer := 0;
stat_temp : String(1..3);
Begin -- halfElfAbilities
-- If the character is a Half Elf, the user can assign
-- 2 ability score increases and they see fit.
Put ("You have chosen Half-Elf as your race. One of your racial traits");
New_Line;
Put ("allows you to increase your ability scores.");
New_Line;
Put ("You have 2 points to allocate where you desire. Your score cannot");
New_Line;
Put ("exceed 20. Your current stats are:");
New_Line;
-- Output the character's stats to the screen
-- so the user can see what they already have.
Put (THIRTY_THREE_DASHES);
New_Line;
Set_Col(1);
Put ("STR");
Set_Col(7);
Put ("DEX");
Set_Col(13);
Put ("CON");
Set_Col(19);
Put ("INT");
Set_Col(25);
Put ("WIS");
Set_Col(31);
Put ("CHA");
New_Line;
Put (THIRTY_THREE_DASHES);
New_Line;
Set_Col(1+1);
Put (character.stat.STR.base, 1);
Set_Col(7+1);
Put (character.stat.DEX.base, 1);
Set_Col(13+1);
Put (character.stat.CON.base, 1);
Set_Col(19+1);
Put (character.stat.INT.base, 1);
Set_Col(25+1);
Put (character.stat.WIS.base, 1);
Set_Col(31+1);
Put (character.stat.CHA.base, 1);
New_Line;
Set_Col(1);
Put("(");
If character.stat.STR.modifier >= 0 Then
Put("+");
Put(character.stat.STR.modifier, 1);
Else
Put(character.stat.STR.modifier, 1);
End If;
Put(")");
Set_Col(7);
Put("(");
If character.stat.DEX.modifier >= 0 Then
Put("+");
Put(character.stat.DEX.modifier, 1);
Else
Put(character.stat.DEX.modifier, 1);
End If;
Put(")");
Set_Col(13);
Put("(");
If character.stat.CON.modifier >= 0 Then
Put("+");
Put(character.stat.CON.modifier, 1);
Else
Put(character.stat.CON.modifier, 1);
End If;
Put(")");
Set_Col(19);
Put("(");
If character.stat.INT.modifier >= 0 Then
Put("+");
Put(character.stat.INT.modifier, 1);
Else
Put(character.stat.INT.modifier, 1);
End If;
Put(")");
Set_Col(25);
Put("(");
If character.stat.WIS.modifier >= 0 Then
Put("+");
Put(character.stat.WIS.modifier, 1);
Else
Put(character.stat.WIS.modifier, 1);
End If;
Put(")");
Set_Col(31);
Put("(");
If character.stat.CHA.modifier >= 0 Then
Put("+");
Put(character.stat.CHA.modifier, 1);
Else
Put(character.stat.CHA.modifier, 1);
End If;
Put(")");
New_Line;
Put (THIRTY_THREE_DASHES);
New_Line(2);
-- Have the user select the stat(s) they would like to increase.
Put ("Enter the 3 letter abbreviation that corresponds to the");
New_Line;
Put ("ability score you would like to increase, one at a time:");
New_Line;
While (num_modified < 2) Loop
Put (">>> ");
Get(stat_temp);
If stat_temp = "STR" and character.stat.STR.base < 20 Then
character.stat.STR.base := character.stat.STR.base + 1;
num_modified := num_modified + 1;
Elsif stat_temp = "DEX" and character.stat.DEX.base < 20 Then
character.stat.DEX.base := character.stat.DEX.base + 1;
num_modified := num_modified + 1;
Elsif stat_temp = "CON" and character.stat.CON.base < 20 Then
character.stat.CON.base := character.stat.CON.base + 1;
num_modified := num_modified + 1;
Elsif stat_temp = "INT" and character.stat.INT.base < 20 Then
character.stat.INT.base := character.stat.INT.base + 1;
num_modified := num_modified + 1;
Elsif stat_temp = "WIS" and character.stat.WIS.base < 20 Then
character.stat.WIS.base := character.stat.WIS.base + 1;
num_modified := num_modified + 1;
Elsif stat_temp = "CHA" and character.stat.CHA.base < 20 Then
character.stat.CHA.base := character.stat.CHA.base + 1;
num_modified := num_modified + 1;
Else
Put ("Invalid selection. Please check you've entered a valid stat.");
End If;
New_Line;
Exit When num_modified = 2;
End Loop;
End halfElfAbilities;
------------------------------------------------------------
Procedure combatReference (character : in out Character_Type) is
spellDCBase : Integer;
Begin --combatReference
-- Physical combat information
-- Compute the attack modifer, based on the weapon's ability score
-- and the character's proficiency with that weapon.
character.combat.STRbased := character.stat.STR.modifier;
character.combat.STRproficient :=
character.stat.STR.modifier + character.class.proficiency;
character.combat.DEXbased := character.stat.DEX.modifier;
character.combat.DEXproficient :=
character.stat.DEX.modifier + character.class.proficiency;
character.combat.unarmedAttack :=
character.stat.STR.modifier + character.class.proficiency;
-- Spellcasting Information
-- Calculate the Spell Save DC, Spell Attack Modifier, and
-- set the Spellcasting Ability Score.
spellDCBase := 8 + character.class.proficiency;
Case character.class.main is
When Bard => character.combat.spellDC :=
spellDCBase + character.stat.CHA.modifier;
character.combat.spellAttack :=
character.class.proficiency + character.stat.CHA.modifier;
character.combat.spellStat := CHA;
When Cleric => character.combat.spellDC :=
spellDCBase + character.stat.WIS.modifier;
character.combat.spellAttack :=
character.class.proficiency + character.stat.WIS.modifier;
character.combat.spellStat := WIS;
When Druid => character.combat.spellDC :=
spellDCBase + character.stat.WIS.modifier;
character.combat.spellAttack :=
character.class.proficiency + character.stat.WIS.modifier;
character.combat.spellStat := WIS;
-- Monks are not spellcasters. In this case,
-- spellDC refers to the Monk's Ki Save DC.
When Monk => character.combat.spellDC :=
spellDCBase + character.stat.WIS.modifier;
character.combat.spellAttack := -99;
character.combat.spellStat := NA;
When Paladin => character.combat.spellDC :=
spellDCBase + character.stat.CHA.modifier;
character.combat.spellAttack :=
character.class.proficiency + character.stat.CHA.modifier;
character.combat.spellStat := CHA;
When Ranger => character.combat.spellDC :=
spellDCBase + character.stat.WIS.modifier;
character.combat.spellAttack :=
character.class.proficiency + character.stat.WIS.modifier;
character.combat.spellStat := WIS;
When Sorcerer => character.combat.spellDC :=
spellDCBase + character.stat.CHA.modifier;
character.combat.spellAttack :=
character.class.proficiency + character.stat.CHA.modifier;
character.combat.spellStat := CHA;
When Warlock => character.combat.spellDC :=
spellDCBase + character.stat.CHA.modifier;
character.combat.spellAttack :=
character.class.proficiency + character.stat.CHA.modifier;
character.combat.spellStat := CHA;
When Wizard => character.combat.spellDC :=
spellDCBase + character.stat.INT.modifier;
character.combat.spellAttack :=
character.class.proficiency + character.stat.INT.modifier;
character.combat.spellStat := INT;
-- Non-Spellcasters get their scores set to an arbitrary
-- value because they don't have a Spell Save DC,
-- Spell Attack Modifier, or a Spellcasting Ability Score.
-- These values are set in the rare event that a
-- non-spellcasting class gets classified as spellcasting.
When others => character.combat.spellDC := -99;
character.combat.spellAttack := -99;
character.combat.spellStat := NA;
End Case;
-- Hard Coded:
-- Damage Die
-- Classification (simple/martial)
-- Damage Ability Score
-- Name string
-- Name length integer
character.combat.attack(Battleaxe).die := 8;
character.combat.attack(Battleaxe).classification := Martial;
character.combat.attack(Battleaxe).damageAbility := STR;
character.combat.attack(Battleaxe).name := "Battleaxe ";
character.combat.attack(Battleaxe).nameLength := 9;
---
character.combat.attack(Blowgun).die := 1;
character.combat.attack(Blowgun).classification := Martial;
character.combat.attack(Blowgun).damageAbility := DEX;
character.combat.attack(Blowgun).name := "Blowgun ";
character.combat.attack(Blowgun).nameLength := 7;
---
character.combat.attack(Club).die := 4;
character.combat.attack(Club).classification := Simple;
character.combat.attack(Club).damageAbility := STR;
character.combat.attack(Club).name := "Club ";
character.combat.attack(Club).nameLength := 4;
---
character.combat.attack(Dagger).die := 4;
character.combat.attack(Dagger).classification := Simple;
character.combat.attack(Dagger).damageAbility := STR;
character.combat.attack(Dagger).name := "Dagger ";
character.combat.attack(Dagger).nameLength := 6;
---
character.combat.attack(Dart).die := 4;
character.combat.attack(Dart).classification := Simple;
character.combat.attack(Dart).damageAbility := DEX;
character.combat.attack(Dart).name := "Dart ";
character.combat.attack(Dart).nameLength := 4;
---
character.combat.attack(Flail).die := 8;
character.combat.attack(Flail).classification := Martial;
character.combat.attack(Flail).damageAbility := STR;
character.combat.attack(Flail).name := "Flail ";
character.combat.attack(Flail).nameLength := 5;
---
character.combat.attack(Glaive).die := 10;
character.combat.attack(Glaive).classification := Martial;
character.combat.attack(Glaive).damageAbility := STR;
character.combat.attack(Glaive).name := "Glaive ";
character.combat.attack(Glaive).nameLength := 6;
---
character.combat.attack(Greatclub).die := 8;
character.combat.attack(Greatclub).classification := Simple;
character.combat.attack(Greatclub).damageAbility := STR;
character.combat.attack(Greatclub).name := "Greatclub ";
character.combat.attack(Greatclub).nameLength := 9;
---
character.combat.attack(Greatsword).die := 6;
character.combat.attack(Greatsword).classification := Martial;
character.combat.attack(Greatsword).damageAbility := STR;
character.combat.attack(Greatsword).name := "Greatsword ";
character.combat.attack(Greatsword).nameLength := 10;
---
character.combat.attack(Halberd).die := 10;
character.combat.attack(Halberd).classification := Martial;
character.combat.attack(Halberd).damageAbility := STR;
character.combat.attack(Halberd).name := "Halberd ";
character.combat.attack(Halberd).nameLength := 7;
---
character.combat.attack(Handaxe).die := 6;
character.combat.attack(Handaxe).classification := Simple;
character.combat.attack(Handaxe).damageAbility := STR;
character.combat.attack(Handaxe).name := "Handaxe ";
character.combat.attack(Handaxe).nameLength := 7;
---
character.combat.attack(HandCrossbow).die := 6;
character.combat.attack(HandCrossbow).classification := Martial;
character.combat.attack(HandCrossbow).damageAbility := DEX;
character.combat.attack(HandCrossbow).name := "Hand Crossbow ";
character.combat.attack(HandCrossbow).nameLength := 13;
---
character.combat.attack(HeavyCrossbow).die := 10;
character.combat.attack(HeavyCrossbow).classification := Martial;
character.combat.attack(HeavyCrossbow).damageAbility := DEX;
character.combat.attack(HeavyCrossbow).name := "Heavy Crossbow";
character.combat.attack(HeavyCrossbow).nameLength := 14;
---
character.combat.attack(Javelin).die := 6;
character.combat.attack(Javelin).classification := Simple;
character.combat.attack(Javelin).damageAbility := STR;
character.combat.attack(Javelin).name := "Javelin ";
character.combat.attack(Javelin).nameLength := 7;
---
character.combat.attack(Lance).die := 12;
character.combat.attack(Lance).classification := Martial;
character.combat.attack(Lance).damageAbility := STR;
character.combat.attack(Lance).name := "Lance ";
character.combat.attack(Lance).nameLength := 5;
---
character.combat.attack(LightCrossbow).die := 8;
character.combat.attack(LightCrossbow).classification := Simple;
character.combat.attack(LightCrossbow).damageAbility := DEX;
character.combat.attack(LightCrossbow).name := "Light Crossbow";
character.combat.attack(LightCrossbow).nameLength := 14;
---
character.combat.attack(LightHammer).die := 4;
character.combat.attack(LightHammer).classification := Simple;
character.combat.attack(LightHammer).damageAbility := STR;
character.combat.attack(LightHammer).name := "Light Hammer ";
character.combat.attack(LightHammer).nameLength := 12;
---
character.combat.attack(Longbow).die := 8;
character.combat.attack(Longbow).classification := Martial;
character.combat.attack(Longbow).damageAbility := DEX;
character.combat.attack(Longbow).name := "Longbow ";
character.combat.attack(Longbow).nameLength := 7;
---
character.combat.attack(Longsword).die := 8;
character.combat.attack(Longsword).classification := Martial;
character.combat.attack(Longsword).damageAbility := STR;
character.combat.attack(Longsword).name := "Longsword ";
character.combat.attack(Longsword).nameLength := 9;
---
character.combat.attack(Mace).die := 6;
character.combat.attack(Mace).classification := Simple;
character.combat.attack(Mace).damageAbility := STR;
character.combat.attack(Mace).name := "Mace ";
character.combat.attack(Mace).nameLength := 4;
---
character.combat.attack(Maul).die := 6;
character.combat.attack(Maul).classification := Martial;
character.combat.attack(Maul).damageAbility := STR;
character.combat.attack(Maul).name := "Maul ";
character.combat.attack(Maul).nameLength := 4;
---
character.combat.attack(Morningstar).die := 8;
character.combat.attack(Morningstar).classification := Martial;
character.combat.attack(Morningstar).damageAbility := STR;
character.combat.attack(Morningstar).name := "Morningstar ";
character.combat.attack(Morningstar).nameLength := 11;
---
character.combat.attack(Net).die := 99;
character.combat.attack(Net).classification := Martial;
character.combat.attack(Net).damageAbility := DEX;
character.combat.attack(Net).name := "Net ";
character.combat.attack(Net).nameLength := 3;
---
character.combat.attack(Pike).die := 10;
character.combat.attack(Pike).classification := Martial;
character.combat.attack(Pike).damageAbility := STR;
character.combat.attack(Pike).name := "Pike ";
character.combat.attack(Pike).nameLength := 4;
---
character.combat.attack(Quarterstaff).die := 6;
character.combat.attack(Quarterstaff).classification := Simple;
character.combat.attack(Quarterstaff).damageAbility := STR;
character.combat.attack(Quarterstaff).name := "Quarterstaff ";
character.combat.attack(Quarterstaff).nameLength := 12;
---
character.combat.attack(Rapier).die := 8;
character.combat.attack(Rapier).classification := Martial;
character.combat.attack(Rapier).damageAbility := STR;
character.combat.attack(Rapier).name := "Rapier ";
character.combat.attack(Rapier).nameLength := 6;
---
character.combat.attack(Scimitar).die := 6;
character.combat.attack(Scimitar).classification := Martial;
character.combat.attack(Scimitar).damageAbility := STR;
character.combat.attack(Scimitar).name := "Scimitar ";
character.combat.attack(Scimitar).nameLength := 8;
---
character.combat.attack(Shortbow).die := 6;
character.combat.attack(Shortbow).classification := Simple;
character.combat.attack(Shortbow).damageAbility := DEX;
character.combat.attack(Shortbow).name := "Shortbow ";
character.combat.attack(Shortbow).nameLength := 8;
---
character.combat.attack(Shortsword).die := 6;
character.combat.attack(Shortsword).classification := Martial;
character.combat.attack(Shortsword).damageAbility := STR;
character.combat.attack(Shortsword).name := "Shortsword ";
character.combat.attack(Shortsword).nameLength := 10;
---
character.combat.attack(Sickle).die := 4;
character.combat.attack(Sickle).classification := Simple;
character.combat.attack(Sickle).damageAbility := STR;
character.combat.attack(Sickle).name := "Sickle ";
character.combat.attack(Sickle).nameLength := 6;
---
character.combat.attack(Sling).die := 4;
character.combat.attack(Sling).classification := Simple;
character.combat.attack(Sling).damageAbility := DEX;
character.combat.attack(Sling).name := "Sling ";
character.combat.attack(Sling).nameLength := 5;
---
character.combat.attack(Spear).die := 6;
character.combat.attack(Spear).classification := Simple;
character.combat.attack(Spear).damageAbility := STR;
character.combat.attack(Spear).name := "Spear ";
character.combat.attack(Spear).nameLength := 5;
---
character.combat.attack(Trident).die := 6;
character.combat.attack(Trident).classification := Martial;
character.combat.attack(Trident).damageAbility := STR;
character.combat.attack(Trident).name := "Trident ";
character.combat.attack(Trident).nameLength := 7;
---
character.combat.attack(Warhammer).die := 8;
character.combat.attack(Warhammer).classification := Martial;
character.combat.attack(Warhammer).damageAbility := STR;
character.combat.attack(Warhammer).name := "Warhammer ";
character.combat.attack(Warhammer).nameLength := 9;
---
character.combat.attack(Warpick).die := 8;
character.combat.attack(Warpick).classification := Martial;
character.combat.attack(Warpick).damageAbility := STR;
character.combat.attack(Warpick).name := "Warpick ";
character.combat.attack(Warpick).nameLength := 7;
---
character.combat.attack(Whip).die := 4;
character.combat.attack(Whip).classification := Martial;
character.combat.attack(Whip).damageAbility := STR;
character.combat.attack(Whip).name := "Whip ";
character.combat.attack(Whip).nameLength := 4;
--Assign weapon proficiencies based on class
For i in character.combat.attack'range Loop
---
If character.class.main = Barbarian Then
character.combat.attack(i).proficient := True;
--If character.combat.attack(i).classification = Simple Then
-- character.combat.attack(i).proficient := True;
--Else
-- character.combat.attack(i).proficient := True;
--End If;
---
Elsif character.class.main = Bard Then
If character.combat.attack(i).classification = Simple Then
character.combat.attack(i).proficient := True;
Else
character.combat.attack(i).proficient := False;
End If;
character.combat.attack(HandCrossbow).proficient := True;
character.combat.attack(Longsword).proficient := True;
character.combat.attack(Rapier).proficient := True;
character.combat.attack(Shortsword).proficient := True;
---
Elsif character.class.main = Cleric Then
If character.combat.attack(i).classification = Simple Then
character.combat.attack(i).proficient := True;
Else
character.combat.attack(i).proficient := False;
End If;
---
Elsif character.class.main = Druid Then
If character.combat.attack(i).classification = Simple Then
character.combat.attack(i).proficient := False;
Else
character.combat.attack(i).proficient := False;
End If;
character.combat.attack(Club).proficient := True;
character.combat.attack(Dagger).proficient := True;
character.combat.attack(Dart).proficient := True;
character.combat.attack(Javelin).proficient := True;
character.combat.attack(Mace).proficient := True;
character.combat.attack(Quarterstaff).proficient := True;
character.combat.attack(Scimitar).proficient := True;
character.combat.attack(Sickle).proficient := True;
character.combat.attack(Sling).proficient := True;
character.combat.attack(Spear).proficient := True;
---
Elsif character.class.main = Fighter Then
character.combat.attack(i).proficient := True;
--If character.combat.attack(i).classification = Simple Then
-- character.combat.attack(i).proficient := True;
--Else
-- character.combat.attack(i).proficient := True;
--End If;
---
Elsif character.class.main = Monk Then
If character.combat.attack(i).classification = Simple Then
character.combat.attack(i).proficient := True;
Else
character.combat.attack(i).proficient := False;
End If;
character.combat.attack(Shortsword).proficient := True;
---
Elsif character.class.main = Paladin Then
character.combat.attack(i).proficient := True;
--If character.combat.attack(i).classification = Simple Then
-- character.combat.attack(i).proficient := True;
--Else
-- character.combat.attack(i).proficient := True;
--End If;
---
Elsif character.class.main = Ranger Then
character.combat.attack(i).proficient := True;
--If character.combat.attack(i).classification = Simple Then
-- character.combat.attack(i).proficient := True;
--Else
-- character.combat.attack(i).proficient := True;
--End If;
---
Elsif character.class.main = Rogue Then
If character.combat.attack(i).classification = Simple Then
character.combat.attack(i).proficient := True;
Else
character.combat.attack(i).proficient := False;
End If;
character.combat.attack(HandCrossbow).proficient := True;
character.combat.attack(Longsword).proficient := True;
character.combat.attack(Rapier).proficient := True;
character.combat.attack(Shortsword).proficient := True;
---
Elsif character.class.main = Sorcerer Then
If character.combat.attack(i).classification = Simple Then
character.combat.attack(i).proficient := False;
Else
character.combat.attack(i).proficient := False;
End If;
character.combat.attack(Dagger).proficient := True;
character.combat.attack(Dart).proficient := True;
character.combat.attack(Sling).proficient := True;
character.combat.attack(Quarterstaff).proficient := True;
character.combat.attack(LightCrossbow).proficient := True;
---
Elsif character.class.main = Warlock Then
If character.combat.attack(i).classification = Simple Then
character.combat.attack(i).proficient := True;
Else
character.combat.attack(i).proficient := False;
End If;
---
Elsif character.class.main = Wizard Then
If character.combat.attack(i).classification = Simple Then
character.combat.attack(i).proficient := False;
Else
character.combat.attack(i).proficient := False;
End If;
character.combat.attack(Dagger).proficient := True;
character.combat.attack(Dart).proficient := True;
character.combat.attack(Sling).proficient := True;
character.combat.attack(Quarterstaff).proficient := True;
character.combat.attack(LightCrossbow).proficient := True;
End If;
-- Assign to hit and damage modifiers based on class proficiencies
If character.combat.attack(i).proficient Then
If character.combat.attack(i).damageAbility = STR Then
character.combat.attack(i).toHit := character.combat.STRproficient;
Else
character.combat.attack(i).toHit := character.combat.DEXproficient;
End IF;
Elsif character.combat.attack(i).proficient = False Then
If character.combat.attack(i).damageAbility = STR Then
character.combat.attack(i).toHit := character.combat.STRbased;
Else
character.combat.attack(i).toHit := character.combat.DEXbased;
End IF;
Else
character.combat.attack(i).toHit := -99;
End IF;
End Loop;
End combatReference;
------------------------------------------------------------
Procedure outputToConsole (character : in Character_Type) is
Begin -- outputToConsole
Put (THIRTY_THREE_DASHES);
New_Line;
Put (character.name.name (1..character.name.length)); -- Name
New_Line;
If character.race.size = 'S' Then -- Size
Put ("SMALL ");
Elsif character.race.size = 'M' Then
Put ("MEDIUM ");
Elsif character.race.size = 'L' Then
Put ("LARGE ");
End IF;
Put (character.race.subrace); -- Subrace
Put (" ");
Put (character.race.main); -- Main Race
Put (" ");
Put (character.class.main); -- Main Class
Put (" (");
Put (character.class.level, 1); -- Level
Put (")");
New_Line;
Put (THIRTY_THREE_DASHES);
New_Line;
Put ("Total Health: ");
Put (character.health.total, 1); -- Health
New_Line;
Put ("Armor Class: ");
Put (10 + character.stat.DEX.modifier, 2); -- Armor Class
Put (" (Unarmored)");
New_Line;
Put ("Hit Dice: ");
Put (character.class.level, 2); -- (number of) Hit Dice
Put ("d");
Put (character.class.hitDice, 1); -- (size of) Hit Dice
New_Line;
Put ("Speed: ");
Put (character.race.speed, 1); -- Movement Speed
Put (" ft.");
New_Line;
Put (THIRTY_THREE_DASHES);
New_Line;
Set_Col(1); -- Stat labels
Put ("STR");
Set_Col(7);
Put ("DEX");
Set_Col(13);
Put ("CON");
Set_Col(19);
Put ("INT");
Set_Col(25);
Put ("WIS");
Set_Col(31);
Put ("CHA");
New_Line;
Put (THIRTY_THREE_DASHES);
New_Line;
Set_Col(1+1);
Put (character.stat.STR.base, 1); -- Base Stats
Set_Col(7+1);
Put (character.stat.DEX.base, 1);
Set_Col(13+1);
Put (character.stat.CON.base, 1);
Set_Col(19+1);
Put (character.stat.INT.base, 1);
Set_Col(25+1);
Put (character.stat.WIS.base, 1);
Set_Col(31+1);
Put (character.stat.CHA.base, 1);
New_Line;
Set_Col(1);
Put("(");
If character.stat.STR.modifier >= 0 Then -- Modifiers
Put("+");
Put(character.stat.STR.modifier, 1);
Else
Put(character.stat.STR.modifier, 1);
End If;
Put(")");
Set_Col(7);
Put("(");
If character.stat.DEX.modifier >= 0 Then
Put("+");
Put(character.stat.DEX.modifier, 1);
Else
Put(character.stat.DEX.modifier, 1);
End If;
Put(")");
Set_Col(13);
Put("(");
If character.stat.CON.modifier >= 0 Then
Put("+");
Put(character.stat.CON.modifier, 1);
Else
Put(character.stat.CON.modifier, 1);
End If;
Put(")");
Set_Col(19);
Put("(");
If character.stat.INT.modifier >= 0 Then
Put("+");
Put(character.stat.INT.modifier, 1);
Else
Put(character.stat.INT.modifier, 1);
End If;
Put(")");
Set_Col(25);
Put("(");
If character.stat.WIS.modifier >= 0 Then
Put("+");
Put(character.stat.WIS.modifier, 1);
Else
Put(character.stat.WIS.modifier, 1);
End If;
Put(")");
Set_Col(31);
Put("(");
If character.stat.CHA.modifier >= 0 Then
Put("+");
Put(character.stat.CHA.modifier, 1);
Else
Put(character.stat.CHA.modifier, 1);
End If;
Put(")");
New_Line;
Put (THIRTY_THREE_DASHES);
New_Line;
End outputToConsole;
------------------------------------------------------------
Procedure outputCharacterFile (character : in Character_type) is
File : File_Type;
Begin -- outputCharacterFile
-- Output most relevant info to a character file.
Create (File, name => "Character.txt");
Put (File, character.name.name (1..character.name.length)); -- Name
New_Line (File);
If character.race.size = 'S' Then -- Size
Put (File, "SMALL ");
Elsif character.race.size = 'M' Then
Put (File, "MEDIUM ");
Elsif character.race.size = 'L' Then
Put (File, "LARGE ");
End IF;
Put (File, character.race.subrace); -- Subrace
Put (File, " ");
Put (File, character.race.main); -- Main Race
Put (File, " ");
Put (File, character.class.main); -- Main Class
Put (File, " (");
Put (File, character.class.level, 1); -- Level
Put (File, ")");
New_Line (File);
Put (File, THIRTY_THREE_DASHES);
New_Line (File);
Put (File, "Total Health: ");
Put (File, character.health.total, 1); -- Health
New_Line (File);
Put (File, "Armor Class: ");
Put (File, 10 + character.stat.DEX.modifier, 2); -- Armor Class
Put (File, " (Unarmored)");
New_Line (File);
Put (File, "Hit Dice: ");
Put (File, character.class.level, 2); -- Hit Dice
Put (File, "d");
Put (File, character.class.hitDice, 1);
New_Line (File);
Put (File, "Speed: ");
Put (File, character.race.speed, 1); -- Speed
Put (File, " ft.");
New_Line (File);
Put (File, THIRTY_THREE_DASHES);
New_Line (File);
Set_Col (File, 1); -- Stats
Put (File, "STR");
Set_Col (File, 7);
Put (File, "DEX");
Set_Col (File, 13);
Put (File, "CON");
Set_Col (File, 19);
Put (File, "INT");
Set_Col (File, 25);
Put (File, "WIS");
Set_Col (File, 31);
Put (File, "CHA");
New_Line (File);
Put (File, THIRTY_THREE_DASHES);
New_Line (File);
Set_Col (File, 1+1);
Put (File, character.stat.STR.base, 1);
Set_Col (File, 7+1);
Put (File, character.stat.DEX.base, 1);
Set_Col (File, 13+1);
Put (File, character.stat.CON.base, 1);
Set_Col (File, 19+1);
Put (File, character.stat.INT.base, 1);
Set_Col (File, 25+1);
Put (File, character.stat.WIS.base, 1);
Set_Col (File, 31+1);
Put (File, character.stat.CHA.base, 1);
New_Line (File);
Set_Col (File, 1);
Put (File, "(");
If character.stat.STR.modifier >= 0 Then
Put (File, "+");
Put (File, character.stat.STR.modifier, 1);
Else
Put (File, character.stat.STR.modifier, 1);
End If;
Put (File, ")");
Set_Col (File, 7);
Put (File, "(");
If character.stat.DEX.modifier >= 0 Then
Put (File, "+");
Put (File, character.stat.DEX.modifier, 1);
Else
Put (File, character.stat.DEX.modifier, 1);
End If;
Put (File, ")");
Set_Col (File, 13);
Put (File, "(");
If character.stat.CON.modifier >= 0 Then
Put (File, "+");
Put (File, character.stat.CON.modifier, 1);
Else
Put (File, character.stat.CON.modifier, 1);
End If;
Put (File, ")");
Set_Col (File, 19);
Put (File, "(");
If character.stat.INT.modifier >= 0 Then
Put (File, "+");
Put (File, character.stat.INT.modifier, 1);
Else
Put (File, character.stat.INT.modifier, 1);
End If;
Put (File, ")");
Set_Col (File, 25);
Put (File, "(");
If character.stat.WIS.modifier >= 0 Then
Put (File, "+");
Put (File, character.stat.WIS.modifier, 1);
Else
Put (File, character.stat.WIS.modifier, 1);
End If;
Put (File, ")");
Set_Col (File, 31);
Put (File, "(");
If character.stat.CHA.modifier >= 0 Then
Put (File, "+");
Put (File, character.stat.CHA.modifier, 1);
Else
Put (File, character.stat.CHA.modifier, 1);
End If;
Put (File, ")");
New_Line (File, 2);
-- A warning to the user.
Put (File, "- I would recommend saving this document and all other");
New_Line (File);
Put (File, " documents produced with your character's name.");
New_Line (File, 2);
Put (File, "- Every time the program is executed, it");
New_Line (File);
Put (File, " will write over any pre-existing characters.");
New_Line(File, 2);
Put (File, "Ex) Gundren_Rockseeker.txt | Gundren_Skills.txt");
New_Line(File);
Put (File, " Gundren_Features.Txt | Gundren_Combat.txt");
Close (File);
End OutputCharacterFile;
----------------------------------------------------
Procedure outputSkillsToFile (character : in Character_type) is
skillsFile : File_Type;
Begin --outputSkillsToFile
-- Create a file to display the character's skills,
-- whether they are proficient or not,
-- and what modifiers they get for those skills.
Create (skillsFile, Name => "Skills.txt");
Put (skillsFile, character.name.name (1..character.name.length));
Put (skillsFile, " Skills File");
New_Line (skillsFile);
Put (skillsFile, THIRTY_THREE_DASHES);
New_Line (skillsFile);
Put (skillsFile, "[");
If character.class.skill.acrobatics.proficient Then
Put (skillsFile, "x] ");
Else
Put (skillsFile, " ] ");
End If;
Put (skillsFile, "(");
If character.class.skill.acrobatics.base >= 0 Then
Put (skillsFile, "+");
End If;
Put (skillsFile, character.class.skill.acrobatics.base, 1);
Put (skillsFile, ") Acrobatics (DEX)");
New_Line (skillsFile);
---------------
Put (skillsFile, "[");
If character.class.skill.animalHandling.proficient Then
Put (skillsFile, "x] ");
Else
Put (skillsFile, " ] ");
End If;
Put (skillsFile, "(");
If character.class.skill.animalhandling.base >= 0 Then
Put (skillsFile, "+");
End If;
Put (skillsFile, character.class.skill.animalhandling.base, 1);
Put (skillsFile, ") Animal Handling (WIS)");
New_Line (skillsFile);
---------------
Put (skillsFile, "[");
If character.class.skill.arcana.proficient Then
Put (skillsFile, "x] ");
Else
Put (skillsFile, " ] ");
End If;
Put (skillsFile, "(");
If character.class.skill.arcana.base >= 0 Then
Put (skillsFile, "+");
End If;
Put (skillsFile, character.class.skill.arcana.base, 1);
Put (skillsFile, ") Arcana (INT)");
New_Line (skillsFile);
----------------
Put (skillsFile, "[");
If character.class.skill.athletics.proficient Then
Put (skillsFile, "x] ");
Else
Put (skillsFile, " ] ");
End If;
Put (skillsFile, "(");
If character.class.skill.athletics.base >= 0 Then
Put (skillsFile, "+");
End If;
Put (skillsFile, character.class.skill.athletics.base, 1);
Put (skillsFile, ") Athletics (STR)");
New_Line (skillsFile);
-------------------
Put (skillsFile, "[");
If character.class.skill.deception.proficient Then
Put (skillsFile, "x] ");
Else
Put (skillsFile, " ] ");
End If;
Put (skillsFile, "(");
If character.class.skill.deception.base >= 0 Then
Put (skillsFile, "+");
End If;
Put (skillsFile, character.class.skill.deception.base, 1);
Put (skillsFile, ") Deception (CHA)");
New_Line (skillsFile);
-----------------
Put (skillsFile, "[");
If character.class.skill.history.proficient Then
Put (skillsFile, "x] ");
Else
Put (skillsFile, " ] ");
End If;
Put (skillsFile, "(");
If character.class.skill.history.base >= 0 Then
Put (skillsFile, "+");
End If;
Put (skillsFile, character.class.skill.history.base, 1);
Put (skillsFile, ") History (INT)");
New_Line (skillsFile);
-----------------
Put (skillsFile, "[");
If character.class.skill.insight.proficient Then
Put (skillsFile, "x] ");
Else
Put (skillsFile, " ] ");
End If;
Put (skillsFile, "(");
If character.class.skill.insight.base >= 0 Then
Put (skillsFile, "+");
End If;
Put (skillsFile, character.class.skill.insight.base, 1);
Put (skillsFile, ") Insight (WIS)");
New_Line (skillsFile);
-------------
Put (skillsFile, "[");
If character.class.skill.intimidation.proficient Then
Put (skillsFile, "x] ");
Else
Put (skillsFile, " ] ");
End If;
Put (skillsFile, "(");
If character.class.skill.intimidation.base >= 0 Then
Put (skillsFile, "+");
End If;
Put (skillsFile, character.class.skill.intimidation.base, 1);
Put (skillsFile, ") Intimidation (CHA)");
New_Line (skillsFile);
-----------------
Put (skillsFile, "[");
If character.class.skill.investigation.proficient Then
Put (skillsFile, "x] ");
Else
Put (skillsFile, " ] ");
End If;
Put (skillsFile, "(");
If character.class.skill.investigation.base >= 0 Then
Put (skillsFile, "+");
End If;
Put (skillsFile, character.class.skill.investigation.base, 1);
Put (skillsFile, ") Investigation (INT)");
New_Line (skillsFile);
----------------------
Put (skillsFile, "[");
If character.class.skill.medicine.proficient Then
Put (skillsFile, "x] ");
Else
Put (skillsFile, " ] ");
End If;
Put (skillsFile, "(");
If character.class.skill.medicine.base >= 0 Then
Put (skillsFile, "+");
End If;
Put (skillsFile, character.class.skill.medicine.base, 1);
Put (skillsFile, ") Medicine (WIS)");
New_Line (skillsFile);
--------------------
Put (skillsFile, "[");
If character.class.skill.nature.proficient Then
Put (skillsFile, "x] ");
Else
Put (skillsFile, " ] ");
End If;
Put (skillsFile, "(");
If character.class.skill.nature.base >= 0 Then
Put (skillsFile, "+");
End If;
Put (skillsFile, character.class.skill.nature.base, 1);
Put (skillsFile, ") Nature (INT)");
New_Line (skillsFile);
---------------------
Put (skillsFile, "[");
If character.class.skill.perception.proficient Then
Put (skillsFile, "x] ");
Else
Put (skillsFile, " ] ");
End If;
Put (skillsFile, "(");
If character.class.skill.perception.base >= 0 Then
Put (skillsFile, "+");
End If;
Put (skillsFile, character.class.skill.perception.base, 1);
Put (skillsFile, ") Perception (WIS)");
New_Line (skillsFile);
-------------------
Put (skillsFile, "[");
If character.class.skill.performance.proficient Then
Put (skillsFile, "x] ");
Else
Put (skillsFile, " ] ");
End If;
Put (skillsFile, "(");
If character.class.skill.performance.base >= 0 Then
Put (skillsFile, "+");
End If;
Put (skillsFile, character.class.skill.performance.base, 1);
Put (skillsFile, ") Performance (CHA)");
New_Line (skillsFile);
--------------------
Put (skillsFile, "[");
If character.class.skill.persuasion.proficient Then
Put (skillsFile, "x] ");
Else
Put (skillsFile, " ] ");
End If;
Put (skillsFile, "(");
If character.class.skill.persuasion.base >= 0 Then
Put (skillsFile, "+");
End If;
Put (skillsFile, character.class.skill.persuasion.base, 1);
Put (skillsFile, ") Persuasion (CHA)");
New_Line (skillsFile);
--------------------
Put (skillsFile, "[");
If character.class.skill.religion.proficient Then
Put (skillsFile, "x] ");
Else
Put (skillsFile, " ] ");
End If;
Put (skillsFile, "(");
If character.class.skill.religion.base >= 0 Then
Put (skillsFile, "+");
End If;
Put (skillsFile, character.class.skill.religion.base, 1);
Put (skillsFile, ") Religion (INT)");
New_Line (skillsFile);
---------------------
Put (skillsFile, "[");
If character.class.skill.sleightOfHand.proficient Then
Put (skillsFile, "x] ");
Else
Put (skillsFile, " ] ");
End If;
Put (skillsFile, "(");
If character.class.skill.sleightOfHand.base >= 0 Then
Put (skillsFile, "+");
End If;
Put (skillsFile, character.class.skill.sleightOfHand.base, 1);
Put (skillsFile, ") Sleight of Hand (DEX)");
New_Line (skillsFile);
--------------------
Put (skillsFile, "[");
If character.class.skill.stealth.proficient Then
Put (skillsFile, "x] ");
Else
Put (skillsFile, " ] ");
End If;
Put (skillsFile, "(");
If character.class.skill.stealth.base >= 0 Then
Put (skillsFile, "+");
End If;
Put (skillsFile, character.class.skill.stealth.base, 1);
Put (skillsFile, ") Stealth (DEX)");
New_Line (skillsFile);
---------------------
Put (skillsFile, "[");
If character.class.skill.survival.proficient Then
Put (skillsFile, "x] ");
Else
Put (skillsFile, " ] ");
End If;
Put (skillsFile, "(");
If character.class.skill.survival.base >= 0 Then
Put (skillsFile, "+");
End If;
Put (skillsFile, character.class.skill.survival.base, 1);
Put (skillsFile, ") Survival (WIS)");
New_Line (skillsFile);
Close (skillsFile);
End outputSkillsToFile;
----------------------------------------------------
Procedure outputCombatReference (character : in Character_Type) is
combatFile : File_type;
Begin -- outputCombatReference
-- Create a file that serves as a combat reference.
-- This file shows
-- A] attack roll modifier
-- B] damage modifier
-- for each weapon in the Player's Handbook as well as
-- the base modifiers for weapons in general.
-- This file also shows
-- A] spell save DC
-- B] spell attack modifier
-- C] spellcasting ability score
Create (combatFile, name => "CombatReference.txt");
Put (combatFile, character.name.name (1..character.name.length));
Put (combatFile, " Combat File");
New_Line (combatFile);
Put (combatFile, THIRTY_THREE_DASHES);
New_Line (combatFile, 2);
-----
Put (combatFile, "----- Melee/Ranged -----");
New_Line (combatFile);
Put (combatFile, "STR-Based Weapon Attack (Not Proficient)");
New_Line (combatFile);
Set_Col (combatFile, 4);
Put (combatFile, "To hit: ");
If character.combat.STRbased >= 0 Then
Put (combatFile, "+");
End If;
Put (combatFile, character.combat.STRbased, 1);
New_Line (combatFile);
-----
Put (combatFile, "STR-Based Weapon Attack (Proficient)");
New_Line (combatFile);
Set_Col (combatFile, 4);
Put (combatFile, "To hit: ");
If character.combat.STRproficient >= 0 Then
Put (combatFile, "+");
End If;
Put (combatFile, character.combat.STRproficient, 1);
New_Line (combatFile, 2);
-----
Put (combatFile, "DEX-Based Weapon Attack (Not Proficient)");
New_Line (combatFile);
Set_Col (combatFile, 4);
Put (combatFile, "To hit: ");
If character.combat.DEXbased >= 0 Then
Put (combatFile, "+");
End If;
Put (combatFile, character.combat.DEXbased, 1);
New_Line (combatFile);
-----
Put (combatFile, "DEX-Based Weapon Attack (Proficient)");
New_Line (combatFile);
Set_Col (combatFile, 4);
Put (combatFile, "To hit: ");
If character.combat.DEXproficient >= 0 Then
Put (combatFile, "+");
End If;
Put (combatFile, character.combat.DEXproficient, 1);
New_Line (combatFile, 2);
-----
Put (combatFile, "Unarmed Strike");
New_Line (combatFile);
Set_Col (combatFile, 4);
Put (combatFile, "To hit: ");
If character.combat.unarmedAttack >= 0 Then
Put (combatFile, "+");
End If;
Put (combatFile, character.combat.unarmedAttack, 1);
New_Line (combatFile);
Set_Col (combatFile, 4);
Put (combatFile, "Damage: 1");
If character.combat.unarmedAttack >= 0 Then
Put (combatFile, "+");
End If;
Put (combatFile, character.combat.STRbased, 1);
Put (combatFile, " Bludgeoning");
New_Line (combatFile, 2);
-- Output the character's Spell Save DC,
-- Spell Attack Modifier, and Spellcasting Ability
-- to CombatReference.txt.
-- Non-Spellcasters don't output aything.
-- Monks output Ki.
-- The spellDC and such is computed with combatReference()
Case character.class.main is
When Bard =>
Put (combatFile, "----- SpellCasting -----");
New_Line (combatFile);
Put (combatFile, "Spell Save DC: ");
Put (combatFile, character.combat.spellDC, 1);
New_Line (combatFile);
Put (combatFile, "Spell Attack Modifier: ");
If character.combat.spellAttack >= 0 Then
Put (combatFile, "+");
End If;
Put (combatFile, character.combat.spellAttack, 1);
New_Line (combatFile);
Put (combatFile, "Spellcasting Ability: ");
Put (combatFile, character.combat.spellStat);
New_Line (combatFile, 2);
When Cleric =>
Put (combatFile, "----- SpellCasting -----");
New_Line (combatFile);
Put (combatFile, "Spell Save DC: ");
Put (combatFile, character.combat.spellDC, 1);
New_Line (combatFile);
Put (combatFile, "Spell Attack Modifier: ");
If character.combat.spellAttack >= 0 Then
Put (combatFile, "+");
End If;
Put (combatFile, character.combat.spellAttack, 1);
New_Line (combatFile);
Put (combatFile, "Spellcasting Ability: ");
Put (combatFile, character.combat.spellStat);
New_Line (combatFile, 2);
When Druid =>
Put (combatFile, "----- SpellCasting -----");
New_Line (combatFile);
Put (combatFile, "Spell Save DC: ");
Put (combatFile, character.combat.spellDC, 1);
New_Line (combatFile);
Put (combatFile, "Spell Attack Modifier: ");
If character.combat.spellAttack >= 0 Then
Put (combatFile, "+");
End If;
Put (combatFile, character.combat.spellAttack, 1);
New_Line (combatFile);
Put (combatFile, "Spellcasting Ability: ");
Put (combatFile, character.combat.spellStat);
New_Line (combatFile, 2);
When Monk =>
-- Monks aren't spellcasters, so I'm using the spellcasting
-- section to output their Ki Save DC. It's not a
-- perfect system but it will work for us.
Put (combatFile, "---------- Ki ----------");
New_Line (combatFile);
Put (combatFile, "Ki Save DC: ");
Put (combatFile, character.combat.spellDC, 1);
New_Line (combatFile, 2);
When Paladin =>
Put (combatFile, "----- SpellCasting -----");
New_Line (combatFile);
Put (combatFile, "Spell Save DC: ");
Put (combatFile, character.combat.spellDC, 1);
New_Line (combatFile);
Put (combatFile, "Spell Attack Modifier: ");
If character.combat.spellAttack >= 0 Then
Put (combatFile, "+");
End If;
Put (combatFile, character.combat.spellAttack, 1);
New_Line (combatFile);
Put (combatFile, "Spellcasting Ability: ");
Put (combatFile, character.combat.spellStat);
New_Line (combatFile, 2);
When Ranger =>
Put (combatFile, "----- SpellCasting -----");
New_Line (combatFile);
Put (combatFile, "Spell Save DC: ");
Put (combatFile, character.combat.spellDC, 1);
New_Line (combatFile);
Put (combatFile, "Spell Attack Modifier: ");
If character.combat.spellAttack >= 0 Then
Put (combatFile, "+");
End If;
Put (combatFile, character.combat.spellAttack, 1);
New_Line (combatFile);
Put (combatFile, "Spellcasting Ability: ");
Put (combatFile, character.combat.spellStat);
New_Line (combatFile, 2);
When Sorcerer =>
Put (combatFile, "----- SpellCasting -----");
New_Line (combatFile);
Put (combatFile, "Spell Save DC: ");
Put (combatFile, character.combat.spellDC, 1);
New_Line (combatFile);
Put (combatFile, "Spell Attack Modifier: ");
If character.combat.spellAttack >= 0 Then
Put (combatFile, "+");
End If;
Put (combatFile, character.combat.spellAttack, 1);
New_Line (combatFile);
Put (combatFile, "Spellcasting Ability: ");
Put (combatFile, character.combat.spellStat);
New_Line (combatFile, 2);
When Warlock =>
Put (combatFile, "----- SpellCasting -----");
New_Line (combatFile);
Put (combatFile, "Spell Save DC: ");
Put (combatFile, character.combat.spellDC, 1);
New_Line (combatFile);
Put (combatFile, "Spell Attack Modifier: ");
If character.combat.spellAttack >= 0 Then
Put (combatFile, "+");
End If;
Put (combatFile, character.combat.spellAttack, 1);
New_Line (combatFile);
Put (combatFile, "Spellcasting Ability: ");
Put (combatFile, character.combat.spellStat);
New_Line (combatFile, 2);
When Wizard =>
Put (combatFile, "----- SpellCasting -----");
New_Line (combatFile);
Put (combatFile, "Spell Save DC: ");
Put (combatFile, character.combat.spellDC, 1);
New_Line (combatFile);
Put (combatFile, "Spell Attack Modifier: ");
If character.combat.spellAttack >= 0 Then
Put (combatFile, "+");
End If;
Put (combatFile, character.combat.spellAttack, 1);
New_Line (combatFile);
Put (combatFile, "Spellcasting Ability: ");
Put (combatFile, character.combat.spellStat);
New_Line (combatFile, 2);
When others => null;
End Case;
Put (combatFile, "----- Weapon Attacks -----");
New_Line (combatFile);
For i in character.combat.attack'range Loop
Put (combatFile, character.combat.attack(i).name (1..character.combat.attack(i).nameLength));
If character.combat.attack(i).damageAbility = STR Then
If character.combat.attack(i).proficient Then
If character.combat.attack(i).name = "Greatsword " Then
New_Line (combatFile);
Set_Col (combatFile, 4);
Put (combatFile, "+");
Put (combatFile, character.combat.attack(i).toHit, 1);
Put (combatFile, " to hit");
New_Line (combatFile);
Set_Col (combatFile, 4);
Put (combatFile, "2d");
Put (combatFile, character.combat.attack(i).die, 1);
Put (combatFile, " + ");
Put (combatFile, character.combat.STRproficient, 1);
Put (combatFile, " damage");
Elsif character.combat.attack(i).name = "Maul " Then
New_Line (combatFile);
Set_Col (combatFile, 4);
Put (combatFile, "+");
Put (combatFile, character.combat.attack(i).toHit, 1);
Put (combatFile, " to hit");
New_Line (combatFile);
Set_Col (combatFile, 4);
Put (combatFile, "2d");
Put (combatFile, character.combat.attack(i).die, 1);
Put (combatFile, " + ");
Put (combatFile, character.combat.STRproficient, 1);
Put (combatFile, " damage");
Else
New_Line (combatFile);
Set_Col (combatFile, 4);
Put (combatFile, "+");
Put (combatFile, character.combat.attack(i).toHit, 1);
Put (combatFile, " to hit");
New_Line (combatFile);
Set_Col (combatFile, 4);
Put (combatFile, "1d");
Put (combatFile, character.combat.attack(i).die, 1);
Put (combatFile, " + ");
Put (combatFile, character.combat.STRproficient, 1);
Put (combatFile, " damage");
End IF;
Else
If character.combat.attack(i).name = "Greatsword " Then
New_Line (combatFile);
Set_Col (combatFile, 4);
Put (combatFile, "+");
Put (combatFile, character.combat.attack(i).toHit, 1);
Put (combatFile, " to hit");
New_Line (combatFile);
Set_Col (combatFile, 4);
Put (combatFile, "2d");
Put (combatFile, character.combat.attack(i).die, 1);
Put (combatFile, " + ");
Put (combatFile, character.combat.STRbased, 1);
Put (combatFile, " damage");
Elsif character.combat.attack(i).name = "Maul " Then
New_Line (combatFile);
Set_Col (combatFile, 4);
Put (combatFile, "+");
Put (combatFile, character.combat.attack(i).toHit, 1);
Put (combatFile, " to hit");
New_Line (combatFile);
Set_Col (combatFile, 4);
Put (combatFile, "2d");
Put (combatFile, character.combat.attack(i).die, 1);
Put (combatFile, " + ");
Put (combatFile, character.combat.STRbased, 1);
Put (combatFile, " damage");
Else
New_Line (combatFile);
Set_Col (combatFile, 4);
Put (combatFile, "+");
Put (combatFile, character.combat.attack(i).toHit, 1);
Put (combatFile, " to hit");
New_Line (combatFile);
Set_Col (combatFile, 4);
Put (combatFile, "1d");
Put (combatFile, character.combat.attack(i).die, 1);
Put (combatFile, " + ");
Put (combatFile, character.combat.STRbased, 1);
Put (combatFile, " damage");
End If;
End If;
Elsif character.combat.attack(i).damageAbility = DEX Then
If character.combat.attack(i).proficient Then
If character.combat.attack(i).name = "Net " Then
New_Line (combatFile);
Set_Col (combatFile, 4);
Put (combatFile, "+");
Put (combatFile, character.combat.attack(i).toHit, 1);
Put (combatFile, " to hit");
New_Line (combatFile);
Set_Col (combatFile, 4);
Put (combatFile, "DC 10 escape");
Else
New_Line (combatFile);
Set_Col (combatFile, 4);
Put (combatFile, "+");
Put (combatFile, character.combat.attack(i).toHit, 1);
Put (combatFile, " to hit");
New_Line (combatFile);
Set_Col (combatFile, 4);
Put (combatFile, "1d");
Put (combatFile, character.combat.attack(i).die, 1);
Put (combatFile, " + ");
Put (combatFile, character.combat.DEXproficient, 1);
Put (combatFile, " damage");
End If;
Else
IF character.combat.attack(i).name = "Net " Then
New_Line (combatFile);
Set_Col (combatFile, 4);
Put (combatFile, "+");
Put (combatFile, character.combat.attack(i).toHit, 1);
Put (combatFile, " to hit");
New_Line (combatFile);
Set_Col (combatFile, 4);
Put (combatFile, "DC 10 escape");
Else
New_Line (combatFile);
Set_Col (combatFile, 4);
Put (combatFile, "+");
Put (combatFile, character.combat.attack(i).toHit, 1);
Put (combatFile, " to hit");
New_Line (combatFile);
Set_Col (combatFile, 4);
Put (combatFile, "1d");
Put (combatFile, character.combat.attack(i).die, 1);
Put (combatFile, " + ");
Put (combatFile, character.combat.DEXbased, 1);
Put (combatFile, " damage");
End IF;
End If;
End If;
New_Line (combatFile);
End Loop;
close(combatFile);
End outputCombatReference;
----------------------------------------------------
Procedure outputFeatures (character : In Character_Type) is
featuresFile : File_Type;
Procedure printDraconicAncestry is
-- A procedure that will print the Draconic Ancestry
-- table found on page 34 of the Player's Handbook.
Begin
Set_Col(featuresFile, 1);
Put(featuresFile, "Dragon");
Set_Col(featuresFile, 12);
Put(featuresFile, "Damage Type");
Set_Col(featuresFile, 25);
Put(featuresFile, "Breath Weapon");
New_Line(featuresFile);
---
Set_Col(featuresFile, 1);
Put(featuresFile, "Black");
Set_Col(featuresFile, 12);
Put(featuresFile, "Acid");
Set_Col(featuresFile, 25);
Put(featuresFile, "5 by 30 ft. line (Dex. save)");
New_Line(featuresFile);
---
Set_Col(featuresFile, 1);
Put(featuresFile, "Blue");
Set_Col(featuresFile, 12);
Put(featuresFile, "Lightning");
Set_Col(featuresFile, 25);
Put(featuresFile, "5 by 30 ft. line (Dex. save)");
New_Line(featuresFile);
---
Set_Col(featuresFile, 1);
Put(featuresFile, "Brass");
Set_Col(featuresFile, 12);
Put(featuresFile, "Fire");
Set_Col(featuresFile, 25);
Put(featuresFile, "5 by 30 ft. line (Dex. save)");
New_Line(featuresFile);
---
Set_Col(featuresFile, 1);
Put(featuresFile, "Bronze");
Set_Col(featuresFile, 12);
Put(featuresFile, "Lightning");
Set_Col(featuresFile, 25);
Put(featuresFile, "5 by 30 ft. line (Dex. save)");
New_Line(featuresFile);
---
Set_Col(featuresFile, 1);
Put(featuresFile, "Copper");
Set_Col(featuresFile, 12);
Put(featuresFile, "Acid");
Set_Col(featuresFile, 25);
Put(featuresFile, "5 by 30 ft. line (Dex. save)");
New_Line(featuresFile);
---
Set_Col(featuresFile, 1);
Put(featuresFile, "Gold");
Set_Col(featuresFile, 12);
Put(featuresFile, "Fire");
Set_Col(featuresFile, 25);
Put(featuresFile, "15 ft. cone (Dex. save)");
New_Line(featuresFile);
---
Set_Col(featuresFile, 1);
Put(featuresFile, "Green");
Set_Col(featuresFile, 12);
Put(featuresFile, "Poison");
Set_Col(featuresFile, 25);
Put(featuresFile, "15 ft. cone (Con. save)");
New_Line(featuresFile);
---
Set_Col(featuresFile, 1);
Put(featuresFile, "Red");
Set_Col(featuresFile, 12);
Put(featuresFile, "Fire");
Set_Col(featuresFile, 25);
Put(featuresFile, "15 ft. cone (Dex. save)");
New_Line(featuresFile);
---
Set_Col(featuresFile, 1);
Put(featuresFile, "Silver");
Set_Col(featuresFile, 12);
Put(featuresFile, "Cold");
Set_Col(featuresFile, 25);
Put(featuresFile, "15 ft. cone (Con. save)");
New_Line(featuresFile);
---
Set_Col(featuresFile, 1);
Put(featuresFile, "White");
Set_Col(featuresFile, 12);
Put(featuresFile, "Cold");
Set_Col(featuresFile, 25);
Put(featuresFile, "15 ft. cone (Con. save)");
New_Line(featuresFile);
End printDraconicAncestry;
Begin
create(File => featuresFile, name => "Features.txt");
Put (featuresFile, character.name.name (1..character.name.length));
Put (featuresFile, " Features File");
New_Line (featuresFile);
Put (featuresFile, THIRTY_THREE_DASHES);
New_Line (featuresFile, 2);
Put (featuresFile, "Racial Features:");
New_Line(featuresFile);
Put (featuresFile, "----------------");
New_Line(featuresFile);
-- Print out features based on race and subrace.
Case character.race.main is
When Dragonborn => Put(featuresFile, "Draconic Ancestry: You have Draconic ancestry. Choose one type of dragon from the Draconic Ancestry table. Your breath weapon and ");
Put(featuresFile, "damage Resistance are determined by the dragon type, as shown in the table.");
New_Line(featuresFile);
printDraconicAncestry; -- Calls a nested function that prints the table from the PLayer's Handbook.
New_Line(featuresFile);
Put(featuresFile, "Breath Weapon: You can use your action to exhale destructive energy. Your Draconic ancestry determines the size, shape, and damage type of the exhalation. ");
Put(featuresFile, "When you use your breath weapon, each creature in the area of the exhalation must make a saving throw, the type of which is determined by your Draconic ancestry. ");
Put(featuresFile, "The DC for this saving throw equals 8 + your Constitution modifier + your Proficiency Bonus. A creature takes 2d6 damage on a failed save, ");
Put(featuresFile, "and half as much damage on a successful one. The damage increases to 3d6 at 6th level, 4d6 at 11th level, and 5d6 at 16th level. ");
Put(featuresFile, "After you use your breath weapon, you can’t use it again until you complete a short or Long Rest.");
New_Line(featuresFile);
Put(featuresFile, "Damage Resistance: You have Resistance to the damage type associated with your Draconic ancestry.");
When Dwarf => Put(featuresFile, "Darkvision: Accustomed to life underground, you have superior vision in dark and dim Conditions. You can see in dim light ");
Put(featuresFile, "within 60 feet of you as if it were bright light, and in Darkness as if it were dim light. You can't discern color in Darkness, only shades of gray.");
New_Line(featuresFile);
Put(featuresFile, "Dwarven Resilience: You have advantage on Saving Throws against poison, and you have Resistance against poison damage.");
New_Line(featuresFile);
Put(featuresFile, "Stonecunning: Whenever you make an Intelligence (History) check related to the Origin of stonework, you are considered proficient ");
Put(featuresFile, "in the History skill and add double your proficiency bonus to the check, instead of your normal proficiency bonus.");
New_Line(featuresFile);
Put(featuresFile, "Dwarven Toughness: Your hit point maximum increases by 1, and it increases by 1 every time you gain a level.");
When Elf => Put(featuresFile, "Darkvision: Accustomed to life underground, you have superior vision in dark and dim Conditions. You can see in dim light within 60 feet ");
Put(featuresFile, "of you as if it were bright light, and in Darkness as if it were dim light. You can't discern color in Darkness, only shades of gray.");
New_Line(featuresFile);
Put(featuresFile, "Fey Ancestry: You have advantage on Saving Throws against being Charmed, and magic can't put you to sleep.");
New_Line(featuresFile);
Put(featuresFile, "Trance: Elves don't need to sleep. Instead, they meditate deeply, remaining semiconscious, for 4 hours a day. (The Common word for such ");
Put(featuresFile, "meditation is 'trance.') While meditating, you can dream after a fashion; such dreams are actually mental exercises that have become ");
Put(featuresFile, "reflexive through years of practice. After Resting in this way, you gain the same benefit that a human does from 8 hours of sleep.");
New_Line(featuresFile);
Put(featuresFile, "Cantrip: You know one cantrip of your choice from the Wizard spell list. Intelligence is your Spellcasting ability for it.");
New_Line(featuresFile);
Put(featuresFile, "Extra Language: You can speak, read, and write one extra language of your choice.");
When Gnome => Put(featuresFile, "Darkvision: Accustomed to life underground, you have superior vision in dark and dim Conditions. You can see in dim light ");
Put(featuresFile, "within 60 feet of you as if it were bright light, and in Darkness as if it were dim light. You can't discern color in Darkness, only shades of gray.");
New_Line(featuresFile);
Put(featuresFile, "Gnome Cunning: You have advantage on all Intelligence, Wisdom, and Charisma Saving Throws against magic.");
New_Line(featuresFile);
Put(featuresFile, "Artificer’s Lore: Whenever you make an Intelligence (History) check related to Magic Items, alchemical Objects, or technological devices, ");
Put(featuresFile, "you can add twice your Proficiency Bonus, instead of any Proficiency Bonus you normally apply.");
New_Line(featuresFile);
Put(featuresFile, "Tinker: You have proficiency with artisan’s tools (tinker’s tools). Using those tools, you can spend 1 hour and 10 gp worth of materials to construct a ");
Put(featuresFile, "Tiny clockwork device (AC 5, 1 hp). The device ceases to function after 24 hours (unless you spend 1 hour repairing it to keep the device functioning), ");
Put(featuresFile, "or when you use your action to dismantle it; at that time, you can reclaim the materials used to create it. You can have up to three such devices active at a time. ");
Put(featuresFile, "When you create a device, choose one of the following options:");
New_Line(featuresFile);
Put(featuresFile, " Clockwork Toy: This toy is a clockwork animal, monster, or person, such as a frog, mouse, bird, dragon, or Soldier. When placed on the ground, ");
Put(featuresFile, "the toy moves 5 feet across the ground on each of your turns in a random direction. It makes noises as appropriate to the creature it represents.");
New_Line(featuresFile);
Put(featuresFile, " Fire Starter: The device produces a miniature flame, which you can use to light a Candle, torch, or campfire. Using the device requires your action.");
New_Line(featuresFile);
Put(featuresFile, " Music Box: When opened, this music box plays a single song at a moderate volume. The box stops playing when it reaches the song’s end or when it is closed.");
When HalfElf => Put(featuresFile, "Darkvision: Thanks to your elf blood, you have superior vision in dark and dim Conditions. You can see in dim light within 60 feet of you as if it were ");
Put(featuresFile, "bright light, and in Darkness as if it were dim light. You can’t discern color in Darkness, only shades of gray.");
New_Line(featuresFile);
Put(featuresFile, "Fey Ancestry: You have advantage on Saving Throws against being Charmed, and magic can’t put you to sleep.");
New_Line(featuresFile);
Put(featuresFile, "Skill Versatility: You gain proficiency in two Skills of your choice.");
When Halfling => Put(featuresFile, "Lucky: When you roll a 1 on The D20 for an Attack roll, ability check, or saving throw, you can reroll the die and must use the new roll.");
New_Line(featuresFile);
Put(featuresFile, "Brave: You have advantage on Saving Throws against being Frightened.");
New_Line(featuresFile);
Put(featuresFile, "Halfling Nimbleness: You can move through the space of any creature that is of a size larger than yours.");
New_Line(featuresFile);
Put(featuresFile, "Naturally Stealthy: You can attempt to hide even when you are obscured only by a creature that is at least one size larger than you.");
When HalfOrc => Put(featuresFile, "Darkvision: Thanks to your orc blood, you have superior vision in dark and dim Conditions. You can see in dim light within 60 feet of ");
Put(featuresFile, "you as if it were bright light, and in Darkness as if it were dim light. You can’t discern color in Darkness, only shades of gray.");
New_Line(featuresFile);
Put(featuresFile, "Menacing: You gain proficiency in the Intimidation skill.");
New_Line(featuresFile);
Put(featuresFile, "Relentless Endurance: When you are reduced to 0 Hit Points but not killed outright, you can drop to 1 hit point instead. ");
Put(featuresFile, "You can’t use this feature again until you finish a Long Rest.");
New_Line(featuresFile);
Put(featuresFile, "Savage Attacks: When you score a critical hit with a melee weapon Attack, you can roll one of the weapon’s damage dice one ");
Put(featuresFile, "additional time and add it to the extra damage of the critical hit.");
When Tiefling => Put(featuresFile, "Darkvision: Thanks to your Infernal heritage, you have superior vision in dark and dim Conditions. You can see in dim ");
Put(featuresFile, "light within 60 feet of you as if it were bright light, and in Darkness as if it were dim light. You can’t discern color in Darkness, only shades of gray.");
New_Line(featuresFile);
Put(featuresFile, "Hellish Resistance: You have Resistance to fire damage.");
New_Line(featuresFile);
Put(featuresFile, "Infernal Legacy. You know the Thaumaturgy cantrip. When you reach 3rd level, you can cast the Hellish Rebuke spell ");
Put(featuresFile, "as a 2nd-level spell once with this trait and regain the ability to do so when you finish a Long Rest. When you reach 5th level, ");
Put(featuresFile, "you can cast the Darkness spell once with this trait and regain the ability to do so when you finish a Long Rest. Charisma is your Spellcasting ability for these Spells.");
When Others => null;
End Case;
New_Line(featuresFile, 2);
Put(featuresFile, "Class Features:");
New_Line(featuresFile);
Put(featuresFile, "---------------");
New_Line(featuresFile);
-- Print out features based on class, subclass, and level
Case character.class.main is
When Barbarian =>
If character.class.subclass = Berserker Then
Put (featuresFile, character.class.main);
Put (featuresFile, " - PATH OF THE ");
Put (featuresFile, character.class.subclass);
New_Line(featuresFile);
Put (featuresFile, "---------------------------------------");
New_Line(featuresFile);
Put (featuresFile, "| Lv | Feature(s)");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
If character.class.level >= 1 Then
Put (featuresFile, "| 1 | Rage");
New_Line(featuresFile);
Put (featuresFile, "| | Unarmored Defense");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 2 Then
Put (featuresFile, "| 2 | Reckless Attack");
New_Line(featuresFile);
Put (featuresFile, "| | Danger Sense");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 3 Then
Put (featuresFile, "| 3 | Primal Path");
New_Line(featuresFile);
Put (featuresFile, "| | Frenzy");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 4 Then
Put (featuresFile, "| 4 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 5 Then
Put (featuresFile, "| 5 | Extra Attack");
New_Line(featuresFile);
Put (featuresFile, "| | Fast Movement");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 6 Then
Put (featuresFile, "| 6 | Mindless Rage");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 7 Then
Put (featuresFile, "| 7 | Feral Instinct");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 8 Then
Put (featuresFile, "| 8 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 9 Then
Put (featuresFile, "| 9 | Brutal Critical (+1 die)");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 10 Then
Put (featuresFile, "| 10 | Intimidating Presense");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 11 Then
Put (featuresFile, "| 11 | Relentless");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 12 Then
Put (featuresFile, "| 12 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 13 Then
Put (featuresFile, "| 13 | Brutal Critical (+2 dice)");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 14 Then
Put (featuresFile, "| 14 | Retaliation");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 15 Then
Put (featuresFile, "| 15 | Persistent Rage");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 16 Then
Put (featuresFile, "| 16 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 17 Then
Put (featuresFile, "| 17 | Brutal Critical (+3 dice)");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 18 Then
Put (featuresFile, "| 18 | Indomitable Might");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 19 Then
Put (featuresFile, "| 19 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 20 Then
Put (featuresFile, "| 20 | Primal Champion");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
End If;
When Bard =>
If character.class.subclass = Lore Then
Put (featuresFile, character.class.main);
Put (featuresFile, " - COLLEGE OF ");
Put (featuresFile, character.class.subclass);
New_Line(featuresFile);
Put (featuresFile, "---------------------------------------");
New_Line(featuresFile);
Put (featuresFile, "| Lv | Feature(s)");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
If character.class.level >= 1 Then
Put (featuresFile, "| 1 | Spellcasting");
New_Line(featuresFile);
Put (featuresFile, "| | Bardic Inspiration (d6)");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 2 Then
Put (featuresFile, "| 2 | Jack of all Trades");
New_Line(featuresFile);
Put (featuresFile, "| | Song of Rest (1d6)");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 3 Then
Put (featuresFile, "| 3 | Bard College");
New_Line(featuresFile);
Put (featuresFile, "| | Expertise");
New_Line(featuresFile);
Put (featuresFile, "| | Bonus Proficiencies (+3)");
New_Line(featuresFile);
Put (featuresFile, "| | Cutting Words");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 4 Then
Put (featuresFile, "| 4 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 5 Then
Put (featuresFile, "| 5 | Bardic Inspiration (d8)");
New_Line(featuresFile);
Put (featuresFile, "| | Font of Inspiration");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 6 Then
Put (featuresFile, "| 6 | Countercharm");
New_Line(featuresFile);
Put (featuresFile, "| | Additional Magical Secrets (+2)");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 7 Then
Put (featuresFile, "| 7 | ---");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 8 Then
Put (featuresFile, "| 8 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 9 Then
Put (featuresFile, "| 9 | Song of Rest (1d8)");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 10 Then
Put (featuresFile, "| 10 | Bardic Inspiration (d10)");
New_Line(featuresFile);
Put (featuresFile, "| | Expertise");
New_Line(featuresFile);
Put (featuresFile, "| | Magical Secrets (+2)");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 11 Then
Put (featuresFile, "| 11 | ---");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 12 Then
Put (featuresFile, "| 12 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 13 Then
Put (featuresFile, "| 13 | Song of Rest (1d10)");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 14 Then
Put (featuresFile, "| 14 | Magical Secrets (+2)");
New_Line(featuresFile);
Put (featuresFile, "| | Peerless Skill");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 15 Then
Put (featuresFile, "| 15 | Bardic Inspiration (d12)");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 16 Then
Put (featuresFile, "| 16 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 17 Then
Put (featuresFile, "| 17 | Song of Rest (1d12)");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 18 Then
Put (featuresFile, "| 18 | Magical Secrets (+2)");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 19 Then
Put (featuresFile, "| 19 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 20 Then
Put (featuresFile, "| 20 | Superior Inspiration");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
End If;
When Cleric =>
If character.class.subclass = life Then
Put (featuresFile, character.class.main);
Put (featuresFile, " - ");
Put (featuresFile, character.class.subclass);
Put (featuresFile, " DOMAIN");
New_Line(featuresFile);
Put (featuresFile, "---------------------------------------");
New_Line (featuresFile);
Put (featuresFile, "| Lv | Feature(s)");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
If character.class.level >= 1 Then
-- print out 1st lev class features
Ada.Text_IO.Put(featuresFile, "| 1 | Spellcasting");
New_Line(featuresFile);
Ada.Text_IO.Put(featuresFile, "| | Divine Domain");
New_Line(featuresFile);
Ada.Text_IO.Put(featuresFile, "| | Bonus Proficiency");
New_Line(featuresFile);
Ada.Text_IO.Put(featuresFile, "| | Disciple of Life");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 2 Then
-- print out 1st and 2nd lev class features
Ada.Text_IO.Put(featuresFile, "| 2 | Channel Divinity (1/rest)");
New_Line(featuresFile);
Ada.Text_IO.Put(featuresFile, "| | Channel Divinity: Preserve Life");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 3 Then
-- print out 1st, 2nd, and 3rd lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 3 | ---");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 4 Then
-- print out 1st thru 4th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 4 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 5 Then
-- print out 1st thru 5th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 5 | Destroy Undead (CR < 1/2)");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 6 Then
-- print out 1st thru 6th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 6 | Channel Divinity (2/rest)");
New_Line(featuresFile);
Ada.Text_IO.Put(featuresFile, "| | Blessed Healer");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 7 Then
-- print out 1st thru 7th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 7 | ---");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 8 Then
-- print out 1st thru 8th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 8 | Ability Score Improvement*");
New_Line(featuresFile);
Ada.Text_IO.Put(featuresFile, "| | Destroy Undead (CR < 1)");
New_Line(featuresFile);
Ada.Text_IO.Put(featuresFile, "| | Divine Strike");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 9 Then
-- print out 1st thru 9th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 9 | ---");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 10 Then
-- print out 1st thru 10th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 10 | Divine Intervention");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 11 Then
-- print out 1st thru 11th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 11 | Destroy Undead (CR < 2)");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 12 Then
-- print out 1st thru 12th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 12 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 13 Then
-- print out 1st thru 13th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 13 | ---");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 14 Then
-- print out 1st thru 14th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 14 | Destroy Undead (CR < 3)");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 15 Then
-- print out 1st thru 15th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 15 | ---");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 16 Then
-- print out 1st thru 16th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 16 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 17 Then
-- print out 1st thru 17th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 17 | Destroy Undead (CR < 4)");
New_Line(featuresFile);
Ada.Text_IO.Put(featuresFile, "| | Supreme Healing");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 18 Then
-- print out 1st thru 18th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 18 | Channel Divinity (3/rest)");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 19 Then
-- print out 1st thru 19th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 19 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 20 Then
-- print out 1st thru 20th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 20 | Divine Intervention Improvement");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
End If;
When Druid =>
If character.class.subclass = Land Then
Put (featuresFile, character.class.main);
Put (featuresFile, " - CIRCLE OF THE ");
Put (featuresFile, character.class.subclass);
New_Line(featuresFile);
Put (featuresFile, "---------------------------------------");
New_Line(featuresFile);
Put (featuresFile, "| Lv | Feature(s)");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
If character.class.level >= 1 Then
Put (featuresFile, "| 1 | Druidic");
New_Line(featuresFile);
Put (featuresFile, "| | Spellcasting");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 2 Then
Put (featuresFile, "| 2 | Wild Shape");
New_Line(featuresFile);
Put (featuresFile, "| | Druid Circle");
New_Line(featuresFile);
Put (featuresFile, "| | Bonus Cantrip");
New_Line(featuresFile);
Put (featuresFile, "| | Natural Recovery");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 3 Then
Put (featuresFile, "| 3 | Circle Spells");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 4 Then
Put (featuresFile, "| 4 | Wild Shape Improvement");
New_Line(featuresFile);
Put (featuresFile, "| | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 5 Then
Put (featuresFile, "| 5 | Circle Spells");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 6 Then
Put (featuresFile, "| 6 | Land's Stride");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 7 Then
Put (featuresFile, "| 7 | Circle Spells");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 8 Then
Put (featuresFile, "| 8 | Wild Shape Improvement");
New_Line(featuresFile);
Put (featuresFile, "| | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 9 Then
Put (featuresFile, "| 9 | Circle Spells");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 10 Then
Put (featuresFile, "| 10 | Nature's Ward");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 11 Then
Put (featuresFile, "| 11 | ---");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 12 Then
Put (featuresFile, "| 12 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 13 Then
Put (featuresFile, "| 13 | ---");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 14 Then
Put (featuresFile, "| 14 | Nature's Sanctuary");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 15 Then
Put (featuresFile, "| 15 | ---");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 16 Then
Put (featuresFile, "| 16 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 17 Then
Put (featuresFile, "| 17 | ---");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 18 Then
Put (featuresFile, "| 18 | Timeless Body");
New_Line(featuresFile);
Put (featuresFile, "| | Beast Spells");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 19 Then
Put (featuresFile, "| 19 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 20 Then
Put (featuresFile, "| 20 | Archdruid");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
End If;
When Fighter =>
If character.class.subclass = champion Then
Put (featuresFile, character.class.main);
Put (featuresFile, " - ");
Put (featuresFile, character.class.subclass);
Put (featuresFile, " ARCHETYPE");
New_Line(featuresFile);
Put (featuresFile, "---------------------------------------");
New_Line (featuresFile);
Put (featuresFile, "| Lv | Feature(s)");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
If character.class.level >= 1 Then
-- print out 1st lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 1 | Fighting Style");
New_Line(featuresFile);
Ada.Text_IO.Put(featuresFile, "| | Second Wind");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 2 Then
-- print out 1st and 2nd lev class features
Ada.Text_IO.Put(featuresFile, "| 2 | Action Surge (1 Use)");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 3 Then
-- print out 1st, 2nd, and 3rd lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 3 | Martial Archetype");
New_Line(featuresFile);
Ada.Text_IO.Put(featuresFile, "| | Improved Critical");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 4 Then
-- print out 1st thru 4th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 4 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 5 Then
-- print out 1st thru 5th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 5 | Extra Attack (1)");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 6 Then
-- print out 1st thru 6th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 6 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 7 Then
-- print out 1st thru 7th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 7 | Remarkable Athlete");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 8 Then
-- print out 1st thru 8th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 8 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 9 Then
-- print out 1st thru 9th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 9 | Indomitable (1 Use)");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 10 Then
-- print out 1st thru 10th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 10 | Additional Fighting Style");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 11 Then
-- print out 1st thru 11th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 11 | Extra Attack (2)");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 12 Then
-- print out 1st thru 12th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 12 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 13 Then
-- print out 1st thru 13th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 13 | Indomitable (2 Uses)");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 14 Then
-- print out 1st thru 14th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 14 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 15 Then
-- print out 1st thru 15th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 15 | Superior Critical");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 16 Then
-- print out 1st thru 16th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 16 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 17 Then
-- print out 1st thru 17th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 17 | Action Surge (2 Uses)");
New_Line(featuresFile);
Ada.Text_IO.Put(featuresFile, "| | Indomitable (3 Uses)");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 18 Then
-- print out 1st thru 18th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 18 | Survivor");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 19 Then
-- print out 1st thru 19th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 19 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 20 Then
-- print out 1st thru 20th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 20 | Extra Attack (3)");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
End If;
When Monk =>
If character.class.subclass = OpenHand Then
Put (featuresFile, character.class.main);
Put (featuresFile, " - WAY OF THE OPEN HAND");
New_Line(featuresFile);
Put (featuresFile, "---------------------------------------");
New_Line(featuresFile);
Put (featuresFile, "| Lv | Feature(s)");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
If character.class.level >= 1 Then
Put (featuresFile, "| 1 | Unarmored Defense");
New_Line(featuresFile);
Put (featuresFile, "| | Martial Arts");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 2 Then
Put (featuresFile, "| 2 | Ki");
New_Line(featuresFile);
Put (featuresFile, "| | Unarmored Movement");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 3 Then
Put (featuresFile, "| 3 | Monastic Tradition");
New_Line(featuresFile);
Put (featuresFile, "| | Deflect Missiles");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 4 Then
Put (featuresFile, "| 4 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, "| | Slow Fall");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 5 Then
Put (featuresFile, "| 5 | Extra Attack");
New_Line(featuresFile);
Put (featuresFile, "| | Stunning Strike");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 6 Then
Put (featuresFile, "| 6 | Ki-Empowered Strikes");
New_Line(featuresFile);
Put (featuresFile, "| | Wholeness of Body");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 7 Then
Put (featuresFile, "| 7 | Evasion");
New_Line(featuresFile);
Put (featuresFile, "| | Stillness of Mind");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 8 Then
Put (featuresFile, "| 8 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 9 Then
Put (featuresFile, "| 9 | Unarmored Movement Improvement");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 10 Then
Put (featuresFile, "| 10 | Purity of Body");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 11 Then
Put (featuresFile, "| 11 | Tranquility");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 12 Then
Put (featuresFile, "| 12 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 13 Then
Put (featuresFile, "| 13 | Tongue of the Sun and Moon");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 14 Then
Put (featuresFile, "| 14 | Diamond Soul");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 15 Then
Put (featuresFile, "| 15 | Timeless Body");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 16 Then
Put (featuresFile, "| 16 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 17 Then
Put (featuresFile, "| 17 | Quivering Palm");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 18 Then
Put (featuresFile, "| 18 | Empty Body");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 19 Then
Put (featuresFile, "| 19 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 20 Then
Put (featuresFile, "| 20 | Perfect Self");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
End If;
When Paladin =>
If character.class.subclass = Devotion Then
Put (featuresFile, character.class.main);
Put (featuresFile, " - OATH OF ");
Put (featuresFile, character.class.subclass);
New_Line(featuresFile);
Put (featuresFile, "---------------------------------------");
New_Line(featuresFile);
Put (featuresFile, "| Lv | Feature(s)");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
If character.class.level >= 1 Then
Put (featuresFile, "| 1 | Divine Sense");
New_Line(featuresFile);
Put (featuresFile, "| | Lay on Hands");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 2 Then
Put (featuresFile, "| 2 | Fighting Style");
New_Line(featuresFile);
Put (featuresFile, "| | Spellcasting");
New_Line(featuresFile);
Put (featuresFile, "| | Divine Smite");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 3 Then
Put (featuresFile, "| 3 | Divine Helath");
New_Line(featuresFile);
Put (featuresFile, "| | Sacred Oath");
New_Line(featuresFile);
Put (featuresFile, "| | Oath Spells");
New_Line(featuresFile);
Put (featuresFile, "| | Channel Divinity");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 4 Then
Put (featuresFile, "| 4 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 5 Then
Put (featuresFile, "| 5 | Extra Attack");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 6 Then
Put (featuresFile, "| 6 | Aura of Protection (10 ft)");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 7 Then
Put (featuresFile, "| 7 | Aura of Devotion (10 ft)");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 8 Then
Put (featuresFile, "| 8 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 9 Then
Put (featuresFile, "| 9 | ---");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 10 Then
Put (featuresFile, "| 10 | Aura of Courage (10 ft)");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 11 Then
Put (featuresFile, "| 11 | Improved Divine Smite");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 12 Then
Put (featuresFile, "| 12 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 13 Then
Put (featuresFile, "| 13 | ---");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 14 Then
Put (featuresFile, "| 14 | Cleansing Touch");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 15 Then
Put (featuresFile, "| 15 | Purity of Spirit");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 16 Then
Put (featuresFile, "| 16 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 17 Then
Put (featuresFile, "| 17 | ---");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 18 Then
Put (featuresFile, "| 18 | Aura Improvements (30 ft)");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 19 Then
Put (featuresFile, "| 19 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 20 Then
Put (featuresFile, "| 20 | Holy Nimbus");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
End If;
When Ranger =>
If character.class.subclass = Hunter Then
Put (featuresFile, character.class.main);
Put (featuresFile, " - ");
Put (featuresFile, character.class.subclass);
New_Line(featuresFile);
Put (featuresFile, "---------------------------------------");
New_Line(featuresFile);
Put (featuresFile, "| Lv | Feature(s)");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
If character.class.level >= 1 Then
Put (featuresFile, "| 1 | Favored Enemy");
New_Line(featuresFile);
Put (featuresFile, "| | Natural Explorer");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 2 Then
Put (featuresFile, "| 2 | Fighting Style");
New_Line(featuresFile);
Put (featuresFile, "| | Spellcasting");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 3 Then
Put (featuresFile, "| 3 | Ranger Archetype");
New_Line(featuresFile);
Put (featuresFile, "| | Primeval Awareness");
New_Line(featuresFile);
Put (featuresFile, "| | Hunter's Prey");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 4 Then
Put (featuresFile, "| 4 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 5 Then
Put (featuresFile, "| 5 | Extra Attack");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 6 Then
Put (featuresFile, "| 6 | Favored Enemy Improvement");
New_Line(featuresFile);
Put (featuresFile, "| | Natural Explorer Improvement");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 7 Then
Put (featuresFile, "| 7 | Defensive Tactics");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 8 Then
Put (featuresFile, "| 8 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, "| | Land's Stride");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 9 Then
Put (featuresFile, "| 9 | ---");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 10 Then
Put (featuresFile, "| 10 | Natural explorer Improvement");
New_Line(featuresFile);
Put (featuresFile, "| | Hide in Plain Sight");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 11 Then
Put (featuresFile, "| 11 | Multiattack");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 12 Then
Put (featuresFile, "| 12 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 13 Then
Put (featuresFile, "| 13 | ---");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 14 Then
Put (featuresFile, "| 14 | Favored Enemy Improvement");
New_Line(featuresFile);
Put (featuresFile, "| | Vanish");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 15 Then
Put (featuresFile, "| 15 | Superior Hunter's Defense");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 16 Then
Put (featuresFile, "| 16 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 17 Then
Put (featuresFile, "| 17 | ---");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 18 Then
Put (featuresFile, "| 18 | Feral Senses");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 19 Then
Put (featuresFile, "| 19 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 20 Then
Put (featuresFile, "| 20 | Foe Slayer");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
End If;
When Rogue =>
If character.class.subclass = thief Then
Put (featuresFile, character.class.main);
Put (featuresFile, " - ");
Put (featuresFile, character.class.subclass);
Put (featuresFile, " ARCHETYPE");
New_Line(featuresFile);
Put (featuresFile, "---------------------------------------");
New_Line (featuresFile);
Put (featuresFile, "| Lv | Feature(s)");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
If character.class.level >= 1 Then
-- print out 1st lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 1 | Expertise");
New_Line(featuresFile);
Ada.Text_IO.Put(featuresFile, "| | Sneak Attack");
New_Line(featuresFile);
Ada.Text_IO.Put(featuresFile, "| | Thieves' Cant");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 2 Then
-- print out 1st and 2nd lev class features
Ada.Text_IO.Put(featuresFile, "| 2 | Cunning Action");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 3 Then
-- print out 1st, 2nd, and 3rd lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 3 | Roguish Archetype");
New_Line(featuresFile);
Ada.Text_IO.Put(featuresFile, "| | Fast Hands");
New_Line(featuresFile);
Ada.Text_IO.Put(featuresFile, "| | Second-Story Work");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 4 Then
-- print out 1st thru 4th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 4 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 5 Then
-- print out 1st thru 5th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 5 | Uncanny Dodge");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 6 Then
-- print out 1st thru 6th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 6 | Expertise");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 7 Then
-- print out 1st thru 7th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 7 | Evasion");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 8 Then
-- print out 1st thru 8th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 8 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 9 Then
-- print out 1st thru 9th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 9 | Supreme Sneak");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 10 Then
-- print out 1st thru 10th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 10 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 11 Then
-- print out 1st thru 11th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 11 | Reliable Talent");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 12 Then
-- print out 1st thru 12th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 12 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 13 Then
-- print out 1st thru 13th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 13 | Use Magic Device");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 14 Then
-- print out 1st thru 14th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 14 | Blindsense");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 15 Then
-- print out 1st thru 15th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 15 | Slippery Mind");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 16 Then
-- print out 1st thru 16th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 16 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 17 Then
-- print out 1st thru 17th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 17 | Thief's Reflexes");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 18 Then
-- print out 1st thru 18th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 18 | Elusive");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 19 Then
-- print out 1st thru 19th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 19 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 20 Then
-- print out 1st thru 20th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 20 | Stroke of Luck");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
End If;
When Sorcerer =>
If character.class.subclass = Draconic Then
Put (featuresFile, character.class.main);
Put (featuresFile, " - ");
Put (featuresFile, character.class.subclass);
Put (featuresFile, " BLOODLINES");
New_Line(featuresFile);
Put (featuresFile, "---------------------------------------");
New_Line(featuresFile);
Put (featuresFile, "| Lv | Feature(s)");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
If character.class.level >= 1 Then
Put (featuresFile, "| 1 | Spellcasting");
New_Line(featuresFile);
Put (featuresFile, "| | Sorcerous Origins");
New_Line(featuresFile);
Put (featuresFile, "| | Dragon Ancestor");
New_Line(featuresFile);
Put (featuresFile, "| | Draconic Resilience");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 2 Then
Put (featuresFile, "| 2 | Font of Magic");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 3 Then
Put (featuresFile, "| 3 | Metamagic");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 4 Then
Put (featuresFile, "| 4 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 5 Then
Put (featuresFile, "| 5 | ---");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 6 Then
Put (featuresFile, "| 6 | Elemental affinity");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 7 Then
Put (featuresFile, "| 7 | ---");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 8 Then
Put (featuresFile, "| 8 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 9 Then
Put (featuresFile, "| 9 | ---");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 10 Then
Put (featuresFile, "| 10 | Metamagic");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 11 Then
Put (featuresFile, "| 11 | ---");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 12 Then
Put (featuresFile, "| 12 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 13 Then
Put (featuresFile, "| 13 | ---");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 14 Then
Put (featuresFile, "| 14 | Dragon Wings");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 15 Then
Put (featuresFile, "| 15 | ---");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 16 Then
Put (featuresFile, "| 16 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 17 Then
Put (featuresFile, "| 17 | Metamagic");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 18 Then
Put (featuresFile, "| 18 | Draconic Presence");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 19 Then
Put (featuresFile, "| 19 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 20 Then
Put (featuresFile, "| 20 | Sorcerous Restoration");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
End If;
When Warlock =>
If character.class.subclass = Fiend Then
Put (featuresFile, character.class.main);
Put (featuresFile, " - PACT OF THE ");
Put (featuresFile, character.class.subclass);
New_Line(featuresFile);
Put (featuresFile, "---------------------------------------");
New_Line(featuresFile);
Put (featuresFile, "| Lv | Feature(s)");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
If character.class.level >= 1 Then
Put (featuresFile, "| 1 | Otherworldly Patron");
New_Line(featuresFile);
Put (featuresFile, "| | Pact magic");
New_Line(featuresFile);
Put (featuresFile, "| | Dark One's Own Blessing");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 2 Then
Put (featuresFile, "| 2 | Eldritch Invocations");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 3 Then
Put (featuresFile, "| 3 | Pact Boon");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 4 Then
Put (featuresFile, "| 4 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 5 Then
Put (featuresFile, "| 5 | ---");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 6 Then
Put (featuresFile, "| 6 | Dark One's Own Luck");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 7 Then
Put (featuresFile, "| 7 | ---");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 8 Then
Put (featuresFile, "| 8 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 9 Then
Put (featuresFile, "| 9 | ---");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 10 Then
Put (featuresFile, "| 10 | Fiendish Resilience");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 11 Then
Put (featuresFile, "| 11 | Mystic Arcaneum (6th level)");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 12 Then
Put (featuresFile, "| 12 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 13 Then
Put (featuresFile, "| 13 | Mystic Arcaneum (7th level)");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 14 Then
Put (featuresFile, "| 14 | Hurl through Hell");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 15 Then
Put (featuresFile, "| 15 | Mystic Arcaneum (8th level)");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 16 Then
Put (featuresFile, "| 16 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 17 Then
Put (featuresFile, "| 17 | Mystic Arcaneum (9th level)");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 18 Then
Put (featuresFile, "| 18 | ---");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 19 Then
Put (featuresFile, "| 19 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 20 Then
Put (featuresFile, "| 20 | Eldritch Master");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
End If;
When Wizard =>
If character.class.subclass = Evocation Then
Put (featuresFile, character.class.main);
Put (featuresFile, " - SCHOOL OF ");
Put (featuresFile, character.class.subclass);
New_Line(featuresFile);
Put (featuresFile, "---------------------------------------");
New_Line (featuresFile);
Put (featuresFile, "| Lv | Feature(s)");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
If character.class.level >= 1 Then
-- print out 1st lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 1 | Spellcasting");
New_Line(featuresFile);
Ada.Text_IO.Put(featuresFile, "| | Arcane Recovery");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 2 Then
-- print out 1st and 2nd lev class features
Ada.Text_IO.Put(featuresFile, "| 2 | Arcane Tradition");
New_Line(featuresFile);
Ada.Text_IO.Put(featuresFile, "| | Evocation Savant");
New_Line(featuresFile);
Ada.Text_IO.Put(featuresFile, "| | Sculpt Spells");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 3 Then
-- print out 1st, 2nd, and 3rd lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 3 | ---");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 4 Then
-- print out 1st thru 4th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 4 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 5 Then
-- print out 1st thru 5th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 5 | ---");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 6 Then
-- print out 1st thru 6th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 6 | Potent Cantrip");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 7 Then
-- print out 1st thru 7th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 7 | ---");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 8 Then
-- print out 1st thru 8th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 8 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 9 Then
-- print out 1st thru 9th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 9 | ---");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 10 Then
-- print out 1st thru 10th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 10 | Empowered Evocation");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 11 Then
-- print out 1st thru 11th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 11 | ---");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 12 Then
-- print out 1st thru 12th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 12 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 13 Then
-- print out 1st thru 13th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 13 | ---");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 14 Then
-- print out 1st thru 14th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 14 | Overchannel");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 15 Then
-- print out 1st thru 15th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 15 | ---");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 16 Then
-- print out 1st thru 16th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 16 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 17 Then
-- print out 1st thru 17th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 17 | ---");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 18 Then
-- print out 1st thru 18th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 18 | Spell Mastery");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 19 Then
-- print out 1st thru 19th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 19 | Ability Score Improvement*");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
If character.class.level >= 20 Then
-- print out 1st thru 20th lev class and sub features
Ada.Text_IO.Put(featuresFile, "| 20 | Signature Spell");
New_Line(featuresFile);
Put (featuresFile, TABLE_BORDER);
New_Line(featuresFile);
End If;
End If;
When others => null;
End Case;
Put(featuresFile, "* You must manually modify ability scores.");
New_Line(featuresFile);
Put(featuresFile, " You have 2 points to allocate and scores cannot exceed 20.");
New_Line(featuresFile);
close(featuresFile);
End outputFeatures;
----------------------------------------------------
--------Declaration Section of the main body--------
----------------------------------------------------
escape : Character;
character : Character_Type;
Begin -- NPC_Builder
getUserInput (character);
New_Line;
caseRaceInfo(character);
caseAbilityScores(character);
If character.race.main = HalfElf Then
halfElfAbilities(character);
caseAbilityScores(character);
End If;
caseClassInfo(character);
combatReference(character);
New_Line;
outputToConsole(character);
outputCharacterFile(character);
outputSkillsToFile(character);
outputCombatReference(character);
outputFeatures(character);
New_Line;
Put ("Check out the area you saved this program");
New_Line;
Put ("to find text file versions of the output.");
New_Line;
Put ("The files will be named:");
New_Line;
Put ("1.) 'Character.txt.'");
New_Line;
Put ("2.) 'Skills.txt'");
New_Line;
Put ("3.) 'CombatReference.txt'");
New_Line;
Put ("4.) 'Features.txt'");
New_Line(2);
Put("Press any key to terminate the program. ");
Ada.Text_IO.Get_Immediate(escape);
End NPC_Builder;
|
--
-- Copyright (C) 2017, AdaCore
--
-- This spec has been automatically generated from STM32F40x.svd
pragma Ada_2012;
pragma Style_Checks (Off);
with System;
-- STM32F40x
package Interfaces.STM32 is
pragma Preelaborate;
pragma No_Elaboration_Code_All;
---------------
-- Base type --
---------------
type UInt32 is new Interfaces.Unsigned_32;
type UInt16 is new Interfaces.Unsigned_16;
type Byte is new Interfaces.Unsigned_8;
type Bit is mod 2**1
with Size => 1;
type UInt2 is mod 2**2
with Size => 2;
type UInt3 is mod 2**3
with Size => 3;
type UInt4 is mod 2**4
with Size => 4;
type UInt5 is mod 2**5
with Size => 5;
type UInt6 is mod 2**6
with Size => 6;
type UInt7 is mod 2**7
with Size => 7;
type UInt9 is mod 2**9
with Size => 9;
type UInt10 is mod 2**10
with Size => 10;
type UInt11 is mod 2**11
with Size => 11;
type UInt12 is mod 2**12
with Size => 12;
type UInt13 is mod 2**13
with Size => 13;
type UInt14 is mod 2**14
with Size => 14;
type UInt15 is mod 2**15
with Size => 15;
type UInt17 is mod 2**17
with Size => 17;
type UInt18 is mod 2**18
with Size => 18;
type UInt19 is mod 2**19
with Size => 19;
type UInt20 is mod 2**20
with Size => 20;
type UInt21 is mod 2**21
with Size => 21;
type UInt22 is mod 2**22
with Size => 22;
type UInt23 is mod 2**23
with Size => 23;
type UInt24 is mod 2**24
with Size => 24;
type UInt25 is mod 2**25
with Size => 25;
type UInt26 is mod 2**26
with Size => 26;
type UInt27 is mod 2**27
with Size => 27;
type UInt28 is mod 2**28
with Size => 28;
type UInt29 is mod 2**29
with Size => 29;
type UInt30 is mod 2**30
with Size => 30;
type UInt31 is mod 2**31
with Size => 31;
--------------------
-- Base addresses --
--------------------
RNG_Base : constant System.Address :=
System'To_Address (16#50060800#);
DCMI_Base : constant System.Address :=
System'To_Address (16#50050000#);
FSMC_Base : constant System.Address :=
System'To_Address (16#A0000000#);
DBG_Base : constant System.Address :=
System'To_Address (16#E0042000#);
DMA2_Base : constant System.Address :=
System'To_Address (16#40026400#);
DMA1_Base : constant System.Address :=
System'To_Address (16#40026000#);
RCC_Base : constant System.Address :=
System'To_Address (16#40023800#);
GPIOI_Base : constant System.Address :=
System'To_Address (16#40022000#);
GPIOH_Base : constant System.Address :=
System'To_Address (16#40021C00#);
GPIOG_Base : constant System.Address :=
System'To_Address (16#40021800#);
GPIOF_Base : constant System.Address :=
System'To_Address (16#40021400#);
GPIOE_Base : constant System.Address :=
System'To_Address (16#40021000#);
GPIOD_Base : constant System.Address :=
System'To_Address (16#40020C00#);
GPIOC_Base : constant System.Address :=
System'To_Address (16#40020800#);
GPIOB_Base : constant System.Address :=
System'To_Address (16#40020400#);
GPIOA_Base : constant System.Address :=
System'To_Address (16#40020000#);
SYSCFG_Base : constant System.Address :=
System'To_Address (16#40013800#);
SPI1_Base : constant System.Address :=
System'To_Address (16#40013000#);
SPI2_Base : constant System.Address :=
System'To_Address (16#40003800#);
SPI3_Base : constant System.Address :=
System'To_Address (16#40003C00#);
I2S2ext_Base : constant System.Address :=
System'To_Address (16#40003400#);
I2S3ext_Base : constant System.Address :=
System'To_Address (16#40004000#);
SDIO_Base : constant System.Address :=
System'To_Address (16#40012C00#);
ADC1_Base : constant System.Address :=
System'To_Address (16#40012000#);
ADC2_Base : constant System.Address :=
System'To_Address (16#40012100#);
ADC3_Base : constant System.Address :=
System'To_Address (16#40012200#);
USART6_Base : constant System.Address :=
System'To_Address (16#40011400#);
USART1_Base : constant System.Address :=
System'To_Address (16#40011000#);
USART2_Base : constant System.Address :=
System'To_Address (16#40004400#);
USART3_Base : constant System.Address :=
System'To_Address (16#40004800#);
DAC_Base : constant System.Address :=
System'To_Address (16#40007400#);
PWR_Base : constant System.Address :=
System'To_Address (16#40007000#);
I2C3_Base : constant System.Address :=
System'To_Address (16#40005C00#);
I2C2_Base : constant System.Address :=
System'To_Address (16#40005800#);
I2C1_Base : constant System.Address :=
System'To_Address (16#40005400#);
IWDG_Base : constant System.Address :=
System'To_Address (16#40003000#);
WWDG_Base : constant System.Address :=
System'To_Address (16#40002C00#);
RTC_Base : constant System.Address :=
System'To_Address (16#40002800#);
UART4_Base : constant System.Address :=
System'To_Address (16#40004C00#);
UART5_Base : constant System.Address :=
System'To_Address (16#40005000#);
C_ADC_Base : constant System.Address :=
System'To_Address (16#40012300#);
TIM1_Base : constant System.Address :=
System'To_Address (16#40010000#);
TIM8_Base : constant System.Address :=
System'To_Address (16#40010400#);
TIM2_Base : constant System.Address :=
System'To_Address (16#40000000#);
TIM3_Base : constant System.Address :=
System'To_Address (16#40000400#);
TIM4_Base : constant System.Address :=
System'To_Address (16#40000800#);
TIM5_Base : constant System.Address :=
System'To_Address (16#40000C00#);
TIM9_Base : constant System.Address :=
System'To_Address (16#40014000#);
TIM12_Base : constant System.Address :=
System'To_Address (16#40001800#);
TIM10_Base : constant System.Address :=
System'To_Address (16#40014400#);
TIM13_Base : constant System.Address :=
System'To_Address (16#40001C00#);
TIM14_Base : constant System.Address :=
System'To_Address (16#40002000#);
TIM11_Base : constant System.Address :=
System'To_Address (16#40014800#);
TIM6_Base : constant System.Address :=
System'To_Address (16#40001000#);
TIM7_Base : constant System.Address :=
System'To_Address (16#40001400#);
Ethernet_MAC_Base : constant System.Address :=
System'To_Address (16#40028000#);
Ethernet_MMC_Base : constant System.Address :=
System'To_Address (16#40028100#);
Ethernet_PTP_Base : constant System.Address :=
System'To_Address (16#40028700#);
Ethernet_DMA_Base : constant System.Address :=
System'To_Address (16#40029000#);
CRC_Base : constant System.Address :=
System'To_Address (16#40023000#);
OTG_FS_GLOBAL_Base : constant System.Address :=
System'To_Address (16#50000000#);
OTG_FS_HOST_Base : constant System.Address :=
System'To_Address (16#50000400#);
OTG_FS_DEVICE_Base : constant System.Address :=
System'To_Address (16#50000800#);
OTG_FS_PWRCLK_Base : constant System.Address :=
System'To_Address (16#50000E00#);
CAN1_Base : constant System.Address :=
System'To_Address (16#40006400#);
CAN2_Base : constant System.Address :=
System'To_Address (16#40006800#);
FLASH_Base : constant System.Address :=
System'To_Address (16#40023C00#);
EXTI_Base : constant System.Address :=
System'To_Address (16#40013C00#);
OTG_HS_GLOBAL_Base : constant System.Address :=
System'To_Address (16#40040000#);
OTG_HS_HOST_Base : constant System.Address :=
System'To_Address (16#40040400#);
OTG_HS_DEVICE_Base : constant System.Address :=
System'To_Address (16#40040800#);
OTG_HS_PWRCLK_Base : constant System.Address :=
System'To_Address (16#40040E00#);
NVIC_Base : constant System.Address :=
System'To_Address (16#E000E000#);
end Interfaces.STM32;
|
-- part of AdaYaml, (c) 2017 Felix Krause
-- released under the terms of the MIT license, see the file "copying.txt"
package Yaml.Transformation_Tests is
end Yaml.Transformation_Tests;
|
with Ada.Strings.Fixed;
with Ada.Integer_Text_IO;
-- Copyright 2021 Melwyn Francis Carlo
procedure A036 is
use Ada.Strings.Fixed;
use Ada.Integer_Text_IO;
-- Initial values denoting the numbers 0, 1, 3, 5, 7, and 9.
Sum_Val : Integer := 25;
Decimal : String (1 .. 10);
Binary : String (1 .. 30);
Is_Decimal_Palindromic, Is_Binary_Palindromic : Boolean;
J, Decimal_Len, Decimal_Len_By_2,
Binary_Len, Binary_Len_By_2,
Temp_Len, Quotient : Integer;
begin
for I in 10 .. 1_000_000 loop
if (I mod 2) = 0 then
goto Continue;
end if;
Move (Source => Trim (Integer'Image (I), Ada.Strings.Both),
Target => Decimal,
Justify => Ada.Strings.Left);
Decimal_Len := Trim (Integer'Image (I), Ada.Strings.Both)'Length;
Is_Decimal_Palindromic := True;
if Decimal_Len /= 1 then
Decimal_Len_By_2 := Integer (Float'Floor (Float (Decimal_Len) / 2.0));
for J in 1 .. Decimal_Len_By_2 loop
Temp_Len := Decimal_Len - J + 1;
if Decimal (J) /= Decimal (Temp_Len) then
Is_Decimal_Palindromic := False;
exit;
end if;
end loop;
end if;
if (not Is_Decimal_Palindromic) then
goto Continue;
end if;
Binary := 30 * " ";
J := 1;
Quotient := I;
while Quotient /= 0 loop
Binary (J) := Character'Val ((Quotient mod 2) + Character'Pos ('0'));
Quotient := Integer (Float'Floor (Float (Quotient) / 2.0));
J := J + 1;
end loop;
Is_Binary_Palindromic := True;
Binary_Len := Index (Binary, " ") - 1;
Binary_Len_By_2 := Integer (Float'Floor (Float (Binary_Len) / 2.0));
for J in 1 .. Binary_Len_By_2 loop
Temp_Len := Binary_Len - J + 1;
if Binary (J) /= Binary (Temp_Len) then
Is_Binary_Palindromic := False;
exit;
end if;
end loop;
if not Is_Binary_Palindromic then
goto Continue;
end if;
Sum_Val := Sum_Val + I;
<<Continue>>
end loop;
Put (Sum_Val, Width => 0);
end A036;
|
generic
Frequency : Unsigned_32;
Source: Source_Type;
Input: Input_Type;
package MSPGD.Clock.Source is
pragma Preelaborate;
procedure Init;
procedure Delay_us (us : Natural);
procedure Delay_ms (ms : Natural);
procedure Delay_s (s : Natural);
function Millisecond_Counter return Unsigned_32;
procedure Delay_Slow_Periods (P : Unsigned_16);
function Maximum_Delay_ms return Unsigned_16;
end MSPGD.Clock.Source;
|
------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- ncurses --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright 2020 Thomas E. Dickey --
-- Copyright 2000,2006 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: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
-- Version Control
-- $Revision: 1.3 $
-- $Date: 2020/02/02 23:34:34 $
-- Binding Version 01.00
------------------------------------------------------------------------------
procedure ncurses2.attr_test;
|
pragma License (Unrestricted);
-- Ada 2012
with Ada.Characters.Handling;
private with Ada.UCD;
package Ada.Wide_Wide_Characters.Handling is
-- pragma Pure;
pragma Preelaborate;
-- function Character_Set_Version return String;
Character_Set_Version : constant String;
function Is_Control (Item : Wide_Wide_Character) return Boolean
renames Characters.Handling.Overloaded_Is_Control;
function Is_Letter (Item : Wide_Wide_Character) return Boolean
renames Characters.Handling.Overloaded_Is_Letter;
function Is_Lower (Item : Wide_Wide_Character) return Boolean
renames Characters.Handling.Overloaded_Is_Lower;
function Is_Upper (Item : Wide_Wide_Character) return Boolean
renames Characters.Handling.Overloaded_Is_Upper;
function Is_Basic (Item : Wide_Wide_Character) return Boolean
renames Characters.Handling.Overloaded_Is_Basic;
-- Note: Wide_Wide_Characters.Handling.Is_Basic is incompatible with
-- Characters.Handling.Is_Basic. See AI12-0260-1.
function Is_Digit (Item : Wide_Wide_Character) return Boolean
renames Characters.Handling.Overloaded_Is_Digit;
function Is_Decimal_Digit (Item : Wide_Wide_Character) return Boolean
renames Is_Digit;
function Is_Hexadecimal_Digit (Item : Wide_Wide_Character) return Boolean
renames Characters.Handling.Overloaded_Is_Hexadecimal_Digit;
function Is_Alphanumeric (Item : Wide_Wide_Character) return Boolean
renames Characters.Handling.Overloaded_Is_Alphanumeric;
function Is_Special (Item : Wide_Wide_Character) return Boolean
renames Characters.Handling.Overloaded_Is_Special;
-- function Is_Line_Terminator (Item : Wide_Wide_Character) return Boolean;
-- function Is_Mark (Item : Wide_Wide_Character) return Boolean;
-- function Is_Other_Format (Item : Wide_Wide_Character) return Boolean;
-- function Is_Punctuation_Connector (Item : Wide_Wide_Character)
-- return Boolean;
-- function Is_Space (Item : Wide_Wide_Character) return Boolean;
function Is_Graphic (Item : Wide_Wide_Character) return Boolean
renames Characters.Handling.Overloaded_Is_Graphic;
function To_Basic (Item : Wide_Wide_Character) return Wide_Wide_Character
renames Characters.Handling.Overloaded_To_Basic;
function To_Lower (Item : Wide_Wide_Character) return Wide_Wide_Character
renames Characters.Handling.Overloaded_To_Lower;
function To_Upper (Item : Wide_Wide_Character) return Wide_Wide_Character
renames Characters.Handling.Overloaded_To_Upper;
function To_Lower (Item : Wide_Wide_String) return Wide_Wide_String
renames Characters.Handling.Overloaded_To_Lower;
function To_Upper (Item : Wide_Wide_String) return Wide_Wide_String
renames Characters.Handling.Overloaded_To_Upper;
function To_Basic (Item : Wide_Wide_String) return Wide_Wide_String
renames Characters.Handling.Overloaded_To_Basic;
private
Character_Set_Version : constant String := UCD.Version;
end Ada.Wide_Wide_Characters.Handling;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . P A C K _ 3 7 --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2020, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- Handling of packed arrays with Component_Size = 37
package System.Pack_37 is
pragma Preelaborate;
Bits : constant := 37;
type Bits_37 is mod 2 ** Bits;
for Bits_37'Size use Bits;
-- In all subprograms below, Rev_SSO is set True if the array has the
-- non-default scalar storage order.
function Get_37
(Arr : System.Address;
N : Natural;
Rev_SSO : Boolean) return Bits_37 with Inline;
-- Arr is the address of the packed array, N is the zero-based
-- subscript. This element is extracted and returned.
procedure Set_37
(Arr : System.Address;
N : Natural;
E : Bits_37;
Rev_SSO : Boolean) with Inline;
-- 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_37;
|
------------------------------------------------------------------------------
-- --
-- GNAT LIBRARY COMPONENTS --
-- --
-- ADA.STRINGS.UNBOUNDED.EQUAL_CASE_INSENSITIVE --
-- --
-- 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. --
-- --
-- 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/>. --
-- --
-- This unit was originally developed by Matthew J Heaney. --
------------------------------------------------------------------------------
function Ada.Strings.Unbounded.Equal_Case_Insensitive
(Left, Right : Unbounded.Unbounded_String)
return Boolean;
pragma Preelaborate (Ada.Strings.Unbounded.Equal_Case_Insensitive);
|
-- C97203B.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.
--*
-- CHECK THAT A CONDITIONAL_ENTRY_CALL CAN APPEAR IN PLACES WHERE A
-- SELECTIVE_WAIT CANNOT.
-- PART 2: PROCEDURE BODY EMBEDDED IN TASK BODY.
-- RM 4/09/1982
WITH REPORT;
USE REPORT;
PROCEDURE C97203B IS
BEGIN
TEST ( "C97203B" , "CHECK THAT A CONDITIONAL_ENTRY_CALL CAN" &
" APPEAR WHERE A SELECTIVE_WAIT CANNOT" );
-------------------------------------------------------------------
DECLARE
TASK TT IS
ENTRY A ( AUTHORIZED : IN BOOLEAN );
END TT ;
TASK BODY TT IS
PROCEDURE WITHIN_TASK_BODY ;
PROCEDURE WITHIN_TASK_BODY IS
BEGIN
SELECT -- NOT A SELECTIVE_WAIT
A ( FALSE ) ; -- CALLING (OWN) ENTRY
ELSE
COMMENT( "ALTERNATIVE BRANCH TAKEN" );
END SELECT;
END WITHIN_TASK_BODY ;
BEGIN
-- CALL THE INNER PROC. TO FORCE EXEC. OF COND_E_CALL
WITHIN_TASK_BODY ;
ACCEPT A ( AUTHORIZED : IN BOOLEAN ) DO
IF AUTHORIZED THEN
COMMENT( "AUTHORIZED ENTRY_CALL" );
ELSE
FAILED( "UNAUTHORIZED ENTRY_CALL" );
END IF;
END A ;
END TT ;
PROCEDURE OUTSIDE_TASK_BODY IS
BEGIN
SELECT -- NOT A SELECTIVE_WAIT
TT.A ( FALSE ) ; -- UNBORN
ELSE
COMMENT( "(OUT:) ALTERNATIVE BRANCH TAKEN" );
END SELECT;
END OUTSIDE_TASK_BODY ;
PACKAGE CREATE_OPPORTUNITY_TO_CALL IS END;
PACKAGE BODY CREATE_OPPORTUNITY_TO_CALL IS
BEGIN
-- CALL THE OTHER PROC. TO FORCE EXEC. OF COND_E_CALL
OUTSIDE_TASK_BODY ;
END CREATE_OPPORTUNITY_TO_CALL ;
BEGIN
TT.A ( TRUE );
EXCEPTION
WHEN TASKING_ERROR =>
FAILED( "TASKING ERROR" );
END ;
-------------------------------------------------------------------
RESULT ;
END C97203B ;
|
-----------------------------------------------------------------------
-- awa-applications-configs -- Read application configuration files
-- Copyright (C) 2011, 2012, 2015, 2017, 2018, 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.Command_Line;
with Ada.Directories;
with Ada.Strings.Unbounded;
with Util.Strings;
with Util.Properties;
with Util.Beans.Objects;
with Util.Files;
with Util.Log.Loggers;
with Util.Serialize.IO.XML;
with ASF.Contexts.Faces;
with ASF.Applications.Main.Configs;
with Security.Policies;
with AWA.Events.Configs.Reader_Config;
with AWA.Services.Contexts;
package body AWA.Applications.Configs is
Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create ("AWA.Applications.Configs");
type Wallet_Manager is limited new Util.Properties.Implementation.Manager with record
Wallet : Keystore.Properties.Manager;
Props : ASF.Applications.Config;
Length : Positive;
Prefix : String (1 .. MAX_PREFIX_LENGTH);
end record;
-- Get the value identified by the name.
-- If the name cannot be found, the method should return the Null object.
overriding
function Get_Value (From : in Wallet_Manager;
Name : in String) return Util.Beans.Objects.Object;
-- Set the value identified by the name.
-- If the map contains the given name, the value changed.
-- Otherwise name is added to the map and the value associated with it.
overriding
procedure Set_Value (From : in out Wallet_Manager;
Name : in String;
Value : in Util.Beans.Objects.Object);
-- Returns TRUE if the property exists.
overriding
function Exists (Self : in Wallet_Manager;
Name : in String)
return Boolean;
-- Remove the property given its name.
overriding
procedure Remove (Self : in out Wallet_Manager;
Name : in String);
-- Iterate over the properties and execute the given procedure passing the
-- property name and its value.
overriding
procedure Iterate (Self : in Wallet_Manager;
Process : access procedure (Name : in String;
Item : in Util.Beans.Objects.Object));
-- Deep copy of properties stored in 'From' to 'To'.
function Create_Copy (Self : in Wallet_Manager)
return Util.Properties.Implementation.Manager_Access;
package Shared_Manager is
new Util.Properties.Implementation.Shared_Implementation (Wallet_Manager);
subtype Property_Map is Shared_Manager.Manager;
type Property_Map_Access is access all Property_Map;
-- ------------------------------
-- Get the value identified by the name.
-- If the name cannot be found, the method should return the Null object.
-- ------------------------------
overriding
function Get_Value (From : in Wallet_Manager;
Name : in String) return Util.Beans.Objects.Object is
Prefixed_Name : constant String := From.Prefix (1 .. From.Length) & Name;
begin
if From.Wallet.Exists (Prefixed_Name) then
declare
Value : constant String := From.Wallet.Get (Prefixed_Name);
begin
return Util.Beans.Objects.To_Object (Value);
end;
else
return From.Props.Get_Value (Name);
end if;
end Get_Value;
-- ------------------------------
-- Set the value identified by the name.
-- If the map contains the given name, the value changed.
-- Otherwise name is added to the map and the value associated with it.
-- ------------------------------
overriding
procedure Set_Value (From : in out Wallet_Manager;
Name : in String;
Value : in Util.Beans.Objects.Object) is
Prefixed_Name : constant String := From.Prefix (1 .. From.Length) & Name;
begin
if From.Wallet.Exists (Prefixed_Name) then
From.Wallet.Set_Value (Prefixed_Name, Value);
else
From.Props.Set_Value (Name, Value);
end if;
end Set_Value;
-- ------------------------------
-- Returns TRUE if the property exists.
-- ------------------------------
function Exists (Self : in Wallet_Manager;
Name : in String)
return Boolean is
begin
return Self.Props.Exists (Name)
or else Self.Wallet.Exists (Self.Prefix (1 .. Self.Length) & Name);
end Exists;
-- ------------------------------
-- Remove the property given its name.
-- ------------------------------
procedure Remove (Self : in out Wallet_Manager;
Name : in String) is
Prefixed_Name : constant String := Self.Prefix (1 .. Self.Length) & Name;
begin
if Self.Wallet.Exists (Prefixed_Name) then
Self.Wallet.Remove (Prefixed_Name);
else
Self.Props.Remove (Name);
end if;
end Remove;
-- ------------------------------
-- Iterate over the properties and execute the given procedure passing the
-- property name and its value.
-- ------------------------------
procedure Iterate (Self : in Wallet_Manager;
Process : access procedure (Name : in String;
Item : in Util.Beans.Objects.Object)) is
procedure Wallet_Filter (Name : in String;
Item : in Util.Beans.Objects.Object);
procedure Property_Filter (Name : in String;
Item : in Util.Beans.Objects.Object);
procedure Wallet_Filter (Name : in String;
Item : in Util.Beans.Objects.Object) is
begin
if Util.Strings.Starts_With (Name, Self.Prefix (1 .. Self.Length)) then
Log.Debug ("Use wallet property {0} as {1}",
Name, Name (Name'First + Self.Length .. Name'Last));
Process (Name (Name'First + Self.Length .. Name'Last), Item);
end if;
end Wallet_Filter;
procedure Property_Filter (Name : in String;
Item : in Util.Beans.Objects.Object) is
Prefixed_Name : constant String := Self.Prefix (1 .. Self.Length) & Name;
begin
if not Self.Wallet.Exists (Prefixed_Name) then
Process (Name, Item);
end if;
end Property_Filter;
begin
Self.Props.Iterate (Property_Filter'Access);
Self.Wallet.Iterate (Wallet_Filter'Access);
end Iterate;
-- ------------------------------
-- Deep copy of properties stored in 'From' to 'To'.
-- ------------------------------
function Create_Copy (Self : in Wallet_Manager)
return Util.Properties.Implementation.Manager_Access is
Result : constant Property_Map_Access := new Property_Map;
begin
Result.Length := Self.Length;
Result.Wallet := Self.Wallet;
Result.Props := Self.Props;
Result.Prefix := Self.Prefix;
return Result.all'Access;
end Create_Copy;
-- ------------------------------
-- Merge the configuration content and the keystore to a final configuration object.
-- The keystore can be used to store sensitive information such as database connection,
-- secret keys while the rest of the configuration remains in clear property files.
-- The keystore must be unlocked to have access to its content.
-- The prefix parameter is used to prefix names from the keystore so that the same
-- keystore could be used by several applications.
-- ------------------------------
procedure Merge (Into : in out ASF.Applications.Config;
Config : in out ASF.Applications.Config;
Wallet : in out Keystore.Properties.Manager;
Prefix : in String) is
function Allocate return Util.Properties.Implementation.Shared_Manager_Access;
function Allocate return Util.Properties.Implementation.Shared_Manager_Access is
Result : constant Property_Map_Access := new Property_Map;
begin
Result.Length := Prefix'Length;
Result.Wallet := Wallet;
Result.Props := Config;
Result.Prefix (1 .. Result.Length) := Prefix;
return Result.all'Access;
end Allocate;
procedure Setup is
new Util.Properties.Implementation.Initialize (Allocate);
begin
Setup (Into);
end Merge;
-- ------------------------------
-- XML reader configuration. By instantiating this generic package, the XML parser
-- gets initialized to read the configuration for servlets, filters, managed beans,
-- permissions, events and other configuration elements.
-- ------------------------------
package body Reader_Config is
App_Access : constant ASF.Contexts.Faces.Application_Access := App.all'Unchecked_Access;
package Bean_Config is
new ASF.Applications.Main.Configs.Reader_Config (Mapper, App_Access,
Context.all'Access,
Override_Context);
package Event_Config is
new AWA.Events.Configs.Reader_Config (Mapper => Mapper,
Manager => App.Events'Unchecked_Access,
Context => Context.all'Access);
pragma Warnings (Off, Bean_Config);
pragma Warnings (Off, Event_Config);
begin
Event_Config.Initialize;
end Reader_Config;
-- ------------------------------
-- Read the application configuration file and configure the application
-- ------------------------------
procedure Read_Configuration (App : in out Application'Class;
File : in String;
Context : in EL.Contexts.Default.Default_Context_Access;
Override_Context : in Boolean) is
Reader : Util.Serialize.IO.XML.Parser;
Mapper : Util.Serialize.Mappers.Processing;
Ctx : AWA.Services.Contexts.Service_Context;
Sec : constant Security.Policies.Policy_Manager_Access := App.Get_Security_Manager;
begin
Log.Info ("Reading application configuration file {0}", File);
Ctx.Set_Context (App'Unchecked_Access, null);
declare
package Config is new Reader_Config (Mapper, App'Unchecked_Access, Context,
Override_Context);
pragma Warnings (Off, Config);
begin
Sec.Prepare_Config (Mapper);
-- Initialize the parser with the module configuration mappers (if any).
Initialize_Parser (App, Reader);
if Log.Get_Level >= Util.Log.DEBUG_LEVEL then
Util.Serialize.Mappers.Dump (Mapper, Log);
end if;
-- Read the configuration file and record managed beans, navigation rules.
Reader.Parse (File, Mapper);
end;
exception
when others =>
Log.Error ("Error while reading {0}", File);
raise;
end Read_Configuration;
-- ------------------------------
-- Get the configuration path for the application name.
-- The configuration path is search from:
-- o the current directory,
-- o the 'config' directory,
-- o the Dynamo installation directory in share/dynamo
-- ------------------------------
function Get_Config_Path (Name : in String) return String is
use Ada.Strings.Unbounded;
use Ada.Directories;
Command : constant String := Ada.Command_Line.Command_Name;
Path : constant String := Ada.Directories.Containing_Directory (Command);
Dir : constant String := Containing_Directory (Path);
Paths : Ada.Strings.Unbounded.Unbounded_String;
begin
Append (Paths, ".;");
Append (Paths, Util.Files.Compose (Dir, "config"));
Append (Paths, ";");
Append (Paths, Util.Files.Compose (Dir, "share/dynamo/" & Name));
return Util.Files.Find_File_Path (Name & ".properties", To_String (Paths));
end Get_Config_Path;
end AWA.Applications.Configs;
|
-- This spec has been automatically generated from STM32F7x9.svd
pragma Restrictions (No_Elaboration_Code);
pragma Ada_2012;
pragma Style_Checks (Off);
with HAL;
with System;
package STM32_SVD.CRYP is
pragma Preelaborate;
---------------
-- Registers --
---------------
subtype CR_ALGOMODE0_Field is HAL.UInt3;
subtype CR_DATATYPE_Field is HAL.UInt2;
subtype CR_KEYSIZE_Field is HAL.UInt2;
subtype CR_GCM_CCMPH_Field is HAL.UInt2;
-- control register
type CR_Register is record
-- unspecified
Reserved_0_1 : HAL.UInt2 := 16#0#;
-- Algorithm direction
ALGODIR : Boolean := False;
-- Algorithm mode
ALGOMODE0 : CR_ALGOMODE0_Field := 16#0#;
-- Data type selection
DATATYPE : CR_DATATYPE_Field := 16#0#;
-- Key size selection (AES mode only)
KEYSIZE : CR_KEYSIZE_Field := 16#0#;
-- unspecified
Reserved_10_13 : HAL.UInt4 := 16#0#;
-- Write-only. FIFO flush
FFLUSH : Boolean := False;
-- Cryptographic processor enable
CRYPEN : Boolean := False;
-- GCM_CCMPH
GCM_CCMPH : CR_GCM_CCMPH_Field := 16#0#;
-- unspecified
Reserved_18_18 : HAL.Bit := 16#0#;
-- ALGOMODE
ALGOMODE3 : 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 CR_Register use record
Reserved_0_1 at 0 range 0 .. 1;
ALGODIR at 0 range 2 .. 2;
ALGOMODE0 at 0 range 3 .. 5;
DATATYPE at 0 range 6 .. 7;
KEYSIZE at 0 range 8 .. 9;
Reserved_10_13 at 0 range 10 .. 13;
FFLUSH at 0 range 14 .. 14;
CRYPEN at 0 range 15 .. 15;
GCM_CCMPH at 0 range 16 .. 17;
Reserved_18_18 at 0 range 18 .. 18;
ALGOMODE3 at 0 range 19 .. 19;
Reserved_20_31 at 0 range 20 .. 31;
end record;
-- status register
type SR_Register is record
-- Read-only. Input FIFO empty
IFEM : Boolean;
-- Read-only. Input FIFO not full
IFNF : Boolean;
-- Read-only. Output FIFO not empty
OFNE : Boolean;
-- Read-only. Output FIFO full
OFFU : Boolean;
-- Read-only. Busy bit
BUSY : Boolean;
-- unspecified
Reserved_5_31 : HAL.UInt27;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for SR_Register use record
IFEM at 0 range 0 .. 0;
IFNF at 0 range 1 .. 1;
OFNE at 0 range 2 .. 2;
OFFU at 0 range 3 .. 3;
BUSY at 0 range 4 .. 4;
Reserved_5_31 at 0 range 5 .. 31;
end record;
-- DMA control register
type DMACR_Register is record
-- DMA input enable
DIEN : Boolean := False;
-- DMA output enable
DOEN : Boolean := False;
-- unspecified
Reserved_2_31 : HAL.UInt30 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DMACR_Register use record
DIEN at 0 range 0 .. 0;
DOEN at 0 range 1 .. 1;
Reserved_2_31 at 0 range 2 .. 31;
end record;
-- interrupt mask set/clear register
type IMSCR_Register is record
-- Input FIFO service interrupt mask
INIM : Boolean := False;
-- Output FIFO service interrupt mask
OUTIM : Boolean := False;
-- unspecified
Reserved_2_31 : HAL.UInt30 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for IMSCR_Register use record
INIM at 0 range 0 .. 0;
OUTIM at 0 range 1 .. 1;
Reserved_2_31 at 0 range 2 .. 31;
end record;
-- raw interrupt status register
type RISR_Register is record
-- Read-only. Input FIFO service raw interrupt status
INRIS : Boolean;
-- Read-only. Output FIFO service raw interrupt status
OUTRIS : Boolean;
-- unspecified
Reserved_2_31 : HAL.UInt30;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for RISR_Register use record
INRIS at 0 range 0 .. 0;
OUTRIS at 0 range 1 .. 1;
Reserved_2_31 at 0 range 2 .. 31;
end record;
-- masked interrupt status register
type MISR_Register is record
-- Read-only. Input FIFO service masked interrupt status
INMIS : Boolean;
-- Read-only. Output FIFO service masked interrupt status
OUTMIS : Boolean;
-- unspecified
Reserved_2_31 : HAL.UInt30;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for MISR_Register use record
INMIS at 0 range 0 .. 0;
OUTMIS at 0 range 1 .. 1;
Reserved_2_31 at 0 range 2 .. 31;
end record;
-- K0LR_b array
type K0LR_b_Field_Array is array (224 .. 255) of Boolean
with Component_Size => 1, Size => 32;
-- key registers
type K0LR_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- b as a value
Val : HAL.UInt32;
when True =>
-- b as an array
Arr : K0LR_b_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for K0LR_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- K0RR_b array
type K0RR_b_Field_Array is array (192 .. 223) of Boolean
with Component_Size => 1, Size => 32;
-- key registers
type K0RR_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- b as a value
Val : HAL.UInt32;
when True =>
-- b as an array
Arr : K0RR_b_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for K0RR_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- K1LR_b array
type K1LR_b_Field_Array is array (160 .. 191) of Boolean
with Component_Size => 1, Size => 32;
-- key registers
type K1LR_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- b as a value
Val : HAL.UInt32;
when True =>
-- b as an array
Arr : K1LR_b_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for K1LR_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- K1RR_b array
type K1RR_b_Field_Array is array (128 .. 159) of Boolean
with Component_Size => 1, Size => 32;
-- key registers
type K1RR_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- b as a value
Val : HAL.UInt32;
when True =>
-- b as an array
Arr : K1RR_b_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for K1RR_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- K2LR_b array
type K2LR_b_Field_Array is array (96 .. 127) of Boolean
with Component_Size => 1, Size => 32;
-- key registers
type K2LR_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- b as a value
Val : HAL.UInt32;
when True =>
-- b as an array
Arr : K2LR_b_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for K2LR_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- K2RR_b array
type K2RR_b_Field_Array is array (64 .. 95) of Boolean
with Component_Size => 1, Size => 32;
-- key registers
type K2RR_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- b as a value
Val : HAL.UInt32;
when True =>
-- b as an array
Arr : K2RR_b_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for K2RR_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- K3LR_b array
type K3LR_b_Field_Array is array (32 .. 63) of Boolean
with Component_Size => 1, Size => 32;
-- key registers
type K3LR_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- b as a value
Val : HAL.UInt32;
when True =>
-- b as an array
Arr : K3LR_b_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for K3LR_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- K3RR_b array
type K3RR_b_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- key registers
type K3RR_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- b as a value
Val : HAL.UInt32;
when True =>
-- b as an array
Arr : K3RR_b_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for K3RR_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- initialization vector registers
type IV0LR_Register is record
-- IV31
IV31 : Boolean := False;
-- IV30
IV30 : Boolean := False;
-- IV29
IV29 : Boolean := False;
-- IV28
IV28 : Boolean := False;
-- IV27
IV27 : Boolean := False;
-- IV26
IV26 : Boolean := False;
-- IV25
IV25 : Boolean := False;
-- IV24
IV24 : Boolean := False;
-- IV23
IV23 : Boolean := False;
-- IV22
IV22 : Boolean := False;
-- IV21
IV21 : Boolean := False;
-- IV20
IV20 : Boolean := False;
-- IV19
IV19 : Boolean := False;
-- IV18
IV18 : Boolean := False;
-- IV17
IV17 : Boolean := False;
-- IV16
IV16 : Boolean := False;
-- IV15
IV15 : Boolean := False;
-- IV14
IV14 : Boolean := False;
-- IV13
IV13 : Boolean := False;
-- IV12
IV12 : Boolean := False;
-- IV11
IV11 : Boolean := False;
-- IV10
IV10 : Boolean := False;
-- IV9
IV9 : Boolean := False;
-- IV8
IV8 : Boolean := False;
-- IV7
IV7 : Boolean := False;
-- IV6
IV6 : Boolean := False;
-- IV5
IV5 : Boolean := False;
-- IV4
IV4 : Boolean := False;
-- IV3
IV3 : Boolean := False;
-- IV2
IV2 : Boolean := False;
-- IV1
IV1 : Boolean := False;
-- IV0
IV0 : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for IV0LR_Register use record
IV31 at 0 range 0 .. 0;
IV30 at 0 range 1 .. 1;
IV29 at 0 range 2 .. 2;
IV28 at 0 range 3 .. 3;
IV27 at 0 range 4 .. 4;
IV26 at 0 range 5 .. 5;
IV25 at 0 range 6 .. 6;
IV24 at 0 range 7 .. 7;
IV23 at 0 range 8 .. 8;
IV22 at 0 range 9 .. 9;
IV21 at 0 range 10 .. 10;
IV20 at 0 range 11 .. 11;
IV19 at 0 range 12 .. 12;
IV18 at 0 range 13 .. 13;
IV17 at 0 range 14 .. 14;
IV16 at 0 range 15 .. 15;
IV15 at 0 range 16 .. 16;
IV14 at 0 range 17 .. 17;
IV13 at 0 range 18 .. 18;
IV12 at 0 range 19 .. 19;
IV11 at 0 range 20 .. 20;
IV10 at 0 range 21 .. 21;
IV9 at 0 range 22 .. 22;
IV8 at 0 range 23 .. 23;
IV7 at 0 range 24 .. 24;
IV6 at 0 range 25 .. 25;
IV5 at 0 range 26 .. 26;
IV4 at 0 range 27 .. 27;
IV3 at 0 range 28 .. 28;
IV2 at 0 range 29 .. 29;
IV1 at 0 range 30 .. 30;
IV0 at 0 range 31 .. 31;
end record;
-- initialization vector registers
type IV0RR_Register is record
-- IV63
IV63 : Boolean := False;
-- IV62
IV62 : Boolean := False;
-- IV61
IV61 : Boolean := False;
-- IV60
IV60 : Boolean := False;
-- IV59
IV59 : Boolean := False;
-- IV58
IV58 : Boolean := False;
-- IV57
IV57 : Boolean := False;
-- IV56
IV56 : Boolean := False;
-- IV55
IV55 : Boolean := False;
-- IV54
IV54 : Boolean := False;
-- IV53
IV53 : Boolean := False;
-- IV52
IV52 : Boolean := False;
-- IV51
IV51 : Boolean := False;
-- IV50
IV50 : Boolean := False;
-- IV49
IV49 : Boolean := False;
-- IV48
IV48 : Boolean := False;
-- IV47
IV47 : Boolean := False;
-- IV46
IV46 : Boolean := False;
-- IV45
IV45 : Boolean := False;
-- IV44
IV44 : Boolean := False;
-- IV43
IV43 : Boolean := False;
-- IV42
IV42 : Boolean := False;
-- IV41
IV41 : Boolean := False;
-- IV40
IV40 : Boolean := False;
-- IV39
IV39 : Boolean := False;
-- IV38
IV38 : Boolean := False;
-- IV37
IV37 : Boolean := False;
-- IV36
IV36 : Boolean := False;
-- IV35
IV35 : Boolean := False;
-- IV34
IV34 : Boolean := False;
-- IV33
IV33 : Boolean := False;
-- IV32
IV32 : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for IV0RR_Register use record
IV63 at 0 range 0 .. 0;
IV62 at 0 range 1 .. 1;
IV61 at 0 range 2 .. 2;
IV60 at 0 range 3 .. 3;
IV59 at 0 range 4 .. 4;
IV58 at 0 range 5 .. 5;
IV57 at 0 range 6 .. 6;
IV56 at 0 range 7 .. 7;
IV55 at 0 range 8 .. 8;
IV54 at 0 range 9 .. 9;
IV53 at 0 range 10 .. 10;
IV52 at 0 range 11 .. 11;
IV51 at 0 range 12 .. 12;
IV50 at 0 range 13 .. 13;
IV49 at 0 range 14 .. 14;
IV48 at 0 range 15 .. 15;
IV47 at 0 range 16 .. 16;
IV46 at 0 range 17 .. 17;
IV45 at 0 range 18 .. 18;
IV44 at 0 range 19 .. 19;
IV43 at 0 range 20 .. 20;
IV42 at 0 range 21 .. 21;
IV41 at 0 range 22 .. 22;
IV40 at 0 range 23 .. 23;
IV39 at 0 range 24 .. 24;
IV38 at 0 range 25 .. 25;
IV37 at 0 range 26 .. 26;
IV36 at 0 range 27 .. 27;
IV35 at 0 range 28 .. 28;
IV34 at 0 range 29 .. 29;
IV33 at 0 range 30 .. 30;
IV32 at 0 range 31 .. 31;
end record;
-- initialization vector registers
type IV1LR_Register is record
-- IV95
IV95 : Boolean := False;
-- IV94
IV94 : Boolean := False;
-- IV93
IV93 : Boolean := False;
-- IV92
IV92 : Boolean := False;
-- IV91
IV91 : Boolean := False;
-- IV90
IV90 : Boolean := False;
-- IV89
IV89 : Boolean := False;
-- IV88
IV88 : Boolean := False;
-- IV87
IV87 : Boolean := False;
-- IV86
IV86 : Boolean := False;
-- IV85
IV85 : Boolean := False;
-- IV84
IV84 : Boolean := False;
-- IV83
IV83 : Boolean := False;
-- IV82
IV82 : Boolean := False;
-- IV81
IV81 : Boolean := False;
-- IV80
IV80 : Boolean := False;
-- IV79
IV79 : Boolean := False;
-- IV78
IV78 : Boolean := False;
-- IV77
IV77 : Boolean := False;
-- IV76
IV76 : Boolean := False;
-- IV75
IV75 : Boolean := False;
-- IV74
IV74 : Boolean := False;
-- IV73
IV73 : Boolean := False;
-- IV72
IV72 : Boolean := False;
-- IV71
IV71 : Boolean := False;
-- IV70
IV70 : Boolean := False;
-- IV69
IV69 : Boolean := False;
-- IV68
IV68 : Boolean := False;
-- IV67
IV67 : Boolean := False;
-- IV66
IV66 : Boolean := False;
-- IV65
IV65 : Boolean := False;
-- IV64
IV64 : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for IV1LR_Register use record
IV95 at 0 range 0 .. 0;
IV94 at 0 range 1 .. 1;
IV93 at 0 range 2 .. 2;
IV92 at 0 range 3 .. 3;
IV91 at 0 range 4 .. 4;
IV90 at 0 range 5 .. 5;
IV89 at 0 range 6 .. 6;
IV88 at 0 range 7 .. 7;
IV87 at 0 range 8 .. 8;
IV86 at 0 range 9 .. 9;
IV85 at 0 range 10 .. 10;
IV84 at 0 range 11 .. 11;
IV83 at 0 range 12 .. 12;
IV82 at 0 range 13 .. 13;
IV81 at 0 range 14 .. 14;
IV80 at 0 range 15 .. 15;
IV79 at 0 range 16 .. 16;
IV78 at 0 range 17 .. 17;
IV77 at 0 range 18 .. 18;
IV76 at 0 range 19 .. 19;
IV75 at 0 range 20 .. 20;
IV74 at 0 range 21 .. 21;
IV73 at 0 range 22 .. 22;
IV72 at 0 range 23 .. 23;
IV71 at 0 range 24 .. 24;
IV70 at 0 range 25 .. 25;
IV69 at 0 range 26 .. 26;
IV68 at 0 range 27 .. 27;
IV67 at 0 range 28 .. 28;
IV66 at 0 range 29 .. 29;
IV65 at 0 range 30 .. 30;
IV64 at 0 range 31 .. 31;
end record;
-- initialization vector registers
type IV1RR_Register is record
-- IV127
IV127 : Boolean := False;
-- IV126
IV126 : Boolean := False;
-- IV125
IV125 : Boolean := False;
-- IV124
IV124 : Boolean := False;
-- IV123
IV123 : Boolean := False;
-- IV122
IV122 : Boolean := False;
-- IV121
IV121 : Boolean := False;
-- IV120
IV120 : Boolean := False;
-- IV119
IV119 : Boolean := False;
-- IV118
IV118 : Boolean := False;
-- IV117
IV117 : Boolean := False;
-- IV116
IV116 : Boolean := False;
-- IV115
IV115 : Boolean := False;
-- IV114
IV114 : Boolean := False;
-- IV113
IV113 : Boolean := False;
-- IV112
IV112 : Boolean := False;
-- IV111
IV111 : Boolean := False;
-- IV110
IV110 : Boolean := False;
-- IV109
IV109 : Boolean := False;
-- IV108
IV108 : Boolean := False;
-- IV107
IV107 : Boolean := False;
-- IV106
IV106 : Boolean := False;
-- IV105
IV105 : Boolean := False;
-- IV104
IV104 : Boolean := False;
-- IV103
IV103 : Boolean := False;
-- IV102
IV102 : Boolean := False;
-- IV101
IV101 : Boolean := False;
-- IV100
IV100 : Boolean := False;
-- IV99
IV99 : Boolean := False;
-- IV98
IV98 : Boolean := False;
-- IV97
IV97 : Boolean := False;
-- IV96
IV96 : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for IV1RR_Register use record
IV127 at 0 range 0 .. 0;
IV126 at 0 range 1 .. 1;
IV125 at 0 range 2 .. 2;
IV124 at 0 range 3 .. 3;
IV123 at 0 range 4 .. 4;
IV122 at 0 range 5 .. 5;
IV121 at 0 range 6 .. 6;
IV120 at 0 range 7 .. 7;
IV119 at 0 range 8 .. 8;
IV118 at 0 range 9 .. 9;
IV117 at 0 range 10 .. 10;
IV116 at 0 range 11 .. 11;
IV115 at 0 range 12 .. 12;
IV114 at 0 range 13 .. 13;
IV113 at 0 range 14 .. 14;
IV112 at 0 range 15 .. 15;
IV111 at 0 range 16 .. 16;
IV110 at 0 range 17 .. 17;
IV109 at 0 range 18 .. 18;
IV108 at 0 range 19 .. 19;
IV107 at 0 range 20 .. 20;
IV106 at 0 range 21 .. 21;
IV105 at 0 range 22 .. 22;
IV104 at 0 range 23 .. 23;
IV103 at 0 range 24 .. 24;
IV102 at 0 range 25 .. 25;
IV101 at 0 range 26 .. 26;
IV100 at 0 range 27 .. 27;
IV99 at 0 range 28 .. 28;
IV98 at 0 range 29 .. 29;
IV97 at 0 range 30 .. 30;
IV96 at 0 range 31 .. 31;
end record;
-----------------
-- Peripherals --
-----------------
-- Cryptographic processor
type CRYP_Peripheral is record
-- control register
CR : aliased CR_Register;
-- status register
SR : aliased SR_Register;
-- data input register
DIN : aliased HAL.UInt32;
-- data output register
DOUT : aliased HAL.UInt32;
-- DMA control register
DMACR : aliased DMACR_Register;
-- interrupt mask set/clear register
IMSCR : aliased IMSCR_Register;
-- raw interrupt status register
RISR : aliased RISR_Register;
-- masked interrupt status register
MISR : aliased MISR_Register;
-- key registers
K0LR : aliased K0LR_Register;
-- key registers
K0RR : aliased K0RR_Register;
-- key registers
K1LR : aliased K1LR_Register;
-- key registers
K1RR : aliased K1RR_Register;
-- key registers
K2LR : aliased K2LR_Register;
-- key registers
K2RR : aliased K2RR_Register;
-- key registers
K3LR : aliased K3LR_Register;
-- key registers
K3RR : aliased K3RR_Register;
-- initialization vector registers
IV0LR : aliased IV0LR_Register;
-- initialization vector registers
IV0RR : aliased IV0RR_Register;
-- initialization vector registers
IV1LR : aliased IV1LR_Register;
-- initialization vector registers
IV1RR : aliased IV1RR_Register;
-- context swap register
CSGCMCCM0R : aliased HAL.UInt32;
-- context swap register
CSGCMCCM1R : aliased HAL.UInt32;
-- context swap register
CSGCMCCM2R : aliased HAL.UInt32;
-- context swap register
CSGCMCCM3R : aliased HAL.UInt32;
-- context swap register
CSGCMCCM4R : aliased HAL.UInt32;
-- context swap register
CSGCMCCM5R : aliased HAL.UInt32;
-- context swap register
CSGCMCCM6R : aliased HAL.UInt32;
-- context swap register
CSGCMCCM7R : aliased HAL.UInt32;
-- context swap register
CSGCM0R : aliased HAL.UInt32;
-- context swap register
CSGCM1R : aliased HAL.UInt32;
-- context swap register
CSGCM2R : aliased HAL.UInt32;
-- context swap register
CSGCM3R : aliased HAL.UInt32;
-- context swap register
CSGCM4R : aliased HAL.UInt32;
-- context swap register
CSGCM5R : aliased HAL.UInt32;
-- context swap register
CSGCM6R : aliased HAL.UInt32;
-- context swap register
CSGCM7R : aliased HAL.UInt32;
end record
with Volatile;
for CRYP_Peripheral use record
CR at 16#0# range 0 .. 31;
SR at 16#4# range 0 .. 31;
DIN at 16#8# range 0 .. 31;
DOUT at 16#C# range 0 .. 31;
DMACR at 16#10# range 0 .. 31;
IMSCR at 16#14# range 0 .. 31;
RISR at 16#18# range 0 .. 31;
MISR at 16#1C# range 0 .. 31;
K0LR at 16#20# range 0 .. 31;
K0RR at 16#24# range 0 .. 31;
K1LR at 16#28# range 0 .. 31;
K1RR at 16#2C# range 0 .. 31;
K2LR at 16#30# range 0 .. 31;
K2RR at 16#34# range 0 .. 31;
K3LR at 16#38# range 0 .. 31;
K3RR at 16#3C# range 0 .. 31;
IV0LR at 16#40# range 0 .. 31;
IV0RR at 16#44# range 0 .. 31;
IV1LR at 16#48# range 0 .. 31;
IV1RR at 16#4C# range 0 .. 31;
CSGCMCCM0R at 16#50# range 0 .. 31;
CSGCMCCM1R at 16#54# range 0 .. 31;
CSGCMCCM2R at 16#58# range 0 .. 31;
CSGCMCCM3R at 16#5C# range 0 .. 31;
CSGCMCCM4R at 16#60# range 0 .. 31;
CSGCMCCM5R at 16#64# range 0 .. 31;
CSGCMCCM6R at 16#68# range 0 .. 31;
CSGCMCCM7R at 16#6C# range 0 .. 31;
CSGCM0R at 16#70# range 0 .. 31;
CSGCM1R at 16#74# range 0 .. 31;
CSGCM2R at 16#78# range 0 .. 31;
CSGCM3R at 16#7C# range 0 .. 31;
CSGCM4R at 16#80# range 0 .. 31;
CSGCM5R at 16#84# range 0 .. 31;
CSGCM6R at 16#88# range 0 .. 31;
CSGCM7R at 16#8C# range 0 .. 31;
end record;
-- Cryptographic processor
CRYP_Periph : aliased CRYP_Peripheral
with Import, Address => System'To_Address (16#50060000#);
end STM32_SVD.CRYP;
|
--
-- 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 ewok.tasks_shared; use ewok.tasks_shared;
with ewok.devices_shared; use ewok.devices_shared;
with ewok.exported.devices;
with ewok.exported.interrupts;
with soc.interrupts;
with soc.devmap;
package ewok.devices
with spark_mode => off
is
type t_device_type is (DEV_TYPE_USER, DEV_TYPE_KERNEL);
type t_device_state is -- FIXME
(DEV_STATE_UNUSED,
DEV_STATE_RESERVED,
DEV_STATE_REGISTERED,
DEV_STATE_ENABLED);
type t_checked_user_device is new ewok.exported.devices.t_user_device;
type t_checked_user_device_access is access all t_checked_user_device;
type t_device is record
udev : aliased t_checked_user_device;
task_id : t_task_id := ID_UNUSED;
periph_id : soc.devmap.t_periph_id := soc.devmap.NO_PERIPH;
status : t_device_state := DEV_STATE_UNUSED;
end record;
registered_device : array (t_registered_device_id) of t_device;
procedure get_registered_device_entry
(dev_id : out t_device_id;
success : out boolean);
procedure release_registered_device_entry (dev_id : t_registered_device_id);
function get_task_from_id(dev_id : t_registered_device_id)
return t_task_id;
function get_user_device (dev_id : t_registered_device_id)
return t_checked_user_device_access
with inline_always;
function get_device_size (dev_id : t_registered_device_id)
return unsigned_32;
function get_device_addr (dev_id : t_registered_device_id)
return system_address;
function is_device_region_ro (dev_id : t_registered_device_id)
return boolean;
function get_device_subregions_mask (dev_id : t_registered_device_id)
return unsigned_8;
function get_interrupt_config_from_interrupt
(interrupt : soc.interrupts.t_interrupt)
return ewok.exported.interrupts.t_interrupt_config_access;
procedure register_device
(task_id : in t_task_id;
udev : in ewok.exported.devices.t_user_device_access;
dev_id : out t_device_id;
success : out boolean);
procedure release_device
(task_id : in t_task_id;
dev_id : in t_registered_device_id;
success : out boolean);
procedure enable_device
(dev_id : in t_registered_device_id;
success : out boolean);
function sanitize_user_defined_device
(udev : in ewok.exported.devices.t_user_device_access;
task_id : in t_task_id)
return boolean;
end ewok.devices;
|
------------------------------------------------------------------------------
-- --
-- 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$
------------------------------------------------------------------------------
with AMF.Elements;
with AMF.Internals.Element_Collections;
with AMF.Internals.Helpers;
with AMF.Internals.Tables.UML_Attributes;
with AMF.Visitors.UMLDI_Iterators;
with AMF.Visitors.UMLDI_Visitors;
package body AMF.Internals.UMLDI_UML_Classifier_Shapes is
-------------------------
-- Get_Is_Double_Sided --
-------------------------
overriding function Get_Is_Double_Sided
(Self : not null access constant UMLDI_UML_Classifier_Shape_Proxy)
return Boolean is
begin
return
AMF.Internals.Tables.UML_Attributes.Internal_Get_Is_Double_Sided
(Self.Element);
end Get_Is_Double_Sided;
-------------------------
-- Set_Is_Double_Sided --
-------------------------
overriding procedure Set_Is_Double_Sided
(Self : not null access UMLDI_UML_Classifier_Shape_Proxy;
To : Boolean) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Is_Double_Sided
(Self.Element, To);
end Set_Is_Double_Sided;
----------------------------------
-- Get_Is_Indent_For_Visibility --
----------------------------------
overriding function Get_Is_Indent_For_Visibility
(Self : not null access constant UMLDI_UML_Classifier_Shape_Proxy)
return Boolean is
begin
return
AMF.Internals.Tables.UML_Attributes.Internal_Get_Is_Indent_For_Visibility
(Self.Element);
end Get_Is_Indent_For_Visibility;
----------------------------------
-- Set_Is_Indent_For_Visibility --
----------------------------------
overriding procedure Set_Is_Indent_For_Visibility
(Self : not null access UMLDI_UML_Classifier_Shape_Proxy;
To : Boolean) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Is_Indent_For_Visibility
(Self.Element, To);
end Set_Is_Indent_For_Visibility;
-----------------------
-- Get_Model_Element --
-----------------------
overriding function Get_Model_Element
(Self : not null access constant UMLDI_UML_Classifier_Shape_Proxy)
return AMF.UML.Classifiers.UML_Classifier_Access is
begin
return
AMF.UML.Classifiers.UML_Classifier_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Model_Element
(Self.Element)));
end Get_Model_Element;
-----------------------
-- Set_Model_Element --
-----------------------
overriding procedure Set_Model_Element
(Self : not null access UMLDI_UML_Classifier_Shape_Proxy;
To : AMF.UML.Classifiers.UML_Classifier_Access) is
begin
raise Program_Error;
-- AMF.Internals.Tables.UML_Attributes.Internal_Set_Model_Element
-- (Self.Element,
-- AMF.Internals.Helpers.To_Element
-- (AMF.Elements.Element_Access (To)));
end Set_Model_Element;
---------------------
-- Get_Compartment --
---------------------
overriding function Get_Compartment
(Self : not null access constant UMLDI_UML_Classifier_Shape_Proxy)
return AMF.UMLDI.UML_Compartments.Collections.Ordered_Set_Of_UMLDI_UML_Compartment is
begin
return
AMF.UMLDI.UML_Compartments.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Compartment
(Self.Element)));
end Get_Compartment;
-----------------
-- Get_Is_Icon --
-----------------
overriding function Get_Is_Icon
(Self : not null access constant UMLDI_UML_Classifier_Shape_Proxy)
return Boolean is
begin
return
AMF.Internals.Tables.UML_Attributes.Internal_Get_Is_Icon
(Self.Element);
end Get_Is_Icon;
-----------------
-- Set_Is_Icon --
-----------------
overriding procedure Set_Is_Icon
(Self : not null access UMLDI_UML_Classifier_Shape_Proxy;
To : Boolean) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Is_Icon
(Self.Element, To);
end Set_Is_Icon;
---------------------
-- Get_Local_Style --
---------------------
overriding function Get_Local_Style
(Self : not null access constant UMLDI_UML_Classifier_Shape_Proxy)
return AMF.UMLDI.UML_Styles.UMLDI_UML_Style_Access is
begin
return
AMF.UMLDI.UML_Styles.UMLDI_UML_Style_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Local_Style
(Self.Element)));
end Get_Local_Style;
---------------------
-- Set_Local_Style --
---------------------
overriding procedure Set_Local_Style
(Self : not null access UMLDI_UML_Classifier_Shape_Proxy;
To : AMF.UMLDI.UML_Styles.UMLDI_UML_Style_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Local_Style
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Local_Style;
-----------------------
-- Get_Model_Element --
-----------------------
overriding function Get_Model_Element
(Self : not null access constant UMLDI_UML_Classifier_Shape_Proxy)
return AMF.UML.Elements.Collections.Set_Of_UML_Element is
begin
raise Program_Error;
return X : AMF.UML.Elements.Collections.Set_Of_UML_Element;
-- return
-- AMF.UML.Elements.Collections.Wrap
-- (AMF.Internals.Element_Collections.Wrap
-- (AMF.Internals.Tables.UML_Attributes.Internal_Get_Model_Element
-- (Self.Element)));
end Get_Model_Element;
-----------------------
-- Get_Model_Element --
-----------------------
overriding function Get_Model_Element
(Self : not null access constant UMLDI_UML_Classifier_Shape_Proxy)
return AMF.CMOF.Elements.CMOF_Element_Access is
begin
return
AMF.CMOF.Elements.CMOF_Element_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Model_Element
(Self.Element)));
end Get_Model_Element;
---------------------
-- Get_Local_Style --
---------------------
overriding function Get_Local_Style
(Self : not null access constant UMLDI_UML_Classifier_Shape_Proxy)
return AMF.DI.Styles.DI_Style_Access is
begin
return
AMF.DI.Styles.DI_Style_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Local_Style
(Self.Element)));
end Get_Local_Style;
---------------------
-- Set_Local_Style --
---------------------
overriding procedure Set_Local_Style
(Self : not null access UMLDI_UML_Classifier_Shape_Proxy;
To : AMF.DI.Styles.DI_Style_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Local_Style
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Local_Style;
-------------------
-- Enter_Element --
-------------------
overriding procedure Enter_Element
(Self : not null access constant UMLDI_UML_Classifier_Shape_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control) is
begin
if Visitor in AMF.Visitors.UMLDI_Visitors.UMLDI_Visitor'Class then
AMF.Visitors.UMLDI_Visitors.UMLDI_Visitor'Class
(Visitor).Enter_UML_Classifier_Shape
(AMF.UMLDI.UML_Classifier_Shapes.UMLDI_UML_Classifier_Shape_Access (Self),
Control);
end if;
end Enter_Element;
-------------------
-- Leave_Element --
-------------------
overriding procedure Leave_Element
(Self : not null access constant UMLDI_UML_Classifier_Shape_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control) is
begin
if Visitor in AMF.Visitors.UMLDI_Visitors.UMLDI_Visitor'Class then
AMF.Visitors.UMLDI_Visitors.UMLDI_Visitor'Class
(Visitor).Leave_UML_Classifier_Shape
(AMF.UMLDI.UML_Classifier_Shapes.UMLDI_UML_Classifier_Shape_Access (Self),
Control);
end if;
end Leave_Element;
-------------------
-- Visit_Element --
-------------------
overriding procedure Visit_Element
(Self : not null access constant UMLDI_UML_Classifier_Shape_Proxy;
Iterator : in out AMF.Visitors.Abstract_Iterator'Class;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control) is
begin
if Iterator in AMF.Visitors.UMLDI_Iterators.UMLDI_Iterator'Class then
AMF.Visitors.UMLDI_Iterators.UMLDI_Iterator'Class
(Iterator).Visit_UML_Classifier_Shape
(Visitor,
AMF.UMLDI.UML_Classifier_Shapes.UMLDI_UML_Classifier_Shape_Access (Self),
Control);
end if;
end Visit_Element;
end AMF.Internals.UMLDI_UML_Classifier_Shapes;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . T R A C E B A C K _ E N T R I E S --
-- --
-- B o d y --
-- --
-- Copyright (C) 2003-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. --
-- --
------------------------------------------------------------------------------
package body System.Traceback_Entries is
------------
-- PC_For --
------------
function PC_For (TB_Entry : Traceback_Entry) return System.Address is
begin
return TB_Entry.PC;
end PC_For;
------------
-- PV_For --
------------
function PV_For (TB_Entry : Traceback_Entry) return System.Address is
begin
return TB_Entry.PV;
end PV_For;
------------------
-- TB_Entry_For --
------------------
function TB_Entry_For (PC : System.Address) return Traceback_Entry is
begin
return (PC => PC, PV => System.Null_Address);
end TB_Entry_For;
end System.Traceback_Entries;
|
-- MIT License
--
-- Copyright (c) 2020 Max Reznik
--
-- 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 PB_Support.Integer_32_Vectors;
with Compiler.Enum_Descriptors;
with Compiler.Field_Descriptors;
package body Compiler.Descriptors is
F : Ada_Pretty.Factory renames Compiler.Context.Factory;
use type Ada_Pretty.Node_Access;
use type League.Strings.Universal_String;
function "+" (Text : Wide_Wide_String)
return League.Strings.Universal_String
renames League.Strings.To_Universal_String;
function Type_Name
(Self : Google.Protobuf.Descriptor.Descriptor_Proto)
return League.Strings.Universal_String;
-- Return Ada type (simple) name
function Check_Dependency
(Self : Google.Protobuf.Descriptor.Descriptor_Proto;
Pkg : League.Strings.Universal_String;
Done : Compiler.Context.String_Sets.Set;
Force : Natural;
Fake : in out Compiler.Context.String_Sets.Set) return Boolean;
function Public_Spec
(Self : Google.Protobuf.Descriptor.Descriptor_Proto;
Pkg : League.Strings.Universal_String;
Fake : Compiler.Context.String_Sets.Set)
return Ada_Pretty.Node_Access;
function Read_Subprogram
(Self : Google.Protobuf.Descriptor.Descriptor_Proto;
Pkg : League.Strings.Universal_String;
Fake : Compiler.Context.String_Sets.Set)
return Ada_Pretty.Node_Access;
function Write_Subprogram
(Self : Google.Protobuf.Descriptor.Descriptor_Proto;
Pkg : League.Strings.Universal_String;
Fake : Compiler.Context.String_Sets.Set)
return Ada_Pretty.Node_Access;
procedure One_Of_Declaration
(Self : Google.Protobuf.Descriptor.Descriptor_Proto;
Index : Positive;
Pkg : League.Strings.Universal_String;
Fake : Compiler.Context.String_Sets.Set;
Types : in out Ada_Pretty.Node_Access;
Component : in out Ada_Pretty.Node_Access);
function Is_One_Of
(Value : PB_Support.Integer_32_Vectors.Option;
Index : Positive) return Boolean;
function Indexing_Spec
(Self : Google.Protobuf.Descriptor.Descriptor_Proto;
Prefix : League.Strings.Universal_String;
Variable : Boolean) return Ada_Pretty.Node_Access;
function Indexing_Body
(Self : Google.Protobuf.Descriptor.Descriptor_Proto;
Prefix : League.Strings.Universal_String;
Variable : Boolean) return Ada_Pretty.Node_Access;
----------------
-- Enum_Types --
----------------
function Enum_Types
(Self : Google.Protobuf.Descriptor.Descriptor_Proto)
return Ada_Pretty.Node_Access
is
Result : Ada_Pretty.Node_Access;
Item : Ada_Pretty.Node_Access;
begin
for J in 1 .. Self.Enum_Type.Length loop
Item := Compiler.Enum_Descriptors.Public_Spec (Self.Enum_Type (J));
Result := F.New_List (Result, Item);
end loop;
for J in 1 .. Self.Nested_Type.Length loop
Item := Enum_Types (Self.Nested_Type (J));
if Item /= null then
Result := F.New_List (Result, Item);
end if;
end loop;
return Result;
end Enum_Types;
----------------------
-- Check_Dependency --
----------------------
function Check_Dependency
(Self : Google.Protobuf.Descriptor.Descriptor_Proto;
Pkg : League.Strings.Universal_String;
Done : Compiler.Context.String_Sets.Set;
Force : Natural;
Fake : in out Compiler.Context.String_Sets.Set) return Boolean
is
Required : Compiler.Context.String_Sets.Set;
Tipe : constant League.Strings.Universal_String := Type_Name (Self);
begin
for J in 1 .. Self.Field.Length loop
declare
use all type Google.Protobuf.Descriptor.Label;
Field : constant Google.Protobuf.Descriptor.Field_Descriptor_Proto
:= Self.Field (J);
Type_Name : League.Strings.Universal_String;
Named_Type : Compiler.Context.Named_Type;
begin
if Field.Type_Name.Is_Set then
Type_Name := Field.Type_Name.Value;
end if;
if not Compiler.Context.Named_Types.Contains (Type_Name) then
null;
else
Named_Type := Compiler.Context.Named_Types (Type_Name);
if not (Done.Contains (Named_Type.Ada_Type.Type_Name)
or else Named_Type.Is_Enumeration
or else Named_Type.Ada_Type.Package_Name /= Pkg
or else
(Field.Label.Is_Set
and then Field.Label.Value = LABEL_REPEATED))
then
Required.Insert
(Compiler.Field_Descriptors.Unique_Id
(Field, Pkg, Tipe));
end if;
end if;
end;
end loop;
if Natural (Required.Length) <= Force then
Fake.Union (Required);
return True;
else
return False;
end if;
end Check_Dependency;
----------------
-- Dependency --
----------------
procedure Dependency
(Self : Google.Protobuf.Descriptor.Descriptor_Proto;
Result : in out Compiler.Context.String_Sets.Set)
is
begin
Result.Include (+"Ada.Finalization");
Result.Include (+"Ada.Streams");
if Self.Enum_Type.Length > 0 then
Result.Include (+"PB_Support.Vectors");
end if;
for J in 1 .. Self.Field.Length loop
Compiler.Field_Descriptors.Dependency (Self.Field (J), Result);
end loop;
for J in 1 .. Self.Nested_Type.Length loop
Dependency (Self.Nested_Type (J), Result);
end loop;
end Dependency;
--------------------
-- Get_Used_Types --
--------------------
procedure Get_Used_Types
(Self : Google.Protobuf.Descriptor.Descriptor_Proto;
Result : in out Compiler.Context.String_Sets.Set) is
begin
for J in 1 .. Self.Field.Length loop
Compiler.Field_Descriptors.Get_Used_Types (Self.Field (J), Result);
end loop;
for J in 1 .. Self.Nested_Type.Length loop
Get_Used_Types (Self.Nested_Type (J), Result);
end loop;
end Get_Used_Types;
-------------------
-- Indexing_Body --
-------------------
function Indexing_Body
(Self : Google.Protobuf.Descriptor.Descriptor_Proto;
Prefix : League.Strings.Universal_String;
Variable : Boolean) return Ada_Pretty.Node_Access
is
My_Name : constant League.Strings.Universal_String := Type_Name (Self);
Ref_Name : constant League.Strings.Universal_String :=
My_Name & "_" & Prefix & "_Reference";
Result : Ada_Pretty.Node_Access;
begin
Result := F.New_Subprogram_Body
(Specification =>
F.New_Subprogram_Specification
(Name => F.New_Name ("Get_" & Ref_Name),
Is_Overriding => Ada_Pretty.False,
Parameters => F.New_List
(F.New_Parameter
(Name => F.New_Name (+"Self"),
Type_Definition => F.New_Name (My_Name & "_Vector"),
Is_In => Variable,
Is_Out => Variable,
Is_Aliased => True),
F.New_Parameter
(Name => F.New_Name (+"Index"),
Type_Definition => F.New_Name (+"Positive"))),
Result => F.New_Name (Ref_Name)),
Statements => F.New_Return
(F.New_Parentheses
(F.New_Argument_Association
(Value => F.New_Name (+"Self.Data (Index)'Access"),
Choice => F.New_Name (+"Element")))));
return Result;
end Indexing_Body;
-------------------
-- Indexing_Spec --
-------------------
function Indexing_Spec
(Self : Google.Protobuf.Descriptor.Descriptor_Proto;
Prefix : League.Strings.Universal_String;
Variable : Boolean) return Ada_Pretty.Node_Access
is
My_Name : constant League.Strings.Universal_String := Type_Name (Self);
Ref_Name : constant League.Strings.Universal_String :=
My_Name & "_" & Prefix & "_Reference";
Map : constant array (Boolean) of Ada_Pretty.Access_Modifier :=
(True => Ada_Pretty.Unspecified,
False => Ada_Pretty.Access_Constant);
Result : Ada_Pretty.Node_Access;
begin
Result := F.New_Type
(Name => F.New_Name (Ref_Name),
Discriminants => F.New_Parameter
(Name => F.New_Name (+"Element"),
Type_Definition => F.New_Null_Exclusion
(F.New_Access
(Target => F.New_Name (My_Name),
Modifier => Map (Variable)))),
Definition => F.New_Record,
Aspects => F.New_Argument_Association
(Choice => F.New_Name (+"Implicit_Dereference"),
Value => F.New_Name (+"Element")));
Result := F.New_List
(Result,
F.New_Subprogram_Declaration
(Specification =>
F.New_Subprogram_Specification
(Name => F.New_Name ("Get_" & Ref_Name),
Is_Overriding => Ada_Pretty.False,
Parameters => F.New_List
(F.New_Parameter
(Name => F.New_Name (+"Self"),
Type_Definition => F.New_Name (My_Name & "_Vector"),
Is_In => Variable,
Is_Out => Variable,
Is_Aliased => True),
F.New_Parameter
(Name => F.New_Name (+"Index"),
Type_Definition => F.New_Name (+"Positive"))),
Result => F.New_Name (Ref_Name)),
Aspects => F.New_Name (+"Inline")));
return Result;
end Indexing_Spec;
---------------
-- Is_One_Of --
---------------
function Is_One_Of
(Value : PB_Support.Integer_32_Vectors.Option;
Index : Positive) return Boolean
is
begin
return Value.Is_Set and then Natural (Value.Value) + 1 = Index;
end Is_One_Of;
------------------------
-- One_Of_Declaration --
------------------------
procedure One_Of_Declaration
(Self : Google.Protobuf.Descriptor.Descriptor_Proto;
Index : Positive;
Pkg : League.Strings.Universal_String;
Fake : Compiler.Context.String_Sets.Set;
Types : in out Ada_Pretty.Node_Access;
Component : in out Ada_Pretty.Node_Access)
is
My_Name : constant League.Strings.Universal_String := Type_Name (Self);
Item_Name : constant League.Strings.Universal_String :=
Compiler.Context.To_Ada_Name (Self.Oneof_Decl (Index).Name.Value);
Next : Ada_Pretty.Node_Access;
Name : constant League.Strings.Universal_String :=
My_Name & "_Variant";
Choices : Ada_Pretty.Node_Access;
begin
Next := F.New_Name (Item_Name & "_Not_Set");
Choices :=
F.New_Case_Path
(Next,
F.New_Statement);
for J in 1 .. Self.Field.Length loop
declare
Field : constant Google.Protobuf.Descriptor.Field_Descriptor_Proto
:= Self.Field (J);
Literal : League.Strings.Universal_String;
begin
if Is_One_Of (Field.Oneof_Index, Index) then
Literal := Compiler.Context.To_Ada_Name (Field.Name.Value) &
"_Kind";
Next := F.New_List
(Next,
F.New_Argument_Association (F.New_Name (Literal)));
Choices := F.New_List
(Choices,
F.New_Case_Path
(F.New_Name (Literal),
Compiler.Field_Descriptors.Component
(Field, Pkg, My_Name, Fake)));
end if;
end;
end loop;
Types := F.New_List
(Types,
F.New_Type
(Name => F.New_Name (Name & "_Kind"),
Definition => F.New_Parentheses (Next)));
Types := F.New_List
(Types,
F.New_Type
(Name => F.New_Name (Name),
Discriminants =>
F.New_Parameter
(Name => F.New_Name (Item_Name),
Type_Definition => F.New_Name (Name & "_Kind"),
Initialization => F.New_Name (Item_Name & "_Not_Set")),
Definition => F.New_Record
(Components =>
F.New_Case
(Expression => F.New_Name (Item_Name),
List => Choices))));
Component := F.New_List
(Component,
F.New_Variable
(Name => F.New_Name (+"Variant"),
Type_Definition => F.New_Name (Name)));
end One_Of_Declaration;
--------------------------
-- Populate_Named_Types --
--------------------------
procedure Populate_Named_Types
(Self : Google.Protobuf.Descriptor.Descriptor_Proto;
PB_Prefix : League.Strings.Universal_String;
Ada_Package : League.Strings.Universal_String;
Map : in out Compiler.Context.Named_Type_Maps.Map)
is
Name : constant League.Strings.Universal_String := Type_Name (Self);
Key : League.Strings.Universal_String := PB_Prefix;
Value : constant Compiler.Context.Named_Type :=
(Is_Enumeration => False,
Ada_Type =>
(Package_Name => Ada_Package,
Type_Name => Name));
begin
Key.Append (".");
if Self.Name.Is_Set then
Key.Append (Self.Name.Value);
end if;
Map.Insert (Key, Value);
for J in 1 .. Self.Nested_Type.Length loop
Populate_Named_Types
(Self => Self.Nested_Type (J),
PB_Prefix => Key,
Ada_Package => Ada_Package,
Map => Map);
end loop;
for J in 1 .. Self.Enum_Type.Length loop
Compiler.Enum_Descriptors.Populate_Named_Types
(Self => Self.Enum_Type (J),
PB_Prefix => Key,
Ada_Package => Ada_Package,
Map => Map);
end loop;
end Populate_Named_Types;
------------------
-- Private_Spec --
------------------
function Private_Spec
(Self : Google.Protobuf.Descriptor.Descriptor_Proto)
return Ada_Pretty.Node_Access
is
My_Name : constant League.Strings.Universal_String := Type_Name (Self);
T_Array : Ada_Pretty.Node_Access;
Array_Access : Ada_Pretty.Node_Access;
Result : Ada_Pretty.Node_Access;
Item : Ada_Pretty.Node_Access;
Read : Ada_Pretty.Node_Access;
Write : Ada_Pretty.Node_Access;
Use_R : Ada_Pretty.Node_Access;
Use_W : Ada_Pretty.Node_Access;
Adjust : Ada_Pretty.Node_Access;
Final : Ada_Pretty.Node_Access;
begin
for J in 1 .. Self.Nested_Type.Length loop
Item := Private_Spec (Self.Nested_Type (J));
Result := F.New_List (Result, Item);
end loop;
Read := F.New_Subprogram_Declaration
(F.New_Subprogram_Specification
(Name => F.New_Name ("Read_" & My_Name),
Parameters => F.New_List
(F.New_Parameter
(Name => F.New_Name (+"Stream"),
Type_Definition => F.New_Selected_Name
(+"access Ada.Streams.Root_Stream_Type'Class")),
F.New_Parameter
(Name => F.New_Name (+"V"),
Type_Definition => F.New_Name (My_Name),
Is_Out => True))));
Write := F.New_Subprogram_Declaration
(F.New_Subprogram_Specification
(Name => F.New_Name ("Write_" & My_Name),
Parameters => F.New_List
(F.New_Parameter
(Name => F.New_Name (+"Stream"),
Type_Definition => F.New_Selected_Name
(+"access Ada.Streams.Root_Stream_Type'Class")),
F.New_Parameter
(Name => F.New_Name (+"V"),
Type_Definition => F.New_Name (My_Name)))));
Use_R := F.New_Statement
(F.New_Name ("for " & My_Name & "'Read use Read_" & My_Name));
Use_W := F.New_Statement
(F.New_Name ("for " & My_Name & "'Write use Write_" & My_Name));
T_Array := F.New_Type
(Name => F.New_Name (My_Name & "_Array"),
Definition => F.New_Array
(Indexes => F.New_Name (+"Positive range <>"),
Component => F.New_Name ("aliased " & My_Name)));
Array_Access := F.New_Type
(Name => F.New_Name (My_Name & "_Array_Access"),
Definition => F.New_Access
(Target => F.New_Name (My_Name & "_Array")));
Item := F.New_Type
(F.New_Name (Type_Name (Self) & "_Vector"),
Definition => F.New_Record
(Parent => F.New_Selected_Name
(+"Ada.Finalization.Controlled"),
Components => F.New_List
(F.New_Variable
(Name => F.New_Name (+"Data"),
Type_Definition => F.New_Name (My_Name & "_Array_Access")),
F.New_Variable
(Name => F.New_Name (+"Length"),
Type_Definition => F.New_Name (+"Natural"),
Initialization => F.New_Literal (0)))));
Adjust := F.New_Subprogram_Declaration
(F.New_Subprogram_Specification
(Is_Overriding => Ada_Pretty.True,
Name => F.New_Name (+"Adjust"),
Parameters => F.New_Parameter
(Name => F.New_Name (+"Self"),
Type_Definition => F.New_Name (Type_Name (Self) & "_Vector"),
Is_In => True,
Is_Out => True)));
Final := F.New_Subprogram_Declaration
(F.New_Subprogram_Specification
(Is_Overriding => Ada_Pretty.True,
Name => F.New_Name (+"Finalize"),
Parameters => F.New_Parameter
(Name => F.New_Name (+"Self"),
Type_Definition => F.New_Name (Type_Name (Self) & "_Vector"),
Is_In => True,
Is_Out => True)));
Result := F.New_List
(Result,
F.New_List
((Read, Write, Use_R, Use_W,
T_Array, Array_Access, Item, Adjust, Final)));
return Result;
end Private_Spec;
-----------------
-- Public_Spec --
-----------------
function Public_Spec
(Self : Google.Protobuf.Descriptor.Descriptor_Proto;
Pkg : League.Strings.Universal_String;
Fake : Compiler.Context.String_Sets.Set)
return Ada_Pretty.Node_Access
is
My_Name : constant League.Strings.Universal_String := Type_Name (Self);
Me : constant Ada_Pretty.Node_Access := F.New_Name (My_Name);
V_Name : Ada_Pretty.Node_Access;
P_Self : Ada_Pretty.Node_Access;
Is_Set : Ada_Pretty.Node_Access;
Count : Ada_Pretty.Node_Access;
Clear : Ada_Pretty.Node_Access;
Append : Ada_Pretty.Node_Access;
Option : Ada_Pretty.Node_Access;
Result : Ada_Pretty.Node_Access;
Item : Ada_Pretty.Node_Access;
One_Of : Ada_Pretty.Node_Access;
Indexing : Ada_Pretty.Node_Access;
begin
for J in 1 .. Self.Field.Length loop
if not Self.Field (J).Oneof_Index.Is_Set then
Item := Compiler.Field_Descriptors.Component
(Self.Field (J), Pkg, My_Name, Fake);
Result := F.New_List (Result, Item);
end if;
end loop;
for J in 1 .. Self.Oneof_Decl.Length loop
One_Of_Declaration (Self, J, Pkg, Fake, One_Of, Result);
end loop;
Result := F.New_List
(One_Of,
F.New_Type
(F.New_Name (My_Name),
Definition => F.New_Record (Components => Result)));
Is_Set := F.New_Name (+"Is_Set");
Option := F.New_Type
(Name => F.New_Name ("Optional_" & My_Name),
Discriminants => F.New_Parameter
(Name => Is_Set,
Type_Definition => F.New_Name (+"Boolean"),
Initialization => F.New_Name (+"False")),
Definition => F.New_Record
(Components => F.New_Case
(Expression => Is_Set,
List => F.New_List
(F.New_Case_Path
(Choice => F.New_Name (+"True"),
List => F.New_Variable
(Name => F.New_Name (+"Value"),
Type_Definition =>
F.New_Selected_Name
(Compiler.Context.Relative_Name
(Pkg & "." & My_Name, Pkg)))),
F.New_Case_Path
(Choice => F.New_Name (+"False"),
List => F.New_Statement)))));
V_Name := F.New_Name (My_Name & "_Vector");
P_Self := F.New_Name (+"Self");
Count := F.New_Subprogram_Declaration
(F.New_Subprogram_Specification
(Name => F.New_Name (+"Length"),
Parameters => F.New_Parameter
(Name => P_Self,
Type_Definition => V_Name),
Result => F.New_Name (+"Natural")));
Clear := F.New_Subprogram_Declaration
(F.New_Subprogram_Specification
(Name => F.New_Name (+"Clear"),
Parameters => F.New_Parameter
(Name => P_Self,
Type_Definition => V_Name,
Is_In => True,
Is_Out => True)));
Append := F.New_Subprogram_Declaration
(F.New_Subprogram_Specification
(Name => F.New_Name (+"Append"),
Parameters => F.New_List
(F.New_Parameter
(Name => P_Self,
Type_Definition => V_Name,
Is_In => True,
Is_Out => True),
F.New_Parameter
(F.New_Name (+"V"), Me))));
Indexing := F.New_List
(Indexing_Spec (Self, +"Variable", True),
Indexing_Spec (Self, +"Constant", False));
Result := F.New_List ((Result, Option, Count, Clear, Append, Indexing));
return Result;
end Public_Spec;
-----------------
-- Public_Spec --
-----------------
procedure Public_Spec
(Self : Google.Protobuf.Descriptor.Descriptor_Proto;
Pkg : League.Strings.Universal_String;
Result : out Ada_Pretty.Node_Access;
Again : in out Boolean;
Done : in out Compiler.Context.String_Sets.Set;
Force : in out Natural)
is
Name : constant League.Strings.Universal_String := Type_Name (Self);
Item : Ada_Pretty.Node_Access;
Fake : Compiler.Context.String_Sets.Set renames
Compiler.Context.Fake;
begin
Result := null;
for J in 1 .. Self.Nested_Type.Length loop
Public_Spec (Self.Nested_Type (J), Pkg, Item, Again, Done, Force);
if Item /= null then
Result := F.New_List (Result, Item);
Force := 0;
end if;
end loop;
if not Done.Contains (Name) then
if Check_Dependency (Self, Pkg, Done, Force, Fake) then
Result := F.New_List (Result, Public_Spec (Self, Pkg, Fake));
Done.Insert (Name);
else
Again := True;
end if;
end if;
end Public_Spec;
---------------------
-- Read_Subprogram --
---------------------
function Read_Subprogram
(Self : Google.Protobuf.Descriptor.Descriptor_Proto;
Pkg : League.Strings.Universal_String;
Fake : Compiler.Context.String_Sets.Set)
return Ada_Pretty.Node_Access
is
function Oneof_Name
(Field : Google.Protobuf.Descriptor.Field_Descriptor_Proto)
return League.Strings.Universal_String;
function Oneof_Name
(Field : Google.Protobuf.Descriptor.Field_Descriptor_Proto)
return League.Strings.Universal_String is
begin
if Field.Oneof_Index.Is_Set then
return Compiler.Context.To_Ada_Name
(Self.Oneof_Decl
(Natural (Field.Oneof_Index.Value) + 1).Name.Value);
else
return League.Strings.Empty_Universal_String;
end if;
end Oneof_Name;
My_Name : constant League.Strings.Universal_String := Type_Name (Self);
Key : Ada_Pretty.Node_Access;
Result : Ada_Pretty.Node_Access;
Field : Ada_Pretty.Node_Access;
begin
Key := F.New_Variable
(Name => F.New_Name (+"Key"),
Type_Definition => F.New_Selected_Name (+"PB_Support.IO.Key"),
Is_Aliased => True);
for J in 1 .. Self.Field.Length loop
Field := Compiler.Field_Descriptors.Read_Case
(Self.Field (J),
Pkg,
My_Name,
Fake,
Oneof_Name (Self.Field (J)));
Result := F.New_List (Result, Field);
end loop;
Result := F.New_List
(Result,
F.New_Case_Path
(Choice => F.New_Name (+"others"),
List => F.New_Statement
(F.New_Apply
(Prefix => F.New_Selected_Name
(+"PB_Support.IO.Unknown_Field"),
Arguments => F.New_List
(F.New_Argument_Association (F.New_Name (+"Stream")),
F.New_Argument_Association
(F.New_Selected_Name (+"Key.Encoding")))))));
Result := F.New_Subprogram_Body
(F.New_Subprogram_Specification
(Name => F.New_Name ("Read_" & My_Name),
Parameters => F.New_List
(F.New_Parameter
(Name => F.New_Name (+"Stream"),
Type_Definition => F.New_Selected_Name
(+"access Ada.Streams.Root_Stream_Type'Class")),
F.New_Parameter
(Name => F.New_Name (+"V"),
Type_Definition => F.New_Name (My_Name),
Is_Out => True))),
Declarations => Key,
Statements => F.New_Loop
(Condition => F.New_Apply
(Prefix => F.New_Selected_Name
(+"PB_Support.IO.Read_Key"),
Arguments => F.New_List
(F.New_Argument_Association
(F.New_Name (+"Stream")),
F.New_Argument_Association
(F.New_Name (+"Key'Access")))),
Statements => F.New_Case
(Expression => F.New_Selected_Name (+"Key.Field"),
List => Result)));
return Result;
end Read_Subprogram;
-----------------
-- Subprograms --
-----------------
function Subprograms
(Self : Google.Protobuf.Descriptor.Descriptor_Proto;
Pkg : League.Strings.Universal_String)
return Ada_Pretty.Node_Access
is
My_Name : constant League.Strings.Universal_String := Type_Name (Self);
Me : constant Ada_Pretty.Node_Access := F.New_Name (My_Name);
V_Name : Ada_Pretty.Node_Access;
P_Self : Ada_Pretty.Node_Access;
Free : Ada_Pretty.Node_Access;
Count : Ada_Pretty.Node_Access;
Clear : Ada_Pretty.Node_Access;
Append : Ada_Pretty.Node_Access;
Adjust : Ada_Pretty.Node_Access;
Final : Ada_Pretty.Node_Access;
Read : Ada_Pretty.Node_Access;
Write : Ada_Pretty.Node_Access;
Ref : Ada_Pretty.Node_Access;
Result : Ada_Pretty.Node_Access;
begin
V_Name := F.New_Name (My_Name & "_Vector");
P_Self := F.New_Name (+"Self");
Count := F.New_Subprogram_Body
(F.New_Subprogram_Specification
(Name => F.New_Name (+"Length"),
Parameters => F.New_Parameter
(Name => P_Self,
Type_Definition => V_Name),
Result => F.New_Name (+"Natural")),
Statements => F.New_Return
(F.New_Selected_Name (+"Self.Length")));
Clear := F.New_Subprogram_Body
(F.New_Subprogram_Specification
(Name => F.New_Name (+"Clear"),
Parameters => F.New_Parameter
(Name => P_Self,
Type_Definition => V_Name,
Is_In => True,
Is_Out => True)),
Statements => F.New_Assignment
(Left => F.New_Selected_Name (+"Self.Length"),
Right => F.New_Literal (0)));
Free := F.New_Statement
(F.New_Apply
(F.New_Name (+"procedure Free is new Ada.Unchecked_Deallocation"),
F.New_List
(F.New_Argument_Association
(F.New_Name (My_Name & "_Array")),
F.New_Argument_Association
(F.New_Name (My_Name & "_Array_Access")))));
Append := F.New_Subprogram_Body
(F.New_Subprogram_Specification
(Name => F.New_Name (+"Append"),
Parameters => F.New_List
(F.New_Parameter
(Name => P_Self,
Type_Definition => V_Name,
Is_In => True,
Is_Out => True),
F.New_Parameter
(F.New_Name (+"V"), Me))),
Declarations => F.New_Variable
(Name => F.New_Name (+"Init_Length"),
Type_Definition => F.New_Name (+"Positive"),
Is_Constant => True,
Initialization => F.New_Apply
(Prefix => F.New_Selected_Name (+"Positive'Max"),
Arguments => F.New_List
(F.New_Argument_Association (F.New_Literal (1)),
F.New_Argument_Association
(F.New_List
(F.New_Literal (256),
F.New_Infix
(+"/",
F.New_Selected_Name (My_Name & "'Size"))))))),
Statements => F.New_List
((F.New_If
(Condition => F.New_Selected_Name (+"Self.Length = 0"),
Then_Path => F.New_Assignment
(F.New_Selected_Name (+"Self.Data"),
F.New_Infix
(Operator => +"new",
Left => F.New_Apply
(F.New_Selected_Name (My_Name & "_Array"),
F.New_Selected_Name (+"1 .. Init_Length")))),
Elsif_List => F.New_Elsif
(Condition => F.New_List
(F.New_Selected_Name (+"Self.Length"),
F.New_Infix
(+"=",
F.New_Selected_Name (+"Self.Data'Last"))),
List => F.New_Assignment
(F.New_Selected_Name (+"Self.Data"),
F.New_Qualified_Expession
(F.New_Selected_Name ("new " & My_Name & "_Array"),
F.New_List
(F.New_Selected_Name (+"Self.Data.all"),
F.New_Infix
(+"&",
F.New_Qualified_Expession
(F.New_Selected_Name (My_Name & "_Array"),
F.New_Selected_Name
(+"1 .. Self.Length => <>"))
)))))),
F.New_Assignment
(F.New_Selected_Name (+"Self.Length"),
F.New_List
(F.New_Selected_Name (+"Self.Length"),
F.New_Infix (+"+", F.New_Literal (1)))),
F.New_Assignment
(F.New_Apply
(F.New_Selected_Name (+"Self.Data"),
F.New_Selected_Name (+"Self.Length")),
F.New_Name (+"V")))));
Adjust := F.New_Subprogram_Body
(F.New_Subprogram_Specification
(Is_Overriding => Ada_Pretty.True,
Name => F.New_Name (+"Adjust"),
Parameters => F.New_Parameter
(Name => F.New_Name (+"Self"),
Type_Definition => F.New_Name (Type_Name (Self) & "_Vector"),
Is_In => True,
Is_Out => True)),
Statements => F.New_If
(Condition => F.New_Name (+"Self.Length > 0"),
Then_Path => F.New_Assignment
(F.New_Selected_Name (+"Self.Data"),
F.New_Qualified_Expession
(F.New_Name ("new " & My_Name & "_Array"),
F.New_Apply
(F.New_Selected_Name (+"Self.Data"),
F.New_List
(F.New_Literal (1),
F.New_Infix
(+"..",
F.New_Selected_Name (+"Self.Length"))))))));
Final := F.New_Subprogram_Body
(F.New_Subprogram_Specification
(Is_Overriding => Ada_Pretty.True,
Name => F.New_Name (+"Finalize"),
Parameters => F.New_Parameter
(Name => F.New_Name (+"Self"),
Type_Definition => F.New_Name (Type_Name (Self) & "_Vector"),
Is_In => True,
Is_Out => True)),
Statements => F.New_If
(Condition => F.New_Name (+"Self.Data /= null"),
Then_Path => F.New_Statement
(F.New_Apply
(F.New_Name (+"Free"),
F.New_Selected_Name (+"Self.Data")))));
Read := Read_Subprogram (Self, Pkg, Compiler.Context.Fake);
Write := Write_Subprogram (Self, Pkg, Compiler.Context.Fake);
Ref := F.New_List
(Indexing_Body (Self, +"Variable", True),
Indexing_Body (Self, +"Constant", False));
Result := F.New_List
((Count, Clear, Free, Append, Adjust, Final, Ref, Read, Write));
for J in 1 .. Self.Nested_Type.Length loop
Result := F.New_List
(Result, Subprograms (Self.Nested_Type (J), Pkg));
end loop;
return Result;
end Subprograms;
---------------
-- Type_Name --
---------------
function Type_Name
(Self : Google.Protobuf.Descriptor.Descriptor_Proto)
return League.Strings.Universal_String is
begin
if Self.Name.Is_Set then
return Compiler.Context.To_Ada_Name (Self.Name.Value);
else
return +"Message";
end if;
end Type_Name;
-------------------------
-- Vector_Declarations --
-------------------------
function Vector_Declarations
(Self : Google.Protobuf.Descriptor.Descriptor_Proto)
return Ada_Pretty.Node_Access
is
My_Name : constant League.Strings.Universal_String := Type_Name (Self);
Result : Ada_Pretty.Node_Access;
Item : Ada_Pretty.Node_Access;
begin
Result := F.New_List
(Result,
F.New_Type
(Name => F.New_Name (My_Name & "_Vector"),
Definition => F.New_Private_Record
(Is_Tagged => True),
Aspects => F.New_List
(F.New_Argument_Association
(F.New_Name ("Get_" & My_Name & "_Variable_Reference"),
F.New_Name (+"Variable_Indexing")),
F.New_Argument_Association
(F.New_Name ("Get_" & My_Name & "_Constant_Reference"),
F.New_Name (+"Constant_Indexing")))));
for J in 1 .. Self.Nested_Type.Length loop
Item := Vector_Declarations (Self.Nested_Type (J));
Result := F.New_List (Result, Item);
end loop;
return Result;
end Vector_Declarations;
----------------------
-- Write_Subprogram --
----------------------
function Write_Subprogram
(Self : Google.Protobuf.Descriptor.Descriptor_Proto;
Pkg : League.Strings.Universal_String;
Fake : Compiler.Context.String_Sets.Set)
return Ada_Pretty.Node_Access
is
My_Name : constant League.Strings.Universal_String := Type_Name (Self);
Result : Ada_Pretty.Node_Access;
If_Stmt : Ada_Pretty.Node_Access;
Decl : Ada_Pretty.Node_Access;
Stream : constant Ada_Pretty.Node_Access :=
F.New_Selected_Name (+"PB_Support.Internal.Stream");
Stmts : Ada_Pretty.Node_Access;
begin
If_Stmt := F.New_If
(F.New_List
(F.New_Selected_Name (+"Stream.all"),
F.New_Infix
(+"not in",
F.New_Selected_Name (+"PB_Support.Internal.Stream"))),
F.New_Block
(Declarations => F.New_Variable
(Name => F.New_Name (+"WS"),
Type_Definition => F.New_Apply
(Stream,
F.New_Name (+"Stream")),
Is_Aliased => True),
Statements => F.New_List
(F.New_Statement
(F.New_Apply
(F.New_Name ("Write_" & My_Name),
F.New_List
(F.New_Argument_Association
(F.New_Name (+"WS'Access")),
F.New_Argument_Association
(F.New_Name (+"V"))))),
F.New_Return)));
Stmts := F.New_Statement (F.New_Selected_Name (+"WS.Start_Message"));
for J in 1 .. Self.Field.Length loop
if not Self.Field (J).Oneof_Index.Is_Set then
Stmts := F.New_List
(Stmts,
Compiler.Field_Descriptors.Write_Call
(Self.Field (J), Pkg, My_Name, Fake));
end if;
end loop;
for K in 1 .. Self.Oneof_Decl.Length loop
declare
Name : constant League.Strings.Universal_String :=
Compiler.Context.To_Ada_Name (Self.Oneof_Decl (K).Name.Value);
Cases : Ada_Pretty.Node_Access;
begin
for J in 1 .. Self.Field.Length loop
if Is_One_Of (Self.Field (J).Oneof_Index, K) then
Cases := F.New_List
(Cases,
Compiler.Field_Descriptors.Case_Path
(Self.Field (J), Pkg, My_Name, Fake));
end if;
end loop;
Cases := F.New_List
(Cases,
F.New_Case_Path
(F.New_Name (Name & "_Not_Set"),
F.New_Statement));
Stmts := F.New_List
(Stmts,
F.New_Case
(F.New_Selected_Name ("V.Variant." & Name),
Cases));
end;
end loop;
Stmts := F.New_List
(Stmts,
F.New_If
(F.New_Selected_Name (+"WS.End_Message"),
F.New_Statement
(F.New_Apply
(F.New_Name ("Write_" & My_Name),
F.New_List
(F.New_Argument_Association
(F.New_Name (+"WS'Access")),
F.New_Argument_Association
(F.New_Name (+"V")))))));
Decl := F.New_Block
(Declarations =>
F.New_Variable
(Name => F.New_Name (+"WS"),
Type_Definition => Stream,
Rename =>
F.New_Apply
(Stream,
F.New_Argument_Association
(F.New_Selected_Name (+"Stream.all")))),
Statements => Stmts);
Result := F.New_Subprogram_Body
(F.New_Subprogram_Specification
(Name => F.New_Name ("Write_" & My_Name),
Parameters => F.New_List
(F.New_Parameter
(Name => F.New_Name (+"Stream"),
Type_Definition => F.New_Selected_Name
(+"access Ada.Streams.Root_Stream_Type'Class")),
F.New_Parameter
(Name => F.New_Name (+"V"),
Type_Definition => F.New_Name (My_Name)))),
Statements => F.New_List (If_Stmt, Decl));
return Result;
end Write_Subprogram;
end Compiler.Descriptors;
|
-------------------------------------------------------------------------------
-- Copyright (c) 2019, Daniel King
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions are met:
-- * Redistributions of source code must retain the above copyright
-- notice, this list of conditions and the following disclaimer.
-- * Redistributions in binary form must reproduce the above copyright
-- notice, this list of conditions and the following disclaimer in the
-- documentation and/or other materials provided with the distribution.
-- * The name of the copyright holder may not be used to endorse or promote
-- Products derived from this software without specific prior written
-- permission.
--
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
-- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-------------------------------------------------------------------------------
with Keccak.Generic_Duplex;
with Keccak.Generic_Sponge;
pragma Elaborate_All (Keccak.Generic_Duplex);
pragma Elaborate_All (Keccak.Generic_Sponge);
-- @summary
-- Instantiation of Keccak-p[1600,14], with a Sponge and Duplex built on top of it.
package Keccak.Keccak_1600.Rounds_14
with SPARK_Mode => On
is
procedure Permute is new KeccakF_1600_Permutation.Permute
(Num_Rounds => 14);
package Sponge is new Keccak.Generic_Sponge
(State_Size_Bits => KeccakF_1600.State_Size_Bits,
State_Type => State,
Init_State => KeccakF_1600.Init,
Permute => Permute,
XOR_Bits_Into_State => KeccakF_1600_Lanes.XOR_Bits_Into_State,
Extract_Data => KeccakF_1600_Lanes.Extract_Bytes,
Pad => Keccak.Padding.Pad101_Multi_Blocks);
package Duplex is new Keccak.Generic_Duplex
(State_Size_Bits => KeccakF_1600.State_Size_Bits,
State_Type => State,
Init_State => KeccakF_1600.Init,
Permute => Permute,
XOR_Bits_Into_State => KeccakF_1600_Lanes.XOR_Bits_Into_State,
Extract_Bits => KeccakF_1600_Lanes.Extract_Bits,
Pad => Keccak.Padding.Pad101_Single_Block,
Min_Padding_Bits => Keccak.Padding.Pad101_Min_Bits);
end Keccak.Keccak_1600.Rounds_14;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . I N T E R R U P T _ M A N A G E M E N T --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2020, 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 Solaris version of this package
-- Make a careful study of all signals available under the OS, to see which
-- need to be reserved, kept always unmasked, or kept always unmasked.
-- Be on the lookout for special signals that may be used by the thread
-- library.
package body System.Interrupt_Management is
use Interfaces.C;
use System.OS_Interface;
type Interrupt_List is array (Interrupt_ID range <>) of Interrupt_ID;
Exception_Interrupts : constant Interrupt_List :=
(SIGFPE, SIGILL, SIGSEGV, SIGBUS);
Unreserve_All_Interrupts : Interfaces.C.int;
pragma Import
(C, Unreserve_All_Interrupts, "__gl_unreserve_all_interrupts");
function State (Int : Interrupt_ID) return Character;
pragma Import (C, State, "__gnat_get_interrupt_state");
-- Get interrupt state. Defined in init.c
-- The input argument is the interrupt number,
-- and the result is one of the following:
User : constant Character := 'u';
Runtime : constant Character := 'r';
Default : constant Character := 's';
-- 'n' this interrupt not set by any Interrupt_State pragma
-- 'u' Interrupt_State pragma set state to User
-- 'r' Interrupt_State pragma set state to Runtime
-- 's' Interrupt_State pragma set state to System (use "default"
-- system handler)
----------------------
-- Notify_Exception --
----------------------
-- This function identifies the Ada exception to be raised using the
-- information when the system received a synchronous signal. Since this
-- function is machine and OS dependent, different code has to be provided
-- for different target.
procedure Notify_Exception
(signo : Signal;
info : access siginfo_t;
context : access ucontext_t);
----------------------
-- Notify_Exception --
----------------------
procedure Notify_Exception
(signo : Signal;
info : access siginfo_t;
context : access ucontext_t)
is
pragma Unreferenced (info);
begin
-- Perform the necessary context adjustments prior to a raise from a
-- signal handler.
Adjust_Context_For_Raise (signo, context.all'Address);
-- Check that treatment of exception propagation here is consistent with
-- treatment of the abort signal in System.Task_Primitives.Operations.
case signo is
when SIGFPE => raise Constraint_Error;
when SIGILL => raise Program_Error;
when SIGSEGV => raise Storage_Error;
when SIGBUS => raise Storage_Error;
when others => null;
end case;
end Notify_Exception;
----------------
-- Initialize --
----------------
Initialized : Boolean := False;
procedure Initialize is
act : aliased struct_sigaction;
old_act : aliased struct_sigaction;
mask : aliased sigset_t;
Result : Interfaces.C.int;
begin
if Initialized then
return;
end if;
Initialized := True;
-- Need to call pthread_init very early because it is doing signal
-- initializations.
pthread_init;
-- Change this if you want to use another signal for task abort.
-- SIGTERM might be a good one.
Abort_Task_Interrupt := SIGABRT;
act.sa_handler := Notify_Exception'Address;
-- Set sa_flags to SA_NODEFER so that during the handler execution
-- we do not change the Signal_Mask to be masked for the Signal.
-- This is a temporary fix to the problem that the Signal_Mask is
-- not restored after the exception (longjmp) from the handler.
-- The right fix should be made in sigsetjmp so that we save
-- the Signal_Set and restore it after a longjmp.
-- In that case, this field should be changed back to 0. ??? (Dong-Ik)
act.sa_flags := 16;
Result := sigemptyset (mask'Access);
pragma Assert (Result = 0);
-- ??? For the same reason explained above, we can't mask these signals
-- because otherwise we won't be able to catch more than one signal.
act.sa_mask := mask;
pragma Assert (Keep_Unmasked = (Interrupt_ID'Range => False));
pragma Assert (Reserve = (Interrupt_ID'Range => False));
for J in Exception_Interrupts'Range loop
if State (Exception_Interrupts (J)) /= User then
Keep_Unmasked (Exception_Interrupts (J)) := True;
Reserve (Exception_Interrupts (J)) := True;
if State (Exception_Interrupts (J)) /= Default then
Result :=
sigaction
(Signal (Exception_Interrupts (J)), act'Unchecked_Access,
old_act'Unchecked_Access);
pragma Assert (Result = 0);
end if;
end if;
end loop;
if State (Abort_Task_Interrupt) /= User then
Keep_Unmasked (Abort_Task_Interrupt) := True;
Reserve (Abort_Task_Interrupt) := True;
end if;
-- Set SIGINT to unmasked state as long as it's
-- not in "User" state. Check for Unreserve_All_Interrupts last
if State (SIGINT) /= User then
Keep_Unmasked (SIGINT) := True;
Reserve (SIGINT) := True;
end if;
-- Check all signals for state that requires keeping them
-- unmasked and reserved
for J in Interrupt_ID'Range loop
if State (J) = Default or else State (J) = Runtime then
Keep_Unmasked (J) := True;
Reserve (J) := True;
end if;
end loop;
-- Add the set of signals that must always be unmasked for this target
for J in Unmasked'Range loop
Keep_Unmasked (Interrupt_ID (Unmasked (J))) := True;
Reserve (Interrupt_ID (Unmasked (J))) := True;
end loop;
-- Add target-specific reserved signals
for J in Reserved'Range loop
Reserve (Interrupt_ID (Reserved (J))) := True;
end loop;
-- Process pragma Unreserve_All_Interrupts. This overrides any
-- settings due to pragma Interrupt_State:
if Unreserve_All_Interrupts /= 0 then
Keep_Unmasked (SIGINT) := False;
Reserve (SIGINT) := False;
end if;
-- We do not have Signal 0 in reality. We just use this value to
-- identify not existing signals (see s-intnam.ads). Therefore, Signal 0
-- should not be used in all signal related operations hence mark it as
-- reserved.
Reserve (0) := True;
end Initialize;
end System.Interrupt_Management;
|
--------------------------------------------------------------------------------
-- MIT License
--
-- Copyright (c) 2020 Zane Myers
--
-- 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 Vulkan.Math.Integers;
with Vulkan.Math.Common;
with Vulkan.Math.GenFType;
with Ada.Unchecked_Conversion;
use Vulkan.Math.Integers;
use Vulkan.Math.Common;
use Vulkan.Math.GenFType;
package body Vulkan.Math.Packing is
-- A short value.
type Half_Float_Unused_Bits is mod 2 ** 16;
-- A sign bit.
type Sign_Bit is mod 2 ** 1;
-- Single float exponent MSB bits
type Single_Float_Exponent_Msb is mod 2 ** 3;
-- Single float exponent LSB bits
type Single_Float_Exponent_Lsb is mod 2 ** 5;
-- Single float mantissa MSB bits
type Single_Float_Mantissa_Msb is mod 2 ** 10;
-- Single float mantissa LSB bits
type Single_Float_Mantissa_Lsb is mod 2 ** 13;
-- The layout of a single-precision floating point number.
type Single_Float_Bits is record
sign : Sign_Bit;
exponent_msb : Single_Float_Exponent_Msb;
exponent_lsb : Single_Float_Exponent_Lsb;
mantissa_msb : Single_Float_Mantissa_Msb;
mantissa_lsb : Single_Float_Mantissa_Lsb;
end record;
-- The bit positions to use for each field of the record.
for Single_Float_Bits use record
sign at 0 range 31 .. 31;
exponent_msb at 0 range 28 .. 30;
exponent_lsb at 0 range 23 .. 27;
mantissa_msb at 0 range 13 .. 22;
mantissa_lsb at 0 range 0 .. 12;
end record;
-- The size of a single precision float.
for Single_Float_Bits'Size use 32;
-- The layout of a half-precision floating point number.
type Vkm_Half_Float_Bits is record
unused : Half_Float_Unused_Bits;
sign : Sign_Bit;
exponent : Single_Float_Exponent_Lsb;
mantissa : Single_Float_Mantissa_Msb;
end record;
-- The bit positions to use for each field of the record.
for Vkm_Half_Float_Bits use record
unused at 0 range 16 .. 31;
sign at 0 range 15 .. 15;
exponent at 0 range 10 .. 14;
mantissa at 0 range 0 .. 9;
end record;
-- The size of a half-precision float.
for Vkm_Half_Float_Bits'Size use 32;
-- The layout of a packed double-precision floating point number.
type Vkm_Double_Float_Bits is record
msb : Vkm_Uint;
lsb : Vkm_Uint;
end record;
-- The bit positions to use for each field of the record.
for Vkm_Double_Float_Bits use record
msb at 0 range 32 .. 63;
lsb at 0 range 0 .. 31;
end record;
-- The size of a double-precision float.
for Vkm_Double_Float_Bits'Size use 64;
----------------------------------------------------------------------------
-- Unchecked Conversion Operations
----------------------------------------------------------------------------
-- Unchecked conversion from 32-bit float to Single Float Bits.
function Convert_Vkm_Float_To_Single_Float_Bits is new
Ada.Unchecked_Conversion(Source => Vkm_Float, Target => Single_Float_Bits);
-- Unchecked conversion to 32-bit float from Single Float Bits.
function Convert_Single_Float_Bits_To_Vkm_Float is new
Ada.Unchecked_Conversion(Source => Single_Float_Bits, Target => Vkm_Float);
-- Unchecked conversion from Half_Float_Bits to unsigned integer.
function Convert_Vkm_Half_Float_Bits_To_Vkm_Uint is new
Ada.Unchecked_Conversion(Source => Vkm_Half_Float_Bits, Target => Vkm_Uint);
-- Unchecked conversion from unsigned integer to Vkm_Half_Float_Bits.
function Convert_Vkm_Uint_To_Half_Float_Bits is new
Ada.Unchecked_Conversion(Source => Vkm_Uint, Target => Vkm_Half_Float_Bits);
-- Unchecked conversion from Vkm_Double_Float_Bits to Vkm_Double.
function Convert_Vkm_Double_Float_Bits_To_Vkm_Double is new
Ada.Unchecked_Conversion(Source => Vkm_Double_Float_Bits, Target => Vkm_Double);
-- Unchecked conversion from Vkm_Double_Float_Bits to Vkm_Double.
function Convert_Vkm_Double_To_Vkm_Double_Float_Bits is new
Ada.Unchecked_Conversion(Source => Vkm_Double, Target => Vkm_Double_Float_Bits);
----------------------------------------------------------------------------
-- Local Operation Declarations
----------------------------------------------------------------------------
-- @summary
-- Convert a single-precision floating point number to a half-precision
-- floating point number.
--
-- @description
-- Convert a single-precision floating point number to a half-precision
-- floating point number.
--
-- @param value
-- The Vkm_Float to convert to bits for a half-precision floating point number.
--
-- @return
-- The bits for a half-precision floating point number.
----------------------------------------------------------------------------
function Convert_Single_To_Half(
value : in Vkm_Float) return Vkm_Uint;
----------------------------------------------------------------------------
-- @summary
-- Convert a half-precision floating point number to a single-precision
-- floating point number.
--
-- @description
-- Convert a half-precision floating point number to a single-precision
-- floating point number.
--
-- @param value
-- The bits for a half-precision floating point number to convert to a
-- single-precision floating point number.
--
-- @return
-- The bits for a half-precision floating point number.
----------------------------------------------------------------------------
function Convert_Half_To_Single(
value : in Vkm_Uint) return Vkm_Float;
----------------------------------------------------------------------------
-- Operations
----------------------------------------------------------------------------
function Pack_Unsigned_Normalized_2x16(
vector : in Vkm_Vec2) return Vkm_Uint is
converted : constant Vkm_Vec2 := Round(Clamp(vector, 0.0, 1.0) * 65535.0);
packed : Vkm_Uint := 0;
begin
packed := Bitfield_Insert(packed, To_Vkm_Uint(converted.x), 0, 16);
packed := Bitfield_Insert(packed, To_Vkm_Uint(converted.y), 16, 16);
return packed;
end Pack_Unsigned_Normalized_2x16;
----------------------------------------------------------------------------
function Pack_Signed_Normalized_2x16(
vector : in Vkm_Vec2) return Vkm_Uint is
converted : constant Vkm_Vec2 := Round(Clamp(vector, -1.0, 1.0) * 32767.0);
packed : Vkm_Int := 0;
begin
packed := Bitfield_Insert(packed, To_Vkm_Int(converted.x), 0, 16);
packed := Bitfield_Insert(packed, To_Vkm_Int(converted.y), 16, 16);
return To_Vkm_Uint(packed);
end Pack_Signed_Normalized_2x16;
----------------------------------------------------------------------------
function Pack_Unsigned_Normalized_4x8(
vector : in Vkm_Vec4) return Vkm_Uint is
converted : constant Vkm_Vec4 := Round(Clamp(vector, 0.0, 1.0) * 255.0);
packed : Vkm_Uint := 0;
begin
packed := Bitfield_Insert(packed, To_Vkm_Uint(converted.x), 0, 8);
packed := Bitfield_Insert(packed, To_Vkm_Uint(converted.y), 8, 8);
packed := Bitfield_Insert(packed, To_Vkm_Uint(converted.z), 16, 8);
packed := Bitfield_Insert(packed, To_Vkm_Uint(converted.w), 24, 8);
return packed;
end Pack_Unsigned_Normalized_4x8;
----------------------------------------------------------------------------
function Pack_Signed_Normalized_4x8(
vector : in Vkm_Vec4) return Vkm_Uint is
converted : constant Vkm_Vec4 := Round(Clamp(vector, -1.0, 1.0) * 127.0);
packed : Vkm_Int := 0;
begin
packed := Bitfield_Insert(packed, To_Vkm_Int(converted.x), 0, 8);
packed := Bitfield_Insert(packed, To_Vkm_Int(converted.y), 8, 8);
packed := Bitfield_Insert(packed, To_Vkm_Int(converted.z), 16, 8);
packed := Bitfield_Insert(packed, To_Vkm_Int(converted.w), 24, 8);
return To_Vkm_Uint(packed);
end Pack_Signed_Normalized_4x8;
----------------------------------------------------------------------------
function Unpack_Unsigned_Normalized_2x16(
packed : in Vkm_Uint) return Vkm_Vec2 is
unpacked : Vkm_Vec2 := Make_Vec2;
begin
unpacked.x(To_Vkm_Float(Bitfield_Extract(packed, 0, 16)));
unpacked.y(To_Vkm_Float(Bitfield_Extract(packed, 16, 16)));
return unpacked / 65535.0;
end Unpack_Unsigned_Normalized_2x16;
----------------------------------------------------------------------------
function Unpack_Signed_Normalized_2x16(
packed : in Vkm_Uint) return Vkm_Vec2 is
unpacked : Vkm_Vec2 := Make_Vec2;
begin
unpacked.x(To_Vkm_Float(Bitfield_Extract(To_Vkm_Int(packed), 0, 16)));
unpacked.y(To_Vkm_Float(Bitfield_Extract(To_Vkm_Int(packed), 16, 16)));
return Clamp(unpacked / 32767.0, -1.0, 1.0);
end Unpack_Signed_Normalized_2x16;
----------------------------------------------------------------------------
function Unpack_Unsigned_Normalized_4x8(
packed : in Vkm_Uint) return Vkm_Vec4 is
unpacked : Vkm_Vec4 := Make_Vec4;
begin
unpacked.x(To_Vkm_Float(Bitfield_Extract(packed, 0, 8)));
unpacked.y(To_Vkm_Float(Bitfield_Extract(packed, 8, 8)));
unpacked.z(To_Vkm_Float(Bitfield_Extract(packed, 16, 8)));
unpacked.w(To_Vkm_Float(Bitfield_Extract(packed, 24, 8)));
return unpacked / 255.0;
end Unpack_Unsigned_Normalized_4x8;
----------------------------------------------------------------------------
function Unpack_Signed_Normalized_4x8(
packed : in Vkm_Uint) return Vkm_Vec4 is
unpacked : Vkm_Vec4 := Make_Vec4;
begin
unpacked.x(To_Vkm_Float(Bitfield_Extract(To_Vkm_Int(packed), 0, 8)))
.y(To_Vkm_Float(Bitfield_Extract(To_Vkm_Int(packed), 8, 8)))
.z(To_Vkm_Float(Bitfield_Extract(To_Vkm_Int(packed), 16, 8)))
.w(To_Vkm_Float(Bitfield_Extract(To_Vkm_Int(packed), 24, 8)));
return Clamp( unpacked / 127.0, -1.0, 1.0);
end Unpack_Signed_Normalized_4x8;
----------------------------------------------------------------------------
function Pack_Half_2x16(
vector : in Vkm_Vec2) return Vkm_Uint is
packed : Vkm_Uint := 0;
begin
packed := Bitfield_Insert(packed, Convert_Single_To_Half(vector.x), 0, 16);
packed := Bitfield_Insert(packed, Convert_Single_To_Half(vector.y), 16, 16);
return packed;
end Pack_Half_2x16;
----------------------------------------------------------------------------
function Unpack_Half_2x16(
packed : in Vkm_Uint) return Vkm_Vec2 is
unpacked : Vkm_Vec2 := Make_Vec2;
begin
unpacked.x(Convert_Half_To_Single(Bitfield_Extract(packed, 0, 16)))
.y(Convert_Half_To_Single(Bitfield_Extract(packed, 16, 16)));
return unpacked;
end Unpack_Half_2x16;
----------------------------------------------------------------------------
function Pack_Double_2x32(
vector : in Vkm_Uvec2) return Vkm_Double is
double_float_bits : constant Vkm_Double_Float_Bits :=
(lsb => vector.x,
msb => vector.y);
begin
return Convert_Vkm_Double_Float_Bits_To_Vkm_Double(double_float_bits);
end Pack_Double_2x32;
----------------------------------------------------------------------------
function Unpack_Double_2x32(
packed : in Vkm_Double) return Vkm_Uvec2 is
double_float_bits : constant Vkm_Double_Float_Bits :=
Convert_Vkm_Double_To_Vkm_Double_Float_Bits(packed);
unpacked : Vkm_Uvec2 := Make_Uvec2;
begin
unpacked.x(double_float_bits.lsb)
.y(double_float_bits.msb);
return unpacked;
end Unpack_Double_2x32;
----------------------------------------------------------------------------
-- Local Operation Definitions
----------------------------------------------------------------------------
function Convert_Single_To_Half(
value : in Vkm_Float) return Vkm_Uint is
float_bits : constant Single_Float_Bits :=
Convert_Vkm_Float_To_Single_Float_Bits(value);
half_float_bits : constant Vkm_Half_Float_Bits :=
(unused => 0,
sign => float_bits.sign,
exponent => float_bits.exponent_lsb,
mantissa => float_bits.mantissa_msb);
begin
return Convert_Vkm_Half_Float_Bits_To_Vkm_Uint(half_float_bits);
end Convert_Single_To_Half;
----------------------------------------------------------------------------
function Convert_Half_To_Single(
value : in Vkm_Uint) return Vkm_Float is
half_float_bits : constant Vkm_Half_Float_Bits :=
Convert_Vkm_Uint_To_Half_Float_Bits(value);
float_bits : constant Single_Float_Bits :=
(sign => half_float_bits.sign,
exponent_msb => 0,
exponent_lsb => half_float_bits.exponent,
mantissa_msb => half_float_bits.mantissa,
mantissa_lsb => 0);
begin
return Convert_Single_Float_Bits_To_Vkm_Float(float_bits);
end Convert_Half_To_Single;
end Vulkan.Math.Packing;
|
-- Warning: This file is automatically generated by AFLEX.
-- It is useless to modify it. Change the ".Y" & ".L" files instead.
package body CSS.Parser.Lexer_io is
-- gets input and stuffs it into 'buf'. number of characters read, or YY_NULL,
-- is returned in 'result'.
procedure YY_INPUT (buf : out unbounded_character_array;
result : out Integer;
max_size : in Integer) is
c : Character;
i : Integer := 1;
loc : Integer := buf'First;
begin
if Text_IO.Is_Open (user_input_file) then
while i <= max_size loop
-- Ada ate our newline, put it back on the end.
if Text_IO.End_Of_Line (user_input_file) then
buf (loc) := ASCII.LF;
Text_IO.Skip_Line (user_input_file, 1);
else
-- UCI CODES CHANGED:
-- The following codes are modified. Previous codes is commented out.
-- The purpose of doing this is to make it possible to set Temp_Line
-- in Ayacc-extension specific codes. Definitely, we can read the character
-- into the Temp_Line and then set the buf. But Temp_Line will only
-- be used in Ayacc-extension specific codes which makes
-- this approach impossible.
Text_IO.Get (user_input_file, c);
buf (loc) := c;
-- Text_IO.Get (user_input_file, buf (loc));
end if;
loc := loc + 1;
i := i + 1;
end loop;
else
while i <= max_size loop
if Text_IO.End_Of_Line then -- Ada ate our newline, put it back on the end.
buf (loc) := ASCII.LF;
Text_IO.Skip_Line (1);
else
-- The following codes are modified. Previous codes is commented out.
-- The purpose of doing this is to make it possible to set Temp_Line
-- in Ayacc-extension specific codes. Definitely, we can read the character
-- into the Temp_Line and then set the buf. But Temp_Line will only
-- be used in Ayacc-extension specific codes which makes this approach impossible.
Text_IO.Get (c);
buf (loc) := c;
-- get (buf (loc));
end if;
loc := loc + 1;
i := i + 1;
end loop;
end if; -- for input file being standard input
result := i - 1;
exception
when Text_IO.End_Error =>
result := i - 1;
-- when we hit EOF we need to set yy_eof_has_been_seen
yy_eof_has_been_seen := True;
end YY_INPUT;
-- yy_get_next_buffer - try to read in new buffer
--
-- returns a code representing an action
-- EOB_ACT_LAST_MATCH -
-- EOB_ACT_RESTART_SCAN - restart the scanner
-- EOB_ACT_END_OF_FILE - end of file
function yy_get_next_buffer return eob_action_type is
dest : Integer := 0;
source : Integer := yytext_ptr - 1; -- copy prev. char, too
number_to_move : Integer;
ret_val : eob_action_type;
num_to_read : Integer;
begin
if yy_c_buf_p > yy_n_chars + 1 then
raise NULL_IN_INPUT;
end if;
-- try to read more data
-- first move last chars to start of buffer
number_to_move := yy_c_buf_p - yytext_ptr;
for i in 0 .. number_to_move - 1 loop
yy_ch_buf (dest) := yy_ch_buf (source);
dest := dest + 1;
source := source + 1;
end loop;
if yy_eof_has_been_seen then
-- don't do the read, it's not guaranteed to return an EOF,
-- just force an EOF
yy_n_chars := 0;
else
num_to_read := YY_BUF_SIZE - number_to_move - 1;
if num_to_read > YY_READ_BUF_SIZE then
num_to_read := YY_READ_BUF_SIZE;
end if;
-- read in more data
YY_INPUT (yy_ch_buf (number_to_move .. yy_ch_buf'Last), yy_n_chars, num_to_read);
end if;
if yy_n_chars = 0 then
if number_to_move = 1 then
ret_val := EOB_ACT_END_OF_FILE;
else
ret_val := EOB_ACT_LAST_MATCH;
end if;
yy_eof_has_been_seen := True;
else
ret_val := EOB_ACT_RESTART_SCAN;
end if;
yy_n_chars := yy_n_chars + number_to_move;
yy_ch_buf (yy_n_chars) := YY_END_OF_BUFFER_CHAR;
yy_ch_buf (yy_n_chars + 1) := YY_END_OF_BUFFER_CHAR;
-- yytext begins at the second character in
-- yy_ch_buf; the first character is the one which
-- preceded it before reading in the latest buffer;
-- it needs to be kept around in case it's a
-- newline, so yy_get_previous_state() will have
-- with '^' rules active
yytext_ptr := 1;
return ret_val;
end yy_get_next_buffer;
procedure yyUnput (c : Character; yy_bp : in out Integer) is
number_to_move : Integer;
dest : Integer;
source : Integer;
tmp_yy_cp : Integer;
begin
tmp_yy_cp := yy_c_buf_p;
yy_ch_buf (tmp_yy_cp) := yy_hold_char; -- undo effects of setting up yytext
if tmp_yy_cp < 2 then
-- need to shift things up to make room
number_to_move := yy_n_chars + 2; -- +2 for EOB chars
dest := YY_BUF_SIZE + 2;
source := number_to_move;
while source > 0 loop
dest := dest - 1;
source := source - 1;
yy_ch_buf (dest) := yy_ch_buf (source);
end loop;
tmp_yy_cp := tmp_yy_cp + dest - source;
yy_bp := yy_bp + dest - source;
yy_n_chars := YY_BUF_SIZE;
if tmp_yy_cp < 2 then
raise PUSHBACK_OVERFLOW;
end if;
end if;
if tmp_yy_cp > yy_bp and then yy_ch_buf (tmp_yy_cp - 1) = ASCII.LF then
yy_ch_buf (tmp_yy_cp - 2) := ASCII.LF;
end if;
tmp_yy_cp := tmp_yy_cp - 1;
yy_ch_buf (tmp_yy_cp) := c;
-- Note: this code is the text of YY_DO_BEFORE_ACTION, only
-- here we get different yy_cp and yy_bp's
yytext_ptr := yy_bp;
yy_hold_char := yy_ch_buf (tmp_yy_cp);
yy_ch_buf (tmp_yy_cp) := ASCII.NUL;
yy_c_buf_p := tmp_yy_cp;
end yyUnput;
procedure Unput (c : Character) is
begin
yyUnput (c, yy_bp);
end Unput;
function Input return Character is
c : Character;
begin
yy_ch_buf (yy_c_buf_p) := yy_hold_char;
if yy_ch_buf (yy_c_buf_p) = YY_END_OF_BUFFER_CHAR then
-- need more input
yytext_ptr := yy_c_buf_p;
yy_c_buf_p := yy_c_buf_p + 1;
case yy_get_next_buffer is
-- this code, unfortunately, is somewhat redundant with
-- that above
when EOB_ACT_END_OF_FILE =>
if yyWrap then
yy_c_buf_p := yytext_ptr;
return ASCII.NUL;
end if;
yy_ch_buf (0) := ASCII.LF;
yy_n_chars := 1;
yy_ch_buf (yy_n_chars) := YY_END_OF_BUFFER_CHAR;
yy_ch_buf (yy_n_chars + 1) := YY_END_OF_BUFFER_CHAR;
yy_eof_has_been_seen := False;
yy_c_buf_p := 1;
yytext_ptr := yy_c_buf_p;
yy_hold_char := yy_ch_buf (yy_c_buf_p);
return Input;
when EOB_ACT_RESTART_SCAN =>
yy_c_buf_p := yytext_ptr;
when EOB_ACT_LAST_MATCH =>
raise UNEXPECTED_LAST_MATCH;
end case;
end if;
c := yy_ch_buf (yy_c_buf_p);
yy_c_buf_p := yy_c_buf_p + 1;
yy_hold_char := yy_ch_buf (yy_c_buf_p);
return c;
end Input;
procedure Output (c : Character) is
begin
if Is_Open (user_output_file) then
Text_IO.Put (user_output_file, c);
else
Text_IO.Put (c);
end if;
end Output;
procedure Output_New_Line is
begin
if Is_Open (user_output_file) then
Text_IO.New_Line (user_output_file);
else
Text_IO.New_Line;
end if;
end Output_New_Line;
function Output_Column return Text_IO.Count is
begin
if Is_Open (user_output_file) then
return Text_IO.Col (user_output_file);
else
return Text_IO.Col;
end if;
end Output_Column;
function Input_Line return Text_IO.Count is
l : Text_IO.Count := 1;
begin
return l; -- from file, always 1
-- if is_open(user_input_file) then
-- return Text_IO.Line(user_input_file);
-- else
-- return Text_IO.Line;
-- end if;
end Input_Line;
-- default yywrap function - always treat EOF as an EOF
function yyWrap return Boolean is
begin
return True;
end yyWrap;
procedure Open_Input (fname : in String) is
begin
yy_init := True;
Open (user_input_file, Text_IO.In_File, fname);
end Open_Input;
procedure Create_Output (fname : in String := "") is
begin
if fname /= "" then
Create (user_output_file, Text_IO.Out_File, fname);
end if;
end Create_Output;
procedure Close_Input is
begin
if Is_Open (user_input_file) then
Text_IO.Close (user_input_file);
end if;
end Close_Input;
procedure Close_Output is
begin
if Is_Open (user_output_file) then
Text_IO.Close (user_output_file);
end if;
end Close_Output;
end CSS.Parser.Lexer_io;
|
----------------Main programm------------------------
--Parallel and distributed computing.
--Labwork 1. Ada. Subprograms and packages
--Khilchenko Yehor
--IP-74
--02.10.2019
--Func1: d = A*((B+C)*(MA*ME));
--Func2: h = MAX(MF + MG*(MH*ML));
--Func3: s = MIN(A*TRANS(MB*MM) + B*SORT(C));
with Data, Text_IO, Ada.Integer_Text_IO, System.Multiprocessors;
use Text_IO, Ada.Integer_Text_IO, System.Multiprocessors;
procedure Main_Lab1 is
n: Integer := 5 ;
package data1 is new data (n);
use data1;
CPU0: CPU_Range :=0;
CPU1: CPU_Range :=1;
CPU2: CPU_Range :=2;
f1, f2, f3:Integer;
procedure tasks is
task T1 is
pragma Priority(1);
pragma CPU(CPU0);
end;
task body T1 is
A, B, C: Vector;
MA, ME: Matrix;
begin
Put_Line("T1 started");
Vector_Filling_Ones(A);
Vector_Filling_Ones(B);
Vector_Filling_Ones(C);
Matrix_Filling_Ones(MA);
Matrix_Filling_Ones(ME);
f1:=Func1(A, B, C, MA, ME);
--delay(1.0);
end T1;
task T2 is
pragma Priority(1);
pragma CPU(CPU1);
end;
task body T2 is
MF, MG, MH, ML: Matrix;
begin
Put_Line("T2 started");
Matrix_Filling_Ones(MF);
Matrix_Filling_Ones(MG);
Matrix_Filling_Ones(MH);
Matrix_Filling_Ones(ML);
f2:=Func2(MF, MG, MH, ML);
--delay(1.0);
end T2;
task T3 is
pragma Priority(1);
pragma CPU(CPU2);
end;
task body T3 is
MB, MM : Matrix;
A, B, C: Vector;
begin
Put_Line("T3 started");
Vector_Filling_Ones(A);
Vector_Filling_Ones(B);
Vector_Filling_Ones(C);
Matrix_Filling_Ones(MB);
Matrix_Filling_Ones(MM);
f3:=Func3(A, B, C, MB, MM);
--delay(1.0);
end T3;
begin
null;
end tasks;
Begin
tasks;
Put_Line("Func1: d = A*((B+C)*(MA*ME))");
Put(f1);
New_Line;
New_Line;
Put_Line("T1 finished");
Put_Line("Func2: h = MAX(MF + MG*(MH*ML))");
Put(f2);
New_Line;
New_Line;
Put_Line("T2 finished");
Put_Line("Func3: s = MIN(A*TRANS(MB*MM) + B*SORT(C))");
Put(f3);
New_Line;
New_Line;
Put_Line("T3 finished");
End Main_Lab1;
|
------------------------------------------------------------------------------
-- --
-- Copyright (C) 2015-2020, AdaCore --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- 2. 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. --
-- 3. Neither the name of STMicroelectronics nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
-- --
-- This file is based on: --
-- --
-- @file stm32f4xx_hal_cortex.h --
-- @author MCD Application Team --
-- @version V1.1.0 --
-- @date 19-June-2014 --
-- @brief Header file of CORTEX HAL module. --
-- --
-- COPYRIGHT(c) 2014 STMicroelectronics --
------------------------------------------------------------------------------
-- This file provides Nested Vector interrupt Controller definitions for the
-- ARM Cortex M0 microcontrollers from ST Microelectronics.
with HAL; use HAL;
package Cortex_M.NVIC is -- the Nested Vectored Interrupt Controller
NVIC_PRIO_BITS : constant := 2;
-- All Cortex M0 parts have 2 bit priority mask
type Interrupt_ID is new Natural range 0 .. 31;
type Interrupt_Priority is new UInt8 range 0 .. (2**NVIC_PRIO_BITS - 1);
procedure Set_Priority
(IRQn : Interrupt_ID;
Priority : Interrupt_Priority) with Inline;
procedure Enable_Interrupt (IRQn : Interrupt_ID) with Inline;
procedure Disable_Interrupt (IRQn : Interrupt_ID) with Inline;
function Enabled (IRQn : Interrupt_ID) return Boolean with Inline;
function Pending (IRQn : Interrupt_ID) return Boolean with Inline;
procedure Set_Pending (IRQn : Interrupt_ID) with Inline;
procedure Clear_Pending (IRQn : Interrupt_ID) with Inline;
end Cortex_M.NVIC;
|
-- Copyright 2011-2017 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
Last_Word : Word := 0;
procedure Call_Me (W : Word) is
begin
Last_Word := W;
end Call_Me;
end Pck;
|
pragma Style_Checks (Off);
-- This spec has been automatically generated from STM32G474xx.svd
pragma Restrictions (No_Elaboration_Code);
with HAL;
with System;
package STM32_SVD.CRS is
pragma Preelaborate;
---------------
-- Registers --
---------------
subtype CR_TRIM_Field is HAL.UInt7;
-- CRS control register
type CR_Register is record
-- SYNC event OK interrupt enable
SYNCOKIE : Boolean := False;
-- SYNC warning interrupt enable
SYNCWARNIE : Boolean := False;
-- Synchronization or trimming error interrupt enable
ERRIE : Boolean := False;
-- Expected SYNC interrupt enable
ESYNCIE : Boolean := False;
-- unspecified
Reserved_4_4 : HAL.Bit := 16#0#;
-- Frequency error counter enable This bit enables the oscillator clock
-- for the frequency error counter. When this bit is set, the CRS_CFGR
-- register is write-protected and cannot be modified.
CEN : Boolean := False;
-- Automatic trimming enable This bit enables the automatic hardware
-- adjustment of TRIM bits according to the measured frequency error
-- between two SYNC events. If this bit is set, the TRIM bits are
-- read-only. The TRIM value can be adjusted by hardware by one or two
-- steps at a time, depending on the measured frequency error value.
-- Refer to Section7.3.4: Frequency error evaluation and automatic
-- trimming for more details.
AUTOTRIMEN : Boolean := False;
-- Generate software SYNC event This bit is set by software in order to
-- generate a software SYNC event. It is automatically cleared by
-- hardware.
SWSYNC : Boolean := False;
-- HSI48 oscillator smooth trimming These bits provide a
-- user-programmable trimming value to the HSI48 oscillator. They can be
-- programmed to adjust to variations in voltage and temperature that
-- influence the frequency of the HSI48. The default value is 32, which
-- corresponds to the middle of the trimming interval. The trimming step
-- is around 67 kHz between two consecutive TRIM steps. A higher TRIM
-- value corresponds to a higher output frequency. When the AUTOTRIMEN
-- bit is set, this field is controlled by hardware and is read-only.
TRIM : CR_TRIM_Field := 16#40#;
-- unspecified
Reserved_15_31 : HAL.UInt17 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CR_Register use record
SYNCOKIE at 0 range 0 .. 0;
SYNCWARNIE at 0 range 1 .. 1;
ERRIE at 0 range 2 .. 2;
ESYNCIE at 0 range 3 .. 3;
Reserved_4_4 at 0 range 4 .. 4;
CEN at 0 range 5 .. 5;
AUTOTRIMEN at 0 range 6 .. 6;
SWSYNC at 0 range 7 .. 7;
TRIM at 0 range 8 .. 14;
Reserved_15_31 at 0 range 15 .. 31;
end record;
subtype CFGR_RELOAD_Field is HAL.UInt16;
subtype CFGR_FELIM_Field is HAL.UInt8;
subtype CFGR_SYNCDIV_Field is HAL.UInt3;
subtype CFGR_SYNCSRC_Field is HAL.UInt2;
-- This register can be written only when the frequency error counter is
-- disabled (CEN bit is cleared in CRS_CR). When the counter is enabled,
-- this register is write-protected.
type CFGR_Register is record
-- Counter reload value RELOAD is the value to be loaded in the
-- frequency error counter with each SYNC event. Refer to Section7.3.3:
-- Frequency error measurement for more details about counter behavior.
RELOAD : CFGR_RELOAD_Field := 16#BB7F#;
-- Frequency error limit FELIM contains the value to be used to evaluate
-- the captured frequency error value latched in the FECAP[15:0] bits of
-- the CRS_ISR register. Refer to Section7.3.4: Frequency error
-- evaluation and automatic trimming for more details about FECAP
-- evaluation.
FELIM : CFGR_FELIM_Field := 16#22#;
-- SYNC divider These bits are set and cleared by software to control
-- the division factor of the SYNC signal.
SYNCDIV : CFGR_SYNCDIV_Field := 16#0#;
-- unspecified
Reserved_27_27 : HAL.Bit := 16#0#;
-- SYNC signal source selection These bits are set and cleared by
-- software to select the SYNC signal source. Note: When using USB LPM
-- (Link Power Management) and the device is in Sleep mode, the periodic
-- USB SOF will not be generated by the host. No SYNC signal will
-- therefore be provided to the CRS to calibrate the HSI48 on the run.
-- To guarantee the required clock precision after waking up from Sleep
-- mode, the LSE or reference clock on the GPIOs should be used as SYNC
-- signal.
SYNCSRC : CFGR_SYNCSRC_Field := 16#2#;
-- unspecified
Reserved_30_30 : HAL.Bit := 16#0#;
-- SYNC polarity selection This bit is set and cleared by software to
-- select the input polarity for the SYNC signal source.
SYNCPOL : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CFGR_Register use record
RELOAD at 0 range 0 .. 15;
FELIM at 0 range 16 .. 23;
SYNCDIV at 0 range 24 .. 26;
Reserved_27_27 at 0 range 27 .. 27;
SYNCSRC at 0 range 28 .. 29;
Reserved_30_30 at 0 range 30 .. 30;
SYNCPOL at 0 range 31 .. 31;
end record;
subtype ISR_FECAP_Field is HAL.UInt16;
-- CRS interrupt and status register
type ISR_Register is record
-- Read-only. SYNC event OK flag This flag is set by hardware when the
-- measured frequency error is smaller than FELIM * 3. This means that
-- either no adjustment of the TRIM value is needed or that an
-- adjustment by one trimming step is enough to compensate the frequency
-- error. An interrupt is generated if the SYNCOKIE bit is set in the
-- CRS_CR register. It is cleared by software by setting the SYNCOKC bit
-- in the CRS_ICR register.
SYNCOKF : Boolean;
-- Read-only. SYNC warning flag This flag is set by hardware when the
-- measured frequency error is greater than or equal to FELIM * 3, but
-- smaller than FELIM * 128. This means that to compensate the frequency
-- error, the TRIM value must be adjusted by two steps or more. An
-- interrupt is generated if the SYNCWARNIE bit is set in the CRS_CR
-- register. It is cleared by software by setting the SYNCWARNC bit in
-- the CRS_ICR register.
SYNCWARNF : Boolean;
-- Read-only. Error flag This flag is set by hardware in case of any
-- synchronization or trimming error. It is the logical OR of the
-- TRIMOVF, SYNCMISS and SYNCERR bits. An interrupt is generated if the
-- ERRIE bit is set in the CRS_CR register. It is cleared by software in
-- reaction to setting the ERRC bit in the CRS_ICR register, which
-- clears the TRIMOVF, SYNCMISS and SYNCERR bits.
ERRF : Boolean;
-- Read-only. Expected SYNC flag This flag is set by hardware when the
-- frequency error counter reached a zero value. An interrupt is
-- generated if the ESYNCIE bit is set in the CRS_CR register. It is
-- cleared by software by setting the ESYNCC bit in the CRS_ICR
-- register.
ESYNCF : Boolean;
-- unspecified
Reserved_4_7 : HAL.UInt4;
-- Read-only. SYNC error This flag is set by hardware when the SYNC
-- pulse arrives before the ESYNC event and the measured frequency error
-- is greater than or equal to FELIM * 128. This means that the
-- frequency error is too big (internal frequency too low) to be
-- compensated by adjusting the TRIM value, and that some other action
-- should be taken. An interrupt is generated if the ERRIE bit is set in
-- the CRS_CR register. It is cleared by software by setting the ERRC
-- bit in the CRS_ICR register.
SYNCERR : Boolean;
-- Read-only. SYNC missed This flag is set by hardware when the
-- frequency error counter reached value FELIM * 128 and no SYNC was
-- detected, meaning either that a SYNC pulse was missed or that the
-- frequency error is too big (internal frequency too high) to be
-- compensated by adjusting the TRIM value, and that some other action
-- should be taken. At this point, the frequency error counter is
-- stopped (waiting for a next SYNC) and an interrupt is generated if
-- the ERRIE bit is set in the CRS_CR register. It is cleared by
-- software by setting the ERRC bit in the CRS_ICR register.
SYNCMISS : Boolean;
-- Read-only. Trimming overflow or underflow This flag is set by
-- hardware when the automatic trimming tries to over- or under-flow the
-- TRIM value. An interrupt is generated if the ERRIE bit is set in the
-- CRS_CR register. It is cleared by software by setting the ERRC bit in
-- the CRS_ICR register.
TRIMOVF : Boolean;
-- unspecified
Reserved_11_14 : HAL.UInt4;
-- Read-only. Frequency error direction FEDIR is the counting direction
-- of the frequency error counter latched in the time of the last SYNC
-- event. It shows whether the actual frequency is below or above the
-- target.
FEDIR : Boolean;
-- Read-only. Frequency error capture FECAP is the frequency error
-- counter value latched in the time ofthe last SYNC event. Refer to
-- Section7.3.4: Frequency error evaluation and automatic trimming for
-- more details about FECAP usage.
FECAP : ISR_FECAP_Field;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for ISR_Register use record
SYNCOKF at 0 range 0 .. 0;
SYNCWARNF at 0 range 1 .. 1;
ERRF at 0 range 2 .. 2;
ESYNCF at 0 range 3 .. 3;
Reserved_4_7 at 0 range 4 .. 7;
SYNCERR at 0 range 8 .. 8;
SYNCMISS at 0 range 9 .. 9;
TRIMOVF at 0 range 10 .. 10;
Reserved_11_14 at 0 range 11 .. 14;
FEDIR at 0 range 15 .. 15;
FECAP at 0 range 16 .. 31;
end record;
-- CRS interrupt flag clear register
type ICR_Register is record
-- SYNC event OK clear flag Writing 1 to this bit clears the SYNCOKF
-- flag in the CRS_ISR register.
SYNCOKC : Boolean := False;
-- SYNC warning clear flag Writing 1 to this bit clears the SYNCWARNF
-- flag in the CRS_ISR register.
SYNCWARNC : Boolean := False;
-- Error clear flag Writing 1 to this bit clears TRIMOVF, SYNCMISS and
-- SYNCERR bits and consequently also the ERRF flag in the CRS_ISR
-- register.
ERRC : Boolean := False;
-- Expected SYNC clear flag Writing 1 to this bit clears the ESYNCF flag
-- in the CRS_ISR register.
ESYNCC : Boolean := False;
-- unspecified
Reserved_4_31 : HAL.UInt28 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for ICR_Register use record
SYNCOKC at 0 range 0 .. 0;
SYNCWARNC at 0 range 1 .. 1;
ERRC at 0 range 2 .. 2;
ESYNCC at 0 range 3 .. 3;
Reserved_4_31 at 0 range 4 .. 31;
end record;
-----------------
-- Peripherals --
-----------------
-- CRS
type CRS_Peripheral is record
-- CRS control register
CR : aliased CR_Register;
-- This register can be written only when the frequency error counter is
-- disabled (CEN bit is cleared in CRS_CR). When the counter is enabled,
-- this register is write-protected.
CFGR : aliased CFGR_Register;
-- CRS interrupt and status register
ISR : aliased ISR_Register;
-- CRS interrupt flag clear register
ICR : aliased ICR_Register;
end record
with Volatile;
for CRS_Peripheral use record
CR at 16#0# range 0 .. 31;
CFGR at 16#4# range 0 .. 31;
ISR at 16#8# range 0 .. 31;
ICR at 16#C# range 0 .. 31;
end record;
-- CRS
CRS_Periph : aliased CRS_Peripheral
with Import, Address => CRS_Base;
end STM32_SVD.CRS;
|
-----------------------------------------------------------------------
-- helios-commands -- Helios commands
-- Copyright (C) 2017, 2018, 2019 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.IO_Exceptions;
with Ada.Command_Line;
with Util.Log.Loggers;
with Helios.Commands.Drivers;
with Helios.Commands.Info;
with Helios.Commands.Check;
with Helios.Commands.Agent;
with Helios.Commands.Register;
package body Helios.Commands is
Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create ("Helios.Commands");
procedure Load_Server_Config (Context : in out Context_Type);
Help_Command : aliased Helios.Commands.Drivers.Help_Command_Type;
Info_Command : aliased Helios.Commands.Info.Command_Type;
Check_Command : aliased Helios.Commands.Check.Command_Type;
Agent_Command : aliased Helios.Commands.Agent.Command_Type;
Register_Command : aliased Helios.Commands.Register.Command_Type;
Driver : Drivers.Driver_Type;
-- ------------------------------
-- Initialize the commands.
-- ------------------------------
procedure Initialize is
begin
Driver.Set_Description ("helios - monitoring agent");
Driver.Set_Usage ("[-v] [-d] [-c config] <command> [<args>]" & ASCII.LF &
"where:" & ASCII.LF &
" -v Verbose execution mode" & ASCII.LF &
" -d Debug execution mode" & ASCII.LF &
" -c config Use the configuration file");
Driver.Add_Command ("help", "print some help", Help_Command'Access);
Driver.Add_Command ("info", "report information", Info_Command'Access);
Driver.Add_Command ("check", "check the agent status", Check_Command'Access);
Driver.Add_Command ("agent", "agent start and stop", Agent_Command'Access);
Driver.Add_Command ("register", "agent registration", Register_Command'Access);
end Initialize;
-- ------------------------------
-- Print the command usage.
-- ------------------------------
procedure Usage (Args : in Argument_List'Class;
Name : in String := "") is
Context : Context_Type;
begin
Driver.Usage (Args, Context, Name);
end Usage;
-- ------------------------------
-- Execute the command with its arguments.
-- ------------------------------
procedure Execute (Name : in String;
Args : in Argument_List'Class;
Context : in out Context_Type) is
begin
Driver.Execute (Name, Args, Context);
end Execute;
-- ------------------------------
-- Load the configuration to use REST API to our server.
-- ------------------------------
procedure Load_Server_Config (Context : in out Context_Type) is
Path : constant String := Context.Config.Get ("hyperion", "hyperion-client.cfg");
begin
Context.Server.Load_Properties (Path);
exception
when Ada.IO_Exceptions.Name_Error =>
Log.Error ("Configuration key file '{0}' does not exist.", Path);
Log.Error ("Use the '-c config' option to specify a configuration file.");
Ada.Command_Line.Set_Exit_Status (Ada.Command_Line.Failure);
raise Error;
end Load_Server_Config;
-- ------------------------------
-- Save the server connection configuration.
-- ------------------------------
procedure Save_Server_Configuration (Context : in out Context_Type) is
Path : constant String := Context.Config.Get ("hyperion", "hyperion-client.cfg");
begin
Context.Server.Save_Properties (Path);
exception
when Ada.IO_Exceptions.Name_Error =>
Log.Error ("Cannot save server configuration");
Ada.Command_Line.Set_Exit_Status (Ada.Command_Line.Failure);
raise Error;
end Save_Server_Configuration;
-- ------------------------------
-- Load the configuration context from the configuration file.
-- ------------------------------
procedure Load (Context : in out Context_Type) is
Path : constant String := Ada.Strings.Unbounded.To_String (Context.Config_Path);
begin
Context.Config.Load_Properties (Path);
Load_Server_Config (Context);
exception
when Ada.IO_Exceptions.Name_Error =>
Log.Error ("Configuration file '{0}' does not exist.", Path);
Log.Error ("Use the '-c config' option to specify a configuration file.");
Ada.Command_Line.Set_Exit_Status (Ada.Command_Line.Failure);
raise Error;
end Load;
-- ------------------------------
-- Set the path of the configuration file to load.
-- ------------------------------
procedure Set_Configuration (Context : in out Context_Type;
Path : in String) is
begin
Context.Config_Path := Ada.Strings.Unbounded.To_Unbounded_String (Path);
end Set_Configuration;
end Helios.Commands;
|
-- Copyright 2012-2017 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 IO is
procedure Put_Line (S : String);
end IO;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.