content
stringlengths 23
1.05M
|
|---|
-- { dg-do compile }
-- { dg-options "-O2 -fdump-tree-optimized" }
function Opt54 (Val, Max : Integer) return Integer is
begin
if Val >= Max then
return Max;
end if;
return Val + 1;
end;
-- { dg-final { scan-tree-dump-not "gnat_rcheck" "optimized" } }
|
for Value in 0..Integer'Last loop
Put (Value);
exit when Value mod 6 = 0;
end loop;
|
-- C45503A.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 'REM' AND 'MOD' YIELD CORRECT RESULTS WHEN THE OPERANDS
-- ARE OF PREDEFINED TYPE INTEGER.
-- R.WILLIAMS 9/1/86
WITH REPORT; USE REPORT;
PROCEDURE C45503A IS
BEGIN
TEST ( "C45503A", "CHECK THAT 'REM' AND 'MOD' YIELD CORRECT " &
"RESULTS WHEN THE OPERANDS ARE OF PREDEFINED " &
"TYPE INTEGER" );
DECLARE
I0 : INTEGER := 0;
I1 : INTEGER := 1;
I2 : INTEGER := 2;
I3 : INTEGER := 3;
I4 : INTEGER := 4;
I5 : INTEGER := 5;
I10 : INTEGER := 10;
I11 : INTEGER := 11;
I12 : INTEGER := 12;
I13 : INTEGER := 13;
I14 : INTEGER := 14;
N1 : INTEGER := -1;
N2 : INTEGER := -2;
N3 : INTEGER := -3;
N4 : INTEGER := -4;
N5 : INTEGER := -5;
N10 : INTEGER := -10;
N11 : INTEGER := -11;
N12 : INTEGER := -12;
N13 : INTEGER := -13;
N14 : INTEGER := -14;
BEGIN
IF I10 REM I5 /= I0 THEN
FAILED ( "INCORRECT RESULT FOR I10 REM I5" );
END IF;
IF IDENT_INT (I11) REM IDENT_INT (I5) /= I1 THEN
FAILED ( "INCORRECT RESULT FOR IDENT_INT (I11) REM " &
"IDENT_INT (I5)" );
END IF;
IF I12 REM I5 /= I2 THEN
FAILED ( "INCORRECT RESULT FOR I12 REM I5" );
END IF;
IF "REM" (LEFT => I12, RIGHT => I5) /= I2 THEN
FAILED ( "INCORRECT RESULT FOR ""REM"" (LEFT => I12, " &
"RIGHT => I5)" );
END IF;
IF IDENT_INT (I13) REM IDENT_INT (I5) /= I3 THEN
FAILED ( "INCORRECT RESULT FOR IDENT_INT (I13) REM " &
"IDENT_INT (I5)" );
END IF;
IF I14 REM I5 /= I4 THEN
FAILED ( "INCORRECT RESULT FOR I14 REM I5" );
END IF;
IF IDENT_INT (I10) REM IDENT_INT (N5) /= I0 THEN
FAILED ( "INCORRECT RESULT FOR IDENT_INT (I10) REM " &
"IDENT_INT (N5)" );
END IF;
IF "REM" (LEFT => IDENT_INT (I10), RIGHT => IDENT_INT (N5))
/= I0 THEN
FAILED ( "INCORRECT RESULT FOR ""REM"" (LEFT => " &
"IDENT_INT (I10), RIGHT => IDENT_INT (N5))" );
END IF;
IF I11 REM N5 /= I1 THEN
FAILED ( "INCORRECT RESULT FOR I11 REM N5" );
END IF;
IF IDENT_INT (I12) REM IDENT_INT (N5) /= I2 THEN
FAILED ( "INCORRECT RESULT FOR IDENT_INT (I12) REM " &
"IDENT_INT (N5)" );
END IF;
IF I13 REM N5 /= I3 THEN
FAILED ( "INCORRECT RESULT FOR I13 REM N5" );
END IF;
IF "REM" (LEFT => I13, RIGHT => N5) /= I3 THEN
FAILED ( "INCORRECT RESULT FOR ""REM"" (LEFT => I13, " &
"RIGHT => N5)" );
END IF;
IF IDENT_INT (I14) REM IDENT_INT (N5) /= I4 THEN
FAILED ( "INCORRECT RESULT FOR IDENT_INT (I14) REM " &
"IDENT_INT (N5)" );
END IF;
IF N10 REM I5 /= I0 THEN
FAILED ( "INCORRECT RESULT FOR N10 REM I5" );
END IF;
IF IDENT_INT (N11) REM IDENT_INT (I5) /= N1 THEN
FAILED ( "INCORRECT RESULT FOR IDENT_INT (N11) REM " &
"IDENT_INT (I5)" );
END IF;
IF "REM" (LEFT => IDENT_INT (N11), RIGHT => IDENT_INT (I5))
/= N1 THEN
FAILED ( "INCORRECT RESULT FOR ""REM"" (LEFT => " &
"IDENT_INT (N11), RIGHT => IDENT_INT (I5))" );
END IF;
IF N12 REM I5 /= N2 THEN
FAILED ( "INCORRECT RESULT FOR N12 REM I5" );
END IF;
IF IDENT_INT (N13) REM IDENT_INT (I5) /= N3 THEN
FAILED ( "INCORRECT RESULT FOR IDENT_INT (N13) REM " &
"IDENT_INT (I5)" );
END IF;
IF N14 REM I5 /= N4 THEN
FAILED ( "INCORRECT RESULT FOR N14 REM I5" );
END IF;
IF "REM" (LEFT => N14, RIGHT => I5) /= N4 THEN
FAILED ( "INCORRECT RESULT FOR ""REM"" (LEFT => N14, " &
"RIGHT => I5)" );
END IF;
IF IDENT_INT (N10) REM IDENT_INT (N5) /= I0 THEN
FAILED ( "INCORRECT RESULT FOR IDENT_INT (N10) REM " &
"IDENT_INT (N5)" );
END IF;
IF N11 REM N5 /= N1 THEN
FAILED ( "INCORRECT RESULT FOR N11 REM N5" );
END IF;
IF IDENT_INT (N12) REM IDENT_INT (N5) /= N2 THEN
FAILED ( "INCORRECT RESULT FOR IDENT_INT (N12) REM " &
"IDENT_INT (N5)" );
END IF;
IF "REM" (LEFT => IDENT_INT (N12), RIGHT => IDENT_INT (N5))
/= N2 THEN
FAILED ( "INCORRECT RESULT FOR ""REM"" (LEFT => " &
"IDENT_INT (N12), RIGHT => IDENT_INT (N5))" );
END IF;
IF N13 REM N5 /= N3 THEN
FAILED ( "INCORRECT RESULT FOR N13 REM N5" );
END IF;
IF IDENT_INT (N14) REM IDENT_INT (N5) /= N4 THEN
FAILED ( "INCORRECT RESULT FOR IDENT_INT (N14) REM " &
"IDENT_INT (N5)" );
END IF;
IF I10 MOD I5 /= I0 THEN
FAILED ( "INCORRECT RESULT FOR I10 MOD I5" );
END IF;
IF IDENT_INT (I11) MOD IDENT_INT (I5) /= I1 THEN
FAILED ( "INCORRECT RESULT FOR IDENT_INT (I11) MOD " &
"IDENT_INT (I5)" );
END IF;
IF I12 MOD I5 /= I2 THEN
FAILED ( "INCORRECT RESULT FOR I12 MOD I5" );
END IF;
IF "MOD" (LEFT => I12, RIGHT => I5) /= I2 THEN
FAILED ( "INCORRECT RESULT FOR ""MOD"" (LEFT => I12, " &
"RIGHT => I5)" );
END IF;
IF IDENT_INT (I13) MOD IDENT_INT (I5) /= I3 THEN
FAILED ( "INCORRECT RESULT FOR IDENT_INT (I13) MOD " &
"IDENT_INT (I5)" );
END IF;
IF I14 MOD I5 /= I4 THEN
FAILED ( "INCORRECT RESULT FOR I14 MOD I5" );
END IF;
IF IDENT_INT (I10) MOD IDENT_INT (N5) /= I0 THEN
FAILED ( "INCORRECT RESULT FOR IDENT_INT (I10) MOD " &
"IDENT_INT (N5)" );
END IF;
IF "MOD" (LEFT => IDENT_INT (I10), RIGHT => IDENT_INT (N5))
/= I0 THEN
FAILED ( "INCORRECT RESULT FOR ""MOD"" (LEFT => " &
"IDENT_INT (I10), RIGHT => IDENT_INT (N5))" );
END IF;
IF I11 MOD N5 /= N4 THEN
FAILED ( "INCORRECT RESULT FOR I11 MOD N5" );
END IF;
IF IDENT_INT (I12) MOD IDENT_INT (N5) /= N3 THEN
FAILED ( "INCORRECT RESULT FOR IDENT_INT (I12) MOD " &
"IDENT_INT (N5)" );
END IF;
IF I13 MOD N5 /= N2 THEN
FAILED ( "INCORRECT RESULT FOR I13 MOD N5" );
END IF;
IF "MOD" (LEFT => I13, RIGHT => N5) /= N2 THEN
FAILED ( "INCORRECT RESULT FOR ""MOD"" (LEFT => I13, " &
"RIGHT => N5)" );
END IF;
IF IDENT_INT (I14) MOD IDENT_INT (N5) /= N1 THEN
FAILED ( "INCORRECT RESULT FOR IDENT_INT (I14) MOD " &
"IDENT_INT (N5)" );
END IF;
IF N10 MOD I5 /= I0 THEN
FAILED ( "INCORRECT RESULT FOR N10 MOD I5" );
END IF;
IF IDENT_INT (N11) MOD IDENT_INT (I5) /= I4 THEN
FAILED ( "INCORRECT RESULT FOR IDENT_INT (N11) MOD " &
"IDENT_INT (I5)" );
END IF;
IF "MOD" (LEFT => IDENT_INT (N11), RIGHT => IDENT_INT (I5))
/= I4 THEN
FAILED ( "INCORRECT RESULT FOR ""MOD"" (LEFT => " &
"IDENT_INT (N11), RIGHT => IDENT_INT (I5))" );
END IF;
IF N12 MOD I5 /= I3 THEN
FAILED ( "INCORRECT RESULT FOR N12 MOD I5" );
END IF;
IF IDENT_INT (N13) MOD IDENT_INT (I5) /= I2 THEN
FAILED ( "INCORRECT RESULT FOR IDENT_INT (N13) MOD " &
"IDENT_INT (I5)" );
END IF;
IF N14 MOD I5 /= I1 THEN
FAILED ( "INCORRECT RESULT FOR N14 MOD I5" );
END IF;
IF "MOD" (LEFT => N14, RIGHT => I5) /= I1 THEN
FAILED ( "INCORRECT RESULT FOR ""MOD"" (LEFT => I14, " &
"RIGHT => I5)" );
END IF;
IF IDENT_INT (N10) MOD IDENT_INT (N5) /= I0 THEN
FAILED ( "INCORRECT RESULT FOR IDENT_INT (N10) MOD " &
"IDENT_INT (N5)" );
END IF;
IF N11 MOD N5 /= N1 THEN
FAILED ( "INCORRECT RESULT FOR N11 MOD N5" );
END IF;
IF IDENT_INT (N12) MOD IDENT_INT (N5) /= N2 THEN
FAILED ( "INCORRECT RESULT FOR IDENT_INT (N12) MOD " &
"IDENT_INT (N5)" );
END IF;
IF "MOD" (LEFT => IDENT_INT (N12), RIGHT => IDENT_INT (N5))
/= N2 THEN
FAILED ( "INCORRECT RESULT FOR ""MOD"" (LEFT => " &
"IDENT_INT (N12), RIGHT => IDENT_INT (N5))" );
END IF;
IF N13 MOD N5 /= N3 THEN
FAILED ( "INCORRECT RESULT FOR N13 MOD N5" );
END IF;
IF IDENT_INT (N14) MOD IDENT_INT (N5) /= N4 THEN
FAILED ( "INCORRECT RESULT FOR IDENT_INT (N14) MOD " &
"IDENT_INT (N5)" );
END IF;
END;
RESULT;
END C45503A;
|
-----------------------------------------------------------------------
-- AWA.Tags.Models -- AWA.Tags.Models
-----------------------------------------------------------------------
-- File generated by ada-gen DO NOT MODIFY
-- Template used: templates/model/package-spec.xhtml
-- Ada Generator: https://ada-gen.googlecode.com/svn/trunk Revision 1095
-----------------------------------------------------------------------
-- 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.
-----------------------------------------------------------------------
pragma Warnings (Off);
with ADO.Sessions;
with ADO.Objects;
with ADO.Statements;
with ADO.SQL;
with ADO.Schemas;
with ADO.Queries;
with ADO.Queries.Loaders;
with Ada.Containers.Vectors;
with Ada.Strings.Unbounded;
with Util.Beans.Objects;
with Util.Beans.Basic.Lists;
pragma Warnings (On);
package AWA.Tags.Models is
pragma Style_Checks ("-mr");
type Tag_Ref is new ADO.Objects.Object_Ref with null record;
type Tagged_Entity_Ref is new ADO.Objects.Object_Ref with null record;
-- --------------------
-- The tag definition.
-- --------------------
-- Create an object key for Tag.
function Tag_Key (Id : in ADO.Identifier) return ADO.Objects.Object_Key;
-- Create an object key for Tag from a string.
-- Raises Constraint_Error if the string cannot be converted into the object key.
function Tag_Key (Id : in String) return ADO.Objects.Object_Key;
Null_Tag : constant Tag_Ref;
function "=" (Left, Right : Tag_Ref'Class) return Boolean;
-- Set the tag identifier
procedure Set_Id (Object : in out Tag_Ref;
Value : in ADO.Identifier);
-- Get the tag identifier
function Get_Id (Object : in Tag_Ref)
return ADO.Identifier;
-- Set the tag name
procedure Set_Name (Object : in out Tag_Ref;
Value : in Ada.Strings.Unbounded.Unbounded_String);
procedure Set_Name (Object : in out Tag_Ref;
Value : in String);
-- Get the tag name
function Get_Name (Object : in Tag_Ref)
return Ada.Strings.Unbounded.Unbounded_String;
function Get_Name (Object : in Tag_Ref)
return String;
-- Load the entity identified by 'Id'.
-- Raises the NOT_FOUND exception if it does not exist.
procedure Load (Object : in out Tag_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier);
-- Load the entity identified by 'Id'.
-- Returns True in <b>Found</b> if the object was found and False if it does not exist.
procedure Load (Object : in out Tag_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier;
Found : out Boolean);
-- Find and load the entity.
overriding
procedure Find (Object : in out Tag_Ref;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean);
-- Save the entity. If the entity does not have an identifier, an identifier is allocated
-- and it is inserted in the table. Otherwise, only data fields which have been changed
-- are updated.
overriding
procedure Save (Object : in out Tag_Ref;
Session : in out ADO.Sessions.Master_Session'Class);
-- Delete the entity.
overriding
procedure Delete (Object : in out Tag_Ref;
Session : in out ADO.Sessions.Master_Session'Class);
overriding
function Get_Value (From : in Tag_Ref;
Name : in String) return Util.Beans.Objects.Object;
-- Table definition
TAG_TABLE : constant ADO.Schemas.Class_Mapping_Access;
-- Internal method to allocate the Object_Record instance
overriding
procedure Allocate (Object : in out Tag_Ref);
-- Copy of the object.
procedure Copy (Object : in Tag_Ref;
Into : in out Tag_Ref);
package Tag_Vectors is
new Ada.Containers.Vectors (Index_Type => Positive,
Element_Type => Tag_Ref,
"=" => "=");
subtype Tag_Vector is Tag_Vectors.Vector;
procedure List (Object : in out Tag_Vector;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class);
-- Create an object key for Tagged_Entity.
function Tagged_Entity_Key (Id : in ADO.Identifier) return ADO.Objects.Object_Key;
-- Create an object key for Tagged_Entity from a string.
-- Raises Constraint_Error if the string cannot be converted into the object key.
function Tagged_Entity_Key (Id : in String) return ADO.Objects.Object_Key;
Null_Tagged_Entity : constant Tagged_Entity_Ref;
function "=" (Left, Right : Tagged_Entity_Ref'Class) return Boolean;
-- Set the tag entity identifier
procedure Set_Id (Object : in out Tagged_Entity_Ref;
Value : in ADO.Identifier);
-- Get the tag entity identifier
function Get_Id (Object : in Tagged_Entity_Ref)
return ADO.Identifier;
-- Set Title: Tag model
-- Date: 2013-02-23the database entity to which the tag is associated
procedure Set_For_Entity_Id (Object : in out Tagged_Entity_Ref;
Value : in ADO.Identifier);
-- Get Title: Tag model
-- Date: 2013-02-23the database entity to which the tag is associated
function Get_For_Entity_Id (Object : in Tagged_Entity_Ref)
return ADO.Identifier;
-- Set the entity type
procedure Set_Entity_Type (Object : in out Tagged_Entity_Ref;
Value : in ADO.Entity_Type);
-- Get the entity type
function Get_Entity_Type (Object : in Tagged_Entity_Ref)
return ADO.Entity_Type;
--
procedure Set_Tag (Object : in out Tagged_Entity_Ref;
Value : in AWA.Tags.Models.Tag_Ref'Class);
--
function Get_Tag (Object : in Tagged_Entity_Ref)
return AWA.Tags.Models.Tag_Ref'Class;
-- Load the entity identified by 'Id'.
-- Raises the NOT_FOUND exception if it does not exist.
procedure Load (Object : in out Tagged_Entity_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier);
-- Load the entity identified by 'Id'.
-- Returns True in <b>Found</b> if the object was found and False if it does not exist.
procedure Load (Object : in out Tagged_Entity_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier;
Found : out Boolean);
-- Find and load the entity.
overriding
procedure Find (Object : in out Tagged_Entity_Ref;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean);
-- Save the entity. If the entity does not have an identifier, an identifier is allocated
-- and it is inserted in the table. Otherwise, only data fields which have been changed
-- are updated.
overriding
procedure Save (Object : in out Tagged_Entity_Ref;
Session : in out ADO.Sessions.Master_Session'Class);
-- Delete the entity.
overriding
procedure Delete (Object : in out Tagged_Entity_Ref;
Session : in out ADO.Sessions.Master_Session'Class);
overriding
function Get_Value (From : in Tagged_Entity_Ref;
Name : in String) return Util.Beans.Objects.Object;
-- Table definition
TAGGED_ENTITY_TABLE : constant ADO.Schemas.Class_Mapping_Access;
-- Internal method to allocate the Object_Record instance
overriding
procedure Allocate (Object : in out Tagged_Entity_Ref);
-- Copy of the object.
procedure Copy (Object : in Tagged_Entity_Ref;
Into : in out Tagged_Entity_Ref);
package Tagged_Entity_Vectors is
new Ada.Containers.Vectors (Index_Type => Positive,
Element_Type => Tagged_Entity_Ref,
"=" => "=");
subtype Tagged_Entity_Vector is Tagged_Entity_Vectors.Vector;
procedure List (Object : in out Tagged_Entity_Vector;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class);
-- --------------------
-- The tag information.
-- --------------------
type Tag_Info is
new Util.Beans.Basic.Bean with record
-- the tag name.
Tag : Ada.Strings.Unbounded.Unbounded_String;
-- the number of references for the tag.
Count : Natural;
end record;
-- Get the bean attribute identified by the name.
overriding
function Get_Value (From : in Tag_Info;
Name : in String) return Util.Beans.Objects.Object;
-- Set the bean attribute identified by the name.
overriding
procedure Set_Value (Item : in out Tag_Info;
Name : in String;
Value : in Util.Beans.Objects.Object);
package Tag_Info_Beans is
new Util.Beans.Basic.Lists (Element_Type => Tag_Info);
package Tag_Info_Vectors renames Tag_Info_Beans.Vectors;
subtype Tag_Info_List_Bean is Tag_Info_Beans.List_Bean;
type Tag_Info_List_Bean_Access is access all Tag_Info_List_Bean;
-- Run the query controlled by <b>Context</b> and append the list in <b>Object</b>.
procedure List (Object : in out Tag_Info_List_Bean'Class;
Session : in out ADO.Sessions.Session'Class;
Context : in out ADO.Queries.Context'Class);
subtype Tag_Info_Vector is Tag_Info_Vectors.Vector;
-- Run the query controlled by <b>Context</b> and append the list in <b>Object</b>.
procedure List (Object : in out Tag_Info_Vector;
Session : in out ADO.Sessions.Session'Class;
Context : in out ADO.Queries.Context'Class);
Query_Check_Tag : constant ADO.Queries.Query_Definition_Access;
Query_Tag_List : constant ADO.Queries.Query_Definition_Access;
Query_Tag_Search : constant ADO.Queries.Query_Definition_Access;
Query_Tag_List_All : constant ADO.Queries.Query_Definition_Access;
Query_Tag_List_For_Entities : constant ADO.Queries.Query_Definition_Access;
private
TAG_NAME : aliased constant String := "awa_tag";
COL_0_1_NAME : aliased constant String := "id";
COL_1_1_NAME : aliased constant String := "name";
TAG_DEF : aliased constant ADO.Schemas.Class_Mapping :=
(Count => 2,
Table => TAG_NAME'Access,
Members => (
1 => COL_0_1_NAME'Access,
2 => COL_1_1_NAME'Access)
);
TAG_TABLE : constant ADO.Schemas.Class_Mapping_Access
:= TAG_DEF'Access;
Null_Tag : constant Tag_Ref
:= Tag_Ref'(ADO.Objects.Object_Ref with null record);
type Tag_Impl is
new ADO.Objects.Object_Record (Key_Type => ADO.Objects.KEY_INTEGER,
Of_Class => TAG_DEF'Access)
with record
Name : Ada.Strings.Unbounded.Unbounded_String;
end record;
type Tag_Access is access all Tag_Impl;
overriding
procedure Destroy (Object : access Tag_Impl);
overriding
procedure Find (Object : in out Tag_Impl;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean);
overriding
procedure Load (Object : in out Tag_Impl;
Session : in out ADO.Sessions.Session'Class);
procedure Load (Object : in out Tag_Impl;
Stmt : in out ADO.Statements.Query_Statement'Class;
Session : in out ADO.Sessions.Session'Class);
overriding
procedure Save (Object : in out Tag_Impl;
Session : in out ADO.Sessions.Master_Session'Class);
procedure Create (Object : in out Tag_Impl;
Session : in out ADO.Sessions.Master_Session'Class);
overriding
procedure Delete (Object : in out Tag_Impl;
Session : in out ADO.Sessions.Master_Session'Class);
procedure Set_Field (Object : in out Tag_Ref'Class;
Impl : out Tag_Access);
TAGGED_ENTITY_NAME : aliased constant String := "awa_tagged_entity";
COL_0_2_NAME : aliased constant String := "id";
COL_1_2_NAME : aliased constant String := "for_entity_id";
COL_2_2_NAME : aliased constant String := "entity_type";
COL_3_2_NAME : aliased constant String := "tag_id";
TAGGED_ENTITY_DEF : aliased constant ADO.Schemas.Class_Mapping :=
(Count => 4,
Table => TAGGED_ENTITY_NAME'Access,
Members => (
1 => COL_0_2_NAME'Access,
2 => COL_1_2_NAME'Access,
3 => COL_2_2_NAME'Access,
4 => COL_3_2_NAME'Access)
);
TAGGED_ENTITY_TABLE : constant ADO.Schemas.Class_Mapping_Access
:= TAGGED_ENTITY_DEF'Access;
Null_Tagged_Entity : constant Tagged_Entity_Ref
:= Tagged_Entity_Ref'(ADO.Objects.Object_Ref with null record);
type Tagged_Entity_Impl is
new ADO.Objects.Object_Record (Key_Type => ADO.Objects.KEY_INTEGER,
Of_Class => TAGGED_ENTITY_DEF'Access)
with record
For_Entity_Id : ADO.Identifier;
Entity_Type : ADO.Entity_Type;
Tag : AWA.Tags.Models.Tag_Ref;
end record;
type Tagged_Entity_Access is access all Tagged_Entity_Impl;
overriding
procedure Destroy (Object : access Tagged_Entity_Impl);
overriding
procedure Find (Object : in out Tagged_Entity_Impl;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean);
overriding
procedure Load (Object : in out Tagged_Entity_Impl;
Session : in out ADO.Sessions.Session'Class);
procedure Load (Object : in out Tagged_Entity_Impl;
Stmt : in out ADO.Statements.Query_Statement'Class;
Session : in out ADO.Sessions.Session'Class);
overriding
procedure Save (Object : in out Tagged_Entity_Impl;
Session : in out ADO.Sessions.Master_Session'Class);
procedure Create (Object : in out Tagged_Entity_Impl;
Session : in out ADO.Sessions.Master_Session'Class);
overriding
procedure Delete (Object : in out Tagged_Entity_Impl;
Session : in out ADO.Sessions.Master_Session'Class);
procedure Set_Field (Object : in out Tagged_Entity_Ref'Class;
Impl : out Tagged_Entity_Access);
package File_1 is
new ADO.Queries.Loaders.File (Path => "tag-queries.xml",
Sha1 => "BFA439EF20901C425F86DB33AD8870BADB46FBEB");
package Def_Taginfo_Check_Tag is
new ADO.Queries.Loaders.Query (Name => "check-tag",
File => File_1.File'Access);
Query_Check_Tag : constant ADO.Queries.Query_Definition_Access
:= Def_Taginfo_Check_Tag.Query'Access;
package Def_Taginfo_Tag_List is
new ADO.Queries.Loaders.Query (Name => "tag-list",
File => File_1.File'Access);
Query_Tag_List : constant ADO.Queries.Query_Definition_Access
:= Def_Taginfo_Tag_List.Query'Access;
package Def_Taginfo_Tag_Search is
new ADO.Queries.Loaders.Query (Name => "tag-search",
File => File_1.File'Access);
Query_Tag_Search : constant ADO.Queries.Query_Definition_Access
:= Def_Taginfo_Tag_Search.Query'Access;
package Def_Taginfo_Tag_List_All is
new ADO.Queries.Loaders.Query (Name => "tag-list-all",
File => File_1.File'Access);
Query_Tag_List_All : constant ADO.Queries.Query_Definition_Access
:= Def_Taginfo_Tag_List_All.Query'Access;
package Def_Taginfo_Tag_List_For_Entities is
new ADO.Queries.Loaders.Query (Name => "tag-list-for-entities",
File => File_1.File'Access);
Query_Tag_List_For_Entities : constant ADO.Queries.Query_Definition_Access
:= Def_Taginfo_Tag_List_For_Entities.Query'Access;
end AWA.Tags.Models;
|
------------------------------------------------------------------------------
-- --
-- Copyright (C) 2015-2017, 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 stm32f40[5|7]xx.h --
-- @author MCD Application Team --
-- @version V1.1.0 --
-- @date 19-June-2014 --
-- @brief CMSIS STM32F407xx Device Peripheral Access Layer Header File. --
-- --
-- COPYRIGHT(c) 2014 STMicroelectronics --
------------------------------------------------------------------------------
-- This file provides declarations for devices on the STM32F40xxx MCUs
-- manufactured by ST Microelectronics. For example, an STM32F405.
with STM32_SVD; use STM32_SVD;
with STM32.DMA; use STM32.DMA;
with STM32.GPIO; use STM32.GPIO;
with STM32.ADC; use STM32.ADC;
with STM32.USARTs; use STM32.USARTs;
with STM32.SPI; use STM32.SPI;
with STM32.I2S; use STM32.I2S;
with STM32.Timers; use STM32.Timers;
with STM32.DAC; use STM32.DAC;
with STM32.I2C; use STM32.I2C;
with STM32.RTC; use STM32.RTC;
with STM32.CRC; use STM32.CRC;
package STM32.Device is
pragma Elaborate_Body;
Unknown_Device : exception;
-- Raised by the routines below for a device passed as an actual parameter
-- when that device is not present on the given hardware instance.
procedure Enable_Clock (This : aliased in out GPIO_Port);
procedure Disable_Clock (This : aliased in out GPIO_Port);
procedure Enable_Clock (Point : GPIO_Point);
procedure Disable_Clock (Point : GPIO_Point);
procedure Enable_Clock (Points : GPIO_Points);
procedure Reset (This : aliased in out GPIO_Port)
with Inline;
procedure Reset (Point : GPIO_Point)
with Inline;
procedure Reset (Points : GPIO_Points)
with Inline;
function GPIO_Port_Representation (Port : GPIO_Port) return UInt4
with Inline;
GPIO_A : aliased GPIO_Port with Import, Volatile, Address => GPIOA_Base;
GPIO_B : aliased GPIO_Port with Import, Volatile, Address => GPIOB_Base;
GPIO_C : aliased GPIO_Port with Import, Volatile, Address => GPIOC_Base;
GPIO_D : aliased GPIO_Port with Import, Volatile, Address => GPIOD_Base;
GPIO_E : aliased GPIO_Port with Import, Volatile, Address => GPIOE_Base;
GPIO_F : aliased GPIO_Port with Import, Volatile, Address => GPIOF_Base;
GPIO_G : aliased GPIO_Port with Import, Volatile, Address => GPIOG_Base;
PA0 : aliased GPIO_Point := (GPIO_A'Access, Pin_0);
PA1 : aliased GPIO_Point := (GPIO_A'Access, Pin_1);
PA2 : aliased GPIO_Point := (GPIO_A'Access, Pin_2);
PA3 : aliased GPIO_Point := (GPIO_A'Access, Pin_3);
PA4 : aliased GPIO_Point := (GPIO_A'Access, Pin_4);
PA5 : aliased GPIO_Point := (GPIO_A'Access, Pin_5);
PA6 : aliased GPIO_Point := (GPIO_A'Access, Pin_6);
PA7 : aliased GPIO_Point := (GPIO_A'Access, Pin_7);
PA8 : aliased GPIO_Point := (GPIO_A'Access, Pin_8);
PA9 : aliased GPIO_Point := (GPIO_A'Access, Pin_9);
PA10 : aliased GPIO_Point := (GPIO_A'Access, Pin_10);
PA11 : aliased GPIO_Point := (GPIO_A'Access, Pin_11);
PA12 : aliased GPIO_Point := (GPIO_A'Access, Pin_12);
PA13 : aliased GPIO_Point := (GPIO_A'Access, Pin_13);
PA14 : aliased GPIO_Point := (GPIO_A'Access, Pin_14);
PA15 : aliased GPIO_Point := (GPIO_A'Access, Pin_15);
PB0 : aliased GPIO_Point := (GPIO_B'Access, Pin_0);
PB1 : aliased GPIO_Point := (GPIO_B'Access, Pin_1);
PB2 : aliased GPIO_Point := (GPIO_B'Access, Pin_2);
PB3 : aliased GPIO_Point := (GPIO_B'Access, Pin_3);
PB4 : aliased GPIO_Point := (GPIO_B'Access, Pin_4);
PB5 : aliased GPIO_Point := (GPIO_B'Access, Pin_5);
PB6 : aliased GPIO_Point := (GPIO_B'Access, Pin_6);
PB7 : aliased GPIO_Point := (GPIO_B'Access, Pin_7);
PB8 : aliased GPIO_Point := (GPIO_B'Access, Pin_8);
PB9 : aliased GPIO_Point := (GPIO_B'Access, Pin_9);
PB10 : aliased GPIO_Point := (GPIO_B'Access, Pin_10);
PB11 : aliased GPIO_Point := (GPIO_B'Access, Pin_11);
PB12 : aliased GPIO_Point := (GPIO_B'Access, Pin_12);
PB13 : aliased GPIO_Point := (GPIO_B'Access, Pin_13);
PB14 : aliased GPIO_Point := (GPIO_B'Access, Pin_14);
PB15 : aliased GPIO_Point := (GPIO_B'Access, Pin_15);
PC0 : aliased GPIO_Point := (GPIO_C'Access, Pin_0);
PC1 : aliased GPIO_Point := (GPIO_C'Access, Pin_1);
PC2 : aliased GPIO_Point := (GPIO_C'Access, Pin_2);
PC3 : aliased GPIO_Point := (GPIO_C'Access, Pin_3);
PC4 : aliased GPIO_Point := (GPIO_C'Access, Pin_4);
PC5 : aliased GPIO_Point := (GPIO_C'Access, Pin_5);
PC6 : aliased GPIO_Point := (GPIO_C'Access, Pin_6);
PC7 : aliased GPIO_Point := (GPIO_C'Access, Pin_7);
PC8 : aliased GPIO_Point := (GPIO_C'Access, Pin_8);
PC9 : aliased GPIO_Point := (GPIO_C'Access, Pin_9);
PC10 : aliased GPIO_Point := (GPIO_C'Access, Pin_10);
PC11 : aliased GPIO_Point := (GPIO_C'Access, Pin_11);
PC12 : aliased GPIO_Point := (GPIO_C'Access, Pin_12);
PC13 : aliased GPIO_Point := (GPIO_C'Access, Pin_13);
PC14 : aliased GPIO_Point := (GPIO_C'Access, Pin_14);
PC15 : aliased GPIO_Point := (GPIO_C'Access, Pin_15);
PD0 : aliased GPIO_Point := (GPIO_D'Access, Pin_0);
PD1 : aliased GPIO_Point := (GPIO_D'Access, Pin_1);
PD2 : aliased GPIO_Point := (GPIO_D'Access, Pin_2);
PD3 : aliased GPIO_Point := (GPIO_D'Access, Pin_3);
PD4 : aliased GPIO_Point := (GPIO_D'Access, Pin_4);
PD5 : aliased GPIO_Point := (GPIO_D'Access, Pin_5);
PD6 : aliased GPIO_Point := (GPIO_D'Access, Pin_6);
PD7 : aliased GPIO_Point := (GPIO_D'Access, Pin_7);
PD8 : aliased GPIO_Point := (GPIO_D'Access, Pin_8);
PD9 : aliased GPIO_Point := (GPIO_D'Access, Pin_9);
PD10 : aliased GPIO_Point := (GPIO_D'Access, Pin_10);
PD11 : aliased GPIO_Point := (GPIO_D'Access, Pin_11);
PD12 : aliased GPIO_Point := (GPIO_D'Access, Pin_12);
PD13 : aliased GPIO_Point := (GPIO_D'Access, Pin_13);
PD14 : aliased GPIO_Point := (GPIO_D'Access, Pin_14);
PD15 : aliased GPIO_Point := (GPIO_D'Access, Pin_15);
PE0 : aliased GPIO_Point := (GPIO_E'Access, Pin_0);
PE1 : aliased GPIO_Point := (GPIO_E'Access, Pin_1);
PE2 : aliased GPIO_Point := (GPIO_E'Access, Pin_2);
PE3 : aliased GPIO_Point := (GPIO_E'Access, Pin_3);
PE4 : aliased GPIO_Point := (GPIO_E'Access, Pin_4);
PE5 : aliased GPIO_Point := (GPIO_E'Access, Pin_5);
PE6 : aliased GPIO_Point := (GPIO_E'Access, Pin_6);
PE7 : aliased GPIO_Point := (GPIO_E'Access, Pin_7);
PE8 : aliased GPIO_Point := (GPIO_E'Access, Pin_8);
PE9 : aliased GPIO_Point := (GPIO_E'Access, Pin_9);
PE10 : aliased GPIO_Point := (GPIO_E'Access, Pin_10);
PE11 : aliased GPIO_Point := (GPIO_E'Access, Pin_11);
PE12 : aliased GPIO_Point := (GPIO_E'Access, Pin_12);
PE13 : aliased GPIO_Point := (GPIO_E'Access, Pin_13);
PE14 : aliased GPIO_Point := (GPIO_E'Access, Pin_14);
PE15 : aliased GPIO_Point := (GPIO_E'Access, Pin_15);
PF0 : aliased GPIO_Point := (GPIO_F'Access, Pin_0);
PF1 : aliased GPIO_Point := (GPIO_F'Access, Pin_1);
PF2 : aliased GPIO_Point := (GPIO_F'Access, Pin_2);
PF3 : aliased GPIO_Point := (GPIO_F'Access, Pin_3);
PF4 : aliased GPIO_Point := (GPIO_F'Access, Pin_4);
PF5 : aliased GPIO_Point := (GPIO_F'Access, Pin_5);
PF6 : aliased GPIO_Point := (GPIO_F'Access, Pin_6);
PF7 : aliased GPIO_Point := (GPIO_F'Access, Pin_7);
PF8 : aliased GPIO_Point := (GPIO_F'Access, Pin_8);
PF9 : aliased GPIO_Point := (GPIO_F'Access, Pin_9);
PF10 : aliased GPIO_Point := (GPIO_F'Access, Pin_10);
PF11 : aliased GPIO_Point := (GPIO_F'Access, Pin_11);
PF12 : aliased GPIO_Point := (GPIO_F'Access, Pin_12);
PF13 : aliased GPIO_Point := (GPIO_F'Access, Pin_13);
PF14 : aliased GPIO_Point := (GPIO_F'Access, Pin_14);
PF15 : aliased GPIO_Point := (GPIO_F'Access, Pin_15);
PG0 : aliased GPIO_Point := (GPIO_G'Access, Pin_0);
PG1 : aliased GPIO_Point := (GPIO_G'Access, Pin_1);
PG2 : aliased GPIO_Point := (GPIO_G'Access, Pin_2);
PG3 : aliased GPIO_Point := (GPIO_G'Access, Pin_3);
PG4 : aliased GPIO_Point := (GPIO_G'Access, Pin_4);
PG5 : aliased GPIO_Point := (GPIO_G'Access, Pin_5);
PG6 : aliased GPIO_Point := (GPIO_G'Access, Pin_6);
PG7 : aliased GPIO_Point := (GPIO_G'Access, Pin_7);
PG8 : aliased GPIO_Point := (GPIO_G'Access, Pin_8);
PG9 : aliased GPIO_Point := (GPIO_G'Access, Pin_9);
PG10 : aliased GPIO_Point := (GPIO_G'Access, Pin_10);
PG11 : aliased GPIO_Point := (GPIO_G'Access, Pin_11);
PG12 : aliased GPIO_Point := (GPIO_G'Access, Pin_12);
PG13 : aliased GPIO_Point := (GPIO_G'Access, Pin_13);
PG14 : aliased GPIO_Point := (GPIO_G'Access, Pin_14);
PG15 : aliased GPIO_Point := (GPIO_G'Access, Pin_15);
-- GPIO_AF_RTC_50Hz_0 : constant GPIO_Alternate_Function;
-- GPIO_AF_MCO_0 : constant GPIO_Alternate_Function;
-- GPIO_AF_TAMPER_0 : constant GPIO_Alternate_Function;
-- GPIO_AF_SWJ_0 : constant GPIO_Alternate_Function;
-- GPIO_AF_TRACE_0 : constant GPIO_Alternate_Function;
-- GPIO_AF_TIM1_1 : constant GPIO_Alternate_Function;
-- GPIO_AF_TIM2_1 : constant GPIO_Alternate_Function;
-- GPIO_AF_TIM3_2 : constant GPIO_Alternate_Function;
-- GPIO_AF_TIM4_2 : constant GPIO_Alternate_Function;
-- GPIO_AF_TIM5_2 : constant GPIO_Alternate_Function;
-- GPIO_AF_TIM8_3 : constant GPIO_Alternate_Function;
-- GPIO_AF_TIM9_3 : constant GPIO_Alternate_Function;
-- GPIO_AF_TIM10_3 : constant GPIO_Alternate_Function;
-- GPIO_AF_TIM11_3 : constant GPIO_Alternate_Function;
-- GPIO_AF_I2C1_4 : constant GPIO_Alternate_Function;
-- GPIO_AF_I2C2_4 : constant GPIO_Alternate_Function;
-- GPIO_AF_I2C3_4 : constant GPIO_Alternate_Function;
-- GPIO_AF_SPI1_5 : constant GPIO_Alternate_Function;
-- GPIO_AF_SPI2_5 : constant GPIO_Alternate_Function;
-- GPIO_AF_I2S2_5 : constant GPIO_Alternate_Function;
-- GPIO_AF_I2S2ext_5 : constant GPIO_Alternate_Function;
-- GPIO_AF_SPI3_6 : constant GPIO_Alternate_Function;
-- GPIO_AF_I2S3_6 : constant GPIO_Alternate_Function;
-- GPIO_AF_I2Sext_6 : constant GPIO_Alternate_Function;
-- GPIO_AF_I2S3ext_7 : constant GPIO_Alternate_Function;
-- GPIO_AF_USART1_7 : constant GPIO_Alternate_Function;
-- GPIO_AF_USART2_7 : constant GPIO_Alternate_Function;
-- GPIO_AF_USART3_7 : constant GPIO_Alternate_Function;
-- GPIO_AF_UART4_8 : constant GPIO_Alternate_Function;
-- GPIO_AF_UART5_8 : constant GPIO_Alternate_Function;
-- GPIO_AF_USART6_8 : constant GPIO_Alternate_Function;
-- GPIO_AF_CAN1_9 : constant GPIO_Alternate_Function;
-- GPIO_AF_CAN2_9 : constant GPIO_Alternate_Function;
-- GPIO_AF_TIM12_9 : constant GPIO_Alternate_Function;
-- GPIO_AF_TIM13_9 : constant GPIO_Alternate_Function;
-- GPIO_AF_TIM14_9 : constant GPIO_Alternate_Function;
-- GPIO_AF_OTG_FS_10 : constant GPIO_Alternate_Function;
-- GPIO_AF_OTG_HS_10 : constant GPIO_Alternate_Function;
-- GPIO_AF_ETH_11 : constant GPIO_Alternate_Function;
-- GPIO_AF_FMC_12 : constant GPIO_Alternate_Function;
-- GPIO_AF_OTG_FS_12 : constant GPIO_Alternate_Function;
-- GPIO_AF_DCMI_13 : constant GPIO_Alternate_Function;
-- GPIO_AF_EVENTOUT_15 : constant GPIO_Alternate_Function;
ADC_1 : aliased Analog_To_Digital_Converter with Volatile, Import, Address => ADC1_Base;
ADC_2 : aliased Analog_To_Digital_Converter with Volatile, Import, Address => ADC2_Base;
ADC_3 : aliased Analog_To_Digital_Converter with Volatile, Import, Address => ADC3_Base;
procedure Enable_Clock (This : aliased in out Analog_To_Digital_Converter);
procedure Reset_All_ADC_Units;
-- DAC_1 : aliased Digital_To_Analog_Converter with Import, Volatile, Address => DAC_Base;
-- DAC_Channel_1_IO : GPIO_Point renames PA4;
-- DAC_Channel_2_IO : GPIO_Point renames PA5;
-- procedure Enable_Clock (This : aliased in out Digital_To_Analog_Converter);
-- procedure Reset (This : aliased in out Digital_To_Analog_Converter);
Internal_USART_1 : aliased Internal_USART with Import, Volatile, Address => USART1_Base;
Internal_USART_2 : aliased Internal_USART with Import, Volatile, Address => USART2_Base;
Internal_USART_3 : aliased Internal_USART with Import, Volatile, Address => USART3_Base;
Internal_UART_4 : aliased Internal_USART with Import, Volatile, Address => UART4_Base;
Internal_UART_5 : aliased Internal_USART with Import, Volatile, Address => UART5_Base;
USART_1 : aliased USART (Internal_USART_1'Access);
USART_2 : aliased USART (Internal_USART_2'Access);
USART_3 : aliased USART (Internal_USART_3'Access);
UART_4 : aliased USART (Internal_UART_4'Access);
UART_5 : aliased USART (Internal_UART_5'Access);
procedure Enable_Clock (This : aliased in out USART);
procedure Reset (This : aliased in out USART);
DMA_1 : aliased DMA_Controller with Import, Volatile, Address => DMA1_Base;
DMA_2 : aliased DMA_Controller with Import, Volatile, Address => DMA2_Base;
procedure Enable_Clock (This : aliased in out DMA_Controller);
procedure Reset (This : aliased in out DMA_Controller);
Internal_I2C_Port_1 : aliased Internal_I2C_Port with Import, Volatile, Address => I2C1_Base;
Internal_I2C_Port_2 : aliased Internal_I2C_Port with Import, Volatile, Address => I2C2_Base;
type I2C_Port_Id is (I2C_Id_1, I2C_Id_2);
I2C_1 : aliased I2C_Port (Internal_I2C_Port_1'Access);
I2C_2 : aliased I2C_Port (Internal_I2C_Port_2'Access);
function As_Port_Id (Port : I2C_Port) return I2C_Port_Id with Inline;
procedure Enable_Clock (This : aliased I2C_Port);
procedure Enable_Clock (This : I2C_Port_Id);
procedure Reset (This : I2C_Port);
procedure Reset (This : I2C_Port_Id);
Internal_SPI_1 : aliased Internal_SPI_Port with Import, Volatile, Address => SPI1_Base;
Internal_SPI_2 : aliased Internal_SPI_Port with Import, Volatile, Address => SPI2_Base;
Internal_SPI_3 : aliased Internal_SPI_Port with Import, Volatile, Address => SPI3_Base;
SPI_1 : aliased SPI_Port (Internal_SPI_1'Access);
SPI_2 : aliased SPI_Port (Internal_SPI_2'Access);
SPI_3 : aliased SPI_Port (Internal_SPI_3'Access);
procedure Enable_Clock (This : SPI_Port);
procedure Reset (This : in out SPI_Port);
Internal_I2S_1 : aliased Internal_I2S_Port with Import, Volatile, Address => SPI1_Base;
Internal_I2S_2 : aliased Internal_I2S_Port with Import, Volatile, Address => SPI2_Base;
Internal_I2S_3 : aliased Internal_I2S_Port with Import, Volatile, Address => SPI3_Base;
I2S_1 : aliased I2S_Port (Internal_I2S_1'Access);
I2S_2 : aliased I2S_Port (Internal_I2S_2'Access);
I2S_3 : aliased I2S_Port (Internal_I2S_3'Access);
procedure Enable_Clock (This : I2S_Port);
procedure Reset (This : in out I2S_Port);
Timer_1 : aliased Timer with Import, Volatile, Address => TIM1_Base;
Timer_2 : aliased Timer with Import, Volatile, Address => TIM2_Base;
Timer_3 : aliased Timer with Import, Volatile, Address => TIM3_Base;
Timer_4 : aliased Timer with Import, Volatile, Address => TIM4_Base;
Timer_5 : aliased Timer with Import, Volatile, Address => TIM5_Base;
Timer_6 : aliased Timer with Import, Volatile, Address => TIM6_Base;
Timer_7 : aliased Timer with Import, Volatile, Address => TIM7_Base;
Timer_8 : aliased Timer with Import, Volatile, Address => TIM8_Base;
Timer_9 : aliased Timer with Import, Volatile, Address => TIM9_Base;
Timer_10 : aliased Timer with Import, Volatile, Address => TIM10_Base;
Timer_11 : aliased Timer with Import, Volatile, Address => TIM11_Base;
Timer_12 : aliased Timer with Import, Volatile, Address => TIM12_Base;
Timer_13 : aliased Timer with Import, Volatile, Address => TIM13_Base;
Timer_14 : aliased Timer with Import, Volatile, Address => TIM14_Base;
procedure Enable_Clock (This : in out Timer);
procedure Reset (This : in out Timer);
CRC_Unit : CRC_32 with Import, Volatile, Address => CRC_Base;
procedure Enable_Clock (This : in out CRC_32);
procedure Disable_Clock (This : in out CRC_32);
procedure Reset (This : in out CRC_32);
-----------------------------
-- Reset and Clock Control --
-----------------------------
type RCC_System_Clocks is record
SYSCLK : UInt32;
HCLK : UInt32;
PCLK1 : UInt32;
PCLK2 : UInt32;
TIMCLK1 : UInt32;
TIMCLK2 : UInt32;
I2SCLK : UInt32;
end record;
function System_Clock_Frequencies return RCC_System_Clocks;
procedure Set_PLLI2S_Factors (Pll_N : UInt9;
Pll_R : UInt3);
function PLLI2S_Enabled return Boolean;
procedure Enable_PLLI2S
with Post => PLLI2S_Enabled;
procedure Disable_PLLI2S
with Post => not PLLI2S_Enabled;
procedure Enable_DCMI_Clock;
procedure Reset_DCMI;
-- RTC : aliased RTC_Device;
private
-- GPIO_AF_RTC_50Hz_0 : constant GPIO_Alternate_Function := 0;
-- GPIO_AF_MCO_0 : constant GPIO_Alternate_Function := 0;
-- GPIO_AF_TAMPER_0 : constant GPIO_Alternate_Function := 0;
-- GPIO_AF_SWJ_0 : constant GPIO_Alternate_Function := 0;
-- GPIO_AF_TRACE_0 : constant GPIO_Alternate_Function := 0;
-- GPIO_AF_TIM1_1 : constant GPIO_Alternate_Function := 1;
-- GPIO_AF_TIM2_1 : constant GPIO_Alternate_Function := 1;
-- GPIO_AF_TIM3_2 : constant GPIO_Alternate_Function := 2;
-- GPIO_AF_TIM4_2 : constant GPIO_Alternate_Function := 2;
-- GPIO_AF_TIM5_2 : constant GPIO_Alternate_Function := 2;
-- GPIO_AF_TIM8_3 : constant GPIO_Alternate_Function := 3;
-- GPIO_AF_TIM9_3 : constant GPIO_Alternate_Function := 3;
-- GPIO_AF_TIM10_3 : constant GPIO_Alternate_Function := 3;
-- GPIO_AF_TIM11_3 : constant GPIO_Alternate_Function := 3;
-- GPIO_AF_I2C1_4 : constant GPIO_Alternate_Function := 4;
-- GPIO_AF_I2C2_4 : constant GPIO_Alternate_Function := 4;
-- GPIO_AF_I2C3_4 : constant GPIO_Alternate_Function := 4;
-- GPIO_AF_SPI1_5 : constant GPIO_Alternate_Function := 5;
-- GPIO_AF_SPI2_5 : constant GPIO_Alternate_Function := 5;
-- GPIO_AF_I2S2_5 : constant GPIO_Alternate_Function := 5;
-- GPIO_AF_I2S2ext_5 : constant GPIO_Alternate_Function := 5;
-- GPIO_AF_SPI3_6 : constant GPIO_Alternate_Function := 6;
-- GPIO_AF_I2S3_6 : constant GPIO_Alternate_Function := 6;
-- GPIO_AF_I2Sext_6 : constant GPIO_Alternate_Function := 6;
-- GPIO_AF_I2S3ext_7 : constant GPIO_Alternate_Function := 7;
-- GPIO_AF_USART1_7 : constant GPIO_Alternate_Function := 7;
-- GPIO_AF_USART2_7 : constant GPIO_Alternate_Function := 7;
-- GPIO_AF_USART3_7 : constant GPIO_Alternate_Function := 7;
-- GPIO_AF_UART4_8 : constant GPIO_Alternate_Function := 8;
-- GPIO_AF_UART5_8 : constant GPIO_Alternate_Function := 8;
-- GPIO_AF_USART6_8 : constant GPIO_Alternate_Function := 8;
-- GPIO_AF_CAN1_9 : constant GPIO_Alternate_Function := 9;
-- GPIO_AF_CAN2_9 : constant GPIO_Alternate_Function := 9;
-- GPIO_AF_TIM12_9 : constant GPIO_Alternate_Function := 9;
-- GPIO_AF_TIM13_9 : constant GPIO_Alternate_Function := 9;
-- GPIO_AF_TIM14_9 : constant GPIO_Alternate_Function := 9;
-- GPIO_AF_OTG_FS_10 : constant GPIO_Alternate_Function := 10;
-- GPIO_AF_OTG_HS_10 : constant GPIO_Alternate_Function := 10;
-- GPIO_AF_ETH_11 : constant GPIO_Alternate_Function := 11;
-- GPIO_AF_FMC_12 : constant GPIO_Alternate_Function := 12;
-- GPIO_AF_OTG_FS_12 : constant GPIO_Alternate_Function := 12;
-- GPIO_AF_DCMI_13 : constant GPIO_Alternate_Function := 13;
-- GPIO_AF_EVENTOUT_15 : constant GPIO_Alternate_Function := 15;
end STM32.Device;
|
pragma Style_Checks (Off);
-- This spec has been automatically generated from ATSAMD51G19A.svd
pragma Restrictions (No_Elaboration_Code);
with HAL;
with System;
package SAM_SVD.TCC is
pragma Preelaborate;
---------------
-- Registers --
---------------
-- Enhanced Resolution
type CTRLA_RESOLUTIONSelect is
(-- Dithering is disabled
NONE,
-- Dithering is done every 16 PWM frames
DITH4,
-- Dithering is done every 32 PWM frames
DITH5,
-- Dithering is done every 64 PWM frames
DITH6)
with Size => 2;
for CTRLA_RESOLUTIONSelect use
(NONE => 0,
DITH4 => 1,
DITH5 => 2,
DITH6 => 3);
-- Prescaler
type CTRLA_PRESCALERSelect is
(-- No division
DIV1,
-- Divide by 2
DIV2,
-- Divide by 4
DIV4,
-- Divide by 8
DIV8,
-- Divide by 16
DIV16,
-- Divide by 64
DIV64,
-- Divide by 256
DIV256,
-- Divide by 1024
DIV1024)
with Size => 3;
for CTRLA_PRESCALERSelect use
(DIV1 => 0,
DIV2 => 1,
DIV4 => 2,
DIV8 => 3,
DIV16 => 4,
DIV64 => 5,
DIV256 => 6,
DIV1024 => 7);
-- Prescaler and Counter Synchronization Selection
type CTRLA_PRESCSYNCSelect is
(-- Reload or reset counter on next GCLK
GCLK,
-- Reload or reset counter on next prescaler clock
PRESC,
-- Reload or reset counter on next GCLK and reset prescaler counter
RESYNC)
with Size => 2;
for CTRLA_PRESCSYNCSelect use
(GCLK => 0,
PRESC => 1,
RESYNC => 2);
-- TCC_CTRLA_CPTEN array
type TCC_CTRLA_CPTEN_Field_Array is array (0 .. 5) of Boolean
with Component_Size => 1, Size => 6;
-- Type definition for TCC_CTRLA_CPTEN
type TCC_CTRLA_CPTEN_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- CPTEN as a value
Val : HAL.UInt6;
when True =>
-- CPTEN as an array
Arr : TCC_CTRLA_CPTEN_Field_Array;
end case;
end record
with Unchecked_Union, Size => 6;
for TCC_CTRLA_CPTEN_Field use record
Val at 0 range 0 .. 5;
Arr at 0 range 0 .. 5;
end record;
-- Control A
type TCC_CTRLA_Register is record
-- Software Reset
SWRST : Boolean := False;
-- Enable
ENABLE : Boolean := False;
-- unspecified
Reserved_2_4 : HAL.UInt3 := 16#0#;
-- Enhanced Resolution
RESOLUTION : CTRLA_RESOLUTIONSelect := SAM_SVD.TCC.NONE;
-- unspecified
Reserved_7_7 : HAL.Bit := 16#0#;
-- Prescaler
PRESCALER : CTRLA_PRESCALERSelect := SAM_SVD.TCC.DIV1;
-- Run in Standby
RUNSTDBY : Boolean := False;
-- Prescaler and Counter Synchronization Selection
PRESCSYNC : CTRLA_PRESCSYNCSelect := SAM_SVD.TCC.GCLK;
-- Auto Lock
ALOCK : Boolean := False;
-- Master Synchronization (only for TCC Slave Instance)
MSYNC : Boolean := False;
-- unspecified
Reserved_16_22 : HAL.UInt7 := 16#0#;
-- DMA One-shot Trigger Mode
DMAOS : Boolean := False;
-- Capture Channel 0 Enable
CPTEN : TCC_CTRLA_CPTEN_Field :=
(As_Array => False, Val => 16#0#);
-- unspecified
Reserved_30_31 : HAL.UInt2 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TCC_CTRLA_Register use record
SWRST at 0 range 0 .. 0;
ENABLE at 0 range 1 .. 1;
Reserved_2_4 at 0 range 2 .. 4;
RESOLUTION at 0 range 5 .. 6;
Reserved_7_7 at 0 range 7 .. 7;
PRESCALER at 0 range 8 .. 10;
RUNSTDBY at 0 range 11 .. 11;
PRESCSYNC at 0 range 12 .. 13;
ALOCK at 0 range 14 .. 14;
MSYNC at 0 range 15 .. 15;
Reserved_16_22 at 0 range 16 .. 22;
DMAOS at 0 range 23 .. 23;
CPTEN at 0 range 24 .. 29;
Reserved_30_31 at 0 range 30 .. 31;
end record;
-- Ramp Index Command
type CTRLBCLR_IDXCMDSelect is
(-- Command disabled: Index toggles between cycles A and B
DISABLE,
-- Set index: cycle B will be forced in the next cycle
SET,
-- Clear index: cycle A will be forced in the next cycle
CLEAR,
-- Hold index: the next cycle will be the same as the current cycle
HOLD)
with Size => 2;
for CTRLBCLR_IDXCMDSelect use
(DISABLE => 0,
SET => 1,
CLEAR => 2,
HOLD => 3);
-- TCC Command
type CTRLBCLR_CMDSelect is
(-- No action
NONE,
-- Clear start, restart or retrigger
RETRIGGER,
-- Force stop
STOP,
-- Force update or double buffered registers
UPDATE,
-- Force COUNT read synchronization
READSYNC,
-- One-shot DMA trigger
DMAOS)
with Size => 3;
for CTRLBCLR_CMDSelect use
(NONE => 0,
RETRIGGER => 1,
STOP => 2,
UPDATE => 3,
READSYNC => 4,
DMAOS => 5);
-- Control B Clear
type TCC_CTRLBCLR_Register is record
-- Counter Direction
DIR : Boolean := False;
-- Lock Update
LUPD : Boolean := False;
-- One-Shot
ONESHOT : Boolean := False;
-- Ramp Index Command
IDXCMD : CTRLBCLR_IDXCMDSelect := SAM_SVD.TCC.DISABLE;
-- TCC Command
CMD : CTRLBCLR_CMDSelect := SAM_SVD.TCC.NONE;
end record
with Volatile_Full_Access, Object_Size => 8,
Bit_Order => System.Low_Order_First;
for TCC_CTRLBCLR_Register use record
DIR at 0 range 0 .. 0;
LUPD at 0 range 1 .. 1;
ONESHOT at 0 range 2 .. 2;
IDXCMD at 0 range 3 .. 4;
CMD at 0 range 5 .. 7;
end record;
-- Ramp Index Command
type CTRLBSET_IDXCMDSelect is
(-- Command disabled: Index toggles between cycles A and B
DISABLE,
-- Set index: cycle B will be forced in the next cycle
SET,
-- Clear index: cycle A will be forced in the next cycle
CLEAR,
-- Hold index: the next cycle will be the same as the current cycle
HOLD)
with Size => 2;
for CTRLBSET_IDXCMDSelect use
(DISABLE => 0,
SET => 1,
CLEAR => 2,
HOLD => 3);
-- TCC Command
type CTRLBSET_CMDSelect is
(-- No action
NONE,
-- Clear start, restart or retrigger
RETRIGGER,
-- Force stop
STOP,
-- Force update or double buffered registers
UPDATE,
-- Force COUNT read synchronization
READSYNC,
-- One-shot DMA trigger
DMAOS)
with Size => 3;
for CTRLBSET_CMDSelect use
(NONE => 0,
RETRIGGER => 1,
STOP => 2,
UPDATE => 3,
READSYNC => 4,
DMAOS => 5);
-- Control B Set
type TCC_CTRLBSET_Register is record
-- Counter Direction
DIR : Boolean := False;
-- Lock Update
LUPD : Boolean := False;
-- One-Shot
ONESHOT : Boolean := False;
-- Ramp Index Command
IDXCMD : CTRLBSET_IDXCMDSelect := SAM_SVD.TCC.DISABLE;
-- TCC Command
CMD : CTRLBSET_CMDSelect := SAM_SVD.TCC.NONE;
end record
with Volatile_Full_Access, Object_Size => 8,
Bit_Order => System.Low_Order_First;
for TCC_CTRLBSET_Register use record
DIR at 0 range 0 .. 0;
LUPD at 0 range 1 .. 1;
ONESHOT at 0 range 2 .. 2;
IDXCMD at 0 range 3 .. 4;
CMD at 0 range 5 .. 7;
end record;
-- TCC_SYNCBUSY_CC array
type TCC_SYNCBUSY_CC_Field_Array is array (0 .. 5) of Boolean
with Component_Size => 1, Size => 6;
-- Type definition for TCC_SYNCBUSY_CC
type TCC_SYNCBUSY_CC_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- CC as a value
Val : HAL.UInt6;
when True =>
-- CC as an array
Arr : TCC_SYNCBUSY_CC_Field_Array;
end case;
end record
with Unchecked_Union, Size => 6;
for TCC_SYNCBUSY_CC_Field use record
Val at 0 range 0 .. 5;
Arr at 0 range 0 .. 5;
end record;
-- Synchronization Busy
type TCC_SYNCBUSY_Register is record
-- Read-only. Swrst Busy
SWRST : Boolean;
-- Read-only. Enable Busy
ENABLE : Boolean;
-- Read-only. Ctrlb Busy
CTRLB : Boolean;
-- Read-only. Status Busy
STATUS : Boolean;
-- Read-only. Count Busy
COUNT : Boolean;
-- Read-only. Pattern Busy
PATT : Boolean;
-- Read-only. Wave Busy
WAVE : Boolean;
-- Read-only. Period Busy
PER : Boolean;
-- Read-only. Compare Channel 0 Busy
CC : TCC_SYNCBUSY_CC_Field;
-- unspecified
Reserved_14_31 : HAL.UInt18;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TCC_SYNCBUSY_Register use record
SWRST at 0 range 0 .. 0;
ENABLE at 0 range 1 .. 1;
CTRLB at 0 range 2 .. 2;
STATUS at 0 range 3 .. 3;
COUNT at 0 range 4 .. 4;
PATT at 0 range 5 .. 5;
WAVE at 0 range 6 .. 6;
PER at 0 range 7 .. 7;
CC at 0 range 8 .. 13;
Reserved_14_31 at 0 range 14 .. 31;
end record;
-- Fault A Source
type FCTRLA_SRCSelect is
(-- Fault input disabled
DISABLE,
-- MCEx (x=0,1) event input
ENABLE,
-- Inverted MCEx (x=0,1) event input
INVERT,
-- Alternate fault (A or B) state at the end of the previous period
ALTFAULT)
with Size => 2;
for FCTRLA_SRCSelect use
(DISABLE => 0,
ENABLE => 1,
INVERT => 2,
ALTFAULT => 3);
-- Fault A Blanking Mode
type FCTRLA_BLANKSelect is
(-- Blanking applied from start of the ramp
START,
-- Blanking applied from rising edge of the output waveform
RISE,
-- Blanking applied from falling edge of the output waveform
FALL,
-- Blanking applied from each toggle of the output waveform
BOTH)
with Size => 2;
for FCTRLA_BLANKSelect use
(START => 0,
RISE => 1,
FALL => 2,
BOTH => 3);
-- Fault A Halt Mode
type FCTRLA_HALTSelect is
(-- Halt action disabled
DISABLE,
-- Hardware halt action
HW,
-- Software halt action
SW,
-- Non-recoverable fault
NR)
with Size => 2;
for FCTRLA_HALTSelect use
(DISABLE => 0,
HW => 1,
SW => 2,
NR => 3);
-- Fault A Capture Channel
type FCTRLA_CHSELSelect is
(-- Capture value stored in channel 0
CC0,
-- Capture value stored in channel 1
CC1,
-- Capture value stored in channel 2
CC2,
-- Capture value stored in channel 3
CC3)
with Size => 2;
for FCTRLA_CHSELSelect use
(CC0 => 0,
CC1 => 1,
CC2 => 2,
CC3 => 3);
-- Fault A Capture Action
type FCTRLA_CAPTURESelect is
(-- No capture
DISABLE,
-- Capture on fault
CAPT,
-- Minimum capture
CAPTMIN,
-- Maximum capture
CAPTMAX,
-- Minimum local detection
LOCMIN,
-- Maximum local detection
LOCMAX,
-- Minimum and maximum local detection
DERIV0,
-- Capture with ramp index as MSB value
CAPTMARK)
with Size => 3;
for FCTRLA_CAPTURESelect use
(DISABLE => 0,
CAPT => 1,
CAPTMIN => 2,
CAPTMAX => 3,
LOCMIN => 4,
LOCMAX => 5,
DERIV0 => 6,
CAPTMARK => 7);
subtype TCC_FCTRLA_BLANKVAL_Field is HAL.UInt8;
subtype TCC_FCTRLA_FILTERVAL_Field is HAL.UInt4;
-- Recoverable Fault A Configuration
type TCC_FCTRLA_Register is record
-- Fault A Source
SRC : FCTRLA_SRCSelect := SAM_SVD.TCC.DISABLE;
-- unspecified
Reserved_2_2 : HAL.Bit := 16#0#;
-- Fault A Keeper
KEEP : Boolean := False;
-- Fault A Qualification
QUAL : Boolean := False;
-- Fault A Blanking Mode
BLANK : FCTRLA_BLANKSelect := SAM_SVD.TCC.START;
-- Fault A Restart
RESTART : Boolean := False;
-- Fault A Halt Mode
HALT : FCTRLA_HALTSelect := SAM_SVD.TCC.DISABLE;
-- Fault A Capture Channel
CHSEL : FCTRLA_CHSELSelect := SAM_SVD.TCC.CC0;
-- Fault A Capture Action
CAPTURE : FCTRLA_CAPTURESelect := SAM_SVD.TCC.DISABLE;
-- Fault A Blanking Prescaler
BLANKPRESC : Boolean := False;
-- Fault A Blanking Time
BLANKVAL : TCC_FCTRLA_BLANKVAL_Field := 16#0#;
-- Fault A Filter Value
FILTERVAL : TCC_FCTRLA_FILTERVAL_Field := 16#0#;
-- unspecified
Reserved_28_31 : HAL.UInt4 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TCC_FCTRLA_Register use record
SRC at 0 range 0 .. 1;
Reserved_2_2 at 0 range 2 .. 2;
KEEP at 0 range 3 .. 3;
QUAL at 0 range 4 .. 4;
BLANK at 0 range 5 .. 6;
RESTART at 0 range 7 .. 7;
HALT at 0 range 8 .. 9;
CHSEL at 0 range 10 .. 11;
CAPTURE at 0 range 12 .. 14;
BLANKPRESC at 0 range 15 .. 15;
BLANKVAL at 0 range 16 .. 23;
FILTERVAL at 0 range 24 .. 27;
Reserved_28_31 at 0 range 28 .. 31;
end record;
-- Fault B Source
type FCTRLB_SRCSelect is
(-- Fault input disabled
DISABLE,
-- MCEx (x=0,1) event input
ENABLE,
-- Inverted MCEx (x=0,1) event input
INVERT,
-- Alternate fault (A or B) state at the end of the previous period
ALTFAULT)
with Size => 2;
for FCTRLB_SRCSelect use
(DISABLE => 0,
ENABLE => 1,
INVERT => 2,
ALTFAULT => 3);
-- Fault B Blanking Mode
type FCTRLB_BLANKSelect is
(-- Blanking applied from start of the ramp
START,
-- Blanking applied from rising edge of the output waveform
RISE,
-- Blanking applied from falling edge of the output waveform
FALL,
-- Blanking applied from each toggle of the output waveform
BOTH)
with Size => 2;
for FCTRLB_BLANKSelect use
(START => 0,
RISE => 1,
FALL => 2,
BOTH => 3);
-- Fault B Halt Mode
type FCTRLB_HALTSelect is
(-- Halt action disabled
DISABLE,
-- Hardware halt action
HW,
-- Software halt action
SW,
-- Non-recoverable fault
NR)
with Size => 2;
for FCTRLB_HALTSelect use
(DISABLE => 0,
HW => 1,
SW => 2,
NR => 3);
-- Fault B Capture Channel
type FCTRLB_CHSELSelect is
(-- Capture value stored in channel 0
CC0,
-- Capture value stored in channel 1
CC1,
-- Capture value stored in channel 2
CC2,
-- Capture value stored in channel 3
CC3)
with Size => 2;
for FCTRLB_CHSELSelect use
(CC0 => 0,
CC1 => 1,
CC2 => 2,
CC3 => 3);
-- Fault B Capture Action
type FCTRLB_CAPTURESelect is
(-- No capture
DISABLE,
-- Capture on fault
CAPT,
-- Minimum capture
CAPTMIN,
-- Maximum capture
CAPTMAX,
-- Minimum local detection
LOCMIN,
-- Maximum local detection
LOCMAX,
-- Minimum and maximum local detection
DERIV0,
-- Capture with ramp index as MSB value
CAPTMARK)
with Size => 3;
for FCTRLB_CAPTURESelect use
(DISABLE => 0,
CAPT => 1,
CAPTMIN => 2,
CAPTMAX => 3,
LOCMIN => 4,
LOCMAX => 5,
DERIV0 => 6,
CAPTMARK => 7);
subtype TCC_FCTRLB_BLANKVAL_Field is HAL.UInt8;
subtype TCC_FCTRLB_FILTERVAL_Field is HAL.UInt4;
-- Recoverable Fault B Configuration
type TCC_FCTRLB_Register is record
-- Fault B Source
SRC : FCTRLB_SRCSelect := SAM_SVD.TCC.DISABLE;
-- unspecified
Reserved_2_2 : HAL.Bit := 16#0#;
-- Fault B Keeper
KEEP : Boolean := False;
-- Fault B Qualification
QUAL : Boolean := False;
-- Fault B Blanking Mode
BLANK : FCTRLB_BLANKSelect := SAM_SVD.TCC.START;
-- Fault B Restart
RESTART : Boolean := False;
-- Fault B Halt Mode
HALT : FCTRLB_HALTSelect := SAM_SVD.TCC.DISABLE;
-- Fault B Capture Channel
CHSEL : FCTRLB_CHSELSelect := SAM_SVD.TCC.CC0;
-- Fault B Capture Action
CAPTURE : FCTRLB_CAPTURESelect := SAM_SVD.TCC.DISABLE;
-- Fault B Blanking Prescaler
BLANKPRESC : Boolean := False;
-- Fault B Blanking Time
BLANKVAL : TCC_FCTRLB_BLANKVAL_Field := 16#0#;
-- Fault B Filter Value
FILTERVAL : TCC_FCTRLB_FILTERVAL_Field := 16#0#;
-- unspecified
Reserved_28_31 : HAL.UInt4 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TCC_FCTRLB_Register use record
SRC at 0 range 0 .. 1;
Reserved_2_2 at 0 range 2 .. 2;
KEEP at 0 range 3 .. 3;
QUAL at 0 range 4 .. 4;
BLANK at 0 range 5 .. 6;
RESTART at 0 range 7 .. 7;
HALT at 0 range 8 .. 9;
CHSEL at 0 range 10 .. 11;
CAPTURE at 0 range 12 .. 14;
BLANKPRESC at 0 range 15 .. 15;
BLANKVAL at 0 range 16 .. 23;
FILTERVAL at 0 range 24 .. 27;
Reserved_28_31 at 0 range 28 .. 31;
end record;
subtype TCC_WEXCTRL_OTMX_Field is HAL.UInt2;
-- TCC_WEXCTRL_DTIEN array
type TCC_WEXCTRL_DTIEN_Field_Array is array (0 .. 3) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for TCC_WEXCTRL_DTIEN
type TCC_WEXCTRL_DTIEN_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- DTIEN as a value
Val : HAL.UInt4;
when True =>
-- DTIEN as an array
Arr : TCC_WEXCTRL_DTIEN_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for TCC_WEXCTRL_DTIEN_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
subtype TCC_WEXCTRL_DTLS_Field is HAL.UInt8;
subtype TCC_WEXCTRL_DTHS_Field is HAL.UInt8;
-- Waveform Extension Configuration
type TCC_WEXCTRL_Register is record
-- Output Matrix
OTMX : TCC_WEXCTRL_OTMX_Field := 16#0#;
-- unspecified
Reserved_2_7 : HAL.UInt6 := 16#0#;
-- Dead-time Insertion Generator 0 Enable
DTIEN : TCC_WEXCTRL_DTIEN_Field :=
(As_Array => False, Val => 16#0#);
-- unspecified
Reserved_12_15 : HAL.UInt4 := 16#0#;
-- Dead-time Low Side Outputs Value
DTLS : TCC_WEXCTRL_DTLS_Field := 16#0#;
-- Dead-time High Side Outputs Value
DTHS : TCC_WEXCTRL_DTHS_Field := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TCC_WEXCTRL_Register use record
OTMX at 0 range 0 .. 1;
Reserved_2_7 at 0 range 2 .. 7;
DTIEN at 0 range 8 .. 11;
Reserved_12_15 at 0 range 12 .. 15;
DTLS at 0 range 16 .. 23;
DTHS at 0 range 24 .. 31;
end record;
-- TCC_DRVCTRL_NRE array
type TCC_DRVCTRL_NRE_Field_Array is array (0 .. 7) of Boolean
with Component_Size => 1, Size => 8;
-- Type definition for TCC_DRVCTRL_NRE
type TCC_DRVCTRL_NRE_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- NRE as a value
Val : HAL.UInt8;
when True =>
-- NRE as an array
Arr : TCC_DRVCTRL_NRE_Field_Array;
end case;
end record
with Unchecked_Union, Size => 8;
for TCC_DRVCTRL_NRE_Field use record
Val at 0 range 0 .. 7;
Arr at 0 range 0 .. 7;
end record;
-- TCC_DRVCTRL_NRV array
type TCC_DRVCTRL_NRV_Field_Array is array (0 .. 7) of Boolean
with Component_Size => 1, Size => 8;
-- Type definition for TCC_DRVCTRL_NRV
type TCC_DRVCTRL_NRV_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- NRV as a value
Val : HAL.UInt8;
when True =>
-- NRV as an array
Arr : TCC_DRVCTRL_NRV_Field_Array;
end case;
end record
with Unchecked_Union, Size => 8;
for TCC_DRVCTRL_NRV_Field use record
Val at 0 range 0 .. 7;
Arr at 0 range 0 .. 7;
end record;
-- TCC_DRVCTRL_INVEN array
type TCC_DRVCTRL_INVEN_Field_Array is array (0 .. 7) of Boolean
with Component_Size => 1, Size => 8;
-- Type definition for TCC_DRVCTRL_INVEN
type TCC_DRVCTRL_INVEN_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- INVEN as a value
Val : HAL.UInt8;
when True =>
-- INVEN as an array
Arr : TCC_DRVCTRL_INVEN_Field_Array;
end case;
end record
with Unchecked_Union, Size => 8;
for TCC_DRVCTRL_INVEN_Field use record
Val at 0 range 0 .. 7;
Arr at 0 range 0 .. 7;
end record;
-- TCC_DRVCTRL_FILTERVAL array element
subtype TCC_DRVCTRL_FILTERVAL_Element is HAL.UInt4;
-- TCC_DRVCTRL_FILTERVAL array
type TCC_DRVCTRL_FILTERVAL_Field_Array is array (0 .. 1)
of TCC_DRVCTRL_FILTERVAL_Element
with Component_Size => 4, Size => 8;
-- Type definition for TCC_DRVCTRL_FILTERVAL
type TCC_DRVCTRL_FILTERVAL_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FILTERVAL as a value
Val : HAL.UInt8;
when True =>
-- FILTERVAL as an array
Arr : TCC_DRVCTRL_FILTERVAL_Field_Array;
end case;
end record
with Unchecked_Union, Size => 8;
for TCC_DRVCTRL_FILTERVAL_Field use record
Val at 0 range 0 .. 7;
Arr at 0 range 0 .. 7;
end record;
-- Driver Control
type TCC_DRVCTRL_Register is record
-- Non-Recoverable State 0 Output Enable
NRE : TCC_DRVCTRL_NRE_Field := (As_Array => False, Val => 16#0#);
-- Non-Recoverable State 0 Output Value
NRV : TCC_DRVCTRL_NRV_Field := (As_Array => False, Val => 16#0#);
-- Output Waveform 0 Inversion
INVEN : TCC_DRVCTRL_INVEN_Field :=
(As_Array => False, Val => 16#0#);
-- Non-Recoverable Fault Input 0 Filter Value
FILTERVAL : TCC_DRVCTRL_FILTERVAL_Field :=
(As_Array => False, Val => 16#0#);
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TCC_DRVCTRL_Register use record
NRE at 0 range 0 .. 7;
NRV at 0 range 8 .. 15;
INVEN at 0 range 16 .. 23;
FILTERVAL at 0 range 24 .. 31;
end record;
-- Debug Control
type TCC_DBGCTRL_Register is record
-- Debug Running Mode
DBGRUN : Boolean := False;
-- unspecified
Reserved_1_1 : HAL.Bit := 16#0#;
-- Fault Detection on Debug Break Detection
FDDBD : Boolean := False;
-- unspecified
Reserved_3_7 : HAL.UInt5 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 8,
Bit_Order => System.Low_Order_First;
for TCC_DBGCTRL_Register use record
DBGRUN at 0 range 0 .. 0;
Reserved_1_1 at 0 range 1 .. 1;
FDDBD at 0 range 2 .. 2;
Reserved_3_7 at 0 range 3 .. 7;
end record;
-- Timer/counter Input Event0 Action
type EVCTRL_EVACT0Select is
(-- Event action disabled
OFF,
-- Start, restart or re-trigger counter on event
RETRIGGER,
-- Count on event
COUNTEV,
-- Start counter on event
START,
-- Increment counter on event
INC,
-- Count on active state of asynchronous event
COUNT,
-- Stamp capture
STAMP,
-- Non-recoverable fault
FAULT)
with Size => 3;
for EVCTRL_EVACT0Select use
(OFF => 0,
RETRIGGER => 1,
COUNTEV => 2,
START => 3,
INC => 4,
COUNT => 5,
STAMP => 6,
FAULT => 7);
-- Timer/counter Input Event1 Action
type EVCTRL_EVACT1Select is
(-- Event action disabled
OFF,
-- Re-trigger counter on event
RETRIGGER,
-- Direction control
DIR,
-- Stop counter on event
STOP,
-- Decrement counter on event
DEC,
-- Period capture value in CC0 register, pulse width capture value in CC1
-- register
PPW,
-- Period capture value in CC1 register, pulse width capture value in CC0
-- register
PWP,
-- Non-recoverable fault
FAULT)
with Size => 3;
for EVCTRL_EVACT1Select use
(OFF => 0,
RETRIGGER => 1,
DIR => 2,
STOP => 3,
DEC => 4,
PPW => 5,
PWP => 6,
FAULT => 7);
-- Timer/counter Output Event Mode
type EVCTRL_CNTSELSelect is
(-- An interrupt/event is generated when a new counter cycle starts
START,
-- An interrupt/event is generated when a counter cycle ends
END_k,
-- An interrupt/event is generated when a counter cycle ends, except for the
-- first and last cycles
BETWEEN,
-- An interrupt/event is generated when a new counter cycle starts or a
-- counter cycle ends
BOUNDARY)
with Size => 2;
for EVCTRL_CNTSELSelect use
(START => 0,
END_k => 1,
BETWEEN => 2,
BOUNDARY => 3);
-- TCC_EVCTRL_TCINV array
type TCC_EVCTRL_TCINV_Field_Array is array (0 .. 1) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for TCC_EVCTRL_TCINV
type TCC_EVCTRL_TCINV_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TCINV as a value
Val : HAL.UInt2;
when True =>
-- TCINV as an array
Arr : TCC_EVCTRL_TCINV_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for TCC_EVCTRL_TCINV_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- TCC_EVCTRL_TCEI array
type TCC_EVCTRL_TCEI_Field_Array is array (0 .. 1) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for TCC_EVCTRL_TCEI
type TCC_EVCTRL_TCEI_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TCEI as a value
Val : HAL.UInt2;
when True =>
-- TCEI as an array
Arr : TCC_EVCTRL_TCEI_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for TCC_EVCTRL_TCEI_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- TCC_EVCTRL_MCEI array
type TCC_EVCTRL_MCEI_Field_Array is array (0 .. 5) of Boolean
with Component_Size => 1, Size => 6;
-- Type definition for TCC_EVCTRL_MCEI
type TCC_EVCTRL_MCEI_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MCEI as a value
Val : HAL.UInt6;
when True =>
-- MCEI as an array
Arr : TCC_EVCTRL_MCEI_Field_Array;
end case;
end record
with Unchecked_Union, Size => 6;
for TCC_EVCTRL_MCEI_Field use record
Val at 0 range 0 .. 5;
Arr at 0 range 0 .. 5;
end record;
-- TCC_EVCTRL_MCEO array
type TCC_EVCTRL_MCEO_Field_Array is array (0 .. 5) of Boolean
with Component_Size => 1, Size => 6;
-- Type definition for TCC_EVCTRL_MCEO
type TCC_EVCTRL_MCEO_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MCEO as a value
Val : HAL.UInt6;
when True =>
-- MCEO as an array
Arr : TCC_EVCTRL_MCEO_Field_Array;
end case;
end record
with Unchecked_Union, Size => 6;
for TCC_EVCTRL_MCEO_Field use record
Val at 0 range 0 .. 5;
Arr at 0 range 0 .. 5;
end record;
-- Event Control
type TCC_EVCTRL_Register is record
-- Timer/counter Input Event0 Action
EVACT0 : EVCTRL_EVACT0Select := SAM_SVD.TCC.OFF;
-- Timer/counter Input Event1 Action
EVACT1 : EVCTRL_EVACT1Select := SAM_SVD.TCC.OFF;
-- Timer/counter Output Event Mode
CNTSEL : EVCTRL_CNTSELSelect := SAM_SVD.TCC.START;
-- Overflow/Underflow Output Event Enable
OVFEO : Boolean := False;
-- Retrigger Output Event Enable
TRGEO : Boolean := False;
-- Timer/counter Output Event Enable
CNTEO : Boolean := False;
-- unspecified
Reserved_11_11 : HAL.Bit := 16#0#;
-- Inverted Event 0 Input Enable
TCINV : TCC_EVCTRL_TCINV_Field :=
(As_Array => False, Val => 16#0#);
-- Timer/counter Event 0 Input Enable
TCEI : TCC_EVCTRL_TCEI_Field :=
(As_Array => False, Val => 16#0#);
-- Match or Capture Channel 0 Event Input Enable
MCEI : TCC_EVCTRL_MCEI_Field :=
(As_Array => False, Val => 16#0#);
-- unspecified
Reserved_22_23 : HAL.UInt2 := 16#0#;
-- Match or Capture Channel 0 Event Output Enable
MCEO : TCC_EVCTRL_MCEO_Field :=
(As_Array => False, Val => 16#0#);
-- unspecified
Reserved_30_31 : HAL.UInt2 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TCC_EVCTRL_Register use record
EVACT0 at 0 range 0 .. 2;
EVACT1 at 0 range 3 .. 5;
CNTSEL at 0 range 6 .. 7;
OVFEO at 0 range 8 .. 8;
TRGEO at 0 range 9 .. 9;
CNTEO at 0 range 10 .. 10;
Reserved_11_11 at 0 range 11 .. 11;
TCINV at 0 range 12 .. 13;
TCEI at 0 range 14 .. 15;
MCEI at 0 range 16 .. 21;
Reserved_22_23 at 0 range 22 .. 23;
MCEO at 0 range 24 .. 29;
Reserved_30_31 at 0 range 30 .. 31;
end record;
-- TCC_INTENCLR_FAULT array
type TCC_INTENCLR_FAULT_Field_Array is array (0 .. 1) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for TCC_INTENCLR_FAULT
type TCC_INTENCLR_FAULT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FAULT as a value
Val : HAL.UInt2;
when True =>
-- FAULT as an array
Arr : TCC_INTENCLR_FAULT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for TCC_INTENCLR_FAULT_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- TCC_INTENCLR_MC array
type TCC_INTENCLR_MC_Field_Array is array (0 .. 5) of Boolean
with Component_Size => 1, Size => 6;
-- Type definition for TCC_INTENCLR_MC
type TCC_INTENCLR_MC_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MC as a value
Val : HAL.UInt6;
when True =>
-- MC as an array
Arr : TCC_INTENCLR_MC_Field_Array;
end case;
end record
with Unchecked_Union, Size => 6;
for TCC_INTENCLR_MC_Field use record
Val at 0 range 0 .. 5;
Arr at 0 range 0 .. 5;
end record;
-- Interrupt Enable Clear
type TCC_INTENCLR_Register is record
-- Overflow Interrupt Enable
OVF : Boolean := False;
-- Retrigger Interrupt Enable
TRG : Boolean := False;
-- Counter Interrupt Enable
CNT : Boolean := False;
-- Error Interrupt Enable
ERR : Boolean := False;
-- unspecified
Reserved_4_9 : HAL.UInt6 := 16#0#;
-- Non-Recoverable Update Fault Interrupt Enable
UFS : Boolean := False;
-- Non-Recoverable Debug Fault Interrupt Enable
DFS : Boolean := False;
-- Recoverable Fault A Interrupt Enable
FAULTA : Boolean := False;
-- Recoverable Fault B Interrupt Enable
FAULTB : Boolean := False;
-- Non-Recoverable Fault 0 Interrupt Enable
FAULT : TCC_INTENCLR_FAULT_Field :=
(As_Array => False, Val => 16#0#);
-- Match or Capture Channel 0 Interrupt Enable
MC : TCC_INTENCLR_MC_Field :=
(As_Array => False, Val => 16#0#);
-- unspecified
Reserved_22_31 : HAL.UInt10 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TCC_INTENCLR_Register use record
OVF at 0 range 0 .. 0;
TRG at 0 range 1 .. 1;
CNT at 0 range 2 .. 2;
ERR at 0 range 3 .. 3;
Reserved_4_9 at 0 range 4 .. 9;
UFS at 0 range 10 .. 10;
DFS at 0 range 11 .. 11;
FAULTA at 0 range 12 .. 12;
FAULTB at 0 range 13 .. 13;
FAULT at 0 range 14 .. 15;
MC at 0 range 16 .. 21;
Reserved_22_31 at 0 range 22 .. 31;
end record;
-- TCC_INTENSET_FAULT array
type TCC_INTENSET_FAULT_Field_Array is array (0 .. 1) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for TCC_INTENSET_FAULT
type TCC_INTENSET_FAULT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FAULT as a value
Val : HAL.UInt2;
when True =>
-- FAULT as an array
Arr : TCC_INTENSET_FAULT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for TCC_INTENSET_FAULT_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- TCC_INTENSET_MC array
type TCC_INTENSET_MC_Field_Array is array (0 .. 5) of Boolean
with Component_Size => 1, Size => 6;
-- Type definition for TCC_INTENSET_MC
type TCC_INTENSET_MC_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MC as a value
Val : HAL.UInt6;
when True =>
-- MC as an array
Arr : TCC_INTENSET_MC_Field_Array;
end case;
end record
with Unchecked_Union, Size => 6;
for TCC_INTENSET_MC_Field use record
Val at 0 range 0 .. 5;
Arr at 0 range 0 .. 5;
end record;
-- Interrupt Enable Set
type TCC_INTENSET_Register is record
-- Overflow Interrupt Enable
OVF : Boolean := False;
-- Retrigger Interrupt Enable
TRG : Boolean := False;
-- Counter Interrupt Enable
CNT : Boolean := False;
-- Error Interrupt Enable
ERR : Boolean := False;
-- unspecified
Reserved_4_9 : HAL.UInt6 := 16#0#;
-- Non-Recoverable Update Fault Interrupt Enable
UFS : Boolean := False;
-- Non-Recoverable Debug Fault Interrupt Enable
DFS : Boolean := False;
-- Recoverable Fault A Interrupt Enable
FAULTA : Boolean := False;
-- Recoverable Fault B Interrupt Enable
FAULTB : Boolean := False;
-- Non-Recoverable Fault 0 Interrupt Enable
FAULT : TCC_INTENSET_FAULT_Field :=
(As_Array => False, Val => 16#0#);
-- Match or Capture Channel 0 Interrupt Enable
MC : TCC_INTENSET_MC_Field :=
(As_Array => False, Val => 16#0#);
-- unspecified
Reserved_22_31 : HAL.UInt10 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TCC_INTENSET_Register use record
OVF at 0 range 0 .. 0;
TRG at 0 range 1 .. 1;
CNT at 0 range 2 .. 2;
ERR at 0 range 3 .. 3;
Reserved_4_9 at 0 range 4 .. 9;
UFS at 0 range 10 .. 10;
DFS at 0 range 11 .. 11;
FAULTA at 0 range 12 .. 12;
FAULTB at 0 range 13 .. 13;
FAULT at 0 range 14 .. 15;
MC at 0 range 16 .. 21;
Reserved_22_31 at 0 range 22 .. 31;
end record;
-- TCC_INTFLAG_FAULT array
type TCC_INTFLAG_FAULT_Field_Array is array (0 .. 1) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for TCC_INTFLAG_FAULT
type TCC_INTFLAG_FAULT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FAULT as a value
Val : HAL.UInt2;
when True =>
-- FAULT as an array
Arr : TCC_INTFLAG_FAULT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for TCC_INTFLAG_FAULT_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- TCC_INTFLAG_MC array
type TCC_INTFLAG_MC_Field_Array is array (0 .. 5) of Boolean
with Component_Size => 1, Size => 6;
-- Type definition for TCC_INTFLAG_MC
type TCC_INTFLAG_MC_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MC as a value
Val : HAL.UInt6;
when True =>
-- MC as an array
Arr : TCC_INTFLAG_MC_Field_Array;
end case;
end record
with Unchecked_Union, Size => 6;
for TCC_INTFLAG_MC_Field use record
Val at 0 range 0 .. 5;
Arr at 0 range 0 .. 5;
end record;
-- Interrupt Flag Status and Clear
type TCC_INTFLAG_Register is record
-- Overflow
OVF : Boolean := False;
-- Retrigger
TRG : Boolean := False;
-- Counter
CNT : Boolean := False;
-- Error
ERR : Boolean := False;
-- unspecified
Reserved_4_9 : HAL.UInt6 := 16#0#;
-- Non-Recoverable Update Fault
UFS : Boolean := False;
-- Non-Recoverable Debug Fault
DFS : Boolean := False;
-- Recoverable Fault A
FAULTA : Boolean := False;
-- Recoverable Fault B
FAULTB : Boolean := False;
-- Non-Recoverable Fault 0
FAULT : TCC_INTFLAG_FAULT_Field :=
(As_Array => False, Val => 16#0#);
-- Match or Capture 0
MC : TCC_INTFLAG_MC_Field :=
(As_Array => False, Val => 16#0#);
-- unspecified
Reserved_22_31 : HAL.UInt10 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TCC_INTFLAG_Register use record
OVF at 0 range 0 .. 0;
TRG at 0 range 1 .. 1;
CNT at 0 range 2 .. 2;
ERR at 0 range 3 .. 3;
Reserved_4_9 at 0 range 4 .. 9;
UFS at 0 range 10 .. 10;
DFS at 0 range 11 .. 11;
FAULTA at 0 range 12 .. 12;
FAULTB at 0 range 13 .. 13;
FAULT at 0 range 14 .. 15;
MC at 0 range 16 .. 21;
Reserved_22_31 at 0 range 22 .. 31;
end record;
-- TCC_STATUS_FAULT array
type TCC_STATUS_FAULT_Field_Array is array (0 .. 1) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for TCC_STATUS_FAULT
type TCC_STATUS_FAULT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FAULT as a value
Val : HAL.UInt2;
when True =>
-- FAULT as an array
Arr : TCC_STATUS_FAULT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for TCC_STATUS_FAULT_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- TCC_STATUS_CCBUFV array
type TCC_STATUS_CCBUFV_Field_Array is array (0 .. 5) of Boolean
with Component_Size => 1, Size => 6;
-- Type definition for TCC_STATUS_CCBUFV
type TCC_STATUS_CCBUFV_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- CCBUFV as a value
Val : HAL.UInt6;
when True =>
-- CCBUFV as an array
Arr : TCC_STATUS_CCBUFV_Field_Array;
end case;
end record
with Unchecked_Union, Size => 6;
for TCC_STATUS_CCBUFV_Field use record
Val at 0 range 0 .. 5;
Arr at 0 range 0 .. 5;
end record;
-- TCC_STATUS_CMP array
type TCC_STATUS_CMP_Field_Array is array (0 .. 5) of Boolean
with Component_Size => 1, Size => 6;
-- Type definition for TCC_STATUS_CMP
type TCC_STATUS_CMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- CMP as a value
Val : HAL.UInt6;
when True =>
-- CMP as an array
Arr : TCC_STATUS_CMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 6;
for TCC_STATUS_CMP_Field use record
Val at 0 range 0 .. 5;
Arr at 0 range 0 .. 5;
end record;
-- Status
type TCC_STATUS_Register is record
-- Stop
STOP : Boolean := True;
-- Ramp
IDX : Boolean := False;
-- Non-recoverable Update Fault State
UFS : Boolean := False;
-- Non-Recoverable Debug Fault State
DFS : Boolean := False;
-- Slave
SLAVE : Boolean := False;
-- Pattern Buffer Valid
PATTBUFV : Boolean := False;
-- unspecified
Reserved_6_6 : HAL.Bit := 16#0#;
-- Period Buffer Valid
PERBUFV : Boolean := False;
-- Recoverable Fault A Input
FAULTAIN : Boolean := False;
-- Recoverable Fault B Input
FAULTBIN : Boolean := False;
-- Non-Recoverable Fault0 Input
FAULT0IN : Boolean := False;
-- Non-Recoverable Fault1 Input
FAULT1IN : Boolean := False;
-- Recoverable Fault A State
FAULTA : Boolean := False;
-- Recoverable Fault B State
FAULTB : Boolean := False;
-- Non-Recoverable Fault 0 State
FAULT : TCC_STATUS_FAULT_Field :=
(As_Array => False, Val => 16#0#);
-- Compare Channel 0 Buffer Valid
CCBUFV : TCC_STATUS_CCBUFV_Field :=
(As_Array => False, Val => 16#0#);
-- unspecified
Reserved_22_23 : HAL.UInt2 := 16#0#;
-- Compare Channel 0 Value
CMP : TCC_STATUS_CMP_Field :=
(As_Array => False, Val => 16#0#);
-- unspecified
Reserved_30_31 : HAL.UInt2 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TCC_STATUS_Register use record
STOP at 0 range 0 .. 0;
IDX at 0 range 1 .. 1;
UFS at 0 range 2 .. 2;
DFS at 0 range 3 .. 3;
SLAVE at 0 range 4 .. 4;
PATTBUFV at 0 range 5 .. 5;
Reserved_6_6 at 0 range 6 .. 6;
PERBUFV at 0 range 7 .. 7;
FAULTAIN at 0 range 8 .. 8;
FAULTBIN at 0 range 9 .. 9;
FAULT0IN at 0 range 10 .. 10;
FAULT1IN at 0 range 11 .. 11;
FAULTA at 0 range 12 .. 12;
FAULTB at 0 range 13 .. 13;
FAULT at 0 range 14 .. 15;
CCBUFV at 0 range 16 .. 21;
Reserved_22_23 at 0 range 22 .. 23;
CMP at 0 range 24 .. 29;
Reserved_30_31 at 0 range 30 .. 31;
end record;
subtype TCC_COUNT_COUNT_Field is HAL.UInt24;
-- Count
type TCC_COUNT_Register is record
-- Counter Value
COUNT : TCC_COUNT_COUNT_Field := 16#0#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TCC_COUNT_Register use record
COUNT at 0 range 0 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
subtype TCC_COUNT_DITH4_MODE_COUNT_Field is HAL.UInt20;
-- Count
type TCC_COUNT_DITH4_MODE_Register is record
-- unspecified
Reserved_0_3 : HAL.UInt4 := 16#0#;
-- Counter Value
COUNT : TCC_COUNT_DITH4_MODE_COUNT_Field := 16#0#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TCC_COUNT_DITH4_MODE_Register use record
Reserved_0_3 at 0 range 0 .. 3;
COUNT at 0 range 4 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
subtype TCC_COUNT_DITH5_MODE_COUNT_Field is HAL.UInt19;
-- Count
type TCC_COUNT_DITH5_MODE_Register is record
-- unspecified
Reserved_0_4 : HAL.UInt5 := 16#0#;
-- Counter Value
COUNT : TCC_COUNT_DITH5_MODE_COUNT_Field := 16#0#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TCC_COUNT_DITH5_MODE_Register use record
Reserved_0_4 at 0 range 0 .. 4;
COUNT at 0 range 5 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
subtype TCC_COUNT_DITH6_MODE_COUNT_Field is HAL.UInt18;
-- Count
type TCC_COUNT_DITH6_MODE_Register is record
-- unspecified
Reserved_0_5 : HAL.UInt6 := 16#0#;
-- Counter Value
COUNT : TCC_COUNT_DITH6_MODE_COUNT_Field := 16#0#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TCC_COUNT_DITH6_MODE_Register use record
Reserved_0_5 at 0 range 0 .. 5;
COUNT at 0 range 6 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
-- TCC_PATT_PGE array
type TCC_PATT_PGE_Field_Array is array (0 .. 7) of Boolean
with Component_Size => 1, Size => 8;
-- Type definition for TCC_PATT_PGE
type TCC_PATT_PGE_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- PGE as a value
Val : HAL.UInt8;
when True =>
-- PGE as an array
Arr : TCC_PATT_PGE_Field_Array;
end case;
end record
with Unchecked_Union, Size => 8;
for TCC_PATT_PGE_Field use record
Val at 0 range 0 .. 7;
Arr at 0 range 0 .. 7;
end record;
-- TCC_PATT_PGV array
type TCC_PATT_PGV_Field_Array is array (0 .. 7) of Boolean
with Component_Size => 1, Size => 8;
-- Type definition for TCC_PATT_PGV
type TCC_PATT_PGV_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- PGV as a value
Val : HAL.UInt8;
when True =>
-- PGV as an array
Arr : TCC_PATT_PGV_Field_Array;
end case;
end record
with Unchecked_Union, Size => 8;
for TCC_PATT_PGV_Field use record
Val at 0 range 0 .. 7;
Arr at 0 range 0 .. 7;
end record;
-- Pattern
type TCC_PATT_Register is record
-- Pattern Generator 0 Output Enable
PGE : TCC_PATT_PGE_Field := (As_Array => False, Val => 16#0#);
-- Pattern Generator 0 Output Value
PGV : TCC_PATT_PGV_Field := (As_Array => False, Val => 16#0#);
end record
with Volatile_Full_Access, Object_Size => 16,
Bit_Order => System.Low_Order_First;
for TCC_PATT_Register use record
PGE at 0 range 0 .. 7;
PGV at 0 range 8 .. 15;
end record;
-- Waveform Generation
type WAVE_WAVEGENSelect is
(-- Normal frequency
NFRQ,
-- Match frequency
MFRQ,
-- Normal PWM
NPWM,
-- Dual-slope critical
DSCRITICAL,
-- Dual-slope with interrupt/event condition when COUNT reaches ZERO
DSBOTTOM,
-- Dual-slope with interrupt/event condition when COUNT reaches ZERO or TOP
DSBOTH,
-- Dual-slope with interrupt/event condition when COUNT reaches TOP
DSTOP)
with Size => 3;
for WAVE_WAVEGENSelect use
(NFRQ => 0,
MFRQ => 1,
NPWM => 2,
DSCRITICAL => 4,
DSBOTTOM => 5,
DSBOTH => 6,
DSTOP => 7);
-- Ramp Mode
type WAVE_RAMPSelect is
(-- RAMP1 operation
RAMP1,
-- Alternative RAMP2 operation
RAMP2A,
-- RAMP2 operation
RAMP2,
-- Critical RAMP2 operation
RAMP2C)
with Size => 2;
for WAVE_RAMPSelect use
(RAMP1 => 0,
RAMP2A => 1,
RAMP2 => 2,
RAMP2C => 3);
-- TCC_WAVE_CICCEN array
type TCC_WAVE_CICCEN_Field_Array is array (0 .. 3) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for TCC_WAVE_CICCEN
type TCC_WAVE_CICCEN_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- CICCEN as a value
Val : HAL.UInt4;
when True =>
-- CICCEN as an array
Arr : TCC_WAVE_CICCEN_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for TCC_WAVE_CICCEN_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- TCC_WAVE_POL array
type TCC_WAVE_POL_Field_Array is array (0 .. 5) of Boolean
with Component_Size => 1, Size => 6;
-- Type definition for TCC_WAVE_POL
type TCC_WAVE_POL_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- POL as a value
Val : HAL.UInt6;
when True =>
-- POL as an array
Arr : TCC_WAVE_POL_Field_Array;
end case;
end record
with Unchecked_Union, Size => 6;
for TCC_WAVE_POL_Field use record
Val at 0 range 0 .. 5;
Arr at 0 range 0 .. 5;
end record;
-- TCC_WAVE_SWAP array
type TCC_WAVE_SWAP_Field_Array is array (0 .. 3) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for TCC_WAVE_SWAP
type TCC_WAVE_SWAP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- SWAP as a value
Val : HAL.UInt4;
when True =>
-- SWAP as an array
Arr : TCC_WAVE_SWAP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for TCC_WAVE_SWAP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- Waveform Control
type TCC_WAVE_Register is record
-- Waveform Generation
WAVEGEN : WAVE_WAVEGENSelect := SAM_SVD.TCC.NFRQ;
-- unspecified
Reserved_3_3 : HAL.Bit := 16#0#;
-- Ramp Mode
RAMP : WAVE_RAMPSelect := SAM_SVD.TCC.RAMP1;
-- unspecified
Reserved_6_6 : HAL.Bit := 16#0#;
-- Circular period Enable
CIPEREN : Boolean := False;
-- Circular Channel 0 Enable
CICCEN : TCC_WAVE_CICCEN_Field :=
(As_Array => False, Val => 16#0#);
-- unspecified
Reserved_12_15 : HAL.UInt4 := 16#0#;
-- Channel 0 Polarity
POL : TCC_WAVE_POL_Field :=
(As_Array => False, Val => 16#0#);
-- unspecified
Reserved_22_23 : HAL.UInt2 := 16#0#;
-- Swap DTI Output Pair 0
SWAP : TCC_WAVE_SWAP_Field :=
(As_Array => False, Val => 16#0#);
-- unspecified
Reserved_28_31 : HAL.UInt4 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TCC_WAVE_Register use record
WAVEGEN at 0 range 0 .. 2;
Reserved_3_3 at 0 range 3 .. 3;
RAMP at 0 range 4 .. 5;
Reserved_6_6 at 0 range 6 .. 6;
CIPEREN at 0 range 7 .. 7;
CICCEN at 0 range 8 .. 11;
Reserved_12_15 at 0 range 12 .. 15;
POL at 0 range 16 .. 21;
Reserved_22_23 at 0 range 22 .. 23;
SWAP at 0 range 24 .. 27;
Reserved_28_31 at 0 range 28 .. 31;
end record;
subtype TCC_PER_PER_Field is HAL.UInt24;
-- Period
type TCC_PER_Register is record
-- Period Value
PER : TCC_PER_PER_Field := 16#FFFFFF#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#FF#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TCC_PER_Register use record
PER at 0 range 0 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
subtype TCC_PER_DITH4_MODE_DITHER_Field is HAL.UInt4;
subtype TCC_PER_DITH4_MODE_PER_Field is HAL.UInt20;
-- Period
type TCC_PER_DITH4_MODE_Register is record
-- Dithering Cycle Number
DITHER : TCC_PER_DITH4_MODE_DITHER_Field := 16#F#;
-- Period Value
PER : TCC_PER_DITH4_MODE_PER_Field := 16#FFFFF#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#FF#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TCC_PER_DITH4_MODE_Register use record
DITHER at 0 range 0 .. 3;
PER at 0 range 4 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
subtype TCC_PER_DITH5_MODE_DITHER_Field is HAL.UInt5;
subtype TCC_PER_DITH5_MODE_PER_Field is HAL.UInt19;
-- Period
type TCC_PER_DITH5_MODE_Register is record
-- Dithering Cycle Number
DITHER : TCC_PER_DITH5_MODE_DITHER_Field := 16#1F#;
-- Period Value
PER : TCC_PER_DITH5_MODE_PER_Field := 16#7FFFF#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#FF#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TCC_PER_DITH5_MODE_Register use record
DITHER at 0 range 0 .. 4;
PER at 0 range 5 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
subtype TCC_PER_DITH6_MODE_DITHER_Field is HAL.UInt6;
subtype TCC_PER_DITH6_MODE_PER_Field is HAL.UInt18;
-- Period
type TCC_PER_DITH6_MODE_Register is record
-- Dithering Cycle Number
DITHER : TCC_PER_DITH6_MODE_DITHER_Field := 16#3F#;
-- Period Value
PER : TCC_PER_DITH6_MODE_PER_Field := 16#3FFFF#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#FF#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TCC_PER_DITH6_MODE_Register use record
DITHER at 0 range 0 .. 5;
PER at 0 range 6 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
subtype TCC_CC_CC_Field is HAL.UInt24;
-- Compare and Capture
type TCC_CC_Register is record
-- Channel Compare/Capture Value
CC : TCC_CC_CC_Field := 16#0#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TCC_CC_Register use record
CC at 0 range 0 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
-- Compare and Capture
type TCC_CC_Registers is array (0 .. 5) of TCC_CC_Register;
subtype TCC_CC_DITH4_MODE_DITHER_Field is HAL.UInt4;
subtype TCC_CC_DITH4_MODE_CC_Field is HAL.UInt20;
-- Compare and Capture
type TCC_CC_DITH4_MODE_Register is record
-- Dithering Cycle Number
DITHER : TCC_CC_DITH4_MODE_DITHER_Field := 16#0#;
-- Channel Compare/Capture Value
CC : TCC_CC_DITH4_MODE_CC_Field := 16#0#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TCC_CC_DITH4_MODE_Register use record
DITHER at 0 range 0 .. 3;
CC at 0 range 4 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
-- Compare and Capture
type TCC_CC_DITH4_MODE_Registers is array (0 .. 5)
of TCC_CC_DITH4_MODE_Register;
subtype TCC_CC_DITH5_MODE_DITHER_Field is HAL.UInt5;
subtype TCC_CC_DITH5_MODE_CC_Field is HAL.UInt19;
-- Compare and Capture
type TCC_CC_DITH5_MODE_Register is record
-- Dithering Cycle Number
DITHER : TCC_CC_DITH5_MODE_DITHER_Field := 16#0#;
-- Channel Compare/Capture Value
CC : TCC_CC_DITH5_MODE_CC_Field := 16#0#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TCC_CC_DITH5_MODE_Register use record
DITHER at 0 range 0 .. 4;
CC at 0 range 5 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
-- Compare and Capture
type TCC_CC_DITH5_MODE_Registers is array (0 .. 5)
of TCC_CC_DITH5_MODE_Register;
subtype TCC_CC_DITH6_MODE_DITHER_Field is HAL.UInt6;
subtype TCC_CC_DITH6_MODE_CC_Field is HAL.UInt18;
-- Compare and Capture
type TCC_CC_DITH6_MODE_Register is record
-- Dithering Cycle Number
DITHER : TCC_CC_DITH6_MODE_DITHER_Field := 16#0#;
-- Channel Compare/Capture Value
CC : TCC_CC_DITH6_MODE_CC_Field := 16#0#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TCC_CC_DITH6_MODE_Register use record
DITHER at 0 range 0 .. 5;
CC at 0 range 6 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
-- Compare and Capture
type TCC_CC_DITH6_MODE_Registers is array (0 .. 5)
of TCC_CC_DITH6_MODE_Register;
-- TCC_PATTBUF_PGEB array
type TCC_PATTBUF_PGEB_Field_Array is array (0 .. 7) of Boolean
with Component_Size => 1, Size => 8;
-- Type definition for TCC_PATTBUF_PGEB
type TCC_PATTBUF_PGEB_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- PGEB as a value
Val : HAL.UInt8;
when True =>
-- PGEB as an array
Arr : TCC_PATTBUF_PGEB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 8;
for TCC_PATTBUF_PGEB_Field use record
Val at 0 range 0 .. 7;
Arr at 0 range 0 .. 7;
end record;
-- TCC_PATTBUF_PGVB array
type TCC_PATTBUF_PGVB_Field_Array is array (0 .. 7) of Boolean
with Component_Size => 1, Size => 8;
-- Type definition for TCC_PATTBUF_PGVB
type TCC_PATTBUF_PGVB_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- PGVB as a value
Val : HAL.UInt8;
when True =>
-- PGVB as an array
Arr : TCC_PATTBUF_PGVB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 8;
for TCC_PATTBUF_PGVB_Field use record
Val at 0 range 0 .. 7;
Arr at 0 range 0 .. 7;
end record;
-- Pattern Buffer
type TCC_PATTBUF_Register is record
-- Pattern Generator 0 Output Enable Buffer
PGEB : TCC_PATTBUF_PGEB_Field := (As_Array => False, Val => 16#0#);
-- Pattern Generator 0 Output Enable
PGVB : TCC_PATTBUF_PGVB_Field := (As_Array => False, Val => 16#0#);
end record
with Volatile_Full_Access, Object_Size => 16,
Bit_Order => System.Low_Order_First;
for TCC_PATTBUF_Register use record
PGEB at 0 range 0 .. 7;
PGVB at 0 range 8 .. 15;
end record;
subtype TCC_PERBUF_PERBUF_Field is HAL.UInt24;
-- Period Buffer
type TCC_PERBUF_Register is record
-- Period Buffer Value
PERBUF : TCC_PERBUF_PERBUF_Field := 16#FFFFFF#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#FF#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TCC_PERBUF_Register use record
PERBUF at 0 range 0 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
subtype TCC_PERBUF_DITH4_MODE_DITHERBUF_Field is HAL.UInt4;
subtype TCC_PERBUF_DITH4_MODE_PERBUF_Field is HAL.UInt20;
-- Period Buffer
type TCC_PERBUF_DITH4_MODE_Register is record
-- Dithering Buffer Cycle Number
DITHERBUF : TCC_PERBUF_DITH4_MODE_DITHERBUF_Field := 16#F#;
-- Period Buffer Value
PERBUF : TCC_PERBUF_DITH4_MODE_PERBUF_Field := 16#FFFFF#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#FF#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TCC_PERBUF_DITH4_MODE_Register use record
DITHERBUF at 0 range 0 .. 3;
PERBUF at 0 range 4 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
subtype TCC_PERBUF_DITH5_MODE_DITHERBUF_Field is HAL.UInt5;
subtype TCC_PERBUF_DITH5_MODE_PERBUF_Field is HAL.UInt19;
-- Period Buffer
type TCC_PERBUF_DITH5_MODE_Register is record
-- Dithering Buffer Cycle Number
DITHERBUF : TCC_PERBUF_DITH5_MODE_DITHERBUF_Field := 16#1F#;
-- Period Buffer Value
PERBUF : TCC_PERBUF_DITH5_MODE_PERBUF_Field := 16#7FFFF#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#FF#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TCC_PERBUF_DITH5_MODE_Register use record
DITHERBUF at 0 range 0 .. 4;
PERBUF at 0 range 5 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
subtype TCC_PERBUF_DITH6_MODE_DITHERBUF_Field is HAL.UInt6;
subtype TCC_PERBUF_DITH6_MODE_PERBUF_Field is HAL.UInt18;
-- Period Buffer
type TCC_PERBUF_DITH6_MODE_Register is record
-- Dithering Buffer Cycle Number
DITHERBUF : TCC_PERBUF_DITH6_MODE_DITHERBUF_Field := 16#3F#;
-- Period Buffer Value
PERBUF : TCC_PERBUF_DITH6_MODE_PERBUF_Field := 16#3FFFF#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#FF#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TCC_PERBUF_DITH6_MODE_Register use record
DITHERBUF at 0 range 0 .. 5;
PERBUF at 0 range 6 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
subtype TCC_CCBUF_CCBUF_Field is HAL.UInt24;
-- Compare and Capture Buffer
type TCC_CCBUF_Register is record
-- Channel Compare/Capture Buffer Value
CCBUF : TCC_CCBUF_CCBUF_Field := 16#0#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TCC_CCBUF_Register use record
CCBUF at 0 range 0 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
-- Compare and Capture Buffer
type TCC_CCBUF_Registers is array (0 .. 5) of TCC_CCBUF_Register;
subtype TCC_CCBUF_DITH4_MODE_CCBUF_Field is HAL.UInt4;
subtype TCC_CCBUF_DITH4_MODE_DITHERBUF_Field is HAL.UInt20;
-- Compare and Capture Buffer
type TCC_CCBUF_DITH4_MODE_Register is record
-- Channel Compare/Capture Buffer Value
CCBUF : TCC_CCBUF_DITH4_MODE_CCBUF_Field := 16#0#;
-- Dithering Buffer Cycle Number
DITHERBUF : TCC_CCBUF_DITH4_MODE_DITHERBUF_Field := 16#0#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TCC_CCBUF_DITH4_MODE_Register use record
CCBUF at 0 range 0 .. 3;
DITHERBUF at 0 range 4 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
-- Compare and Capture Buffer
type TCC_CCBUF_DITH4_MODE_Registers is array (0 .. 5)
of TCC_CCBUF_DITH4_MODE_Register;
subtype TCC_CCBUF_DITH5_MODE_DITHERBUF_Field is HAL.UInt5;
subtype TCC_CCBUF_DITH5_MODE_CCBUF_Field is HAL.UInt19;
-- Compare and Capture Buffer
type TCC_CCBUF_DITH5_MODE_Register is record
-- Dithering Buffer Cycle Number
DITHERBUF : TCC_CCBUF_DITH5_MODE_DITHERBUF_Field := 16#0#;
-- Channel Compare/Capture Buffer Value
CCBUF : TCC_CCBUF_DITH5_MODE_CCBUF_Field := 16#0#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TCC_CCBUF_DITH5_MODE_Register use record
DITHERBUF at 0 range 0 .. 4;
CCBUF at 0 range 5 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
-- Compare and Capture Buffer
type TCC_CCBUF_DITH5_MODE_Registers is array (0 .. 5)
of TCC_CCBUF_DITH5_MODE_Register;
subtype TCC_CCBUF_DITH6_MODE_DITHERBUF_Field is HAL.UInt6;
subtype TCC_CCBUF_DITH6_MODE_CCBUF_Field is HAL.UInt18;
-- Compare and Capture Buffer
type TCC_CCBUF_DITH6_MODE_Register is record
-- Dithering Buffer Cycle Number
DITHERBUF : TCC_CCBUF_DITH6_MODE_DITHERBUF_Field := 16#0#;
-- Channel Compare/Capture Buffer Value
CCBUF : TCC_CCBUF_DITH6_MODE_CCBUF_Field := 16#0#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TCC_CCBUF_DITH6_MODE_Register use record
DITHERBUF at 0 range 0 .. 5;
CCBUF at 0 range 6 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
-- Compare and Capture Buffer
type TCC_CCBUF_DITH6_MODE_Registers is array (0 .. 5)
of TCC_CCBUF_DITH6_MODE_Register;
-----------------
-- Peripherals --
-----------------
type TCC0_Disc is
(Default,
DITH4_MODE,
DITH5_MODE,
DITH6_MODE);
-- Timer Counter Control
type TCC_Peripheral
(Discriminent : TCC0_Disc := Default)
is record
-- Control A
CTRLA : aliased TCC_CTRLA_Register;
-- Control B Clear
CTRLBCLR : aliased TCC_CTRLBCLR_Register;
-- Control B Set
CTRLBSET : aliased TCC_CTRLBSET_Register;
-- Synchronization Busy
SYNCBUSY : aliased TCC_SYNCBUSY_Register;
-- Recoverable Fault A Configuration
FCTRLA : aliased TCC_FCTRLA_Register;
-- Recoverable Fault B Configuration
FCTRLB : aliased TCC_FCTRLB_Register;
-- Waveform Extension Configuration
WEXCTRL : aliased TCC_WEXCTRL_Register;
-- Driver Control
DRVCTRL : aliased TCC_DRVCTRL_Register;
-- Debug Control
DBGCTRL : aliased TCC_DBGCTRL_Register;
-- Event Control
EVCTRL : aliased TCC_EVCTRL_Register;
-- Interrupt Enable Clear
INTENCLR : aliased TCC_INTENCLR_Register;
-- Interrupt Enable Set
INTENSET : aliased TCC_INTENSET_Register;
-- Interrupt Flag Status and Clear
INTFLAG : aliased TCC_INTFLAG_Register;
-- Status
STATUS : aliased TCC_STATUS_Register;
-- Pattern
PATT : aliased TCC_PATT_Register;
-- Waveform Control
WAVE : aliased TCC_WAVE_Register;
-- Pattern Buffer
PATTBUF : aliased TCC_PATTBUF_Register;
case Discriminent is
when Default =>
-- Count
COUNT : aliased TCC_COUNT_Register;
-- Period
PER : aliased TCC_PER_Register;
-- Compare and Capture
CC : aliased TCC_CC_Registers;
-- Period Buffer
PERBUF : aliased TCC_PERBUF_Register;
-- Compare and Capture Buffer
CCBUF : aliased TCC_CCBUF_Registers;
when DITH4_MODE =>
-- Count
COUNT_DITH4_MODE : aliased TCC_COUNT_DITH4_MODE_Register;
-- Period
PER_DITH4_MODE : aliased TCC_PER_DITH4_MODE_Register;
-- Compare and Capture
CC_DITH4_MODE : aliased TCC_CC_DITH4_MODE_Registers;
-- Period Buffer
PERBUF_DITH4_MODE : aliased TCC_PERBUF_DITH4_MODE_Register;
-- Compare and Capture Buffer
CCBUF_DITH4_MODE : aliased TCC_CCBUF_DITH4_MODE_Registers;
when DITH5_MODE =>
-- Count
COUNT_DITH5_MODE : aliased TCC_COUNT_DITH5_MODE_Register;
-- Period
PER_DITH5_MODE : aliased TCC_PER_DITH5_MODE_Register;
-- Compare and Capture
CC_DITH5_MODE : aliased TCC_CC_DITH5_MODE_Registers;
-- Period Buffer
PERBUF_DITH5_MODE : aliased TCC_PERBUF_DITH5_MODE_Register;
-- Compare and Capture Buffer
CCBUF_DITH5_MODE : aliased TCC_CCBUF_DITH5_MODE_Registers;
when DITH6_MODE =>
-- Count
COUNT_DITH6_MODE : aliased TCC_COUNT_DITH6_MODE_Register;
-- Period
PER_DITH6_MODE : aliased TCC_PER_DITH6_MODE_Register;
-- Compare and Capture
CC_DITH6_MODE : aliased TCC_CC_DITH6_MODE_Registers;
-- Period Buffer
PERBUF_DITH6_MODE : aliased TCC_PERBUF_DITH6_MODE_Register;
-- Compare and Capture Buffer
CCBUF_DITH6_MODE : aliased TCC_CCBUF_DITH6_MODE_Registers;
end case;
end record
with Unchecked_Union, Volatile;
for TCC_Peripheral use record
CTRLA at 16#0# range 0 .. 31;
CTRLBCLR at 16#4# range 0 .. 7;
CTRLBSET at 16#5# range 0 .. 7;
SYNCBUSY at 16#8# range 0 .. 31;
FCTRLA at 16#C# range 0 .. 31;
FCTRLB at 16#10# range 0 .. 31;
WEXCTRL at 16#14# range 0 .. 31;
DRVCTRL at 16#18# range 0 .. 31;
DBGCTRL at 16#1E# range 0 .. 7;
EVCTRL at 16#20# range 0 .. 31;
INTENCLR at 16#24# range 0 .. 31;
INTENSET at 16#28# range 0 .. 31;
INTFLAG at 16#2C# range 0 .. 31;
STATUS at 16#30# range 0 .. 31;
PATT at 16#38# range 0 .. 15;
WAVE at 16#3C# range 0 .. 31;
PATTBUF at 16#64# range 0 .. 15;
COUNT at 16#34# range 0 .. 31;
PER at 16#40# range 0 .. 31;
CC at 16#44# range 0 .. 191;
PERBUF at 16#6C# range 0 .. 31;
CCBUF at 16#70# range 0 .. 191;
COUNT_DITH4_MODE at 16#34# range 0 .. 31;
PER_DITH4_MODE at 16#40# range 0 .. 31;
CC_DITH4_MODE at 16#44# range 0 .. 191;
PERBUF_DITH4_MODE at 16#6C# range 0 .. 31;
CCBUF_DITH4_MODE at 16#70# range 0 .. 191;
COUNT_DITH5_MODE at 16#34# range 0 .. 31;
PER_DITH5_MODE at 16#40# range 0 .. 31;
CC_DITH5_MODE at 16#44# range 0 .. 191;
PERBUF_DITH5_MODE at 16#6C# range 0 .. 31;
CCBUF_DITH5_MODE at 16#70# range 0 .. 191;
COUNT_DITH6_MODE at 16#34# range 0 .. 31;
PER_DITH6_MODE at 16#40# range 0 .. 31;
CC_DITH6_MODE at 16#44# range 0 .. 191;
PERBUF_DITH6_MODE at 16#6C# range 0 .. 31;
CCBUF_DITH6_MODE at 16#70# range 0 .. 191;
end record;
-- Timer Counter Control
TCC0_Periph : aliased TCC_Peripheral
with Import, Address => TCC0_Base;
-- Timer Counter Control
TCC1_Periph : aliased TCC_Peripheral
with Import, Address => TCC1_Base;
-- Timer Counter Control
TCC2_Periph : aliased TCC_Peripheral
with Import, Address => TCC2_Base;
end SAM_SVD.TCC;
|
package laby_functions is
type point is
record
x,y : float ;
end record ;
type node is private ;
type tree is access node ;
function maze_random(W,H : integer) return Tree ;
procedure maze_svg(maze : tree ; file_name : string) ;
procedure show_tree_content(maze : tree ; index : integer) ;
procedure solution_svg(m : tree ; file_name : string) ;
private
type wall_type is (vertical,horizontal,no_wall) ;
type node is
record
wall : wall_type ;
left_child : tree ;
right_child : tree ;
x,y : natural ;
width,height : natural ;
wall_offset : natural ;
door_offset : natural ;
end record ;
end laby_functions ;
|
package body Loop_Optimization8_Pkg2 is
function Length (Set : T) return Natural is
begin
return Set.Length;
end Length;
function Index (Set : T; Position : Natural) return Integer is
begin
return Set.Elements (Position);
end Index;
end Loop_Optimization8_Pkg2;
|
-- Copyright (c) 2021 Devin Hill
-- zlib License -- see LICENSE for details.
package body GBA.Display.Backgrounds.Refs is
function ID (This : BG_Ref'Class) return BG_ID is
( This.ID );
function Priority (This : BG_Ref'Class) return Display_Priority is
( This.Control.Priority );
function Mosaic_Enabled (This : BG_Ref'Class) return Boolean is
( This.Control.Enable_Mosaic );
procedure Set_Priority
(This : in out BG_Ref'Class; Priority : Display_Priority) is
begin
This.Control.Priority := Priority;
end;
procedure Enable_Mosaic
(This : in out BG_Ref'Class; Enable : Boolean := True) is
begin
This.Control.Enable_Mosaic := Enable;
end;
procedure Update_Control_Info (This : in out BG_Ref'Class) is
begin
Update (BG_Control_Info (This.Control.all));
end;
procedure Refresh_Offset_Register (This : in out Reg_BG_Ref'Class)
with Inline_Always is
begin
Set_Offset (This.ID, This.Offset);
end;
function Offset (This : Reg_BG_Ref'Class) return BG_Offset_Info is
( This.Offset );
procedure Set_Offset
( This : in out Reg_BG_Ref'Class; Offset : BG_Offset_Info ) is
begin
This.Offset := Offset;
Refresh_Offset_Register (This);
end;
procedure Set_Offset
( This : in out Reg_BG_Ref'Class; X, Y : BG_Scroll_Offset ) is
begin
This.Offset := (X => X, Y => Y);
Refresh_Offset_Register (This);
end;
procedure Set_Offset_X
(This : in out Reg_BG_Ref'Class; Value : BG_Scroll_Offset) is
begin
This.Offset.X := Value;
Refresh_Offset_Register (This);
end;
procedure Set_Offset_Y
(This : in out Reg_BG_Ref'Class; Value : BG_Scroll_Offset) is
begin
This.Offset.Y := Value;
Refresh_Offset_Register (This);
end;
procedure Move_Offset
(This : in out Reg_BG_Ref'Class; DX, DY : BG_Scroll_Offset := 0) is
begin
This.Offset :=
( X => This.Offset.X + DX
, Y => This.Offset.Y + DY
);
Refresh_Offset_Register (This);
end;
procedure Update_Offset (This : in out Reg_BG_Ref'Class) is
begin
Update (This.Offset);
Refresh_Offset_Register (This);
end;
procedure Refresh_Transform_Info (This : Aff_BG_Ref'Class)
with Inline_Always is
begin
Set_Transform (This.ID, This.Transform_Info);
end;
procedure Refresh_Affine_Matrix (This : Aff_BG_Ref'Class)
with Inline_Always is
begin
Set_Affine_Matrix (This.ID, This.Transform_Info.Affine_Matrix);
end;
procedure Refresh_Reference_Point (This : Aff_BG_Ref'Class)
with Inline_Always is
begin
Set_Reference_Point (This.ID, This.Transform_Info.Reference_Point);
end;
function Transform (This : Aff_BG_Ref'Class)
return Affine_Transform_Matrix is
begin
return This.Transform_Info.Affine_Matrix;
end;
function Reference_Point (This : Aff_BG_Ref'Class)
return BG_Reference_Point is
begin
return This.Transform_Info.Reference_Point;
end;
procedure Set_Reference_Point
(This : in out Aff_BG_Ref'Class;
Reference_Point : BG_Reference_Point) is
begin
This.Transform_Info.Reference_Point := Reference_Point;
Refresh_Reference_Point (This);
end;
procedure Set_Reference_Point
(This : in out Aff_BG_Ref'Class; X, Y : BG_Reference_Point_Coordinate) is
begin
This.Transform_Info.Reference_Point := (X => X, Y => Y);
Refresh_Reference_Point (This);
end;
procedure Set_Reference_X
(This : in out Aff_BG_Ref'Class; Value : BG_Reference_Point_Coordinate) is
begin
This.Transform_Info.Reference_Point.X := Value;
Set_Reference_X (This.ID, Value);
end;
procedure Set_Reference_Y
(This : in out Aff_BG_Ref'Class; Value : BG_Reference_Point_Coordinate) is
begin
This.Transform_Info.Reference_Point.Y := Value;
Set_Reference_Y (This.ID, Value);
end;
procedure Move_Reference_Point
(This : in out Aff_BG_Ref'Class; DX, DY : BG_Reference_Point_Coordinate := 0.0) is
RP : BG_Reference_Point renames This.Transform_Info.Reference_Point;
begin
RP := (X => RP.X + DX, Y => RP.Y + DY);
Refresh_Reference_Point (This);
end;
procedure Update_Transform (This : in out Aff_BG_Ref'Class) is
begin
Update (This.Transform_Info);
Refresh_Transform_Info (This);
end;
end GBA.Display.Backgrounds.Refs;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S C N --
-- --
-- B o d y --
-- --
-- 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. 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 Namet; use Namet;
with Opt; use Opt;
with Restrict; use Restrict;
with Rident; use Rident;
with Scans; use Scans;
with Sinfo; use Sinfo;
with Sinput; use Sinput;
with Uintp; use Uintp;
package body Scn is
Used_As_Identifier : array (Token_Type) of Boolean;
-- Flags set True if a given keyword is used as an identifier (used to
-- make sure that we only post an error message for incorrect use of a
-- keyword as an identifier once for a given keyword).
----------------------------
-- Determine_Token_Casing --
----------------------------
function Determine_Token_Casing return Casing_Type is
begin
return Scanner.Determine_Token_Casing;
end Determine_Token_Casing;
------------------------
-- Initialize_Scanner --
------------------------
procedure Initialize_Scanner
(Unit : Unit_Number_Type;
Index : Source_File_Index) is
begin
Scanner.Initialize_Scanner (Index);
Set_Unit (Index, Unit);
Current_Source_Unit := Unit;
-- Set default for Comes_From_Source. All nodes built now until we
-- reenter the analyzer will have Comes_From_Source set to True
Set_Comes_From_Source_Default (True);
Check_For_BOM;
-- Because of the License stuff above, Scng.Initialize_Scanner cannot
-- call Scan. Scan initial token (note this initializes Prev_Token,
-- Prev_Token_Ptr).
Scan;
-- Clear flags for reserved words used as identifiers
Used_As_Identifier := (others => False);
end Initialize_Scanner;
---------------
-- Post_Scan --
---------------
procedure Post_Scan is
procedure Check_Obsolescent_Features_Restriction (S : Source_Ptr);
-- This checks for Obsolescent_Features restriction being active, and
-- if so, flags the restriction as occurring at the given scan location.
procedure Check_Obsolete_Base_Char;
-- Check for numeric literal using ':' instead of '#' for based case
--------------------------------------------
-- Check_Obsolescent_Features_Restriction --
--------------------------------------------
procedure Check_Obsolescent_Features_Restriction (S : Source_Ptr) is
begin
-- Normally we have a node handy for posting restrictions. We don't
-- have such a node here, so construct a dummy one with the right
-- scan pointer. This is only used to get the Sloc value anyway.
Check_Restriction (No_Obsolescent_Features, New_Node (N_Empty, S));
end Check_Obsolescent_Features_Restriction;
------------------------------
-- Check_Obsolete_Base_Char --
------------------------------
procedure Check_Obsolete_Base_Char is
S : Source_Ptr;
begin
if Based_Literal_Uses_Colon then
-- Find the : for the restriction or warning message
S := Token_Ptr;
while Source (S) /= ':' loop
S := S + 1;
end loop;
Check_Obsolescent_Features_Restriction (S);
if Warn_On_Obsolescent_Feature then
Error_Msg
("?j?use of "":"" is an obsolescent feature (RM J.2(3))", S);
Error_Msg
("\?j?use ""'#"" instead", S);
end if;
end if;
end Check_Obsolete_Base_Char;
-- Start of processing for Post_Scan
begin
case Token is
when Tok_Char_Literal =>
Token_Node := New_Node (N_Character_Literal, Token_Ptr);
Set_Char_Literal_Value (Token_Node, UI_From_CC (Character_Code));
Set_Chars (Token_Node, Token_Name);
when Tok_Identifier =>
Token_Node := New_Node (N_Identifier, Token_Ptr);
Set_Chars (Token_Node, Token_Name);
when Tok_Real_Literal =>
Token_Node := New_Node (N_Real_Literal, Token_Ptr);
Set_Realval (Token_Node, Real_Literal_Value);
Check_Obsolete_Base_Char;
when Tok_Integer_Literal =>
Token_Node := New_Node (N_Integer_Literal, Token_Ptr);
Set_Intval (Token_Node, Int_Literal_Value);
Check_Obsolete_Base_Char;
when Tok_String_Literal =>
Token_Node := New_Node (N_String_Literal, Token_Ptr);
Set_Has_Wide_Character
(Token_Node, Wide_Character_Found);
Set_Has_Wide_Wide_Character
(Token_Node, Wide_Wide_Character_Found);
Set_Strval (Token_Node, String_Literal_Id);
if Source (Token_Ptr) = '%' then
Check_Obsolescent_Features_Restriction (Token_Ptr);
if Warn_On_Obsolescent_Feature then
Error_Msg_SC
("?j?use of ""'%"" is an obsolescent feature (RM J.2(4))");
Error_Msg_SC ("\?j?use """""" instead");
end if;
end if;
when Tok_Operator_Symbol =>
Token_Node := New_Node (N_Operator_Symbol, Token_Ptr);
Set_Chars (Token_Node, Token_Name);
Set_Strval (Token_Node, String_Literal_Id);
when Tok_Vertical_Bar =>
if Source (Token_Ptr) = '!' then
Check_Obsolescent_Features_Restriction (Token_Ptr);
if Warn_On_Obsolescent_Feature then
Error_Msg_SC
("?j?use of ""'!"" is an obsolescent feature (RM J.2(2))");
Error_Msg_SC ("\?j?use ""'|"" instead");
end if;
end if;
when others =>
null;
end case;
end Post_Scan;
------------------------------
-- Scan_Reserved_Identifier --
------------------------------
procedure Scan_Reserved_Identifier (Force_Msg : Boolean) is
Token_Chars : String := Token_Type'Image (Token);
Len : Natural := 0;
begin
-- AI12-0125 : '@' denotes the target_name, i.e. serves as an
-- abbreviation for the LHS of an assignment.
if Token = Tok_At_Sign then
Token_Node := New_Node (N_Target_Name, Token_Ptr);
return;
end if;
-- We have in Token_Chars the image of the Token name, i.e. Tok_xxx.
-- This code extracts the xxx and makes an identifier out of it.
for J in 5 .. Token_Chars'Length loop
Len := Len + 1;
Token_Chars (Len) := Fold_Lower (Token_Chars (J));
end loop;
Token_Name := Name_Find (Token_Chars (1 .. Len));
-- If Inside_Pragma is True, we don't give an error. This is to allow
-- things like "pragma Ignore_Pragma (Interface)", where "Interface" is
-- a reserved word. There is no danger of missing errors, because any
-- misuse must have been preceded by an illegal declaration. For
-- example, in "pragma Pack (Begin);", either Begin is not declared,
-- which is an error, or it is declared, which will be an error on that
-- declaration.
if (not Used_As_Identifier (Token) or else Force_Msg)
and then not Inside_Pragma
then
Error_Msg_Name_1 := Token_Name;
Error_Msg_SC ("reserved word* cannot be used as identifier!");
Used_As_Identifier (Token) := True;
end if;
Token := Tok_Identifier;
Token_Node := New_Node (N_Identifier, Token_Ptr);
Set_Chars (Token_Node, Token_Name);
end Scan_Reserved_Identifier;
end Scn;
|
with Ada.Integer_Text_IO;
with Ada.Text_IO;
with Words;
procedure Euler42 is
function Is_Triangular(I: Integer) return Boolean is
T: Integer := 1;
N: Integer := 2;
begin
while T <= I loop
if T = I then return True; end if;
T := T + N;
N := N + 1;
end loop;
return False;
end Is_Triangular;
begin
declare
List: Words.List := Words.Split(Ada.Text_IO.Get_Line);
Count: Natural := 0;
begin
for W of List loop
if Is_Triangular(Words.Score(W.all)) then
Count := Count + 1;
end if;
end loop;
Words.Free(List);
Ada.Integer_Text_IO.Put(Count);
end;
end Euler42;
|
------------------------------------------------------------------------------
-- --
-- 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 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 version of the LCH writes the exception name and message (if any),
-- followed by the traceback, if any, to the LCD. It uses the package
-- LCD_Std_Out, and that package body elaboration assignes GPIO ports
-- and pins, as well as a SPI port, to initialize the ILI9341 component.
-- Note this version requires building with the ravenscar-full runtime.
-- The non-symbolic traceback addresses are written to the LCD. From these
-- addresses you can get the symbolic traceback using arm-eabi-addr2line on
-- the command line. For example:
--
-- arm-eabi-addr2line -e <executable> --functions --demangle <address> ...
--
-- Note that you must build with the "-E" binder switch for the traceback
-- addresses to be stored with exception occurrences.
--
-- See the GNAT User Guide, section 8.1.14. Stack Traceback for details.
with Ada.Real_Time; use Ada.Real_Time;
with STM32.Board; use STM32.Board;
with LCD_Std_Out;
with BMP_Fonts;
with Ada.Exceptions.Traceback; use Ada.Exceptions.Traceback;
with GNAT.Debug_Utilities; use GNAT.Debug_Utilities;
package body Last_Chance_Handler is
-------------------------
-- Last_Chance_Handler --
-------------------------
procedure Last_Chance_Handler (Error : Exception_Occurrence) is
begin
Initialize_LEDs; -- in case no other use already within the application
All_LEDs_Off;
LCD_Std_Out.Set_Font (To => BMP_Fonts.Font12x12);
LCD_Std_Out.Clear_Screen;
No_Exceptions_Propagated : begin
LCD_Std_Out.Put_Line (Exception_Name (Error));
LCD_Std_Out.Put_Line (Exception_Message (Error));
LCD_Std_Out.New_Line;
LCD_Std_Out.Put_Line ("Traceback:");
for Call_Stack_Address of Tracebacks (Error) loop
LCD_Std_Out.Put_Line (Image_C (Call_Stack_Address));
end loop;
exception
when others => null;
end No_Exceptions_Propagated;
loop
Toggle (LCH_LED);
delay until Clock + Milliseconds (500);
end loop;
end Last_Chance_Handler;
end Last_Chance_Handler;
|
with Ada.Text_IO;
with Ada.Float_Text_IO;
procedure textionum is
type M is mod 100;
type D1 is delta 0.1 digits 3;
package D1IO is new Ada.Text_IO.Decimal_IO (D1);
type D2 is delta 10.0 digits 3;
package D2IO is new Ada.Text_IO.Decimal_IO (D2);
S7 : String (1 .. 7);
S : String (1 .. 12);
begin
D1IO.Put (S7, 10.0);
pragma Assert (S7 = " 10.0");
D1IO.Put (S7, -12.3, Aft => 3);
pragma Assert (S7 = "-12.300");
D2IO.Put (S7, 10.0);
pragma Assert (S7 = " 10.0");
D2IO.Put (S7, -1230.0);
pragma Assert (S7 = "-1230.0");
D2IO.Put (S7, 0.0);
pragma Assert (S7 = " 0.0");
pragma Assert (Integer (Float'(5490.0)) = 5490);
Ada.Float_Text_IO.Put (S, 5490.0);
pragma Assert (S = " 5.49000E+03");
Test_Enumeration_IO : declare
package Boolean_IO is new Ada.Text_IO.Enumeration_IO (Boolean);
Boolean_Item : Boolean;
package Character_IO is new Ada.Text_IO.Enumeration_IO (Character);
Character_Item : Character;
package Wide_Character_IO is new Ada.Text_IO.Enumeration_IO (Wide_Character);
Wide_Character_Item : Wide_Character;
package Wide_Wide_Character_IO is new Ada.Text_IO.Enumeration_IO (Wide_Wide_Character);
Wide_Wide_Character_Item : Wide_Wide_Character;
type E is (A, B, C);
package E_IO is new Ada.Text_IO.Enumeration_IO (E);
E_Item : E;
package Integer_IO is new Ada.Text_IO.Enumeration_IO (Integer);
Integer_Item : Integer;
package M_IO is new Ada.Text_IO.Enumeration_IO (M);
M_Item : M;
Last : Natural;
begin
Boolean_IO.Get ("True", Boolean_Item, Last);
pragma Assert (Boolean_Item and then Last = 4);
begin
Boolean_IO.Get ("null", Boolean_Item, Last);
raise Program_Error;
exception
when Ada.Text_IO.Data_Error => null;
end;
Character_IO.Get ("Hex_FF", Character_Item, Last);
pragma Assert (Character_Item = Character'Val (16#FF#) and then Last = 6);
begin
Character_IO.Get ("Hex_100", Character_Item, Last);
raise Program_Error;
exception
when Ada.Text_IO.Data_Error => null;
end;
Wide_Character_IO.Get ("Hex_FFFF", Wide_Character_Item, Last);
pragma Assert (Wide_Character_Item = Wide_Character'Val (16#FFFF#) and then Last = 8);
begin
Wide_Character_IO.Get ("Hex_10000", Wide_Character_Item, Last);
raise Program_Error;
exception
when Ada.Text_IO.Data_Error => null;
end;
Wide_Wide_Character_IO.Get ("Hex_7FFFFFFF", Wide_Wide_Character_Item, Last);
pragma Assert (Wide_Wide_Character_Item = Wide_Wide_Character'Val (16#7FFFFFFF#) and then Last = 12);
begin
Wide_Wide_Character_IO.Get ("Hex_80000000", Wide_Wide_Character_Item, Last);
raise Program_Error;
exception
when Ada.Text_IO.Data_Error => null;
end;
E_IO.Get ("A", E_Item, Last);
pragma Assert (E_Item = A and then Last = 1);
begin
E_IO.Get ("D", E_Item, Last);
raise Program_Error;
exception
when Ada.Text_IO.Data_Error => null;
end;
Integer_IO.Get ("10", Integer_Item, Last);
pragma Assert (Integer_Item = 10 and then Last = 2);
begin
Integer_IO.Get ("1A", Integer_Item, Last);
raise Program_Error;
exception
when Ada.Text_IO.Data_Error => null;
end;
M_IO.Get ("10", M_Item, Last);
pragma Assert (M_Item = 10 and then Last = 2);
begin
M_IO.Get ("1A", M_Item, Last);
raise Program_Error;
exception
when Ada.Text_IO.Data_Error => null;
end;
end Test_Enumeration_IO;
pragma Debug (Ada.Debug.Put ("OK"));
end textionum;
|
-------------------------------------------------------------------------------
-- Package : Show_Version --
-- Description : Display current program version and build info. --
-- Author : Simon Rowe <simon@wiremoons.com> --
-- License : MIT Open Source. --
-------------------------------------------------------------------------------
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Ada.Strings.Maps; use Ada.Strings.Maps;
with Ada.Text_IO.Unbounded_IO; use Ada.Text_IO.Unbounded_IO;
with Ada.Directories;
with Ada.IO_Exceptions;
with Ada.Strings.Fixed;
with Ada.Command_Line;
with GNAT.Source_Info;
with GNAT.Compiler_Version;
with System.Multiprocessors;
package body Show_Version is
-- SET APPLICATION VERSION TO DISPLAY BELOW --
AppVersion : constant String := "0.0.5";
package CVer is new GNAT.Compiler_Version;
-- Linux distros using 'systemd' are required to have the file:
OS_Release_File : constant String := "/etc/os-release";
F : File_Type;
procedure Set_Debug (Is_Debug : in out Boolean) is
--------------------------------------
-- Set if in debug build
--------------------------------------
begin
-- Only gets called if program is compiled as a 'debug' build so variable only set 'true' if this is the case
Is_Debug := True;
end Set_Debug;
function Is_Linux return Boolean is
---------------------------------------
-- Check if the OS is a Linux distro
---------------------------------------
begin
if Ada.Directories.Exists (OS_Release_File) then
return True;
else
return False;
end if;
end Is_Linux;
function Is_Windows return Boolean is
---------------------------------------
-- Check if the OS is Windows
---------------------------------------
-- alter to use env variable in Windiws is not on a 'c:' drive
--
begin
if Ada.Directories.Exists ("c:\windows") then
return True;
else
return False;
end if;
end Is_Windows;
procedure Clean_Pretty_Name (OS_Name : in out Unbounded_String) is
-----------------------------------------------
-- Clean up the 'PRETTY_NAME' and extract text
-----------------------------------------------
-- Expects the line of text in the format:
-- PRETTY_NAME="Ubuntu 20.04.1 LTS"
--
-- Delete all leading text up to and including '=' leaving:
-- "Ubuntu 20.04.1 LTS"
--
-- This is then further cleaned up to remove both '"' characters which are defined in the 'Quote_Char'
-- Character_Set. The cleaned up text is modified in place using the provided Unbounded.String resulting in
-- a final string of (or equivalent for other PRETTY_NAME entries):
-- Ubuntu 20.04.1 LTS
Quote_Char : constant Character_Set := To_Set ('"'); --\""
begin
if Length (OS_Name) > 0 then
-- delete up to (and including) character '=' in string
Delete (OS_Name, 1, Index (OS_Name, "="));
-- trim off quotes
Trim (OS_Name, Quote_Char, Quote_Char);
end if;
end Clean_Pretty_Name;
function Get_Linux_OS return String is
----------------------------------------
-- Get the OS Linux distro 'PRETTY_NAME'
----------------------------------------
-- Linux systems running 'systemd' should include a file:
-- /etc/os-release
--
-- This file includes many entries but should have the line:
-- PRETTY_NAME="Ubuntu 20.04.1 LTS"
-- The file is opened and read until the above line is located. The line is then cleaned up in the procedure
-- 'Clean_Pretty_Name'. The remaining text should jus be:
-- Ubuntu 20.04.1 LTS
-- that is returned as a String.
OS_Name : Unbounded_String := Null_Unbounded_String;
begin
if Ada.Directories.Exists (OS_Release_File) then
Open (F, In_File, OS_Release_File);
while not End_Of_File (F) loop
declare
Line : constant String := Get_Line (F);
begin
if Ada.Strings.Fixed.Count (Line, "PRETTY_NAME") > 0 then
-- get the identified line from the file
OS_Name := To_Unbounded_String (Line);
pragma Debug (New_Line (Standard_Error, 1));
pragma Debug (Put_Line (Standard_Error, "[DEBUG] unmodified: " & OS_Name));
-- extract the part required
Clean_Pretty_Name (OS_Name);
pragma Debug (Put_Line (Standard_Error, "[DEBUG] cleaned up: " & OS_Name));
end if;
end;
end loop;
-- return the extracted distro text
return To_String (OS_Name);
else
New_Line (2);
Put_Line (Standard_Error, "ERROR: unable to locate file:");
Put_Line (Standard_Error, " - " & OS_Release_File);
New_Line (1);
return "UNKNOWN LINUX OS";
end if;
exception
when Ada.IO_Exceptions.Name_Error =>
New_Line (2);
Put_Line (Standard_Error, "ERROR: file not found exception!");
return "UNKNOWN LINUX OS";
when others =>
New_Line (2);
Put_Line (Standard_Error, "ERROR: unknown exception!");
return "UNKNOWN LINUX OS";
end Get_Linux_OS;
procedure Show is
-------------------------------------------
-- Collect and display version information
-------------------------------------------
Is_Debug : Boolean := False;
begin
-- only gets called if complied with: '-gnata'
pragma Debug (Set_Debug (Is_Debug));
pragma Debug (Put_Line (Standard_Error, "[DEBUG] 'Show_Version' is running in debug mode."));
-- start output of version information
New_Line (1);
Put ("'");
Put (Ada.Directories.Simple_Name (Ada.Command_Line.Command_Name));
Put ("' is version: '");
Put (AppVersion);
Put ("' running on: '");
if Is_Linux then
Put (Get_Linux_OS);
elsif Is_Windows then
Put ("Windows");
else
Put ("UNKNOWN OS");
end if;
Put ("' with");
Put (System.Multiprocessors.Number_Of_CPUs'Image);
Put_Line (" CPU cores.");
Put ("Compiled on: ");
Put (GNAT.Source_Info.Compilation_ISO_Date);
Put (" @ ");
Put (GNAT.Source_Info.Compilation_Time);
Put_Line (".");
Put_Line ("Copyright (c) 2021 Simon Rowe.");
New_Line (1);
Put ("Ada source built as '");
if Is_Debug then
Put ("debug");
else
Put ("release");
end if;
Put ("' using GNAT complier version: '");
Put (CVer.Version);
Put_Line ("'.");
New_Line (1);
Put_Line ("For licenses and further information visit:");
Put_Line (" - https://github.com/wiremoons/apass/");
New_Line (1);
end Show;
end Show_Version;
|
package Pascal is
type Row is array (Natural range <>) of Natural;
function Length(R: Row) return Positive;
function First_Row(Max_Length: Positive) return Row;
function Next_Row(R: Row) return Row;
end Pascal;
|
-----------------------------------------------------------------------
-- util-commands-drivers -- Support to make command line tools
-- 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 Util.Log;
with Util.Commands.Parsers;
private with Ada.Strings.Unbounded;
private with Ada.Containers.Ordered_Sets;
-- == Command line driver ==
-- The `Util.Commands.Drivers` generic package provides a support to build command line
-- tools that have different commands identified by a name. It defines the `Driver_Type`
-- tagged record that provides a registry of application commands. It gives entry points
-- to register commands and execute them.
--
-- The `Context_Type` package parameter defines the type for the `Context` parameter
-- that is passed to the command when it is executed. It can be used to provide
-- application specific context to the command.
--
-- The `Config_Parser` describes the parser package that will handle the analysis of
-- command line options. To use the GNAT options parser, it is possible to use the
-- `Util.Commands.Parsers.GNAT_Parser` package.
generic
-- The command execution context.
type Context_Type (<>) is limited private;
with package Config_Parser is new Util.Commands.Parsers.Config_Parser (<>);
with function Translate (Message : in String) return String is No_Translate;
Driver_Name : String := "Drivers";
package Util.Commands.Drivers is
subtype Config_Type is Config_Parser.Config_Type;
-- A simple command handler executed when the command with the given name is executed.
type Command_Handler is not null access procedure (Name : in String;
Args : in Argument_List'Class;
Context : in out Context_Type);
-- A more complex command handler that has a command instance as context.
type Command_Type is abstract tagged limited private;
type Command_Access is access all Command_Type'Class;
-- Get the description associated with the command.
function Get_Description (Command : in Command_Type) return String;
-- Get the name used to register the command.
function Get_Name (Command : in Command_Type) return String;
-- Execute the command with the arguments. The command name is passed with the command
-- arguments.
procedure Execute (Command : in out Command_Type;
Name : in String;
Args : in Argument_List'Class;
Context : in out Context_Type) is abstract;
-- Setup the command before parsing the arguments and executing it.
procedure Setup (Command : in out Command_Type;
Config : in out Config_Type;
Context : in out Context_Type) is null;
-- Write the help associated with the command.
procedure Help (Command : in out Command_Type;
Name : in String;
Context : in out Context_Type) is abstract;
-- Write the command usage.
procedure Usage (Command : in out Command_Type;
Name : in String;
Context : in out Context_Type);
-- Print a message for the command. The level indicates whether the message is an error,
-- warning or informational. The command name can be used to known the originator.
-- The <tt>Log</tt> operation is redirected to the driver's <tt>Log</tt> procedure.
procedure Log (Command : in Command_Type;
Level : in Util.Log.Level_Type;
Name : in String;
Message : in String);
type Help_Command_Type is new Command_Type with private;
-- Execute the help command with the arguments.
-- Print the help for every registered command.
overriding
procedure Execute (Command : in out Help_Command_Type;
Name : in String;
Args : in Argument_List'Class;
Context : in out Context_Type);
-- Write the help associated with the command.
overriding
procedure Help (Command : in out Help_Command_Type;
Name : in String;
Context : in out Context_Type);
type Driver_Type is tagged limited private;
-- Report the command usage.
procedure Usage (Driver : in Driver_Type;
Args : in Argument_List'Class;
Context : in out Context_Type;
Name : in String := "");
-- Set the driver description printed in the usage.
procedure Set_Description (Driver : in out Driver_Type;
Description : in String);
-- Set the driver usage printed in the usage.
procedure Set_Usage (Driver : in out Driver_Type;
Usage : in String);
-- Register the command under the given name.
procedure Add_Command (Driver : in out Driver_Type;
Name : in String;
Command : in Command_Access);
procedure Add_Command (Driver : in out Driver_Type;
Name : in String;
Description : in String;
Command : in Command_Access);
-- Register the command under the given name.
procedure Add_Command (Driver : in out Driver_Type;
Name : in String;
Description : in String;
Handler : in Command_Handler);
-- Find the command having the given name.
-- Returns null if the command was not found.
function Find_Command (Driver : in Driver_Type;
Name : in String) return Command_Access;
-- Execute the command registered under the given name.
procedure Execute (Driver : in Driver_Type;
Name : in String;
Args : in Argument_List'Class;
Context : in out Context_Type);
-- Print a message for the command. The level indicates whether the message is an error,
-- warning or informational. The command name can be used to known the originator.
procedure Log (Driver : in Driver_Type;
Level : in Util.Log.Level_Type;
Name : in String;
Message : in String);
private
type Command_Type is abstract tagged limited record
Driver : access Driver_Type'Class;
Name : Ada.Strings.Unbounded.Unbounded_String;
Description : Ada.Strings.Unbounded.Unbounded_String;
end record;
function "<" (Left, Right : in Command_Access) return Boolean is
(Ada.Strings.Unbounded."<" (Left.Name, Right.Name));
package Command_Sets is
new Ada.Containers.Ordered_Sets (Element_Type => Command_Access,
"<" => "<",
"=" => "=");
type Help_Command_Type is new Command_Type with null record;
type Handler_Command_Type is new Command_Type with record
Handler : Command_Handler;
end record;
-- Execute the command with the arguments.
overriding
procedure Execute (Command : in out Handler_Command_Type;
Name : in String;
Args : in Argument_List'Class;
Context : in out Context_Type);
-- Write the help associated with the command.
overriding
procedure Help (Command : in out Handler_Command_Type;
Name : in String;
Context : in out Context_Type);
type Driver_Type is tagged limited record
List : Command_Sets.Set;
Desc : Ada.Strings.Unbounded.Unbounded_String;
Usage : Ada.Strings.Unbounded.Unbounded_String;
end record;
end Util.Commands.Drivers;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- G N A T . H E A P _ S O R T _ G --
-- --
-- S p e c --
-- --
-- Copyright (C) 1995-2020, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- Heapsort generic package using formal procedures
-- This package provides a generic heapsort routine that can be used with
-- different types of data.
-- See also GNAT.Heap_Sort, a version that works with subprogram access
-- parameters, allowing code sharing. The generic version is slightly more
-- efficient but does not allow code sharing and has an interface that is
-- more awkward to use.
-- There is also GNAT.Heap_Sort_A, which is now considered obsolete, but
-- was an older version working with subprogram parameters. This version
-- is retained for backwards compatibility with old versions of GNAT.
-- This heapsort algorithm uses approximately N*log(N) compares in the
-- worst case and is in place with no additional storage required. See
-- the body for exact details of the algorithm used.
generic
-- The data to be sorted is assumed to be indexed by integer values from
-- 1 to N, where N is the number of items to be sorted. In addition, the
-- index value zero is used for a temporary location used during the sort.
with procedure Move (From : Natural; To : Natural);
-- A procedure that moves the data item with index value From to the data
-- item with index value To (the old value in To being lost). An index
-- value of zero is used for moves from and to a single temporary location.
-- For best efficiency, this routine should be marked as inlined.
with function Lt (Op1, Op2 : Natural) return Boolean;
-- A function that compares two items and returns True if the item with
-- index Op1 is less than the item with Index Op2, and False if the Op1
-- item is greater than the Op2 item. If the two items are equal, then
-- it does not matter whether True or False is returned (it is slightly
-- more efficient to return False). For best efficiency, this routine
-- should be marked as inlined.
-- Note on use of temporary location
-- There are two ways of providing for the index value zero to represent
-- a temporary value. Either an extra location can be allocated at the
-- start of the array, or alternatively the Move and Lt subprograms can
-- test for the case of zero and treat it specially. In any case it is
-- desirable to specify the two subprograms as inlined and the tests for
-- zero will in this case be resolved at instantiation time.
package GNAT.Heap_Sort_G is
pragma Pure;
procedure Sort (N : Natural);
-- This procedures sorts items in the range from 1 to N into ascending
-- order making calls to Lt to do required comparisons, and Move to move
-- items around. Note that, as described above, both Move and Lt use a
-- single temporary location with index value zero. This sort is not
-- stable, i.e. the order of equal elements in the input is not preserved.
end GNAT.Heap_Sort_G;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- B I N D O . G R A P H S --
-- --
-- B o d y --
-- --
-- Copyright (C) 2019-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. 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 Ada.Unchecked_Deallocation;
with Butil; use Butil;
with Debug; use Debug;
with Output; use Output;
with Bindo.Writers;
use Bindo.Writers;
use Bindo.Writers.Phase_Writers;
package body Bindo.Graphs is
-----------------------
-- Local subprograms --
-----------------------
function Sequence_Next_Cycle return Library_Graph_Cycle_Id;
pragma Inline (Sequence_Next_Cycle);
-- Generate a new unique library graph cycle handle
function Sequence_Next_Edge return Invocation_Graph_Edge_Id;
pragma Inline (Sequence_Next_Edge);
-- Generate a new unique invocation graph edge handle
function Sequence_Next_Edge return Library_Graph_Edge_Id;
pragma Inline (Sequence_Next_Edge);
-- Generate a new unique library graph edge handle
function Sequence_Next_Vertex return Invocation_Graph_Vertex_Id;
pragma Inline (Sequence_Next_Vertex);
-- Generate a new unique invocation graph vertex handle
function Sequence_Next_Vertex return Library_Graph_Vertex_Id;
pragma Inline (Sequence_Next_Vertex);
-- Generate a new unique library graph vertex handle
-----------------------------------
-- Destroy_Invocation_Graph_Edge --
-----------------------------------
procedure Destroy_Invocation_Graph_Edge
(Edge : in out Invocation_Graph_Edge_Id)
is
pragma Unreferenced (Edge);
begin
null;
end Destroy_Invocation_Graph_Edge;
---------------------------------
-- Destroy_Library_Graph_Cycle --
---------------------------------
procedure Destroy_Library_Graph_Cycle
(Cycle : in out Library_Graph_Cycle_Id)
is
pragma Unreferenced (Cycle);
begin
null;
end Destroy_Library_Graph_Cycle;
--------------------------------
-- Destroy_Library_Graph_Edge --
--------------------------------
procedure Destroy_Library_Graph_Edge
(Edge : in out Library_Graph_Edge_Id)
is
pragma Unreferenced (Edge);
begin
null;
end Destroy_Library_Graph_Edge;
----------------------------------
-- Destroy_Library_Graph_Vertex --
----------------------------------
procedure Destroy_Library_Graph_Vertex
(Vertex : in out Library_Graph_Vertex_Id)
is
pragma Unreferenced (Vertex);
begin
null;
end Destroy_Library_Graph_Vertex;
--------------------------------
-- Hash_Invocation_Graph_Edge --
--------------------------------
function Hash_Invocation_Graph_Edge
(Edge : Invocation_Graph_Edge_Id) return Bucket_Range_Type
is
begin
pragma Assert (Present (Edge));
return Bucket_Range_Type (Edge);
end Hash_Invocation_Graph_Edge;
----------------------------------
-- Hash_Invocation_Graph_Vertex --
----------------------------------
function Hash_Invocation_Graph_Vertex
(Vertex : Invocation_Graph_Vertex_Id) return Bucket_Range_Type
is
begin
pragma Assert (Present (Vertex));
return Bucket_Range_Type (Vertex);
end Hash_Invocation_Graph_Vertex;
------------------------------
-- Hash_Library_Graph_Cycle --
------------------------------
function Hash_Library_Graph_Cycle
(Cycle : Library_Graph_Cycle_Id) return Bucket_Range_Type
is
begin
pragma Assert (Present (Cycle));
return Bucket_Range_Type (Cycle);
end Hash_Library_Graph_Cycle;
-----------------------------
-- Hash_Library_Graph_Edge --
-----------------------------
function Hash_Library_Graph_Edge
(Edge : Library_Graph_Edge_Id) return Bucket_Range_Type
is
begin
pragma Assert (Present (Edge));
return Bucket_Range_Type (Edge);
end Hash_Library_Graph_Edge;
-------------------------------
-- Hash_Library_Graph_Vertex --
-------------------------------
function Hash_Library_Graph_Vertex
(Vertex : Library_Graph_Vertex_Id) return Bucket_Range_Type
is
begin
pragma Assert (Present (Vertex));
return Bucket_Range_Type (Vertex);
end Hash_Library_Graph_Vertex;
--------------------
-- Library_Graphs --
--------------------
package body Library_Graphs is
-----------------------
-- Local subprograms --
-----------------------
procedure Add_Body_Before_Spec_Edge
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id;
Edges : LGE_Lists.Doubly_Linked_List);
pragma Inline (Add_Body_Before_Spec_Edge);
-- Create a new edge in library graph G between vertex Vertex and its
-- corresponding spec or body, where the body is a predecessor and the
-- spec a successor. Add the edge to list Edges.
procedure Add_Body_Before_Spec_Edges
(G : Library_Graph;
Edges : LGE_Lists.Doubly_Linked_List);
pragma Inline (Add_Body_Before_Spec_Edges);
-- Create new edges in library graph G for all vertices and their
-- corresponding specs or bodies, where the body is a predecessor
-- and the spec is a successor. Add all edges to list Edges.
procedure Add_Edge_Kind_Check
(G : Library_Graph;
Pred : Library_Graph_Vertex_Id;
Succ : Library_Graph_Vertex_Id;
New_Kind : Library_Graph_Edge_Kind);
-- This is called by Add_Edge in the case where there is already a
-- Pred-->Succ edge, to assert that the New_Kind is appropriate. Raises
-- Program_Error if a bug is detected. The purpose is to prevent bugs
-- where calling Add_Edge in different orders produces different output.
function Add_Edge
(G : Library_Graph;
Pred : Library_Graph_Vertex_Id;
Succ : Library_Graph_Vertex_Id;
Kind : Library_Graph_Edge_Kind;
Activates_Task : Boolean) return Library_Graph_Edge_Id;
pragma Inline (Add_Edge);
-- Create a new edge in library graph G with source vertex Pred and
-- destination vertex Succ, and return its handle. Kind denotes the
-- nature of the edge. Activates_Task should be set when the edge
-- involves a task activation. If Pred and Succ are already related,
-- no edge is created and No_Library_Graph_Edge is returned, but if
-- Activates_Task is True, then the flag of the existing edge is
-- updated.
function At_Least_One_Edge_Satisfies
(G : Library_Graph;
Cycle : Library_Graph_Cycle_Id;
Predicate : LGE_Predicate_Ptr) return Boolean;
pragma Inline (At_Least_One_Edge_Satisfies);
-- Determine whether at least one edge of cycle Cycle of library graph G
-- satisfies predicate Predicate.
function Copy_Cycle_Path
(Cycle_Path : LGE_Lists.Doubly_Linked_List)
return LGE_Lists.Doubly_Linked_List;
pragma Inline (Copy_Cycle_Path);
-- Create a deep copy of list Cycle_Path
function Cycle_End_Vertices
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id;
Elaborate_All_Active : Boolean) return LGV_Sets.Membership_Set;
pragma Inline (Cycle_End_Vertices);
-- Part of Tarjan's enumeration of the elementary circuits of a directed
-- graph algorithm. Collect the vertices that terminate a cycle starting
-- from vertex Vertex of library graph G in a set. This is usually the
-- vertex itself, unless the vertex is part of an Elaborate_Body pair,
-- or flag Elaborate_All_Active is set. In that case the complementary
-- vertex is also added to the set.
function Cycle_Kind_Of
(G : Library_Graph;
Edge : Library_Graph_Edge_Id) return Library_Graph_Cycle_Kind;
pragma Inline (Cycle_Kind_Of);
-- Determine the cycle kind of edge Edge of library graph G if the edge
-- participated in a circuit.
function Cycle_Kind_Precedence
(Kind : Library_Graph_Cycle_Kind;
Compared_To : Library_Graph_Cycle_Kind) return Precedence_Kind;
pragma Inline (Cycle_Kind_Precedence);
-- Determine the precedence of cycle kind Kind compared to cycle kind
-- Compared_To.
function Cycle_Path_Precedence
(G : Library_Graph;
Path : LGE_Lists.Doubly_Linked_List;
Compared_To : LGE_Lists.Doubly_Linked_List) return Precedence_Kind;
pragma Inline (Cycle_Path_Precedence);
-- Determine the precedence of cycle path Path of library graph G
-- compared to path Compared_To.
function Cycle_Precedence
(G : Library_Graph;
Cycle : Library_Graph_Cycle_Id;
Compared_To : Library_Graph_Cycle_Id) return Precedence_Kind;
pragma Inline (Cycle_Precedence);
-- Determine the precedence of cycle Cycle of library graph G compared
-- to cycle Compared_To.
procedure Decrement_Library_Graph_Edge_Count
(G : Library_Graph;
Kind : Library_Graph_Edge_Kind);
pragma Inline (Decrement_Library_Graph_Edge_Count);
-- Decrement the number of edges of kind King in library graph G by one
procedure Delete_Body_Before_Spec_Edges
(G : Library_Graph;
Edges : LGE_Lists.Doubly_Linked_List);
pragma Inline (Delete_Body_Before_Spec_Edges);
-- Delete all edges in list Edges from library graph G, that link spec
-- and bodies, where the body acts as the predecessor and the spec as a
-- successor.
procedure Delete_Edge
(G : Library_Graph;
Edge : Library_Graph_Edge_Id);
pragma Inline (Delete_Edge);
-- Delete edge Edge from library graph G
function Edge_Precedence
(G : Library_Graph;
Edge : Library_Graph_Edge_Id;
Compared_To : Library_Graph_Edge_Id) return Precedence_Kind;
pragma Inline (Edge_Precedence);
-- Determine the precedence of edge Edge of library graph G compared to
-- edge Compared_To.
procedure Find_Cycles_From_Successor
(G : Library_Graph;
Edge : Library_Graph_Edge_Id;
End_Vertices : LGV_Sets.Membership_Set;
Deleted_Vertices : LGV_Sets.Membership_Set;
Most_Significant_Edge : Library_Graph_Edge_Id;
Invocation_Edge_Count : Natural;
Cycle_Path_Stack : LGE_Lists.Doubly_Linked_List;
Visited_Set : LGV_Sets.Membership_Set;
Visited_Stack : LGV_Lists.Doubly_Linked_List;
Cycle_Count : in out Natural;
Cycle_Limit : Natural;
Elaborate_All_Active : Boolean;
Has_Cycle : out Boolean;
Indent : Indentation_Level);
pragma Inline (Find_Cycles_From_Successor);
-- Part of Tarjan's enumeration of the elementary circuits of a directed
-- graph algorithm. Find all cycles from the successor indicated by edge
-- Edge of library graph G. If at least one cycle exists, set Has_Cycle
-- to True. The remaining parameters are as follows:
--
-- * End vertices is the set of vertices that terminate a potential
-- cycle.
--
-- * Deleted vertices is the set of vertices that have been expanded
-- during previous depth-first searches and should not be visited
-- for the rest of the algorithm.
--
-- * Most_Significant_Edge is the current highest-precedence edge on
-- the path of the potential cycle.
--
-- * Invocation_Edge_Count is the number of invocation edges on the
-- path of the potential cycle.
--
-- * Cycle_Path_Stack is the path of the potential cycle.
--
-- * Visited_Set is the set of vertices that have been visited during
-- the current depth-first search.
--
-- * Visited_Stack maintains the vertices of Visited_Set in a stack
-- for later unvisiting.
--
-- * Cycle_Count is the number of cycles discovered so far.
--
-- * Cycle_Limit is the upper bound of the number of cycles to be
-- discovered.
--
-- * Elaborate_All_Active should be set when the component currently
-- being examined for cycles contains an Elaborate_All edge.
--
-- * Indent in the desired indentation level for tracing.
procedure Find_Cycles_From_Vertex
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id;
End_Vertices : LGV_Sets.Membership_Set;
Deleted_Vertices : LGV_Sets.Membership_Set;
Most_Significant_Edge : Library_Graph_Edge_Id;
Invocation_Edge_Count : Natural;
Cycle_Path_Stack : LGE_Lists.Doubly_Linked_List;
Visited_Set : LGV_Sets.Membership_Set;
Visited_Stack : LGV_Lists.Doubly_Linked_List;
Cycle_Count : in out Natural;
Cycle_Limit : Natural;
Elaborate_All_Active : Boolean;
Is_Start_Vertex : Boolean;
Has_Cycle : out Boolean;
Indent : Indentation_Level);
pragma Inline (Find_Cycles_From_Vertex);
-- Part of Tarjan's enumeration of the elementary circuits of a directed
-- graph algorithm. Find all cycles from vertex Vertex of library graph
-- G. If at least one cycle exists, set Has_Cycle to True. The remaining
-- parameters are as follows:
--
-- * End_Vertices is the set of vertices that terminate a potential
-- cycle.
--
-- * Deleted_Vertices is the set of vertices that have been expanded
-- during previous depth-first searches and should not be visited
-- for the rest of the algorithm.
--
-- * Most_Significant_Edge is the current highest-precedence edge on
-- the path of the potential cycle.
--
-- * Invocation_Edge_Count is the number of invocation edges on the
-- path of the potential cycle.
--
-- * Cycle_Path_Stack is the path of the potential cycle.
--
-- * Visited_Set is the set of vertices that have been visited during
-- the current depth-first search.
--
-- * Visited_Stack maintains the vertices of Visited_Set in a stack
-- for later unvisiting.
--
-- * Cycle_Count is the number of cycles discovered so far.
--
-- * Cycle_Limit is the upper bound of the number of cycles to be
-- discovered.
--
-- * Elaborate_All_Active should be set when the component currently
-- being examined for cycles contains an Elaborate_All edge.
--
-- * Indent in the desired indentation level for tracing.
procedure Find_Cycles_In_Component
(G : Library_Graph;
Comp : Component_Id;
Cycle_Count : in out Natural;
Cycle_Limit : Natural);
pragma Inline (Find_Cycles_In_Component);
-- Part of Tarjan's enumeration of the elementary circuits of a directed
-- graph algorithm. Find all cycles in component Comp of library graph
-- G. The remaining parameters are as follows:
--
-- * Cycle_Count is the number of cycles discovered so far.
--
-- * Cycle_Limit is the upper bound of the number of cycles to be
-- discovered.
function Find_Edge
(G : Library_Graph;
Pred : Library_Graph_Vertex_Id;
Succ : Library_Graph_Vertex_Id) return Library_Graph_Edge_Id;
-- There must be an edge Pred-->Succ; this returns it
function Find_First_Lower_Precedence_Cycle
(G : Library_Graph;
Cycle : Library_Graph_Cycle_Id) return Library_Graph_Cycle_Id;
pragma Inline (Find_First_Lower_Precedence_Cycle);
-- Inspect the list of cycles of library graph G and return the first
-- cycle whose precedence is lower than that of cycle Cycle. If there
-- is no such cycle, return No_Library_Graph_Cycle.
procedure Free is
new Ada.Unchecked_Deallocation
(Library_Graph_Attributes, Library_Graph);
function Get_Component_Attributes
(G : Library_Graph;
Comp : Component_Id) return Component_Attributes;
pragma Inline (Get_Component_Attributes);
-- Obtain the attributes of component Comp of library graph G
function Get_LGC_Attributes
(G : Library_Graph;
Cycle : Library_Graph_Cycle_Id) return Library_Graph_Cycle_Attributes;
pragma Inline (Get_LGC_Attributes);
-- Obtain the attributes of cycle Cycle of library graph G
function Get_LGE_Attributes
(G : Library_Graph;
Edge : Library_Graph_Edge_Id)
return Library_Graph_Edge_Attributes;
pragma Inline (Get_LGE_Attributes);
-- Obtain the attributes of edge Edge of library graph G
function Get_LGV_Attributes
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id)
return Library_Graph_Vertex_Attributes;
pragma Inline (Get_LGV_Attributes);
-- Obtain the attributes of vertex Edge of library graph G
function Has_Elaborate_Body
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id) return Boolean;
pragma Inline (Has_Elaborate_Body);
-- Determine whether vertex Vertex of library graph G is subject to
-- pragma Elaborate_Body.
function Has_Elaborate_All_Edge
(G : Library_Graph;
Comp : Component_Id) return Boolean;
pragma Inline (Has_Elaborate_All_Edge);
-- Determine whether component Comp of library graph G contains an
-- Elaborate_All edge that links two vertices in the same component.
function Has_Elaborate_All_Edge
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id) return Boolean;
pragma Inline (Has_Elaborate_All_Edge);
-- Determine whether vertex Vertex of library graph G contains an
-- Elaborate_All edge to a successor where both the vertex and the
-- successor reside in the same component.
function Highest_Precedence_Edge
(G : Library_Graph;
Left : Library_Graph_Edge_Id;
Right : Library_Graph_Edge_Id) return Library_Graph_Edge_Id;
pragma Inline (Highest_Precedence_Edge);
-- Return the edge with highest precedence among edges Left and Right of
-- library graph G.
procedure Increment_Library_Graph_Edge_Count
(G : Library_Graph;
Kind : Library_Graph_Edge_Kind);
pragma Inline (Increment_Library_Graph_Edge_Count);
-- Increment the number of edges of king Kind in library graph G by one
procedure Increment_Pending_Predecessors
(G : Library_Graph;
Comp : Component_Id;
Edge : Library_Graph_Edge_Id);
pragma Inline (Increment_Pending_Predecessors);
-- Increment the number of pending predecessors component Comp which was
-- reached via edge Edge of library graph G must wait on before it can
-- be elaborated by one.
procedure Increment_Pending_Predecessors
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id;
Edge : Library_Graph_Edge_Id);
pragma Inline (Increment_Pending_Predecessors);
-- Increment the number of pending predecessors vertex Vertex which was
-- reached via edge Edge of library graph G must wait on before it can
-- be elaborated by one.
procedure Initialize_Components (G : Library_Graph);
pragma Inline (Initialize_Components);
-- Initialize on the initial call or re-initialize on subsequent calls
-- all components of library graph G.
function Is_Cycle_Initiating_Edge
(G : Library_Graph;
Edge : Library_Graph_Edge_Id) return Boolean;
pragma Inline (Is_Cycle_Initiating_Edge);
-- Determine whether edge Edge of library graph G starts a cycle
function Is_Cyclic_Edge
(G : Library_Graph;
Edge : Library_Graph_Edge_Id) return Boolean;
pragma Inline (Is_Cyclic_Edge);
-- Determine whether edge Edge of library graph G participates in a
-- cycle.
function Is_Cyclic_Elaborate_All_Edge
(G : Library_Graph;
Edge : Library_Graph_Edge_Id) return Boolean;
pragma Inline (Is_Cyclic_Elaborate_All_Edge);
-- Determine whether edge Edge of library graph G participates in a
-- cycle and has a predecessor that is subject to pragma Elaborate_All.
function Is_Cyclic_Elaborate_Body_Edge
(G : Library_Graph;
Edge : Library_Graph_Edge_Id) return Boolean;
pragma Inline (Is_Cyclic_Elaborate_Body_Edge);
-- Determine whether edge Edge of library graph G participates in a
-- cycle and has a successor that is either a spec subject to pragma
-- Elaborate_Body, or a body that completes such a spec.
function Is_Cyclic_Elaborate_Edge
(G : Library_Graph;
Edge : Library_Graph_Edge_Id) return Boolean;
pragma Inline (Is_Cyclic_Elaborate_Edge);
-- Determine whether edge Edge of library graph G participates in a
-- cycle and has a predecessor that is subject to pragma Elaborate.
function Is_Cyclic_Forced_Edge
(G : Library_Graph;
Edge : Library_Graph_Edge_Id) return Boolean;
pragma Inline (Is_Cyclic_Forced_Edge);
-- Determine whether edge Edge of library graph G participates in a
-- cycle and came from the forced-elaboration-order file.
function Is_Cyclic_Invocation_Edge
(G : Library_Graph;
Edge : Library_Graph_Edge_Id) return Boolean;
pragma Inline (Is_Cyclic_Invocation_Edge);
-- Determine whether edge Edge of library graph G participates in a
-- cycle and came from the traversal of the invocation graph.
function Is_Cyclic_With_Edge
(G : Library_Graph;
Edge : Library_Graph_Edge_Id) return Boolean;
pragma Inline (Is_Cyclic_With_Edge);
-- Determine whether edge Edge of library graph G participates in a
-- cycle and is the result of a with dependency between its successor
-- and predecessor.
function Is_Recorded_Edge
(G : Library_Graph;
Rel : Predecessor_Successor_Relation) return Boolean;
pragma Inline (Is_Recorded_Edge);
-- Determine whether a predecessor vertex and a successor vertex
-- described by relation Rel are already linked in library graph G.
function Is_Static_Successor_Edge
(G : Library_Graph;
Edge : Library_Graph_Edge_Id) return Boolean;
pragma Inline (Is_Static_Successor_Edge);
-- Determine whether the successor of invocation edge Edge represents a
-- unit that was compiled with the static model.
function Is_Vertex_With_Elaborate_Body
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id) return Boolean;
pragma Inline (Is_Vertex_With_Elaborate_Body);
-- Determine whether vertex Vertex of library graph G denotes a spec
-- subject to pragma Elaborate_Body or the completing body of such a
-- spec.
function Links_Vertices_In_Same_Component
(G : Library_Graph;
Edge : Library_Graph_Edge_Id) return Boolean;
pragma Inline (Links_Vertices_In_Same_Component);
-- Determine whether edge Edge of library graph G links a predecessor
-- and successor that reside in the same component.
function Maximum_Invocation_Edge_Count
(G : Library_Graph;
Edge : Library_Graph_Edge_Id;
Count : Natural) return Natural;
pragma Inline (Maximum_Invocation_Edge_Count);
-- Determine whether edge Edge of library graph G is an invocation edge,
-- and if it is return Count + 1, otherwise return Count.
procedure Normalize_Cycle_Path
(Cycle_Path : LGE_Lists.Doubly_Linked_List;
Most_Significant_Edge : Library_Graph_Edge_Id);
pragma Inline (Normalize_Cycle_Path);
-- Normalize cycle path Path by rotating it until its starting edge is
-- Sig_Edge.
procedure Order_Cycle
(G : Library_Graph;
Cycle : Library_Graph_Cycle_Id);
pragma Inline (Order_Cycle);
-- Insert cycle Cycle in library graph G and sort it based on its
-- precedence relative to all recorded cycles.
function Path
(G : Library_Graph;
Cycle : Library_Graph_Cycle_Id) return LGE_Lists.Doubly_Linked_List;
pragma Inline (Path);
-- Obtain the path of edges which comprises cycle Cycle of library
-- graph G.
procedure Record_Cycle
(G : Library_Graph;
Most_Significant_Edge : Library_Graph_Edge_Id;
Invocation_Edge_Count : Natural;
Cycle_Path : LGE_Lists.Doubly_Linked_List;
Indent : Indentation_Level);
pragma Inline (Record_Cycle);
-- Normalize a cycle described by its path Cycle_Path and add it to
-- library graph G. Most_Significant_Edge denotes the edge with the
-- highest significance along the cycle path. Invocation_Edge_Count
-- is the number of invocation edges along the cycle path. Indent is
-- the desired indentation level for tracing.
procedure Set_Activates_Task
(G : Library_Graph;
Edge : Library_Graph_Edge_Id);
-- Set the Activates_Task flag of the Edge to True
procedure Set_Component_Attributes
(G : Library_Graph;
Comp : Component_Id;
Val : Component_Attributes);
pragma Inline (Set_Component_Attributes);
-- Set the attributes of component Comp of library graph G to value Val
procedure Set_Corresponding_Vertex
(G : Library_Graph;
U_Id : Unit_Id;
Val : Library_Graph_Vertex_Id);
pragma Inline (Set_Corresponding_Vertex);
-- Associate vertex Val of library graph G with unit U_Id
procedure Set_Is_Recorded_Edge
(G : Library_Graph;
Rel : Predecessor_Successor_Relation);
pragma Inline (Set_Is_Recorded_Edge);
-- Mark a predecessor vertex and a successor vertex described by
-- relation Rel as already linked.
procedure Set_LGC_Attributes
(G : Library_Graph;
Cycle : Library_Graph_Cycle_Id;
Val : Library_Graph_Cycle_Attributes);
pragma Inline (Set_LGC_Attributes);
-- Set the attributes of cycle Cycle of library graph G to value Val
procedure Set_LGE_Attributes
(G : Library_Graph;
Edge : Library_Graph_Edge_Id;
Val : Library_Graph_Edge_Attributes);
pragma Inline (Set_LGE_Attributes);
-- Set the attributes of edge Edge of library graph G to value Val
procedure Set_LGV_Attributes
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id;
Val : Library_Graph_Vertex_Attributes);
pragma Inline (Set_LGV_Attributes);
-- Set the attributes of vertex Vertex of library graph G to value Val
procedure Trace_Component
(G : Library_Graph;
Comp : Component_Id;
Indent : Indentation_Level);
pragma Inline (Trace_Component);
-- Write the contents of component Comp of library graph G to standard
-- output. Indent is the desired indentation level for tracing.
procedure Trace_Cycle
(G : Library_Graph;
Cycle : Library_Graph_Cycle_Id;
Indent : Indentation_Level);
pragma Inline (Trace_Cycle);
-- Write the contents of cycle Cycle of library graph G to standard
-- output. Indent is the desired indentation level for tracing.
procedure Trace_Edge
(G : Library_Graph;
Edge : Library_Graph_Edge_Id;
Indent : Indentation_Level);
pragma Inline (Trace_Edge);
-- Write the contents of edge Edge of library graph G to standard
-- output. Indent is the desired indentation level for tracing.
procedure Trace_Vertex
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id;
Indent : Indentation_Level);
pragma Inline (Trace_Vertex);
-- Write the contents of vertex Vertex of library graph G to standard
-- output. Indent is the desired indentation level for tracing.
procedure Unvisit
(Vertex : Library_Graph_Vertex_Id;
Visited_Set : LGV_Sets.Membership_Set;
Visited_Stack : LGV_Lists.Doubly_Linked_List);
pragma Inline (Unvisit);
-- Part of Tarjan's enumeration of the elementary circuits of a directed
-- graph algorithm. Unwind the Visited_Stack by removing the top vertex
-- from set Visited_Set until vertex Vertex is reached, inclusive.
procedure Update_Pending_Predecessors
(Strong_Predecessors : in out Natural;
Weak_Predecessors : in out Natural;
Update_Weak : Boolean;
Value : Integer);
pragma Inline (Update_Pending_Predecessors);
-- Update the number of pending strong or weak predecessors denoted by
-- Strong_Predecessors and Weak_Predecessors respectively depending on
-- flag Update_Weak by adding value Value.
procedure Update_Pending_Predecessors_Of_Components (G : Library_Graph);
pragma Inline (Update_Pending_Predecessors_Of_Components);
-- Update the number of pending predecessors all components of library
-- graph G must wait on before they can be elaborated.
procedure Update_Pending_Predecessors_Of_Components
(G : Library_Graph;
Edge : Library_Graph_Edge_Id);
pragma Inline (Update_Pending_Predecessors_Of_Components);
-- Update the number of pending predecessors the component of edge
-- LGE_Is's successor vertex of library graph G must wait on before
-- it can be elaborated.
function Vertex_Precedence
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id;
Compared_To : Library_Graph_Vertex_Id) return Precedence_Kind;
pragma Inline (Vertex_Precedence);
-- Determine the precedence of vertex Vertex of library graph G compared
-- to vertex Compared_To.
procedure Visit
(Vertex : Library_Graph_Vertex_Id;
Visited_Set : LGV_Sets.Membership_Set;
Visited_Stack : LGV_Lists.Doubly_Linked_List);
pragma Inline (Visit);
-- Part of Tarjan's enumeration of the elementary circuits of a directed
-- graph algorithm. Push vertex Vertex on the Visited_Stack and add it
-- to set Visited_Set.
--------------------
-- Activates_Task --
--------------------
function Activates_Task
(G : Library_Graph;
Edge : Library_Graph_Edge_Id) return Boolean
is
begin
return Get_LGE_Attributes (G, Edge).Activates_Task;
end Activates_Task;
-------------------------------
-- Add_Body_Before_Spec_Edge --
-------------------------------
procedure Add_Body_Before_Spec_Edge
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id;
Edges : LGE_Lists.Doubly_Linked_List)
is
Edge : Library_Graph_Edge_Id;
begin
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
pragma Assert (LGE_Lists.Present (Edges));
-- A vertex requires a special Body_Before_Spec edge to its
-- Corresponding_Item when it either denotes a
--
-- * Body that completes a previous spec
--
-- * Spec with a completing body
--
-- The edge creates an intentional circularity between the spec and
-- body in order to emulate a library unit, and guarantees that both
-- will appear in the same component.
--
-- Due to the structure of the library graph, either the spec or
-- the body may be visited first, yet Corresponding_Item will still
-- attempt to create the Body_Before_Spec edge. This is OK because
-- successor and predecessor are kept consistent in both cases, and
-- Add_Edge will prevent the creation of the second edge.
-- Assume that no Body_Before_Spec is necessary
Edge := No_Library_Graph_Edge;
-- A body that completes a previous spec
if Is_Body_With_Spec (G, Vertex) then
Edge :=
Add_Edge
(G => G,
Pred => Vertex,
Succ => Corresponding_Item (G, Vertex),
Kind => Body_Before_Spec_Edge,
Activates_Task => False);
-- A spec with a completing body
elsif Is_Spec_With_Body (G, Vertex) then
Edge :=
Add_Edge
(G => G,
Pred => Corresponding_Item (G, Vertex),
Succ => Vertex,
Kind => Body_Before_Spec_Edge,
Activates_Task => False);
end if;
if Present (Edge) then
LGE_Lists.Append (Edges, Edge);
end if;
end Add_Body_Before_Spec_Edge;
--------------------------------
-- Add_Body_Before_Spec_Edges --
--------------------------------
procedure Add_Body_Before_Spec_Edges
(G : Library_Graph;
Edges : LGE_Lists.Doubly_Linked_List)
is
Iter : Elaborable_Units_Iterator;
U_Id : Unit_Id;
begin
pragma Assert (Present (G));
pragma Assert (LGE_Lists.Present (Edges));
Iter := Iterate_Elaborable_Units;
while Has_Next (Iter) loop
Next (Iter, U_Id);
Add_Body_Before_Spec_Edge
(G => G,
Vertex => Corresponding_Vertex (G, U_Id),
Edges => Edges);
end loop;
end Add_Body_Before_Spec_Edges;
--------------
-- Add_Edge --
--------------
procedure Add_Edge
(G : Library_Graph;
Pred : Library_Graph_Vertex_Id;
Succ : Library_Graph_Vertex_Id;
Kind : Library_Graph_Edge_Kind;
Activates_Task : Boolean)
is
Ignore : constant Library_Graph_Edge_Id :=
Add_Edge
(G => G,
Pred => Pred,
Succ => Succ,
Kind => Kind,
Activates_Task => Activates_Task);
begin
null;
end Add_Edge;
-------------------------
-- Add_Edge_Kind_Check --
-------------------------
procedure Add_Edge_Kind_Check
(G : Library_Graph;
Pred : Library_Graph_Vertex_Id;
Succ : Library_Graph_Vertex_Id;
New_Kind : Library_Graph_Edge_Kind)
is
Old_Edge : constant Library_Graph_Edge_Id :=
Find_Edge (G, Pred, Succ);
Old_Kind : constant Library_Graph_Edge_Kind :=
Get_LGE_Attributes (G, Old_Edge).Kind;
OK : Boolean;
begin
case New_Kind is
when Spec_Before_Body_Edge =>
OK := False;
-- Spec_Before_Body_Edge comes first, and there is never more
-- than one Spec_Before_Body_Edge for a given unit, so we can't
-- have a preexisting edge in the Spec_Before_Body_Edge case.
when With_Edge | Elaborate_Edge | Elaborate_All_Edge
| Forced_Edge | Invocation_Edge =>
OK := Old_Kind <= New_Kind;
-- These edges are created in the order of the enumeration
-- type, and there can be duplicates; hence "<=".
when Body_Before_Spec_Edge =>
OK := Old_Kind = Body_Before_Spec_Edge
-- We call Add_Edge with Body_Before_Spec_Edge twice -- once
-- for the spec and once for the body.
or else Old_Kind = Forced_Edge
or else Old_Kind = Invocation_Edge;
-- The old one can be Forced_Edge or Invocation_Edge, which
-- necessarily results in an elaboration cycle (in the static
-- model), but this assertion happens before cycle detection,
-- so we need to allow these cases.
when No_Edge =>
OK := False;
end case;
if not OK then
raise Program_Error with Old_Kind'Img & "-->" & New_Kind'Img;
end if;
end Add_Edge_Kind_Check;
--------------
-- Add_Edge --
--------------
function Add_Edge
(G : Library_Graph;
Pred : Library_Graph_Vertex_Id;
Succ : Library_Graph_Vertex_Id;
Kind : Library_Graph_Edge_Kind;
Activates_Task : Boolean) return Library_Graph_Edge_Id
is
pragma Assert (Present (G));
pragma Assert (Present (Pred));
pragma Assert (Present (Succ));
pragma Assert (Kind = Invocation_Edge or else not Activates_Task);
-- Only invocation edges can activate tasks
Rel : constant Predecessor_Successor_Relation :=
(Predecessor => Pred, Successor => Succ);
Edge : Library_Graph_Edge_Id;
begin
-- If we already have a Pred-->Succ edge, we don't add another
-- one. But we need to update Activates_Task, in order to avoid
-- depending on the order of processing of edges. If we have
-- Pred-->Succ with Activates_Task=True, and another Pred-->Succ with
-- Activates_Task=False, we want Activates_Task to be True no matter
-- which order we processed those two Add_Edge calls.
if Is_Recorded_Edge (G, Rel) then
pragma Debug (Add_Edge_Kind_Check (G, Pred, Succ, Kind));
if Activates_Task then
Set_Activates_Task (G, Find_Edge (G, Pred, Succ));
end if;
return No_Library_Graph_Edge;
end if;
Edge := Sequence_Next_Edge;
-- Add the edge to the underlying graph. Note that the predecessor
-- is the source of the edge because it will later need to notify
-- all its successors that it has been elaborated.
DG.Add_Edge
(G => G.Graph,
E => Edge,
Source => Pred,
Destination => Succ);
-- Construct and save the attributes of the edge
Set_LGE_Attributes
(G => G,
Edge => Edge,
Val =>
(Activates_Task => Activates_Task,
Kind => Kind));
-- Mark the predecessor and successor as related by the new edge.
-- This prevents all further attempts to link the same predecessor
-- and successor.
Set_Is_Recorded_Edge (G, Rel);
-- Update the number of pending predecessors the successor must wait
-- on before it is elaborated.
Increment_Pending_Predecessors
(G => G,
Vertex => Succ,
Edge => Edge);
-- Update the edge statistics
Increment_Library_Graph_Edge_Count (G, Kind);
return Edge;
end Add_Edge;
----------------
-- Add_Vertex --
----------------
procedure Add_Vertex
(G : Library_Graph;
U_Id : Unit_Id)
is
Vertex : Library_Graph_Vertex_Id;
begin
pragma Assert (Present (G));
pragma Assert (Present (U_Id));
-- Nothing to do when the unit already has a vertex
if Present (Corresponding_Vertex (G, U_Id)) then
return;
end if;
Vertex := Sequence_Next_Vertex;
-- Add the vertex to the underlying graph
DG.Add_Vertex (G.Graph, Vertex);
-- Construct and save the attributes of the vertex
Set_LGV_Attributes
(G => G,
Vertex => Vertex,
Val =>
(Corresponding_Item => No_Library_Graph_Vertex,
In_Elaboration_Order => False,
Pending_Strong_Predecessors => 0,
Pending_Weak_Predecessors => 0,
Unit => U_Id));
-- Associate the unit with its corresponding vertex
Set_Corresponding_Vertex (G, U_Id, Vertex);
end Add_Vertex;
---------------------------------
-- At_Least_One_Edge_Satisfies --
---------------------------------
function At_Least_One_Edge_Satisfies
(G : Library_Graph;
Cycle : Library_Graph_Cycle_Id;
Predicate : LGE_Predicate_Ptr) return Boolean
is
Edge : Library_Graph_Edge_Id;
Iter : Edges_Of_Cycle_Iterator;
Satisfied : Boolean;
begin
pragma Assert (Present (G));
pragma Assert (Present (Cycle));
pragma Assert (Predicate /= null);
-- Assume that the predicate cannot be satisfied
Satisfied := False;
-- IMPORTANT:
--
-- * The iteration must run to completion in order to unlock the
-- edges of the cycle.
Iter := Iterate_Edges_Of_Cycle (G, Cycle);
while Has_Next (Iter) loop
Next (Iter, Edge);
Satisfied := Satisfied or else Predicate.all (G, Edge);
end loop;
return Satisfied;
end At_Least_One_Edge_Satisfies;
--------------------------
-- Complementary_Vertex --
--------------------------
function Complementary_Vertex
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id;
Force_Complement : Boolean) return Library_Graph_Vertex_Id
is
Complement : Library_Graph_Vertex_Id;
begin
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
-- Assume that there is no complementary vertex
Complement := No_Library_Graph_Vertex;
-- The caller requests the complement explicitly
if Force_Complement then
Complement := Corresponding_Item (G, Vertex);
-- The vertex is a completing body of a spec subject to pragma
-- Elaborate_Body. The complementary vertex is the spec.
elsif Is_Body_Of_Spec_With_Elaborate_Body (G, Vertex) then
Complement := Proper_Spec (G, Vertex);
-- The vertex is a spec subject to pragma Elaborate_Body. The
-- complementary vertex is the body.
elsif Is_Spec_With_Elaborate_Body (G, Vertex) then
Complement := Proper_Body (G, Vertex);
end if;
return Complement;
end Complementary_Vertex;
---------------
-- Component --
---------------
function Component
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id) return Component_Id
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
return DG.Component (G.Graph, Vertex);
end Component;
---------------------------------
-- Contains_Elaborate_All_Edge --
---------------------------------
function Contains_Elaborate_All_Edge
(G : Library_Graph;
Cycle : Library_Graph_Cycle_Id) return Boolean
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Cycle));
return
At_Least_One_Edge_Satisfies
(G => G,
Cycle => Cycle,
Predicate => Is_Elaborate_All_Edge'Access);
end Contains_Elaborate_All_Edge;
------------------------------------
-- Contains_Static_Successor_Edge --
------------------------------------
function Contains_Static_Successor_Edge
(G : Library_Graph;
Cycle : Library_Graph_Cycle_Id) return Boolean
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Cycle));
return
At_Least_One_Edge_Satisfies
(G => G,
Cycle => Cycle,
Predicate => Is_Static_Successor_Edge'Access);
end Contains_Static_Successor_Edge;
------------------------------
-- Contains_Task_Activation --
------------------------------
function Contains_Task_Activation
(G : Library_Graph;
Cycle : Library_Graph_Cycle_Id) return Boolean
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Cycle));
return
At_Least_One_Edge_Satisfies
(G => G,
Cycle => Cycle,
Predicate => Activates_Task'Access);
end Contains_Task_Activation;
---------------------
-- Copy_Cycle_Path --
---------------------
function Copy_Cycle_Path
(Cycle_Path : LGE_Lists.Doubly_Linked_List)
return LGE_Lists.Doubly_Linked_List
is
Edge : Library_Graph_Edge_Id;
Iter : LGE_Lists.Iterator;
Path : LGE_Lists.Doubly_Linked_List;
begin
pragma Assert (LGE_Lists.Present (Cycle_Path));
Path := LGE_Lists.Create;
Iter := LGE_Lists.Iterate (Cycle_Path);
while LGE_Lists.Has_Next (Iter) loop
LGE_Lists.Next (Iter, Edge);
LGE_Lists.Append (Path, Edge);
end loop;
return Path;
end Copy_Cycle_Path;
------------------------
-- Corresponding_Item --
------------------------
function Corresponding_Item
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id) return Library_Graph_Vertex_Id
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
return Get_LGV_Attributes (G, Vertex).Corresponding_Item;
end Corresponding_Item;
--------------------------
-- Corresponding_Vertex --
--------------------------
function Corresponding_Vertex
(G : Library_Graph;
U_Id : Unit_Id) return Library_Graph_Vertex_Id
is
begin
pragma Assert (Present (G));
pragma Assert (Present (U_Id));
return Unit_Tables.Get (G.Unit_To_Vertex, U_Id);
end Corresponding_Vertex;
------------
-- Create --
------------
function Create
(Initial_Vertices : Positive;
Initial_Edges : Positive) return Library_Graph
is
G : constant Library_Graph := new Library_Graph_Attributes;
begin
G.Component_Attributes := Component_Tables.Create (Initial_Vertices);
G.Cycle_Attributes := LGC_Tables.Create (Initial_Vertices);
G.Cycles := LGC_Lists.Create;
G.Edge_Attributes := LGE_Tables.Create (Initial_Edges);
G.Graph :=
DG.Create
(Initial_Vertices => Initial_Vertices,
Initial_Edges => Initial_Edges);
G.Recorded_Edges := RE_Sets.Create (Initial_Edges);
G.Unit_To_Vertex := Unit_Tables.Create (Initial_Vertices);
G.Vertex_Attributes := LGV_Tables.Create (Initial_Vertices);
return G;
end Create;
------------------------
-- Cycle_End_Vertices --
------------------------
function Cycle_End_Vertices
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id;
Elaborate_All_Active : Boolean) return LGV_Sets.Membership_Set
is
Complement : Library_Graph_Vertex_Id;
End_Vertices : LGV_Sets.Membership_Set := LGV_Sets.Nil;
begin
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
End_Vertices := LGV_Sets.Create (2);
-- The input vertex always terminates a cycle path
LGV_Sets.Insert (End_Vertices, Vertex);
-- Add the complementary vertex to the set of cycle terminating
-- vertices when either Elaborate_All is in effect, or the input
-- vertex is part of an Elaborat_Body pair.
if Elaborate_All_Active
or else Is_Vertex_With_Elaborate_Body (G, Vertex)
then
Complement :=
Complementary_Vertex
(G => G,
Vertex => Vertex,
Force_Complement => Elaborate_All_Active);
if Present (Complement) then
LGV_Sets.Insert (End_Vertices, Complement);
end if;
end if;
return End_Vertices;
end Cycle_End_Vertices;
-------------------
-- Cycle_Kind_Of --
-------------------
function Cycle_Kind_Of
(G : Library_Graph;
Edge : Library_Graph_Edge_Id) return Library_Graph_Cycle_Kind
is
pragma Assert (Present (G));
pragma Assert (Present (Edge));
begin
if Is_Cyclic_Elaborate_All_Edge (G, Edge) then
return Elaborate_All_Cycle;
elsif Is_Cyclic_Elaborate_Body_Edge (G, Edge) then
return Elaborate_Body_Cycle;
elsif Is_Cyclic_Elaborate_Edge (G, Edge) then
return Elaborate_Cycle;
elsif Is_Cyclic_Forced_Edge (G, Edge) then
return Forced_Cycle;
elsif Is_Cyclic_Invocation_Edge (G, Edge) then
return Invocation_Cycle;
else
return No_Cycle_Kind;
end if;
end Cycle_Kind_Of;
---------------------------
-- Cycle_Kind_Precedence --
---------------------------
function Cycle_Kind_Precedence
(Kind : Library_Graph_Cycle_Kind;
Compared_To : Library_Graph_Cycle_Kind) return Precedence_Kind
is
Comp_Pos : constant Integer :=
Library_Graph_Cycle_Kind'Pos (Compared_To);
Kind_Pos : constant Integer := Library_Graph_Cycle_Kind'Pos (Kind);
begin
-- A lower ordinal indicates a higher precedence
if Kind_Pos < Comp_Pos then
return Higher_Precedence;
elsif Kind_Pos > Comp_Pos then
return Lower_Precedence;
else
return Equal_Precedence;
end if;
end Cycle_Kind_Precedence;
---------------------------
-- Cycle_Path_Precedence --
---------------------------
function Cycle_Path_Precedence
(G : Library_Graph;
Path : LGE_Lists.Doubly_Linked_List;
Compared_To : LGE_Lists.Doubly_Linked_List) return Precedence_Kind
is
procedure Next_Available
(Iter : in out LGE_Lists.Iterator;
Edge : out Library_Graph_Edge_Id);
pragma Inline (Next_Available);
-- Obtain the next edge available through iterator Iter, or return
-- No_Library_Graph_Edge if the iterator has been exhausted.
--------------------
-- Next_Available --
--------------------
procedure Next_Available
(Iter : in out LGE_Lists.Iterator;
Edge : out Library_Graph_Edge_Id)
is
begin
-- Assume that the iterator has been exhausted
Edge := No_Library_Graph_Edge;
if LGE_Lists.Has_Next (Iter) then
LGE_Lists.Next (Iter, Edge);
end if;
end Next_Available;
-- Local variables
Comp_Edge : Library_Graph_Edge_Id;
Comp_Iter : LGE_Lists.Iterator;
Path_Edge : Library_Graph_Edge_Id;
Path_Iter : LGE_Lists.Iterator;
Prec : Precedence_Kind;
-- Start of processing for Cycle_Path_Precedence
begin
pragma Assert (Present (G));
pragma Assert (LGE_Lists.Present (Path));
pragma Assert (LGE_Lists.Present (Compared_To));
-- Assume that the paths have equal precedence
Prec := Equal_Precedence;
Comp_Iter := LGE_Lists.Iterate (Compared_To);
Path_Iter := LGE_Lists.Iterate (Path);
Next_Available (Comp_Iter, Comp_Edge);
Next_Available (Path_Iter, Path_Edge);
-- IMPORTANT:
--
-- * The iteration must run to completion in order to unlock the
-- edges of both paths.
while Present (Comp_Edge) or else Present (Path_Edge) loop
if Prec = Equal_Precedence
and then Present (Comp_Edge)
and then Present (Path_Edge)
then
Prec :=
Edge_Precedence
(G => G,
Edge => Path_Edge,
Compared_To => Comp_Edge);
end if;
Next_Available (Comp_Iter, Comp_Edge);
Next_Available (Path_Iter, Path_Edge);
end loop;
return Prec;
end Cycle_Path_Precedence;
----------------------
-- Cycle_Precedence --
----------------------
function Cycle_Precedence
(G : Library_Graph;
Cycle : Library_Graph_Cycle_Id;
Compared_To : Library_Graph_Cycle_Id) return Precedence_Kind
is
pragma Assert (Present (G));
pragma Assert (Present (Cycle));
pragma Assert (Present (Compared_To));
Comp_Invs : constant Natural :=
Invocation_Edge_Count (G, Compared_To);
Comp_Len : constant Natural := Length (G, Compared_To);
Cycle_Invs : constant Natural := Invocation_Edge_Count (G, Cycle);
Cycle_Len : constant Natural := Length (G, Cycle);
Kind_Prec : constant Precedence_Kind :=
Cycle_Kind_Precedence
(Kind => Kind (G, Cycle),
Compared_To => Kind (G, Compared_To));
begin
-- Prefer a cycle with higher precedence based on its kind
if Kind_Prec = Higher_Precedence
or else
Kind_Prec = Lower_Precedence
then
return Kind_Prec;
-- Prefer a shorter cycle
elsif Cycle_Len < Comp_Len then
return Higher_Precedence;
elsif Cycle_Len > Comp_Len then
return Lower_Precedence;
-- Prefer a cycle wih fewer invocation edges
elsif Cycle_Invs < Comp_Invs then
return Higher_Precedence;
elsif Cycle_Invs > Comp_Invs then
return Lower_Precedence;
-- Prefer a cycle with a higher path precedence
else
return
Cycle_Path_Precedence
(G => G,
Path => Path (G, Cycle),
Compared_To => Path (G, Compared_To));
end if;
end Cycle_Precedence;
----------------------------------------
-- Decrement_Library_Graph_Edge_Count --
----------------------------------------
procedure Decrement_Library_Graph_Edge_Count
(G : Library_Graph;
Kind : Library_Graph_Edge_Kind)
is
pragma Assert (Present (G));
Count : Natural renames G.Counts (Kind);
begin
Count := Count - 1;
end Decrement_Library_Graph_Edge_Count;
------------------------------------
-- Decrement_Pending_Predecessors --
------------------------------------
procedure Decrement_Pending_Predecessors
(G : Library_Graph;
Comp : Component_Id;
Edge : Library_Graph_Edge_Id)
is
Attrs : Component_Attributes;
begin
pragma Assert (Present (G));
pragma Assert (Present (Comp));
Attrs := Get_Component_Attributes (G, Comp);
Update_Pending_Predecessors
(Strong_Predecessors => Attrs.Pending_Strong_Predecessors,
Weak_Predecessors => Attrs.Pending_Weak_Predecessors,
Update_Weak => Is_Invocation_Edge (G, Edge),
Value => -1);
Set_Component_Attributes (G, Comp, Attrs);
end Decrement_Pending_Predecessors;
------------------------------------
-- Decrement_Pending_Predecessors --
------------------------------------
procedure Decrement_Pending_Predecessors
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id;
Edge : Library_Graph_Edge_Id)
is
Attrs : Library_Graph_Vertex_Attributes;
begin
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
Attrs := Get_LGV_Attributes (G, Vertex);
Update_Pending_Predecessors
(Strong_Predecessors => Attrs.Pending_Strong_Predecessors,
Weak_Predecessors => Attrs.Pending_Weak_Predecessors,
Update_Weak => Is_Invocation_Edge (G, Edge),
Value => -1);
Set_LGV_Attributes (G, Vertex, Attrs);
end Decrement_Pending_Predecessors;
-----------------------------------
-- Delete_Body_Before_Spec_Edges --
-----------------------------------
procedure Delete_Body_Before_Spec_Edges
(G : Library_Graph;
Edges : LGE_Lists.Doubly_Linked_List)
is
Edge : Library_Graph_Edge_Id;
Iter : LGE_Lists.Iterator;
begin
pragma Assert (Present (G));
pragma Assert (LGE_Lists.Present (Edges));
Iter := LGE_Lists.Iterate (Edges);
while LGE_Lists.Has_Next (Iter) loop
LGE_Lists.Next (Iter, Edge);
pragma Assert (Kind (G, Edge) = Body_Before_Spec_Edge);
Delete_Edge (G, Edge);
end loop;
end Delete_Body_Before_Spec_Edges;
-----------------
-- Delete_Edge --
-----------------
procedure Delete_Edge
(G : Library_Graph;
Edge : Library_Graph_Edge_Id)
is
pragma Assert (Present (G));
pragma Assert (Present (Edge));
Pred : constant Library_Graph_Vertex_Id := Predecessor (G, Edge);
Succ : constant Library_Graph_Vertex_Id := Successor (G, Edge);
Rel : constant Predecessor_Successor_Relation :=
(Predecessor => Pred,
Successor => Succ);
begin
-- Update the edge statistics
Decrement_Library_Graph_Edge_Count (G, Kind (G, Edge));
-- Update the number of pending predecessors the successor must wait
-- on before it is elaborated.
Decrement_Pending_Predecessors
(G => G,
Vertex => Succ,
Edge => Edge);
-- Delete the link between the predecessor and successor. This allows
-- for further attempts to link the same predecessor and successor.
RE_Sets.Delete (G.Recorded_Edges, Rel);
-- Delete the attributes of the edge
LGE_Tables.Delete (G.Edge_Attributes, Edge);
-- Delete the edge from the underlying graph
DG.Delete_Edge (G.Graph, Edge);
end Delete_Edge;
-------------
-- Destroy --
-------------
procedure Destroy (G : in out Library_Graph) is
begin
pragma Assert (Present (G));
Component_Tables.Destroy (G.Component_Attributes);
LGC_Tables.Destroy (G.Cycle_Attributes);
LGC_Lists.Destroy (G.Cycles);
LGE_Tables.Destroy (G.Edge_Attributes);
DG.Destroy (G.Graph);
RE_Sets.Destroy (G.Recorded_Edges);
Unit_Tables.Destroy (G.Unit_To_Vertex);
LGV_Tables.Destroy (G.Vertex_Attributes);
Free (G);
end Destroy;
----------------------------------
-- Destroy_Component_Attributes --
----------------------------------
procedure Destroy_Component_Attributes
(Attrs : in out Component_Attributes)
is
pragma Unreferenced (Attrs);
begin
null;
end Destroy_Component_Attributes;
--------------------------------------------
-- Destroy_Library_Graph_Cycle_Attributes --
--------------------------------------------
procedure Destroy_Library_Graph_Cycle_Attributes
(Attrs : in out Library_Graph_Cycle_Attributes)
is
begin
LGE_Lists.Destroy (Attrs.Path);
end Destroy_Library_Graph_Cycle_Attributes;
-------------------------------------------
-- Destroy_Library_Graph_Edge_Attributes --
-------------------------------------------
procedure Destroy_Library_Graph_Edge_Attributes
(Attrs : in out Library_Graph_Edge_Attributes)
is
pragma Unreferenced (Attrs);
begin
null;
end Destroy_Library_Graph_Edge_Attributes;
---------------------------------------------
-- Destroy_Library_Graph_Vertex_Attributes --
---------------------------------------------
procedure Destroy_Library_Graph_Vertex_Attributes
(Attrs : in out Library_Graph_Vertex_Attributes)
is
pragma Unreferenced (Attrs);
begin
null;
end Destroy_Library_Graph_Vertex_Attributes;
---------------------
-- Edge_Precedence --
---------------------
function Edge_Precedence
(G : Library_Graph;
Edge : Library_Graph_Edge_Id;
Compared_To : Library_Graph_Edge_Id) return Precedence_Kind
is
pragma Assert (Present (G));
pragma Assert (Present (Edge));
pragma Assert (Present (Compared_To));
Comp_Succ : constant Library_Graph_Vertex_Id :=
Successor (G, Compared_To);
Edge_Succ : constant Library_Graph_Vertex_Id :=
Successor (G, Edge);
Kind_Prec : constant Precedence_Kind :=
Cycle_Kind_Precedence
(Kind => Cycle_Kind_Of (G, Edge),
Compared_To => Cycle_Kind_Of (G, Compared_To));
Succ_Prec : constant Precedence_Kind :=
Vertex_Precedence
(G => G,
Vertex => Edge_Succ,
Compared_To => Comp_Succ);
begin
-- Prefer an edge with a higher cycle kind precedence
if Kind_Prec = Higher_Precedence
or else
Kind_Prec = Lower_Precedence
then
return Kind_Prec;
-- Prefer an edge whose successor has a higher precedence
elsif Comp_Succ /= Edge_Succ
and then (Succ_Prec = Higher_Precedence
or else
Succ_Prec = Lower_Precedence)
then
return Succ_Prec;
-- Prefer an edge whose predecessor has a higher precedence
else
return
Vertex_Precedence
(G => G,
Vertex => Predecessor (G, Edge),
Compared_To => Predecessor (G, Compared_To));
end if;
end Edge_Precedence;
---------------
-- File_Name --
---------------
function File_Name
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id) return File_Name_Type
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
return File_Name (Unit (G, Vertex));
end File_Name;
---------------------
-- Find_Components --
---------------------
procedure Find_Components (G : Library_Graph) is
Edges : LGE_Lists.Doubly_Linked_List;
begin
pragma Assert (Present (G));
Start_Phase (Component_Discovery);
-- Initialize or reinitialize the components of the graph
Initialize_Components (G);
-- Create a set of special edges that link a predecessor body with a
-- successor spec. This is an illegal dependency, however using such
-- edges eliminates the need to create yet another graph, where both
-- spec and body are collapsed into a single vertex.
Edges := LGE_Lists.Create;
Add_Body_Before_Spec_Edges (G, Edges);
DG.Find_Components (G.Graph);
-- Remove the special edges that link a predecessor body with a
-- successor spec because they cause unresolvable circularities.
Delete_Body_Before_Spec_Edges (G, Edges);
LGE_Lists.Destroy (Edges);
-- Update the number of predecessors various components must wait on
-- before they can be elaborated.
Update_Pending_Predecessors_Of_Components (G);
End_Phase (Component_Discovery);
end Find_Components;
-----------------
-- Find_Cycles --
-----------------
procedure Find_Cycles (G : Library_Graph) is
All_Cycle_Limit : constant Natural := 64;
-- The performance of Tarjan's algorithm may degrate to exponential
-- when pragma Elaborate_All is in effect, or some vertex is part of
-- an Elaborate_Body pair. In this case the algorithm discovers all
-- combinations of edges that close a circuit starting and ending on
-- some start vertex while going through different vertices. Use a
-- limit on the total number of cycles within a component to guard
-- against such degradation.
Comp : Component_Id;
Cycle_Count : Natural;
Iter : Component_Iterator;
begin
pragma Assert (Present (G));
Start_Phase (Cycle_Discovery);
-- The cycles of graph G are discovered using Tarjan's enumeration
-- of the elementary circuits of a directed-graph algorithm. Do not
-- modify this code unless you intimately understand the algorithm.
--
-- The logic of the algorithm is split among the following routines:
--
-- Cycle_End_Vertices
-- Find_Cycles_From_Successor
-- Find_Cycles_From_Vertex
-- Find_Cycles_In_Component
-- Unvisit
-- Visit
--
-- The original algorithm has been significantly modified in order to
--
-- * Accommodate the semantics of Elaborate_All and Elaborate_Body.
--
-- * Capture cycle paths as edges rather than vertices.
--
-- * Take advantage of graph components.
-- Assume that the graph does not contain a cycle
Cycle_Count := 0;
-- Run the modified version of the algorithm on each component of the
-- graph.
Iter := Iterate_Components (G);
while Has_Next (Iter) loop
Next (Iter, Comp);
Find_Cycles_In_Component
(G => G,
Comp => Comp,
Cycle_Count => Cycle_Count,
Cycle_Limit => All_Cycle_Limit);
end loop;
End_Phase (Cycle_Discovery);
end Find_Cycles;
--------------------------------
-- Find_Cycles_From_Successor --
--------------------------------
procedure Find_Cycles_From_Successor
(G : Library_Graph;
Edge : Library_Graph_Edge_Id;
End_Vertices : LGV_Sets.Membership_Set;
Deleted_Vertices : LGV_Sets.Membership_Set;
Most_Significant_Edge : Library_Graph_Edge_Id;
Invocation_Edge_Count : Natural;
Cycle_Path_Stack : LGE_Lists.Doubly_Linked_List;
Visited_Set : LGV_Sets.Membership_Set;
Visited_Stack : LGV_Lists.Doubly_Linked_List;
Cycle_Count : in out Natural;
Cycle_Limit : Natural;
Elaborate_All_Active : Boolean;
Has_Cycle : out Boolean;
Indent : Indentation_Level)
is
pragma Assert (Present (G));
pragma Assert (Present (Edge));
pragma Assert (LGV_Sets.Present (End_Vertices));
pragma Assert (LGV_Sets.Present (Deleted_Vertices));
pragma Assert (LGE_Lists.Present (Cycle_Path_Stack));
pragma Assert (LGV_Sets.Present (Visited_Set));
pragma Assert (LGV_Lists.Present (Visited_Stack));
Succ : constant Library_Graph_Vertex_Id := Successor (G, Edge);
Succ_Indent : constant Indentation_Level :=
Indent + Nested_Indentation;
begin
-- Assume that the successor reached via the edge does not result in
-- a cycle.
Has_Cycle := False;
-- Nothing to do when the edge connects two vertices residing in two
-- different components.
if not Is_Cyclic_Edge (G, Edge) then
return;
end if;
Trace_Edge (G, Edge, Indent);
-- The modified version does not place vertices on the "point stack",
-- but instead collects the edges comprising the cycle. Prepare the
-- edge for backtracking.
LGE_Lists.Prepend (Cycle_Path_Stack, Edge);
Find_Cycles_From_Vertex
(G => G,
Vertex => Succ,
End_Vertices => End_Vertices,
Deleted_Vertices => Deleted_Vertices,
Most_Significant_Edge => Most_Significant_Edge,
Invocation_Edge_Count => Invocation_Edge_Count,
Cycle_Path_Stack => Cycle_Path_Stack,
Visited_Set => Visited_Set,
Visited_Stack => Visited_Stack,
Cycle_Count => Cycle_Count,
Cycle_Limit => Cycle_Limit,
Elaborate_All_Active => Elaborate_All_Active,
Is_Start_Vertex => False,
Has_Cycle => Has_Cycle,
Indent => Succ_Indent);
-- The modified version does not place vertices on the "point stack",
-- but instead collects the edges comprising the cycle. Backtrack the
-- edge.
LGE_Lists.Delete_First (Cycle_Path_Stack);
end Find_Cycles_From_Successor;
-----------------------------
-- Find_Cycles_From_Vertex --
-----------------------------
procedure Find_Cycles_From_Vertex
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id;
End_Vertices : LGV_Sets.Membership_Set;
Deleted_Vertices : LGV_Sets.Membership_Set;
Most_Significant_Edge : Library_Graph_Edge_Id;
Invocation_Edge_Count : Natural;
Cycle_Path_Stack : LGE_Lists.Doubly_Linked_List;
Visited_Set : LGV_Sets.Membership_Set;
Visited_Stack : LGV_Lists.Doubly_Linked_List;
Cycle_Count : in out Natural;
Cycle_Limit : Natural;
Elaborate_All_Active : Boolean;
Is_Start_Vertex : Boolean;
Has_Cycle : out Boolean;
Indent : Indentation_Level)
is
Edge_Indent : constant Indentation_Level :=
Indent + Nested_Indentation;
Complement : Library_Graph_Vertex_Id;
Edge : Library_Graph_Edge_Id;
Iter : Edges_To_Successors_Iterator;
Complement_Has_Cycle : Boolean;
-- This flag is set when either Elaborate_All is in effect or the
-- current vertex is part of an Elaborate_Body pair, and visiting
-- the "complementary" vertex resulted in a cycle.
Successor_Has_Cycle : Boolean;
-- This flag is set when visiting at least one successor of the
-- current vertex resulted in a cycle.
begin
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
pragma Assert (LGV_Sets.Present (End_Vertices));
pragma Assert (LGV_Sets.Present (Deleted_Vertices));
pragma Assert (LGE_Lists.Present (Cycle_Path_Stack));
pragma Assert (LGV_Sets.Present (Visited_Set));
pragma Assert (LGV_Lists.Present (Visited_Stack));
-- Assume that the vertex does not close a circuit
Has_Cycle := False;
-- Nothing to do when the limit on the number of saved cycles has
-- been reached. This protects against a combinatorial explosion
-- in components with Elaborate_All cycles.
if Cycle_Count >= Cycle_Limit then
return;
-- The vertex closes the circuit, thus resulting in a cycle. Save
-- the cycle for later diagnostics. The initial invocation of the
-- routine always ignores the starting vertex, to prevent a spurious
-- self-cycle.
elsif not Is_Start_Vertex
and then LGV_Sets.Contains (End_Vertices, Vertex)
then
Trace_Vertex (G, Vertex, Indent);
Record_Cycle
(G => G,
Most_Significant_Edge => Most_Significant_Edge,
Invocation_Edge_Count => Invocation_Edge_Count,
Cycle_Path => Cycle_Path_Stack,
Indent => Indent);
Has_Cycle := True;
Cycle_Count := Cycle_Count + 1;
return;
-- Nothing to do when the vertex has already been deleted. This
-- indicates that all available cycles involving the vertex have
-- been discovered, and the vertex cannot contribute further to
-- the depth-first search.
elsif LGV_Sets.Contains (Deleted_Vertices, Vertex) then
return;
-- Nothing to do when the vertex has already been visited. This
-- indicates that the depth-first search initiated from some start
-- vertex already encountered this vertex, and the visited stack has
-- not been unrolled yet.
elsif LGV_Sets.Contains (Visited_Set, Vertex) then
return;
end if;
Trace_Vertex (G, Vertex, Indent);
-- Mark the vertex as visited
Visit
(Vertex => Vertex,
Visited_Set => Visited_Set,
Visited_Stack => Visited_Stack);
-- Extend the depth-first search via all the edges to successors
Iter := Iterate_Edges_To_Successors (G, Vertex);
while Has_Next (Iter) loop
Next (Iter, Edge);
Find_Cycles_From_Successor
(G => G,
Edge => Edge,
End_Vertices => End_Vertices,
Deleted_Vertices => Deleted_Vertices,
-- The edge may be more important than the most important edge
-- up to this point, thus "upgrading" the nature of the cycle,
-- and shifting its point of normalization.
Most_Significant_Edge =>
Highest_Precedence_Edge
(G => G,
Left => Edge,
Right => Most_Significant_Edge),
-- The edge may be an invocation edge, in which case the count
-- of invocation edges increases by one.
Invocation_Edge_Count =>
Maximum_Invocation_Edge_Count
(G => G,
Edge => Edge,
Count => Invocation_Edge_Count),
Cycle_Path_Stack => Cycle_Path_Stack,
Visited_Set => Visited_Set,
Visited_Stack => Visited_Stack,
Cycle_Count => Cycle_Count,
Cycle_Limit => Cycle_Limit,
Elaborate_All_Active => Elaborate_All_Active,
Has_Cycle => Successor_Has_Cycle,
Indent => Edge_Indent);
Has_Cycle := Has_Cycle or Successor_Has_Cycle;
end loop;
-- Visit the complementary vertex of the current vertex when pragma
-- Elaborate_All is in effect, or the current vertex is part of an
-- Elaborate_Body pair.
if Elaborate_All_Active
or else Is_Vertex_With_Elaborate_Body (G, Vertex)
then
Complement :=
Complementary_Vertex
(G => G,
Vertex => Vertex,
Force_Complement => Elaborate_All_Active);
if Present (Complement) then
Find_Cycles_From_Vertex
(G => G,
Vertex => Complement,
End_Vertices => End_Vertices,
Deleted_Vertices => Deleted_Vertices,
Most_Significant_Edge => Most_Significant_Edge,
Invocation_Edge_Count => Invocation_Edge_Count,
Cycle_Path_Stack => Cycle_Path_Stack,
Visited_Set => Visited_Set,
Visited_Stack => Visited_Stack,
Cycle_Count => Cycle_Count,
Cycle_Limit => Cycle_Limit,
Elaborate_All_Active => Elaborate_All_Active,
Is_Start_Vertex => Is_Start_Vertex,
Has_Cycle => Complement_Has_Cycle,
Indent => Indent);
Has_Cycle := Has_Cycle or Complement_Has_Cycle;
end if;
end if;
-- The original algorithm clears the "marked stack" in two places:
--
-- * When the depth-first search starting from the current vertex
-- discovers at least one cycle, and
--
-- * When the depth-first search initiated from a start vertex
-- completes.
--
-- The modified version handles both cases in one place.
if Has_Cycle or else Is_Start_Vertex then
Unvisit
(Vertex => Vertex,
Visited_Set => Visited_Set,
Visited_Stack => Visited_Stack);
end if;
-- Delete a start vertex from the graph once its depth-first search
-- completes. This action preserves the invariant where a cycle is
-- not rediscovered "later" in some permuted form.
if Is_Start_Vertex then
LGV_Sets.Insert (Deleted_Vertices, Vertex);
end if;
end Find_Cycles_From_Vertex;
------------------------------
-- Find_Cycles_In_Component --
------------------------------
procedure Find_Cycles_In_Component
(G : Library_Graph;
Comp : Component_Id;
Cycle_Count : in out Natural;
Cycle_Limit : Natural)
is
pragma Assert (Present (G));
pragma Assert (Present (Comp));
Num_Of_Vertices : constant Natural :=
Number_Of_Component_Vertices (G, Comp);
Elaborate_All_Active : constant Boolean :=
Has_Elaborate_All_Edge (G, Comp);
-- The presence of an Elaborate_All edge within a component causes
-- all spec-body pairs to be treated as one vertex.
Has_Cycle : Boolean;
Iter : Component_Vertex_Iterator;
Vertex : Library_Graph_Vertex_Id;
Cycle_Path_Stack : LGE_Lists.Doubly_Linked_List := LGE_Lists.Nil;
-- The "point stack" of Tarjan's algorithm. The original maintains
-- a stack of vertices, however for diagnostic purposes using edges
-- is preferable.
Deleted_Vertices : LGV_Sets.Membership_Set := LGV_Sets.Nil;
-- The original algorithm alters the graph by deleting vertices with
-- lower ordinals compared to some starting vertex. Since the graph
-- must remain intact for diagnostic purposes, vertices are instead
-- inserted in this set and treated as "deleted".
End_Vertices : LGV_Sets.Membership_Set := LGV_Sets.Nil;
-- The original algorithm uses a single vertex to indicate the start
-- and end vertex of a cycle. The semantics of pragmas Elaborate_All
-- and Elaborate_Body increase this number by one. The end vertices
-- are added to this set and treated as "cycle-terminating".
Visited_Set : LGV_Sets.Membership_Set := LGV_Sets.Nil;
-- The "mark" array of Tarjan's algorithm. Since the original visits
-- all vertices in increasing ordinal number 1 .. N, the array offers
-- a one-to-one mapping between a vertex and its "marked" state. The
-- modified version however visits vertices within components, where
-- their ordinals are not contiguous. Vertices are added to this set
-- and treated as "marked".
Visited_Stack : LGV_Lists.Doubly_Linked_List := LGV_Lists.Nil;
-- The "marked stack" of Tarjan's algorithm
begin
Trace_Component (G, Comp, No_Indentation);
-- Initialize all component-level data structures
Cycle_Path_Stack := LGE_Lists.Create;
Deleted_Vertices := LGV_Sets.Create (Num_Of_Vertices);
Visited_Set := LGV_Sets.Create (Num_Of_Vertices);
Visited_Stack := LGV_Lists.Create;
-- The modified version does not use ordinals to visit vertices in
-- 1 .. N fashion. To preserve the invariant of the original, this
-- version deletes a vertex after its depth-first search completes.
-- The timing of the deletion is sound because all cycles through
-- that vertex have already been discovered, thus the vertex cannot
-- contribute to any cycles discovered "later" in the algorithm.
Iter := Iterate_Component_Vertices (G, Comp);
while Has_Next (Iter) loop
Next (Iter, Vertex);
-- Construct the set of vertices (at most 2) that terminates a
-- potential cycle that starts from the current vertex.
End_Vertices :=
Cycle_End_Vertices
(G => G,
Vertex => Vertex,
Elaborate_All_Active => Elaborate_All_Active);
-- The modified version maintains two additional attributes while
-- performing the depth-first search:
--
-- * The most significant edge of the current potential cycle.
--
-- * The number of invocation edges encountered along the path
-- of the current potential cycle.
--
-- Both attributes are used in the heuristic that determines the
-- importance of cycles.
Find_Cycles_From_Vertex
(G => G,
Vertex => Vertex,
End_Vertices => End_Vertices,
Deleted_Vertices => Deleted_Vertices,
Most_Significant_Edge => No_Library_Graph_Edge,
Invocation_Edge_Count => 0,
Cycle_Path_Stack => Cycle_Path_Stack,
Visited_Set => Visited_Set,
Visited_Stack => Visited_Stack,
Cycle_Count => Cycle_Count,
Cycle_Limit => Cycle_Limit,
Elaborate_All_Active => Elaborate_All_Active,
Is_Start_Vertex => True,
Has_Cycle => Has_Cycle,
Indent => Nested_Indentation);
-- Destroy the cycle-terminating vertices because a new set must
-- be constructed for the next vertex.
LGV_Sets.Destroy (End_Vertices);
end loop;
-- Destroy all component-level data structures
LGE_Lists.Destroy (Cycle_Path_Stack);
LGV_Sets.Destroy (Deleted_Vertices);
LGV_Sets.Destroy (Visited_Set);
LGV_Lists.Destroy (Visited_Stack);
end Find_Cycles_In_Component;
---------------
-- Find_Edge --
---------------
function Find_Edge
(G : Library_Graph;
Pred : Library_Graph_Vertex_Id;
Succ : Library_Graph_Vertex_Id) return Library_Graph_Edge_Id
is
Result : Library_Graph_Edge_Id := No_Library_Graph_Edge;
Edge : Library_Graph_Edge_Id;
Iter : Edges_To_Successors_Iterator :=
Iterate_Edges_To_Successors (G, Pred);
begin
-- IMPORTANT:
--
-- * The iteration must run to completion in order to unlock the
-- edges to successors.
-- This does a linear search through the successors of Pred.
-- Efficiency is not a problem, because this is called only when
-- Activates_Task is True, which is rare, and anyway, there aren't
-- usually large numbers of successors.
while Has_Next (Iter) loop
Next (Iter, Edge);
if Succ = Successor (G, Edge) then
pragma Assert (not Present (Result));
Result := Edge;
end if;
end loop;
pragma Assert (Present (Result));
return Result;
end Find_Edge;
---------------------------------------
-- Find_First_Lower_Precedence_Cycle --
---------------------------------------
function Find_First_Lower_Precedence_Cycle
(G : Library_Graph;
Cycle : Library_Graph_Cycle_Id) return Library_Graph_Cycle_Id
is
Current_Cycle : Library_Graph_Cycle_Id;
Iter : All_Cycle_Iterator;
Lesser_Cycle : Library_Graph_Cycle_Id;
begin
pragma Assert (Present (G));
pragma Assert (Present (Cycle));
-- Assume that there is no lesser cycle
Lesser_Cycle := No_Library_Graph_Cycle;
-- Find a cycle with a slightly lower precedence than the input
-- cycle.
--
-- IMPORTANT:
--
-- * The iterator must run to completion in order to unlock the
-- list of all cycles.
Iter := Iterate_All_Cycles (G);
while Has_Next (Iter) loop
Next (Iter, Current_Cycle);
if not Present (Lesser_Cycle)
and then Cycle_Precedence
(G => G,
Cycle => Cycle,
Compared_To => Current_Cycle) = Higher_Precedence
then
Lesser_Cycle := Current_Cycle;
end if;
end loop;
return Lesser_Cycle;
end Find_First_Lower_Precedence_Cycle;
------------------------------
-- Get_Component_Attributes --
------------------------------
function Get_Component_Attributes
(G : Library_Graph;
Comp : Component_Id) return Component_Attributes
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Comp));
return Component_Tables.Get (G.Component_Attributes, Comp);
end Get_Component_Attributes;
------------------------
-- Get_LGC_Attributes --
------------------------
function Get_LGC_Attributes
(G : Library_Graph;
Cycle : Library_Graph_Cycle_Id) return Library_Graph_Cycle_Attributes
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Cycle));
return LGC_Tables.Get (G.Cycle_Attributes, Cycle);
end Get_LGC_Attributes;
------------------------
-- Get_LGE_Attributes --
------------------------
function Get_LGE_Attributes
(G : Library_Graph;
Edge : Library_Graph_Edge_Id) return Library_Graph_Edge_Attributes
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Edge));
return LGE_Tables.Get (G.Edge_Attributes, Edge);
end Get_LGE_Attributes;
------------------------
-- Get_LGV_Attributes --
------------------------
function Get_LGV_Attributes
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id)
return Library_Graph_Vertex_Attributes
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
return LGV_Tables.Get (G.Vertex_Attributes, Vertex);
end Get_LGV_Attributes;
-----------------------------
-- Has_Elaborate_All_Cycle --
-----------------------------
function Has_Elaborate_All_Cycle (G : Library_Graph) return Boolean is
Edge : Library_Graph_Edge_Id;
Iter : All_Edge_Iterator;
Seen : Boolean;
begin
pragma Assert (Present (G));
-- Assume that no cyclic Elaborate_All edge has been seen
Seen := False;
-- IMPORTANT:
--
-- * The iteration must run to completion in order to unlock the
-- graph.
Iter := Iterate_All_Edges (G);
while Has_Next (Iter) loop
Next (Iter, Edge);
if not Seen and then Is_Cyclic_Elaborate_All_Edge (G, Edge) then
Seen := True;
end if;
end loop;
return Seen;
end Has_Elaborate_All_Cycle;
----------------------------
-- Has_Elaborate_All_Edge --
----------------------------
function Has_Elaborate_All_Edge
(G : Library_Graph;
Comp : Component_Id) return Boolean
is
Has_Edge : Boolean;
Iter : Component_Vertex_Iterator;
Vertex : Library_Graph_Vertex_Id;
begin
pragma Assert (Present (G));
pragma Assert (Present (Comp));
-- Assume that there is no Elaborate_All edge
Has_Edge := False;
-- IMPORTANT:
--
-- * The iteration must run to completion in order to unlock the
-- component vertices.
Iter := Iterate_Component_Vertices (G, Comp);
while Has_Next (Iter) loop
Next (Iter, Vertex);
Has_Edge := Has_Edge or else Has_Elaborate_All_Edge (G, Vertex);
end loop;
return Has_Edge;
end Has_Elaborate_All_Edge;
----------------------------
-- Has_Elaborate_All_Edge --
----------------------------
function Has_Elaborate_All_Edge
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id) return Boolean
is
Edge : Library_Graph_Edge_Id;
Has_Edge : Boolean;
Iter : Edges_To_Successors_Iterator;
begin
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
-- Assume that there is no Elaborate_All edge
Has_Edge := False;
-- IMPORTANT:
--
-- * The iteration must run to completion in order to unlock the
-- edges to successors.
Iter := Iterate_Edges_To_Successors (G, Vertex);
while Has_Next (Iter) loop
Next (Iter, Edge);
Has_Edge :=
Has_Edge or else Is_Cyclic_Elaborate_All_Edge (G, Edge);
end loop;
return Has_Edge;
end Has_Elaborate_All_Edge;
------------------------
-- Has_Elaborate_Body --
------------------------
function Has_Elaborate_Body
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id) return Boolean
is
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
U_Id : constant Unit_Id := Unit (G, Vertex);
U_Rec : Unit_Record renames ALI.Units.Table (U_Id);
begin
-- Treat the spec and body as decoupled when switch -d_b (ignore the
-- effects of pragma Elaborate_Body) is in effect.
return U_Rec.Elaborate_Body and not Debug_Flag_Underscore_B;
end Has_Elaborate_Body;
--------------
-- Has_Next --
--------------
function Has_Next (Iter : All_Cycle_Iterator) return Boolean is
begin
return LGC_Lists.Has_Next (LGC_Lists.Iterator (Iter));
end Has_Next;
--------------
-- Has_Next --
--------------
function Has_Next (Iter : All_Edge_Iterator) return Boolean is
begin
return DG.Has_Next (DG.All_Edge_Iterator (Iter));
end Has_Next;
--------------
-- Has_Next --
--------------
function Has_Next (Iter : All_Vertex_Iterator) return Boolean is
begin
return DG.Has_Next (DG.All_Vertex_Iterator (Iter));
end Has_Next;
--------------
-- Has_Next --
--------------
function Has_Next (Iter : Component_Iterator) return Boolean is
begin
return DG.Has_Next (DG.Component_Iterator (Iter));
end Has_Next;
--------------
-- Has_Next --
--------------
function Has_Next (Iter : Component_Vertex_Iterator) return Boolean is
begin
return DG.Has_Next (DG.Component_Vertex_Iterator (Iter));
end Has_Next;
--------------
-- Has_Next --
--------------
function Has_Next (Iter : Edges_Of_Cycle_Iterator) return Boolean is
begin
return LGE_Lists.Has_Next (LGE_Lists.Iterator (Iter));
end Has_Next;
--------------
-- Has_Next --
--------------
function Has_Next (Iter : Edges_To_Successors_Iterator) return Boolean is
begin
return DG.Has_Next (DG.Outgoing_Edge_Iterator (Iter));
end Has_Next;
-----------------------------
-- Has_No_Elaboration_Code --
-----------------------------
function Has_No_Elaboration_Code
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id) return Boolean
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
return Has_No_Elaboration_Code (Unit (G, Vertex));
end Has_No_Elaboration_Code;
-----------------------------------------
-- Hash_Library_Graph_Cycle_Attributes --
-----------------------------------------
function Hash_Library_Graph_Cycle_Attributes
(Attrs : Library_Graph_Cycle_Attributes) return Bucket_Range_Type
is
Edge : Library_Graph_Edge_Id;
Hash : Bucket_Range_Type;
Iter : LGE_Lists.Iterator;
begin
pragma Assert (LGE_Lists.Present (Attrs.Path));
-- The hash is obtained in the following manner:
--
-- (((edge1 * 31) + edge2) * 31) + edgeN
Hash := 0;
Iter := LGE_Lists.Iterate (Attrs.Path);
while LGE_Lists.Has_Next (Iter) loop
LGE_Lists.Next (Iter, Edge);
Hash := (Hash * 31) + Bucket_Range_Type (Edge);
end loop;
return Hash;
end Hash_Library_Graph_Cycle_Attributes;
-----------------------------------------
-- Hash_Predecessor_Successor_Relation --
-----------------------------------------
function Hash_Predecessor_Successor_Relation
(Rel : Predecessor_Successor_Relation) return Bucket_Range_Type
is
begin
pragma Assert (Present (Rel.Predecessor));
pragma Assert (Present (Rel.Successor));
return
Hash_Two_Keys
(Bucket_Range_Type (Rel.Predecessor),
Bucket_Range_Type (Rel.Successor));
end Hash_Predecessor_Successor_Relation;
------------------------------
-- Highest_Precedence_Cycle --
------------------------------
function Highest_Precedence_Cycle
(G : Library_Graph) return Library_Graph_Cycle_Id
is
begin
pragma Assert (Present (G));
pragma Assert (LGC_Lists.Present (G.Cycles));
if LGC_Lists.Is_Empty (G.Cycles) then
return No_Library_Graph_Cycle;
-- The highest precedence cycle is always the first in the list of
-- all cycles.
else
return LGC_Lists.First (G.Cycles);
end if;
end Highest_Precedence_Cycle;
-----------------------------
-- Highest_Precedence_Edge --
-----------------------------
function Highest_Precedence_Edge
(G : Library_Graph;
Left : Library_Graph_Edge_Id;
Right : Library_Graph_Edge_Id) return Library_Graph_Edge_Id
is
Edge_Prec : Precedence_Kind;
begin
pragma Assert (Present (G));
-- Both edges are available, pick the one with highest precedence
if Present (Left) and then Present (Right) then
Edge_Prec :=
Edge_Precedence
(G => G,
Edge => Left,
Compared_To => Right);
if Edge_Prec = Higher_Precedence then
return Left;
-- The precedence rules for edges are such that no two edges can
-- ever have the same precedence.
else
pragma Assert (Edge_Prec = Lower_Precedence);
return Right;
end if;
-- Otherwise at least one edge must be present
elsif Present (Left) then
return Left;
else
pragma Assert (Present (Right));
return Right;
end if;
end Highest_Precedence_Edge;
--------------------------
-- In_Elaboration_Order --
--------------------------
function In_Elaboration_Order
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id) return Boolean
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
return Get_LGV_Attributes (G, Vertex).In_Elaboration_Order;
end In_Elaboration_Order;
-----------------------
-- In_Same_Component --
-----------------------
function In_Same_Component
(G : Library_Graph;
Left : Library_Graph_Vertex_Id;
Right : Library_Graph_Vertex_Id) return Boolean
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Left));
pragma Assert (Present (Right));
return Component (G, Left) = Component (G, Right);
end In_Same_Component;
----------------------------------------
-- Increment_Library_Graph_Edge_Count --
----------------------------------------
procedure Increment_Library_Graph_Edge_Count
(G : Library_Graph;
Kind : Library_Graph_Edge_Kind)
is
pragma Assert (Present (G));
Count : Natural renames G.Counts (Kind);
begin
Count := Count + 1;
end Increment_Library_Graph_Edge_Count;
------------------------------------
-- Increment_Pending_Predecessors --
------------------------------------
procedure Increment_Pending_Predecessors
(G : Library_Graph;
Comp : Component_Id;
Edge : Library_Graph_Edge_Id)
is
Attrs : Component_Attributes;
begin
pragma Assert (Present (G));
pragma Assert (Present (Comp));
Attrs := Get_Component_Attributes (G, Comp);
Update_Pending_Predecessors
(Strong_Predecessors => Attrs.Pending_Strong_Predecessors,
Weak_Predecessors => Attrs.Pending_Weak_Predecessors,
Update_Weak => Is_Invocation_Edge (G, Edge),
Value => 1);
Set_Component_Attributes (G, Comp, Attrs);
end Increment_Pending_Predecessors;
------------------------------------
-- Increment_Pending_Predecessors --
------------------------------------
procedure Increment_Pending_Predecessors
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id;
Edge : Library_Graph_Edge_Id)
is
Attrs : Library_Graph_Vertex_Attributes;
begin
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
Attrs := Get_LGV_Attributes (G, Vertex);
Update_Pending_Predecessors
(Strong_Predecessors => Attrs.Pending_Strong_Predecessors,
Weak_Predecessors => Attrs.Pending_Weak_Predecessors,
Update_Weak => Is_Invocation_Edge (G, Edge),
Value => 1);
Set_LGV_Attributes (G, Vertex, Attrs);
end Increment_Pending_Predecessors;
---------------------------
-- Initialize_Components --
---------------------------
procedure Initialize_Components (G : Library_Graph) is
begin
pragma Assert (Present (G));
-- The graph already contains a set of components. Reinitialize
-- them in order to accommodate the new set of components about to
-- be computed.
if Number_Of_Components (G) > 0 then
Component_Tables.Destroy (G.Component_Attributes);
G.Component_Attributes :=
Component_Tables.Create (Number_Of_Vertices (G));
end if;
end Initialize_Components;
---------------------------
-- Invocation_Edge_Count --
---------------------------
function Invocation_Edge_Count
(G : Library_Graph;
Cycle : Library_Graph_Cycle_Id) return Natural
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Cycle));
return Get_LGC_Attributes (G, Cycle).Invocation_Edge_Count;
end Invocation_Edge_Count;
-------------------------------
-- Invocation_Graph_Encoding --
-------------------------------
function Invocation_Graph_Encoding
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id)
return Invocation_Graph_Encoding_Kind
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
return Invocation_Graph_Encoding (Unit (G, Vertex));
end Invocation_Graph_Encoding;
-------------
-- Is_Body --
-------------
function Is_Body
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id) return Boolean
is
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
U_Id : constant Unit_Id := Unit (G, Vertex);
U_Rec : Unit_Record renames ALI.Units.Table (U_Id);
begin
return U_Rec.Utype = Is_Body or else U_Rec.Utype = Is_Body_Only;
end Is_Body;
-----------------------------------------
-- Is_Body_Of_Spec_With_Elaborate_Body --
-----------------------------------------
function Is_Body_Of_Spec_With_Elaborate_Body
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id) return Boolean
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
if Is_Body_With_Spec (G, Vertex) then
return
Is_Spec_With_Elaborate_Body
(G => G,
Vertex => Proper_Spec (G, Vertex));
end if;
return False;
end Is_Body_Of_Spec_With_Elaborate_Body;
-----------------------
-- Is_Body_With_Spec --
-----------------------
function Is_Body_With_Spec
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id) return Boolean
is
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
U_Id : constant Unit_Id := Unit (G, Vertex);
U_Rec : Unit_Record renames ALI.Units.Table (U_Id);
begin
return U_Rec.Utype = Is_Body;
end Is_Body_With_Spec;
------------------------------
-- Is_Cycle_Initiating_Edge --
------------------------------
function Is_Cycle_Initiating_Edge
(G : Library_Graph;
Edge : Library_Graph_Edge_Id) return Boolean
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Edge));
return
Is_Cyclic_Elaborate_All_Edge (G, Edge)
or else Is_Cyclic_Elaborate_Body_Edge (G, Edge)
or else Is_Cyclic_Elaborate_Edge (G, Edge)
or else Is_Cyclic_Forced_Edge (G, Edge)
or else Is_Cyclic_Invocation_Edge (G, Edge);
end Is_Cycle_Initiating_Edge;
--------------------
-- Is_Cyclic_Edge --
--------------------
function Is_Cyclic_Edge
(G : Library_Graph;
Edge : Library_Graph_Edge_Id) return Boolean
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Edge));
return
Is_Cycle_Initiating_Edge (G, Edge)
or else Is_Cyclic_With_Edge (G, Edge);
end Is_Cyclic_Edge;
----------------------------------
-- Is_Cyclic_Elaborate_All_Edge --
----------------------------------
function Is_Cyclic_Elaborate_All_Edge
(G : Library_Graph;
Edge : Library_Graph_Edge_Id) return Boolean
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Edge));
return
Is_Elaborate_All_Edge (G, Edge)
and then Links_Vertices_In_Same_Component (G, Edge);
end Is_Cyclic_Elaborate_All_Edge;
-----------------------------------
-- Is_Cyclic_Elaborate_Body_Edge --
-----------------------------------
function Is_Cyclic_Elaborate_Body_Edge
(G : Library_Graph;
Edge : Library_Graph_Edge_Id) return Boolean
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Edge));
return
Is_Elaborate_Body_Edge (G, Edge)
and then Links_Vertices_In_Same_Component (G, Edge);
end Is_Cyclic_Elaborate_Body_Edge;
------------------------------
-- Is_Cyclic_Elaborate_Edge --
------------------------------
function Is_Cyclic_Elaborate_Edge
(G : Library_Graph;
Edge : Library_Graph_Edge_Id) return Boolean
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Edge));
return
Is_Elaborate_Edge (G, Edge)
and then Links_Vertices_In_Same_Component (G, Edge);
end Is_Cyclic_Elaborate_Edge;
---------------------------
-- Is_Cyclic_Forced_Edge --
---------------------------
function Is_Cyclic_Forced_Edge
(G : Library_Graph;
Edge : Library_Graph_Edge_Id) return Boolean
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Edge));
return
Is_Forced_Edge (G, Edge)
and then Links_Vertices_In_Same_Component (G, Edge);
end Is_Cyclic_Forced_Edge;
-------------------------------
-- Is_Cyclic_Invocation_Edge --
-------------------------------
function Is_Cyclic_Invocation_Edge
(G : Library_Graph;
Edge : Library_Graph_Edge_Id) return Boolean
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Edge));
return
Is_Invocation_Edge (G, Edge)
and then Links_Vertices_In_Same_Component (G, Edge);
end Is_Cyclic_Invocation_Edge;
-------------------------
-- Is_Cyclic_With_Edge --
-------------------------
function Is_Cyclic_With_Edge
(G : Library_Graph;
Edge : Library_Graph_Edge_Id) return Boolean
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Edge));
-- Ignore Elaborate_Body edges because they also appear as with
-- edges, but have special successors.
return
Is_With_Edge (G, Edge)
and then Links_Vertices_In_Same_Component (G, Edge)
and then not Is_Elaborate_Body_Edge (G, Edge);
end Is_Cyclic_With_Edge;
-------------------------------
-- Is_Dynamically_Elaborated --
-------------------------------
function Is_Dynamically_Elaborated
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id) return Boolean
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
return Is_Dynamically_Elaborated (Unit (G, Vertex));
end Is_Dynamically_Elaborated;
-----------------------------
-- Is_Elaborable_Component --
-----------------------------
function Is_Elaborable_Component
(G : Library_Graph;
Comp : Component_Id) return Boolean
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Comp));
-- A component is elaborable when:
--
-- * It is not waiting on strong predecessors, and
-- * It is not waiting on weak predecessors
return
Pending_Strong_Predecessors (G, Comp) = 0
and then Pending_Weak_Predecessors (G, Comp) = 0;
end Is_Elaborable_Component;
--------------------------
-- Is_Elaborable_Vertex --
--------------------------
function Is_Elaborable_Vertex
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id) return Boolean
is
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
Complement : constant Library_Graph_Vertex_Id :=
Complementary_Vertex
(G => G,
Vertex => Vertex,
Force_Complement => False);
Strong_Preds : Natural;
Weak_Preds : Natural;
begin
-- A vertex is elaborable when:
--
-- * It has not been elaborated yet, and
-- * The complement vertex of an Elaborate_Body pair has not been
-- elaborated yet, and
-- * It resides within an elaborable component, and
-- * It is not waiting on strong predecessors, and
-- * It is not waiting on weak predecessors
if In_Elaboration_Order (G, Vertex) then
return False;
elsif Present (Complement)
and then In_Elaboration_Order (G, Complement)
then
return False;
elsif not Is_Elaborable_Component (G, Component (G, Vertex)) then
return False;
end if;
Pending_Predecessors_For_Elaboration
(G => G,
Vertex => Vertex,
Strong_Preds => Strong_Preds,
Weak_Preds => Weak_Preds);
return Strong_Preds = 0 and then Weak_Preds = 0;
end Is_Elaborable_Vertex;
---------------------------
-- Is_Elaborate_All_Edge --
---------------------------
function Is_Elaborate_All_Edge
(G : Library_Graph;
Edge : Library_Graph_Edge_Id) return Boolean
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Edge));
return Kind (G, Edge) = Elaborate_All_Edge;
end Is_Elaborate_All_Edge;
----------------------------
-- Is_Elaborate_Body_Edge --
----------------------------
function Is_Elaborate_Body_Edge
(G : Library_Graph;
Edge : Library_Graph_Edge_Id) return Boolean
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Edge));
return
Kind (G, Edge) = With_Edge
and then Is_Vertex_With_Elaborate_Body (G, Successor (G, Edge));
end Is_Elaborate_Body_Edge;
-----------------------
-- Is_Elaborate_Edge --
-----------------------
function Is_Elaborate_Edge
(G : Library_Graph;
Edge : Library_Graph_Edge_Id) return Boolean
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Edge));
return Kind (G, Edge) = Elaborate_Edge;
end Is_Elaborate_Edge;
----------------------------
-- Is_Elaborate_Body_Pair --
----------------------------
function Is_Elaborate_Body_Pair
(G : Library_Graph;
Spec_Vertex : Library_Graph_Vertex_Id;
Body_Vertex : Library_Graph_Vertex_Id) return Boolean
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Spec_Vertex));
pragma Assert (Present (Body_Vertex));
return
Is_Spec_With_Elaborate_Body (G, Spec_Vertex)
and then Is_Body_Of_Spec_With_Elaborate_Body (G, Body_Vertex)
and then Proper_Body (G, Spec_Vertex) = Body_Vertex;
end Is_Elaborate_Body_Pair;
--------------------
-- Is_Forced_Edge --
--------------------
function Is_Forced_Edge
(G : Library_Graph;
Edge : Library_Graph_Edge_Id) return Boolean
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Edge));
return Kind (G, Edge) = Forced_Edge;
end Is_Forced_Edge;
----------------------
-- Is_Internal_Unit --
----------------------
function Is_Internal_Unit
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id) return Boolean
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
return Is_Internal_Unit (Unit (G, Vertex));
end Is_Internal_Unit;
------------------------
-- Is_Invocation_Edge --
------------------------
function Is_Invocation_Edge
(G : Library_Graph;
Edge : Library_Graph_Edge_Id) return Boolean
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Edge));
return Kind (G, Edge) = Invocation_Edge;
end Is_Invocation_Edge;
------------------------
-- Is_Predefined_Unit --
------------------------
function Is_Predefined_Unit
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id) return Boolean
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
return Is_Predefined_Unit (Unit (G, Vertex));
end Is_Predefined_Unit;
---------------------------
-- Is_Preelaborated_Unit --
---------------------------
function Is_Preelaborated_Unit
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id) return Boolean
is
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
U_Id : constant Unit_Id := Unit (G, Vertex);
U_Rec : Unit_Record renames ALI.Units.Table (U_Id);
begin
return U_Rec.Preelab or else U_Rec.Pure;
end Is_Preelaborated_Unit;
----------------------
-- Is_Recorded_Edge --
----------------------
function Is_Recorded_Edge
(G : Library_Graph;
Rel : Predecessor_Successor_Relation) return Boolean
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Rel.Predecessor));
pragma Assert (Present (Rel.Successor));
return RE_Sets.Contains (G.Recorded_Edges, Rel);
end Is_Recorded_Edge;
-------------
-- Is_Spec --
-------------
function Is_Spec
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id) return Boolean
is
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
U_Id : constant Unit_Id := Unit (G, Vertex);
U_Rec : Unit_Record renames ALI.Units.Table (U_Id);
begin
return U_Rec.Utype = Is_Spec or else U_Rec.Utype = Is_Spec_Only;
end Is_Spec;
------------------------------
-- Is_Spec_Before_Body_Edge --
------------------------------
function Is_Spec_Before_Body_Edge
(G : Library_Graph;
Edge : Library_Graph_Edge_Id) return Boolean
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Edge));
return Kind (G, Edge) = Spec_Before_Body_Edge;
end Is_Spec_Before_Body_Edge;
-----------------------
-- Is_Spec_With_Body --
-----------------------
function Is_Spec_With_Body
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id) return Boolean
is
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
U_Id : constant Unit_Id := Unit (G, Vertex);
U_Rec : Unit_Record renames ALI.Units.Table (U_Id);
begin
return U_Rec.Utype = Is_Spec;
end Is_Spec_With_Body;
---------------------------------
-- Is_Spec_With_Elaborate_Body --
---------------------------------
function Is_Spec_With_Elaborate_Body
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id) return Boolean
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
return
Is_Spec_With_Body (G, Vertex)
and then Has_Elaborate_Body (G, Vertex);
end Is_Spec_With_Elaborate_Body;
------------------------------
-- Is_Static_Successor_Edge --
------------------------------
function Is_Static_Successor_Edge
(G : Library_Graph;
Edge : Library_Graph_Edge_Id) return Boolean
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Edge));
return
Is_Invocation_Edge (G, Edge)
and then not Is_Dynamically_Elaborated (G, Successor (G, Edge));
end Is_Static_Successor_Edge;
-----------------------------------
-- Is_Vertex_With_Elaborate_Body --
-----------------------------------
function Is_Vertex_With_Elaborate_Body
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id) return Boolean
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
return
Is_Spec_With_Elaborate_Body (G, Vertex)
or else
Is_Body_Of_Spec_With_Elaborate_Body (G, Vertex);
end Is_Vertex_With_Elaborate_Body;
---------------------------------
-- Is_Weakly_Elaborable_Vertex --
----------------------------------
function Is_Weakly_Elaborable_Vertex
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id) return Boolean
is
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
Complement : constant Library_Graph_Vertex_Id :=
Complementary_Vertex
(G => G,
Vertex => Vertex,
Force_Complement => False);
Strong_Preds : Natural;
Weak_Preds : Natural;
begin
-- A vertex is weakly elaborable when:
--
-- * It has not been elaborated yet, and
-- * The complement vertex of an Elaborate_Body pair has not been
-- elaborated yet, and
-- * It resides within an elaborable component, and
-- * It is not waiting on strong predecessors, and
-- * It is waiting on at least one weak predecessor
if In_Elaboration_Order (G, Vertex) then
return False;
elsif Present (Complement)
and then In_Elaboration_Order (G, Complement)
then
return False;
elsif not Is_Elaborable_Component (G, Component (G, Vertex)) then
return False;
end if;
Pending_Predecessors_For_Elaboration
(G => G,
Vertex => Vertex,
Strong_Preds => Strong_Preds,
Weak_Preds => Weak_Preds);
return Strong_Preds = 0 and then Weak_Preds >= 1;
end Is_Weakly_Elaborable_Vertex;
------------------
-- Is_With_Edge --
------------------
function Is_With_Edge
(G : Library_Graph;
Edge : Library_Graph_Edge_Id) return Boolean
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Edge));
return Kind (G, Edge) = With_Edge;
end Is_With_Edge;
------------------------
-- Iterate_All_Cycles --
------------------------
function Iterate_All_Cycles
(G : Library_Graph) return All_Cycle_Iterator
is
begin
pragma Assert (Present (G));
return All_Cycle_Iterator (LGC_Lists.Iterate (G.Cycles));
end Iterate_All_Cycles;
-----------------------
-- Iterate_All_Edges --
-----------------------
function Iterate_All_Edges
(G : Library_Graph) return All_Edge_Iterator
is
begin
pragma Assert (Present (G));
return All_Edge_Iterator (DG.Iterate_All_Edges (G.Graph));
end Iterate_All_Edges;
--------------------------
-- Iterate_All_Vertices --
--------------------------
function Iterate_All_Vertices
(G : Library_Graph) return All_Vertex_Iterator
is
begin
pragma Assert (Present (G));
return All_Vertex_Iterator (DG.Iterate_All_Vertices (G.Graph));
end Iterate_All_Vertices;
------------------------
-- Iterate_Components --
------------------------
function Iterate_Components
(G : Library_Graph) return Component_Iterator
is
begin
pragma Assert (Present (G));
return Component_Iterator (DG.Iterate_Components (G.Graph));
end Iterate_Components;
--------------------------------
-- Iterate_Component_Vertices --
--------------------------------
function Iterate_Component_Vertices
(G : Library_Graph;
Comp : Component_Id) return Component_Vertex_Iterator
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Comp));
return
Component_Vertex_Iterator
(DG.Iterate_Component_Vertices (G.Graph, Comp));
end Iterate_Component_Vertices;
----------------------------
-- Iterate_Edges_Of_Cycle --
----------------------------
function Iterate_Edges_Of_Cycle
(G : Library_Graph;
Cycle : Library_Graph_Cycle_Id) return Edges_Of_Cycle_Iterator
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Cycle));
return Edges_Of_Cycle_Iterator (LGE_Lists.Iterate (Path (G, Cycle)));
end Iterate_Edges_Of_Cycle;
---------------------------------
-- Iterate_Edges_To_Successors --
---------------------------------
function Iterate_Edges_To_Successors
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id) return Edges_To_Successors_Iterator
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
return
Edges_To_Successors_Iterator
(DG.Iterate_Outgoing_Edges (G.Graph, Vertex));
end Iterate_Edges_To_Successors;
----------
-- Kind --
----------
function Kind
(G : Library_Graph;
Cycle : Library_Graph_Cycle_Id) return Library_Graph_Cycle_Kind
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Cycle));
return Get_LGC_Attributes (G, Cycle).Kind;
end Kind;
----------
-- Kind --
----------
function Kind
(G : Library_Graph;
Edge : Library_Graph_Edge_Id) return Library_Graph_Edge_Kind
is
begin
return Get_LGE_Attributes (G, Edge).Kind;
end Kind;
------------
-- Length --
------------
function Length
(G : Library_Graph;
Cycle : Library_Graph_Cycle_Id) return Natural
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Cycle));
return LGE_Lists.Size (Path (G, Cycle));
end Length;
------------------------------
-- Library_Graph_Edge_Count --
------------------------------
function Library_Graph_Edge_Count
(G : Library_Graph;
Kind : Library_Graph_Edge_Kind) return Natural
is
begin
pragma Assert (Present (G));
return G.Counts (Kind);
end Library_Graph_Edge_Count;
--------------------------------------
-- Links_Vertices_In_Same_Component --
--------------------------------------
function Links_Vertices_In_Same_Component
(G : Library_Graph;
Edge : Library_Graph_Edge_Id) return Boolean
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Edge));
-- An edge is part of a cycle when both the successor and predecessor
-- reside in the same component.
return
In_Same_Component
(G => G,
Left => Predecessor (G, Edge),
Right => Successor (G, Edge));
end Links_Vertices_In_Same_Component;
-----------------------------------
-- Maximum_Invocation_Edge_Count --
-----------------------------------
function Maximum_Invocation_Edge_Count
(G : Library_Graph;
Edge : Library_Graph_Edge_Id;
Count : Natural) return Natural
is
New_Count : Natural;
begin
pragma Assert (Present (G));
New_Count := Count;
if Present (Edge) and then Is_Invocation_Edge (G, Edge) then
New_Count := New_Count + 1;
end if;
return New_Count;
end Maximum_Invocation_Edge_Count;
----------
-- Name --
----------
function Name
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id) return Unit_Name_Type
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
return Name (Unit (G, Vertex));
end Name;
-----------------------
-- Needs_Elaboration --
-----------------------
function Needs_Elaboration
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id) return Boolean
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
return Needs_Elaboration (Unit (G, Vertex));
end Needs_Elaboration;
----------
-- Next --
----------
procedure Next
(Iter : in out All_Cycle_Iterator;
Cycle : out Library_Graph_Cycle_Id)
is
begin
LGC_Lists.Next (LGC_Lists.Iterator (Iter), Cycle);
end Next;
----------
-- Next --
----------
procedure Next
(Iter : in out All_Edge_Iterator;
Edge : out Library_Graph_Edge_Id)
is
begin
DG.Next (DG.All_Edge_Iterator (Iter), Edge);
end Next;
----------
-- Next --
----------
procedure Next
(Iter : in out All_Vertex_Iterator;
Vertex : out Library_Graph_Vertex_Id)
is
begin
DG.Next (DG.All_Vertex_Iterator (Iter), Vertex);
end Next;
----------
-- Next --
----------
procedure Next
(Iter : in out Edges_Of_Cycle_Iterator;
Edge : out Library_Graph_Edge_Id)
is
begin
LGE_Lists.Next (LGE_Lists.Iterator (Iter), Edge);
end Next;
----------
-- Next --
----------
procedure Next
(Iter : in out Component_Iterator;
Comp : out Component_Id)
is
begin
DG.Next (DG.Component_Iterator (Iter), Comp);
end Next;
----------
-- Next --
----------
procedure Next
(Iter : in out Edges_To_Successors_Iterator;
Edge : out Library_Graph_Edge_Id)
is
begin
DG.Next (DG.Outgoing_Edge_Iterator (Iter), Edge);
end Next;
----------
-- Next --
----------
procedure Next
(Iter : in out Component_Vertex_Iterator;
Vertex : out Library_Graph_Vertex_Id)
is
begin
DG.Next (DG.Component_Vertex_Iterator (Iter), Vertex);
end Next;
--------------------------
-- Normalize_Cycle_Path --
--------------------------
procedure Normalize_Cycle_Path
(Cycle_Path : LGE_Lists.Doubly_Linked_List;
Most_Significant_Edge : Library_Graph_Edge_Id)
is
Edge : Library_Graph_Edge_Id;
begin
pragma Assert (LGE_Lists.Present (Cycle_Path));
pragma Assert (Present (Most_Significant_Edge));
-- Perform at most |Cycle_Path| rotations in case the cycle is
-- malformed and the significant edge does not appear within.
for Rotation in 1 .. LGE_Lists.Size (Cycle_Path) loop
Edge := LGE_Lists.First (Cycle_Path);
-- The cycle is already rotated such that the most significant
-- edge is first.
if Edge = Most_Significant_Edge then
return;
-- Otherwise rotate the cycle by relocating the current edge from
-- the start to the end of the path. This preserves the order of
-- the path.
else
LGE_Lists.Delete_First (Cycle_Path);
LGE_Lists.Append (Cycle_Path, Edge);
end if;
end loop;
pragma Assert (False);
end Normalize_Cycle_Path;
----------------------------------
-- Number_Of_Component_Vertices --
----------------------------------
function Number_Of_Component_Vertices
(G : Library_Graph;
Comp : Component_Id) return Natural
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Comp));
return DG.Number_Of_Component_Vertices (G.Graph, Comp);
end Number_Of_Component_Vertices;
--------------------------
-- Number_Of_Components --
--------------------------
function Number_Of_Components (G : Library_Graph) return Natural is
begin
pragma Assert (Present (G));
return DG.Number_Of_Components (G.Graph);
end Number_Of_Components;
----------------------
-- Number_Of_Cycles --
----------------------
function Number_Of_Cycles (G : Library_Graph) return Natural is
begin
pragma Assert (Present (G));
return LGC_Lists.Size (G.Cycles);
end Number_Of_Cycles;
---------------------
-- Number_Of_Edges --
---------------------
function Number_Of_Edges (G : Library_Graph) return Natural is
begin
pragma Assert (Present (G));
return DG.Number_Of_Edges (G.Graph);
end Number_Of_Edges;
-----------------------------------
-- Number_Of_Edges_To_Successors --
-----------------------------------
function Number_Of_Edges_To_Successors
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id) return Natural
is
begin
pragma Assert (Present (G));
return DG.Number_Of_Outgoing_Edges (G.Graph, Vertex);
end Number_Of_Edges_To_Successors;
------------------------
-- Number_Of_Vertices --
------------------------
function Number_Of_Vertices (G : Library_Graph) return Natural is
begin
pragma Assert (Present (G));
return DG.Number_Of_Vertices (G.Graph);
end Number_Of_Vertices;
-----------------
-- Order_Cycle --
-----------------
procedure Order_Cycle
(G : Library_Graph;
Cycle : Library_Graph_Cycle_Id)
is
Lesser_Cycle : Library_Graph_Cycle_Id;
begin
pragma Assert (Present (G));
pragma Assert (Present (Cycle));
pragma Assert (LGC_Lists.Present (G.Cycles));
-- The input cycle is the first to be inserted
if LGC_Lists.Is_Empty (G.Cycles) then
LGC_Lists.Prepend (G.Cycles, Cycle);
-- Otherwise the list of all cycles contains at least one cycle.
-- Insert the input cycle based on its precedence.
else
Lesser_Cycle := Find_First_Lower_Precedence_Cycle (G, Cycle);
-- The list contains at least one cycle, and the input cycle has a
-- higher precedence compared to some cycle in the list.
if Present (Lesser_Cycle) then
LGC_Lists.Insert_Before
(L => G.Cycles,
Before => Lesser_Cycle,
Elem => Cycle);
-- Otherwise the input cycle has the lowest precedence among all
-- cycles.
else
LGC_Lists.Append (G.Cycles, Cycle);
end if;
end if;
end Order_Cycle;
----------
-- Path --
----------
function Path
(G : Library_Graph;
Cycle : Library_Graph_Cycle_Id) return LGE_Lists.Doubly_Linked_List
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Cycle));
return Get_LGC_Attributes (G, Cycle).Path;
end Path;
------------------------------------------
-- Pending_Predecessors_For_Elaboration --
------------------------------------------
procedure Pending_Predecessors_For_Elaboration
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id;
Strong_Preds : out Natural;
Weak_Preds : out Natural)
is
Complement : Library_Graph_Vertex_Id;
Spec_Vertex : Library_Graph_Vertex_Id;
Total_Strong_Preds : Natural;
Total_Weak_Preds : Natural;
begin
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
Total_Strong_Preds := Pending_Strong_Predecessors (G, Vertex);
Total_Weak_Preds := Pending_Weak_Predecessors (G, Vertex);
-- Assume that there is no complementary vertex that needs to be
-- examined.
Complement := No_Library_Graph_Vertex;
Spec_Vertex := No_Library_Graph_Vertex;
if Is_Body_Of_Spec_With_Elaborate_Body (G, Vertex) then
Complement := Proper_Spec (G, Vertex);
Spec_Vertex := Complement;
elsif Is_Spec_With_Elaborate_Body (G, Vertex) then
Complement := Proper_Body (G, Vertex);
Spec_Vertex := Vertex;
end if;
-- The vertex is part of an Elaborate_Body pair. Take into account
-- the strong and weak predecessors of the complementary vertex.
if Present (Complement) then
Total_Strong_Preds :=
Pending_Strong_Predecessors (G, Complement) + Total_Strong_Preds;
Total_Weak_Preds :=
Pending_Weak_Predecessors (G, Complement) + Total_Weak_Preds;
-- The body of an Elaborate_Body pair is the successor of a strong
-- edge where the predecessor is the spec. This edge must not be
-- considered for elaboration purposes because the pair is treated
-- as one vertex. Account for the edge only when the spec has not
-- been elaborated yet.
if not In_Elaboration_Order (G, Spec_Vertex) then
Total_Strong_Preds := Total_Strong_Preds - 1;
end if;
end if;
Strong_Preds := Total_Strong_Preds;
Weak_Preds := Total_Weak_Preds;
end Pending_Predecessors_For_Elaboration;
---------------------------------
-- Pending_Strong_Predecessors --
---------------------------------
function Pending_Strong_Predecessors
(G : Library_Graph;
Comp : Component_Id) return Natural
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Comp));
return Get_Component_Attributes (G, Comp).Pending_Strong_Predecessors;
end Pending_Strong_Predecessors;
---------------------------------
-- Pending_Strong_Predecessors --
---------------------------------
function Pending_Strong_Predecessors
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id) return Natural
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
return Get_LGV_Attributes (G, Vertex).Pending_Strong_Predecessors;
end Pending_Strong_Predecessors;
-------------------------------
-- Pending_Weak_Predecessors --
-------------------------------
function Pending_Weak_Predecessors
(G : Library_Graph;
Comp : Component_Id) return Natural
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Comp));
return Get_Component_Attributes (G, Comp).Pending_Weak_Predecessors;
end Pending_Weak_Predecessors;
-------------------------------
-- Pending_Weak_Predecessors --
-------------------------------
function Pending_Weak_Predecessors
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id) return Natural
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
return Get_LGV_Attributes (G, Vertex).Pending_Weak_Predecessors;
end Pending_Weak_Predecessors;
-----------------
-- Predecessor --
-----------------
function Predecessor
(G : Library_Graph;
Edge : Library_Graph_Edge_Id) return Library_Graph_Vertex_Id
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Edge));
return DG.Source_Vertex (G.Graph, Edge);
end Predecessor;
-------------
-- Present --
-------------
function Present (G : Library_Graph) return Boolean is
begin
return G /= Nil;
end Present;
-----------------
-- Proper_Body --
-----------------
function Proper_Body
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id) return Library_Graph_Vertex_Id
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
-- When the vertex denotes a spec with a completing body, return the
-- body.
if Is_Spec_With_Body (G, Vertex) then
return Corresponding_Item (G, Vertex);
-- Otherwise the vertex must be a body
else
pragma Assert (Is_Body (G, Vertex));
return Vertex;
end if;
end Proper_Body;
-----------------
-- Proper_Spec --
-----------------
function Proper_Spec
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id) return Library_Graph_Vertex_Id
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
-- When the vertex denotes a body that completes a spec, return the
-- spec.
if Is_Body_With_Spec (G, Vertex) then
return Corresponding_Item (G, Vertex);
-- Otherwise the vertex must denote a spec
else
pragma Assert (Is_Spec (G, Vertex));
return Vertex;
end if;
end Proper_Spec;
------------------
-- Record_Cycle --
------------------
procedure Record_Cycle
(G : Library_Graph;
Most_Significant_Edge : Library_Graph_Edge_Id;
Invocation_Edge_Count : Natural;
Cycle_Path : LGE_Lists.Doubly_Linked_List;
Indent : Indentation_Level)
is
Cycle : Library_Graph_Cycle_Id;
Path : LGE_Lists.Doubly_Linked_List;
begin
pragma Assert (Present (G));
pragma Assert (Present (Most_Significant_Edge));
pragma Assert (LGE_Lists.Present (Cycle_Path));
-- Replicate the path of the cycle in order to avoid sharing lists
Path := Copy_Cycle_Path (Cycle_Path);
-- Normalize the path of the cycle such that its most significant
-- edge is the first in the list of edges.
Normalize_Cycle_Path
(Cycle_Path => Path,
Most_Significant_Edge => Most_Significant_Edge);
-- Save the cycle for diagnostic purposes. Its kind is determined by
-- its most significant edge.
Cycle := Sequence_Next_Cycle;
Set_LGC_Attributes
(G => G,
Cycle => Cycle,
Val =>
(Invocation_Edge_Count => Invocation_Edge_Count,
Kind =>
Cycle_Kind_Of
(G => G,
Edge => Most_Significant_Edge),
Path => Path));
Trace_Cycle (G, Cycle, Indent);
-- Order the cycle based on its precedence relative to previously
-- discovered cycles.
Order_Cycle (G, Cycle);
end Record_Cycle;
-----------------------------------------
-- Same_Library_Graph_Cycle_Attributes --
-----------------------------------------
function Same_Library_Graph_Cycle_Attributes
(Left : Library_Graph_Cycle_Attributes;
Right : Library_Graph_Cycle_Attributes) return Boolean
is
begin
-- Two cycles are the same when
--
-- * They are of the same kind
-- * They have the same number of invocation edges in their paths
-- * Their paths are the same length
-- * The edges comprising their paths are the same
return
Left.Invocation_Edge_Count = Right.Invocation_Edge_Count
and then Left.Kind = Right.Kind
and then LGE_Lists.Equal (Left.Path, Right.Path);
end Same_Library_Graph_Cycle_Attributes;
------------------------
-- Set_Activates_Task --
------------------------
procedure Set_Activates_Task
(G : Library_Graph;
Edge : Library_Graph_Edge_Id)
is
Attributes : Library_Graph_Edge_Attributes :=
Get_LGE_Attributes (G, Edge);
begin
Attributes.Activates_Task := True;
Set_LGE_Attributes (G, Edge, Attributes);
end Set_Activates_Task;
------------------------------
-- Set_Component_Attributes --
------------------------------
procedure Set_Component_Attributes
(G : Library_Graph;
Comp : Component_Id;
Val : Component_Attributes)
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Comp));
Component_Tables.Put (G.Component_Attributes, Comp, Val);
end Set_Component_Attributes;
----------------------------
-- Set_Corresponding_Item --
----------------------------
procedure Set_Corresponding_Item
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id;
Val : Library_Graph_Vertex_Id)
is
Attrs : Library_Graph_Vertex_Attributes;
begin
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
Attrs := Get_LGV_Attributes (G, Vertex);
Attrs.Corresponding_Item := Val;
Set_LGV_Attributes (G, Vertex, Attrs);
end Set_Corresponding_Item;
------------------------------
-- Set_Corresponding_Vertex --
------------------------------
procedure Set_Corresponding_Vertex
(G : Library_Graph;
U_Id : Unit_Id;
Val : Library_Graph_Vertex_Id)
is
begin
pragma Assert (Present (G));
pragma Assert (Present (U_Id));
Unit_Tables.Put (G.Unit_To_Vertex, U_Id, Val);
end Set_Corresponding_Vertex;
------------------------------
-- Set_In_Elaboration_Order --
------------------------------
procedure Set_In_Elaboration_Order
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id;
Val : Boolean := True)
is
Attrs : Library_Graph_Vertex_Attributes;
begin
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
Attrs := Get_LGV_Attributes (G, Vertex);
Attrs.In_Elaboration_Order := Val;
Set_LGV_Attributes (G, Vertex, Attrs);
end Set_In_Elaboration_Order;
--------------------------
-- Set_Is_Recorded_Edge --
--------------------------
procedure Set_Is_Recorded_Edge
(G : Library_Graph;
Rel : Predecessor_Successor_Relation)
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Rel.Predecessor));
pragma Assert (Present (Rel.Successor));
RE_Sets.Insert (G.Recorded_Edges, Rel);
end Set_Is_Recorded_Edge;
------------------------
-- Set_LGC_Attributes --
------------------------
procedure Set_LGC_Attributes
(G : Library_Graph;
Cycle : Library_Graph_Cycle_Id;
Val : Library_Graph_Cycle_Attributes)
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Cycle));
LGC_Tables.Put (G.Cycle_Attributes, Cycle, Val);
end Set_LGC_Attributes;
------------------------
-- Set_LGE_Attributes --
------------------------
procedure Set_LGE_Attributes
(G : Library_Graph;
Edge : Library_Graph_Edge_Id;
Val : Library_Graph_Edge_Attributes)
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Edge));
LGE_Tables.Put (G.Edge_Attributes, Edge, Val);
end Set_LGE_Attributes;
------------------------
-- Set_LGV_Attributes --
------------------------
procedure Set_LGV_Attributes
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id;
Val : Library_Graph_Vertex_Attributes)
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
LGV_Tables.Put (G.Vertex_Attributes, Vertex, Val);
end Set_LGV_Attributes;
---------------
-- Successor --
---------------
function Successor
(G : Library_Graph;
Edge : Library_Graph_Edge_Id) return Library_Graph_Vertex_Id
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Edge));
return DG.Destination_Vertex (G.Graph, Edge);
end Successor;
---------------------
-- Trace_Component --
---------------------
procedure Trace_Component
(G : Library_Graph;
Comp : Component_Id;
Indent : Indentation_Level)
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Comp));
-- Nothing to do when switch -d_t (output cycle-detection trace
-- information) is not in effect.
if not Debug_Flag_Underscore_T then
return;
end if;
Write_Eol;
Indent_By (Indent);
Write_Str ("component (Comp_");
Write_Int (Int (Comp));
Write_Str (")");
Write_Eol;
end Trace_Component;
-----------------
-- Trace_Cycle --
-----------------
procedure Trace_Cycle
(G : Library_Graph;
Cycle : Library_Graph_Cycle_Id;
Indent : Indentation_Level)
is
Attr_Indent : constant Indentation_Level :=
Indent + Nested_Indentation;
Edge_Indent : constant Indentation_Level :=
Attr_Indent + Nested_Indentation;
Edge : Library_Graph_Edge_Id;
Iter : Edges_Of_Cycle_Iterator;
begin
pragma Assert (Present (G));
pragma Assert (Present (Cycle));
-- Nothing to do when switch -d_t (output cycle-detection trace
-- information) is not in effect.
if not Debug_Flag_Underscore_T then
return;
end if;
Indent_By (Indent);
Write_Str ("cycle (LGC_Id_");
Write_Int (Int (Cycle));
Write_Str (")");
Write_Eol;
Indent_By (Attr_Indent);
Write_Str ("kind = ");
Write_Str (Kind (G, Cycle)'Img);
Write_Eol;
Indent_By (Attr_Indent);
Write_Str ("invocation edges = ");
Write_Int (Int (Invocation_Edge_Count (G, Cycle)));
Write_Eol;
Indent_By (Attr_Indent);
Write_Str ("length: ");
Write_Int (Int (Length (G, Cycle)));
Write_Eol;
Iter := Iterate_Edges_Of_Cycle (G, Cycle);
while Has_Next (Iter) loop
Next (Iter, Edge);
Indent_By (Edge_Indent);
Write_Str ("library graph edge (LGE_Id_");
Write_Int (Int (Edge));
Write_Str (")");
Write_Eol;
end loop;
end Trace_Cycle;
----------------
-- Trace_Edge --
----------------
procedure Trace_Edge
(G : Library_Graph;
Edge : Library_Graph_Edge_Id;
Indent : Indentation_Level)
is
pragma Assert (Present (G));
pragma Assert (Present (Edge));
Attr_Indent : constant Indentation_Level :=
Indent + Nested_Indentation;
Pred : constant Library_Graph_Vertex_Id := Predecessor (G, Edge);
Succ : constant Library_Graph_Vertex_Id := Successor (G, Edge);
begin
-- Nothing to do when switch -d_t (output cycle-detection trace
-- information) is not in effect.
if not Debug_Flag_Underscore_T then
return;
end if;
Indent_By (Indent);
Write_Str ("library graph edge (LGE_Id_");
Write_Int (Int (Edge));
Write_Str (")");
Write_Eol;
Indent_By (Attr_Indent);
Write_Str ("kind = ");
Write_Str (Kind (G, Edge)'Img);
Write_Eol;
Indent_By (Attr_Indent);
Write_Str ("Predecessor (LGV_Id_");
Write_Int (Int (Pred));
Write_Str (") name = ");
Write_Name (Name (G, Pred));
Write_Eol;
Indent_By (Attr_Indent);
Write_Str ("Successor (LGV_Id_");
Write_Int (Int (Succ));
Write_Str (") name = ");
Write_Name (Name (G, Succ));
Write_Eol;
end Trace_Edge;
------------------
-- Trace_Vertex --
------------------
procedure Trace_Vertex
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id;
Indent : Indentation_Level)
is
Attr_Indent : constant Indentation_Level :=
Indent + Nested_Indentation;
begin
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
-- Nothing to do when switch -d_t (output cycle-detection trace
-- information) is not in effect.
if not Debug_Flag_Underscore_T then
return;
end if;
Indent_By (Indent);
Write_Str ("library graph vertex (LGV_Id_");
Write_Int (Int (Vertex));
Write_Str (")");
Write_Eol;
Indent_By (Attr_Indent);
Write_Str ("Unit (U_Id_");
Write_Int (Int (Unit (G, Vertex)));
Write_Str (") name = ");
Write_Name (Name (G, Vertex));
Write_Eol;
end Trace_Vertex;
----------
-- Unit --
----------
function Unit
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id) return Unit_Id
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
return Get_LGV_Attributes (G, Vertex).Unit;
end Unit;
-------------
-- Unvisit --
-------------
procedure Unvisit
(Vertex : Library_Graph_Vertex_Id;
Visited_Set : LGV_Sets.Membership_Set;
Visited_Stack : LGV_Lists.Doubly_Linked_List)
is
Current_Vertex : Library_Graph_Vertex_Id;
begin
pragma Assert (Present (Vertex));
pragma Assert (LGV_Sets.Present (Visited_Set));
pragma Assert (LGV_Lists.Present (Visited_Stack));
while not LGV_Lists.Is_Empty (Visited_Stack) loop
Current_Vertex := LGV_Lists.First (Visited_Stack);
LGV_Lists.Delete_First (Visited_Stack);
LGV_Sets.Delete (Visited_Set, Current_Vertex);
exit when Current_Vertex = Vertex;
end loop;
end Unvisit;
---------------------------------
-- Update_Pending_Predecessors --
---------------------------------
procedure Update_Pending_Predecessors
(Strong_Predecessors : in out Natural;
Weak_Predecessors : in out Natural;
Update_Weak : Boolean;
Value : Integer)
is
begin
if Update_Weak then
Weak_Predecessors := Weak_Predecessors + Value;
else
Strong_Predecessors := Strong_Predecessors + Value;
end if;
end Update_Pending_Predecessors;
-----------------------------------------------
-- Update_Pending_Predecessors_Of_Components --
-----------------------------------------------
procedure Update_Pending_Predecessors_Of_Components
(G : Library_Graph)
is
Edge : Library_Graph_Edge_Id;
Iter : All_Edge_Iterator;
begin
pragma Assert (Present (G));
Iter := Iterate_All_Edges (G);
while Has_Next (Iter) loop
Next (Iter, Edge);
Update_Pending_Predecessors_Of_Components (G, Edge);
end loop;
end Update_Pending_Predecessors_Of_Components;
-----------------------------------------------
-- Update_Pending_Predecessors_Of_Components --
-----------------------------------------------
procedure Update_Pending_Predecessors_Of_Components
(G : Library_Graph;
Edge : Library_Graph_Edge_Id)
is
pragma Assert (Present (G));
pragma Assert (Present (Edge));
Pred_Comp : constant Component_Id :=
Component (G, Predecessor (G, Edge));
Succ_Comp : constant Component_Id :=
Component (G, Successor (G, Edge));
pragma Assert (Present (Pred_Comp));
pragma Assert (Present (Succ_Comp));
begin
-- The edge links a successor and a predecessor coming from two
-- different SCCs. This indicates that the SCC of the successor
-- must wait on another predecessor until it can be elaborated.
if Pred_Comp /= Succ_Comp then
Increment_Pending_Predecessors
(G => G,
Comp => Succ_Comp,
Edge => Edge);
end if;
end Update_Pending_Predecessors_Of_Components;
-----------------------
-- Vertex_Precedence --
-----------------------
function Vertex_Precedence
(G : Library_Graph;
Vertex : Library_Graph_Vertex_Id;
Compared_To : Library_Graph_Vertex_Id) return Precedence_Kind
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
pragma Assert (Present (Compared_To));
-- Use lexicographical order to determine precedence and ensure
-- deterministic behavior.
if Uname_Less (Name (G, Vertex), Name (G, Compared_To)) then
return Higher_Precedence;
else
return Lower_Precedence;
end if;
end Vertex_Precedence;
-----------
-- Visit --
-----------
procedure Visit
(Vertex : Library_Graph_Vertex_Id;
Visited_Set : LGV_Sets.Membership_Set;
Visited_Stack : LGV_Lists.Doubly_Linked_List)
is
begin
pragma Assert (Present (Vertex));
pragma Assert (LGV_Sets.Present (Visited_Set));
pragma Assert (LGV_Lists.Present (Visited_Stack));
LGV_Sets.Insert (Visited_Set, Vertex);
LGV_Lists.Prepend (Visited_Stack, Vertex);
end Visit;
end Library_Graphs;
-----------------------
-- Invocation_Graphs --
-----------------------
package body Invocation_Graphs is
-----------------------
-- Local subprograms --
-----------------------
procedure Free is
new Ada.Unchecked_Deallocation
(Invocation_Graph_Attributes, Invocation_Graph);
function Get_IGE_Attributes
(G : Invocation_Graph;
Edge : Invocation_Graph_Edge_Id)
return Invocation_Graph_Edge_Attributes;
pragma Inline (Get_IGE_Attributes);
-- Obtain the attributes of edge Edge of invocation graph G
function Get_IGV_Attributes
(G : Invocation_Graph;
Vertex : Invocation_Graph_Vertex_Id)
return Invocation_Graph_Vertex_Attributes;
pragma Inline (Get_IGV_Attributes);
-- Obtain the attributes of vertex Vertex of invocation graph G
procedure Increment_Invocation_Graph_Edge_Count
(G : Invocation_Graph;
Kind : Invocation_Kind);
pragma Inline (Increment_Invocation_Graph_Edge_Count);
-- Increment the number of edges of king Kind in invocation graph G by
-- one.
function Is_Elaboration_Root
(G : Invocation_Graph;
Vertex : Invocation_Graph_Vertex_Id) return Boolean;
pragma Inline (Is_Elaboration_Root);
-- Determine whether vertex Vertex of invocation graph denotes the
-- elaboration procedure of a spec or a body.
function Is_Existing_Source_Target_Relation
(G : Invocation_Graph;
Rel : Source_Target_Relation) return Boolean;
pragma Inline (Is_Existing_Source_Target_Relation);
-- Determine whether a source vertex and a target vertex described by
-- relation Rel are already related in invocation graph G.
procedure Save_Elaboration_Root
(G : Invocation_Graph;
Root : Invocation_Graph_Vertex_Id);
pragma Inline (Save_Elaboration_Root);
-- Save elaboration root Root of invocation graph G
procedure Set_Corresponding_Vertex
(G : Invocation_Graph;
IS_Id : Invocation_Signature_Id;
Vertex : Invocation_Graph_Vertex_Id);
pragma Inline (Set_Corresponding_Vertex);
-- Associate vertex Vertex of invocation graph G with signature IS_Id
procedure Set_Is_Existing_Source_Target_Relation
(G : Invocation_Graph;
Rel : Source_Target_Relation;
Val : Boolean := True);
pragma Inline (Set_Is_Existing_Source_Target_Relation);
-- Mark a source vertex and a target vertex described by relation Rel as
-- already related in invocation graph G depending on value Val.
procedure Set_IGE_Attributes
(G : Invocation_Graph;
Edge : Invocation_Graph_Edge_Id;
Val : Invocation_Graph_Edge_Attributes);
pragma Inline (Set_IGE_Attributes);
-- Set the attributes of edge Edge of invocation graph G to value Val
procedure Set_IGV_Attributes
(G : Invocation_Graph;
Vertex : Invocation_Graph_Vertex_Id;
Val : Invocation_Graph_Vertex_Attributes);
pragma Inline (Set_IGV_Attributes);
-- Set the attributes of vertex Vertex of invocation graph G to value
-- Val.
--------------
-- Add_Edge --
--------------
procedure Add_Edge
(G : Invocation_Graph;
Source : Invocation_Graph_Vertex_Id;
Target : Invocation_Graph_Vertex_Id;
IR_Id : Invocation_Relation_Id)
is
pragma Assert (Present (G));
pragma Assert (Present (Source));
pragma Assert (Present (Target));
pragma Assert (Present (IR_Id));
Rel : constant Source_Target_Relation :=
(Source => Source,
Target => Target);
Edge : Invocation_Graph_Edge_Id;
begin
-- Nothing to do when the source and target are already related by an
-- edge.
if Is_Existing_Source_Target_Relation (G, Rel) then
return;
end if;
Edge := Sequence_Next_Edge;
-- Add the edge to the underlying graph
DG.Add_Edge
(G => G.Graph,
E => Edge,
Source => Source,
Destination => Target);
-- Build and save the attributes of the edge
Set_IGE_Attributes
(G => G,
Edge => Edge,
Val => (Relation => IR_Id));
-- Mark the source and target as related by the new edge. This
-- prevents all further attempts to link the same source and target.
Set_Is_Existing_Source_Target_Relation (G, Rel);
-- Update the edge statistics
Increment_Invocation_Graph_Edge_Count (G, Kind (IR_Id));
end Add_Edge;
----------------
-- Add_Vertex --
----------------
procedure Add_Vertex
(G : Invocation_Graph;
IC_Id : Invocation_Construct_Id;
Body_Vertex : Library_Graph_Vertex_Id;
Spec_Vertex : Library_Graph_Vertex_Id)
is
pragma Assert (Present (G));
pragma Assert (Present (IC_Id));
pragma Assert (Present (Body_Vertex));
pragma Assert (Present (Spec_Vertex));
Construct_Signature : constant Invocation_Signature_Id :=
Signature (IC_Id);
Vertex : Invocation_Graph_Vertex_Id;
begin
-- Nothing to do when the construct already has a vertex
if Present (Corresponding_Vertex (G, Construct_Signature)) then
return;
end if;
Vertex := Sequence_Next_Vertex;
-- Add the vertex to the underlying graph
DG.Add_Vertex (G.Graph, Vertex);
-- Build and save the attributes of the vertex
Set_IGV_Attributes
(G => G,
Vertex => Vertex,
Val => (Body_Vertex => Body_Vertex,
Construct => IC_Id,
Spec_Vertex => Spec_Vertex));
-- Associate the construct with its corresponding vertex
Set_Corresponding_Vertex (G, Construct_Signature, Vertex);
-- Save the vertex for later processing when it denotes a spec or
-- body elaboration procedure.
if Is_Elaboration_Root (G, Vertex) then
Save_Elaboration_Root (G, Vertex);
end if;
end Add_Vertex;
-----------------
-- Body_Vertex --
-----------------
function Body_Vertex
(G : Invocation_Graph;
Vertex : Invocation_Graph_Vertex_Id) return Library_Graph_Vertex_Id
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
return Get_IGV_Attributes (G, Vertex).Body_Vertex;
end Body_Vertex;
------------
-- Column --
------------
function Column
(G : Invocation_Graph;
Vertex : Invocation_Graph_Vertex_Id) return Nat
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
return Column (Signature (Construct (G, Vertex)));
end Column;
---------------
-- Construct --
---------------
function Construct
(G : Invocation_Graph;
Vertex : Invocation_Graph_Vertex_Id) return Invocation_Construct_Id
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
return Get_IGV_Attributes (G, Vertex).Construct;
end Construct;
--------------------------
-- Corresponding_Vertex --
--------------------------
function Corresponding_Vertex
(G : Invocation_Graph;
IS_Id : Invocation_Signature_Id) return Invocation_Graph_Vertex_Id
is
begin
pragma Assert (Present (G));
pragma Assert (Present (IS_Id));
return Signature_Tables.Get (G.Signature_To_Vertex, IS_Id);
end Corresponding_Vertex;
------------
-- Create --
------------
function Create
(Initial_Vertices : Positive;
Initial_Edges : Positive;
Lib_Graph : Library_Graphs.Library_Graph)
return Invocation_Graph
is
G : constant Invocation_Graph := new Invocation_Graph_Attributes'
(Counts => <>,
Edge_Attributes => IGE_Tables.Create (Initial_Edges),
Graph =>
DG.Create
(Initial_Vertices => Initial_Vertices,
Initial_Edges => Initial_Edges),
Relations => Relation_Sets.Create (Initial_Edges),
Roots => IGV_Sets.Create (Initial_Vertices),
Signature_To_Vertex => Signature_Tables.Create (Initial_Vertices),
Vertex_Attributes => IGV_Tables.Create (Initial_Vertices),
Lib_Graph => Lib_Graph);
begin
return G;
end Create;
-------------
-- Destroy --
-------------
procedure Destroy (G : in out Invocation_Graph) is
begin
pragma Assert (Present (G));
IGE_Tables.Destroy (G.Edge_Attributes);
DG.Destroy (G.Graph);
Relation_Sets.Destroy (G.Relations);
IGV_Sets.Destroy (G.Roots);
Signature_Tables.Destroy (G.Signature_To_Vertex);
IGV_Tables.Destroy (G.Vertex_Attributes);
Free (G);
end Destroy;
-----------------------------------
-- Destroy_Invocation_Graph_Edge --
-----------------------------------
procedure Destroy_Invocation_Graph_Edge
(Edge : in out Invocation_Graph_Edge_Id)
is
pragma Unreferenced (Edge);
begin
null;
end Destroy_Invocation_Graph_Edge;
----------------------------------------------
-- Destroy_Invocation_Graph_Edge_Attributes --
----------------------------------------------
procedure Destroy_Invocation_Graph_Edge_Attributes
(Attrs : in out Invocation_Graph_Edge_Attributes)
is
pragma Unreferenced (Attrs);
begin
null;
end Destroy_Invocation_Graph_Edge_Attributes;
-------------------------------------
-- Destroy_Invocation_Graph_Vertex --
-------------------------------------
procedure Destroy_Invocation_Graph_Vertex
(Vertex : in out Invocation_Graph_Vertex_Id)
is
pragma Unreferenced (Vertex);
begin
null;
end Destroy_Invocation_Graph_Vertex;
------------------------------------------------
-- Destroy_Invocation_Graph_Vertex_Attributes --
------------------------------------------------
procedure Destroy_Invocation_Graph_Vertex_Attributes
(Attrs : in out Invocation_Graph_Vertex_Attributes)
is
pragma Unreferenced (Attrs);
begin
null;
end Destroy_Invocation_Graph_Vertex_Attributes;
-----------
-- Extra --
-----------
function Extra
(G : Invocation_Graph;
Edge : Invocation_Graph_Edge_Id) return Name_Id
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Edge));
return Extra (Relation (G, Edge));
end Extra;
------------------------
-- Get_IGE_Attributes --
------------------------
function Get_IGE_Attributes
(G : Invocation_Graph;
Edge : Invocation_Graph_Edge_Id)
return Invocation_Graph_Edge_Attributes
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Edge));
return IGE_Tables.Get (G.Edge_Attributes, Edge);
end Get_IGE_Attributes;
------------------------
-- Get_IGV_Attributes --
------------------------
function Get_IGV_Attributes
(G : Invocation_Graph;
Vertex : Invocation_Graph_Vertex_Id)
return Invocation_Graph_Vertex_Attributes
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
return IGV_Tables.Get (G.Vertex_Attributes, Vertex);
end Get_IGV_Attributes;
--------------
-- Has_Next --
--------------
function Has_Next (Iter : All_Edge_Iterator) return Boolean is
begin
return DG.Has_Next (DG.All_Edge_Iterator (Iter));
end Has_Next;
--------------
-- Has_Next --
--------------
function Has_Next (Iter : All_Vertex_Iterator) return Boolean is
begin
return DG.Has_Next (DG.All_Vertex_Iterator (Iter));
end Has_Next;
--------------
-- Has_Next --
--------------
function Has_Next (Iter : Edges_To_Targets_Iterator) return Boolean is
begin
return DG.Has_Next (DG.Outgoing_Edge_Iterator (Iter));
end Has_Next;
--------------
-- Has_Next --
--------------
function Has_Next (Iter : Elaboration_Root_Iterator) return Boolean is
begin
return IGV_Sets.Has_Next (IGV_Sets.Iterator (Iter));
end Has_Next;
-------------------------------
-- Hash_Invocation_Signature --
-------------------------------
function Hash_Invocation_Signature
(IS_Id : Invocation_Signature_Id) return Bucket_Range_Type
is
begin
pragma Assert (Present (IS_Id));
return Bucket_Range_Type (IS_Id);
end Hash_Invocation_Signature;
---------------------------------
-- Hash_Source_Target_Relation --
---------------------------------
function Hash_Source_Target_Relation
(Rel : Source_Target_Relation) return Bucket_Range_Type
is
begin
pragma Assert (Present (Rel.Source));
pragma Assert (Present (Rel.Target));
return
Hash_Two_Keys
(Bucket_Range_Type (Rel.Source),
Bucket_Range_Type (Rel.Target));
end Hash_Source_Target_Relation;
-------------------------------------------
-- Increment_Invocation_Graph_Edge_Count --
-------------------------------------------
procedure Increment_Invocation_Graph_Edge_Count
(G : Invocation_Graph;
Kind : Invocation_Kind)
is
pragma Assert (Present (G));
Count : Natural renames G.Counts (Kind);
begin
Count := Count + 1;
end Increment_Invocation_Graph_Edge_Count;
---------------------------------
-- Invocation_Graph_Edge_Count --
---------------------------------
function Invocation_Graph_Edge_Count
(G : Invocation_Graph;
Kind : Invocation_Kind) return Natural
is
begin
pragma Assert (Present (G));
return G.Counts (Kind);
end Invocation_Graph_Edge_Count;
-------------------------
-- Is_Elaboration_Root --
-------------------------
function Is_Elaboration_Root
(G : Invocation_Graph;
Vertex : Invocation_Graph_Vertex_Id) return Boolean
is
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
Vertex_Kind : constant Invocation_Construct_Kind :=
Kind (Construct (G, Vertex));
begin
return
Vertex_Kind = Elaborate_Body_Procedure
or else
Vertex_Kind = Elaborate_Spec_Procedure;
end Is_Elaboration_Root;
----------------------------------------
-- Is_Existing_Source_Target_Relation --
----------------------------------------
function Is_Existing_Source_Target_Relation
(G : Invocation_Graph;
Rel : Source_Target_Relation) return Boolean
is
begin
pragma Assert (Present (G));
return Relation_Sets.Contains (G.Relations, Rel);
end Is_Existing_Source_Target_Relation;
-----------------------
-- Iterate_All_Edges --
-----------------------
function Iterate_All_Edges
(G : Invocation_Graph) return All_Edge_Iterator
is
begin
pragma Assert (Present (G));
return All_Edge_Iterator (DG.Iterate_All_Edges (G.Graph));
end Iterate_All_Edges;
--------------------------
-- Iterate_All_Vertices --
--------------------------
function Iterate_All_Vertices
(G : Invocation_Graph) return All_Vertex_Iterator
is
begin
pragma Assert (Present (G));
return All_Vertex_Iterator (DG.Iterate_All_Vertices (G.Graph));
end Iterate_All_Vertices;
------------------------------
-- Iterate_Edges_To_Targets --
------------------------------
function Iterate_Edges_To_Targets
(G : Invocation_Graph;
Vertex : Invocation_Graph_Vertex_Id) return Edges_To_Targets_Iterator
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
return
Edges_To_Targets_Iterator
(DG.Iterate_Outgoing_Edges (G.Graph, Vertex));
end Iterate_Edges_To_Targets;
-------------------------------
-- Iterate_Elaboration_Roots --
-------------------------------
function Iterate_Elaboration_Roots
(G : Invocation_Graph) return Elaboration_Root_Iterator
is
begin
pragma Assert (Present (G));
return Elaboration_Root_Iterator (IGV_Sets.Iterate (G.Roots));
end Iterate_Elaboration_Roots;
----------
-- Kind --
----------
function Kind
(G : Invocation_Graph;
Edge : Invocation_Graph_Edge_Id) return Invocation_Kind
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Edge));
return Kind (Relation (G, Edge));
end Kind;
-------------------
-- Get_Lib_Graph --
-------------------
function Get_Lib_Graph
(G : Invocation_Graph) return Library_Graphs.Library_Graph
is
pragma Assert (Present (G));
begin
return G.Lib_Graph;
end Get_Lib_Graph;
----------
-- Line --
----------
function Line
(G : Invocation_Graph;
Vertex : Invocation_Graph_Vertex_Id) return Nat
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
return Line (Signature (Construct (G, Vertex)));
end Line;
----------
-- Name --
----------
function Name
(G : Invocation_Graph;
Vertex : Invocation_Graph_Vertex_Id) return Name_Id
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
return Name (Signature (Construct (G, Vertex)));
end Name;
----------
-- Next --
----------
procedure Next
(Iter : in out All_Edge_Iterator;
Edge : out Invocation_Graph_Edge_Id)
is
begin
DG.Next (DG.All_Edge_Iterator (Iter), Edge);
end Next;
----------
-- Next --
----------
procedure Next
(Iter : in out All_Vertex_Iterator;
Vertex : out Invocation_Graph_Vertex_Id)
is
begin
DG.Next (DG.All_Vertex_Iterator (Iter), Vertex);
end Next;
----------
-- Next --
----------
procedure Next
(Iter : in out Edges_To_Targets_Iterator;
Edge : out Invocation_Graph_Edge_Id)
is
begin
DG.Next (DG.Outgoing_Edge_Iterator (Iter), Edge);
end Next;
----------
-- Next --
----------
procedure Next
(Iter : in out Elaboration_Root_Iterator;
Root : out Invocation_Graph_Vertex_Id)
is
begin
IGV_Sets.Next (IGV_Sets.Iterator (Iter), Root);
end Next;
---------------------
-- Number_Of_Edges --
---------------------
function Number_Of_Edges (G : Invocation_Graph) return Natural is
begin
pragma Assert (Present (G));
return DG.Number_Of_Edges (G.Graph);
end Number_Of_Edges;
--------------------------------
-- Number_Of_Edges_To_Targets --
--------------------------------
function Number_Of_Edges_To_Targets
(G : Invocation_Graph;
Vertex : Invocation_Graph_Vertex_Id) return Natural
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
return DG.Number_Of_Outgoing_Edges (G.Graph, Vertex);
end Number_Of_Edges_To_Targets;
---------------------------------
-- Number_Of_Elaboration_Roots --
---------------------------------
function Number_Of_Elaboration_Roots
(G : Invocation_Graph) return Natural
is
begin
pragma Assert (Present (G));
return IGV_Sets.Size (G.Roots);
end Number_Of_Elaboration_Roots;
------------------------
-- Number_Of_Vertices --
------------------------
function Number_Of_Vertices (G : Invocation_Graph) return Natural is
begin
pragma Assert (Present (G));
return DG.Number_Of_Vertices (G.Graph);
end Number_Of_Vertices;
-------------
-- Present --
-------------
function Present (G : Invocation_Graph) return Boolean is
begin
return G /= Nil;
end Present;
--------------
-- Relation --
--------------
function Relation
(G : Invocation_Graph;
Edge : Invocation_Graph_Edge_Id) return Invocation_Relation_Id
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Edge));
return Get_IGE_Attributes (G, Edge).Relation;
end Relation;
---------------------------
-- Save_Elaboration_Root --
---------------------------
procedure Save_Elaboration_Root
(G : Invocation_Graph;
Root : Invocation_Graph_Vertex_Id)
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Root));
IGV_Sets.Insert (G.Roots, Root);
end Save_Elaboration_Root;
------------------------------
-- Set_Corresponding_Vertex --
------------------------------
procedure Set_Corresponding_Vertex
(G : Invocation_Graph;
IS_Id : Invocation_Signature_Id;
Vertex : Invocation_Graph_Vertex_Id)
is
begin
pragma Assert (Present (G));
pragma Assert (Present (IS_Id));
pragma Assert (Present (Vertex));
Signature_Tables.Put (G.Signature_To_Vertex, IS_Id, Vertex);
end Set_Corresponding_Vertex;
--------------------------------------------
-- Set_Is_Existing_Source_Target_Relation --
--------------------------------------------
procedure Set_Is_Existing_Source_Target_Relation
(G : Invocation_Graph;
Rel : Source_Target_Relation;
Val : Boolean := True)
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Rel.Source));
pragma Assert (Present (Rel.Target));
if Val then
Relation_Sets.Insert (G.Relations, Rel);
else
Relation_Sets.Delete (G.Relations, Rel);
end if;
end Set_Is_Existing_Source_Target_Relation;
------------------------
-- Set_IGE_Attributes --
------------------------
procedure Set_IGE_Attributes
(G : Invocation_Graph;
Edge : Invocation_Graph_Edge_Id;
Val : Invocation_Graph_Edge_Attributes)
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Edge));
IGE_Tables.Put (G.Edge_Attributes, Edge, Val);
end Set_IGE_Attributes;
------------------------
-- Set_IGV_Attributes --
------------------------
procedure Set_IGV_Attributes
(G : Invocation_Graph;
Vertex : Invocation_Graph_Vertex_Id;
Val : Invocation_Graph_Vertex_Attributes)
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
IGV_Tables.Put (G.Vertex_Attributes, Vertex, Val);
end Set_IGV_Attributes;
-----------------
-- Spec_Vertex --
-----------------
function Spec_Vertex
(G : Invocation_Graph;
Vertex : Invocation_Graph_Vertex_Id) return Library_Graph_Vertex_Id
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
return Get_IGV_Attributes (G, Vertex).Spec_Vertex;
end Spec_Vertex;
------------
-- Target --
------------
function Target
(G : Invocation_Graph;
Edge : Invocation_Graph_Edge_Id) return Invocation_Graph_Vertex_Id
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Edge));
return DG.Destination_Vertex (G.Graph, Edge);
end Target;
end Invocation_Graphs;
-------------
-- Present --
-------------
function Present (Edge : Invocation_Graph_Edge_Id) return Boolean is
begin
return Edge /= No_Invocation_Graph_Edge;
end Present;
-------------
-- Present --
-------------
function Present (Vertex : Invocation_Graph_Vertex_Id) return Boolean is
begin
return Vertex /= No_Invocation_Graph_Vertex;
end Present;
-------------
-- Present --
-------------
function Present (Cycle : Library_Graph_Cycle_Id) return Boolean is
begin
return Cycle /= No_Library_Graph_Cycle;
end Present;
-------------
-- Present --
-------------
function Present (Edge : Library_Graph_Edge_Id) return Boolean is
begin
return Edge /= No_Library_Graph_Edge;
end Present;
-------------
-- Present --
-------------
function Present (Vertex : Library_Graph_Vertex_Id) return Boolean is
begin
return Vertex /= No_Library_Graph_Vertex;
end Present;
--------------------------
-- Sequence_Next_Edge --
--------------------------
IGE_Sequencer : Invocation_Graph_Edge_Id := First_Invocation_Graph_Edge;
-- The counter for invocation graph edges. Do not directly manipulate its
-- value.
function Sequence_Next_Edge return Invocation_Graph_Edge_Id is
Edge : constant Invocation_Graph_Edge_Id := IGE_Sequencer;
begin
IGE_Sequencer := IGE_Sequencer + 1;
return Edge;
end Sequence_Next_Edge;
--------------------------
-- Sequence_Next_Vertex --
--------------------------
IGV_Sequencer : Invocation_Graph_Vertex_Id := First_Invocation_Graph_Vertex;
-- The counter for invocation graph vertices. Do not directly manipulate
-- its value.
function Sequence_Next_Vertex return Invocation_Graph_Vertex_Id is
Vertex : constant Invocation_Graph_Vertex_Id := IGV_Sequencer;
begin
IGV_Sequencer := IGV_Sequencer + 1;
return Vertex;
end Sequence_Next_Vertex;
--------------------------
-- Sequence_Next_Cycle --
--------------------------
LGC_Sequencer : Library_Graph_Cycle_Id := First_Library_Graph_Cycle;
-- The counter for library graph cycles. Do not directly manipulate its
-- value.
function Sequence_Next_Cycle return Library_Graph_Cycle_Id is
Cycle : constant Library_Graph_Cycle_Id := LGC_Sequencer;
begin
LGC_Sequencer := LGC_Sequencer + 1;
return Cycle;
end Sequence_Next_Cycle;
--------------------------
-- Sequence_Next_Edge --
--------------------------
LGE_Sequencer : Library_Graph_Edge_Id := First_Library_Graph_Edge;
-- The counter for library graph edges. Do not directly manipulate its
-- value.
function Sequence_Next_Edge return Library_Graph_Edge_Id is
Edge : constant Library_Graph_Edge_Id := LGE_Sequencer;
begin
LGE_Sequencer := LGE_Sequencer + 1;
return Edge;
end Sequence_Next_Edge;
--------------------------
-- Sequence_Next_Vertex --
--------------------------
LGV_Sequencer : Library_Graph_Vertex_Id := First_Library_Graph_Vertex;
-- The counter for library graph vertices. Do not directly manipulate its
-- value.
function Sequence_Next_Vertex return Library_Graph_Vertex_Id is
Vertex : constant Library_Graph_Vertex_Id := LGV_Sequencer;
begin
LGV_Sequencer := LGV_Sequencer + 1;
return Vertex;
end Sequence_Next_Vertex;
end Bindo.Graphs;
|
with AUnit.Assertions; use AUnit.Assertions;
with Ada.Containers.Vectors;
with Ada.Text_IO;
with DataBatch;
with MathUtils;
use MathUtils.Float_Vec;
package body DataBatchTests is
procedure Register_Tests (T: in out TestCase) is
use AUnit.Test_Cases.Registration;
begin
Register_Routine (T, testBasicBatch'Access, "batch");
end Register_Tests;
function Name(T: TestCase) return Test_String is
begin
return Format("Data Batch Tests");
end Name;
procedure testBasicBatch(T : in out Test_Cases.Test_Case'Class) is
b: DataBatch.Batch;
vec: MathUtils.Vector;
begin
Assert(b.size = 0, "size 0");
b.reserve(10);
Assert(b.size = 0, "size 0");
b.append(1.0 & 1.0 & 1.0);
Assert(b.size = 1, "size 1");
b.append(2.0 & 2.0 & 2.0);
b.append(3.0 & 3.0 & 3.0);
b.append(4.0 & 4.0 & 4.0);
Assert(b.size = 4, "size 4");
b.randomize;
Assert(b.contains(1.0 & 1.0 & 1.0), "");
Assert(b.contains(2.0 & 2.0 & 2.0), "");
Assert(b.contains(3.0 & 3.0 & 3.0), "");
Assert(b.contains(4.0 & 4.0 & 4.0), "");
end testBasicBatch;
end DataBatchTests;
|
pragma Assertion_Policy(Check);
package Discr40 is
subtype Element is Integer;
type Vector is array (Positive range <>) of Element;
type Stack (Max_Length : Natural) is
record
Length : Natural;
Data : Vector (1 .. Max_Length);
end record;
function Not_Full (S : Stack) return Boolean is
(S.Length < S.Max_Length);
procedure Push (S: in out Stack; E : Element)
with Pre => Not_Full(S), -- Precodition
Post => -- Postcondition
(S.Length = S'Old.Length + 1) and
(S.Data (S.Length) = E) and
(for all J in 1 .. S'Old.Length =>
S.Data(J) = S'Old.Data(J));
end Discr40;
|
pragma License (Unrestricted);
with Ada.IO_Exceptions;
with Ada.Text_IO;
package Ada.Wide_Wide_Text_IO is
-- modified
-- type File_Type is limited private;
subtype File_Type is Text_IO.File_Type;
-- AI12-0054-2, Text_IO (see A.10.1) could have used predicates to describe
-- some common exceptional conditions as follows:
-- subtype Open_File_Type is File_Type
-- with
-- Dynamic_Predicate => Is_Open (Open_File_Type),
-- Predicate_Failure => raise Status_Error with "File not open";
-- subtype Input_File_Type is Open_File_Type
-- with
-- Dynamic_Predicate => Mode (Input_File_Type) = In_File,
-- Predicate_Failure =>
-- raise Mode_Error with
-- "Cannot read file: " & Name (Input_File_Type);
-- subtype Output_File_Type is Open_File_Type
-- with
-- Dynamic_Predicate => Mode (Output_File_Type) /= In_File,
-- Predicate_Failure =>
-- raise Mode_Error with
-- "Cannot write file: " & Name (Output_File_Type);
-- type File_Mode is (In_File, Out_File, Append_File);
subtype File_Mode is Text_IO.File_Mode;
function In_File return File_Mode
renames Text_IO.In_File;
function Out_File return File_Mode
renames Text_IO.Out_File;
function Append_File return File_Mode
renames Text_IO.Append_File;
-- type Count is range 0 .. implementation-defined;
subtype Count is Text_IO.Count;
subtype Positive_Count is Count range 1 .. Count'Last;
Unbounded : constant Count := 0;
subtype Field is
Integer range 0 .. Text_IO.Field'Last; -- implementation-defined
subtype Number_Base is Integer range 2 .. 16;
-- type Type_Set is (Lower_Case, Upper_Case);
subtype Type_Set is Text_IO.Type_Set;
function Lower_Case return Type_Set
renames Text_IO.Lower_Case;
function Upper_Case return Type_Set
renames Text_IO.Upper_Case;
-- File Management
procedure Create (
File : in out File_Type;
Mode : File_Mode := Out_File;
Name : String := "";
Form : String := "")
renames Text_IO.Create;
procedure Open (
File : in out File_Type;
Mode : File_Mode;
Name : String;
Form : String := "")
renames Text_IO.Open;
procedure Close (File : in out File_Type)
renames Text_IO.Close;
procedure Delete (File : in out File_Type)
renames Text_IO.Delete;
procedure Reset (File : in out File_Type; Mode : File_Mode)
renames Text_IO.Reset;
procedure Reset (File : in out File_Type)
renames Text_IO.Reset;
function Mode (
File : File_Type) -- Open_File_Type
return File_Mode
renames Text_IO.Mode;
function Name (
File : File_Type) -- Open_File_Type
return String
renames Text_IO.Name;
function Form (
File : File_Type) -- Open_File_Type
return String
renames Text_IO.Form;
function Is_Open (File : File_Type) return Boolean
renames Text_IO.Is_Open;
-- Control of default input and output files
procedure Set_Input (File : File_Type)
renames Text_IO.Set_Input;
procedure Set_Output (File : File_Type)
renames Text_IO.Set_Output;
procedure Set_Error (File : File_Type)
renames Text_IO.Set_Error;
-- function Standard_Input return File_Type;
-- function Standard_Output return File_Type;
-- function Standard_Error return File_Type;
-- function Current_Input return File_Type;
-- function Current_Output return File_Type;
-- function Current_Error return File_Type;
-- type File_Access is access constant File_Type;
subtype File_Access is Text_IO.File_Access;
function Standard_Input return File_Access
renames Text_IO.Standard_Input;
function Standard_Output return File_Access
renames Text_IO.Standard_Output;
function Standard_Error return File_Access
renames Text_IO.Standard_Error;
function Current_Input return File_Access
renames Text_IO.Current_Input;
function Current_Output return File_Access
renames Text_IO.Current_Output;
function Current_Error return File_Access
renames Text_IO.Current_Error;
-- Buffer control
procedure Flush (
File : File_Type) -- Output_File_Type
renames Text_IO.Flush;
procedure Flush
renames Text_IO.Flush;
-- Specification of line and page lengths
procedure Set_Line_Length (
File : File_Type; -- Output_File_Type
To : Count)
renames Text_IO.Set_Line_Length;
procedure Set_Line_Length (To : Count)
renames Text_IO.Set_Line_Length;
procedure Set_Page_Length (
File : File_Type; -- Output_File_Type
To : Count)
renames Text_IO.Set_Page_Length;
procedure Set_Page_Length (To : Count)
renames Text_IO.Set_Page_Length;
function Line_Length (
File : File_Type) -- Output_File_Type
return Count
renames Text_IO.Line_Length;
function Line_Length return Count
renames Text_IO.Line_Length;
function Page_Length (
File : File_Type) -- Output_File_Type
return Count
renames Text_IO.Page_Length;
function Page_Length return Count
renames Text_IO.Page_Length;
-- Column, Line, and Page Control
procedure New_Line (
File : File_Type; -- Output_File_Type
Spacing : Positive_Count := 1)
renames Text_IO.New_Line;
procedure New_Line (Spacing : Positive_Count := 1)
renames Text_IO.New_Line;
procedure Skip_Line (
File : File_Type; -- Input_File_Type
Spacing : Positive_Count := 1)
renames Text_IO.Skip_Line;
procedure Skip_Line (Spacing : Positive_Count := 1)
renames Text_IO.Skip_Line;
function End_Of_Line (
File : File_Type) -- Input_File_Type
return Boolean
renames Text_IO.End_Of_Line;
function End_Of_Line return Boolean
renames Text_IO.End_Of_Line;
procedure New_Page (
File : File_Type) -- Output_File_Type
renames Text_IO.New_Page;
procedure New_Page
renames Text_IO.New_Page;
procedure Skip_Page (
File : File_Type) -- Input_File_Type
renames Text_IO.Skip_Page;
procedure Skip_Page
renames Text_IO.Skip_Page;
function End_Of_Page (
File : File_Type) -- Input_File_Type
return Boolean
renames Text_IO.End_Of_Page;
function End_Of_Page return Boolean
renames Text_IO.End_Of_Page;
function End_Of_File (
File : File_Type) -- Input_File_Type
return Boolean
renames Text_IO.End_Of_File;
function End_Of_File return Boolean
renames Text_IO.End_Of_File;
procedure Set_Col (
File : File_Type; -- Open_File_Type
To : Positive_Count)
renames Text_IO.Set_Col;
procedure Set_Col (To : Positive_Count)
renames Text_IO.Set_Col;
procedure Set_Line (
File : File_Type; -- Open_File_Type
To : Positive_Count)
renames Text_IO.Set_Line;
procedure Set_Line (To : Positive_Count)
renames Text_IO.Set_Line;
function Col (
File : File_Type) -- Open_File_Type
return Positive_Count
renames Text_IO.Col;
function Col return Positive_Count
renames Text_IO.Col;
function Line (
File : File_Type) -- Open_File_Type
return Positive_Count
renames Text_IO.Line;
function Line return Positive_Count
renames Text_IO.Line;
function Page (
File : File_Type) -- Open_File_Type
return Positive_Count
renames Text_IO.Page;
function Page return Positive_Count
renames Text_IO.Page;
-- Character Input-Output
procedure Get (
File : File_Type; -- Input_File_Type
Item : out Wide_Wide_Character)
renames Text_IO.Overloaded_Get;
procedure Get (Item : out Wide_Wide_Character)
renames Text_IO.Overloaded_Get;
procedure Put (
File : File_Type; -- Output_File_Type
Item : Wide_Wide_Character)
renames Text_IO.Overloaded_Put;
procedure Put (Item : Wide_Wide_Character)
renames Text_IO.Overloaded_Put;
procedure Look_Ahead (
File : File_Type; -- Input_File_Type
Item : out Wide_Wide_Character;
End_Of_Line : out Boolean)
renames Text_IO.Overloaded_Look_Ahead;
procedure Look_Ahead (
Item : out Wide_Wide_Character;
End_Of_Line : out Boolean)
renames Text_IO.Overloaded_Look_Ahead;
procedure Get_Immediate (
File : File_Type; -- Input_File_Type
Item : out Wide_Wide_Character)
renames Text_IO.Overloaded_Get_Immediate;
procedure Get_Immediate (Item : out Wide_Wide_Character)
renames Text_IO.Overloaded_Get_Immediate;
procedure Get_Immediate (
File : File_Type; -- Input_File_Type
Item : out Wide_Wide_Character;
Available : out Boolean)
renames Text_IO.Overloaded_Get_Immediate;
procedure Get_Immediate (
Item : out Wide_Wide_Character;
Available : out Boolean)
renames Text_IO.Overloaded_Get_Immediate;
-- String Input-Output
procedure Get (
File : File_Type; -- Input_File_Type
Item : out Wide_Wide_String)
renames Text_IO.Overloaded_Get;
procedure Get (Item : out Wide_Wide_String)
renames Text_IO.Overloaded_Get;
procedure Put (
File : File_Type; -- Output_File_Type
Item : Wide_Wide_String)
renames Text_IO.Overloaded_Put;
procedure Put (Item : Wide_Wide_String)
renames Text_IO.Overloaded_Put;
procedure Get_Line (
File : File_Type; -- Input_File_Type
Item : out Wide_Wide_String;
Last : out Natural)
renames Text_IO.Overloaded_Get_Line;
procedure Get_Line (
Item : out Wide_Wide_String;
Last : out Natural)
renames Text_IO.Overloaded_Get_Line;
function Get_Line (
File : File_Type) -- Input_File_Type
return Wide_Wide_String
renames Text_IO.Overloaded_Get_Line;
function Get_Line return Wide_Wide_String
renames Text_IO.Overloaded_Get_Line;
procedure Put_Line (
File : File_Type; -- Output_File_Type
Item : Wide_Wide_String)
renames Text_IO.Overloaded_Put_Line;
procedure Put_Line (Item : Wide_Wide_String)
renames Text_IO.Overloaded_Put_Line;
-- Generic packages for Input-Output of Integer Types
-- Generic packages for Input-Output of Real Types
-- Generic package for Input-Output of Enumeration Types
-- Note: Integer_IO, Modular_IO, Float_IO, Fixed_IO, Decimal_IO, and
-- Enumeration_IO are separated by compiler.
-- Exceptions
Status_Error : exception
renames IO_Exceptions.Status_Error;
Mode_Error : exception
renames IO_Exceptions.Mode_Error;
Name_Error : exception
renames IO_Exceptions.Name_Error;
Use_Error : exception
renames IO_Exceptions.Use_Error;
Device_Error : exception
renames IO_Exceptions.Device_Error;
End_Error : exception
renames IO_Exceptions.End_Error;
Data_Error : exception
renames IO_Exceptions.Data_Error;
Layout_Error : exception
renames IO_Exceptions.Layout_Error;
end Ada.Wide_Wide_Text_IO;
|
with Ada.Text_IO;
procedure CLS is
begin
Ada.Text_IO.Put(ASCII.ESC & "[2J");
end CLS;
|
pragma Ada_95;
pragma Warnings (Off);
pragma Source_File_Name (ada_main, Spec_File_Name => "b~unit.ads");
pragma Source_File_Name (ada_main, Body_File_Name => "b~unit.adb");
pragma Suppress (Overflow_Check);
package body ada_main is
E15 : Short_Integer; pragma Import (Ada, E15, "system__soft_links_E");
E25 : Short_Integer; pragma Import (Ada, E25, "system__exception_table_E");
E27 : Short_Integer; pragma Import (Ada, E27, "system__exceptions_E");
E19 : Short_Integer; pragma Import (Ada, E19, "system__secondary_stack_E");
E07 : Short_Integer; pragma Import (Ada, E07, "interfaces__c_E");
E02 : Short_Integer; pragma Import (Ada, E02, "unit_E");
Local_Priority_Specific_Dispatching : constant String := "";
Local_Interrupt_States : constant String := "";
Is_Elaborated : Boolean := False;
procedure adafinal is
procedure s_stalib_adafinal;
pragma Import (C, s_stalib_adafinal, "system__standard_library__adafinal");
procedure Runtime_Finalize;
pragma Import (C, Runtime_Finalize, "__gnat_runtime_finalize");
begin
if not Is_Elaborated then
return;
end if;
Is_Elaborated := False;
Runtime_Finalize;
s_stalib_adafinal;
end adafinal;
type No_Param_Proc is access procedure;
procedure adainit is
Main_Priority : Integer;
pragma Import (C, Main_Priority, "__gl_main_priority");
Time_Slice_Value : Integer;
pragma Import (C, Time_Slice_Value, "__gl_time_slice_val");
WC_Encoding : Character;
pragma Import (C, WC_Encoding, "__gl_wc_encoding");
Locking_Policy : Character;
pragma Import (C, Locking_Policy, "__gl_locking_policy");
Queuing_Policy : Character;
pragma Import (C, Queuing_Policy, "__gl_queuing_policy");
Task_Dispatching_Policy : Character;
pragma Import (C, Task_Dispatching_Policy, "__gl_task_dispatching_policy");
Priority_Specific_Dispatching : System.Address;
pragma Import (C, Priority_Specific_Dispatching, "__gl_priority_specific_dispatching");
Num_Specific_Dispatching : Integer;
pragma Import (C, Num_Specific_Dispatching, "__gl_num_specific_dispatching");
Main_CPU : Integer;
pragma Import (C, Main_CPU, "__gl_main_cpu");
Interrupt_States : System.Address;
pragma Import (C, Interrupt_States, "__gl_interrupt_states");
Num_Interrupt_States : Integer;
pragma Import (C, Num_Interrupt_States, "__gl_num_interrupt_states");
Unreserve_All_Interrupts : Integer;
pragma Import (C, Unreserve_All_Interrupts, "__gl_unreserve_all_interrupts");
Detect_Blocking : Integer;
pragma Import (C, Detect_Blocking, "__gl_detect_blocking");
Default_Stack_Size : Integer;
pragma Import (C, Default_Stack_Size, "__gl_default_stack_size");
Leap_Seconds_Support : Integer;
pragma Import (C, Leap_Seconds_Support, "__gl_leap_seconds_support");
Bind_Env_Addr : System.Address;
pragma Import (C, Bind_Env_Addr, "__gl_bind_env_addr");
procedure Runtime_Initialize (Install_Handler : Integer);
pragma Import (C, Runtime_Initialize, "__gnat_runtime_initialize");
Finalize_Library_Objects : No_Param_Proc;
pragma Import (C, Finalize_Library_Objects, "__gnat_finalize_library_objects");
begin
if Is_Elaborated then
return;
end if;
Is_Elaborated := True;
Main_Priority := -1;
Time_Slice_Value := -1;
WC_Encoding := 'b';
Locking_Policy := ' ';
Queuing_Policy := ' ';
Task_Dispatching_Policy := ' ';
Priority_Specific_Dispatching :=
Local_Priority_Specific_Dispatching'Address;
Num_Specific_Dispatching := 0;
Main_CPU := -1;
Interrupt_States := Local_Interrupt_States'Address;
Num_Interrupt_States := 0;
Unreserve_All_Interrupts := 0;
Detect_Blocking := 0;
Default_Stack_Size := -1;
Leap_Seconds_Support := 0;
Runtime_Initialize (1);
Finalize_Library_Objects := null;
if E15 = 0 then
System.Soft_Links'Elab_Spec;
end if;
if E25 = 0 then
System.Exception_Table'Elab_Body;
end if;
E25 := E25 + 1;
if E27 = 0 then
System.Exceptions'Elab_Spec;
end if;
E27 := E27 + 1;
if E15 = 0 then
System.Soft_Links'Elab_Body;
end if;
E15 := E15 + 1;
if E19 = 0 then
System.Secondary_Stack'Elab_Body;
end if;
E19 := E19 + 1;
if E07 = 0 then
Interfaces.C'Elab_Spec;
end if;
E07 := E07 + 1;
E02 := E02 + 1;
end adainit;
-- BEGIN Object file/option list
-- ./unit.o
-- -L./
-- -L/usr/lib/gcc/x86_64-linux-gnu/7/adalib/
-- -shared
-- -lgnat-7
-- END Object file/option list
end ada_main;
|
-----------------------------------------------------------------------
-- util-commands-tests - Test for commands
-- Copyright (C) 2018, 2019, 2020 Stephane Carrez
-- Written by Stephane Carrez (Stephane.Carrez@gmail.com)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with GNAT.Command_Line;
with Util.Test_Caller;
with Util.Commands.Parsers.GNAT_Parser;
with Util.Commands.Drivers;
package body Util.Commands.Tests is
package Caller is new Util.Test_Caller (Test, "Commands");
type Test_Context_Type is record
Number : Integer;
Success : Boolean := False;
end record;
package Test_Command is new
Util.Commands.Drivers (Context_Type => Test_Context_Type,
Config_Parser => Util.Commands.Parsers.GNAT_Parser.Config_Parser,
Driver_Name => "test");
type Test_Command_Type is new Test_Command.Command_Type with record
Opt_Count : aliased Integer := 0;
Opt_V : aliased Boolean := False;
Opt_N : aliased Boolean := False;
Expect_V : Boolean := False;
Expect_N : Boolean := False;
Expect_C : Integer := 0;
Expect_A : Integer := 0;
Expect_Help : Boolean := False;
end record;
overriding
procedure Execute (Command : in out Test_Command_Type;
Name : in String;
Args : in Argument_List'Class;
Context : in out Test_Context_Type);
-- Setup the command before parsing the arguments and executing it.
procedure Setup (Command : in out Test_Command_Type;
Config : in out GNAT.Command_Line.Command_Line_Configuration;
Context : in out Test_Context_Type);
-- Write the help associated with the command.
procedure Help (Command : in out Test_Command_Type;
Name : in String;
Context : in out Test_Context_Type);
procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite) is
begin
Caller.Add_Test (Suite, "Test Util.Commands.Driver.Execute",
Test_Execute'Access);
Caller.Add_Test (Suite, "Test Util.Commands.Driver.Help",
Test_Help'Access);
Caller.Add_Test (Suite, "Test Util.Commands.Driver.Usage",
Test_Usage'Access);
end Add_Tests;
overriding
procedure Execute (Command : in out Test_Command_Type;
Name : in String;
Args : in Argument_List'Class;
Context : in out Test_Context_Type) is
pragma Unreferenced (Name);
begin
Context.Success := Command.Opt_Count = Command.Expect_C and
Command.Opt_V = Command.Expect_V and
Command.Opt_N = Command.Expect_N and
Args.Get_Count = Command.Expect_A and
not Command.Expect_Help;
end Execute;
-- ------------------------------
-- Setup the command before parsing the arguments and executing it.
-- ------------------------------
procedure Setup (Command : in out Test_Command_Type;
Config : in out GNAT.Command_Line.Command_Line_Configuration;
Context : in out Test_Context_Type) is
pragma Unreferenced (Context);
begin
GNAT.Command_Line.Define_Switch (Config => Config,
Switch => "-c:",
Long_Switch => "--count=",
Help => "Number option",
Section => "",
Initial => Integer (0),
Default => Integer (10),
Output => Command.Opt_Count'Access);
GNAT.Command_Line.Define_Switch (Config => Config,
Switch => "-v",
Long_Switch => "--verbose",
Help => "Verbose option",
Section => "",
Output => Command.Opt_V'Access);
GNAT.Command_Line.Define_Switch (Config => Config,
Switch => "-n",
Long_Switch => "--not",
Help => "Not option",
Section => "",
Output => Command.Opt_N'Access);
end Setup;
-- ------------------------------
-- Write the help associated with the command.
-- ------------------------------
procedure Help (Command : in out Test_Command_Type;
Name : in String;
Context : in out Test_Context_Type) is
pragma Unreferenced (Name);
begin
Context.Success := Command.Expect_Help;
end Help;
-- ------------------------------
-- Tests when the execution of commands.
-- ------------------------------
procedure Test_Execute (T : in out Test) is
C1 : aliased Test_Command_Type;
C2 : aliased Test_Command_Type;
D : Test_Command.Driver_Type;
Args : String_Argument_List (500, 30);
begin
D.Set_Description ("Test command");
D.Add_Command ("list", C1'Unchecked_Access);
D.Add_Command ("print", C2'Unchecked_Access);
declare
Ctx : Test_Context_Type;
begin
C1.Expect_V := True;
C1.Expect_N := True;
C1.Expect_C := 4;
C1.Expect_A := 2;
Initialize (Args, "list --count=4 -v -n test titi");
D.Execute ("list", Args, Ctx);
T.Assert (Ctx.Success, "Some arguments not parsed correctly");
end;
declare
Ctx : Test_Context_Type;
begin
C1.Expect_V := False;
C1.Expect_N := True;
C1.Expect_C := 8;
C1.Expect_A := 3;
Initialize (Args, "list -c 8 -n test titi last");
D.Execute ("list", Args, Ctx);
T.Assert (Ctx.Success, "Some arguments not parsed correctly");
end;
end Test_Execute;
-- ------------------------------
-- Test execution of help.
-- ------------------------------
procedure Test_Help (T : in out Test) is
C1 : aliased Test_Command_Type;
C2 : aliased Test_Command_Type;
H : aliased Test_Command.Help_Command_Type;
D : Test_Command.Driver_Type;
Args : String_Argument_List (500, 30);
begin
D.Set_Description ("Test command");
D.Add_Command ("list", C1'Unchecked_Access);
D.Add_Command ("print", C2'Unchecked_Access);
D.Add_Command ("help", H'Unchecked_Access);
declare
Ctx : Test_Context_Type;
begin
C1.Expect_Help := True;
Initialize (Args, "help list");
D.Execute ("help", Args, Ctx);
T.Assert (Ctx.Success, "Some arguments not parsed correctly");
end;
declare
Ctx : Test_Context_Type;
begin
C2.Expect_Help := True;
Initialize (Args, "help print");
D.Execute ("help", Args, Ctx);
T.Assert (Ctx.Success, "Some arguments not parsed correctly");
end;
declare
Ctx : Test_Context_Type;
begin
C1.Expect_Help := False;
C2.Expect_Help := False;
Initialize (Args, "help");
D.Execute ("help", Args, Ctx);
T.Assert (not Ctx.Success, "Some arguments not parsed correctly");
end;
declare
Ctx : Test_Context_Type;
begin
Initialize (Args, "help missing");
D.Execute ("help", Args, Ctx);
T.Fail ("No exception raised for missing command");
exception
when Not_Found =>
null;
end;
end Test_Help;
-- ------------------------------
-- Test usage operation.
-- ------------------------------
procedure Test_Usage (T : in out Test) is
C1 : aliased Test_Command_Type;
C2 : aliased Test_Command_Type;
H : aliased Test_Command.Help_Command_Type;
D : Test_Command.Driver_Type;
Args : String_Argument_List (500, 30);
begin
D.Set_Description ("Test command");
D.Add_Command ("list", C1'Unchecked_Access);
D.Add_Command ("print", C2'Unchecked_Access);
D.Add_Command ("help", H'Unchecked_Access);
Args.Initialize (Line => "cmd list");
declare
Ctx : Test_Context_Type;
begin
D.Usage (Args, Ctx);
C1.Expect_Help := True;
Initialize (Args, "help list");
D.Execute ("help", Args, Ctx);
T.Assert (Ctx.Success, "Some arguments not parsed correctly");
D.Usage (Args, Ctx, "list");
end;
end Test_Usage;
end Util.Commands.Tests;
|
-- Project: StratoX
-- System: Stratosphere Balloon Flight Controller
-- Author: Martin Becker (becker@rcs.ei.tum.de)
with FAT_Filesystem; use FAT_Filesystem;
with FAT_Filesystem.Directories; use FAT_Filesystem.Directories;
with FAT_Filesystem.Directories.Files; use FAT_Filesystem.Directories.Files;
with Media_Reader.SDCard; use Media_Reader.SDCard;
-- @summary top-level package for reading/writing to SD card
-- minimal package with pointer stuff
package body SDLog with SPARK_Mode => Off is
SD_Controller : aliased SDCard_Controller; -- limited type
FS : FAT_Filesystem_Access := null; -- pointer
fh_log : FAT_Filesystem.Directories.Files.File_Handle;
-----------
-- Close --
-----------
procedure Close is
begin
Close (FS);
log_open := False;
end Close;
----------
-- Init --
----------
procedure Init is
Status : FAT_Filesystem.Status_Code;
begin
SD_Initialized := False;
log_open := False;
SD_Controller.Initialize;
if not SD_Controller.Card_Present then
Error_State := True;
return;
else
Error_State := False;
end if;
FS := Open (SD_Controller'Unchecked_Access, Status);
if Status /= OK then
Error_State := True;
return;
else
SD_Initialized := True;
end if;
end Init;
-------------------
-- Start_Logfile --
-------------------
-- creates a new directory within root, that is named
-- after the build.
procedure Start_Logfile
(dirname : String;
filename : String;
ret : out Boolean)
is
Hnd_Root : Directory_Handle;
Status : Status_Code;
Log_Dir : Directory_Entry;
Log_Hnd : Directory_Handle;
begin
ret := False;
if (not SD_Initialized) or Error_State then
return;
end if;
if Open_Root_Directory (FS, Hnd_Root) /= OK then
Error_State := True;
return;
end if;
-- 1. create log directory
Status := Make_Directory (Parent => Hnd_Root,
newname => dirname,
D_Entry => Log_Dir);
if Status /= OK and then Status /= Already_Exists
then
return;
end if;
Close (Hnd_Root);
Status := Open (E => Log_Dir, Dir => Log_Hnd);
if Status /= OK then
return;
end if;
-- 2. create log file
Status := File_Create (Parent => Log_Hnd,
newname => filename,
File => fh_log);
if Status /= OK then
return;
end if;
ret := True;
log_open := True;
end Start_Logfile;
---------------
-- Flush_Log --
---------------
procedure Flush_Log is
begin
if not log_open then
return;
end if;
declare
Status : Status_Code := File_Flush (fh_log);
pragma Unreferenced (Status);
begin
null;
end;
end Flush_Log;
---------------
-- Write_Log --
---------------
procedure Write_Log
(Data : FAT_Filesystem.Directories.Files.File_Data;
n_written : out Integer) is
begin
if not log_open then
n_written := -1;
return;
end if;
declare
DISCARD : Status_Code;
begin
n_written := File_Write
(File => fh_log, Data => Data, Status => DISCARD);
end;
end Write_Log;
procedure Write_Log (S : String; n_written : out Integer) is
d : File_Data renames To_File_Data (S);
begin
Write_Log (d, n_written);
end Write_Log;
------------------
-- To_File_Data --
------------------
function To_File_Data
(S : String) return FAT_Filesystem.Directories.Files.File_Data
is
d : File_Data (1 .. S'Length);
idx : Unsigned_16 := d'First;
begin
-- FIXME: inefficient
for k in S'Range loop
d (idx) := Character'Pos (S (k));
idx := idx + 1;
end loop;
return d; -- this throws an exception.
end To_File_Data;
function Is_Open return Boolean is (log_open);
function Logsize return Unsigned_32 is (File_Size (fh_log));
end SDLog;
|
generic
type Data is private;
package Iface1 is
type Future is synchronized interface;
type Any_Future is access all Future;
procedure Get (This : in out Future; P : out Data) is abstract;
procedure Set (This : in out Future; P : in Data) is abstract;
type Reusable_Future is synchronized interface and Future;
type Any_Reusable_Future is access all Reusable_Future'Class;
end Iface1;
|
with
AdaM.Any,
ada.Streams,
ada.Tags;
package AdaM.Factory
--
-- Provides persistent pointers.
--
--
-- Example:
--
-- package Subprogram
-- is
-- type Item is new Source.Entity with private;
-- type View is access all Item'Class;
--
-- private
-- ...
--
-- procedure View_write (Stream : not null access Ada.Streams.Root_Stream_Type'Class;
-- Self : in View);
--
-- procedure View_read (Stream : not null access Ada.Streams.Root_Stream_Type'Class;
-- Self : out View);
--
-- for View'write use View_write;
-- for View'read use View_read;
-- end Subprogram;
--
--
-- package body Subprogram
-- is
-- record_Version : constant := 1;
-- max_Subprograms : constant := 5_000;
-- null_Subprogram : constant Subprogram.item := (Source.Entity with others => <>);
--
-- package Pool is new adam.Factory.Pools (".adam-store",
-- "subprograms",
-- max_Subprograms,
-- record_Version,
-- Subprogram.item,
-- Subprogram.view,
-- null_Subprogram);
--
-- procedure View_write (Stream : not null access Ada.Streams.Root_Stream_Type'Class;
-- Self : in View)
-- renames Pool.View_write;
--
-- procedure View_read (Stream : not null access Ada.Streams.Root_Stream_Type'Class;
-- Self : out View)
-- renames Pool.View_read;
-- end Subprogram;
--
--
-- procedure Test
-- is
-- the_Subprogram : Subprogram.view;
-- begin
-- adam.Factory.open;
--
-- if first_Run then
-- the_Subprogram := Pool.new_Item;
-- else
-- Subprogram.view'read (any_Stream, the_Subprogram);
-- end if;
--
-- Subprogram.view'write (any_Stream, the_Subprogram);
--
-- adam.Factory.close;
-- end Test;
--
--
-- The new subprogram will persist and the_Subprogram pointer can be streamed.
--
is
procedure open;
procedure close;
type Any_view is access all Any.Item'Class;
function to_View (Id : in AdaM.Id; Tag : in ada.Tags.Tag) return Any_view;
generic
storage_Folder : String;
pool_Name : String;
max_Items : Positive := 5_000;
record_Version : Positive;
type Item is new AdaM.Any.Item with private;
type View is access all Item'Class;
package Pools
is
function to_View (Id : in AdaM.Id) return View;
function to_Id (From : in View) return AdaM.Id;
function new_Item return View;
procedure free (Self : in out View);
procedure View_write (Stream : not null access Ada.Streams.Root_Stream_Type'Class;
Self : in View);
procedure View_read (Stream : not null access Ada.Streams.Root_Stream_Type'Class;
Self : out View);
function storage_record_Version return Positive;
end Pools;
end AdaM.Factory;
|
-- { dg-do compile }
pragma Warnings (Off);
with Ada.Containers.Doubly_Linked_Lists;
with Ada.Containers.Hashed_Maps;
with Ada.Containers.Hashed_Sets;
with Ada.Containers.Indefinite_Doubly_Linked_Lists;
with Ada.Containers.Indefinite_Hashed_Maps;
with Ada.Containers.Indefinite_Hashed_Sets;
with Ada.Containers.Indefinite_Ordered_Maps;
with Ada.Containers.Indefinite_Ordered_Multisets;
with Ada.Containers.Indefinite_Ordered_Sets;
with Ada.Containers.Indefinite_Vectors;
with Ada.Containers.Ordered_Maps;
with Ada.Containers.Ordered_Multisets;
with Ada.Containers.Ordered_Sets;
with Ada.Containers.Prime_Numbers;
with Ada.Containers.Red_Black_Trees.Generic_Keys;
with Ada.Containers.Red_Black_Trees.Generic_Operations;
with Ada.Containers.Red_Black_Trees.Generic_Set_Operations;
with Ada.Containers.Red_Black_Trees;
with Ada.Containers.Restricted_Doubly_Linked_Lists;
with Ada.Containers.Vectors;
package With_Containers is
pragma Remote_Types;
end With_Containers;
|
-- This package has been generated automatically by GNATtest.
-- You are allowed to add your code to the bodies of test routines.
-- Such changes will be kept during further regeneration of this file.
-- All code placed outside of test routine bodies will be lost. The
-- code intended to set up and tear down the test environment should be
-- placed into Tcl.Test_Data.
with AUnit.Assertions; use AUnit.Assertions;
with System.Assertions;
-- begin read only
-- id:2.2/00/
--
-- This section can be used to add with clauses if necessary.
--
-- end read only
with GNAT.Directory_Operations; use GNAT.Directory_Operations;
-- begin read only
-- end read only
package body Tcl.Test_Data.Tests is
-- begin read only
-- id:2.2/01/
--
-- This section can be used to add global variables and other elements.
--
-- end read only
-- begin read only
-- end read only
-- begin read only
procedure Wrap_Test_Tcl_Eval_6f41cd_5b9cd5
(Tcl_Script: String; Interpreter: Tcl_Interpreter := Get_Interpreter) is
begin
begin
pragma Assert
(Tcl_Script'Length > 0 and Interpreter /= Null_Interpreter);
null;
exception
when System.Assertions.Assert_Failure =>
AUnit.Assertions.Assert
(False,
"req_sloc(tcl.ads:0):Test_Tcl_Eval test requirement violated");
end;
GNATtest_Generated.GNATtest_Standard.Tcl.Tcl_Eval
(Tcl_Script, Interpreter);
begin
pragma Assert(True);
null;
exception
when System.Assertions.Assert_Failure =>
AUnit.Assertions.Assert
(False,
"ens_sloc(tcl.ads:0:):Test_Tcl_Eval test commitment violated");
end;
end Wrap_Test_Tcl_Eval_6f41cd_5b9cd5;
-- end read only
-- begin read only
procedure Test_1_Tcl_Eval_test_tcl_eval(Gnattest_T: in out Test);
procedure Test_Tcl_Eval_6f41cd_5b9cd5(Gnattest_T: in out Test) renames
Test_1_Tcl_Eval_test_tcl_eval;
-- id:2.2/6f41cdb0dd725e03/Tcl_Eval/1/0/test_tcl_eval/
procedure Test_1_Tcl_Eval_test_tcl_eval(Gnattest_T: in out Test) is
procedure Tcl_Eval
(Tcl_Script: String;
Interpreter: Tcl_Interpreter := Get_Interpreter) renames
Wrap_Test_Tcl_Eval_6f41cd_5b9cd5;
-- end read only
pragma Unreferenced(Gnattest_T);
begin
Tcl_Eval("expr 2 + 2");
Assert(Tcl_Get_Result = "4", "Failed to evaluate Tcl code.");
-- begin read only
end Test_1_Tcl_Eval_test_tcl_eval;
-- end read only
-- begin read only
function Wrap_Test_Tcl_Eval_aa3c35_916b02
(Tcl_Script: String; Interpreter: Tcl_Interpreter := Get_Interpreter)
return Tcl_String_Result is
begin
begin
pragma Assert
(Tcl_Script'Length > 0 and Interpreter /= Null_Interpreter);
null;
exception
when System.Assertions.Assert_Failure =>
AUnit.Assertions.Assert
(False,
"req_sloc(tcl.ads:0):Test_Tcl_Eval2 test requirement violated");
end;
declare
Test_Tcl_Eval_aa3c35_916b02_Result: constant Tcl_String_Result :=
GNATtest_Generated.GNATtest_Standard.Tcl.Tcl_Eval
(Tcl_Script, Interpreter);
begin
begin
pragma Assert(True);
null;
exception
when System.Assertions.Assert_Failure =>
AUnit.Assertions.Assert
(False,
"ens_sloc(tcl.ads:0:):Test_Tcl_Eval2 test commitment violated");
end;
return Test_Tcl_Eval_aa3c35_916b02_Result;
end;
end Wrap_Test_Tcl_Eval_aa3c35_916b02;
-- end read only
-- begin read only
procedure Test_2_Tcl_Eval_test_tcl_eval2(Gnattest_T: in out Test);
procedure Test_Tcl_Eval_aa3c35_916b02(Gnattest_T: in out Test) renames
Test_2_Tcl_Eval_test_tcl_eval2;
-- id:2.2/aa3c355d19bf848c/Tcl_Eval/0/0/test_tcl_eval2/
procedure Test_2_Tcl_Eval_test_tcl_eval2(Gnattest_T: in out Test) is
function Tcl_Eval
(Tcl_Script: String; Interpreter: Tcl_Interpreter := Get_Interpreter)
return Tcl_String_Result renames
Wrap_Test_Tcl_Eval_aa3c35_916b02;
-- end read only
pragma Unreferenced(Gnattest_T);
begin
Assert
(Tcl_Eval("expr 2 + 5").Result = "7",
"Failed to evaluate and get result of Tcl code.");
-- begin read only
end Test_2_Tcl_Eval_test_tcl_eval2;
-- end read only
-- begin read only
function Wrap_Test_Tcl_Eval_991647_19bef1
(Tcl_Script: String; Interpreter: Tcl_Interpreter := Get_Interpreter)
return Tcl_Boolean_Result is
begin
begin
pragma Assert
(Tcl_Script'Length > 0 and Interpreter /= Null_Interpreter);
null;
exception
when System.Assertions.Assert_Failure =>
AUnit.Assertions.Assert
(False,
"req_sloc(tcl.ads:0):Test_Tcl_Eval3 test requirement violated");
end;
declare
Test_Tcl_Eval_991647_19bef1_Result: constant Tcl_Boolean_Result :=
GNATtest_Generated.GNATtest_Standard.Tcl.Tcl_Eval
(Tcl_Script, Interpreter);
begin
begin
pragma Assert(True);
null;
exception
when System.Assertions.Assert_Failure =>
AUnit.Assertions.Assert
(False,
"ens_sloc(tcl.ads:0:):Test_Tcl_Eval3 test commitment violated");
end;
return Test_Tcl_Eval_991647_19bef1_Result;
end;
end Wrap_Test_Tcl_Eval_991647_19bef1;
-- end read only
-- begin read only
procedure Test_3_Tcl_Eval_test_tcl_eval3(Gnattest_T: in out Test);
procedure Test_Tcl_Eval_991647_19bef1(Gnattest_T: in out Test) renames
Test_3_Tcl_Eval_test_tcl_eval3;
-- id:2.2/9916475f68961448/Tcl_Eval/0/0/test_tcl_eval3/
procedure Test_3_Tcl_Eval_test_tcl_eval3(Gnattest_T: in out Test) is
function Tcl_Eval
(Tcl_Script: String; Interpreter: Tcl_Interpreter := Get_Interpreter)
return Tcl_Boolean_Result renames
Wrap_Test_Tcl_Eval_991647_19bef1;
-- end read only
pragma Unreferenced(Gnattest_T);
begin
Assert
(not Tcl_Eval("info exists asdfervariable").Result,
"Failed to get boolean value of Tcl command.");
-- begin read only
end Test_3_Tcl_Eval_test_tcl_eval3;
-- end read only
-- begin read only
function Wrap_Test_Tcl_Eval_a72eed_9dbc2f
(Tcl_Script: String; Interpreter: Tcl_Interpreter := Get_Interpreter)
return Tcl_Integer_Result is
begin
begin
pragma Assert
(Tcl_Script'Length > 0 and Interpreter /= Null_Interpreter);
null;
exception
when System.Assertions.Assert_Failure =>
AUnit.Assertions.Assert
(False,
"req_sloc(tcl.ads:0):Test_Tcl_Eval4 test requirement violated");
end;
declare
Test_Tcl_Eval_a72eed_9dbc2f_Result: constant Tcl_Integer_Result :=
GNATtest_Generated.GNATtest_Standard.Tcl.Tcl_Eval
(Tcl_Script, Interpreter);
begin
begin
pragma Assert(True);
null;
exception
when System.Assertions.Assert_Failure =>
AUnit.Assertions.Assert
(False,
"ens_sloc(tcl.ads:0:):Test_Tcl_Eval4 test commitment violated");
end;
return Test_Tcl_Eval_a72eed_9dbc2f_Result;
end;
end Wrap_Test_Tcl_Eval_a72eed_9dbc2f;
-- end read only
-- begin read only
procedure Test_4_Tcl_Eval_test_tcl_eval4(Gnattest_T: in out Test);
procedure Test_Tcl_Eval_a72eed_9dbc2f(Gnattest_T: in out Test) renames
Test_4_Tcl_Eval_test_tcl_eval4;
-- id:2.2/a72eedb15fa1e475/Tcl_Eval/0/0/test_tcl_eval4/
procedure Test_4_Tcl_Eval_test_tcl_eval4(Gnattest_T: in out Test) is
function Tcl_Eval
(Tcl_Script: String; Interpreter: Tcl_Interpreter := Get_Interpreter)
return Tcl_Integer_Result renames
Wrap_Test_Tcl_Eval_a72eed_9dbc2f;
-- end read only
pragma Unreferenced(Gnattest_T);
begin
Assert
(Tcl_Eval("expr 2 + 2").Result = 4,
"Failed to get Integer value of Tcl command.");
-- begin read only
end Test_4_Tcl_Eval_test_tcl_eval4;
-- end read only
-- begin read only
function Wrap_Test_Tcl_Eval_629595_f7c23b
(Tcl_Script: String; Interpreter: Tcl_Interpreter := Get_Interpreter)
return Tcl_Float_Result is
begin
begin
pragma Assert
(Tcl_Script'Length > 0 and Interpreter /= Null_Interpreter);
null;
exception
when System.Assertions.Assert_Failure =>
AUnit.Assertions.Assert
(False,
"req_sloc(tcl.ads:0):Test_Tcl_Eval5 test requirement violated");
end;
declare
Test_Tcl_Eval_629595_f7c23b_Result: constant Tcl_Float_Result :=
GNATtest_Generated.GNATtest_Standard.Tcl.Tcl_Eval
(Tcl_Script, Interpreter);
begin
begin
pragma Assert(True);
null;
exception
when System.Assertions.Assert_Failure =>
AUnit.Assertions.Assert
(False,
"ens_sloc(tcl.ads:0:):Test_Tcl_Eval5 test commitment violated");
end;
return Test_Tcl_Eval_629595_f7c23b_Result;
end;
end Wrap_Test_Tcl_Eval_629595_f7c23b;
-- end read only
-- begin read only
procedure Test_5_Tcl_Eval_test_tcl_eval5(Gnattest_T: in out Test);
procedure Test_Tcl_Eval_629595_f7c23b(Gnattest_T: in out Test) renames
Test_5_Tcl_Eval_test_tcl_eval5;
-- id:2.2/629595d58c48dc53/Tcl_Eval/0/0/test_tcl_eval5/
procedure Test_5_Tcl_Eval_test_tcl_eval5(Gnattest_T: in out Test) is
function Tcl_Eval
(Tcl_Script: String; Interpreter: Tcl_Interpreter := Get_Interpreter)
return Tcl_Float_Result renames
Wrap_Test_Tcl_Eval_629595_f7c23b;
-- end read only
pragma Unreferenced(Gnattest_T);
begin
Assert
(Tcl_Eval("expr 2.5 + 2.2").Result = 4.7,
"Failed to get Float value of Tcl command.");
-- begin read only
end Test_5_Tcl_Eval_test_tcl_eval5;
-- end read only
-- begin read only
function Wrap_Test_Tcl_Eval_File_54cee0_9ae206
(File_Name: String; Interpreter: Tcl_Interpreter := Get_Interpreter)
return Tcl_Results is
begin
begin
pragma Assert
(File_Name'Length > 0 and Interpreter /= Null_Interpreter);
null;
exception
when System.Assertions.Assert_Failure =>
AUnit.Assertions.Assert
(False,
"req_sloc(tcl.ads:0):Test_Tcl_Eval_File test requirement violated");
end;
declare
Test_Tcl_Eval_File_54cee0_9ae206_Result: constant Tcl_Results :=
GNATtest_Generated.GNATtest_Standard.Tcl.Tcl_Eval_File
(File_Name, Interpreter);
begin
begin
pragma Assert(True);
null;
exception
when System.Assertions.Assert_Failure =>
AUnit.Assertions.Assert
(False,
"ens_sloc(tcl.ads:0:):Test_Tcl_Eval_File test commitment violated");
end;
return Test_Tcl_Eval_File_54cee0_9ae206_Result;
end;
end Wrap_Test_Tcl_Eval_File_54cee0_9ae206;
-- end read only
-- begin read only
procedure Test_Tcl_Eval_File_test_tcl_eval_file(Gnattest_T: in out Test);
procedure Test_Tcl_Eval_File_54cee0_9ae206(Gnattest_T: in out Test) renames
Test_Tcl_Eval_File_test_tcl_eval_file;
-- id:2.2/54cee041219047c4/Tcl_Eval_File/1/0/test_tcl_eval_file/
procedure Test_Tcl_Eval_File_test_tcl_eval_file(Gnattest_T: in out Test) is
function Tcl_Eval_File
(File_Name: String; Interpreter: Tcl_Interpreter := Get_Interpreter)
return Tcl_Results renames
Wrap_Test_Tcl_Eval_File_54cee0_9ae206;
-- end read only
pragma Unreferenced(Gnattest_T);
begin
if Tcl_Eval_File(".." & Dir_Separator & "test.tcl") = TCL_ERROR then
Assert(False, "Can't evaluate file as Tcl script.");
end if;
Assert(True, "This test can only crash.");
-- begin read only
end Test_Tcl_Eval_File_test_tcl_eval_file;
-- end read only
-- begin read only
function Wrap_Test_Tcl_Get_Result_9a7ac3_b83d43
(Interpreter: Tcl_Interpreter := Get_Interpreter) return String is
begin
begin
pragma Assert(Interpreter /= Null_Interpreter);
null;
exception
when System.Assertions.Assert_Failure =>
AUnit.Assertions.Assert
(False,
"req_sloc(tcl.ads:0):Test_Tcl_GetResult test requirement violated");
end;
declare
Test_Tcl_Get_Result_9a7ac3_b83d43_Result: constant String :=
GNATtest_Generated.GNATtest_Standard.Tcl.Tcl_Get_Result
(Interpreter);
begin
begin
pragma Assert(True);
null;
exception
when System.Assertions.Assert_Failure =>
AUnit.Assertions.Assert
(False,
"ens_sloc(tcl.ads:0:):Test_Tcl_GetResult test commitment violated");
end;
return Test_Tcl_Get_Result_9a7ac3_b83d43_Result;
end;
end Wrap_Test_Tcl_Get_Result_9a7ac3_b83d43;
-- end read only
-- begin read only
procedure Test_1_Tcl_Get_Result_test_tcl_getresult(Gnattest_T: in out Test);
procedure Test_Tcl_Get_Result_9a7ac3_b83d43(Gnattest_T: in out Test) renames
Test_1_Tcl_Get_Result_test_tcl_getresult;
-- id:2.2/9a7ac36b6f9d677a/Tcl_Get_Result/1/0/test_tcl_getresult/
procedure Test_1_Tcl_Get_Result_test_tcl_getresult
(Gnattest_T: in out Test) is
function Tcl_Get_Result
(Interpreter: Tcl_Interpreter := Get_Interpreter) return String renames
Wrap_Test_Tcl_Get_Result_9a7ac3_b83d43;
-- end read only
pragma Unreferenced(Gnattest_T);
begin
Tcl_Set_Result("2");
Assert(Tcl_Get_Result = "2", "Failed to get Tcl result as String");
-- begin read only
end Test_1_Tcl_Get_Result_test_tcl_getresult;
-- end read only
-- begin read only
function Wrap_Test_Tcl_Get_Result_8d4605_70ce85
(Interpreter: Tcl_Interpreter := Get_Interpreter) return Integer is
begin
begin
pragma Assert(Interpreter /= Null_Interpreter);
null;
exception
when System.Assertions.Assert_Failure =>
AUnit.Assertions.Assert
(False,
"req_sloc(tcl.ads:0):Test_Tcl_GetResult2 test requirement violated");
end;
declare
Test_Tcl_Get_Result_8d4605_70ce85_Result: constant Integer :=
GNATtest_Generated.GNATtest_Standard.Tcl.Tcl_Get_Result
(Interpreter);
begin
begin
pragma Assert(True);
null;
exception
when System.Assertions.Assert_Failure =>
AUnit.Assertions.Assert
(False,
"ens_sloc(tcl.ads:0:):Test_Tcl_GetResult2 test commitment violated");
end;
return Test_Tcl_Get_Result_8d4605_70ce85_Result;
end;
end Wrap_Test_Tcl_Get_Result_8d4605_70ce85;
-- end read only
-- begin read only
procedure Test_2_Tcl_Get_Result_test_tcl_getresult2
(Gnattest_T: in out Test);
procedure Test_Tcl_Get_Result_8d4605_70ce85(Gnattest_T: in out Test) renames
Test_2_Tcl_Get_Result_test_tcl_getresult2;
-- id:2.2/8d460597473cf5f0/Tcl_Get_Result/0/0/test_tcl_getresult2/
procedure Test_2_Tcl_Get_Result_test_tcl_getresult2
(Gnattest_T: in out Test) is
function Tcl_Get_Result
(Interpreter: Tcl_Interpreter := Get_Interpreter)
return Integer renames
Wrap_Test_Tcl_Get_Result_8d4605_70ce85;
-- end read only
pragma Unreferenced(Gnattest_T);
begin
Tcl_Set_Result("22");
Assert(Tcl_Get_Result = 22, "Failed to get Tcl result as Integer");
-- begin read only
end Test_2_Tcl_Get_Result_test_tcl_getresult2;
-- end read only
-- begin read only
function Wrap_Test_Tcl_Get_Result_040714_d18240
(Interpreter: Tcl_Interpreter := Get_Interpreter) return Float is
begin
begin
pragma Assert(Interpreter /= Null_Interpreter);
null;
exception
when System.Assertions.Assert_Failure =>
AUnit.Assertions.Assert
(False,
"req_sloc(tcl.ads:0):Test_Tcl_GetResult3 test requirement violated");
end;
declare
Test_Tcl_Get_Result_040714_d18240_Result: constant Float :=
GNATtest_Generated.GNATtest_Standard.Tcl.Tcl_Get_Result
(Interpreter);
begin
begin
pragma Assert(True);
null;
exception
when System.Assertions.Assert_Failure =>
AUnit.Assertions.Assert
(False,
"ens_sloc(tcl.ads:0:):Test_Tcl_GetResult3 test commitment violated");
end;
return Test_Tcl_Get_Result_040714_d18240_Result;
end;
end Wrap_Test_Tcl_Get_Result_040714_d18240;
-- end read only
-- begin read only
procedure Test_3_Tcl_Get_Result_test_tcl_getresult3
(Gnattest_T: in out Test);
procedure Test_Tcl_Get_Result_040714_d18240(Gnattest_T: in out Test) renames
Test_3_Tcl_Get_Result_test_tcl_getresult3;
-- id:2.2/040714248a32a2ad/Tcl_Get_Result/0/0/test_tcl_getresult3/
procedure Test_3_Tcl_Get_Result_test_tcl_getresult3
(Gnattest_T: in out Test) is
function Tcl_Get_Result
(Interpreter: Tcl_Interpreter := Get_Interpreter) return Float renames
Wrap_Test_Tcl_Get_Result_040714_d18240;
-- end read only
pragma Unreferenced(Gnattest_T);
begin
Tcl_Set_Result("2.2");
Assert(Tcl_Get_Result = 2.2, "Failed to get Tcl result as Float");
-- begin read only
end Test_3_Tcl_Get_Result_test_tcl_getresult3;
-- end read only
-- begin read only
procedure Wrap_Test_Tcl_Set_Result_2e8975_cb8f85
(Tcl_Result: String; Result_Type: Result_Types := Default_Result_Type;
Interpreter: Tcl_Interpreter := Get_Interpreter) is
begin
begin
pragma Assert
(Tcl_Result'Length > 0 and Interpreter /= Null_Interpreter);
null;
exception
when System.Assertions.Assert_Failure =>
AUnit.Assertions.Assert
(False,
"req_sloc(tcl.ads:0):Test_Tcl_SetResult test requirement violated");
end;
GNATtest_Generated.GNATtest_Standard.Tcl.Tcl_Set_Result
(Tcl_Result, Result_Type, Interpreter);
begin
pragma Assert(True);
null;
exception
when System.Assertions.Assert_Failure =>
AUnit.Assertions.Assert
(False,
"ens_sloc(tcl.ads:0:):Test_Tcl_SetResult test commitment violated");
end;
end Wrap_Test_Tcl_Set_Result_2e8975_cb8f85;
-- end read only
-- begin read only
procedure Test_Tcl_Set_Result_test_tcl_setresult(Gnattest_T: in out Test);
procedure Test_Tcl_Set_Result_2e8975_cb8f85(Gnattest_T: in out Test) renames
Test_Tcl_Set_Result_test_tcl_setresult;
-- id:2.2/2e8975e68b3f48df/Tcl_Set_Result/1/0/test_tcl_setresult/
procedure Test_Tcl_Set_Result_test_tcl_setresult(Gnattest_T: in out Test) is
procedure Tcl_Set_Result
(Tcl_Result: String; Result_Type: Result_Types := Default_Result_Type;
Interpreter: Tcl_Interpreter := Get_Interpreter) renames
Wrap_Test_Tcl_Set_Result_2e8975_cb8f85;
-- end read only
pragma Unreferenced(Gnattest_T);
begin
Tcl_Set_Result("2");
Assert(Tcl_Get_Result = "2", "Failed to set Tcl result");
-- begin read only
end Test_Tcl_Set_Result_test_tcl_setresult;
-- end read only
-- begin read only
procedure Wrap_Test_Tcl_Update_7113e2_953c64
(Interpreter: Tcl_Interpreter := Get_Interpreter;
Idle_Tasks_Only: Boolean := False) is
begin
begin
pragma Assert(Interpreter /= Null_Interpreter);
null;
exception
when System.Assertions.Assert_Failure =>
AUnit.Assertions.Assert
(False,
"req_sloc(tcl.ads:0):Test_Tcl_Update test requirement violated");
end;
GNATtest_Generated.GNATtest_Standard.Tcl.Tcl_Update
(Interpreter, Idle_Tasks_Only);
begin
pragma Assert(True);
null;
exception
when System.Assertions.Assert_Failure =>
AUnit.Assertions.Assert
(False,
"ens_sloc(tcl.ads:0:):Test_Tcl_Update test commitment violated");
end;
end Wrap_Test_Tcl_Update_7113e2_953c64;
-- end read only
-- begin read only
procedure Test_Tcl_Update_test_tcl_update(Gnattest_T: in out Test);
procedure Test_Tcl_Update_7113e2_953c64(Gnattest_T: in out Test) renames
Test_Tcl_Update_test_tcl_update;
-- id:2.2/7113e27f42b016a5/Tcl_Update/1/0/test_tcl_update/
procedure Test_Tcl_Update_test_tcl_update(Gnattest_T: in out Test) is
procedure Tcl_Update
(Interpreter: Tcl_Interpreter := Get_Interpreter;
Idle_Tasks_Only: Boolean := False) renames
Wrap_Test_Tcl_Update_7113e2_953c64;
-- end read only
pragma Unreferenced(Gnattest_T);
begin
Tcl_Update;
Assert(True, "This test can only crash.");
-- begin read only
end Test_Tcl_Update_test_tcl_update;
-- end read only
-- begin read only
-- id:2.2/02/
--
-- This section can be used to add elaboration code for the global state.
--
begin
-- end read only
null;
-- begin read only
-- end read only
end Tcl.Test_Data.Tests;
|
-- CE2402A.ADA
-- Grant of Unlimited Rights
--
-- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
-- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
-- unlimited rights in the software and documentation contained herein.
-- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
-- this public release, the Government intends to confer upon all
-- recipients unlimited rights equal to those held by the Government.
-- These rights include rights to use, duplicate, release or disclose the
-- released technical data and computer software in whole or in part, in
-- any manner and for any purpose whatsoever, and to have or permit others
-- to do so.
--
-- DISCLAIMER
--
-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
-- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
-- PARTICULAR PURPOSE OF SAID MATERIAL.
--*
-- OBJECTIVE:
-- CHECK THAT READ, WRITE, INDEX, SET_INDEX, SIZE, AND
-- END_OF_FILE RAISE STATUS_ERROR WHEN APPLIED TO A NON-OPEN
-- DIRECT FILE. USE_ERROR IS NOT PERMITTED.
-- HISTORY:
-- ABW 08/17/82
-- SPS 09/16/82
-- SPS 11/09/82
-- JBG 08/30/83
-- EG 11/26/84
-- EG 06/04/85
-- GMT 08/03/87 CLARIFIED SOME OF THE FAILED MESSAGES, AND
-- REMOVED THE EXCEPTION FOR CONSTRAINT_ERROR.
WITH REPORT; USE REPORT;
WITH DIRECT_IO;
PROCEDURE CE2402A IS
PACKAGE DIR IS NEW DIRECT_IO (INTEGER);
USE DIR;
FILE1 : FILE_TYPE;
CNST : CONSTANT INTEGER := 101;
IVAL : INTEGER;
BOOL : BOOLEAN;
X_COUNT : COUNT;
P_COUNT : POSITIVE_COUNT;
BEGIN
TEST ("CE2402A","CHECK THAT READ, WRITE, INDEX, " &
"SET_INDEX, SIZE, AND END_OF_FILE " &
"RAISE STATUS_ERROR WHEN APPLIED " &
"A NON-OPEN DIRECT FILE");
BEGIN
WRITE (FILE1, CNST);
FAILED ("STATUS_ERROR WAS NOT RAISED ON WRITE - 1");
EXCEPTION
WHEN STATUS_ERROR =>
NULL;
WHEN USE_ERROR =>
FAILED ("USE_ERROR RAISED ON WRITE - 2");
WHEN OTHERS =>
FAILED ("UNEXPECTED EXCEPTION RAISED ON WRITE - 3");
END;
BEGIN
X_COUNT := SIZE (FILE1);
FAILED ("STATUS_ERROR NOT RAISED ON SIZE - 4");
EXCEPTION
WHEN STATUS_ERROR =>
NULL;
WHEN USE_ERROR =>
FAILED ("USE_ERROR RAISED ON SIZE - 5");
WHEN OTHERS =>
FAILED ("UNEXPECTED EXCEPTION RAISED ON SIZE - 6");
END;
BEGIN
BOOL := END_OF_FILE (FILE1);
FAILED ("STATUS_ERROR WAS NOT RAISED ON END_OF_FILE - 7");
EXCEPTION
WHEN STATUS_ERROR =>
NULL;
WHEN USE_ERROR =>
FAILED ("USE_ERROR RAISED ON END_OF_FILE - 8");
WHEN OTHERS =>
FAILED ("WRONG EXCEPTION RAISED ON END_OF_FILE - 9");
END;
BEGIN
P_COUNT := INDEX (FILE1);
FAILED ("STATUS_ERROR WAS NOT RAISED ON INDEX - 10");
EXCEPTION
WHEN STATUS_ERROR =>
NULL;
WHEN USE_ERROR =>
FAILED ("USE_ERROR RAISED ON INDEX - 11");
WHEN OTHERS =>
FAILED ("WRONG EXCEPTION RAISED ON INDEX - 12");
END;
BEGIN
READ (FILE1, IVAL);
FAILED ("STATUS_ERROR WAS NOT RAISED ON READ - 13");
EXCEPTION
WHEN STATUS_ERROR =>
NULL;
WHEN USE_ERROR =>
FAILED ("USE_ERROR RAISED ON READ - 14");
WHEN OTHERS =>
FAILED ("WRONG EXCEPTION RAISED ON READ - 15");
END;
DECLARE
ONE : POSITIVE_COUNT := POSITIVE_COUNT (IDENT_INT(1));
BEGIN
BEGIN
WRITE (FILE1, CNST, ONE);
FAILED ("STATUS_ERROR NOT RAISED ON WRITE - 16");
EXCEPTION
WHEN STATUS_ERROR =>
NULL;
WHEN USE_ERROR =>
FAILED ("USE_ERROR RAISED ON WRITE - 17");
WHEN OTHERS =>
FAILED ("WRONG EXCEPTION RAISED ON WRITE - 18");
END;
BEGIN
SET_INDEX (FILE1,ONE);
FAILED ("STATUS_ERROR NOT RAISED ON SET_INDEX - 19");
EXCEPTION
WHEN STATUS_ERROR =>
NULL;
WHEN USE_ERROR =>
FAILED ("USE_ERROR RAISED ON SET_INDEX - 20");
WHEN OTHERS =>
FAILED ("WRONG EXCEPTION RAISED ON SET_INDEX - 21");
END;
BEGIN
READ (FILE1, IVAL, ONE);
FAILED ("STATUS_ERROR WAS NOT RAISED ON READ - 22");
EXCEPTION
WHEN STATUS_ERROR =>
NULL;
WHEN USE_ERROR =>
FAILED ("USE_ERROR RAISED ON READ - 23");
WHEN OTHERS =>
FAILED ("WRONG EXCEPTION RAISED ON READ - 24");
END;
END;
RESULT;
END CE2402A;
|
------------------------------------------------------------------------------
-- --
-- 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_gpio.c --
-- @author MCD Application Team --
-- @version V1.1.0 --
-- @date 19-June-2014 --
-- @brief GPIO HAL module driver. --
-- --
-- COPYRIGHT(c) 2014 STMicroelectronics --
------------------------------------------------------------------------------
with System; use System;
with STM32_SVD.GPIO; use STM32_SVD.GPIO;
with STM32.RCC;
with STM32.SYSCFG;
with System.Machine_Code;
package body STM32.GPIO is
procedure Lock_The_Pin (Port : in out Internal_GPIO_Port; Pin : Short);
-- This is the routine that actually locks the pin for the port. It is an
-- internal routine and has no preconditions. We use it to avoid redundant
-- calls to the precondition that checks that the pin is not already
-- locked. The redundancy would otherwise occur because the routine that
-- locks an array of pins is implemented by calling the routine that locks
-- a single pin: both those Lock routines have a precondition that checks
-- that the pin(s) is not already being locked.
-------------
-- Any_Set --
-------------
function Any_Set (Pins : GPIO_Points) return Boolean is
begin
for Pin of Pins loop
if Pin.Set then
return True;
end if;
end loop;
return False;
end Any_Set;
---------
-- Set --
---------
overriding
function Set (This : GPIO_Point) return Boolean is
(This.Periph.IDR.IDR.Arr (This.Pin));
-------------
-- All_Set --
-------------
function All_Set (Pins : GPIO_Points) return Boolean is
begin
for Pin of Pins loop
if not Pin.Set then
return False;
end if;
end loop;
return True;
end All_Set;
---------
-- Set --
---------
overriding
procedure Set (This : in GPIO_Point) is
begin
This.Periph.BSRR.BS.Arr (This.Pin) := True;
end Set;
---------
-- Set --
---------
procedure Set (Pins : in out GPIO_Points) is
begin
for Pin of Pins loop
Pin.Set;
end loop;
end Set;
-----------
-- Clear --
-----------
overriding
procedure Clear (This : in out GPIO_Point) is
begin
This.Periph.BSRR.BR.Arr (This.Pin) := True;
end Clear;
-----------
-- Clear --
-----------
procedure Clear (Pins : in out GPIO_Points) is
begin
for Pin of Pins loop
Pin.Clear;
end loop;
end Clear;
------------
-- Toggle --
------------
overriding
procedure Toggle (This : in out GPIO_Point) is
begin
This.Periph.ODR.ODR.Arr (This.Pin) :=
not This.Periph.ODR.ODR.Arr (This.Pin);
end Toggle;
------------
-- Toggle --
------------
procedure Toggle (Points : in out GPIO_Points) is
begin
for Point of Points loop
Point.Toggle;
end loop;
end Toggle;
------------
-- Locked --
------------
function Locked (Pin : GPIO_Point) return Boolean is
(Pin.Periph.LCKR.LCK.Arr (Pin.Pin));
------------------
-- Lock_The_Pin --
------------------
procedure Lock_The_Pin (Port : in out Internal_GPIO_Port; Pin : Short) is
Temp : Word;
pragma Volatile (Temp);
use System.Machine_Code;
use ASCII;
begin
-- As per the Reference Manual (RM0090; Doc ID 018909 Rev 6) pg 282,
-- a specific sequence is required to set the Lock bit. Throughout the
-- sequence the same value for the lower 15 bits of the word must be
-- used (ie the pin number). The lock bit is referred to as LCKK in
-- the doc.
-- Temp := LCCK or Pin'Enum_Rep;
--
-- -- set the lock bit
-- Port.LCKR := Temp;
--
-- -- clear the lock bit
-- Port.LCKR := Pin'Enum_Rep;
--
-- -- set the lock bit again
-- Port.LCKR := Temp;
--
-- -- read the lock bit
-- Temp := Port.LCKR;
--
-- -- read the lock bit again
-- Temp := Port.LCKR;
-- We use the following assembly language sequence because the above
-- high-level version in Ada works only if the optimizer is enabled.
-- This is not an issue specific to Ada. If you need a specific sequence
-- of instructions you should really specify those instructions.
-- We don't want the functionality to depend on the switches, and we
-- don't want to preclude debugging, hence the following:
Asm ("orr r3, %2, #65536" & LF & HT &
"str r3, %0" & LF & HT &
"ldr r3, %0" & LF & HT & -- temp <- pin or LCCK
"str r3, [%1, #28]" & LF & HT & -- temp -> lckr
"str %2, [%1, #28]" & LF & HT & -- pin -> lckr
"ldr r3, %0" & LF & HT &
"str r3, [%1, #28]" & LF & HT & -- temp -> lckr
"ldr r3, [%1, #28]" & LF & HT &
"str r3, %0" & LF & HT & -- temp <- lckr
"ldr r3, [%1, #28]" & LF & HT &
"str r3, %0" & LF & HT, -- temp <- lckr
Inputs => (Address'Asm_Input ("r", Port'Address), -- %1
(Short'Asm_Input ("r", Pin))), -- %2
Outputs => (Word'Asm_Output ("=m", Temp)), -- %0
Volatile => True,
Clobber => ("r2, r3"));
end Lock_The_Pin;
----------
-- Lock --
----------
procedure Lock (Point : GPIO_Point) is
begin
Lock_The_Pin (Point.Periph.all, Shift_Left (1, Point.Pin));
end Lock;
----------
-- Lock --
----------
procedure Lock (Points : GPIO_Points) is
begin
for Point of Points loop
Point.Lock;
end loop;
end Lock;
------------------
-- Configure_IO --
------------------
procedure Configure_IO
(Point : GPIO_Point;
Config : GPIO_Port_Configuration)
is
MODER : MODER_Register := Point.Periph.MODER;
OTYPER : OTYPER_Register := Point.Periph.OTYPER;
OSPEEDR : OSPEEDR_Register := Point.Periph.OSPEEDR;
PUPDR : PUPDR_Register := Point.Periph.PUPDR;
begin
MODER.Arr (Point.Pin) :=
Pin_IO_Modes'Enum_Rep (Config.Mode);
OTYPER.OT.Arr (Point.Pin) := Config.Output_Type = Open_Drain;
OSPEEDR.Arr (Point.Pin) :=
Pin_Output_Speeds'Enum_Rep (Config.Speed);
PUPDR.Arr (Point.Pin) :=
Internal_Pin_Resistors'Enum_Rep (Config.Resistors);
Point.Periph.MODER := MODER;
Point.Periph.OTYPER := OTYPER;
Point.Periph.OSPEEDR := OSPEEDR;
Point.Periph.PUPDR := PUPDR;
end Configure_IO;
------------------
-- Configure_IO --
------------------
procedure Configure_IO
(Points : GPIO_Points;
Config : GPIO_Port_Configuration)
is
begin
for Point of Points loop
Point.Configure_IO (Config);
end loop;
end Configure_IO;
----------------------------------
-- Configure_Alternate_Function --
----------------------------------
procedure Configure_Alternate_Function
(Point : GPIO_Point;
AF : GPIO_Alternate_Function)
is
begin
if Point.Pin < 8 then
Point.Periph.AFRL.Arr (Point.Pin) := UInt4 (AF);
else
Point.Periph.AFRH.Arr (Point.Pin) := UInt4 (AF);
end if;
end Configure_Alternate_Function;
----------------------------------
-- Configure_Alternate_Function --
----------------------------------
procedure Configure_Alternate_Function
(Points : GPIO_Points;
AF : GPIO_Alternate_Function)
is
begin
for Point of Points loop
Point.Configure_Alternate_Function (AF);
end loop;
end Configure_Alternate_Function;
-------------------------------
-- Get_Interrupt_Line_Number --
-------------------------------
function Get_Interrupt_Line_Number
(Point : GPIO_Point) return EXTI.External_Line_Number
is
begin
return EXTI.External_Line_Number'Val (Point.Pin);
end Get_Interrupt_Line_Number;
-----------------------
-- Configure_Trigger --
-----------------------
procedure Configure_Trigger
(Point : GPIO_Point;
Trigger : EXTI.External_Triggers)
is
use STM32.EXTI;
Line : constant External_Line_Number :=
External_Line_Number'Val (Point.Pin);
use STM32.SYSCFG, STM32.RCC;
begin
SYSCFG_Clock_Enable;
Connect_External_Interrupt (Point);
if Trigger in Interrupt_Triggers then
Enable_External_Interrupt (Line, Trigger);
else
Enable_External_Event (Line, Trigger);
end if;
end Configure_Trigger;
-----------------------
-- Configure_Trigger --
-----------------------
procedure Configure_Trigger
(Points : GPIO_Points;
Trigger : EXTI.External_Triggers)
is
begin
for Point of Points loop
Point.Configure_Trigger (Trigger);
end loop;
end Configure_Trigger;
end STM32.GPIO;
|
--
-- 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 soc.interrupts; use soc.interrupts;
with ewok.posthook;
with ewok.softirq;
with ewok.dma;
with soc.dma;
with soc.nvic;
package body ewok.isr
with spark_mode => off
is
procedure postpone_isr
(intr : in soc.interrupts.t_interrupt;
handler : in ewok.interrupts.t_interrupt_handler_access;
task_id : in ewok.tasks_shared.t_task_id)
is
pragma warnings (off); -- Size differ
function to_unsigned_32 is new ada.unchecked_conversion
(soc.dma.t_dma_stream_int_status, unsigned_32);
pragma warnings (on);
dma_status : soc.dma.t_dma_stream_int_status;
status : unsigned_32 := 0;
data : unsigned_32 := 0;
isr_params : ewok.softirq.t_isr_parameters;
ok : boolean;
begin
-- Acknowledge interrupt:
-- - DMAs are managed by the kernel
-- - Devices managed by user tasks should use the posthook mechanism
-- to acknowledge interrupt (in order to avoid bursts).
-- Note:
-- Posthook execution is mandatory for hardware devices that wait for
-- a quick answer from the driver. It permit to execute some
-- instructions (reading and writing registers) and to return some
-- value (former 'status' and 'data' parameters)
if soc.dma.soc_is_dma_irq (intr) then
ewok.dma.get_status_register (task_id, intr, dma_status, ok);
if ok then
status := to_unsigned_32 (dma_status) and 2#0011_1101#;
else
raise program_error;
end if;
ewok.dma.clear_dma_interrupts (task_id, intr);
else
-- INFO: this function should be executed as a critical section
-- (ToCToU risk)
ewok.posthook.exec (intr, status, data);
end if;
-- All user ISR have their Pending IRQ bit clean here
soc.nvic.clear_pending_irq (soc.nvic.to_irq_number (intr));
-- Pushing the request for further treatment by softirq
isr_params.handler := ewok.interrupts.to_system_address (handler);
isr_params.interrupt := intr;
isr_params.posthook_status := status;
isr_params.posthook_data := data;
-- INFO: this function is not reentrant
ewok.softirq.push_isr (task_id, isr_params);
return;
end postpone_isr;
end ewok.isr;
|
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Float_Text_IO; use Ada.Float_Text_IO;
procedure Steps_7 is
task Bank is
entry Put_Amount (Amount : in Float);
entry Get_Amount (Amount : in Float);
entry Give_Bonus (Amount : in Float);
end Bank;
task body Bank is
Fee : constant Float := 2.0;
Debt_Limit : constant Float := 1000.0;
Money : Float := 0.0;
begin
loop
select
when Money > 0.0 =>
accept Get_Amount (Amount : in Float) do
if Money - Amount < -Debt_Limit + Fee then
Put ("BANK: No debts greater than ");
Put (Debt_Limit, Aft => 2, Exp => 0);
New_Line;
else
Money := Money - Amount - 2.0;
Put ("BANK: Withdrawing ");
Put (Amount, Aft => 2, Exp => 0);
New_Line;
Put ("BANK: Current deposit: ");
Put (Money, Aft => 2, Exp => 0);
New_Line;
end if;
end Get_Amount;
or
when Money < 0.0 =>
accept Give_Bonus (Amount : in Float) do
requeue Put_Amount;
end Give_Bonus;
or
accept Put_Amount (Amount : in Float) do
Put ("BANK: Deposit ");
Put (Amount, Aft => 2, Exp => 0);
New_Line;
Money := Money + Amount;
Put ("BANK: Current deposit: ");
Put (Money, Aft => 2, Exp => 0);
New_Line;
end Put_Amount;
end select;
end loop;
end Bank;
task Bonus;
task body Bonus is
Bonus_Amount : constant Float := 200.0;
begin
loop
-- Put_Line ("Checking for need");
delay 5.0;
Bank.Give_Bonus (Bonus_Amount);
Put ("STATE: We helped the bank^H^H^H^H you with a bonus of ");
Put (Bonus_Amount, Aft => 2, Exp => 0);
New_Line;
end loop;
end Bonus;
begin
Bank.Put_Amount (120.0);
Bank.Get_Amount (125.0);
Put_Line ("We need more money, but we must wait for the bonus");
Bank.Get_Amount (50.0);
end;
|
pragma License (Unrestricted);
generic
type Real is digits <>;
package Ada.Numerics.Generic_Complex_Types is
pragma Pure;
type Complex is record
Re, Im : Real'Base;
end record;
pragma Complex_Representation (Complex);
type Imaginary is private;
pragma Preelaborable_Initialization (Imaginary);
-- modified
-- i : constant Imaginary;
-- j : constant Imaginary;
function i return Imaginary;
function j return Imaginary
renames i;
pragma Inline (i);
function Re (X : Complex) return Real'Base;
function Im (X : Complex) return Real'Base;
function Im (X : Imaginary) return Real'Base;
pragma Inline (Re);
pragma Inline (Im);
procedure Set_Re (X : in out Complex; Re : Real'Base);
procedure Set_Im (X : in out Complex; Im : Real'Base);
procedure Set_Im (X : out Imaginary; Im : Real'Base);
pragma Inline (Set_Re);
pragma Inline (Set_Im);
function Compose_From_Cartesian (Re, Im : Real'Base) return Complex;
function Compose_From_Cartesian (Re : Real'Base) return Complex;
function Compose_From_Cartesian (Im : Imaginary) return Complex;
pragma Inline (Compose_From_Cartesian);
function Modulus (X : Complex) return Real'Base;
function "abs" (Right : Complex) return Real'Base
renames Modulus;
pragma Inline (Modulus);
function Argument (X : Complex) return Real'Base;
function Argument (X : Complex; Cycle : Real'Base) return Real'Base;
pragma Inline (Argument);
function Compose_From_Polar (Modulus, Argument : Real'Base)
return Complex;
function Compose_From_Polar (Modulus, Argument, Cycle : Real'Base)
return Complex;
function "+" (Right : Complex) return Complex;
function "-" (Right : Complex) return Complex;
function Conjugate (X : Complex) return Complex;
pragma Inline ("+");
pragma Inline ("-");
pragma Inline (Conjugate);
function "+" (Left, Right : Complex) return Complex;
function "-" (Left, Right : Complex) return Complex;
function "*" (Left, Right : Complex) return Complex;
function "/" (Left, Right : Complex) return Complex;
pragma Inline ("+");
pragma Inline ("-");
function "**" (Left : Complex; Right : Integer) return Complex;
function "+" (Right : Imaginary) return Imaginary
with Import, Convention => Intrinsic;
function "-" (Right : Imaginary) return Imaginary
with Import, Convention => Intrinsic;
function Conjugate (X : Imaginary) return Imaginary
renames "-";
function "abs" (Right : Imaginary) return Real'Base;
pragma Inline ("abs");
function "+" (Left, Right : Imaginary) return Imaginary
with Import, Convention => Intrinsic;
function "-" (Left, Right : Imaginary) return Imaginary
with Import, Convention => Intrinsic;
function "*" (Left, Right : Imaginary) return Real'Base;
function "/" (Left, Right : Imaginary) return Real'Base;
pragma Inline ("*");
pragma Inline ("/");
function "**" (Left : Imaginary; Right : Integer) return Complex;
function "<" (Left, Right : Imaginary) return Boolean
with Import, Convention => Intrinsic;
function "<=" (Left, Right : Imaginary) return Boolean
with Import, Convention => Intrinsic;
function ">" (Left, Right : Imaginary) return Boolean
with Import, Convention => Intrinsic;
function ">=" (Left, Right : Imaginary) return Boolean
with Import, Convention => Intrinsic;
function "+" (Left : Complex; Right : Real'Base) return Complex;
function "+" (Left : Real'Base; Right : Complex) return Complex;
function "-" (Left : Complex; Right : Real'Base) return Complex;
function "-" (Left : Real'Base; Right : Complex) return Complex;
function "*" (Left : Complex; Right : Real'Base) return Complex;
function "*" (Left : Real'Base; Right : Complex) return Complex;
function "/" (Left : Complex; Right : Real'Base) return Complex;
function "/" (Left : Real'Base; Right : Complex) return Complex;
pragma Inline ("+");
pragma Inline ("-");
pragma Inline ("*");
pragma Inline ("/");
function "+" (Left : Complex; Right : Imaginary) return Complex;
function "+" (Left : Imaginary; Right : Complex) return Complex;
function "-" (Left : Complex; Right : Imaginary) return Complex;
function "-" (Left : Imaginary; Right : Complex) return Complex;
function "*" (Left : Complex; Right : Imaginary) return Complex;
function "*" (Left : Imaginary; Right : Complex) return Complex;
function "/" (Left : Complex; Right : Imaginary) return Complex;
function "/" (Left : Imaginary; Right : Complex) return Complex;
pragma Inline ("+");
pragma Inline ("-");
pragma Inline ("*");
pragma Inline ("/");
function "+" (Left : Imaginary; Right : Real'Base) return Complex;
function "+" (Left : Real'Base; Right : Imaginary) return Complex;
function "-" (Left : Imaginary; Right : Real'Base) return Complex;
function "-" (Left : Real'Base; Right : Imaginary) return Complex;
function "*" (Left : Imaginary; Right : Real'Base) return Imaginary;
function "*" (Left : Real'Base; Right : Imaginary) return Imaginary;
function "/" (Left : Imaginary; Right : Real'Base) return Imaginary;
function "/" (Left : Real'Base; Right : Imaginary) return Imaginary;
pragma Inline ("+");
pragma Inline ("-");
pragma Inline ("*");
pragma Inline ("/");
private
type Imaginary is new Real'Base;
-- i : constant Imaginary := 1.0;
-- j : constant Imaginary := 1.0;
function i return Imaginary is (1.0);
end Ada.Numerics.Generic_Complex_Types;
|
-- todo: initialize in several functions: initGPIO, initI2C, use HAL
-- with Config; use Config;
with HIL.GPIO;
with HIL.SPI;
with HIL.Clock;
with HIL.UART;
with HIL.I2C;
with HIL.Random;
with Ada.Real_Time; use Ada.Real_Time;
package body CPU with SPARK_Mode is
-- configures hardware registers
procedure initialize is
startup_time : constant Ada.Real_Time.Time := Ada.Real_Time.Clock;
begin
-- Configure GPIO
HIL.Clock.configure;
HIL.Random.initialize;
HIL.UART.configure;
HIL.GPIO.configure;
HIL.SPI.configure;
delay until startup_time + Ada.Real_Time.Milliseconds (200);
HIL.I2C.initialize;
end initialize;
procedure sleep is -- ??
begin
null;
end sleep;
end CPU;
|
pragma License (Unrestricted);
-- implementation unit
package System.Formatting.Float is
pragma Pure;
subtype Long_Long_Unsigned_Float is
Long_Long_Float range 0.0 .. Long_Long_Float'Last;
-- sign marks
function Sign_Mark (Value : Long_Long_Float; Signs : Sign_Marks)
return Character;
-- Width of integer part, without sign.
function Fore_Digits_Width (
Value : Long_Long_Unsigned_Float;
Base : Number_Base := 10)
return Positive;
function Fore_Digits_Width (
First, Last : Long_Long_Float;
Base : Number_Base := 10)
return Positive;
-- for Image_No_Exponent and fixed
procedure Image_No_Sign_Nor_Exponent (
Value : Long_Long_Float;
Item : out String;
Fore_Last, Last : out Natural;
Base : Number_Base := 10;
Base_Form : Boolean := False;
Set : Type_Set := Upper_Case;
Fore_Digits_Width : Positive := 1;
Fore_Digits_Fill : Character := '0';
Aft_Width : Positive);
-- for float
procedure Image_No_Exponent (
Value : Long_Long_Float;
Item : out String; -- same as above except unnecessary width for exponent
Fore_Last, Last : out Natural;
Signs : Sign_Marks := ('-', ' ', ' ');
Base : Number_Base := 10;
Base_Form : Boolean := False;
Set : Type_Set := Upper_Case;
Fore_Digits_Width : Positive := 1;
Fore_Digits_Fill : Character := '0';
Aft_Width : Positive;
NaN : String := "NAN";
Infinity : String := "INF");
procedure Image (
Value : Long_Long_Float;
Item : out String; -- Item'Length >= Long_Long_Float'Width + 4 for "16##"
Fore_Last, Last : out Natural;
Signs : Sign_Marks := ('-', ' ', ' ');
Base : Number_Base := 10;
Base_Form : Boolean := False;
Set : Type_Set := Upper_Case;
Fore_Digits_Width : Positive := 1;
Fore_Digits_Fill : Character := '0';
Aft_Width : Positive;
Exponent_Mark : Character := 'E';
Exponent_Signs : Sign_Marks := ('-', '+', '+');
Exponent_Digits_Width : Positive := 2;
Exponent_Digits_Fill : Character := '0';
NaN : String := "NAN";
Infinity : String := "INF");
end System.Formatting.Float;
|
package body Make_Ada is
function Make_Call
(Name : String;
Actual_Parameter_Part : Vector)
return String
is
Actual_Parameter_Part_String : constant String :=
(if Actual_Parameter_Part.Is_Empty then ""
else " (" & Join (Actual_Parameter_Part, ", ") & ")");
begin
return Name & Actual_Parameter_Part_String;
end Make_Call;
function Make_Parameter_Association (Name : String := "";
Value : String := "1")
return String
is
begin
if Name = "" then
return Value;
else
return Name & " => " & Value;
end if;
end Make_Parameter_Association;
end Make_Ada;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . B B . T I M I N G _ E V E N T S --
-- --
-- S p e c --
-- --
-- Copyright (C) 2011-2021, 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.BB.Time;
with System.Multiprocessors;
package System.Bb.Timing_Events is
pragma Preelaborate;
type Timing_Event is tagged limited private;
type Timing_Event_Handler
is access procedure (Event : in out Timing_Event'Class);
type Timing_Event_Access is access all Timing_Event;
procedure Set_Handler
(Event : in out Timing_Event;
At_Time : System.BB.Time.Time;
Handler : Timing_Event_Handler);
-- Associate the handler Handler with the event Event: if Handler is null
-- the event is cleared; otherwise, it is set, and the execution time for
-- the event to be At_Time.
--
-- A call of a procedure Set_Handler for an event that is already set
-- replaces the handler and the time of execution; if Handler is not null,
-- the event remains set.
procedure Cancel_Handler
(Event : in out Timing_Event;
Cancelled : out Boolean);
-- Clear the event if it is set. Cancelled is assigned True if the event
-- was set prior to it being cleared; otherwise, it is assigned False.
function Time_Of_Event (Event : Timing_Event) return System.BB.Time.Time;
-- Return the time of the event if the event is set, Time'First otherwise
function Get_Next_Timeout
(CPU_Id : System.Multiprocessors.CPU) return System.BB.Time.Time;
pragma Inline (Get_Next_Timeout);
-- Return the next expiration time for all timing events associated with
-- CPU_Id. Return Time'Last if no timing event is pending for CPU_Id.
procedure Execute_Expired_Timing_Events (Now : System.BB.Time.Time);
-- Execute all timing events whose expiration time is before Now
private
type Timing_Event is tagged limited record
Timeout : System.BB.Time.Time := System.BB.Time.Time'First;
-- The time at which the user's handler should be invoked when the event
-- is "set" (i.e., when Handler is not null).
Handler : Timing_Event_Handler := null;
-- An access value designating the protected procedure to be invoked at
-- the Timeout time in the future. When this value is null the event is
-- said to be "cleared" and no timeout is processed.
Next : Timing_Event_Access := null;
-- Next event in the list
Prev : Timing_Event_Access := null;
-- Previous event in the list
CPU : System.Multiprocessors.CPU;
-- Owner of the timing event
end record;
end System.BB.Timing_Events;
|
with Ada.Finalization;
private with C.gmp;
package GMP.Random is
pragma Preelaborate;
type Generator is limited private;
function Initialize return Generator;
function Initialize (Initiator : Long_Integer) return Generator;
procedure Reset (Gen : in out Generator);
procedure Reset (Gen : in out Generator; Initiator : in Long_Integer);
type State is private;
function Initialize return State;
function Initialize (Initiator : Long_Integer) return State;
function Save (Gen : Generator) return State;
procedure Save (Gen : in Generator; To_State : out State);
function Reset (From_State : State) return Generator;
procedure Reset (Gen : in out Generator; From_State : State);
function Random (Gen : aliased in out Generator) return Long_Integer;
generic
type Result_Subtype is (<>);
package Discrete_Random is
function Random (Gen : aliased in out Generator) return Result_Subtype;
end Discrete_Random;
private
package Controlled is
type State is private;
function Reference (Item : in out GMP.Random.State)
return not null access C.gmp.gmp_randstate_struct;
function Constant_Reference (Item : GMP.Random.State)
return not null access constant C.gmp.gmp_randstate_struct;
pragma Inline (Reference);
pragma Inline (Constant_Reference);
private
type State is new Ada.Finalization.Controlled
with record
Raw : aliased C.gmp.gmp_randstate_t :=
(others => (mp_seed => (others => (others => <>)), others => <>));
end record;
overriding procedure Initialize (Object : in out State);
overriding procedure Adjust (Object : in out State);
overriding procedure Finalize (Object : in out State);
end Controlled;
type State is new Controlled.State;
type Generator is limited record
State : GMP.Random.State;
end record;
end GMP.Random;
|
-- 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/>.
with Interfaces.C; use Interfaces.C;
with CArgv; use CArgv;
with Tcl.Ada;
with Tcl.Tk.Ada.Widgets; use Tcl.Tk.Ada.Widgets;
with Items; use Items;
with Ships; use Ships;
-- ****h* Utils/UUI
-- FUNCTION
-- Provide various code for GUI
-- SOURCE
package Utils.UI is
-- ****
-- ****t* UUI/UUI.CreateCommands
-- FUNCTION
-- Used to add new Tcl commands to interpreter
-- SOURCE
package CreateCommands is new Tcl.Ada.Generic_Command
(ClientData => Integer);
-- ****
-- ****o* UUI/UUI.Show_On_Map_Command
-- FUNCTION
-- Show the selected point on map
-- PARAMETERS
-- Client_Data - Custom data send to the command. Unused
-- Interp - Tcl interpreter in which command was executed.
-- Argc - Number of arguments passed to the command. Unused
-- Argv - Values of arguments passed to the command.
-- RESULT
-- This function always return TCL_OK
-- COMMANDS
-- ShowOnMap X Y
-- X is the x coordinate of point to show, Y is the y coordinate of point
-- to show
-- SOURCE
function Show_On_Map_Command
(Client_Data: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int;
Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int with
Convention => C;
-- ****
-- ****o* UUI/UUI.Set_Destination_Command
-- FUNCTION
-- Set the selected map point as the player's ship destination
-- PARAMETERS
-- Client_Data - Custom data send to the command. Unused
-- Interp - Tcl interpreter in which command was executed.
-- Argc - Number of arguments passed to the command. Unused
-- Argv - Values of arguments passed to the command.
-- RESULT
-- This function always return TCL_OK
-- COMMANDS
-- SetDestination X Y
-- X is the x coordinate of point to set, Y is the y coordinate of point
-- to set
-- SOURCE
function Set_Destination_Command
(Client_Data: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int;
Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int with
Convention => C;
-- ****
-- ****f* UUI/UUI.Add_Command
-- FUNCTION
-- Add the selected command to Tcl interpreter
-- PARAMETERS
-- Name - The name of the command which will be used in Tcl
-- Ada_Command - Ada function which will be invoked
-- SOURCE
procedure Add_Command
(Name: String; Ada_Command: not null CreateCommands.Tcl_CmdProc) with
Pre => Name'Length > 0;
-- ****
-- ****f* UUI/UUI.Add_Commands
-- FUNCTION
-- Add various, UI related Tcl commands
-- SOURCE
procedure Add_Commands;
-- ****
-- ****f* UUI/UUI.Minutes_To_Date
-- FUNCTION
-- Convert minutes to game date and add it to text
-- PARAMETERS
-- Minutes - Amount of minutes to convert
-- Info_Text - Text to which time info will be added
-- RESULT
-- Parameter InfoText
-- SOURCE
procedure Minutes_To_Date
(Minutes: Natural; Info_Text: in out Unbounded_String) with
Global => null,
SPARK_Mode;
-- ****
-- ****f* UUI/UUI.Travel_Info
-- FUNCTION
-- Add info about travel eta and approx fuel usage
-- PARAMETERS
-- Info_Text - Text to which info about travel will be added
-- Distance - Distance in map fields to destination point
-- Show_Fuel_Name - If true, add fuel name to info. Default is false
-- RESULT
-- Parameter InfoText
-- SOURCE
procedure Travel_Info
(Info_Text: in out Unbounded_String; Distance: Positive;
Show_Fuel_Name: Boolean := False) with
SPARK_Mode;
-- ****
-- ****f* UUI/UUI.Update_Messages
-- FUNCTION
-- Update game messages
-- SOURCE
procedure Update_Messages with
SPARK_Mode;
-- ****
-- ****f* UUI/UUI.Show_Screen
-- FUNCTION
-- Remove an old screen from the window and add a new to it
-- PARAMETERS
-- NewScreenName - Part of th name of the new Ttk_Frame to add
-- SOURCE
procedure Show_Screen(New_Screen_Name: String) with
SPARK_Mode,
Pre => New_Screen_Name'Length > 0;
-- ****
-- ****f* UUI/UUI.Show_Inventory_Item_Info
-- FUNCTION
-- Show info about selected item in ship cargo or crew member inventory
-- PARAMETERS
-- Parent - The name of the parent widget
-- Item_Index - Index of item (can be inventory or ship cargo)
-- Member_Index - If item is in crew member inventory, crew index of member,
-- otherwise 0
-- SOURCE
procedure Show_Inventory_Item_Info
(Parent: String; Item_Index: Positive; Member_Index: Natural) with
SPARK_Mode,
Pre => Member_Index <= Player_Ship.Crew.Last_Index and Parent'Length > 0;
-- ****
-- ****f* UUI/UUI.Delete_Widgets
-- FUNCTION
-- Remove widgets from the selected frame
-- PARAMETERS
-- Start_Index - The first row from which widgets will be removed
-- End_Index - The last row in which widgets will be removed
-- Frame - The fram from which widgets will be removed
-- HISTORY
-- 5.9 - Added
-- SOURCE
procedure Delete_Widgets
(Start_Index, End_Index: Integer; Frame: Tk_Widget'Class) with
SPARK_Mode;
-- ****
-- ****f* UUI/UUI.Get_Skill_Marks
-- FUNCTION
-- Get the marks for the selected skill for the selected crew member
-- PARAMETERS
-- Skill_Index - The index of the skill which will be checked
-- Member_Index - The index of the player ship crew member which will be
-- checked
-- RESULT
-- If the crew member don't have the selected skill, empty String, if
-- have the skill, " +", if the skill is the highest in the crew, " ++"
-- HISTORY
-- 6.7 - Added
-- SOURCE
function Get_Skill_Marks
(Skill_Index: Skills_Amount_Range; Member_Index: Positive)
return String with
SPARK_Mode,
Pre => Skill_Index <= Skills_Amount and
Member_Index <= Player_Ship.Crew.Last_Index;
-- ****
end Utils.UI;
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012, Vadim Godunko <vgodunko@gmail.com> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
with AMF.CMOF;
with AMF.Internals.Tables.CMOF_Attributes;
with AMF.Internals.Tables.Standard_Profile_L2_String_Data_00;
package body AMF.Internals.Tables.Standard_Profile_L2_Metamodel.Properties is
----------------
-- Initialize --
----------------
procedure Initialize is
begin
Initialize_1;
Initialize_2;
Initialize_3;
Initialize_4;
Initialize_5;
Initialize_6;
Initialize_7;
Initialize_8;
Initialize_9;
Initialize_10;
Initialize_11;
Initialize_12;
Initialize_13;
Initialize_14;
Initialize_15;
Initialize_16;
Initialize_17;
Initialize_18;
Initialize_19;
Initialize_20;
Initialize_21;
Initialize_22;
Initialize_23;
Initialize_24;
Initialize_25;
Initialize_26;
Initialize_27;
Initialize_28;
Initialize_29;
Initialize_30;
Initialize_31;
Initialize_32;
Initialize_33;
Initialize_34;
Initialize_35;
Initialize_36;
Initialize_37;
Initialize_38;
Initialize_39;
Initialize_40;
Initialize_41;
Initialize_42;
Initialize_43;
Initialize_44;
Initialize_45;
Initialize_46;
Initialize_47;
Initialize_48;
Initialize_49;
Initialize_50;
Initialize_51;
Initialize_52;
Initialize_53;
Initialize_54;
Initialize_55;
Initialize_56;
Initialize_57;
Initialize_58;
Initialize_59;
Initialize_60;
Initialize_61;
Initialize_62;
Initialize_63;
Initialize_64;
Initialize_65;
Initialize_66;
Initialize_67;
Initialize_68;
Initialize_69;
Initialize_70;
Initialize_71;
Initialize_72;
Initialize_73;
Initialize_74;
Initialize_75;
Initialize_76;
Initialize_77;
Initialize_78;
Initialize_79;
Initialize_80;
Initialize_81;
Initialize_82;
Initialize_83;
Initialize_84;
Initialize_85;
Initialize_86;
Initialize_87;
Initialize_88;
Initialize_89;
Initialize_90;
Initialize_91;
Initialize_92;
Initialize_93;
Initialize_94;
Initialize_95;
Initialize_96;
Initialize_97;
Initialize_98;
Initialize_99;
Initialize_100;
Initialize_101;
Initialize_102;
Initialize_103;
Initialize_104;
Initialize_105;
Initialize_106;
Initialize_107;
Initialize_108;
Initialize_109;
Initialize_110;
Initialize_111;
Initialize_112;
Initialize_113;
Initialize_114;
Initialize_115;
Initialize_116;
Initialize_117;
Initialize_118;
Initialize_119;
Initialize_120;
Initialize_121;
Initialize_122;
Initialize_123;
Initialize_124;
Initialize_125;
Initialize_126;
Initialize_127;
Initialize_128;
Initialize_129;
Initialize_130;
Initialize_131;
Initialize_132;
Initialize_133;
Initialize_134;
Initialize_135;
Initialize_136;
Initialize_137;
Initialize_138;
Initialize_139;
Initialize_140;
Initialize_141;
Initialize_142;
Initialize_143;
Initialize_144;
Initialize_145;
Initialize_146;
Initialize_147;
Initialize_148;
Initialize_149;
Initialize_150;
Initialize_151;
Initialize_152;
Initialize_153;
Initialize_154;
Initialize_155;
Initialize_156;
Initialize_157;
Initialize_158;
Initialize_159;
Initialize_160;
Initialize_161;
Initialize_162;
Initialize_163;
Initialize_164;
Initialize_165;
Initialize_166;
Initialize_167;
Initialize_168;
Initialize_169;
Initialize_170;
Initialize_171;
Initialize_172;
Initialize_173;
Initialize_174;
Initialize_175;
Initialize_176;
Initialize_177;
Initialize_178;
Initialize_179;
Initialize_180;
end Initialize;
------------------
-- Initialize_1 --
------------------
procedure Initialize_1 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 1,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0029'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 1, (Is_Empty => True));
end Initialize_1;
------------------
-- Initialize_2 --
------------------
procedure Initialize_2 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 2,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_004A'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 2, (Is_Empty => True));
end Initialize_2;
------------------
-- Initialize_3 --
------------------
procedure Initialize_3 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 3,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_006A'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 3, (Is_Empty => True));
end Initialize_3;
------------------
-- Initialize_4 --
------------------
procedure Initialize_4 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 4,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0088'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 4, (Is_Empty => True));
end Initialize_4;
------------------
-- Initialize_5 --
------------------
procedure Initialize_5 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 5,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_001D'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 5, (Is_Empty => True));
end Initialize_5;
------------------
-- Initialize_6 --
------------------
procedure Initialize_6 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 6,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0013'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 6, (Is_Empty => True));
end Initialize_6;
------------------
-- Initialize_7 --
------------------
procedure Initialize_7 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 7,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0071'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 7, (Is_Empty => True));
end Initialize_7;
------------------
-- Initialize_8 --
------------------
procedure Initialize_8 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 8,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0003'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 8, (Is_Empty => True));
end Initialize_8;
------------------
-- Initialize_9 --
------------------
procedure Initialize_9 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Abstract (Base + 9, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 9,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0010'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 9, (Is_Empty => True));
end Initialize_9;
-------------------
-- Initialize_10 --
-------------------
procedure Initialize_10 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 10,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0076'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 10, (Is_Empty => True));
end Initialize_10;
-------------------
-- Initialize_11 --
-------------------
procedure Initialize_11 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 11,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0007'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 11, (Is_Empty => True));
end Initialize_11;
-------------------
-- Initialize_12 --
-------------------
procedure Initialize_12 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 12,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0036'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 12, (Is_Empty => True));
end Initialize_12;
-------------------
-- Initialize_13 --
-------------------
procedure Initialize_13 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 13,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0033'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 13, (Is_Empty => True));
end Initialize_13;
-------------------
-- Initialize_14 --
-------------------
procedure Initialize_14 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 14,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0079'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 14, (Is_Empty => True));
end Initialize_14;
-------------------
-- Initialize_15 --
-------------------
procedure Initialize_15 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 15,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0040'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 15, (Is_Empty => True));
end Initialize_15;
-------------------
-- Initialize_16 --
-------------------
procedure Initialize_16 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 16,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_001E'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 16, (Is_Empty => True));
end Initialize_16;
-------------------
-- Initialize_17 --
-------------------
procedure Initialize_17 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 17,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0052'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 17, (Is_Empty => True));
end Initialize_17;
-------------------
-- Initialize_18 --
-------------------
procedure Initialize_18 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 18,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_004C'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 18, (Is_Empty => True));
end Initialize_18;
-------------------
-- Initialize_19 --
-------------------
procedure Initialize_19 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 19,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_000A'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 19, (Is_Empty => True));
end Initialize_19;
-------------------
-- Initialize_20 --
-------------------
procedure Initialize_20 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 20,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0082'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 20, (Is_Empty => True));
end Initialize_20;
-------------------
-- Initialize_21 --
-------------------
procedure Initialize_21 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 21,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0055'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 21, (Is_Empty => True));
end Initialize_21;
-------------------
-- Initialize_22 --
-------------------
procedure Initialize_22 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 22,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_001B'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 22, (Is_Empty => True));
end Initialize_22;
-------------------
-- Initialize_23 --
-------------------
procedure Initialize_23 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 23,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0062'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 23, (Is_Empty => True));
end Initialize_23;
-------------------
-- Initialize_24 --
-------------------
procedure Initialize_24 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 24,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_000B'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 24, (Is_Empty => True));
end Initialize_24;
-------------------
-- Initialize_25 --
-------------------
procedure Initialize_25 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 25,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_006E'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 25, (Is_Empty => True));
end Initialize_25;
-------------------
-- Initialize_26 --
-------------------
procedure Initialize_26 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 26,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0014'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 26, (Is_Empty => True));
end Initialize_26;
-------------------
-- Initialize_27 --
-------------------
procedure Initialize_27 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 27,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0051'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 27, (Is_Empty => True));
end Initialize_27;
-------------------
-- Initialize_28 --
-------------------
procedure Initialize_28 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 28,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_001A'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 28, (Is_Empty => True));
end Initialize_28;
-------------------
-- Initialize_29 --
-------------------
procedure Initialize_29 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 29,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_006D'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 29, (Is_Empty => True));
end Initialize_29;
-------------------
-- Initialize_30 --
-------------------
procedure Initialize_30 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 30,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0022'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 30, (Is_Empty => True));
end Initialize_30;
-------------------
-- Initialize_31 --
-------------------
procedure Initialize_31 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 31,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_000C'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 31, (False, AMF.CMOF.Public_Visibility));
end Initialize_31;
-------------------
-- Initialize_32 --
-------------------
procedure Initialize_32 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 32,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_008D'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 32, (False, AMF.CMOF.Public_Visibility));
end Initialize_32;
-------------------
-- Initialize_33 --
-------------------
procedure Initialize_33 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 33,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0085'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 33, (False, AMF.CMOF.Public_Visibility));
end Initialize_33;
-------------------
-- Initialize_34 --
-------------------
procedure Initialize_34 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 34,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_008D'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 34, (False, AMF.CMOF.Public_Visibility));
end Initialize_34;
-------------------
-- Initialize_35 --
-------------------
procedure Initialize_35 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 35,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0078'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 35, (False, AMF.CMOF.Public_Visibility));
end Initialize_35;
-------------------
-- Initialize_36 --
-------------------
procedure Initialize_36 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 36, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 36,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0015'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 36, (False, AMF.CMOF.Public_Visibility));
end Initialize_36;
-------------------
-- Initialize_37 --
-------------------
procedure Initialize_37 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 37,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0085'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 37, (False, AMF.CMOF.Public_Visibility));
end Initialize_37;
-------------------
-- Initialize_38 --
-------------------
procedure Initialize_38 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 38,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0011'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 38, (False, AMF.CMOF.Public_Visibility));
end Initialize_38;
-------------------
-- Initialize_39 --
-------------------
procedure Initialize_39 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 39,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0037'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 39, (False, AMF.CMOF.Public_Visibility));
end Initialize_39;
-------------------
-- Initialize_40 --
-------------------
procedure Initialize_40 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 40,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0011'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 40, (False, AMF.CMOF.Public_Visibility));
end Initialize_40;
-------------------
-- Initialize_41 --
-------------------
procedure Initialize_41 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 41,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0011'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 41, (False, AMF.CMOF.Public_Visibility));
end Initialize_41;
-------------------
-- Initialize_42 --
-------------------
procedure Initialize_42 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 42,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_000C'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 42, (False, AMF.CMOF.Public_Visibility));
end Initialize_42;
-------------------
-- Initialize_43 --
-------------------
procedure Initialize_43 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 43,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_007B'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 43, (False, AMF.CMOF.Public_Visibility));
end Initialize_43;
-------------------
-- Initialize_44 --
-------------------
procedure Initialize_44 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 44,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0037'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 44, (False, AMF.CMOF.Public_Visibility));
end Initialize_44;
-------------------
-- Initialize_45 --
-------------------
procedure Initialize_45 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 45,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_000C'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 45, (False, AMF.CMOF.Public_Visibility));
end Initialize_45;
-------------------
-- Initialize_46 --
-------------------
procedure Initialize_46 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 46,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_008D'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 46, (False, AMF.CMOF.Public_Visibility));
end Initialize_46;
-------------------
-- Initialize_47 --
-------------------
procedure Initialize_47 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 47,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0011'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 47, (False, AMF.CMOF.Public_Visibility));
end Initialize_47;
-------------------
-- Initialize_48 --
-------------------
procedure Initialize_48 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 48,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_000C'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 48, (False, AMF.CMOF.Public_Visibility));
end Initialize_48;
-------------------
-- Initialize_49 --
-------------------
procedure Initialize_49 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 49,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_007B'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 49, (False, AMF.CMOF.Public_Visibility));
end Initialize_49;
-------------------
-- Initialize_50 --
-------------------
procedure Initialize_50 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 50,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0037'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 50, (False, AMF.CMOF.Public_Visibility));
end Initialize_50;
-------------------
-- Initialize_51 --
-------------------
procedure Initialize_51 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 51,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0043'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 51, (False, AMF.CMOF.Public_Visibility));
end Initialize_51;
-------------------
-- Initialize_52 --
-------------------
procedure Initialize_52 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 52,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0078'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 52, (False, AMF.CMOF.Public_Visibility));
end Initialize_52;
-------------------
-- Initialize_53 --
-------------------
procedure Initialize_53 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 53,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_008D'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 53, (False, AMF.CMOF.Public_Visibility));
end Initialize_53;
-------------------
-- Initialize_54 --
-------------------
procedure Initialize_54 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 54,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0011'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 54, (False, AMF.CMOF.Public_Visibility));
end Initialize_54;
-------------------
-- Initialize_55 --
-------------------
procedure Initialize_55 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 55,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_008D'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 55, (False, AMF.CMOF.Public_Visibility));
end Initialize_55;
-------------------
-- Initialize_56 --
-------------------
procedure Initialize_56 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 56,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0037'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 56, (False, AMF.CMOF.Public_Visibility));
end Initialize_56;
-------------------
-- Initialize_57 --
-------------------
procedure Initialize_57 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 57,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0011'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 57, (False, AMF.CMOF.Public_Visibility));
end Initialize_57;
-------------------
-- Initialize_58 --
-------------------
procedure Initialize_58 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 58,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0043'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 58, (False, AMF.CMOF.Public_Visibility));
end Initialize_58;
-------------------
-- Initialize_59 --
-------------------
procedure Initialize_59 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 59,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0037'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 59, (False, AMF.CMOF.Public_Visibility));
end Initialize_59;
-------------------
-- Initialize_60 --
-------------------
procedure Initialize_60 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 60,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0078'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 60, (False, AMF.CMOF.Public_Visibility));
end Initialize_60;
-------------------
-- Initialize_61 --
-------------------
procedure Initialize_61 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 61,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_000C'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 61, (False, AMF.CMOF.Public_Visibility));
end Initialize_61;
-------------------
-- Initialize_62 --
-------------------
procedure Initialize_62 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 62,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_000C'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 62, (False, AMF.CMOF.Public_Visibility));
end Initialize_62;
-------------------
-- Initialize_63 --
-------------------
procedure Initialize_63 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 63,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0042'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 63, (Is_Empty => True));
end Initialize_63;
-------------------
-- Initialize_64 --
-------------------
procedure Initialize_64 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 64,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_007C'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 64, (Is_Empty => True));
end Initialize_64;
-------------------
-- Initialize_65 --
-------------------
procedure Initialize_65 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 65,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_000E'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 65, (Is_Empty => True));
end Initialize_65;
-------------------
-- Initialize_66 --
-------------------
procedure Initialize_66 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 66,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0017'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 66, (Is_Empty => True));
end Initialize_66;
-------------------
-- Initialize_67 --
-------------------
procedure Initialize_67 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 67,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_008C'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 67, (Is_Empty => True));
end Initialize_67;
-------------------
-- Initialize_68 --
-------------------
procedure Initialize_68 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 68,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0020'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 68, (Is_Empty => True));
end Initialize_68;
-------------------
-- Initialize_69 --
-------------------
procedure Initialize_69 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 69,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0069'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 69, (Is_Empty => True));
end Initialize_69;
-------------------
-- Initialize_70 --
-------------------
procedure Initialize_70 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 70,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_003E'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 70, (Is_Empty => True));
end Initialize_70;
-------------------
-- Initialize_71 --
-------------------
procedure Initialize_71 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 71,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0074'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 71, (Is_Empty => True));
end Initialize_71;
-------------------
-- Initialize_72 --
-------------------
procedure Initialize_72 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 72,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0032'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 72, (Is_Empty => True));
end Initialize_72;
-------------------
-- Initialize_73 --
-------------------
procedure Initialize_73 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 73,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_004F'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 73, (Is_Empty => True));
end Initialize_73;
-------------------
-- Initialize_74 --
-------------------
procedure Initialize_74 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 74,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0063'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 74, (Is_Empty => True));
end Initialize_74;
-------------------
-- Initialize_75 --
-------------------
procedure Initialize_75 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 75,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0059'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 75, (Is_Empty => True));
end Initialize_75;
-------------------
-- Initialize_76 --
-------------------
procedure Initialize_76 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 76,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0070'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 76, (Is_Empty => True));
end Initialize_76;
-------------------
-- Initialize_77 --
-------------------
procedure Initialize_77 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 77,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0068'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 77, (Is_Empty => True));
end Initialize_77;
-------------------
-- Initialize_78 --
-------------------
procedure Initialize_78 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 78,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0006'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 78, (Is_Empty => True));
end Initialize_78;
-------------------
-- Initialize_79 --
-------------------
procedure Initialize_79 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 79,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0054'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 79, (Is_Empty => True));
end Initialize_79;
-------------------
-- Initialize_80 --
-------------------
procedure Initialize_80 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 80,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_007E'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 80, (Is_Empty => True));
end Initialize_80;
-------------------
-- Initialize_81 --
-------------------
procedure Initialize_81 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 81,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_005B'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 81, (Is_Empty => True));
end Initialize_81;
-------------------
-- Initialize_82 --
-------------------
procedure Initialize_82 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 82,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_004E'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 82, (Is_Empty => True));
end Initialize_82;
-------------------
-- Initialize_83 --
-------------------
procedure Initialize_83 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 83,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0050'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 83, (Is_Empty => True));
end Initialize_83;
-------------------
-- Initialize_84 --
-------------------
procedure Initialize_84 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 84,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0028'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 84, (Is_Empty => True));
end Initialize_84;
-------------------
-- Initialize_85 --
-------------------
procedure Initialize_85 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 85,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_003D'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 85, (Is_Empty => True));
end Initialize_85;
-------------------
-- Initialize_86 --
-------------------
procedure Initialize_86 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 86,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0077'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 86, (Is_Empty => True));
end Initialize_86;
-------------------
-- Initialize_87 --
-------------------
procedure Initialize_87 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 87,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0027'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 87, (Is_Empty => True));
end Initialize_87;
-------------------
-- Initialize_88 --
-------------------
procedure Initialize_88 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 88,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_006F'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 88, (Is_Empty => True));
end Initialize_88;
-------------------
-- Initialize_89 --
-------------------
procedure Initialize_89 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 89,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_007F'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 89, (Is_Empty => True));
end Initialize_89;
-------------------
-- Initialize_90 --
-------------------
procedure Initialize_90 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 90,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0038'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 90, (Is_Empty => True));
end Initialize_90;
-------------------
-- Initialize_91 --
-------------------
procedure Initialize_91 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 91,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0067'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 91, (Is_Empty => True));
end Initialize_91;
-------------------
-- Initialize_92 --
-------------------
procedure Initialize_92 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 92,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_004B'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 92, (Is_Empty => True));
end Initialize_92;
-------------------
-- Initialize_93 --
-------------------
procedure Initialize_93 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 93,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0061'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 93, (Is_Empty => True));
end Initialize_93;
-------------------
-- Initialize_94 --
-------------------
procedure Initialize_94 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 94,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0030'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 94, (Is_Empty => True));
end Initialize_94;
-------------------
-- Initialize_95 --
-------------------
procedure Initialize_95 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 95,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_007D'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Uri
(Base + 95,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0049'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 95, (Is_Empty => True));
end Initialize_95;
-------------------
-- Initialize_96 --
-------------------
procedure Initialize_96 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 96, AMF.CMOF.Public_Visibility);
end Initialize_96;
-------------------
-- Initialize_97 --
-------------------
procedure Initialize_97 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 97, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 97, (False, 0));
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 97,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0060'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 97, (False, AMF.CMOF.Public_Visibility));
end Initialize_97;
-------------------
-- Initialize_98 --
-------------------
procedure Initialize_98 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 98, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 98, (False, 0));
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 98,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0073'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 98, (False, AMF.CMOF.Public_Visibility));
end Initialize_98;
-------------------
-- Initialize_99 --
-------------------
procedure Initialize_99 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 99, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 99, (False, 0));
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 99,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0041'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 99, (False, AMF.CMOF.Public_Visibility));
end Initialize_99;
--------------------
-- Initialize_100 --
--------------------
procedure Initialize_100 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 100, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 100, (False, 0));
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 100,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0008'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 100, (False, AMF.CMOF.Public_Visibility));
end Initialize_100;
--------------------
-- Initialize_101 --
--------------------
procedure Initialize_101 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 101, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 101, (False, 0));
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 101,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0056'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 101, (False, AMF.CMOF.Public_Visibility));
end Initialize_101;
--------------------
-- Initialize_102 --
--------------------
procedure Initialize_102 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 102, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 102, (False, 0));
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 102,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_006B'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 102, (False, AMF.CMOF.Public_Visibility));
end Initialize_102;
--------------------
-- Initialize_103 --
--------------------
procedure Initialize_103 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 103, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 103, (False, 0));
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 103,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0000'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 103, (False, AMF.CMOF.Public_Visibility));
end Initialize_103;
--------------------
-- Initialize_104 --
--------------------
procedure Initialize_104 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 104, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 104, (False, 0));
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 104,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_001F'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 104, (False, AMF.CMOF.Public_Visibility));
end Initialize_104;
--------------------
-- Initialize_105 --
--------------------
procedure Initialize_105 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 105, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 105, (False, 0));
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 105,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0075'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 105, (False, AMF.CMOF.Public_Visibility));
end Initialize_105;
--------------------
-- Initialize_106 --
--------------------
procedure Initialize_106 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 106, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 106, (False, 0));
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 106,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_005C'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 106, (False, AMF.CMOF.Public_Visibility));
end Initialize_106;
--------------------
-- Initialize_107 --
--------------------
procedure Initialize_107 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 107, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 107, (False, 0));
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 107,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_002F'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 107, (False, AMF.CMOF.Public_Visibility));
end Initialize_107;
--------------------
-- Initialize_108 --
--------------------
procedure Initialize_108 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 108, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 108, (False, 0));
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 108,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_000D'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 108, (False, AMF.CMOF.Public_Visibility));
end Initialize_108;
--------------------
-- Initialize_109 --
--------------------
procedure Initialize_109 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 109, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 109, (False, 0));
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 109,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0081'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 109, (False, AMF.CMOF.Public_Visibility));
end Initialize_109;
--------------------
-- Initialize_110 --
--------------------
procedure Initialize_110 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 110, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 110, (False, 0));
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 110,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0001'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 110, (False, AMF.CMOF.Public_Visibility));
end Initialize_110;
--------------------
-- Initialize_111 --
--------------------
procedure Initialize_111 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 111, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 111, (False, 0));
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 111,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0016'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 111, (False, AMF.CMOF.Public_Visibility));
end Initialize_111;
--------------------
-- Initialize_112 --
--------------------
procedure Initialize_112 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 112, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 112, (False, 0));
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 112,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0005'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 112, (False, AMF.CMOF.Public_Visibility));
end Initialize_112;
--------------------
-- Initialize_113 --
--------------------
procedure Initialize_113 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 113, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 113, (False, 0));
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 113,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0064'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 113, (False, AMF.CMOF.Public_Visibility));
end Initialize_113;
--------------------
-- Initialize_114 --
--------------------
procedure Initialize_114 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 114, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 114, (False, 0));
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 114,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0080'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 114, (False, AMF.CMOF.Public_Visibility));
end Initialize_114;
--------------------
-- Initialize_115 --
--------------------
procedure Initialize_115 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 115, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 115, (False, 0));
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 115,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0045'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 115, (False, AMF.CMOF.Public_Visibility));
end Initialize_115;
--------------------
-- Initialize_116 --
--------------------
procedure Initialize_116 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 116, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 116, (False, 0));
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 116,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0065'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 116, (False, AMF.CMOF.Public_Visibility));
end Initialize_116;
--------------------
-- Initialize_117 --
--------------------
procedure Initialize_117 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 117, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 117, (False, 0));
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 117,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0025'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 117, (False, AMF.CMOF.Public_Visibility));
end Initialize_117;
--------------------
-- Initialize_118 --
--------------------
procedure Initialize_118 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 118, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 118, (False, 0));
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 118,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0012'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 118, (False, AMF.CMOF.Public_Visibility));
end Initialize_118;
--------------------
-- Initialize_119 --
--------------------
procedure Initialize_119 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 119, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 119, (False, 0));
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 119,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0035'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 119, (False, AMF.CMOF.Public_Visibility));
end Initialize_119;
--------------------
-- Initialize_120 --
--------------------
procedure Initialize_120 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 120, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 120, (False, 0));
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 120,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0089'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 120, (False, AMF.CMOF.Public_Visibility));
end Initialize_120;
--------------------
-- Initialize_121 --
--------------------
procedure Initialize_121 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 121, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 121, (False, 0));
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 121,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0044'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 121, (False, AMF.CMOF.Public_Visibility));
end Initialize_121;
--------------------
-- Initialize_122 --
--------------------
procedure Initialize_122 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 122, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 122, (False, 0));
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 122,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_003B'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 122, (False, AMF.CMOF.Public_Visibility));
end Initialize_122;
--------------------
-- Initialize_123 --
--------------------
procedure Initialize_123 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 123, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 123, (False, 0));
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 123,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0084'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 123, (False, AMF.CMOF.Public_Visibility));
end Initialize_123;
--------------------
-- Initialize_124 --
--------------------
procedure Initialize_124 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 124, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 124, (False, 0));
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 124,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_005C'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 124, (False, AMF.CMOF.Public_Visibility));
end Initialize_124;
--------------------
-- Initialize_125 --
--------------------
procedure Initialize_125 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 125, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 125, (False, 0));
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 125,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0060'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 125, (False, AMF.CMOF.Public_Visibility));
end Initialize_125;
--------------------
-- Initialize_126 --
--------------------
procedure Initialize_126 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 126, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 126, (False, 0));
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 126,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_005D'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 126, (False, AMF.CMOF.Public_Visibility));
end Initialize_126;
--------------------
-- Initialize_127 --
--------------------
procedure Initialize_127 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 127, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 127, (False, 0));
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 127,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_008A'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 127, (False, AMF.CMOF.Public_Visibility));
end Initialize_127;
--------------------
-- Initialize_128 --
--------------------
procedure Initialize_128 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 128, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 128, (False, 0));
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 128,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_002B'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 128, (False, AMF.CMOF.Public_Visibility));
end Initialize_128;
--------------------
-- Initialize_129 --
--------------------
procedure Initialize_129 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Body
(Base + 129,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0072'Access);
end Initialize_129;
--------------------
-- Initialize_130 --
--------------------
procedure Initialize_130 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Body
(Base + 130,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0048'Access);
end Initialize_130;
--------------------
-- Initialize_131 --
--------------------
procedure Initialize_131 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 131,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_004D'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 131, (Is_Empty => True));
end Initialize_131;
--------------------
-- Initialize_132 --
--------------------
procedure Initialize_132 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 132, (Is_Empty => True));
end Initialize_132;
--------------------
-- Initialize_133 --
--------------------
procedure Initialize_133 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Body
(Base + 133,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_002A'Access);
end Initialize_133;
--------------------
-- Initialize_134 --
--------------------
procedure Initialize_134 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 134,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0053'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 134, (Is_Empty => True));
end Initialize_134;
--------------------
-- Initialize_135 --
--------------------
procedure Initialize_135 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 135, (Is_Empty => True));
end Initialize_135;
--------------------
-- Initialize_136 --
--------------------
procedure Initialize_136 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Body
(Base + 136,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_008B'Access);
end Initialize_136;
--------------------
-- Initialize_137 --
--------------------
procedure Initialize_137 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Body
(Base + 137,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_001C'Access);
end Initialize_137;
--------------------
-- Initialize_138 --
--------------------
procedure Initialize_138 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Body
(Base + 138,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_000F'Access);
end Initialize_138;
--------------------
-- Initialize_139 --
--------------------
procedure Initialize_139 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Body
(Base + 139,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0046'Access);
end Initialize_139;
--------------------
-- Initialize_140 --
--------------------
procedure Initialize_140 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Body
(Base + 140,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0009'Access);
end Initialize_140;
--------------------
-- Initialize_141 --
--------------------
procedure Initialize_141 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Body
(Base + 141,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0031'Access);
end Initialize_141;
--------------------
-- Initialize_142 --
--------------------
procedure Initialize_142 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Body
(Base + 142,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0004'Access);
end Initialize_142;
--------------------
-- Initialize_143 --
--------------------
procedure Initialize_143 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Body
(Base + 143,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0047'Access);
end Initialize_143;
--------------------
-- Initialize_144 --
--------------------
procedure Initialize_144 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Body
(Base + 144,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0039'Access);
end Initialize_144;
--------------------
-- Initialize_145 --
--------------------
procedure Initialize_145 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Body
(Base + 145,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0034'Access);
end Initialize_145;
--------------------
-- Initialize_146 --
--------------------
procedure Initialize_146 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 146,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0087'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 146, (Is_Empty => True));
end Initialize_146;
--------------------
-- Initialize_147 --
--------------------
procedure Initialize_147 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 147, (Is_Empty => True));
end Initialize_147;
--------------------
-- Initialize_148 --
--------------------
procedure Initialize_148 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Body
(Base + 148,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0018'Access);
end Initialize_148;
--------------------
-- Initialize_149 --
--------------------
procedure Initialize_149 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 149,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_008E'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 149, (Is_Empty => True));
end Initialize_149;
--------------------
-- Initialize_150 --
--------------------
procedure Initialize_150 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 150, (Is_Empty => True));
end Initialize_150;
--------------------
-- Initialize_151 --
--------------------
procedure Initialize_151 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Body
(Base + 151,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0066'Access);
end Initialize_151;
--------------------
-- Initialize_152 --
--------------------
procedure Initialize_152 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 152,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0053'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 152, (Is_Empty => True));
end Initialize_152;
--------------------
-- Initialize_153 --
--------------------
procedure Initialize_153 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 153, (Is_Empty => True));
end Initialize_153;
--------------------
-- Initialize_154 --
--------------------
procedure Initialize_154 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Body
(Base + 154,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_006C'Access);
end Initialize_154;
--------------------
-- Initialize_155 --
--------------------
procedure Initialize_155 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Body
(Base + 155,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0086'Access);
end Initialize_155;
--------------------
-- Initialize_156 --
--------------------
procedure Initialize_156 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Body
(Base + 156,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0083'Access);
end Initialize_156;
--------------------
-- Initialize_157 --
--------------------
procedure Initialize_157 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Body
(Base + 157,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_003F'Access);
end Initialize_157;
--------------------
-- Initialize_158 --
--------------------
procedure Initialize_158 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Body
(Base + 158,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0058'Access);
end Initialize_158;
--------------------
-- Initialize_159 --
--------------------
procedure Initialize_159 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 159,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_005F'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 159, (Is_Empty => True));
end Initialize_159;
--------------------
-- Initialize_160 --
--------------------
procedure Initialize_160 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 160, (Is_Empty => True));
end Initialize_160;
--------------------
-- Initialize_161 --
--------------------
procedure Initialize_161 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Body
(Base + 161,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0002'Access);
end Initialize_161;
--------------------
-- Initialize_162 --
--------------------
procedure Initialize_162 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Body
(Base + 162,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_003A'Access);
end Initialize_162;
--------------------
-- Initialize_163 --
--------------------
procedure Initialize_163 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Body
(Base + 163,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_007A'Access);
end Initialize_163;
--------------------
-- Initialize_164 --
--------------------
procedure Initialize_164 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Body
(Base + 164,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0024'Access);
end Initialize_164;
--------------------
-- Initialize_165 --
--------------------
procedure Initialize_165 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 165,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_002D'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 165, (Is_Empty => True));
end Initialize_165;
--------------------
-- Initialize_166 --
--------------------
procedure Initialize_166 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 166, (Is_Empty => True));
end Initialize_166;
--------------------
-- Initialize_167 --
--------------------
procedure Initialize_167 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Body
(Base + 167,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_002E'Access);
end Initialize_167;
--------------------
-- Initialize_168 --
--------------------
procedure Initialize_168 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Body
(Base + 168,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_005E'Access);
end Initialize_168;
--------------------
-- Initialize_169 --
--------------------
procedure Initialize_169 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Body
(Base + 169,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0021'Access);
end Initialize_169;
--------------------
-- Initialize_170 --
--------------------
procedure Initialize_170 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 170,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_005A'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 170, (Is_Empty => True));
end Initialize_170;
--------------------
-- Initialize_171 --
--------------------
procedure Initialize_171 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 171, (Is_Empty => True));
end Initialize_171;
--------------------
-- Initialize_172 --
--------------------
procedure Initialize_172 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Body
(Base + 172,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0026'Access);
end Initialize_172;
--------------------
-- Initialize_173 --
--------------------
procedure Initialize_173 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Body
(Base + 173,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0019'Access);
end Initialize_173;
--------------------
-- Initialize_174 --
--------------------
procedure Initialize_174 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Body
(Base + 174,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0021'Access);
end Initialize_174;
--------------------
-- Initialize_175 --
--------------------
procedure Initialize_175 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 175,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_002C'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 175, (Is_Empty => True));
end Initialize_175;
--------------------
-- Initialize_176 --
--------------------
procedure Initialize_176 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 176, (Is_Empty => True));
end Initialize_176;
--------------------
-- Initialize_177 --
--------------------
procedure Initialize_177 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Body
(Base + 177,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0057'Access);
end Initialize_177;
--------------------
-- Initialize_178 --
--------------------
procedure Initialize_178 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 178,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_0023'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 178, (Is_Empty => True));
end Initialize_178;
--------------------
-- Initialize_179 --
--------------------
procedure Initialize_179 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 179, (Is_Empty => True));
end Initialize_179;
--------------------
-- Initialize_180 --
--------------------
procedure Initialize_180 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 180,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_003C'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Value
(Base + 180,
AMF.Internals.Tables.Standard_Profile_L2_String_Data_00.MS_007D'Access);
end Initialize_180;
end AMF.Internals.Tables.Standard_Profile_L2_Metamodel.Properties;
|
--------------------------------------------------------------------------------------------------------------------
-- Copyright (c) 2013-2020, Luke A. Guest
--
-- This software is provided 'as-is', without any express or implied
-- warranty. In no event will the authors be held liable for any damages
-- arising from the use of this software.
--
-- Permission is granted to anyone to use this software for any purpose,
-- including commercial applications, and to alter it and redistribute it
-- freely, subject to the following restrictions:
--
-- 1. The origin of this software must not be misrepresented; you must not
-- claim that you wrote the original software. If you use this software
-- in a product, an acknowledgment in the product documentation would be
-- appreciated but is not required.
--
-- 2. Altered source versions must be plainly marked as such, and must not be
-- misrepresented as being the original software.
--
-- 3. This notice may not be removed or altered from any source
-- distribution.
--------------------------------------------------------------------------------------------------------------------
-- SDL.Video.Windows.Manager
--
-- Access to the underlying window system.
--
-- Due to the nature of free OSes like Linux, one user may be using X11, another XCB, another Wayland and another
-- using Mir. We don't want to use build specific data for all these three, that makes sense for the varying OSes,
-- such as Linux, Windows, MacOS X, etc. So, if building on Windows, the compiler should only allow access to the
-- Windows/WinRT specific stuff, Linux, then X11/Wayland/Mir, etc.
--------------------------------------------------------------------------------------------------------------------
with Interfaces.C;
with SDL.Versions;
package SDL.Video.Windows.Manager is
type WM_Types is (WM_Unknown,
WM_Windows,
WM_X11,
WM_Direct_FB,
WM_Cocoa,
WM_UI_Kit,
WM_Wayland,
WM_Mir,
WM_Win_RT,
WM_Android) with
Convention => C;
type C_Address is access all Interfaces.Unsigned_32 with
Convention => C;
-- These are dummy types that (should) match what a real binding would provide so that the end user can
-- convert these using Unchecked_Conversion to pass into any other API's.
package Windows is
type HWNDs is new C_Address;
type HDCs is new C_Address;
end Windows;
-- WinRT only available since version 2.0.3.
package Win_RT is
type Inspectable is new C_Address;
end Win_RT;
package X11 is
type Display is new C_Address;
type Window is new Interfaces.Unsigned_32;
end X11;
package Direct_FB is
type Direct_FB is new C_Address;
type Direct_FB_Window is new C_Address;
type Direct_FB_Surface is new C_Address;
end Direct_FB;
package Cocoa is
type NS_Window is new C_Address;
end Cocoa;
package UI_Kit is
package C renames Interfaces.C;
type Window is new C_Address;
Frame_Buffer : C.unsigned;
Colour_Buffer : C.unsigned;
Resolve_Frame_Buffer : C.unsigned;
end UI_Kit;
-- Wayland only available since version 2.0.2.
package Wayland is
type Display is new C_Address;
type Surface is new C_Address;
type Shell_Surface is new C_Address;
end Wayland;
-- Mir only available since version 2.0.2.
package Mir is
type Connection is new C_Address;
type Surface is new C_Address;
end Mir;
-- Android only available since version 2.0.4.
package Android is
type Native_Window is new C_Address;
type EGL_Surface is new C_Address;
end Android;
type Information (WM : WM_Types) is
record
case WM is
when WM_Unknown =>
null;
when WM_Windows =>
HWND : Windows.HWNDs;
HDC : Windows.HDCs;
when WM_Win_RT =>
RT_Inspectable : Win_RT.Inspectable;
when WM_X11 =>
X11_Display : X11.Display;
X11_Window : X11.Window;
when WM_Direct_FB =>
DFB_Main_Interface : Direct_FB.Direct_FB;
DFB_Window : Direct_FB.Direct_FB_Window;
DFB_Surface : Direct_FB.Direct_FB_Surface;
when WM_Cocoa =>
Cocoa_Window : Cocoa.NS_Window;
when WM_UI_Kit =>
UIK_Window : UI_Kit.Window;
UIK_Frame_Buffer : UI_Kit.Window;
UIK_Colour_Buffer : UI_Kit.Window;
UIK_Resolve_Frame_Buffer : UI_Kit.Window;
when WM_Wayland =>
Wayland_Display : Wayland.Display;
Wayland_Surface : Wayland.Surface;
Wayland_Shell_Surface : Wayland.Shell_Surface;
when WM_Mir =>
Mir_Connection : Mir.Connection;
Mir_Surface : Mir.Surface;
when WM_Android =>
Android_Window : Android.Native_Window;
Android_Surface : Android.EGL_Surface;
end case;
end record with
Unchecked_Union;
type WM_Info is
record
Version : SDL.Versions.Version;
Sub_System : WM_Types;
Info : Information (WM => WM_Unknown);
end record with
Convention => C;
function Get_WM_Info (Win : in Window; Info : out WM_Info) return Boolean with
Inline => True;
end SDL.Video.Windows.Manager;
|
with ObjectPack, AbstractStrategyCombinatorPackage, IntrospectorPackage, StrategyPackage;
use ObjectPack, AbstractStrategyCombinatorPackage, IntrospectorPackage, StrategyPackage;
package FailStrategy is
type Fail is new AbstractStrategyCombinator and Object with
record
message: access String := null;
end record;
----------------------------------------------------------------------------
-- Object implementation
----------------------------------------------------------------------------
function toString(f: Fail) return String;
----------------------------------------------------------------------------
-- Strategy implementation
----------------------------------------------------------------------------
function visitLight(str:access Fail; any: ObjectPtr; i: access Introspector'Class) return ObjectPtr;
function visit(str: access Fail; i: access Introspector'Class) return Integer;
----------------------------------------------------------------------------
function newFail return StrategyPtr;
function newFail(m: String) return StrategyPtr;
function newFail(m: access String) return StrategyPtr;
end FailStrategy;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S Y S T E M . F I N A L I Z A T I O N _ M A S T E R S --
-- --
-- S p e c --
-- --
-- Copyright (C) 2011-2021, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- --
-- --
-- --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with Ada.Finalization;
with System.Storage_Elements;
with System.Storage_Pools;
pragma Compiler_Unit_Warning;
package System.Finalization_Masters is
pragma Preelaborate;
-- A reference to primitive Finalize_Address. The expander generates an
-- implementation of this procedure for each controlled and class-wide
-- type. Since controlled objects are simply viewed as addresses once
-- allocated through a master, Finalize_Address provides a backward
-- indirection from an address to a type-specific context.
type Finalize_Address_Ptr is access procedure (Obj : System.Address);
-- Heterogeneous collection type structure
type FM_Node is private;
type FM_Node_Ptr is access all FM_Node;
pragma No_Strict_Aliasing (FM_Node_Ptr);
-- A reference to any derivation from Root_Storage_Pool. Since this type
-- may not be used to allocate objects, its storage size is zero.
type Any_Storage_Pool_Ptr is
access System.Storage_Pools.Root_Storage_Pool'Class;
for Any_Storage_Pool_Ptr'Storage_Size use 0;
-- Finalization master type structure. A unique master is associated with
-- each access-to-controlled or access-to-class-wide type. Masters also act
-- as components of subpools. By default, a master contains objects of the
-- same designated type but it may also accommodate heterogeneous objects.
type Finalization_Master is
new Ada.Finalization.Limited_Controlled with private;
-- A reference to a finalization master. Since this type may not be used
-- to allocate objects, its storage size is zero.
type Finalization_Master_Ptr is access all Finalization_Master;
for Finalization_Master_Ptr'Storage_Size use 0;
procedure Attach (N : not null FM_Node_Ptr; L : not null FM_Node_Ptr);
-- Compiler interface, do not call from within the run-time. Prepend a
-- node to a specific finalization master.
procedure Attach_Unprotected
(N : not null FM_Node_Ptr;
L : not null FM_Node_Ptr);
-- Prepend a node to a specific finalization master
procedure Delete_Finalize_Address_Unprotected (Obj : System.Address);
-- Destroy the relation pair object - Finalize_Address from the internal
-- hash table.
procedure Detach_Unprotected (N : not null FM_Node_Ptr);
-- Remove a node from an arbitrary finalization master
overriding procedure Finalize (Master : in out Finalization_Master);
-- Lock the master to prevent allocations during finalization. Iterate over
-- the list of allocated controlled objects, finalizing each one by calling
-- its specific Finalize_Address. In the end, deallocate the dummy head.
function Finalize_Address
(Master : Finalization_Master) return Finalize_Address_Ptr;
-- Return a reference to the TSS primitive Finalize_Address associated with
-- a master.
function Finalize_Address_Unprotected
(Obj : System.Address) return Finalize_Address_Ptr;
-- Retrieve the Finalize_Address primitive associated with a particular
-- object.
function Finalization_Started (Master : Finalization_Master) return Boolean;
-- Return the finalization status of a master
function Header_Size return System.Storage_Elements.Storage_Count;
-- Return the size of type FM_Node as Storage_Count
function Is_Homogeneous (Master : Finalization_Master) return Boolean;
-- Return the behavior flag of a master
function Objects (Master : Finalization_Master) return FM_Node_Ptr;
-- Return the header of the doubly-linked list of controlled objects
procedure Print_Master (Master : Finalization_Master);
-- Debug routine, outputs the contents of a master
procedure Set_Finalize_Address
(Master : in out Finalization_Master;
Fin_Addr_Ptr : Finalize_Address_Ptr);
-- Compiler interface, do not call from within the run-time. Set the clean
-- up routine of a finalization master
procedure Set_Finalize_Address_Unprotected
(Master : in out Finalization_Master;
Fin_Addr_Ptr : Finalize_Address_Ptr);
-- Set the clean up routine of a finalization master
procedure Set_Heterogeneous_Finalize_Address_Unprotected
(Obj : System.Address;
Fin_Addr_Ptr : Finalize_Address_Ptr);
-- Add a relation pair object - Finalize_Address to the internal hash
-- table. This is done in the context of allocation on a heterogeneous
-- finalization master where a single master services multiple anonymous
-- access-to-controlled types.
procedure Set_Is_Heterogeneous (Master : in out Finalization_Master);
-- Mark the master as being a heterogeneous collection of objects
private
-- Heterogeneous collection type structure
type FM_Node is record
Prev : FM_Node_Ptr := null;
Next : FM_Node_Ptr := null;
end record;
-- Finalization master type structure. A unique master is associated with
-- each access-to-controlled or access-to-class-wide type. Masters also act
-- as components of subpools. By default, a master contains objects of the
-- same designated type but it may also accommodate heterogeneous objects.
type Finalization_Master is
new Ada.Finalization.Limited_Controlled with
record
Is_Homogeneous : Boolean := True;
-- A flag which controls the behavior of the master. A value of False
-- denotes a heterogeneous collection.
Base_Pool : Any_Storage_Pool_Ptr := null;
-- A reference to the pool which this finalization master services. This
-- field is used in conjunction with the build-in-place machinery.
Objects : aliased FM_Node;
-- A doubly linked list which contains the headers of all controlled
-- objects allocated in a [sub]pool.
Finalize_Address : Finalize_Address_Ptr := null;
-- A reference to the routine reponsible for object finalization. This
-- is used only when the master is in homogeneous mode.
Finalization_Started : Boolean := False;
-- A flag used to detect allocations which occur during the finalization
-- of a master. The allocations must raise Program_Error. This scenario
-- may arise in a multitask environment.
end record;
-- Since RTSfind cannot contain names of the form RE_"+", the following
-- routine serves as a wrapper around System.Storage_Elements."+".
function Add_Offset_To_Address
(Addr : System.Address;
Offset : System.Storage_Elements.Storage_Offset) return System.Address;
function Base_Pool
(Master : Finalization_Master) return Any_Storage_Pool_Ptr;
-- Return a reference to the underlying storage pool on which the master
-- operates.
overriding procedure Initialize (Master : in out Finalization_Master);
-- Initialize the dummy head of a finalization master
procedure Set_Base_Pool
(Master : in out Finalization_Master;
Pool_Ptr : Any_Storage_Pool_Ptr);
-- Set the underlying pool of a finalization master
end System.Finalization_Masters;
|
------------------------------------------------------------------------------
-- G E L A X 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 Asis.Elements;
with Asis.Expressions;
with Asis.Definitions;
with Asis.Declarations;
with XASIS.Utils;
with XASIS.Classes;
package body XASIS.Static.Iter is
use Asis;
use Asis.Elements;
function Evaluate_Static_Function
(Object : access Calculator;
Func : in Asis.Element;
Args : in Asis.Association_List;
Name : in Asis.Expression) return Value;
function Statically_Denote
(Element : in Asis.Expression) return Asis.Element;
function Get_Type_Class (Name : Asis.Expression) return Classes.Type_Info;
-- Return type info for prefix of an attribute
function Evaluate_Defined
(Object : access Calculator;
Element : in Asis.Expression) return Value;
-- Ranges --
function Get_Range
(Object : access Calculator;
Element : in Asis.Range_Constraint) return Static_Range;
function Static_Indication_Range
(Object : access Calculator;
Def : in Asis.Subtype_Indication;
Base : in Boolean := False)
return Static_Range;
function Static_Subtype_Range
(Object : access Calculator;
Mark : in Asis.Expression;
Cons : in Asis.Constraint := Asis.Nil_Element;
Base : in Boolean := False)
return Static_Range;
--------------
-- Evaluate --
--------------
function Evaluate
(Object : access Calculator;
Element : in Asis.Expression) return Value
is
use Asis.Expressions;
Kind : constant Asis.Expression_Kinds := Expression_Kind (Element);
begin
case Kind is
when An_Integer_Literal
| A_Real_Literal
| An_Enumeration_Literal
| A_Character_Literal
| A_String_Literal =>
return Literal (Object, Element);
when An_Identifier
| A_Selected_Component
=>
declare
Decl : Asis.Declaration :=
XASIS.Utils.Selected_Name_Declaration (Element, False);
begin
case Declaration_Kind (Decl) is
when An_Integer_Number_Declaration
| A_Real_Number_Declaration =>
return Evaluate
(Object,
Asis.Declarations.Initialization_Expression (Decl));
when An_Enumeration_Literal_Specification =>
-- Because An_Enumeration_Literal stored as
-- An_Identifier till resolution complete, we keep
-- this call here.
return Literal (Object, Element);
when others =>
return Evaluate_Static_Constant (Object, Decl);
end case;
end;
when A_Function_Call =>
declare
Func : Asis.Element := Statically_Denote (Prefix (Element));
Attr : Boolean := Expression_Kind (Prefix (Element)) =
An_Attribute_Reference;
Args : Asis.Association_List :=
Function_Call_Parameters (Element, not Attr);
begin
return Evaluate_Static_Function
(Object, Func, Args, Prefix (Element));
end;
when An_Attribute_Reference =>
declare
Mark : Asis.Expression := Asis.Expressions.Prefix (Element);
Info : Classes.Type_Info := Get_Type_Class (Name => Mark);
Kind : Asis.Attribute_Kinds := Attribute_Kind (Element);
begin
return Attribute (Object, Info, Kind, Element);
end;
when A_Type_Conversion | A_Qualified_Expression =>
declare
Arg : constant Asis.Expression :=
Converted_Or_Qualified_Expression (Element);
begin
return Evaluate (Object, Arg);
end;
when An_In_Range_Membership_Test
| A_Not_In_Range_Membership_Test
| An_In_Type_Membership_Test
| A_Not_In_Type_Membership_Test
=>
declare
function Get_Range return Static_Range is
begin
if Kind = An_In_Range_Membership_Test
or Kind = A_Not_In_Range_Membership_Test
then
return Get_Range
(Object, Membership_Test_Range (Element));
else
return Static_Subtype_Range
(Object, Membership_Test_Subtype_Mark (Element));
end if;
end Get_Range;
Bnd : Static_Range := Get_Range;
Arg : Asis.Expression := Membership_Test_Expression (Element);
Inv : constant Boolean := Kind = A_Not_In_Range_Membership_Test
or Kind = A_Not_In_Type_Membership_Test;
begin
return Check_Range (Object, Arg, Bnd, Inv);
end;
when A_Parenthesized_Expression =>
declare
Arg : constant Asis.Expression :=
Expression_Parenthesized (Element);
begin
return Evaluate (Object, Arg);
end;
when others =>
Raise_Error (Internal_Error);
return Undefined (Object, Asis.Nil_Element);
end case;
end Evaluate;
----------------------
-- Evaluate_Defined --
----------------------
function Evaluate_Defined
(Object : access Calculator;
Element : in Asis.Expression) return Value is
begin
-- Check implementation-defined mark
if Is_Part_Of_Implicit (Element) then
return Undefined (Object, Element);
else
return Evaluate (Object, Element);
end if;
end Evaluate_Defined;
------------------------------
-- Evaluate_Static_Constant --
------------------------------
function Evaluate_Static_Constant
(Object : access Calculator;
Element : in Asis.Declaration)
return Value
is
use Asis.Declarations;
begin
case Declaration_Kind (Element) is
when An_Object_Renaming_Declaration =>
return Evaluate (Object, Renamed_Entity (Element));
when A_Constant_Declaration =>
return Evaluate (Object, Initialization_Expression (Element));
when others =>
Raise_Error (Internal_Error);
return Undefined (Object, Asis.Nil_Element);
end case;
end Evaluate_Static_Constant;
------------------------------
-- Evaluate_Static_Function --
------------------------------
function Evaluate_Static_Function
(Object : access Calculator;
Func : in Asis.Element;
Args : in Asis.Association_List;
Name : in Asis.Expression) return Value
is
begin
if Element_Kind (Func) = A_Declaration then
if XASIS.Utils.Is_Predefined_Operator (Func) then
declare
use Asis.Declarations;
Name : Asis.Defining_Name :=
XASIS.Utils.Declaration_Name (Func);
Decl : Asis.Declaration :=
Enclosing_Element (Corresponding_Type (Func));
Info : Classes.Type_Info :=
XASIS.Classes.Type_From_Declaration (Decl);
begin
return Operator (Object, Info, Operator_Kind (Name), Args);
end;
elsif Declaration_Kind (Func) =
An_Enumeration_Literal_Specification
then
return Evaluate (Object, Name);
end if;
elsif Expression_Kind (Func) = An_Attribute_Reference then
declare
Mark : Asis.Expression := Asis.Expressions.Prefix (Func);
Info : Classes.Type_Info := Get_Type_Class (Name => Mark);
begin
return Attribute_Call (Object, Info, Attribute_Kind (Func), Args);
end;
end if;
Raise_Error (Internal_Error);
return Undefined (Object, Asis.Nil_Element);
end Evaluate_Static_Function;
--------------------
-- Get_Type_Class --
--------------------
function Get_Type_Class (Name : Asis.Expression) return Classes.Type_Info is
Info : Classes.Type_Info := Classes.Type_From_Subtype_Mark (Name);
Decl : Asis.Declaration;
begin
if Classes.Is_Not_Type (Info) then
Decl := Statically_Denote (Name);
Info := Classes.Type_Of_Declaration (Decl);
end if;
return Info;
end Get_Type_Class;
-----------------------
-- Statically_Denote --
-----------------------
function Statically_Denote
(Element : in Asis.Expression) return Asis.Element
is
use Asis.Expressions;
use Asis.Declarations;
Expr : Asis.Expression := Element;
Decl : Asis.Declaration;
begin
case Expression_Kind (Element) is
when An_Attribute_Reference =>
return Element;
when An_Identifier | An_Operator_Symbol
| A_Character_Literal | An_Enumeration_Literal
| A_Selected_Component =>
if Expression_Kind (Element) = A_Selected_Component then
Expr := Selector (Element);
end if;
Decl := Corresponding_Name_Declaration (Expr);
if Declaration_Kind (Decl) = An_Object_Renaming_Declaration then
return Statically_Denote (Renamed_Entity (Decl));
else
return Decl;
end if;
when others =>
Raise_Error (Internal_Error);
return Asis.Nil_Element;
end case;
end Statically_Denote;
--------- Ranges ------------------------------------
-------------------------
-- Array_Subtype_Range --
-------------------------
function Array_Subtype_Range
(Object : access Calculator;
Def : in Asis.Subtype_Indication;
Index : in Asis.ASIS_Positive)
return Static_Range
is
use Asis.Definitions;
Cons : Asis.Constraint := Subtype_Constraint (Def);
begin
if Is_Nil (Cons) then
declare
Name : Asis.Expression := Asis.Definitions.Subtype_Mark (Def);
Decl : Asis.Declaration :=
XASIS.Utils.Selected_Name_Declaration (Name, False);
begin
return Constrained_Array_Range (Object, Decl, Index);
end;
else
declare
List : Asis.Discrete_Range_List := Discrete_Ranges (Cons);
begin
return Get_Discrete_Range (Object, List (Index));
end;
end if;
end Array_Subtype_Range;
-----------------------------
-- Constrained_Array_Range --
-----------------------------
function Constrained_Array_Range
(Object : access Calculator;
Decl : in Asis.Declaration;
Index : in Asis.ASIS_Positive)
return Static_Range
is
--------------------
-- Is_Constrained --
--------------------
function Is_Constrained (Def : Asis.Definition) return Boolean is
begin
case Definition_Kind (Def) is
when A_Type_Definition =>
return Type_Kind (Def) = A_Constrained_Array_Definition;
when A_Subtype_Indication =>
declare
Cons : Asis.Constraint :=
Asis.Definitions.Subtype_Constraint (Def);
begin
if not Is_Nil (Cons) then
return True;
else
declare
Name : Asis.Expression :=
Asis.Definitions.Subtype_Mark (Def);
Decl : Asis.Declaration :=
XASIS.Utils.Selected_Name_Declaration (Name, False);
begin
return Is_Constrained
(Asis.Declarations.Type_Declaration_View (Decl));
end;
end if;
end;
when others =>
return False;
end case;
end Is_Constrained;
use Asis.Declarations;
Kind : Asis.Declaration_Kinds := Declaration_Kind (Decl);
Def : Asis.Definition;
begin
case Kind is
when An_Ordinary_Type_Declaration =>
Def := Type_Declaration_View (Decl);
when A_Subtype_Declaration =>
Def := Type_Declaration_View (Decl);
return Array_Subtype_Range (Object, Def, Index);
when A_Variable_Declaration | A_Constant_Declaration =>
Def := Object_Declaration_View (Decl);
if Is_Constrained (Def) then
case Definition_Kind (Def) is
when A_Type_Definition =>
null;
when A_Subtype_Indication =>
return Array_Subtype_Range (Object, Def, Index);
when others =>
Raise_Error (Internal_Error);
end case;
elsif Kind = A_Constant_Declaration and Index = 1 then
return String_Constant_Range (Object, Decl);
else
Raise_Error (Internal_Error);
end if;
when An_Object_Renaming_Declaration =>
return String_Constant_Range (Object, Decl);
when others =>
Raise_Error (Internal_Error);
end case;
case Type_Kind (Def) is
when A_Constrained_Array_Definition =>
declare
List : Asis.Definition_List :=
Asis.Definitions.Discrete_Subtype_Definitions (Def);
begin
return Get_Discrete_Range (Object, List (Index));
end;
when others =>
Raise_Error (Internal_Error);
end case;
raise Evaluation_Error;
end Constrained_Array_Range;
------------------------
-- Get_Discrete_Range --
------------------------
function Get_Discrete_Range -- Is_Static_Discrete_Subtype
(Object : access Calculator;
Element : in Asis.Definition) return Static_Range
is
use Asis.Definitions;
begin
case Discrete_Range_Kind (Element) is
when A_Discrete_Subtype_Indication =>
return Static_Indication_Range (Object, Element);
when A_Discrete_Range_Attribute_Reference =>
return Static_Range_Attribute (Object, Range_Attribute (Element));
when A_Discrete_Simple_Expression_Range =>
return (Evaluate_Defined (Object, Lower_Bound (Element)),
Evaluate_Defined (Object, Upper_Bound (Element)));
when others =>
Raise_Error (Internal_Error);
end case;
raise Evaluation_Error;
end Get_Discrete_Range;
---------------
-- Get_Range --
---------------
function Get_Range
(Object : access Calculator;
Element : in Asis.Range_Constraint) return Static_Range
is
use Asis.Expressions;
use Asis.Definitions;
begin
case Constraint_Kind (Element) is
when A_Range_Attribute_Reference =>
return Static_Range_Attribute (Object, Range_Attribute (Element));
when A_Simple_Expression_Range =>
return (Evaluate_Defined (Object, Lower_Bound (Element)),
Evaluate_Defined (Object, Upper_Bound (Element)));
when others =>
Raise_Error (Internal_Error);
end case;
raise Evaluation_Error;
end Get_Range;
-----------------------------
-- Static_Indication_Range --
-----------------------------
function Static_Indication_Range
(Object : access Calculator;
Def : in Asis.Subtype_Indication;
Base : in Boolean := False)
return Static_Range
is
Name : Asis.Expression :=
Asis.Definitions.Subtype_Mark (Def);
Cons : Asis.Constraint :=
Asis.Definitions.Subtype_Constraint (Def);
begin
return Static_Subtype_Range (Object, Name, Cons, Base);
end Static_Indication_Range;
----------------------------
-- Static_Range_Attribute --
----------------------------
function Static_Range_Attribute -- Is_Static_Bound
(Object : access Calculator;
Attr : in Asis.Expression) return Static_Range
is
Prefix : Asis.Expression := Asis.Expressions.Prefix (Attr);
Info : Classes.Type_Info := Classes.Type_From_Subtype_Mark (Prefix);
Index : Asis.ASIS_Positive := 1;
begin -- Static_Range_Attribute
if Classes.Is_Scalar (Info) then
return Static_Subtype_Range (Object, Prefix);
else
declare
Decl : Asis.Declaration := Statically_Denote (Prefix);
begin
return Range_Of_Array (Object, Decl, Attr);
end;
end if;
end Static_Range_Attribute;
--------------------------
-- Static_Subtype_Range --
--------------------------
function Static_Subtype_Range
(Object : access Calculator;
Mark : in Asis.Expression;
Cons : in Asis.Constraint := Asis.Nil_Element;
Base : in Boolean := False)
return Static_Range
is
use Asis.Expressions;
use Asis.Definitions;
use Asis.Declarations;
Decl : Asis.Declaration;
Def : Asis.Definition;
begin
if not Base and not Is_Nil (Cons) then
return Get_Range (Object, Cons);
end if;
if Expression_Kind (Mark) = An_Attribute_Reference then
if Attribute_Kind (Mark) = A_Base_Attribute then
return Static_Subtype_Range (Object, Prefix (Mark), Base => True);
else
Raise_Error (Internal_Error);
end if;
end if;
Decl := XASIS.Utils.Selected_Name_Declaration (Mark, False);
Def := Type_Declaration_View (Decl);
case Definition_Kind (Def) is
when A_Subtype_Indication =>
return Static_Indication_Range (Object, Def, Base);
when A_Type_Definition =>
case Type_Kind (Def) is
when A_Derived_Type_Definition =>
Def := Parent_Subtype_Indication (Def);
return Static_Indication_Range (Object, Def, Base);
when An_Enumeration_Type_Definition =>
return Range_Of_Type (Object, Def);
when A_Signed_Integer_Type_Definition =>
if Base then
return Range_Of_Type (Object, Def);
else
return Get_Range (Object, Integer_Constraint (Def));
end if;
when A_Modular_Type_Definition =>
return Range_Of_Type (Object, Def);
when A_Floating_Point_Definition
| An_Ordinary_Fixed_Point_Definition
| A_Decimal_Fixed_Point_Definition
=>
declare
Rng : Asis.Range_Constraint :=
Real_Range_Constraint (Def);
begin
if Is_Nil (Rng) or Base then
return Range_Of_Type (Object, Def);
else
return Get_Range (Object, Rng);
end if;
end;
when others =>
Raise_Error (Internal_Error);
end case;
when others =>
Raise_Error (Internal_Error);
end case;
raise Evaluation_Error;
end Static_Subtype_Range;
end XASIS.Static.Iter;
------------------------------------------------------------------------------
-- Copyright (c) 2006-2013, 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.
------------------------------------------------------------------------------
|
with System;
with Ada.Synchronous_Task_Control; use Ada.Synchronous_Task_Control;
with STM32_SVD; use STM32_SVD;
with STM32GD.Board; use STM32GD.Board;
with Packet; use Packet;
with CBOR_Codec;
with RTC_IRQ;
with RTC;
with Peripherals;
with Utils;
procedure Main is
Date_Time : RTC.Date_Time_Type;
Temperature : Peripherals.Si7006.Temperature_Type;
Humidity : Peripherals.Si7006.Humidity_Type;
Node_Name : String (1 .. 7 + 8);
procedure Generate_Node_Name is
Device_ID_0 : UInt32
with Import, Address => System'To_Address (16#1FFF_F7AC#);
Device_ID_1 : UInt32
with Import, Address => System'To_Address (16#1FFF_F7B0#);
Device_ID_2 : UInt32
with Import, Address => System'To_Address (16#1FFF_F7B4#);
HW_ID : UInt32;
begin
HW_ID := (Device_ID_0 xor Device_ID_1 xor Device_ID_2) + 1;
Node_Name := "Sensor/" & Utils.To_Hex_String (UInt32 (HW_ID));
end Generate_Node_Name;
RF_Message : Radio.Packet_Type;
RF_Message_Index : Radio.Packet_Size_Type;
procedure Write_To_RF_Message (Data : Byte);
function Read_From_RF_Message return Byte;
package RF_CBOR is new CBOR_Codec (
Write => Write_To_RF_Message,
Read => Read_From_RF_Message);
procedure Start_RF_Message is
begin
RF_Message_Index := RF_Message'First;
end Start_RF_Message;
procedure Write_To_RF_Message (Data : Byte) is
begin
RF_Message (RF_Message_Index) := Data;
RF_Message_Index := RF_Message_Index + 1;
end Write_To_RF_Message;
function Read_From_RF_Message return Byte is
B : Byte;
begin
B := RF_Message (RF_Message_Index);
RF_Message_Index := RF_Message_Index + 1;
return B;
end Read_From_RF_Message;
procedure Send_Ping is
begin
Start_RF_Message;
RF_CBOR.Encode_Tag (Ping_Tag);
RF_CBOR.Encode_Byte_String ("Sensor");
Radio.TX (RF_Message);
end Send_Ping;
procedure Read_Sensor_Data is
begin
Temperature := Peripherals.Si7006.Temperature_x100;
Humidity := Peripherals.Si7006.Humidity;
end Read_Sensor_Data;
procedure Send_Sensor_Data is
begin
Start_RF_Message;
RF_CBOR.Encode_Tag (Sensor_Reading_Tag);
RF_CBOR.Encode_Array (4);
RF_CBOR.Encode_Byte_String (Node_Name);
RF_CBOR.Encode_Tag (Voltage_Tag);
RF_CBOR.Encode_Decimal_Fraction (Peripherals.Supply_Voltage, -3);
RF_CBOR.Encode_Tag (Temperature_Tag);
RF_CBOR.Encode_Decimal_Fraction (Temperature, -2);
RF_CBOR.Encode_Tag (Humidity_Tag);
RF_CBOR.Encode_Decimal_Fraction (Humidity, 0);
Text_IO.Put ("Packet: ");
for I in Integer range RF_Message'First .. RF_Message_Index loop
Text_IO.Put (Utils.To_Hex_String (RF_Message (I)));
end loop;
Text_IO.New_Line;
Radio.TX (RF_Message);
end Send_Sensor_Data;
begin
Init;
RTC.Init;
Peripherals.Init;
RTC.Read (Date_Time);
Generate_Node_Name;
Text_IO.Put_Line ("Sensor " & Node_Name & " starting");
loop
LED2.Set;
Text_IO.Put_Line ("Reading sensor data");
Read_Sensor_Data;
Send_Sensor_Data;
Radio.Power_Down;
RTC.Read (Date_Time);
RTC.Add_Seconds (Date_Time, 1 * 15);
RTC.Set_Alarm (Date_Time);
LED2.Clear;
Text_IO.Put_Line ("Entering sleep");
Peripherals.Power_Down;
Peripherals.Enable_Stop_Mode (True);
Suspend_Until_True (RTC_IRQ.Alarm_Occurred);
Peripherals.Power_Up;
Text_IO.Put_Line ("Exited sleep");
end loop;
end Main;
|
with TTS_Example2;
with Ada.Exceptions; use Ada.Exceptions;
with Ada.Real_Time;
with Ada.Text_IO; use Ada.Text_IO;
procedure Main2 is
begin
TTS_Example2.Main;
delay until Ada.Real_Time.Time_Last;
exception
when E : others =>
Put_Line (Exception_Message (E));
end Main2;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- O S I N T - B --
-- --
-- B o d y --
-- --
-- Copyright (C) 2001-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 Opt; use Opt;
with Output; use Output;
package body Osint.B is
Current_List_File : File_Descriptor := Invalid_FD;
-------------------------
-- Close_Binder_Output --
-------------------------
procedure Close_Binder_Output is
Status : Boolean;
begin
Close (Output_FD, Status);
if not Status then
Fail
("error while closing generated file "
& Get_Name_String (Output_File_Name));
end if;
end Close_Binder_Output;
---------------------
-- Close_List_File --
---------------------
procedure Close_List_File is
begin
if Current_List_File /= Invalid_FD then
Close (Current_List_File);
Current_List_File := Invalid_FD;
Set_Standard_Output;
end if;
end Close_List_File;
--------------------------
-- Create_Binder_Output --
--------------------------
procedure Create_Binder_Output
(Output_File_Name : String;
Typ : Character;
Bfile : out Name_Id)
is
File_Name : String_Ptr;
Findex1 : Natural;
Findex2 : Natural;
Flength : Natural;
Bind_File_Prefix_Len : constant Natural := 2;
-- Length of binder file prefix (2 for b~)
begin
if Output_File_Name /= "" then
Name_Buffer (1 .. Output_File_Name'Length) := Output_File_Name;
Name_Buffer (Output_File_Name'Length + 1) := ASCII.NUL;
if Typ = 's' then
Name_Buffer (Output_File_Name'Last) := 's';
end if;
Name_Len := Output_File_Name'Last;
else
Name_Buffer (1) := 'b';
File_Name := File_Names (Current_File_Name_Index);
Findex1 := File_Name'First;
-- The ali file might be specified by a full path name. However,
-- the binder generated file should always be created in the
-- current directory, so the path might need to be stripped away.
-- In addition to the default directory_separator allow the '/' to
-- act as separator since this is allowed in MS-DOS and OS2 ports.
for J in reverse File_Name'Range loop
if File_Name (J) = Directory_Separator
or else File_Name (J) = '/'
then
Findex1 := J + 1;
exit;
end if;
end loop;
Findex2 := File_Name'Last;
while File_Name (Findex2) /= '.' loop
Findex2 := Findex2 - 1;
end loop;
Flength := Findex2 - Findex1;
if Maximum_File_Name_Length > 0 then
-- Make room for the extra two characters in "b?"
while Int (Flength) >
Maximum_File_Name_Length - Nat (Bind_File_Prefix_Len)
loop
Findex2 := Findex2 - 1;
Flength := Findex2 - Findex1;
end loop;
end if;
Name_Buffer
(Bind_File_Prefix_Len + 1 .. Flength + Bind_File_Prefix_Len) :=
File_Name (Findex1 .. Findex2 - 1);
Name_Buffer (Flength + Bind_File_Prefix_Len + 1) := '.';
-- Ada bind file, name is b~xxx.adb or b~xxx.ads
Name_Buffer (2) := '~';
Name_Buffer (Flength + Bind_File_Prefix_Len + 2) := 'a';
Name_Buffer (Flength + Bind_File_Prefix_Len + 3) := 'd';
Name_Buffer (Flength + Bind_File_Prefix_Len + 4) := Typ;
Name_Buffer (Flength + Bind_File_Prefix_Len + 5) := ASCII.NUL;
Name_Len := Flength + Bind_File_Prefix_Len + 4;
end if;
Bfile := Name_Find;
Create_File_And_Check (Output_FD, Text);
end Create_Binder_Output;
--------------------
-- More_Lib_Files --
--------------------
function More_Lib_Files return Boolean renames More_Files;
------------------------
-- Next_Main_Lib_File --
------------------------
function Next_Main_Lib_File return File_Name_Type renames Next_Main_File;
---------------------------------
-- Set_Current_File_Name_Index --
---------------------------------
procedure Set_Current_File_Name_Index (To : Int) is
begin
Current_File_Name_Index := To;
end Set_Current_File_Name_Index;
-------------------
-- Set_List_File --
-------------------
procedure Set_List_File (Filename : String) is
begin
pragma Assert (Current_List_File = Invalid_FD);
Current_List_File := Create_File (Filename, Text);
if Current_List_File = Invalid_FD then
Fail ("cannot create list file: " & Filename);
else
Set_Output (Current_List_File);
end if;
end Set_List_File;
-----------------------
-- Write_Binder_Info --
-----------------------
procedure Write_Binder_Info (Info : String) renames Write_Info;
begin
Set_Program (Binder);
end Osint.B;
|
-- { dg-do compile }
-- { dg-options "-O2" }
with Opt8_Pkg;
package body Opt8 is
function Content_Value (Rec : Kappa_Component_Rec)
return Value_Number is
begin
return Opt8_Pkg.Id_To_VN (Rec.Content_VN);
end;
function Possible_Values_Count (V: Kappa_Component_Ptr) return Natural is
Result : Natural := 0;
List : Kappa_Component_Ptr := V;
begin
while List /= null loop
Result := Result +1;
List := List.Next;
end loop;
return Result;
end;
function VN_Complexity (Val : Value_Number; N : Natural)
return Natural is
Result : Natural := 0;
begin
case Val.Kind is
when Membership_VN =>
Result := VN_Complexity(Val, N);
when Selected_Address_VN =>
Result := VN_Complexity(Val, N) + 1;
when Kappa_VN =>
Result := Possible_Values_Count(Val.Possible_New_Values)*3;
if Val.Use_Default then
if Result < N then
Result := Result +
VN_Complexity(Content_Value (Val.old_Value), N);
end if;
end if;
when others =>
Result := 0;
end case;
return Result;
end;
end Opt8;
|
with STM32GD.Board; use STM32GD.Board;
procedure Main is
begin
Init;
loop
USART.Transmit (USART.Receive);
LED.Toggle;
end loop;
end Main;
|
package body Last_Chance_Handler is
-------------------------
-- Last_Chance_Handler --
-------------------------
procedure Last_Chance_Handler (Msg : System.Address; Line : Integer) is
pragma Unreferenced (Msg, Line);
procedure OS_Exit (Status : Integer);
pragma Import (C, OS_Exit, "exit");
pragma No_Return (OS_Exit);
begin
-- No return procedure.
OS_Exit (1);
end Last_Chance_Handler;
end Last_Chance_Handler;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- B I N D O . D I A G N O S T I C S --
-- --
-- B o d y --
-- --
-- Copyright (C) 2019-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. 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 Binderr; use Binderr;
with Debug; use Debug;
with Rident; use Rident;
with Types; use Types;
with Bindo.Validators;
use Bindo.Validators;
use Bindo.Validators.Cycle_Validators;
with Bindo.Writers;
use Bindo.Writers;
use Bindo.Writers.Cycle_Writers;
use Bindo.Writers.Phase_Writers;
package body Bindo.Diagnostics is
-----------------------
-- Local subprograms --
-----------------------
procedure Diagnose_All_Cycles (Inv_Graph : Invocation_Graph);
pragma Inline (Diagnose_All_Cycles);
-- Emit diagnostics for all cycles of library graph G
procedure Diagnose_Cycle
(Inv_Graph : Invocation_Graph;
Cycle : Library_Graph_Cycle_Id);
pragma Inline (Diagnose_Cycle);
-- Emit diagnostics for cycle Cycle of library graph G
procedure Find_And_Output_Invocation_Paths
(Inv_Graph : Invocation_Graph;
Source : Library_Graph_Vertex_Id;
Destination : Library_Graph_Vertex_Id);
pragma Inline (Find_And_Output_Invocation_Paths);
-- Find all paths in invocation graph Inv_Graph that originate from vertex
-- Source and reach vertex Destination of library graph Lib_Graph. Output
-- the transitions of each such path.
function Find_Elaboration_Root
(Inv_Graph : Invocation_Graph;
Vertex : Library_Graph_Vertex_Id) return Invocation_Graph_Vertex_Id;
pragma Inline (Find_Elaboration_Root);
-- Find the elaboration root in invocation graph Inv_Graph that corresponds
-- to vertex Vertex of library graph Lib_Graph.
procedure Output_All_Cycles_Suggestions (G : Library_Graph);
pragma Inline (Output_All_Cycles_Suggestions);
-- Suggest the diagnostic of all cycles in library graph G if circumstances
-- allow it.
procedure Output_Elaborate_All_Suggestions
(G : Library_Graph;
Pred : Library_Graph_Vertex_Id;
Succ : Library_Graph_Vertex_Id);
pragma Inline (Output_Elaborate_All_Suggestions);
-- Suggest ways to break a cycle that involves an Elaborate_All edge that
-- links predecessor Pred and successor Succ of library graph G.
procedure Output_Elaborate_All_Transition
(G : Library_Graph;
Source : Library_Graph_Vertex_Id;
Actual_Destination : Library_Graph_Vertex_Id;
Expected_Destination : Library_Graph_Vertex_Id);
pragma Inline (Output_Elaborate_All_Transition);
-- Output a transition through an Elaborate_All edge of library graph G
-- with successor Source and predecessor Actual_Destination. Parameter
-- Expected_Destination denotes the predecessor as specified by the next
-- edge in a cycle.
procedure Output_Elaborate_Body_Suggestions
(G : Library_Graph;
Succ : Library_Graph_Vertex_Id);
pragma Inline (Output_Elaborate_Body_Suggestions);
-- Suggest ways to break a cycle that involves an edge where successor Succ
-- is either a spec subject to pragma Elaborate_Body or the body of such a
-- spec.
procedure Output_Elaborate_Body_Transition
(G : Library_Graph;
Source : Library_Graph_Vertex_Id;
Actual_Destination : Library_Graph_Vertex_Id;
Expected_Destination : Library_Graph_Vertex_Id;
Elaborate_All_Active : Boolean);
pragma Inline (Output_Elaborate_Body_Transition);
-- Output a transition through an edge of library graph G with successor
-- Source and predecessor Actual_Destination. Vertex Source is either
-- a spec subject to pragma Elaborate_Body or denotes the body of such
-- a spec. Expected_Destination denotes the predecessor as specified by
-- the next edge in a cycle. Elaborate_All_Active should be set when the
-- transition occurs within a cycle that involves an Elaborate_All edge.
procedure Output_Elaborate_Suggestions
(G : Library_Graph;
Pred : Library_Graph_Vertex_Id;
Succ : Library_Graph_Vertex_Id);
pragma Inline (Output_Elaborate_Suggestions);
-- Suggest ways to break a cycle that involves an Elaborate edge that links
-- predecessor Pred and successor Succ of library graph G.
procedure Output_Elaborate_Transition
(G : Library_Graph;
Source : Library_Graph_Vertex_Id;
Actual_Destination : Library_Graph_Vertex_Id;
Expected_Destination : Library_Graph_Vertex_Id);
pragma Inline (Output_Elaborate_Transition);
-- Output a transition through an Elaborate edge of library graph G
-- with successor Source and predecessor Actual_Destination. Parameter
-- Expected_Destination denotes the predecessor as specified by the next
-- edge in a cycle.
procedure Output_Forced_Suggestions
(G : Library_Graph;
Pred : Library_Graph_Vertex_Id;
Succ : Library_Graph_Vertex_Id);
pragma Inline (Output_Forced_Suggestions);
-- Suggest ways to break a cycle that involves a Forced edge that links
-- predecessor Pred with successor Succ of library graph G.
procedure Output_Forced_Transition
(G : Library_Graph;
Source : Library_Graph_Vertex_Id;
Actual_Destination : Library_Graph_Vertex_Id;
Expected_Destination : Library_Graph_Vertex_Id;
Elaborate_All_Active : Boolean);
pragma Inline (Output_Forced_Transition);
-- Output a transition through a Forced edge of library graph G with
-- successor Source and predecessor Actual_Destination. Parameter
-- Expected_Destination denotes the predecessor as specified by the
-- next edge in a cycle. Elaborate_All_Active should be set when the
-- transition occurs within a cycle that involves an Elaborate_All edge.
procedure Output_Full_Encoding_Suggestions
(G : Library_Graph;
Cycle : Library_Graph_Cycle_Id;
First_Edge : Library_Graph_Edge_Id);
pragma Inline (Output_Full_Encoding_Suggestions);
-- Suggest the use of the full path invocation graph encoding to break
-- cycle Cycle with initial edge First_Edge of library graph G.
procedure Output_Invocation_Path
(Inv_Graph : Invocation_Graph;
Elaborated_Vertex : Library_Graph_Vertex_Id;
Path : IGE_Lists.Doubly_Linked_List;
Path_Id : in out Nat);
pragma Inline (Output_Invocation_Path);
-- Output path Path, which consists of invocation graph Inv_Graph edges.
-- Elaborated_Vertex is the vertex of library graph Lib_Graph whose
-- elaboration initiated the path. Path_Id is the unique id of the path.
procedure Output_Invocation_Path_Transition
(Inv_Graph : Invocation_Graph;
Edge : Invocation_Graph_Edge_Id);
pragma Inline (Output_Invocation_Path_Transition);
-- Output a transition through edge Edge of invocation graph G, which is
-- part of an invocation path.
procedure Output_Invocation_Related_Suggestions
(G : Library_Graph;
Cycle : Library_Graph_Cycle_Id);
pragma Inline (Output_Invocation_Related_Suggestions);
-- Suggest ways to break cycle Cycle of library graph G that involves at
-- least one invocation edge.
procedure Output_Invocation_Transition
(Inv_Graph : Invocation_Graph;
Source : Library_Graph_Vertex_Id;
Destination : Library_Graph_Vertex_Id);
pragma Inline (Output_Invocation_Transition);
-- Output a transition through an invocation edge of library graph G with
-- successor Source and predecessor Destination. Inv_Graph is the related
-- invocation graph.
procedure Output_Reason_And_Circularity_Header
(G : Library_Graph;
First_Edge : Library_Graph_Edge_Id);
pragma Inline (Output_Reason_And_Circularity_Header);
-- Output the reason and circularity header for a circularity of library
-- graph G with initial edge First_Edge.
procedure Output_Suggestions
(G : Library_Graph;
Cycle : Library_Graph_Cycle_Id;
First_Edge : Library_Graph_Edge_Id);
pragma Inline (Output_Suggestions);
-- Suggest various ways to break cycle Cycle with initial edge First_Edge
-- of library graph G.
procedure Output_Transition
(Inv_Graph : Invocation_Graph;
Current_Edge : Library_Graph_Edge_Id;
Next_Edge : Library_Graph_Edge_Id;
Elaborate_All_Active : Boolean);
pragma Inline (Output_Transition);
-- Output a transition described by edge Current_Edge, which is followed by
-- edge Next_Edge of library graph Lib_Graph. Inv_Graph denotes the related
-- invocation graph. Elaborate_All_Active should be set when the transition
-- occurs within a cycle that involves an Elaborate_All edge.
procedure Output_With_Transition
(G : Library_Graph;
Source : Library_Graph_Vertex_Id;
Actual_Destination : Library_Graph_Vertex_Id;
Expected_Destination : Library_Graph_Vertex_Id;
Elaborate_All_Active : Boolean);
pragma Inline (Output_With_Transition);
-- Output a transition through a regular with edge of library graph G
-- with successor Source and predecessor Actual_Destination. Parameter
-- Expected_Destination denotes the predecessor as specified by the next
-- edge in a cycle. Elaborate_All_Active should be set when the transition
-- occurs within a cycle that involves an Elaborate_All edge.
procedure Visit_Vertex
(Inv_Graph : Invocation_Graph;
Invoker : Invocation_Graph_Vertex_Id;
Invoker_Vertex : Library_Graph_Vertex_Id;
Last_Vertex : Library_Graph_Vertex_Id;
Elaborated_Vertex : Library_Graph_Vertex_Id;
End_Vertex : Library_Graph_Vertex_Id;
Visited_Invokers : IGV_Sets.Membership_Set;
Path : IGE_Lists.Doubly_Linked_List;
Path_Id : in out Nat);
pragma Inline (Visit_Vertex);
-- Visit invocation graph vertex Invoker that resides in library graph
-- vertex Invoker_Vertex as part of a DFS traversal. Last_Vertex denotes
-- the previous vertex in the traversal. Elaborated_Vertex is the vertex
-- whose elaboration started the traversal. End_Vertex is the vertex that
-- terminates the traversal. Visited_Invoker is the set of all invokers
-- visited so far. All edges along the path are recorded in Path. Path_Id
-- is the id of the path.
-------------------------
-- Diagnose_All_Cycles --
-------------------------
procedure Diagnose_All_Cycles (Inv_Graph : Invocation_Graph) is
Lib_Graph : constant Library_Graph := Get_Lib_Graph (Inv_Graph);
Cycle : Library_Graph_Cycle_Id;
Iter : All_Cycle_Iterator;
begin
pragma Assert (Present (Inv_Graph));
pragma Assert (Present (Lib_Graph));
Iter := Iterate_All_Cycles (Lib_Graph);
while Has_Next (Iter) loop
Next (Iter, Cycle);
Diagnose_Cycle (Inv_Graph => Inv_Graph, Cycle => Cycle);
end loop;
end Diagnose_All_Cycles;
----------------------------
-- Diagnose_Circularities --
----------------------------
procedure Diagnose_Circularities (Inv_Graph : Invocation_Graph) is
Lib_Graph : constant Library_Graph := Get_Lib_Graph (Inv_Graph);
begin
pragma Assert (Present (Inv_Graph));
pragma Assert (Present (Lib_Graph));
-- Find, validate, and output all cycles of the library graph
Find_Cycles (Lib_Graph);
Validate_Cycles (Lib_Graph);
Write_Cycles (Lib_Graph);
-- Diagnose all cycles in the graph regardless of their importance when
-- switch -d_C (diagnose all cycles) is in effect.
if Debug_Flag_Underscore_CC then
Diagnose_All_Cycles (Inv_Graph);
-- Otherwise diagnose the most important cycle in the graph
else
Diagnose_Cycle
(Inv_Graph => Inv_Graph,
Cycle => Highest_Precedence_Cycle (Lib_Graph));
end if;
end Diagnose_Circularities;
--------------------
-- Diagnose_Cycle --
--------------------
procedure Diagnose_Cycle
(Inv_Graph : Invocation_Graph;
Cycle : Library_Graph_Cycle_Id)
is
Lib_Graph : constant Library_Graph := Get_Lib_Graph (Inv_Graph);
pragma Assert (Present (Inv_Graph));
pragma Assert (Present (Lib_Graph));
pragma Assert (Present (Cycle));
Elaborate_All_Active : constant Boolean :=
Contains_Elaborate_All_Edge
(G => Lib_Graph,
Cycle => Cycle);
Current_Edge : Library_Graph_Edge_Id := No_Library_Graph_Edge;
First_Edge : Library_Graph_Edge_Id;
Iter : Edges_Of_Cycle_Iterator;
Next_Edge : Library_Graph_Edge_Id;
begin
Start_Phase (Cycle_Diagnostics);
First_Edge := No_Library_Graph_Edge;
-- Inspect the edges of the cycle in pairs, emitting diagnostics based
-- on their successors and predecessors.
Iter := Iterate_Edges_Of_Cycle (Lib_Graph, Cycle);
while Has_Next (Iter) loop
-- Emit the reason for the cycle using the initial edge, which is the
-- most important edge in the cycle.
if not Present (First_Edge) then
Next (Iter, Current_Edge);
First_Edge := Current_Edge;
Output_Reason_And_Circularity_Header
(G => Lib_Graph,
First_Edge => First_Edge);
end if;
-- Obtain the other edge of the pair
exit when not Has_Next (Iter);
Next (Iter, Next_Edge);
-- Describe the transition from the current edge to the next edge by
-- taking into account the predecessors and successors involved, as
-- well as the nature of the edge.
Output_Transition
(Inv_Graph => Inv_Graph,
Current_Edge => Current_Edge,
Next_Edge => Next_Edge,
Elaborate_All_Active => Elaborate_All_Active);
Current_Edge := Next_Edge;
end loop;
-- Describe the transition from the last edge to the first edge
Output_Transition
(Inv_Graph => Inv_Graph,
Current_Edge => Current_Edge,
Next_Edge => First_Edge,
Elaborate_All_Active => Elaborate_All_Active);
-- Suggest various alternatives for breaking the cycle
Output_Suggestions
(G => Lib_Graph,
Cycle => Cycle,
First_Edge => First_Edge);
End_Phase (Cycle_Diagnostics);
end Diagnose_Cycle;
--------------------------------------
-- Find_And_Output_Invocation_Paths --
--------------------------------------
procedure Find_And_Output_Invocation_Paths
(Inv_Graph : Invocation_Graph;
Source : Library_Graph_Vertex_Id;
Destination : Library_Graph_Vertex_Id)
is
Lib_Graph : constant Library_Graph := Get_Lib_Graph (Inv_Graph);
Path : IGE_Lists.Doubly_Linked_List;
Path_Id : Nat;
Visited : IGV_Sets.Membership_Set;
begin
pragma Assert (Present (Inv_Graph));
pragma Assert (Present (Lib_Graph));
pragma Assert (Present (Source));
pragma Assert (Present (Destination));
-- Nothing to do when the invocation graph encoding format of the source
-- vertex does not contain detailed information about invocation paths.
if Invocation_Graph_Encoding (Lib_Graph, Source) /=
Full_Path_Encoding
then
return;
end if;
Path := IGE_Lists.Create;
Path_Id := 1;
Visited := IGV_Sets.Create (Number_Of_Vertices (Inv_Graph));
-- Start a DFS traversal over the invocation graph, in an attempt to
-- reach Destination from Source. The actual start of the path is the
-- elaboration root invocation vertex that corresponds to the Source.
-- Each unique path is emitted as part of the current cycle diagnostic.
Visit_Vertex
(Inv_Graph => Inv_Graph,
Invoker =>
Find_Elaboration_Root
(Inv_Graph => Inv_Graph,
Vertex => Source),
Invoker_Vertex => Source,
Last_Vertex => Source,
Elaborated_Vertex => Source,
End_Vertex => Destination,
Visited_Invokers => Visited,
Path => Path,
Path_Id => Path_Id);
IGE_Lists.Destroy (Path);
IGV_Sets.Destroy (Visited);
end Find_And_Output_Invocation_Paths;
---------------------------
-- Find_Elaboration_Root --
---------------------------
function Find_Elaboration_Root
(Inv_Graph : Invocation_Graph;
Vertex : Library_Graph_Vertex_Id) return Invocation_Graph_Vertex_Id
is
Lib_Graph : constant Library_Graph := Get_Lib_Graph (Inv_Graph);
Current_Vertex : Invocation_Graph_Vertex_Id;
Iter : Elaboration_Root_Iterator;
Root_Vertex : Invocation_Graph_Vertex_Id;
begin
pragma Assert (Present (Inv_Graph));
pragma Assert (Present (Lib_Graph));
pragma Assert (Present (Vertex));
-- Assume that the vertex does not have a corresponding elaboration root
Root_Vertex := No_Invocation_Graph_Vertex;
-- Inspect all elaboration roots trying to find the one that resides in
-- the input vertex.
--
-- IMPORTANT:
--
-- * The iterator must run to completion in order to unlock the
-- invocation graph.
Iter := Iterate_Elaboration_Roots (Inv_Graph);
while Has_Next (Iter) loop
Next (Iter, Current_Vertex);
if not Present (Root_Vertex)
and then Body_Vertex (Inv_Graph, Current_Vertex) = Vertex
then
Root_Vertex := Current_Vertex;
end if;
end loop;
return Root_Vertex;
end Find_Elaboration_Root;
-----------------------------------
-- Output_All_Cycles_Suggestions --
-----------------------------------
procedure Output_All_Cycles_Suggestions (G : Library_Graph) is
begin
pragma Assert (Present (G));
-- The library graph contains at least one cycle and only the highest
-- priority cycle was diagnosed. Diagnosing all cycles may yield extra
-- information for decision making.
if Number_Of_Cycles (G) > 1 and then not Debug_Flag_Underscore_CC then
Error_Msg_Info
(" diagnose all circularities (binder switch -d_C)");
end if;
end Output_All_Cycles_Suggestions;
--------------------------------------
-- Output_Elaborate_All_Suggestions --
--------------------------------------
procedure Output_Elaborate_All_Suggestions
(G : Library_Graph;
Pred : Library_Graph_Vertex_Id;
Succ : Library_Graph_Vertex_Id)
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Pred));
pragma Assert (Present (Succ));
Error_Msg_Unit_1 := Name (G, Pred);
Error_Msg_Unit_2 := Name (G, Succ);
Error_Msg_Info
(" change pragma Elaborate_All for unit $ to Elaborate in unit $");
Error_Msg_Info
(" remove pragma Elaborate_All for unit $ in unit $");
end Output_Elaborate_All_Suggestions;
-------------------------------------
-- Output_Elaborate_All_Transition --
-------------------------------------
procedure Output_Elaborate_All_Transition
(G : Library_Graph;
Source : Library_Graph_Vertex_Id;
Actual_Destination : Library_Graph_Vertex_Id;
Expected_Destination : Library_Graph_Vertex_Id)
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Source));
pragma Assert (Present (Actual_Destination));
pragma Assert (Present (Expected_Destination));
-- The actual and expected destination vertices match, and denote the
-- initial declaration of a unit.
--
-- Elaborate_All Actual_Destination
-- Source ---------------> spec -->
-- Expected_Destination
--
-- Elaborate_All Actual_Destination
-- Source ---------------> stand-alone body -->
-- Expected_Destination
if Actual_Destination = Expected_Destination then
Error_Msg_Unit_1 := Name (G, Source);
Error_Msg_Unit_2 := Name (G, Actual_Destination);
Error_Msg_Info
(" unit $ has with clause and pragma Elaborate_All for unit $");
-- Otherwise the actual destination vertex denotes the spec of a unit,
-- while the expected destination is the corresponding body.
--
-- Elaborate_All Actual_Destination
-- Source ---------------> spec
--
-- body -->
-- Expected_Destination
else
pragma Assert (Is_Spec_With_Body (G, Actual_Destination));
pragma Assert (Is_Body_With_Spec (G, Expected_Destination));
pragma Assert
(Proper_Body (G, Actual_Destination) = Expected_Destination);
Error_Msg_Unit_1 := Name (G, Source);
Error_Msg_Unit_2 := Name (G, Actual_Destination);
Error_Msg_Info
(" unit $ has with clause and pragma Elaborate_All for unit $");
Error_Msg_Unit_1 := Name (G, Expected_Destination);
Error_Msg_Info
(" unit $ is in the closure of pragma Elaborate_All");
end if;
end Output_Elaborate_All_Transition;
---------------------------------------
-- Output_Elaborate_Body_Suggestions --
---------------------------------------
procedure Output_Elaborate_Body_Suggestions
(G : Library_Graph;
Succ : Library_Graph_Vertex_Id)
is
Spec : Library_Graph_Vertex_Id;
begin
pragma Assert (Present (G));
pragma Assert (Present (Succ));
-- Find the initial declaration of the unit because it is the one
-- subject to pragma Elaborate_Body.
if Is_Body_With_Spec (G, Succ) then
Spec := Proper_Spec (G, Succ);
else
Spec := Succ;
end if;
Error_Msg_Unit_1 := Name (G, Spec);
Error_Msg_Info
(" remove pragma Elaborate_Body in unit $");
end Output_Elaborate_Body_Suggestions;
--------------------------------------
-- Output_Elaborate_Body_Transition --
--------------------------------------
procedure Output_Elaborate_Body_Transition
(G : Library_Graph;
Source : Library_Graph_Vertex_Id;
Actual_Destination : Library_Graph_Vertex_Id;
Expected_Destination : Library_Graph_Vertex_Id;
Elaborate_All_Active : Boolean)
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Source));
pragma Assert (Present (Actual_Destination));
pragma Assert (Present (Expected_Destination));
-- The actual and expected destination vertices match
--
-- Actual_Destination
-- Source --------> spec -->
-- Elaborate_Body Expected_Destination
--
-- spec
--
-- Actual_Destination
-- Source --------> body -->
-- Elaborate_Body Expected_Destination
if Actual_Destination = Expected_Destination then
Error_Msg_Unit_1 := Name (G, Source);
Error_Msg_Unit_2 := Name (G, Actual_Destination);
Error_Msg_Info
(" unit $ has with clause for unit $");
-- The actual destination vertex denotes the spec of a unit while the
-- expected destination is the corresponding body, and the unit is in
-- the closure of an earlier Elaborate_All pragma.
--
-- Actual_Destination
-- Source --------> spec
-- Elaborate_Body
-- body -->
-- Expected_Destination
elsif Elaborate_All_Active then
pragma Assert (Is_Spec_With_Body (G, Actual_Destination));
pragma Assert (Is_Body_With_Spec (G, Expected_Destination));
pragma Assert
(Proper_Body (G, Actual_Destination) = Expected_Destination);
Error_Msg_Unit_1 := Name (G, Source);
Error_Msg_Unit_2 := Name (G, Actual_Destination);
Error_Msg_Info
(" unit $ has with clause for unit $");
Error_Msg_Unit_1 := Name (G, Expected_Destination);
Error_Msg_Info
(" unit $ is in the closure of pragma Elaborate_All");
-- Otherwise the actual destination vertex is the spec of a unit subject
-- to pragma Elaborate_Body and the expected destination vertex is the
-- completion body.
--
-- Actual_Destination
-- Source --------> spec Elaborate_Body
-- Elaborate_Body
-- body -->
-- Expected_Destination
else
pragma Assert
(Is_Elaborate_Body_Pair
(G => G,
Spec_Vertex => Actual_Destination,
Body_Vertex => Expected_Destination));
Error_Msg_Unit_1 := Name (G, Source);
Error_Msg_Unit_2 := Name (G, Actual_Destination);
Error_Msg_Info
(" unit $ has with clause for unit $");
Error_Msg_Unit_1 := Name (G, Actual_Destination);
Error_Msg_Info
(" unit $ is subject to pragma Elaborate_Body");
Error_Msg_Unit_1 := Name (G, Expected_Destination);
Error_Msg_Info
(" unit $ is in the closure of pragma Elaborate_Body");
end if;
end Output_Elaborate_Body_Transition;
----------------------------------
-- Output_Elaborate_Suggestions --
----------------------------------
procedure Output_Elaborate_Suggestions
(G : Library_Graph;
Pred : Library_Graph_Vertex_Id;
Succ : Library_Graph_Vertex_Id)
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Pred));
pragma Assert (Present (Succ));
Error_Msg_Unit_1 := Name (G, Pred);
Error_Msg_Unit_2 := Name (G, Succ);
Error_Msg_Info
(" remove pragma Elaborate for unit $ in unit $");
end Output_Elaborate_Suggestions;
---------------------------------
-- Output_Elaborate_Transition --
---------------------------------
procedure Output_Elaborate_Transition
(G : Library_Graph;
Source : Library_Graph_Vertex_Id;
Actual_Destination : Library_Graph_Vertex_Id;
Expected_Destination : Library_Graph_Vertex_Id)
is
Spec : Library_Graph_Vertex_Id;
begin
pragma Assert (Present (G));
pragma Assert (Present (Source));
pragma Assert (Present (Actual_Destination));
pragma Assert (Present (Expected_Destination));
-- The actual and expected destination vertices match, and denote the
-- initial declaration of a unit.
--
-- Elaborate Actual_Destination
-- Source -----------> spec -->
-- Expected_Destination
--
-- Elaborate Actual_Destination
-- Source -----------> stand-alone body -->
-- Expected_Destination
--
-- The processing of pragma Elaborate body generates an edge between a
-- successor and predecessor body.
--
-- spec
--
-- Elaborate Actual_Destination
-- Source -----------> body -->
-- Expected_Destination
if Actual_Destination = Expected_Destination then
-- Find the initial declaration of the unit because it is the one
-- subject to pragma Elaborate.
if Is_Body_With_Spec (G, Actual_Destination) then
Spec := Proper_Spec (G, Actual_Destination);
else
Spec := Actual_Destination;
end if;
Error_Msg_Unit_1 := Name (G, Source);
Error_Msg_Unit_2 := Name (G, Spec);
Error_Msg_Info
(" unit $ has with clause and pragma Elaborate for unit $");
if Actual_Destination /= Spec then
Error_Msg_Unit_1 := Name (G, Actual_Destination);
Error_Msg_Info
(" unit $ is in the closure of pragma Elaborate");
end if;
-- Otherwise the actual destination vertex denotes the spec of a unit
-- while the expected destination vertex is the corresponding body.
--
-- Elaborate Actual_Destination
-- Source -----------> spec
--
-- body -->
-- Expected_Destination
else
pragma Assert (Is_Spec_With_Body (G, Actual_Destination));
pragma Assert (Is_Body_With_Spec (G, Expected_Destination));
pragma Assert
(Proper_Body (G, Actual_Destination) = Expected_Destination);
Error_Msg_Unit_1 := Name (G, Source);
Error_Msg_Unit_2 := Name (G, Actual_Destination);
Error_Msg_Info
(" unit $ has with clause and pragma Elaborate for unit $");
Error_Msg_Unit_1 := Name (G, Expected_Destination);
Error_Msg_Info
(" unit $ is in the closure of pragma Elaborate");
end if;
end Output_Elaborate_Transition;
-------------------------------
-- Output_Forced_Suggestions --
-------------------------------
procedure Output_Forced_Suggestions
(G : Library_Graph;
Pred : Library_Graph_Vertex_Id;
Succ : Library_Graph_Vertex_Id)
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Pred));
pragma Assert (Present (Succ));
Error_Msg_Unit_1 := Name (G, Succ);
Error_Msg_Unit_2 := Name (G, Pred);
Error_Msg_Info
(" remove the dependency of unit $ on unit $ from the argument of "
& "switch -f");
Error_Msg_Info
(" remove switch -f");
end Output_Forced_Suggestions;
------------------------------
-- Output_Forced_Transition --
------------------------------
procedure Output_Forced_Transition
(G : Library_Graph;
Source : Library_Graph_Vertex_Id;
Actual_Destination : Library_Graph_Vertex_Id;
Expected_Destination : Library_Graph_Vertex_Id;
Elaborate_All_Active : Boolean)
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Source));
pragma Assert (Present (Actual_Destination));
pragma Assert (Present (Expected_Destination));
-- The actual and expected destination vertices match
--
-- Forced Actual_Destination
-- Source --------> spec -->
-- Expected_Destination
--
-- Forced Actual_Destination
-- Source --------> body -->
-- Expected_Destination
if Actual_Destination = Expected_Destination then
Error_Msg_Unit_1 := Name (G, Source);
Error_Msg_Unit_2 := Name (G, Actual_Destination);
Error_Msg_Info
(" unit $ has a dependency on unit $ forced by -f switch");
-- The actual destination vertex denotes the spec of a unit while the
-- expected destination is the corresponding body, and the unit is in
-- the closure of an earlier Elaborate_All pragma.
--
-- Forced Actual_Destination
-- Source --------> spec
--
-- body -->
-- Expected_Destination
elsif Elaborate_All_Active then
pragma Assert (Is_Spec_With_Body (G, Actual_Destination));
pragma Assert (Is_Body_With_Spec (G, Expected_Destination));
pragma Assert
(Proper_Body (G, Actual_Destination) = Expected_Destination);
Error_Msg_Unit_1 := Name (G, Source);
Error_Msg_Unit_2 := Name (G, Actual_Destination);
Error_Msg_Info
(" unit $ has a dependency on unit $ forced by -f switch");
Error_Msg_Unit_1 := Name (G, Expected_Destination);
Error_Msg_Info
(" unit $ is in the closure of pragma Elaborate_All");
-- Otherwise the actual destination vertex denotes a spec subject to
-- pragma Elaborate_Body while the expected destination denotes the
-- corresponding body.
--
-- Forced Actual_Destination
-- Source --------> spec Elaborate_Body
--
-- body -->
-- Expected_Destination
else
pragma Assert
(Is_Elaborate_Body_Pair
(G => G,
Spec_Vertex => Actual_Destination,
Body_Vertex => Expected_Destination));
Error_Msg_Unit_1 := Name (G, Source);
Error_Msg_Unit_2 := Name (G, Actual_Destination);
Error_Msg_Info
(" unit $ has a dependency on unit $ forced by -f switch");
Error_Msg_Unit_1 := Name (G, Actual_Destination);
Error_Msg_Info
(" unit $ is subject to pragma Elaborate_Body");
Error_Msg_Unit_1 := Name (G, Expected_Destination);
Error_Msg_Info
(" unit $ is in the closure of pragma Elaborate_Body");
end if;
end Output_Forced_Transition;
--------------------------------------
-- Output_Full_Encoding_Suggestions --
--------------------------------------
procedure Output_Full_Encoding_Suggestions
(G : Library_Graph;
Cycle : Library_Graph_Cycle_Id;
First_Edge : Library_Graph_Edge_Id)
is
Succ : Library_Graph_Vertex_Id;
begin
pragma Assert (Present (G));
pragma Assert (Present (Cycle));
pragma Assert (Present (First_Edge));
if Is_Invocation_Edge (G, First_Edge) then
Succ := Successor (G, First_Edge);
if Invocation_Graph_Encoding (G, Succ) /= Full_Path_Encoding then
Error_Msg_Info
(" use detailed invocation information (compiler switch "
& "-gnatd_F)");
end if;
end if;
end Output_Full_Encoding_Suggestions;
----------------------------
-- Output_Invocation_Path --
-----------------------------
procedure Output_Invocation_Path
(Inv_Graph : Invocation_Graph;
Elaborated_Vertex : Library_Graph_Vertex_Id;
Path : IGE_Lists.Doubly_Linked_List;
Path_Id : in out Nat)
is
Lib_Graph : constant Library_Graph := Get_Lib_Graph (Inv_Graph);
Edge : Invocation_Graph_Edge_Id;
Iter : IGE_Lists.Iterator;
begin
pragma Assert (Present (Inv_Graph));
pragma Assert (Present (Lib_Graph));
pragma Assert (Present (Elaborated_Vertex));
pragma Assert (IGE_Lists.Present (Path));
Error_Msg_Nat_1 := Path_Id;
Error_Msg_Info (" path #:");
Error_Msg_Unit_1 := Name (Lib_Graph, Elaborated_Vertex);
Error_Msg_Info (" elaboration of unit $");
Iter := IGE_Lists.Iterate (Path);
while IGE_Lists.Has_Next (Iter) loop
IGE_Lists.Next (Iter, Edge);
Output_Invocation_Path_Transition
(Inv_Graph => Inv_Graph, Edge => Edge);
end loop;
Path_Id := Path_Id + 1;
end Output_Invocation_Path;
---------------------------------------
-- Output_Invocation_Path_Transition --
---------------------------------------
procedure Output_Invocation_Path_Transition
(Inv_Graph : Invocation_Graph;
Edge : Invocation_Graph_Edge_Id)
is
Lib_Graph : constant Library_Graph := Get_Lib_Graph (Inv_Graph);
pragma Assert (Present (Inv_Graph));
pragma Assert (Present (Lib_Graph));
pragma Assert (Present (Edge));
Declared : constant String := "declared at {:#:#";
Targ : constant Invocation_Graph_Vertex_Id :=
Target (Inv_Graph, Edge);
Targ_Extra : constant Name_Id :=
Extra (Inv_Graph, Edge);
Targ_Vertex : constant Library_Graph_Vertex_Id :=
Spec_Vertex (Inv_Graph, Targ);
begin
Error_Msg_Name_1 := Name (Inv_Graph, Targ);
Error_Msg_Nat_1 := Line (Inv_Graph, Targ);
Error_Msg_Nat_2 := Column (Inv_Graph, Targ);
Error_Msg_File_1 := File_Name (Lib_Graph, Targ_Vertex);
case Kind (Inv_Graph, Edge) is
when Accept_Alternative =>
Error_Msg_Info
(" selection of entry % "
& Declared);
when Access_Taken =>
Error_Msg_Info
(" aliasing of subprogram % "
& Declared);
when Call =>
Error_Msg_Info
(" call to subprogram % "
& Declared);
when Controlled_Adjustment
| Internal_Controlled_Adjustment
=>
Error_Msg_Name_1 := Targ_Extra;
Error_Msg_Info
(" adjustment actions for type % "
& Declared);
when Controlled_Finalization
| Internal_Controlled_Finalization
=>
Error_Msg_Name_1 := Targ_Extra;
Error_Msg_Info
(" finalization actions for type % "
& Declared);
when Controlled_Initialization
| Internal_Controlled_Initialization
| Type_Initialization
=>
Error_Msg_Name_1 := Targ_Extra;
Error_Msg_Info
(" initialization actions for type % "
& Declared);
when Default_Initial_Condition_Verification =>
Error_Msg_Name_1 := Targ_Extra;
Error_Msg_Info
(" verification of Default_Initial_Condition for type % "
& Declared);
when Initial_Condition_Verification =>
Error_Msg_Info
(" verification of Initial_Condition "
& Declared);
when Instantiation =>
Error_Msg_Info
(" instantiation % "
& Declared);
when Invariant_Verification =>
Error_Msg_Name_1 := Targ_Extra;
Error_Msg_Info
(" verification of invariant for type % "
& Declared);
when Postcondition_Verification =>
Error_Msg_Name_1 := Targ_Extra;
Error_Msg_Info
(" verification of postcondition for subprogram % "
& Declared);
when Protected_Entry_Call =>
Error_Msg_Info
(" call to protected entry % "
& Declared);
when Protected_Subprogram_Call =>
Error_Msg_Info
(" call to protected subprogram % "
& Declared);
when Task_Activation =>
Error_Msg_Info
(" activation of local task "
& Declared);
when Task_Entry_Call =>
Error_Msg_Info
(" call to task entry % "
& Declared);
when others =>
pragma Assert (False);
null;
end case;
end Output_Invocation_Path_Transition;
-------------------------------------------
-- Output_Invocation_Related_Suggestions --
-------------------------------------------
procedure Output_Invocation_Related_Suggestions
(G : Library_Graph;
Cycle : Library_Graph_Cycle_Id)
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Cycle));
-- Nothing to do when the cycle does not contain an invocation edge
if Invocation_Edge_Count (G, Cycle) = 0 then
return;
end if;
-- The cycle contains at least one invocation edge, where at least
-- one of the paths the edge represents activates a task. The use of
-- restriction No_Entry_Calls_In_Elaboration_Code may halt the flow
-- within the task body on a select or accept statement, eliminating
-- subsequent invocation edges, thus breaking the cycle.
if not Cumulative_Restrictions.Set (No_Entry_Calls_In_Elaboration_Code)
and then Contains_Task_Activation (G, Cycle)
then
Error_Msg_Info
(" use pragma Restrictions "
& "(No_Entry_Calls_In_Elaboration_Code)");
end if;
-- The cycle contains at least one invocation edge where the successor
-- was statically elaborated. The use of the dynamic model may remove
-- one of the invocation edges in the cycle, thus breaking the cycle.
if Contains_Static_Successor_Edge (G, Cycle) then
Error_Msg_Info
(" use the dynamic elaboration model (compiler switch -gnatE)");
end if;
end Output_Invocation_Related_Suggestions;
----------------------------------
-- Output_Invocation_Transition --
----------------------------------
procedure Output_Invocation_Transition
(Inv_Graph : Invocation_Graph;
Source : Library_Graph_Vertex_Id;
Destination : Library_Graph_Vertex_Id)
is
Lib_Graph : constant Library_Graph := Get_Lib_Graph (Inv_Graph);
begin
pragma Assert (Present (Inv_Graph));
pragma Assert (Present (Lib_Graph));
pragma Assert (Present (Source));
pragma Assert (Present (Destination));
Error_Msg_Unit_1 := Name (Lib_Graph, Source);
Error_Msg_Unit_2 := Name (Lib_Graph, Destination);
Error_Msg_Info
(" unit $ invokes a construct of unit $ at elaboration time");
Find_And_Output_Invocation_Paths
(Inv_Graph => Inv_Graph,
Source => Source,
Destination => Destination);
end Output_Invocation_Transition;
------------------------------------------
-- Output_Reason_And_Circularity_Header --
------------------------------------------
procedure Output_Reason_And_Circularity_Header
(G : Library_Graph;
First_Edge : Library_Graph_Edge_Id)
is
pragma Assert (Present (G));
pragma Assert (Present (First_Edge));
Succ : constant Library_Graph_Vertex_Id := Successor (G, First_Edge);
begin
Error_Msg_Unit_1 := Name (G, Succ);
Error_Msg ("Elaboration circularity detected");
Error_Msg_Info ("");
Error_Msg_Info (" Reason:");
Error_Msg_Info ("");
Error_Msg_Info (" unit $ depends on its own elaboration");
Error_Msg_Info ("");
Error_Msg_Info (" Circularity:");
Error_Msg_Info ("");
end Output_Reason_And_Circularity_Header;
------------------------
-- Output_Suggestions --
------------------------
procedure Output_Suggestions
(G : Library_Graph;
Cycle : Library_Graph_Cycle_Id;
First_Edge : Library_Graph_Edge_Id)
is
pragma Assert (Present (G));
pragma Assert (Present (Cycle));
pragma Assert (Present (First_Edge));
Pred : constant Library_Graph_Vertex_Id := Predecessor (G, First_Edge);
Succ : constant Library_Graph_Vertex_Id := Successor (G, First_Edge);
begin
Error_Msg_Info ("");
Error_Msg_Info (" Suggestions:");
Error_Msg_Info ("");
-- Output edge-specific suggestions
if Is_Elaborate_All_Edge (G, First_Edge) then
Output_Elaborate_All_Suggestions
(G => G,
Pred => Pred,
Succ => Succ);
elsif Is_Elaborate_Body_Edge (G, First_Edge) then
Output_Elaborate_Body_Suggestions
(G => G,
Succ => Succ);
elsif Is_Elaborate_Edge (G, First_Edge) then
Output_Elaborate_Suggestions
(G => G,
Pred => Pred,
Succ => Succ);
elsif Is_Forced_Edge (G, First_Edge) then
Output_Forced_Suggestions
(G => G,
Pred => Pred,
Succ => Succ);
end if;
-- Output general purpose suggestions
Output_Invocation_Related_Suggestions
(G => G,
Cycle => Cycle);
Output_Full_Encoding_Suggestions
(G => G,
Cycle => Cycle,
First_Edge => First_Edge);
Output_All_Cycles_Suggestions (G);
Error_Msg_Info ("");
end Output_Suggestions;
-----------------------
-- Output_Transition --
-----------------------
procedure Output_Transition
(Inv_Graph : Invocation_Graph;
Current_Edge : Library_Graph_Edge_Id;
Next_Edge : Library_Graph_Edge_Id;
Elaborate_All_Active : Boolean)
is
Lib_Graph : constant Library_Graph := Get_Lib_Graph (Inv_Graph);
pragma Assert (Present (Inv_Graph));
pragma Assert (Present (Lib_Graph));
pragma Assert (Present (Current_Edge));
pragma Assert (Present (Next_Edge));
Actual_Destination : constant Library_Graph_Vertex_Id :=
Predecessor (Lib_Graph, Current_Edge);
Expected_Destination : constant Library_Graph_Vertex_Id :=
Successor (Lib_Graph, Next_Edge);
Source : constant Library_Graph_Vertex_Id :=
Successor (Lib_Graph, Current_Edge);
begin
if Is_Elaborate_All_Edge (Lib_Graph, Current_Edge) then
Output_Elaborate_All_Transition
(G => Lib_Graph,
Source => Source,
Actual_Destination => Actual_Destination,
Expected_Destination => Expected_Destination);
elsif Is_Elaborate_Body_Edge (Lib_Graph, Current_Edge) then
Output_Elaborate_Body_Transition
(G => Lib_Graph,
Source => Source,
Actual_Destination => Actual_Destination,
Expected_Destination => Expected_Destination,
Elaborate_All_Active => Elaborate_All_Active);
elsif Is_Elaborate_Edge (Lib_Graph, Current_Edge) then
Output_Elaborate_Transition
(G => Lib_Graph,
Source => Source,
Actual_Destination => Actual_Destination,
Expected_Destination => Expected_Destination);
elsif Is_Forced_Edge (Lib_Graph, Current_Edge) then
Output_Forced_Transition
(G => Lib_Graph,
Source => Source,
Actual_Destination => Actual_Destination,
Expected_Destination => Expected_Destination,
Elaborate_All_Active => Elaborate_All_Active);
elsif Is_Invocation_Edge (Lib_Graph, Current_Edge) then
Output_Invocation_Transition
(Inv_Graph => Inv_Graph,
Source => Source,
Destination => Expected_Destination);
else
pragma Assert (Is_With_Edge (Lib_Graph, Current_Edge));
Output_With_Transition
(G => Lib_Graph,
Source => Source,
Actual_Destination => Actual_Destination,
Expected_Destination => Expected_Destination,
Elaborate_All_Active => Elaborate_All_Active);
end if;
end Output_Transition;
----------------------------
-- Output_With_Transition --
----------------------------
procedure Output_With_Transition
(G : Library_Graph;
Source : Library_Graph_Vertex_Id;
Actual_Destination : Library_Graph_Vertex_Id;
Expected_Destination : Library_Graph_Vertex_Id;
Elaborate_All_Active : Boolean)
is
begin
pragma Assert (Present (G));
pragma Assert (Present (Source));
pragma Assert (Present (Actual_Destination));
pragma Assert (Present (Expected_Destination));
-- The actual and expected destination vertices match, and denote the
-- initial declaration of a unit.
--
-- with Actual_Destination
-- Source ------> spec -->
-- Expected_Destination
--
-- with Actual_Destination
-- Source ------> stand-alone body -->
-- Expected_Destination
if Actual_Destination = Expected_Destination then
Error_Msg_Unit_1 := Name (G, Source);
Error_Msg_Unit_2 := Name (G, Actual_Destination);
Error_Msg_Info
(" unit $ has with clause for unit $");
-- The actual destination vertex denotes the spec of a unit while the
-- expected destination is the corresponding body, and the unit is in
-- the closure of an earlier Elaborate_All pragma.
--
-- with Actual_Destination
-- Source ------> spec
--
-- body -->
-- Expected_Destination
elsif Elaborate_All_Active then
pragma Assert (Is_Spec_With_Body (G, Actual_Destination));
pragma Assert (Is_Body_With_Spec (G, Expected_Destination));
pragma Assert
(Proper_Body (G, Actual_Destination) = Expected_Destination);
Error_Msg_Unit_1 := Name (G, Source);
Error_Msg_Unit_2 := Name (G, Actual_Destination);
Error_Msg_Info
(" unit $ has with clause for unit $");
Error_Msg_Unit_1 := Name (G, Expected_Destination);
Error_Msg_Info
(" unit $ is in the closure of pragma Elaborate_All");
-- Otherwise the actual destination vertex denotes a spec subject to
-- pragma Elaborate_Body while the expected destination denotes the
-- corresponding body.
--
-- with Actual_Destination
-- Source ------> spec Elaborate_Body
--
-- body -->
-- Expected_Destination
else
pragma Assert
(Is_Elaborate_Body_Pair
(G => G,
Spec_Vertex => Actual_Destination,
Body_Vertex => Expected_Destination));
Error_Msg_Unit_1 := Name (G, Source);
Error_Msg_Unit_2 := Name (G, Actual_Destination);
Error_Msg_Info
(" unit $ has with clause for unit $");
Error_Msg_Unit_1 := Name (G, Actual_Destination);
Error_Msg_Info
(" unit $ is subject to pragma Elaborate_Body");
Error_Msg_Unit_1 := Name (G, Expected_Destination);
Error_Msg_Info
(" unit $ is in the closure of pragma Elaborate_Body");
end if;
end Output_With_Transition;
------------------
-- Visit_Vertex --
------------------
procedure Visit_Vertex
(Inv_Graph : Invocation_Graph;
Invoker : Invocation_Graph_Vertex_Id;
Invoker_Vertex : Library_Graph_Vertex_Id;
Last_Vertex : Library_Graph_Vertex_Id;
Elaborated_Vertex : Library_Graph_Vertex_Id;
End_Vertex : Library_Graph_Vertex_Id;
Visited_Invokers : IGV_Sets.Membership_Set;
Path : IGE_Lists.Doubly_Linked_List;
Path_Id : in out Nat)
is
Lib_Graph : constant Library_Graph := Get_Lib_Graph (Inv_Graph);
Edge : Invocation_Graph_Edge_Id;
Iter : Edges_To_Targets_Iterator;
Targ : Invocation_Graph_Vertex_Id;
begin
pragma Assert (Present (Inv_Graph));
pragma Assert (Present (Lib_Graph));
pragma Assert (Present (Invoker));
pragma Assert (Present (Invoker_Vertex));
pragma Assert (Present (Last_Vertex));
pragma Assert (Present (Elaborated_Vertex));
pragma Assert (Present (End_Vertex));
pragma Assert (IGV_Sets.Present (Visited_Invokers));
pragma Assert (IGE_Lists.Present (Path));
-- The current invocation vertex resides within the end library vertex.
-- Emit the path that started from some elaboration root and ultimately
-- reached the desired library vertex.
if Body_Vertex (Inv_Graph, Invoker) = End_Vertex
and then Invoker_Vertex /= Last_Vertex
then
Output_Invocation_Path
(Inv_Graph => Inv_Graph,
Elaborated_Vertex => Elaborated_Vertex,
Path => Path,
Path_Id => Path_Id);
-- Otherwise extend the search for the end library vertex via all edges
-- to targets.
elsif not IGV_Sets.Contains (Visited_Invokers, Invoker) then
-- Prepare for invoker backtracking
IGV_Sets.Insert (Visited_Invokers, Invoker);
-- Extend the search via all edges to targets
Iter := Iterate_Edges_To_Targets (Inv_Graph, Invoker);
while Has_Next (Iter) loop
Next (Iter, Edge);
-- Prepare for edge backtracking
IGE_Lists.Append (Path, Edge);
-- The traversal proceeds through the library vertex that houses
-- the body of the target.
Targ := Target (Inv_Graph, Edge);
Visit_Vertex
(Inv_Graph => Inv_Graph,
Invoker => Targ,
Invoker_Vertex => Body_Vertex (Inv_Graph, Targ),
Last_Vertex => Invoker_Vertex,
Elaborated_Vertex => Elaborated_Vertex,
End_Vertex => End_Vertex,
Visited_Invokers => Visited_Invokers,
Path => Path,
Path_Id => Path_Id);
-- Backtrack the edge
IGE_Lists.Delete_Last (Path);
end loop;
-- Backtrack the invoker
IGV_Sets.Delete (Visited_Invokers, Invoker);
end if;
end Visit_Vertex;
end Bindo.Diagnostics;
|
------------------------------------------------------------------------------
-- Copyright (c) 2014, Natacha Porté --
-- --
-- Permission to use, copy, modify, and distribute this software for any --
-- purpose with or without fee is hereby granted, provided that the above --
-- copyright notice and this permission notice appear in all copies. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF --
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR --
-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES --
-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN --
-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF --
-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --
------------------------------------------------------------------------------
package body Natools.Reference_Tests.Pools is
use type Ref_Pools.Pool_Size;
procedure Check_Counts
(Test : in out NT.Test;
Pool : in Ref_Pools.Pool;
Active, Initialized, Total : in Ref_Pools.Pool_Size);
procedure Check_Order
(Test : in out NT.Test;
Pool : in out Ref_Pools.Pool);
------------------------------
-- Local Helper Subprograms --
------------------------------
procedure Check_Counts
(Test : in out NT.Test;
Pool : in Ref_Pools.Pool;
Active, Initialized, Total : in Ref_Pools.Pool_Size)
is
S : Ref_Pools.Pool_Size;
begin
S := Pool.Active_Size;
if S /= Active then
Test.Fail
("Pool.Active_Size is"
& Ref_Pools.Pool_Size'Image (S)
& ", expected "
& Ref_Pools.Pool_Size'Image (Active));
end if;
S := Pool.Initialized_Size;
if S /= Initialized then
Test.Fail
("Pool.Initialized_Size is"
& Ref_Pools.Pool_Size'Image (S)
& ", expected "
& Ref_Pools.Pool_Size'Image (Initialized));
end if;
S := Pool.Capacity;
if S /= Total then
Test.Fail
("Pool.Initialized_Size is"
& Ref_Pools.Pool_Size'Image (S)
& ", expected "
& Ref_Pools.Pool_Size'Image (Total));
end if;
end Check_Counts;
procedure Check_Order
(Test : in out NT.Test;
Pool : in out Ref_Pools.Pool)
is
procedure Process (Ref : in Refs.Reference);
Rank, Last : Natural := 0;
procedure Process (Ref : in Refs.Reference) is
begin
Rank := Rank + 1;
if Ref.Is_Empty then
Test.Fail ("Unexpected empty reference at rank"
& Natural'Image (Rank));
return;
end if;
declare
Accessor : constant Refs.Accessor := Ref.Query;
begin
if Accessor.Data.Instance_Number = 0 then
Test.Fail ("Unexpected null instance number at rank"
& Natural'Image (Rank));
elsif Last = 0 then
Last := Accessor.Data.Instance_Number;
elsif Accessor.Data.Instance_Number /= Last + 1 then
Test.Fail ("At rank"
& Natural'Image (Rank)
& ", reference to instance"
& Natural'Image (Accessor.Data.Instance_Number)
& " following reference to instance"
& Natural'Image (Last));
Last := 0;
else
Last := Accessor.Data.Instance_Number;
end if;
end;
end Process;
begin
Pool.Unchecked_Iterate (Process'Access);
end Check_Order;
------------------------
-- Peudo_Process Task --
------------------------
task body Pseudo_Process is
Time : Duration;
Ref : Refs.Reference;
begin
select
accept Start (Target : in Refs.Reference; Amount : in Duration) do
Time := Amount;
Ref := Target;
end Start;
or terminate;
end select;
delay Time;
Ref.Reset;
end Pseudo_Process;
procedure Bounded_Start
(Process : in out Pseudo_Process;
Pool : in out Ref_Pools.Pool;
Amount : in Duration;
Test : in out NT.Test;
Expected_Instance : in Natural)
is
Ref : Refs.Reference;
begin
Pool.Get (Factory'Access, Ref);
if Ref.Query.Data.Instance_Number /= Expected_Instance then
Test.Fail ("Got reference to instance"
& Natural'Image (Ref.Query.Data.Instance_Number)
& ", expected"
& Natural'Image (Expected_Instance));
end if;
Process.Start (Ref, Amount);
end Bounded_Start;
procedure Unbounded_Start
(Process : in out Pseudo_Process;
Pool : in out Ref_Pools.Pool;
Amount : in Duration;
Test : in out NT.Test;
Expected_Instance : in Natural)
is
Ref : Refs.Reference;
begin
Pool.Create (Factory'Access, Ref);
if Ref.Query.Data.Instance_Number /= Expected_Instance then
Test.Fail ("Got reference to instance"
& Natural'Image (Ref.Query.Data.Instance_Number)
& ", expected"
& Natural'Image (Expected_Instance));
end if;
Process.Start (Ref, Amount);
end Unbounded_Start;
-------------------------
-- Complete Test Suite --
-------------------------
procedure All_Tests (Report : in out NT.Reporter'Class) is
begin
Bounded_Pool (Report);
Static_Pool (Report);
Unbounded_Pool (Report);
end All_Tests;
-----------------------
-- Inidividual Tests --
-----------------------
procedure Bounded_Pool (Report : in out NT.Reporter'Class) is
Test : NT.Test := Report.Item ("Bounded pool typical usage");
begin
declare
Test_Length : constant Duration := 0.5;
Ref_Pool : Ref_Pools.Pool;
Workers : array (1 .. 4) of Pseudo_Process;
begin
-- Timeline (in Test_Length/10): <-------->
-- Task using reference 1: 1111111111
-- Task using reference 2: 2222 44
-- Task using reference 3: 3333
Check_Counts (Test, Ref_Pool, 0, 0, 0);
Ref_Pool.Preallocate (3);
Check_Counts (Test, Ref_Pool, 0, 0, 3);
Bounded_Start (Workers (1), Ref_Pool, Test_Length, Test, 1);
Check_Counts (Test, Ref_Pool, 1, 1, 3);
delay Test_Length * 0.2;
Bounded_Start (Workers (2), Ref_Pool, Test_Length * 0.4, Test, 2);
Check_Counts (Test, Ref_Pool, 2, 2, 3);
delay Test_Length * 0.2;
Bounded_Start (Workers (3), Ref_Pool, Test_Length * 0.4, Test, 3);
Check_Counts (Test, Ref_Pool, 3, 3, 3);
delay Test_Length * 0.1;
begin
Bounded_Start (Workers (4), Ref_Pool, Test_Length * 0.2, Test, 0);
Test.Fail ("Expected exception after filling bounded pool");
exception
when Constraint_Error =>
null;
when Error : others =>
Test.Info ("At Get on full bounded pool,");
Test.Report_Exception (Error, NT.Fail);
end;
delay Test_Length * 0.2;
Check_Counts (Test, Ref_Pool, 2, 3, 3);
Bounded_Start (Workers (4), Ref_Pool, Test_Length * 0.2, Test, 2);
Check_Counts (Test, Ref_Pool, 3, 3, 3);
Check_Order (Test, Ref_Pool);
end;
exception
when Error : others => Test.Report_Exception (Error);
end Bounded_Pool;
procedure Static_Pool (Report : in out NT.Reporter'Class) is
Test : NT.Test := Report.Item ("Static pool typical usage");
begin
declare
Size : constant Ref_Pools.Pool_Size := 10;
Ref_Pool : Ref_Pools.Pool;
Ref : array (Ref_Pools.Pool_Size range 1 .. Size) of Refs.Reference;
begin
Check_Counts (Test, Ref_Pool, 0, 0, 0);
Ref_Pool.Preallocate (Size, Factory'Access);
Check_Counts (Test, Ref_Pool, 0, Size, Size);
for I in Ref'Range loop
Ref_Pool.Get (Ref (I));
Check_Counts (Test, Ref_Pool, I, Size, Size);
end loop;
Ref (2).Reset;
Check_Counts (Test, Ref_Pool, Size - 1, Size, Size);
Ref_Pool.Get (Ref (2));
Check_Counts (Test, Ref_Pool, Size, Size, Size);
declare
Extra_Ref : Refs.Reference;
begin
Ref_Pool.Get (Extra_Ref);
Test.Fail ("Expected exception at Get on full pool");
exception
when Constraint_Error =>
null;
when Error : others =>
Test.Info ("At Get on full pool,");
Test.Report_Exception (Error, NT.Fail);
end;
Check_Order (Test, Ref_Pool);
end;
exception
when Error : others => Test.Report_Exception (Error);
end Static_Pool;
procedure Unbounded_Pool (Report : in out NT.Reporter'Class) is
Test : NT.Test := Report.Item ("Unbounded pool typical usage");
begin
declare
Test_Length : constant Duration := 0.5;
Ref_Pool : Ref_Pools.Pool;
Workers : array (1 .. 5) of Pseudo_Process;
begin
Check_Counts (Test, Ref_Pool, 0, 0, 0);
Ref_Pool.Preallocate (1);
Check_Counts (Test, Ref_Pool, 0, 0, 1);
-- Timeline (in Test_Length/10): <-------->
-- Task using reference 1: 11111 444
-- Task using reference 2: 22222 55
-- Task using reference 3: 33333
Unbounded_Start (Workers (1), Ref_Pool, Test_Length * 0.5, Test, 1);
Check_Counts (Test, Ref_Pool, 1, 1, 1);
delay Test_Length * 0.2;
Unbounded_Start (Workers (2), Ref_Pool, Test_Length * 0.5, Test, 2);
Check_Counts (Test, Ref_Pool, 2, 2, 2);
delay Test_Length * 0.2;
Unbounded_Start (Workers (3), Ref_Pool, Test_Length * 0.5, Test, 3);
Check_Counts (Test, Ref_Pool, 3, 3, 3);
delay Test_Length * 0.2;
Check_Counts (Test, Ref_Pool, 2, 3, 3);
Unbounded_Start (Workers (4), Ref_Pool, Test_Length * 0.3, Test, 1);
Check_Counts (Test, Ref_Pool, 3, 3, 3);
delay Test_Length * 0.1;
Check_Counts (Test, Ref_Pool, 2, 3, 3);
Ref_Pool.Purge;
Check_Counts (Test, Ref_Pool, 2, 2, 2);
Unbounded_Start (Workers (5), Ref_Pool, Test_Length * 0.2, Test, 3);
end;
exception
when Error : others => Test.Report_Exception (Error);
end Unbounded_Pool;
end Natools.Reference_Tests.Pools;
|
package body SPDX.Licenses is
--------------
-- Valid_Id --
--------------
function Valid_Id (Str : String) return Boolean is
begin
return (for some I in Id => Str = Img (I));
end Valid_Id;
-------------
-- From_Id --
-------------
function From_Id (Str : String) return Id is
begin
for I in Id loop
if Str = Img (I) then
return I;
end if;
end loop;
raise Program_Error;
end From_Id;
end SPDX.Licenses;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . T A S K I N G . P R O T E C T E D _ O B J E C T S . --
-- E N T R I E S --
-- --
-- B o d y --
-- --
-- Copyright (C) 1998-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. --
-- --
------------------------------------------------------------------------------
-- This package contains all the simple primitives related to protected
-- objects with entries (i.e init, lock, unlock).
-- The handling of protected objects with no entries is done in
-- System.Tasking.Protected_Objects, the complex routines for protected
-- objects with entries in System.Tasking.Protected_Objects.Operations.
-- The split between Entries and Operations is needed to break circular
-- dependencies inside the run time.
-- Note: the compiler generates direct calls to this interface, via Rtsfind
with Ada.Exceptions;
-- Used for Exception_Occurrence_Access
-- Raise_Exception
with System.Task_Primitives.Operations;
-- Used for Initialize_Lock
-- Write_Lock
-- Unlock
-- Get_Priority
-- Wakeup
with System.Tasking.Initialization;
-- Used for Defer_Abort,
-- Undefer_Abort,
-- Change_Base_Priority
pragma Elaborate_All (System.Tasking.Initialization);
-- This insures that tasking is initialized if any protected objects are
-- created.
with System.Parameters;
-- Used for Single_Lock
package body System.Tasking.Protected_Objects.Entries is
package STPO renames System.Task_Primitives.Operations;
use Parameters;
use Task_Primitives.Operations;
use Ada.Exceptions;
----------------
-- Local Data --
----------------
Locking_Policy : Character;
pragma Import (C, Locking_Policy, "__gl_locking_policy");
--------------
-- Finalize --
--------------
procedure Finalize (Object : in out Protection_Entries) is
Entry_Call : Entry_Call_Link;
Caller : Task_Id;
Ceiling_Violation : Boolean;
Self_ID : constant Task_Id := STPO.Self;
Old_Base_Priority : System.Any_Priority;
begin
if Object.Finalized then
return;
end if;
STPO.Write_Lock (Object.L'Unrestricted_Access, Ceiling_Violation);
if Single_Lock then
Lock_RTS;
end if;
if Ceiling_Violation then
-- Dip our own priority down to ceiling of lock. See similar code in
-- Tasking.Entry_Calls.Lock_Server.
STPO.Write_Lock (Self_ID);
Old_Base_Priority := Self_ID.Common.Base_Priority;
Self_ID.New_Base_Priority := Object.Ceiling;
Initialization.Change_Base_Priority (Self_ID);
STPO.Unlock (Self_ID);
if Single_Lock then
Unlock_RTS;
end if;
STPO.Write_Lock (Object.L'Unrestricted_Access, Ceiling_Violation);
if Ceiling_Violation then
Raise_Exception (Program_Error'Identity, "Ceiling Violation");
end if;
if Single_Lock then
Lock_RTS;
end if;
Object.Old_Base_Priority := Old_Base_Priority;
Object.Pending_Action := True;
end if;
-- Send program_error to all tasks still queued on this object
for E in Object.Entry_Queues'Range loop
Entry_Call := Object.Entry_Queues (E).Head;
while Entry_Call /= null loop
Caller := Entry_Call.Self;
Entry_Call.Exception_To_Raise := Program_Error'Identity;
STPO.Write_Lock (Caller);
Initialization.Wakeup_Entry_Caller (Self_ID, Entry_Call, Done);
STPO.Unlock (Caller);
exit when Entry_Call = Object.Entry_Queues (E).Tail;
Entry_Call := Entry_Call.Next;
end loop;
end loop;
Object.Finalized := True;
if Single_Lock then
Unlock_RTS;
end if;
STPO.Unlock (Object.L'Unrestricted_Access);
STPO.Finalize_Lock (Object.L'Unrestricted_Access);
end Finalize;
-------------------------------------
-- Has_Interrupt_Or_Attach_Handler --
-------------------------------------
function Has_Interrupt_Or_Attach_Handler
(Object : Protection_Entries_Access)
return Boolean
is
pragma Warnings (Off, Object);
begin
return False;
end Has_Interrupt_Or_Attach_Handler;
-----------------------------------
-- Initialize_Protection_Entries --
-----------------------------------
procedure Initialize_Protection_Entries
(Object : Protection_Entries_Access;
Ceiling_Priority : Integer;
Compiler_Info : System.Address;
Entry_Bodies : Protected_Entry_Body_Access;
Find_Body_Index : Find_Body_Index_Access)
is
Init_Priority : Integer := Ceiling_Priority;
Self_ID : constant Task_Id := STPO.Self;
begin
if Init_Priority = Unspecified_Priority then
Init_Priority := System.Priority'Last;
end if;
if Locking_Policy = 'C'
and then Has_Interrupt_Or_Attach_Handler (Object)
and then Init_Priority not in System.Interrupt_Priority
then
-- Required by C.3.1(11)
raise Program_Error;
end if;
Initialization.Defer_Abort (Self_ID);
Initialize_Lock (Init_Priority, Object.L'Access);
Initialization.Undefer_Abort (Self_ID);
Object.Ceiling := System.Any_Priority (Init_Priority);
Object.Owner := Null_Task;
Object.Compiler_Info := Compiler_Info;
Object.Pending_Action := False;
Object.Call_In_Progress := null;
Object.Entry_Bodies := Entry_Bodies;
Object.Find_Body_Index := Find_Body_Index;
for E in Object.Entry_Queues'Range loop
Object.Entry_Queues (E).Head := null;
Object.Entry_Queues (E).Tail := null;
end loop;
end Initialize_Protection_Entries;
------------------
-- Lock_Entries --
------------------
procedure Lock_Entries
(Object : Protection_Entries_Access; Ceiling_Violation : out Boolean)
is
begin
if Object.Finalized then
Raise_Exception
(Program_Error'Identity, "Protected Object is finalized");
end if;
-- If pragma Detect_Blocking is active then, as described in the ARM
-- 9.5.1, par. 15, we must check whether this is an external call on a
-- protected subprogram with the same target object as that of the
-- protected action that is currently in progress (i.e., if the caller
-- is already the protected object's owner). If this is the case hence
-- Program_Error must be raised.
if Detect_Blocking and then Object.Owner = Self then
raise Program_Error;
end if;
-- The lock is made without defering abort
-- Therefore the abort has to be deferred before calling this routine.
-- This means that the compiler has to generate a Defer_Abort call
-- before the call to Lock.
-- The caller is responsible for undeferring abort, and compiler
-- generated calls must be protected with cleanup handlers to ensure
-- that abort is undeferred in all cases.
pragma Assert (STPO.Self.Deferral_Level > 0);
Write_Lock (Object.L'Access, Ceiling_Violation);
-- We are entering in a protected action, so that we increase the
-- protected object nesting level (if pragma Detect_Blocking is
-- active), and update the protected object's owner.
if Detect_Blocking then
declare
Self_Id : constant Task_Id := Self;
begin
-- Update the protected object's owner
Object.Owner := Self_Id;
-- Increase protected object nesting level
Self_Id.Common.Protected_Action_Nesting :=
Self_Id.Common.Protected_Action_Nesting + 1;
end;
end if;
end Lock_Entries;
procedure Lock_Entries (Object : Protection_Entries_Access) is
Ceiling_Violation : Boolean;
begin
Lock_Entries (Object, Ceiling_Violation);
if Ceiling_Violation then
Raise_Exception (Program_Error'Identity, "Ceiling Violation");
end if;
end Lock_Entries;
----------------------------
-- Lock_Read_Only_Entries --
----------------------------
procedure Lock_Read_Only_Entries (Object : Protection_Entries_Access) is
Ceiling_Violation : Boolean;
begin
if Object.Finalized then
Raise_Exception
(Program_Error'Identity, "Protected Object is finalized");
end if;
-- If pragma Detect_Blocking is active then, as described in the ARM
-- 9.5.1, par. 15, we must check whether this is an external call on a
-- protected subprogram with the same target object as that of the
-- protected action that is currently in progress (i.e., if the caller
-- is already the protected object's owner). If this is the case hence
-- Program_Error must be raised.
-- Note that in this case (getting read access), several tasks may
-- have read ownership of the protected object, so that this method of
-- storing the (single) protected object's owner does not work
-- reliably for read locks. However, this is the approach taken for two
-- major reasosn: first, this function is not currently being used (it
-- is provided for possible future use), and second, it largely
-- simplifies the implementation.
if Detect_Blocking and then Object.Owner = Self then
raise Program_Error;
end if;
Read_Lock (Object.L'Access, Ceiling_Violation);
if Ceiling_Violation then
Raise_Exception (Program_Error'Identity, "Ceiling Violation");
end if;
-- We are entering in a protected action, so that we increase the
-- protected object nesting level (if pragma Detect_Blocking is
-- active), and update the protected object's owner.
if Detect_Blocking then
declare
Self_Id : constant Task_Id := Self;
begin
-- Update the protected object's owner
Object.Owner := Self_Id;
-- Increase protected object nesting level
Self_Id.Common.Protected_Action_Nesting :=
Self_Id.Common.Protected_Action_Nesting + 1;
end;
end if;
end Lock_Read_Only_Entries;
--------------------
-- Unlock_Entries --
--------------------
procedure Unlock_Entries (Object : Protection_Entries_Access) is
begin
-- We are exiting from a protected action, so that we decrease the
-- protected object nesting level (if pragma Detect_Blocking is
-- active), and remove ownership of the protected object.
if Detect_Blocking then
declare
Self_Id : constant Task_Id := Self;
begin
-- Calls to this procedure can only take place when being within
-- a protected action and when the caller is the protected
-- object's owner.
pragma Assert (Self_Id.Common.Protected_Action_Nesting > 0
and then Object.Owner = Self_Id);
-- Remove ownership of the protected object
Object.Owner := Null_Task;
Self_Id.Common.Protected_Action_Nesting :=
Self_Id.Common.Protected_Action_Nesting - 1;
end;
end if;
Unlock (Object.L'Access);
end Unlock_Entries;
end System.Tasking.Protected_Objects.Entries;
|
package ObjectPack is
type Object is interface;
function toString(obj: Object) return String is abstract;
type ObjectPtr is access all Object'Class;
type ObjectPtrArray is array (Natural range <>) of ObjectPtr;
type ObjectPtrArrayPtr is access all ObjectPtrArray;
generic
type Item is private;
function hash(obj: Item) return Integer;
end;
|
-- { dg-do run }
-- { dg-options "-gnat05 -O2" }
with Enum2_Pkg; use Enum2_Pkg;
procedure Enum2 is
type Enum is (A, B, C, D);
Table : array (B .. C, 1 .. 1) of F_String := (others => (others => Null_String));
begin
Table := (others => (others => Null_String));
end;
|
-- This file is covered by the Internet Software Consortium (ISC) License
-- Reference: ../License.txt
with Unix;
with Parameters;
with HelperText;
with File_Operations;
with PortScan.Scan;
with PortScan.Operations;
with Ada.Characters.Latin_1;
with Ada.Directories;
with Ada.Exceptions;
with Ada.Text_IO;
package body Repository is
package PM renames Parameters;
package HT renames HelperText;
package FOP renames File_Operations;
package LAT renames Ada.Characters.Latin_1;
package DIR renames Ada.Directories;
package EX renames Ada.Exceptions;
package TIO renames Ada.Text_IO;
--------------------------------------------------------------------------------------------
-- signing_command
--------------------------------------------------------------------------------------------
function signing_command return String
is
filename : constant String := get_file_prefix & "-signing_command";
begin
return FOP.head_n1 (filename);
end signing_command;
--------------------------------------------------------------------------------------------
-- profile_fingerprint
--------------------------------------------------------------------------------------------
function profile_fingerprint return String
is
filename : constant String := get_file_prefix & "-fingerprint";
begin
return FOP.head_n1 (filename);
end profile_fingerprint;
--------------------------------------------------------------------------------------------
-- valid_signing_command
--------------------------------------------------------------------------------------------
function valid_signing_command return Boolean
is
file_prefix : constant String := get_file_prefix;
fingerprint : constant String := file_prefix & "fingerprint";
ext_command : constant String := file_prefix & "signing_command";
found_finger : constant Boolean := DIR.Exists (fingerprint);
found_command : constant Boolean := DIR.Exists (ext_command);
begin
if found_finger and then found_command then
if HT.IsBlank (FOP.head_n1 (fingerprint)) or else
HT.IsBlank (FOP.head_n1 (ext_command))
then
TIO.Put_Line ("At least one of the profile signing command files is blank");
TIO.Put_Line (sorry);
return False;
end if;
return True;
end if;
if found_finger then
TIO.Put_Line ("The profile fingerprint was found but not the signing command");
TIO.Put_Line (sorry);
elsif found_command then
TIO.Put_Line ("The profile signing command was found but not the fingerprint");
TIO.Put_Line (sorry);
end if;
return False;
end valid_signing_command;
--------------------------------------------------------------------------------------------
-- acceptable_RSA_signing_support
--------------------------------------------------------------------------------------------
function acceptable_RSA_signing_support return Boolean
is
file_prefix : constant String := get_file_prefix;
key_private : constant String := file_prefix & "private.key";
key_public : constant String := file_prefix & "public.key";
found_private : constant Boolean := DIR.Exists (key_private);
found_public : constant Boolean := DIR.Exists (key_public);
begin
if not found_private and then not found_public then
return True;
end if;
if found_public and then not found_private then
TIO.Put_Line ("A public RSA key file has been found without a " &
"corresponding private key file.");
TIO.Put_Line (sorry);
return True;
end if;
if found_private and then not found_public then
TIO.Put_Line ("A private RSA key file has been found without a " &
"corresponding public key file.");
TIO.Put_Line (sorry);
return True;
end if;
declare
mode : constant String := file_permissions (key_private);
begin
if mode /= "400" then
TIO.Put_Line ("The private RSA key file has insecure file permissions (" & mode & ")");
TIO.Put_Line ("Please change the file mode of " & key_private &
" to 400 before continuing.");
return False;
end if;
end;
return True;
end acceptable_RSA_signing_support;
--------------------------------------------------------------------------------------------
-- set_raven_conf_with_RSA
--------------------------------------------------------------------------------------------
function set_raven_conf_with_RSA return Boolean
is
file_prefix : constant String := get_file_prefix;
key_private : constant String := file_prefix & "private.key";
key_public : constant String := file_prefix & "public.key";
found_private : constant Boolean := DIR.Exists (key_private);
found_public : constant Boolean := DIR.Exists (key_public);
begin
return
found_public and then
found_private and then
file_permissions (key_private) = "400";
end set_raven_conf_with_RSA;
--------------------------------------------------------------------------------------------
-- get_file_prefix
--------------------------------------------------------------------------------------------
function get_file_prefix return String is
begin
return PM.raven_confdir & "/" & HT.USS (PM.configuration.profile) & "-";
end get_file_prefix;
--------------------------------------------------------------------------------------------
-- file_permissions
--------------------------------------------------------------------------------------------
function file_permissions (full_path : String) return String
is
function OS_command return String;
content : HT.Text;
status : Integer;
function OS_command return String is
begin
case platform_type is
when dragonfly |
freebsd |
netbsd |
openbsd |
macos => return "/usr/bin/stat -f %Lp ";
when linux |
sunos => return "/usr/bin/stat -L --format=%a ";
end case;
end OS_command;
command : constant String := HT.USS (PM.configuration.dir_sysroot) & OS_command & full_path;
begin
content := Unix.piped_command (command, status);
if status /= 0 then
return "000";
end if;
return HT.first_line (HT.USS (content));
end file_permissions;
--------------------------------------------------------------------------------------------
-- host_pkg8_conservative_upgrade_set
--------------------------------------------------------------------------------------------
function host_pkg8_conservative_upgrade_set return Boolean
is
command : constant String := host_pkg8 & " config CONSERVATIVE_UPGRADE";
content : HT.Text;
status : Integer;
begin
content := Unix.piped_command (command, status);
return (HT.first_line (HT.USS (content)) = "yes");
end host_pkg8_conservative_upgrade_set;
--------------------------------------------------------------------------------------------
-- get_repos_dir
--------------------------------------------------------------------------------------------
function get_repos_dir return String
is
command : String := host_pkg8 & " config repos_dir";
status : Integer;
markers : HT.Line_Markers;
repdirs : String := HT.USS (Unix.piped_command (command, status));
default : constant String := host_localbase & "/etc/pkg/repos";
begin
if status /= 0 then
-- command failed, use default
return default;
end if;
HT.initialize_markers (repdirs, markers);
loop
exit when not HT.next_line_present (repdirs, markers);
declare
line : constant String := HT.extract_line (repdirs, markers);
begin
if line /= "/etc/pkg" then
return line;
end if;
end;
end loop;
-- fallback, use default
return default;
end get_repos_dir;
--------------------------------------------------------------------------------------------
-- write_pkg_repos_configuration_file
--------------------------------------------------------------------------------------------
function write_pkg_repos_configuration_file return Boolean
is
repdir : constant String := get_repos_dir;
target : constant String := repdir & "/00_raven.conf";
pkgdir : constant String := HT.USS (PM.configuration.dir_packages);
pubkey : constant String := get_file_prefix & "-public.key";
keydir : constant String := PM.raven_confdir & "/keys";
tstdir : constant String := keydir & "/trusted";
autgen : constant String := "# Automatically generated." & LAT.LF;
fpfile : constant String := tstdir & "/fingerprint." & HT.USS (PM.configuration.profile);
handle : TIO.File_Type;
vscmd : Boolean := False;
begin
if DIR.Exists (target) then
DIR.Delete_File (target);
elsif not DIR.Exists (repdir) then
DIR.Create_Path (repdir);
end if;
TIO.Create (File => handle, Mode => TIO.Out_File, Name => target);
TIO.Put_Line (handle, autgen);
TIO.Put_Line (handle, "Raven: {");
TIO.Put_Line (handle, " url : file://" & pkgdir & ",");
TIO.Put_Line (handle, " priority : 0,");
TIO.Put_Line (handle, " enabled : yes,");
if valid_signing_command then
vscmd := True;
TIO.Put_Line (handle, " signature_type : FINGERPRINTS,");
TIO.Put_Line (handle, " fingerprints : " & keydir);
elsif set_raven_conf_with_RSA then
TIO.Put_Line (handle, " signature_type : PUBKEY,");
TIO.Put_Line (handle, " pubkey : " & LAT.Quotation & pubkey & LAT.Quotation);
end if;
TIO.Put_Line (handle, "}");
TIO.Close (handle);
if vscmd then
if DIR.Exists (fpfile) then
DIR.Delete_File (fpfile);
elsif not DIR.Exists (tstdir) then
DIR.Create_Path (tstdir);
end if;
TIO.Create (File => handle, Mode => TIO.Out_File, Name => fpfile);
TIO.Put_Line (handle, autgen);
TIO.Put_Line (handle, "function : sha256");
TIO.Put_Line (handle, "fingerprint : " & profile_fingerprint);
TIO.Close (handle);
end if;
return True;
exception
when others =>
TIO.Put_Line ("Error: failed to create " & target);
if TIO.Is_Open (handle) then
TIO.Close (handle);
end if;
return False;
end write_pkg_repos_configuration_file;
--------------------------------------------------------------------------------------------
-- rebuild_local_respository
--------------------------------------------------------------------------------------------
procedure preclean_repository (repository : String)
is
begin
if PortScan.Scan.scan_repository (repository) then
PortScan.Operations.eliminate_obsolete_packages;
end if;
end preclean_repository;
--------------------------------------------------------------------------------------------
-- rebuild_local_respository
--------------------------------------------------------------------------------------------
procedure rebuild_local_respository (remove_invalid_packages : Boolean)
is
------------------------------------------------------------
-- fully_scan_tree must be executed before this routine --
------------------------------------------------------------
repo : constant String := HT.USS (PM.configuration.dir_repository);
main : constant String := HT.USS (PM.configuration.dir_packages);
xz_meta : constant String := main & "/meta.tzst";
xz_digest : constant String := main & "/digests.tzst";
xz_pkgsite : constant String := main & "/packagesite.tzst";
bs_error : constant String := "Rebuild Repository: Failed to bootstrap builder";
build_res : Boolean;
begin
if remove_invalid_packages then
preclean_repository (repo);
end if;
if DIR.Exists (xz_meta) then
DIR.Delete_File (xz_meta);
end if;
if DIR.Exists (xz_digest) then
DIR.Delete_File (xz_digest);
end if;
if DIR.Exists (xz_pkgsite) then
DIR.Delete_File (xz_pkgsite);
end if;
if valid_signing_command then
build_res := build_repository (signing_command);
elsif acceptable_RSA_signing_support then
build_res := build_repository;
else
build_res := False;
end if;
if build_res then
TIO.Put_Line ("Local repository successfully rebuilt.");
else
TIO.Put_Line ("Failed to rebuild repository.");
end if;
end rebuild_local_respository;
--------------------------------------------------------------------------------------------
-- silent_exec
--------------------------------------------------------------------------------------------
procedure silent_exec (command : String)
is
cmd_output : HT.Text;
success : Boolean := Unix.piped_mute_command (command, cmd_output);
begin
if not success then
raise bad_command with command & " => failed: " & HT.USS (cmd_output);
end if;
end silent_exec;
--------------------------------------------------------------------------------------------
-- build_repository
--------------------------------------------------------------------------------------------
function build_repository (sign_command : String := "") return Boolean
is
key_private : constant String := get_file_prefix & "private.key";
use_key : constant Boolean := DIR.Exists (key_private);
use_cmd : constant Boolean := (sign_command /= "");
pkgdir : constant String := HT.USS (PM.configuration.dir_packages);
command : constant String := host_pkg8 & " repo -q " & pkgdir;
sc_cmd : constant String := command & " signing_command: " & sign_command;
cmd_out : HT.Text;
begin
if use_key then
TIO.Put_Line ("Rebuilding RSA-signed local repository ...");
silent_exec (command & " " & key_private);
elsif use_cmd then
TIO.Put_Line ("Rebuilding externally-signed local repository ...");
silent_exec (sc_cmd);
else
TIO.Put_Line ("Rebuilding local repository ...");
silent_exec (command);
end if;
return True;
exception
when quepaso : others =>
TIO.Put_Line (EX.Exception_Message (quepaso));
return False;
end build_repository;
end Repository;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S E M _ A T T R --
-- --
-- S p e c --
-- --
-- $Revision$
-- --
-- Copyright (C) 1992-1999, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- Attribute handling is isolated in a separate package to ease the addition
-- of implementation defined attributes. Logically this processing belongs
-- in chapter 4. See Sem_Ch4 for a description of the relation of the
-- Analyze and Resolve routines for expression components.
-- This spec also documents all GNAT implementation defined pragmas
with Snames; use Snames;
with Types; use Types;
package Sem_Attr is
type Attribute_Class_Array is array (Attribute_Id) of Boolean;
-- Type used to build attribute classification flag arrays
-----------------------------------------
-- Implementation Dependent Attributes --
-----------------------------------------
-- This section describes the implementation dependent attributes
-- provided in GNAT, as well as constructing an array of flags
-- indicating which attributes these are.
Attribute_Impl_Def : Attribute_Class_Array := Attribute_Class_Array'(
------------------
-- Abort_Signal --
------------------
Attribute_Abort_Signal => True,
--
-- Standard'Abort_Signal (Standard is the only allowed prefix)
-- provides the entity for the special exception used to signal
-- task abort or asynchronous transfer of control. Normally this
-- attribute should only be used in the tasking runtime (it is
-- highly peculiar, and completely outside the normal semantics
-- of Ada, for a user program to intercept the abort exception).
------------------
-- Address_Size --
------------------
Attribute_Address_Size => True,
--
-- Standard'Address_Size (Standard is the only allowed prefix) is
-- a static constant giving the number of bits in an Address. It
-- is used primarily for constructing the definition of Memory_Size
-- in package Standard, but may be freely used in user programs.
-- This is a static attribute.
---------------
-- Asm_Input --
---------------
Attribute_Asm_Input => True,
--
-- Used only in conjunction with the Asm and Asm_Volatile subprograms
-- in package Machine_Code to construct machine instructions. See
-- documentation in package Machine_Code in file s-maccod.ads.
----------------
-- Asm_Output --
----------------
Attribute_Asm_Output => True,
--
-- Used only in conjunction with the Asm and Asm_Volatile subprograms
-- in package Machine_Code to construct machine instructions. See
-- documentation in package Machine_Code in file s-maccod.ads.
---------------
-- AST_Entry --
---------------
Attribute_AST_Entry => True,
--
-- E'Ast_Entry, where E is a task entry, yields a value of the
-- predefined type System.DEC.AST_Handler, that enables the given
-- entry to be called when an AST occurs. If the name to which the
-- attribute applies has not been specified with the pragma AST_Entry,
-- the attribute returns the value No_Ast_Handler, and no AST occurs.
-- If the entry is for a task that is not callable (T'Callable False),
-- the exception program error is raised. If an AST occurs for an
-- entry of a task that is terminated, the program is erroneous.
--
-- The attribute AST_Entry is supported only in OpenVMS versions
-- of GNAT. It will be rejected as illegal in other GNAT versions.
---------
-- Bit --
---------
Attribute_Bit => True,
--
-- Obj'Bit, where Obj is any object, yields the bit offset within
-- the storage unit (byte) that contains the first bit of storage
-- allocated for the object. The value of this attribute is of the
-- type Universal_Integer, and is always a non-negative number not
-- exceeding the value of System.Storage_Unit.
--
-- For an object that is a variable or a constant allocated in a
-- register, the value is zero. (The use of this attribute does not
-- force the allocation of a variable to memory).
--
-- For an object that is a formal parameter, this attribute applies
-- to either the matching actual parameter or to a copy of the
-- matching actual parameter.
--
-- For an access object the value is zero. Note that Obj.all'Bit is
-- subject to an Access_Check for the designated object. Similarly
-- for a record component X.C'Bit is subject to a discriminant check
-- and X(I).Bit and X(I1..I2)'Bit are subject to index checks.
--
-- This attribute is designed to be compatible with the DEC Ada
-- definition and implementation of the Bit attribute.
------------------
-- Code_Address --
------------------
Attribute_Code_Address => True,
--
-- subp'Code_Address, where subp is a subprogram entity, gives the
-- address of the first generated instruction for a subprogram. This
-- is often, but not always the same as the 'Address value, which is
-- the address to be used in a call. The differences occur in the case
-- of a nested procedure (where Address yields the address of the
-- trampoline code used to load the static link), and on some systems
-- which use procedure descriptors (in which case Address yields the
-- address of the descriptor).
-----------------------
-- Default_Bit_Order --
-----------------------
Attribute_Default_Bit_Order => True,
--
-- Standard'Default_Bit_Order (Standard is the only permissible prefix),
-- provides the value System.Default_Bit_Order as a Pos value (0 for
-- High_Order_First, 1 for Low_Order_First). This is used to construct
-- the definition of Default_Bit_Order in package System. This is a
-- static attribute.
---------------
-- Elab_Body --
---------------
Attribute_Elab_Body => True,
--
-- This attribute can only be applied to a program unit name. It
-- returns the entity for the corresponding elaboration procedure
-- for elaborating the body of the referenced unit. This is used
-- in the main generated elaboration procedure by the binder, and
-- is not normally used in any other context, but there may be
-- specialized situations in which it is useful to be able to
-- call this elaboration procedure from Ada code, e.g. if it
-- is necessary to do selective reelaboration to fix some error.
---------------
-- Elab_Spec --
---------------
Attribute_Elab_Spec => True,
--
-- This attribute can only be applied to a program unit name. It
-- returns the entity for the corresponding elaboration procedure
-- for elaborating the spec of the referenced unit. This is used
-- in the main generated elaboration procedure by the binder, and
-- is not normally used in any other context, but there may be
-- specialized situations in which it is useful to be able to
-- call this elaboration procedure from Ada code, e.g. if it
-- is necessary to do selective reelaboration to fix some error.
----------------
-- Elaborated --
----------------
Attribute_Elaborated => True,
--
-- Lunit'Elaborated, where Lunit is a library unit, yields a boolean
-- value indicating whether or not the body of the designated library
-- unit has been elaborated yet.
--------------
-- Enum_Rep --
--------------
Attribute_Enum_Rep => True,
--
-- For every enumeration subtype S, S'Enum_Rep denotes a function
-- with the following specification:
--
-- function S'Enum_Rep (Arg : S'Base) return universal_integer;
--
-- The function returns the representation value for the given
-- enumeration value. This will be equal to the 'Pos value in the
-- absence of an enumeration representation clause. This is a static
-- attribute (i.e. the result is static if the argument is static).
-----------------
-- Fixed_Value --
-----------------
Attribute_Fixed_Value => True,
--
-- For every fixed-point type S, S'Fixed_Value denotes a function
-- with the following specification:
--
-- function S'Fixed_Value (Arg : universal_integer) return S;
--
-- The value returned is the fixed-point value V such that
--
-- V = Arg * S'Small
--
-- The effect is thus equivalent to first converting the argument
-- to the integer type used to represent S, and then doing an
-- unchecked conversion to the fixed-point type. This attribute is
-- primarily intended for use in implementation of the input-output
-- functions for fixed-point values.
-----------------------
-- Has_Discriminants --
-----------------------
Attribute_Has_Discriminants => True,
--
-- Gtyp'Has_Discriminants, where Gtyp is a generic formal type, yields
-- a Boolean value indicating whether or not the actual instantiation
-- type has discriminants.
---------
-- Img --
---------
Attribute_Img => True,
--
-- The 'Img function is defined for any prefix, P, that denotes an
-- object of scalar type T. P'Img is equivalent to T'Image (P). This
-- is convenient for debugging. For example:
--
-- Put_Line ("X = " & X'Img);
--
-- has the same meaning as the more verbose:
--
-- Put_Line ("X = " & Temperature_Type'Image (X));
--
-- where Temperature_Type is the subtype of the object X.
-------------------
-- Integer_Value --
-------------------
Attribute_Integer_Value => True,
--
-- For every integer type S, S'Integer_Value denotes a function
-- with the following specification:
--
-- function S'Integer_Value (Arg : universal_fixed) return S;
--
-- The value returned is the integer value V, such that
--
-- Arg = V * fixed-type'Small
--
-- The effect is thus equivalent to first doing an unchecked convert
-- from the fixed-point type to its corresponding implementation type,
-- and then converting the result to the target integer type. This
-- attribute is primarily intended for use in implementation of the
-- standard input-output functions for fixed-point values.
------------------
-- Machine_Size --
------------------
Attribute_Machine_Size => True,
--
-- This attribute is identical to the Object_Size attribute. It is
-- provided for compatibility with the DEC attribute of this name.
----------------------------
-- Max_Interrupt_Priority --
----------------------------
Attribute_Max_Interrupt_Priority => True,
--
-- Standard'Max_Interrupt_Priority (Standard is the only permissible
-- prefix), provides the value System.Max_Interrupt_Priority, and is
-- intended primarily for constructing this definition in package
-- System (see note above in Default_Bit_Order description}. This
-- is a static attribute.
------------------
-- Max_Priority --
------------------
Attribute_Max_Priority => True,
--
-- Standard'Max_Priority (Standard is the only permissible prefix)
-- provides the value System.Max_Priority, and is intended primarily
-- for constructing this definition in package System (see note above
-- in Default_Bit_Order description). This is a static attribute.
-----------------------
-- Maximum_Alignment --
-----------------------
Attribute_Maximum_Alignment => True,
--
-- Standard'Maximum_Alignment (Standard is the only permissible prefix)
-- provides the maximum useful alignment value for the target. This
-- is a static value that can be used to specify the alignment for an
-- object, guaranteeing that it is properly aligned in all cases. The
-- time this is useful is when an external object is imported and its
-- alignment requirements are unknown. This is a static attribute.
--------------------
-- Mechanism_Code --
--------------------
Attribute_Mechanism_Code => True,
--
-- function'Mechanism_Code yeilds an integer code for the mechanism
-- used for the result of function, and subprogram'Mechanism_Code (n)
-- yields the mechanism used for formal parameter number n (a static
-- integer value, 1 = first parameter). The code returned is:
--
-- 1 = by copy (value)
-- 2 = by reference
-- 3 = by descriptor (default descriptor type)
-- 4 = by descriptor (UBS unaligned bit string)
-- 5 = by descriptor (UBSB aligned bit string with arbitrary bounds)
-- 6 = by descriptor (UBA unaligned bit array)
-- 7 = by descriptor (S string, also scalar access type parameter)
-- 8 = by descriptor (SB string with arbitrary bounds)
-- 9 = by descriptor (A contiguous array)
-- 10 = by descriptor (NCA non-contiguous array)
--------------------
-- Null_Parameter --
--------------------
Attribute_Null_Parameter => True,
--
-- A reference T'Null_Parameter denotes an (imaginary) object of
-- type or subtype T allocated at (machine) address zero. The
-- attribute is allowed only as the default expression of a formal
-- parameter, or as an actual expression of a subporgram call. In
-- either case, the subprogram must be imported.
--
-- The identity of the object is represented by the address zero
-- in the argument list, independent of the passing mechanism
-- (explicit or default).
--
-- The reason that this capability is needed is that for a record
-- or other composite object passed by reference, there is no other
-- way of specifying that a zero address should be passed.
-----------------
-- Object_Size --
-----------------
Attribute_Object_Size => True,
--
-- Type'Object_Size is the same as Type'Size for all types except
-- fixed-point types and discrete types. For fixed-point types and
-- discrete types, this attribute gives the size used for default
-- allocation of objects and components of the size. See section
-- in Einfo ("Handling of type'Size values") for further details.
-------------------------
-- Passed_By_Reference --
-------------------------
Attribute_Passed_By_Reference => True,
--
-- T'Passed_By_Reference for any subtype T returns a boolean value
-- that is true if the type is normally passed by reference and
-- false if the type is normally passed by copy in calls. For scalar
-- types, the result is always False and is static. For non-scalar
-- types, the result is non-static (since it is computed by Gigi).
------------------
-- Range_Length --
------------------
Attribute_Range_Length => True,
--
-- T'Range_Length for any discrete type T yields the number of
-- values represented by the subtype (zero for a null range). The
-- result is static for static subtypes. Note that Range_Length
-- applied to the index subtype of a one dimensional array always
-- gives the same result as Range applied to the array itself.
-- The result is of type universal integer.
------------------
-- Storage_Unit --
------------------
Attribute_Storage_Unit => True,
--
-- Standard'Storage_Unit (Standard is the only permissible prefix)
-- provides the value System.Storage_Unit, and is intended primarily
-- for constructing this definition in package System (see note above
-- in Default_Bit_Order description). The is a static attribute.
----------
-- Tick --
----------
Attribute_Tick => True,
--
-- Standard'Tick (Standard is the only permissible prefix) provides
-- the value System.Tick, and is intended primarily for constructing
-- this definition in package System (see note above in description
-- of Default_Bit_Order). This is a static attribute.
----------------
-- To_Address --
----------------
Attribute_To_Address => True,
--
-- System'To_Address (Address is the only permissible prefix)
-- is a function that takes any integer value, and converts it into
-- an address value. The semantics is to first convert the integer
-- value to type Integer_Address according to normal conversion
-- rules, and then to convert this to an address using the same
-- semantics as the System.Storage_Elements.To_Address function.
-- The important difference is that this is a static attribute
-- so it can be used in initializations in preealborate packages.
----------------
-- Type_Class --
----------------
Attribute_Type_Class => True,
--
-- T'Type_Class for any type or subtype T yields the value of the
-- type class for the full type of T. If T is a generic formal type,
-- then the value is the value for the corresponding actual subtype.
-- The value of this attribute is of type System.Aux_DEC.Type_Class,
-- which has the following definition:
--
-- type Type_Class is
-- (Type_Class_Enumeration,
-- Type_Class_Integer,
-- Type_Class_Fixed_Point,
-- Type_Class_Floating_Point,
-- Type_Class_Array,
-- Type_Class_Record,
-- Type_Class_Access,
-- Type_Class_Task,
-- Type_Class_Address);
--
-- Protected types yield the value Type_Class_Task, which thus
-- applies to all concurrent types. This attribute is designed to
-- be compatible with the DEC Ada attribute of the same name.
--
-- Note: if pragma Extend_System is used to merge the definitions of
-- Aux_DEC into System, then the type Type_Class can be referenced
-- as an entity within System, as can its enumeration literals.
-----------------
-- UET_Address --
-----------------
Attribute_UET_Address => True,
--
-- Unit'UET_Address, where Unit is a program unit, yields the address
-- of the unit exception table for the specified unit. This is only
-- used in the internal implementation of exception handling. See the
-- implementation of unit Ada.Exceptions for details on its use.
------------------------------
-- Universal_Literal_String --
------------------------------
Attribute_Universal_Literal_String => True,
--
-- The prefix of 'Universal_Literal_String must be a named number.
-- The static result is the string consisting of the characters of
-- the number as defined in the original source. This allows the
-- user program to access the actual text of named numbers without
-- intermediate conversions and without the need to enclose the
-- strings in quotes (which would preclude their use as numbers).
-- This is used internally for the construction of values of the
-- floating-point attributes from the file ttypef.ads, but may
-- also be used by user programs.
-------------------------
-- Unrestricted_Access --
-------------------------
Attribute_Unrestricted_Access => True,
--
-- The Unrestricted_Access attribute is similar to Access except that
-- all accessibility and aliased view checks are omitted. This is very
-- much a user-beware attribute. Basically its status is very similar
-- to Address, for which it is a desirable replacement where the value
-- desired is an access type. In other words, its effect is identical
-- to first taking 'Address and then doing an unchecked conversion to
-- a desired access type. Note that in GNAT, but not necessarily in
-- other implementations, the use of static chains for inner level
-- subprograms means that Unrestricted_Access applied to a subprogram
-- yields a value that can be called as long as the subprogram is in
-- scope (normal Ada 95 accessibility rules restrict this usage).
---------------
-- VADS_Size --
---------------
Attribute_VADS_Size => True,
--
-- Typ'VADS_Size yields the Size value typically yielded by some
-- Ada 83 compilers. The differences between VADS_Size and Size
-- is that for scalar types for which no Size has been specified,
-- VADS_Size yields the Object_Size rather than the Value_Size.
-- For example, while Natural'Size is typically 31, the value of
-- Natural'VADS_Size is 32. For all other types, Size and VADS_Size
-- yield the same value.
----------------
-- Value_Size --
----------------
Attribute_Value_Size => True,
--
-- Type'Value_Size is the number of bits required to represent a
-- value of the given subtype. It is the same as Type'Size, but,
-- unlike Size, may be set for non-first subtypes. See section
-- in Einfo ("Handling of type'Size values") for further details.
---------------
-- Word_Size --
---------------
Attribute_Word_Size => True,
--
-- Standard'Word_Size (Standard is the only permissible prefix)
-- provides the value System.Word_Size, and is intended primarily
-- for constructing this definition in package System (see note above
-- in Default_Bit_Order description). This is a static attribute.
others => False);
-----------------
-- Subprograms --
-----------------
procedure Analyze_Attribute (N : Node_Id);
-- Performs bottom up semantic analysis of an attribute. Note that the
-- parser has already checked that type returning attributes appear only
-- in appropriate contexts (i.e. in subtype marks, or as prefixes for
-- other attributes).
procedure Resolve_Attribute (N : Node_Id; Typ : Entity_Id);
-- Performs type resolution of attribute. If the attribute yields
-- a universal value, mark its type as that of the context. On
-- the other hand, if the context itself is universal (as in
-- T'Val (T'Pos (X)), mark the type as being the largest type of
-- that class that can be used at run-time. This is correct since
-- either the value gets folded (in which case it doesn't matter
-- what type of the class we give if, since the folding uses universal
-- arithmetic anyway) or it doesn't get folded (in which case it is
-- going to be dealt with at runtime, and the largest type is right).
end Sem_Attr;
|
-- -----------------------------------------------------------------------------
-- smk, the smart make (http://lionel.draghi.free.fr/smk/)
-- © 2018, 2019 Lionel Draghi <lionel.draghi@free.fr>
-- SPDX-License-Identifier: APSL-2.0
-- -----------------------------------------------------------------------------
-- 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.Calendar;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
private package Smk.Files is
-- --------------------------------------------------------------------------
-- Purpose:
-- This package defines a File and related operations
-- --------------------------------------------------------------------------
type File_Status is (New_File,
Identical,
Updated,
Missing,
Unknown) with Default_Value => Unknown;
Status_Image : constant array (File_Status) of String (1 .. 7) :=
(New_File => "New ",
Identical => "Identic", -- Identical
Updated => "Updated",
Missing => "Missing",
Unknown => "Unknown");
Short_Status_Image : constant array (File_Status) of Character :=
(New_File => 'N',
Identical => '=',
Updated => 'U',
Missing => 'M',
Unknown => '?');
-- --------------------------------------------------------------------------
type File_Role is (Source,
Target,
Unused) with Default_Value => Unused;
Role_Image : constant array (File_Role) of String (1 .. 6) :=
(Source => "Source",
Target => "Target",
Unused => "Unused");
-- --------------------------------------------------------------------------
type File_Name is new Unbounded_String;
function "+" (Name : File_Name) return String;
function "+" (Name : String) return File_Name;
No_File : constant File_Name
:= File_Name (Ada.Strings.Unbounded.Null_Unbounded_String);
-- --------------------------------------------------------------------------
function Shorten (Name : String) return String;
function Shorten (Name : File_Name) return String;
-- returns Name if Settings.Shorten_File_Names = False,
-- or a short path from current dir the the file.
-- NB : Name must be a Full_Name (a rooted path)
-- --------------------------------------------------------------------------
type File_Type is private;
-- --------------------------------------------------------------------------
function Create (File : File_Name;
Role : File_Role) return File_Type;
-- --------------------------------------------------------------------------
function Time_Tag (File : File_Type) return Ada.Calendar.Time;
function Is_Dir (File : File_Type) return Boolean;
function Is_System (File : File_Type) return Boolean;
-- Is_System returns True if the File_Name starts with "/usr/, "/lib/", etc.
function Role (File : File_Type) return File_Role
with Pre => not (Is_Source (File) and Is_Target (File)); -- can't be both
function Status (File : File_Type) return File_Status;
function Is_Source (File : File_Type) return Boolean;
function Is_Target (File : File_Type) return Boolean;
function Is_Unused (File : File_Type) return Boolean is
(not Is_Source (File) and not Is_Target (File));
-- -----------------------------------------------------------------------
function Has_Target (Name : File_Name;
Target : String) return Boolean;
-- File is a Full_Name
-- return True if Target match the right part of File
-- --------------------------------------------------------------------------
function File_Image (Name : File_Name;
File : File_Type;
Prefix : String := "") return String;
-- Return a string according to Long_Listing_Format setting
-- if True: [Fil] [Normal] [Source] [Identic] [<timetag>] ogg-to-mp3.sh
-- if False: ogg-to-mp3.sh
-- --------------------------------------------------------------------------
function Is_Dir (File_Name : in String) return Boolean;
-- --------------------------------------------------------------------------
procedure Update_File_Status (Name : in File_Name;
File : in out File_Type;
Previous_Status : out File_Status;
Current_Status : out File_Status);
private
-- --------------------------------------------------------------------------
type File_Type is record
Time_Tag : Ada.Calendar.Time;
Is_System : Boolean;
Is_Dir : Boolean;
Is_Source : Boolean;
Is_Target : Boolean;
Status : File_Status;
end record;
end Smk.Files;
|
-- SPDX-FileCopyrightText: 2020 Max Reznik <reznikmm@gmail.com>
--
-- SPDX-License-Identifier: MIT
----------------------------------------------------------------
with Ada.Containers.Vectors;
with Ada.Containers.Hashed_Maps;
with Ada.Tags;
with League.Strings;
with League.Strings.Hash;
with League.String_Vectors;
with Markdown.Blockquotes;
with Markdown.Blocks;
with Markdown.Inline_Parsers;
with Markdown.Link_Registers;
with Markdown.Visitors;
package Markdown.Parsers is
type Parser is limited new Markdown.Link_Registers.Link_Register with
private;
procedure Append_Line
(Self : in out Parser'Class;
Text : League.Strings.Universal_String);
procedure Stop (Self : in out Parser'Class);
function Parse_Inlines
(Self : Parser'Class;
Text : League.String_Vectors.Universal_String_Vector)
return Markdown.Inline_Parsers.Annotated_Text;
type Block_Start_Filter is access procedure
(Line : Markdown.Blocks.Text_Line;
Tag : in out Ada.Tags.Tag;
CIP : out Can_Interrupt_Paragraph);
procedure Register
(Self : in out Parser'Class;
Filter : Block_Start_Filter);
procedure Visit
(Self : Parser'Class;
Visitor : in out Markdown.Visitors.Visitor'Class);
private
package Block_Vectors is new Ada.Containers.Vectors
(Positive, Markdown.Blocks.Block_Access, Markdown.Blocks."=");
package Container_Vectors is new Ada.Containers.Vectors
(Positive, Markdown.Blocks.Container_Block_Access, Markdown.Blocks."=");
package Filter_Vectors is new Ada.Containers.Vectors
(Positive, Block_Start_Filter, "=");
type Link_Information is record
Destination : League.Strings.Universal_String;
Title : League.String_Vectors.Universal_String_Vector;
end record;
package Link_Maps is new Ada.Containers.Hashed_Maps
(Key_Type => League.Strings.Universal_String,
Element_Type => Link_Information,
Hash => League.Strings.Hash,
Equivalent_Keys => League.Strings."=",
"=" => "=");
type Parser is limited new Markdown.Link_Registers.Link_Register with record
Links : Link_Maps.Map;
Blocks : Markdown.Blockquotes.Blockquote; -- a dummy root block
Open : Container_Vectors.Vector;
Open_Leaf : Markdown.Blocks.Block_Access;
Filters : Filter_Vectors.Vector;
end record;
overriding procedure Resolve
(Self : Parser;
Label : League.Strings.Universal_String;
Found : out Boolean;
Destination : out League.Strings.Universal_String;
Title : out League.String_Vectors.Universal_String_Vector);
end Markdown.Parsers;
|
-- contains debug functions for printing things
package Debug with SPARK_Mode is
-- print a string
procedure Put(Item : in String) with
Global => null;
-- print a string and add a new line
procedure Put_Line(Item : in String) with
Global => null;
-- print an integer (with no new line)
procedure Put(Item : in Integer) with
Global => null;
-- new line
procedure New_Line with
Global => null;
-- print a single character
procedure Put(Item : in Character) with
Global => null;
end Debug;
|
pragma Warnings (Off);
with SDL_Image;
use SDL_Image;
procedure Compile is
begin
null;
end Compile;
|
with
lace.Event.utility,
system.RPC,
ada.unchecked_Conversion;
package body lace.Event.Logger.text
is
use lace.Event.utility,
ada.Text_IO;
-- Forge
--
function to_Logger (Name : in String) return Item
is
begin
return Self : Item
do
create (Self.File, out_File, Name & ".log");
end return;
end to_Logger;
overriding
procedure destruct (Self : in out Item)
is
begin
close (Self.File);
end destruct;
-- Operations
--
overriding
procedure log_Connection (Self : in out Item; From : in Observer.view;
To : in Subject .view;
for_Kind : in Event.Kind)
is
begin
put_Line (Self.File, "log Connection => "
& From.Name & " observes " & To.Name
& " for event kind " & Name_of (for_Kind) & ".");
end log_Connection;
overriding
procedure log_Disconnection (Self : in out Item; From : in Observer.view;
To : in Subject.view;
for_Kind : in Event.Kind)
is
function from_Name return String
is
function to_Integer is new ada.unchecked_Conversion (Observer.view,
long_Integer);
begin
return From.Name;
exception
when system.RPC.communication_Error
| storage_Error =>
return "dead Observer (" & long_Integer'Image (to_Integer (From)) & ")";
end from_Name;
begin
put_Line (Self.File, "log Disconnection => "
& from_Name
& " no longer observes "
& To.Name
& " for event kind " & Name_of (for_Kind) & ".");
end log_Disconnection;
overriding
procedure log_Emit (Self : in out Item; From : in Subject .view;
To : in Observer.view;
the_Event : in Event.item'Class)
is
function to_Name return String
is
function to_Integer is new ada.unchecked_Conversion (lace.Observer.view,
long_Integer);
begin
return To.Name;
exception
when system.RPC.communication_Error
| storage_Error =>
return "dead Observer (" & long_Integer'Image (to_Integer (To)) & ")";
end to_Name;
begin
if Self.Ignored.contains (to_Kind (the_Event'Tag))
then
return;
end if;
put_Line (Self.File, "log Emit => "
& From.Name & " sends " & Name_of (Kind_of (the_Event))
& " to " & to_Name & ".");
end log_Emit;
overriding
procedure log_Relay (Self : in out Item; From : in Observer.view;
To : in Observer.view;
the_Event : in Event.item'Class)
is
begin
put_Line (Self.File, "log Relay => "
& From.Name & " relays " & Name_of (Kind_of (the_Event))
& " to " & To.Name & ".");
end log_Relay;
overriding
procedure log_new_Response (Self : in out Item; the_Response : in Response.view;
of_Observer : in Observer.item'Class;
to_Kind : in Event.Kind;
from_Subject : in subject_Name)
is
begin
put_Line (Self.File, "log new Response => "
& of_Observer.Name
& " responds to " & Name_of (to_Kind)
& " from " & from_Subject
& " with " & the_Response.Name);
end log_new_Response;
overriding
procedure log_rid_Response (Self : in out Item; the_Response : in Response.view;
of_Observer : in Observer.item'Class;
to_Kind : in Event.Kind;
from_Subject : in subject_Name)
is
begin
put_Line (Self.File, "log rid Response => "
& of_Observer.Name
& " no longer responds to " & Name_of (to_Kind)
& " from " & from_Subject
& " with " & the_Response.Name & ".");
end log_rid_Response;
overriding
procedure log_Response (Self : in out Item; the_Response : in Response.view;
of_Observer : in Observer.view;
to_Event : in Event.item'Class;
from_Subject : in subject_Name)
is
begin
if Self.Ignored.contains (to_Kind (to_Event'Tag))
then
return;
end if;
put_Line (Self.File, "log Response => "
& of_Observer.Name
& " responds to " & Name_of (to_Kind (to_Event'Tag))
& " from " & from_Subject
& " with " & the_Response.Name & ".");
end log_Response;
overriding
procedure log (Self : in out Item; Message : in String)
is
begin
put_Line (Self.File, Message);
end log;
overriding
procedure ignore (Self : in out Item; Kind : in Event.Kind)
is
begin
Self.Ignored.insert (Kind);
end ignore;
end lace.event.Logger.text;
|
--
-- bytebauble.adb - Body of the ByteBauble package.
--
--
-- 2021/03/05, Maya Posch
with Ada.Text_IO; use Ada.Text_IO;
with System; use System;
package body ByteBauble is
-- DETECT HOST ENDIAN --
procedure detectHostEndian is
-- type uint16 is mod 2 ** 16;
-- type uint8 is mod 2 ** 8;
-- bytes : uint16 := 1;
-- check : uint8;
begin
--check := bytes(0 .. 7);
Put_Line ("Endianness " & Bit_Order'Image(Default_Bit_Order));
--if check > 0 then
if Default_Bit_Order = LOW_ORDER_FIRST then
hostEndian := BB_LE;
Put_Line(Standard_Output, "Detected Host Little Endian.");
else
hostEndian := BB_BE;
Put_Line(Standard_Output, "Detected Host Big Endian.");
end if;
end detectHostEndian;
-- GET HOST ENDIAN --
function getHostEndian return BBEndianness is
begin
return hostEndian;
end getHostEndian;
-- SET GLOBAL ENDIANNESS --
procedure setGlobalEndianness(endian : in BBEndianness) is
begin
globalEndian := endian;
end setGlobalEndianness;
function toGlobal(value : in uint16; endian : in BBEndianness) return uint16 is
begin
if globalEndian = endian then
-- -- Same endianness, just return the value.
return value;
end if;
return Bswap_16(value);
end toGlobal;
function toGlobal(value : in uint32; endian : in BBEndianness) return uint32 is
begin
if globalEndian = endian then
-- -- Same endianness, just return the value.
return value;
end if;
return Bswap_32(value);
end toGlobal;
function toGlobal(value : in uint64; endian : in BBEndianness) return uint64 is
begin
if globalEndian = endian then
-- -- Same endianness, just return the value.
return value;
end if;
return Bswap_64(value);
end toGlobal;
function toHost(value : in uint16; endian : in BBEndianness) return uint16 is
begin
if hostEndian = endian then
-- Same endianness, just return the value.
return value;
end if;
return Bswap_16(value);
end toHost;
function toHost(value : in uint32; endian : in BBEndianness) return uint32 is
begin
if hostEndian = endian then
-- Same endianness, just return the value.
return value;
end if;
return Bswap_32(value);
end toHost;
function toHost(value : in uint64; endian : in BBEndianness) return uint64 is
begin
if hostEndian = endian then
-- Same endianness, just return the value.
return value;
end if;
return Bswap_64(value);
end toHost;
end ByteBauble;
|
-----------------------------------------------------------------------
-- contexts-facelets -- Contexts for facelets
-- Copyright (C) 2009, 2010, 2011, 2013 Stephane Carrez
-- Written by Stephane Carrez (Stephane.Carrez@gmail.com)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Directories;
with Util.Files;
with Util.Log.Loggers;
with EL.Variables;
with ASF.Applications.Main;
with ASF.Views.Nodes.Facelets;
package body ASF.Contexts.Facelets is
use Util.Log;
-- The logger
Log : constant Loggers.Logger := Loggers.Create ("ASF.Contexts.Facelets");
-- ------------------------------
-- Get the EL context for evaluating expressions.
-- ------------------------------
function Get_ELContext (Context : in Facelet_Context)
return EL.Contexts.ELContext_Access is
begin
return Context.Context;
end Get_ELContext;
-- ------------------------------
-- Set the EL context for evaluating expressions.
-- ------------------------------
procedure Set_ELContext (Context : in out Facelet_Context;
ELContext : in EL.Contexts.ELContext_Access) is
begin
Context.Context := ELContext;
end Set_ELContext;
-- ------------------------------
-- Get the function mapper associated with the EL context.
-- ------------------------------
function Get_Function_Mapper (Context : in Facelet_Context)
return EL.Functions.Function_Mapper_Access is
use EL.Contexts;
begin
if Context.Context = null then
return null;
else
return Context.Context.Get_Function_Mapper;
end if;
end Get_Function_Mapper;
-- ------------------------------
-- Set the attribute having given name with the value.
-- ------------------------------
procedure Set_Attribute (Context : in out Facelet_Context;
Name : in String;
Value : in EL.Objects.Object) is
begin
null;
end Set_Attribute;
-- ------------------------------
-- Set the attribute having given name with the value.
-- ------------------------------
procedure Set_Attribute (Context : in out Facelet_Context;
Name : in Unbounded_String;
Value : in EL.Objects.Object) is
begin
null;
end Set_Attribute;
-- ------------------------------
-- Set the attribute having given name with the expression.
-- ------------------------------
procedure Set_Variable (Context : in out Facelet_Context;
Name : in Unbounded_String;
Value : in EL.Expressions.Expression) is
Mapper : constant access EL.Variables.Variable_Mapper'Class
:= Context.Context.Get_Variable_Mapper;
begin
if Mapper /= null then
Mapper.Set_Variable (Name, Value);
end if;
end Set_Variable;
-- Set the attribute having given name with the expression.
procedure Set_Variable (Context : in out Facelet_Context;
Name : in String;
Value : in EL.Expressions.Expression) is
N : constant Unbounded_String := To_Unbounded_String (Name);
begin
Set_Variable (Context, N, Value);
end Set_Variable;
-- ------------------------------
-- Include the facelet from the given source file.
-- The included views appended to the parent component tree.
-- ------------------------------
procedure Include_Facelet (Context : in out Facelet_Context;
Source : in String;
Parent : in Base.UIComponent_Access) is
begin
null;
end Include_Facelet;
-- ------------------------------
-- Include the definition having the given name.
-- ------------------------------
procedure Include_Definition (Context : in out Facelet_Context;
Name : in Unbounded_String;
Parent : in Base.UIComponent_Access;
Found : out Boolean) is
Node : Composition_Tag_Node;
Iter : Defines_Vector.Cursor := Context.Defines.Last;
The_Name : aliased constant String := To_String (Name);
begin
if Context.Inserts.Contains (The_Name'Unchecked_Access) then
Found := True;
return;
end if;
Context.Inserts.Insert (The_Name'Unchecked_Access);
while Defines_Vector.Has_Element (Iter) loop
Node := Defines_Vector.Element (Iter);
Node.Include_Definition (Parent => Parent,
Context => Context,
Name => Name,
Found => Found);
if Found then
Context.Inserts.Delete (The_Name'Unchecked_Access);
return;
end if;
Defines_Vector.Previous (Iter);
end loop;
Found := False;
Context.Inserts.Delete (The_Name'Unchecked_Access);
end Include_Definition;
-- ------------------------------
-- Push into the current facelet context the <ui:define> nodes contained in
-- the composition/decorate tag.
-- ------------------------------
procedure Push_Defines (Context : in out Facelet_Context;
Node : access ASF.Views.Nodes.Facelets.Composition_Tag_Node) is
begin
Context.Defines.Append (Node.all'Access);
end Push_Defines;
-- ------------------------------
-- Pop from the current facelet context the <ui:define> nodes.
-- ------------------------------
procedure Pop_Defines (Context : in out Facelet_Context) is
use Ada.Containers;
begin
if Context.Defines.Length > 0 then
Context.Defines.Delete_Last;
end if;
end Pop_Defines;
-- ------------------------------
-- Set the path to resolve relative facelet paths and get the previous path.
-- ------------------------------
procedure Set_Relative_Path (Context : in out Facelet_Context;
Path : in String;
Previous : out Unbounded_String) is
begin
Log.Debug ("Set facelet relative path: {0}", Path);
Previous := Context.Path;
Context.Path := To_Unbounded_String (Ada.Directories.Containing_Directory (Path));
end Set_Relative_Path;
-- ------------------------------
-- Set the path to resolve relative facelet paths.
-- ------------------------------
procedure Set_Relative_Path (Context : in out Facelet_Context;
Path : in Unbounded_String) is
begin
Log.Debug ("Set facelet relative path: {0}", Path);
Context.Path := Path;
end Set_Relative_Path;
-- ------------------------------
-- Resolve the facelet relative path
-- ------------------------------
function Resolve_Path (Context : Facelet_Context;
Path : String) return String is
begin
if Path (Path'First) = '/' then
return Path;
else
Log.Debug ("Resolve {0} with context {1}", Path, To_String (Context.Path));
return Util.Files.Compose (To_String (Context.Path), Path);
end if;
end Resolve_Path;
-- ------------------------------
-- Get a converter from a name.
-- Returns the converter object or null if there is no converter.
-- ------------------------------
function Get_Converter (Context : in Facelet_Context;
Name : in EL.Objects.Object)
return ASF.Converters.Converter_Access is
begin
return Facelet_Context'Class (Context).Get_Application.Find (Name);
end Get_Converter;
-- ------------------------------
-- Get a validator from a name.
-- Returns the validator object or null if there is no validator.
-- ------------------------------
function Get_Validator (Context : in Facelet_Context;
Name : in EL.Objects.Object)
return ASF.Validators.Validator_Access is
begin
return Facelet_Context'Class (Context).Get_Application.Find_Validator (Name);
end Get_Validator;
end ASF.Contexts.Facelets;
|
-- caesar.adb
-- An improved algorithm that uses bit magic to transform ASCII
-- characters instead of looping through a lookup table.
--
-- Written by: A Dikdik <cutedikdik@yandex.com>
-- Copyright (c) 2017 A Dikdik
-- All rights reserved.
--
-- Licensed under the BSD clause 3 license.
--
-- About:
-- The goal of this program is to function as a bi-directional way of
-- ciphering and deciphering text using the classical Caesar cipher (ROT-1)
--
-- In order to do this without using a look-up table that contains pairs of
-- both upper and lower-case ASCII letters this program uses tricks in order
-- shift and wrap around ASCII values. In some ways this is more efficient
-- and requires less code while still performing the same basic job as a
-- program that uses a look-up table.
--
-- to compile: ~$ make
--
-- to encipher: ~$ ./bin/caesar --encipher 3 'some text to encipher'
-- to decipher: ~$ ./bin/caesar --decipher 3 'some text to decipher'
with Ada.Text_IO;
with Ada.Command_Line;
procedure Caesar
is
-- to be brief and safe we rename instead of use
package IO renames Ada.Text_IO;
package CL renames Ada.Command_Line;
-- create some variables to hold our argument parsing state
Key_Argument : Integer; -- stores the key argument
Mode : Boolean; -- stores whether or not this is a cipher operation
-- ASCII value constants
ASCII_la : constant Integer := 97;
ASCII_lz : constant Integer := 122;
ASCII_UA : constant Integer := 65;
ASCII_UZ : constant Integer := 90;
-- Shift_Character
-- Takes a valid ASCII letter and either shifts it up in value by one
-- or, in the case of 'z' and 'Z', assigns it the value of 'a' or 'A'
-- or vice versa depending on the mode.
--
-- Parameter: (Character) In_Character - Valid ASCII character to shift
-- Parameter: (Integer) Key - Places to shift
-- Parameter: (Boolean) Mode - Whether or not this is a deciphering
-- Return: (Character) - Valid ASCII character result
function Shift_Character (In_Character : Character;
Key : Integer;
Mode : Boolean)
return Character
is
Temp_Character : Integer;
Key_Text_Sum : Integer;
Key_Text_Sub : Integer;
begin
Temp_Character := Character'Pos (In_Character);
Key_Text_Sum := Temp_Character + Key;
Key_Text_Sub := Key_Text_Sum - (Key * 2);
if Mode = TRUE then
if Key_Text_Sum > ASCII_lz then
Temp_Character := ((Key_Text_Sum - ASCII_lz) + ASCII_La - 1);
elsif Key_Text_Sum > ASCII_UZ and Key_Text_Sum < ASCII_la then
Temp_Character := ((Key_Text_Sum - ASCII_UZ) + ASCII_UA - 1);
else
Temp_Character := Key_Text_Sum;
end if;
elsif Mode = FALSE then
if Key_Text_Sub < ASCII_la and Key_Text_Sub > ASCII_UZ then
Temp_Character := (1 + ASCII_lz - (ASCII_la - Key_Text_Sub));
elsif Key_Text_Sub < ASCII_UA then
Temp_Character := (1 + ASCII_UZ - (ASCII_UA - Key_Text_Sub));
else
Temp_Character := Key_Text_Sub;
end if;
end if;
return Character'Val (Temp_Character);
end Shift_Character;
-- Is_Valid_Character
-- Takes a character and returns whether or not it is considered to be
-- a valid ASCII character that can be shifted.
--
-- Memo:
-- If the character is invalid then it should be readded to the string
-- as is, effectively ignoring it.
--
-- Parameter: (Character) In_Character - Character to be evaluated
-- Return: (Boolean) - Result of whether or not the input is valid
function Is_Valid_Character (In_Character : Character)
return Boolean
is
Character_Code : Integer;
begin
Character_Code := Character'Pos (In_Character);
if Character_Code >= ASCII_UA and Character_Code <= ASCII_UZ then
return TRUE;
elsif Character_Code >= ASCII_la and Character_Code <= ASCII_lz then
return TRUE;
end if;
return FALSE;
end Is_Valid_Character;
-- Cipher
-- Takes a string and applies the cipher algorithm to it
--
-- Parameter (String) Text - Text to be ciphered
-- Parameter (Integer) Key - Places to shift
-- Parameter (Boolean) Mode - Whether to encipher or decipher
procedure Cipher (Text : in String;
Key : in Integer;
Mode : in Boolean)
is
I : Integer := 1; -- loop iterator
begin
for I in 1 .. Text'Length loop
if Is_Valid_Character (Text (I)) = TRUE then
IO.Put (Shift_Character (Text (I), Key, Mode));
else
IO.Put (Text (I));
end if;
end loop;
IO.New_Line (1);
end Cipher;
begin
-- check number of arguments (expects 3)
if CL.Argument_Count /= 3 then
IO.Put_Line ("Unexpected amount of arguments!");
return;
end if;
-- check if it is a mode flag
-- memo: argument 1 must be a mode flag!
if CL.Argument (1) = "--decipher" then
Mode := FALSE;
elsif CL.Argument (1) = "--encipher" then
Mode := TRUE;
else
IO.Put_Line ("Could not find mode flag at position one.");
return;
end if;
-- grab the text and the key
Key_Argument := Integer'Value (CL.Argument (2));
-- generate our cipher-text
Cipher (CL.Argument (3), Key_Argument, Mode);
end Caesar;
|
-- SPDX-FileCopyrightText: 2020 Max Reznik <reznikmm@gmail.com>
--
-- SPDX-License-Identifier: MIT
----------------------------------------------------------------
with League.Strings;
with League.JSON.Arrays;
with League.JSON.Objects;
with League.JSON.Values;
with League.String_Vectors;
package Jupyter.Kernels is
Version : constant Wide_Wide_String := "5.3";
-- The current version of the specification is 5.3.
type Kernel is limited interface;
-- Global kernel request interface
type Session is limited interface;
-- Per session request interface
type Session_Access is access all Session'Class with Storage_Size => 0;
type IO_Pub is limited interface;
-- this socket is the ‘broadcast channel’ where the kernel publishes
-- all side effects (stdout, stderr, debugging events etc.) as well as
-- the requests coming from any client over the shell socket and its own
-- requests on the stdin socket.
type IO_Pub_Access is access all IO_Pub'Class with Storage_Size => 0;
not overriding procedure Kernel_Info
(Self : aliased in out Kernel;
Result : out League.JSON.Objects.JSON_Object) is abstract;
-- If a client needs to know information about the kernel, it can make
-- a request of the kernel’s information. This message can be used to
-- fetch core information of the kernel, including language (e.g., Python),
-- language version number and IPython version number, and the IPython
-- message spec version number.
not overriding procedure Shutdown (Self : aliased in out Kernel) is null;
-- The client sends a shutdown request to the kernel, and once it receives
-- the reply message (which is otherwise empty), it can assume that the
-- kernel has completed shutdown safely.
not overriding procedure Create_Session
(Self : aliased in out Kernel;
Session_Id : Positive;
Result : out Session_Access) is abstract;
-- Create a new session with unique Id
not overriding procedure Destroy_Session
(Self : aliased in out Kernel;
Session_Id : Positive) is null;
-- Deallocate the sesstion with given Id
not overriding procedure Interrupt
(Self : aliased in out Kernel;
Session_Id : Positive) is null;
-- Kernel interrupt
not overriding procedure Debug
(Self : aliased in out Kernel;
Session_Id : Positive;
Content : out League.JSON.Objects.JSON_Object) is null;
-- This message type is used with debugging kernels to request specific
-- actions to be performed by the debugger such as adding a breakpoint
-- or stepping into a code.
--
-- @param Content The content dict can be any JSON information used by
-- debugging frontends and kernels.
not overriding function Get_Session
(Self : aliased in out Kernel;
Session_Id : Positive) return Session_Access is abstract;
-- Get a session by Id
not overriding procedure Save_History
(Self : aliased in out Kernel;
Session_Id : Positive;
Input : League.JSON.Values.JSON_Value;
Output : League.JSON.Values.JSON_Value) is null;
-- Save history element for a session with given Id
type History_Access_Type is (A_Range, A_Tail, A_Search);
-- Kind of history reply. So far, this can be 'range', 'tail' or 'search'.
type History_Access (Kind : History_Access_Type := A_Range) is record
Session : Positive;
-- Session is a number counting up each time the kernel starts;
-- you can give a positive session number, or a negative number
-- to count back from the current session.
case Kind is
when A_Range =>
-- Get a range of input cells.
Start, Stop : Positive;
-- start and stop are line (cell) numbers within that session.
when A_Tail | A_Search =>
Count : Positive; -- Get the last Count cells.
case Kind is
when A_Search =>
Pattern : League.Strings.Universal_String;
-- Get cells matching the specified glob pattern (with * and
-- ? as wildcards).
Unique : Boolean;
-- Do not include duplicated history.
when others =>
null;
end case;
end case;
end record;
not overriding procedure History
(Self : aliased in out Kernel;
Output : Boolean;
Raw : Boolean;
History_Access : Jupyter.Kernels.History_Access;
History : out League.JSON.Arrays.JSON_Array) is null;
-- For clients to explicitly request history from a kernel. The kernel has
-- all the actual execution history stored in a single location, so clients
-- can request it from the kernel when needed.
--
-- @param Output If True, also return output history in the resulting
-- dict.
--
-- @param Raw If True, return the raw input history, else the transformed
-- input.
--
-- @param History A list of 3 tuples, either:
-- * (session, line_number, input) or
-- * (session, line_number, (input, output)),
-- depending on whether Output was False or True, respectively.
type Execution_Error is record
Name : League.Strings.Universal_String;
Value : League.Strings.Universal_String;
Traceback : League.String_Vectors.Universal_String_Vector;
end record;
function No_Execution_Error return Execution_Error is ((others => <>));
not overriding procedure Execute
(Self : aliased in out Session;
IO_Pub : not null IO_Pub_Access;
Execution_Counter : Positive;
Code : League.Strings.Universal_String;
Silent : Boolean;
User_Expressions : League.JSON.Objects.JSON_Object;
Allow_Stdin : Boolean;
Stop_On_Error : Boolean;
Expression_Values : out League.JSON.Objects.JSON_Object;
Error : in out Execution_Error) is abstract;
-- Execute code on behalf of the user, in a namespace reserved to the
-- user’s variables (and thus separate from the kernel’s own internal
-- code and variables).
--
-- @param Execution_Counter The global kernel counter that increases by
-- one with each request that stores history. This will typically be used
-- by clients to display prompt numbers to the user. If the request did not
-- store history, this will be the current value of the counter in the
-- kernel.
--
-- @param Code Source code to be executed by the kernel, one or more
-- lines.
--
-- @param Silent A boolean flag which, if True, signals the kernel
-- to execute this code as quietly as possible. silent=True forces
-- store_history to be False, and will *not*:
-- * broadcast output on the IOPUB channel
-- * have an execute_result
--
-- @param User_Expressions A dict mapping names to expressions to be
-- evaluated in the user's dict. The rich display- data representation
-- of each will be evaluated after execution.
--
-- @param Allow_Stdin Some frontends do not support stdin requests.
-- If this is true, code running in the kernel can prompt the user for
-- input with an input_request message (see below). If it is false, the
-- kernel should not send these messages.
--
-- @param Stop_On_Error If True, aborts the execution queue if an exception
-- is encountered. If False, queued execute_requests will execute even if
-- this request generates an exception.
--
-- @param Expression_Values Results for the User_Expressions.
not overriding procedure Complete
(Self : aliased in out Session;
Code : League.Strings.Universal_String;
Cursor_Pos : Positive;
Matches : out League.JSON.Arrays.JSON_Array;
Cursor_Start : out Positive;
Cursor_End : out Positive;
Metadata : out League.JSON.Objects.JSON_Object) is null;
-- Completion request
--
-- @param Code The code context in which completion is requested this may
-- be up to an entire multiline cell, such as 'foo = a.isal'
--
-- @param Cursor_Pos The cursor position within 'Code' (in unicode
-- characters) where completion is requested
--
-- @param Matches The list of all matches to the completion request, such
-- as ['a.isalnum', 'a.isalpha'] for the above example.
--
-- @param Cursor_Start The range of text that should be replaced by the
-- above matches when a completion is accepted. typically cursor_end is the
-- same as cursor_pos in the request.
--
-- @param Cursor_End See Cursor_Start
--
-- @param Metadata Information that frontend plugins might use for extra
-- display information about completions.
not overriding procedure Inspect
(Self : aliased in out Session;
Code : League.Strings.Universal_String;
Cursor_Pos : Positive;
Detail_Level : Natural;
Found : out Boolean;
Data : out League.JSON.Objects.JSON_Object;
Metadata : out League.JSON.Objects.JSON_Object) is null;
-- Code can be inspected to show useful information to the user. It is up
-- to the Kernel to decide what information should be displayed, and its
-- formatting.
--
-- @param Code The code context in which introspection is requested this
-- may be up to an entire multiline cell.
--
-- @param Cursor_Pos The cursor position within 'Code' (in unicode
-- characters) where inspection is requested.
--
-- @param Detail_Level The level of detail desired. In IPython, the
-- default (0) is equivalent to typing 'x?' at the prompt, 1 is equivalent
-- to 'x??'. The difference is up to kernels, but in IPython level 1
-- includes the source code if available.
--
-- @param Found Found should be true if an object was found
--
-- @param Data Data can be empty if nothing is found
type Completeness_Status is (Complete, Incomplete, Invalid, Unknown);
-- Kind of completeness reply
--
-- @value Complete Code is ready to be executed
-- @value Incomplete Code should prompt for another line
-- @value Invalid Code will typically be sent for execution, so that
-- the user sees the error soonest
--
-- @value Unknown if the kernel is not able to determine this. The frontend
-- should also handle the kernel not replying promptly. It may default
-- to sending the code for execution, or it may implement simple fallback
-- heuristics for whether to execute the code (e.g. execute after a blank
-- line).
not overriding procedure Is_Complete
(Self : aliased in out Session;
Code : League.Strings.Universal_String;
Status : in out Completeness_Status;
Indent : out League.Strings.Universal_String) is null;
-- When the user enters a line in a console style interface, the console
-- must decide whether to immediately execute the current code, or whether
-- to show a continuation prompt for further input.
--
-- @param Code The code entered so far as a multiline string
-- @param Status One of 'complete', 'incomplete', 'invalid', 'unknown'
-- @param Indent If status is 'incomplete', indent should contain the
-- characters to use to indent the next line. This is only a hint:
-- frontends may ignore it and use their own autoindentation rules.
-- For other statuses, this field does not exist.
------------
-- IO_Pub --
------------
not overriding procedure Stream
(Self : in out IO_Pub;
Name : League.Strings.Universal_String;
Text : League.Strings.Universal_String) is abstract;
-- Streaming output
--
-- @param Name The name of the stream is one of 'stdout', 'stderr'
-- @param Text The text is an arbitrary string to be written to that
-- stream
not overriding procedure Display_Data
(Self : in out IO_Pub;
Data : League.JSON.Objects.JSON_Object;
Metadata : League.JSON.Objects.JSON_Object;
Transient : League.JSON.Objects.JSON_Object) is abstract;
-- This type of message is used to bring back data that should be displayed
-- (text, html, svg, etc.) in the frontends. This data is published to all
-- frontends. Each message can have multiple representations of the data;
-- it is up to the frontend to decide which to use and how. A single
-- message should contain all possible representations of the same
-- information. Each representation should be a JSON’able data
-- structure, and should be a valid MIME type.
--
-- @param Data The data dict contains key/value pairs, where the keys are
-- MIME types and the values are the raw data of the representation in that
-- format
-- @param Metadata Any metadata that describes the data
-- @param Transient Optional transient data introduced in 5.1. Information
-- not to be persisted to a notebook or other documents. Intended to live
-- only during a live kernel session.
not overriding procedure Update_Display_Data
(Self : in out IO_Pub;
Data : League.JSON.Objects.JSON_Object;
Metadata : League.JSON.Objects.JSON_Object;
Transient : League.JSON.Objects.JSON_Object) is abstract;
not overriding procedure Execute_Result
(Self : in out IO_Pub;
Data : League.JSON.Objects.JSON_Object;
Metadata : League.JSON.Objects.JSON_Object;
Transient : League.JSON.Objects.JSON_Object) is abstract;
-- Results of an execution are published as an execute_result. These
-- are identical to display_data messages, with the addition of an
-- execution_count key.
not overriding procedure Execute_Error
(Self : in out IO_Pub;
Value : Execution_Error) is abstract;
-- When an error occurs during code execution
not overriding procedure Clear_Output
(Self : in out IO_Pub;
Wait : Boolean) is abstract;
-- This message type is used to clear the output that is visible on the
-- frontend.
--
-- @param Wait Wait to clear the output until new output is available.
-- Clears the existing output immediately before the new output is
-- displayed. Useful for creating simple animations with minimal
-- flickering.
not overriding procedure Debug_Event
(Self : in out IO_Pub;
Content : League.JSON.Objects.JSON_Object) is abstract;
-- This message type is used by debugging kernels to send debugging events
-- to the frontend.
--
-- @param Content The content dict can be any JSON information used by
-- debugging frontends.
end Jupyter.Kernels;
|
-------------------------------------------------------------------------------
-- This file is part of libsparkcrypto.
--
-- Copyright (C) 2010, Alexander Senier
-- Copyright (C) 2010, secunet Security Networks AG
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions are met:
--
-- * Redistributions of source code must retain the above copyright notice,
-- this list of conditions and the following disclaimer.
--
-- * Redistributions in binary form must reproduce the above copyright
-- notice, this list of conditions and the following disclaimer in the
-- documentation and/or other materials provided with the distribution.
--
-- * Neither the name of the nor the names of its contributors may be used
-- to endorse or promote products derived from this software without
-- specific prior written permission.
--
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
-- BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-- POSSIBILITY OF SUCH DAMAGE.
-------------------------------------------------------------------------------
with LSC.Internal.Types;
use type LSC.Internal.Types.Word32;
use type LSC.Internal.Types.Index;
-------------------------------------------------------------------------------
-- The AES algorithm
--
-- <ul>
-- <li>
-- <a href="http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf">
-- FIPS PUB 197, Advanced Encryption Standard (AES), National Institute of
-- Standards and Technology, U.S. Department of Commerce, November 2001. </a>
-- </li>
--
-- <li>
-- <a href="http://csrc.nist.gov/archive/aes/rijndael/Rijndael-ammended.pdf">
-- Joan Daemen and Vincent Rijmen, AES submission document on Rijndael,
-- Version 2, September 1999.</a>
-- </li>
-- </ul>
-------------------------------------------------------------------------------
package LSC.Internal.AES is
pragma Pure;
-- AES encryption context
type AES_Enc_Context is private;
-- AES decryption context
type AES_Dec_Context is private;
-- Index of AES key
subtype Key_Index is Types.Index range 0 .. 7;
-- AES key
type Key_Type is array (Key_Index range <>) of Types.Word32;
-- Index of AES-128 key
subtype AES128_Key_Index is Types.Index range 0 .. 3;
-- AES-128 key
subtype AES128_Key_Type is Key_Type (AES128_Key_Index);
-- Index of AES-192 key
subtype AES192_Key_Index is Types.Index range 0 .. 5;
-- AES-192 key
subtype AES192_Key_Type is Key_Type (AES192_Key_Index);
-- Index of AES-256 key
subtype AES256_Key_Index is Types.Index range 0 .. 7;
-- AES-256 key
subtype AES256_Key_Type is Key_Type (AES256_Key_Index);
-- Index of AES block
subtype Block_Index is Types.Index range 0 .. 3;
-- AES block
subtype Block_Type is Types.Word32_Array_Type (Block_Index);
-- Index of AES message
subtype Message_Index is Natural;
-- AES message (unconstrained array of AES blocks)
type Message_Type is array (Message_Index range <>) of Block_Type;
-- Create AES-128 encryption context from AES-128 @Key@
function Create_AES128_Enc_Context (Key : AES128_Key_Type) return AES_Enc_Context;
-- Create AES-192 encryption context from AES-192 @Key@
function Create_AES192_Enc_Context (Key : AES192_Key_Type) return AES_Enc_Context;
-- Create AES-256 encryption context from AES-256 @Key@
function Create_AES256_Enc_Context (Key : AES256_Key_Type) return AES_Enc_Context;
-- Encrypt one @Plaintext@ block using given @Context@, return one block of
-- ciphertext
function Encrypt (Context : AES_Enc_Context;
Plaintext : Block_Type) return Block_Type
with Global => null;
-- Create AES-128 decryption context from AES-128 @Key@
function Create_AES128_Dec_Context (Key : AES128_Key_Type) return AES_Dec_Context;
-- Create AES-192 decryption context from AES-192 @Key@
function Create_AES192_Dec_Context (Key : AES192_Key_Type) return AES_Dec_Context;
-- Create AES-256 decryption context from AES-256 @Key@
function Create_AES256_Dec_Context (Key : AES256_Key_Type) return AES_Dec_Context;
-- Decrypt one @Ciphertext@ block using given @Context@, return one block of
-- plaintext
function Decrypt (Context : AES_Dec_Context;
Ciphertext : Block_Type) return Block_Type
with Global => null;
-- Empty AES block
Null_Block : constant Block_Type;
-- Empty AES-128 key
Null_AES128_Key : constant AES128_Key_Type;
-- Empty AES-192 key
Null_AES192_Key : constant AES192_Key_Type;
-- Empty AES-256 key
Null_AES256_Key : constant AES256_Key_Type;
private
Nb : constant Types.Index := 4;
subtype Schedule_Index is Types.Index range 0 .. 15 * Nb - 1;
subtype Schedule_Type is Types.Word32_Array_Type (Schedule_Index);
Null_Schedule : constant Schedule_Type :=
Schedule_Type'(Schedule_Index => 0);
subtype Nr_Type is Types.Index range 10 .. 14;
subtype Nk_Type is Types.Index range 4 .. 8;
type AES_Enc_Context is
record
Schedule : Schedule_Type;
Nr : Nr_Type;
end record;
type AES_Dec_Context is
record
Schedule : Schedule_Type;
Nr : Nr_Type;
end record;
Null_Block : constant Block_Type :=
Block_Type'(Block_Index => 0);
Null_AES128_Key : constant AES128_Key_Type :=
AES128_Key_Type'(AES128_Key_Index => 0);
Null_AES192_Key : constant AES192_Key_Type :=
AES192_Key_Type'(AES192_Key_Index => 0);
Null_AES256_Key : constant AES256_Key_Type :=
AES256_Key_Type'(AES256_Key_Index => 0);
end LSC.Internal.AES;
|
with Ada.Strings.Fixed.Hash;
package body Limited_With3_Pkg1 is
function Equal ( Left, Right : Element_Access) return Boolean is
begin
return True;
end;
function Equivalent_Keys (Left, Right : Key_Type) return Boolean is
begin
return True;
end;
function Hash (Key : Key_Type) return Ada.Containers.Hash_Type is
begin
return Ada.Strings.Fixed.Hash (Key.all);
end Hash;
end Limited_With3_Pkg1;
|
pragma Style_Checks (Off);
-- This spec has been automatically generated from STM32H743x.svd
pragma Restrictions (No_Elaboration_Code);
with HAL;
with System;
package STM32_SVD.HRTIM is
pragma Preelaborate;
---------------
-- Registers --
---------------
subtype CR1_AD1USRC_Field is HAL.UInt3;
subtype CR1_AD2USRC_Field is HAL.UInt3;
subtype CR1_AD3USRC_Field is HAL.UInt3;
subtype CR1_AD4USRC_Field is HAL.UInt3;
-- Control Register 1
type CR1_Register is record
-- Master Update Disable
MUDIS : Boolean := False;
-- Timer A Update Disable
TAUDIS : Boolean := False;
-- Timer B Update Disable
TBUDIS : Boolean := False;
-- Timer C Update Disable
TCUDIS : Boolean := False;
-- Timer D Update Disable
TDUDIS : Boolean := False;
-- Timer E Update Disable
TEUDIS : Boolean := False;
-- unspecified
Reserved_6_15 : HAL.UInt10 := 16#0#;
-- ADC Trigger 1 Update Source
AD1USRC : CR1_AD1USRC_Field := 16#0#;
-- ADC Trigger 2 Update Source
AD2USRC : CR1_AD2USRC_Field := 16#0#;
-- ADC Trigger 3 Update Source
AD3USRC : CR1_AD3USRC_Field := 16#0#;
-- ADC Trigger 4 Update Source
AD4USRC : CR1_AD4USRC_Field := 16#0#;
-- unspecified
Reserved_28_31 : HAL.UInt4 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CR1_Register use record
MUDIS at 0 range 0 .. 0;
TAUDIS at 0 range 1 .. 1;
TBUDIS at 0 range 2 .. 2;
TCUDIS at 0 range 3 .. 3;
TDUDIS at 0 range 4 .. 4;
TEUDIS at 0 range 5 .. 5;
Reserved_6_15 at 0 range 6 .. 15;
AD1USRC at 0 range 16 .. 18;
AD2USRC at 0 range 19 .. 21;
AD3USRC at 0 range 22 .. 24;
AD4USRC at 0 range 25 .. 27;
Reserved_28_31 at 0 range 28 .. 31;
end record;
-- Control Register 2
type CR2_Register is record
-- Master Timer Software update
MSWU : Boolean := False;
-- Timer A Software update
TASWU : Boolean := False;
-- Timer B Software Update
TBSWU : Boolean := False;
-- Timer C Software Update
TCSWU : Boolean := False;
-- Timer D Software Update
TDSWU : Boolean := False;
-- Timer E Software Update
TESWU : Boolean := False;
-- unspecified
Reserved_6_7 : HAL.UInt2 := 16#0#;
-- Master Counter software reset
MRST : Boolean := False;
-- Timer A counter software reset
TARST : Boolean := False;
-- Timer B counter software reset
TBRST : Boolean := False;
-- Timer C counter software reset
TCRST : Boolean := False;
-- Timer D counter software reset
TDRST : Boolean := False;
-- Timer E counter software reset
TERST : Boolean := False;
-- unspecified
Reserved_14_31 : HAL.UInt18 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CR2_Register use record
MSWU at 0 range 0 .. 0;
TASWU at 0 range 1 .. 1;
TBSWU at 0 range 2 .. 2;
TCSWU at 0 range 3 .. 3;
TDSWU at 0 range 4 .. 4;
TESWU at 0 range 5 .. 5;
Reserved_6_7 at 0 range 6 .. 7;
MRST at 0 range 8 .. 8;
TARST at 0 range 9 .. 9;
TBRST at 0 range 10 .. 10;
TCRST at 0 range 11 .. 11;
TDRST at 0 range 12 .. 12;
TERST at 0 range 13 .. 13;
Reserved_14_31 at 0 range 14 .. 31;
end record;
-- ISR_FLT array
type ISR_FLT_Field_Array is array (1 .. 5) of Boolean
with Component_Size => 1, Size => 5;
-- Type definition for ISR_FLT
type ISR_FLT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FLT as a value
Val : HAL.UInt5;
when True =>
-- FLT as an array
Arr : ISR_FLT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 5;
for ISR_FLT_Field use record
Val at 0 range 0 .. 4;
Arr at 0 range 0 .. 4;
end record;
-- Interrupt Status Register
type ISR_Register is record
-- Read-only. Fault 1 Interrupt Flag
FLT : ISR_FLT_Field := (As_Array => False, Val => 16#0#);
-- System Fault Interrupt Flag
SYSFLT : Boolean := False;
-- unspecified
Reserved_6_15 : HAL.UInt10 := 16#0#;
-- Read-only. DLL Ready Interrupt Flag
DLLRDY : Boolean := False;
-- Read-only. Burst mode Period Interrupt Flag
BMPER : Boolean := False;
-- unspecified
Reserved_18_31 : HAL.UInt14 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for ISR_Register use record
FLT at 0 range 0 .. 4;
SYSFLT at 0 range 5 .. 5;
Reserved_6_15 at 0 range 6 .. 15;
DLLRDY at 0 range 16 .. 16;
BMPER at 0 range 17 .. 17;
Reserved_18_31 at 0 range 18 .. 31;
end record;
-- Interrupt Clear Register
type ICR_Register is record
-- Write-only. Fault 1 Interrupt Flag Clear
FLT1C : Boolean := False;
-- Write-only. Fault 2 Interrupt Flag Clear
FLT2C : Boolean := False;
-- Write-only. Fault 3 Interrupt Flag Clear
FLT3C : Boolean := False;
-- Write-only. Fault 4 Interrupt Flag Clear
FLT4C : Boolean := False;
-- Write-only. Fault 5 Interrupt Flag Clear
FLT5C : Boolean := False;
-- System Fault Interrupt Flag Clear
SYSFLTC : Boolean := False;
-- unspecified
Reserved_6_15 : HAL.UInt10 := 16#0#;
-- Write-only. DLL Ready Interrupt flag Clear
DLLRDYC : Boolean := False;
-- Write-only. Burst mode period flag Clear
BMPERC : Boolean := False;
-- unspecified
Reserved_18_31 : HAL.UInt14 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for ICR_Register use record
FLT1C at 0 range 0 .. 0;
FLT2C at 0 range 1 .. 1;
FLT3C at 0 range 2 .. 2;
FLT4C at 0 range 3 .. 3;
FLT5C at 0 range 4 .. 4;
SYSFLTC at 0 range 5 .. 5;
Reserved_6_15 at 0 range 6 .. 15;
DLLRDYC at 0 range 16 .. 16;
BMPERC at 0 range 17 .. 17;
Reserved_18_31 at 0 range 18 .. 31;
end record;
-- Interrupt Enable Register
type IER_Register is record
-- Fault 1 Interrupt Enable
FLT1IE : Boolean := False;
-- Fault 2 Interrupt Enable
FLT2IE : Boolean := False;
-- Fault 3 Interrupt Enable
FLT3IE : Boolean := False;
-- Fault 4 Interrupt Enable
FLT4IE : Boolean := False;
-- Fault 5 Interrupt Enable
FLT5IE : Boolean := False;
-- System Fault Interrupt Enable
SYSFLTE : Boolean := False;
-- unspecified
Reserved_6_15 : HAL.UInt10 := 16#0#;
-- DLL Ready Interrupt Enable
DLLRDYIE : Boolean := False;
-- Burst mode period Interrupt Enable
BMPERIE : Boolean := False;
-- unspecified
Reserved_18_31 : HAL.UInt14 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for IER_Register use record
FLT1IE at 0 range 0 .. 0;
FLT2IE at 0 range 1 .. 1;
FLT3IE at 0 range 2 .. 2;
FLT4IE at 0 range 3 .. 3;
FLT5IE at 0 range 4 .. 4;
SYSFLTE at 0 range 5 .. 5;
Reserved_6_15 at 0 range 6 .. 15;
DLLRDYIE at 0 range 16 .. 16;
BMPERIE at 0 range 17 .. 17;
Reserved_18_31 at 0 range 18 .. 31;
end record;
-- Output Enable Register
type OENR_Register is record
-- Write-only. Timer A Output 1 Enable
TA1OEN : Boolean := False;
-- Write-only. Timer A Output 2 Enable
TA2OEN : Boolean := False;
-- Write-only. Timer B Output 1 Enable
TB1OEN : Boolean := False;
-- Write-only. Timer B Output 2 Enable
TB2OEN : Boolean := False;
-- Write-only. Timer C Output 1 Enable
TC1OEN : Boolean := False;
-- Write-only. Timer C Output 2 Enable
TC2OEN : Boolean := False;
-- Write-only. Timer D Output 1 Enable
TD1OEN : Boolean := False;
-- Write-only. Timer D Output 2 Enable
TD2OEN : Boolean := False;
-- Write-only. Timer E Output 1 Enable
TE1OEN : Boolean := False;
-- Write-only. Timer E Output 2 Enable
TE2OEN : Boolean := False;
-- unspecified
Reserved_10_31 : HAL.UInt22 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for OENR_Register use record
TA1OEN at 0 range 0 .. 0;
TA2OEN at 0 range 1 .. 1;
TB1OEN at 0 range 2 .. 2;
TB2OEN at 0 range 3 .. 3;
TC1OEN at 0 range 4 .. 4;
TC2OEN at 0 range 5 .. 5;
TD1OEN at 0 range 6 .. 6;
TD2OEN at 0 range 7 .. 7;
TE1OEN at 0 range 8 .. 8;
TE2OEN at 0 range 9 .. 9;
Reserved_10_31 at 0 range 10 .. 31;
end record;
-- ODISR
type ODISR_Register is record
-- TA1ODIS
TA1ODIS : Boolean := False;
-- TA2ODIS
TA2ODIS : Boolean := False;
-- TB1ODIS
TB1ODIS : Boolean := False;
-- TB2ODIS
TB2ODIS : Boolean := False;
-- TC1ODIS
TC1ODIS : Boolean := False;
-- TC2ODIS
TC2ODIS : Boolean := False;
-- TD1ODIS
TD1ODIS : Boolean := False;
-- TD2ODIS
TD2ODIS : Boolean := False;
-- TE1ODIS
TE1ODIS : Boolean := False;
-- TE2ODIS
TE2ODIS : Boolean := False;
-- unspecified
Reserved_10_31 : HAL.UInt22 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for ODISR_Register use record
TA1ODIS at 0 range 0 .. 0;
TA2ODIS at 0 range 1 .. 1;
TB1ODIS at 0 range 2 .. 2;
TB2ODIS at 0 range 3 .. 3;
TC1ODIS at 0 range 4 .. 4;
TC2ODIS at 0 range 5 .. 5;
TD1ODIS at 0 range 6 .. 6;
TD2ODIS at 0 range 7 .. 7;
TE1ODIS at 0 range 8 .. 8;
TE2ODIS at 0 range 9 .. 9;
Reserved_10_31 at 0 range 10 .. 31;
end record;
-- Output Disable Status Register
type ODSR_Register is record
-- Read-only. Timer A Output 1 disable status
TA1ODS : Boolean;
-- Read-only. Timer A Output 2 disable status
TA2ODS : Boolean;
-- Read-only. Timer B Output 1 disable status
TB1ODS : Boolean;
-- Read-only. Timer B Output 2 disable status
TB2ODS : Boolean;
-- Read-only. Timer C Output 1 disable status
TC1ODS : Boolean;
-- Read-only. Timer C Output 2 disable status
TC2ODS : Boolean;
-- Read-only. Timer D Output 1 disable status
TD1ODS : Boolean;
-- Read-only. Timer D Output 2 disable status
TD2ODS : Boolean;
-- Read-only. Timer E Output 1 disable status
TE1ODS : Boolean;
-- Read-only. Timer E Output 2 disable status
TE2ODS : Boolean;
-- unspecified
Reserved_10_31 : HAL.UInt22;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for ODSR_Register use record
TA1ODS at 0 range 0 .. 0;
TA2ODS at 0 range 1 .. 1;
TB1ODS at 0 range 2 .. 2;
TB2ODS at 0 range 3 .. 3;
TC1ODS at 0 range 4 .. 4;
TC2ODS at 0 range 5 .. 5;
TD1ODS at 0 range 6 .. 6;
TD2ODS at 0 range 7 .. 7;
TE1ODS at 0 range 8 .. 8;
TE2ODS at 0 range 9 .. 9;
Reserved_10_31 at 0 range 10 .. 31;
end record;
subtype BMCR_BMCLK_Field is HAL.UInt4;
subtype BMCR_BMPRSC_Field is HAL.UInt4;
-- Burst Mode Control Register
type BMCR_Register is record
-- Burst Mode enable
BME : Boolean := False;
-- Burst Mode operating mode
BMOM : Boolean := False;
-- Burst Mode Clock source
BMCLK : BMCR_BMCLK_Field := 16#0#;
-- Burst Mode Prescaler
BMPRSC : BMCR_BMPRSC_Field := 16#0#;
-- Burst Mode Preload Enable
BMPREN : Boolean := False;
-- unspecified
Reserved_11_15 : HAL.UInt5 := 16#0#;
-- Master Timer Burst Mode
MTBM : Boolean := False;
-- Timer A Burst Mode
TABM : Boolean := False;
-- Timer B Burst Mode
TBBM : Boolean := False;
-- Timer C Burst Mode
TCBM : Boolean := False;
-- Timer D Burst Mode
TDBM : Boolean := False;
-- Timer E Burst Mode
TEBM : Boolean := False;
-- unspecified
Reserved_22_30 : HAL.UInt9 := 16#0#;
-- Burst Mode Status
BMSTAT : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for BMCR_Register use record
BME at 0 range 0 .. 0;
BMOM at 0 range 1 .. 1;
BMCLK at 0 range 2 .. 5;
BMPRSC at 0 range 6 .. 9;
BMPREN at 0 range 10 .. 10;
Reserved_11_15 at 0 range 11 .. 15;
MTBM at 0 range 16 .. 16;
TABM at 0 range 17 .. 17;
TBBM at 0 range 18 .. 18;
TCBM at 0 range 19 .. 19;
TDBM at 0 range 20 .. 20;
TEBM at 0 range 21 .. 21;
Reserved_22_30 at 0 range 22 .. 30;
BMSTAT at 0 range 31 .. 31;
end record;
-- BMTRG_MSTCMP array
type BMTRG_MSTCMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for BMTRG_MSTCMP
type BMTRG_MSTCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MSTCMP as a value
Val : HAL.UInt4;
when True =>
-- MSTCMP as an array
Arr : BMTRG_MSTCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for BMTRG_MSTCMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- BMTRG_TACMP array
type BMTRG_TACMP_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for BMTRG_TACMP
type BMTRG_TACMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TACMP as a value
Val : HAL.UInt2;
when True =>
-- TACMP as an array
Arr : BMTRG_TACMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for BMTRG_TACMP_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- BMTRG_TBCMP array
type BMTRG_TBCMP_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for BMTRG_TBCMP
type BMTRG_TBCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TBCMP as a value
Val : HAL.UInt2;
when True =>
-- TBCMP as an array
Arr : BMTRG_TBCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for BMTRG_TBCMP_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- BMTRG_TCCMP array
type BMTRG_TCCMP_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for BMTRG_TCCMP
type BMTRG_TCCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TCCMP as a value
Val : HAL.UInt2;
when True =>
-- TCCMP as an array
Arr : BMTRG_TCCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for BMTRG_TCCMP_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- BMTRG_TDCMP array
type BMTRG_TDCMP_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for BMTRG_TDCMP
type BMTRG_TDCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TDCMP as a value
Val : HAL.UInt2;
when True =>
-- TDCMP as an array
Arr : BMTRG_TDCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for BMTRG_TDCMP_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- BMTRG_TECMP array
type BMTRG_TECMP_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for BMTRG_TECMP
type BMTRG_TECMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TECMP as a value
Val : HAL.UInt2;
when True =>
-- TECMP as an array
Arr : BMTRG_TECMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for BMTRG_TECMP_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- BMTRG
type BMTRG_Register is record
-- SW
SW : Boolean := False;
-- MSTRST
MSTRST : Boolean := False;
-- MSTREP
MSTREP : Boolean := False;
-- MSTCMP1
MSTCMP : BMTRG_MSTCMP_Field :=
(As_Array => False, Val => 16#0#);
-- TARST
TARST : Boolean := False;
-- TAREP
TAREP : Boolean := False;
-- TACMP1
TACMP : BMTRG_TACMP_Field := (As_Array => False, Val => 16#0#);
-- TBRST
TBRST : Boolean := False;
-- TBREP
TBREP : Boolean := False;
-- TBCMP1
TBCMP : BMTRG_TBCMP_Field := (As_Array => False, Val => 16#0#);
-- TCRST
TCRST : Boolean := False;
-- TCREP
TCREP : Boolean := False;
-- TCCMP1
TCCMP : BMTRG_TCCMP_Field := (As_Array => False, Val => 16#0#);
-- TDRST
TDRST : Boolean := False;
-- TDREP
TDREP : Boolean := False;
-- TDCMP1
TDCMP : BMTRG_TDCMP_Field := (As_Array => False, Val => 16#0#);
-- TERST
TERST : Boolean := False;
-- TEREP
TEREP : Boolean := False;
-- TECMP1
TECMP : BMTRG_TECMP_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_27_30 : HAL.UInt4 := 16#0#;
-- OCHPEV
OCHPEV : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for BMTRG_Register use record
SW at 0 range 0 .. 0;
MSTRST at 0 range 1 .. 1;
MSTREP at 0 range 2 .. 2;
MSTCMP at 0 range 3 .. 6;
TARST at 0 range 7 .. 7;
TAREP at 0 range 8 .. 8;
TACMP at 0 range 9 .. 10;
TBRST at 0 range 11 .. 11;
TBREP at 0 range 12 .. 12;
TBCMP at 0 range 13 .. 14;
TCRST at 0 range 15 .. 15;
TCREP at 0 range 16 .. 16;
TCCMP at 0 range 17 .. 18;
TDRST at 0 range 19 .. 19;
TDREP at 0 range 20 .. 20;
TDCMP at 0 range 21 .. 22;
TERST at 0 range 23 .. 23;
TEREP at 0 range 24 .. 24;
TECMP at 0 range 25 .. 26;
Reserved_27_30 at 0 range 27 .. 30;
OCHPEV at 0 range 31 .. 31;
end record;
subtype BMCMPR_BMCMP_Field is HAL.UInt16;
-- BMCMPR
type BMCMPR_Register is record
-- BMCMP
BMCMP : BMCMPR_BMCMP_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for BMCMPR_Register use record
BMCMP at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype BMPER_BMPER_Field is HAL.UInt16;
-- Burst Mode Period Register
type BMPER_Register is record
-- Burst mode Period
BMPER : BMPER_BMPER_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for BMPER_Register use record
BMPER at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype EECR1_EE1SRC_Field is HAL.UInt2;
subtype EECR1_EE1SNS_Field is HAL.UInt2;
subtype EECR1_EE2SRC_Field is HAL.UInt2;
subtype EECR1_EE2SNS_Field is HAL.UInt2;
subtype EECR1_EE3SRC_Field is HAL.UInt2;
subtype EECR1_EE3SNS_Field is HAL.UInt2;
subtype EECR1_EE4SRC_Field is HAL.UInt2;
subtype EECR1_EE4SNS_Field is HAL.UInt2;
subtype EECR1_EE5SRC_Field is HAL.UInt2;
subtype EECR1_EE5SNS_Field is HAL.UInt2;
-- Timer External Event Control Register 1
type EECR1_Register is record
-- External Event 1 Source
EE1SRC : EECR1_EE1SRC_Field := 16#0#;
-- External Event 1 Polarity
EE1POL : Boolean := False;
-- External Event 1 Sensitivity
EE1SNS : EECR1_EE1SNS_Field := 16#0#;
-- External Event 1 Fast mode
EE1FAST : Boolean := False;
-- External Event 2 Source
EE2SRC : EECR1_EE2SRC_Field := 16#0#;
-- External Event 2 Polarity
EE2POL : Boolean := False;
-- External Event 2 Sensitivity
EE2SNS : EECR1_EE2SNS_Field := 16#0#;
-- External Event 2 Fast mode
EE2FAST : Boolean := False;
-- External Event 3 Source
EE3SRC : EECR1_EE3SRC_Field := 16#0#;
-- External Event 3 Polarity
EE3POL : Boolean := False;
-- External Event 3 Sensitivity
EE3SNS : EECR1_EE3SNS_Field := 16#0#;
-- External Event 3 Fast mode
EE3FAST : Boolean := False;
-- External Event 4 Source
EE4SRC : EECR1_EE4SRC_Field := 16#0#;
-- External Event 4 Polarity
EE4POL : Boolean := False;
-- External Event 4 Sensitivity
EE4SNS : EECR1_EE4SNS_Field := 16#0#;
-- External Event 4 Fast mode
EE4FAST : Boolean := False;
-- External Event 5 Source
EE5SRC : EECR1_EE5SRC_Field := 16#0#;
-- External Event 5 Polarity
EE5POL : Boolean := False;
-- External Event 5 Sensitivity
EE5SNS : EECR1_EE5SNS_Field := 16#0#;
-- External Event 5 Fast mode
EE5FAST : Boolean := False;
-- unspecified
Reserved_30_31 : HAL.UInt2 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for EECR1_Register use record
EE1SRC at 0 range 0 .. 1;
EE1POL at 0 range 2 .. 2;
EE1SNS at 0 range 3 .. 4;
EE1FAST at 0 range 5 .. 5;
EE2SRC at 0 range 6 .. 7;
EE2POL at 0 range 8 .. 8;
EE2SNS at 0 range 9 .. 10;
EE2FAST at 0 range 11 .. 11;
EE3SRC at 0 range 12 .. 13;
EE3POL at 0 range 14 .. 14;
EE3SNS at 0 range 15 .. 16;
EE3FAST at 0 range 17 .. 17;
EE4SRC at 0 range 18 .. 19;
EE4POL at 0 range 20 .. 20;
EE4SNS at 0 range 21 .. 22;
EE4FAST at 0 range 23 .. 23;
EE5SRC at 0 range 24 .. 25;
EE5POL at 0 range 26 .. 26;
EE5SNS at 0 range 27 .. 28;
EE5FAST at 0 range 29 .. 29;
Reserved_30_31 at 0 range 30 .. 31;
end record;
subtype EECR2_EE6SRC_Field is HAL.UInt2;
subtype EECR2_EE6SNS_Field is HAL.UInt2;
subtype EECR2_EE7SRC_Field is HAL.UInt2;
subtype EECR2_EE7SNS_Field is HAL.UInt2;
subtype EECR2_EE8SRC_Field is HAL.UInt2;
subtype EECR2_EE8SNS_Field is HAL.UInt2;
subtype EECR2_EE9SRC_Field is HAL.UInt2;
subtype EECR2_EE9SNS_Field is HAL.UInt2;
subtype EECR2_EE10SRC_Field is HAL.UInt2;
subtype EECR2_EE10SNS_Field is HAL.UInt2;
-- Timer External Event Control Register 2
type EECR2_Register is record
-- External Event 6 Source
EE6SRC : EECR2_EE6SRC_Field := 16#0#;
-- External Event 6 Polarity
EE6POL : Boolean := False;
-- External Event 6 Sensitivity
EE6SNS : EECR2_EE6SNS_Field := 16#0#;
-- unspecified
Reserved_5_5 : HAL.Bit := 16#0#;
-- External Event 7 Source
EE7SRC : EECR2_EE7SRC_Field := 16#0#;
-- External Event 7 Polarity
EE7POL : Boolean := False;
-- External Event 7 Sensitivity
EE7SNS : EECR2_EE7SNS_Field := 16#0#;
-- unspecified
Reserved_11_11 : HAL.Bit := 16#0#;
-- External Event 8 Source
EE8SRC : EECR2_EE8SRC_Field := 16#0#;
-- External Event 8 Polarity
EE8POL : Boolean := False;
-- External Event 8 Sensitivity
EE8SNS : EECR2_EE8SNS_Field := 16#0#;
-- unspecified
Reserved_17_17 : HAL.Bit := 16#0#;
-- External Event 9 Source
EE9SRC : EECR2_EE9SRC_Field := 16#0#;
-- External Event 9 Polarity
EE9POL : Boolean := False;
-- External Event 9 Sensitivity
EE9SNS : EECR2_EE9SNS_Field := 16#0#;
-- unspecified
Reserved_23_23 : HAL.Bit := 16#0#;
-- External Event 10 Source
EE10SRC : EECR2_EE10SRC_Field := 16#0#;
-- External Event 10 Polarity
EE10POL : Boolean := False;
-- External Event 10 Sensitivity
EE10SNS : EECR2_EE10SNS_Field := 16#0#;
-- unspecified
Reserved_29_31 : HAL.UInt3 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for EECR2_Register use record
EE6SRC at 0 range 0 .. 1;
EE6POL at 0 range 2 .. 2;
EE6SNS at 0 range 3 .. 4;
Reserved_5_5 at 0 range 5 .. 5;
EE7SRC at 0 range 6 .. 7;
EE7POL at 0 range 8 .. 8;
EE7SNS at 0 range 9 .. 10;
Reserved_11_11 at 0 range 11 .. 11;
EE8SRC at 0 range 12 .. 13;
EE8POL at 0 range 14 .. 14;
EE8SNS at 0 range 15 .. 16;
Reserved_17_17 at 0 range 17 .. 17;
EE9SRC at 0 range 18 .. 19;
EE9POL at 0 range 20 .. 20;
EE9SNS at 0 range 21 .. 22;
Reserved_23_23 at 0 range 23 .. 23;
EE10SRC at 0 range 24 .. 25;
EE10POL at 0 range 26 .. 26;
EE10SNS at 0 range 27 .. 28;
Reserved_29_31 at 0 range 29 .. 31;
end record;
subtype EECR3_EE6F_Field is HAL.UInt4;
subtype EECR3_EE7F_Field is HAL.UInt4;
subtype EECR3_EE8F_Field is HAL.UInt4;
subtype EECR3_EE9F_Field is HAL.UInt4;
subtype EECR3_EE10F_Field is HAL.UInt4;
subtype EECR3_EEVSD_Field is HAL.UInt2;
-- Timer External Event Control Register 3
type EECR3_Register is record
-- EE6F
EE6F : EECR3_EE6F_Field := 16#0#;
-- unspecified
Reserved_4_5 : HAL.UInt2 := 16#0#;
-- EE7F
EE7F : EECR3_EE7F_Field := 16#0#;
-- unspecified
Reserved_10_11 : HAL.UInt2 := 16#0#;
-- EE8F
EE8F : EECR3_EE8F_Field := 16#0#;
-- unspecified
Reserved_16_17 : HAL.UInt2 := 16#0#;
-- EE9F
EE9F : EECR3_EE9F_Field := 16#0#;
-- unspecified
Reserved_22_23 : HAL.UInt2 := 16#0#;
-- EE10F
EE10F : EECR3_EE10F_Field := 16#0#;
-- unspecified
Reserved_28_29 : HAL.UInt2 := 16#0#;
-- EEVSD
EEVSD : EECR3_EEVSD_Field := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for EECR3_Register use record
EE6F at 0 range 0 .. 3;
Reserved_4_5 at 0 range 4 .. 5;
EE7F at 0 range 6 .. 9;
Reserved_10_11 at 0 range 10 .. 11;
EE8F at 0 range 12 .. 15;
Reserved_16_17 at 0 range 16 .. 17;
EE9F at 0 range 18 .. 21;
Reserved_22_23 at 0 range 22 .. 23;
EE10F at 0 range 24 .. 27;
Reserved_28_29 at 0 range 28 .. 29;
EEVSD at 0 range 30 .. 31;
end record;
-- ADC1R_AD1MC array
type ADC1R_AD1MC_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for ADC1R_AD1MC
type ADC1R_AD1MC_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- AD1MC as a value
Val : HAL.UInt4;
when True =>
-- AD1MC as an array
Arr : ADC1R_AD1MC_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for ADC1R_AD1MC_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- ADC1R_AD1EEV array
type ADC1R_AD1EEV_Field_Array is array (1 .. 5) of Boolean
with Component_Size => 1, Size => 5;
-- Type definition for ADC1R_AD1EEV
type ADC1R_AD1EEV_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- AD1EEV as a value
Val : HAL.UInt5;
when True =>
-- AD1EEV as an array
Arr : ADC1R_AD1EEV_Field_Array;
end case;
end record
with Unchecked_Union, Size => 5;
for ADC1R_AD1EEV_Field use record
Val at 0 range 0 .. 4;
Arr at 0 range 0 .. 4;
end record;
-- ADC1R_AD1TAC array
type ADC1R_AD1TAC_Field_Array is array (2 .. 4) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for ADC1R_AD1TAC
type ADC1R_AD1TAC_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- AD1TAC as a value
Val : HAL.UInt3;
when True =>
-- AD1TAC as an array
Arr : ADC1R_AD1TAC_Field_Array;
end case;
end record
with Unchecked_Union, Size => 3;
for ADC1R_AD1TAC_Field use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- ADC1R_AD1TBC array
type ADC1R_AD1TBC_Field_Array is array (2 .. 4) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for ADC1R_AD1TBC
type ADC1R_AD1TBC_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- AD1TBC as a value
Val : HAL.UInt3;
when True =>
-- AD1TBC as an array
Arr : ADC1R_AD1TBC_Field_Array;
end case;
end record
with Unchecked_Union, Size => 3;
for ADC1R_AD1TBC_Field use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- ADC1R_AD1TCC array
type ADC1R_AD1TCC_Field_Array is array (2 .. 4) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for ADC1R_AD1TCC
type ADC1R_AD1TCC_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- AD1TCC as a value
Val : HAL.UInt3;
when True =>
-- AD1TCC as an array
Arr : ADC1R_AD1TCC_Field_Array;
end case;
end record
with Unchecked_Union, Size => 3;
for ADC1R_AD1TCC_Field use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- ADC1R_AD1TDC array
type ADC1R_AD1TDC_Field_Array is array (2 .. 4) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for ADC1R_AD1TDC
type ADC1R_AD1TDC_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- AD1TDC as a value
Val : HAL.UInt3;
when True =>
-- AD1TDC as an array
Arr : ADC1R_AD1TDC_Field_Array;
end case;
end record
with Unchecked_Union, Size => 3;
for ADC1R_AD1TDC_Field use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- ADC1R_AD1TEC array
type ADC1R_AD1TEC_Field_Array is array (2 .. 4) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for ADC1R_AD1TEC
type ADC1R_AD1TEC_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- AD1TEC as a value
Val : HAL.UInt3;
when True =>
-- AD1TEC as an array
Arr : ADC1R_AD1TEC_Field_Array;
end case;
end record
with Unchecked_Union, Size => 3;
for ADC1R_AD1TEC_Field use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- ADC Trigger 1 Register
type ADC1R_Register is record
-- ADC trigger 1 on Master Compare 1
AD1MC : ADC1R_AD1MC_Field := (As_Array => False, Val => 16#0#);
-- ADC trigger 1 on Master Period
AD1MPER : Boolean := False;
-- ADC trigger 1 on External Event 1
AD1EEV : ADC1R_AD1EEV_Field := (As_Array => False, Val => 16#0#);
-- ADC trigger 1 on Timer A compare 2
AD1TAC : ADC1R_AD1TAC_Field := (As_Array => False, Val => 16#0#);
-- ADC trigger 1 on Timer A Period
AD1TAPER : Boolean := False;
-- ADC trigger 1 on Timer A Reset
AD1TARST : Boolean := False;
-- ADC trigger 1 on Timer B compare 2
AD1TBC : ADC1R_AD1TBC_Field := (As_Array => False, Val => 16#0#);
-- ADC trigger 1 on Timer B Period
AD1TBPER : Boolean := False;
-- ADC trigger 1 on Timer B Reset
AD1TBRST : Boolean := False;
-- ADC trigger 1 on Timer C compare 2
AD1TCC : ADC1R_AD1TCC_Field := (As_Array => False, Val => 16#0#);
-- ADC trigger 1 on Timer C Period
AD1TCPER : Boolean := False;
-- ADC trigger 1 on Timer D compare 2
AD1TDC : ADC1R_AD1TDC_Field := (As_Array => False, Val => 16#0#);
-- ADC trigger 1 on Timer D Period
AD1TDPER : Boolean := False;
-- ADC trigger 1 on Timer E compare 2
AD1TEC : ADC1R_AD1TEC_Field := (As_Array => False, Val => 16#0#);
-- ADC trigger 1 on Timer E Period
AD1TEPER : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for ADC1R_Register use record
AD1MC at 0 range 0 .. 3;
AD1MPER at 0 range 4 .. 4;
AD1EEV at 0 range 5 .. 9;
AD1TAC at 0 range 10 .. 12;
AD1TAPER at 0 range 13 .. 13;
AD1TARST at 0 range 14 .. 14;
AD1TBC at 0 range 15 .. 17;
AD1TBPER at 0 range 18 .. 18;
AD1TBRST at 0 range 19 .. 19;
AD1TCC at 0 range 20 .. 22;
AD1TCPER at 0 range 23 .. 23;
AD1TDC at 0 range 24 .. 26;
AD1TDPER at 0 range 27 .. 27;
AD1TEC at 0 range 28 .. 30;
AD1TEPER at 0 range 31 .. 31;
end record;
-- ADC2R_AD2MC array
type ADC2R_AD2MC_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for ADC2R_AD2MC
type ADC2R_AD2MC_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- AD2MC as a value
Val : HAL.UInt4;
when True =>
-- AD2MC as an array
Arr : ADC2R_AD2MC_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for ADC2R_AD2MC_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- ADC2R_AD2EEV array
type ADC2R_AD2EEV_Field_Array is array (6 .. 10) of Boolean
with Component_Size => 1, Size => 5;
-- Type definition for ADC2R_AD2EEV
type ADC2R_AD2EEV_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- AD2EEV as a value
Val : HAL.UInt5;
when True =>
-- AD2EEV as an array
Arr : ADC2R_AD2EEV_Field_Array;
end case;
end record
with Unchecked_Union, Size => 5;
for ADC2R_AD2EEV_Field use record
Val at 0 range 0 .. 4;
Arr at 0 range 0 .. 4;
end record;
-- ADC2R_AD2TAC array
type ADC2R_AD2TAC_Field_Array is array (2 .. 4) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for ADC2R_AD2TAC
type ADC2R_AD2TAC_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- AD2TAC as a value
Val : HAL.UInt3;
when True =>
-- AD2TAC as an array
Arr : ADC2R_AD2TAC_Field_Array;
end case;
end record
with Unchecked_Union, Size => 3;
for ADC2R_AD2TAC_Field use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- ADC2R_AD2TBC array
type ADC2R_AD2TBC_Field_Array is array (2 .. 4) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for ADC2R_AD2TBC
type ADC2R_AD2TBC_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- AD2TBC as a value
Val : HAL.UInt3;
when True =>
-- AD2TBC as an array
Arr : ADC2R_AD2TBC_Field_Array;
end case;
end record
with Unchecked_Union, Size => 3;
for ADC2R_AD2TBC_Field use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- ADC2R_AD2TCC array
type ADC2R_AD2TCC_Field_Array is array (2 .. 4) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for ADC2R_AD2TCC
type ADC2R_AD2TCC_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- AD2TCC as a value
Val : HAL.UInt3;
when True =>
-- AD2TCC as an array
Arr : ADC2R_AD2TCC_Field_Array;
end case;
end record
with Unchecked_Union, Size => 3;
for ADC2R_AD2TCC_Field use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- ADC2R_AD2TDC array
type ADC2R_AD2TDC_Field_Array is array (2 .. 4) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for ADC2R_AD2TDC
type ADC2R_AD2TDC_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- AD2TDC as a value
Val : HAL.UInt3;
when True =>
-- AD2TDC as an array
Arr : ADC2R_AD2TDC_Field_Array;
end case;
end record
with Unchecked_Union, Size => 3;
for ADC2R_AD2TDC_Field use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- ADC2R_AD2TEC array
type ADC2R_AD2TEC_Field_Array is array (2 .. 4) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for ADC2R_AD2TEC
type ADC2R_AD2TEC_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- AD2TEC as a value
Val : HAL.UInt3;
when True =>
-- AD2TEC as an array
Arr : ADC2R_AD2TEC_Field_Array;
end case;
end record
with Unchecked_Union, Size => 3;
for ADC2R_AD2TEC_Field use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- ADC Trigger 2 Register
type ADC2R_Register is record
-- ADC trigger 2 on Master Compare 1
AD2MC : ADC2R_AD2MC_Field := (As_Array => False, Val => 16#0#);
-- ADC trigger 2 on Master Period
AD2MPER : Boolean := False;
-- ADC trigger 2 on External Event 6
AD2EEV : ADC2R_AD2EEV_Field := (As_Array => False, Val => 16#0#);
-- ADC trigger 2 on Timer A compare 2
AD2TAC : ADC2R_AD2TAC_Field := (As_Array => False, Val => 16#0#);
-- ADC trigger 2 on Timer A Period
AD2TAPER : Boolean := False;
-- ADC trigger 2 on Timer B compare 2
AD2TBC : ADC2R_AD2TBC_Field := (As_Array => False, Val => 16#0#);
-- ADC trigger 2 on Timer B Period
AD2TBPER : Boolean := False;
-- ADC trigger 2 on Timer C compare 2
AD2TCC : ADC2R_AD2TCC_Field := (As_Array => False, Val => 16#0#);
-- ADC trigger 2 on Timer C Period
AD2TCPER : Boolean := False;
-- ADC trigger 2 on Timer C Reset
AD2TCRST : Boolean := False;
-- ADC trigger 2 on Timer D compare 2
AD2TDC : ADC2R_AD2TDC_Field := (As_Array => False, Val => 16#0#);
-- ADC trigger 2 on Timer D Period
AD2TDPER : Boolean := False;
-- ADC trigger 2 on Timer D Reset
AD2TDRST : Boolean := False;
-- ADC trigger 2 on Timer E compare 2
AD2TEC : ADC2R_AD2TEC_Field := (As_Array => False, Val => 16#0#);
-- ADC trigger 2 on Timer E Reset
AD2TERST : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for ADC2R_Register use record
AD2MC at 0 range 0 .. 3;
AD2MPER at 0 range 4 .. 4;
AD2EEV at 0 range 5 .. 9;
AD2TAC at 0 range 10 .. 12;
AD2TAPER at 0 range 13 .. 13;
AD2TBC at 0 range 14 .. 16;
AD2TBPER at 0 range 17 .. 17;
AD2TCC at 0 range 18 .. 20;
AD2TCPER at 0 range 21 .. 21;
AD2TCRST at 0 range 22 .. 22;
AD2TDC at 0 range 23 .. 25;
AD2TDPER at 0 range 26 .. 26;
AD2TDRST at 0 range 27 .. 27;
AD2TEC at 0 range 28 .. 30;
AD2TERST at 0 range 31 .. 31;
end record;
-- ADC3R_AD1MC array
type ADC3R_AD1MC_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for ADC3R_AD1MC
type ADC3R_AD1MC_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- AD1MC as a value
Val : HAL.UInt4;
when True =>
-- AD1MC as an array
Arr : ADC3R_AD1MC_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for ADC3R_AD1MC_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- ADC3R_AD1EEV array
type ADC3R_AD1EEV_Field_Array is array (1 .. 5) of Boolean
with Component_Size => 1, Size => 5;
-- Type definition for ADC3R_AD1EEV
type ADC3R_AD1EEV_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- AD1EEV as a value
Val : HAL.UInt5;
when True =>
-- AD1EEV as an array
Arr : ADC3R_AD1EEV_Field_Array;
end case;
end record
with Unchecked_Union, Size => 5;
for ADC3R_AD1EEV_Field use record
Val at 0 range 0 .. 4;
Arr at 0 range 0 .. 4;
end record;
-- ADC3R_AD1TAC array
type ADC3R_AD1TAC_Field_Array is array (2 .. 4) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for ADC3R_AD1TAC
type ADC3R_AD1TAC_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- AD1TAC as a value
Val : HAL.UInt3;
when True =>
-- AD1TAC as an array
Arr : ADC3R_AD1TAC_Field_Array;
end case;
end record
with Unchecked_Union, Size => 3;
for ADC3R_AD1TAC_Field use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- ADC3R_AD1TBC array
type ADC3R_AD1TBC_Field_Array is array (2 .. 4) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for ADC3R_AD1TBC
type ADC3R_AD1TBC_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- AD1TBC as a value
Val : HAL.UInt3;
when True =>
-- AD1TBC as an array
Arr : ADC3R_AD1TBC_Field_Array;
end case;
end record
with Unchecked_Union, Size => 3;
for ADC3R_AD1TBC_Field use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- ADC3R_AD1TCC array
type ADC3R_AD1TCC_Field_Array is array (2 .. 4) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for ADC3R_AD1TCC
type ADC3R_AD1TCC_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- AD1TCC as a value
Val : HAL.UInt3;
when True =>
-- AD1TCC as an array
Arr : ADC3R_AD1TCC_Field_Array;
end case;
end record
with Unchecked_Union, Size => 3;
for ADC3R_AD1TCC_Field use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- ADC3R_AD1TDC array
type ADC3R_AD1TDC_Field_Array is array (2 .. 4) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for ADC3R_AD1TDC
type ADC3R_AD1TDC_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- AD1TDC as a value
Val : HAL.UInt3;
when True =>
-- AD1TDC as an array
Arr : ADC3R_AD1TDC_Field_Array;
end case;
end record
with Unchecked_Union, Size => 3;
for ADC3R_AD1TDC_Field use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- ADC3R_AD1TEC array
type ADC3R_AD1TEC_Field_Array is array (2 .. 4) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for ADC3R_AD1TEC
type ADC3R_AD1TEC_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- AD1TEC as a value
Val : HAL.UInt3;
when True =>
-- AD1TEC as an array
Arr : ADC3R_AD1TEC_Field_Array;
end case;
end record
with Unchecked_Union, Size => 3;
for ADC3R_AD1TEC_Field use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- ADC Trigger 3 Register
type ADC3R_Register is record
-- AD1MC1
AD1MC : ADC3R_AD1MC_Field := (As_Array => False, Val => 16#0#);
-- AD1MPER
AD1MPER : Boolean := False;
-- AD1EEV1
AD1EEV : ADC3R_AD1EEV_Field := (As_Array => False, Val => 16#0#);
-- AD1TAC2
AD1TAC : ADC3R_AD1TAC_Field := (As_Array => False, Val => 16#0#);
-- AD1TAPER
AD1TAPER : Boolean := False;
-- AD1TARST
AD1TARST : Boolean := False;
-- AD1TBC2
AD1TBC : ADC3R_AD1TBC_Field := (As_Array => False, Val => 16#0#);
-- AD1TBPER
AD1TBPER : Boolean := False;
-- AD1TBRST
AD1TBRST : Boolean := False;
-- AD1TCC2
AD1TCC : ADC3R_AD1TCC_Field := (As_Array => False, Val => 16#0#);
-- AD1TCPER
AD1TCPER : Boolean := False;
-- AD1TDC2
AD1TDC : ADC3R_AD1TDC_Field := (As_Array => False, Val => 16#0#);
-- AD1TDPER
AD1TDPER : Boolean := False;
-- AD1TEC2
AD1TEC : ADC3R_AD1TEC_Field := (As_Array => False, Val => 16#0#);
-- AD1TEPER
AD1TEPER : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for ADC3R_Register use record
AD1MC at 0 range 0 .. 3;
AD1MPER at 0 range 4 .. 4;
AD1EEV at 0 range 5 .. 9;
AD1TAC at 0 range 10 .. 12;
AD1TAPER at 0 range 13 .. 13;
AD1TARST at 0 range 14 .. 14;
AD1TBC at 0 range 15 .. 17;
AD1TBPER at 0 range 18 .. 18;
AD1TBRST at 0 range 19 .. 19;
AD1TCC at 0 range 20 .. 22;
AD1TCPER at 0 range 23 .. 23;
AD1TDC at 0 range 24 .. 26;
AD1TDPER at 0 range 27 .. 27;
AD1TEC at 0 range 28 .. 30;
AD1TEPER at 0 range 31 .. 31;
end record;
-- ADC4R_AD2MC array
type ADC4R_AD2MC_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for ADC4R_AD2MC
type ADC4R_AD2MC_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- AD2MC as a value
Val : HAL.UInt4;
when True =>
-- AD2MC as an array
Arr : ADC4R_AD2MC_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for ADC4R_AD2MC_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- ADC4R_AD2EEV array
type ADC4R_AD2EEV_Field_Array is array (6 .. 10) of Boolean
with Component_Size => 1, Size => 5;
-- Type definition for ADC4R_AD2EEV
type ADC4R_AD2EEV_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- AD2EEV as a value
Val : HAL.UInt5;
when True =>
-- AD2EEV as an array
Arr : ADC4R_AD2EEV_Field_Array;
end case;
end record
with Unchecked_Union, Size => 5;
for ADC4R_AD2EEV_Field use record
Val at 0 range 0 .. 4;
Arr at 0 range 0 .. 4;
end record;
-- ADC4R_AD2TAC array
type ADC4R_AD2TAC_Field_Array is array (2 .. 4) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for ADC4R_AD2TAC
type ADC4R_AD2TAC_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- AD2TAC as a value
Val : HAL.UInt3;
when True =>
-- AD2TAC as an array
Arr : ADC4R_AD2TAC_Field_Array;
end case;
end record
with Unchecked_Union, Size => 3;
for ADC4R_AD2TAC_Field use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- ADC4R_AD2TBC array
type ADC4R_AD2TBC_Field_Array is array (2 .. 4) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for ADC4R_AD2TBC
type ADC4R_AD2TBC_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- AD2TBC as a value
Val : HAL.UInt3;
when True =>
-- AD2TBC as an array
Arr : ADC4R_AD2TBC_Field_Array;
end case;
end record
with Unchecked_Union, Size => 3;
for ADC4R_AD2TBC_Field use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- ADC4R_AD2TCC array
type ADC4R_AD2TCC_Field_Array is array (2 .. 4) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for ADC4R_AD2TCC
type ADC4R_AD2TCC_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- AD2TCC as a value
Val : HAL.UInt3;
when True =>
-- AD2TCC as an array
Arr : ADC4R_AD2TCC_Field_Array;
end case;
end record
with Unchecked_Union, Size => 3;
for ADC4R_AD2TCC_Field use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- ADC4R_AD2TDC array
type ADC4R_AD2TDC_Field_Array is array (2 .. 4) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for ADC4R_AD2TDC
type ADC4R_AD2TDC_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- AD2TDC as a value
Val : HAL.UInt3;
when True =>
-- AD2TDC as an array
Arr : ADC4R_AD2TDC_Field_Array;
end case;
end record
with Unchecked_Union, Size => 3;
for ADC4R_AD2TDC_Field use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- ADC4R_AD2TEC array
type ADC4R_AD2TEC_Field_Array is array (2 .. 4) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for ADC4R_AD2TEC
type ADC4R_AD2TEC_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- AD2TEC as a value
Val : HAL.UInt3;
when True =>
-- AD2TEC as an array
Arr : ADC4R_AD2TEC_Field_Array;
end case;
end record
with Unchecked_Union, Size => 3;
for ADC4R_AD2TEC_Field use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- ADC Trigger 4 Register
type ADC4R_Register is record
-- AD2MC1
AD2MC : ADC4R_AD2MC_Field := (As_Array => False, Val => 16#0#);
-- AD2MPER
AD2MPER : Boolean := False;
-- AD2EEV6
AD2EEV : ADC4R_AD2EEV_Field := (As_Array => False, Val => 16#0#);
-- AD2TAC2
AD2TAC : ADC4R_AD2TAC_Field := (As_Array => False, Val => 16#0#);
-- AD2TAPER
AD2TAPER : Boolean := False;
-- AD2TBC2
AD2TBC : ADC4R_AD2TBC_Field := (As_Array => False, Val => 16#0#);
-- AD2TBPER
AD2TBPER : Boolean := False;
-- AD2TCC2
AD2TCC : ADC4R_AD2TCC_Field := (As_Array => False, Val => 16#0#);
-- AD2TCPER
AD2TCPER : Boolean := False;
-- AD2TCRST
AD2TCRST : Boolean := False;
-- AD2TDC2
AD2TDC : ADC4R_AD2TDC_Field := (As_Array => False, Val => 16#0#);
-- AD2TDPER
AD2TDPER : Boolean := False;
-- AD2TDRST
AD2TDRST : Boolean := False;
-- AD2TEC2
AD2TEC : ADC4R_AD2TEC_Field := (As_Array => False, Val => 16#0#);
-- AD2TERST
AD2TERST : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for ADC4R_Register use record
AD2MC at 0 range 0 .. 3;
AD2MPER at 0 range 4 .. 4;
AD2EEV at 0 range 5 .. 9;
AD2TAC at 0 range 10 .. 12;
AD2TAPER at 0 range 13 .. 13;
AD2TBC at 0 range 14 .. 16;
AD2TBPER at 0 range 17 .. 17;
AD2TCC at 0 range 18 .. 20;
AD2TCPER at 0 range 21 .. 21;
AD2TCRST at 0 range 22 .. 22;
AD2TDC at 0 range 23 .. 25;
AD2TDPER at 0 range 26 .. 26;
AD2TDRST at 0 range 27 .. 27;
AD2TEC at 0 range 28 .. 30;
AD2TERST at 0 range 31 .. 31;
end record;
subtype DLLCR_CALRTE_Field is HAL.UInt2;
-- DLL Control Register
type DLLCR_Register is record
-- DLL Calibration Start
CAL : Boolean := False;
-- DLL Calibration Enable
CALEN : Boolean := False;
-- DLL Calibration rate
CALRTE : DLLCR_CALRTE_Field := 16#0#;
-- unspecified
Reserved_4_31 : HAL.UInt28 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for DLLCR_Register use record
CAL at 0 range 0 .. 0;
CALEN at 0 range 1 .. 1;
CALRTE at 0 range 2 .. 3;
Reserved_4_31 at 0 range 4 .. 31;
end record;
subtype FLTINR1_FLT1F_Field is HAL.UInt4;
subtype FLTINR1_FLT2F_Field is HAL.UInt4;
subtype FLTINR1_FLT3F_Field is HAL.UInt4;
subtype FLTINR1_FLT4F_Field is HAL.UInt4;
-- HRTIM Fault Input Register 1
type FLTINR1_Register is record
-- FLT1E
FLT1E : Boolean := False;
-- FLT1P
FLT1P : Boolean := False;
-- FLT1SRC
FLT1SRC : Boolean := False;
-- FLT1F
FLT1F : FLTINR1_FLT1F_Field := 16#0#;
-- FLT1LCK
FLT1LCK : Boolean := False;
-- FLT2E
FLT2E : Boolean := False;
-- FLT2P
FLT2P : Boolean := False;
-- FLT2SRC
FLT2SRC : Boolean := False;
-- FLT2F
FLT2F : FLTINR1_FLT2F_Field := 16#0#;
-- FLT2LCK
FLT2LCK : Boolean := False;
-- FLT3E
FLT3E : Boolean := False;
-- FLT3P
FLT3P : Boolean := False;
-- FLT3SRC
FLT3SRC : Boolean := False;
-- FLT3F
FLT3F : FLTINR1_FLT3F_Field := 16#0#;
-- FLT3LCK
FLT3LCK : Boolean := False;
-- FLT4E
FLT4E : Boolean := False;
-- FLT4P
FLT4P : Boolean := False;
-- FLT4SRC
FLT4SRC : Boolean := False;
-- FLT4F
FLT4F : FLTINR1_FLT4F_Field := 16#0#;
-- FLT4LCK
FLT4LCK : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for FLTINR1_Register use record
FLT1E at 0 range 0 .. 0;
FLT1P at 0 range 1 .. 1;
FLT1SRC at 0 range 2 .. 2;
FLT1F at 0 range 3 .. 6;
FLT1LCK at 0 range 7 .. 7;
FLT2E at 0 range 8 .. 8;
FLT2P at 0 range 9 .. 9;
FLT2SRC at 0 range 10 .. 10;
FLT2F at 0 range 11 .. 14;
FLT2LCK at 0 range 15 .. 15;
FLT3E at 0 range 16 .. 16;
FLT3P at 0 range 17 .. 17;
FLT3SRC at 0 range 18 .. 18;
FLT3F at 0 range 19 .. 22;
FLT3LCK at 0 range 23 .. 23;
FLT4E at 0 range 24 .. 24;
FLT4P at 0 range 25 .. 25;
FLT4SRC at 0 range 26 .. 26;
FLT4F at 0 range 27 .. 30;
FLT4LCK at 0 range 31 .. 31;
end record;
subtype FLTINR2_FLT5F_Field is HAL.UInt4;
subtype FLTINR2_FLTSD_Field is HAL.UInt2;
-- HRTIM Fault Input Register 2
type FLTINR2_Register is record
-- FLT5E
FLT5E : Boolean := False;
-- FLT5P
FLT5P : Boolean := False;
-- FLT5SRC
FLT5SRC : Boolean := False;
-- FLT5F
FLT5F : FLTINR2_FLT5F_Field := 16#0#;
-- FLT5LCK
FLT5LCK : Boolean := False;
-- unspecified
Reserved_8_23 : HAL.UInt16 := 16#0#;
-- FLTSD
FLTSD : FLTINR2_FLTSD_Field := 16#0#;
-- unspecified
Reserved_26_31 : HAL.UInt6 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for FLTINR2_Register use record
FLT5E at 0 range 0 .. 0;
FLT5P at 0 range 1 .. 1;
FLT5SRC at 0 range 2 .. 2;
FLT5F at 0 range 3 .. 6;
FLT5LCK at 0 range 7 .. 7;
Reserved_8_23 at 0 range 8 .. 23;
FLTSD at 0 range 24 .. 25;
Reserved_26_31 at 0 range 26 .. 31;
end record;
-- BDMUPDR_MCMP array
type BDMUPDR_MCMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for BDMUPDR_MCMP
type BDMUPDR_MCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MCMP as a value
Val : HAL.UInt4;
when True =>
-- MCMP as an array
Arr : BDMUPDR_MCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for BDMUPDR_MCMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- BDMUPDR
type BDMUPDR_Register is record
-- MCR
MCR : Boolean := False;
-- MICR
MICR : Boolean := False;
-- MDIER
MDIER : Boolean := False;
-- MCNT
MCNT : Boolean := False;
-- MPER
MPER : Boolean := False;
-- MREP
MREP : Boolean := False;
-- MCMP1
MCMP : BDMUPDR_MCMP_Field :=
(As_Array => False, Val => 16#0#);
-- unspecified
Reserved_10_31 : HAL.UInt22 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for BDMUPDR_Register use record
MCR at 0 range 0 .. 0;
MICR at 0 range 1 .. 1;
MDIER at 0 range 2 .. 2;
MCNT at 0 range 3 .. 3;
MPER at 0 range 4 .. 4;
MREP at 0 range 5 .. 5;
MCMP at 0 range 6 .. 9;
Reserved_10_31 at 0 range 10 .. 31;
end record;
-- BDTxUPR_TIMxCMP array
type BDTxUPR_TIMxCMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for BDTxUPR_TIMxCMP
type BDTxUPR_TIMxCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TIMxCMP as a value
Val : HAL.UInt4;
when True =>
-- TIMxCMP as an array
Arr : BDTxUPR_TIMxCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for BDTxUPR_TIMxCMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- BDTxUPR_TIMxEEFR array
type BDTxUPR_TIMxEEFR_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for BDTxUPR_TIMxEEFR
type BDTxUPR_TIMxEEFR_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TIMxEEFR as a value
Val : HAL.UInt2;
when True =>
-- TIMxEEFR as an array
Arr : BDTxUPR_TIMxEEFR_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for BDTxUPR_TIMxEEFR_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- Burst DMA Timerx update Register
type BDTxUPR_Register is record
-- HRTIM_TIMxCR register update enable
TIMxCR : Boolean := False;
-- HRTIM_TIMxICR register update enable
TIMxICR : Boolean := False;
-- HRTIM_TIMxDIER register update enable
TIMxDIER : Boolean := False;
-- HRTIM_CNTxR register update enable
TIMxCNT : Boolean := False;
-- HRTIM_PERxR register update enable
TIMxPER : Boolean := False;
-- HRTIM_REPxR register update enable
TIMxREP : Boolean := False;
-- HRTIM_CMP1xR register update enable
TIMxCMP : BDTxUPR_TIMxCMP_Field :=
(As_Array => False, Val => 16#0#);
-- HRTIM_DTxR register update enable
TIMx_DTxR : Boolean := False;
-- HRTIM_SET1xR register update enable
TIMxSET1R : Boolean := False;
-- HRTIM_RST1xR register update enable
TIMxRST1R : Boolean := False;
-- HRTIM_SET2xR register update enable
TIMxSET2R : Boolean := False;
-- HRTIM_RST2xR register update enable
TIMxRST2R : Boolean := False;
-- HRTIM_EEFxR1 register update enable
TIMxEEFR : BDTxUPR_TIMxEEFR_Field :=
(As_Array => False, Val => 16#0#);
-- HRTIM_RSTxR register update enable
TIMxRSTR : Boolean := False;
-- HRTIM_CHPxR register update enable
TIMxCHPR : Boolean := False;
-- HRTIM_OUTxR register update enable
TIMxOUTR : Boolean := False;
-- HRTIM_FLTxR register update enable
TIMxFLTR : Boolean := False;
-- unspecified
Reserved_21_31 : HAL.UInt11 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for BDTxUPR_Register use record
TIMxCR at 0 range 0 .. 0;
TIMxICR at 0 range 1 .. 1;
TIMxDIER at 0 range 2 .. 2;
TIMxCNT at 0 range 3 .. 3;
TIMxPER at 0 range 4 .. 4;
TIMxREP at 0 range 5 .. 5;
TIMxCMP at 0 range 6 .. 9;
TIMx_DTxR at 0 range 10 .. 10;
TIMxSET1R at 0 range 11 .. 11;
TIMxRST1R at 0 range 12 .. 12;
TIMxSET2R at 0 range 13 .. 13;
TIMxRST2R at 0 range 14 .. 14;
TIMxEEFR at 0 range 15 .. 16;
TIMxRSTR at 0 range 17 .. 17;
TIMxCHPR at 0 range 18 .. 18;
TIMxOUTR at 0 range 19 .. 19;
TIMxFLTR at 0 range 20 .. 20;
Reserved_21_31 at 0 range 21 .. 31;
end record;
subtype MCR_CKPSC_Field is HAL.UInt3;
subtype MCR_SYNCIN_Field is HAL.UInt2;
subtype MCR_SYNCOUT_Field is HAL.UInt2;
subtype MCR_SYNCSRC_Field is HAL.UInt2;
subtype MCR_DACSYNC_Field is HAL.UInt2;
subtype MCR_BRSTDMA_Field is HAL.UInt2;
-- Master Timer Control Register
type MCR_Register is record
-- HRTIM Master Clock prescaler
CKPSC : MCR_CKPSC_Field := 16#0#;
-- Master Continuous mode
CONT : Boolean := False;
-- Master Re-triggerable mode
RETRIG : Boolean := False;
-- Half mode enable
HALF : Boolean := False;
-- unspecified
Reserved_6_7 : HAL.UInt2 := 16#0#;
-- ynchronization input
SYNCIN : MCR_SYNCIN_Field := 16#0#;
-- Synchronization Resets Master
SYNCRSTM : Boolean := False;
-- Synchronization Starts Master
SYNCSTRTM : Boolean := False;
-- Synchronization output
SYNCOUT : MCR_SYNCOUT_Field := 16#0#;
-- Synchronization source
SYNCSRC : MCR_SYNCSRC_Field := 16#0#;
-- Master Counter enable
MCEN : Boolean := False;
-- Timer A counter enable
TACEN : Boolean := False;
-- Timer B counter enable
TBCEN : Boolean := False;
-- Timer C counter enable
TCCEN : Boolean := False;
-- Timer D counter enable
TDCEN : Boolean := False;
-- Timer E counter enable
TECEN : Boolean := False;
-- unspecified
Reserved_22_24 : HAL.UInt3 := 16#0#;
-- AC Synchronization
DACSYNC : MCR_DACSYNC_Field := 16#0#;
-- Preload enable
PREEN : Boolean := False;
-- unspecified
Reserved_28_28 : HAL.Bit := 16#0#;
-- Master Timer Repetition update
MREPU : Boolean := False;
-- Burst DMA Update
BRSTDMA : MCR_BRSTDMA_Field := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for MCR_Register use record
CKPSC at 0 range 0 .. 2;
CONT at 0 range 3 .. 3;
RETRIG at 0 range 4 .. 4;
HALF at 0 range 5 .. 5;
Reserved_6_7 at 0 range 6 .. 7;
SYNCIN at 0 range 8 .. 9;
SYNCRSTM at 0 range 10 .. 10;
SYNCSTRTM at 0 range 11 .. 11;
SYNCOUT at 0 range 12 .. 13;
SYNCSRC at 0 range 14 .. 15;
MCEN at 0 range 16 .. 16;
TACEN at 0 range 17 .. 17;
TBCEN at 0 range 18 .. 18;
TCCEN at 0 range 19 .. 19;
TDCEN at 0 range 20 .. 20;
TECEN at 0 range 21 .. 21;
Reserved_22_24 at 0 range 22 .. 24;
DACSYNC at 0 range 25 .. 26;
PREEN at 0 range 27 .. 27;
Reserved_28_28 at 0 range 28 .. 28;
MREPU at 0 range 29 .. 29;
BRSTDMA at 0 range 30 .. 31;
end record;
-- MISR_MCMP array
type MISR_MCMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for MISR_MCMP
type MISR_MCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MCMP as a value
Val : HAL.UInt4;
when True =>
-- MCMP as an array
Arr : MISR_MCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for MISR_MCMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- Master Timer Interrupt Status Register
type MISR_Register is record
-- Read-only. Master Compare 1 Interrupt Flag
MCMP : MISR_MCMP_Field;
-- Read-only. Master Repetition Interrupt Flag
MREP : Boolean;
-- Read-only. Sync Input Interrupt Flag
SYNC : Boolean;
-- Read-only. Master Update Interrupt Flag
MUPD : Boolean;
-- unspecified
Reserved_7_31 : HAL.UInt25;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for MISR_Register use record
MCMP at 0 range 0 .. 3;
MREP at 0 range 4 .. 4;
SYNC at 0 range 5 .. 5;
MUPD at 0 range 6 .. 6;
Reserved_7_31 at 0 range 7 .. 31;
end record;
-- Master Timer Interrupt Clear Register
type MICR_Register is record
-- Write-only. Master Compare 1 Interrupt flag clear
MCMP1C : Boolean := False;
-- Write-only. Master Compare 2 Interrupt flag clear
MCMP2C : Boolean := False;
-- Write-only. Master Compare 3 Interrupt flag clear
MCMP3C : Boolean := False;
-- Write-only. Master Compare 4 Interrupt flag clear
MCMP4C : Boolean := False;
-- Write-only. Repetition Interrupt flag clear
MREPC : Boolean := False;
-- Write-only. Sync Input Interrupt flag clear
SYNCC : Boolean := False;
-- Write-only. Master update Interrupt flag clear
MUPDC : Boolean := False;
-- unspecified
Reserved_7_31 : HAL.UInt25 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for MICR_Register use record
MCMP1C at 0 range 0 .. 0;
MCMP2C at 0 range 1 .. 1;
MCMP3C at 0 range 2 .. 2;
MCMP4C at 0 range 3 .. 3;
MREPC at 0 range 4 .. 4;
SYNCC at 0 range 5 .. 5;
MUPDC at 0 range 6 .. 6;
Reserved_7_31 at 0 range 7 .. 31;
end record;
-- MDIER
type MDIER_Register is record
-- MCMP1IE
MCMP1IE : Boolean := False;
-- MCMP2IE
MCMP2IE : Boolean := False;
-- MCMP3IE
MCMP3IE : Boolean := False;
-- MCMP4IE
MCMP4IE : Boolean := False;
-- MREPIE
MREPIE : Boolean := False;
-- SYNCIE
SYNCIE : Boolean := False;
-- MUPDIE
MUPDIE : Boolean := False;
-- unspecified
Reserved_7_15 : HAL.UInt9 := 16#0#;
-- MCMP1DE
MCMP1DE : Boolean := False;
-- MCMP2DE
MCMP2DE : Boolean := False;
-- MCMP3DE
MCMP3DE : Boolean := False;
-- MCMP4DE
MCMP4DE : Boolean := False;
-- MREPDE
MREPDE : Boolean := False;
-- SYNCDE
SYNCDE : Boolean := False;
-- MUPDDE
MUPDDE : Boolean := False;
-- unspecified
Reserved_23_31 : HAL.UInt9 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for MDIER_Register use record
MCMP1IE at 0 range 0 .. 0;
MCMP2IE at 0 range 1 .. 1;
MCMP3IE at 0 range 2 .. 2;
MCMP4IE at 0 range 3 .. 3;
MREPIE at 0 range 4 .. 4;
SYNCIE at 0 range 5 .. 5;
MUPDIE at 0 range 6 .. 6;
Reserved_7_15 at 0 range 7 .. 15;
MCMP1DE at 0 range 16 .. 16;
MCMP2DE at 0 range 17 .. 17;
MCMP3DE at 0 range 18 .. 18;
MCMP4DE at 0 range 19 .. 19;
MREPDE at 0 range 20 .. 20;
SYNCDE at 0 range 21 .. 21;
MUPDDE at 0 range 22 .. 22;
Reserved_23_31 at 0 range 23 .. 31;
end record;
subtype MCNTR_MCNT_Field is HAL.UInt16;
-- Master Timer Counter Register
type MCNTR_Register is record
-- Counter value
MCNT : MCNTR_MCNT_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for MCNTR_Register use record
MCNT at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype MPER_MPER_Field is HAL.UInt16;
-- Master Timer Period Register
type MPER_Register is record
-- Master Timer Period value
MPER : MPER_MPER_Field := 16#FFFF#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for MPER_Register use record
MPER at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype MREP_MREP_Field is HAL.UInt8;
-- Master Timer Repetition Register
type MREP_Register is record
-- Master Timer Repetition counter value
MREP : MREP_MREP_Field := 16#0#;
-- unspecified
Reserved_8_31 : HAL.UInt24 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for MREP_Register use record
MREP at 0 range 0 .. 7;
Reserved_8_31 at 0 range 8 .. 31;
end record;
subtype MCMP1R_MCMP1_Field is HAL.UInt16;
-- Master Timer Compare 1 Register
type MCMP1R_Register is record
-- Master Timer Compare 1 value
MCMP1 : MCMP1R_MCMP1_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for MCMP1R_Register use record
MCMP1 at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype MCMP2R_MCMP2_Field is HAL.UInt16;
-- Master Timer Compare 2 Register
type MCMP2R_Register is record
-- Master Timer Compare 2 value
MCMP2 : MCMP2R_MCMP2_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for MCMP2R_Register use record
MCMP2 at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype MCMP3R_MCMP3_Field is HAL.UInt16;
-- Master Timer Compare 3 Register
type MCMP3R_Register is record
-- Master Timer Compare 3 value
MCMP3 : MCMP3R_MCMP3_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for MCMP3R_Register use record
MCMP3 at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype MCMP4R_MCMP4_Field is HAL.UInt16;
-- Master Timer Compare 4 Register
type MCMP4R_Register is record
-- Master Timer Compare 4 value
MCMP4 : MCMP4R_MCMP4_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for MCMP4R_Register use record
MCMP4 at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype TIMACR_CKPSCx_Field is HAL.UInt3;
-- TIMACR_DELCMP array element
subtype TIMACR_DELCMP_Element is HAL.UInt2;
-- TIMACR_DELCMP array
type TIMACR_DELCMP_Field_Array is array (2 .. 3) of TIMACR_DELCMP_Element
with Component_Size => 2, Size => 4;
-- Type definition for TIMACR_DELCMP
type TIMACR_DELCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- DELCMP as a value
Val : HAL.UInt4;
when True =>
-- DELCMP as an array
Arr : TIMACR_DELCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for TIMACR_DELCMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
subtype TIMACR_DACSYNC_Field is HAL.UInt2;
subtype TIMACR_UPDGAT_Field is HAL.UInt4;
-- Timerx Control Register
type TIMACR_Register is record
-- HRTIM Timer x Clock prescaler
CKPSCx : TIMACR_CKPSCx_Field := 16#0#;
-- Continuous mode
CONT : Boolean := False;
-- Re-triggerable mode
RETRIG : Boolean := False;
-- Half mode enable
HALF : Boolean := False;
-- Push-Pull mode enable
PSHPLL : Boolean := False;
-- unspecified
Reserved_7_9 : HAL.UInt3 := 16#0#;
-- Synchronization Resets Timer x
SYNCRSTx : Boolean := False;
-- Synchronization Starts Timer x
SYNCSTRTx : Boolean := False;
-- Delayed CMP2 mode
DELCMP : TIMACR_DELCMP_Field :=
(As_Array => False, Val => 16#0#);
-- unspecified
Reserved_16_16 : HAL.Bit := 16#0#;
-- Timer x Repetition update
TxREPU : Boolean := False;
-- Timerx reset update
TxRSTU : Boolean := False;
-- unspecified
Reserved_19_19 : HAL.Bit := 16#0#;
-- TBU
TBU : Boolean := False;
-- TCU
TCU : Boolean := False;
-- TDU
TDU : Boolean := False;
-- TEU
TEU : Boolean := False;
-- Master Timer update
MSTU : Boolean := False;
-- AC Synchronization
DACSYNC : TIMACR_DACSYNC_Field := 16#0#;
-- Preload enable
PREEN : Boolean := False;
-- Update Gating
UPDGAT : TIMACR_UPDGAT_Field := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TIMACR_Register use record
CKPSCx at 0 range 0 .. 2;
CONT at 0 range 3 .. 3;
RETRIG at 0 range 4 .. 4;
HALF at 0 range 5 .. 5;
PSHPLL at 0 range 6 .. 6;
Reserved_7_9 at 0 range 7 .. 9;
SYNCRSTx at 0 range 10 .. 10;
SYNCSTRTx at 0 range 11 .. 11;
DELCMP at 0 range 12 .. 15;
Reserved_16_16 at 0 range 16 .. 16;
TxREPU at 0 range 17 .. 17;
TxRSTU at 0 range 18 .. 18;
Reserved_19_19 at 0 range 19 .. 19;
TBU at 0 range 20 .. 20;
TCU at 0 range 21 .. 21;
TDU at 0 range 22 .. 22;
TEU at 0 range 23 .. 23;
MSTU at 0 range 24 .. 24;
DACSYNC at 0 range 25 .. 26;
PREEN at 0 range 27 .. 27;
UPDGAT at 0 range 28 .. 31;
end record;
-- TIMAISR_CMP array
type TIMAISR_CMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for TIMAISR_CMP
type TIMAISR_CMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- CMP as a value
Val : HAL.UInt4;
when True =>
-- CMP as an array
Arr : TIMAISR_CMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for TIMAISR_CMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- TIMAISR_CPT array
type TIMAISR_CPT_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for TIMAISR_CPT
type TIMAISR_CPT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- CPT as a value
Val : HAL.UInt2;
when True =>
-- CPT as an array
Arr : TIMAISR_CPT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for TIMAISR_CPT_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- Timerx Interrupt Status Register
type TIMAISR_Register is record
-- Read-only. Compare 1 Interrupt Flag
CMP : TIMAISR_CMP_Field;
-- Read-only. Repetition Interrupt Flag
REP : Boolean;
-- unspecified
Reserved_5_5 : HAL.Bit;
-- Read-only. Update Interrupt Flag
UPD : Boolean;
-- Read-only. Capture1 Interrupt Flag
CPT : TIMAISR_CPT_Field;
-- Read-only. Output 1 Set Interrupt Flag
SETx1 : Boolean;
-- Read-only. Output 1 Reset Interrupt Flag
RSTx1 : Boolean;
-- Read-only. Output 2 Set Interrupt Flag
SETx2 : Boolean;
-- Read-only. Output 2 Reset Interrupt Flag
RSTx2 : Boolean;
-- Read-only. Reset Interrupt Flag
RST : Boolean;
-- Read-only. Delayed Protection Flag
DLYPRT : Boolean;
-- unspecified
Reserved_15_15 : HAL.Bit;
-- Read-only. Current Push Pull Status
CPPSTAT : Boolean;
-- Read-only. Idle Push Pull Status
IPPSTAT : Boolean;
-- Read-only. Output 1 State
O1STAT : Boolean;
-- Read-only. Output 2 State
O2STAT : Boolean;
-- unspecified
Reserved_20_31 : HAL.UInt12;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TIMAISR_Register use record
CMP at 0 range 0 .. 3;
REP at 0 range 4 .. 4;
Reserved_5_5 at 0 range 5 .. 5;
UPD at 0 range 6 .. 6;
CPT at 0 range 7 .. 8;
SETx1 at 0 range 9 .. 9;
RSTx1 at 0 range 10 .. 10;
SETx2 at 0 range 11 .. 11;
RSTx2 at 0 range 12 .. 12;
RST at 0 range 13 .. 13;
DLYPRT at 0 range 14 .. 14;
Reserved_15_15 at 0 range 15 .. 15;
CPPSTAT at 0 range 16 .. 16;
IPPSTAT at 0 range 17 .. 17;
O1STAT at 0 range 18 .. 18;
O2STAT at 0 range 19 .. 19;
Reserved_20_31 at 0 range 20 .. 31;
end record;
-- Timerx Interrupt Clear Register
type TIMAICR_Register is record
-- Write-only. Compare 1 Interrupt flag Clear
CMP1C : Boolean := False;
-- Write-only. Compare 2 Interrupt flag Clear
CMP2C : Boolean := False;
-- Write-only. Compare 3 Interrupt flag Clear
CMP3C : Boolean := False;
-- Write-only. Compare 4 Interrupt flag Clear
CMP4C : Boolean := False;
-- Write-only. Repetition Interrupt flag Clear
REPC : Boolean := False;
-- unspecified
Reserved_5_5 : HAL.Bit := 16#0#;
-- Write-only. Update Interrupt flag Clear
UPDC : Boolean := False;
-- Write-only. Capture1 Interrupt flag Clear
CPT1C : Boolean := False;
-- Write-only. Capture2 Interrupt flag Clear
CPT2C : Boolean := False;
-- Write-only. Output 1 Set flag Clear
SET1xC : Boolean := False;
-- Write-only. Output 1 Reset flag Clear
RSTx1C : Boolean := False;
-- Write-only. Output 2 Set flag Clear
SET2xC : Boolean := False;
-- Write-only. Output 2 Reset flag Clear
RSTx2C : Boolean := False;
-- Write-only. Reset Interrupt flag Clear
RSTC : Boolean := False;
-- Write-only. Delayed Protection Flag Clear
DLYPRTC : Boolean := False;
-- unspecified
Reserved_15_31 : HAL.UInt17 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TIMAICR_Register use record
CMP1C at 0 range 0 .. 0;
CMP2C at 0 range 1 .. 1;
CMP3C at 0 range 2 .. 2;
CMP4C at 0 range 3 .. 3;
REPC at 0 range 4 .. 4;
Reserved_5_5 at 0 range 5 .. 5;
UPDC at 0 range 6 .. 6;
CPT1C at 0 range 7 .. 7;
CPT2C at 0 range 8 .. 8;
SET1xC at 0 range 9 .. 9;
RSTx1C at 0 range 10 .. 10;
SET2xC at 0 range 11 .. 11;
RSTx2C at 0 range 12 .. 12;
RSTC at 0 range 13 .. 13;
DLYPRTC at 0 range 14 .. 14;
Reserved_15_31 at 0 range 15 .. 31;
end record;
-- TIMxDIER
type TIMADIER_Register is record
-- CMP1IE
CMP1IE : Boolean := False;
-- CMP2IE
CMP2IE : Boolean := False;
-- CMP3IE
CMP3IE : Boolean := False;
-- CMP4IE
CMP4IE : Boolean := False;
-- REPIE
REPIE : Boolean := False;
-- unspecified
Reserved_5_5 : HAL.Bit := 16#0#;
-- UPDIE
UPDIE : Boolean := False;
-- CPT1IE
CPT1IE : Boolean := False;
-- CPT2IE
CPT2IE : Boolean := False;
-- SET1xIE
SET1xIE : Boolean := False;
-- RSTx1IE
RSTx1IE : Boolean := False;
-- SETx2IE
SETx2IE : Boolean := False;
-- RSTx2IE
RSTx2IE : Boolean := False;
-- RSTIE
RSTIE : Boolean := False;
-- DLYPRTIE
DLYPRTIE : Boolean := False;
-- unspecified
Reserved_15_15 : HAL.Bit := 16#0#;
-- CMP1DE
CMP1DE : Boolean := False;
-- CMP2DE
CMP2DE : Boolean := False;
-- CMP3DE
CMP3DE : Boolean := False;
-- CMP4DE
CMP4DE : Boolean := False;
-- REPDE
REPDE : Boolean := False;
-- unspecified
Reserved_21_21 : HAL.Bit := 16#0#;
-- UPDDE
UPDDE : Boolean := False;
-- CPT1DE
CPT1DE : Boolean := False;
-- CPT2DE
CPT2DE : Boolean := False;
-- SET1xDE
SET1xDE : Boolean := False;
-- RSTx1DE
RSTx1DE : Boolean := False;
-- SETx2DE
SETx2DE : Boolean := False;
-- RSTx2DE
RSTx2DE : Boolean := False;
-- RSTDE
RSTDE : Boolean := False;
-- DLYPRTDE
DLYPRTDE : Boolean := False;
-- unspecified
Reserved_31_31 : HAL.Bit := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TIMADIER_Register use record
CMP1IE at 0 range 0 .. 0;
CMP2IE at 0 range 1 .. 1;
CMP3IE at 0 range 2 .. 2;
CMP4IE at 0 range 3 .. 3;
REPIE at 0 range 4 .. 4;
Reserved_5_5 at 0 range 5 .. 5;
UPDIE at 0 range 6 .. 6;
CPT1IE at 0 range 7 .. 7;
CPT2IE at 0 range 8 .. 8;
SET1xIE at 0 range 9 .. 9;
RSTx1IE at 0 range 10 .. 10;
SETx2IE at 0 range 11 .. 11;
RSTx2IE at 0 range 12 .. 12;
RSTIE at 0 range 13 .. 13;
DLYPRTIE at 0 range 14 .. 14;
Reserved_15_15 at 0 range 15 .. 15;
CMP1DE at 0 range 16 .. 16;
CMP2DE at 0 range 17 .. 17;
CMP3DE at 0 range 18 .. 18;
CMP4DE at 0 range 19 .. 19;
REPDE at 0 range 20 .. 20;
Reserved_21_21 at 0 range 21 .. 21;
UPDDE at 0 range 22 .. 22;
CPT1DE at 0 range 23 .. 23;
CPT2DE at 0 range 24 .. 24;
SET1xDE at 0 range 25 .. 25;
RSTx1DE at 0 range 26 .. 26;
SETx2DE at 0 range 27 .. 27;
RSTx2DE at 0 range 28 .. 28;
RSTDE at 0 range 29 .. 29;
DLYPRTDE at 0 range 30 .. 30;
Reserved_31_31 at 0 range 31 .. 31;
end record;
subtype CNTAR_CNTx_Field is HAL.UInt16;
-- Timerx Counter Register
type CNTAR_Register is record
-- Timerx Counter value
CNTx : CNTAR_CNTx_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CNTAR_Register use record
CNTx at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype PERAR_PERx_Field is HAL.UInt16;
-- Timerx Period Register
type PERAR_Register is record
-- Timerx Period value
PERx : PERAR_PERx_Field := 16#FFFF#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for PERAR_Register use record
PERx at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype REPAR_REPx_Field is HAL.UInt8;
-- Timerx Repetition Register
type REPAR_Register is record
-- Timerx Repetition counter value
REPx : REPAR_REPx_Field := 16#0#;
-- unspecified
Reserved_8_31 : HAL.UInt24 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for REPAR_Register use record
REPx at 0 range 0 .. 7;
Reserved_8_31 at 0 range 8 .. 31;
end record;
subtype CMP1AR_CMP1x_Field is HAL.UInt16;
-- Timerx Compare 1 Register
type CMP1AR_Register is record
-- Timerx Compare 1 value
CMP1x : CMP1AR_CMP1x_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CMP1AR_Register use record
CMP1x at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype CMP1CAR_CMP1x_Field is HAL.UInt16;
subtype CMP1CAR_REPx_Field is HAL.UInt8;
-- Timerx Compare 1 Compound Register
type CMP1CAR_Register is record
-- Timerx Compare 1 value
CMP1x : CMP1CAR_CMP1x_Field := 16#0#;
-- Timerx Repetition value (aliased from HRTIM_REPx register)
REPx : CMP1CAR_REPx_Field := 16#0#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CMP1CAR_Register use record
CMP1x at 0 range 0 .. 15;
REPx at 0 range 16 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
subtype CMP2AR_CMP2x_Field is HAL.UInt16;
-- Timerx Compare 2 Register
type CMP2AR_Register is record
-- Timerx Compare 2 value
CMP2x : CMP2AR_CMP2x_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CMP2AR_Register use record
CMP2x at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype CMP3AR_CMP3x_Field is HAL.UInt16;
-- Timerx Compare 3 Register
type CMP3AR_Register is record
-- Timerx Compare 3 value
CMP3x : CMP3AR_CMP3x_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CMP3AR_Register use record
CMP3x at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype CMP4AR_CMP4x_Field is HAL.UInt16;
-- Timerx Compare 4 Register
type CMP4AR_Register is record
-- Timerx Compare 4 value
CMP4x : CMP4AR_CMP4x_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CMP4AR_Register use record
CMP4x at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype CPT1AR_CPT1x_Field is HAL.UInt16;
-- Timerx Capture 1 Register
type CPT1AR_Register is record
-- Read-only. Timerx Capture 1 value
CPT1x : CPT1AR_CPT1x_Field;
-- unspecified
Reserved_16_31 : HAL.UInt16;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CPT1AR_Register use record
CPT1x at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype CPT2AR_CPT2x_Field is HAL.UInt16;
-- Timerx Capture 2 Register
type CPT2AR_Register is record
-- Read-only. Timerx Capture 2 value
CPT2x : CPT2AR_CPT2x_Field;
-- unspecified
Reserved_16_31 : HAL.UInt16;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CPT2AR_Register use record
CPT2x at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype DTAR_DTRx_Field is HAL.UInt9;
subtype DTAR_DTPRSC_Field is HAL.UInt3;
subtype DTAR_DTFx_Field is HAL.UInt9;
-- Timerx Deadtime Register
type DTAR_Register is record
-- Deadtime Rising value
DTRx : DTAR_DTRx_Field := 16#0#;
-- Sign Deadtime Rising value
SDTRx : Boolean := False;
-- Deadtime Prescaler
DTPRSC : DTAR_DTPRSC_Field := 16#0#;
-- unspecified
Reserved_13_13 : HAL.Bit := 16#0#;
-- Deadtime Rising Sign Lock
DTRSLKx : Boolean := False;
-- Deadtime Rising Lock
DTRLKx : Boolean := False;
-- Deadtime Falling value
DTFx : DTAR_DTFx_Field := 16#0#;
-- Sign Deadtime Falling value
SDTFx : Boolean := False;
-- unspecified
Reserved_26_29 : HAL.UInt4 := 16#0#;
-- Deadtime Falling Sign Lock
DTFSLKx : Boolean := False;
-- Deadtime Falling Lock
DTFLKx : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for DTAR_Register use record
DTRx at 0 range 0 .. 8;
SDTRx at 0 range 9 .. 9;
DTPRSC at 0 range 10 .. 12;
Reserved_13_13 at 0 range 13 .. 13;
DTRSLKx at 0 range 14 .. 14;
DTRLKx at 0 range 15 .. 15;
DTFx at 0 range 16 .. 24;
SDTFx at 0 range 25 .. 25;
Reserved_26_29 at 0 range 26 .. 29;
DTFSLKx at 0 range 30 .. 30;
DTFLKx at 0 range 31 .. 31;
end record;
-- SETA1R_CMP array
type SETA1R_CMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for SETA1R_CMP
type SETA1R_CMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- CMP as a value
Val : HAL.UInt4;
when True =>
-- CMP as an array
Arr : SETA1R_CMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for SETA1R_CMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- SETA1R_MSTCMP array
type SETA1R_MSTCMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for SETA1R_MSTCMP
type SETA1R_MSTCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MSTCMP as a value
Val : HAL.UInt4;
when True =>
-- MSTCMP as an array
Arr : SETA1R_MSTCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for SETA1R_MSTCMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- SETA1R_TIMEVNT array
type SETA1R_TIMEVNT_Field_Array is array (1 .. 9) of Boolean
with Component_Size => 1, Size => 9;
-- Type definition for SETA1R_TIMEVNT
type SETA1R_TIMEVNT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TIMEVNT as a value
Val : HAL.UInt9;
when True =>
-- TIMEVNT as an array
Arr : SETA1R_TIMEVNT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 9;
for SETA1R_TIMEVNT_Field use record
Val at 0 range 0 .. 8;
Arr at 0 range 0 .. 8;
end record;
-- SETA1R_EXTEVNT array
type SETA1R_EXTEVNT_Field_Array is array (1 .. 10) of Boolean
with Component_Size => 1, Size => 10;
-- Type definition for SETA1R_EXTEVNT
type SETA1R_EXTEVNT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- EXTEVNT as a value
Val : HAL.UInt10;
when True =>
-- EXTEVNT as an array
Arr : SETA1R_EXTEVNT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 10;
for SETA1R_EXTEVNT_Field use record
Val at 0 range 0 .. 9;
Arr at 0 range 0 .. 9;
end record;
-- Timerx Output1 Set Register
type SETA1R_Register is record
-- Software Set trigger
SST : Boolean := False;
-- Timer A resynchronizaton
RESYNC : Boolean := False;
-- Timer A Period
PER : Boolean := False;
-- Timer A compare 1
CMP : SETA1R_CMP_Field := (As_Array => False, Val => 16#0#);
-- Master Period
MSTPER : Boolean := False;
-- Master Compare 1
MSTCMP : SETA1R_MSTCMP_Field := (As_Array => False, Val => 16#0#);
-- Timer Event 1
TIMEVNT : SETA1R_TIMEVNT_Field := (As_Array => False, Val => 16#0#);
-- External Event 1
EXTEVNT : SETA1R_EXTEVNT_Field := (As_Array => False, Val => 16#0#);
-- Registers update (transfer preload to active)
UPDATE : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for SETA1R_Register use record
SST at 0 range 0 .. 0;
RESYNC at 0 range 1 .. 1;
PER at 0 range 2 .. 2;
CMP at 0 range 3 .. 6;
MSTPER at 0 range 7 .. 7;
MSTCMP at 0 range 8 .. 11;
TIMEVNT at 0 range 12 .. 20;
EXTEVNT at 0 range 21 .. 30;
UPDATE at 0 range 31 .. 31;
end record;
-- RSTA1R_CMP array
type RSTA1R_CMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for RSTA1R_CMP
type RSTA1R_CMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- CMP as a value
Val : HAL.UInt4;
when True =>
-- CMP as an array
Arr : RSTA1R_CMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for RSTA1R_CMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- RSTA1R_MSTCMP array
type RSTA1R_MSTCMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for RSTA1R_MSTCMP
type RSTA1R_MSTCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MSTCMP as a value
Val : HAL.UInt4;
when True =>
-- MSTCMP as an array
Arr : RSTA1R_MSTCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for RSTA1R_MSTCMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- RSTA1R_TIMEVNT array
type RSTA1R_TIMEVNT_Field_Array is array (1 .. 9) of Boolean
with Component_Size => 1, Size => 9;
-- Type definition for RSTA1R_TIMEVNT
type RSTA1R_TIMEVNT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TIMEVNT as a value
Val : HAL.UInt9;
when True =>
-- TIMEVNT as an array
Arr : RSTA1R_TIMEVNT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 9;
for RSTA1R_TIMEVNT_Field use record
Val at 0 range 0 .. 8;
Arr at 0 range 0 .. 8;
end record;
-- RSTA1R_EXTEVNT array
type RSTA1R_EXTEVNT_Field_Array is array (1 .. 10) of Boolean
with Component_Size => 1, Size => 10;
-- Type definition for RSTA1R_EXTEVNT
type RSTA1R_EXTEVNT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- EXTEVNT as a value
Val : HAL.UInt10;
when True =>
-- EXTEVNT as an array
Arr : RSTA1R_EXTEVNT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 10;
for RSTA1R_EXTEVNT_Field use record
Val at 0 range 0 .. 9;
Arr at 0 range 0 .. 9;
end record;
-- Timerx Output1 Reset Register
type RSTA1R_Register is record
-- SRT
SRT : Boolean := False;
-- RESYNC
RESYNC : Boolean := False;
-- PER
PER : Boolean := False;
-- CMP1
CMP : RSTA1R_CMP_Field := (As_Array => False, Val => 16#0#);
-- MSTPER
MSTPER : Boolean := False;
-- MSTCMP1
MSTCMP : RSTA1R_MSTCMP_Field := (As_Array => False, Val => 16#0#);
-- TIMEVNT1
TIMEVNT : RSTA1R_TIMEVNT_Field := (As_Array => False, Val => 16#0#);
-- EXTEVNT1
EXTEVNT : RSTA1R_EXTEVNT_Field := (As_Array => False, Val => 16#0#);
-- UPDATE
UPDATE : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for RSTA1R_Register use record
SRT at 0 range 0 .. 0;
RESYNC at 0 range 1 .. 1;
PER at 0 range 2 .. 2;
CMP at 0 range 3 .. 6;
MSTPER at 0 range 7 .. 7;
MSTCMP at 0 range 8 .. 11;
TIMEVNT at 0 range 12 .. 20;
EXTEVNT at 0 range 21 .. 30;
UPDATE at 0 range 31 .. 31;
end record;
-- SETA2R_CMP array
type SETA2R_CMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for SETA2R_CMP
type SETA2R_CMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- CMP as a value
Val : HAL.UInt4;
when True =>
-- CMP as an array
Arr : SETA2R_CMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for SETA2R_CMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- SETA2R_MSTCMP array
type SETA2R_MSTCMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for SETA2R_MSTCMP
type SETA2R_MSTCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MSTCMP as a value
Val : HAL.UInt4;
when True =>
-- MSTCMP as an array
Arr : SETA2R_MSTCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for SETA2R_MSTCMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- SETA2R_TIMEVNT array
type SETA2R_TIMEVNT_Field_Array is array (1 .. 9) of Boolean
with Component_Size => 1, Size => 9;
-- Type definition for SETA2R_TIMEVNT
type SETA2R_TIMEVNT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TIMEVNT as a value
Val : HAL.UInt9;
when True =>
-- TIMEVNT as an array
Arr : SETA2R_TIMEVNT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 9;
for SETA2R_TIMEVNT_Field use record
Val at 0 range 0 .. 8;
Arr at 0 range 0 .. 8;
end record;
-- SETA2R_EXTEVNT array
type SETA2R_EXTEVNT_Field_Array is array (1 .. 10) of Boolean
with Component_Size => 1, Size => 10;
-- Type definition for SETA2R_EXTEVNT
type SETA2R_EXTEVNT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- EXTEVNT as a value
Val : HAL.UInt10;
when True =>
-- EXTEVNT as an array
Arr : SETA2R_EXTEVNT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 10;
for SETA2R_EXTEVNT_Field use record
Val at 0 range 0 .. 9;
Arr at 0 range 0 .. 9;
end record;
-- Timerx Output2 Set Register
type SETA2R_Register is record
-- SST
SST : Boolean := False;
-- RESYNC
RESYNC : Boolean := False;
-- PER
PER : Boolean := False;
-- CMP1
CMP : SETA2R_CMP_Field := (As_Array => False, Val => 16#0#);
-- MSTPER
MSTPER : Boolean := False;
-- MSTCMP1
MSTCMP : SETA2R_MSTCMP_Field := (As_Array => False, Val => 16#0#);
-- TIMEVNT1
TIMEVNT : SETA2R_TIMEVNT_Field := (As_Array => False, Val => 16#0#);
-- EXTEVNT1
EXTEVNT : SETA2R_EXTEVNT_Field := (As_Array => False, Val => 16#0#);
-- UPDATE
UPDATE : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for SETA2R_Register use record
SST at 0 range 0 .. 0;
RESYNC at 0 range 1 .. 1;
PER at 0 range 2 .. 2;
CMP at 0 range 3 .. 6;
MSTPER at 0 range 7 .. 7;
MSTCMP at 0 range 8 .. 11;
TIMEVNT at 0 range 12 .. 20;
EXTEVNT at 0 range 21 .. 30;
UPDATE at 0 range 31 .. 31;
end record;
-- RSTA2R_CMP array
type RSTA2R_CMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for RSTA2R_CMP
type RSTA2R_CMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- CMP as a value
Val : HAL.UInt4;
when True =>
-- CMP as an array
Arr : RSTA2R_CMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for RSTA2R_CMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- RSTA2R_MSTCMP array
type RSTA2R_MSTCMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for RSTA2R_MSTCMP
type RSTA2R_MSTCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MSTCMP as a value
Val : HAL.UInt4;
when True =>
-- MSTCMP as an array
Arr : RSTA2R_MSTCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for RSTA2R_MSTCMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- RSTA2R_TIMEVNT array
type RSTA2R_TIMEVNT_Field_Array is array (1 .. 9) of Boolean
with Component_Size => 1, Size => 9;
-- Type definition for RSTA2R_TIMEVNT
type RSTA2R_TIMEVNT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TIMEVNT as a value
Val : HAL.UInt9;
when True =>
-- TIMEVNT as an array
Arr : RSTA2R_TIMEVNT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 9;
for RSTA2R_TIMEVNT_Field use record
Val at 0 range 0 .. 8;
Arr at 0 range 0 .. 8;
end record;
-- RSTA2R_EXTEVNT array
type RSTA2R_EXTEVNT_Field_Array is array (1 .. 10) of Boolean
with Component_Size => 1, Size => 10;
-- Type definition for RSTA2R_EXTEVNT
type RSTA2R_EXTEVNT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- EXTEVNT as a value
Val : HAL.UInt10;
when True =>
-- EXTEVNT as an array
Arr : RSTA2R_EXTEVNT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 10;
for RSTA2R_EXTEVNT_Field use record
Val at 0 range 0 .. 9;
Arr at 0 range 0 .. 9;
end record;
-- Timerx Output2 Reset Register
type RSTA2R_Register is record
-- SRT
SRT : Boolean := False;
-- RESYNC
RESYNC : Boolean := False;
-- PER
PER : Boolean := False;
-- CMP1
CMP : RSTA2R_CMP_Field := (As_Array => False, Val => 16#0#);
-- MSTPER
MSTPER : Boolean := False;
-- MSTCMP1
MSTCMP : RSTA2R_MSTCMP_Field := (As_Array => False, Val => 16#0#);
-- TIMEVNT1
TIMEVNT : RSTA2R_TIMEVNT_Field := (As_Array => False, Val => 16#0#);
-- EXTEVNT1
EXTEVNT : RSTA2R_EXTEVNT_Field := (As_Array => False, Val => 16#0#);
-- UPDATE
UPDATE : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for RSTA2R_Register use record
SRT at 0 range 0 .. 0;
RESYNC at 0 range 1 .. 1;
PER at 0 range 2 .. 2;
CMP at 0 range 3 .. 6;
MSTPER at 0 range 7 .. 7;
MSTCMP at 0 range 8 .. 11;
TIMEVNT at 0 range 12 .. 20;
EXTEVNT at 0 range 21 .. 30;
UPDATE at 0 range 31 .. 31;
end record;
subtype EEFAR1_EE1FLTR_Field is HAL.UInt4;
subtype EEFAR1_EE2FLTR_Field is HAL.UInt4;
subtype EEFAR1_EE3FLTR_Field is HAL.UInt4;
subtype EEFAR1_EE4FLTR_Field is HAL.UInt4;
subtype EEFAR1_EE5FLTR_Field is HAL.UInt4;
-- Timerx External Event Filtering Register 1
type EEFAR1_Register is record
-- External Event 1 latch
EE1LTCH : Boolean := False;
-- External Event 1 filter
EE1FLTR : EEFAR1_EE1FLTR_Field := 16#0#;
-- unspecified
Reserved_5_5 : HAL.Bit := 16#0#;
-- External Event 2 latch
EE2LTCH : Boolean := False;
-- External Event 2 filter
EE2FLTR : EEFAR1_EE2FLTR_Field := 16#0#;
-- unspecified
Reserved_11_11 : HAL.Bit := 16#0#;
-- External Event 3 latch
EE3LTCH : Boolean := False;
-- External Event 3 filter
EE3FLTR : EEFAR1_EE3FLTR_Field := 16#0#;
-- unspecified
Reserved_17_17 : HAL.Bit := 16#0#;
-- External Event 4 latch
EE4LTCH : Boolean := False;
-- External Event 4 filter
EE4FLTR : EEFAR1_EE4FLTR_Field := 16#0#;
-- unspecified
Reserved_23_23 : HAL.Bit := 16#0#;
-- External Event 5 latch
EE5LTCH : Boolean := False;
-- External Event 5 filter
EE5FLTR : EEFAR1_EE5FLTR_Field := 16#0#;
-- unspecified
Reserved_29_31 : HAL.UInt3 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for EEFAR1_Register use record
EE1LTCH at 0 range 0 .. 0;
EE1FLTR at 0 range 1 .. 4;
Reserved_5_5 at 0 range 5 .. 5;
EE2LTCH at 0 range 6 .. 6;
EE2FLTR at 0 range 7 .. 10;
Reserved_11_11 at 0 range 11 .. 11;
EE3LTCH at 0 range 12 .. 12;
EE3FLTR at 0 range 13 .. 16;
Reserved_17_17 at 0 range 17 .. 17;
EE4LTCH at 0 range 18 .. 18;
EE4FLTR at 0 range 19 .. 22;
Reserved_23_23 at 0 range 23 .. 23;
EE5LTCH at 0 range 24 .. 24;
EE5FLTR at 0 range 25 .. 28;
Reserved_29_31 at 0 range 29 .. 31;
end record;
subtype EEFAR2_EE6FLTR_Field is HAL.UInt4;
subtype EEFAR2_EE7FLTR_Field is HAL.UInt4;
subtype EEFAR2_EE8FLTR_Field is HAL.UInt4;
subtype EEFAR2_EE9FLTR_Field is HAL.UInt4;
subtype EEFAR2_EE10FLTR_Field is HAL.UInt4;
-- Timerx External Event Filtering Register 2
type EEFAR2_Register is record
-- External Event 6 latch
EE6LTCH : Boolean := False;
-- External Event 6 filter
EE6FLTR : EEFAR2_EE6FLTR_Field := 16#0#;
-- unspecified
Reserved_5_5 : HAL.Bit := 16#0#;
-- External Event 7 latch
EE7LTCH : Boolean := False;
-- External Event 7 filter
EE7FLTR : EEFAR2_EE7FLTR_Field := 16#0#;
-- unspecified
Reserved_11_11 : HAL.Bit := 16#0#;
-- External Event 8 latch
EE8LTCH : Boolean := False;
-- External Event 8 filter
EE8FLTR : EEFAR2_EE8FLTR_Field := 16#0#;
-- unspecified
Reserved_17_17 : HAL.Bit := 16#0#;
-- External Event 9 latch
EE9LTCH : Boolean := False;
-- External Event 9 filter
EE9FLTR : EEFAR2_EE9FLTR_Field := 16#0#;
-- unspecified
Reserved_23_23 : HAL.Bit := 16#0#;
-- External Event 10 latch
EE10LTCH : Boolean := False;
-- External Event 10 filter
EE10FLTR : EEFAR2_EE10FLTR_Field := 16#0#;
-- unspecified
Reserved_29_31 : HAL.UInt3 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for EEFAR2_Register use record
EE6LTCH at 0 range 0 .. 0;
EE6FLTR at 0 range 1 .. 4;
Reserved_5_5 at 0 range 5 .. 5;
EE7LTCH at 0 range 6 .. 6;
EE7FLTR at 0 range 7 .. 10;
Reserved_11_11 at 0 range 11 .. 11;
EE8LTCH at 0 range 12 .. 12;
EE8FLTR at 0 range 13 .. 16;
Reserved_17_17 at 0 range 17 .. 17;
EE9LTCH at 0 range 18 .. 18;
EE9FLTR at 0 range 19 .. 22;
Reserved_23_23 at 0 range 23 .. 23;
EE10LTCH at 0 range 24 .. 24;
EE10FLTR at 0 range 25 .. 28;
Reserved_29_31 at 0 range 29 .. 31;
end record;
-- RSTAR_CMP array
type RSTAR_CMP_Field_Array is array (2 .. 3) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for RSTAR_CMP
type RSTAR_CMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- CMP as a value
Val : HAL.UInt2;
when True =>
-- CMP as an array
Arr : RSTAR_CMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for RSTAR_CMP_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- RSTAR_MSTCMP array
type RSTAR_MSTCMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for RSTAR_MSTCMP
type RSTAR_MSTCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MSTCMP as a value
Val : HAL.UInt4;
when True =>
-- MSTCMP as an array
Arr : RSTAR_MSTCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for RSTAR_MSTCMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- RSTAR_EXTEVNT array
type RSTAR_EXTEVNT_Field_Array is array (1 .. 10) of Boolean
with Component_Size => 1, Size => 10;
-- Type definition for RSTAR_EXTEVNT
type RSTAR_EXTEVNT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- EXTEVNT as a value
Val : HAL.UInt10;
when True =>
-- EXTEVNT as an array
Arr : RSTAR_EXTEVNT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 10;
for RSTAR_EXTEVNT_Field use record
Val at 0 range 0 .. 9;
Arr at 0 range 0 .. 9;
end record;
-- RSTAR_TIMBCMP array
type RSTAR_TIMBCMP_Field_Array is array (1 .. 3) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for RSTAR_TIMBCMP
type RSTAR_TIMBCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TIMBCMP as a value
Val : HAL.UInt3;
when True =>
-- TIMBCMP as an array
Arr : RSTAR_TIMBCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 3;
for RSTAR_TIMBCMP_Field use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- RSTAR_TIMCCMP array
type RSTAR_TIMCCMP_Field_Array is array (1 .. 3) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for RSTAR_TIMCCMP
type RSTAR_TIMCCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TIMCCMP as a value
Val : HAL.UInt3;
when True =>
-- TIMCCMP as an array
Arr : RSTAR_TIMCCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 3;
for RSTAR_TIMCCMP_Field use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- RSTAR_TIMDCMP array
type RSTAR_TIMDCMP_Field_Array is array (1 .. 3) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for RSTAR_TIMDCMP
type RSTAR_TIMDCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TIMDCMP as a value
Val : HAL.UInt3;
when True =>
-- TIMDCMP as an array
Arr : RSTAR_TIMDCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 3;
for RSTAR_TIMDCMP_Field use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- RSTAR_TIMECMP array
type RSTAR_TIMECMP_Field_Array is array (1 .. 3) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for RSTAR_TIMECMP
type RSTAR_TIMECMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TIMECMP as a value
Val : HAL.UInt3;
when True =>
-- TIMECMP as an array
Arr : RSTAR_TIMECMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 3;
for RSTAR_TIMECMP_Field use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- TimerA Reset Register
type RSTAR_Register is record
-- unspecified
Reserved_0_0 : HAL.Bit := 16#0#;
-- Timer A Update reset
UPDT : Boolean := False;
-- Timer A compare 2 reset
CMP : RSTAR_CMP_Field := (As_Array => False, Val => 16#0#);
-- Master timer Period
MSTPER : Boolean := False;
-- Master compare 1
MSTCMP : RSTAR_MSTCMP_Field :=
(As_Array => False, Val => 16#0#);
-- External Event 1
EXTEVNT : RSTAR_EXTEVNT_Field :=
(As_Array => False, Val => 16#0#);
-- Timer B Compare 1
TIMBCMP : RSTAR_TIMBCMP_Field :=
(As_Array => False, Val => 16#0#);
-- Timer C Compare 1
TIMCCMP : RSTAR_TIMCCMP_Field :=
(As_Array => False, Val => 16#0#);
-- Timer D Compare 1
TIMDCMP : RSTAR_TIMDCMP_Field :=
(As_Array => False, Val => 16#0#);
-- Timer E Compare 1
TIMECMP : RSTAR_TIMECMP_Field :=
(As_Array => False, Val => 16#0#);
-- unspecified
Reserved_31_31 : HAL.Bit := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for RSTAR_Register use record
Reserved_0_0 at 0 range 0 .. 0;
UPDT at 0 range 1 .. 1;
CMP at 0 range 2 .. 3;
MSTPER at 0 range 4 .. 4;
MSTCMP at 0 range 5 .. 8;
EXTEVNT at 0 range 9 .. 18;
TIMBCMP at 0 range 19 .. 21;
TIMCCMP at 0 range 22 .. 24;
TIMDCMP at 0 range 25 .. 27;
TIMECMP at 0 range 28 .. 30;
Reserved_31_31 at 0 range 31 .. 31;
end record;
subtype CHPAR_CHPFRQ_Field is HAL.UInt4;
subtype CHPAR_CHPDTY_Field is HAL.UInt3;
subtype CHPAR_STRTPW_Field is HAL.UInt4;
-- Timerx Chopper Register
type CHPAR_Register is record
-- Timerx carrier frequency value
CHPFRQ : CHPAR_CHPFRQ_Field := 16#0#;
-- Timerx chopper duty cycle value
CHPDTY : CHPAR_CHPDTY_Field := 16#0#;
-- STRTPW
STRTPW : CHPAR_STRTPW_Field := 16#0#;
-- unspecified
Reserved_11_31 : HAL.UInt21 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CHPAR_Register use record
CHPFRQ at 0 range 0 .. 3;
CHPDTY at 0 range 4 .. 6;
STRTPW at 0 range 7 .. 10;
Reserved_11_31 at 0 range 11 .. 31;
end record;
-- CPT1ACR_TBCMP array
type CPT1ACR_TBCMP_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for CPT1ACR_TBCMP
type CPT1ACR_TBCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TBCMP as a value
Val : HAL.UInt2;
when True =>
-- TBCMP as an array
Arr : CPT1ACR_TBCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for CPT1ACR_TBCMP_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- CPT1ACR_TCCMP array
type CPT1ACR_TCCMP_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for CPT1ACR_TCCMP
type CPT1ACR_TCCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TCCMP as a value
Val : HAL.UInt2;
when True =>
-- TCCMP as an array
Arr : CPT1ACR_TCCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for CPT1ACR_TCCMP_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- CPT1ACR_TDCMP array
type CPT1ACR_TDCMP_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for CPT1ACR_TDCMP
type CPT1ACR_TDCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TDCMP as a value
Val : HAL.UInt2;
when True =>
-- TDCMP as an array
Arr : CPT1ACR_TDCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for CPT1ACR_TDCMP_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- CPT1ACR_TECMP array
type CPT1ACR_TECMP_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for CPT1ACR_TECMP
type CPT1ACR_TECMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TECMP as a value
Val : HAL.UInt2;
when True =>
-- TECMP as an array
Arr : CPT1ACR_TECMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for CPT1ACR_TECMP_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- Timerx Capture 2 Control Register
type CPT1ACR_Register is record
-- Software Capture
SWCPT : Boolean := False;
-- Update Capture
UDPCPT : Boolean := False;
-- External Event 1 Capture
EXEV1CPT : Boolean := False;
-- External Event 2 Capture
EXEV2CPT : Boolean := False;
-- External Event 3 Capture
EXEV3CPT : Boolean := False;
-- External Event 4 Capture
EXEV4CPT : Boolean := False;
-- External Event 5 Capture
EXEV5CPT : Boolean := False;
-- External Event 6 Capture
EXEV6CPT : Boolean := False;
-- External Event 7 Capture
EXEV7CPT : Boolean := False;
-- External Event 8 Capture
EXEV8CPT : Boolean := False;
-- External Event 9 Capture
EXEV9CPT : Boolean := False;
-- External Event 10 Capture
EXEV10CPT : Boolean := False;
-- unspecified
Reserved_12_15 : HAL.UInt4 := 16#0#;
-- Timer B output 1 Set
TB1SET : Boolean := False;
-- Timer B output 1 Reset
TB1RST : Boolean := False;
-- Timer B Compare 1
TBCMP : CPT1ACR_TBCMP_Field :=
(As_Array => False, Val => 16#0#);
-- Timer C output 1 Set
TC1SET : Boolean := False;
-- Timer C output 1 Reset
TC1RST : Boolean := False;
-- Timer C Compare 1
TCCMP : CPT1ACR_TCCMP_Field :=
(As_Array => False, Val => 16#0#);
-- Timer D output 1 Set
TD1SET : Boolean := False;
-- Timer D output 1 Reset
TD1RST : Boolean := False;
-- Timer D Compare 1
TDCMP : CPT1ACR_TDCMP_Field :=
(As_Array => False, Val => 16#0#);
-- Timer E output 1 Set
TE1SET : Boolean := False;
-- Timer E output 1 Reset
TE1RST : Boolean := False;
-- Timer E Compare 1
TECMP : CPT1ACR_TECMP_Field :=
(As_Array => False, Val => 16#0#);
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CPT1ACR_Register use record
SWCPT at 0 range 0 .. 0;
UDPCPT at 0 range 1 .. 1;
EXEV1CPT at 0 range 2 .. 2;
EXEV2CPT at 0 range 3 .. 3;
EXEV3CPT at 0 range 4 .. 4;
EXEV4CPT at 0 range 5 .. 5;
EXEV5CPT at 0 range 6 .. 6;
EXEV6CPT at 0 range 7 .. 7;
EXEV7CPT at 0 range 8 .. 8;
EXEV8CPT at 0 range 9 .. 9;
EXEV9CPT at 0 range 10 .. 10;
EXEV10CPT at 0 range 11 .. 11;
Reserved_12_15 at 0 range 12 .. 15;
TB1SET at 0 range 16 .. 16;
TB1RST at 0 range 17 .. 17;
TBCMP at 0 range 18 .. 19;
TC1SET at 0 range 20 .. 20;
TC1RST at 0 range 21 .. 21;
TCCMP at 0 range 22 .. 23;
TD1SET at 0 range 24 .. 24;
TD1RST at 0 range 25 .. 25;
TDCMP at 0 range 26 .. 27;
TE1SET at 0 range 28 .. 28;
TE1RST at 0 range 29 .. 29;
TECMP at 0 range 30 .. 31;
end record;
-- CPT2ACR_TBCMP array
type CPT2ACR_TBCMP_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for CPT2ACR_TBCMP
type CPT2ACR_TBCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TBCMP as a value
Val : HAL.UInt2;
when True =>
-- TBCMP as an array
Arr : CPT2ACR_TBCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for CPT2ACR_TBCMP_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- CPT2ACR_TCCMP array
type CPT2ACR_TCCMP_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for CPT2ACR_TCCMP
type CPT2ACR_TCCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TCCMP as a value
Val : HAL.UInt2;
when True =>
-- TCCMP as an array
Arr : CPT2ACR_TCCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for CPT2ACR_TCCMP_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- CPT2ACR_TDCMP array
type CPT2ACR_TDCMP_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for CPT2ACR_TDCMP
type CPT2ACR_TDCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TDCMP as a value
Val : HAL.UInt2;
when True =>
-- TDCMP as an array
Arr : CPT2ACR_TDCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for CPT2ACR_TDCMP_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- CPT2ACR_TECMP array
type CPT2ACR_TECMP_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for CPT2ACR_TECMP
type CPT2ACR_TECMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TECMP as a value
Val : HAL.UInt2;
when True =>
-- TECMP as an array
Arr : CPT2ACR_TECMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for CPT2ACR_TECMP_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- CPT2xCR
type CPT2ACR_Register is record
-- Software Capture
SWCPT : Boolean := False;
-- Update Capture
UDPCPT : Boolean := False;
-- External Event 1 Capture
EXEV1CPT : Boolean := False;
-- External Event 2 Capture
EXEV2CPT : Boolean := False;
-- External Event 3 Capture
EXEV3CPT : Boolean := False;
-- External Event 4 Capture
EXEV4CPT : Boolean := False;
-- External Event 5 Capture
EXEV5CPT : Boolean := False;
-- External Event 6 Capture
EXEV6CPT : Boolean := False;
-- External Event 7 Capture
EXEV7CPT : Boolean := False;
-- External Event 8 Capture
EXEV8CPT : Boolean := False;
-- External Event 9 Capture
EXEV9CPT : Boolean := False;
-- External Event 10 Capture
EXEV10CPT : Boolean := False;
-- unspecified
Reserved_12_15 : HAL.UInt4 := 16#0#;
-- Timer B output 1 Set
TB1SET : Boolean := False;
-- Timer B output 1 Reset
TB1RST : Boolean := False;
-- Timer B Compare 1
TBCMP : CPT2ACR_TBCMP_Field :=
(As_Array => False, Val => 16#0#);
-- Timer C output 1 Set
TC1SET : Boolean := False;
-- Timer C output 1 Reset
TC1RST : Boolean := False;
-- Timer C Compare 1
TCCMP : CPT2ACR_TCCMP_Field :=
(As_Array => False, Val => 16#0#);
-- Timer D output 1 Set
TD1SET : Boolean := False;
-- Timer D output 1 Reset
TD1RST : Boolean := False;
-- Timer D Compare 1
TDCMP : CPT2ACR_TDCMP_Field :=
(As_Array => False, Val => 16#0#);
-- Timer E output 1 Set
TE1SET : Boolean := False;
-- Timer E output 1 Reset
TE1RST : Boolean := False;
-- Timer E Compare 1
TECMP : CPT2ACR_TECMP_Field :=
(As_Array => False, Val => 16#0#);
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CPT2ACR_Register use record
SWCPT at 0 range 0 .. 0;
UDPCPT at 0 range 1 .. 1;
EXEV1CPT at 0 range 2 .. 2;
EXEV2CPT at 0 range 3 .. 3;
EXEV3CPT at 0 range 4 .. 4;
EXEV4CPT at 0 range 5 .. 5;
EXEV5CPT at 0 range 6 .. 6;
EXEV6CPT at 0 range 7 .. 7;
EXEV7CPT at 0 range 8 .. 8;
EXEV8CPT at 0 range 9 .. 9;
EXEV9CPT at 0 range 10 .. 10;
EXEV10CPT at 0 range 11 .. 11;
Reserved_12_15 at 0 range 12 .. 15;
TB1SET at 0 range 16 .. 16;
TB1RST at 0 range 17 .. 17;
TBCMP at 0 range 18 .. 19;
TC1SET at 0 range 20 .. 20;
TC1RST at 0 range 21 .. 21;
TCCMP at 0 range 22 .. 23;
TD1SET at 0 range 24 .. 24;
TD1RST at 0 range 25 .. 25;
TDCMP at 0 range 26 .. 27;
TE1SET at 0 range 28 .. 28;
TE1RST at 0 range 29 .. 29;
TECMP at 0 range 30 .. 31;
end record;
subtype OUTAR_FAULT1_Field is HAL.UInt2;
subtype OUTAR_DLYPRT_Field is HAL.UInt3;
subtype OUTAR_FAULT2_Field is HAL.UInt2;
-- Timerx Output Register
type OUTAR_Register is record
-- unspecified
Reserved_0_0 : HAL.Bit := 16#0#;
-- Output 1 polarity
POL1 : Boolean := False;
-- Output 1 Idle mode
IDLEM1 : Boolean := False;
-- Output 1 Idle State
IDLES1 : Boolean := False;
-- Output 1 Fault state
FAULT1 : OUTAR_FAULT1_Field := 16#0#;
-- Output 1 Chopper enable
CHP1 : Boolean := False;
-- Output 1 Deadtime upon burst mode Idle entry
DIDL1 : Boolean := False;
-- Deadtime enable
DTEN : Boolean := False;
-- Delayed Protection Enable
DLYPRTEN : Boolean := False;
-- Delayed Protection
DLYPRT : OUTAR_DLYPRT_Field := 16#0#;
-- unspecified
Reserved_13_16 : HAL.UInt4 := 16#0#;
-- Output 2 polarity
POL2 : Boolean := False;
-- Output 2 Idle mode
IDLEM2 : Boolean := False;
-- Output 2 Idle State
IDLES2 : Boolean := False;
-- Output 2 Fault state
FAULT2 : OUTAR_FAULT2_Field := 16#0#;
-- Output 2 Chopper enable
CHP2 : Boolean := False;
-- Output 2 Deadtime upon burst mode Idle entry
DIDL2 : Boolean := False;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for OUTAR_Register use record
Reserved_0_0 at 0 range 0 .. 0;
POL1 at 0 range 1 .. 1;
IDLEM1 at 0 range 2 .. 2;
IDLES1 at 0 range 3 .. 3;
FAULT1 at 0 range 4 .. 5;
CHP1 at 0 range 6 .. 6;
DIDL1 at 0 range 7 .. 7;
DTEN at 0 range 8 .. 8;
DLYPRTEN at 0 range 9 .. 9;
DLYPRT at 0 range 10 .. 12;
Reserved_13_16 at 0 range 13 .. 16;
POL2 at 0 range 17 .. 17;
IDLEM2 at 0 range 18 .. 18;
IDLES2 at 0 range 19 .. 19;
FAULT2 at 0 range 20 .. 21;
CHP2 at 0 range 22 .. 22;
DIDL2 at 0 range 23 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
-- Timerx Fault Register
type FLTAR_Register is record
-- Fault 1 enable
FLT1EN : Boolean := False;
-- Fault 2 enable
FLT2EN : Boolean := False;
-- Fault 3 enable
FLT3EN : Boolean := False;
-- Fault 4 enable
FLT4EN : Boolean := False;
-- Fault 5 enable
FLT5EN : Boolean := False;
-- unspecified
Reserved_5_30 : HAL.UInt26 := 16#0#;
-- Fault sources Lock
FLTLCK : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for FLTAR_Register use record
FLT1EN at 0 range 0 .. 0;
FLT2EN at 0 range 1 .. 1;
FLT3EN at 0 range 2 .. 2;
FLT4EN at 0 range 3 .. 3;
FLT5EN at 0 range 4 .. 4;
Reserved_5_30 at 0 range 5 .. 30;
FLTLCK at 0 range 31 .. 31;
end record;
subtype TIMBCR_CKPSCx_Field is HAL.UInt3;
-- TIMBCR_DELCMP array element
subtype TIMBCR_DELCMP_Element is HAL.UInt2;
-- TIMBCR_DELCMP array
type TIMBCR_DELCMP_Field_Array is array (2 .. 3) of TIMBCR_DELCMP_Element
with Component_Size => 2, Size => 4;
-- Type definition for TIMBCR_DELCMP
type TIMBCR_DELCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- DELCMP as a value
Val : HAL.UInt4;
when True =>
-- DELCMP as an array
Arr : TIMBCR_DELCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for TIMBCR_DELCMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
subtype TIMBCR_DACSYNC_Field is HAL.UInt2;
subtype TIMBCR_UPDGAT_Field is HAL.UInt4;
-- Timerx Control Register
type TIMBCR_Register is record
-- HRTIM Timer x Clock prescaler
CKPSCx : TIMBCR_CKPSCx_Field := 16#0#;
-- Continuous mode
CONT : Boolean := False;
-- Re-triggerable mode
RETRIG : Boolean := False;
-- Half mode enable
HALF : Boolean := False;
-- Push-Pull mode enable
PSHPLL : Boolean := False;
-- unspecified
Reserved_7_9 : HAL.UInt3 := 16#0#;
-- Synchronization Resets Timer x
SYNCRSTx : Boolean := False;
-- Synchronization Starts Timer x
SYNCSTRTx : Boolean := False;
-- Delayed CMP2 mode
DELCMP : TIMBCR_DELCMP_Field :=
(As_Array => False, Val => 16#0#);
-- unspecified
Reserved_16_16 : HAL.Bit := 16#0#;
-- Timer x Repetition update
TxREPU : Boolean := False;
-- Timerx reset update
TxRSTU : Boolean := False;
-- unspecified
Reserved_19_19 : HAL.Bit := 16#0#;
-- TBU
TBU : Boolean := False;
-- TCU
TCU : Boolean := False;
-- TDU
TDU : Boolean := False;
-- TEU
TEU : Boolean := False;
-- Master Timer update
MSTU : Boolean := False;
-- AC Synchronization
DACSYNC : TIMBCR_DACSYNC_Field := 16#0#;
-- Preload enable
PREEN : Boolean := False;
-- Update Gating
UPDGAT : TIMBCR_UPDGAT_Field := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TIMBCR_Register use record
CKPSCx at 0 range 0 .. 2;
CONT at 0 range 3 .. 3;
RETRIG at 0 range 4 .. 4;
HALF at 0 range 5 .. 5;
PSHPLL at 0 range 6 .. 6;
Reserved_7_9 at 0 range 7 .. 9;
SYNCRSTx at 0 range 10 .. 10;
SYNCSTRTx at 0 range 11 .. 11;
DELCMP at 0 range 12 .. 15;
Reserved_16_16 at 0 range 16 .. 16;
TxREPU at 0 range 17 .. 17;
TxRSTU at 0 range 18 .. 18;
Reserved_19_19 at 0 range 19 .. 19;
TBU at 0 range 20 .. 20;
TCU at 0 range 21 .. 21;
TDU at 0 range 22 .. 22;
TEU at 0 range 23 .. 23;
MSTU at 0 range 24 .. 24;
DACSYNC at 0 range 25 .. 26;
PREEN at 0 range 27 .. 27;
UPDGAT at 0 range 28 .. 31;
end record;
-- TIMBISR_CMP array
type TIMBISR_CMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for TIMBISR_CMP
type TIMBISR_CMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- CMP as a value
Val : HAL.UInt4;
when True =>
-- CMP as an array
Arr : TIMBISR_CMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for TIMBISR_CMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- TIMBISR_CPT array
type TIMBISR_CPT_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for TIMBISR_CPT
type TIMBISR_CPT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- CPT as a value
Val : HAL.UInt2;
when True =>
-- CPT as an array
Arr : TIMBISR_CPT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for TIMBISR_CPT_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- Timerx Interrupt Status Register
type TIMBISR_Register is record
-- Read-only. Compare 1 Interrupt Flag
CMP : TIMBISR_CMP_Field;
-- Read-only. Repetition Interrupt Flag
REP : Boolean;
-- unspecified
Reserved_5_5 : HAL.Bit;
-- Read-only. Update Interrupt Flag
UPD : Boolean;
-- Read-only. Capture1 Interrupt Flag
CPT : TIMBISR_CPT_Field;
-- Read-only. Output 1 Set Interrupt Flag
SETx1 : Boolean;
-- Read-only. Output 1 Reset Interrupt Flag
RSTx1 : Boolean;
-- Read-only. Output 2 Set Interrupt Flag
SETx2 : Boolean;
-- Read-only. Output 2 Reset Interrupt Flag
RSTx2 : Boolean;
-- Read-only. Reset Interrupt Flag
RST : Boolean;
-- Read-only. Delayed Protection Flag
DLYPRT : Boolean;
-- unspecified
Reserved_15_15 : HAL.Bit;
-- Read-only. Current Push Pull Status
CPPSTAT : Boolean;
-- Read-only. Idle Push Pull Status
IPPSTAT : Boolean;
-- Read-only. Output 1 State
O1STAT : Boolean;
-- Read-only. Output 2 State
O2STAT : Boolean;
-- unspecified
Reserved_20_31 : HAL.UInt12;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TIMBISR_Register use record
CMP at 0 range 0 .. 3;
REP at 0 range 4 .. 4;
Reserved_5_5 at 0 range 5 .. 5;
UPD at 0 range 6 .. 6;
CPT at 0 range 7 .. 8;
SETx1 at 0 range 9 .. 9;
RSTx1 at 0 range 10 .. 10;
SETx2 at 0 range 11 .. 11;
RSTx2 at 0 range 12 .. 12;
RST at 0 range 13 .. 13;
DLYPRT at 0 range 14 .. 14;
Reserved_15_15 at 0 range 15 .. 15;
CPPSTAT at 0 range 16 .. 16;
IPPSTAT at 0 range 17 .. 17;
O1STAT at 0 range 18 .. 18;
O2STAT at 0 range 19 .. 19;
Reserved_20_31 at 0 range 20 .. 31;
end record;
-- Timerx Interrupt Clear Register
type TIMBICR_Register is record
-- Write-only. Compare 1 Interrupt flag Clear
CMP1C : Boolean := False;
-- Write-only. Compare 2 Interrupt flag Clear
CMP2C : Boolean := False;
-- Write-only. Compare 3 Interrupt flag Clear
CMP3C : Boolean := False;
-- Write-only. Compare 4 Interrupt flag Clear
CMP4C : Boolean := False;
-- Write-only. Repetition Interrupt flag Clear
REPC : Boolean := False;
-- unspecified
Reserved_5_5 : HAL.Bit := 16#0#;
-- Write-only. Update Interrupt flag Clear
UPDC : Boolean := False;
-- Write-only. Capture1 Interrupt flag Clear
CPT1C : Boolean := False;
-- Write-only. Capture2 Interrupt flag Clear
CPT2C : Boolean := False;
-- Write-only. Output 1 Set flag Clear
SET1xC : Boolean := False;
-- Write-only. Output 1 Reset flag Clear
RSTx1C : Boolean := False;
-- Write-only. Output 2 Set flag Clear
SET2xC : Boolean := False;
-- Write-only. Output 2 Reset flag Clear
RSTx2C : Boolean := False;
-- Write-only. Reset Interrupt flag Clear
RSTC : Boolean := False;
-- Write-only. Delayed Protection Flag Clear
DLYPRTC : Boolean := False;
-- unspecified
Reserved_15_31 : HAL.UInt17 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TIMBICR_Register use record
CMP1C at 0 range 0 .. 0;
CMP2C at 0 range 1 .. 1;
CMP3C at 0 range 2 .. 2;
CMP4C at 0 range 3 .. 3;
REPC at 0 range 4 .. 4;
Reserved_5_5 at 0 range 5 .. 5;
UPDC at 0 range 6 .. 6;
CPT1C at 0 range 7 .. 7;
CPT2C at 0 range 8 .. 8;
SET1xC at 0 range 9 .. 9;
RSTx1C at 0 range 10 .. 10;
SET2xC at 0 range 11 .. 11;
RSTx2C at 0 range 12 .. 12;
RSTC at 0 range 13 .. 13;
DLYPRTC at 0 range 14 .. 14;
Reserved_15_31 at 0 range 15 .. 31;
end record;
-- TIMxDIER
type TIMBDIER_Register is record
-- CMP1IE
CMP1IE : Boolean := False;
-- CMP2IE
CMP2IE : Boolean := False;
-- CMP3IE
CMP3IE : Boolean := False;
-- CMP4IE
CMP4IE : Boolean := False;
-- REPIE
REPIE : Boolean := False;
-- unspecified
Reserved_5_5 : HAL.Bit := 16#0#;
-- UPDIE
UPDIE : Boolean := False;
-- CPT1IE
CPT1IE : Boolean := False;
-- CPT2IE
CPT2IE : Boolean := False;
-- SET1xIE
SET1xIE : Boolean := False;
-- RSTx1IE
RSTx1IE : Boolean := False;
-- SETx2IE
SETx2IE : Boolean := False;
-- RSTx2IE
RSTx2IE : Boolean := False;
-- RSTIE
RSTIE : Boolean := False;
-- DLYPRTIE
DLYPRTIE : Boolean := False;
-- unspecified
Reserved_15_15 : HAL.Bit := 16#0#;
-- CMP1DE
CMP1DE : Boolean := False;
-- CMP2DE
CMP2DE : Boolean := False;
-- CMP3DE
CMP3DE : Boolean := False;
-- CMP4DE
CMP4DE : Boolean := False;
-- REPDE
REPDE : Boolean := False;
-- unspecified
Reserved_21_21 : HAL.Bit := 16#0#;
-- UPDDE
UPDDE : Boolean := False;
-- CPT1DE
CPT1DE : Boolean := False;
-- CPT2DE
CPT2DE : Boolean := False;
-- SET1xDE
SET1xDE : Boolean := False;
-- RSTx1DE
RSTx1DE : Boolean := False;
-- SETx2DE
SETx2DE : Boolean := False;
-- RSTx2DE
RSTx2DE : Boolean := False;
-- RSTDE
RSTDE : Boolean := False;
-- DLYPRTDE
DLYPRTDE : Boolean := False;
-- unspecified
Reserved_31_31 : HAL.Bit := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TIMBDIER_Register use record
CMP1IE at 0 range 0 .. 0;
CMP2IE at 0 range 1 .. 1;
CMP3IE at 0 range 2 .. 2;
CMP4IE at 0 range 3 .. 3;
REPIE at 0 range 4 .. 4;
Reserved_5_5 at 0 range 5 .. 5;
UPDIE at 0 range 6 .. 6;
CPT1IE at 0 range 7 .. 7;
CPT2IE at 0 range 8 .. 8;
SET1xIE at 0 range 9 .. 9;
RSTx1IE at 0 range 10 .. 10;
SETx2IE at 0 range 11 .. 11;
RSTx2IE at 0 range 12 .. 12;
RSTIE at 0 range 13 .. 13;
DLYPRTIE at 0 range 14 .. 14;
Reserved_15_15 at 0 range 15 .. 15;
CMP1DE at 0 range 16 .. 16;
CMP2DE at 0 range 17 .. 17;
CMP3DE at 0 range 18 .. 18;
CMP4DE at 0 range 19 .. 19;
REPDE at 0 range 20 .. 20;
Reserved_21_21 at 0 range 21 .. 21;
UPDDE at 0 range 22 .. 22;
CPT1DE at 0 range 23 .. 23;
CPT2DE at 0 range 24 .. 24;
SET1xDE at 0 range 25 .. 25;
RSTx1DE at 0 range 26 .. 26;
SETx2DE at 0 range 27 .. 27;
RSTx2DE at 0 range 28 .. 28;
RSTDE at 0 range 29 .. 29;
DLYPRTDE at 0 range 30 .. 30;
Reserved_31_31 at 0 range 31 .. 31;
end record;
subtype CNTR_CNTx_Field is HAL.UInt16;
-- Timerx Counter Register
type CNTR_Register is record
-- Timerx Counter value
CNTx : CNTR_CNTx_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CNTR_Register use record
CNTx at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype PERBR_PERx_Field is HAL.UInt16;
-- Timerx Period Register
type PERBR_Register is record
-- Timerx Period value
PERx : PERBR_PERx_Field := 16#FFFF#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for PERBR_Register use record
PERx at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype REPBR_REPx_Field is HAL.UInt8;
-- Timerx Repetition Register
type REPBR_Register is record
-- Timerx Repetition counter value
REPx : REPBR_REPx_Field := 16#0#;
-- unspecified
Reserved_8_31 : HAL.UInt24 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for REPBR_Register use record
REPx at 0 range 0 .. 7;
Reserved_8_31 at 0 range 8 .. 31;
end record;
subtype CMP1BR_CMP1x_Field is HAL.UInt16;
-- Timerx Compare 1 Register
type CMP1BR_Register is record
-- Timerx Compare 1 value
CMP1x : CMP1BR_CMP1x_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CMP1BR_Register use record
CMP1x at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype CMP1CBR_CMP1x_Field is HAL.UInt16;
subtype CMP1CBR_REPx_Field is HAL.UInt8;
-- Timerx Compare 1 Compound Register
type CMP1CBR_Register is record
-- Timerx Compare 1 value
CMP1x : CMP1CBR_CMP1x_Field := 16#0#;
-- Timerx Repetition value (aliased from HRTIM_REPx register)
REPx : CMP1CBR_REPx_Field := 16#0#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CMP1CBR_Register use record
CMP1x at 0 range 0 .. 15;
REPx at 0 range 16 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
subtype CMP2BR_CMP2x_Field is HAL.UInt16;
-- Timerx Compare 2 Register
type CMP2BR_Register is record
-- Timerx Compare 2 value
CMP2x : CMP2BR_CMP2x_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CMP2BR_Register use record
CMP2x at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype CMP3BR_CMP3x_Field is HAL.UInt16;
-- Timerx Compare 3 Register
type CMP3BR_Register is record
-- Timerx Compare 3 value
CMP3x : CMP3BR_CMP3x_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CMP3BR_Register use record
CMP3x at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype CMP4BR_CMP4x_Field is HAL.UInt16;
-- Timerx Compare 4 Register
type CMP4BR_Register is record
-- Timerx Compare 4 value
CMP4x : CMP4BR_CMP4x_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CMP4BR_Register use record
CMP4x at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype CPT1BR_CPT1x_Field is HAL.UInt16;
-- Timerx Capture 1 Register
type CPT1BR_Register is record
-- Read-only. Timerx Capture 1 value
CPT1x : CPT1BR_CPT1x_Field;
-- unspecified
Reserved_16_31 : HAL.UInt16;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CPT1BR_Register use record
CPT1x at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype CPT2BR_CPT2x_Field is HAL.UInt16;
-- Timerx Capture 2 Register
type CPT2BR_Register is record
-- Read-only. Timerx Capture 2 value
CPT2x : CPT2BR_CPT2x_Field;
-- unspecified
Reserved_16_31 : HAL.UInt16;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CPT2BR_Register use record
CPT2x at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype DTBR_DTRx_Field is HAL.UInt9;
subtype DTBR_DTPRSC_Field is HAL.UInt3;
subtype DTBR_DTFx_Field is HAL.UInt9;
-- Timerx Deadtime Register
type DTBR_Register is record
-- Deadtime Rising value
DTRx : DTBR_DTRx_Field := 16#0#;
-- Sign Deadtime Rising value
SDTRx : Boolean := False;
-- Deadtime Prescaler
DTPRSC : DTBR_DTPRSC_Field := 16#0#;
-- unspecified
Reserved_13_13 : HAL.Bit := 16#0#;
-- Deadtime Rising Sign Lock
DTRSLKx : Boolean := False;
-- Deadtime Rising Lock
DTRLKx : Boolean := False;
-- Deadtime Falling value
DTFx : DTBR_DTFx_Field := 16#0#;
-- Sign Deadtime Falling value
SDTFx : Boolean := False;
-- unspecified
Reserved_26_29 : HAL.UInt4 := 16#0#;
-- Deadtime Falling Sign Lock
DTFSLKx : Boolean := False;
-- Deadtime Falling Lock
DTFLKx : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for DTBR_Register use record
DTRx at 0 range 0 .. 8;
SDTRx at 0 range 9 .. 9;
DTPRSC at 0 range 10 .. 12;
Reserved_13_13 at 0 range 13 .. 13;
DTRSLKx at 0 range 14 .. 14;
DTRLKx at 0 range 15 .. 15;
DTFx at 0 range 16 .. 24;
SDTFx at 0 range 25 .. 25;
Reserved_26_29 at 0 range 26 .. 29;
DTFSLKx at 0 range 30 .. 30;
DTFLKx at 0 range 31 .. 31;
end record;
-- SETB1R_CMP array
type SETB1R_CMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for SETB1R_CMP
type SETB1R_CMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- CMP as a value
Val : HAL.UInt4;
when True =>
-- CMP as an array
Arr : SETB1R_CMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for SETB1R_CMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- SETB1R_MSTCMP array
type SETB1R_MSTCMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for SETB1R_MSTCMP
type SETB1R_MSTCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MSTCMP as a value
Val : HAL.UInt4;
when True =>
-- MSTCMP as an array
Arr : SETB1R_MSTCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for SETB1R_MSTCMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- SETB1R_TIMEVNT array
type SETB1R_TIMEVNT_Field_Array is array (1 .. 9) of Boolean
with Component_Size => 1, Size => 9;
-- Type definition for SETB1R_TIMEVNT
type SETB1R_TIMEVNT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TIMEVNT as a value
Val : HAL.UInt9;
when True =>
-- TIMEVNT as an array
Arr : SETB1R_TIMEVNT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 9;
for SETB1R_TIMEVNT_Field use record
Val at 0 range 0 .. 8;
Arr at 0 range 0 .. 8;
end record;
-- SETB1R_EXTEVNT array
type SETB1R_EXTEVNT_Field_Array is array (1 .. 10) of Boolean
with Component_Size => 1, Size => 10;
-- Type definition for SETB1R_EXTEVNT
type SETB1R_EXTEVNT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- EXTEVNT as a value
Val : HAL.UInt10;
when True =>
-- EXTEVNT as an array
Arr : SETB1R_EXTEVNT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 10;
for SETB1R_EXTEVNT_Field use record
Val at 0 range 0 .. 9;
Arr at 0 range 0 .. 9;
end record;
-- Timerx Output1 Set Register
type SETB1R_Register is record
-- Software Set trigger
SST : Boolean := False;
-- Timer A resynchronizaton
RESYNC : Boolean := False;
-- Timer A Period
PER : Boolean := False;
-- Timer A compare 1
CMP : SETB1R_CMP_Field := (As_Array => False, Val => 16#0#);
-- Master Period
MSTPER : Boolean := False;
-- Master Compare 1
MSTCMP : SETB1R_MSTCMP_Field := (As_Array => False, Val => 16#0#);
-- Timer Event 1
TIMEVNT : SETB1R_TIMEVNT_Field := (As_Array => False, Val => 16#0#);
-- External Event 1
EXTEVNT : SETB1R_EXTEVNT_Field := (As_Array => False, Val => 16#0#);
-- Registers update (transfer preload to active)
UPDATE : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for SETB1R_Register use record
SST at 0 range 0 .. 0;
RESYNC at 0 range 1 .. 1;
PER at 0 range 2 .. 2;
CMP at 0 range 3 .. 6;
MSTPER at 0 range 7 .. 7;
MSTCMP at 0 range 8 .. 11;
TIMEVNT at 0 range 12 .. 20;
EXTEVNT at 0 range 21 .. 30;
UPDATE at 0 range 31 .. 31;
end record;
-- RSTB1R_CMP array
type RSTB1R_CMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for RSTB1R_CMP
type RSTB1R_CMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- CMP as a value
Val : HAL.UInt4;
when True =>
-- CMP as an array
Arr : RSTB1R_CMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for RSTB1R_CMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- RSTB1R_MSTCMP array
type RSTB1R_MSTCMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for RSTB1R_MSTCMP
type RSTB1R_MSTCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MSTCMP as a value
Val : HAL.UInt4;
when True =>
-- MSTCMP as an array
Arr : RSTB1R_MSTCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for RSTB1R_MSTCMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- RSTB1R_TIMEVNT array
type RSTB1R_TIMEVNT_Field_Array is array (1 .. 9) of Boolean
with Component_Size => 1, Size => 9;
-- Type definition for RSTB1R_TIMEVNT
type RSTB1R_TIMEVNT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TIMEVNT as a value
Val : HAL.UInt9;
when True =>
-- TIMEVNT as an array
Arr : RSTB1R_TIMEVNT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 9;
for RSTB1R_TIMEVNT_Field use record
Val at 0 range 0 .. 8;
Arr at 0 range 0 .. 8;
end record;
-- RSTB1R_EXTEVNT array
type RSTB1R_EXTEVNT_Field_Array is array (1 .. 10) of Boolean
with Component_Size => 1, Size => 10;
-- Type definition for RSTB1R_EXTEVNT
type RSTB1R_EXTEVNT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- EXTEVNT as a value
Val : HAL.UInt10;
when True =>
-- EXTEVNT as an array
Arr : RSTB1R_EXTEVNT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 10;
for RSTB1R_EXTEVNT_Field use record
Val at 0 range 0 .. 9;
Arr at 0 range 0 .. 9;
end record;
-- Timerx Output1 Reset Register
type RSTB1R_Register is record
-- SRT
SRT : Boolean := False;
-- RESYNC
RESYNC : Boolean := False;
-- PER
PER : Boolean := False;
-- CMP1
CMP : RSTB1R_CMP_Field := (As_Array => False, Val => 16#0#);
-- MSTPER
MSTPER : Boolean := False;
-- MSTCMP1
MSTCMP : RSTB1R_MSTCMP_Field := (As_Array => False, Val => 16#0#);
-- TIMEVNT1
TIMEVNT : RSTB1R_TIMEVNT_Field := (As_Array => False, Val => 16#0#);
-- EXTEVNT1
EXTEVNT : RSTB1R_EXTEVNT_Field := (As_Array => False, Val => 16#0#);
-- UPDATE
UPDATE : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for RSTB1R_Register use record
SRT at 0 range 0 .. 0;
RESYNC at 0 range 1 .. 1;
PER at 0 range 2 .. 2;
CMP at 0 range 3 .. 6;
MSTPER at 0 range 7 .. 7;
MSTCMP at 0 range 8 .. 11;
TIMEVNT at 0 range 12 .. 20;
EXTEVNT at 0 range 21 .. 30;
UPDATE at 0 range 31 .. 31;
end record;
-- SETB2R_CMP array
type SETB2R_CMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for SETB2R_CMP
type SETB2R_CMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- CMP as a value
Val : HAL.UInt4;
when True =>
-- CMP as an array
Arr : SETB2R_CMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for SETB2R_CMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- SETB2R_MSTCMP array
type SETB2R_MSTCMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for SETB2R_MSTCMP
type SETB2R_MSTCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MSTCMP as a value
Val : HAL.UInt4;
when True =>
-- MSTCMP as an array
Arr : SETB2R_MSTCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for SETB2R_MSTCMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- SETB2R_TIMEVNT array
type SETB2R_TIMEVNT_Field_Array is array (1 .. 9) of Boolean
with Component_Size => 1, Size => 9;
-- Type definition for SETB2R_TIMEVNT
type SETB2R_TIMEVNT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TIMEVNT as a value
Val : HAL.UInt9;
when True =>
-- TIMEVNT as an array
Arr : SETB2R_TIMEVNT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 9;
for SETB2R_TIMEVNT_Field use record
Val at 0 range 0 .. 8;
Arr at 0 range 0 .. 8;
end record;
-- SETB2R_EXTEVNT array
type SETB2R_EXTEVNT_Field_Array is array (1 .. 10) of Boolean
with Component_Size => 1, Size => 10;
-- Type definition for SETB2R_EXTEVNT
type SETB2R_EXTEVNT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- EXTEVNT as a value
Val : HAL.UInt10;
when True =>
-- EXTEVNT as an array
Arr : SETB2R_EXTEVNT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 10;
for SETB2R_EXTEVNT_Field use record
Val at 0 range 0 .. 9;
Arr at 0 range 0 .. 9;
end record;
-- Timerx Output2 Set Register
type SETB2R_Register is record
-- SST
SST : Boolean := False;
-- RESYNC
RESYNC : Boolean := False;
-- PER
PER : Boolean := False;
-- CMP1
CMP : SETB2R_CMP_Field := (As_Array => False, Val => 16#0#);
-- MSTPER
MSTPER : Boolean := False;
-- MSTCMP1
MSTCMP : SETB2R_MSTCMP_Field := (As_Array => False, Val => 16#0#);
-- TIMEVNT1
TIMEVNT : SETB2R_TIMEVNT_Field := (As_Array => False, Val => 16#0#);
-- EXTEVNT1
EXTEVNT : SETB2R_EXTEVNT_Field := (As_Array => False, Val => 16#0#);
-- UPDATE
UPDATE : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for SETB2R_Register use record
SST at 0 range 0 .. 0;
RESYNC at 0 range 1 .. 1;
PER at 0 range 2 .. 2;
CMP at 0 range 3 .. 6;
MSTPER at 0 range 7 .. 7;
MSTCMP at 0 range 8 .. 11;
TIMEVNT at 0 range 12 .. 20;
EXTEVNT at 0 range 21 .. 30;
UPDATE at 0 range 31 .. 31;
end record;
-- RSTB2R_CMP array
type RSTB2R_CMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for RSTB2R_CMP
type RSTB2R_CMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- CMP as a value
Val : HAL.UInt4;
when True =>
-- CMP as an array
Arr : RSTB2R_CMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for RSTB2R_CMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- RSTB2R_MSTCMP array
type RSTB2R_MSTCMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for RSTB2R_MSTCMP
type RSTB2R_MSTCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MSTCMP as a value
Val : HAL.UInt4;
when True =>
-- MSTCMP as an array
Arr : RSTB2R_MSTCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for RSTB2R_MSTCMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- RSTB2R_TIMEVNT array
type RSTB2R_TIMEVNT_Field_Array is array (1 .. 9) of Boolean
with Component_Size => 1, Size => 9;
-- Type definition for RSTB2R_TIMEVNT
type RSTB2R_TIMEVNT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TIMEVNT as a value
Val : HAL.UInt9;
when True =>
-- TIMEVNT as an array
Arr : RSTB2R_TIMEVNT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 9;
for RSTB2R_TIMEVNT_Field use record
Val at 0 range 0 .. 8;
Arr at 0 range 0 .. 8;
end record;
-- RSTB2R_EXTEVNT array
type RSTB2R_EXTEVNT_Field_Array is array (1 .. 10) of Boolean
with Component_Size => 1, Size => 10;
-- Type definition for RSTB2R_EXTEVNT
type RSTB2R_EXTEVNT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- EXTEVNT as a value
Val : HAL.UInt10;
when True =>
-- EXTEVNT as an array
Arr : RSTB2R_EXTEVNT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 10;
for RSTB2R_EXTEVNT_Field use record
Val at 0 range 0 .. 9;
Arr at 0 range 0 .. 9;
end record;
-- Timerx Output2 Reset Register
type RSTB2R_Register is record
-- SRT
SRT : Boolean := False;
-- RESYNC
RESYNC : Boolean := False;
-- PER
PER : Boolean := False;
-- CMP1
CMP : RSTB2R_CMP_Field := (As_Array => False, Val => 16#0#);
-- MSTPER
MSTPER : Boolean := False;
-- MSTCMP1
MSTCMP : RSTB2R_MSTCMP_Field := (As_Array => False, Val => 16#0#);
-- TIMEVNT1
TIMEVNT : RSTB2R_TIMEVNT_Field := (As_Array => False, Val => 16#0#);
-- EXTEVNT1
EXTEVNT : RSTB2R_EXTEVNT_Field := (As_Array => False, Val => 16#0#);
-- UPDATE
UPDATE : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for RSTB2R_Register use record
SRT at 0 range 0 .. 0;
RESYNC at 0 range 1 .. 1;
PER at 0 range 2 .. 2;
CMP at 0 range 3 .. 6;
MSTPER at 0 range 7 .. 7;
MSTCMP at 0 range 8 .. 11;
TIMEVNT at 0 range 12 .. 20;
EXTEVNT at 0 range 21 .. 30;
UPDATE at 0 range 31 .. 31;
end record;
subtype EEFBR1_EE1FLTR_Field is HAL.UInt4;
subtype EEFBR1_EE2FLTR_Field is HAL.UInt4;
subtype EEFBR1_EE3FLTR_Field is HAL.UInt4;
subtype EEFBR1_EE4FLTR_Field is HAL.UInt4;
subtype EEFBR1_EE5FLTR_Field is HAL.UInt4;
-- Timerx External Event Filtering Register 1
type EEFBR1_Register is record
-- External Event 1 latch
EE1LTCH : Boolean := False;
-- External Event 1 filter
EE1FLTR : EEFBR1_EE1FLTR_Field := 16#0#;
-- unspecified
Reserved_5_5 : HAL.Bit := 16#0#;
-- External Event 2 latch
EE2LTCH : Boolean := False;
-- External Event 2 filter
EE2FLTR : EEFBR1_EE2FLTR_Field := 16#0#;
-- unspecified
Reserved_11_11 : HAL.Bit := 16#0#;
-- External Event 3 latch
EE3LTCH : Boolean := False;
-- External Event 3 filter
EE3FLTR : EEFBR1_EE3FLTR_Field := 16#0#;
-- unspecified
Reserved_17_17 : HAL.Bit := 16#0#;
-- External Event 4 latch
EE4LTCH : Boolean := False;
-- External Event 4 filter
EE4FLTR : EEFBR1_EE4FLTR_Field := 16#0#;
-- unspecified
Reserved_23_23 : HAL.Bit := 16#0#;
-- External Event 5 latch
EE5LTCH : Boolean := False;
-- External Event 5 filter
EE5FLTR : EEFBR1_EE5FLTR_Field := 16#0#;
-- unspecified
Reserved_29_31 : HAL.UInt3 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for EEFBR1_Register use record
EE1LTCH at 0 range 0 .. 0;
EE1FLTR at 0 range 1 .. 4;
Reserved_5_5 at 0 range 5 .. 5;
EE2LTCH at 0 range 6 .. 6;
EE2FLTR at 0 range 7 .. 10;
Reserved_11_11 at 0 range 11 .. 11;
EE3LTCH at 0 range 12 .. 12;
EE3FLTR at 0 range 13 .. 16;
Reserved_17_17 at 0 range 17 .. 17;
EE4LTCH at 0 range 18 .. 18;
EE4FLTR at 0 range 19 .. 22;
Reserved_23_23 at 0 range 23 .. 23;
EE5LTCH at 0 range 24 .. 24;
EE5FLTR at 0 range 25 .. 28;
Reserved_29_31 at 0 range 29 .. 31;
end record;
subtype EEFBR2_EE6FLTR_Field is HAL.UInt4;
subtype EEFBR2_EE7FLTR_Field is HAL.UInt4;
subtype EEFBR2_EE8FLTR_Field is HAL.UInt4;
subtype EEFBR2_EE9FLTR_Field is HAL.UInt4;
subtype EEFBR2_EE10FLTR_Field is HAL.UInt4;
-- Timerx External Event Filtering Register 2
type EEFBR2_Register is record
-- External Event 6 latch
EE6LTCH : Boolean := False;
-- External Event 6 filter
EE6FLTR : EEFBR2_EE6FLTR_Field := 16#0#;
-- unspecified
Reserved_5_5 : HAL.Bit := 16#0#;
-- External Event 7 latch
EE7LTCH : Boolean := False;
-- External Event 7 filter
EE7FLTR : EEFBR2_EE7FLTR_Field := 16#0#;
-- unspecified
Reserved_11_11 : HAL.Bit := 16#0#;
-- External Event 8 latch
EE8LTCH : Boolean := False;
-- External Event 8 filter
EE8FLTR : EEFBR2_EE8FLTR_Field := 16#0#;
-- unspecified
Reserved_17_17 : HAL.Bit := 16#0#;
-- External Event 9 latch
EE9LTCH : Boolean := False;
-- External Event 9 filter
EE9FLTR : EEFBR2_EE9FLTR_Field := 16#0#;
-- unspecified
Reserved_23_23 : HAL.Bit := 16#0#;
-- External Event 10 latch
EE10LTCH : Boolean := False;
-- External Event 10 filter
EE10FLTR : EEFBR2_EE10FLTR_Field := 16#0#;
-- unspecified
Reserved_29_31 : HAL.UInt3 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for EEFBR2_Register use record
EE6LTCH at 0 range 0 .. 0;
EE6FLTR at 0 range 1 .. 4;
Reserved_5_5 at 0 range 5 .. 5;
EE7LTCH at 0 range 6 .. 6;
EE7FLTR at 0 range 7 .. 10;
Reserved_11_11 at 0 range 11 .. 11;
EE8LTCH at 0 range 12 .. 12;
EE8FLTR at 0 range 13 .. 16;
Reserved_17_17 at 0 range 17 .. 17;
EE9LTCH at 0 range 18 .. 18;
EE9FLTR at 0 range 19 .. 22;
Reserved_23_23 at 0 range 23 .. 23;
EE10LTCH at 0 range 24 .. 24;
EE10FLTR at 0 range 25 .. 28;
Reserved_29_31 at 0 range 29 .. 31;
end record;
-- RSTBR_CMP array
type RSTBR_CMP_Field_Array is array (2 .. 3) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for RSTBR_CMP
type RSTBR_CMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- CMP as a value
Val : HAL.UInt2;
when True =>
-- CMP as an array
Arr : RSTBR_CMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for RSTBR_CMP_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- RSTBR_MSTCMP array
type RSTBR_MSTCMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for RSTBR_MSTCMP
type RSTBR_MSTCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MSTCMP as a value
Val : HAL.UInt4;
when True =>
-- MSTCMP as an array
Arr : RSTBR_MSTCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for RSTBR_MSTCMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- RSTBR_EXTEVNT array
type RSTBR_EXTEVNT_Field_Array is array (1 .. 10) of Boolean
with Component_Size => 1, Size => 10;
-- Type definition for RSTBR_EXTEVNT
type RSTBR_EXTEVNT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- EXTEVNT as a value
Val : HAL.UInt10;
when True =>
-- EXTEVNT as an array
Arr : RSTBR_EXTEVNT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 10;
for RSTBR_EXTEVNT_Field use record
Val at 0 range 0 .. 9;
Arr at 0 range 0 .. 9;
end record;
-- RSTBR_TIMACMP array
type RSTBR_TIMACMP_Field_Array is array (1 .. 3) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for RSTBR_TIMACMP
type RSTBR_TIMACMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TIMACMP as a value
Val : HAL.UInt3;
when True =>
-- TIMACMP as an array
Arr : RSTBR_TIMACMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 3;
for RSTBR_TIMACMP_Field use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- RSTBR_TIMCCMP array
type RSTBR_TIMCCMP_Field_Array is array (1 .. 3) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for RSTBR_TIMCCMP
type RSTBR_TIMCCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TIMCCMP as a value
Val : HAL.UInt3;
when True =>
-- TIMCCMP as an array
Arr : RSTBR_TIMCCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 3;
for RSTBR_TIMCCMP_Field use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- RSTBR_TIMDCMP array
type RSTBR_TIMDCMP_Field_Array is array (1 .. 3) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for RSTBR_TIMDCMP
type RSTBR_TIMDCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TIMDCMP as a value
Val : HAL.UInt3;
when True =>
-- TIMDCMP as an array
Arr : RSTBR_TIMDCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 3;
for RSTBR_TIMDCMP_Field use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- RSTBR_TIMECMP array
type RSTBR_TIMECMP_Field_Array is array (1 .. 3) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for RSTBR_TIMECMP
type RSTBR_TIMECMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TIMECMP as a value
Val : HAL.UInt3;
when True =>
-- TIMECMP as an array
Arr : RSTBR_TIMECMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 3;
for RSTBR_TIMECMP_Field use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- TimerA Reset Register
type RSTBR_Register is record
-- unspecified
Reserved_0_0 : HAL.Bit := 16#0#;
-- Timer A Update reset
UPDT : Boolean := False;
-- Timer A compare 2 reset
CMP : RSTBR_CMP_Field := (As_Array => False, Val => 16#0#);
-- Master timer Period
MSTPER : Boolean := False;
-- Master compare 1
MSTCMP : RSTBR_MSTCMP_Field :=
(As_Array => False, Val => 16#0#);
-- External Event 1
EXTEVNT : RSTBR_EXTEVNT_Field :=
(As_Array => False, Val => 16#0#);
-- Timer A Compare 1
TIMACMP : RSTBR_TIMACMP_Field :=
(As_Array => False, Val => 16#0#);
-- Timer C Compare 1
TIMCCMP : RSTBR_TIMCCMP_Field :=
(As_Array => False, Val => 16#0#);
-- Timer D Compare 1
TIMDCMP : RSTBR_TIMDCMP_Field :=
(As_Array => False, Val => 16#0#);
-- Timer E Compare 1
TIMECMP : RSTBR_TIMECMP_Field :=
(As_Array => False, Val => 16#0#);
-- unspecified
Reserved_31_31 : HAL.Bit := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for RSTBR_Register use record
Reserved_0_0 at 0 range 0 .. 0;
UPDT at 0 range 1 .. 1;
CMP at 0 range 2 .. 3;
MSTPER at 0 range 4 .. 4;
MSTCMP at 0 range 5 .. 8;
EXTEVNT at 0 range 9 .. 18;
TIMACMP at 0 range 19 .. 21;
TIMCCMP at 0 range 22 .. 24;
TIMDCMP at 0 range 25 .. 27;
TIMECMP at 0 range 28 .. 30;
Reserved_31_31 at 0 range 31 .. 31;
end record;
subtype CHPBR_CHPFRQ_Field is HAL.UInt4;
subtype CHPBR_CHPDTY_Field is HAL.UInt3;
subtype CHPBR_STRTPW_Field is HAL.UInt4;
-- Timerx Chopper Register
type CHPBR_Register is record
-- Timerx carrier frequency value
CHPFRQ : CHPBR_CHPFRQ_Field := 16#0#;
-- Timerx chopper duty cycle value
CHPDTY : CHPBR_CHPDTY_Field := 16#0#;
-- STRTPW
STRTPW : CHPBR_STRTPW_Field := 16#0#;
-- unspecified
Reserved_11_31 : HAL.UInt21 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CHPBR_Register use record
CHPFRQ at 0 range 0 .. 3;
CHPDTY at 0 range 4 .. 6;
STRTPW at 0 range 7 .. 10;
Reserved_11_31 at 0 range 11 .. 31;
end record;
-- CPT1BCR_TACMP array
type CPT1BCR_TACMP_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for CPT1BCR_TACMP
type CPT1BCR_TACMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TACMP as a value
Val : HAL.UInt2;
when True =>
-- TACMP as an array
Arr : CPT1BCR_TACMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for CPT1BCR_TACMP_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- CPT1BCR_TCCMP array
type CPT1BCR_TCCMP_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for CPT1BCR_TCCMP
type CPT1BCR_TCCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TCCMP as a value
Val : HAL.UInt2;
when True =>
-- TCCMP as an array
Arr : CPT1BCR_TCCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for CPT1BCR_TCCMP_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- CPT1BCR_TDCMP array
type CPT1BCR_TDCMP_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for CPT1BCR_TDCMP
type CPT1BCR_TDCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TDCMP as a value
Val : HAL.UInt2;
when True =>
-- TDCMP as an array
Arr : CPT1BCR_TDCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for CPT1BCR_TDCMP_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- CPT1BCR_TECMP array
type CPT1BCR_TECMP_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for CPT1BCR_TECMP
type CPT1BCR_TECMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TECMP as a value
Val : HAL.UInt2;
when True =>
-- TECMP as an array
Arr : CPT1BCR_TECMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for CPT1BCR_TECMP_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- Timerx Capture 2 Control Register
type CPT1BCR_Register is record
-- Software Capture
SWCPT : Boolean := False;
-- Update Capture
UDPCPT : Boolean := False;
-- External Event 1 Capture
EXEV1CPT : Boolean := False;
-- External Event 2 Capture
EXEV2CPT : Boolean := False;
-- External Event 3 Capture
EXEV3CPT : Boolean := False;
-- External Event 4 Capture
EXEV4CPT : Boolean := False;
-- External Event 5 Capture
EXEV5CPT : Boolean := False;
-- External Event 6 Capture
EXEV6CPT : Boolean := False;
-- External Event 7 Capture
EXEV7CPT : Boolean := False;
-- External Event 8 Capture
EXEV8CPT : Boolean := False;
-- External Event 9 Capture
EXEV9CPT : Boolean := False;
-- External Event 10 Capture
EXEV10CPT : Boolean := False;
-- Timer A output 1 Set
TA1SET : Boolean := False;
-- Timer A output 1 Reset
TA1RST : Boolean := False;
-- Timer A Compare 1
TACMP : CPT1BCR_TACMP_Field :=
(As_Array => False, Val => 16#0#);
-- unspecified
Reserved_16_19 : HAL.UInt4 := 16#0#;
-- Timer C output 1 Set
TC1SET : Boolean := False;
-- Timer C output 1 Reset
TC1RST : Boolean := False;
-- Timer C Compare 1
TCCMP : CPT1BCR_TCCMP_Field :=
(As_Array => False, Val => 16#0#);
-- Timer D output 1 Set
TD1SET : Boolean := False;
-- Timer D output 1 Reset
TD1RST : Boolean := False;
-- Timer D Compare 1
TDCMP : CPT1BCR_TDCMP_Field :=
(As_Array => False, Val => 16#0#);
-- Timer E output 1 Set
TE1SET : Boolean := False;
-- Timer E output 1 Reset
TE1RST : Boolean := False;
-- Timer E Compare 1
TECMP : CPT1BCR_TECMP_Field :=
(As_Array => False, Val => 16#0#);
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CPT1BCR_Register use record
SWCPT at 0 range 0 .. 0;
UDPCPT at 0 range 1 .. 1;
EXEV1CPT at 0 range 2 .. 2;
EXEV2CPT at 0 range 3 .. 3;
EXEV3CPT at 0 range 4 .. 4;
EXEV4CPT at 0 range 5 .. 5;
EXEV5CPT at 0 range 6 .. 6;
EXEV6CPT at 0 range 7 .. 7;
EXEV7CPT at 0 range 8 .. 8;
EXEV8CPT at 0 range 9 .. 9;
EXEV9CPT at 0 range 10 .. 10;
EXEV10CPT at 0 range 11 .. 11;
TA1SET at 0 range 12 .. 12;
TA1RST at 0 range 13 .. 13;
TACMP at 0 range 14 .. 15;
Reserved_16_19 at 0 range 16 .. 19;
TC1SET at 0 range 20 .. 20;
TC1RST at 0 range 21 .. 21;
TCCMP at 0 range 22 .. 23;
TD1SET at 0 range 24 .. 24;
TD1RST at 0 range 25 .. 25;
TDCMP at 0 range 26 .. 27;
TE1SET at 0 range 28 .. 28;
TE1RST at 0 range 29 .. 29;
TECMP at 0 range 30 .. 31;
end record;
-- CPT2BCR_TACMP array
type CPT2BCR_TACMP_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for CPT2BCR_TACMP
type CPT2BCR_TACMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TACMP as a value
Val : HAL.UInt2;
when True =>
-- TACMP as an array
Arr : CPT2BCR_TACMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for CPT2BCR_TACMP_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- CPT2BCR_TCCMP array
type CPT2BCR_TCCMP_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for CPT2BCR_TCCMP
type CPT2BCR_TCCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TCCMP as a value
Val : HAL.UInt2;
when True =>
-- TCCMP as an array
Arr : CPT2BCR_TCCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for CPT2BCR_TCCMP_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- CPT2BCR_TDCMP array
type CPT2BCR_TDCMP_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for CPT2BCR_TDCMP
type CPT2BCR_TDCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TDCMP as a value
Val : HAL.UInt2;
when True =>
-- TDCMP as an array
Arr : CPT2BCR_TDCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for CPT2BCR_TDCMP_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- CPT2BCR_TECMP array
type CPT2BCR_TECMP_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for CPT2BCR_TECMP
type CPT2BCR_TECMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TECMP as a value
Val : HAL.UInt2;
when True =>
-- TECMP as an array
Arr : CPT2BCR_TECMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for CPT2BCR_TECMP_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- CPT2xCR
type CPT2BCR_Register is record
-- Software Capture
SWCPT : Boolean := False;
-- Update Capture
UDPCPT : Boolean := False;
-- External Event 1 Capture
EXEV1CPT : Boolean := False;
-- External Event 2 Capture
EXEV2CPT : Boolean := False;
-- External Event 3 Capture
EXEV3CPT : Boolean := False;
-- External Event 4 Capture
EXEV4CPT : Boolean := False;
-- External Event 5 Capture
EXEV5CPT : Boolean := False;
-- External Event 6 Capture
EXEV6CPT : Boolean := False;
-- External Event 7 Capture
EXEV7CPT : Boolean := False;
-- External Event 8 Capture
EXEV8CPT : Boolean := False;
-- External Event 9 Capture
EXEV9CPT : Boolean := False;
-- External Event 10 Capture
EXEV10CPT : Boolean := False;
-- Timer A output 1 Set
TA1SET : Boolean := False;
-- Timer A output 1 Reset
TA1RST : Boolean := False;
-- Timer A Compare 1
TACMP : CPT2BCR_TACMP_Field :=
(As_Array => False, Val => 16#0#);
-- unspecified
Reserved_16_19 : HAL.UInt4 := 16#0#;
-- Timer C output 1 Set
TC1SET : Boolean := False;
-- Timer C output 1 Reset
TC1RST : Boolean := False;
-- Timer C Compare 1
TCCMP : CPT2BCR_TCCMP_Field :=
(As_Array => False, Val => 16#0#);
-- Timer D output 1 Set
TD1SET : Boolean := False;
-- Timer D output 1 Reset
TD1RST : Boolean := False;
-- Timer D Compare 1
TDCMP : CPT2BCR_TDCMP_Field :=
(As_Array => False, Val => 16#0#);
-- Timer E output 1 Set
TE1SET : Boolean := False;
-- Timer E output 1 Reset
TE1RST : Boolean := False;
-- Timer E Compare 1
TECMP : CPT2BCR_TECMP_Field :=
(As_Array => False, Val => 16#0#);
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CPT2BCR_Register use record
SWCPT at 0 range 0 .. 0;
UDPCPT at 0 range 1 .. 1;
EXEV1CPT at 0 range 2 .. 2;
EXEV2CPT at 0 range 3 .. 3;
EXEV3CPT at 0 range 4 .. 4;
EXEV4CPT at 0 range 5 .. 5;
EXEV5CPT at 0 range 6 .. 6;
EXEV6CPT at 0 range 7 .. 7;
EXEV7CPT at 0 range 8 .. 8;
EXEV8CPT at 0 range 9 .. 9;
EXEV9CPT at 0 range 10 .. 10;
EXEV10CPT at 0 range 11 .. 11;
TA1SET at 0 range 12 .. 12;
TA1RST at 0 range 13 .. 13;
TACMP at 0 range 14 .. 15;
Reserved_16_19 at 0 range 16 .. 19;
TC1SET at 0 range 20 .. 20;
TC1RST at 0 range 21 .. 21;
TCCMP at 0 range 22 .. 23;
TD1SET at 0 range 24 .. 24;
TD1RST at 0 range 25 .. 25;
TDCMP at 0 range 26 .. 27;
TE1SET at 0 range 28 .. 28;
TE1RST at 0 range 29 .. 29;
TECMP at 0 range 30 .. 31;
end record;
subtype OUTBR_FAULT1_Field is HAL.UInt2;
subtype OUTBR_DLYPRT_Field is HAL.UInt3;
subtype OUTBR_FAULT2_Field is HAL.UInt2;
-- Timerx Output Register
type OUTBR_Register is record
-- unspecified
Reserved_0_0 : HAL.Bit := 16#0#;
-- Output 1 polarity
POL1 : Boolean := False;
-- Output 1 Idle mode
IDLEM1 : Boolean := False;
-- Output 1 Idle State
IDLES1 : Boolean := False;
-- Output 1 Fault state
FAULT1 : OUTBR_FAULT1_Field := 16#0#;
-- Output 1 Chopper enable
CHP1 : Boolean := False;
-- Output 1 Deadtime upon burst mode Idle entry
DIDL1 : Boolean := False;
-- Deadtime enable
DTEN : Boolean := False;
-- Delayed Protection Enable
DLYPRTEN : Boolean := False;
-- Delayed Protection
DLYPRT : OUTBR_DLYPRT_Field := 16#0#;
-- unspecified
Reserved_13_16 : HAL.UInt4 := 16#0#;
-- Output 2 polarity
POL2 : Boolean := False;
-- Output 2 Idle mode
IDLEM2 : Boolean := False;
-- Output 2 Idle State
IDLES2 : Boolean := False;
-- Output 2 Fault state
FAULT2 : OUTBR_FAULT2_Field := 16#0#;
-- Output 2 Chopper enable
CHP2 : Boolean := False;
-- Output 2 Deadtime upon burst mode Idle entry
DIDL2 : Boolean := False;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for OUTBR_Register use record
Reserved_0_0 at 0 range 0 .. 0;
POL1 at 0 range 1 .. 1;
IDLEM1 at 0 range 2 .. 2;
IDLES1 at 0 range 3 .. 3;
FAULT1 at 0 range 4 .. 5;
CHP1 at 0 range 6 .. 6;
DIDL1 at 0 range 7 .. 7;
DTEN at 0 range 8 .. 8;
DLYPRTEN at 0 range 9 .. 9;
DLYPRT at 0 range 10 .. 12;
Reserved_13_16 at 0 range 13 .. 16;
POL2 at 0 range 17 .. 17;
IDLEM2 at 0 range 18 .. 18;
IDLES2 at 0 range 19 .. 19;
FAULT2 at 0 range 20 .. 21;
CHP2 at 0 range 22 .. 22;
DIDL2 at 0 range 23 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
-- Timerx Fault Register
type FLTBR_Register is record
-- Fault 1 enable
FLT1EN : Boolean := False;
-- Fault 2 enable
FLT2EN : Boolean := False;
-- Fault 3 enable
FLT3EN : Boolean := False;
-- Fault 4 enable
FLT4EN : Boolean := False;
-- Fault 5 enable
FLT5EN : Boolean := False;
-- unspecified
Reserved_5_30 : HAL.UInt26 := 16#0#;
-- Fault sources Lock
FLTLCK : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for FLTBR_Register use record
FLT1EN at 0 range 0 .. 0;
FLT2EN at 0 range 1 .. 1;
FLT3EN at 0 range 2 .. 2;
FLT4EN at 0 range 3 .. 3;
FLT5EN at 0 range 4 .. 4;
Reserved_5_30 at 0 range 5 .. 30;
FLTLCK at 0 range 31 .. 31;
end record;
subtype TIMCCR_CKPSCx_Field is HAL.UInt3;
-- TIMCCR_DELCMP array element
subtype TIMCCR_DELCMP_Element is HAL.UInt2;
-- TIMCCR_DELCMP array
type TIMCCR_DELCMP_Field_Array is array (2 .. 3) of TIMCCR_DELCMP_Element
with Component_Size => 2, Size => 4;
-- Type definition for TIMCCR_DELCMP
type TIMCCR_DELCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- DELCMP as a value
Val : HAL.UInt4;
when True =>
-- DELCMP as an array
Arr : TIMCCR_DELCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for TIMCCR_DELCMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
subtype TIMCCR_DACSYNC_Field is HAL.UInt2;
subtype TIMCCR_UPDGAT_Field is HAL.UInt4;
-- Timerx Control Register
type TIMCCR_Register is record
-- HRTIM Timer x Clock prescaler
CKPSCx : TIMCCR_CKPSCx_Field := 16#0#;
-- Continuous mode
CONT : Boolean := False;
-- Re-triggerable mode
RETRIG : Boolean := False;
-- Half mode enable
HALF : Boolean := False;
-- Push-Pull mode enable
PSHPLL : Boolean := False;
-- unspecified
Reserved_7_9 : HAL.UInt3 := 16#0#;
-- Synchronization Resets Timer x
SYNCRSTx : Boolean := False;
-- Synchronization Starts Timer x
SYNCSTRTx : Boolean := False;
-- Delayed CMP2 mode
DELCMP : TIMCCR_DELCMP_Field :=
(As_Array => False, Val => 16#0#);
-- unspecified
Reserved_16_16 : HAL.Bit := 16#0#;
-- Timer x Repetition update
TxREPU : Boolean := False;
-- Timerx reset update
TxRSTU : Boolean := False;
-- unspecified
Reserved_19_19 : HAL.Bit := 16#0#;
-- TBU
TBU : Boolean := False;
-- TCU
TCU : Boolean := False;
-- TDU
TDU : Boolean := False;
-- TEU
TEU : Boolean := False;
-- Master Timer update
MSTU : Boolean := False;
-- AC Synchronization
DACSYNC : TIMCCR_DACSYNC_Field := 16#0#;
-- Preload enable
PREEN : Boolean := False;
-- Update Gating
UPDGAT : TIMCCR_UPDGAT_Field := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TIMCCR_Register use record
CKPSCx at 0 range 0 .. 2;
CONT at 0 range 3 .. 3;
RETRIG at 0 range 4 .. 4;
HALF at 0 range 5 .. 5;
PSHPLL at 0 range 6 .. 6;
Reserved_7_9 at 0 range 7 .. 9;
SYNCRSTx at 0 range 10 .. 10;
SYNCSTRTx at 0 range 11 .. 11;
DELCMP at 0 range 12 .. 15;
Reserved_16_16 at 0 range 16 .. 16;
TxREPU at 0 range 17 .. 17;
TxRSTU at 0 range 18 .. 18;
Reserved_19_19 at 0 range 19 .. 19;
TBU at 0 range 20 .. 20;
TCU at 0 range 21 .. 21;
TDU at 0 range 22 .. 22;
TEU at 0 range 23 .. 23;
MSTU at 0 range 24 .. 24;
DACSYNC at 0 range 25 .. 26;
PREEN at 0 range 27 .. 27;
UPDGAT at 0 range 28 .. 31;
end record;
-- TIMCISR_CMP array
type TIMCISR_CMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for TIMCISR_CMP
type TIMCISR_CMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- CMP as a value
Val : HAL.UInt4;
when True =>
-- CMP as an array
Arr : TIMCISR_CMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for TIMCISR_CMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- TIMCISR_CPT array
type TIMCISR_CPT_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for TIMCISR_CPT
type TIMCISR_CPT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- CPT as a value
Val : HAL.UInt2;
when True =>
-- CPT as an array
Arr : TIMCISR_CPT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for TIMCISR_CPT_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- Timerx Interrupt Status Register
type TIMCISR_Register is record
-- Read-only. Compare 1 Interrupt Flag
CMP : TIMCISR_CMP_Field;
-- Read-only. Repetition Interrupt Flag
REP : Boolean;
-- unspecified
Reserved_5_5 : HAL.Bit;
-- Read-only. Update Interrupt Flag
UPD : Boolean;
-- Read-only. Capture1 Interrupt Flag
CPT : TIMCISR_CPT_Field;
-- Read-only. Output 1 Set Interrupt Flag
SETx1 : Boolean;
-- Read-only. Output 1 Reset Interrupt Flag
RSTx1 : Boolean;
-- Read-only. Output 2 Set Interrupt Flag
SETx2 : Boolean;
-- Read-only. Output 2 Reset Interrupt Flag
RSTx2 : Boolean;
-- Read-only. Reset Interrupt Flag
RST : Boolean;
-- Read-only. Delayed Protection Flag
DLYPRT : Boolean;
-- unspecified
Reserved_15_15 : HAL.Bit;
-- Read-only. Current Push Pull Status
CPPSTAT : Boolean;
-- Read-only. Idle Push Pull Status
IPPSTAT : Boolean;
-- Read-only. Output 1 State
O1STAT : Boolean;
-- Read-only. Output 2 State
O2STAT : Boolean;
-- unspecified
Reserved_20_31 : HAL.UInt12;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TIMCISR_Register use record
CMP at 0 range 0 .. 3;
REP at 0 range 4 .. 4;
Reserved_5_5 at 0 range 5 .. 5;
UPD at 0 range 6 .. 6;
CPT at 0 range 7 .. 8;
SETx1 at 0 range 9 .. 9;
RSTx1 at 0 range 10 .. 10;
SETx2 at 0 range 11 .. 11;
RSTx2 at 0 range 12 .. 12;
RST at 0 range 13 .. 13;
DLYPRT at 0 range 14 .. 14;
Reserved_15_15 at 0 range 15 .. 15;
CPPSTAT at 0 range 16 .. 16;
IPPSTAT at 0 range 17 .. 17;
O1STAT at 0 range 18 .. 18;
O2STAT at 0 range 19 .. 19;
Reserved_20_31 at 0 range 20 .. 31;
end record;
-- Timerx Interrupt Clear Register
type TIMCICR_Register is record
-- Write-only. Compare 1 Interrupt flag Clear
CMP1C : Boolean := False;
-- Write-only. Compare 2 Interrupt flag Clear
CMP2C : Boolean := False;
-- Write-only. Compare 3 Interrupt flag Clear
CMP3C : Boolean := False;
-- Write-only. Compare 4 Interrupt flag Clear
CMP4C : Boolean := False;
-- Write-only. Repetition Interrupt flag Clear
REPC : Boolean := False;
-- unspecified
Reserved_5_5 : HAL.Bit := 16#0#;
-- Write-only. Update Interrupt flag Clear
UPDC : Boolean := False;
-- Write-only. Capture1 Interrupt flag Clear
CPT1C : Boolean := False;
-- Write-only. Capture2 Interrupt flag Clear
CPT2C : Boolean := False;
-- Write-only. Output 1 Set flag Clear
SET1xC : Boolean := False;
-- Write-only. Output 1 Reset flag Clear
RSTx1C : Boolean := False;
-- Write-only. Output 2 Set flag Clear
SET2xC : Boolean := False;
-- Write-only. Output 2 Reset flag Clear
RSTx2C : Boolean := False;
-- Write-only. Reset Interrupt flag Clear
RSTC : Boolean := False;
-- Write-only. Delayed Protection Flag Clear
DLYPRTC : Boolean := False;
-- unspecified
Reserved_15_31 : HAL.UInt17 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TIMCICR_Register use record
CMP1C at 0 range 0 .. 0;
CMP2C at 0 range 1 .. 1;
CMP3C at 0 range 2 .. 2;
CMP4C at 0 range 3 .. 3;
REPC at 0 range 4 .. 4;
Reserved_5_5 at 0 range 5 .. 5;
UPDC at 0 range 6 .. 6;
CPT1C at 0 range 7 .. 7;
CPT2C at 0 range 8 .. 8;
SET1xC at 0 range 9 .. 9;
RSTx1C at 0 range 10 .. 10;
SET2xC at 0 range 11 .. 11;
RSTx2C at 0 range 12 .. 12;
RSTC at 0 range 13 .. 13;
DLYPRTC at 0 range 14 .. 14;
Reserved_15_31 at 0 range 15 .. 31;
end record;
-- TIMxDIER
type TIMCDIER_Register is record
-- CMP1IE
CMP1IE : Boolean := False;
-- CMP2IE
CMP2IE : Boolean := False;
-- CMP3IE
CMP3IE : Boolean := False;
-- CMP4IE
CMP4IE : Boolean := False;
-- REPIE
REPIE : Boolean := False;
-- unspecified
Reserved_5_5 : HAL.Bit := 16#0#;
-- UPDIE
UPDIE : Boolean := False;
-- CPT1IE
CPT1IE : Boolean := False;
-- CPT2IE
CPT2IE : Boolean := False;
-- SET1xIE
SET1xIE : Boolean := False;
-- RSTx1IE
RSTx1IE : Boolean := False;
-- SETx2IE
SETx2IE : Boolean := False;
-- RSTx2IE
RSTx2IE : Boolean := False;
-- RSTIE
RSTIE : Boolean := False;
-- DLYPRTIE
DLYPRTIE : Boolean := False;
-- unspecified
Reserved_15_15 : HAL.Bit := 16#0#;
-- CMP1DE
CMP1DE : Boolean := False;
-- CMP2DE
CMP2DE : Boolean := False;
-- CMP3DE
CMP3DE : Boolean := False;
-- CMP4DE
CMP4DE : Boolean := False;
-- REPDE
REPDE : Boolean := False;
-- unspecified
Reserved_21_21 : HAL.Bit := 16#0#;
-- UPDDE
UPDDE : Boolean := False;
-- CPT1DE
CPT1DE : Boolean := False;
-- CPT2DE
CPT2DE : Boolean := False;
-- SET1xDE
SET1xDE : Boolean := False;
-- RSTx1DE
RSTx1DE : Boolean := False;
-- SETx2DE
SETx2DE : Boolean := False;
-- RSTx2DE
RSTx2DE : Boolean := False;
-- RSTDE
RSTDE : Boolean := False;
-- DLYPRTDE
DLYPRTDE : Boolean := False;
-- unspecified
Reserved_31_31 : HAL.Bit := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TIMCDIER_Register use record
CMP1IE at 0 range 0 .. 0;
CMP2IE at 0 range 1 .. 1;
CMP3IE at 0 range 2 .. 2;
CMP4IE at 0 range 3 .. 3;
REPIE at 0 range 4 .. 4;
Reserved_5_5 at 0 range 5 .. 5;
UPDIE at 0 range 6 .. 6;
CPT1IE at 0 range 7 .. 7;
CPT2IE at 0 range 8 .. 8;
SET1xIE at 0 range 9 .. 9;
RSTx1IE at 0 range 10 .. 10;
SETx2IE at 0 range 11 .. 11;
RSTx2IE at 0 range 12 .. 12;
RSTIE at 0 range 13 .. 13;
DLYPRTIE at 0 range 14 .. 14;
Reserved_15_15 at 0 range 15 .. 15;
CMP1DE at 0 range 16 .. 16;
CMP2DE at 0 range 17 .. 17;
CMP3DE at 0 range 18 .. 18;
CMP4DE at 0 range 19 .. 19;
REPDE at 0 range 20 .. 20;
Reserved_21_21 at 0 range 21 .. 21;
UPDDE at 0 range 22 .. 22;
CPT1DE at 0 range 23 .. 23;
CPT2DE at 0 range 24 .. 24;
SET1xDE at 0 range 25 .. 25;
RSTx1DE at 0 range 26 .. 26;
SETx2DE at 0 range 27 .. 27;
RSTx2DE at 0 range 28 .. 28;
RSTDE at 0 range 29 .. 29;
DLYPRTDE at 0 range 30 .. 30;
Reserved_31_31 at 0 range 31 .. 31;
end record;
subtype CNTCR_CNTx_Field is HAL.UInt16;
-- Timerx Counter Register
type CNTCR_Register is record
-- Timerx Counter value
CNTx : CNTCR_CNTx_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CNTCR_Register use record
CNTx at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype PERCR_PERx_Field is HAL.UInt16;
-- Timerx Period Register
type PERCR_Register is record
-- Timerx Period value
PERx : PERCR_PERx_Field := 16#FFFF#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for PERCR_Register use record
PERx at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype REPCR_REPx_Field is HAL.UInt8;
-- Timerx Repetition Register
type REPCR_Register is record
-- Timerx Repetition counter value
REPx : REPCR_REPx_Field := 16#0#;
-- unspecified
Reserved_8_31 : HAL.UInt24 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for REPCR_Register use record
REPx at 0 range 0 .. 7;
Reserved_8_31 at 0 range 8 .. 31;
end record;
subtype CMP1CR_CMP1x_Field is HAL.UInt16;
-- Timerx Compare 1 Register
type CMP1CR_Register is record
-- Timerx Compare 1 value
CMP1x : CMP1CR_CMP1x_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CMP1CR_Register use record
CMP1x at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype CMP1CCR_CMP1x_Field is HAL.UInt16;
subtype CMP1CCR_REPx_Field is HAL.UInt8;
-- Timerx Compare 1 Compound Register
type CMP1CCR_Register is record
-- Timerx Compare 1 value
CMP1x : CMP1CCR_CMP1x_Field := 16#0#;
-- Timerx Repetition value (aliased from HRTIM_REPx register)
REPx : CMP1CCR_REPx_Field := 16#0#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CMP1CCR_Register use record
CMP1x at 0 range 0 .. 15;
REPx at 0 range 16 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
subtype CMP2CR_CMP2x_Field is HAL.UInt16;
-- Timerx Compare 2 Register
type CMP2CR_Register is record
-- Timerx Compare 2 value
CMP2x : CMP2CR_CMP2x_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CMP2CR_Register use record
CMP2x at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype CMP3CR_CMP3x_Field is HAL.UInt16;
-- Timerx Compare 3 Register
type CMP3CR_Register is record
-- Timerx Compare 3 value
CMP3x : CMP3CR_CMP3x_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CMP3CR_Register use record
CMP3x at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype CMP4CR_CMP4x_Field is HAL.UInt16;
-- Timerx Compare 4 Register
type CMP4CR_Register is record
-- Timerx Compare 4 value
CMP4x : CMP4CR_CMP4x_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CMP4CR_Register use record
CMP4x at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype CPT1CR_CPT1x_Field is HAL.UInt16;
-- Timerx Capture 1 Register
type CPT1CR_Register is record
-- Read-only. Timerx Capture 1 value
CPT1x : CPT1CR_CPT1x_Field;
-- unspecified
Reserved_16_31 : HAL.UInt16;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CPT1CR_Register use record
CPT1x at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype CPT2CR_CPT2x_Field is HAL.UInt16;
-- Timerx Capture 2 Register
type CPT2CR_Register is record
-- Read-only. Timerx Capture 2 value
CPT2x : CPT2CR_CPT2x_Field;
-- unspecified
Reserved_16_31 : HAL.UInt16;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CPT2CR_Register use record
CPT2x at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype DTCR_DTRx_Field is HAL.UInt9;
subtype DTCR_DTPRSC_Field is HAL.UInt3;
subtype DTCR_DTFx_Field is HAL.UInt9;
-- Timerx Deadtime Register
type DTCR_Register is record
-- Deadtime Rising value
DTRx : DTCR_DTRx_Field := 16#0#;
-- Sign Deadtime Rising value
SDTRx : Boolean := False;
-- Deadtime Prescaler
DTPRSC : DTCR_DTPRSC_Field := 16#0#;
-- unspecified
Reserved_13_13 : HAL.Bit := 16#0#;
-- Deadtime Rising Sign Lock
DTRSLKx : Boolean := False;
-- Deadtime Rising Lock
DTRLKx : Boolean := False;
-- Deadtime Falling value
DTFx : DTCR_DTFx_Field := 16#0#;
-- Sign Deadtime Falling value
SDTFx : Boolean := False;
-- unspecified
Reserved_26_29 : HAL.UInt4 := 16#0#;
-- Deadtime Falling Sign Lock
DTFSLKx : Boolean := False;
-- Deadtime Falling Lock
DTFLKx : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for DTCR_Register use record
DTRx at 0 range 0 .. 8;
SDTRx at 0 range 9 .. 9;
DTPRSC at 0 range 10 .. 12;
Reserved_13_13 at 0 range 13 .. 13;
DTRSLKx at 0 range 14 .. 14;
DTRLKx at 0 range 15 .. 15;
DTFx at 0 range 16 .. 24;
SDTFx at 0 range 25 .. 25;
Reserved_26_29 at 0 range 26 .. 29;
DTFSLKx at 0 range 30 .. 30;
DTFLKx at 0 range 31 .. 31;
end record;
-- SETC1R_CMP array
type SETC1R_CMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for SETC1R_CMP
type SETC1R_CMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- CMP as a value
Val : HAL.UInt4;
when True =>
-- CMP as an array
Arr : SETC1R_CMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for SETC1R_CMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- SETC1R_MSTCMP array
type SETC1R_MSTCMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for SETC1R_MSTCMP
type SETC1R_MSTCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MSTCMP as a value
Val : HAL.UInt4;
when True =>
-- MSTCMP as an array
Arr : SETC1R_MSTCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for SETC1R_MSTCMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- SETC1R_TIMEVNT array
type SETC1R_TIMEVNT_Field_Array is array (1 .. 9) of Boolean
with Component_Size => 1, Size => 9;
-- Type definition for SETC1R_TIMEVNT
type SETC1R_TIMEVNT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TIMEVNT as a value
Val : HAL.UInt9;
when True =>
-- TIMEVNT as an array
Arr : SETC1R_TIMEVNT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 9;
for SETC1R_TIMEVNT_Field use record
Val at 0 range 0 .. 8;
Arr at 0 range 0 .. 8;
end record;
-- SETC1R_EXTEVNT array
type SETC1R_EXTEVNT_Field_Array is array (1 .. 10) of Boolean
with Component_Size => 1, Size => 10;
-- Type definition for SETC1R_EXTEVNT
type SETC1R_EXTEVNT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- EXTEVNT as a value
Val : HAL.UInt10;
when True =>
-- EXTEVNT as an array
Arr : SETC1R_EXTEVNT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 10;
for SETC1R_EXTEVNT_Field use record
Val at 0 range 0 .. 9;
Arr at 0 range 0 .. 9;
end record;
-- Timerx Output1 Set Register
type SETC1R_Register is record
-- Software Set trigger
SST : Boolean := False;
-- Timer A resynchronizaton
RESYNC : Boolean := False;
-- Timer A Period
PER : Boolean := False;
-- Timer A compare 1
CMP : SETC1R_CMP_Field := (As_Array => False, Val => 16#0#);
-- Master Period
MSTPER : Boolean := False;
-- Master Compare 1
MSTCMP : SETC1R_MSTCMP_Field := (As_Array => False, Val => 16#0#);
-- Timer Event 1
TIMEVNT : SETC1R_TIMEVNT_Field := (As_Array => False, Val => 16#0#);
-- External Event 1
EXTEVNT : SETC1R_EXTEVNT_Field := (As_Array => False, Val => 16#0#);
-- Registers update (transfer preload to active)
UPDATE : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for SETC1R_Register use record
SST at 0 range 0 .. 0;
RESYNC at 0 range 1 .. 1;
PER at 0 range 2 .. 2;
CMP at 0 range 3 .. 6;
MSTPER at 0 range 7 .. 7;
MSTCMP at 0 range 8 .. 11;
TIMEVNT at 0 range 12 .. 20;
EXTEVNT at 0 range 21 .. 30;
UPDATE at 0 range 31 .. 31;
end record;
-- RSTC1R_CMP array
type RSTC1R_CMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for RSTC1R_CMP
type RSTC1R_CMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- CMP as a value
Val : HAL.UInt4;
when True =>
-- CMP as an array
Arr : RSTC1R_CMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for RSTC1R_CMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- RSTC1R_MSTCMP array
type RSTC1R_MSTCMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for RSTC1R_MSTCMP
type RSTC1R_MSTCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MSTCMP as a value
Val : HAL.UInt4;
when True =>
-- MSTCMP as an array
Arr : RSTC1R_MSTCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for RSTC1R_MSTCMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- RSTC1R_TIMEVNT array
type RSTC1R_TIMEVNT_Field_Array is array (1 .. 9) of Boolean
with Component_Size => 1, Size => 9;
-- Type definition for RSTC1R_TIMEVNT
type RSTC1R_TIMEVNT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TIMEVNT as a value
Val : HAL.UInt9;
when True =>
-- TIMEVNT as an array
Arr : RSTC1R_TIMEVNT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 9;
for RSTC1R_TIMEVNT_Field use record
Val at 0 range 0 .. 8;
Arr at 0 range 0 .. 8;
end record;
-- RSTC1R_EXTEVNT array
type RSTC1R_EXTEVNT_Field_Array is array (1 .. 10) of Boolean
with Component_Size => 1, Size => 10;
-- Type definition for RSTC1R_EXTEVNT
type RSTC1R_EXTEVNT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- EXTEVNT as a value
Val : HAL.UInt10;
when True =>
-- EXTEVNT as an array
Arr : RSTC1R_EXTEVNT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 10;
for RSTC1R_EXTEVNT_Field use record
Val at 0 range 0 .. 9;
Arr at 0 range 0 .. 9;
end record;
-- Timerx Output1 Reset Register
type RSTC1R_Register is record
-- SRT
SRT : Boolean := False;
-- RESYNC
RESYNC : Boolean := False;
-- PER
PER : Boolean := False;
-- CMP1
CMP : RSTC1R_CMP_Field := (As_Array => False, Val => 16#0#);
-- MSTPER
MSTPER : Boolean := False;
-- MSTCMP1
MSTCMP : RSTC1R_MSTCMP_Field := (As_Array => False, Val => 16#0#);
-- TIMEVNT1
TIMEVNT : RSTC1R_TIMEVNT_Field := (As_Array => False, Val => 16#0#);
-- EXTEVNT1
EXTEVNT : RSTC1R_EXTEVNT_Field := (As_Array => False, Val => 16#0#);
-- UPDATE
UPDATE : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for RSTC1R_Register use record
SRT at 0 range 0 .. 0;
RESYNC at 0 range 1 .. 1;
PER at 0 range 2 .. 2;
CMP at 0 range 3 .. 6;
MSTPER at 0 range 7 .. 7;
MSTCMP at 0 range 8 .. 11;
TIMEVNT at 0 range 12 .. 20;
EXTEVNT at 0 range 21 .. 30;
UPDATE at 0 range 31 .. 31;
end record;
-- SETC2R_CMP array
type SETC2R_CMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for SETC2R_CMP
type SETC2R_CMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- CMP as a value
Val : HAL.UInt4;
when True =>
-- CMP as an array
Arr : SETC2R_CMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for SETC2R_CMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- SETC2R_MSTCMP array
type SETC2R_MSTCMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for SETC2R_MSTCMP
type SETC2R_MSTCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MSTCMP as a value
Val : HAL.UInt4;
when True =>
-- MSTCMP as an array
Arr : SETC2R_MSTCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for SETC2R_MSTCMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- SETC2R_TIMEVNT array
type SETC2R_TIMEVNT_Field_Array is array (1 .. 9) of Boolean
with Component_Size => 1, Size => 9;
-- Type definition for SETC2R_TIMEVNT
type SETC2R_TIMEVNT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TIMEVNT as a value
Val : HAL.UInt9;
when True =>
-- TIMEVNT as an array
Arr : SETC2R_TIMEVNT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 9;
for SETC2R_TIMEVNT_Field use record
Val at 0 range 0 .. 8;
Arr at 0 range 0 .. 8;
end record;
-- SETC2R_EXTEVNT array
type SETC2R_EXTEVNT_Field_Array is array (1 .. 10) of Boolean
with Component_Size => 1, Size => 10;
-- Type definition for SETC2R_EXTEVNT
type SETC2R_EXTEVNT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- EXTEVNT as a value
Val : HAL.UInt10;
when True =>
-- EXTEVNT as an array
Arr : SETC2R_EXTEVNT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 10;
for SETC2R_EXTEVNT_Field use record
Val at 0 range 0 .. 9;
Arr at 0 range 0 .. 9;
end record;
-- Timerx Output2 Set Register
type SETC2R_Register is record
-- SST
SST : Boolean := False;
-- RESYNC
RESYNC : Boolean := False;
-- PER
PER : Boolean := False;
-- CMP1
CMP : SETC2R_CMP_Field := (As_Array => False, Val => 16#0#);
-- MSTPER
MSTPER : Boolean := False;
-- MSTCMP1
MSTCMP : SETC2R_MSTCMP_Field := (As_Array => False, Val => 16#0#);
-- TIMEVNT1
TIMEVNT : SETC2R_TIMEVNT_Field := (As_Array => False, Val => 16#0#);
-- EXTEVNT1
EXTEVNT : SETC2R_EXTEVNT_Field := (As_Array => False, Val => 16#0#);
-- UPDATE
UPDATE : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for SETC2R_Register use record
SST at 0 range 0 .. 0;
RESYNC at 0 range 1 .. 1;
PER at 0 range 2 .. 2;
CMP at 0 range 3 .. 6;
MSTPER at 0 range 7 .. 7;
MSTCMP at 0 range 8 .. 11;
TIMEVNT at 0 range 12 .. 20;
EXTEVNT at 0 range 21 .. 30;
UPDATE at 0 range 31 .. 31;
end record;
-- RSTC2R_CMP array
type RSTC2R_CMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for RSTC2R_CMP
type RSTC2R_CMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- CMP as a value
Val : HAL.UInt4;
when True =>
-- CMP as an array
Arr : RSTC2R_CMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for RSTC2R_CMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- RSTC2R_MSTCMP array
type RSTC2R_MSTCMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for RSTC2R_MSTCMP
type RSTC2R_MSTCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MSTCMP as a value
Val : HAL.UInt4;
when True =>
-- MSTCMP as an array
Arr : RSTC2R_MSTCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for RSTC2R_MSTCMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- RSTC2R_TIMEVNT array
type RSTC2R_TIMEVNT_Field_Array is array (1 .. 9) of Boolean
with Component_Size => 1, Size => 9;
-- Type definition for RSTC2R_TIMEVNT
type RSTC2R_TIMEVNT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TIMEVNT as a value
Val : HAL.UInt9;
when True =>
-- TIMEVNT as an array
Arr : RSTC2R_TIMEVNT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 9;
for RSTC2R_TIMEVNT_Field use record
Val at 0 range 0 .. 8;
Arr at 0 range 0 .. 8;
end record;
-- RSTC2R_EXTEVNT array
type RSTC2R_EXTEVNT_Field_Array is array (1 .. 10) of Boolean
with Component_Size => 1, Size => 10;
-- Type definition for RSTC2R_EXTEVNT
type RSTC2R_EXTEVNT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- EXTEVNT as a value
Val : HAL.UInt10;
when True =>
-- EXTEVNT as an array
Arr : RSTC2R_EXTEVNT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 10;
for RSTC2R_EXTEVNT_Field use record
Val at 0 range 0 .. 9;
Arr at 0 range 0 .. 9;
end record;
-- Timerx Output2 Reset Register
type RSTC2R_Register is record
-- SRT
SRT : Boolean := False;
-- RESYNC
RESYNC : Boolean := False;
-- PER
PER : Boolean := False;
-- CMP1
CMP : RSTC2R_CMP_Field := (As_Array => False, Val => 16#0#);
-- MSTPER
MSTPER : Boolean := False;
-- MSTCMP1
MSTCMP : RSTC2R_MSTCMP_Field := (As_Array => False, Val => 16#0#);
-- TIMEVNT1
TIMEVNT : RSTC2R_TIMEVNT_Field := (As_Array => False, Val => 16#0#);
-- EXTEVNT1
EXTEVNT : RSTC2R_EXTEVNT_Field := (As_Array => False, Val => 16#0#);
-- UPDATE
UPDATE : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for RSTC2R_Register use record
SRT at 0 range 0 .. 0;
RESYNC at 0 range 1 .. 1;
PER at 0 range 2 .. 2;
CMP at 0 range 3 .. 6;
MSTPER at 0 range 7 .. 7;
MSTCMP at 0 range 8 .. 11;
TIMEVNT at 0 range 12 .. 20;
EXTEVNT at 0 range 21 .. 30;
UPDATE at 0 range 31 .. 31;
end record;
subtype EEFCR1_EE1FLTR_Field is HAL.UInt4;
subtype EEFCR1_EE2FLTR_Field is HAL.UInt4;
subtype EEFCR1_EE3FLTR_Field is HAL.UInt4;
subtype EEFCR1_EE4FLTR_Field is HAL.UInt4;
subtype EEFCR1_EE5FLTR_Field is HAL.UInt4;
-- Timerx External Event Filtering Register 1
type EEFCR1_Register is record
-- External Event 1 latch
EE1LTCH : Boolean := False;
-- External Event 1 filter
EE1FLTR : EEFCR1_EE1FLTR_Field := 16#0#;
-- unspecified
Reserved_5_5 : HAL.Bit := 16#0#;
-- External Event 2 latch
EE2LTCH : Boolean := False;
-- External Event 2 filter
EE2FLTR : EEFCR1_EE2FLTR_Field := 16#0#;
-- unspecified
Reserved_11_11 : HAL.Bit := 16#0#;
-- External Event 3 latch
EE3LTCH : Boolean := False;
-- External Event 3 filter
EE3FLTR : EEFCR1_EE3FLTR_Field := 16#0#;
-- unspecified
Reserved_17_17 : HAL.Bit := 16#0#;
-- External Event 4 latch
EE4LTCH : Boolean := False;
-- External Event 4 filter
EE4FLTR : EEFCR1_EE4FLTR_Field := 16#0#;
-- unspecified
Reserved_23_23 : HAL.Bit := 16#0#;
-- External Event 5 latch
EE5LTCH : Boolean := False;
-- External Event 5 filter
EE5FLTR : EEFCR1_EE5FLTR_Field := 16#0#;
-- unspecified
Reserved_29_31 : HAL.UInt3 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for EEFCR1_Register use record
EE1LTCH at 0 range 0 .. 0;
EE1FLTR at 0 range 1 .. 4;
Reserved_5_5 at 0 range 5 .. 5;
EE2LTCH at 0 range 6 .. 6;
EE2FLTR at 0 range 7 .. 10;
Reserved_11_11 at 0 range 11 .. 11;
EE3LTCH at 0 range 12 .. 12;
EE3FLTR at 0 range 13 .. 16;
Reserved_17_17 at 0 range 17 .. 17;
EE4LTCH at 0 range 18 .. 18;
EE4FLTR at 0 range 19 .. 22;
Reserved_23_23 at 0 range 23 .. 23;
EE5LTCH at 0 range 24 .. 24;
EE5FLTR at 0 range 25 .. 28;
Reserved_29_31 at 0 range 29 .. 31;
end record;
subtype EEFCR2_EE6FLTR_Field is HAL.UInt4;
subtype EEFCR2_EE7FLTR_Field is HAL.UInt4;
subtype EEFCR2_EE8FLTR_Field is HAL.UInt4;
subtype EEFCR2_EE9FLTR_Field is HAL.UInt4;
subtype EEFCR2_EE10FLTR_Field is HAL.UInt4;
-- Timerx External Event Filtering Register 2
type EEFCR2_Register is record
-- External Event 6 latch
EE6LTCH : Boolean := False;
-- External Event 6 filter
EE6FLTR : EEFCR2_EE6FLTR_Field := 16#0#;
-- unspecified
Reserved_5_5 : HAL.Bit := 16#0#;
-- External Event 7 latch
EE7LTCH : Boolean := False;
-- External Event 7 filter
EE7FLTR : EEFCR2_EE7FLTR_Field := 16#0#;
-- unspecified
Reserved_11_11 : HAL.Bit := 16#0#;
-- External Event 8 latch
EE8LTCH : Boolean := False;
-- External Event 8 filter
EE8FLTR : EEFCR2_EE8FLTR_Field := 16#0#;
-- unspecified
Reserved_17_17 : HAL.Bit := 16#0#;
-- External Event 9 latch
EE9LTCH : Boolean := False;
-- External Event 9 filter
EE9FLTR : EEFCR2_EE9FLTR_Field := 16#0#;
-- unspecified
Reserved_23_23 : HAL.Bit := 16#0#;
-- External Event 10 latch
EE10LTCH : Boolean := False;
-- External Event 10 filter
EE10FLTR : EEFCR2_EE10FLTR_Field := 16#0#;
-- unspecified
Reserved_29_31 : HAL.UInt3 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for EEFCR2_Register use record
EE6LTCH at 0 range 0 .. 0;
EE6FLTR at 0 range 1 .. 4;
Reserved_5_5 at 0 range 5 .. 5;
EE7LTCH at 0 range 6 .. 6;
EE7FLTR at 0 range 7 .. 10;
Reserved_11_11 at 0 range 11 .. 11;
EE8LTCH at 0 range 12 .. 12;
EE8FLTR at 0 range 13 .. 16;
Reserved_17_17 at 0 range 17 .. 17;
EE9LTCH at 0 range 18 .. 18;
EE9FLTR at 0 range 19 .. 22;
Reserved_23_23 at 0 range 23 .. 23;
EE10LTCH at 0 range 24 .. 24;
EE10FLTR at 0 range 25 .. 28;
Reserved_29_31 at 0 range 29 .. 31;
end record;
-- RSTCR_CMP array
type RSTCR_CMP_Field_Array is array (2 .. 3) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for RSTCR_CMP
type RSTCR_CMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- CMP as a value
Val : HAL.UInt2;
when True =>
-- CMP as an array
Arr : RSTCR_CMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for RSTCR_CMP_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- RSTCR_MSTCMP array
type RSTCR_MSTCMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for RSTCR_MSTCMP
type RSTCR_MSTCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MSTCMP as a value
Val : HAL.UInt4;
when True =>
-- MSTCMP as an array
Arr : RSTCR_MSTCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for RSTCR_MSTCMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- RSTCR_EXTEVNT array
type RSTCR_EXTEVNT_Field_Array is array (1 .. 10) of Boolean
with Component_Size => 1, Size => 10;
-- Type definition for RSTCR_EXTEVNT
type RSTCR_EXTEVNT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- EXTEVNT as a value
Val : HAL.UInt10;
when True =>
-- EXTEVNT as an array
Arr : RSTCR_EXTEVNT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 10;
for RSTCR_EXTEVNT_Field use record
Val at 0 range 0 .. 9;
Arr at 0 range 0 .. 9;
end record;
-- RSTCR_TIMACMP array
type RSTCR_TIMACMP_Field_Array is array (1 .. 3) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for RSTCR_TIMACMP
type RSTCR_TIMACMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TIMACMP as a value
Val : HAL.UInt3;
when True =>
-- TIMACMP as an array
Arr : RSTCR_TIMACMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 3;
for RSTCR_TIMACMP_Field use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- RSTCR_TIMBCMP array
type RSTCR_TIMBCMP_Field_Array is array (1 .. 3) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for RSTCR_TIMBCMP
type RSTCR_TIMBCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TIMBCMP as a value
Val : HAL.UInt3;
when True =>
-- TIMBCMP as an array
Arr : RSTCR_TIMBCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 3;
for RSTCR_TIMBCMP_Field use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- RSTCR_TIMDCMP array
type RSTCR_TIMDCMP_Field_Array is array (1 .. 3) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for RSTCR_TIMDCMP
type RSTCR_TIMDCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TIMDCMP as a value
Val : HAL.UInt3;
when True =>
-- TIMDCMP as an array
Arr : RSTCR_TIMDCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 3;
for RSTCR_TIMDCMP_Field use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- RSTCR_TIMECMP array
type RSTCR_TIMECMP_Field_Array is array (1 .. 3) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for RSTCR_TIMECMP
type RSTCR_TIMECMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TIMECMP as a value
Val : HAL.UInt3;
when True =>
-- TIMECMP as an array
Arr : RSTCR_TIMECMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 3;
for RSTCR_TIMECMP_Field use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- TimerA Reset Register
type RSTCR_Register is record
-- unspecified
Reserved_0_0 : HAL.Bit := 16#0#;
-- Timer A Update reset
UPDT : Boolean := False;
-- Timer A compare 2 reset
CMP : RSTCR_CMP_Field := (As_Array => False, Val => 16#0#);
-- Master timer Period
MSTPER : Boolean := False;
-- Master compare 1
MSTCMP : RSTCR_MSTCMP_Field :=
(As_Array => False, Val => 16#0#);
-- External Event 1
EXTEVNT : RSTCR_EXTEVNT_Field :=
(As_Array => False, Val => 16#0#);
-- Timer A Compare 1
TIMACMP : RSTCR_TIMACMP_Field :=
(As_Array => False, Val => 16#0#);
-- Timer B Compare 1
TIMBCMP : RSTCR_TIMBCMP_Field :=
(As_Array => False, Val => 16#0#);
-- Timer D Compare 1
TIMDCMP : RSTCR_TIMDCMP_Field :=
(As_Array => False, Val => 16#0#);
-- Timer E Compare 1
TIMECMP : RSTCR_TIMECMP_Field :=
(As_Array => False, Val => 16#0#);
-- unspecified
Reserved_31_31 : HAL.Bit := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for RSTCR_Register use record
Reserved_0_0 at 0 range 0 .. 0;
UPDT at 0 range 1 .. 1;
CMP at 0 range 2 .. 3;
MSTPER at 0 range 4 .. 4;
MSTCMP at 0 range 5 .. 8;
EXTEVNT at 0 range 9 .. 18;
TIMACMP at 0 range 19 .. 21;
TIMBCMP at 0 range 22 .. 24;
TIMDCMP at 0 range 25 .. 27;
TIMECMP at 0 range 28 .. 30;
Reserved_31_31 at 0 range 31 .. 31;
end record;
subtype CHPCR_CHPFRQ_Field is HAL.UInt4;
subtype CHPCR_CHPDTY_Field is HAL.UInt3;
subtype CHPCR_STRTPW_Field is HAL.UInt4;
-- Timerx Chopper Register
type CHPCR_Register is record
-- Timerx carrier frequency value
CHPFRQ : CHPCR_CHPFRQ_Field := 16#0#;
-- Timerx chopper duty cycle value
CHPDTY : CHPCR_CHPDTY_Field := 16#0#;
-- STRTPW
STRTPW : CHPCR_STRTPW_Field := 16#0#;
-- unspecified
Reserved_11_31 : HAL.UInt21 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CHPCR_Register use record
CHPFRQ at 0 range 0 .. 3;
CHPDTY at 0 range 4 .. 6;
STRTPW at 0 range 7 .. 10;
Reserved_11_31 at 0 range 11 .. 31;
end record;
-- CPT1CCR_TACMP array
type CPT1CCR_TACMP_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for CPT1CCR_TACMP
type CPT1CCR_TACMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TACMP as a value
Val : HAL.UInt2;
when True =>
-- TACMP as an array
Arr : CPT1CCR_TACMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for CPT1CCR_TACMP_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- CPT1CCR_TBCMP array
type CPT1CCR_TBCMP_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for CPT1CCR_TBCMP
type CPT1CCR_TBCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TBCMP as a value
Val : HAL.UInt2;
when True =>
-- TBCMP as an array
Arr : CPT1CCR_TBCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for CPT1CCR_TBCMP_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- CPT1CCR_TDCMP array
type CPT1CCR_TDCMP_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for CPT1CCR_TDCMP
type CPT1CCR_TDCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TDCMP as a value
Val : HAL.UInt2;
when True =>
-- TDCMP as an array
Arr : CPT1CCR_TDCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for CPT1CCR_TDCMP_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- CPT1CCR_TECMP array
type CPT1CCR_TECMP_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for CPT1CCR_TECMP
type CPT1CCR_TECMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TECMP as a value
Val : HAL.UInt2;
when True =>
-- TECMP as an array
Arr : CPT1CCR_TECMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for CPT1CCR_TECMP_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- Timerx Capture 2 Control Register
type CPT1CCR_Register is record
-- Software Capture
SWCPT : Boolean := False;
-- Update Capture
UDPCPT : Boolean := False;
-- External Event 1 Capture
EXEV1CPT : Boolean := False;
-- External Event 2 Capture
EXEV2CPT : Boolean := False;
-- External Event 3 Capture
EXEV3CPT : Boolean := False;
-- External Event 4 Capture
EXEV4CPT : Boolean := False;
-- External Event 5 Capture
EXEV5CPT : Boolean := False;
-- External Event 6 Capture
EXEV6CPT : Boolean := False;
-- External Event 7 Capture
EXEV7CPT : Boolean := False;
-- External Event 8 Capture
EXEV8CPT : Boolean := False;
-- External Event 9 Capture
EXEV9CPT : Boolean := False;
-- External Event 10 Capture
EXEV10CPT : Boolean := False;
-- Timer A output 1 Set
TA1SET : Boolean := False;
-- Timer A output 1 Reset
TA1RST : Boolean := False;
-- Timer A Compare 1
TACMP : CPT1CCR_TACMP_Field :=
(As_Array => False, Val => 16#0#);
-- Timer B output 1 Set
TB1SET : Boolean := False;
-- Timer B output 1 Reset
TB1RST : Boolean := False;
-- Timer B Compare 1
TBCMP : CPT1CCR_TBCMP_Field :=
(As_Array => False, Val => 16#0#);
-- unspecified
Reserved_20_23 : HAL.UInt4 := 16#0#;
-- Timer D output 1 Set
TD1SET : Boolean := False;
-- Timer D output 1 Reset
TD1RST : Boolean := False;
-- Timer D Compare 1
TDCMP : CPT1CCR_TDCMP_Field :=
(As_Array => False, Val => 16#0#);
-- Timer E output 1 Set
TE1SET : Boolean := False;
-- Timer E output 1 Reset
TE1RST : Boolean := False;
-- Timer E Compare 1
TECMP : CPT1CCR_TECMP_Field :=
(As_Array => False, Val => 16#0#);
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CPT1CCR_Register use record
SWCPT at 0 range 0 .. 0;
UDPCPT at 0 range 1 .. 1;
EXEV1CPT at 0 range 2 .. 2;
EXEV2CPT at 0 range 3 .. 3;
EXEV3CPT at 0 range 4 .. 4;
EXEV4CPT at 0 range 5 .. 5;
EXEV5CPT at 0 range 6 .. 6;
EXEV6CPT at 0 range 7 .. 7;
EXEV7CPT at 0 range 8 .. 8;
EXEV8CPT at 0 range 9 .. 9;
EXEV9CPT at 0 range 10 .. 10;
EXEV10CPT at 0 range 11 .. 11;
TA1SET at 0 range 12 .. 12;
TA1RST at 0 range 13 .. 13;
TACMP at 0 range 14 .. 15;
TB1SET at 0 range 16 .. 16;
TB1RST at 0 range 17 .. 17;
TBCMP at 0 range 18 .. 19;
Reserved_20_23 at 0 range 20 .. 23;
TD1SET at 0 range 24 .. 24;
TD1RST at 0 range 25 .. 25;
TDCMP at 0 range 26 .. 27;
TE1SET at 0 range 28 .. 28;
TE1RST at 0 range 29 .. 29;
TECMP at 0 range 30 .. 31;
end record;
-- CPT2CCR_TACMP array
type CPT2CCR_TACMP_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for CPT2CCR_TACMP
type CPT2CCR_TACMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TACMP as a value
Val : HAL.UInt2;
when True =>
-- TACMP as an array
Arr : CPT2CCR_TACMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for CPT2CCR_TACMP_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- CPT2CCR_TBCMP array
type CPT2CCR_TBCMP_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for CPT2CCR_TBCMP
type CPT2CCR_TBCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TBCMP as a value
Val : HAL.UInt2;
when True =>
-- TBCMP as an array
Arr : CPT2CCR_TBCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for CPT2CCR_TBCMP_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- CPT2CCR_TDCMP array
type CPT2CCR_TDCMP_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for CPT2CCR_TDCMP
type CPT2CCR_TDCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TDCMP as a value
Val : HAL.UInt2;
when True =>
-- TDCMP as an array
Arr : CPT2CCR_TDCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for CPT2CCR_TDCMP_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- CPT2CCR_TECMP array
type CPT2CCR_TECMP_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for CPT2CCR_TECMP
type CPT2CCR_TECMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TECMP as a value
Val : HAL.UInt2;
when True =>
-- TECMP as an array
Arr : CPT2CCR_TECMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for CPT2CCR_TECMP_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- CPT2xCR
type CPT2CCR_Register is record
-- Software Capture
SWCPT : Boolean := False;
-- Update Capture
UDPCPT : Boolean := False;
-- External Event 1 Capture
EXEV1CPT : Boolean := False;
-- External Event 2 Capture
EXEV2CPT : Boolean := False;
-- External Event 3 Capture
EXEV3CPT : Boolean := False;
-- External Event 4 Capture
EXEV4CPT : Boolean := False;
-- External Event 5 Capture
EXEV5CPT : Boolean := False;
-- External Event 6 Capture
EXEV6CPT : Boolean := False;
-- External Event 7 Capture
EXEV7CPT : Boolean := False;
-- External Event 8 Capture
EXEV8CPT : Boolean := False;
-- External Event 9 Capture
EXEV9CPT : Boolean := False;
-- External Event 10 Capture
EXEV10CPT : Boolean := False;
-- Timer A output 1 Set
TA1SET : Boolean := False;
-- Timer A output 1 Reset
TA1RST : Boolean := False;
-- Timer A Compare 1
TACMP : CPT2CCR_TACMP_Field :=
(As_Array => False, Val => 16#0#);
-- Timer B output 1 Set
TB1SET : Boolean := False;
-- Timer B output 1 Reset
TB1RST : Boolean := False;
-- Timer B Compare 1
TBCMP : CPT2CCR_TBCMP_Field :=
(As_Array => False, Val => 16#0#);
-- unspecified
Reserved_20_23 : HAL.UInt4 := 16#0#;
-- Timer D output 1 Set
TD1SET : Boolean := False;
-- Timer D output 1 Reset
TD1RST : Boolean := False;
-- Timer D Compare 1
TDCMP : CPT2CCR_TDCMP_Field :=
(As_Array => False, Val => 16#0#);
-- Timer E output 1 Set
TE1SET : Boolean := False;
-- Timer E output 1 Reset
TE1RST : Boolean := False;
-- Timer E Compare 1
TECMP : CPT2CCR_TECMP_Field :=
(As_Array => False, Val => 16#0#);
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CPT2CCR_Register use record
SWCPT at 0 range 0 .. 0;
UDPCPT at 0 range 1 .. 1;
EXEV1CPT at 0 range 2 .. 2;
EXEV2CPT at 0 range 3 .. 3;
EXEV3CPT at 0 range 4 .. 4;
EXEV4CPT at 0 range 5 .. 5;
EXEV5CPT at 0 range 6 .. 6;
EXEV6CPT at 0 range 7 .. 7;
EXEV7CPT at 0 range 8 .. 8;
EXEV8CPT at 0 range 9 .. 9;
EXEV9CPT at 0 range 10 .. 10;
EXEV10CPT at 0 range 11 .. 11;
TA1SET at 0 range 12 .. 12;
TA1RST at 0 range 13 .. 13;
TACMP at 0 range 14 .. 15;
TB1SET at 0 range 16 .. 16;
TB1RST at 0 range 17 .. 17;
TBCMP at 0 range 18 .. 19;
Reserved_20_23 at 0 range 20 .. 23;
TD1SET at 0 range 24 .. 24;
TD1RST at 0 range 25 .. 25;
TDCMP at 0 range 26 .. 27;
TE1SET at 0 range 28 .. 28;
TE1RST at 0 range 29 .. 29;
TECMP at 0 range 30 .. 31;
end record;
subtype OUTCR_FAULT1_Field is HAL.UInt2;
subtype OUTCR_DLYPRT_Field is HAL.UInt3;
subtype OUTCR_FAULT2_Field is HAL.UInt2;
-- Timerx Output Register
type OUTCR_Register is record
-- unspecified
Reserved_0_0 : HAL.Bit := 16#0#;
-- Output 1 polarity
POL1 : Boolean := False;
-- Output 1 Idle mode
IDLEM1 : Boolean := False;
-- Output 1 Idle State
IDLES1 : Boolean := False;
-- Output 1 Fault state
FAULT1 : OUTCR_FAULT1_Field := 16#0#;
-- Output 1 Chopper enable
CHP1 : Boolean := False;
-- Output 1 Deadtime upon burst mode Idle entry
DIDL1 : Boolean := False;
-- Deadtime enable
DTEN : Boolean := False;
-- Delayed Protection Enable
DLYPRTEN : Boolean := False;
-- Delayed Protection
DLYPRT : OUTCR_DLYPRT_Field := 16#0#;
-- unspecified
Reserved_13_16 : HAL.UInt4 := 16#0#;
-- Output 2 polarity
POL2 : Boolean := False;
-- Output 2 Idle mode
IDLEM2 : Boolean := False;
-- Output 2 Idle State
IDLES2 : Boolean := False;
-- Output 2 Fault state
FAULT2 : OUTCR_FAULT2_Field := 16#0#;
-- Output 2 Chopper enable
CHP2 : Boolean := False;
-- Output 2 Deadtime upon burst mode Idle entry
DIDL2 : Boolean := False;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for OUTCR_Register use record
Reserved_0_0 at 0 range 0 .. 0;
POL1 at 0 range 1 .. 1;
IDLEM1 at 0 range 2 .. 2;
IDLES1 at 0 range 3 .. 3;
FAULT1 at 0 range 4 .. 5;
CHP1 at 0 range 6 .. 6;
DIDL1 at 0 range 7 .. 7;
DTEN at 0 range 8 .. 8;
DLYPRTEN at 0 range 9 .. 9;
DLYPRT at 0 range 10 .. 12;
Reserved_13_16 at 0 range 13 .. 16;
POL2 at 0 range 17 .. 17;
IDLEM2 at 0 range 18 .. 18;
IDLES2 at 0 range 19 .. 19;
FAULT2 at 0 range 20 .. 21;
CHP2 at 0 range 22 .. 22;
DIDL2 at 0 range 23 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
-- Timerx Fault Register
type FLTCR_Register is record
-- Fault 1 enable
FLT1EN : Boolean := False;
-- Fault 2 enable
FLT2EN : Boolean := False;
-- Fault 3 enable
FLT3EN : Boolean := False;
-- Fault 4 enable
FLT4EN : Boolean := False;
-- Fault 5 enable
FLT5EN : Boolean := False;
-- unspecified
Reserved_5_30 : HAL.UInt26 := 16#0#;
-- Fault sources Lock
FLTLCK : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for FLTCR_Register use record
FLT1EN at 0 range 0 .. 0;
FLT2EN at 0 range 1 .. 1;
FLT3EN at 0 range 2 .. 2;
FLT4EN at 0 range 3 .. 3;
FLT5EN at 0 range 4 .. 4;
Reserved_5_30 at 0 range 5 .. 30;
FLTLCK at 0 range 31 .. 31;
end record;
subtype TIMDCR_CKPSCx_Field is HAL.UInt3;
-- TIMDCR_DELCMP array element
subtype TIMDCR_DELCMP_Element is HAL.UInt2;
-- TIMDCR_DELCMP array
type TIMDCR_DELCMP_Field_Array is array (2 .. 3) of TIMDCR_DELCMP_Element
with Component_Size => 2, Size => 4;
-- Type definition for TIMDCR_DELCMP
type TIMDCR_DELCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- DELCMP as a value
Val : HAL.UInt4;
when True =>
-- DELCMP as an array
Arr : TIMDCR_DELCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for TIMDCR_DELCMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
subtype TIMDCR_DACSYNC_Field is HAL.UInt2;
subtype TIMDCR_UPDGAT_Field is HAL.UInt4;
-- Timerx Control Register
type TIMDCR_Register is record
-- HRTIM Timer x Clock prescaler
CKPSCx : TIMDCR_CKPSCx_Field := 16#0#;
-- Continuous mode
CONT : Boolean := False;
-- Re-triggerable mode
RETRIG : Boolean := False;
-- Half mode enable
HALF : Boolean := False;
-- Push-Pull mode enable
PSHPLL : Boolean := False;
-- unspecified
Reserved_7_9 : HAL.UInt3 := 16#0#;
-- Synchronization Resets Timer x
SYNCRSTx : Boolean := False;
-- Synchronization Starts Timer x
SYNCSTRTx : Boolean := False;
-- Delayed CMP2 mode
DELCMP : TIMDCR_DELCMP_Field :=
(As_Array => False, Val => 16#0#);
-- unspecified
Reserved_16_16 : HAL.Bit := 16#0#;
-- Timer x Repetition update
TxREPU : Boolean := False;
-- Timerx reset update
TxRSTU : Boolean := False;
-- unspecified
Reserved_19_19 : HAL.Bit := 16#0#;
-- TBU
TBU : Boolean := False;
-- TCU
TCU : Boolean := False;
-- TDU
TDU : Boolean := False;
-- TEU
TEU : Boolean := False;
-- Master Timer update
MSTU : Boolean := False;
-- AC Synchronization
DACSYNC : TIMDCR_DACSYNC_Field := 16#0#;
-- Preload enable
PREEN : Boolean := False;
-- Update Gating
UPDGAT : TIMDCR_UPDGAT_Field := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TIMDCR_Register use record
CKPSCx at 0 range 0 .. 2;
CONT at 0 range 3 .. 3;
RETRIG at 0 range 4 .. 4;
HALF at 0 range 5 .. 5;
PSHPLL at 0 range 6 .. 6;
Reserved_7_9 at 0 range 7 .. 9;
SYNCRSTx at 0 range 10 .. 10;
SYNCSTRTx at 0 range 11 .. 11;
DELCMP at 0 range 12 .. 15;
Reserved_16_16 at 0 range 16 .. 16;
TxREPU at 0 range 17 .. 17;
TxRSTU at 0 range 18 .. 18;
Reserved_19_19 at 0 range 19 .. 19;
TBU at 0 range 20 .. 20;
TCU at 0 range 21 .. 21;
TDU at 0 range 22 .. 22;
TEU at 0 range 23 .. 23;
MSTU at 0 range 24 .. 24;
DACSYNC at 0 range 25 .. 26;
PREEN at 0 range 27 .. 27;
UPDGAT at 0 range 28 .. 31;
end record;
-- TIMDISR_CMP array
type TIMDISR_CMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for TIMDISR_CMP
type TIMDISR_CMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- CMP as a value
Val : HAL.UInt4;
when True =>
-- CMP as an array
Arr : TIMDISR_CMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for TIMDISR_CMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- TIMDISR_CPT array
type TIMDISR_CPT_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for TIMDISR_CPT
type TIMDISR_CPT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- CPT as a value
Val : HAL.UInt2;
when True =>
-- CPT as an array
Arr : TIMDISR_CPT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for TIMDISR_CPT_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- Timerx Interrupt Status Register
type TIMDISR_Register is record
-- Read-only. Compare 1 Interrupt Flag
CMP : TIMDISR_CMP_Field;
-- Read-only. Repetition Interrupt Flag
REP : Boolean;
-- unspecified
Reserved_5_5 : HAL.Bit;
-- Read-only. Update Interrupt Flag
UPD : Boolean;
-- Read-only. Capture1 Interrupt Flag
CPT : TIMDISR_CPT_Field;
-- Read-only. Output 1 Set Interrupt Flag
SETx1 : Boolean;
-- Read-only. Output 1 Reset Interrupt Flag
RSTx1 : Boolean;
-- Read-only. Output 2 Set Interrupt Flag
SETx2 : Boolean;
-- Read-only. Output 2 Reset Interrupt Flag
RSTx2 : Boolean;
-- Read-only. Reset Interrupt Flag
RST : Boolean;
-- Read-only. Delayed Protection Flag
DLYPRT : Boolean;
-- unspecified
Reserved_15_15 : HAL.Bit;
-- Read-only. Current Push Pull Status
CPPSTAT : Boolean;
-- Read-only. Idle Push Pull Status
IPPSTAT : Boolean;
-- Read-only. Output 1 State
O1STAT : Boolean;
-- Read-only. Output 2 State
O2STAT : Boolean;
-- unspecified
Reserved_20_31 : HAL.UInt12;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TIMDISR_Register use record
CMP at 0 range 0 .. 3;
REP at 0 range 4 .. 4;
Reserved_5_5 at 0 range 5 .. 5;
UPD at 0 range 6 .. 6;
CPT at 0 range 7 .. 8;
SETx1 at 0 range 9 .. 9;
RSTx1 at 0 range 10 .. 10;
SETx2 at 0 range 11 .. 11;
RSTx2 at 0 range 12 .. 12;
RST at 0 range 13 .. 13;
DLYPRT at 0 range 14 .. 14;
Reserved_15_15 at 0 range 15 .. 15;
CPPSTAT at 0 range 16 .. 16;
IPPSTAT at 0 range 17 .. 17;
O1STAT at 0 range 18 .. 18;
O2STAT at 0 range 19 .. 19;
Reserved_20_31 at 0 range 20 .. 31;
end record;
-- Timerx Interrupt Clear Register
type TIMDICR_Register is record
-- Write-only. Compare 1 Interrupt flag Clear
CMP1C : Boolean := False;
-- Write-only. Compare 2 Interrupt flag Clear
CMP2C : Boolean := False;
-- Write-only. Compare 3 Interrupt flag Clear
CMP3C : Boolean := False;
-- Write-only. Compare 4 Interrupt flag Clear
CMP4C : Boolean := False;
-- Write-only. Repetition Interrupt flag Clear
REPC : Boolean := False;
-- unspecified
Reserved_5_5 : HAL.Bit := 16#0#;
-- Write-only. Update Interrupt flag Clear
UPDC : Boolean := False;
-- Write-only. Capture1 Interrupt flag Clear
CPT1C : Boolean := False;
-- Write-only. Capture2 Interrupt flag Clear
CPT2C : Boolean := False;
-- Write-only. Output 1 Set flag Clear
SET1xC : Boolean := False;
-- Write-only. Output 1 Reset flag Clear
RSTx1C : Boolean := False;
-- Write-only. Output 2 Set flag Clear
SET2xC : Boolean := False;
-- Write-only. Output 2 Reset flag Clear
RSTx2C : Boolean := False;
-- Write-only. Reset Interrupt flag Clear
RSTC : Boolean := False;
-- Write-only. Delayed Protection Flag Clear
DLYPRTC : Boolean := False;
-- unspecified
Reserved_15_31 : HAL.UInt17 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TIMDICR_Register use record
CMP1C at 0 range 0 .. 0;
CMP2C at 0 range 1 .. 1;
CMP3C at 0 range 2 .. 2;
CMP4C at 0 range 3 .. 3;
REPC at 0 range 4 .. 4;
Reserved_5_5 at 0 range 5 .. 5;
UPDC at 0 range 6 .. 6;
CPT1C at 0 range 7 .. 7;
CPT2C at 0 range 8 .. 8;
SET1xC at 0 range 9 .. 9;
RSTx1C at 0 range 10 .. 10;
SET2xC at 0 range 11 .. 11;
RSTx2C at 0 range 12 .. 12;
RSTC at 0 range 13 .. 13;
DLYPRTC at 0 range 14 .. 14;
Reserved_15_31 at 0 range 15 .. 31;
end record;
-- TIMxDIER
type TIMDDIER_Register is record
-- CMP1IE
CMP1IE : Boolean := False;
-- CMP2IE
CMP2IE : Boolean := False;
-- CMP3IE
CMP3IE : Boolean := False;
-- CMP4IE
CMP4IE : Boolean := False;
-- REPIE
REPIE : Boolean := False;
-- unspecified
Reserved_5_5 : HAL.Bit := 16#0#;
-- UPDIE
UPDIE : Boolean := False;
-- CPT1IE
CPT1IE : Boolean := False;
-- CPT2IE
CPT2IE : Boolean := False;
-- SET1xIE
SET1xIE : Boolean := False;
-- RSTx1IE
RSTx1IE : Boolean := False;
-- SETx2IE
SETx2IE : Boolean := False;
-- RSTx2IE
RSTx2IE : Boolean := False;
-- RSTIE
RSTIE : Boolean := False;
-- DLYPRTIE
DLYPRTIE : Boolean := False;
-- unspecified
Reserved_15_15 : HAL.Bit := 16#0#;
-- CMP1DE
CMP1DE : Boolean := False;
-- CMP2DE
CMP2DE : Boolean := False;
-- CMP3DE
CMP3DE : Boolean := False;
-- CMP4DE
CMP4DE : Boolean := False;
-- REPDE
REPDE : Boolean := False;
-- unspecified
Reserved_21_21 : HAL.Bit := 16#0#;
-- UPDDE
UPDDE : Boolean := False;
-- CPT1DE
CPT1DE : Boolean := False;
-- CPT2DE
CPT2DE : Boolean := False;
-- SET1xDE
SET1xDE : Boolean := False;
-- RSTx1DE
RSTx1DE : Boolean := False;
-- SETx2DE
SETx2DE : Boolean := False;
-- RSTx2DE
RSTx2DE : Boolean := False;
-- RSTDE
RSTDE : Boolean := False;
-- DLYPRTDE
DLYPRTDE : Boolean := False;
-- unspecified
Reserved_31_31 : HAL.Bit := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TIMDDIER_Register use record
CMP1IE at 0 range 0 .. 0;
CMP2IE at 0 range 1 .. 1;
CMP3IE at 0 range 2 .. 2;
CMP4IE at 0 range 3 .. 3;
REPIE at 0 range 4 .. 4;
Reserved_5_5 at 0 range 5 .. 5;
UPDIE at 0 range 6 .. 6;
CPT1IE at 0 range 7 .. 7;
CPT2IE at 0 range 8 .. 8;
SET1xIE at 0 range 9 .. 9;
RSTx1IE at 0 range 10 .. 10;
SETx2IE at 0 range 11 .. 11;
RSTx2IE at 0 range 12 .. 12;
RSTIE at 0 range 13 .. 13;
DLYPRTIE at 0 range 14 .. 14;
Reserved_15_15 at 0 range 15 .. 15;
CMP1DE at 0 range 16 .. 16;
CMP2DE at 0 range 17 .. 17;
CMP3DE at 0 range 18 .. 18;
CMP4DE at 0 range 19 .. 19;
REPDE at 0 range 20 .. 20;
Reserved_21_21 at 0 range 21 .. 21;
UPDDE at 0 range 22 .. 22;
CPT1DE at 0 range 23 .. 23;
CPT2DE at 0 range 24 .. 24;
SET1xDE at 0 range 25 .. 25;
RSTx1DE at 0 range 26 .. 26;
SETx2DE at 0 range 27 .. 27;
RSTx2DE at 0 range 28 .. 28;
RSTDE at 0 range 29 .. 29;
DLYPRTDE at 0 range 30 .. 30;
Reserved_31_31 at 0 range 31 .. 31;
end record;
subtype CNTDR_CNTx_Field is HAL.UInt16;
-- Timerx Counter Register
type CNTDR_Register is record
-- Timerx Counter value
CNTx : CNTDR_CNTx_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CNTDR_Register use record
CNTx at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype PERDR_PERx_Field is HAL.UInt16;
-- Timerx Period Register
type PERDR_Register is record
-- Timerx Period value
PERx : PERDR_PERx_Field := 16#FFFF#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for PERDR_Register use record
PERx at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype REPDR_REPx_Field is HAL.UInt8;
-- Timerx Repetition Register
type REPDR_Register is record
-- Timerx Repetition counter value
REPx : REPDR_REPx_Field := 16#0#;
-- unspecified
Reserved_8_31 : HAL.UInt24 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for REPDR_Register use record
REPx at 0 range 0 .. 7;
Reserved_8_31 at 0 range 8 .. 31;
end record;
subtype CMP1DR_CMP1x_Field is HAL.UInt16;
-- Timerx Compare 1 Register
type CMP1DR_Register is record
-- Timerx Compare 1 value
CMP1x : CMP1DR_CMP1x_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CMP1DR_Register use record
CMP1x at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype CMP1CDR_CMP1x_Field is HAL.UInt16;
subtype CMP1CDR_REPx_Field is HAL.UInt8;
-- Timerx Compare 1 Compound Register
type CMP1CDR_Register is record
-- Timerx Compare 1 value
CMP1x : CMP1CDR_CMP1x_Field := 16#0#;
-- Timerx Repetition value (aliased from HRTIM_REPx register)
REPx : CMP1CDR_REPx_Field := 16#0#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CMP1CDR_Register use record
CMP1x at 0 range 0 .. 15;
REPx at 0 range 16 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
subtype CMP2DR_CMP2x_Field is HAL.UInt16;
-- Timerx Compare 2 Register
type CMP2DR_Register is record
-- Timerx Compare 2 value
CMP2x : CMP2DR_CMP2x_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CMP2DR_Register use record
CMP2x at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype CMP3DR_CMP3x_Field is HAL.UInt16;
-- Timerx Compare 3 Register
type CMP3DR_Register is record
-- Timerx Compare 3 value
CMP3x : CMP3DR_CMP3x_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CMP3DR_Register use record
CMP3x at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype CMP4DR_CMP4x_Field is HAL.UInt16;
-- Timerx Compare 4 Register
type CMP4DR_Register is record
-- Timerx Compare 4 value
CMP4x : CMP4DR_CMP4x_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CMP4DR_Register use record
CMP4x at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype CPT1DR_CPT1x_Field is HAL.UInt16;
-- Timerx Capture 1 Register
type CPT1DR_Register is record
-- Read-only. Timerx Capture 1 value
CPT1x : CPT1DR_CPT1x_Field;
-- unspecified
Reserved_16_31 : HAL.UInt16;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CPT1DR_Register use record
CPT1x at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype CPT2DR_CPT2x_Field is HAL.UInt16;
-- Timerx Capture 2 Register
type CPT2DR_Register is record
-- Read-only. Timerx Capture 2 value
CPT2x : CPT2DR_CPT2x_Field;
-- unspecified
Reserved_16_31 : HAL.UInt16;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CPT2DR_Register use record
CPT2x at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype DTDR_DTRx_Field is HAL.UInt9;
subtype DTDR_DTPRSC_Field is HAL.UInt3;
subtype DTDR_DTFx_Field is HAL.UInt9;
-- Timerx Deadtime Register
type DTDR_Register is record
-- Deadtime Rising value
DTRx : DTDR_DTRx_Field := 16#0#;
-- Sign Deadtime Rising value
SDTRx : Boolean := False;
-- Deadtime Prescaler
DTPRSC : DTDR_DTPRSC_Field := 16#0#;
-- unspecified
Reserved_13_13 : HAL.Bit := 16#0#;
-- Deadtime Rising Sign Lock
DTRSLKx : Boolean := False;
-- Deadtime Rising Lock
DTRLKx : Boolean := False;
-- Deadtime Falling value
DTFx : DTDR_DTFx_Field := 16#0#;
-- Sign Deadtime Falling value
SDTFx : Boolean := False;
-- unspecified
Reserved_26_29 : HAL.UInt4 := 16#0#;
-- Deadtime Falling Sign Lock
DTFSLKx : Boolean := False;
-- Deadtime Falling Lock
DTFLKx : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for DTDR_Register use record
DTRx at 0 range 0 .. 8;
SDTRx at 0 range 9 .. 9;
DTPRSC at 0 range 10 .. 12;
Reserved_13_13 at 0 range 13 .. 13;
DTRSLKx at 0 range 14 .. 14;
DTRLKx at 0 range 15 .. 15;
DTFx at 0 range 16 .. 24;
SDTFx at 0 range 25 .. 25;
Reserved_26_29 at 0 range 26 .. 29;
DTFSLKx at 0 range 30 .. 30;
DTFLKx at 0 range 31 .. 31;
end record;
-- SETD1R_CMP array
type SETD1R_CMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for SETD1R_CMP
type SETD1R_CMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- CMP as a value
Val : HAL.UInt4;
when True =>
-- CMP as an array
Arr : SETD1R_CMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for SETD1R_CMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- SETD1R_MSTCMP array
type SETD1R_MSTCMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for SETD1R_MSTCMP
type SETD1R_MSTCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MSTCMP as a value
Val : HAL.UInt4;
when True =>
-- MSTCMP as an array
Arr : SETD1R_MSTCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for SETD1R_MSTCMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- SETD1R_TIMEVNT array
type SETD1R_TIMEVNT_Field_Array is array (1 .. 9) of Boolean
with Component_Size => 1, Size => 9;
-- Type definition for SETD1R_TIMEVNT
type SETD1R_TIMEVNT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TIMEVNT as a value
Val : HAL.UInt9;
when True =>
-- TIMEVNT as an array
Arr : SETD1R_TIMEVNT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 9;
for SETD1R_TIMEVNT_Field use record
Val at 0 range 0 .. 8;
Arr at 0 range 0 .. 8;
end record;
-- SETD1R_EXTEVNT array
type SETD1R_EXTEVNT_Field_Array is array (1 .. 10) of Boolean
with Component_Size => 1, Size => 10;
-- Type definition for SETD1R_EXTEVNT
type SETD1R_EXTEVNT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- EXTEVNT as a value
Val : HAL.UInt10;
when True =>
-- EXTEVNT as an array
Arr : SETD1R_EXTEVNT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 10;
for SETD1R_EXTEVNT_Field use record
Val at 0 range 0 .. 9;
Arr at 0 range 0 .. 9;
end record;
-- Timerx Output1 Set Register
type SETD1R_Register is record
-- Software Set trigger
SST : Boolean := False;
-- Timer A resynchronizaton
RESYNC : Boolean := False;
-- Timer A Period
PER : Boolean := False;
-- Timer A compare 1
CMP : SETD1R_CMP_Field := (As_Array => False, Val => 16#0#);
-- Master Period
MSTPER : Boolean := False;
-- Master Compare 1
MSTCMP : SETD1R_MSTCMP_Field := (As_Array => False, Val => 16#0#);
-- Timer Event 1
TIMEVNT : SETD1R_TIMEVNT_Field := (As_Array => False, Val => 16#0#);
-- External Event 1
EXTEVNT : SETD1R_EXTEVNT_Field := (As_Array => False, Val => 16#0#);
-- Registers update (transfer preload to active)
UPDATE : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for SETD1R_Register use record
SST at 0 range 0 .. 0;
RESYNC at 0 range 1 .. 1;
PER at 0 range 2 .. 2;
CMP at 0 range 3 .. 6;
MSTPER at 0 range 7 .. 7;
MSTCMP at 0 range 8 .. 11;
TIMEVNT at 0 range 12 .. 20;
EXTEVNT at 0 range 21 .. 30;
UPDATE at 0 range 31 .. 31;
end record;
-- RSTD1R_CMP array
type RSTD1R_CMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for RSTD1R_CMP
type RSTD1R_CMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- CMP as a value
Val : HAL.UInt4;
when True =>
-- CMP as an array
Arr : RSTD1R_CMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for RSTD1R_CMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- RSTD1R_MSTCMP array
type RSTD1R_MSTCMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for RSTD1R_MSTCMP
type RSTD1R_MSTCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MSTCMP as a value
Val : HAL.UInt4;
when True =>
-- MSTCMP as an array
Arr : RSTD1R_MSTCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for RSTD1R_MSTCMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- RSTD1R_TIMEVNT array
type RSTD1R_TIMEVNT_Field_Array is array (1 .. 9) of Boolean
with Component_Size => 1, Size => 9;
-- Type definition for RSTD1R_TIMEVNT
type RSTD1R_TIMEVNT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TIMEVNT as a value
Val : HAL.UInt9;
when True =>
-- TIMEVNT as an array
Arr : RSTD1R_TIMEVNT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 9;
for RSTD1R_TIMEVNT_Field use record
Val at 0 range 0 .. 8;
Arr at 0 range 0 .. 8;
end record;
-- RSTD1R_EXTEVNT array
type RSTD1R_EXTEVNT_Field_Array is array (1 .. 10) of Boolean
with Component_Size => 1, Size => 10;
-- Type definition for RSTD1R_EXTEVNT
type RSTD1R_EXTEVNT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- EXTEVNT as a value
Val : HAL.UInt10;
when True =>
-- EXTEVNT as an array
Arr : RSTD1R_EXTEVNT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 10;
for RSTD1R_EXTEVNT_Field use record
Val at 0 range 0 .. 9;
Arr at 0 range 0 .. 9;
end record;
-- Timerx Output1 Reset Register
type RSTD1R_Register is record
-- SRT
SRT : Boolean := False;
-- RESYNC
RESYNC : Boolean := False;
-- PER
PER : Boolean := False;
-- CMP1
CMP : RSTD1R_CMP_Field := (As_Array => False, Val => 16#0#);
-- MSTPER
MSTPER : Boolean := False;
-- MSTCMP1
MSTCMP : RSTD1R_MSTCMP_Field := (As_Array => False, Val => 16#0#);
-- TIMEVNT1
TIMEVNT : RSTD1R_TIMEVNT_Field := (As_Array => False, Val => 16#0#);
-- EXTEVNT1
EXTEVNT : RSTD1R_EXTEVNT_Field := (As_Array => False, Val => 16#0#);
-- UPDATE
UPDATE : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for RSTD1R_Register use record
SRT at 0 range 0 .. 0;
RESYNC at 0 range 1 .. 1;
PER at 0 range 2 .. 2;
CMP at 0 range 3 .. 6;
MSTPER at 0 range 7 .. 7;
MSTCMP at 0 range 8 .. 11;
TIMEVNT at 0 range 12 .. 20;
EXTEVNT at 0 range 21 .. 30;
UPDATE at 0 range 31 .. 31;
end record;
-- SETD2R_CMP array
type SETD2R_CMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for SETD2R_CMP
type SETD2R_CMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- CMP as a value
Val : HAL.UInt4;
when True =>
-- CMP as an array
Arr : SETD2R_CMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for SETD2R_CMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- SETD2R_MSTCMP array
type SETD2R_MSTCMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for SETD2R_MSTCMP
type SETD2R_MSTCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MSTCMP as a value
Val : HAL.UInt4;
when True =>
-- MSTCMP as an array
Arr : SETD2R_MSTCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for SETD2R_MSTCMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- SETD2R_TIMEVNT array
type SETD2R_TIMEVNT_Field_Array is array (1 .. 9) of Boolean
with Component_Size => 1, Size => 9;
-- Type definition for SETD2R_TIMEVNT
type SETD2R_TIMEVNT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TIMEVNT as a value
Val : HAL.UInt9;
when True =>
-- TIMEVNT as an array
Arr : SETD2R_TIMEVNT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 9;
for SETD2R_TIMEVNT_Field use record
Val at 0 range 0 .. 8;
Arr at 0 range 0 .. 8;
end record;
-- SETD2R_EXTEVNT array
type SETD2R_EXTEVNT_Field_Array is array (1 .. 10) of Boolean
with Component_Size => 1, Size => 10;
-- Type definition for SETD2R_EXTEVNT
type SETD2R_EXTEVNT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- EXTEVNT as a value
Val : HAL.UInt10;
when True =>
-- EXTEVNT as an array
Arr : SETD2R_EXTEVNT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 10;
for SETD2R_EXTEVNT_Field use record
Val at 0 range 0 .. 9;
Arr at 0 range 0 .. 9;
end record;
-- Timerx Output2 Set Register
type SETD2R_Register is record
-- SST
SST : Boolean := False;
-- RESYNC
RESYNC : Boolean := False;
-- PER
PER : Boolean := False;
-- CMP1
CMP : SETD2R_CMP_Field := (As_Array => False, Val => 16#0#);
-- MSTPER
MSTPER : Boolean := False;
-- MSTCMP1
MSTCMP : SETD2R_MSTCMP_Field := (As_Array => False, Val => 16#0#);
-- TIMEVNT1
TIMEVNT : SETD2R_TIMEVNT_Field := (As_Array => False, Val => 16#0#);
-- EXTEVNT1
EXTEVNT : SETD2R_EXTEVNT_Field := (As_Array => False, Val => 16#0#);
-- UPDATE
UPDATE : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for SETD2R_Register use record
SST at 0 range 0 .. 0;
RESYNC at 0 range 1 .. 1;
PER at 0 range 2 .. 2;
CMP at 0 range 3 .. 6;
MSTPER at 0 range 7 .. 7;
MSTCMP at 0 range 8 .. 11;
TIMEVNT at 0 range 12 .. 20;
EXTEVNT at 0 range 21 .. 30;
UPDATE at 0 range 31 .. 31;
end record;
-- RSTD2R_CMP array
type RSTD2R_CMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for RSTD2R_CMP
type RSTD2R_CMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- CMP as a value
Val : HAL.UInt4;
when True =>
-- CMP as an array
Arr : RSTD2R_CMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for RSTD2R_CMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- RSTD2R_MSTCMP array
type RSTD2R_MSTCMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for RSTD2R_MSTCMP
type RSTD2R_MSTCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MSTCMP as a value
Val : HAL.UInt4;
when True =>
-- MSTCMP as an array
Arr : RSTD2R_MSTCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for RSTD2R_MSTCMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- RSTD2R_TIMEVNT array
type RSTD2R_TIMEVNT_Field_Array is array (1 .. 9) of Boolean
with Component_Size => 1, Size => 9;
-- Type definition for RSTD2R_TIMEVNT
type RSTD2R_TIMEVNT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TIMEVNT as a value
Val : HAL.UInt9;
when True =>
-- TIMEVNT as an array
Arr : RSTD2R_TIMEVNT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 9;
for RSTD2R_TIMEVNT_Field use record
Val at 0 range 0 .. 8;
Arr at 0 range 0 .. 8;
end record;
-- RSTD2R_EXTEVNT array
type RSTD2R_EXTEVNT_Field_Array is array (1 .. 10) of Boolean
with Component_Size => 1, Size => 10;
-- Type definition for RSTD2R_EXTEVNT
type RSTD2R_EXTEVNT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- EXTEVNT as a value
Val : HAL.UInt10;
when True =>
-- EXTEVNT as an array
Arr : RSTD2R_EXTEVNT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 10;
for RSTD2R_EXTEVNT_Field use record
Val at 0 range 0 .. 9;
Arr at 0 range 0 .. 9;
end record;
-- Timerx Output2 Reset Register
type RSTD2R_Register is record
-- SRT
SRT : Boolean := False;
-- RESYNC
RESYNC : Boolean := False;
-- PER
PER : Boolean := False;
-- CMP1
CMP : RSTD2R_CMP_Field := (As_Array => False, Val => 16#0#);
-- MSTPER
MSTPER : Boolean := False;
-- MSTCMP1
MSTCMP : RSTD2R_MSTCMP_Field := (As_Array => False, Val => 16#0#);
-- TIMEVNT1
TIMEVNT : RSTD2R_TIMEVNT_Field := (As_Array => False, Val => 16#0#);
-- EXTEVNT1
EXTEVNT : RSTD2R_EXTEVNT_Field := (As_Array => False, Val => 16#0#);
-- UPDATE
UPDATE : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for RSTD2R_Register use record
SRT at 0 range 0 .. 0;
RESYNC at 0 range 1 .. 1;
PER at 0 range 2 .. 2;
CMP at 0 range 3 .. 6;
MSTPER at 0 range 7 .. 7;
MSTCMP at 0 range 8 .. 11;
TIMEVNT at 0 range 12 .. 20;
EXTEVNT at 0 range 21 .. 30;
UPDATE at 0 range 31 .. 31;
end record;
subtype EEFDR1_EE1FLTR_Field is HAL.UInt4;
subtype EEFDR1_EE2FLTR_Field is HAL.UInt4;
subtype EEFDR1_EE3FLTR_Field is HAL.UInt4;
subtype EEFDR1_EE4FLTR_Field is HAL.UInt4;
subtype EEFDR1_EE5FLTR_Field is HAL.UInt4;
-- Timerx External Event Filtering Register 1
type EEFDR1_Register is record
-- External Event 1 latch
EE1LTCH : Boolean := False;
-- External Event 1 filter
EE1FLTR : EEFDR1_EE1FLTR_Field := 16#0#;
-- unspecified
Reserved_5_5 : HAL.Bit := 16#0#;
-- External Event 2 latch
EE2LTCH : Boolean := False;
-- External Event 2 filter
EE2FLTR : EEFDR1_EE2FLTR_Field := 16#0#;
-- unspecified
Reserved_11_11 : HAL.Bit := 16#0#;
-- External Event 3 latch
EE3LTCH : Boolean := False;
-- External Event 3 filter
EE3FLTR : EEFDR1_EE3FLTR_Field := 16#0#;
-- unspecified
Reserved_17_17 : HAL.Bit := 16#0#;
-- External Event 4 latch
EE4LTCH : Boolean := False;
-- External Event 4 filter
EE4FLTR : EEFDR1_EE4FLTR_Field := 16#0#;
-- unspecified
Reserved_23_23 : HAL.Bit := 16#0#;
-- External Event 5 latch
EE5LTCH : Boolean := False;
-- External Event 5 filter
EE5FLTR : EEFDR1_EE5FLTR_Field := 16#0#;
-- unspecified
Reserved_29_31 : HAL.UInt3 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for EEFDR1_Register use record
EE1LTCH at 0 range 0 .. 0;
EE1FLTR at 0 range 1 .. 4;
Reserved_5_5 at 0 range 5 .. 5;
EE2LTCH at 0 range 6 .. 6;
EE2FLTR at 0 range 7 .. 10;
Reserved_11_11 at 0 range 11 .. 11;
EE3LTCH at 0 range 12 .. 12;
EE3FLTR at 0 range 13 .. 16;
Reserved_17_17 at 0 range 17 .. 17;
EE4LTCH at 0 range 18 .. 18;
EE4FLTR at 0 range 19 .. 22;
Reserved_23_23 at 0 range 23 .. 23;
EE5LTCH at 0 range 24 .. 24;
EE5FLTR at 0 range 25 .. 28;
Reserved_29_31 at 0 range 29 .. 31;
end record;
subtype EEFDR2_EE6FLTR_Field is HAL.UInt4;
subtype EEFDR2_EE7FLTR_Field is HAL.UInt4;
subtype EEFDR2_EE8FLTR_Field is HAL.UInt4;
subtype EEFDR2_EE9FLTR_Field is HAL.UInt4;
subtype EEFDR2_EE10FLTR_Field is HAL.UInt4;
-- Timerx External Event Filtering Register 2
type EEFDR2_Register is record
-- External Event 6 latch
EE6LTCH : Boolean := False;
-- External Event 6 filter
EE6FLTR : EEFDR2_EE6FLTR_Field := 16#0#;
-- unspecified
Reserved_5_5 : HAL.Bit := 16#0#;
-- External Event 7 latch
EE7LTCH : Boolean := False;
-- External Event 7 filter
EE7FLTR : EEFDR2_EE7FLTR_Field := 16#0#;
-- unspecified
Reserved_11_11 : HAL.Bit := 16#0#;
-- External Event 8 latch
EE8LTCH : Boolean := False;
-- External Event 8 filter
EE8FLTR : EEFDR2_EE8FLTR_Field := 16#0#;
-- unspecified
Reserved_17_17 : HAL.Bit := 16#0#;
-- External Event 9 latch
EE9LTCH : Boolean := False;
-- External Event 9 filter
EE9FLTR : EEFDR2_EE9FLTR_Field := 16#0#;
-- unspecified
Reserved_23_23 : HAL.Bit := 16#0#;
-- External Event 10 latch
EE10LTCH : Boolean := False;
-- External Event 10 filter
EE10FLTR : EEFDR2_EE10FLTR_Field := 16#0#;
-- unspecified
Reserved_29_31 : HAL.UInt3 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for EEFDR2_Register use record
EE6LTCH at 0 range 0 .. 0;
EE6FLTR at 0 range 1 .. 4;
Reserved_5_5 at 0 range 5 .. 5;
EE7LTCH at 0 range 6 .. 6;
EE7FLTR at 0 range 7 .. 10;
Reserved_11_11 at 0 range 11 .. 11;
EE8LTCH at 0 range 12 .. 12;
EE8FLTR at 0 range 13 .. 16;
Reserved_17_17 at 0 range 17 .. 17;
EE9LTCH at 0 range 18 .. 18;
EE9FLTR at 0 range 19 .. 22;
Reserved_23_23 at 0 range 23 .. 23;
EE10LTCH at 0 range 24 .. 24;
EE10FLTR at 0 range 25 .. 28;
Reserved_29_31 at 0 range 29 .. 31;
end record;
-- RSTDR_CMP array
type RSTDR_CMP_Field_Array is array (2 .. 3) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for RSTDR_CMP
type RSTDR_CMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- CMP as a value
Val : HAL.UInt2;
when True =>
-- CMP as an array
Arr : RSTDR_CMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for RSTDR_CMP_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- RSTDR_MSTCMP array
type RSTDR_MSTCMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for RSTDR_MSTCMP
type RSTDR_MSTCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MSTCMP as a value
Val : HAL.UInt4;
when True =>
-- MSTCMP as an array
Arr : RSTDR_MSTCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for RSTDR_MSTCMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- RSTDR_EXTEVNT array
type RSTDR_EXTEVNT_Field_Array is array (1 .. 10) of Boolean
with Component_Size => 1, Size => 10;
-- Type definition for RSTDR_EXTEVNT
type RSTDR_EXTEVNT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- EXTEVNT as a value
Val : HAL.UInt10;
when True =>
-- EXTEVNT as an array
Arr : RSTDR_EXTEVNT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 10;
for RSTDR_EXTEVNT_Field use record
Val at 0 range 0 .. 9;
Arr at 0 range 0 .. 9;
end record;
-- RSTDR_TIMACMP array
type RSTDR_TIMACMP_Field_Array is array (1 .. 3) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for RSTDR_TIMACMP
type RSTDR_TIMACMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TIMACMP as a value
Val : HAL.UInt3;
when True =>
-- TIMACMP as an array
Arr : RSTDR_TIMACMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 3;
for RSTDR_TIMACMP_Field use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- RSTDR_TIMBCMP array
type RSTDR_TIMBCMP_Field_Array is array (1 .. 3) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for RSTDR_TIMBCMP
type RSTDR_TIMBCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TIMBCMP as a value
Val : HAL.UInt3;
when True =>
-- TIMBCMP as an array
Arr : RSTDR_TIMBCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 3;
for RSTDR_TIMBCMP_Field use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- RSTDR_TIMCCMP array
type RSTDR_TIMCCMP_Field_Array is array (1 .. 3) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for RSTDR_TIMCCMP
type RSTDR_TIMCCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TIMCCMP as a value
Val : HAL.UInt3;
when True =>
-- TIMCCMP as an array
Arr : RSTDR_TIMCCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 3;
for RSTDR_TIMCCMP_Field use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- RSTDR_TIMECMP array
type RSTDR_TIMECMP_Field_Array is array (1 .. 3) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for RSTDR_TIMECMP
type RSTDR_TIMECMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TIMECMP as a value
Val : HAL.UInt3;
when True =>
-- TIMECMP as an array
Arr : RSTDR_TIMECMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 3;
for RSTDR_TIMECMP_Field use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- TimerA Reset Register
type RSTDR_Register is record
-- unspecified
Reserved_0_0 : HAL.Bit := 16#0#;
-- Timer A Update reset
UPDT : Boolean := False;
-- Timer A compare 2 reset
CMP : RSTDR_CMP_Field := (As_Array => False, Val => 16#0#);
-- Master timer Period
MSTPER : Boolean := False;
-- Master compare 1
MSTCMP : RSTDR_MSTCMP_Field :=
(As_Array => False, Val => 16#0#);
-- External Event 1
EXTEVNT : RSTDR_EXTEVNT_Field :=
(As_Array => False, Val => 16#0#);
-- Timer A Compare 1
TIMACMP : RSTDR_TIMACMP_Field :=
(As_Array => False, Val => 16#0#);
-- Timer B Compare 1
TIMBCMP : RSTDR_TIMBCMP_Field :=
(As_Array => False, Val => 16#0#);
-- Timer C Compare 1
TIMCCMP : RSTDR_TIMCCMP_Field :=
(As_Array => False, Val => 16#0#);
-- Timer E Compare 1
TIMECMP : RSTDR_TIMECMP_Field :=
(As_Array => False, Val => 16#0#);
-- unspecified
Reserved_31_31 : HAL.Bit := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for RSTDR_Register use record
Reserved_0_0 at 0 range 0 .. 0;
UPDT at 0 range 1 .. 1;
CMP at 0 range 2 .. 3;
MSTPER at 0 range 4 .. 4;
MSTCMP at 0 range 5 .. 8;
EXTEVNT at 0 range 9 .. 18;
TIMACMP at 0 range 19 .. 21;
TIMBCMP at 0 range 22 .. 24;
TIMCCMP at 0 range 25 .. 27;
TIMECMP at 0 range 28 .. 30;
Reserved_31_31 at 0 range 31 .. 31;
end record;
subtype CHPDR_CHPFRQ_Field is HAL.UInt4;
subtype CHPDR_CHPDTY_Field is HAL.UInt3;
subtype CHPDR_STRTPW_Field is HAL.UInt4;
-- Timerx Chopper Register
type CHPDR_Register is record
-- Timerx carrier frequency value
CHPFRQ : CHPDR_CHPFRQ_Field := 16#0#;
-- Timerx chopper duty cycle value
CHPDTY : CHPDR_CHPDTY_Field := 16#0#;
-- STRTPW
STRTPW : CHPDR_STRTPW_Field := 16#0#;
-- unspecified
Reserved_11_31 : HAL.UInt21 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CHPDR_Register use record
CHPFRQ at 0 range 0 .. 3;
CHPDTY at 0 range 4 .. 6;
STRTPW at 0 range 7 .. 10;
Reserved_11_31 at 0 range 11 .. 31;
end record;
-- CPT1DCR_TACMP array
type CPT1DCR_TACMP_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for CPT1DCR_TACMP
type CPT1DCR_TACMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TACMP as a value
Val : HAL.UInt2;
when True =>
-- TACMP as an array
Arr : CPT1DCR_TACMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for CPT1DCR_TACMP_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- CPT1DCR_TBCMP array
type CPT1DCR_TBCMP_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for CPT1DCR_TBCMP
type CPT1DCR_TBCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TBCMP as a value
Val : HAL.UInt2;
when True =>
-- TBCMP as an array
Arr : CPT1DCR_TBCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for CPT1DCR_TBCMP_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- CPT1DCR_TCCMP array
type CPT1DCR_TCCMP_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for CPT1DCR_TCCMP
type CPT1DCR_TCCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TCCMP as a value
Val : HAL.UInt2;
when True =>
-- TCCMP as an array
Arr : CPT1DCR_TCCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for CPT1DCR_TCCMP_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- CPT1DCR_TECMP array
type CPT1DCR_TECMP_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for CPT1DCR_TECMP
type CPT1DCR_TECMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TECMP as a value
Val : HAL.UInt2;
when True =>
-- TECMP as an array
Arr : CPT1DCR_TECMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for CPT1DCR_TECMP_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- Timerx Capture 2 Control Register
type CPT1DCR_Register is record
-- Software Capture
SWCPT : Boolean := False;
-- Update Capture
UDPCPT : Boolean := False;
-- External Event 1 Capture
EXEV1CPT : Boolean := False;
-- External Event 2 Capture
EXEV2CPT : Boolean := False;
-- External Event 3 Capture
EXEV3CPT : Boolean := False;
-- External Event 4 Capture
EXEV4CPT : Boolean := False;
-- External Event 5 Capture
EXEV5CPT : Boolean := False;
-- External Event 6 Capture
EXEV6CPT : Boolean := False;
-- External Event 7 Capture
EXEV7CPT : Boolean := False;
-- External Event 8 Capture
EXEV8CPT : Boolean := False;
-- External Event 9 Capture
EXEV9CPT : Boolean := False;
-- External Event 10 Capture
EXEV10CPT : Boolean := False;
-- Timer A output 1 Set
TA1SET : Boolean := False;
-- Timer A output 1 Reset
TA1RST : Boolean := False;
-- Timer A Compare 1
TACMP : CPT1DCR_TACMP_Field :=
(As_Array => False, Val => 16#0#);
-- Timer B output 1 Set
TB1SET : Boolean := False;
-- Timer B output 1 Reset
TB1RST : Boolean := False;
-- Timer B Compare 1
TBCMP : CPT1DCR_TBCMP_Field :=
(As_Array => False, Val => 16#0#);
-- Timer C output 1 Set
TC1SET : Boolean := False;
-- Timer C output 1 Reset
TC1RST : Boolean := False;
-- Timer C Compare 1
TCCMP : CPT1DCR_TCCMP_Field :=
(As_Array => False, Val => 16#0#);
-- unspecified
Reserved_24_27 : HAL.UInt4 := 16#0#;
-- Timer E output 1 Set
TE1SET : Boolean := False;
-- Timer E output 1 Reset
TE1RST : Boolean := False;
-- Timer E Compare 1
TECMP : CPT1DCR_TECMP_Field :=
(As_Array => False, Val => 16#0#);
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CPT1DCR_Register use record
SWCPT at 0 range 0 .. 0;
UDPCPT at 0 range 1 .. 1;
EXEV1CPT at 0 range 2 .. 2;
EXEV2CPT at 0 range 3 .. 3;
EXEV3CPT at 0 range 4 .. 4;
EXEV4CPT at 0 range 5 .. 5;
EXEV5CPT at 0 range 6 .. 6;
EXEV6CPT at 0 range 7 .. 7;
EXEV7CPT at 0 range 8 .. 8;
EXEV8CPT at 0 range 9 .. 9;
EXEV9CPT at 0 range 10 .. 10;
EXEV10CPT at 0 range 11 .. 11;
TA1SET at 0 range 12 .. 12;
TA1RST at 0 range 13 .. 13;
TACMP at 0 range 14 .. 15;
TB1SET at 0 range 16 .. 16;
TB1RST at 0 range 17 .. 17;
TBCMP at 0 range 18 .. 19;
TC1SET at 0 range 20 .. 20;
TC1RST at 0 range 21 .. 21;
TCCMP at 0 range 22 .. 23;
Reserved_24_27 at 0 range 24 .. 27;
TE1SET at 0 range 28 .. 28;
TE1RST at 0 range 29 .. 29;
TECMP at 0 range 30 .. 31;
end record;
-- CPT2DCR_TACMP array
type CPT2DCR_TACMP_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for CPT2DCR_TACMP
type CPT2DCR_TACMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TACMP as a value
Val : HAL.UInt2;
when True =>
-- TACMP as an array
Arr : CPT2DCR_TACMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for CPT2DCR_TACMP_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- CPT2DCR_TBCMP array
type CPT2DCR_TBCMP_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for CPT2DCR_TBCMP
type CPT2DCR_TBCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TBCMP as a value
Val : HAL.UInt2;
when True =>
-- TBCMP as an array
Arr : CPT2DCR_TBCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for CPT2DCR_TBCMP_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- CPT2DCR_TCCMP array
type CPT2DCR_TCCMP_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for CPT2DCR_TCCMP
type CPT2DCR_TCCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TCCMP as a value
Val : HAL.UInt2;
when True =>
-- TCCMP as an array
Arr : CPT2DCR_TCCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for CPT2DCR_TCCMP_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- CPT2DCR_TECMP array
type CPT2DCR_TECMP_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for CPT2DCR_TECMP
type CPT2DCR_TECMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TECMP as a value
Val : HAL.UInt2;
when True =>
-- TECMP as an array
Arr : CPT2DCR_TECMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for CPT2DCR_TECMP_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- CPT2xCR
type CPT2DCR_Register is record
-- Software Capture
SWCPT : Boolean := False;
-- Update Capture
UDPCPT : Boolean := False;
-- External Event 1 Capture
EXEV1CPT : Boolean := False;
-- External Event 2 Capture
EXEV2CPT : Boolean := False;
-- External Event 3 Capture
EXEV3CPT : Boolean := False;
-- External Event 4 Capture
EXEV4CPT : Boolean := False;
-- External Event 5 Capture
EXEV5CPT : Boolean := False;
-- External Event 6 Capture
EXEV6CPT : Boolean := False;
-- External Event 7 Capture
EXEV7CPT : Boolean := False;
-- External Event 8 Capture
EXEV8CPT : Boolean := False;
-- External Event 9 Capture
EXEV9CPT : Boolean := False;
-- External Event 10 Capture
EXEV10CPT : Boolean := False;
-- Timer A output 1 Set
TA1SET : Boolean := False;
-- Timer A output 1 Reset
TA1RST : Boolean := False;
-- Timer A Compare 1
TACMP : CPT2DCR_TACMP_Field :=
(As_Array => False, Val => 16#0#);
-- Timer B output 1 Set
TB1SET : Boolean := False;
-- Timer B output 1 Reset
TB1RST : Boolean := False;
-- Timer B Compare 1
TBCMP : CPT2DCR_TBCMP_Field :=
(As_Array => False, Val => 16#0#);
-- Timer C output 1 Set
TC1SET : Boolean := False;
-- Timer C output 1 Reset
TC1RST : Boolean := False;
-- Timer C Compare 1
TCCMP : CPT2DCR_TCCMP_Field :=
(As_Array => False, Val => 16#0#);
-- unspecified
Reserved_24_27 : HAL.UInt4 := 16#0#;
-- Timer E output 1 Set
TE1SET : Boolean := False;
-- Timer E output 1 Reset
TE1RST : Boolean := False;
-- Timer E Compare 1
TECMP : CPT2DCR_TECMP_Field :=
(As_Array => False, Val => 16#0#);
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CPT2DCR_Register use record
SWCPT at 0 range 0 .. 0;
UDPCPT at 0 range 1 .. 1;
EXEV1CPT at 0 range 2 .. 2;
EXEV2CPT at 0 range 3 .. 3;
EXEV3CPT at 0 range 4 .. 4;
EXEV4CPT at 0 range 5 .. 5;
EXEV5CPT at 0 range 6 .. 6;
EXEV6CPT at 0 range 7 .. 7;
EXEV7CPT at 0 range 8 .. 8;
EXEV8CPT at 0 range 9 .. 9;
EXEV9CPT at 0 range 10 .. 10;
EXEV10CPT at 0 range 11 .. 11;
TA1SET at 0 range 12 .. 12;
TA1RST at 0 range 13 .. 13;
TACMP at 0 range 14 .. 15;
TB1SET at 0 range 16 .. 16;
TB1RST at 0 range 17 .. 17;
TBCMP at 0 range 18 .. 19;
TC1SET at 0 range 20 .. 20;
TC1RST at 0 range 21 .. 21;
TCCMP at 0 range 22 .. 23;
Reserved_24_27 at 0 range 24 .. 27;
TE1SET at 0 range 28 .. 28;
TE1RST at 0 range 29 .. 29;
TECMP at 0 range 30 .. 31;
end record;
subtype OUTDR_FAULT1_Field is HAL.UInt2;
subtype OUTDR_DLYPRT_Field is HAL.UInt3;
subtype OUTDR_FAULT2_Field is HAL.UInt2;
-- Timerx Output Register
type OUTDR_Register is record
-- unspecified
Reserved_0_0 : HAL.Bit := 16#0#;
-- Output 1 polarity
POL1 : Boolean := False;
-- Output 1 Idle mode
IDLEM1 : Boolean := False;
-- Output 1 Idle State
IDLES1 : Boolean := False;
-- Output 1 Fault state
FAULT1 : OUTDR_FAULT1_Field := 16#0#;
-- Output 1 Chopper enable
CHP1 : Boolean := False;
-- Output 1 Deadtime upon burst mode Idle entry
DIDL1 : Boolean := False;
-- Deadtime enable
DTEN : Boolean := False;
-- Delayed Protection Enable
DLYPRTEN : Boolean := False;
-- Delayed Protection
DLYPRT : OUTDR_DLYPRT_Field := 16#0#;
-- unspecified
Reserved_13_16 : HAL.UInt4 := 16#0#;
-- Output 2 polarity
POL2 : Boolean := False;
-- Output 2 Idle mode
IDLEM2 : Boolean := False;
-- Output 2 Idle State
IDLES2 : Boolean := False;
-- Output 2 Fault state
FAULT2 : OUTDR_FAULT2_Field := 16#0#;
-- Output 2 Chopper enable
CHP2 : Boolean := False;
-- Output 2 Deadtime upon burst mode Idle entry
DIDL2 : Boolean := False;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for OUTDR_Register use record
Reserved_0_0 at 0 range 0 .. 0;
POL1 at 0 range 1 .. 1;
IDLEM1 at 0 range 2 .. 2;
IDLES1 at 0 range 3 .. 3;
FAULT1 at 0 range 4 .. 5;
CHP1 at 0 range 6 .. 6;
DIDL1 at 0 range 7 .. 7;
DTEN at 0 range 8 .. 8;
DLYPRTEN at 0 range 9 .. 9;
DLYPRT at 0 range 10 .. 12;
Reserved_13_16 at 0 range 13 .. 16;
POL2 at 0 range 17 .. 17;
IDLEM2 at 0 range 18 .. 18;
IDLES2 at 0 range 19 .. 19;
FAULT2 at 0 range 20 .. 21;
CHP2 at 0 range 22 .. 22;
DIDL2 at 0 range 23 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
-- Timerx Fault Register
type FLTDR_Register is record
-- Fault 1 enable
FLT1EN : Boolean := False;
-- Fault 2 enable
FLT2EN : Boolean := False;
-- Fault 3 enable
FLT3EN : Boolean := False;
-- Fault 4 enable
FLT4EN : Boolean := False;
-- Fault 5 enable
FLT5EN : Boolean := False;
-- unspecified
Reserved_5_30 : HAL.UInt26 := 16#0#;
-- Fault sources Lock
FLTLCK : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for FLTDR_Register use record
FLT1EN at 0 range 0 .. 0;
FLT2EN at 0 range 1 .. 1;
FLT3EN at 0 range 2 .. 2;
FLT4EN at 0 range 3 .. 3;
FLT5EN at 0 range 4 .. 4;
Reserved_5_30 at 0 range 5 .. 30;
FLTLCK at 0 range 31 .. 31;
end record;
subtype TIMECR_CKPSCx_Field is HAL.UInt3;
-- TIMECR_DELCMP array element
subtype TIMECR_DELCMP_Element is HAL.UInt2;
-- TIMECR_DELCMP array
type TIMECR_DELCMP_Field_Array is array (2 .. 3) of TIMECR_DELCMP_Element
with Component_Size => 2, Size => 4;
-- Type definition for TIMECR_DELCMP
type TIMECR_DELCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- DELCMP as a value
Val : HAL.UInt4;
when True =>
-- DELCMP as an array
Arr : TIMECR_DELCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for TIMECR_DELCMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
subtype TIMECR_DACSYNC_Field is HAL.UInt2;
subtype TIMECR_UPDGAT_Field is HAL.UInt4;
-- Timerx Control Register
type TIMECR_Register is record
-- HRTIM Timer x Clock prescaler
CKPSCx : TIMECR_CKPSCx_Field := 16#0#;
-- Continuous mode
CONT : Boolean := False;
-- Re-triggerable mode
RETRIG : Boolean := False;
-- Half mode enable
HALF : Boolean := False;
-- Push-Pull mode enable
PSHPLL : Boolean := False;
-- unspecified
Reserved_7_9 : HAL.UInt3 := 16#0#;
-- Synchronization Resets Timer x
SYNCRSTx : Boolean := False;
-- Synchronization Starts Timer x
SYNCSTRTx : Boolean := False;
-- Delayed CMP2 mode
DELCMP : TIMECR_DELCMP_Field :=
(As_Array => False, Val => 16#0#);
-- unspecified
Reserved_16_16 : HAL.Bit := 16#0#;
-- Timer x Repetition update
TxREPU : Boolean := False;
-- Timerx reset update
TxRSTU : Boolean := False;
-- unspecified
Reserved_19_19 : HAL.Bit := 16#0#;
-- TBU
TBU : Boolean := False;
-- TCU
TCU : Boolean := False;
-- TDU
TDU : Boolean := False;
-- TEU
TEU : Boolean := False;
-- Master Timer update
MSTU : Boolean := False;
-- AC Synchronization
DACSYNC : TIMECR_DACSYNC_Field := 16#0#;
-- Preload enable
PREEN : Boolean := False;
-- Update Gating
UPDGAT : TIMECR_UPDGAT_Field := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TIMECR_Register use record
CKPSCx at 0 range 0 .. 2;
CONT at 0 range 3 .. 3;
RETRIG at 0 range 4 .. 4;
HALF at 0 range 5 .. 5;
PSHPLL at 0 range 6 .. 6;
Reserved_7_9 at 0 range 7 .. 9;
SYNCRSTx at 0 range 10 .. 10;
SYNCSTRTx at 0 range 11 .. 11;
DELCMP at 0 range 12 .. 15;
Reserved_16_16 at 0 range 16 .. 16;
TxREPU at 0 range 17 .. 17;
TxRSTU at 0 range 18 .. 18;
Reserved_19_19 at 0 range 19 .. 19;
TBU at 0 range 20 .. 20;
TCU at 0 range 21 .. 21;
TDU at 0 range 22 .. 22;
TEU at 0 range 23 .. 23;
MSTU at 0 range 24 .. 24;
DACSYNC at 0 range 25 .. 26;
PREEN at 0 range 27 .. 27;
UPDGAT at 0 range 28 .. 31;
end record;
-- TIMEISR_CMP array
type TIMEISR_CMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for TIMEISR_CMP
type TIMEISR_CMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- CMP as a value
Val : HAL.UInt4;
when True =>
-- CMP as an array
Arr : TIMEISR_CMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for TIMEISR_CMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- TIMEISR_CPT array
type TIMEISR_CPT_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for TIMEISR_CPT
type TIMEISR_CPT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- CPT as a value
Val : HAL.UInt2;
when True =>
-- CPT as an array
Arr : TIMEISR_CPT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for TIMEISR_CPT_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- Timerx Interrupt Status Register
type TIMEISR_Register is record
-- Read-only. Compare 1 Interrupt Flag
CMP : TIMEISR_CMP_Field;
-- Read-only. Repetition Interrupt Flag
REP : Boolean;
-- unspecified
Reserved_5_5 : HAL.Bit;
-- Read-only. Update Interrupt Flag
UPD : Boolean;
-- Read-only. Capture1 Interrupt Flag
CPT : TIMEISR_CPT_Field;
-- Read-only. Output 1 Set Interrupt Flag
SETx1 : Boolean;
-- Read-only. Output 1 Reset Interrupt Flag
RSTx1 : Boolean;
-- Read-only. Output 2 Set Interrupt Flag
SETx2 : Boolean;
-- Read-only. Output 2 Reset Interrupt Flag
RSTx2 : Boolean;
-- Read-only. Reset Interrupt Flag
RST : Boolean;
-- Read-only. Delayed Protection Flag
DLYPRT : Boolean;
-- unspecified
Reserved_15_15 : HAL.Bit;
-- Read-only. Current Push Pull Status
CPPSTAT : Boolean;
-- Read-only. Idle Push Pull Status
IPPSTAT : Boolean;
-- Read-only. Output 1 State
O1STAT : Boolean;
-- Read-only. Output 2 State
O2STAT : Boolean;
-- unspecified
Reserved_20_31 : HAL.UInt12;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TIMEISR_Register use record
CMP at 0 range 0 .. 3;
REP at 0 range 4 .. 4;
Reserved_5_5 at 0 range 5 .. 5;
UPD at 0 range 6 .. 6;
CPT at 0 range 7 .. 8;
SETx1 at 0 range 9 .. 9;
RSTx1 at 0 range 10 .. 10;
SETx2 at 0 range 11 .. 11;
RSTx2 at 0 range 12 .. 12;
RST at 0 range 13 .. 13;
DLYPRT at 0 range 14 .. 14;
Reserved_15_15 at 0 range 15 .. 15;
CPPSTAT at 0 range 16 .. 16;
IPPSTAT at 0 range 17 .. 17;
O1STAT at 0 range 18 .. 18;
O2STAT at 0 range 19 .. 19;
Reserved_20_31 at 0 range 20 .. 31;
end record;
-- Timerx Interrupt Clear Register
type TIMEICR_Register is record
-- Write-only. Compare 1 Interrupt flag Clear
CMP1C : Boolean := False;
-- Write-only. Compare 2 Interrupt flag Clear
CMP2C : Boolean := False;
-- Write-only. Compare 3 Interrupt flag Clear
CMP3C : Boolean := False;
-- Write-only. Compare 4 Interrupt flag Clear
CMP4C : Boolean := False;
-- Write-only. Repetition Interrupt flag Clear
REPC : Boolean := False;
-- unspecified
Reserved_5_5 : HAL.Bit := 16#0#;
-- Write-only. Update Interrupt flag Clear
UPDC : Boolean := False;
-- Write-only. Capture1 Interrupt flag Clear
CPT1C : Boolean := False;
-- Write-only. Capture2 Interrupt flag Clear
CPT2C : Boolean := False;
-- Write-only. Output 1 Set flag Clear
SET1xC : Boolean := False;
-- Write-only. Output 1 Reset flag Clear
RSTx1C : Boolean := False;
-- Write-only. Output 2 Set flag Clear
SET2xC : Boolean := False;
-- Write-only. Output 2 Reset flag Clear
RSTx2C : Boolean := False;
-- Write-only. Reset Interrupt flag Clear
RSTC : Boolean := False;
-- Write-only. Delayed Protection Flag Clear
DLYPRTC : Boolean := False;
-- unspecified
Reserved_15_31 : HAL.UInt17 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TIMEICR_Register use record
CMP1C at 0 range 0 .. 0;
CMP2C at 0 range 1 .. 1;
CMP3C at 0 range 2 .. 2;
CMP4C at 0 range 3 .. 3;
REPC at 0 range 4 .. 4;
Reserved_5_5 at 0 range 5 .. 5;
UPDC at 0 range 6 .. 6;
CPT1C at 0 range 7 .. 7;
CPT2C at 0 range 8 .. 8;
SET1xC at 0 range 9 .. 9;
RSTx1C at 0 range 10 .. 10;
SET2xC at 0 range 11 .. 11;
RSTx2C at 0 range 12 .. 12;
RSTC at 0 range 13 .. 13;
DLYPRTC at 0 range 14 .. 14;
Reserved_15_31 at 0 range 15 .. 31;
end record;
-- TIMxDIER
type TIMEDIER_Register is record
-- CMP1IE
CMP1IE : Boolean := False;
-- CMP2IE
CMP2IE : Boolean := False;
-- CMP3IE
CMP3IE : Boolean := False;
-- CMP4IE
CMP4IE : Boolean := False;
-- REPIE
REPIE : Boolean := False;
-- unspecified
Reserved_5_5 : HAL.Bit := 16#0#;
-- UPDIE
UPDIE : Boolean := False;
-- CPT1IE
CPT1IE : Boolean := False;
-- CPT2IE
CPT2IE : Boolean := False;
-- SET1xIE
SET1xIE : Boolean := False;
-- RSTx1IE
RSTx1IE : Boolean := False;
-- SETx2IE
SETx2IE : Boolean := False;
-- RSTx2IE
RSTx2IE : Boolean := False;
-- RSTIE
RSTIE : Boolean := False;
-- DLYPRTIE
DLYPRTIE : Boolean := False;
-- unspecified
Reserved_15_15 : HAL.Bit := 16#0#;
-- CMP1DE
CMP1DE : Boolean := False;
-- CMP2DE
CMP2DE : Boolean := False;
-- CMP3DE
CMP3DE : Boolean := False;
-- CMP4DE
CMP4DE : Boolean := False;
-- REPDE
REPDE : Boolean := False;
-- unspecified
Reserved_21_21 : HAL.Bit := 16#0#;
-- UPDDE
UPDDE : Boolean := False;
-- CPT1DE
CPT1DE : Boolean := False;
-- CPT2DE
CPT2DE : Boolean := False;
-- SET1xDE
SET1xDE : Boolean := False;
-- RSTx1DE
RSTx1DE : Boolean := False;
-- SETx2DE
SETx2DE : Boolean := False;
-- RSTx2DE
RSTx2DE : Boolean := False;
-- RSTDE
RSTDE : Boolean := False;
-- DLYPRTDE
DLYPRTDE : Boolean := False;
-- unspecified
Reserved_31_31 : HAL.Bit := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TIMEDIER_Register use record
CMP1IE at 0 range 0 .. 0;
CMP2IE at 0 range 1 .. 1;
CMP3IE at 0 range 2 .. 2;
CMP4IE at 0 range 3 .. 3;
REPIE at 0 range 4 .. 4;
Reserved_5_5 at 0 range 5 .. 5;
UPDIE at 0 range 6 .. 6;
CPT1IE at 0 range 7 .. 7;
CPT2IE at 0 range 8 .. 8;
SET1xIE at 0 range 9 .. 9;
RSTx1IE at 0 range 10 .. 10;
SETx2IE at 0 range 11 .. 11;
RSTx2IE at 0 range 12 .. 12;
RSTIE at 0 range 13 .. 13;
DLYPRTIE at 0 range 14 .. 14;
Reserved_15_15 at 0 range 15 .. 15;
CMP1DE at 0 range 16 .. 16;
CMP2DE at 0 range 17 .. 17;
CMP3DE at 0 range 18 .. 18;
CMP4DE at 0 range 19 .. 19;
REPDE at 0 range 20 .. 20;
Reserved_21_21 at 0 range 21 .. 21;
UPDDE at 0 range 22 .. 22;
CPT1DE at 0 range 23 .. 23;
CPT2DE at 0 range 24 .. 24;
SET1xDE at 0 range 25 .. 25;
RSTx1DE at 0 range 26 .. 26;
SETx2DE at 0 range 27 .. 27;
RSTx2DE at 0 range 28 .. 28;
RSTDE at 0 range 29 .. 29;
DLYPRTDE at 0 range 30 .. 30;
Reserved_31_31 at 0 range 31 .. 31;
end record;
subtype CNTER_CNTx_Field is HAL.UInt16;
-- Timerx Counter Register
type CNTER_Register is record
-- Timerx Counter value
CNTx : CNTER_CNTx_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CNTER_Register use record
CNTx at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype PERER_PERx_Field is HAL.UInt16;
-- Timerx Period Register
type PERER_Register is record
-- Timerx Period value
PERx : PERER_PERx_Field := 16#FFFF#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for PERER_Register use record
PERx at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype REPER_REPx_Field is HAL.UInt8;
-- Timerx Repetition Register
type REPER_Register is record
-- Timerx Repetition counter value
REPx : REPER_REPx_Field := 16#0#;
-- unspecified
Reserved_8_31 : HAL.UInt24 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for REPER_Register use record
REPx at 0 range 0 .. 7;
Reserved_8_31 at 0 range 8 .. 31;
end record;
subtype CMP1ER_CMP1x_Field is HAL.UInt16;
-- Timerx Compare 1 Register
type CMP1ER_Register is record
-- Timerx Compare 1 value
CMP1x : CMP1ER_CMP1x_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CMP1ER_Register use record
CMP1x at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype CMP1CER_CMP1x_Field is HAL.UInt16;
subtype CMP1CER_REPx_Field is HAL.UInt8;
-- Timerx Compare 1 Compound Register
type CMP1CER_Register is record
-- Timerx Compare 1 value
CMP1x : CMP1CER_CMP1x_Field := 16#0#;
-- Timerx Repetition value (aliased from HRTIM_REPx register)
REPx : CMP1CER_REPx_Field := 16#0#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CMP1CER_Register use record
CMP1x at 0 range 0 .. 15;
REPx at 0 range 16 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
subtype CMP2ER_CMP2x_Field is HAL.UInt16;
-- Timerx Compare 2 Register
type CMP2ER_Register is record
-- Timerx Compare 2 value
CMP2x : CMP2ER_CMP2x_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CMP2ER_Register use record
CMP2x at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype CMP3ER_CMP3x_Field is HAL.UInt16;
-- Timerx Compare 3 Register
type CMP3ER_Register is record
-- Timerx Compare 3 value
CMP3x : CMP3ER_CMP3x_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CMP3ER_Register use record
CMP3x at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype CMP4ER_CMP4x_Field is HAL.UInt16;
-- Timerx Compare 4 Register
type CMP4ER_Register is record
-- Timerx Compare 4 value
CMP4x : CMP4ER_CMP4x_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CMP4ER_Register use record
CMP4x at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype CPT1ER_CPT1x_Field is HAL.UInt16;
-- Timerx Capture 1 Register
type CPT1ER_Register is record
-- Read-only. Timerx Capture 1 value
CPT1x : CPT1ER_CPT1x_Field;
-- unspecified
Reserved_16_31 : HAL.UInt16;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CPT1ER_Register use record
CPT1x at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype CPT2ER_CPT2x_Field is HAL.UInt16;
-- Timerx Capture 2 Register
type CPT2ER_Register is record
-- Read-only. Timerx Capture 2 value
CPT2x : CPT2ER_CPT2x_Field;
-- unspecified
Reserved_16_31 : HAL.UInt16;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CPT2ER_Register use record
CPT2x at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype DTER_DTRx_Field is HAL.UInt9;
subtype DTER_DTPRSC_Field is HAL.UInt3;
subtype DTER_DTFx_Field is HAL.UInt9;
-- Timerx Deadtime Register
type DTER_Register is record
-- Deadtime Rising value
DTRx : DTER_DTRx_Field := 16#0#;
-- Sign Deadtime Rising value
SDTRx : Boolean := False;
-- Deadtime Prescaler
DTPRSC : DTER_DTPRSC_Field := 16#0#;
-- unspecified
Reserved_13_13 : HAL.Bit := 16#0#;
-- Deadtime Rising Sign Lock
DTRSLKx : Boolean := False;
-- Deadtime Rising Lock
DTRLKx : Boolean := False;
-- Deadtime Falling value
DTFx : DTER_DTFx_Field := 16#0#;
-- Sign Deadtime Falling value
SDTFx : Boolean := False;
-- unspecified
Reserved_26_29 : HAL.UInt4 := 16#0#;
-- Deadtime Falling Sign Lock
DTFSLKx : Boolean := False;
-- Deadtime Falling Lock
DTFLKx : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for DTER_Register use record
DTRx at 0 range 0 .. 8;
SDTRx at 0 range 9 .. 9;
DTPRSC at 0 range 10 .. 12;
Reserved_13_13 at 0 range 13 .. 13;
DTRSLKx at 0 range 14 .. 14;
DTRLKx at 0 range 15 .. 15;
DTFx at 0 range 16 .. 24;
SDTFx at 0 range 25 .. 25;
Reserved_26_29 at 0 range 26 .. 29;
DTFSLKx at 0 range 30 .. 30;
DTFLKx at 0 range 31 .. 31;
end record;
-- SETE1R_CMP array
type SETE1R_CMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for SETE1R_CMP
type SETE1R_CMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- CMP as a value
Val : HAL.UInt4;
when True =>
-- CMP as an array
Arr : SETE1R_CMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for SETE1R_CMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- SETE1R_MSTCMP array
type SETE1R_MSTCMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for SETE1R_MSTCMP
type SETE1R_MSTCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MSTCMP as a value
Val : HAL.UInt4;
when True =>
-- MSTCMP as an array
Arr : SETE1R_MSTCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for SETE1R_MSTCMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- SETE1R_TIMEVNT array
type SETE1R_TIMEVNT_Field_Array is array (1 .. 9) of Boolean
with Component_Size => 1, Size => 9;
-- Type definition for SETE1R_TIMEVNT
type SETE1R_TIMEVNT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TIMEVNT as a value
Val : HAL.UInt9;
when True =>
-- TIMEVNT as an array
Arr : SETE1R_TIMEVNT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 9;
for SETE1R_TIMEVNT_Field use record
Val at 0 range 0 .. 8;
Arr at 0 range 0 .. 8;
end record;
-- SETE1R_EXTEVNT array
type SETE1R_EXTEVNT_Field_Array is array (1 .. 10) of Boolean
with Component_Size => 1, Size => 10;
-- Type definition for SETE1R_EXTEVNT
type SETE1R_EXTEVNT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- EXTEVNT as a value
Val : HAL.UInt10;
when True =>
-- EXTEVNT as an array
Arr : SETE1R_EXTEVNT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 10;
for SETE1R_EXTEVNT_Field use record
Val at 0 range 0 .. 9;
Arr at 0 range 0 .. 9;
end record;
-- Timerx Output1 Set Register
type SETE1R_Register is record
-- Software Set trigger
SST : Boolean := False;
-- Timer A resynchronizaton
RESYNC : Boolean := False;
-- Timer A Period
PER : Boolean := False;
-- Timer A compare 1
CMP : SETE1R_CMP_Field := (As_Array => False, Val => 16#0#);
-- Master Period
MSTPER : Boolean := False;
-- Master Compare 1
MSTCMP : SETE1R_MSTCMP_Field := (As_Array => False, Val => 16#0#);
-- Timer Event 1
TIMEVNT : SETE1R_TIMEVNT_Field := (As_Array => False, Val => 16#0#);
-- External Event 1
EXTEVNT : SETE1R_EXTEVNT_Field := (As_Array => False, Val => 16#0#);
-- Registers update (transfer preload to active)
UPDATE : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for SETE1R_Register use record
SST at 0 range 0 .. 0;
RESYNC at 0 range 1 .. 1;
PER at 0 range 2 .. 2;
CMP at 0 range 3 .. 6;
MSTPER at 0 range 7 .. 7;
MSTCMP at 0 range 8 .. 11;
TIMEVNT at 0 range 12 .. 20;
EXTEVNT at 0 range 21 .. 30;
UPDATE at 0 range 31 .. 31;
end record;
-- RSTE1R_CMP array
type RSTE1R_CMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for RSTE1R_CMP
type RSTE1R_CMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- CMP as a value
Val : HAL.UInt4;
when True =>
-- CMP as an array
Arr : RSTE1R_CMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for RSTE1R_CMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- RSTE1R_MSTCMP array
type RSTE1R_MSTCMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for RSTE1R_MSTCMP
type RSTE1R_MSTCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MSTCMP as a value
Val : HAL.UInt4;
when True =>
-- MSTCMP as an array
Arr : RSTE1R_MSTCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for RSTE1R_MSTCMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- RSTE1R_TIMEVNT array
type RSTE1R_TIMEVNT_Field_Array is array (1 .. 9) of Boolean
with Component_Size => 1, Size => 9;
-- Type definition for RSTE1R_TIMEVNT
type RSTE1R_TIMEVNT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TIMEVNT as a value
Val : HAL.UInt9;
when True =>
-- TIMEVNT as an array
Arr : RSTE1R_TIMEVNT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 9;
for RSTE1R_TIMEVNT_Field use record
Val at 0 range 0 .. 8;
Arr at 0 range 0 .. 8;
end record;
-- RSTE1R_EXTEVNT array
type RSTE1R_EXTEVNT_Field_Array is array (1 .. 10) of Boolean
with Component_Size => 1, Size => 10;
-- Type definition for RSTE1R_EXTEVNT
type RSTE1R_EXTEVNT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- EXTEVNT as a value
Val : HAL.UInt10;
when True =>
-- EXTEVNT as an array
Arr : RSTE1R_EXTEVNT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 10;
for RSTE1R_EXTEVNT_Field use record
Val at 0 range 0 .. 9;
Arr at 0 range 0 .. 9;
end record;
-- Timerx Output1 Reset Register
type RSTE1R_Register is record
-- SRT
SRT : Boolean := False;
-- RESYNC
RESYNC : Boolean := False;
-- PER
PER : Boolean := False;
-- CMP1
CMP : RSTE1R_CMP_Field := (As_Array => False, Val => 16#0#);
-- MSTPER
MSTPER : Boolean := False;
-- MSTCMP1
MSTCMP : RSTE1R_MSTCMP_Field := (As_Array => False, Val => 16#0#);
-- TIMEVNT1
TIMEVNT : RSTE1R_TIMEVNT_Field := (As_Array => False, Val => 16#0#);
-- EXTEVNT1
EXTEVNT : RSTE1R_EXTEVNT_Field := (As_Array => False, Val => 16#0#);
-- UPDATE
UPDATE : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for RSTE1R_Register use record
SRT at 0 range 0 .. 0;
RESYNC at 0 range 1 .. 1;
PER at 0 range 2 .. 2;
CMP at 0 range 3 .. 6;
MSTPER at 0 range 7 .. 7;
MSTCMP at 0 range 8 .. 11;
TIMEVNT at 0 range 12 .. 20;
EXTEVNT at 0 range 21 .. 30;
UPDATE at 0 range 31 .. 31;
end record;
-- SETE2R_CMP array
type SETE2R_CMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for SETE2R_CMP
type SETE2R_CMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- CMP as a value
Val : HAL.UInt4;
when True =>
-- CMP as an array
Arr : SETE2R_CMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for SETE2R_CMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- SETE2R_MSTCMP array
type SETE2R_MSTCMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for SETE2R_MSTCMP
type SETE2R_MSTCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MSTCMP as a value
Val : HAL.UInt4;
when True =>
-- MSTCMP as an array
Arr : SETE2R_MSTCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for SETE2R_MSTCMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- SETE2R_TIMEVNT array
type SETE2R_TIMEVNT_Field_Array is array (1 .. 9) of Boolean
with Component_Size => 1, Size => 9;
-- Type definition for SETE2R_TIMEVNT
type SETE2R_TIMEVNT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TIMEVNT as a value
Val : HAL.UInt9;
when True =>
-- TIMEVNT as an array
Arr : SETE2R_TIMEVNT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 9;
for SETE2R_TIMEVNT_Field use record
Val at 0 range 0 .. 8;
Arr at 0 range 0 .. 8;
end record;
-- SETE2R_EXTEVNT array
type SETE2R_EXTEVNT_Field_Array is array (1 .. 10) of Boolean
with Component_Size => 1, Size => 10;
-- Type definition for SETE2R_EXTEVNT
type SETE2R_EXTEVNT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- EXTEVNT as a value
Val : HAL.UInt10;
when True =>
-- EXTEVNT as an array
Arr : SETE2R_EXTEVNT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 10;
for SETE2R_EXTEVNT_Field use record
Val at 0 range 0 .. 9;
Arr at 0 range 0 .. 9;
end record;
-- Timerx Output2 Set Register
type SETE2R_Register is record
-- SST
SST : Boolean := False;
-- RESYNC
RESYNC : Boolean := False;
-- PER
PER : Boolean := False;
-- CMP1
CMP : SETE2R_CMP_Field := (As_Array => False, Val => 16#0#);
-- MSTPER
MSTPER : Boolean := False;
-- MSTCMP1
MSTCMP : SETE2R_MSTCMP_Field := (As_Array => False, Val => 16#0#);
-- TIMEVNT1
TIMEVNT : SETE2R_TIMEVNT_Field := (As_Array => False, Val => 16#0#);
-- EXTEVNT1
EXTEVNT : SETE2R_EXTEVNT_Field := (As_Array => False, Val => 16#0#);
-- UPDATE
UPDATE : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for SETE2R_Register use record
SST at 0 range 0 .. 0;
RESYNC at 0 range 1 .. 1;
PER at 0 range 2 .. 2;
CMP at 0 range 3 .. 6;
MSTPER at 0 range 7 .. 7;
MSTCMP at 0 range 8 .. 11;
TIMEVNT at 0 range 12 .. 20;
EXTEVNT at 0 range 21 .. 30;
UPDATE at 0 range 31 .. 31;
end record;
-- RSTE2R_CMP array
type RSTE2R_CMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for RSTE2R_CMP
type RSTE2R_CMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- CMP as a value
Val : HAL.UInt4;
when True =>
-- CMP as an array
Arr : RSTE2R_CMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for RSTE2R_CMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- RSTE2R_MSTCMP array
type RSTE2R_MSTCMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for RSTE2R_MSTCMP
type RSTE2R_MSTCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MSTCMP as a value
Val : HAL.UInt4;
when True =>
-- MSTCMP as an array
Arr : RSTE2R_MSTCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for RSTE2R_MSTCMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- RSTE2R_TIMEVNT array
type RSTE2R_TIMEVNT_Field_Array is array (1 .. 9) of Boolean
with Component_Size => 1, Size => 9;
-- Type definition for RSTE2R_TIMEVNT
type RSTE2R_TIMEVNT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TIMEVNT as a value
Val : HAL.UInt9;
when True =>
-- TIMEVNT as an array
Arr : RSTE2R_TIMEVNT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 9;
for RSTE2R_TIMEVNT_Field use record
Val at 0 range 0 .. 8;
Arr at 0 range 0 .. 8;
end record;
-- RSTE2R_EXTEVNT array
type RSTE2R_EXTEVNT_Field_Array is array (1 .. 10) of Boolean
with Component_Size => 1, Size => 10;
-- Type definition for RSTE2R_EXTEVNT
type RSTE2R_EXTEVNT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- EXTEVNT as a value
Val : HAL.UInt10;
when True =>
-- EXTEVNT as an array
Arr : RSTE2R_EXTEVNT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 10;
for RSTE2R_EXTEVNT_Field use record
Val at 0 range 0 .. 9;
Arr at 0 range 0 .. 9;
end record;
-- Timerx Output2 Reset Register
type RSTE2R_Register is record
-- SRT
SRT : Boolean := False;
-- RESYNC
RESYNC : Boolean := False;
-- PER
PER : Boolean := False;
-- CMP1
CMP : RSTE2R_CMP_Field := (As_Array => False, Val => 16#0#);
-- MSTPER
MSTPER : Boolean := False;
-- MSTCMP1
MSTCMP : RSTE2R_MSTCMP_Field := (As_Array => False, Val => 16#0#);
-- TIMEVNT1
TIMEVNT : RSTE2R_TIMEVNT_Field := (As_Array => False, Val => 16#0#);
-- EXTEVNT1
EXTEVNT : RSTE2R_EXTEVNT_Field := (As_Array => False, Val => 16#0#);
-- UPDATE
UPDATE : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for RSTE2R_Register use record
SRT at 0 range 0 .. 0;
RESYNC at 0 range 1 .. 1;
PER at 0 range 2 .. 2;
CMP at 0 range 3 .. 6;
MSTPER at 0 range 7 .. 7;
MSTCMP at 0 range 8 .. 11;
TIMEVNT at 0 range 12 .. 20;
EXTEVNT at 0 range 21 .. 30;
UPDATE at 0 range 31 .. 31;
end record;
subtype EEFER1_EE1FLTR_Field is HAL.UInt4;
subtype EEFER1_EE2FLTR_Field is HAL.UInt4;
subtype EEFER1_EE3FLTR_Field is HAL.UInt4;
subtype EEFER1_EE4FLTR_Field is HAL.UInt4;
subtype EEFER1_EE5FLTR_Field is HAL.UInt4;
-- Timerx External Event Filtering Register 1
type EEFER1_Register is record
-- External Event 1 latch
EE1LTCH : Boolean := False;
-- External Event 1 filter
EE1FLTR : EEFER1_EE1FLTR_Field := 16#0#;
-- unspecified
Reserved_5_5 : HAL.Bit := 16#0#;
-- External Event 2 latch
EE2LTCH : Boolean := False;
-- External Event 2 filter
EE2FLTR : EEFER1_EE2FLTR_Field := 16#0#;
-- unspecified
Reserved_11_11 : HAL.Bit := 16#0#;
-- External Event 3 latch
EE3LTCH : Boolean := False;
-- External Event 3 filter
EE3FLTR : EEFER1_EE3FLTR_Field := 16#0#;
-- unspecified
Reserved_17_17 : HAL.Bit := 16#0#;
-- External Event 4 latch
EE4LTCH : Boolean := False;
-- External Event 4 filter
EE4FLTR : EEFER1_EE4FLTR_Field := 16#0#;
-- unspecified
Reserved_23_23 : HAL.Bit := 16#0#;
-- External Event 5 latch
EE5LTCH : Boolean := False;
-- External Event 5 filter
EE5FLTR : EEFER1_EE5FLTR_Field := 16#0#;
-- unspecified
Reserved_29_31 : HAL.UInt3 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for EEFER1_Register use record
EE1LTCH at 0 range 0 .. 0;
EE1FLTR at 0 range 1 .. 4;
Reserved_5_5 at 0 range 5 .. 5;
EE2LTCH at 0 range 6 .. 6;
EE2FLTR at 0 range 7 .. 10;
Reserved_11_11 at 0 range 11 .. 11;
EE3LTCH at 0 range 12 .. 12;
EE3FLTR at 0 range 13 .. 16;
Reserved_17_17 at 0 range 17 .. 17;
EE4LTCH at 0 range 18 .. 18;
EE4FLTR at 0 range 19 .. 22;
Reserved_23_23 at 0 range 23 .. 23;
EE5LTCH at 0 range 24 .. 24;
EE5FLTR at 0 range 25 .. 28;
Reserved_29_31 at 0 range 29 .. 31;
end record;
subtype EEFER2_EE6FLTR_Field is HAL.UInt4;
subtype EEFER2_EE7FLTR_Field is HAL.UInt4;
subtype EEFER2_EE8FLTR_Field is HAL.UInt4;
subtype EEFER2_EE9FLTR_Field is HAL.UInt4;
subtype EEFER2_EE10FLTR_Field is HAL.UInt4;
-- Timerx External Event Filtering Register 2
type EEFER2_Register is record
-- External Event 6 latch
EE6LTCH : Boolean := False;
-- External Event 6 filter
EE6FLTR : EEFER2_EE6FLTR_Field := 16#0#;
-- unspecified
Reserved_5_5 : HAL.Bit := 16#0#;
-- External Event 7 latch
EE7LTCH : Boolean := False;
-- External Event 7 filter
EE7FLTR : EEFER2_EE7FLTR_Field := 16#0#;
-- unspecified
Reserved_11_11 : HAL.Bit := 16#0#;
-- External Event 8 latch
EE8LTCH : Boolean := False;
-- External Event 8 filter
EE8FLTR : EEFER2_EE8FLTR_Field := 16#0#;
-- unspecified
Reserved_17_17 : HAL.Bit := 16#0#;
-- External Event 9 latch
EE9LTCH : Boolean := False;
-- External Event 9 filter
EE9FLTR : EEFER2_EE9FLTR_Field := 16#0#;
-- unspecified
Reserved_23_23 : HAL.Bit := 16#0#;
-- External Event 10 latch
EE10LTCH : Boolean := False;
-- External Event 10 filter
EE10FLTR : EEFER2_EE10FLTR_Field := 16#0#;
-- unspecified
Reserved_29_31 : HAL.UInt3 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for EEFER2_Register use record
EE6LTCH at 0 range 0 .. 0;
EE6FLTR at 0 range 1 .. 4;
Reserved_5_5 at 0 range 5 .. 5;
EE7LTCH at 0 range 6 .. 6;
EE7FLTR at 0 range 7 .. 10;
Reserved_11_11 at 0 range 11 .. 11;
EE8LTCH at 0 range 12 .. 12;
EE8FLTR at 0 range 13 .. 16;
Reserved_17_17 at 0 range 17 .. 17;
EE9LTCH at 0 range 18 .. 18;
EE9FLTR at 0 range 19 .. 22;
Reserved_23_23 at 0 range 23 .. 23;
EE10LTCH at 0 range 24 .. 24;
EE10FLTR at 0 range 25 .. 28;
Reserved_29_31 at 0 range 29 .. 31;
end record;
-- RSTER_CMP array
type RSTER_CMP_Field_Array is array (2 .. 3) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for RSTER_CMP
type RSTER_CMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- CMP as a value
Val : HAL.UInt2;
when True =>
-- CMP as an array
Arr : RSTER_CMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for RSTER_CMP_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- RSTER_MSTCMP array
type RSTER_MSTCMP_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for RSTER_MSTCMP
type RSTER_MSTCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MSTCMP as a value
Val : HAL.UInt4;
when True =>
-- MSTCMP as an array
Arr : RSTER_MSTCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for RSTER_MSTCMP_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- RSTER_EXTEVNT array
type RSTER_EXTEVNT_Field_Array is array (1 .. 10) of Boolean
with Component_Size => 1, Size => 10;
-- Type definition for RSTER_EXTEVNT
type RSTER_EXTEVNT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- EXTEVNT as a value
Val : HAL.UInt10;
when True =>
-- EXTEVNT as an array
Arr : RSTER_EXTEVNT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 10;
for RSTER_EXTEVNT_Field use record
Val at 0 range 0 .. 9;
Arr at 0 range 0 .. 9;
end record;
-- RSTER_TIMACMP array
type RSTER_TIMACMP_Field_Array is array (1 .. 3) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for RSTER_TIMACMP
type RSTER_TIMACMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TIMACMP as a value
Val : HAL.UInt3;
when True =>
-- TIMACMP as an array
Arr : RSTER_TIMACMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 3;
for RSTER_TIMACMP_Field use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- RSTER_TIMBCMP array
type RSTER_TIMBCMP_Field_Array is array (1 .. 3) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for RSTER_TIMBCMP
type RSTER_TIMBCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TIMBCMP as a value
Val : HAL.UInt3;
when True =>
-- TIMBCMP as an array
Arr : RSTER_TIMBCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 3;
for RSTER_TIMBCMP_Field use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- RSTER_TIMCCMP array
type RSTER_TIMCCMP_Field_Array is array (1 .. 3) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for RSTER_TIMCCMP
type RSTER_TIMCCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TIMCCMP as a value
Val : HAL.UInt3;
when True =>
-- TIMCCMP as an array
Arr : RSTER_TIMCCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 3;
for RSTER_TIMCCMP_Field use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- RSTER_TIMDCMP array
type RSTER_TIMDCMP_Field_Array is array (1 .. 3) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for RSTER_TIMDCMP
type RSTER_TIMDCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TIMDCMP as a value
Val : HAL.UInt3;
when True =>
-- TIMDCMP as an array
Arr : RSTER_TIMDCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 3;
for RSTER_TIMDCMP_Field use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- TimerA Reset Register
type RSTER_Register is record
-- unspecified
Reserved_0_0 : HAL.Bit := 16#0#;
-- Timer A Update reset
UPDT : Boolean := False;
-- Timer A compare 2 reset
CMP : RSTER_CMP_Field := (As_Array => False, Val => 16#0#);
-- Master timer Period
MSTPER : Boolean := False;
-- Master compare 1
MSTCMP : RSTER_MSTCMP_Field :=
(As_Array => False, Val => 16#0#);
-- External Event 1
EXTEVNT : RSTER_EXTEVNT_Field :=
(As_Array => False, Val => 16#0#);
-- Timer A Compare 1
TIMACMP : RSTER_TIMACMP_Field :=
(As_Array => False, Val => 16#0#);
-- Timer B Compare 1
TIMBCMP : RSTER_TIMBCMP_Field :=
(As_Array => False, Val => 16#0#);
-- Timer C Compare 1
TIMCCMP : RSTER_TIMCCMP_Field :=
(As_Array => False, Val => 16#0#);
-- Timer D Compare 1
TIMDCMP : RSTER_TIMDCMP_Field :=
(As_Array => False, Val => 16#0#);
-- unspecified
Reserved_31_31 : HAL.Bit := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for RSTER_Register use record
Reserved_0_0 at 0 range 0 .. 0;
UPDT at 0 range 1 .. 1;
CMP at 0 range 2 .. 3;
MSTPER at 0 range 4 .. 4;
MSTCMP at 0 range 5 .. 8;
EXTEVNT at 0 range 9 .. 18;
TIMACMP at 0 range 19 .. 21;
TIMBCMP at 0 range 22 .. 24;
TIMCCMP at 0 range 25 .. 27;
TIMDCMP at 0 range 28 .. 30;
Reserved_31_31 at 0 range 31 .. 31;
end record;
subtype CHPER_CHPFRQ_Field is HAL.UInt4;
subtype CHPER_CHPDTY_Field is HAL.UInt3;
subtype CHPER_STRTPW_Field is HAL.UInt4;
-- Timerx Chopper Register
type CHPER_Register is record
-- Timerx carrier frequency value
CHPFRQ : CHPER_CHPFRQ_Field := 16#0#;
-- Timerx chopper duty cycle value
CHPDTY : CHPER_CHPDTY_Field := 16#0#;
-- STRTPW
STRTPW : CHPER_STRTPW_Field := 16#0#;
-- unspecified
Reserved_11_31 : HAL.UInt21 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CHPER_Register use record
CHPFRQ at 0 range 0 .. 3;
CHPDTY at 0 range 4 .. 6;
STRTPW at 0 range 7 .. 10;
Reserved_11_31 at 0 range 11 .. 31;
end record;
-- CPT1ECR_TACMP array
type CPT1ECR_TACMP_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for CPT1ECR_TACMP
type CPT1ECR_TACMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TACMP as a value
Val : HAL.UInt2;
when True =>
-- TACMP as an array
Arr : CPT1ECR_TACMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for CPT1ECR_TACMP_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- CPT1ECR_TBCMP array
type CPT1ECR_TBCMP_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for CPT1ECR_TBCMP
type CPT1ECR_TBCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TBCMP as a value
Val : HAL.UInt2;
when True =>
-- TBCMP as an array
Arr : CPT1ECR_TBCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for CPT1ECR_TBCMP_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- CPT1ECR_TCCMP array
type CPT1ECR_TCCMP_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for CPT1ECR_TCCMP
type CPT1ECR_TCCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TCCMP as a value
Val : HAL.UInt2;
when True =>
-- TCCMP as an array
Arr : CPT1ECR_TCCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for CPT1ECR_TCCMP_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- CPT1ECR_TDCMP array
type CPT1ECR_TDCMP_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for CPT1ECR_TDCMP
type CPT1ECR_TDCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TDCMP as a value
Val : HAL.UInt2;
when True =>
-- TDCMP as an array
Arr : CPT1ECR_TDCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for CPT1ECR_TDCMP_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- Timerx Capture 2 Control Register
type CPT1ECR_Register is record
-- Software Capture
SWCPT : Boolean := False;
-- Update Capture
UDPCPT : Boolean := False;
-- External Event 1 Capture
EXEV1CPT : Boolean := False;
-- External Event 2 Capture
EXEV2CPT : Boolean := False;
-- External Event 3 Capture
EXEV3CPT : Boolean := False;
-- External Event 4 Capture
EXEV4CPT : Boolean := False;
-- External Event 5 Capture
EXEV5CPT : Boolean := False;
-- External Event 6 Capture
EXEV6CPT : Boolean := False;
-- External Event 7 Capture
EXEV7CPT : Boolean := False;
-- External Event 8 Capture
EXEV8CPT : Boolean := False;
-- External Event 9 Capture
EXEV9CPT : Boolean := False;
-- External Event 10 Capture
EXEV10CPT : Boolean := False;
-- Timer A output 1 Set
TA1SET : Boolean := False;
-- Timer A output 1 Reset
TA1RST : Boolean := False;
-- Timer A Compare 1
TACMP : CPT1ECR_TACMP_Field :=
(As_Array => False, Val => 16#0#);
-- Timer B output 1 Set
TB1SET : Boolean := False;
-- Timer B output 1 Reset
TB1RST : Boolean := False;
-- Timer B Compare 1
TBCMP : CPT1ECR_TBCMP_Field :=
(As_Array => False, Val => 16#0#);
-- Timer C output 1 Set
TC1SET : Boolean := False;
-- Timer C output 1 Reset
TC1RST : Boolean := False;
-- Timer C Compare 1
TCCMP : CPT1ECR_TCCMP_Field :=
(As_Array => False, Val => 16#0#);
-- Timer D output 1 Set
TD1SET : Boolean := False;
-- Timer D output 1 Reset
TD1RST : Boolean := False;
-- Timer D Compare 1
TDCMP : CPT1ECR_TDCMP_Field :=
(As_Array => False, Val => 16#0#);
-- unspecified
Reserved_28_31 : HAL.UInt4 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CPT1ECR_Register use record
SWCPT at 0 range 0 .. 0;
UDPCPT at 0 range 1 .. 1;
EXEV1CPT at 0 range 2 .. 2;
EXEV2CPT at 0 range 3 .. 3;
EXEV3CPT at 0 range 4 .. 4;
EXEV4CPT at 0 range 5 .. 5;
EXEV5CPT at 0 range 6 .. 6;
EXEV6CPT at 0 range 7 .. 7;
EXEV7CPT at 0 range 8 .. 8;
EXEV8CPT at 0 range 9 .. 9;
EXEV9CPT at 0 range 10 .. 10;
EXEV10CPT at 0 range 11 .. 11;
TA1SET at 0 range 12 .. 12;
TA1RST at 0 range 13 .. 13;
TACMP at 0 range 14 .. 15;
TB1SET at 0 range 16 .. 16;
TB1RST at 0 range 17 .. 17;
TBCMP at 0 range 18 .. 19;
TC1SET at 0 range 20 .. 20;
TC1RST at 0 range 21 .. 21;
TCCMP at 0 range 22 .. 23;
TD1SET at 0 range 24 .. 24;
TD1RST at 0 range 25 .. 25;
TDCMP at 0 range 26 .. 27;
Reserved_28_31 at 0 range 28 .. 31;
end record;
-- CPT2ECR_TACMP array
type CPT2ECR_TACMP_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for CPT2ECR_TACMP
type CPT2ECR_TACMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TACMP as a value
Val : HAL.UInt2;
when True =>
-- TACMP as an array
Arr : CPT2ECR_TACMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for CPT2ECR_TACMP_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- CPT2ECR_TBCMP array
type CPT2ECR_TBCMP_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for CPT2ECR_TBCMP
type CPT2ECR_TBCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TBCMP as a value
Val : HAL.UInt2;
when True =>
-- TBCMP as an array
Arr : CPT2ECR_TBCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for CPT2ECR_TBCMP_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- CPT2ECR_TCCMP array
type CPT2ECR_TCCMP_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for CPT2ECR_TCCMP
type CPT2ECR_TCCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TCCMP as a value
Val : HAL.UInt2;
when True =>
-- TCCMP as an array
Arr : CPT2ECR_TCCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for CPT2ECR_TCCMP_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- CPT2ECR_TDCMP array
type CPT2ECR_TDCMP_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for CPT2ECR_TDCMP
type CPT2ECR_TDCMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TDCMP as a value
Val : HAL.UInt2;
when True =>
-- TDCMP as an array
Arr : CPT2ECR_TDCMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for CPT2ECR_TDCMP_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- CPT2xCR
type CPT2ECR_Register is record
-- Software Capture
SWCPT : Boolean := False;
-- Update Capture
UDPCPT : Boolean := False;
-- External Event 1 Capture
EXEV1CPT : Boolean := False;
-- External Event 2 Capture
EXEV2CPT : Boolean := False;
-- External Event 3 Capture
EXEV3CPT : Boolean := False;
-- External Event 4 Capture
EXEV4CPT : Boolean := False;
-- External Event 5 Capture
EXEV5CPT : Boolean := False;
-- External Event 6 Capture
EXEV6CPT : Boolean := False;
-- External Event 7 Capture
EXEV7CPT : Boolean := False;
-- External Event 8 Capture
EXEV8CPT : Boolean := False;
-- External Event 9 Capture
EXEV9CPT : Boolean := False;
-- External Event 10 Capture
EXEV10CPT : Boolean := False;
-- Timer A output 1 Set
TA1SET : Boolean := False;
-- Timer A output 1 Reset
TA1RST : Boolean := False;
-- Timer A Compare 1
TACMP : CPT2ECR_TACMP_Field :=
(As_Array => False, Val => 16#0#);
-- Timer B output 1 Set
TB1SET : Boolean := False;
-- Timer B output 1 Reset
TB1RST : Boolean := False;
-- Timer B Compare 1
TBCMP : CPT2ECR_TBCMP_Field :=
(As_Array => False, Val => 16#0#);
-- Timer C output 1 Set
TC1SET : Boolean := False;
-- Timer C output 1 Reset
TC1RST : Boolean := False;
-- Timer C Compare 1
TCCMP : CPT2ECR_TCCMP_Field :=
(As_Array => False, Val => 16#0#);
-- Timer D output 1 Set
TD1SET : Boolean := False;
-- Timer D output 1 Reset
TD1RST : Boolean := False;
-- Timer D Compare 1
TDCMP : CPT2ECR_TDCMP_Field :=
(As_Array => False, Val => 16#0#);
-- unspecified
Reserved_28_31 : HAL.UInt4 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CPT2ECR_Register use record
SWCPT at 0 range 0 .. 0;
UDPCPT at 0 range 1 .. 1;
EXEV1CPT at 0 range 2 .. 2;
EXEV2CPT at 0 range 3 .. 3;
EXEV3CPT at 0 range 4 .. 4;
EXEV4CPT at 0 range 5 .. 5;
EXEV5CPT at 0 range 6 .. 6;
EXEV6CPT at 0 range 7 .. 7;
EXEV7CPT at 0 range 8 .. 8;
EXEV8CPT at 0 range 9 .. 9;
EXEV9CPT at 0 range 10 .. 10;
EXEV10CPT at 0 range 11 .. 11;
TA1SET at 0 range 12 .. 12;
TA1RST at 0 range 13 .. 13;
TACMP at 0 range 14 .. 15;
TB1SET at 0 range 16 .. 16;
TB1RST at 0 range 17 .. 17;
TBCMP at 0 range 18 .. 19;
TC1SET at 0 range 20 .. 20;
TC1RST at 0 range 21 .. 21;
TCCMP at 0 range 22 .. 23;
TD1SET at 0 range 24 .. 24;
TD1RST at 0 range 25 .. 25;
TDCMP at 0 range 26 .. 27;
Reserved_28_31 at 0 range 28 .. 31;
end record;
subtype OUTER_FAULT1_Field is HAL.UInt2;
subtype OUTER_DLYPRT_Field is HAL.UInt3;
subtype OUTER_FAULT2_Field is HAL.UInt2;
-- Timerx Output Register
type OUTER_Register is record
-- unspecified
Reserved_0_0 : HAL.Bit := 16#0#;
-- Output 1 polarity
POL1 : Boolean := False;
-- Output 1 Idle mode
IDLEM1 : Boolean := False;
-- Output 1 Idle State
IDLES1 : Boolean := False;
-- Output 1 Fault state
FAULT1 : OUTER_FAULT1_Field := 16#0#;
-- Output 1 Chopper enable
CHP1 : Boolean := False;
-- Output 1 Deadtime upon burst mode Idle entry
DIDL1 : Boolean := False;
-- Deadtime enable
DTEN : Boolean := False;
-- Delayed Protection Enable
DLYPRTEN : Boolean := False;
-- Delayed Protection
DLYPRT : OUTER_DLYPRT_Field := 16#0#;
-- unspecified
Reserved_13_16 : HAL.UInt4 := 16#0#;
-- Output 2 polarity
POL2 : Boolean := False;
-- Output 2 Idle mode
IDLEM2 : Boolean := False;
-- Output 2 Idle State
IDLES2 : Boolean := False;
-- Output 2 Fault state
FAULT2 : OUTER_FAULT2_Field := 16#0#;
-- Output 2 Chopper enable
CHP2 : Boolean := False;
-- Output 2 Deadtime upon burst mode Idle entry
DIDL2 : Boolean := False;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for OUTER_Register use record
Reserved_0_0 at 0 range 0 .. 0;
POL1 at 0 range 1 .. 1;
IDLEM1 at 0 range 2 .. 2;
IDLES1 at 0 range 3 .. 3;
FAULT1 at 0 range 4 .. 5;
CHP1 at 0 range 6 .. 6;
DIDL1 at 0 range 7 .. 7;
DTEN at 0 range 8 .. 8;
DLYPRTEN at 0 range 9 .. 9;
DLYPRT at 0 range 10 .. 12;
Reserved_13_16 at 0 range 13 .. 16;
POL2 at 0 range 17 .. 17;
IDLEM2 at 0 range 18 .. 18;
IDLES2 at 0 range 19 .. 19;
FAULT2 at 0 range 20 .. 21;
CHP2 at 0 range 22 .. 22;
DIDL2 at 0 range 23 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
-- Timerx Fault Register
type FLTER_Register is record
-- Fault 1 enable
FLT1EN : Boolean := False;
-- Fault 2 enable
FLT2EN : Boolean := False;
-- Fault 3 enable
FLT3EN : Boolean := False;
-- Fault 4 enable
FLT4EN : Boolean := False;
-- Fault 5 enable
FLT5EN : Boolean := False;
-- unspecified
Reserved_5_30 : HAL.UInt26 := 16#0#;
-- Fault sources Lock
FLTLCK : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for FLTER_Register use record
FLT1EN at 0 range 0 .. 0;
FLT2EN at 0 range 1 .. 1;
FLT3EN at 0 range 2 .. 2;
FLT4EN at 0 range 3 .. 3;
FLT5EN at 0 range 4 .. 4;
Reserved_5_30 at 0 range 5 .. 30;
FLTLCK at 0 range 31 .. 31;
end record;
-----------------
-- Peripherals --
-----------------
-- High Resolution Timer: Common functions
type HRTIM_Common_Peripheral is record
-- Control Register 1
CR1 : aliased CR1_Register;
-- Control Register 2
CR2 : aliased CR2_Register;
-- Interrupt Status Register
ISR : aliased ISR_Register;
-- Interrupt Clear Register
ICR : aliased ICR_Register;
-- Interrupt Enable Register
IER : aliased IER_Register;
-- Output Enable Register
OENR : aliased OENR_Register;
-- ODISR
ODISR : aliased ODISR_Register;
-- Output Disable Status Register
ODSR : aliased ODSR_Register;
-- Burst Mode Control Register
BMCR : aliased BMCR_Register;
-- BMTRG
BMTRG : aliased BMTRG_Register;
-- BMCMPR
BMCMPR : aliased BMCMPR_Register;
-- Burst Mode Period Register
BMPER : aliased BMPER_Register;
-- Timer External Event Control Register 1
EECR1 : aliased EECR1_Register;
-- Timer External Event Control Register 2
EECR2 : aliased EECR2_Register;
-- Timer External Event Control Register 3
EECR3 : aliased EECR3_Register;
-- ADC Trigger 1 Register
ADC1R : aliased ADC1R_Register;
-- ADC Trigger 2 Register
ADC2R : aliased ADC2R_Register;
-- ADC Trigger 3 Register
ADC3R : aliased ADC3R_Register;
-- ADC Trigger 4 Register
ADC4R : aliased ADC4R_Register;
-- DLL Control Register
DLLCR : aliased DLLCR_Register;
-- HRTIM Fault Input Register 1
FLTINR1 : aliased FLTINR1_Register;
-- HRTIM Fault Input Register 2
FLTINR2 : aliased FLTINR2_Register;
-- BDMUPDR
BDMUPDR : aliased BDMUPDR_Register;
-- Burst DMA Timerx update Register
BDTxUPR : aliased BDTxUPR_Register;
-- Burst DMA Data Register
BDMADR : aliased HAL.UInt32;
end record
with Volatile;
for HRTIM_Common_Peripheral use record
CR1 at 16#0# range 0 .. 31;
CR2 at 16#4# range 0 .. 31;
ISR at 16#8# range 0 .. 31;
ICR at 16#C# range 0 .. 31;
IER at 16#10# range 0 .. 31;
OENR at 16#14# range 0 .. 31;
ODISR at 16#18# range 0 .. 31;
ODSR at 16#1C# range 0 .. 31;
BMCR at 16#20# range 0 .. 31;
BMTRG at 16#24# range 0 .. 31;
BMCMPR at 16#28# range 0 .. 31;
BMPER at 16#2C# range 0 .. 31;
EECR1 at 16#30# range 0 .. 31;
EECR2 at 16#34# range 0 .. 31;
EECR3 at 16#38# range 0 .. 31;
ADC1R at 16#3C# range 0 .. 31;
ADC2R at 16#40# range 0 .. 31;
ADC3R at 16#44# range 0 .. 31;
ADC4R at 16#48# range 0 .. 31;
DLLCR at 16#4C# range 0 .. 31;
FLTINR1 at 16#50# range 0 .. 31;
FLTINR2 at 16#54# range 0 .. 31;
BDMUPDR at 16#58# range 0 .. 31;
BDTxUPR at 16#5C# range 0 .. 31;
BDMADR at 16#60# range 0 .. 31;
end record;
-- High Resolution Timer: Common functions
HRTIM_Common_Periph : aliased HRTIM_Common_Peripheral
with Import, Address => HRTIM_Common_Base;
-- High Resolution Timer: Master Timers
type HRTIM_Master_Peripheral is record
-- Master Timer Control Register
MCR : aliased MCR_Register;
-- Master Timer Interrupt Status Register
MISR : aliased MISR_Register;
-- Master Timer Interrupt Clear Register
MICR : aliased MICR_Register;
-- MDIER
MDIER : aliased MDIER_Register;
-- Master Timer Counter Register
MCNTR : aliased MCNTR_Register;
-- Master Timer Period Register
MPER : aliased MPER_Register;
-- Master Timer Repetition Register
MREP : aliased MREP_Register;
-- Master Timer Compare 1 Register
MCMP1R : aliased MCMP1R_Register;
-- Master Timer Compare 2 Register
MCMP2R : aliased MCMP2R_Register;
-- Master Timer Compare 3 Register
MCMP3R : aliased MCMP3R_Register;
-- Master Timer Compare 4 Register
MCMP4R : aliased MCMP4R_Register;
end record
with Volatile;
for HRTIM_Master_Peripheral use record
MCR at 16#0# range 0 .. 31;
MISR at 16#4# range 0 .. 31;
MICR at 16#8# range 0 .. 31;
MDIER at 16#C# range 0 .. 31;
MCNTR at 16#10# range 0 .. 31;
MPER at 16#14# range 0 .. 31;
MREP at 16#18# range 0 .. 31;
MCMP1R at 16#1C# range 0 .. 31;
MCMP2R at 16#24# range 0 .. 31;
MCMP3R at 16#28# range 0 .. 31;
MCMP4R at 16#2C# range 0 .. 31;
end record;
-- High Resolution Timer: Master Timers
HRTIM_Master_Periph : aliased HRTIM_Master_Peripheral
with Import, Address => HRTIM_Master_Base;
-- High Resolution Timer: TIMA
type HRTIM_TIMA_Peripheral is record
-- Timerx Control Register
TIMACR : aliased TIMACR_Register;
-- Timerx Interrupt Status Register
TIMAISR : aliased TIMAISR_Register;
-- Timerx Interrupt Clear Register
TIMAICR : aliased TIMAICR_Register;
-- TIMxDIER
TIMADIER : aliased TIMADIER_Register;
-- Timerx Counter Register
CNTAR : aliased CNTAR_Register;
-- Timerx Period Register
PERAR : aliased PERAR_Register;
-- Timerx Repetition Register
REPAR : aliased REPAR_Register;
-- Timerx Compare 1 Register
CMP1AR : aliased CMP1AR_Register;
-- Timerx Compare 1 Compound Register
CMP1CAR : aliased CMP1CAR_Register;
-- Timerx Compare 2 Register
CMP2AR : aliased CMP2AR_Register;
-- Timerx Compare 3 Register
CMP3AR : aliased CMP3AR_Register;
-- Timerx Compare 4 Register
CMP4AR : aliased CMP4AR_Register;
-- Timerx Capture 1 Register
CPT1AR : aliased CPT1AR_Register;
-- Timerx Capture 2 Register
CPT2AR : aliased CPT2AR_Register;
-- Timerx Deadtime Register
DTAR : aliased DTAR_Register;
-- Timerx Output1 Set Register
SETA1R : aliased SETA1R_Register;
-- Timerx Output1 Reset Register
RSTA1R : aliased RSTA1R_Register;
-- Timerx Output2 Set Register
SETA2R : aliased SETA2R_Register;
-- Timerx Output2 Reset Register
RSTA2R : aliased RSTA2R_Register;
-- Timerx External Event Filtering Register 1
EEFAR1 : aliased EEFAR1_Register;
-- Timerx External Event Filtering Register 2
EEFAR2 : aliased EEFAR2_Register;
-- TimerA Reset Register
RSTAR : aliased RSTAR_Register;
-- Timerx Chopper Register
CHPAR : aliased CHPAR_Register;
-- Timerx Capture 2 Control Register
CPT1ACR : aliased CPT1ACR_Register;
-- CPT2xCR
CPT2ACR : aliased CPT2ACR_Register;
-- Timerx Output Register
OUTAR : aliased OUTAR_Register;
-- Timerx Fault Register
FLTAR : aliased FLTAR_Register;
end record
with Volatile;
for HRTIM_TIMA_Peripheral use record
TIMACR at 16#0# range 0 .. 31;
TIMAISR at 16#4# range 0 .. 31;
TIMAICR at 16#8# range 0 .. 31;
TIMADIER at 16#C# range 0 .. 31;
CNTAR at 16#10# range 0 .. 31;
PERAR at 16#14# range 0 .. 31;
REPAR at 16#18# range 0 .. 31;
CMP1AR at 16#1C# range 0 .. 31;
CMP1CAR at 16#20# range 0 .. 31;
CMP2AR at 16#24# range 0 .. 31;
CMP3AR at 16#28# range 0 .. 31;
CMP4AR at 16#2C# range 0 .. 31;
CPT1AR at 16#30# range 0 .. 31;
CPT2AR at 16#34# range 0 .. 31;
DTAR at 16#38# range 0 .. 31;
SETA1R at 16#3C# range 0 .. 31;
RSTA1R at 16#40# range 0 .. 31;
SETA2R at 16#44# range 0 .. 31;
RSTA2R at 16#48# range 0 .. 31;
EEFAR1 at 16#4C# range 0 .. 31;
EEFAR2 at 16#50# range 0 .. 31;
RSTAR at 16#54# range 0 .. 31;
CHPAR at 16#58# range 0 .. 31;
CPT1ACR at 16#5C# range 0 .. 31;
CPT2ACR at 16#60# range 0 .. 31;
OUTAR at 16#64# range 0 .. 31;
FLTAR at 16#68# range 0 .. 31;
end record;
-- High Resolution Timer: TIMA
HRTIM_TIMA_Periph : aliased HRTIM_TIMA_Peripheral
with Import, Address => HRTIM_TIMA_Base;
-- High Resolution Timer: TIMB
type HRTIM_TIMB_Peripheral is record
-- Timerx Control Register
TIMBCR : aliased TIMBCR_Register;
-- Timerx Interrupt Status Register
TIMBISR : aliased TIMBISR_Register;
-- Timerx Interrupt Clear Register
TIMBICR : aliased TIMBICR_Register;
-- TIMxDIER
TIMBDIER : aliased TIMBDIER_Register;
-- Timerx Counter Register
CNTR : aliased CNTR_Register;
-- Timerx Period Register
PERBR : aliased PERBR_Register;
-- Timerx Repetition Register
REPBR : aliased REPBR_Register;
-- Timerx Compare 1 Register
CMP1BR : aliased CMP1BR_Register;
-- Timerx Compare 1 Compound Register
CMP1CBR : aliased CMP1CBR_Register;
-- Timerx Compare 2 Register
CMP2BR : aliased CMP2BR_Register;
-- Timerx Compare 3 Register
CMP3BR : aliased CMP3BR_Register;
-- Timerx Compare 4 Register
CMP4BR : aliased CMP4BR_Register;
-- Timerx Capture 1 Register
CPT1BR : aliased CPT1BR_Register;
-- Timerx Capture 2 Register
CPT2BR : aliased CPT2BR_Register;
-- Timerx Deadtime Register
DTBR : aliased DTBR_Register;
-- Timerx Output1 Set Register
SETB1R : aliased SETB1R_Register;
-- Timerx Output1 Reset Register
RSTB1R : aliased RSTB1R_Register;
-- Timerx Output2 Set Register
SETB2R : aliased SETB2R_Register;
-- Timerx Output2 Reset Register
RSTB2R : aliased RSTB2R_Register;
-- Timerx External Event Filtering Register 1
EEFBR1 : aliased EEFBR1_Register;
-- Timerx External Event Filtering Register 2
EEFBR2 : aliased EEFBR2_Register;
-- TimerA Reset Register
RSTBR : aliased RSTBR_Register;
-- Timerx Chopper Register
CHPBR : aliased CHPBR_Register;
-- Timerx Capture 2 Control Register
CPT1BCR : aliased CPT1BCR_Register;
-- CPT2xCR
CPT2BCR : aliased CPT2BCR_Register;
-- Timerx Output Register
OUTBR : aliased OUTBR_Register;
-- Timerx Fault Register
FLTBR : aliased FLTBR_Register;
end record
with Volatile;
for HRTIM_TIMB_Peripheral use record
TIMBCR at 16#0# range 0 .. 31;
TIMBISR at 16#4# range 0 .. 31;
TIMBICR at 16#8# range 0 .. 31;
TIMBDIER at 16#C# range 0 .. 31;
CNTR at 16#10# range 0 .. 31;
PERBR at 16#14# range 0 .. 31;
REPBR at 16#18# range 0 .. 31;
CMP1BR at 16#1C# range 0 .. 31;
CMP1CBR at 16#20# range 0 .. 31;
CMP2BR at 16#24# range 0 .. 31;
CMP3BR at 16#28# range 0 .. 31;
CMP4BR at 16#2C# range 0 .. 31;
CPT1BR at 16#30# range 0 .. 31;
CPT2BR at 16#34# range 0 .. 31;
DTBR at 16#38# range 0 .. 31;
SETB1R at 16#3C# range 0 .. 31;
RSTB1R at 16#40# range 0 .. 31;
SETB2R at 16#44# range 0 .. 31;
RSTB2R at 16#48# range 0 .. 31;
EEFBR1 at 16#4C# range 0 .. 31;
EEFBR2 at 16#50# range 0 .. 31;
RSTBR at 16#54# range 0 .. 31;
CHPBR at 16#58# range 0 .. 31;
CPT1BCR at 16#5C# range 0 .. 31;
CPT2BCR at 16#60# range 0 .. 31;
OUTBR at 16#64# range 0 .. 31;
FLTBR at 16#68# range 0 .. 31;
end record;
-- High Resolution Timer: TIMB
HRTIM_TIMB_Periph : aliased HRTIM_TIMB_Peripheral
with Import, Address => HRTIM_TIMB_Base;
-- High Resolution Timer: TIMC
type HRTIM_TIMC_Peripheral is record
-- Timerx Control Register
TIMCCR : aliased TIMCCR_Register;
-- Timerx Interrupt Status Register
TIMCISR : aliased TIMCISR_Register;
-- Timerx Interrupt Clear Register
TIMCICR : aliased TIMCICR_Register;
-- TIMxDIER
TIMCDIER : aliased TIMCDIER_Register;
-- Timerx Counter Register
CNTCR : aliased CNTCR_Register;
-- Timerx Period Register
PERCR : aliased PERCR_Register;
-- Timerx Repetition Register
REPCR : aliased REPCR_Register;
-- Timerx Compare 1 Register
CMP1CR : aliased CMP1CR_Register;
-- Timerx Compare 1 Compound Register
CMP1CCR : aliased CMP1CCR_Register;
-- Timerx Compare 2 Register
CMP2CR : aliased CMP2CR_Register;
-- Timerx Compare 3 Register
CMP3CR : aliased CMP3CR_Register;
-- Timerx Compare 4 Register
CMP4CR : aliased CMP4CR_Register;
-- Timerx Capture 1 Register
CPT1CR : aliased CPT1CR_Register;
-- Timerx Capture 2 Register
CPT2CR : aliased CPT2CR_Register;
-- Timerx Deadtime Register
DTCR : aliased DTCR_Register;
-- Timerx Output1 Set Register
SETC1R : aliased SETC1R_Register;
-- Timerx Output1 Reset Register
RSTC1R : aliased RSTC1R_Register;
-- Timerx Output2 Set Register
SETC2R : aliased SETC2R_Register;
-- Timerx Output2 Reset Register
RSTC2R : aliased RSTC2R_Register;
-- Timerx External Event Filtering Register 1
EEFCR1 : aliased EEFCR1_Register;
-- Timerx External Event Filtering Register 2
EEFCR2 : aliased EEFCR2_Register;
-- TimerA Reset Register
RSTCR : aliased RSTCR_Register;
-- Timerx Chopper Register
CHPCR : aliased CHPCR_Register;
-- Timerx Capture 2 Control Register
CPT1CCR : aliased CPT1CCR_Register;
-- CPT2xCR
CPT2CCR : aliased CPT2CCR_Register;
-- Timerx Output Register
OUTCR : aliased OUTCR_Register;
-- Timerx Fault Register
FLTCR : aliased FLTCR_Register;
end record
with Volatile;
for HRTIM_TIMC_Peripheral use record
TIMCCR at 16#0# range 0 .. 31;
TIMCISR at 16#4# range 0 .. 31;
TIMCICR at 16#8# range 0 .. 31;
TIMCDIER at 16#C# range 0 .. 31;
CNTCR at 16#10# range 0 .. 31;
PERCR at 16#14# range 0 .. 31;
REPCR at 16#18# range 0 .. 31;
CMP1CR at 16#1C# range 0 .. 31;
CMP1CCR at 16#20# range 0 .. 31;
CMP2CR at 16#24# range 0 .. 31;
CMP3CR at 16#28# range 0 .. 31;
CMP4CR at 16#2C# range 0 .. 31;
CPT1CR at 16#30# range 0 .. 31;
CPT2CR at 16#34# range 0 .. 31;
DTCR at 16#38# range 0 .. 31;
SETC1R at 16#3C# range 0 .. 31;
RSTC1R at 16#40# range 0 .. 31;
SETC2R at 16#44# range 0 .. 31;
RSTC2R at 16#48# range 0 .. 31;
EEFCR1 at 16#4C# range 0 .. 31;
EEFCR2 at 16#50# range 0 .. 31;
RSTCR at 16#54# range 0 .. 31;
CHPCR at 16#58# range 0 .. 31;
CPT1CCR at 16#5C# range 0 .. 31;
CPT2CCR at 16#60# range 0 .. 31;
OUTCR at 16#64# range 0 .. 31;
FLTCR at 16#68# range 0 .. 31;
end record;
-- High Resolution Timer: TIMC
HRTIM_TIMC_Periph : aliased HRTIM_TIMC_Peripheral
with Import, Address => HRTIM_TIMC_Base;
-- High Resolution Timer: TIMD
type HRTIM_TIMD_Peripheral is record
-- Timerx Control Register
TIMDCR : aliased TIMDCR_Register;
-- Timerx Interrupt Status Register
TIMDISR : aliased TIMDISR_Register;
-- Timerx Interrupt Clear Register
TIMDICR : aliased TIMDICR_Register;
-- TIMxDIER
TIMDDIER : aliased TIMDDIER_Register;
-- Timerx Counter Register
CNTDR : aliased CNTDR_Register;
-- Timerx Period Register
PERDR : aliased PERDR_Register;
-- Timerx Repetition Register
REPDR : aliased REPDR_Register;
-- Timerx Compare 1 Register
CMP1DR : aliased CMP1DR_Register;
-- Timerx Compare 1 Compound Register
CMP1CDR : aliased CMP1CDR_Register;
-- Timerx Compare 2 Register
CMP2DR : aliased CMP2DR_Register;
-- Timerx Compare 3 Register
CMP3DR : aliased CMP3DR_Register;
-- Timerx Compare 4 Register
CMP4DR : aliased CMP4DR_Register;
-- Timerx Capture 1 Register
CPT1DR : aliased CPT1DR_Register;
-- Timerx Capture 2 Register
CPT2DR : aliased CPT2DR_Register;
-- Timerx Deadtime Register
DTDR : aliased DTDR_Register;
-- Timerx Output1 Set Register
SETD1R : aliased SETD1R_Register;
-- Timerx Output1 Reset Register
RSTD1R : aliased RSTD1R_Register;
-- Timerx Output2 Set Register
SETD2R : aliased SETD2R_Register;
-- Timerx Output2 Reset Register
RSTD2R : aliased RSTD2R_Register;
-- Timerx External Event Filtering Register 1
EEFDR1 : aliased EEFDR1_Register;
-- Timerx External Event Filtering Register 2
EEFDR2 : aliased EEFDR2_Register;
-- TimerA Reset Register
RSTDR : aliased RSTDR_Register;
-- Timerx Chopper Register
CHPDR : aliased CHPDR_Register;
-- Timerx Capture 2 Control Register
CPT1DCR : aliased CPT1DCR_Register;
-- CPT2xCR
CPT2DCR : aliased CPT2DCR_Register;
-- Timerx Output Register
OUTDR : aliased OUTDR_Register;
-- Timerx Fault Register
FLTDR : aliased FLTDR_Register;
end record
with Volatile;
for HRTIM_TIMD_Peripheral use record
TIMDCR at 16#0# range 0 .. 31;
TIMDISR at 16#4# range 0 .. 31;
TIMDICR at 16#8# range 0 .. 31;
TIMDDIER at 16#C# range 0 .. 31;
CNTDR at 16#10# range 0 .. 31;
PERDR at 16#14# range 0 .. 31;
REPDR at 16#18# range 0 .. 31;
CMP1DR at 16#1C# range 0 .. 31;
CMP1CDR at 16#20# range 0 .. 31;
CMP2DR at 16#24# range 0 .. 31;
CMP3DR at 16#28# range 0 .. 31;
CMP4DR at 16#2C# range 0 .. 31;
CPT1DR at 16#30# range 0 .. 31;
CPT2DR at 16#34# range 0 .. 31;
DTDR at 16#38# range 0 .. 31;
SETD1R at 16#3C# range 0 .. 31;
RSTD1R at 16#40# range 0 .. 31;
SETD2R at 16#44# range 0 .. 31;
RSTD2R at 16#48# range 0 .. 31;
EEFDR1 at 16#4C# range 0 .. 31;
EEFDR2 at 16#50# range 0 .. 31;
RSTDR at 16#54# range 0 .. 31;
CHPDR at 16#58# range 0 .. 31;
CPT1DCR at 16#5C# range 0 .. 31;
CPT2DCR at 16#60# range 0 .. 31;
OUTDR at 16#64# range 0 .. 31;
FLTDR at 16#68# range 0 .. 31;
end record;
-- High Resolution Timer: TIMD
HRTIM_TIMD_Periph : aliased HRTIM_TIMD_Peripheral
with Import, Address => HRTIM_TIMD_Base;
-- High Resolution Timer: TIME
type HRTIM_TIME_Peripheral is record
-- Timerx Control Register
TIMECR : aliased TIMECR_Register;
-- Timerx Interrupt Status Register
TIMEISR : aliased TIMEISR_Register;
-- Timerx Interrupt Clear Register
TIMEICR : aliased TIMEICR_Register;
-- TIMxDIER
TIMEDIER : aliased TIMEDIER_Register;
-- Timerx Counter Register
CNTER : aliased CNTER_Register;
-- Timerx Period Register
PERER : aliased PERER_Register;
-- Timerx Repetition Register
REPER : aliased REPER_Register;
-- Timerx Compare 1 Register
CMP1ER : aliased CMP1ER_Register;
-- Timerx Compare 1 Compound Register
CMP1CER : aliased CMP1CER_Register;
-- Timerx Compare 2 Register
CMP2ER : aliased CMP2ER_Register;
-- Timerx Compare 3 Register
CMP3ER : aliased CMP3ER_Register;
-- Timerx Compare 4 Register
CMP4ER : aliased CMP4ER_Register;
-- Timerx Capture 1 Register
CPT1ER : aliased CPT1ER_Register;
-- Timerx Capture 2 Register
CPT2ER : aliased CPT2ER_Register;
-- Timerx Deadtime Register
DTER : aliased DTER_Register;
-- Timerx Output1 Set Register
SETE1R : aliased SETE1R_Register;
-- Timerx Output1 Reset Register
RSTE1R : aliased RSTE1R_Register;
-- Timerx Output2 Set Register
SETE2R : aliased SETE2R_Register;
-- Timerx Output2 Reset Register
RSTE2R : aliased RSTE2R_Register;
-- Timerx External Event Filtering Register 1
EEFER1 : aliased EEFER1_Register;
-- Timerx External Event Filtering Register 2
EEFER2 : aliased EEFER2_Register;
-- TimerA Reset Register
RSTER : aliased RSTER_Register;
-- Timerx Chopper Register
CHPER : aliased CHPER_Register;
-- Timerx Capture 2 Control Register
CPT1ECR : aliased CPT1ECR_Register;
-- CPT2xCR
CPT2ECR : aliased CPT2ECR_Register;
-- Timerx Output Register
OUTER : aliased OUTER_Register;
-- Timerx Fault Register
FLTER : aliased FLTER_Register;
end record
with Volatile;
for HRTIM_TIME_Peripheral use record
TIMECR at 16#0# range 0 .. 31;
TIMEISR at 16#4# range 0 .. 31;
TIMEICR at 16#8# range 0 .. 31;
TIMEDIER at 16#C# range 0 .. 31;
CNTER at 16#10# range 0 .. 31;
PERER at 16#14# range 0 .. 31;
REPER at 16#18# range 0 .. 31;
CMP1ER at 16#1C# range 0 .. 31;
CMP1CER at 16#20# range 0 .. 31;
CMP2ER at 16#24# range 0 .. 31;
CMP3ER at 16#28# range 0 .. 31;
CMP4ER at 16#2C# range 0 .. 31;
CPT1ER at 16#30# range 0 .. 31;
CPT2ER at 16#34# range 0 .. 31;
DTER at 16#38# range 0 .. 31;
SETE1R at 16#3C# range 0 .. 31;
RSTE1R at 16#40# range 0 .. 31;
SETE2R at 16#44# range 0 .. 31;
RSTE2R at 16#48# range 0 .. 31;
EEFER1 at 16#4C# range 0 .. 31;
EEFER2 at 16#50# range 0 .. 31;
RSTER at 16#54# range 0 .. 31;
CHPER at 16#58# range 0 .. 31;
CPT1ECR at 16#5C# range 0 .. 31;
CPT2ECR at 16#60# range 0 .. 31;
OUTER at 16#64# range 0 .. 31;
FLTER at 16#68# range 0 .. 31;
end record;
-- High Resolution Timer: TIME
HRTIM_TIME_Periph : aliased HRTIM_TIME_Peripheral
with Import, Address => HRTIM_TIME_Base;
end STM32_SVD.HRTIM;
|
package Impact.d2.Orbs
--
-- A cut-down port of the Box2D physics engine, using only spheres.
--
-- For experiments with GPU and Ada task acceleration.
--
is
pragma Pure;
private
procedure dummy;
end Impact.d2.Orbs;
|
with Glfw.Windows;
procedure Main_Loop (Main_Window : in out Glfw.Windows.Window);
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- P A R . C H 1 2 --
-- --
-- B o d y --
-- --
-- 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. --
-- --
------------------------------------------------------------------------------
pragma Style_Checks (All_Checks);
-- Turn off subprogram body ordering check. Subprograms are in order
-- by RM section rather than alphabetical
separate (Par)
package body Ch12 is
-- Local functions, used only in this chapter
function P_Formal_Derived_Type_Definition return Node_Id;
function P_Formal_Discrete_Type_Definition return Node_Id;
function P_Formal_Fixed_Point_Definition return Node_Id;
function P_Formal_Floating_Point_Definition return Node_Id;
function P_Formal_Modular_Type_Definition return Node_Id;
function P_Formal_Package_Declaration return Node_Id;
function P_Formal_Private_Type_Definition return Node_Id;
function P_Formal_Signed_Integer_Type_Definition return Node_Id;
function P_Formal_Subprogram_Declaration return Node_Id;
function P_Formal_Type_Declaration return Node_Id;
function P_Formal_Type_Definition return Node_Id;
function P_Generic_Association return Node_Id;
procedure P_Formal_Object_Declarations (Decls : List_Id);
-- Scans one or more formal object declarations and appends them to
-- Decls. Scans more than one declaration only in the case where the
-- source has a declaration with multiple defining identifiers.
--------------------------------
-- 12.1 Generic (also 8.5.5) --
--------------------------------
-- This routine parses either one of the forms of a generic declaration
-- or a generic renaming declaration.
-- GENERIC_DECLARATION ::=
-- GENERIC_SUBPROGRAM_DECLARATION | GENERIC_PACKAGE_DECLARATION
-- GENERIC_SUBPROGRAM_DECLARATION ::=
-- GENERIC_FORMAL_PART SUBPROGRAM_SPECIFICATION;
-- GENERIC_PACKAGE_DECLARATION ::=
-- GENERIC_FORMAL_PART PACKAGE_SPECIFICATION;
-- GENERIC_FORMAL_PART ::=
-- generic {GENERIC_FORMAL_PARAMETER_DECLARATION | USE_CLAUSE}
-- GENERIC_RENAMING_DECLARATION ::=
-- generic package DEFINING_PROGRAM_UNIT_NAME
-- renames generic_package_NAME
-- | generic procedure DEFINING_PROGRAM_UNIT_NAME
-- renames generic_procedure_NAME
-- | generic function DEFINING_PROGRAM_UNIT_NAME
-- renames generic_function_NAME
-- GENERIC_FORMAL_PARAMETER_DECLARATION ::=
-- FORMAL_OBJECT_DECLARATION
-- | FORMAL_TYPE_DECLARATION
-- | FORMAL_SUBPROGRAM_DECLARATION
-- | FORMAL_PACKAGE_DECLARATION
-- The caller has checked that the initial token is GENERIC
-- Error recovery: can raise Error_Resync
function P_Generic return Node_Id is
Gen_Sloc : constant Source_Ptr := Token_Ptr;
Gen_Decl : Node_Id;
Decl_Node : Node_Id;
Decls : List_Id;
Def_Unit : Node_Id;
Ren_Token : Token_Type;
Scan_State : Saved_Scan_State;
begin
Scan; -- past GENERIC
if Token = Tok_Private then
Error_Msg_SC ("PRIVATE goes before GENERIC, not after");
Scan; -- past junk PRIVATE token
end if;
Save_Scan_State (Scan_State); -- at token past GENERIC
-- Check for generic renaming declaration case
if Token = Tok_Package
or else Token = Tok_Function
or else Token = Tok_Procedure
then
Ren_Token := Token;
Scan; -- scan past PACKAGE, FUNCTION or PROCEDURE
if Token = Tok_Identifier then
Def_Unit := P_Defining_Program_Unit_Name;
Check_Misspelling_Of (Tok_Renames);
if Token = Tok_Renames then
if Ren_Token = Tok_Package then
Decl_Node := New_Node
(N_Generic_Package_Renaming_Declaration, Gen_Sloc);
elsif Ren_Token = Tok_Procedure then
Decl_Node := New_Node
(N_Generic_Procedure_Renaming_Declaration, Gen_Sloc);
else -- Ren_Token = Tok_Function then
Decl_Node := New_Node
(N_Generic_Function_Renaming_Declaration, Gen_Sloc);
end if;
Scan; -- past RENAMES
Set_Defining_Unit_Name (Decl_Node, Def_Unit);
Set_Name (Decl_Node, P_Name);
TF_Semicolon;
return Decl_Node;
end if;
end if;
end if;
-- Fall through if this is *not* a generic renaming declaration
Restore_Scan_State (Scan_State);
Decls := New_List;
-- Loop through generic parameter declarations and use clauses
Decl_Loop : loop
P_Pragmas_Opt (Decls);
if Token = Tok_Private then
Error_Msg_S ("generic private child packages not permitted");
Scan; -- past PRIVATE
end if;
if Token = Tok_Use then
Append (P_Use_Clause, Decls);
else
-- Parse a generic parameter declaration
if Token = Tok_Identifier then
P_Formal_Object_Declarations (Decls);
elsif Token = Tok_Type then
Append (P_Formal_Type_Declaration, Decls);
elsif Token = Tok_With then
Scan; -- past WITH
if Token = Tok_Package then
Append (P_Formal_Package_Declaration, Decls);
elsif Token = Tok_Procedure or Token = Tok_Function then
Append (P_Formal_Subprogram_Declaration, Decls);
else
Error_Msg_BC
("FUNCTION, PROCEDURE or PACKAGE expected here");
Resync_Past_Semicolon;
end if;
elsif Token = Tok_Subtype then
Error_Msg_SC ("subtype declaration not allowed " &
"as generic parameter declaration!");
Resync_Past_Semicolon;
else
exit Decl_Loop;
end if;
end if;
end loop Decl_Loop;
-- Generic formal part is scanned, scan out subprogram or package spec
if Token = Tok_Package then
Gen_Decl := New_Node (N_Generic_Package_Declaration, Gen_Sloc);
Set_Specification (Gen_Decl, P_Package (Pf_Spcn));
else
Gen_Decl := New_Node (N_Generic_Subprogram_Declaration, Gen_Sloc);
Set_Specification (Gen_Decl, P_Subprogram_Specification);
if Nkind (Defining_Unit_Name (Specification (Gen_Decl))) =
N_Defining_Program_Unit_Name
and then Scope.Last > 0
then
Error_Msg_SP ("child unit allowed only at library level");
end if;
TF_Semicolon;
end if;
Set_Generic_Formal_Declarations (Gen_Decl, Decls);
return Gen_Decl;
end P_Generic;
-------------------------------
-- 12.1 Generic Declaration --
-------------------------------
-- Parsed by P_Generic (12.1)
------------------------------------------
-- 12.1 Generic Subprogram Declaration --
------------------------------------------
-- Parsed by P_Generic (12.1)
---------------------------------------
-- 12.1 Generic Package Declaration --
---------------------------------------
-- Parsed by P_Generic (12.1)
-------------------------------
-- 12.1 Generic Formal Part --
-------------------------------
-- Parsed by P_Generic (12.1)
-------------------------------------------------
-- 12.1 Generic Formal Parameter Declaration --
-------------------------------------------------
-- Parsed by P_Generic (12.1)
---------------------------------
-- 12.3 Generic Instantiation --
---------------------------------
-- Generic package instantiation parsed by P_Package (7.1)
-- Generic procedure instantiation parsed by P_Subprogram (6.1)
-- Generic function instantiation parsed by P_Subprogram (6.1)
-------------------------------
-- 12.3 Generic Actual Part --
-------------------------------
-- GENERIC_ACTUAL_PART ::=
-- (GENERIC_ASSOCIATION {, GENERIC_ASSOCIATION})
-- Returns a list of generic associations, or Empty if none are present
-- Error recovery: cannot raise Error_Resync
function P_Generic_Actual_Part_Opt return List_Id is
Association_List : List_Id;
begin
-- Figure out if a generic actual part operation is present. Clearly
-- there is no generic actual part if the current token is semicolon
if Token = Tok_Semicolon then
return No_List;
-- If we don't have a left paren, then we have an error, and the job
-- is to figure out whether a left paren or semicolon was intended.
-- We assume a missing left paren (and hence a generic actual part
-- present) if the current token is not on a new line, or if it is
-- indented from the subprogram token. Otherwise assume missing
-- semicolon (which will be diagnosed by caller) and no generic part
elsif Token /= Tok_Left_Paren
and then Token_Is_At_Start_Of_Line
and then Start_Column <= Scope.Table (Scope.Last).Ecol
then
return No_List;
-- Otherwise we have a generic actual part (either a left paren is
-- present, or we have decided that there must be a missing left paren)
else
Association_List := New_List;
T_Left_Paren;
loop
Append (P_Generic_Association, Association_List);
exit when not Comma_Present;
end loop;
T_Right_Paren;
return Association_List;
end if;
end P_Generic_Actual_Part_Opt;
-------------------------------
-- 12.3 Generic Association --
-------------------------------
-- GENERIC_ASSOCIATION ::=
-- [generic_formal_parameter_SELECTOR_NAME =>]
-- EXPLICIT_GENERIC_ACTUAL_PARAMETER
-- EXPLICIT_GENERIC_ACTUAL_PARAMETER ::=
-- EXPRESSION | variable_NAME | subprogram_NAME
-- | entry_NAME | SUBTYPE_MARK | package_instance_NAME
-- Error recovery: cannot raise Error_Resync
function P_Generic_Association return Node_Id is
Scan_State : Saved_Scan_State;
Param_Name_Node : Node_Id;
Generic_Assoc_Node : Node_Id;
begin
Generic_Assoc_Node := New_Node (N_Generic_Association, Token_Ptr);
if Token in Token_Class_Desig then
Param_Name_Node := Token_Node;
Save_Scan_State (Scan_State); -- at designator
Scan; -- past simple name or operator symbol
if Token = Tok_Arrow then
Scan; -- past arrow
Set_Selector_Name (Generic_Assoc_Node, Param_Name_Node);
else
Restore_Scan_State (Scan_State); -- to designator
end if;
end if;
Set_Explicit_Generic_Actual_Parameter (Generic_Assoc_Node, P_Expression);
return Generic_Assoc_Node;
end P_Generic_Association;
---------------------------------------------
-- 12.3 Explicit Generic Actual Parameter --
---------------------------------------------
-- Parsed by P_Generic_Association (12.3)
--------------------------------------
-- 12.4 Formal Object Declarations --
--------------------------------------
-- FORMAL_OBJECT_DECLARATION ::=
-- DEFINING_IDENTIFIER_LIST :
-- MODE SUBTYPE_MARK [:= DEFAULT_EXPRESSION];
-- The caller has checked that the initial token is an identifier
-- Error recovery: cannot raise Error_Resync
procedure P_Formal_Object_Declarations (Decls : List_Id) is
Decl_Node : Node_Id;
Scan_State : Saved_Scan_State;
Num_Idents : Nat;
Ident : Nat;
Idents : array (Int range 1 .. 4096) of Entity_Id;
-- This array holds the list of defining identifiers. The upper bound
-- of 4096 is intended to be essentially infinite, and we do not even
-- bother to check for it being exceeded.
begin
Idents (1) := P_Defining_Identifier (C_Comma_Colon);
Num_Idents := 1;
while Comma_Present loop
Num_Idents := Num_Idents + 1;
Idents (Num_Idents) := P_Defining_Identifier (C_Comma_Colon);
end loop;
T_Colon;
-- If there are multiple identifiers, we repeatedly scan the
-- type and initialization expression information by resetting
-- the scan pointer (so that we get completely separate trees
-- for each occurrence).
if Num_Idents > 1 then
Save_Scan_State (Scan_State);
end if;
-- Loop through defining identifiers in list
Ident := 1;
Ident_Loop : loop
Decl_Node := New_Node (N_Formal_Object_Declaration, Token_Ptr);
Set_Defining_Identifier (Decl_Node, Idents (Ident));
P_Mode (Decl_Node);
Set_Subtype_Mark (Decl_Node, P_Subtype_Mark_Resync);
No_Constraint;
Set_Expression (Decl_Node, Init_Expr_Opt);
if Ident > 1 then
Set_Prev_Ids (Decl_Node, True);
end if;
if Ident < Num_Idents then
Set_More_Ids (Decl_Node, True);
end if;
Append (Decl_Node, Decls);
exit Ident_Loop when Ident = Num_Idents;
Ident := Ident + 1;
Restore_Scan_State (Scan_State);
end loop Ident_Loop;
TF_Semicolon;
end P_Formal_Object_Declarations;
-----------------------------------
-- 12.5 Formal Type Declaration --
-----------------------------------
-- FORMAL_TYPE_DECLARATION ::=
-- type DEFINING_IDENTIFIER [DISCRIMINANT_PART]
-- is FORMAL_TYPE_DEFINITION;
-- The caller has checked that the initial token is TYPE
-- Error recovery: cannot raise Error_Resync
function P_Formal_Type_Declaration return Node_Id is
Decl_Node : Node_Id;
Def_Node : Node_Id;
begin
Decl_Node := New_Node (N_Formal_Type_Declaration, Token_Ptr);
Scan; -- past TYPE
Set_Defining_Identifier (Decl_Node, P_Defining_Identifier);
if P_Unknown_Discriminant_Part_Opt then
Set_Unknown_Discriminants_Present (Decl_Node, True);
else
Set_Discriminant_Specifications
(Decl_Node, P_Known_Discriminant_Part_Opt);
end if;
T_Is;
Def_Node := P_Formal_Type_Definition;
if Def_Node /= Error then
Set_Formal_Type_Definition (Decl_Node, Def_Node);
TF_Semicolon;
else
Decl_Node := Error;
-- If we have semicolon, skip it to avoid cascaded errors
if Token = Tok_Semicolon then
Scan;
end if;
end if;
return Decl_Node;
end P_Formal_Type_Declaration;
----------------------------------
-- 12.5 Formal Type Definition --
----------------------------------
-- FORMAL_TYPE_DEFINITION ::=
-- FORMAL_PRIVATE_TYPE_DEFINITION
-- | FORMAL_DERIVED_TYPE_DEFINITION
-- | FORMAL_DISCRETE_TYPE_DEFINITION
-- | FORMAL_SIGNED_INTEGER_TYPE_DEFINITION
-- | FORMAL_MODULAR_TYPE_DEFINITION
-- | FORMAL_FLOATING_POINT_DEFINITION
-- | FORMAL_ORDINARY_FIXED_POINT_DEFINITION
-- | FORMAL_DECIMAL_FIXED_POINT_DEFINITION
-- | FORMAL_ARRAY_TYPE_DEFINITION
-- | FORMAL_ACCESS_TYPE_DEFINITION
-- | FORMAL_INTERFACE_TYPE_DEFINITION
-- FORMAL_ARRAY_TYPE_DEFINITION ::= ARRAY_TYPE_DEFINITION
-- FORMAL_ACCESS_TYPE_DEFINITION ::= ACCESS_TYPE_DEFINITION
-- FORMAL_INTERFACE_TYPE_DEFINITION ::= INTERFACE_TYPE_DEFINITION
function P_Formal_Type_Definition return Node_Id is
Scan_State : Saved_Scan_State;
Typedef_Node : Node_Id;
begin
if Token_Name = Name_Abstract then
Check_95_Keyword (Tok_Abstract, Tok_Tagged);
end if;
if Token_Name = Name_Tagged then
Check_95_Keyword (Tok_Tagged, Tok_Private);
Check_95_Keyword (Tok_Tagged, Tok_Limited);
end if;
case Token is
-- Mostly we can tell what we have from the initial token. The one
-- exception is ABSTRACT, where we have to scan ahead to see if we
-- have a formal derived type or a formal private type definition.
-- In addition, in Ada 2005 LIMITED may appear after abstract, so
-- that the lookahead must be extended by one more token.
when Tok_Abstract =>
Save_Scan_State (Scan_State);
Scan; -- past ABSTRACT
if Token = Tok_New then
Restore_Scan_State (Scan_State); -- to ABSTRACT
return P_Formal_Derived_Type_Definition;
elsif Token = Tok_Limited then
Scan; -- past LIMITED
if Token = Tok_New then
Restore_Scan_State (Scan_State); -- to ABSTRACT
return P_Formal_Derived_Type_Definition;
else
Restore_Scan_State (Scan_State); -- to ABSTRACT
return P_Formal_Private_Type_Definition;
end if;
else
Restore_Scan_State (Scan_State); -- to ABSTRACT
return P_Formal_Private_Type_Definition;
end if;
when Tok_Access =>
return P_Access_Type_Definition;
when Tok_Array =>
return P_Array_Type_Definition;
when Tok_Delta =>
return P_Formal_Fixed_Point_Definition;
when Tok_Digits =>
return P_Formal_Floating_Point_Definition;
when Tok_Interface => -- Ada 2005 (AI-251)
return P_Interface_Type_Definition (Is_Synchronized => False);
when Tok_Left_Paren =>
return P_Formal_Discrete_Type_Definition;
when Tok_Limited =>
Save_Scan_State (Scan_State);
Scan; -- past LIMITED
if Token = Tok_Interface then
Typedef_Node := P_Interface_Type_Definition
(Is_Synchronized => False);
Set_Limited_Present (Typedef_Node);
return Typedef_Node;
elsif Token = Tok_New then
Restore_Scan_State (Scan_State); -- to LIMITED
return P_Formal_Derived_Type_Definition;
else
if Token = Tok_Abstract then
Error_Msg_SC ("ABSTRACT must come before LIMITED");
Scan; -- past improper ABSTRACT
if Token = Tok_New then
Restore_Scan_State (Scan_State); -- to LIMITED
return P_Formal_Derived_Type_Definition;
else
Restore_Scan_State (Scan_State);
return P_Formal_Private_Type_Definition;
end if;
end if;
Restore_Scan_State (Scan_State);
return P_Formal_Private_Type_Definition;
end if;
when Tok_Mod =>
return P_Formal_Modular_Type_Definition;
when Tok_New =>
return P_Formal_Derived_Type_Definition;
when Tok_Private |
Tok_Tagged =>
return P_Formal_Private_Type_Definition;
when Tok_Range =>
return P_Formal_Signed_Integer_Type_Definition;
when Tok_Record =>
Error_Msg_SC ("record not allowed in generic type definition!");
Discard_Junk_Node (P_Record_Definition);
return Error;
-- Ada 2005 (AI-345)
when Tok_Protected |
Tok_Synchronized |
Tok_Task =>
Scan; -- past TASK, PROTECTED or SYNCHRONIZED
declare
Saved_Token : constant Token_Type := Token;
begin
Typedef_Node := P_Interface_Type_Definition
(Is_Synchronized => True);
case Saved_Token is
when Tok_Task =>
Set_Task_Present (Typedef_Node);
when Tok_Protected =>
Set_Protected_Present (Typedef_Node);
when Tok_Synchronized =>
Set_Synchronized_Present (Typedef_Node);
when others =>
null;
end case;
return Typedef_Node;
end;
when others =>
Error_Msg_BC ("expecting generic type definition here");
Resync_Past_Semicolon;
return Error;
end case;
end P_Formal_Type_Definition;
--------------------------------------------
-- 12.5.1 Formal Private Type Definition --
--------------------------------------------
-- FORMAL_PRIVATE_TYPE_DEFINITION ::=
-- [[abstract] tagged] [limited] private
-- The caller has checked the initial token is PRIVATE, ABSTRACT,
-- TAGGED or LIMITED
-- Error recovery: cannot raise Error_Resync
function P_Formal_Private_Type_Definition return Node_Id is
Def_Node : Node_Id;
begin
Def_Node := New_Node (N_Formal_Private_Type_Definition, Token_Ptr);
if Token = Tok_Abstract then
Scan; -- past ABSTRACT
if Token_Name = Name_Tagged then
Check_95_Keyword (Tok_Tagged, Tok_Private);
Check_95_Keyword (Tok_Tagged, Tok_Limited);
end if;
if Token /= Tok_Tagged then
Error_Msg_SP ("ABSTRACT must be followed by TAGGED");
else
Set_Abstract_Present (Def_Node, True);
end if;
end if;
if Token = Tok_Tagged then
Set_Tagged_Present (Def_Node, True);
Scan; -- past TAGGED
end if;
if Token = Tok_Limited then
Set_Limited_Present (Def_Node, True);
Scan; -- past LIMITED
end if;
if Token = Tok_Abstract then
if Prev_Token = Tok_Tagged then
Error_Msg_SC ("ABSTRACT must come before TAGGED");
elsif Prev_Token = Tok_Limited then
Error_Msg_SC ("ABSTRACT must come before LIMITED");
end if;
Resync_Past_Semicolon;
elsif Token = Tok_Tagged then
Error_Msg_SC ("TAGGED must come before LIMITED");
Resync_Past_Semicolon;
end if;
Set_Sloc (Def_Node, Token_Ptr);
T_Private;
return Def_Node;
end P_Formal_Private_Type_Definition;
--------------------------------------------
-- 12.5.1 Formal Derived Type Definition --
--------------------------------------------
-- FORMAL_DERIVED_TYPE_DEFINITION ::=
-- [abstract] [limited]
-- new SUBTYPE_MARK [[AND interface_list] with private]
-- The caller has checked the initial token(s) is/are NEW, ASTRACT NEW
-- LIMITED NEW, or ABSTRACT LIMITED NEW
-- Error recovery: cannot raise Error_Resync
function P_Formal_Derived_Type_Definition return Node_Id is
Def_Node : Node_Id;
begin
Def_Node := New_Node (N_Formal_Derived_Type_Definition, Token_Ptr);
if Token = Tok_Abstract then
Set_Abstract_Present (Def_Node);
Scan; -- past ABSTRACT
end if;
if Token = Tok_Limited then
Set_Limited_Present (Def_Node);
Scan; -- past Limited
if Ada_Version < Ada_05 then
Error_Msg_SP
("LIMITED in derived type is an Ada 2005 extension");
Error_Msg_SP
("\unit must be compiled with -gnat05 switch");
end if;
if Token = Tok_Abstract then
Scan; -- past ABSTRACT. diagnosed already in caller.
end if;
end if;
Scan; -- past NEW;
Set_Subtype_Mark (Def_Node, P_Subtype_Mark);
No_Constraint;
-- Ada 2005 (AI-251): Deal with interfaces
if Token = Tok_And then
Scan; -- past AND
if Ada_Version < Ada_05 then
Error_Msg_SP
("abstract interface is an Ada 2005 extension");
Error_Msg_SP ("\unit must be compiled with -gnat05 switch");
end if;
Set_Interface_List (Def_Node, New_List);
loop
Append (P_Qualified_Simple_Name, Interface_List (Def_Node));
exit when Token /= Tok_And;
Scan; -- past AND
end loop;
end if;
if Token = Tok_With then
Scan; -- past WITH
Set_Private_Present (Def_Node, True);
T_Private;
elsif Token = Tok_Tagged then
Scan;
if Token = Tok_Private then
Error_Msg_SC ("TAGGED should be WITH");
Set_Private_Present (Def_Node, True);
T_Private;
else
Ignore (Tok_Tagged);
end if;
end if;
return Def_Node;
end P_Formal_Derived_Type_Definition;
---------------------------------------------
-- 12.5.2 Formal Discrete Type Definition --
---------------------------------------------
-- FORMAL_DISCRETE_TYPE_DEFINITION ::= (<>)
-- The caller has checked the initial token is left paren
-- Error recovery: cannot raise Error_Resync
function P_Formal_Discrete_Type_Definition return Node_Id is
Def_Node : Node_Id;
begin
Def_Node := New_Node (N_Formal_Discrete_Type_Definition, Token_Ptr);
Scan; -- past left paren
T_Box;
T_Right_Paren;
return Def_Node;
end P_Formal_Discrete_Type_Definition;
---------------------------------------------------
-- 12.5.2 Formal Signed Integer Type Definition --
---------------------------------------------------
-- FORMAL_SIGNED_INTEGER_TYPE_DEFINITION ::= range <>
-- The caller has checked the initial token is RANGE
-- Error recovery: cannot raise Error_Resync
function P_Formal_Signed_Integer_Type_Definition return Node_Id is
Def_Node : Node_Id;
begin
Def_Node :=
New_Node (N_Formal_Signed_Integer_Type_Definition, Token_Ptr);
Scan; -- past RANGE
T_Box;
return Def_Node;
end P_Formal_Signed_Integer_Type_Definition;
--------------------------------------------
-- 12.5.2 Formal Modular Type Definition --
--------------------------------------------
-- FORMAL_MODULAR_TYPE_DEFINITION ::= mod <>
-- The caller has checked the initial token is MOD
-- Error recovery: cannot raise Error_Resync
function P_Formal_Modular_Type_Definition return Node_Id is
Def_Node : Node_Id;
begin
Def_Node :=
New_Node (N_Formal_Modular_Type_Definition, Token_Ptr);
Scan; -- past MOD
T_Box;
return Def_Node;
end P_Formal_Modular_Type_Definition;
----------------------------------------------
-- 12.5.2 Formal Floating Point Definition --
----------------------------------------------
-- FORMAL_FLOATING_POINT_DEFINITION ::= digits <>
-- The caller has checked the initial token is DIGITS
-- Error recovery: cannot raise Error_Resync
function P_Formal_Floating_Point_Definition return Node_Id is
Def_Node : Node_Id;
begin
Def_Node :=
New_Node (N_Formal_Floating_Point_Definition, Token_Ptr);
Scan; -- past DIGITS
T_Box;
return Def_Node;
end P_Formal_Floating_Point_Definition;
-------------------------------------------
-- 12.5.2 Formal Fixed Point Definition --
-------------------------------------------
-- This routine parses either a formal ordinary fixed point definition
-- or a formal decimal fixed point definition:
-- FORMAL_ORDINARY_FIXED_POINT_DEFINITION ::= delta <>
-- FORMAL_DECIMAL_FIXED_POINT_DEFINITION ::= delta <> digits <>
-- The caller has checked the initial token is DELTA
-- Error recovery: cannot raise Error_Resync
function P_Formal_Fixed_Point_Definition return Node_Id is
Def_Node : Node_Id;
Delta_Sloc : Source_Ptr;
begin
Delta_Sloc := Token_Ptr;
Scan; -- past DELTA
T_Box;
if Token = Tok_Digits then
Def_Node :=
New_Node (N_Formal_Decimal_Fixed_Point_Definition, Delta_Sloc);
Scan; -- past DIGITS
T_Box;
else
Def_Node :=
New_Node (N_Formal_Ordinary_Fixed_Point_Definition, Delta_Sloc);
end if;
return Def_Node;
end P_Formal_Fixed_Point_Definition;
----------------------------------------------------
-- 12.5.2 Formal Ordinary Fixed Point Definition --
----------------------------------------------------
-- Parsed by P_Formal_Fixed_Point_Definition (12.5.2)
---------------------------------------------------
-- 12.5.2 Formal Decimal Fixed Point Definition --
---------------------------------------------------
-- Parsed by P_Formal_Fixed_Point_Definition (12.5.2)
------------------------------------------
-- 12.5.3 Formal Array Type Definition --
------------------------------------------
-- Parsed by P_Formal_Type_Definition (12.5)
-------------------------------------------
-- 12.5.4 Formal Access Type Definition --
-------------------------------------------
-- Parsed by P_Formal_Type_Definition (12.5)
-----------------------------------------
-- 12.6 Formal Subprogram Declaration --
-----------------------------------------
-- FORMAL_SUBPROGRAM_DECLARATION ::=
-- FORMAL_CONCRETE_SUBPROGRAM_DECLARATION
-- | FORMAL_ABSTRACT_SUBPROGRAM_DECLARATION
-- FORMAL_CONCRETE_SUBPROGRAM_DECLARATION ::=
-- with SUBPROGRAM_SPECIFICATION [is SUBPROGRAM_DEFAULT];
-- FORMAL_ABSTRACT_SUBPROGRAM_DECLARATION ::=
-- with SUBPROGRAM_SPECIFICATION is abstract [SUBPROGRAM_DEFAULT];
-- SUBPROGRAM_DEFAULT ::= DEFAULT_NAME | <>
-- DEFAULT_NAME ::= NAME | null
-- The caller has checked that the initial tokens are WITH FUNCTION or
-- WITH PROCEDURE, and the initial WITH has been scanned out.
-- A null default is an Ada 2005 feature
-- Error recovery: cannot raise Error_Resync
function P_Formal_Subprogram_Declaration return Node_Id is
Prev_Sloc : constant Source_Ptr := Prev_Token_Ptr;
Spec_Node : constant Node_Id := P_Subprogram_Specification;
Def_Node : Node_Id;
begin
if Token = Tok_Is then
T_Is; -- past IS, skip extra IS or ";"
if Token = Tok_Abstract then
Def_Node :=
New_Node (N_Formal_Abstract_Subprogram_Declaration, Prev_Sloc);
Scan; -- past ABSTRACT
if Ada_Version < Ada_05 then
Error_Msg_SP
("formal abstract subprograms are an Ada 2005 extension");
Error_Msg_SP ("\unit must be compiled with -gnat05 switch");
end if;
else
Def_Node :=
New_Node (N_Formal_Concrete_Subprogram_Declaration, Prev_Sloc);
end if;
Set_Specification (Def_Node, Spec_Node);
if Token = Tok_Semicolon then
Scan; -- past ";"
elsif Token = Tok_Box then
Set_Box_Present (Def_Node, True);
Scan; -- past <>
T_Semicolon;
elsif Token = Tok_Null then
if Ada_Version < Ada_05 then
Error_Msg_SP
("null default subprograms are an Ada 2005 extension");
Error_Msg_SP ("\unit must be compiled with -gnat05 switch");
end if;
if Nkind (Spec_Node) = N_Procedure_Specification then
Set_Null_Present (Spec_Node);
else
Error_Msg_SP ("only procedures can be null");
end if;
Scan; -- past NULL
T_Semicolon;
else
Set_Default_Name (Def_Node, P_Name);
T_Semicolon;
end if;
else
Def_Node :=
New_Node (N_Formal_Concrete_Subprogram_Declaration, Prev_Sloc);
Set_Specification (Def_Node, Spec_Node);
T_Semicolon;
end if;
return Def_Node;
end P_Formal_Subprogram_Declaration;
------------------------------
-- 12.6 Subprogram Default --
------------------------------
-- Parsed by P_Formal_Procedure_Declaration (12.6)
------------------------
-- 12.6 Default Name --
------------------------
-- Parsed by P_Formal_Procedure_Declaration (12.6)
--------------------------------------
-- 12.7 Formal Package Declaration --
--------------------------------------
-- FORMAL_PACKAGE_DECLARATION ::=
-- with package DEFINING_IDENTIFIER
-- is new generic_package_NAME FORMAL_PACKAGE_ACTUAL_PART;
-- FORMAL_PACKAGE_ACTUAL_PART ::=
-- (<>) | [GENERIC_ACTUAL_PART]
-- The caller has checked that the initial tokens are WITH PACKAGE,
-- and the initial WITH has been scanned out (so Token = Tok_Package).
-- Error recovery: cannot raise Error_Resync
function P_Formal_Package_Declaration return Node_Id is
Def_Node : Node_Id;
Scan_State : Saved_Scan_State;
begin
Def_Node := New_Node (N_Formal_Package_Declaration, Prev_Token_Ptr);
Scan; -- past PACKAGE
Set_Defining_Identifier (Def_Node, P_Defining_Identifier (C_Is));
T_Is;
T_New;
Set_Name (Def_Node, P_Qualified_Simple_Name);
if Token = Tok_Left_Paren then
Save_Scan_State (Scan_State); -- at the left paren
Scan; -- past the left paren
if Token = Tok_Box then
Set_Box_Present (Def_Node, True);
Scan; -- past box
T_Right_Paren;
else
Restore_Scan_State (Scan_State); -- to the left paren
Set_Generic_Associations (Def_Node, P_Generic_Actual_Part_Opt);
end if;
end if;
T_Semicolon;
return Def_Node;
end P_Formal_Package_Declaration;
--------------------------------------
-- 12.7 Formal Package Actual Part --
--------------------------------------
-- Parsed by P_Formal_Package_Declaration (12.7)
end Ch12;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . T R A C E S . S E N D --
-- --
-- B o d y --
-- --
-- Copyright (C) 2001-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. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This version is for all targets, provided that System.IO.Put_Line is
-- functional. It prints debug information to Standard Output
with System.IO; use System.IO;
with GNAT.Regpat; use GNAT.Regpat;
----------------
-- Send_Trace --
----------------
-- Prints debug information both in a human readable form
-- and in the form they are sent from upper layers.
separate (System.Traces.Format)
procedure Send_Trace (Id : Trace_T; Info : String) is
type Param_Type is
(Name_Param,
Caller_Param,
Entry_Param,
Timeout_Param,
Acceptor_Param,
Parent_Param,
Number_Param);
-- Type of parameter found in the message
Info_Trace : String_Trace := Format_Trace (Info);
function Get_Param
(Input : String_Trace;
Param : Param_Type;
How_Many : Integer)
return String;
-- Extract a parameter from the given input string
---------------
-- Get_Param --
---------------
function Get_Param
(Input : String_Trace;
Param : Param_Type;
How_Many : Integer)
return String
is
pragma Unreferenced (How_Many);
Matches : Match_Array (1 .. 2);
begin
-- We need comments here ???
case Param is
when Name_Param =>
Match ("/N:([\w]+)", Input, Matches);
when Caller_Param =>
Match ("/C:([\w]+)", Input, Matches);
when Entry_Param =>
Match ("/E:([\s]*) +([0-9 ,]+)", Input, Matches);
when Timeout_Param =>
Match ("/T:([\s]*) +([0-9]+.[0-9]+)", Input, Matches);
when Acceptor_Param =>
Match ("/A:([\w]+)", Input, Matches);
when Parent_Param =>
Match ("/P:([\w]+)", Input, Matches);
when Number_Param =>
Match ("/#:([\s]*) +([0-9]+)", Input, Matches);
end case;
if Matches (1).First < Input'First then
return "";
end if;
case Param is
when Timeout_Param | Entry_Param | Number_Param =>
return Input (Matches (2).First .. Matches (2).Last);
when others =>
return Input (Matches (1).First .. Matches (1).Last);
end case;
end Get_Param;
-- Start of processing for Send_Trace
begin
New_Line;
Put_Line ("- Trace Debug Info ----------------");
Put ("Caught event Id : ");
case Id is
when M_Accept_Complete => Put ("M_Accept_Complete");
New_Line;
Put_Line ("Task " & Get_Param (Info_Trace, Name_Param, 1)
& " completes accept on entry "
& Get_Param (Info_Trace, Entry_Param, 1) & " with "
& Get_Param (Info_Trace, Caller_Param, 1));
when M_Select_Else => Put ("M_Select_Else");
New_Line;
Put_Line ("Task " & Get_Param (Info_Trace, Name_Param, 1)
& " selects else statement");
when M_RDV_Complete => Put ("M_RDV_Complete");
New_Line;
Put_Line ("Task " & Get_Param (Info_Trace, Name_Param, 1)
& " completes rendezvous with "
& Get_Param (Info_Trace, Caller_Param, 1));
when M_Call_Complete => Put ("M_Call_Complete");
New_Line;
Put_Line ("Task " & Get_Param (Info_Trace, Name_Param, 1)
& " completes call");
when M_Delay => Put ("M_Delay");
New_Line;
Put_Line ("Task " & Get_Param (Info_Trace, Name_Param, 1)
& " completes delay "
& Get_Param (Info_Trace, Timeout_Param, 1));
when E_Missed => Put ("E_Missed");
New_Line;
Put_Line ("Task " & Get_Param (Info_Trace, Name_Param, 1)
& " got an invalid acceptor "
& Get_Param (Info_Trace, Acceptor_Param, 1));
when E_Timeout => Put ("E_Timeout");
New_Line;
Put_Line ("Task " & Get_Param (Info_Trace, Name_Param, 1)
& " ends select due to timeout ");
when E_Kill => Put ("E_Kill");
New_Line;
Put_Line ("Asynchronous Transfer of Control on task "
& Get_Param (Info_Trace, Name_Param, 1));
when W_Delay => Put ("W_Delay");
New_Line;
Put_Line ("Task " & Get_Param (Info_Trace, Name_Param, 1)
& " sleeping "
& Get_Param (Info_Trace, Timeout_Param, 1)
& " seconds");
when WU_Delay => Put ("WU_Delay");
New_Line;
Put_Line ("Task " & Get_Param (Info_Trace, Name_Param, 1)
& " sleeping until "
& Get_Param (Info_Trace, Timeout_Param, 1));
when W_Call => Put ("W_Call");
New_Line;
Put_Line ("Task " & Get_Param (Info_Trace, Name_Param, 1)
& " calling entry "
& Get_Param (Info_Trace, Entry_Param, 1)
& " of " & Get_Param (Info_Trace, Acceptor_Param, 1));
when W_Accept => Put ("W_Accept");
New_Line;
Put ("Task " & Get_Param (Info_Trace, Name_Param, 1)
& " waiting on "
& Get_Param (Info_Trace, Number_Param, 1)
& " accept(s)"
& ", " & Get_Param (Info_Trace, Entry_Param, 1));
New_Line;
when W_Select => Put ("W_Select");
New_Line;
Put_Line ("Task " & Get_Param (Info_Trace, Name_Param, 1)
& " waiting on "
& Get_Param (Info_Trace, Number_Param, 1)
& " select(s)"
& ", " & Get_Param (Info_Trace, Entry_Param, 1));
New_Line;
when W_Completion => Put ("W_Completion");
New_Line;
Put_Line ("Task " & Get_Param (Info_Trace, Name_Param, 1)
& " waiting for completion ");
when WT_Select => Put ("WT_Select");
New_Line;
Put ("Task " & Get_Param (Info_Trace, Name_Param, 1)
& " waiting " & Get_Param (Info_Trace, Timeout_Param, 1)
& " seconds on "
& Get_Param (Info_Trace, Number_Param, 1)
& " select(s)");
if Get_Param (Info_Trace, Number_Param, 1) /= "" then
Put (", " & Get_Param (Info_Trace, Entry_Param, 1));
end if;
New_Line;
when WT_Call => Put ("WT_Call");
New_Line;
Put_Line ("Task " & Get_Param (Info_Trace, Name_Param, 1)
& " calling entry "
& Get_Param (Info_Trace, Entry_Param, 1)
& " of " & Get_Param (Info_Trace, Acceptor_Param, 1)
& " with timeout "
& Get_Param (Info_Trace, Timeout_Param, 1));
when WT_Completion => Put ("WT_Completion");
New_Line;
Put_Line ("Task " & Get_Param (Info_Trace, Name_Param, 1)
& " waiting "
& Get_Param (Info_Trace, Timeout_Param, 1)
& " for call completion");
when PO_Call => Put ("PO_Call");
New_Line;
Put_Line ("Task " & Get_Param (Info_Trace, Name_Param, 1)
& " calling protected entry "
& Get_Param (Info_Trace, Entry_Param, 1));
when POT_Call => Put ("POT_Call");
New_Line;
Put_Line ("Task " & Get_Param (Info_Trace, Name_Param, 1)
& " calling protected entry "
& Get_Param (Info_Trace, Entry_Param, 1)
& " with timeout "
& Get_Param (Info_Trace, Timeout_Param, 1));
when PO_Run => Put ("PO_Run");
New_Line;
Put_Line ("Task " & Get_Param (Info_Trace, Name_Param, 1)
& " running entry "
& Get_Param (Info_Trace, Entry_Param, 1)
& " for "
& Get_Param (Info_Trace, Caller_Param, 1));
when PO_Done => Put ("PO_Done");
New_Line;
Put_Line ("Task " & Get_Param (Info_Trace, Name_Param, 1)
& " finished call from "
& Get_Param (Info_Trace, Caller_Param, 1));
when PO_Lock => Put ("PO_Lock");
New_Line;
Put_Line ("Task " & Get_Param (Info_Trace, Name_Param, 1)
& " took lock");
when PO_Unlock => Put ("PO_Unlock");
New_Line;
Put_Line ("Task " & Get_Param (Info_Trace, Name_Param, 1)
& " released lock");
when T_Create => Put ("T_Create");
New_Line;
Put_Line ("Task " & Get_Param (Info_Trace, Name_Param, 1)
& " created");
when T_Activate => Put ("T_Activate");
New_Line;
Put_Line ("Task " & Get_Param (Info_Trace, Name_Param, 1)
& " activated");
when T_Abort => Put ("T_Abort");
New_Line;
Put_Line ("Task " & Get_Param (Info_Trace, Name_Param, 1)
& " aborted by "
& Get_Param (Info_Trace, Parent_Param, 1));
when T_Terminate => Put ("T_Terminate");
New_Line;
Put_Line ("Task " & Get_Param (Info_Trace, Name_Param, 1)
& " terminated");
when others
=> Put ("Invalid Id");
end case;
Put_Line (" --> " & Info_Trace);
Put_Line ("-----------------------------------");
New_Line;
end Send_Trace;
|
with Ada.Text_IO;
with Spawn_Manager;
with Ada.Command_Line;
procedure Helper is
use Ada.Text_IO;
begin
if Spawn_Manager.Version /= $VERSION then
Ada.Command_Line.Set_Exit_Status (Ada.Command_Line.Failure);
Put_Line ("Version Missmatch : Code=""" & Spawn_Manager.Version & """ /= Lib=""" & $VERSION & """");
end if;
for I in 1 .. Ada.Command_Line.Argument_Count loop
if (Ada.Command_Line.Argument (I) = "-v") or else
(Ada.Command_Line.Argument (I) = "--version")
then
Put_Line (Spawn_Manager.Version);
end if;
end loop;
end Helper;
|
with Primes.PrimeNumberRequest_DataWriter;
with Primes.PrimeNumberReply_DataReader;
with DDS.Request_Reply.Requester.Typed_Requester_Generic;
package Primes.PrimeNumberRequester is new DDS.Request_Reply.Requester.Typed_Requester_Generic
(Request_DataWriter => Primes.PrimeNumberRequest_DataWriter,
Reply_DataReader => Primes.PrimeNumberReply_DataReader);
|
generic
type Real is digits <>;
package root is
type Base_Interface is limited interface;
procedure Primitive1 (B : in out Base_Interface) is abstract; -- builds
procedure Primitive2 (B : in out Base_Interface) is null; -- causes bug
type Derived_Interface is limited interface and Base_Interface;
----------------------------------------------------------
-- derivations that used to be in child package.
-- If they are in the same package, the build proceeds fine
type Base_Type is abstract new Base_Interface with null record;
type Derived_Type is abstract new Base_Type and Derived_Interface with null record;
end root;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . B B . C P U _ S P E C I F I C --
-- --
-- S p e c --
-- --
-- Copyright (C) 1999-2002 Universidad Politecnica de Madrid --
-- Copyright (C) 2003-2004 The European Space Agency --
-- Copyright (C) 2003-2021, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- 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 primitives which are dependent on the
-- underlying processor.
pragma Restrictions (No_Elaboration_Code);
with Ada.Unchecked_Conversion;
with Interfaces;
with System;
with System.BB.Interrupts;
package System.BB.CPU_Specific is
pragma Preelaborate;
package SBI renames System.BB.Interrupts;
------------------
-- CPU Features --
------------------
type Intel_Family is mod 2 ** 4;
type Intel_Model_Number is mod 2 ** 8;
type CPU_Model is record
Family : Intel_Family;
Model : Intel_Model_Number;
end record;
function My_CPU_Model return CPU_Model;
-- Return the CPU model for the current CPU
-- List of known CPUs
No_Model : constant CPU_Model := (0, 0);
-- Client and Server Processors
Sandy_Bridge_Client : constant CPU_Model := (16#6#, 16#2A#);
Sandy_Bridge_Server : constant CPU_Model := (16#6#, 16#2D#);
Ivy_Bridge_Client : constant CPU_Model := (16#6#, 16#3A#);
Ivy_Bridge_Server : constant CPU_Model := (16#6#, 16#3E#);
Haswell_Client : constant CPU_Model := (16#6#, 16#3C#);
Haswell_Client_L : constant CPU_Model := (16#6#, 16#35#);
Haswell_Client_G : constant CPU_Model := (16#6#, 16#36#);
Haswell_Server : constant CPU_Model := (16#6#, 16#3F#);
Broadwell_Client : constant CPU_Model := (16#6#, 16#3D#);
Broadwell_Client_G : constant CPU_Model := (16#6#, 16#47#);
Broadwell_Server : constant CPU_Model := (16#6#, 16#4F#);
Broadwell_Server_D : constant CPU_Model := (16#6#, 16#56#);
-- Small Core Processors
Goldmont : constant CPU_Model := (16#6#, 16#5C#);
Denverton : constant CPU_Model := (16#6#, 16#5F#);
--------------------
-- CPUID Features --
--------------------
Max_CPUID_Index : Interfaces.Unsigned_32;
-- Max CPU ID leaf index supported by the processor
type Unsigned_4 is mod 2 ** 4;
type Processor_Types is
(Original_OEM_Processor, Intel_OverDrive_Processor,
Dual_Processor, Reserved);
type Feature_Information_EAX is record
Stepping : Unsigned_4;
Model : Unsigned_4;
Family : Intel_Family;
Processor_Type : Processor_Types;
Extended_Model : Unsigned_4;
Extended_Family : Interfaces.Unsigned_8;
end record with Size => 32;
for Feature_Information_EAX use record
Stepping at 0 range 0 .. 3;
Model at 0 range 4 .. 7;
Family at 0 range 8 .. 11;
Processor_Type at 0 range 12 .. 13;
Extended_Model at 0 range 16 .. 19;
Extended_Family at 0 range 20 .. 27;
end record;
type Feature_Information_ECX is record
x2APIC : Boolean;
TSC_Deadline : Boolean;
XSAVE : Boolean;
OSXSAVE : Boolean;
AVX : Boolean;
end record with Size => 32;
for Feature_Information_ECX use record
x2APIC at 0 range 21 .. 21;
TSC_Deadline at 0 range 24 .. 24;
XSAVE at 0 range 26 .. 26;
OSXSAVE at 0 range 27 .. 27;
AVX at 0 range 28 .. 28;
end record;
type Feature_Information_EDX is record
TSC : Boolean;
APIC : Boolean;
end record with Size => 32;
for Feature_Information_EDX use record
TSC at 0 range 4 .. 4;
APIC at 0 range 9 .. 9;
end record;
type Extended_State_Subleaf_1_EAX is record
XSAVEOPT : Boolean;
end record;
for Extended_State_Subleaf_1_EAX use record
XSAVEOPT at 0 range 0 .. 0;
end record;
type Extended_Function_Time_EDX is record
Invariant_TSC : Boolean;
end record;
for Extended_Function_Time_EDX use record
Invariant_TSC at 0 range 8 .. 8;
end record;
------------------------------
-- Model Specific Registers --
------------------------------
MSR_PLATFORM_INFO : constant := 16#CE#;
type Platform_Infomation is record
Maximum_Non_Turbo_Ratio : Interfaces.Unsigned_8;
end record with Size => 32;
for Platform_Infomation use record
Maximum_Non_Turbo_Ratio at 0 range 8 .. 15;
end record;
IA32_GS_BASE : constant := 16#C0000101#;
-----------------------
-- Control Registers --
-----------------------
type Control_Register_4 is record
Virtual_8086_Mode_Extensions : Boolean;
Protected_Mode_Virtual_Interrupts : Boolean;
Time_Stamp_Disable : Boolean;
Debugging_Extensions : Boolean;
Page_Size_Extensions : Boolean;
Physical_Address_Extension : Boolean;
Machine_Check_Enable : Boolean;
Page_Global_Enable : Boolean;
Performance_Monitoring_Counter_Enable : Boolean;
FXSAVE_FXRSTOR_And_SSE_Enable : Boolean;
OS_Support_for_Unmasked_SIMD_FP_Exceptions : Boolean;
User_Mode_Instruction_Prevention : Boolean;
VMX_Enable : Boolean;
SMX_Enable : Boolean;
FSGSBASE_Enable : Boolean;
PCID_Enable : Boolean;
XSAVE_and_Processor_Extended_States_Enable : Boolean;
SMEP_Enable : Boolean;
SMAP_Enable : Boolean;
Protection_Key_Enable : Boolean;
end record with Size => 64;
-- Important: when writing to a control register, the values of the reserve
-- bits should not be changed.
type Hardware_Piority_Level is mod 2 ** 4;
type Control_Register_8 is record
Task_Priority_Level : Hardware_Piority_Level;
end record with Size => 64;
for Control_Register_4 use record
Virtual_8086_Mode_Extensions at 0 range 0 .. 0;
Protected_Mode_Virtual_Interrupts at 0 range 1 .. 1;
Time_Stamp_Disable at 0 range 2 .. 2;
Debugging_Extensions at 0 range 3 .. 3;
Page_Size_Extensions at 0 range 4 .. 4;
Physical_Address_Extension at 0 range 5 .. 5;
Machine_Check_Enable at 0 range 6 .. 6;
Page_Global_Enable at 0 range 7 .. 7;
Performance_Monitoring_Counter_Enable at 0 range 8 .. 8;
FXSAVE_FXRSTOR_And_SSE_Enable at 0 range 9 .. 9;
OS_Support_for_Unmasked_SIMD_FP_Exceptions at 0 range 10 .. 10;
User_Mode_Instruction_Prevention at 0 range 11 .. 11;
VMX_Enable at 0 range 13 .. 13;
SMX_Enable at 0 range 14 .. 14;
FSGSBASE_Enable at 0 range 16 .. 16;
PCID_Enable at 0 range 17 .. 17;
XSAVE_and_Processor_Extended_States_Enable at 0 range 18 .. 18;
SMEP_Enable at 0 range 20 .. 20;
SMAP_Enable at 0 range 21 .. 21;
Protection_Key_Enable at 0 range 22 .. 22;
end record;
for Control_Register_8 use record
Task_Priority_Level at 0 range 0 .. 3;
end record;
------------------------
-- Context management --
------------------------
-- EFLAG
type IO_Privilege is mod 2;
type Carry_Flag_Status is (False, True);
for Carry_Flag_Status use (False => 2#10#, True => 2#11#);
-- The bit next to the Carry Flag is always 1 so extend the carry flag to
-- cover that bit as well to save us from having to have to define a
-- useless "always one" component to the record.
type EFLAGS is record
Carry_Flag : Carry_Flag_Status;
Parity_Flag : Boolean;
Auxiliary_Carry_Flag : Boolean;
Zero_Flag : Boolean;
Sign_Flag : Boolean;
Trap_Flag : Boolean;
Interrupt_Enable_Flag : Boolean;
Direction_Flag : Boolean;
Overflow_Flag : Boolean;
IO_Privilege_Level : IO_Privilege;
Nested_Task : Boolean;
Resume_Flag : Boolean;
Virtual_8086_Mode : Boolean;
Alignment_Check_Access_Control : Boolean;
Virtual_Interrupt_Flag : Boolean;
Virtual_Interrupt_Pending : Boolean;
ID_Flag : Boolean;
end record with Size => 64;
for EFLAGS use record
Carry_Flag at 0 range 0 .. 1;
Parity_Flag at 0 range 2 .. 2;
Auxiliary_Carry_Flag at 0 range 4 .. 4;
Zero_Flag at 0 range 6 .. 6;
Sign_Flag at 0 range 7 .. 7;
Trap_Flag at 0 range 8 .. 8;
Interrupt_Enable_Flag at 0 range 9 .. 9;
Direction_Flag at 0 range 10 .. 10;
Overflow_Flag at 0 range 11 .. 11;
IO_Privilege_Level at 0 range 12 .. 13;
Nested_Task at 0 range 14 .. 14;
Resume_Flag at 0 range 16 .. 16;
Virtual_8086_Mode at 0 range 17 .. 17;
Alignment_Check_Access_Control at 0 range 18 .. 18;
Virtual_Interrupt_Flag at 0 range 19 .. 19;
Virtual_Interrupt_Pending at 0 range 20 .. 20;
ID_Flag at 0 range 21 .. 21;
end record;
-- The context buffer is a type that represents thread's state and is not
-- otherwise stored in main memory. This typically includes all user-
-- visible registers, and possibly some other status as well.
type Context_Buffer is record
-- Only callee-saved registers need to be saved, as the context switch
-- is always synchronous. We save/restore the link return register
-- so we can load the initial stack pointer on start.
RIP : System.Address; -- Link return register
RFLAGS : EFLAGS; -- FLAG register
RSP : System.Address; -- Stack pointer
RBX : System.Address;
RBP : System.Address;
R12 : System.Address;
R13 : System.Address;
R14 : System.Address;
R15 : System.Address;
end record;
for Context_Buffer use record
RIP at 0 range 0 .. 63;
RFLAGS at 8 range 0 .. 63;
RSP at 16 range 0 .. 63;
RBX at 24 range 0 .. 63;
RBP at 32 range 0 .. 63;
R12 at 40 range 0 .. 63;
R13 at 48 range 0 .. 63;
R14 at 56 range 0 .. 63;
R15 at 64 range 0 .. 63;
end record;
-- State_Component_Bit_Map
type State_Component_Bit_Map is record
X87 : Boolean;
SSE : Boolean;
AVX : Boolean;
MPX_BNDREGS : Boolean;
MPX_BNDCSR : Boolean;
AVX_512_Opmask : Boolean;
AVX_512_ZMM_Hi256 : Boolean;
AVX_512_Hi16_ZMM : Boolean;
PT : Boolean;
PKRU : Boolean;
CET_U : Boolean;
CET_S : Boolean;
HDC : Boolean;
end record with Size => 64;
for State_Component_Bit_Map use record
X87 at 0 range 0 .. 0;
SSE at 0 range 1 .. 1;
AVX at 0 range 2 .. 2;
MPX_BNDREGS at 0 range 3 .. 3;
MPX_BNDCSR at 0 range 4 .. 4;
AVX_512_Opmask at 0 range 5 .. 5;
AVX_512_ZMM_Hi256 at 0 range 6 .. 6;
AVX_512_Hi16_ZMM at 0 range 7 .. 7;
PT at 0 range 8 .. 8;
PKRU at 0 range 9 .. 9;
CET_U at 0 range 11 .. 11;
CET_S at 0 range 12 .. 12;
HDC at 0 range 13 .. 13;
end record;
BB_X86_Context_State : constant State_Component_Bit_Map :=
(X87 => True,
SSE => True,
AVX => True,
AVX_512_Opmask => True,
AVX_512_ZMM_Hi256 => True,
AVX_512_Hi16_ZMM => True,
others => False);
-- The process state that we will save for the BB runtime. Keep in sync
-- with the XSAVE_Area type above, otherwise we run the risk of writing
-- outside the bounds of XSAVE_Area.
Stack_Alignment : constant := 16;
-- Hardware stack alignment requirement
----------------
-- Local APIC --
----------------
Local_APIC_Base_Address : constant := 16#FEE0_0000#;
Local_APIC_ID_Offset_Address : constant := 16#020#;
Local_APIC_EOI_Offset_Address : constant := 16#0B0#;
Local_APIC_Spurious_Int_Offset_Address : constant := 16#0F0#;
Local_APIC_ICR_Low_Offset_Address : constant := 16#300#;
Local_APIC_ICR_High_Offset_Address : constant := 16#310#;
Local_APIC_LVT_Timer_Offset_Address : constant := 16#320#;
Local_APIC_Initial_Count_Offset_Address : constant := 16#380#;
Local_APIC_Timer_Current_Count_Address : constant := 16#390#;
Local_APIC_Divide_Config_Offset_Address : constant := 16#3E0#;
type APIC_ID is new Interfaces.Unsigned_8;
type Local_APIC_ID is record
ID : APIC_ID;
end record with Size => 32;
for Local_APIC_ID use record
ID at 0 range 24 .. 31;
end record;
type Local_APIC_EOI is (Signal) with Size => 32;
for Local_APIC_EOI use (Signal => 0);
type Local_APIC_Spurious_Interrupt is record
Spurious_Vector : Interrupts.Interrupt_ID;
APIC_Enabled : Boolean;
Focus_Processor_Checking : Boolean;
Suppress_EOI_Broadcast : Boolean;
end record with Size => 32;
for Local_APIC_Spurious_Interrupt use record
Spurious_Vector at 0 range 0 .. 7;
APIC_Enabled at 0 range 8 .. 8;
Focus_Processor_Checking at 0 range 9 .. 9;
Suppress_EOI_Broadcast at 0 range 12 .. 12;
end record;
type Interrupt_Command_High is record
Destination : Interfaces.Unsigned_8;
end record;
for Interrupt_Command_High use record
Destination at 0 range 24 .. 31;
end record;
type Destination_Shorthand is
(No_Shorthand, Self, All_Including_Self, All_Excluding_Self);
type Trigger_Type is (Edge, Level);
for Trigger_Type use (Edge => 2#01#, Level => 2#11#);
type Delivery_Status is (Idle, Send_Pending);
type Destination_Mode_Type is (Physical, Logical);
type Delivery_Mode_Type is
(Fixed, Lowest_Priority, SMI, NMI, INIT, Start_Up);
for Delivery_Mode_Type use
(Fixed => 2#000#, Lowest_Priority => 2#001#,
SMI => 2#010#, NMI => 2#100#,
INIT => 2#101#, Start_Up => 2#110#);
type Interrupt_Command_Low is record
Destination : Destination_Shorthand;
Trigger : Trigger_Type;
Delivery : Delivery_Status;
Destination_Mode : Destination_Mode_Type;
Delivery_Mode : Delivery_Mode_Type;
Vector : Interrupts.Interrupt_ID;
end record;
for Interrupt_Command_Low use record
Destination at 0 range 18 .. 19;
Trigger at 0 range 14 .. 15;
Delivery at 0 range 12 .. 12;
Destination_Mode at 0 range 11 .. 11;
Delivery_Mode at 0 range 8 .. 10;
Vector at 0 range 0 .. 7;
end record;
type Timer_Type is (One_Shot, Periodic, TSC_Deadline);
for Timer_Type use (One_Shot => 0, Periodic => 1, TSC_Deadline => 2);
type LVT_Timer is record
Timer_Mode : Timer_Type;
Mask : Boolean;
Delivery : Delivery_Status;
Vector : Interrupts.Interrupt_ID;
end record with Size => 32;
for LVT_Timer use record
Timer_Mode at 0 range 17 .. 18;
Mask at 0 range 16 .. 16;
Delivery at 0 range 12 .. 12;
Vector at 0 range 0 .. 7;
end record;
type APIC_Time is new Interfaces.Unsigned_32;
type Divide_Configuration is
(Divide_by_2, Divide_by_4, Divide_by_8, Divide_by_16, Divide_by_32,
Divide_by_64, Divide_by_128, Divide_by_1);
for Divide_Configuration use
(Divide_by_2 => 2#0000#, Divide_by_4 => 2#0001#,
Divide_by_8 => 2#0010#, Divide_by_16 => 2#0011#,
Divide_by_32 => 2#1000#, Divide_by_64 => 2#1001#,
Divide_by_128 => 2#1010#, Divide_by_1 => 2#1011#);
Local_APIC_ID_Register : Local_APIC_ID
with Volatile_Full_Access,
Address =>
System'To_Address
(Local_APIC_Base_Address + Local_APIC_ID_Offset_Address);
Local_APIC_End_of_Interrupt : Local_APIC_EOI
with Volatile_Full_Access,
Address =>
System'To_Address
(Local_APIC_Base_Address + Local_APIC_EOI_Offset_Address);
Local_APIC_Spurious_Interrupt_Register : Local_APIC_Spurious_Interrupt
with Volatile_Full_Access,
Address =>
System'To_Address
(Local_APIC_Base_Address + Local_APIC_Spurious_Int_Offset_Address);
Interrupt_Command_Register_Low : Interrupt_Command_Low
with Volatile_Full_Access,
Address =>
System'To_Address
(Local_APIC_Base_Address + Local_APIC_ICR_Low_Offset_Address);
Interrupt_Command_Register_High : Interrupt_Command_High
with Volatile_Full_Access,
Address =>
System'To_Address
(Local_APIC_Base_Address + Local_APIC_ICR_High_Offset_Address);
Local_APIC_LVT_Timer_Register : LVT_Timer
with Volatile_Full_Access,
Address =>
System'To_Address
(Local_APIC_Base_Address + Local_APIC_LVT_Timer_Offset_Address);
Local_APIC_Timer_Initial_Count : APIC_Time
with Volatile,
Address =>
System'To_Address
(Local_APIC_Base_Address + Local_APIC_Initial_Count_Offset_Address);
Local_APIC_Timer_Current_Count : APIC_Time
with Volatile,
Address =>
System'To_Address
(Local_APIC_Base_Address + Local_APIC_Timer_Current_Count_Address);
Local_APIC_Timer_Divide_Configuration : Divide_Configuration
with Volatile,
Address =>
System'To_Address
(Local_APIC_Base_Address + Local_APIC_Divide_Config_Offset_Address);
----------------
-- APIC Timer --
----------------
APIC_Timer_Interrupt_ID : constant Interrupts.Interrupt_ID := 255;
TSC_Frequency_In_kHz : Interfaces.Unsigned_64;
-- The frequency of the Time Stamp Counter in kHz. We use kHz because is
-- gives us more head room when when convert from ticks to nanoseconds and
-- vice versa (since we need to multiply ticks with the frequency, which
-- caps the maximum number of ticks the clock can accumulate until we can
-- no longer perform that conversion).
---------
-- PIT --
---------
PIT_Channel_0_Data_Port : constant := 16#40#;
PIT_Mode_Command_Port : constant := 16#43#;
type PIT_Channel is (Channel_0, Channel_1, Channel_2, Read_Back);
type PIT_Access_Mode is
(Latch_Count_Value, Low_Byte, High_Byte, Low_High_Byte);
type PIT_Operating_Mode is
(Interrupt_On_Terminal_Count, One_Shot, Rate_Generator,
Square_Wave_Generator, Software_Triggered_Strobe,
Hardware_Triggered_Strobe);
type PIT_BCD_Binary_Mode is (BCD, Binary);
type PIT_Mode_Command_Register is record
Channel : PIT_Channel;
Access_Mode : PIT_Access_Mode;
Operating_Mode : PIT_Operating_Mode;
BCD_Binary_Mode : PIT_BCD_Binary_Mode;
end record with Size => 8;
for PIT_Mode_Command_Register use record
Channel at 0 range 6 .. 7;
Access_Mode at 0 range 4 .. 5;
Operating_Mode at 0 range 1 .. 3;
BCD_Binary_Mode at 0 range 0 .. 0;
end record;
function To_IO_Byte is new
Ada.Unchecked_Conversion
(PIT_Mode_Command_Register, Interfaces.Unsigned_8);
---------------
-- CPU Clock --
---------------
function Read_Raw_Clock return Interfaces.Unsigned_64
with Inline;
-- Read the hardware clock source
-------------------------
-- Hardware Exceptions --
-------------------------
type Error_Code is mod 2 ** 64;
-- A code the processor will push onto the exception stack in response to
-- certain exceptions.
-- Exceptions IDs
Divide_Error_Exception : constant SBI.Interrupt_ID := 0;
Dedug_Execption : constant SBI.Interrupt_ID := 1;
NMI_Interrupt : constant SBI.Interrupt_ID := 2;
Breakpoint_Execption : constant SBI.Interrupt_ID := 3;
Overflow_Exception : constant SBI.Interrupt_ID := 4;
BOUND_Range_Exceeded_Exception : constant SBI.Interrupt_ID := 5;
Invalid_Opcode_Exception : constant SBI.Interrupt_ID := 6;
Device_Not_Available_Exception : constant SBI.Interrupt_ID := 7;
Double_Fault_Exception : constant SBI.Interrupt_ID := 8;
Invalid_TSS_Exception : constant SBI.Interrupt_ID := 10;
Segment_Not_Present_Exception : constant SBI.Interrupt_ID := 11;
Stack_Segment_Fault_Exception : constant SBI.Interrupt_ID := 12;
General_Protection_Exception : constant SBI.Interrupt_ID := 13;
Page_Fault_Exception : constant SBI.Interrupt_ID := 14;
Math_Fault_Exception : constant SBI.Interrupt_ID := 16;
Alignment_Check_Exception : constant SBI.Interrupt_ID := 17;
Machine_Check_Exception : constant SBI.Interrupt_ID := 18;
SIMD_Floating_Point_Exception : constant SBI.Interrupt_ID := 19;
Virtualization_Exception : constant SBI.Interrupt_ID := 20;
Control_Protection_Exception : constant SBI.Interrupt_ID := 21;
------------------
-- Helper Types --
------------------
-- The Bytable types allow the individual bytes of an unsigned types to be
-- easily accessed.
type Bytable_View is (Full, Bytes);
type Unsigned_16_Bytable (View : Bytable_View := Full) is record
case View is
when Full =>
Value : Interfaces.Unsigned_16;
when Bytes =>
Low : Interfaces.Unsigned_8;
High : Interfaces.Unsigned_8;
end case;
end record with Unchecked_Union, Size => 16;
for Unsigned_16_Bytable use record
Value at 0 range 0 .. 15;
Low at 0 range 0 .. 7;
High at 0 range 8 .. 15;
end record;
end System.BB.CPU_Specific;
|
-- Copyright (c) 1990 Regents of the University of California.
-- All rights reserved.
--
-- This software was developed by John Self of the Arcadia project
-- at the University of California, Irvine.
--
-- Redistribution and use in source and binary forms are permitted
-- provided that the above copyright notice and this paragraph are
-- duplicated in all such forms and that any documentation,
-- advertising materials, and other materials related to such
-- distribution and use acknowledge that the software was developed
-- by the University of California, Irvine. The name of the
-- University may not be used to endorse or promote products derived
-- from this software without specific prior written permission.
-- THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
-- IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
-- WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-- TITLE DFA construction routines
-- AUTHOR: John Self (UCI)
-- DESCRIPTION converts non-deterministic finite automatons to finite ones.
-- $Header: /co/ua/self/arcadia/aflex/ada/src/RCS/dfaS.a,v 1.4 90/01/12 15:19:52 self Exp Locker: self $
with misc_defs;
with text_io;
package dfa is
use MISC_DEFS, TEXT_IO;
procedure CHECK_FOR_BACKTRACKING(DS : in INTEGER;
STATE : in UNBOUNDED_INT_ARRAY);
procedure CHECK_TRAILING_CONTEXT(NFA_STATES : in INT_PTR;
NUM_STATES : in INTEGER;
ACCSET : in INT_PTR;
NACC : in INTEGER);
procedure DUMP_ASSOCIATED_RULES(F : in FILE_TYPE;
DS : in INTEGER);
procedure DUMP_TRANSITIONS(F : in FILE_TYPE;
STATE : in UNBOUNDED_INT_ARRAY);
procedure EPSCLOSURE(T : in out INT_PTR;
NS_ADDR : in out INTEGER;
ACCSET : in out INT_PTR;
NACC_ADDR, HV_ADDR : out INTEGER;
RESULT : out INT_PTR);
procedure INCREASE_MAX_DFAS;
procedure NTOD;
procedure SNSTODS(SNS : in INT_PTR;
NUMSTATES : in INTEGER;
ACCSET : in INT_PTR;
NACC, HASHVAL : in INTEGER;
NEWDS_ADDR : out INTEGER;
RESULT : out BOOLEAN);
function SYMFOLLOWSET(DS : in INT_PTR;
DSIZE, TRANSSYM : in INTEGER;
NSET : in INT_PTR) return INTEGER;
procedure SYMPARTITION(DS : in INT_PTR;
NUMSTATES : in INTEGER;
SYMLIST : in out C_SIZE_BOOL_ARRAY;
DUPLIST : in out C_SIZE_ARRAY);
end dfa;
|
-- SPDX-FileCopyrightText: 2019-2021 Max Reznik <reznikmm@gmail.com>
--
-- SPDX-License-Identifier: MIT
-------------------------------------------------------------
with Program.Element_Vector_Factories;
with Program.Element_Vectors;
with Program.Element_Visitors;
with Program.Elements.Component_Definitions;
with Program.Elements.Defining_Identifiers;
with Program.Elements.Defining_Names;
with Program.Elements.Enumeration_Literal_Specifications;
with Program.Elements.Identifiers;
with Program.Elements.Package_Declarations;
with Program.Elements.Signed_Integer_Types;
with Program.Elements.Subtype_Declarations;
with Program.Elements.Subtype_Indications;
with Program.Elements.Unconstrained_Array_Types;
with Program.Implicit_Element_Factories;
with Program.Lexical_Elements;
with Program.Node_Symbols;
with Program.Plain_Lexical_Elements;
with Program.Predefined_Operators;
with Program.Symbol_Lists;
with Program.Symbols;
with Program.Visibility;
with Program.Resolvers.Basic;
procedure Program.Resolve_Standard
(Unit : not null Program.Compilation_Units.Compilation_Unit_Access;
Context : aliased in out Program.Visibility.Context;
Library : in out Program.Library_Environments.Library_Environment;
Subpool : not null System.Storage_Pools.Subpools.Subpool_Handle;
Setter : not null
Program.Cross_Reference_Updaters.Cross_Reference_Updater_Access)
is
function To_Symbol
(Name : access Program.Elements.Element'Class)
return Program.Symbols.Symbol;
Factory : Program.Implicit_Element_Factories.Element_Factory (Subpool);
Vectors : Program.Element_Vector_Factories.Element_Vector_Factory (Subpool);
package Visitors is
type Visitor
is new Program.Resolvers.Basic.Visitor with record
Meta_Char : Program.Visibility.Meta_Character_Literal_Kind :=
Program.Visibility.Meta_Character;
end record;
overriding procedure Enumeration_Literal_Specification
(Self : in out Visitor;
Element : not null Program.Elements.Enumeration_Literal_Specifications
.Enumeration_Literal_Specification_Access);
overriding procedure Package_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Package_Declarations
.Package_Declaration_Access);
overriding procedure Signed_Integer_Type
(Self : in out Visitor;
Element : not null Program.Elements.Signed_Integer_Types
.Signed_Integer_Type_Access);
overriding procedure Subtype_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Subtype_Declarations
.Subtype_Declaration_Access);
overriding procedure Unconstrained_Array_Type
(Self : in out Visitor;
Element : not null Program.Elements.Unconstrained_Array_Types
.Unconstrained_Array_Type_Access);
end Visitors;
package body Visitors is
---------------------------------------
-- Enumeration_Literal_Specification --
---------------------------------------
overriding procedure Enumeration_Literal_Specification
(Self : in out Visitor;
Element : not null Program.Elements.Enumeration_Literal_Specifications
.Enumeration_Literal_Specification_Access)
is
Symbol : constant Program.Symbols.Symbol :=
Program.Node_Symbols.Get_Symbol (Element.Name);
begin
if Program.Symbols.Is_Character_Literal (Symbol) then
Self.Env.Create_Character_Literal
(Symbol,
Element.Name,
Self.Meta_Char,
Self.Type_View);
if Self.Meta_Char not in Visibility.Meta_Wide_Wide_Character then
Self.Meta_Char :=
Visibility.Meta_Character_Literal_Kind'Succ (Self.Meta_Char);
end if;
else
Self.Env.Create_Enumeration_Literal
(Symbol,
Element.Name,
Self.Type_View);
end if;
end Enumeration_Literal_Specification;
-------------------------
-- Package_Declaration --
-------------------------
overriding procedure Package_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Package_Declarations
.Package_Declaration_Access) is
begin
Self.Env.Create_Package
(Symbol => Program.Symbols.Standard,
Name => Element.Name);
Self.Visit_Each_Child (Element);
end Package_Declaration;
-------------------------
-- Signed_Integer_Type --
-------------------------
overriding procedure Signed_Integer_Type
(Self : in out Visitor;
Element : not null Program.Elements.Signed_Integer_Types
.Signed_Integer_Type_Access)
is
pragma Unreferenced (Element);
Type_View : Program.Visibility.View;
Ignore : Program.Element_Vectors.Element_Vector_Access;
begin
Self.Env.Create_Signed_Integer_Type
(Symbol => Program.Node_Symbols.Get_Symbol (Self.Type_Name),
Name => Self.Type_Name);
Type_View := Self.Env.Latest_View;
Self.Env.Leave_Declarative_Region;
Program.Predefined_Operators.Create_Operators_For_Integer
(Self => Self.Env.all,
Type_View => Type_View,
Setter => Setter,
Factory => Factory,
Vectors => Vectors,
Result => Ignore); -- FIXME: keep result in AST
end Signed_Integer_Type;
-------------------------
-- Subtype_Declaration --
-------------------------
overriding procedure Subtype_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Subtype_Declarations
.Subtype_Declaration_Access)
is
use type Program.Visibility.View_Cursor;
Subtype_Name : constant
Program.Elements.Defining_Names.Defining_Name_Access :=
Element.Name.To_Defining_Name;
Subtype_Mark_Symbol : constant Program.Symbols.Symbol :=
To_Symbol (Element.Subtype_Indication.Subtype_Mark);
begin
for J in Self.Env.Immediate_Visible (Subtype_Mark_Symbol) loop
Self.Env.Create_Subtype
(Symbol => Program.Node_Symbols.Get_Symbol (Subtype_Name),
Name => Subtype_Name,
Subtype_Mark => +J,
Has_Constraint => Element
.Subtype_Indication.Constraint.Assigned);
Self.Visit_Each_Child (Element);
Self.Env.Leave_Declarative_Region;
return;
end loop;
raise Program_Error;
end Subtype_Declaration;
------------------------------
-- Unconstrained_Array_Type --
------------------------------
overriding procedure Unconstrained_Array_Type
(Self : in out Visitor;
Element : not null Program.Elements.Unconstrained_Array_Types
.Unconstrained_Array_Type_Access)
is
use type Program.Visibility.View_Cursor;
Index_Symbol : constant Program.Symbols.Symbol :=
To_Symbol (Element.Index_Subtypes.Element (1));
Component_Symbol : constant Program.Symbols.Symbol :=
To_Symbol (Element.Component_Definition);
Type_View : Program.Visibility.View;
Ignore : Program.Element_Vectors.Element_Vector_Access;
begin
for Index_View in Self.Env.Immediate_Visible (Index_Symbol) loop
for Component in Self.Env.Immediate_Visible (Component_Symbol) loop
Self.Env.Create_Array_Type
(Symbol => Program.Node_Symbols.Get_Symbol (Self.Type_Name),
Name => Self.Type_Name,
Indexes => (1 => +Index_View),
Component => +Component);
Type_View := Self.Env.Latest_View;
Self.Env.Leave_Declarative_Region;
Program.Predefined_Operators.Create_Operators_For_Array
(Self => Self.Env.all,
Type_View => Type_View,
Setter => Setter,
Factory => Factory,
Vectors => Vectors,
Result => Ignore); -- FIXME: keep result in AST
return;
end loop;
end loop;
raise Program_Error;
end Unconstrained_Array_Type;
end Visitors;
function To_Symbol
(Name : access Program.Elements.Element'Class)
return Program.Symbols.Symbol
is
type Getter is new Program.Element_Visitors.Element_Visitor with record
Result : Program.Symbols.Symbol := Program.Symbols.No_Symbol;
end record;
overriding procedure Identifier
(Self : in out Getter;
Element : not null Program.Elements.Identifiers.Identifier_Access);
overriding procedure Component_Definition
(Self : in out Getter;
Element : not null Program.Elements.Component_Definitions
.Component_Definition_Access);
overriding procedure Subtype_Indication
(Self : in out Getter;
Element : not null Program.Elements.Subtype_Indications
.Subtype_Indication_Access);
--------------------------
-- Component_Definition --
--------------------------
overriding procedure Component_Definition
(Self : in out Getter;
Element : not null Program.Elements.Component_Definitions
.Component_Definition_Access)
is
begin
Element.Subtype_Indication.Visit (Self);
end Component_Definition;
----------------
-- Identifier --
----------------
overriding procedure Identifier
(Self : in out Getter;
Element : not null Program.Elements.Identifiers.Identifier_Access)
is
Token : constant Program.Lexical_Elements.Lexical_Element_Access :=
Element.To_Identifier_Text.Identifier_Token;
begin
Self.Result := Program.Plain_Lexical_Elements.Lexical_Element
(Token.all).Symbol;
end Identifier;
------------------------
-- Subtype_Indication --
------------------------
overriding procedure Subtype_Indication
(Self : in out Getter;
Element : not null Program.Elements.Subtype_Indications
.Subtype_Indication_Access)
is
begin
Element.Subtype_Mark.Visit (Self);
end Subtype_Indication;
G : Getter;
begin
Name.Visit (G);
pragma Assert (G.Result not in Program.Symbols.No_Symbol);
return G.Result;
end To_Symbol;
Visitor : Visitors.Visitor (Context'Unchecked_Access, Setter);
Root : constant Program.Elements.Element_Access := Unit.Unit_Declaration;
begin
Context.Create_Empty_Context;
Root.Visit (Visitor);
Library.Put_Public_View
(Program.Symbol_Lists.Empty_Symbol_List, -- Means Standard root package
Context.Create_Snapshot);
end Program.Resolve_Standard;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- I N T E R F A C E S . C _ S T R E A M S --
-- --
-- B o d y --
-- --
-- Copyright (C) 1996-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. --
-- --
-- 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. --
-- --
------------------------------------------------------------------------------
-- This is the Alpha/VMS version
with Unchecked_Conversion;
package body Interfaces.C_Streams is
use type System.CRTL.size_t;
-- As the functions fread, fwrite and setvbuf are too big to be inlined,
-- they are just wrappers to the following implementation functions.
function fread_impl
(buffer : voids;
size : size_t;
count : size_t;
stream : FILEs) return size_t;
function fread_impl
(buffer : voids;
index : size_t;
size : size_t;
count : size_t;
stream : FILEs) return size_t;
function fwrite_impl
(buffer : voids;
size : size_t;
count : size_t;
stream : FILEs) return size_t;
function setvbuf_impl
(stream : FILEs;
buffer : chars;
mode : int;
size : size_t) return int;
------------
-- fread --
------------
function fread_impl
(buffer : voids;
size : size_t;
count : size_t;
stream : FILEs) return size_t
is
Get_Count : size_t := 0;
type Buffer_Type is array (size_t range 1 .. count,
size_t range 1 .. size) of Character;
type Buffer_Access is access Buffer_Type;
function To_BA is new Unchecked_Conversion (voids, Buffer_Access);
BA : constant Buffer_Access := To_BA (buffer);
Ch : int;
begin
-- This Fread goes with the Fwrite below. The C library fread sometimes
-- can't read fputc generated files.
for C in 1 .. count loop
for S in 1 .. size loop
Ch := fgetc (stream);
if Ch = EOF then
return Get_Count;
end if;
BA.all (C, S) := Character'Val (Ch);
end loop;
Get_Count := Get_Count + 1;
end loop;
return Get_Count;
end fread_impl;
function fread_impl
(buffer : voids;
index : size_t;
size : size_t;
count : size_t;
stream : FILEs) return size_t
is
Get_Count : size_t := 0;
type Buffer_Type is array (size_t range 1 .. count,
size_t range 1 .. size) of Character;
type Buffer_Access is access Buffer_Type;
function To_BA is new Unchecked_Conversion (voids, Buffer_Access);
BA : constant Buffer_Access := To_BA (buffer);
Ch : int;
begin
-- This Fread goes with the Fwrite below. The C library fread sometimes
-- can't read fputc generated files.
for C in 1 + index .. count + index loop
for S in 1 .. size loop
Ch := fgetc (stream);
if Ch = EOF then
return Get_Count;
end if;
BA.all (C, S) := Character'Val (Ch);
end loop;
Get_Count := Get_Count + 1;
end loop;
return Get_Count;
end fread_impl;
function fread
(buffer : voids;
size : size_t;
count : size_t;
stream : FILEs) return size_t
is
begin
return fread_impl (buffer, size, count, stream);
end fread;
function fread
(buffer : voids;
index : size_t;
size : size_t;
count : size_t;
stream : FILEs) return size_t
is
begin
return fread_impl (buffer, index, size, count, stream);
end fread;
------------
-- fwrite --
------------
function fwrite_impl
(buffer : voids;
size : size_t;
count : size_t;
stream : FILEs) return size_t
is
Put_Count : size_t := 0;
type Buffer_Type is array (size_t range 1 .. count,
size_t range 1 .. size) of Character;
type Buffer_Access is access Buffer_Type;
function To_BA is new Unchecked_Conversion (voids, Buffer_Access);
BA : constant Buffer_Access := To_BA (buffer);
begin
-- Fwrite on VMS has the undesirable effect of always generating at
-- least one record of output per call, regardless of buffering. To
-- get around this, we do multiple fputc calls instead.
for C in 1 .. count loop
for S in 1 .. size loop
if fputc (Character'Pos (BA.all (C, S)), stream) = EOF then
return Put_Count;
end if;
end loop;
Put_Count := Put_Count + 1;
end loop;
return Put_Count;
end fwrite_impl;
function fwrite
(buffer : voids;
size : size_t;
count : size_t;
stream : FILEs) return size_t
is
begin
return fwrite_impl (buffer, size, count, stream);
end fwrite;
-------------
-- setvbuf --
-------------
function setvbuf_impl
(stream : FILEs;
buffer : chars;
mode : int;
size : size_t) return int
is
use type System.Address;
begin
-- In order for the above fwrite hack to work, we must always buffer
-- stdout and stderr. Is_regular_file on VMS cannot detect when
-- these are redirected to a file, so checking for that condition
-- doesnt help.
if mode = IONBF
and then (stream = stdout or else stream = stderr)
then
return System.CRTL.setvbuf
(stream, buffer, IOLBF, System.CRTL.size_t (size));
else
return System.CRTL.setvbuf
(stream, buffer, mode, System.CRTL.size_t (size));
end if;
end setvbuf_impl;
function setvbuf
(stream : FILEs;
buffer : chars;
mode : int;
size : size_t) return int
is
begin
return setvbuf_impl (stream, buffer, mode, size);
end setvbuf;
end Interfaces.C_Streams;
|
with System.Machine_Code; use System.Machine_Code;
package body MSPGD is
procedure Standby is
begin
Asm ("bis.b #0xD8, SR", Volatile => True);
end Standby;
procedure Stop is
begin
Asm ("bis.b #0xF8, SR", Volatile => True);
end Stop;
procedure Reset is
begin
Asm ("mov.b #0, &0x0121", Volatile => True);
end Reset;
end MSPGD;
|
-- tests with generics
with Ada.Text_IO; use Ada.Text_IO;
procedure Generics is
generic
type T is (<>);
N : in T;
with function "*" (A, B : T) return T is <>;
function Multiplier (X : T) return T;
function Multiplier (X : T) return T is
begin
return N * X;
end;
function Double_It is new Multiplier (Integer, 2);
-- this can't work.
--function Double_It is new Multiplier (Float, 2.0);
type Num is (Zero, One, Two, Three, Four, Five, Six);
function "*" (A, B : Num) return Num is
begin
if Num'Pos (A) * Num'Pos (B) <= Num'Pos (Six) then
return Num'Val (Num'Pos (A) * Num'Pos (B));
else
return Six;
end if;
end;
-- no problem with overloading in Ada!
function Double_It is new Multiplier (Num, Two);
function Star_Op (A, B : Integer) return Integer is
begin
return (if A > B then A * (B + 1) else (A + 1) * B);
end Star_Op;
--function Strangeness is new Multiplier (Integer, 6, Star_Op);
function Strangeness is new Multiplier (T => Integer,
N => 6,
"*" => Star_Op);
-- Ada.Text_IO.Integer_IO is a generic pkg! Here we instantiate it,
-- the use it to overload Put with this type too.
package Int_IO is new Integer_IO (Integer);
use Int_IO;
-- a modular type
type Byte is mod 256;
Byte_Test : Byte := 255;
-- Ada.Text_IO.Modular_IO is another generic pkg.
package Mod_IO is new Modular_IO (Byte);
use Mod_IO;
-- and another generic package is...
package Enum_IO is new Enumeration_IO (Num);
use Enum_IO;
Num_Test : Num := Zero;
begin
-- Modular test
Put (Byte_Test); New_Line; -- 255
Byte_Test := Byte_Test + 1; -- this is ok
Put (Byte_Test); New_Line; -- 0
-- enumeration test
Put (Num_Test); New_Line; -- ZERO
Put (Num'Succ (Num_Test)); New_Line; -- ONE
-- generics tests
Put (Double_It (10)); New_Line;
-- instead of Enum_IO, we can do this:
Put_Line (Num'Image (Double_It (Three))); -- SIX
Put_Line (Num'Image (Double_It (Two))); -- FOUR
Put (Strangeness (10)); New_Line;
Put (Strangeness (5)); New_Line;
Put (Strangeness (7)); New_Line;
end Generics;
|
--
-- The author disclaims copyright to this source code. In place of
-- a legal notice, here is a blessing:
--
-- May you do good and not evil.
-- May you find forgiveness for yourself and forgive others.
-- May you share freely, not taking more than you give.
--
with Ada.Command_Line;
with Setup;
package Command_Line is
Terminate_Program : exception;
-- Raised when program should terminate.
procedure Parse (Config : in out Setup.Configuration);
-- Parse command line and change Config accordingly. Print out
-- program version or help text and raise Terminate_Program.
procedure Put_Usage;
-- Show program usage text to screen.
procedure Put_Version;
-- Show program name and version to screen.
subtype Exit_Status is Ada.Command_Line.Exit_Status;
Success : Exit_Status renames Ada.Command_Line.Success;
Failure : Exit_Status renames Ada.Command_Line.Failure;
procedure Set_Exit_Status (Status : Exit_Status) renames
Ada.Command_Line.Set_Exit_Status;
-- Set program exit status.
end Command_Line;
|
-- { dg-do compile }
-- { dg-options "-g" }
procedure Debug5 is
type Record_Type (L1, L2 : Natural) is record
S1 : String (1 .. L1);
case L2 is
when 0 => null;
when others => S2 : String (L1 .. L2);
end case;
end record;
procedure Discard (R : Record_Type) is
begin
null;
end Discard;
R : constant Record_Type := (0, 0, others => <>);
begin
Discard (R);
end Debug5;
|
--------------------------------------------------------------------------------------------------------------------
-- Copyright (c) 2013-2020, Luke A. Guest
--
-- This software is provided 'as-is', without any express or implied
-- warranty. In no event will the authors be held liable for any damages
-- arising from the use of this software.
--
-- Permission is granted to anyone to use this software for any purpose,
-- including commercial applications, and to alter it and redistribute it
-- freely, subject to the following restrictions:
--
-- 1. The origin of this software must not be misrepresented; you must not
-- claim that you wrote the original software. If you use this software
-- in a product, an acknowledgment in the product documentation would be
-- appreciated but is not required.
--
-- 2. Altered source versions must be plainly marked as such, and must not be
-- misrepresented as being the original software.
--
-- 3. This notice may not be removed or altered from any source
-- distribution.
--------------------------------------------------------------------------------------------------------------------
-- SDL.Events.Events
--
-- Combines all of the various event types into a single variant record to match the union in the SDL library. Not
-- the nicest of names for the package, but it works.
--------------------------------------------------------------------------------------------------------------------
with SDL.Events.Windows;
with SDL.Events.Keyboards;
with SDL.Events.Mice;
with SDL.Events.Joysticks;
with SDL.Events.Controllers;
with SDL.Events.Touches;
with SDL.Events.Files;
package SDL.Events.Events is
pragma Preelaborate;
type Event_Selector is (Is_Event,
Is_Window_Event,
Is_Keyboard_Event,
Is_Text_Editing_Event,
Is_Text_Input_Event,
Is_Mouse_Motion_Event,
Is_Mouse_Button_Event,
Is_Mouse_Wheel_Event,
Is_Joystick_Axis_Event,
Is_Joystick_Ball_Event,
Is_Joystick_Hat_Event,
Is_Joystick_Button_Event,
Is_Joystick_Device_Event,
Is_Controller_Axis_Event,
Is_Controller_Button_Event,
Is_Controller_Device_Event,
Is_Touch_Finger_Event,
Is_Touch_Multi_Gesture_Event,
Is_Touch_Dollar_Gesture,
Is_Drop_Event);
type Events (Event_Type : Event_Selector := Is_Event) is
record
case Event_Type is
when Is_Window_Event =>
Window : SDL.Events.Windows.Window_Events;
when Is_Keyboard_Event =>
Keyboard : SDL.Events.Keyboards.Keyboard_Events;
when Is_Text_Editing_Event =>
Text_Editing : SDL.Events.Keyboards.Text_Editing_Events;
when Is_Text_Input_Event =>
Text_Input : SDL.Events.Keyboards.Text_Input_Events;
when Is_Mouse_Motion_Event =>
Mouse_Motion : SDL.Events.Mice.Motion_Events;
when Is_Mouse_Button_Event =>
Mouse_Button : SDL.Events.Mice.Button_Events;
when Is_Mouse_Wheel_Event =>
Mouse_Wheel : SDL.Events.Mice.Wheel_Events;
when Is_Joystick_Axis_Event =>
Joystick_Axis : SDL.Events.Joysticks.Axis_Events;
when Is_Joystick_Ball_Event =>
Joystick_Ball : SDL.Events.Joysticks.Ball_Events;
when Is_Joystick_Hat_Event =>
Joystick_Hat : SDL.Events.Joysticks.Hat_Events;
when Is_Joystick_Button_Event =>
Joystick_Button : SDL.Events.Joysticks.Button_Events;
when Is_Joystick_Device_Event =>
Joystick_Device : SDL.Events.Joysticks.Device_Events;
when Is_Controller_Axis_Event =>
Controller_Axis : SDL.Events.Controllers.Axis_Events;
when Is_Controller_Button_Event =>
Controller_Button : SDL.Events.Controllers.Button_Events;
when Is_Controller_Device_Event =>
Controller_Device : SDL.Events.Controllers.Device_Events;
when Is_Touch_Finger_Event =>
Touch_Finger : SDL.Events.Touches.Finger_Events;
when Is_Touch_Multi_Gesture_Event =>
Touch_Multi_Gesture : SDL.Events.Touches.Multi_Gesture_Events;
when Is_Touch_Dollar_Gesture =>
Touch_Dollar_Gesture : SDL.Events.Touches.Dollar_Events;
when Is_Drop_Event =>
Drop : SDL.Events.Files.Drop_Events;
when others =>
Common : Common_Events;
end case;
end record with
Unchecked_Union,
Convention => C;
-- Some error occurred while polling/waiting for events.
Event_Error : exception;
-- Poll for currently pending events.
--
-- If the are any pending events, the next event is removed from the queue
-- and stored in Event, and then this returns True. Otherwise, this does
-- nothing and returns False.
function Poll (Event : out Events) return Boolean with
Inline => True;
-- Wait until an event is pending.
--
-- If there are any pending events, the next event is removed from
-- the queue and stored in Event.
procedure Wait (Event : out Events);
end SDL.Events.Events;
|
with vermek;
procedure demo is
begin
end demo;
|
package body System.Long_Long_Elementary_Functions is
function Fast_Log (X : Long_Long_Float) return Long_Long_Float is
begin
return Long_Long_Float (Fast_Log (Long_Float (X)));
end Fast_Log;
function Fast_Exp (X : Long_Long_Float) return Long_Long_Float is
begin
return Long_Long_Float (Fast_Exp (Long_Float (X)));
end Fast_Exp;
function Fast_Pow (Left, Right : Long_Long_Float) return Long_Long_Float is
begin
return Long_Long_Float (
Fast_Pow (Long_Float (Left), Long_Float (Right)));
end Fast_Pow;
function Fast_Sinh (X : Long_Long_Float) return Long_Long_Float is
begin
return Long_Long_Float (Fast_Sinh (Long_Float (X)));
end Fast_Sinh;
function Fast_Cosh (X : Long_Long_Float) return Long_Long_Float is
begin
return Long_Long_Float (Fast_Cosh (Long_Float (X)));
end Fast_Cosh;
function Fast_Tanh (X : Long_Long_Float) return Long_Long_Float is
begin
return Long_Long_Float (Fast_Tanh (Long_Float (X)));
end Fast_Tanh;
function Fast_Arcsinh (X : Long_Long_Float) return Long_Long_Float is
begin
return Long_Long_Float (Fast_Arcsinh (Long_Float (X)));
end Fast_Arcsinh;
function Fast_Arccosh (X : Long_Long_Float) return Long_Long_Float is
begin
return Long_Long_Float (Fast_Arccosh (Long_Float (X)));
end Fast_Arccosh;
function Fast_Arctanh (X : Long_Long_Float) return Long_Long_Float is
begin
return Long_Long_Float (Fast_Arctanh (Long_Float (X)));
end Fast_Arctanh;
end System.Long_Long_Elementary_Functions;
|
with Interfaces;
package Bit_Packed_Array1 is
type laser_illuminator_code_group_t is (zero, one);
pragma Convention (C, laser_illuminator_code_group_t);
subtype lic_array_index_t is Interfaces.Unsigned_8 range 0 .. 3;
type lic_array_t is array (lic_array_index_t)
of laser_illuminator_code_group_t;
pragma Convention (C, lic_array_t);
type Eighty_Bytes_T is array (1 .. 80) of Interfaces.Unsigned_8;
type Mission_Assignment_T is record
Eighty_Bytes : Eighty_Bytes_T;
Laser_Illuminator_Code : lic_array_t;
end record;
for Mission_Assignment_T use record
Eighty_Bytes at 0 range 0 .. 639;
Laser_Illuminator_Code at 0 range 653 .. 780;
end record;
type Mission_Assignment_Dbase_Rec_T is record
ISF : Mission_Assignment_T;
end record;
MADR : Mission_Assignment_Dbase_Rec_T;
procedure Generate_Callforward;
end Bit_Packed_Array1;
|
-----------------------------------------------------------------------
-- wiki-nodes-lists -- Wiki Document Internal representation
-- Copyright (C) 2016, 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 Util.Refs;
package Wiki.Nodes.Lists is
pragma Preelaborate;
package Node_List_Refs is new Util.Refs.General_References (Node_List, Finalize);
type Node_List_Ref is new Node_List_Refs.Ref with null record;
-- Append a node to the node list.
procedure Append (Into : in out Node_List_Ref;
Node : in Node_Type_Access);
-- Iterate over the nodes of the list and call the <tt>Process</tt> procedure with
-- each node instance.
procedure Iterate (List : in Node_List_Access;
Process : not null access procedure (Node : in Node_Type));
-- Iterate over the nodes of the list and call the <tt>Process</tt> procedure with
-- each node instance.
procedure Iterate (List : in Node_List_Ref;
Process : not null access procedure (Node : in Node_Type));
-- Returns True if the list reference is empty.
function Is_Empty (List : in Node_List_Ref) return Boolean;
-- Get the number of nodes in the list.
function Length (List : in Node_List_Ref) return Natural;
private
subtype Node_List_Accessor is Node_List_Refs.Element_Accessor;
procedure Iterate (List : in Node_List_Accessor;
Process : not null access procedure (Node : in Node_Type));
end Wiki.Nodes.Lists;
|
-- Score PIXAL le 07/10/2020 à 14:33 : 100%
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
-- Lire et écrire un tableau d'entiers.
procedure Tableau_IO is
Capacite: constant Integer := 10; -- Cette taille est arbitraire
type T_TableauBrut is array (1..Capacite) of Integer;
type T_Tableau is
record
Elements: T_TableauBrut;
Taille: Integer;
-- Invariant: 0 <= Taille and Taille <= Capacite;
end record;
--------------------[ Ne pas changer le code qui précède ]---------------------
procedure Lire_Tableau(Tableau: out T_Tableau) is
begin
Put("Nombre d'éléments ? ");
Get(Tableau.Taille);
if Tableau.Taille < 0 then
Tableau.Taille = 0;
end if;
for J in 1..Tableau.Taille loop
if J > Capacite then
Put_Line("Données tronquées");
else
Put("Element ");
Put(J, 1);
Put(" ? ");
Get(Tableau.Elements(J));
end if;
end loop;
if Tableau.Taille > Capacite then
Tableau.Taille := Capacite;
end if;
end Lire_Tableau;
procedure Ecrire_Tableau (Tableau: in T_Tableau) is
begin
Put("[");
for J in 1..Tableau.Taille loop
if J > 1 then
Put(", ");
end if;
Put(Tableau.Elements(J), 1);
end loop;
Put("]");
end Ecrire_Tableau;
----[ Ne pas changer le code qui suit, sauf pour la question optionnelle ]----
Tab1: T_Tableau; -- Un tableau
begin
Lire_Tableau (Tab1);
-- Afficher le tableau lu
Put ("Tableau lu : ");
Ecrire_Tableau (Tab1);
New_Line;
-- DERNIERE QUESTION:
-- On peux ne pas modifier l'attribut Taille de T_Tableau (si ce dernier est > Capacite)
-- et donc, dans le programme principale, si T_Tableau.Taille > Capacite, c'est que les
-- données ont été tronquées.
end Tableau_IO;
|
-- Copyright (C) 2019 Thierry Rascle <thierr26@free.fr>
-- MIT license. Please refer to the LICENSE file.
with Apsepp.Test_Reporter_Class; use Apsepp.Test_Reporter_Class;
function Apsepp.Test_Node_Class.Runner_Sequential.Create
(Root_Node_Access : Test_Node_Access;
Test_Reporter_Instance_Access : Test_Reporter_Access := null;
Reporter_Access_Set_CB : Scope_Bound_Locks.SB_Lock_CB := null)
return Test_Runner_Sequential;
|
with System.Formatting.Literals.Float;
with System.Value_Errors;
package body System.Val_Dec is
function Value_Decimal (Str : String; Scale : Integer) return Integer is
Last : Natural := Str'First - 1;
Result : Long_Long_Float;
Error : Boolean;
begin
Formatting.Literals.Float.Get_Literal (Str, Last, Result, Error);
if not Error then
Formatting.Literals.Check_Last (Str, Last, Error);
if not Error then
return Integer (Result * 10.0 ** Scale);
end if;
end if;
Value_Errors.Raise_Value_Failure ("Decimal", Str);
end Value_Decimal;
end System.Val_Dec;
|
pragma Assertion_Policy(Check);
with Libadalang.Analysis;
with Extraction.Node_Edge_Types;
with Extraction.Utilities;
package body Extraction.Direct_Calls is
use type LALCO.Ada_Node_Kind_Type;
function Is_Duplicate_Callsite(Name : LAL.Name) return Boolean is
function Is_Node_Duplicating_Parent(Node : LAL.Name) return Boolean is
Parent : constant LAL.Ada_Node'Class := Node.Parent;
begin
if Parent.Kind = LALCO.Ada_Call_Expr
and then Node = Parent.As_Call_Expr.F_Name
then
declare
Call_Expr : LAL.Call_Expr := Parent.As_Call_Expr;
begin
if Call_Expr.P_Called_Subp_Spec = LAL.No_Ada_Node
and then Call_Expr.Parent.Kind = LALCO.Ada_Call_Expr
and then Call_Expr.Parent.As_Call_Expr.P_Called_Subp_Spec.Kind = LALCO.Ada_Entry_Spec
then
Call_Expr := Call_Expr.Parent.As_Call_Expr;
end if;
return Node.P_Called_Subp_Spec = Call_Expr.P_Called_Subp_Spec;
end;
else
return Parent.Kind = LALCO.Ada_Dotted_Name
and then Node = Parent.As_Dotted_Name.F_Suffix;
end if;
end Is_Node_Duplicating_Parent;
begin
if Name.Kind = LALCO.Ada_Dotted_Name
or else Name.Kind in LALCO.Ada_Base_Id
then
return Is_Node_Duplicating_Parent(Name);
else
pragma Assert(Name.Kind = LALCO.Ada_Call_Expr, "Expected call expression");
return False;
end if;
end Is_Duplicate_Callsite;
function Is_Direct_Call(Node : LAL.Ada_Node'Class) return Boolean is
begin
case Node.Kind is
when LALCO.Ada_Name =>
return Node.As_Name.P_Is_Direct_Call
and then not Is_Duplicate_Callsite(Node.As_Name);
when LALCO.Ada_Un_Op_Range =>
return not Utilities.Get_Referenced_Decl(Node.As_Un_Op.F_Op).Is_Null;
when LALCO.Ada_Bin_Op_Range =>
return not Utilities.Get_Referenced_Decl(Node.As_Bin_Op.F_Op).Is_Null;
when others =>
return False;
end case;
end Is_Direct_Call;
function Get_Target(Expr : LAL.Expr'Class) return LAL.Basic_Decl is
begin
case LALCO.Ada_Expr(Expr.Kind) is
when LALCO.Ada_Name =>
return Utilities.Get_Parent_Basic_Decl(Expr.As_Name.P_Called_Subp_Spec);
when LALCO.Ada_Bin_Op_Range =>
return Utilities.Get_Referenced_Decl(Expr.As_Bin_Op.F_Op);
when LALCO.Ada_Un_Op_Range =>
return Utilities.Get_Referenced_Decl(Expr.As_Un_Op.F_Op);
when others =>
raise Internal_Extraction_Error with "Cases in Is_Direct_Call and Get_Target do not match";
end case;
end Get_Target;
procedure Extract_Edges
(Node : LAL.Ada_Node'Class;
Graph : Graph_Operations.Graph_Context)
is
begin
if Is_Direct_Call(Node) then
declare
Expr : constant LAL.Expr := Node.As_Expr;
Source : constant LAL.Basic_Decl := Utilities.Get_Parent_Basic_Decl(Expr);
Target : constant LAL.Basic_Decl := Get_Target(Expr);
Edge_Attrs : constant GW.Attribute_Value_Sets.Map := Node_Edge_Types.Get_Edge_Attributes(Expr);
begin
Graph.Write_Edge(Source, Target, Node_Edge_Types.Edge_Type_Calls, Edge_Attrs);
end;
end if;
end Extract_Edges;
end Extraction.Direct_Calls;
|
----------------------------------------------------------
-- Copyright (c), The MIT License (MIT)
-- Author: Lyaaaaaaaaaaaaaaa
--
-- Revision History:
-- 18/09/2019 Lyaaaaaaaaaaaaaaa
-- - Added file header
-- - Filter_Check becomes Check_Filters
--
-- Encoding issues :
-- - Needs UTF-8 encoded files,
-- otherwise it will return wrong data.
--
-- Limitations :
-- - Filters can't be longer than 40 characters.
-- See array_line_control 's range in Create_Filters.
-- See Filters in Create_Filters and its subtype.
----------------------------------------------------------
with Text_IO; use Text_IO;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Text_IO.Unbounded_IO;
with Ada.Characters.Handling; use Ada.Characters.Handling;
----------------------------------------------------------
package Log_Filter is
----------------------------------------------------------
type Store_Filter is
array (Natural range <>, Natural range <>) of Character;
type Store_Filters_State is
array (Natural range <>) of Boolean;
----------------------------------------------------------
--------------------------------------------
-- Procedures and functions --
--------------------------------------------
-------------------
-- Filters --
-------------------
procedure Create_Filters
(P_Number_Of_Filters : Natural;
P_User_Filters_Input : String;
P_Last_Inputs_Position : Natural);
-- Inserts into 2D table "Store_Filter" input words in lower case.
-- Calls Read_File
procedure Check_Filters
(P_Filters : store_Filter;
P_Number_Of_Filters : Natural;
P_Word : String;
P_Filters_State : in out store_Filters_State);
-- Compares each filter with the words in current line.
procedure Initialize_Filters_State
(P_Value : Boolean;
P_Filters_State : in out Store_Filters_State);
procedure Set_Filters
(P_Filters : String);
-- Counts the received filters and calls Create_Filters
-----------------
-- Lines --
-----------------
procedure Update_Lines;
-- Updates Lines and Lines_Count.
procedure Read_Line
(P_Filters : Store_Filter;
P_Number_Of_Filters : Natural;
P_Filters_State : in out Store_Filters_State);
-- Reads Line character by character and inserts them into strings "Word"
-- Then, calls Check_Filters.
procedure Reset_Lines;
procedure Reset_Lines_Count;
function Get_Lines
return String;
function Get_Lines_Count
return Integer;
----------------
-- File --
----------------
procedure Read_File
(P_Filters : Store_Filter;
P_Number_Of_Filters : Natural);
-- Inserts into Line the current line from the selected file.
-- Calls Initialize_Filters_State and Read_Line,
-- then checks Filter_State and calls Update_Lines.
procedure Select_File
(P_File : String);
procedure Close_File;
function Get_File_Name
return String;
-----------------
-- Other --
-----------------
function Are_They_All_True
(P_Filters_State : Store_Filters_State)
return Boolean;
end Log_Filter;
|
with VisitablePackage, ObjectPack;
use VisitablePackage, ObjectPack;
package VisitableBuiltinPackage is
type VisitableBuiltin is new Visitable and Object with
record
builtin : ObjectPtr := null;
end record;
function toString(vb: VisitableBuiltin) return String;
function setChildren(v: access VisitableBuiltin ; children : ObjectPtrArrayPtr) return VisitablePtr;
function getChildren(v: access VisitableBuiltin) return ObjectPtrArrayPtr;
function getChildAt(v: access VisitableBuiltin; i : Integer) return VisitablePtr;
function setChildAt(v: access VisitableBuiltin; i: in Integer; child: in VisitablePtr) return VisitablePtr;
function getChildCount(v:access VisitableBuiltin) return Integer;
function makeVisitableBuiltinPackage(o: ObjectPtr) return VisitableBuiltin;
function getBuiltin(v: VisitableBuiltin) return ObjectPtr;
end VisitableBuiltinPackage;
|
-- Copyright (c) 2021 Devin Hill
-- zlib License -- see LICENSE for details.
package body GBA.Allocation is
package body Stack_Arena is
begin
Init_Arena (Storage);
end Stack_Arena;
end GBA.Allocation;
|
-- Task 2 of RTPL WS17/18
-- Team members: Hannes B. and Gabriel Z.
package myTasks with SPARK_Mode is
-- Procedure for option 5
procedure opt5;
-- Procedure for option 6
procedure opt6;
-- Procedure for option 7
procedure opt7;
-- User defined task for growing of elements
task type myGrow;
-- To stop myGrow task enable this flag
myGrowEnd : Boolean := False;
private
-- Float values for user input
-- F1 : Float := 1.0;
-- F2 : Float := 2.0;
-- Integer value for user input
I1 : Integer := 0;
-- Control character for user input
C1 : Character := ' ';
-- Amount to store
Amount : Integer := 0;
-- Mutex if Amount can be changed
Available : Boolean := True;
-- Grow enabled / disabled
GrowEnable : Boolean := False;
-- User defined task to add / remove elements
task type myAmount is
entry Sub (min : in Integer);
entry Add (sum : in Integer);
end myAmount;
end myTasks;
|
pragma Ada_2012;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Ada.Strings.Fixed;
with Ada.Characters.Handling;
with Utilities.Tokenize;
with Ada.Strings;
package body Utilities.Option_Lists is
-----------
-- Parse --
-----------
function Parse
(Input : String;
Entry_Separator : Character := ',';
Key_Separator : Character := '=';
Trim_Key : Boolean := True;
Trim_Value : Boolean := True;
Key_Case : Case_Action := Force_Lower;
Default_Value : String := "")
return Option_List
is
use Tokenize;
procedure Split_Key_Value (Item : String;
Separator : Character;
Key : out Unbounded_String;
Value : out Unbounded_String)
is
use Ada.Strings;
Pos : constant Natural := Fixed.Index (Source => Item,
Pattern => Separator & "");
begin
if Pos = 0 then
-- No key-value separator: it is pure key
Key := To_Unbounded_String (Item);
Value := To_Unbounded_String (Default_Value);
elsif Pos = Item'Last then
-- The separator is at the end: value is the empty string
Key := To_Unbounded_String (Item (Item'First .. Pos - 1));
Value := Null_Unbounded_String;
else
-- The separator is at the end: value is the empty string
Key := To_Unbounded_String (Item (Item'First .. Pos - 1));
Value := To_Unbounded_String (Item (Pos + 1 .. Item'Last));
end if;
if Trim_Key then
Key := Trim (Key, Strings.Both);
end if;
if Key = "" then
raise Constraint_Error with "Empty key in '" & Item & "'";
end if;
if Trim_Value then
Value := Trim (Value, Strings.Both);
end if;
end Split_Key_Value;
function Manage_Case (X : String; How : Case_Action) return string
is ((case How is
when Force_Lower =>
Characters.Handling.To_Lower (X),
when Force_Upper =>
Characters.Handling.To_Upper (X),
when Keep =>
X));
function Manage_Case (X : Unbounded_String; How : Case_Action) return string
is (Manage_Case (To_String (X), How));
Entries : constant Token_List :=
Split (To_Be_Splitted => Input,
Separator => Entry_Separator,
Collate_Separator => True);
Result : Option_List;
begin
for Pair of Entries loop
declare
Key : Unbounded_String;
Value : Unbounded_String;
begin
Split_Key_Value (Pair, Key_Separator, Key, Value);
Result.Include (Key => Manage_Case (Key, Key_Case),
New_Item => To_String (Value));
end;
end loop;
return Result;
end Parse;
end Utilities.Option_Lists;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.