content
stringlengths
23
1.05M
package Brain is task Sense with Priority => 3; task Think with Priority => 1; task Act with Priority => 2; private end Brain;
-- -- Copyright (C) 2015 secunet Security Networks AG -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- with System; with System.Machine_Code; package body HW.Port_IO with Refined_State => (State => null), SPARK_Mode => Off is generic type Word is private; procedure Port_In (Value : out Word; Port : Port_Type); procedure Port_In (Value : out Word; Port : Port_Type) is begin System.Machine_Code.Asm ("in %1, %0", Inputs => (Port_Type'Asm_Input ("Nd", Port)), Outputs => (Word'Asm_Output ("=a", Value)), Volatile => True); end Port_In; procedure InB_Body is new Port_In (Word => Word8); procedure InB (Value : out Word8; Port : Port_Type) renames InB_Body; procedure InW_Body is new Port_In (Word => Word16); procedure InW (Value : out Word16; Port : Port_Type) renames InW_Body; procedure InL_Body is new Port_In (Word => Word32); procedure InL (Value : out Word32; Port : Port_Type) renames InL_Body; ---------------------------------------------------------------------------- generic type Word is private; procedure Port_Out (Port : Port_Type; Value : Word); procedure Port_Out (Port : Port_Type; Value : Word) is begin System.Machine_Code.Asm ("out %1, %0", Inputs => (Port_Type'Asm_Input ("Nd", Port), Word'Asm_Input ("a", Value)), Volatile => True); end Port_Out; procedure OutB_Body is new Port_Out (Word => Word8); procedure OutB (Port : Port_Type; Value : Word8) renames OutB_Body; procedure OutW_Body is new Port_Out (Word => Word16); procedure OutW (Port : Port_Type; Value : Word16) renames OutW_Body; procedure OutL_Body is new Port_Out (Word => Word32); procedure OutL (Port : Port_Type; Value : Word32) renames OutL_Body; end HW.Port_IO; -- vim: set ts=8 sts=3 sw=3 et:
-- -- 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 ada.unchecked_conversion; with m4.layout; with m4.scb; package m4.mpu with spark_mode => on is ------------ -- Config -- ------------ subtype t_region_number is unsigned_8 range 0 .. 7; subtype t_region_size is bits_5 range 4 .. 31; subtype t_region_perm is bits_3; type t_region_config is record region_number : t_region_number; addr : system_address; size : t_region_size; access_perm : t_region_perm; xn : boolean; b : boolean; s : boolean; subregion_mask : unsigned_8; -- 0: sub-region enabled, 1: disabled end record; REGION_SIZE_32B : constant t_region_size := 4; REGION_SIZE_64B : constant t_region_size := 5; REGION_SIZE_128B : constant t_region_size := 6; REGION_SIZE_256B : constant t_region_size := 7; REGION_SIZE_512B : constant t_region_size := 8; REGION_SIZE_1KB : constant t_region_size := 9; REGION_SIZE_2KB : constant t_region_size := 10; REGION_SIZE_4KB : constant t_region_size := 11; REGION_SIZE_8KB : constant t_region_size := 12; REGION_SIZE_16KB : constant t_region_size := 13; REGION_SIZE_32KB : constant t_region_size := 14; REGION_SIZE_64KB : constant t_region_size := 15; REGION_SIZE_128KB : constant t_region_size := 16; REGION_SIZE_256KB : constant t_region_size := 17; REGION_SIZE_512KB : constant t_region_size := 18; REGION_SIZE_1MB : constant t_region_size := 19; REGION_SIZE_2MB : constant t_region_size := 20; REGION_SIZE_4MB : constant t_region_size := 21; REGION_SIZE_8MB : constant t_region_size := 22; REGION_SIZE_16MB : constant t_region_size := 23; REGION_SIZE_32MB : constant t_region_size := 24; REGION_SIZE_64MB : constant t_region_size := 25; REGION_SIZE_128MB : constant t_region_size := 26; REGION_SIZE_256MB : constant t_region_size := 27; REGION_SIZE_512MB : constant t_region_size := 28; REGION_SIZE_1GB : constant t_region_size := 29; REGION_SIZE_2GB : constant t_region_size := 30; REGION_SIZE_4GB : constant t_region_size := 31; -- Access Permissions -- Note: Describes privileged and user access. -- For example, REGION_PERM_PRIV_RW_USER_NO means -- - privileged : read/write access -- - user : no access REGION_PERM_PRIV_NO_USER_NO : constant t_region_perm := 2#000#; REGION_PERM_PRIV_RW_USER_NO : constant t_region_perm := 2#001#; REGION_PERM_PRIV_RW_USER_RO : constant t_region_perm := 2#010#; REGION_PERM_PRIV_RW_USER_RW : constant t_region_perm := 2#011#; REGION_PERM_UNUSED : constant t_region_perm := 2#100#; REGION_PERM_PRIV_RO_USER_NO : constant t_region_perm := 2#101#; REGION_PERM_PRIV_RO_USER_RO : constant t_region_perm := 2#110#; REGION_PERM_PRIV_RO_USER_RO2 : constant t_region_perm := 2#111#; --------------- -- Functions -- --------------- procedure is_mpu_available (success : out boolean) with inline, Global => (In_Out => MPU); procedure enable with inline, global => (in_out => (MPU)); procedure disable with inline, global => (in_out => (MPU)); procedure disable_region (region_number : in t_region_number) with inline, global => (in_out => (MPU)); -- Only used by SPARK prover function region_not_rwx(region : t_region_config) return boolean is (region.xn = true or region.access_perm = REGION_PERM_PRIV_RO_USER_RO or region.access_perm = REGION_PERM_PRIV_NO_USER_NO) with ghost; procedure init with global => (in_out => (MPU, m4.scb.SCB)); procedure enable_unrestricted_kernel_access with inline, global => (in_out => (MPU)); procedure disable_unrestricted_kernel_access with inline, global => (in_out => (MPU)); -- That function is only used by SPARK prover function get_region_size_mask (size : t_region_size) return unsigned_32 is (2**(natural (size) + 1) - 1) with ghost; pragma assertion_policy (pre => IGNORE, post => IGNORE, assert => IGNORE); pragma warnings (off, "explicit membership test may be optimized"); pragma warnings (off, "condition can only be False if invalid values present"); procedure configure_region (region : in t_region_config) with global => (in_out => (MPU)), pre => (region.region_number in 0 .. 7 and (region.addr and 2#11111#) = 0 and region.size >= 4 and (region.addr and get_region_size_mask(region.size)) = 0) and region_not_rwx (region); procedure update_subregion_mask (region_number : in t_region_number; subregion_mask : in unsigned_8) with inline, global => (in_out => (MPU)); pragma warnings (on); ----------------------- -- MPU Type Register -- ----------------------- type t_MPU_TYPE is record SEPARAT : boolean := true; -- Support for separate instruction and date memory maps DREGION : unsigned_8 := 8; -- Number of supported MPU data regions IREGION : unsigned_8 := 0; -- Number of supported MPU instruction regions end record with size => 32; for t_MPU_TYPE use record SEPARAT at 0 range 0 .. 0; DREGION at 0 range 8 .. 15; IREGION at 0 range 16 .. 23; end record; function to_unsigned_32 is new ada.unchecked_conversion (t_MPU_TYPE, unsigned_32); -------------------------- -- MPU Control Register -- -------------------------- type t_MPU_CTRL is record ENABLE : boolean; -- Enables the MPU HFNMIENA : boolean; -- Enables the operation of MPU during hard fault, -- NMI, and FAULTMASK handlers PRIVDEFENA : boolean; -- Enables privileged software access to the -- default memory map end record with size => 32; for t_MPU_CTRL use record ENABLE at 0 range 0 .. 0; HFNMIENA at 0 range 1 .. 1; PRIVDEFENA at 0 range 2 .. 2; end record; -------------------------------- -- MPU Region Number Register -- -------------------------------- type t_MPU_RNR is record REGION : unsigned_8 range 0 .. 7; -- Indicates the region referenced by -- MPU_RBAR and MPU_RASR end record with size => 32; for t_MPU_RNR use record REGION at 0 range 0 .. 7; end record; -------------------------------------- -- MPU Region Base Address Register -- -------------------------------------- -- -- Defines the base address of the MPU region selected by the MPU_RNR -- type t_MPU_RBAR is record REGION : bits_4 range 0 .. 7; VALID : boolean; ADDR : bits_27; end record with size => 32; for t_MPU_RBAR use record REGION at 0 range 0 .. 3; VALID at 0 range 4 .. 4; ADDR at 0 range 5 .. 31; end record; function address_to_bits_27 (addr : system_address) return bits_27 with pre => (addr and 2#11111#) = 0; -------------------------------------------- -- MPU Region Attribute and Size Register -- -------------------------------------------- type t_MPU_RASR is record ENABLE : boolean; -- Enable region SIZE : t_region_size; SRD : unsigned_8; -- Subregion disable bits (0 = enabled, 1 = disabled) B : boolean; C : boolean; S : boolean; -- Shareable TEX : bits_3; -- Memory attributes AP : t_region_perm; -- Permissions XN : boolean; -- Instruction fetches disabled end record with size => 32; for t_MPU_RASR use record ENABLE at 0 range 0 .. 0; SIZE at 0 range 1 .. 5; SRD at 0 range 8 .. 15; B at 0 range 16 .. 16; C at 0 range 17 .. 17; S at 0 range 18 .. 18; TEX at 0 range 19 .. 21; AP at 0 range 24 .. 26; XN at 0 range 28 .. 28; end record; function to_MPU_RASR is new ada.unchecked_conversion (unsigned_32, t_MPU_RASR); -------------------- -- MPU peripheral -- -------------------- type t_MPU_peripheral is record TYPER : t_MPU_TYPE; CTRL : t_MPU_CTRL; RNR : t_MPU_RNR; RBAR : t_MPU_RBAR; RASR : t_MPU_RASR; RBAR_A1 : t_MPU_RBAR; RASR_A1 : t_MPU_RASR; RBAR_A2 : t_MPU_RBAR; RASR_A2 : t_MPU_RASR; RBAR_A3 : t_MPU_RBAR; RASR_A3 : t_MPU_RASR; end record; for t_MPU_peripheral use record TYPER at 16#00# range 0 .. 31; CTRL at 16#04# range 0 .. 31; RNR at 16#08# range 0 .. 31; RBAR at 16#0C# range 0 .. 31; RASR at 16#10# range 0 .. 31; RBAR_A1 at 16#14# range 0 .. 31; RASR_A1 at 16#18# range 0 .. 31; RBAR_A2 at 16#1C# range 0 .. 31; RASR_A2 at 16#20# range 0 .. 31; RBAR_A3 at 16#24# range 0 .. 31; RASR_A3 at 16#28# range 0 .. 31; end record; ---------------- -- Peripheral -- ---------------- MPU : t_MPU_peripheral with import, volatile, address => m4.layout.MPU_base; end m4.mpu;
-- C24203B.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 BASED REAL LITERALS WITH BASES 2 THROUGH 16 ALL -- YIELD CORRECT VALUES. -- THIS TEST USES MODEL NUMBERS OF DIGITS 6. -- HISTORY: -- DHH 06/15/88 CREATED ORIGINAL TEST. -- DTN 11/30/95 REMOVED CONFORMANCE CHECKS WHERE RULES RELAXED. WITH REPORT; USE REPORT; PROCEDURE C24203B IS TYPE CHECK IS DIGITS 6; BEGIN TEST("C24203B", "CHECK THAT BASED REAL LITERALS WITH BASES " & "2 THROUGH 16 ALL YIELD CORRECT VALUES"); IF 2#0.0000000000000000000000000000000000000000000000000000000000001# /= 2.0 ** (-61) THEN FAILED ("INCORRECT VALUE FOR BASE 2 REAL LITERAL"); END IF; IF 3#0.00000000001# < ((2.0 ** (-18)) + (251558.0 * (2.0 ** (-37)))) OR 3#0.00000000001# > ((2.0 ** (-18)) + (251559.0 * (2.0 ** (-37)))) THEN FAILED ("INCORRECT VALUE FOR BASE 3 REAL LITERAL"); END IF; IF 4#13333333.213# /= 32767.609375 THEN FAILED ("INCORRECT VALUE FOR BASE 4 REAL LITERAL"); END IF; IF 5#2021444.4241121# < 32749.90625 OR 5#2021444.4241121# > 32749.921875 THEN FAILED ("INCORRECT VALUE FOR BASE 5 REAL LITERAL"); END IF; IF 6#411355.531043# /= 32759.921875 THEN FAILED ("INCORRECT VALUE FOR BASE 6 REAL LITERAL"); END IF; IF 7#164366.625344# < 32780.90625 OR 7#164366.625344# > 32780.9375 THEN FAILED ("INCORRECT VALUE FOR BASE 7 REAL LITERAL"); END IF; IF 8#77777.07# /= 32767.109375 THEN FAILED ("INCORRECT VALUE FOR BASE 8 REAL LITERAL"); END IF; IF 9#48888.820314# < 32804.90625 OR 9#48888.820314# > 32804.9375 THEN FAILED ("INCORRECT VALUE FOR BASE 9 REAL LITERAL"); END IF; IF 10#32767.921875# /= 32767.921875 THEN FAILED ("INCORRECT VALUE FOR BASE 10 REAL LITERAL"); END IF; IF 11#2267A.A06682# < 32757.90625 OR 11#2267A.A06682# > 32757.921875 THEN FAILED ("INCORRECT VALUE FOR BASE 11 REAL LITERAL"); END IF; IF 12#16B5B.B09# /= 32759.921875 THEN FAILED ("INCORRECT VALUE FOR BASE 12 REAL LITERAL"); END IF; IF 13#11B9C.BB616# < 32746.90625 OR 13#11B9C.BB616# > 32746.921875 THEN FAILED ("INCORRECT VALUE FOR BASE 13 REAL LITERAL"); END IF; IF 14#BD1D.CC98A7# /= 32759.921875 THEN FAILED ("INCORRECT VALUE FOR BASE 14 REAL LITERAL"); END IF; IF 15#3D28188D45881111111111.0# < (((2.0 ** 21) -2.0) * (2.0 ** 63)) THEN FAILED ("INCORRECT VALUE FOR BASE 15 REAL LITERAL"); END IF; RESULT; END C24203B;
with Ada.Integer_Text_IO; use Ada.Integer_Text_IO; with Ada.Float_Text_IO; use Ada.Float_Text_IO; with Text_IO; use Text_IO; procedure Overflow is function GetPositiveInteger(varName : String) return Positive is Result : Positive; HaveResult : Boolean := False; Input : String(1..1024) := (others => ' '); Last : Natural; begin -- function body while not HaveResult loop Put("Input a positive integer "); Put(varName); Put(" = "); begin Get_Line(Input, Last); -- both Input and Last assigned Get(Input, Result, Last); -- Result assigned HaveResult := True; exception when DATA_ERROR | CONSTRAINT_ERROR => Put_Line("Not a positive integer, try again."); end; end loop; return Result; end GetPositiveInteger; subtype My_Num1 is Integer range 1..1000000; type My_Num2 is range 1..1000000; function Power(N : in Positive; M : in Natural) return My_Num2 is Result : My_Num2 := 1; begin for I in 1 .. M loop Result := Result * My_Num2(N); end loop; return Result; end Power; function Power_FP(N : in Float; M : in Natural) return Float is Result : Float := 1.0; begin for I in 1 .. M loop Result := Result * N; end loop; return Result; end Power_FP; function Geom_FP(N : in Float; M : in Natural) return Float is Sum : Float := 1.0; Power : Float := 1.0; begin for I in 1 .. M loop Power := Power / N; Sum := Sum + Power; end loop; return Sum; end Geom_FP; N,M,T : Positive; begin N := GetPositiveInteger("n"); M := GetPositiveInteger("m"); T := GetPositiveInteger("task (1=floating-point n^m; 2=integer n^m; 3=floating-point 1+1/n+1/n^2+...+1/n^m)"); case T is when 1 => Put(Power_FP(Float(N),M)); when 2 => Put(Integer(Power(N,M))); when 3 => Put(Geom_FP(Float(N),M)); when others => Put("illegal task"); end case; end Overflow;
-- This file is covered by the Internet Software Consortium (ISC) License -- Reference: ../License.txt -- GCC 6.0 only (skip Container_Checks until identified need arises) pragma Suppress (Tampering_Check); with Ada.Text_IO; with Ada.Calendar; with Ada.Containers.Hashed_Maps; with Ada.Containers.Ordered_Sets; with Ada.Containers.Vectors; with Ada.Characters.Latin_1; with Ada.Directories; with Ada.Exceptions; with JohnnyText; with Parameters; with Definitions; use Definitions; private with Replicant.Platform; package PortScan is package JT renames JohnnyText; package AC renames Ada.Containers; package CAL renames Ada.Calendar; package AD renames Ada.Directories; package EX renames Ada.Exceptions; package TIO renames Ada.Text_IO; package LAT renames Ada.Characters.Latin_1; package PM renames Parameters; type count_type is (total, success, failure, ignored, skipped); type dim_handlers is array (count_type) of TIO.File_Type; type port_id is private; port_match_failed : constant port_id; -- Scan the entire ports tree in order with a single, non-recursive pass -- Return True on success function scan_entire_ports_tree (portsdir : String) return Boolean; -- Starting with a single port, recurse to determine a limited but complete -- dependency tree. Repeated calls will augment already existing data. -- Return True on success function scan_single_port (catport : String; always_build : Boolean; fatal : out Boolean) return Boolean; -- This procedure causes the reverse dependencies to be calculated, and -- then the extended (recursive) reverse dependencies. The former is -- used progressively to determine when a port is free to build and the -- latter sets the build priority. procedure set_build_priority; -- Wipe out all scan data so new scan can be performed procedure reset_ports_tree; -- Returns the number of cores. The set_cores procedure must be run first. -- set_cores was private previously, but we need the information to set -- intelligent defaults for the configuration file. procedure set_cores; function cores_available return cpu_range; -- Return " (port deleted)" if the catport doesn't exist -- Return " (directory empty)" if the directory exists but has no contents -- Return " (Makefile missing)" when makefile is missing -- otherwise return blank string function obvious_problem (portsdir, catport : String) return String; -- Attempts to generate a ports index file after acquiring all port origins -- Returns False (with an outputted message) if it fails to: -- a. create directories -- b. scan fails -- c. index file creation fails function generate_ports_index (index_file, portsdir : String) return Boolean; -- Recursively scans a ports directory tree, returning True as soon as a file or directory -- newer than the given time is found. function tree_newer_than_reference (portsdir : String; reference : CAL.Time; valid : out Boolean) return Boolean; -- Store origin support -- * store data from flavor index in hash and vector -- * clear data when complete -- * valid origin returns true when candidate available verbatim procedure load_index_for_store_origins; procedure clear_store_origin_data; function input_origin_valid (candidate : String) return Boolean; procedure suggest_flavor_for_bad_origin (candidate : String); private package REP renames Replicant; package PLAT renames Replicant.Platform; max_ports : constant := 40000; scan_slave : constant builders := 9; ss_base : constant String := "/SL09"; dir_ports : constant String := "/xports"; chroot : constant String := "/usr/sbin/chroot "; index_path : constant String := "/var/cache/synth"; type port_id is range -1 .. max_ports - 1; subtype port_index is port_id range 0 .. port_id'Last; port_match_failed : constant port_id := port_id'First; -- skip "package" because every port has same dependency on ports-mgmt/pkg -- except for pkg itself. Skip "test" because these dependencies are -- not required to build packages. type dependency_type is (fetch, extract, patch, build, library, runtime); subtype LR_set is dependency_type range library .. runtime; bmake_execution : exception; pkgng_execution : exception; make_garbage : exception; nonexistent_port : exception; circular_logic : exception; seek_failure : exception; unknown_format : exception; package subqueue is new AC.Vectors (Element_Type => port_index, Index_Type => port_index); package string_crate is new AC.Vectors (Element_Type => JT.Text, Index_Type => port_index, "=" => JT.SU."="); type queue_record is record ap_index : port_index; reverse_score : port_index; end record; -- Functions for ranking_crate definitions function "<" (L, R : queue_record) return Boolean; package ranking_crate is new AC.Ordered_Sets (Element_Type => queue_record); -- Functions for portkey_crate and package_crate definitions function port_hash (key : JT.Text) return AC.Hash_Type; package portkey_crate is new AC.Hashed_Maps (Key_Type => JT.Text, Element_Type => port_index, Hash => port_hash, Equivalent_Keys => JT.equivalent); package package_crate is new AC.Hashed_Maps (Key_Type => JT.Text, Element_Type => Boolean, Hash => port_hash, Equivalent_Keys => JT.equivalent); -- Functions for block_crate definitions function block_hash (key : port_index) return AC.Hash_Type; function block_ekey (left, right : port_index) return Boolean; package block_crate is new AC.Hashed_Maps (Key_Type => port_index, Element_Type => port_index, Hash => block_hash, Equivalent_Keys => block_ekey); type port_record is record sequence_id : port_index := 0; key_cursor : portkey_crate.Cursor := portkey_crate.No_Element; jobs : builders := 1; ignore_reason : JT.Text := JT.blank; port_version : JT.Text := JT.blank; package_name : JT.Text := JT.blank; pkg_dep_query : JT.Text := JT.blank; ignored : Boolean := False; scanned : Boolean := False; rev_scanned : Boolean := False; unlist_failed : Boolean := False; work_locked : Boolean := False; scan_locked : Boolean := False; pkg_present : Boolean := False; remote_pkg : Boolean := False; never_remote : Boolean := False; deletion_due : Boolean := False; use_procfs : Boolean := False; use_linprocfs : Boolean := False; reverse_score : port_index := 0; min_librun : Natural := 0; librun : block_crate.Map; blocked_by : block_crate.Map; blocks : block_crate.Map; all_reverse : block_crate.Map; options : package_crate.Map; flavors : string_crate.Vector; end record; type port_record_access is access all port_record; type dim_make_queue is array (scanners) of subqueue.Vector; type dim_progress is array (scanners) of port_index; type dim_all_ports is array (port_index) of aliased port_record; all_ports : dim_all_ports; ports_keys : portkey_crate.Map; portlist : portkey_crate.Map; make_queue : dim_make_queue; mq_progress : dim_progress := (others => 0); rank_queue : ranking_crate.Set; number_cores : cpu_range := cpu_range'First; lot_number : scanners := 1; lot_counter : port_index := 0; last_port : port_index := 0; prescanned : Boolean := False; fullpop : Boolean := True; so_porthash : portkey_crate.Map; so_serial : string_crate.Vector; procedure iterate_reverse_deps; procedure iterate_drill_down; procedure populate_set_depends (target : port_index; catport : String; line : JT.Text; dtype : dependency_type); procedure populate_set_options (target : port_index; line : JT.Text; on : Boolean); procedure populate_flavors (target : port_index; line : JT.Text); procedure populate_port_data (target : port_index); procedure populate_port_data_fpc (target : port_index); procedure populate_port_data_nps (target : port_index); procedure drill_down (next_target : port_index; original_target : port_index); -- subroutines for populate_port_data procedure prescan_ports_tree (portsdir : String); procedure grep_Makefile (portsdir, category : String); procedure walk_all_subdirectories (portsdir, category : String); procedure wipe_make_queue; procedure read_flavor_index; procedure parallel_deep_scan (success : out Boolean; show_progress : Boolean); -- some helper routines function find_colon (Source : String) return Natural; function scrub_phase (Source : String) return JT.Text; function get_catport (PR : port_record) return String; function scan_progress return String; function get_max_lots return scanners; function get_pkg_name (origin : String) return String; function timestamp (hack : CAL.Time; www_format : Boolean := False) return String; function clean_up_pkgsrc_ignore_reason (dirty_string : String) return JT.Text; function subdirectory_is_older (portsdir, category : String; reference : CAL.Time) return Boolean; type dim_counters is array (count_type) of Natural; -- bulk run variables Flog : dim_handlers; start_time : CAL.Time; stop_time : CAL.Time; scan_start : CAL.Time; scan_stop : CAL.Time; bld_counter : dim_counters := (0, 0, 0, 0, 0); end PortScan;
-- Institution: Technische Universität München -- Department: Realtime Computer Systems (RCS) -- Project: StratoX -- Module: Software Configuration -- -- Authors: Martin Becker (becker@rcs.ei.tum.de) -- @summary -- Target-specific types for the devices that are exposed -- in hil-i2c et. al in Pixhawk. package HIL.Devices with SPARK_Mode is type Device_Type_I2C is (UNKNOWN, MAGNETOMETER); type Device_Type_SPI is (Barometer, Magneto, MPU6000, FRAM, Extern); type Device_Type_UART is (GPS, Console, PX4IO); type Device_Type_GPIO is (RED_LED, SPI_CS_BARO, SPI_CS_MPU6000, SPI_CS_LSM303D, SPI_CS_L3GD20H, SPI_CS_FRAM, SPI_CS_EXT ); -- INTERRUPT PRIOS, ALL AT ONE PLACE. Must decide who wins here. IRQ_PRIO_UART4 : constant := 251; -- must be higher, because too low could result in loss of data IRQ_PRIO_UART_LOG : constant := 249; IRQ_PRIO_SDIO : constant := 250; -- sdcard: can be lower. only affects throughput, not data integrity. end HIL.Devices;
with Ada.Numerics.Generic_Elementary_Functions; package body Four_Body is One : constant Real := +1.0; Two : constant Real := +2.0; Min_Allowed_Real : constant Real := Two**(Real'Machine_Emin + 32); package mth is new Ada.Numerics.Generic_Elementary_Functions (Real); use mth; procedure Update_State (Y : in out Dynamical_Variable; Body_id : in Bodies; X, Z, U, W : in Real) is State_id : State_Index; begin State_id := (Body_id - Bodies'First) * No_Of_Bodies; Y(State_id+0) := X; Y(State_id+1) := Z; Y(State_id+2) := U; Y(State_id+3) := W; end Update_State; function State_Val (Y : Dynamical_Variable; Body_id : Bodies; XYUV_id : XYUV_Index) return Real is State_id : constant State_Index := (Body_id - Bodies'First) * No_Of_Bodies + XYUV_id; begin return Y(State_id); end State_Val; -- Define a metric for the vector Y function Norm (Y : Dynamical_Variable) return Real is Sum : Real := +0.0; X, Z : Real; begin for Body_id in Bodies loop X := State_Val (Y, Body_id, 0); Z := State_Val (Y, Body_id, 1); Sum := Sum + Abs (X) + Abs (Z); end loop; return Sum; end Norm; function "-" (Left : Dynamical_Variable; Right : Dynamical_Variable) return Dynamical_Variable is Result : Dynamical_Variable; begin for I in State_Index loop Result(I) := Left(I) - Right(I); end loop; return Result; end "-"; function "*" (Left : Real; Right : Dynamical_Variable) return Dynamical_Variable is Result : Dynamical_Variable; begin for X in State_Index loop Result(X) := Left * Right(X); end loop; return Result; end "*"; function "+" (Left : Dynamical_Variable; Right : Dynamical_Variable) return Dynamical_Variable is Result : Dynamical_Variable; begin for X in State_Index loop Result(X) := Left(X) + Right(X); end loop; return Result; end "+"; -- Defines the differential equation to integrate: -- -- dY/dt = F (t, Y) -- -- The N-Body equation of motion is: -- -- Acceleration(Body_j) = (2 * Pi)**2 * -- SumOver(Body_k) { Mass(Body_k) * DeltaR / NORM(DeltaR)**3 }, -- -- where DeltaR = (X(Body_k) - X(Body_j)), -- and mass, time, and distance are in the natural units given above. -- Actually, the (2 * Pi)**2 is absorbed into the Mass to avoid -- unecessary multiplications. -- -- An optimization: each mass in a pair A and B experiences a force that -- is equal in magnitude to the force the other mass experiences in the -- pair, so there's no need to calculate the forces twice. function F (Time : Real; Y : Dynamical_Variable) return Dynamical_Variable is Deriv : Dynamical_Variable; Delta_X, Delta_Z : Real; Rinv, R2, R3, MR3 : Real; X2, X0, Z2, Z0 : Real; State_id, Other_State_id : State_Index; begin for The_Body in Bodies loop State_id := (The_Body - Bodies'First) * No_Of_Bodies; Deriv(State_id + 0) := Y(State_id + 2); Deriv(State_id + 1) := Y(State_id + 3); Deriv(State_id + 2) := 0.0; Deriv(State_id + 3) := 0.0; end loop; for The_Body in Bodies loop State_id := (The_Body - Bodies'First) * No_Of_Bodies; for Other_Body in Bodies loop if Other_Body > The_Body then -- The Other_Bodies with indices < The_Body -- already had their contributions -- to the force on The_Body added to the sum. Other_State_id := (Other_Body - Bodies'First) * No_Of_Bodies; X2 := State_Val (Y, Other_Body, 0); X0 := State_Val (Y, The_Body, 0); Z2 := State_Val (Y, Other_Body, 1); Z0 := State_Val (Y, The_Body, 1); Delta_X := X2 - X0; Delta_Z := Z2 - Z0; -- Delta_X := Y(Other_Body)(0) - Y(The_Body)(0); -- Delta_Z := Y(Other_Body)(1) - Y(The_Body)(1); R2 := Delta_X*Delta_X + Delta_Z*Delta_Z + Min_Allowed_Real; Rinv := Sqrt (One / R2); R3 := Rinv * Rinv * Rinv; -- force on The_Body due to the other bodies with ID > The_Body MR3 := Mass (Other_Body) * R3; Deriv(State_id + 2) := Deriv(State_id + 2) + Delta_X*MR3; Deriv(State_id + 3) := Deriv(State_id + 3) + Delta_Z*MR3; -- force on Other_Body due to the The_Body. (Accel. = force/Mass) MR3 := Mass (The_Body) * R3; Deriv(Other_State_id + 2) := Deriv(Other_State_id + 2) - Delta_X*MR3; Deriv(Other_State_id + 3) := Deriv(Other_State_id + 3) - Delta_Z*MR3; end if; end loop; end loop; return Deriv; end F; end Four_Body;
with Ada.Environment_Variables; with Print_Variable; with Load_Environment_Variables; with Ada.Text_IO; procedure Example_3 is begin Ada.Text_IO.Put_Line ("Start main"); Ada.Environment_Variables.Iterate (Print_Variable'Access); end Example_3;
-- Copyright (c) 1990 Regents of the University of California. -- All rights reserved. -- -- The primary authors of ayacc were David Taback and Deepak Tolani. -- Enhancements were made by Ronald J. Schmalz. -- -- Send requests for ayacc information to ayacc-info@ics.uci.edu -- Send bug reports for ayacc to ayacc-bugs@ics.uci.edu -- -- 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. -- Module : lr0_machine_body.ada -- Component of : ayacc -- Version : 1.2 -- Date : 11/21/86 12:31:19 -- SCCS File : disk21~/rschm/hasee/sccs/ayacc/sccs/sxlr0_machine_body.ada -- $Header: lr0_machine_body.a,v 0.1 86/04/01 15:06:56 ada Exp $ -- $Log: lr0_machine_body.a,v $ -- Revision 0.1 86/04/01 15:06:56 ada -- This version fixes some minor bugs with empty grammars -- and $$ expansion. It also uses vads5.1b enhancements -- such as pragma inline. -- -- -- Revision 0.0 86/02/19 18:37:23 ada -- -- These files comprise the initial version of Ayacc -- designed and implemented by David Taback and Deepak Tolani. -- Ayacc has been compiled and tested under the Verdix Ada compiler -- version 4.06 on a vax 11/750 running Unix 4.2BSD. -- with Symbol_Info, Text_IO; use Text_IO; package body LR0_Machine is SCCS_ID : constant String := "@(#) lr0_machine_body.ada, Version 1.2"; use Parse_State_Set_Pack; use Item_Set_Pack; use Grammar_Symbol_Set_Pack; use Transition_Set_Pack; type Item_Array is array (Item_Array_Index range <>) of Item; -- The type declarations for storing the nonterminal transitions of -- the DFA in the states. type Transition_Array is array(Integer range <>) of Transition; -- Note: terminal_goto is not yet used. type State is record Nonterminal_Goto : Transition_Array_Pointer := null; --& terminal_goto : transition_array_pointer := null; Kernel : Item_Array_Pointer := null; Preds : Parse_State_Set; end record; type State_Array is array (Parse_State range <>) of State; type State_Array_Pointer is access State_Array; --& Due to a bug in the Verdix 4.06 compiler, we cannot have the --& 'terminal_goto' declaration in type state. (Everything will compile, --& but when it is run we get a bus error.) --& The following declarations are used to get around the Verdix bug. type State_2 is record Terminal_Goto : Transition_Array_Pointer := null; end record; type State_Array_2 is array(Parse_State range <>) of State_2; type State_Array_Pointer_2 is access State_Array_2; State_Info_2 : State_Array_Pointer_2; --& End of Verdix bug fix. First_State : constant Parse_State := 0; Last_State : Parse_State; Max_State : Parse_State; -- estimated max State_Info : State_Array_Pointer := null; -- The pointer to array of state information. Estimated_Number_of_States : Integer; -- -- -- The following arrays are used for looking up a state given -- -- the transition symbol. TERMINAL_GOTOS holds the states that -- -- have terminal transitions into them, NONTERMINAL_GOTOS holds -- -- states that have nonterminal transitions into them and -- -- OVERFLOW_GOTOS holds the overflow from the previous arrays. -- -- -- type Goto_Array is array (Grammar_Symbol range <>) of Parse_State; type Overflow_Array is array (Parse_State range<>) of Parse_State; type Goto_Array_Pointer is access Goto_Array; type Overflow_Array_Pointer is access Overflow_Array; Terminal_Gotos : Goto_Array_Pointer; Nonterminal_Gotos : Goto_Array_Pointer; Overflow_Gotos : Overflow_Array_Pointer; -- This array is used to store the items generated by get_closure -- and closure. -- It is also declared to work around a VADS 5.1b bug for arrays whose -- bounds are set when the procedure is called (the memory is not -- dealocated when the procedure is exited). Closure_Items : Item_Array_Pointer; type Boolean_Array is array(Grammar_Symbol range <>) of Boolean; type Boolean_Array_Pointer is access Boolean_Array; Examined_Symbols : Boolean_Array_Pointer; ------------------------------------------------------------------------------ function Find_State (Kernel_Set : Item_Set; Trans_Sym : Grammar_Symbol) return Parse_State; function "<" (Item_1, Item_2: Item) return Boolean is begin if Item_1.Rule_ID = Item_2.Rule_ID then return Item_1.Dot_Position < Item_2.Dot_Position; else return Item_1.Rule_ID < Item_2.Rule_ID; end if; end "<"; function "<" (Trans_1, Trans_2: Transition) return Boolean is begin if Trans_1.Symbol = Trans_2.Symbol then return Trans_1.State_ID < Trans_2.State_ID; else return Trans_1.Symbol < Trans_2.Symbol; end if; end "<"; procedure Get_Closure (State_ID : in Parse_State; Closure_Items : in Item_Array_Pointer; Last : out Item_Array_Index); procedure Make_LR0_States is Goto_Set : Item_Set; Current_State : Parse_State; Goto_State : Parse_State; Gotos : Transition_Array_Pointer; Nt_Trans : Transition; Nt_Trans_Set : Transition_Set; Nt_Trans_Iter : Transition_Iterator; T_Trans : Transition; T_Trans_Set : Transition_Set; T_Trans_Iter : Transition_Iterator; I : Item; Sym : Grammar_Symbol; Last : Item_Array_Index; -- The last item in closure_items. Kernel : Item_Array_Pointer; Did_Goto : array(First_Symbol(Nonterminal)..Last_Symbol(Terminal)) of Boolean; -- did_goto(sym) = True if computed goto for sym. begin Current_State := 0; Generate_States: loop --& VADS version 4.06 corrupts memory on the following statement --& did_goto := (others => false); --& Therefore, we do it the hard way. for S in Did_Goto'range loop Did_Goto(S) := False; end loop; --& End bug hack. Make_Null(Nt_Trans_Set); Make_Null(T_Trans_Set); Get_Closure(Current_State, Closure_Items, Last); -- generate goto's for current state -- -- This is somewhat hacked but... -- For simplicity, the kernel Items are appended to -- the end of the CLOSURE_ITEMS array so that the -- reflexive transitive closure of the state is in closure_items. -- (GET_CLOSURE only puts the transitive closure -- into closure_items). -- This assumes that CLOSURE_ITEMS is large enough to hold the -- closure + kernel. This assumtion should hold for all -- but contrived grammars (I hope). Kernel := State_Info(Current_State).Kernel; for Item_Index in Kernel.all'range loop Last := Last + 1; Closure_Items(Last) := Kernel(Item_Index); end loop; for Item_Index in 1..Last loop I := Closure_Items(Item_Index); if I.Dot_Position < Length_of(I.Rule_ID) then Sym := Get_RHS(I.Rule_ID, I.Dot_Position + 1); -- generate goto on SYM if not done yet. if not Did_Goto(Sym) then Did_Goto(Sym) := True; -- get the items in goto of sym Make_Null(Goto_Set); I.Dot_Position := I.Dot_Position + 1; Insert(I, Into => Goto_Set); for J in Item_Index+1..Last loop I := Closure_Items(J); if I.Dot_Position < Length_of(I.Rule_ID) then I.Dot_Position := I.Dot_Position + 1; if Get_RHS(I.Rule_ID, I.Dot_Position) = Sym then Insert(I, Into => Goto_Set); end if; end if; end loop; Goto_State := Find_State(Goto_Set, Sym); Make_Null(Goto_Set); if Is_Nonterminal(Sym) then Nt_Trans := (Symbol => Sym, State_ID => Goto_State); Insert(Nt_Trans, Into => Nt_Trans_Set); else -- terminal transition T_Trans := (Symbol => Sym, State_ID => Goto_State); Insert(T_Trans, Into => T_Trans_Set); end if; Insert(Current_State, Into => State_Info(Goto_State).Preds); end if; end if; end loop; -- at this point, all the goto's for the current -- state have been generated. State_Info(Current_State).Nonterminal_Goto := new Transition_Array(1..Size_of(Nt_Trans_Set)); Gotos := State_Info(Current_State).Nonterminal_Goto; Initialize(Nt_Trans_Iter, Nt_Trans_Set); for S in 1..Size_of(Nt_Trans_Set) loop Next(Nt_Trans_Iter, Nt_Trans); Gotos(S) := Nt_Trans; end loop; State_Info_2(Current_State).Terminal_Goto := new Transition_Array(1..Size_of(T_Trans_Set)); Gotos := State_Info_2(Current_State).Terminal_Goto; Initialize(T_Trans_Iter, T_Trans_Set); for S in 1..Size_of(T_Trans_Set) loop Next(T_Trans_Iter, T_Trans); Gotos(S) := T_Trans; end loop; Make_Null(Nt_Trans_Set); Make_Null(T_Trans_Set); Current_State := Current_State + 1; exit Generate_States when Current_State > Last_State; end loop Generate_States; end Make_LR0_States; -- This procedure allocates the arrays for computing the LR(0) states. -- The number of states is not known at this point, so it is -- estimated using a formula taken from -- -- Purdom, P. W.: "The Size of LALR(1) Parsers," BIT, VOL. 14, -- No. 3, July 1974, pp.326-337 -- -- The formula is -- Number of states = 0.5949 * C + 0.02 -- -- where C is the number of rules plus the total number of symbols on -- the right hand side. We round this figures a little... procedure LR0_Initialize is C : Integer := 0; First_Item: constant Item := (Rule_ID => First_Rule, Dot_Position => 0); begin -- estimate the number of states -- for R in First_Rule..Last_Rule loop C := C + 1 + Length_of(R); end loop; Estimated_Number_of_States := Integer(0.6 * Float(C) + 1.0); -- Increase the estimate by 25% just in case -- Max_State := 2 + Parse_State(1.25 * Float(Estimated_Number_of_States)); if Max_State < 100 then Max_State := 100; end if; -- Initialize the state array -- State_Info := new State_Array(0..Max_State); State_Info(First_State).Kernel := new Item_Array(1..1); State_Info(First_State).Kernel(1) := First_Item; Make_Null(State_Info(First_State).Preds); --& Hack state_info_2 State_Info_2 := new State_Array_2(0..Max_State); Last_State := 0; -- set up the goto arrays -- Terminal_Gotos := new Goto_Array (First_Symbol(Terminal)..Last_Symbol(Terminal)); Nonterminal_Gotos := new Goto_Array (First_Symbol(Nonterminal)..Last_Symbol(Nonterminal)); Overflow_Gotos := new Overflow_Array(First_State..Max_State); -- Initialize them to the null_parse_state -- --& more Verdix BUGS --& terminal_gotos.all := --& (terminal_gotos.all'range => null_parse_state); --& --& nonterminal_gotos.all := --& (nonterminal_gotos.all'range => null_parse_state); --& Start Verdix bug fix for I in Terminal_Gotos.all'range loop Terminal_Gotos(I) := Null_Parse_State; end loop; for I in Nonterminal_Gotos.all'range loop Nonterminal_Gotos(I) := Null_Parse_State; end loop; --& End Verdix Bug fix -- initialize closure_items to the size of the maximum closure -- i. e. the number of rules in the grammar. -- Hack: The size is increased by 15 to hold any kernel that -- might be appended to closure_items. It is hoped -- that no kernel is greater that 15. If a kernel is greater -- than 15, it is hoped that #rules+15 > transitive closure -- of any state. Closure_Items := new Item_Array (1..Item_Array_Index(Last_Rule-First_Rule+1+15)); Examined_Symbols := new Boolean_Array (First_Symbol(Nonterminal)..Last_Symbol(Nonterminal)); Make_LR0_States; end LR0_Initialize; function First_Parse_State return Parse_State is begin return First_State; -- a constant; end First_Parse_State; function Last_Parse_State return Parse_State is begin return Last_State; end Last_Parse_State; procedure Get_Closure (State_ID : in Parse_State; Closure_Items : in Item_Array_Pointer; Last : out Item_Array_Index) is --- use Symbol_Info; Sym : Grammar_Symbol; Iterator : Item_Iterator; Temp_Item : Item; New_Item : Item; Index : Yield_Index; Last_Index : Yield_Index; Closure_Index : Item_Array_Index; -- for looping thru Closure_Items Next_Free : Item_Array_Index; -- next free in closure_items Kernel_Ptr : Item_Array_Pointer; -- points to kernel begin -- examined_symbols := (others => false); for I in Examined_Symbols.all'range loop Examined_Symbols(I) := False; end loop; New_Item.Dot_Position := 0; -- Used to add closure items. Next_Free := 1; -- first add all the items directly derivable from kernel to closure. Kernel_Ptr := State_Info(State_ID).Kernel; for T in Kernel_Ptr.all'range loop Temp_Item := Kernel_Ptr(T); if Temp_Item.Dot_Position < Length_of(Temp_Item.Rule_ID) then Sym := Get_RHS(Temp_Item.Rule_ID, Temp_Item.Dot_Position+1); if Is_Nonterminal(Sym) and then not Examined_Symbols(Sym) then Examined_Symbols(Sym) := True; for I in Nonterminal_Yield_Index(Sym).. Nonterminal_Yield_Index(Sym+1) - 1 loop New_Item.Rule_ID := Nonterminal_Yield(I); Closure_Items(Next_Free) := New_Item; Next_Free := Next_Free + 1; end loop; end if; end if; end loop; -- Now compute the closure of the items in Closure_Items. Closure_Index := 1; while Closure_Index < Next_Free loop Temp_Item := Closure_Items(Closure_Index); if Temp_Item.Dot_Position < Length_of(Temp_Item.Rule_ID) then Sym := Get_RHS(Temp_Item.Rule_ID, Temp_Item.Dot_Position+1); if Is_Nonterminal(Sym) and then not Examined_Symbols(Sym) then Examined_Symbols(Sym) := True; for I in Nonterminal_Yield_Index(Sym).. Nonterminal_Yield_Index(Sym+1) - 1 loop New_Item.Rule_ID := Nonterminal_Yield(I); Closure_Items(Next_Free) := New_Item; Next_Free := Next_Free + 1; end loop; end if; end if; Closure_Index := Closure_Index + 1; end loop; Last := Next_Free - 1; end Get_Closure; procedure Closure(Set_1: in out Item_Set) is use Symbol_Info; Next_Free : Item_Array_Index; -- index of next free in Closure_Items Sym : Grammar_Symbol; Iterator : Item_Iterator; Temp_Item : Item; New_Item : Item; Index : Yield_Index; Last_Index : Yield_Index; Closure_Index : Item_Array_Index; -- for looping thru Closure_Items begin Next_Free := 1; -- examined_symbols := (others => false); for I in Examined_Symbols.all'range loop Examined_Symbols(I) := False; end loop; New_Item.Dot_Position := 0; -- Used to add closure items. -- first add all the items directly derivable from set_1 to closure. Initialize(Iterator, Set_1); while More(Iterator) loop Next(Iterator, Temp_Item); if Temp_Item.Dot_Position < Length_of(Temp_Item.Rule_ID) then Sym := Get_RHS(Temp_Item.Rule_ID, Temp_Item.Dot_Position+1); if Is_Nonterminal(Sym) and then not Examined_Symbols(Sym) then Examined_Symbols(Sym) := True; for I in Nonterminal_Yield_Index(Sym).. Nonterminal_Yield_Index(Sym+1) - 1 loop New_Item.Rule_ID := Nonterminal_Yield(I); Closure_Items(Next_Free) := New_Item; Next_Free := Next_Free + 1; end loop; end if; end if; end loop; -- Now comput the closure of the items in Closure_Items. Closure_Index := 1; while Closure_Index < Next_Free loop Temp_Item := Closure_Items(Closure_Index); if Temp_Item.Dot_Position < Length_of(Temp_Item.Rule_ID) then Sym := Get_RHS(Temp_Item.Rule_ID, Temp_Item.Dot_Position+1); if Is_Nonterminal(Sym) and then not Examined_Symbols(Sym) then Examined_Symbols(Sym) := True; for I in Nonterminal_Yield_Index(Sym).. Nonterminal_Yield_Index(Sym+1) - 1 loop New_Item.Rule_ID := Nonterminal_Yield(I); Closure_Items(Next_Free) := New_Item; Next_Free := Next_Free + 1; end loop; end if; end if; Closure_Index := Closure_Index + 1; end loop; -- Now add all the closure items to set_1. for I in 1..Next_Free-1 loop Insert(Closure_Items(I), Into => Set_1); end loop; end Closure; function Find_State(Kernel_Set : Item_Set; Trans_Sym : Grammar_Symbol) return Parse_State is Last : constant Item_Array_Index := Item_Array_Index(Size_of(Kernel_Set)); Temp_Item : Item; Iterator : Item_Set_Pack.Set_Iterator; Kernel : Item_Array(1..Last); S : Parse_State; begin if Last = 0 then Put_Line("Ayacc: Possible Error in Find_State."); return Null_Parse_State; end if; -- Copy kernel_set into the array KERNEL to compare it -- to exiting states. Initialize(Iterator, Kernel_Set); for I in 1..Last loop -- last = # of items in kernel_set Next(Iterator, Kernel(I)); end loop; -- Look for state in existing states -- if Is_Terminal(Trans_Sym) then S := Terminal_Gotos(Trans_Sym); else S := Nonterminal_Gotos(Trans_Sym); end if; while S /= Null_Parse_State loop -- Uncomment the following 3 lines of code when you -- you use a bug free compiler. --&if kernel = state_info(S).kernel.all then --&return S; --&end if; -- The following code is to fix a bug in the Verdix compiler -- remove it when you use a bug free compiler. if Kernel'Last /= State_Info(S).Kernel.all'Last then goto Continue; end if; for J in Kernel'range loop if Kernel(J).Rule_ID /= State_Info(S).Kernel(J).Rule_ID or else Kernel(J).Dot_Position /= State_Info(S).Kernel(J).Dot_Position then goto Continue; end if; end loop; return S; -- The end of verdix compiler bug fix. <<Continue>> S := Overflow_Gotos(S); end loop; -- Didn't find state, create a new state. -- Last_State := Last_State + 1; State_Info(Last_State).Kernel := new Item_Array(1..Last); State_Info(Last_State).Kernel.all := Kernel; Make_Null(State_Info(Last_State).Preds); -- Save state number in list of transitions on symbol Trans_Sym. if Is_Terminal(Trans_Sym) then Overflow_Gotos(Last_State) := Terminal_Gotos(Trans_Sym); Terminal_Gotos(Trans_Sym) := Last_State; else Overflow_Gotos(Last_State) := Nonterminal_Gotos(Trans_Sym); Nonterminal_Gotos(Trans_Sym) := Last_State; end if; return Last_State; end Find_State; function Get_Goto(State_ID : Parse_State; Sym : Grammar_Symbol) return Parse_State is Gotos : Transition_Array_Pointer; begin Gotos := State_Info(State_ID).Nonterminal_Goto; for S in Gotos.all'range loop if Sym = Gotos(S).Symbol then return Gotos(S).State_ID; end if; end loop; Put_Line("Ayacc: Possible Error in Get_Goto."); return Null_Parse_State; end Get_Goto; procedure Get_Pred_Set (State_ID : in Parse_State; I : in Item; Pred_Set : in out Parse_State_Set) is ---- New_Item : Item; Temp_Item : Item; Iterator : Parse_State_Iterator; Pred_State : Parse_State; begin if I.Dot_Position = 0 then Insert(State_ID, Into => Pred_Set); else Temp_Item := State_Info(State_ID).Kernel(1); if Get_RHS(Temp_Item.Rule_ID, Temp_Item.Dot_Position) = Get_RHS(I.Rule_ID, I.Dot_Position) then New_Item := (I.Rule_ID, I.Dot_Position - 1); Initialize(Iterator, State_Info(State_ID).Preds); while More(Iterator) loop Next(Iterator, Pred_State); Get_Pred_Set(Pred_State, New_Item, Pred_Set); end loop; end if; end if; end Get_Pred_Set; procedure Get_Transitions (State_ID : in Parse_State; Kind : in Transition_Type; Set_1 : in out Transition_Set) is Gotos : Transition_Array_Pointer; begin Make_Null(Set_1); if Kind = Terminals or else Kind = Grammar_Symbols then Gotos := State_Info_2(State_ID).Terminal_Goto; for S in reverse Gotos.all'range loop Insert(Gotos(S), Into => Set_1); end loop; end if; if Kind /= Terminals then Gotos := State_Info(State_ID).Nonterminal_Goto; for S in reverse Gotos.all'range loop Insert(Gotos(S), Into => Set_1); end loop; return; end if; end Get_Transitions; procedure Get_Transition_Symbols (State_ID : in Parse_State; Kind : in Transition_Type; Set_1 : in out Grammar_Symbol_Set) is Gotos : Transition_Array_Pointer; begin Make_Null(Set_1); if Kind = Terminals or else Kind = Grammar_Symbols then Gotos := State_Info_2(State_ID).Terminal_Goto; for S in reverse Gotos.all'range loop Insert(Gotos(S).Symbol, Into => Set_1); end loop; end if; if Kind = Terminals then return; end if; if Kind = Nonterminals or else Kind = Grammar_Symbols then Gotos := State_Info(State_ID).Nonterminal_Goto; for S in reverse Gotos.all'range loop Insert(Gotos(S).Symbol, Into => Set_1); end loop; end if; end Get_Transition_Symbols; procedure Get_Kernel (State_ID : in Parse_State; Set_1 : in out Item_Set) is begin Make_Null(Set_1); for I in State_Info(State_ID).Kernel.all'range loop Insert(State_Info(State_ID).Kernel(I), Into => Set_1); end loop; end Get_Kernel; procedure Initialize(Iterator : in out Kernel_Iterator; State_ID : in Parse_State) is begin if State_ID in First_State..Last_State then Iterator.Kernel := State_Info(State_ID).Kernel; Iterator.Curser := 1; else raise State_Out_of_Bounds; end if; end Initialize; function More(Iterator: Kernel_Iterator) return Boolean is begin return Iterator.Curser <= Iterator.Kernel.all'Last; end More; procedure Next(Iterator: in out Kernel_Iterator; I : out Item) is begin I := Iterator.Kernel(Iterator.Curser); Iterator.Curser := Iterator.Curser + 1; end Next; procedure Initialize (Iterator : in out Nt_Transition_Iterator; State_ID : in Parse_State) is begin if State_ID in First_State..Last_State then Iterator.Nonterm_Trans := State_Info(State_ID).Nonterminal_Goto; Iterator.Curser := 1; else raise State_Out_of_Bounds; end if; end Initialize; function More(Iterator : Nt_Transition_Iterator) return Boolean is begin return Iterator.Curser <= Iterator.Nonterm_Trans.all'Last; end More; procedure Next (Iterator: in out Nt_Transition_Iterator; Trans : out Transition) is begin Trans := Iterator.Nonterm_Trans(Iterator.Curser); Iterator.Curser := Iterator.Curser + 1; end Next; ----------------------------------------------------- -- terminal interator stuff. procedure Initialize (Iterator : in out T_Transition_Iterator; State_ID : in Parse_State) is begin if State_ID in First_State..Last_State then Iterator.Term_Trans := State_Info_2(State_ID).Terminal_Goto; Iterator.Curser := 1; else raise State_Out_of_Bounds; end if; end Initialize; function More(Iterator : T_Transition_Iterator) return Boolean is begin return Iterator.Curser <= Iterator.Term_Trans.all'Last; end More; procedure Next (Iterator: in out T_Transition_Iterator; Trans : out Transition) is begin Trans := Iterator.Term_Trans(Iterator.Curser); Iterator.Curser := Iterator.Curser + 1; end Next; end LR0_Machine;
-- 9x9 multiplication table in Ada -- CC0, Wei-Lun Chao <bluebat@member.fsf.org>, 2018. -- gnat make mt9x9.adb && ./mt9x9 with Ada.Text_IO; use Ada.Text_IO; procedure mt9x9 is package IO is new Integer_IO (Integer); use IO; V : array (1..3) of Integer := (1, 4, 7); begin for i of V loop for j in 1..9 loop for k in i..i+2 loop Put (k, Width => 1); Put ("x"); Put (j, Width => 1); Put ("="); Put (k*j, Width => 2); Put (ASCII.HT); end loop; Put_Line (""); end loop; New_Line; end loop; end mt9x9;
-- -- Copyright 2018 The wookey project team <wookey@ssi.gouv.fr> -- - Ryad Benadjila -- - Arnauld Michelizza -- - Mathieu Renard -- - Philippe Thierry -- - Philippe Trebuchet -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. -- -- with ewok.tasks_shared; with ewok.interrupts; with soc.interrupts; package ewok.exported.interrupts with spark_mode => off is MAX_POSTHOOK_INSTR : constant := 10; type t_posthook_action is (POSTHOOK_NIL, POSTHOOK_READ, POSTHOOK_WRITE, POSTHOOK_WRITE_REG, -- C name "and" POSTHOOK_WRITE_MASK); -- C name "mask" -- value <- register type t_posthook_action_read is record offset : unsigned_32; value : unsigned_32; end record; -- register <- value & mask type t_posthook_action_write is record offset : unsigned_32; value : unsigned_32; mask : unsigned_32; end record; -- register(dest) <- register(src) & mask type t_posthook_action_write_reg is record offset_dest : unsigned_32; offset_src : unsigned_32; mask : unsigned_32; mode : unsigned_8; end record; -- register(dest) <- register(src) & register(mask) type t_posthook_action_write_mask is record offset_dest : unsigned_32; offset_src : unsigned_32; offset_mask : unsigned_32; mode : unsigned_8; end record; MODE_STANDARD : constant := 0; MODE_NOT : constant := 1; type t_posthook_instruction (instr : t_posthook_action := POSTHOOK_NIL) is record case instr is when POSTHOOK_NIL => null; when POSTHOOK_READ => read : t_posthook_action_read; when POSTHOOK_WRITE => write : t_posthook_action_write; when POSTHOOK_WRITE_REG => write_reg : t_posthook_action_write_reg; when POSTHOOK_WRITE_MASK => write_mask : t_posthook_action_write_mask; end case; end record; -- number of posthooks subtype t_posthook_instruction_number is integer range 1 .. MAX_POSTHOOK_INSTR; -- array of posthooks type t_posthook_instruction_list is array (t_posthook_instruction_number'range) of t_posthook_instruction; type t_interrupt_posthook is record action : t_posthook_instruction_list; -- Reading, writing, masking... status : unsigned_32; data : unsigned_32; end record; type t_interrupt_config is record handler : ewok.interrupts.t_interrupt_handler_access := NULL; interrupt : soc.interrupts.t_interrupt := soc.interrupts.INT_NONE; mode : ewok.tasks_shared.t_scheduling_post_isr; posthook : t_interrupt_posthook; end record; type t_interrupt_config_access is access all t_interrupt_config; end ewok.exported.interrupts;
with Ada.Text_IO; use Ada.Text_IO; with Buffer_Package; use Buffer_Package; with Termbox_Package; use Termbox_Package; package body Command_Package is function Command (E : in out Editor; V : in out View; F : Cmd_Flag_Type; Func : Cmd_Func_Type; A : Arg) return Boolean is Flags : Cmd_Flag_Type := F; B : Buffer := V.B; P : Pos := V.P; OL : Integer := P.L; Has_Line : Boolean := V.B.N /= 0; begin if (Flags = NEEDSBLOCK) and (V.BS = NONE or V.BE = NONE or not Has_Line) then E.Error := To_Unbounded_String ("No Blocks Marked"); return False; end if; if Flags = MARK then Mark_Func (V.B); end if; Func (E, V, A); Fix_Block (E.Doc_View); Fix_Cursor (E); if Flags = CLEARSBLOCK then Clear_Tag (V.B, BLOCK); V.BS := NONE; V.BE := NONE; end if; if not (Flags = SETSHILITE) then Clear_Tag (V.B, HIGHLIGHT); end if; if V.P.L /= OL then V.EX := False; end if; if not (Flags = NOLOCATOR) then V.GB := V.P; end if; return True; end Command; procedure Run_File (E : Editor; V : in out View; A : Arg) is Result : constant Boolean := Read_File (A.S1); pragma Unreferenced (E); pragma Unreferenced (V); begin if Result then Put ("Read Success"); else Put ("Read Failure"); end if; end Run_File; procedure Cmd_Insert_File (E : in out Editor; V : in out View; A : Arg) is Result : Boolean := Read_File (A.S1, V); begin if not Result then E.Error := "Could not open file: " & A.S1; end if; end Cmd_Insert_File; function Test_None (V : View) return Boolean is begin if V.BS = NONE or V.BE = NONE then return False; end if; return True; end Test_None; procedure Fix_Block (V : in out View) is begin Clear_Tag (V.B, BLOCK); declare TN : Boolean := Test_None (V); begin if TN then if V.BS > V.BE then declare L : Integer := V.BS; begin V.BS := V.BE; V.BE := L; end; end if; Set_Tag (V.B, BLOCK, (V.BS, 0), (V.BE, NONE), TB_REVERSE); end if; end; end Fix_Block; end Command_Package;
-- CD5014X.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 AN ADDRESS CLAUSE CAN BE GIVEN IN THE PRIVATE PART -- OF A GENERIC PACKAGE SPECIFICATION FOR A VARIABLE OF A FORMAL -- ARRAY TYPE, WHERE THE VARIABLE IS DECLARED IN THE VISIBLE PART -- OF THE SPECIFICATION. -- HISTORY: -- BCB 10/08/87 CREATED ORIGINAL TEST. -- PWB 05/11/89 CHANGED EXTENSION FROM '.DEP' TO '.ADA'. WITH SYSTEM; USE SYSTEM; WITH SPPRT13; USE SPPRT13; WITH REPORT; USE REPORT; WITH TEXT_IO; USE TEXT_IO; PROCEDURE CD5014X IS BEGIN TEST ("CD5014X", " AN ADDRESS CLAUSE CAN BE GIVEN " & "IN THE PRIVATE PART OF A GENERIC PACKAGE " & "SPECIFICATION FOR A VARIABLE OF A FORMAL " & "ARRAY TYPE, WHERE THE VARIABLE IS DECLARED " & "IN THE VISIBLE PART OF THE SPECIFICATION"); DECLARE TYPE COLOR IS (RED,BLUE,GREEN); TYPE COLOR_TABLE IS ARRAY (COLOR) OF INTEGER; GENERIC TYPE INDEX IS (<>); TYPE FORM_ARRAY_TYPE IS ARRAY (INDEX) OF INTEGER; PACKAGE PKG IS FORM_ARRAY_OBJ1 : FORM_ARRAY_TYPE := (1,2,3); PRIVATE FOR FORM_ARRAY_OBJ1 USE AT VARIABLE_ADDRESS; END PKG; PACKAGE BODY PKG IS BEGIN IF EQUAL(3,3) THEN FORM_ARRAY_OBJ1 := (10,20,30); END IF; IF FORM_ARRAY_OBJ1 /= (10,20,30) THEN FAILED ("INCORRECT VALUE FOR FORMAL ARRAY VARIABLE"); END IF; IF FORM_ARRAY_OBJ1'ADDRESS /= VARIABLE_ADDRESS THEN FAILED ("INCORRECT ADDRESS FOR FORMAL ARRAY " & "VARIABLE"); END IF; END PKG; PACKAGE PACK IS NEW PKG(INDEX => COLOR, FORM_ARRAY_TYPE => COLOR_TABLE); BEGIN NULL; END; RESULT; END CD5014X;
--=========================================================================== -- -- This is the main slave program for the ItsyBitsy for the -- use cases: -- 2: Master Pico -> Slave ItsyBitsy -- 4: Master ItsyBitsy -> Slave ItsyBitsy -- --=========================================================================== -- -- Copyright 2022 (C) Holger Rodriguez -- -- SPDX-License-Identifier: BSD-3-Clause -- with HAL; with HAL.SPI; with RP.Clock; with RP.GPIO; with RP.Device; with ItsyBitsy; with SPI_Slave_ItsyBitsy; procedure Main_Slave_ItsyBitsy is Data_In : HAL.SPI.SPI_Data_16b (1 .. 1) := (others => 0); Status_In : HAL.SPI.SPI_Status; THE_VALUE : constant HAL.UInt16 := HAL.UInt16 (16#A5A5#); Data_Out : HAL.SPI.SPI_Data_16b (1 .. 1) := (others => THE_VALUE); Status_Out : HAL.SPI.SPI_Status; use HAL; begin RP.Clock.Initialize (ItsyBitsy.XOSC_Frequency); RP.Clock.Enable (RP.Clock.PERI); RP.Device.Timer.Enable; ItsyBitsy.LED.Configure (RP.GPIO.Output); SPI_Slave_ItsyBitsy.Initialize; loop -- do this to get the slave ready SPI_Slave_ItsyBitsy.SPI.Transmit (Data_Out, Status_Out); for I in 1 .. 1 loop SPI_Slave_ItsyBitsy.SPI.Receive (Data_In, Status_In, 0); Data_Out (1) := not Data_In (1); -- THE_VALUE SPI_Slave_ItsyBitsy.SPI.Transmit (Data_Out, Status_Out); end loop; RP.Device.Timer.Delay_Milliseconds (10); ItsyBitsy.LED.Toggle; end loop; end Main_Slave_ItsyBitsy;
------------------------------------------------------------------------------ -- Copyright (c) 2017, Natacha Porté -- -- -- -- Permission to use, copy, modify, and distribute this software for any -- -- purpose with or without fee is hereby granted, provided that the above -- -- copyright notice and this permission notice appear in all copies. -- -- -- -- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -- -- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -- -- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -- -- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -- -- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -- -- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -- -- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -- ------------------------------------------------------------------------------ with Ada.Calendar; with AWS.Headers; with AWS.Messages; with AWS.Parameters; with Natools.S_Expressions.File_Writers; with Natools.Time_IO.RFC_3339; with Natools.Web; package body Lithium.Exception_Log is procedure Report (Ex : in Ada.Exceptions.Exception_Occurrence; Request : in AWS.Status.Data) is begin declare Writer : Natools.S_Expressions.File_Writers.Writer := Natools.S_Expressions.File_Writers.Open_Or_Create ("exceptions.sx"); begin Writer.Open_List; Writer.Append_String (Natools.Time_IO.RFC_3339.Image (Ada.Calendar.Clock)); Writer.Open_List; Writer.Append_String (AWS.Status.Method (Request)); Writer.Append_String (AWS.Status.URI (Request)); Writer.Close_List; Write_Headers : declare Headers : constant AWS.Headers.List := AWS.Status.Header (Request); begin Writer.Open_List; Writer.Append_String ("headers"); for I in 1 .. AWS.Headers.Count (Headers) loop Writer.Open_List; Writer.Append_String (AWS.Headers.Get_Name (Headers, I)); Writer.Append_String (AWS.Headers.Get_Value (Headers, I)); Writer.Close_List; end loop; Writer.Close_List; end Write_Headers; Write_Parameters : declare Parameters : constant AWS.Parameters.List := AWS.Status.Parameters (Request); begin Writer.Open_List; Writer.Append_String ("parameters"); for I in 1 .. AWS.Parameters.Count (Parameters) loop Writer.Open_List; Writer.Append_String (AWS.Parameters.Get_Name (Parameters, I)); Writer.Append_String (AWS.Parameters.Get_Value (Parameters, I)); Writer.Close_List; end loop; Writer.Close_List; end Write_Parameters; Writer.Open_List; Writer.Append_String ("body"); Writer.Append_Atom (AWS.Status.Binary_Data (Request)); Writer.Close_List; Writer.Open_List; Writer.Append_String ("exception"); Writer.Open_List; Writer.Append_String ("name"); Writer.Append_String (Ada.Exceptions.Exception_Name (Ex)); Writer.Close_List; Writer.Open_List; Writer.Append_String ("message"); Writer.Append_String (Ada.Exceptions.Exception_Message (Ex)); Writer.Close_List; Writer.Open_List; Writer.Append_String ("info"); Writer.Append_String (Ada.Exceptions.Exception_Information (Ex)); Writer.Close_List; Writer.Close_List; Writer.Close_List; Writer.Newline; end; Natools.Web.Log (Natools.Web.Severities.Error, "Exception " & Ada.Exceptions.Exception_Name (Ex) & " raised and logged"); exception when Double : others => Last_Chance : begin Natools.Web.Log (Natools.Web.Severities.Critical, "Exception " & Ada.Exceptions.Exception_Name (Ex) & " raised but logging raised " & Ada.Exceptions.Exception_Name (Double) & " (" & Ada.Exceptions.Exception_Message (Double) & ")"); exception when others => null; end Last_Chance; end Report; function Respond (Ex : in Ada.Exceptions.Exception_Occurrence; Request : in AWS.Status.Data) return AWS.Response.Data is pragma Unreferenced (Request); begin return AWS.Response.Build ("text/html", "<html><head><title>Error 500 - Internal Server Error</title></head>" & "<body><h1>Error 500 - Internal Server Error<h1><pre><code>" & Ada.Exceptions.Exception_Information (Ex) & "</code></pre></body></html>", AWS.Messages.S500); end Respond; end Lithium.Exception_Log;
-- { dg-do run } -- { dg-options "-O" } procedure string_slice is subtype Key_T is String (1 .. 3); function One_Xkey return Key_T is Key : Key_T := "XXX"; begin Key (1 .. 2) := "__"; return Key; end; Key : Key_T := One_Xkey; begin if Key (3) /= 'X' then raise Program_Error; end if; end;
-- Copyright (c) 2019 Maxim Reznik <reznikmm@gmail.com> -- -- SPDX-License-Identifier: MIT -- License-Filename: LICENSE ------------------------------------------------------------- with League.Strings; package Slim.Messages.SETD is type SETD_Message is new Message with private; -- Setting reply type Setting_Kind is (Player_Name, Something_Else); type Setting (Kind : Setting_Kind := Player_Name) is record case Kind is when Player_Name => Player : League.Strings.Universal_String; when Something_Else => null; end case; end record; not overriding function Get_Setting (Self : SETD_Message) return Setting; private type SETD_Message is new Base_Message (Max_8 => 1, Max_16 => 0, Max_32 => 0, Max_64 => 0) with record Player : League.Strings.Universal_String; Value : Ada.Streams.Stream_Element; -- values other then player name end record; overriding function Read (Data : not null access League.Stream_Element_Vectors.Stream_Element_Vector) return SETD_Message; overriding procedure Write (Self : SETD_Message; Tag : out Message_Tag; Data : out League.Stream_Element_Vectors.Stream_Element_Vector); overriding procedure Read_Custom_Field (Self : in out SETD_Message; Index : Positive; Input : in out Ada.Streams.Stream_Element_Offset; Data : League.Stream_Element_Vectors.Stream_Element_Vector); overriding procedure Write_Custom_Field (Self : SETD_Message; Index : Positive; Data : in out League.Stream_Element_Vectors.Stream_Element_Vector); overriding procedure Visit (Self : not null access SETD_Message; Visiter : in out Slim.Message_Visiters.Visiter'Class); end Slim.Messages.SETD;
-- This file is supposed to be generated from a configuration. -- For Alire we use this file with default values. package ADL_Config is Max_Mount_Points : constant := 2; Max_Mount_Name_Length : constant := 128; Max_Path_Length : constant := 1024; end ADL_Config;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- -- S Y S T E M . B B . R I S C V _ P L I C -- -- -- -- B o d y -- -- -- -- Copyright (C) 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. -- -- -- -- The port of GNARL to bare board targets was initially developed by the -- -- Real-Time Systems Group at the Technical University of Madrid. -- -- -- ------------------------------------------------------------------------------ -- This package implements the RISC-V PLIC interface from the SiFive E3 PLIC with Interfaces; use Interfaces; with System.BB.CPU_Specific; with System.BB.Board_Parameters; use System.BB.Board_Parameters; package body System.BB.RISCV_PLIC is use type CPU_Specific.Register_Word; --------------------- -- Source Priority -- --------------------- type Priority_Type is mod 2**PLIC_Priority_Bits with Size => PLIC_Priority_Bits; type Priority_Register is record P : Priority_Type; end record with Volatile_Full_Access, Size => 32; for Priority_Register use record P at 0 range 0 .. PLIC_Priority_Bits - 1; end record; type Priority_Array is array (1 .. PLIC_Nbr_Of_Sources) of Priority_Register; Source_Priority : Priority_Array with Address => PLIC_Base_Address + 4; ---------------------- -- Enable Registers -- ---------------------- type Enable_Flags is array (0 .. 31) of Boolean with Volatile_Full_Access, Pack, Size => 32; type Enable_Array is array (0 .. PLIC_Nbr_Of_Mask_Regs - 1) of Enable_Flags with Pack, Size => 32 * PLIC_Nbr_Of_Mask_Regs; pragma Warnings (Off, "832 bits of ""Hart_Enables"" unused"); type Hart_Enables is record M_Mode : Enable_Array; S_Mode : Enable_Array; end record with Size => 8 * 256; pragma Warnings (On, "832 bits of ""Hart_Enables"" unused"); for Hart_Enables use record M_Mode at 16#00# range 0 .. (32 * PLIC_Nbr_Of_Mask_Regs) - 1; S_Mode at 16#80# range 0 .. (32 * PLIC_Nbr_Of_Mask_Regs) - 1; end record; type Hart_Enables_Array is array (1 .. PLIC_Nbr_Of_Harts - 1) of Hart_Enables; Hart_0_M_Mode_Enables : Enable_Array with Address => PLIC_Base_Address + 16#0000_2000#; -- Hart 0 is a special case because there is no S-Mode and the address is -- does not follow the same pattern as the other harts. Harts_Enables : Hart_Enables_Array with Address => PLIC_Base_Address + 16#0000_2080#; -- Other harts enables ----------------------------------- -- Hart Threshold/Claim/Complete -- ----------------------------------- pragma Warnings (Off, "32704 bits of ""Hart_Control"" unused"); type Hart_Control is record Threshold : Priority_Register; Claim_Complete : Unsigned_32; end record with Size => 8 * 4096; pragma Warnings (On, "32704 bits of ""Hart_Control"" unused"); for Hart_Control use record Threshold at 0 range 0 .. 31; Claim_Complete at 4 range 0 .. 31; end record; type Hart_Control_Array is array (0 .. PLIC_Nbr_Of_Harts - 1) of Hart_Control with Size => 8 * 4096 * PLIC_Nbr_Of_Harts; Harts_Control : Hart_Control_Array with Address => PLIC_Base_Address + 16#0020_0000#; Claimed_Table : array (BBI.Any_Interrupt_ID) of Boolean := (others => False) with Ghost; Use_Hart_0 : constant Boolean := PLIC_Hart_Id = 0; ---------------- -- Initialize -- ---------------- procedure Initialize is begin -- Disable all interrupts Hart_0_M_Mode_Enables := (others => (others => False)); Harts_Enables := (others => (M_Mode => (others => (others => False)), S_Mode => (others => (others => False))) ); -- Set all priority to zero for Prio of Source_Priority loop Prio := (P => 0); end loop; end Initialize; ------------- -- Pending -- ------------- function Pending return Boolean is begin return (CPU_Specific.Mip and CPU_Specific.Mip_MEIP) /= 0; end Pending; ------------ -- Enable -- ------------ procedure Enable (Interrupt : BBI.Interrupt_ID) is Reg_Id : constant Natural := Natural (Interrupt) / 32; Int_Id : constant Natural := Natural (Interrupt) mod 32; begin if Use_Hart_0 then Hart_0_M_Mode_Enables (Reg_Id) (Int_Id) := True; else Harts_Enables (PLIC_Hart_Id).M_Mode (Reg_Id) (Int_Id) := True; end if; end Enable; ------------- -- Claimed -- ------------- function Claimed (Interrupt : BBI.Interrupt_ID) return Boolean is (Claimed_Table (Interrupt)); ------------ -- Claim -- ------------ function Claim return BBI.Any_Interrupt_ID is Number : constant Unsigned_32 := Harts_Control (PLIC_Hart_Id).Claim_Complete; Id : BBI.Any_Interrupt_ID; begin if Number not in Unsigned_32 (BBI.Interrupt_ID'First) .. Unsigned_32 (BBI.Interrupt_ID'Last) then Id := BBI.No_Interrupt; else Id := BBI.Interrupt_ID (Number); end if; Claimed_Table (Id) := True; return Id; end Claim; -------------- -- Complete -- -------------- procedure Complete (Interrupt : BBI.Interrupt_ID) is begin -- Writing to the CLAIM register to signal completion Harts_Control (PLIC_Hart_Id).Claim_Complete := Unsigned_32 (Interrupt); Claimed_Table (Interrupt) := False; end Complete; ---------------------------- -- Set_Priority_Threshold -- ---------------------------- procedure Set_Priority_Threshold (Priority : Integer) is Thresh : Priority_Register renames Harts_Control (PLIC_Hart_Id).Threshold; Int_Priority : constant Integer := Priority - Interrupt_Priority'First + 1; begin if Int_Priority > Integer (Priority_Type'Last) then Thresh := (P => Priority_Type'Last); elsif Int_Priority < Integer (Priority_Type'First) then Thresh := (P => Priority_Type'First); else Thresh := (P => Priority_Type (Int_Priority)); end if; end Set_Priority_Threshold; --------------- -- Threshold -- --------------- function Threshold return Integer is begin return Integer (Harts_Control (PLIC_Hart_Id).Threshold.P); end Threshold; ------------------ -- Set_Priority -- ------------------ procedure Set_Priority (Interrupt : System.BB.Interrupts.Interrupt_ID; Prio : Interrupt_Priority) is Int_Prio : constant Natural := Natural (Prio) - Natural (Interrupt_Priority'First) + 1; -- On the PLIC, priority zero is reserved to mean "never interrupt" Int_Id : constant Natural := Natural (Interrupt); begin Source_Priority (Int_Id).P := Priority_Type (Int_Prio); end Set_Priority; --------------------------- -- Priority_Of_Interrupt -- --------------------------- function Priority_Of_Interrupt (Interrupt : System.BB.Interrupts.Interrupt_ID) return System.Any_Priority is Int_Id : constant Natural := Natural (Interrupt); begin return Natural (Source_Priority (Int_Id).P) + Interrupt_Priority'First - 1; end Priority_Of_Interrupt; end System.BB.RISCV_PLIC;
with GMP.Z; with GMP.Q; with GMP.F; with GMP.FR; with GMP.C; procedure check_sig is -- numeric generic type T is private; with function Image (Value : T; Base : GMP.Number_Base) return String is <>; with function Value (Image : String; Base : GMP.Number_Base) return T is <>; pragma Unreferenced (Image); pragma Unreferenced (Value); with function "=" (Left, Right : T) return Boolean is <>; with function "<" (Left, Right : T) return Boolean is <>; with function ">" (Left, Right : T) return Boolean is <>; with function "<=" (Left, Right : T) return Boolean is <>; with function ">=" (Left, Right : T) return Boolean is <>; pragma Unreferenced ("="); pragma Unreferenced ("<"); pragma Unreferenced (">"); pragma Unreferenced ("<="); pragma Unreferenced (">="); with function "+" (Right : T) return T is <>; with function "-" (Right : T) return T is <>; pragma Unreferenced ("+"); pragma Unreferenced ("-"); with function "+" (Left, Right : T) return T is <>; with function "-" (Left, Right : T) return T is <>; with function "*" (Left, Right : T) return T is <>; with function "/" (Left, Right : T) return T is <>; with function "**" (Left : T; Right : Natural) return T is <>; pragma Unreferenced ("+"); pragma Unreferenced ("-"); pragma Unreferenced ("*"); pragma Unreferenced ("/"); pragma Unreferenced ("**"); -- scale, root, sqrt package Sig_N is end Sig_N; -- scalar generic type T is private; pragma Unreferenced (T); package Sig_S is end Sig_S; -- real generic type T is private; pragma Unreferenced (T); -- truncate, ceil, floor package Sig_R is end Sig_R; -- float generic type T is private; pragma Unreferenced (T); -- nearly_equal, frexp, log, based_log package Sig_F is end Sig_F; -- instances package F is new GMP.F; package FR is new GMP.FR; package C is new GMP.C (FR, FR); begin declare -- Z is numeric/scalar use GMP.Z; package ZN is new Sig_N (MP_Integer); package ZS is new Sig_S (MP_Integer); pragma Unreferenced (ZN); pragma Unreferenced (ZS); begin null; end; declare -- Q is numeric/real use GMP.Q; package QN is new Sig_N (MP_Rational); package QR is new Sig_R (MP_Rational); pragma Unreferenced (QN); pragma Unreferenced (QR); begin null; end; declare -- F is numeric/real/float use F; package FN is new Sig_N (MP_Float); package FR is new Sig_R (MP_Float); package FF is new Sig_F (MP_Float); pragma Unreferenced (FN); pragma Unreferenced (FR); pragma Unreferenced (FF); begin null; end; declare -- FR is numeric/real/float use FR; package FRN is new Sig_N (MP_Float); package FRR is new Sig_R (MP_Float); package FRF is new Sig_F (MP_Float); pragma Unreferenced (FRN); pragma Unreferenced (FRR); pragma Unreferenced (FRF); begin null; end; declare -- C is numeric use C; package CN is new Sig_N (MP_Complex); pragma Unreferenced (CN); begin null; end; end check_sig;
with EU_Projects.Nodes.Timed_Nodes; with EU_Projects.Nodes.Action_Nodes.Tasks; with EU_Projects.Node_Tables; package EU_Projects.Nodes.Timed_Nodes.Deliverables is subtype Deliverable_Index is Node_Index; No_Deliverable : constant Extended_Node_Index := No_Index; type Deliverable_Label is new Node_Label; type Deliverable is new Nodes.Timed_Nodes.Timed_Node with private; type Deliverable_Access is access all Deliverable; type Deliverable_Type is (Report, Demo, Dissemination, Other); type Dissemination_Level is (Public, Confidential, Classified); type Deliverable_Status is (Parent, Clone, Stand_Alone); overriding function Dependency_Ready_Var (Item : Deliverable) return String is ("end"); function Status (Item : Deliverable) return Deliverable_Status; function Create (Label : Deliverable_Label; Name : String; Description : String; Short_Name : String; Delivered_By : Node_Label_Lists.Vector; Due_On : String; Node_Dir : in out Node_Tables.Node_Table; Parent_WP : Node_Access; Linked_Milestones : Nodes.Node_Label_Lists.Vector; Deliv_Type : Deliverable_Type; Dissemination : Dissemination_Level) return Deliverable_Access with Post => Create'Result.Status = Stand_Alone; overriding function Variables (Item : Deliverable) return Variable_List is ((if Item.Status = Parent then Empty_List else (1 => Event_Names.Event_Time_Name))); overriding function Is_Variable (Item : Deliverable; Var : Simple_Identifier) return Boolean is (if Item.Status = Parent then False else Var = Event_Names.Event_Time_Name); procedure Clone (Item : in out Deliverable; Due_On : in String; Node_Dir : in out Node_Tables.Node_Table) with Pre => not Item.Is_Clone and Item.Index = No_Deliverable, Post => Item.Status = Parent and Item.Max_Clone = Item.Max_Clone'Old + (if Item.Status'Old = Stand_Alone then 2 else 1); function Clone_Sub_Label (Item : Deliverable) return String; function Clone (Item : Deliverable; Idx : Positive) return Deliverable_Access; function Is_Clone (Item : Deliverable) return Boolean is (Item.Status = Clone); overriding function Due_On (Item : Deliverable) return Times.Instant with Pre => Item.Time_Fixed and Item.Status /= Parent; use type Times.Instant; package Instant_Vectors is new Ada.Containers.Vectors (Index_Type => Positive, Element_Type => Times.Instant); function Due_On (Item : Deliverable; Sorted : Boolean := True) return Instant_Vectors.Vector; function Image (Item : Instant_Vectors.Vector; Separator : String := ", ") return String; procedure Set_Index (Item : in out Deliverable; Idx : Deliverable_Index) with Pre => Item.Index = No_Deliverable; overriding function Full_Index (Item : Deliverable; Prefixed : Boolean) return String; function Max_Clone (Item : Deliverable) return Natural; function Delivered_By (Item : Deliverable) return Nodes.Node_Label_Lists.Vector; function Dependency_List (Item : Deliverable) return Node_Label_Lists.Vector is (Item.Delivered_By); function Linked_Milestones (Item : Deliverable) return Nodes.Node_Label_Lists.Vector; function Parent_Wp (Item : Deliverable) return Node_Access; function Nature (Item : Deliverable) return Deliverable_Type; function Dissemination (Item : Deliverable) return Dissemination_Level; private -- use Tasks; -- -- package Task_Lists is -- new Ada.Containers.Vectors (Index_Type => Positive, -- Element_Type => Project_Task_Access); subtype Clone_Index_Type is Integer range 0 .. Character'Pos ('z')-Character'Pos ('a'); No_Clone : constant Clone_Index_Type := 0; package Deliverable_Arrays is new Ada.Containers.Vectors (Index_Type => Positive, Element_Type => Deliverable_Access); type Deliverable is new Nodes.Timed_Nodes.Timed_Node with record Deliverer : Node_Label_Lists.Vector; Linked_Milestones : Nodes.Node_Label_Lists.Vector; Parent_WP : Node_Access; Deliv_Type : Deliverable_Type; Dissemination : Dissemination_Level; Status : Deliverable_Status; Clone_List : Deliverable_Arrays.Vector; Clone_Index : Clone_Index_Type; end record with Dynamic_Predicate => (if Deliverable.Status /= Parent then Deliverable.Clone_List.Is_Empty else (for all X of Deliverable.Clone_List => X.Status = Clone)); function Status (Item : Deliverable) return Deliverable_Status is (Item.Status); function Clone (Item : Deliverable; Idx : Positive) return Deliverable_Access is (Item.Clone_List (Idx)); function Max_Clone (Item : Deliverable) return Natural is (if Item.Clone_List.Is_Empty then 0 else Item.Clone_List.Last_Index); function Delivered_By (Item : Deliverable) return Nodes.Node_Label_Lists.Vector is (Item.Deliverer); function Parent_Wp (Item : Deliverable) return Node_Access is (Item.Parent_Wp); function Clone_Sub_Label (Item : Deliverable) return String is (if Item.Status = Clone then "." & Character'Val (Character'Pos ('a')-1 + Item.Clone_Index) else ""); overriding function Full_Index (Item : Deliverable; Prefixed : Boolean) return String is ((if Prefixed then "D" else "") & Chop (Node_Index'Image (Item.Parent_WP.Index)) & "." & Chop (Node_Index'Image (Item.Index)) & Item.Clone_Sub_Label); function Linked_Milestones (Item : Deliverable) return Nodes.Node_Label_Lists.Vector is (Item.Linked_Milestones); function Nature (Item : Deliverable) return Deliverable_Type is (Item.Deliv_Type); function Dissemination (Item : Deliverable) return Dissemination_Level is (Item.Dissemination); -- function Index (Item : Deliverable) return Deliverable_Index -- is (Deliverable_Index (Item.Index)); end EU_Projects.Nodes.Timed_Nodes.Deliverables;
with Ada.Command_line; use Ada.Command_line; with Ada.Text_IO; use Ada.Text_IO; procedure johncena is begin while (True) loop Put_Line(""); end loop; end johncena;
-- part of OpenGLAda, (c) 2017 Felix Krause -- released under the terms of the MIT license, see the file "COPYING" with GL.Buffers; with GL.Pixels; with GL.Types; private with GL.Low_Level; package GL.Framebuffer is pragma Preelaborate; use GL.Types; type Logic_Op is (Clear, And_Op, And_Reverse, Copy, And_Inverted, Noop, Xor_Op, Or_Op, Nor, Equiv, Invert, Or_Reverse, Copy_Inverted, Or_Inverted, Nand, Set); subtype Read_Buffer_Selector is Buffers.Color_Buffer_Selector range Buffers.None .. Buffers.Right; -- this package provides functionality the works implicitly on the current -- framebuffer. for working with framebuffer objects, -- see GL.Objects.Framebuffers. procedure Set_Clamp_Read_Color (Enabled : Boolean); procedure Set_Read_Buffer (Value : Read_Buffer_Selector); function Read_Buffer return Read_Buffer_Selector; generic type Element_Type is private; type Index_Type is (<>); type Array_Type is array (Index_Type range <>) of aliased Element_Type; procedure Read_Pixels (X, Y : Int; Width, Height : Size; Format : Pixels.Framebuffer_Format; Data_Type : Pixels.Data_Type; Data : out Array_Type); procedure Set_Logic_Op_Mode (Value : Logic_Op); function Logic_Op_Mode return Logic_Op; private for Logic_Op use (Clear => 16#1500#, And_Op => 16#1501#, And_Reverse => 16#1502#, Copy => 16#1503#, And_Inverted => 16#1504#, Noop => 16#1505#, Xor_Op => 16#1506#, Or_Op => 16#1507#, Nor => 16#1508#, Equiv => 16#1509#, Invert => 16#150A#, Or_Reverse => 16#150B#, Copy_Inverted => 16#150C#, Or_Inverted => 16#150D#, Nand => 16#150E#, Set => 16#150F#); for Logic_Op'Size use Low_Level.Enum'Size; end GL.Framebuffer;
-- part of OpenGLAda, (c) 2017 Felix Krause -- released under the terms of the MIT license, see the file "COPYING" with GL.API; with GL.Enums.Getter; package body GL.Pixels is procedure Set_Pack_Swap_Bytes (Value : Boolean) is begin API.Pixel_Store (Enums.Pack_Swap_Bytes, Low_Level.Bool (Value)); Raise_Exception_On_OpenGL_Error; end Set_Pack_Swap_Bytes; procedure Set_Pack_LSB_First (Value : Boolean) is begin API.Pixel_Store (Enums.Pack_LSB_First, Low_Level.Bool (Value)); Raise_Exception_On_OpenGL_Error; end Set_Pack_LSB_First; procedure Set_Pack_Row_Length (Value : Size) is begin API.Pixel_Store (Enums.Pack_Row_Length, Value); Raise_Exception_On_OpenGL_Error; end Set_Pack_Row_Length; procedure Set_Pack_Image_Height (Value : Size) is begin API.Pixel_Store (Enums.Pack_Image_Height, Value); Raise_Exception_On_OpenGL_Error; end Set_Pack_Image_Height; procedure Set_Pack_Skip_Pixels (Value : Size) is begin API.Pixel_Store (Enums.Pack_Skip_Pixels, Value); Raise_Exception_On_OpenGL_Error; end Set_Pack_Skip_Pixels; procedure Set_Pack_Skip_Rows (Value : Size) is begin API.Pixel_Store (Enums.Pack_Skip_Rows, Value); Raise_Exception_On_OpenGL_Error; end Set_Pack_Skip_Rows; procedure Set_Pack_Skip_Images (Value : Size) is begin API.Pixel_Store (Enums.Pack_Skip_Images, Value); Raise_Exception_On_OpenGL_Error; end Set_Pack_Skip_Images; procedure Set_Pack_Alignment (Value : Alignment) is begin API.Pixel_Store (Enums.Pack_Alignment, Value); Raise_Exception_On_OpenGL_Error; end Set_Pack_Alignment; function Pack_Swap_Bytes return Boolean is Ret : aliased Low_Level.Bool; begin API.Get_Boolean (Enums.Getter.Pack_Swap_Bytes, Ret'Access); Raise_Exception_On_OpenGL_Error; return Boolean (Ret); end Pack_Swap_Bytes; function Pack_LSB_First return Boolean is Ret : aliased Low_Level.Bool; begin API.Get_Boolean (Enums.Getter.Pack_Lsb_First, Ret'Access); Raise_Exception_On_OpenGL_Error; return Boolean (Ret); end Pack_LSB_First; function Pack_Row_Length return Size is Ret : aliased Types.Int; begin API.Get_Integer (Enums.Getter.Pack_Row_Length, Ret'Access); Raise_Exception_On_OpenGL_Error; return Size (Ret); end Pack_Row_Length; function Pack_Image_Height return Size is Ret : aliased Types.Int; begin API.Get_Integer (Enums.Getter.Pack_Image_Height, Ret'Access); Raise_Exception_On_OpenGL_Error; return Size (Ret); end Pack_Image_Height; function Pack_Skip_Pixels return Size is Ret : aliased Types.Int; begin API.Get_Integer (Enums.Getter.Pack_Skip_Pixels, Ret'Access); Raise_Exception_On_OpenGL_Error; return Size (Ret); end Pack_Skip_Pixels; function Pack_Skip_Rows return Size is Ret : aliased Types.Int; begin API.Get_Integer (Enums.Getter.Pack_Skip_Rows, Ret'Access); Raise_Exception_On_OpenGL_Error; return Size (Ret); end Pack_Skip_Rows; function Pack_Skip_Images return Size is Ret : aliased Types.Int; begin API.Get_Integer (Enums.Getter.Pack_Skip_Images, Ret'Access); Raise_Exception_On_OpenGL_Error; return Size (Ret); end Pack_Skip_Images; function Pack_Alignment return Alignment is Ret : aliased Alignment; begin API.Get_Alignment (Enums.Getter.Pack_Alignment, Ret'Access); Raise_Exception_On_OpenGL_Error; return Ret; end Pack_Alignment; procedure Set_Unpack_Swap_Bytes (Value : Boolean) is begin API.Pixel_Store (Enums.Unpack_Swap_Bytes, Low_Level.Bool (Value)); Raise_Exception_On_OpenGL_Error; end Set_Unpack_Swap_Bytes; procedure Set_Unpack_LSB_First (Value : Boolean) is begin API.Pixel_Store (Enums.Unpack_LSB_First, Low_Level.Bool (Value)); Raise_Exception_On_OpenGL_Error; end Set_Unpack_LSB_First; procedure Set_Unpack_Row_Length (Value : Size) is begin API.Pixel_Store (Enums.Unpack_Row_Length, Value); Raise_Exception_On_OpenGL_Error; end Set_Unpack_Row_Length; procedure Set_Unpack_Image_Height (Value : Size) is begin API.Pixel_Store (Enums.Unpack_Image_Height, Value); Raise_Exception_On_OpenGL_Error; end Set_Unpack_Image_Height; procedure Set_Unpack_Skip_Pixels (Value : Size) is begin API.Pixel_Store (Enums.Unpack_Skip_Pixels, Value); Raise_Exception_On_OpenGL_Error; end Set_Unpack_Skip_Pixels; procedure Set_Unpack_Skip_Rows (Value : Size) is begin API.Pixel_Store (Enums.Unpack_Skip_Rows, Value); Raise_Exception_On_OpenGL_Error; end Set_Unpack_Skip_Rows; procedure Set_Unpack_Skip_Images (Value : Size) is begin API.Pixel_Store (Enums.Unpack_Skip_Images, Value); Raise_Exception_On_OpenGL_Error; end Set_Unpack_Skip_Images; procedure Set_Unpack_Alignment (Value : Alignment) is begin API.Pixel_Store (Enums.Unpack_Alignment, Value); Raise_Exception_On_OpenGL_Error; end Set_Unpack_Alignment; function Unpack_Swap_Bytes return Boolean is Ret : aliased Low_Level.Bool; begin API.Get_Boolean (Enums.Getter.Unpack_Swap_Bytes, Ret'Access); Raise_Exception_On_OpenGL_Error; return Boolean (Ret); end Unpack_Swap_Bytes; function Unpack_LSB_First return Boolean is Ret : aliased Low_Level.Bool; begin API.Get_Boolean (Enums.Getter.Unpack_Lsb_First, Ret'Access); Raise_Exception_On_OpenGL_Error; return Boolean (Ret); end Unpack_LSB_First; function Unpack_Row_Length return Size is Ret : aliased Types.Int; begin API.Get_Integer (Enums.Getter.Unpack_Row_Length, Ret'Access); Raise_Exception_On_OpenGL_Error; return Size (Ret); end Unpack_Row_Length; function Unpack_Image_Height return Size is Ret : aliased Types.Int; begin API.Get_Integer (Enums.Getter.Unpack_Image_Height, Ret'Access); Raise_Exception_On_OpenGL_Error; return Size (Ret); end Unpack_Image_Height; function Unpack_Skip_Pixels return Size is Ret : aliased Types.Int; begin API.Get_Integer (Enums.Getter.Unpack_Skip_Pixels, Ret'Access); Raise_Exception_On_OpenGL_Error; return Size (Ret); end Unpack_Skip_Pixels; function Unpack_Skip_Rows return Size is Ret : aliased Types.Int; begin API.Get_Integer (Enums.Getter.Unpack_Skip_Rows, Ret'Access); Raise_Exception_On_OpenGL_Error; return Size (Ret); end Unpack_Skip_Rows; function Unpack_Skip_Images return Size is Ret : aliased Types.Int; begin API.Get_Integer (Enums.Getter.Unpack_Skip_Images, Ret'Access); Raise_Exception_On_OpenGL_Error; return Size (Ret); end Unpack_Skip_Images; function Unpack_Alignment return Alignment is Ret : aliased Alignment; begin API.Get_Alignment (Enums.Getter.Unpack_Alignment, Ret'Access); Raise_Exception_On_OpenGL_Error; return Ret; end Unpack_Alignment; end GL.Pixels;
with Ada.Unchecked_Deallocation; package body Ada.Containers.Forward_Iterators is pragma Check_Policy (Validate => Ignore); procedure Free is new Unchecked_Deallocation (Element_Type, Element_Access); procedure Free is new Unchecked_Deallocation (Node, Node_Access); procedure Retain (Node : not null Node_Access); procedure Retain (Node : not null Node_Access) is begin Node.Reference_Count := Node.Reference_Count + 1; end Retain; procedure Release (Node : in out Node_Access); procedure Release (Node : in out Node_Access) is Item : Node_Access := Node; begin while Item /= null loop Item.Reference_Count := Item.Reference_Count - 1; exit when Item.Reference_Count > 0; declare Next : constant Node_Access := Item.Next; begin Free (Item.Item); Free (Item); Item := Next; end; end loop; Node := null; end Release; procedure Update_Last (Object : in out Iterator); procedure Update_Last (Object : in out Iterator) is begin if not Has_Element (Object.Last_Input_Cursor) then Object.State := No_Element; Release (Object.Last); else declare New_Node : constant Node_Access := new Node'( Reference_Count => 1, Next => null, Item => new Element_Type'(Element (Object.Last_Input_Cursor))); begin if Object.Last /= null then pragma Check (Validate, Object.Last.Next = null); Object.Last.Next := New_Node; Retain (New_Node); Release (Object.Last); end if; Object.Last := New_Node; end; end if; end Update_Last; -- implementation function Has_Element (Position : Cursor) return Boolean is begin return Controlled.Reference (Position) /= null; end Has_Element; function Constant_Reference (Position : Cursor) return Constant_Reference_Type is begin return (Element => Controlled.Reference (Position).Item.all'Access); end Constant_Reference; function Iterate return Iterator_Interfaces.Forward_Iterator'Class is begin return Result : Iterator := (Finalization.Limited_Controlled with Last_Input_Cursor => Input_Iterator_Interfaces.First (Input_Iterator), Last => null, State => First) do Update_Last (Result); end return; end Iterate; package body Controlled is function Create (Node : Node_Access) return Cursor is begin if Node /= null then Retain (Node); end if; return (Finalization.Controlled with Node => Node); end Create; function Reference (Position : Forward_Iterators.Cursor) return Node_Access is begin return Cursor (Position).Node; end Reference; overriding procedure Adjust (Object : in out Cursor) is begin if Object.Node /= null then Retain (Object.Node); end if; end Adjust; overriding procedure Finalize (Object : in out Cursor) is begin Release (Object.Node); end Finalize; end Controlled; overriding procedure Finalize (Object : in out Iterator) is begin Release (Object.Last); end Finalize; overriding function First (Object : Iterator) return Cursor is pragma Check (Pre, Check => Object.State = First or else raise Status_Error); begin return Create (Object.Last); end First; overriding function Next (Object : Iterator; Position : Cursor) return Cursor is Mutable_Object : Iterator renames Object'Unrestricted_Access.all; Result_Node : Node_Access := Controlled.Reference (Position).Next; begin if Result_Node = null then -- Position is the current last if Mutable_Object.State /= No_Element then Mutable_Object.State := Next; Mutable_Object.Last_Input_Cursor := Input_Iterator_Interfaces.Next ( Input_Iterator, Mutable_Object.Last_Input_Cursor); Update_Last (Mutable_Object); end if; Result_Node := Mutable_Object.Last; end if; return Create (Result_Node); end Next; end Ada.Containers.Forward_Iterators;
package body Test_Container.Read is procedure Initialize (T : in out Test) is begin Set_Name (T, "Test_Container.Read"); Ahven.Framework.Add_Test_Routine (T, Constant_Length_Array'Access, "constant length array: 0, 0, 0"); Ahven.Framework.Add_Test_Routine (T, Variable_Length_Array'Access, "variable length array: 1, 2, 3"); Ahven.Framework.Add_Test_Routine (T, List'Access, "empty list"); Ahven.Framework.Add_Test_Routine (T, Set'Access, "set: 0"); Ahven.Framework.Add_Test_Routine (T, Map'Access, "f -> (0, 0)"); end Initialize; procedure Constant_Length_Array is State : access Skill_State := new Skill_State; begin Skill.Read (State, "resources/container.sf"); declare X : Container_Type_Access := Skill.Get_Container (State, 1); Arr : Container_Arr_Array := X.Get_Arr; begin for I in 1 .. 3 loop Ahven.Assert (0 = Arr (I), "not three zeros"); end loop; end; end Constant_Length_Array; procedure Variable_Length_Array is use Container_Varr_Vector; State : access Skill_State := new Skill_State; begin Skill.Read (State, "resources/container.sf"); declare X : Container_Type_Access := Skill.Get_Container (State, 1); Varr : Container_Varr_Vector.Vector := X.Get_Varr; begin Ahven.Assert (3 = Natural (Varr.Length), "length is not 3"); for I in 1 .. 3 loop Ahven.Assert (Long (I) = Varr.Element (I), "elements are not 1, 2, 3"); end loop; end; end Variable_Length_Array; procedure List is use Container_L_List; State : access Skill_State := new Skill_State; begin Skill.Read (State, "resources/container.sf"); declare X : Container_Type_Access := Skill.Get_Container (State, 1); L : Container_L_List.List := X.Get_L; begin Ahven.Assert (L.Is_Empty, "is not empty"); end; end List; procedure Set is use Container_S_Set; State : access Skill_State := new Skill_State; begin Skill.Read (State, "resources/container.sf"); declare X : Container_Type_Access := Skill.Get_Container (State, 1); S : Container_S_Set.Set := X.Get_S; begin Ahven.Assert (1 = Natural (S.Length), "length is not 0"); Ahven.Assert (S.Contains (0), "element is not 0"); end; end Set; procedure Map is State : access Skill_State := new Skill_State; begin Skill.Read (State, "resources/container.sf"); declare procedure Iterate_2 (Position : Container_F_Map_2.Cursor) is K : v64 := Container_F_Map_2.Key (Position); V : v64 := Container_F_Map_2.Element (Position); begin Ahven.Assert (0 = K, "key is not 0"); Ahven.Assert (0 = V, "value is not 0"); end Iterate_2; procedure Iterate (Position : Container_F_Map_1.Cursor) is K : String_Access := Container_F_Map_1.Key (Position); M : Container_F_Map_2.Map := Container_F_Map_1.Element (Position); begin Ahven.Assert ("f" = K.all, "string is not f"); M.Iterate (Iterate_2'Access); end Iterate; begin for I in 1 .. Containers_Size (State) loop declare M : Container_F_Map_1.Map := Get_Container (State, I).Get_F; begin M.Iterate (Iterate'Access); end; end loop; end; end Map; end Test_Container.Read;
-- -- Copyright 2021 (C) Holger Rodriguez -- -- SPDX-License-Identifier: BSD-3-Clause -- package body Edc_Client.LED is subtype LED_String_Block is String (1 .. 2); BLOCK : constant LED_String_Block := "L0"; subtype LED_String_Specifier is String (1 .. 2); procedure Transmit (Specifier : LED_String_Specifier) is Command : LED_String; begin Command (1 .. 2) := BLOCK (1 .. 2); Command (3 .. 4) := Specifier (1 .. 2); Transmitter (Command); end Transmit; --======================================================================== -- -- All procedures below are described in the corresponding .ads file -- --======================================================================== procedure Red_On is Specifier : constant LED_String_Specifier := "R1"; begin Transmit (Specifier); end Red_On; procedure Red_Off is Specifier : constant LED_String_Specifier := "R0"; begin Transmit (Specifier); end Red_Off; procedure Red_Toggle is Specifier : constant LED_String_Specifier := "R2"; begin Transmit (Specifier); end Red_Toggle; procedure Amber_On is Specifier : constant LED_String_Specifier := "A1"; begin Transmit (Specifier); end Amber_On; procedure Amber_Off is Specifier : constant LED_String_Specifier := "A0"; begin Transmit (Specifier); end Amber_Off; procedure Amber_Toggle is Specifier : constant LED_String_Specifier := "A2"; begin Transmit (Specifier); end Amber_Toggle; procedure Green_On is Specifier : constant LED_String_Specifier := "G1"; begin Transmit (Specifier); end Green_On; procedure Green_Off is Specifier : constant LED_String_Specifier := "G0"; begin Transmit (Specifier); end Green_Off; procedure Green_Toggle is Specifier : constant LED_String_Specifier := "G2"; begin Transmit (Specifier); end Green_Toggle; procedure White_On is Specifier : constant LED_String_Specifier := "W1"; begin Transmit (Specifier); end White_On; procedure White_Off is Specifier : constant LED_String_Specifier := "W0"; begin Transmit (Specifier); end White_Off; procedure White_Toggle is Specifier : constant LED_String_Specifier := "W2"; begin Transmit (Specifier); end White_Toggle; procedure Blue_On is Specifier : constant LED_String_Specifier := "B1"; begin Transmit (Specifier); end Blue_On; procedure Blue_Off is Specifier : constant LED_String_Specifier := "B0"; begin Transmit (Specifier); end Blue_Off; procedure Blue_Toggle is Specifier : constant LED_String_Specifier := "B2"; begin Transmit (Specifier); end Blue_Toggle; end Edc_Client.LED;
with Ada.Text_IO; use Ada.Text_IO; with Ada.Integer_Text_IO; use Ada.Integer_Text_IO; -- Afficher la table de multiplication de 7 procedure Table_7 is begin for J in 1 .. 9 loop Put(J, 1); Put(" x 7 = "); Put(7*J, 1); New_Line; end loop; end Table_7;
with Ada.Text_IO; use Ada.Text_IO; with Yeison_Single; procedure Demo_Single is package Yeison renames Yeison_Single; use Yeison.Operators; A1 : constant Yeison.Any := 1; -- An integer atom; A2 : constant Yeison.Any := "string"; -- A string atom A3 : constant Yeison.Any := Yeison.True; -- A Boolean atom A4 : constant Yeison.Any := 3.14; -- A real atom M1 : constant Yeison.Any := ("one" => A1, "two" => A2); -- A map initialized with yeison atoms M2 : constant Yeison.Any := ("one" => 1, "two" => "two"); -- A map initialized with literals M3 : constant Yeison.Any := ("one" => A1, "two" => "two", "three" => M2); -- A map containing other maps V1 : constant Yeison.Any := +(A1, A2); -- A vector initialized with atoms V2 : constant Yeison.Any := +(1, 2, 3) with Unreferenced; -- A vector initialized with integer literals V3 : constant Yeison.Any := +("one", "two", "three") with Unreferenced; -- A vector initialized with string literals V4 : constant Yeison.Any := ("one", 2, "three", 4.0); -- A vector made of mixed atoms/literals M4 : constant Yeison.Any := ("one" => A1, "two" => 2, "three" => M3, "four" => V4); -- A map initialized with all kinds of elements V5 : constant Yeison.Any := (A1, 2, M3, V4, "five"); -- A vector initialized with all kinds of elements M5 : constant Yeison.Any := ("one" => 1, "two" => ("two" => 2, "three" => M3), "zri" => +(1, 2, 3)); -- Inline declaration of nested maps/vectors. Unfortunately the qualification is mandatory. V6 : constant Yeison.Any := (1, +(1, 2), ("one" => 1, "two" => M2)); -- A vector with a nested vector/map. Same problem as with maps. X0 : Yeison.Any; X1 : constant Yeison.Any := 1; X2 : constant Yeison.Any := "two"; X3 : constant Yeison.Any := M4; X4 : constant Yeison.Any := V5; -- Storing any kind of value in a variable begin X0 := 1; Put_Line (X0.Image); X0 := "one"; Put_Line (X0.Image); Put_Line (M1.Image); Put_Line (V1.Image); Put_Line (M5.Image); Put_Line (M4 ("one").Image); Put_Line (V6 (1).Image); end Demo_Single;
-- SPDX-License-Identifier: Apache-2.0 -- -- Copyright (c) 2019 onox <denkpadje@gmail.com> -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. with Ada.Containers.Bounded_Vectors; with Ada.Directories; with Ada.IO_Exceptions; package body Inotify.Recursive is function "+" (Value : String) return SU.Unbounded_String renames SU.To_Unbounded_String; function "+" (Value : SU.Unbounded_String) return String renames SU.To_String; package Watch_Vectors is new Ada.Containers.Bounded_Vectors (Positive, Watch); package Move_Vectors is new Ada.Containers.Bounded_Vectors (Positive, Move); overriding function Add_Watch (Object : in out Recursive_Instance; Path : String; Mask : Watch_Bits := All_Events) return Watch is Recursive_Mask : Watch_Bits := Mask; procedure Add_Entry (Next_Entry : Ada.Directories.Directory_Entry_Type) is use all type Ada.Directories.File_Kind; Name : constant String := Ada.Directories.Simple_Name (Next_Entry); begin if Ada.Directories.Kind (Next_Entry) = Directory and Name not in "." | ".." then Object.Add_Watch (Ada.Directories.Compose (Path, Name), Recursive_Mask); end if; exception -- Ignore the folder if the user has no permission to scan it -- or if the file is a symlink when Ada.IO_Exceptions.Use_Error => null; end Add_Entry; begin Recursive_Mask.Created := True; Recursive_Mask.Deleted_Self := True; Recursive_Mask.Moved_From := True; Recursive_Mask.Moved_To := True; Recursive_Mask.Moved_Self := True; -- Do not follow symlinks if Ada.Directories.Full_Name (Path) /= Path then raise Ada.IO_Exceptions.Use_Error; end if; Ada.Directories.Search (Path, "", Process => Add_Entry'Access); return Result : constant Watch := Instance (Object).Add_Watch (Path, Recursive_Mask) do Object.Masks.Insert (Result.Watch, Mask); end return; end Add_Watch; procedure Remove_Children (Object : in out Recursive_Instance; Subject : Watch) is Path : constant String := Object.Watches.Element (Subject.Watch); Watches : Watch_Vectors.Vector (Capacity => Object.Watches.Length); procedure Iterate (Position : Watch_Maps.Cursor) is Other_Path : constant String := Watch_Maps.Element (Position); begin if Other_Path'Length > Path'Length and then Path & '/' = Other_Path (1 .. Path'Length + 1) then Watches.Append ((Watch => Watch_Maps.Key (Position))); end if; end Iterate; begin Object.Watches.Iterate (Iterate'Access); for Element of Watches loop Instance (Object).Remove_Watch (Element); Object.Masks.Delete (Element.Watch); end loop; end Remove_Children; overriding procedure Remove_Watch (Object : in out Recursive_Instance; Subject : Watch) is begin -- Procedure Process_Events might read multiple events for a specific -- watch and the callback for the first event may immediately try to -- remove the watch if Object.Defer_Remove then if not Object.Pending_Removals.Contains (Subject) then Object.Pending_Removals.Append (Subject); end if; return; end if; Object.Remove_Children (Subject); Instance (Object).Remove_Watch (Subject); Object.Masks.Delete (Subject.Watch); end Remove_Watch; overriding procedure Process_Events (Object : in out Recursive_Instance; Handle : not null access procedure (Subject : Watch; Event : Event_Kind; Is_Directory : Boolean; Name : String); Move_Handle : not null access procedure (Subject : Watch; Is_Directory : Boolean; From, To : String)) is Moves : Move_Vectors.Vector (Capacity => Object.Watches.Length); procedure Handle_Event (Subject : Inotify.Watch; Event : Inotify.Event_Kind; Is_Directory : Boolean; Name : String) is Mask : constant Watch_Bits := Object.Masks (Subject.Watch); begin case Event is when Created => if Mask.Created then Handle (Subject, Event, Is_Directory, Name); end if; if Is_Directory then Object.Add_Watch (Name, Mask); end if; when Deleted_Self => if Mask.Deleted_Self then Handle (Subject, Event, Is_Directory, Name); -- TODO Is_Directory is always False even if inode is a directory end if; -- The OS will already have deleted the watch and generated -- an Ignored event, which caused the watch to be deleted from -- Object.Watches in Instance.Process_Events Object.Masks.Delete (Subject.Watch); when Moved_From => if Mask.Moved_From then Handle (Subject, Event, Is_Directory, Name); end if; when Moved_To => if Mask.Moved_To then Handle (Subject, Event, Is_Directory, Name); end if; when Moved_Self => if Mask.Moved_Self then Handle (Subject, Event, Is_Directory, Name); -- TODO Is_Directory is always False even if inode is a directory end if; declare Cursor : Move_Vectors.Cursor := Move_Vectors.No_Element; procedure Process_Move (Position : Move_Vectors.Cursor) is Element : constant Move := Moves (Position); begin if +Element.From = Name then Object.Remove_Watch (Subject); Object.Add_Watch (+Element.To, Mask); Cursor := Position; end if; end Process_Move; use type Move_Vectors.Cursor; begin Moves.Iterate (Process_Move'Access); if Cursor /= Move_Vectors.No_Element then Moves.Delete (Cursor); else Object.Remove_Watch (Subject); -- TODO Delete cookie as well end if; end; when others => Handle (Subject, Event, Is_Directory, Name); end case; end Handle_Event; procedure Handle_Move_Event (Subject : Watch; Is_Directory : Boolean; From, To : String) is begin Move_Handle (Subject, Is_Directory, From, To); if Is_Directory then if From /= "" then Moves.Append ((+From, +To)); else Object.Add_Watch (To, Object.Masks.Element (Subject.Watch)); end if; end if; end Handle_Move_Event; begin Instance (Object).Process_Events (Handle_Event'Access, Handle_Move_Event'Access); end Process_Events; overriding procedure Process_Events (Object : in out Recursive_Instance; Handle : not null access procedure (Subject : Watch; Event : Event_Kind; Is_Directory : Boolean; Name : String)) is procedure Move_Handle (Subject : Watch; Is_Directory : Boolean; From, To : String) is null; begin Object.Process_Events (Handle, Move_Handle'Access); end Process_Events; end Inotify.Recursive;
-- This file was generated automatically: DO NOT MODIFY IT ! with System.IO; use System.IO; with Ada.Unchecked_Conversion; with Ada.Numerics.Generic_Elementary_Functions; with Base_Types; use Base_Types; with TASTE_ExtendedTypes; use TASTE_ExtendedTypes; with TASTE_BasicTypes; use TASTE_BasicTypes; with UserDefs_Base_Types; use UserDefs_Base_Types; with adaasn1rtl; use adaasn1rtl; with Interfaces; use Interfaces; package body logger is type States is (wait); type ctxt_Ty is record state : States; initDone : Boolean := False; v : aliased asn1SccBase_commands_Motion2D; end record; ctxt: aliased ctxt_Ty; CS_Only : constant Integer := 2; procedure runTransition(Id: Integer); procedure log_cmd(cmd_val: access asn1SccBase_commands_Motion2D) is begin case ctxt.state is when wait => ctxt.v := cmd_val.all; runTransition(1); when others => runTransition(CS_Only); end case; end log_cmd; procedure runTransition(Id: Integer) is trId : Integer := Id; begin while (trId /= -1) loop case trId is when 0 => -- NEXT_STATE Wait (11,18) at 320, 60 trId := -1; ctxt.state := Wait; goto next_transition; when 1 => -- writeln('Logging', v!translation, v!rotation, v!heading!rad) (17,17) Put("Logging"); Put(asn1SccT_Double'Image(ctxt.v.translation)); Put(asn1SccT_Double'Image(ctxt.v.rotation)); Put(asn1SccT_Double'Image(ctxt.v.heading.rad)); New_Line; -- NEXT_STATE Wait (19,22) at 552, 175 trId := -1; ctxt.state := Wait; goto next_transition; when CS_Only => trId := -1; goto next_transition; when others => null; end case; <<next_transition>> null; end loop; end runTransition; begin runTransition(0); ctxt.initDone := True; end logger;
with config.applications; package config.tasks with spark_mode => off is procedure zeroify_bss (id : in config.applications.t_real_task_id) with global => (input => (config.applications.list)); procedure copy_data_to_ram (id : in config.applications.t_real_task_id) with global => (input => (config.applications.list)); end config.tasks;
with System.Machine_Code; use System.Machine_Code; with STM32_SVD.Flash; use STM32_SVD.Flash; with STM32_SVD; use STM32_SVD; with System; package body Flash is procedure Init is begin null; end Init; procedure Unlock is begin Flash_Periph.KEYR := 16#4567_0123#; Flash_Periph.KEYR := 16#CDEF_89AB#; end Unlock; procedure Lock is begin Flash_Periph.CR.PER := 0; Flash_Periph.CR.PG := 0; Flash_Periph.CR.LOCK := 1; end Lock; procedure Erase (Addr : Unsigned_32) is begin Flash_Periph.CR.PER := 1; Flash_Periph.AR := UInt32 (Addr); Flash_Periph.CR.STRT := 1; Wait_Until_Ready; Flash_Periph.CR.PER := 0; end Erase; procedure Enable_Write is begin Flash_Periph.CR.PG := 1; end Enable_Write; procedure Write (Addr : Unsigned_32; Value : Unsigned_16) is begin Asm ("strh r1, [r0]", Volatile => True); Wait_Until_Ready; end Write; function Read (Addr : Unsigned_32) return Unsigned_16 is V : Unsigned_16; begin Asm ("ldrh %1, [%0]", Inputs => Unsigned_32'Asm_Input ("r", Addr), Outputs => Unsigned_16'Asm_Output ("=r", V)); return V; end Read; procedure Wait_Until_Ready is begin while Flash_Periph.SR.BSY = 1 loop null; end loop; while Flash_Periph.SR.EOP = 0 loop null; end loop; Flash_Periph.SR.EOP := 1; end Wait_Until_Ready; end Flash;
----------------------------------------------------------------------- -- events.tests -- Unit tests for event channels -- Copyright (C) 2009, 2010, 2011 Stephane Carrez -- Written by Stephane Carrez (Stephane.Carrez@gmail.com) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Ada.Unchecked_Deallocation; with Util.Test_Caller; package body Util.Events.Channels.Tests is use Util.Tests; package Caller is new Util.Test_Caller (Test, "Events.Channels"); procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite) is begin Caller.Add_Test (Suite, "Test Util.Events.Channels.Post_Event", Test_Post_Event'Access); end Add_Tests; procedure Receive_Event (Sub : in out Test; Item : in Event'Class) is pragma Unreferenced (Item); begin Sub.Count := Sub.Count + 1; end Receive_Event; procedure Test_Post_Event (T : in out Test) is procedure Free is new Ada.Unchecked_Deallocation (Object => Channel'Class, Name => Channel_Access); C : Channel_Access := Create ("test", "direct"); E : Event; T1 : aliased Test; T2 : aliased Test; begin C.Post (E); Assert_Equals (T, "test", C.Get_Name, "Invalid channel name"); C.Subscribe (T1'Unchecked_Access); C.Post (E); Assert_Equals (T, 1, T1.Count, "Invalid number of received events"); Assert_Equals (T, 0, T2.Count, "Invalid number of events"); C.Subscribe (T2'Unchecked_Access); C.Post (E); C.Unsubscribe (T1'Unchecked_Access); C.Post (E); Assert_Equals (T, 2, T1.Count, "Invalid number of received events"); Assert_Equals (T, 2, T2.Count, "Invalid number of events"); Free (C); end Test_Post_Event; end Util.Events.Channels.Tests;
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <!DOCTYPE boost_serialization> <boost_serialization signature="serialization::archive" version="15"> <syndb class_id="0" tracking_level="0" version="0"> <userIPLatency>-1</userIPLatency> <userIPName></userIPName> <cdfg class_id="1" tracking_level="1" version="0" object_id="_0"> <name>honeybee</name> <ret_bitwidth>64</ret_bitwidth> <ports class_id="2" tracking_level="0" version="0"> <count>6</count> <item_version>0</item_version> <item class_id="3" tracking_level="1" version="0" object_id="_1"> <Value class_id="4" tracking_level="0" version="0"> <Obj class_id="5" tracking_level="0" version="0"> <type>1</type> <id>1</id> <name>edge_p1_x</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo class_id="6" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>edge_y.p1.x</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <direction>0</direction> <if_type>0</if_type> <array_size>0</array_size> <bit_vecs class_id="7" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_2"> <Value> <Obj> <type>1</type> <id>2</id> <name>edge_p1_y</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>edge_y.p1.z</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <direction>0</direction> <if_type>0</if_type> <array_size>0</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_3"> <Value> <Obj> <type>1</type> <id>3</id> <name>edge_p1_z</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>edge_y.p1.y</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <direction>0</direction> <if_type>0</if_type> <array_size>0</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_4"> <Value> <Obj> <type>1</type> <id>4</id> <name>edge_p2_x</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>edge_y.p2.x</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <direction>0</direction> <if_type>0</if_type> <array_size>0</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_5"> <Value> <Obj> <type>1</type> <id>5</id> <name>edge_p2_y</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>edge_y.p2.z</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <direction>0</direction> <if_type>0</if_type> <array_size>0</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_6"> <Value> <Obj> <type>1</type> <id>6</id> <name>edge_p2_z</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>edge_y.p2.y</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <direction>0</direction> <if_type>0</if_type> <array_size>0</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> </ports> <nodes class_id="8" tracking_level="0" version="0"> <count>12</count> <item_version>0</item_version> <item class_id="9" tracking_level="1" version="0" object_id="_7"> <Value> <Obj> <type>0</type> <id>15</id> <name>edge_p2_z_read</name> <fileName>src/honeybee.c</fileName> <fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory> <lineNumber>159</lineNumber> <contextFuncName>honeybee</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item class_id="10" tracking_level="0" version="0"> <first>/mnt/hgfs/Thesis/HoneyBee</first> <second class_id="11" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="12" tracking_level="0" version="0"> <first class_id="13" tracking_level="0" version="0"> <first>src/honeybee.c</first> <second>honeybee</second> </first> <second>159</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>29</item> <item>30</item> </oprand_edges> <opcode>read</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>1</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_8"> <Value> <Obj> <type>0</type> <id>16</id> <name>edge_p2_y_read</name> <fileName>src/honeybee.c</fileName> <fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory> <lineNumber>159</lineNumber> <contextFuncName>honeybee</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/mnt/hgfs/Thesis/HoneyBee</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>src/honeybee.c</first> <second>honeybee</second> </first> <second>159</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>31</item> <item>32</item> </oprand_edges> <opcode>read</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>2</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_9"> <Value> <Obj> <type>0</type> <id>17</id> <name>edge_p2_x_read</name> <fileName>src/honeybee.c</fileName> <fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory> <lineNumber>159</lineNumber> <contextFuncName>honeybee</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/mnt/hgfs/Thesis/HoneyBee</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>src/honeybee.c</first> <second>honeybee</second> </first> <second>159</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>33</item> <item>34</item> </oprand_edges> <opcode>read</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>3</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_10"> <Value> <Obj> <type>0</type> <id>18</id> <name>edge_p1_z_read</name> <fileName>src/honeybee.c</fileName> <fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory> <lineNumber>159</lineNumber> <contextFuncName>honeybee</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/mnt/hgfs/Thesis/HoneyBee</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>src/honeybee.c</first> <second>honeybee</second> </first> <second>159</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>35</item> <item>36</item> </oprand_edges> <opcode>read</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>4</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_11"> <Value> <Obj> <type>0</type> <id>19</id> <name>edge_p1_y_read</name> <fileName>src/honeybee.c</fileName> <fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory> <lineNumber>159</lineNumber> <contextFuncName>honeybee</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/mnt/hgfs/Thesis/HoneyBee</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>src/honeybee.c</first> <second>honeybee</second> </first> <second>159</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>37</item> <item>38</item> </oprand_edges> <opcode>read</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>5</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_12"> <Value> <Obj> <type>0</type> <id>20</id> <name>edge_p1_x_read</name> <fileName>src/honeybee.c</fileName> <fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory> <lineNumber>159</lineNumber> <contextFuncName>honeybee</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/mnt/hgfs/Thesis/HoneyBee</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>src/honeybee.c</first> <second>honeybee</second> </first> <second>159</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>39</item> <item>40</item> </oprand_edges> <opcode>read</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>6</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_13"> <Value> <Obj> <type>0</type> <id>21</id> <name>collisions_z</name> <fileName>src/honeybee.c</fileName> <fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory> <lineNumber>166</lineNumber> <contextFuncName>honeybee</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/mnt/hgfs/Thesis/HoneyBee</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>src/honeybee.c</first> <second>honeybee</second> </first> <second>166</second> </item> </second> </item> </inlineStackInfo> <originalName>collisions_z</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>64</bitwidth> </Value> <oprand_edges> <count>7</count> <item_version>0</item_version> <item>42</item> <item>43</item> <item>44</item> <item>45</item> <item>46</item> <item>47</item> <item>48</item> </oprand_edges> <opcode>call</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>8.58</m_delay> <m_topoIndex>7</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_14"> <Value> <Obj> <type>0</type> <id>22</id> <name>collisions_y</name> <fileName>src/honeybee.c</fileName> <fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory> <lineNumber>167</lineNumber> <contextFuncName>honeybee</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/mnt/hgfs/Thesis/HoneyBee</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>src/honeybee.c</first> <second>honeybee</second> </first> <second>167</second> </item> </second> </item> </inlineStackInfo> <originalName>collisions_y</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>64</bitwidth> </Value> <oprand_edges> <count>7</count> <item_version>0</item_version> <item>50</item> <item>51</item> <item>52</item> <item>53</item> <item>54</item> <item>55</item> <item>56</item> </oprand_edges> <opcode>call</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>8.58</m_delay> <m_topoIndex>8</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_15"> <Value> <Obj> <type>0</type> <id>23</id> <name>collisions_x</name> <fileName>src/honeybee.c</fileName> <fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory> <lineNumber>168</lineNumber> <contextFuncName>honeybee</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/mnt/hgfs/Thesis/HoneyBee</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>src/honeybee.c</first> <second>honeybee</second> </first> <second>168</second> </item> </second> </item> </inlineStackInfo> <originalName>collisions_x</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>64</bitwidth> </Value> <oprand_edges> <count>7</count> <item_version>0</item_version> <item>58</item> <item>59</item> <item>60</item> <item>61</item> <item>62</item> <item>63</item> <item>64</item> </oprand_edges> <opcode>call</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>8.58</m_delay> <m_topoIndex>9</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_16"> <Value> <Obj> <type>0</type> <id>24</id> <name>or_ln170</name> <fileName>src/honeybee.c</fileName> <fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory> <lineNumber>170</lineNumber> <contextFuncName>honeybee</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/mnt/hgfs/Thesis/HoneyBee</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>src/honeybee.c</first> <second>honeybee</second> </first> <second>170</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>64</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>65</item> <item>66</item> </oprand_edges> <opcode>or</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>10</m_topoIndex> <m_clusterGroupNumber>1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_17"> <Value> <Obj> <type>0</type> <id>25</id> <name>collisions</name> <fileName>src/honeybee.c</fileName> <fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory> <lineNumber>170</lineNumber> <contextFuncName>honeybee</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/mnt/hgfs/Thesis/HoneyBee</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>src/honeybee.c</first> <second>honeybee</second> </first> <second>170</second> </item> </second> </item> </inlineStackInfo> <originalName>collisions</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>64</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>67</item> <item>68</item> </oprand_edges> <opcode>or</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.80</m_delay> <m_topoIndex>11</m_topoIndex> <m_clusterGroupNumber>1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_18"> <Value> <Obj> <type>0</type> <id>26</id> <name>_ln171</name> <fileName>src/honeybee.c</fileName> <fileDirectory>/mnt/hgfs/Thesis/HoneyBee</fileDirectory> <lineNumber>171</lineNumber> <contextFuncName>honeybee</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/mnt/hgfs/Thesis/HoneyBee</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>src/honeybee.c</first> <second>honeybee</second> </first> <second>171</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>69</item> </oprand_edges> <opcode>ret</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>12</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> </nodes> <consts class_id="15" tracking_level="0" version="0"> <count>3</count> <item_version>0</item_version> <item class_id="16" tracking_level="1" version="0" object_id="_19"> <Value> <Obj> <type>2</type> <id>41</id> <name>checkAxis_2</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>64</bitwidth> </Value> <const_type>6</const_type> <content>&lt;constant:checkAxis.2&gt;</content> </item> <item class_id_reference="16" object_id="_20"> <Value> <Obj> <type>2</type> <id>49</id> <name>checkAxis_0</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>64</bitwidth> </Value> <const_type>6</const_type> <content>&lt;constant:checkAxis.0&gt;</content> </item> <item class_id_reference="16" object_id="_21"> <Value> <Obj> <type>2</type> <id>57</id> <name>checkAxis_1</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>64</bitwidth> </Value> <const_type>6</const_type> <content>&lt;constant:checkAxis.1&gt;</content> </item> </consts> <blocks class_id="17" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="18" tracking_level="1" version="0" object_id="_22"> <Obj> <type>3</type> <id>27</id> <name>honeybee</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <node_objs> <count>12</count> <item_version>0</item_version> <item>15</item> <item>16</item> <item>17</item> <item>18</item> <item>19</item> <item>20</item> <item>21</item> <item>22</item> <item>23</item> <item>24</item> <item>25</item> <item>26</item> </node_objs> </item> </blocks> <edges class_id="19" tracking_level="0" version="0"> <count>32</count> <item_version>0</item_version> <item class_id="20" tracking_level="1" version="0" object_id="_23"> <id>30</id> <edge_type>1</edge_type> <source_obj>6</source_obj> <sink_obj>15</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_24"> <id>32</id> <edge_type>1</edge_type> <source_obj>5</source_obj> <sink_obj>16</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_25"> <id>34</id> <edge_type>1</edge_type> <source_obj>4</source_obj> <sink_obj>17</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_26"> <id>36</id> <edge_type>1</edge_type> <source_obj>3</source_obj> <sink_obj>18</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_27"> <id>38</id> <edge_type>1</edge_type> <source_obj>2</source_obj> <sink_obj>19</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_28"> <id>40</id> <edge_type>1</edge_type> <source_obj>1</source_obj> <sink_obj>20</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_29"> <id>42</id> <edge_type>1</edge_type> <source_obj>41</source_obj> <sink_obj>21</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_30"> <id>43</id> <edge_type>1</edge_type> <source_obj>20</source_obj> <sink_obj>21</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_31"> <id>44</id> <edge_type>1</edge_type> <source_obj>19</source_obj> <sink_obj>21</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_32"> <id>45</id> <edge_type>1</edge_type> <source_obj>18</source_obj> <sink_obj>21</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_33"> <id>46</id> <edge_type>1</edge_type> <source_obj>17</source_obj> <sink_obj>21</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_34"> <id>47</id> <edge_type>1</edge_type> <source_obj>16</source_obj> <sink_obj>21</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_35"> <id>48</id> <edge_type>1</edge_type> <source_obj>15</source_obj> <sink_obj>21</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_36"> <id>50</id> <edge_type>1</edge_type> <source_obj>49</source_obj> <sink_obj>22</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_37"> <id>51</id> <edge_type>1</edge_type> <source_obj>20</source_obj> <sink_obj>22</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_38"> <id>52</id> <edge_type>1</edge_type> <source_obj>18</source_obj> <sink_obj>22</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_39"> <id>53</id> <edge_type>1</edge_type> <source_obj>19</source_obj> <sink_obj>22</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_40"> <id>54</id> <edge_type>1</edge_type> <source_obj>17</source_obj> <sink_obj>22</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_41"> <id>55</id> <edge_type>1</edge_type> <source_obj>15</source_obj> <sink_obj>22</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_42"> <id>56</id> <edge_type>1</edge_type> <source_obj>16</source_obj> <sink_obj>22</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_43"> <id>58</id> <edge_type>1</edge_type> <source_obj>57</source_obj> <sink_obj>23</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_44"> <id>59</id> <edge_type>1</edge_type> <source_obj>18</source_obj> <sink_obj>23</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_45"> <id>60</id> <edge_type>1</edge_type> <source_obj>19</source_obj> <sink_obj>23</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_46"> <id>61</id> <edge_type>1</edge_type> <source_obj>20</source_obj> <sink_obj>23</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_47"> <id>62</id> <edge_type>1</edge_type> <source_obj>15</source_obj> <sink_obj>23</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_48"> <id>63</id> <edge_type>1</edge_type> <source_obj>16</source_obj> <sink_obj>23</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_49"> <id>64</id> <edge_type>1</edge_type> <source_obj>17</source_obj> <sink_obj>23</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_50"> <id>65</id> <edge_type>1</edge_type> <source_obj>21</source_obj> <sink_obj>24</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_51"> <id>66</id> <edge_type>1</edge_type> <source_obj>23</source_obj> <sink_obj>24</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_52"> <id>67</id> <edge_type>1</edge_type> <source_obj>24</source_obj> <sink_obj>25</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_53"> <id>68</id> <edge_type>1</edge_type> <source_obj>22</source_obj> <sink_obj>25</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_54"> <id>69</id> <edge_type>1</edge_type> <source_obj>25</source_obj> <sink_obj>26</sink_obj> <is_back_edge>0</is_back_edge> </item> </edges> </cdfg> <cdfg_regions class_id="21" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="22" tracking_level="1" version="0" object_id="_55"> <mId>1</mId> <mTag>honeybee</mTag> <mType>0</mType> <sub_regions> <count>0</count> <item_version>0</item_version> </sub_regions> <basic_blocks> <count>1</count> <item_version>0</item_version> <item>27</item> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>-1</mMinTripCount> <mMaxTripCount>-1</mMaxTripCount> <mMinLatency>53</mMinLatency> <mMaxLatency>53</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"></mDfPipe> </item> </cdfg_regions> <fsm class_id="24" tracking_level="1" version="0" object_id="_56"> <states class_id="25" tracking_level="0" version="0"> <count>54</count> <item_version>0</item_version> <item class_id="26" tracking_level="1" version="0" object_id="_57"> <id>1</id> <operations class_id="27" tracking_level="0" version="0"> <count>9</count> <item_version>0</item_version> <item class_id="28" tracking_level="1" version="0" object_id="_58"> <id>15</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_59"> <id>16</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_60"> <id>17</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_61"> <id>18</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_62"> <id>19</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_63"> <id>20</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_64"> <id>21</id> <stage>53</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_65"> <id>22</id> <stage>53</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_66"> <id>23</id> <stage>53</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_67"> <id>2</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_68"> <id>21</id> <stage>52</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_69"> <id>22</id> <stage>52</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_70"> <id>23</id> <stage>52</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_71"> <id>3</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_72"> <id>21</id> <stage>51</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_73"> <id>22</id> <stage>51</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_74"> <id>23</id> <stage>51</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_75"> <id>4</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_76"> <id>21</id> <stage>50</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_77"> <id>22</id> <stage>50</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_78"> <id>23</id> <stage>50</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_79"> <id>5</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_80"> <id>21</id> <stage>49</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_81"> <id>22</id> <stage>49</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_82"> <id>23</id> <stage>49</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_83"> <id>6</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_84"> <id>21</id> <stage>48</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_85"> <id>22</id> <stage>48</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_86"> <id>23</id> <stage>48</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_87"> <id>7</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_88"> <id>21</id> <stage>47</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_89"> <id>22</id> <stage>47</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_90"> <id>23</id> <stage>47</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_91"> <id>8</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_92"> <id>21</id> <stage>46</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_93"> <id>22</id> <stage>46</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_94"> <id>23</id> <stage>46</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_95"> <id>9</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_96"> <id>21</id> <stage>45</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_97"> <id>22</id> <stage>45</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_98"> <id>23</id> <stage>45</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_99"> <id>10</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_100"> <id>21</id> <stage>44</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_101"> <id>22</id> <stage>44</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_102"> <id>23</id> <stage>44</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_103"> <id>11</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_104"> <id>21</id> <stage>43</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_105"> <id>22</id> <stage>43</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_106"> <id>23</id> <stage>43</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_107"> <id>12</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_108"> <id>21</id> <stage>42</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_109"> <id>22</id> <stage>42</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_110"> <id>23</id> <stage>42</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_111"> <id>13</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_112"> <id>21</id> <stage>41</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_113"> <id>22</id> <stage>41</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_114"> <id>23</id> <stage>41</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_115"> <id>14</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_116"> <id>21</id> <stage>40</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_117"> <id>22</id> <stage>40</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_118"> <id>23</id> <stage>40</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_119"> <id>15</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_120"> <id>21</id> <stage>39</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_121"> <id>22</id> <stage>39</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_122"> <id>23</id> <stage>39</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_123"> <id>16</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_124"> <id>21</id> <stage>38</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_125"> <id>22</id> <stage>38</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_126"> <id>23</id> <stage>38</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_127"> <id>17</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_128"> <id>21</id> <stage>37</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_129"> <id>22</id> <stage>37</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_130"> <id>23</id> <stage>37</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_131"> <id>18</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_132"> <id>21</id> <stage>36</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_133"> <id>22</id> <stage>36</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_134"> <id>23</id> <stage>36</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_135"> <id>19</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_136"> <id>21</id> <stage>35</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_137"> <id>22</id> <stage>35</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_138"> <id>23</id> <stage>35</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_139"> <id>20</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_140"> <id>21</id> <stage>34</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_141"> <id>22</id> <stage>34</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_142"> <id>23</id> <stage>34</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_143"> <id>21</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_144"> <id>21</id> <stage>33</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_145"> <id>22</id> <stage>33</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_146"> <id>23</id> <stage>33</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_147"> <id>22</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_148"> <id>21</id> <stage>32</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_149"> <id>22</id> <stage>32</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_150"> <id>23</id> <stage>32</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_151"> <id>23</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_152"> <id>21</id> <stage>31</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_153"> <id>22</id> <stage>31</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_154"> <id>23</id> <stage>31</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_155"> <id>24</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_156"> <id>21</id> <stage>30</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_157"> <id>22</id> <stage>30</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_158"> <id>23</id> <stage>30</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_159"> <id>25</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_160"> <id>21</id> <stage>29</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_161"> <id>22</id> <stage>29</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_162"> <id>23</id> <stage>29</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_163"> <id>26</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_164"> <id>21</id> <stage>28</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_165"> <id>22</id> <stage>28</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_166"> <id>23</id> <stage>28</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_167"> <id>27</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_168"> <id>21</id> <stage>27</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_169"> <id>22</id> <stage>27</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_170"> <id>23</id> <stage>27</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_171"> <id>28</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_172"> <id>21</id> <stage>26</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_173"> <id>22</id> <stage>26</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_174"> <id>23</id> <stage>26</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_175"> <id>29</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_176"> <id>21</id> <stage>25</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_177"> <id>22</id> <stage>25</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_178"> <id>23</id> <stage>25</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_179"> <id>30</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_180"> <id>21</id> <stage>24</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_181"> <id>22</id> <stage>24</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_182"> <id>23</id> <stage>24</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_183"> <id>31</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_184"> <id>21</id> <stage>23</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_185"> <id>22</id> <stage>23</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_186"> <id>23</id> <stage>23</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_187"> <id>32</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_188"> <id>21</id> <stage>22</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_189"> <id>22</id> <stage>22</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_190"> <id>23</id> <stage>22</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_191"> <id>33</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_192"> <id>21</id> <stage>21</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_193"> <id>22</id> <stage>21</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_194"> <id>23</id> <stage>21</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_195"> <id>34</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_196"> <id>21</id> <stage>20</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_197"> <id>22</id> <stage>20</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_198"> <id>23</id> <stage>20</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_199"> <id>35</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_200"> <id>21</id> <stage>19</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_201"> <id>22</id> <stage>19</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_202"> <id>23</id> <stage>19</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_203"> <id>36</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_204"> <id>21</id> <stage>18</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_205"> <id>22</id> <stage>18</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_206"> <id>23</id> <stage>18</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_207"> <id>37</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_208"> <id>21</id> <stage>17</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_209"> <id>22</id> <stage>17</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_210"> <id>23</id> <stage>17</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_211"> <id>38</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_212"> <id>21</id> <stage>16</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_213"> <id>22</id> <stage>16</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_214"> <id>23</id> <stage>16</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_215"> <id>39</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_216"> <id>21</id> <stage>15</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_217"> <id>22</id> <stage>15</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_218"> <id>23</id> <stage>15</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_219"> <id>40</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_220"> <id>21</id> <stage>14</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_221"> <id>22</id> <stage>14</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_222"> <id>23</id> <stage>14</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_223"> <id>41</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_224"> <id>21</id> <stage>13</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_225"> <id>22</id> <stage>13</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_226"> <id>23</id> <stage>13</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_227"> <id>42</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_228"> <id>21</id> <stage>12</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_229"> <id>22</id> <stage>12</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_230"> <id>23</id> <stage>12</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_231"> <id>43</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_232"> <id>21</id> <stage>11</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_233"> <id>22</id> <stage>11</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_234"> <id>23</id> <stage>11</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_235"> <id>44</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_236"> <id>21</id> <stage>10</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_237"> <id>22</id> <stage>10</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_238"> <id>23</id> <stage>10</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_239"> <id>45</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_240"> <id>21</id> <stage>9</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_241"> <id>22</id> <stage>9</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_242"> <id>23</id> <stage>9</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_243"> <id>46</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_244"> <id>21</id> <stage>8</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_245"> <id>22</id> <stage>8</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_246"> <id>23</id> <stage>8</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_247"> <id>47</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_248"> <id>21</id> <stage>7</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_249"> <id>22</id> <stage>7</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_250"> <id>23</id> <stage>7</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_251"> <id>48</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_252"> <id>21</id> <stage>6</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_253"> <id>22</id> <stage>6</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_254"> <id>23</id> <stage>6</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_255"> <id>49</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_256"> <id>21</id> <stage>5</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_257"> <id>22</id> <stage>5</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_258"> <id>23</id> <stage>5</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_259"> <id>50</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_260"> <id>21</id> <stage>4</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_261"> <id>22</id> <stage>4</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_262"> <id>23</id> <stage>4</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_263"> <id>51</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_264"> <id>21</id> <stage>3</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_265"> <id>22</id> <stage>3</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_266"> <id>23</id> <stage>3</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_267"> <id>52</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_268"> <id>21</id> <stage>2</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_269"> <id>22</id> <stage>2</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_270"> <id>23</id> <stage>2</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_271"> <id>53</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_272"> <id>21</id> <stage>1</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_273"> <id>22</id> <stage>1</stage> <latency>53</latency> </item> <item class_id_reference="28" object_id="_274"> <id>23</id> <stage>1</stage> <latency>53</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_275"> <id>54</id> <operations> <count>11</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_276"> <id>7</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_277"> <id>8</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_278"> <id>9</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_279"> <id>10</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_280"> <id>11</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_281"> <id>12</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_282"> <id>13</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_283"> <id>14</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_284"> <id>24</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_285"> <id>25</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_286"> <id>26</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> </states> <transitions class_id="29" tracking_level="0" version="0"> <count>53</count> <item_version>0</item_version> <item class_id="30" tracking_level="1" version="0" object_id="_287"> <inState>1</inState> <outState>2</outState> <condition class_id="31" tracking_level="0" version="0"> <id>-1</id> <sop class_id="32" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="33" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_288"> <inState>2</inState> <outState>3</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_289"> <inState>3</inState> <outState>4</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_290"> <inState>4</inState> <outState>5</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_291"> <inState>5</inState> <outState>6</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_292"> <inState>6</inState> <outState>7</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_293"> <inState>7</inState> <outState>8</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_294"> <inState>8</inState> <outState>9</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_295"> <inState>9</inState> <outState>10</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_296"> <inState>10</inState> <outState>11</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_297"> <inState>11</inState> <outState>12</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_298"> <inState>12</inState> <outState>13</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_299"> <inState>13</inState> <outState>14</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_300"> <inState>14</inState> <outState>15</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_301"> <inState>15</inState> <outState>16</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_302"> <inState>16</inState> <outState>17</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_303"> <inState>17</inState> <outState>18</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_304"> <inState>18</inState> <outState>19</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_305"> <inState>19</inState> <outState>20</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_306"> <inState>20</inState> <outState>21</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_307"> <inState>21</inState> <outState>22</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_308"> <inState>22</inState> <outState>23</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_309"> <inState>23</inState> <outState>24</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_310"> <inState>24</inState> <outState>25</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_311"> <inState>25</inState> <outState>26</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_312"> <inState>26</inState> <outState>27</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_313"> <inState>27</inState> <outState>28</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_314"> <inState>28</inState> <outState>29</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_315"> <inState>29</inState> <outState>30</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_316"> <inState>30</inState> <outState>31</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_317"> <inState>31</inState> <outState>32</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_318"> <inState>32</inState> <outState>33</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_319"> <inState>33</inState> <outState>34</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_320"> <inState>34</inState> <outState>35</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_321"> <inState>35</inState> <outState>36</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_322"> <inState>36</inState> <outState>37</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_323"> <inState>37</inState> <outState>38</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_324"> <inState>38</inState> <outState>39</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_325"> <inState>39</inState> <outState>40</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_326"> <inState>40</inState> <outState>41</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_327"> <inState>41</inState> <outState>42</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_328"> <inState>42</inState> <outState>43</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_329"> <inState>43</inState> <outState>44</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_330"> <inState>44</inState> <outState>45</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_331"> <inState>45</inState> <outState>46</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_332"> <inState>46</inState> <outState>47</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_333"> <inState>47</inState> <outState>48</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_334"> <inState>48</inState> <outState>49</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_335"> <inState>49</inState> <outState>50</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_336"> <inState>50</inState> <outState>51</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_337"> <inState>51</inState> <outState>52</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_338"> <inState>52</inState> <outState>53</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_339"> <inState>53</inState> <outState>54</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> </transitions> </fsm> <res class_id="-1"></res> <node_label_latency class_id="35" tracking_level="0" version="0"> <count>12</count> <item_version>0</item_version> <item class_id="36" tracking_level="0" version="0"> <first>15</first> <second class_id="37" tracking_level="0" version="0"> <first>0</first> <second>0</second> </second> </item> <item> <first>16</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>17</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>18</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>19</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>20</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>21</first> <second> <first>0</first> <second>52</second> </second> </item> <item> <first>22</first> <second> <first>0</first> <second>52</second> </second> </item> <item> <first>23</first> <second> <first>0</first> <second>52</second> </second> </item> <item> <first>24</first> <second> <first>53</first> <second>0</second> </second> </item> <item> <first>25</first> <second> <first>53</first> <second>0</second> </second> </item> <item> <first>26</first> <second> <first>53</first> <second>0</second> </second> </item> </node_label_latency> <bblk_ent_exit class_id="38" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="39" tracking_level="0" version="0"> <first>27</first> <second class_id="40" tracking_level="0" version="0"> <first>0</first> <second>53</second> </second> </item> </bblk_ent_exit> <regions class_id="41" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </regions> <dp_fu_nodes class_id="42" tracking_level="0" version="0"> <count>11</count> <item_version>0</item_version> <item class_id="43" tracking_level="0" version="0"> <first>28</first> <second> <count>1</count> <item_version>0</item_version> <item>15</item> </second> </item> <item> <first>34</first> <second> <count>1</count> <item_version>0</item_version> <item>16</item> </second> </item> <item> <first>40</first> <second> <count>1</count> <item_version>0</item_version> <item>17</item> </second> </item> <item> <first>46</first> <second> <count>1</count> <item_version>0</item_version> <item>18</item> </second> </item> <item> <first>52</first> <second> <count>1</count> <item_version>0</item_version> <item>19</item> </second> </item> <item> <first>58</first> <second> <count>1</count> <item_version>0</item_version> <item>20</item> </second> </item> <item> <first>64</first> <second> <count>53</count> <item_version>0</item_version> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> </second> </item> <item> <first>80</first> <second> <count>53</count> <item_version>0</item_version> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> </second> </item> <item> <first>96</first> <second> <count>53</count> <item_version>0</item_version> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> </second> </item> <item> <first>112</first> <second> <count>1</count> <item_version>0</item_version> <item>24</item> </second> </item> <item> <first>116</first> <second> <count>1</count> <item_version>0</item_version> <item>25</item> </second> </item> </dp_fu_nodes> <dp_fu_nodes_expression class_id="45" tracking_level="0" version="0"> <count>2</count> <item_version>0</item_version> <item class_id="46" tracking_level="0" version="0"> <first>collisions_fu_116</first> <second> <count>1</count> <item_version>0</item_version> <item>25</item> </second> </item> <item> <first>or_ln170_fu_112</first> <second> <count>1</count> <item_version>0</item_version> <item>24</item> </second> </item> </dp_fu_nodes_expression> <dp_fu_nodes_module> <count>3</count> <item_version>0</item_version> <item> <first>grp_checkAxis_0_fu_96</first> <second> <count>53</count> <item_version>0</item_version> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> <item>22</item> </second> </item> <item> <first>grp_checkAxis_1_fu_80</first> <second> <count>53</count> <item_version>0</item_version> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> <item>23</item> </second> </item> <item> <first>grp_checkAxis_2_fu_64</first> <second> <count>53</count> <item_version>0</item_version> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> <item>21</item> </second> </item> </dp_fu_nodes_module> <dp_fu_nodes_io> <count>6</count> <item_version>0</item_version> <item> <first>edge_p1_x_read_read_fu_58</first> <second> <count>1</count> <item_version>0</item_version> <item>20</item> </second> </item> <item> <first>edge_p1_y_read_read_fu_52</first> <second> <count>1</count> <item_version>0</item_version> <item>19</item> </second> </item> <item> <first>edge_p1_z_read_read_fu_46</first> <second> <count>1</count> <item_version>0</item_version> <item>18</item> </second> </item> <item> <first>edge_p2_x_read_read_fu_40</first> <second> <count>1</count> <item_version>0</item_version> <item>17</item> </second> </item> <item> <first>edge_p2_y_read_read_fu_34</first> <second> <count>1</count> <item_version>0</item_version> <item>16</item> </second> </item> <item> <first>edge_p2_z_read_read_fu_28</first> <second> <count>1</count> <item_version>0</item_version> <item>15</item> </second> </item> </dp_fu_nodes_io> <return_ports> <count>0</count> <item_version>0</item_version> </return_ports> <dp_mem_port_nodes class_id="47" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </dp_mem_port_nodes> <dp_reg_nodes> <count>9</count> <item_version>0</item_version> <item> <first>121</first> <second> <count>1</count> <item_version>0</item_version> <item>15</item> </second> </item> <item> <first>128</first> <second> <count>1</count> <item_version>0</item_version> <item>16</item> </second> </item> <item> <first>135</first> <second> <count>1</count> <item_version>0</item_version> <item>17</item> </second> </item> <item> <first>142</first> <second> <count>1</count> <item_version>0</item_version> <item>18</item> </second> </item> <item> <first>149</first> <second> <count>1</count> <item_version>0</item_version> <item>19</item> </second> </item> <item> <first>156</first> <second> <count>1</count> <item_version>0</item_version> <item>20</item> </second> </item> <item> <first>163</first> <second> <count>1</count> <item_version>0</item_version> <item>21</item> </second> </item> <item> <first>168</first> <second> <count>1</count> <item_version>0</item_version> <item>22</item> </second> </item> <item> <first>173</first> <second> <count>1</count> <item_version>0</item_version> <item>23</item> </second> </item> </dp_reg_nodes> <dp_regname_nodes> <count>9</count> <item_version>0</item_version> <item> <first>collisions_x_reg_173</first> <second> <count>1</count> <item_version>0</item_version> <item>23</item> </second> </item> <item> <first>collisions_y_reg_168</first> <second> <count>1</count> <item_version>0</item_version> <item>22</item> </second> </item> <item> <first>collisions_z_reg_163</first> <second> <count>1</count> <item_version>0</item_version> <item>21</item> </second> </item> <item> <first>edge_p1_x_read_reg_156</first> <second> <count>1</count> <item_version>0</item_version> <item>20</item> </second> </item> <item> <first>edge_p1_y_read_reg_149</first> <second> <count>1</count> <item_version>0</item_version> <item>19</item> </second> </item> <item> <first>edge_p1_z_read_reg_142</first> <second> <count>1</count> <item_version>0</item_version> <item>18</item> </second> </item> <item> <first>edge_p2_x_read_reg_135</first> <second> <count>1</count> <item_version>0</item_version> <item>17</item> </second> </item> <item> <first>edge_p2_y_read_reg_128</first> <second> <count>1</count> <item_version>0</item_version> <item>16</item> </second> </item> <item> <first>edge_p2_z_read_reg_121</first> <second> <count>1</count> <item_version>0</item_version> <item>15</item> </second> </item> </dp_regname_nodes> <dp_reg_phi> <count>0</count> <item_version>0</item_version> </dp_reg_phi> <dp_regname_phi> <count>0</count> <item_version>0</item_version> </dp_regname_phi> <dp_port_io_nodes class_id="48" tracking_level="0" version="0"> <count>6</count> <item_version>0</item_version> <item class_id="49" tracking_level="0" version="0"> <first>edge_p1_x</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>read</first> <second> <count>1</count> <item_version>0</item_version> <item>20</item> </second> </item> </second> </item> <item> <first>edge_p1_y</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>read</first> <second> <count>1</count> <item_version>0</item_version> <item>19</item> </second> </item> </second> </item> <item> <first>edge_p1_z</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>read</first> <second> <count>1</count> <item_version>0</item_version> <item>18</item> </second> </item> </second> </item> <item> <first>edge_p2_x</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>read</first> <second> <count>1</count> <item_version>0</item_version> <item>17</item> </second> </item> </second> </item> <item> <first>edge_p2_y</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>read</first> <second> <count>1</count> <item_version>0</item_version> <item>16</item> </second> </item> </second> </item> <item> <first>edge_p2_z</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>read</first> <second> <count>1</count> <item_version>0</item_version> <item>15</item> </second> </item> </second> </item> </dp_port_io_nodes> <port2core class_id="50" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </port2core> <node2core> <count>0</count> <item_version>0</item_version> </node2core> </syndb> </boost_serialization>
package Swaps is procedure Swap (Value_1 : in out Integer; Value_2 : in out Integer); end Swaps;
with avtas.lmcp.object; use avtas.lmcp.object; with avtas.lmcp.types; use avtas.lmcp.types; with afrl.cmasi.enumerations; use afrl.cmasi.enumerations; package afrl.cmasi.object is type Object is abstract new avtas.lmcp.object.Object with private; type Object_Acc is access all Object; type Object_Class_Acc is access all Object'Class; function getSeriesVersion(this : Object) return UInt16_t is (3); function getSeriesName(this : Object) return String is ("CMASI"); function getSeriesNameAsLong(this : Object) return Int64_t is (4849604199710720000); private type Object is new avtas.lmcp.object.Object with null record; end afrl.cmasi.object;
------------------------------------------------------------------------------- -- Copyright 2021, The Trendy Terminal Developers (see AUTHORS file) -- 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. ------------------------------------------------------------------------------- -- Trendy Terminal defines a known environment in which to perform input/output. -- Failure to meet these requirements results in an failed initialization. -- -- The requirements: -- 1. UTF-8 -- 2. VT100 terminal escape sequences. -- -- The base package provides platform-specific environment setup, and the basic -- read/write commands on top of which to build functionality. package Trendy_Terminal is end Trendy_Terminal;
-- { dg-do compile } procedure loop_bound is package P is type Base is new Integer; Limit : constant Base := 10; type Index is private; generic package Gen is end; private type Index is new Base range 0 .. Limit; end P; package body P is package body Gen is type Table is array (Index) of Integer; procedure Init (X : in out Table) is begin for I in 1..Index'last -1 loop X (I) := -1; end loop; end Init; end Gen; end P; package Inst is new P.Gen; begin null; end;
-- -- -- package Copyright (c) Dmitry A. Kazakov -- -- Generic_Unbounded_Ptr_Array Luebeck -- -- Interface Spring, 2002 -- -- -- -- Last revision : 21:24 10 Nov 2009 -- -- -- -- This library is free software; you can redistribute it and/or -- -- modify it under the terms of the GNU General Public License as -- -- published by the Free Software Foundation; either version 2 of -- -- the License, or (at your option) any later version. This library -- -- is distributed in the hope that it will be useful, but WITHOUT -- -- ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- General Public License for more details. You should have -- -- received a copy of the GNU General Public License along with -- -- this library; if not, write to the Free Software Foundation, -- -- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- this unit, or you link this unit with other files to produce an -- -- executable, this unit does not by itself cause the resulting -- -- executable to be covered by the GNU General Public License. This -- -- exception does not however invalidate any other reasons why the -- -- executable file might be covered by the GNU Public License. -- --____________________________________________________________________-- -- -- This package defines a generic type Unbounded_Ptr_Array. An instance -- of Unbounded_Ptr_Array is a dynamically expanded vector of pointers -- to elements. Upon destruction objects pointed by array elements are -- destroyed. Same happens when an element is replaced. Thus once -- pointer to an allocated object is put into an array, its is no more -- the user responsibility to care on its destruction. A consequence of -- this is that pointers to statically or stack-allocated objects -- cannot be put there. The package has the following generic -- parameters: -- -- Index_Type - The array index type -- Object_Type - The object type -- Object_Ptr_Type - The object pointer type -- Object_Ptr_Array_Type - The array of pointers type -- Minimal_Size - Minimal additionally allocated size -- Increment - By which the vector is enlarged -- with Generic_Unbounded_Array; generic type Index_Type is (<>); type Object_Type (<>) is limited private; type Object_Ptr_Type is access Object_Type; type Object_Ptr_Array_Type is array (Index_Type range <>) of Object_Ptr_Type; Minimal_Size : Positive := 64; Increment : Natural := 50; package Generic_Unbounded_Ptr_Array is package Object_Ptr_Array is new Generic_Unbounded_Array ( Index_Type, Object_Ptr_Type, Object_Ptr_Array_Type, null, Minimal_Size, Increment ); type Unbounded_Ptr_Array is new Object_Ptr_Array.Unbounded_Array with null record; -- -- Erase -- Delete all array items -- -- Container - The array -- -- This procedure makes Container empty. -- procedure Erase (Container : in out Unbounded_Ptr_Array); -- -- Finalize -- Destructor -- -- Container - The array -- procedure Finalize (Container : in out Unbounded_Ptr_Array); -- -- Get -- Get an array element by its index -- -- Container - The array -- Index - Of the element -- -- This an equivalent to Container.Vector (Index). However it does not -- fail if no vector allocated or index is not in the vector range. It -- returns null instead. -- -- Returns : -- -- The element or null if none -- function Get ( Container : Unbounded_Ptr_Array; Index : Index_Type ) return Object_Ptr_Type; -- -- Put -- Replace an array element by its index -- -- Container - The array -- Index - Of the element -- Element - Pointer to the new element -- -- The array is expanded as necessary. If the replaced array element is -- not null then the object it points is destroyed. Note that the object -- pointed by Element is not copied. Thus it is not a responsibility of -- the caller to destroy the object. It will be automatically destroyed -- upon array destruction or replacing the element in the array. -- procedure Put ( Container : in out Unbounded_Ptr_Array; Index : Index_Type; Element : Object_Ptr_Type ); private pragma Inline (Get); end Generic_Unbounded_Ptr_Array;
----------------------------------------------------------------------- -- helios-monitor-agent -- Helios monitor agent -- Copyright (C) 2017, 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 Helios.Monitor.CPU; with Helios.Monitor.Ifnet; with Helios.Monitor.Disks; with Helios.Monitor.Sysfile; package body Helios.Monitor.Agent is function Get_Agent (Name : in String; Config : in Util.Properties.Manager) return Agent_Type_Access; Cpu_Mon : aliased Helios.Monitor.CPU.Agent_Type; Ifnet_Mon : aliased Helios.Monitor.Ifnet.Agent_Type; Disk_Mon : aliased Helios.Monitor.Disks.Agent_Type; -- ------------------------------ -- Get the monitoring agent given its name and configuration. -- ------------------------------ function Get_Agent (Name : in String; Config : in Util.Properties.Manager) return Agent_Type_Access is begin if Name = "ifnet" then return Ifnet_Mon'Access; elsif Name = "cpu" then return Cpu_Mon'Access; elsif Name = "disks" then return Disk_Mon'Access; end if; if Config.Get ("plugin", "") = "sysfile" then return new Helios.Monitor.Sysfile.Agent_Type; else return null; end if; end Get_Agent; -- ------------------------------ -- Configure the agent plugins. -- ------------------------------ procedure Configure (Runtime : in out Runtime_Type; Config : in Util.Properties.Manager) is use type Ada.Real_Time.Time_Span; procedure Process (Name : in String; Value : in Util.Properties.Value); procedure Configure (Name : in String; Config : in Util.Properties.Manager); procedure Build_Queue (Agent : in out Agent_Type'Class); procedure Start_Timer (Agent : in out Agent_Type'Class); procedure Configure (Name : in String; Config : in Util.Properties.Manager) is Agent : constant Agent_Type_Access := Get_Agent (Name, Config); begin if Agent /= null then Register (Agent, Name, Config); end if; end Configure; -- Identify monitor plugins and configure them. procedure Process (Name : in String; Value : in Util.Properties.Value) is begin if Util.Properties.Is_Manager (Value) then Configure (Name, Util.Properties.To_Manager (Value)); end if; end Process; procedure Build_Queue (Agent : in out Agent_Type'Class) is Count : constant Natural := 1 + (Runtime.Report_Period / Agent.Period); begin Helios.Datas.Initialize (Agent.Data, Agent.Node, Count); end Build_Queue; Start_Delay : Ada.Real_Time.Time_Span := Ada.Real_Time.Milliseconds (100); Spread_Delay : constant Ada.Real_Time.Time_Span := Ada.Real_Time.Microseconds (100); procedure Start_Timer (Agent : in out Agent_Type'Class) is Timer : Util.Events.Timers.Timer_Ref; begin Runtime.Timers.Set_Timer (Agent'Unchecked_Access, Timer, Start_Delay); Start_Delay := Start_Delay + Spread_Delay; end Start_Timer; begin Config.Iterate (Process'Access); Iterate (Build_Queue'Access); Iterate (Start_Timer'Access); end Configure; -- ------------------------------ -- Run the monitoring agent main loop. -- ------------------------------ procedure Run (Runtime : in out Runtime_Type) is use Ada.Real_Time; Deadline : Ada.Real_Time.Time; Stop_Time : constant Ada.Real_Time.Time := Ada.Real_Time.Clock + Ada.Real_Time.Seconds (300); begin while not Runtime.Stop loop Runtime.Timers.Process (Deadline); delay until Deadline; exit when Stop_Time < Ada.Real_Time.Clock; end loop; end Run; end Helios.Monitor.Agent;
pragma License (Unrestricted); with Ada.Numerics.Generic_Complex_Elementary_Functions; with Ada.Numerics.Long_Long_Complex_Types; package Ada.Numerics.Long_Long_Complex_Elementary_Functions is new Generic_Complex_Elementary_Functions (Long_Long_Complex_Types); pragma Pure (Ada.Numerics.Long_Long_Complex_Elementary_Functions);
-- -- -- package Copyright (c) Dmitry A. Kazakov -- -- Parsers.Generic_Source.XPM Luebeck -- -- Implementation Summer, 2006 -- -- -- -- Last revision : 19:53 12 Jan 2008 -- -- -- -- This library is free software; you can redistribute it and/or -- -- modify it under the terms of the GNU General Public License as -- -- published by the Free Software Foundation; either version 2 of -- -- the License, or (at your option) any later version. This library -- -- is distributed in the hope that it will be useful, but WITHOUT -- -- ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- General Public License for more details. You should have -- -- received a copy of the GNU General Public License along with -- -- this library; if not, write to the Free Software Foundation, -- -- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- this unit, or you link this unit with other files to produce an -- -- executable, this unit does not by itself cause the resulting -- -- executable to be covered by the GNU General Public License. This -- -- exception does not however invalidate any other reasons why the -- -- executable file might be covered by the GNU Public License. -- --____________________________________________________________________-- -- -- This generic package is an XPM parser. It can be instantiated for -- any type of sources, but usually it makes sense for multi-line -- sources only. The package provides three subprograms for parsing XPM -- files. An XPM file is a C program containing an XPM image. A source -- containing such image is usually parsed this way: -- -- Header : Descriptor := Get (Source); -- Map : Color_Tables.Table := Get (Source, Header); -- Image : Pixel_Buffer := Get (Source, Header, Map); -- with Tables; with Parsers.Generic_Source.Get_Cpp_Blank; with Parsers.Generic_Source.Get_Text; with Parsers.Generic_Source.Keywords; generic package Parsers.Generic_Source.XPM is -- -- Descriptor -- Of an XPM file -- -- The descriptor contains the information about an XPM image. -- -- Name - The name of the image, as found in the file -- Width - In pixels -- Height - In pixels -- Pixel_Size - Number of characters per pixel used in the file -- Map_Size - Number of colors in the colormap -- Extended - Has XPMEXT part -- X_Hotspot - Hostspot co-ordinate 0.. -- Y_Hotspot - Hostspot co-ordinate 0.. -- type Descriptor ( Has_Hotspot : Boolean; Length : Positive ) is record Name : String (1..Length); Width : Positive; Height : Positive; Pixel_Size : Positive; Map_Size : Positive; Extended : Boolean; case Has_Hotspot is when True => X_Hotspot : Natural; Y_Hotspot : Natural; when False => null; end case; end record; -- -- RGB_Color -- The type of a pixel -- -- The values are encoded as RGB, big endian. For example, Red is -- 16#FF0000#. The value 2**24 is used for the transparent color. -- type RGB_Color is range 0..2**24; Transparent : constant RGB_Color := RGB_Color'Last; -- -- Color_Tables -- Colormaps -- -- The type Color_Table.Table is a mapping String->RGB_Color. -- package Color_Tables is new Tables (RGB_Color); -- -- Pixel_Buffer -- Image in Row x Column format -- type Pixel_Buffer is array (Positive range <>, Positive range <>) of RGB_Color; -- -- Get -- Descriptor from source -- -- Code - The source to parse -- -- Returns : -- -- The image descriptor -- -- Exceptions : -- -- Syntax_Error - Syntax error during parsing -- othes - Source related exception -- function Get (Code : access Source_Type) return Descriptor; -- -- Get -- Colormap from source -- -- Code - The source to parse -- Header - Parsed before -- -- Returns : -- -- The image colormap -- -- Exceptions : -- -- Syntax_Error - Syntax error during parsing -- othes - Source related exception -- function Get ( Code : access Source_Type; Header : Descriptor ) return Color_Tables.Table; -- -- Get -- Image from source -- -- Code - The source to parse -- Header - The image descriptor parsed before -- Map - The image colormap parsed before -- -- Returns : -- -- The image -- -- Exceptions : -- -- Syntax_Error - Syntax error during parsing -- othes - Source related exception -- function Get ( Code : access Source_Type; Header : Descriptor; Map : Color_Tables.Table ) return Pixel_Buffer; private type Color_Type is (m, s, g4, g, c); package Color_Types is new Keywords (Color_Type); type Color_Name is (none, white, black, red, green, blue); package Color_Names is new Keywords (Color_Name); procedure Skip is new Parsers.Generic_Source.Get_Cpp_Blank; procedure Get is new Parsers.Generic_Source.Get_Text; end Parsers.Generic_Source.XPM;
package MSPGD.Clock is pragma Preelaborate; type Source_Type is (ACLK, MCLK, SMCLK); type Input_Type is (DCO, VLO, LFXT1, XT2); end MSPGD.Clock;
-- Institution: Technische Universität München -- Department: Realtime Computer Systems (RCS) -- Project: StratoX -- -- Authors: Emanuel Regnath (emanuel.regnath@tum.de) -- -- Description: Driver for the HMC5883L with Interfaces; use Interfaces; package HMC5883L.Driver with SPARK_Mode, Abstract_State => State, Initializes => State is procedure initialize; function testConnection return Boolean; -- CONFIG_A register function getSampleAveraging return Unsigned_8; procedure setSampleAveraging(averaging : Unsigned_8); procedure getDataRate(rate : out Unsigned_8); procedure setDataRate(rate : Unsigned_8); procedure getMeasurementBias(bias : out Unsigned_8); procedure setMeasurementBias(bias : Unsigned_8); -- CONFIG_B register procedure getGain(gain : out Unsigned_8); procedure setGain(gain : Unsigned_8); -- MODE register procedure getMode(mode : out Unsigned_8); procedure setMode(newMode : Unsigned_8); -- DATA* registers procedure getHeading(x : out Integer_16; y : out Integer_16; z : out Integer_16); procedure getHeadingX(x : out Integer_16); procedure getHeadingY(y : out Integer_16); procedure getHeadingZ(z : out Integer_16); -- STATUS register function getLockStatus return Boolean; function getReadyStatus return Boolean; -- ID* registers function getIDA return Unsigned_8; function getIDB return Unsigned_8; function getIDC return Unsigned_8; private type Buffer_Type is array( 1 .. 6 ) of Unsigned_8; buffer : Buffer_Type with Part_Of => State; -- TODO: not initialized. VC also fails. mode : Unsigned_8 with Part_Of => State; -- TODO: not initialized. end HMC5883L.Driver;
------------------------------------------------------------------------------ -- C O D E P E E R / S P A R K -- -- -- -- Copyright (C) 2015-2020, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. This software is distributed in the hope that it will be useful, -- -- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- -- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- -- License for more details. You should have received a copy of the GNU -- -- General Public License distributed with this software; see file -- -- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- -- of the license. -- -- -- ------------------------------------------------------------------------------ pragma Ada_2012; with Ada.Containers; use Ada.Containers; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; package SA_Messages is -- This package can be used for reading/writing a file containing a -- sequence of static anaysis results. Each element can describe a runtime -- check whose outcome has been statically determined, or it might be a -- warning or diagnostic message. It is expected that typically CodePeer -- will do the writing and SPARK will do the reading; this will allow SPARK -- to get the benefit of CodePeer's analysis. -- -- Each item is represented as a pair consisting of a message and an -- associated source location. Source locations may refer to a location -- within the expansion of an instance of a generic; this is represented -- by combining the corresponding location within the generic with the -- location of the instance (repeated if the instance itself occurs within -- a generic). In addition, the type Iteration_Id is intended for use in -- distinguishing messages which refer to a specific iteration of a loop -- (this case can arise, for example, if CodePeer chooses to unroll a -- for-loop). This data structure is only general enough to support the -- kinds of unrolling that are currently planned for CodePeer. For -- example, an Iteration_Id can only identify an iteration of the nearest -- enclosing loop of the associated File/Line/Column source location. -- This is not a problem because CodePeer doesn't unroll loops which -- contain other loops. type Message_Kind is ( -- Check kinds Array_Index_Check, Divide_By_Zero_Check, Tag_Check, Discriminant_Check, Range_Check, Overflow_Check, Assertion_Check, -- Warning kinds Suspicious_Range_Precondition_Warning, Suspicious_First_Precondition_Warning, Suspicious_Input_Warning, Suspicious_Constant_Operation_Warning, Unread_In_Out_Parameter_Warning, Unassigned_In_Out_Parameter_Warning, Non_Analyzed_Call_Warning, Procedure_Does_Not_Return_Warning, Check_Fails_On_Every_Call_Warning, Unknown_Call_Warning, Dead_Store_Warning, Dead_Outparam_Store_Warning, Potentially_Dead_Store_Warning, Same_Value_Dead_Store_Warning, Dead_Block_Warning, Infinite_Loop_Warning, Dead_Edge_Warning, Plain_Dead_Edge_Warning, True_Dead_Edge_Warning, False_Dead_Edge_Warning, True_Condition_Dead_Edge_Warning, False_Condition_Dead_Edge_Warning, Unrepeatable_While_Loop_Warning, Dead_Block_Continuation_Warning, Local_Lock_Of_Global_Object_Warning, Analyzed_Module_Warning, Non_Analyzed_Module_Warning, Non_Analyzed_Procedure_Warning, Incompletely_Analyzed_Procedure_Warning); -- Assertion_Check includes checks for user-defined PPCs (both specific -- and class-wide), Assert pragma checks, subtype predicate checks, -- type invariant checks (specific and class-wide), and checks for -- implementation-defined assertions such as Assert_And_Cut, Assume, -- Contract_Cases, Default_Initial_Condition, Initial_Condition, -- Loop_Invariant, Loop_Variant, and Refined_Post. -- -- TBD: it might be nice to distinguish these different kinds of assertions -- as is done in SPARK's VC_Kind enumeration type, but any distinction -- which isn't already present in CP's BE_Message_Subkind enumeration type -- would require more work on the CP side. -- -- The warning kinds are pretty much a copy of the set of -- Be_Message_Subkind values for which CP's Is_Warning predicate returns -- True; see descriptive comment for each in CP's message_kinds.ads . subtype Check_Kind is Message_Kind range Array_Index_Check .. Assertion_Check; subtype Warning_Kind is Message_Kind range Message_Kind'Succ (Check_Kind'Last) .. Message_Kind'Last; -- Possible outcomes of the static analysis of a runtime check -- -- Not_Statically_Known_With_Low_Severity could be used instead of of -- Not_Statically_Known if there is some reason to believe that (although -- the tool couldn't prove it) the check is likely to always pass (in CP -- terms, if the corresponding CP message has severity Low as opposed to -- Medium). It's not clear yet whether SPARK will care about this -- distinction. type SA_Check_Result is (Statically_Known_Success, Not_Statically_Known_With_Low_Severity, Not_Statically_Known, Statically_Known_Failure); type SA_Message (Kind : Message_Kind := Message_Kind'Last) is record case Kind is when Check_Kind => Check_Result : SA_Check_Result; when Warning_Kind => null; end case; end record; type Source_Location_Or_Null (<>) is private; Null_Location : constant Source_Location_Or_Null; subtype Source_Location is Source_Location_Or_Null with Dynamic_Predicate => Source_Location /= Null_Location; type Line_Number is new Positive; type Column_Number is new Positive; function File_Name (Location : Source_Location) return String; function File_Name (Location : Source_Location) return Unbounded_String; function Line (Location : Source_Location) return Line_Number; function Column (Location : Source_Location) return Column_Number; type Iteration_Kind is (None, Initial, Subsequent, Numbered); -- None is for the usual no-unrolling case. -- Initial and Subsequent are for use in the case where only the first -- iteration of a loop (or some part thereof, such as the termination -- test of a while-loop) is unrolled. -- Numbered is for use in the case where a for-loop with a statically -- known number of iterations is fully unrolled. subtype Iteration_Number is Integer range 1 .. 255; subtype Iteration_Total is Integer range 2 .. 255; type Iteration_Id (Kind : Iteration_Kind := None) is record case Kind is when Numbered => Number : Iteration_Number; Of_Total : Iteration_Total; when others => null; end case; end record; function Iteration (Location : Source_Location) return Iteration_Id; function Enclosing_Instance (Location : Source_Location) return Source_Location_Or_Null; -- For a source location occurring within the expansion of an instance of a -- generic unit, the Line, Column, and File_Name selectors will indicate a -- location within the generic; the Enclosing_Instance selector yields the -- location of the declaration of the instance. function Make (File_Name : String; Line : Line_Number; Column : Column_Number; Iteration : Iteration_Id; Enclosing_Instance : Source_Location_Or_Null) return Source_Location; -- Constructor type Message_And_Location (<>) is private; function Location (Item : Message_And_Location) return Source_Location; function Message (Item : Message_And_Location) return SA_Message; function Make_Msg_Loc (Msg : SA_Message; Loc : Source_Location) return Message_And_Location; -- Selectors function "<" (Left, Right : Message_And_Location) return Boolean; function Hash (Key : Message_And_Location) return Hash_Type; -- Actuals for container instances File_Extension : constant String; -- ".json" (but could change in future) -- Clients may wish to use File_Extension in constructing -- File_Name parameters for calls to Open. package Writing is function Is_Open return Boolean; procedure Open (File_Name : String) with Precondition => not Is_Open, Postcondition => Is_Open; -- Behaves like Text_IO.Create with respect to error cases procedure Write (Message : SA_Message; Location : Source_Location); procedure Close with Precondition => Is_Open, Postcondition => not Is_Open; -- Behaves like Text_IO.Close with respect to error cases end Writing; package Reading is function Is_Open return Boolean; procedure Open (File_Name : String; Full_Path : Boolean := True) with Precondition => not Is_Open, Postcondition => Is_Open; -- Behaves like Text_IO.Open with respect to error cases function Done return Boolean with Precondition => Is_Open; function Get return Message_And_Location with Precondition => not Done; procedure Close with Precondition => Is_Open, Postcondition => not Is_Open; -- Behaves like Text_IO.Close with respect to error cases end Reading; private type Simple_Source_Location is record File_Name : Unbounded_String := Null_Unbounded_String; Line : Line_Number := Line_Number'Last; Column : Column_Number := Column_Number'Last; Iteration : Iteration_Id := (Kind => None); end record; type Source_Locations is array (Natural range <>) of Simple_Source_Location; type Source_Location_Or_Null (Count : Natural) is record Locations : Source_Locations (1 .. Count); end record; Null_Location : constant Source_Location_Or_Null := (Count => 0, Locations => (others => <>)); type Message_And_Location (Count : Positive) is record Message : SA_Message; Location : Source_Location (Count => Count); end record; File_Extension : constant String := ".json"; end SA_Messages;
pragma License (Unrestricted); -- implementation unit required by compiler with System.Unsigned_Types; package System.Val_Uns is pragma Pure; -- required for Modular'Value by compiler (s-valuns.ads) function Value_Unsigned (Str : String) return Unsigned_Types.Unsigned; end System.Val_Uns;
-- SPDX-FileCopyrightText: 2019 Max Reznik <reznikmm@gmail.com> -- -- SPDX-License-Identifier: MIT ------------------------------------------------------------- with Program.Elements; package Program.Nodes is pragma Preelaborate; type Node is abstract limited new Program.Elements.Element with private; private type Node is abstract limited new Program.Elements.Element with record Enclosing_Element : Program.Elements.Element_Access; end record; procedure Set_Enclosing_Element (Self : access Program.Elements.Element'Class; Value : access Program.Elements.Element'Class); overriding function Enclosing_Element (Self : Node) return Program.Elements.Element_Access; overriding function Is_Part_Of_Implicit (Self : Node) return Boolean; overriding function Is_Part_Of_Inherited (Self : Node) return Boolean; overriding function Is_Part_Of_Instance (Self : Node) return Boolean; overriding function Is_Pragma (Self : Node) return Boolean; overriding function Is_Defining_Name (Self : Node) return Boolean; overriding function Is_Defining_Identifier (Self : Node) return Boolean; overriding function Is_Defining_Character_Literal (Self : Node) return Boolean; overriding function Is_Defining_Operator_Symbol (Self : Node) return Boolean; overriding function Is_Defining_Expanded_Name (Self : Node) return Boolean; overriding function Is_Declaration (Self : Node) return Boolean; overriding function Is_Type_Declaration (Self : Node) return Boolean; overriding function Is_Task_Type_Declaration (Self : Node) return Boolean; overriding function Is_Protected_Type_Declaration (Self : Node) return Boolean; overriding function Is_Subtype_Declaration (Self : Node) return Boolean; overriding function Is_Object_Declaration (Self : Node) return Boolean; overriding function Is_Single_Task_Declaration (Self : Node) return Boolean; overriding function Is_Single_Protected_Declaration (Self : Node) return Boolean; overriding function Is_Number_Declaration (Self : Node) return Boolean; overriding function Is_Enumeration_Literal_Specification (Self : Node) return Boolean; overriding function Is_Discriminant_Specification (Self : Node) return Boolean; overriding function Is_Component_Declaration (Self : Node) return Boolean; overriding function Is_Loop_Parameter_Specification (Self : Node) return Boolean; overriding function Is_Generalized_Iterator_Specification (Self : Node) return Boolean; overriding function Is_Element_Iterator_Specification (Self : Node) return Boolean; overriding function Is_Procedure_Declaration (Self : Node) return Boolean; overriding function Is_Function_Declaration (Self : Node) return Boolean; overriding function Is_Parameter_Specification (Self : Node) return Boolean; overriding function Is_Procedure_Body_Declaration (Self : Node) return Boolean; overriding function Is_Function_Body_Declaration (Self : Node) return Boolean; overriding function Is_Return_Object_Specification (Self : Node) return Boolean; overriding function Is_Package_Declaration (Self : Node) return Boolean; overriding function Is_Package_Body_Declaration (Self : Node) return Boolean; overriding function Is_Object_Renaming_Declaration (Self : Node) return Boolean; overriding function Is_Exception_Renaming_Declaration (Self : Node) return Boolean; overriding function Is_Procedure_Renaming_Declaration (Self : Node) return Boolean; overriding function Is_Function_Renaming_Declaration (Self : Node) return Boolean; overriding function Is_Package_Renaming_Declaration (Self : Node) return Boolean; overriding function Is_Generic_Package_Renaming_Declaration (Self : Node) return Boolean; overriding function Is_Generic_Procedure_Renaming_Declaration (Self : Node) return Boolean; overriding function Is_Generic_Function_Renaming_Declaration (Self : Node) return Boolean; overriding function Is_Task_Body_Declaration (Self : Node) return Boolean; overriding function Is_Protected_Body_Declaration (Self : Node) return Boolean; overriding function Is_Entry_Declaration (Self : Node) return Boolean; overriding function Is_Entry_Body_Declaration (Self : Node) return Boolean; overriding function Is_Entry_Index_Specification (Self : Node) return Boolean; overriding function Is_Procedure_Body_Stub (Self : Node) return Boolean; overriding function Is_Function_Body_Stub (Self : Node) return Boolean; overriding function Is_Package_Body_Stub (Self : Node) return Boolean; overriding function Is_Task_Body_Stub (Self : Node) return Boolean; overriding function Is_Protected_Body_Stub (Self : Node) return Boolean; overriding function Is_Exception_Declaration (Self : Node) return Boolean; overriding function Is_Choice_Parameter_Specification (Self : Node) return Boolean; overriding function Is_Generic_Package_Declaration (Self : Node) return Boolean; overriding function Is_Generic_Procedure_Declaration (Self : Node) return Boolean; overriding function Is_Generic_Function_Declaration (Self : Node) return Boolean; overriding function Is_Package_Instantiation (Self : Node) return Boolean; overriding function Is_Procedure_Instantiation (Self : Node) return Boolean; overriding function Is_Function_Instantiation (Self : Node) return Boolean; overriding function Is_Formal_Object_Declaration (Self : Node) return Boolean; overriding function Is_Formal_Type_Declaration (Self : Node) return Boolean; overriding function Is_Formal_Procedure_Declaration (Self : Node) return Boolean; overriding function Is_Formal_Function_Declaration (Self : Node) return Boolean; overriding function Is_Formal_Package_Declaration (Self : Node) return Boolean; overriding function Is_Definition (Self : Node) return Boolean; overriding function Is_Type_Definition (Self : Node) return Boolean; overriding function Is_Subtype_Indication (Self : Node) return Boolean; overriding function Is_Constraint (Self : Node) return Boolean; overriding function Is_Component_Definition (Self : Node) return Boolean; overriding function Is_Discrete_Range (Self : Node) return Boolean; overriding function Is_Discrete_Subtype_Indication (Self : Node) return Boolean; overriding function Is_Discrete_Range_Attribute_Reference (Self : Node) return Boolean; overriding function Is_Discrete_Simple_Expression_Range (Self : Node) return Boolean; overriding function Is_Unknown_Discriminant_Part (Self : Node) return Boolean; overriding function Is_Known_Discriminant_Part (Self : Node) return Boolean; overriding function Is_Record_Definition (Self : Node) return Boolean; overriding function Is_Null_Component (Self : Node) return Boolean; overriding function Is_Variant_Part (Self : Node) return Boolean; overriding function Is_Variant (Self : Node) return Boolean; overriding function Is_Others_Choice (Self : Node) return Boolean; overriding function Is_Anonymous_Access_Definition (Self : Node) return Boolean; overriding function Is_Anonymous_Access_To_Object (Self : Node) return Boolean; overriding function Is_Anonymous_Access_To_Procedure (Self : Node) return Boolean; overriding function Is_Anonymous_Access_To_Function (Self : Node) return Boolean; overriding function Is_Private_Type_Definition (Self : Node) return Boolean; overriding function Is_Private_Extension_Definition (Self : Node) return Boolean; overriding function Is_Incomplete_Type_Definition (Self : Node) return Boolean; overriding function Is_Task_Definition (Self : Node) return Boolean; overriding function Is_Protected_Definition (Self : Node) return Boolean; overriding function Is_Formal_Type_Definition (Self : Node) return Boolean; overriding function Is_Aspect_Specification (Self : Node) return Boolean; overriding function Is_Real_Range_Specification (Self : Node) return Boolean; overriding function Is_Expression (Self : Node) return Boolean; overriding function Is_Numeric_Literal (Self : Node) return Boolean; overriding function Is_String_Literal (Self : Node) return Boolean; overriding function Is_Identifier (Self : Node) return Boolean; overriding function Is_Operator_Symbol (Self : Node) return Boolean; overriding function Is_Character_Literal (Self : Node) return Boolean; overriding function Is_Explicit_Dereference (Self : Node) return Boolean; overriding function Is_Function_Call (Self : Node) return Boolean; overriding function Is_Infix_Operator (Self : Node) return Boolean; overriding function Is_Indexed_Component (Self : Node) return Boolean; overriding function Is_Slice (Self : Node) return Boolean; overriding function Is_Selected_Component (Self : Node) return Boolean; overriding function Is_Attribute_Reference (Self : Node) return Boolean; overriding function Is_Record_Aggregate (Self : Node) return Boolean; overriding function Is_Extension_Aggregate (Self : Node) return Boolean; overriding function Is_Array_Aggregate (Self : Node) return Boolean; overriding function Is_Short_Circuit_Operation (Self : Node) return Boolean; overriding function Is_Membership_Test (Self : Node) return Boolean; overriding function Is_Null_Literal (Self : Node) return Boolean; overriding function Is_Parenthesized_Expression (Self : Node) return Boolean; overriding function Is_Raise_Expression (Self : Node) return Boolean; overriding function Is_Type_Conversion (Self : Node) return Boolean; overriding function Is_Qualified_Expression (Self : Node) return Boolean; overriding function Is_Allocator (Self : Node) return Boolean; overriding function Is_Case_Expression (Self : Node) return Boolean; overriding function Is_If_Expression (Self : Node) return Boolean; overriding function Is_Quantified_Expression (Self : Node) return Boolean; overriding function Is_Association (Self : Node) return Boolean; overriding function Is_Discriminant_Association (Self : Node) return Boolean; overriding function Is_Record_Component_Association (Self : Node) return Boolean; overriding function Is_Array_Component_Association (Self : Node) return Boolean; overriding function Is_Parameter_Association (Self : Node) return Boolean; overriding function Is_Formal_Package_Association (Self : Node) return Boolean; overriding function Is_Statement (Self : Node) return Boolean; overriding function Is_Null_Statement (Self : Node) return Boolean; overriding function Is_Assignment_Statement (Self : Node) return Boolean; overriding function Is_If_Statement (Self : Node) return Boolean; overriding function Is_Case_Statement (Self : Node) return Boolean; overriding function Is_Loop_Statement (Self : Node) return Boolean; overriding function Is_While_Loop_Statement (Self : Node) return Boolean; overriding function Is_For_Loop_Statement (Self : Node) return Boolean; overriding function Is_Block_Statement (Self : Node) return Boolean; overriding function Is_Exit_Statement (Self : Node) return Boolean; overriding function Is_Goto_Statement (Self : Node) return Boolean; overriding function Is_Call_Statement (Self : Node) return Boolean; overriding function Is_Simple_Return_Statement (Self : Node) return Boolean; overriding function Is_Extended_Return_Statement (Self : Node) return Boolean; overriding function Is_Accept_Statement (Self : Node) return Boolean; overriding function Is_Requeue_Statement (Self : Node) return Boolean; overriding function Is_Delay_Statement (Self : Node) return Boolean; overriding function Is_Terminate_Alternative_Statement (Self : Node) return Boolean; overriding function Is_Select_Statement (Self : Node) return Boolean; overriding function Is_Abort_Statement (Self : Node) return Boolean; overriding function Is_Raise_Statement (Self : Node) return Boolean; overriding function Is_Code_Statement (Self : Node) return Boolean; overriding function Is_Path (Self : Node) return Boolean; overriding function Is_Elsif_Path (Self : Node) return Boolean; overriding function Is_Case_Path (Self : Node) return Boolean; overriding function Is_Select_Path (Self : Node) return Boolean; overriding function Is_Case_Expression_Path (Self : Node) return Boolean; overriding function Is_Elsif_Expression_Path (Self : Node) return Boolean; overriding function Is_Clause (Self : Node) return Boolean; overriding function Is_Use_Clause (Self : Node) return Boolean; overriding function Is_With_Clause (Self : Node) return Boolean; overriding function Is_Representation_Clause (Self : Node) return Boolean; overriding function Is_Component_Clause (Self : Node) return Boolean; overriding function Is_Derived_Type (Self : Node) return Boolean; overriding function Is_Derived_Record_Extension (Self : Node) return Boolean; overriding function Is_Enumeration_Type (Self : Node) return Boolean; overriding function Is_Signed_Integer_Type (Self : Node) return Boolean; overriding function Is_Modular_Type (Self : Node) return Boolean; overriding function Is_Root_Type (Self : Node) return Boolean; overriding function Is_Floating_Point_Type (Self : Node) return Boolean; overriding function Is_Ordinary_Fixed_Point_Type (Self : Node) return Boolean; overriding function Is_Decimal_Fixed_Point_Type (Self : Node) return Boolean; overriding function Is_Unconstrained_Array_Type (Self : Node) return Boolean; overriding function Is_Constrained_Array_Type (Self : Node) return Boolean; overriding function Is_Record_Type (Self : Node) return Boolean; overriding function Is_Interface_Type (Self : Node) return Boolean; overriding function Is_Object_Access_Type (Self : Node) return Boolean; overriding function Is_Procedure_Access_Type (Self : Node) return Boolean; overriding function Is_Function_Access_Type (Self : Node) return Boolean; overriding function Is_Formal_Private_Type_Definition (Self : Node) return Boolean; overriding function Is_Formal_Derived_Type_Definition (Self : Node) return Boolean; overriding function Is_Formal_Discrete_Type_Definition (Self : Node) return Boolean; overriding function Is_Formal_Signed_Integer_Type_Definition (Self : Node) return Boolean; overriding function Is_Formal_Modular_Type_Definition (Self : Node) return Boolean; overriding function Is_Formal_Floating_Point_Definition (Self : Node) return Boolean; overriding function Is_Formal_Ordinary_Fixed_Point_Definition (Self : Node) return Boolean; overriding function Is_Formal_Decimal_Fixed_Point_Definition (Self : Node) return Boolean; overriding function Is_Formal_Unconstrained_Array_Type (Self : Node) return Boolean; overriding function Is_Formal_Constrained_Array_Type (Self : Node) return Boolean; overriding function Is_Formal_Access_Type (Self : Node) return Boolean; overriding function Is_Formal_Object_Access_Type (Self : Node) return Boolean; overriding function Is_Formal_Procedure_Access_Type (Self : Node) return Boolean; overriding function Is_Formal_Function_Access_Type (Self : Node) return Boolean; overriding function Is_Formal_Interface_Type (Self : Node) return Boolean; overriding function Is_Access_Type (Self : Node) return Boolean; overriding function Is_Range_Attribute_Reference (Self : Node) return Boolean; overriding function Is_Simple_Expression_Range (Self : Node) return Boolean; overriding function Is_Digits_Constraint (Self : Node) return Boolean; overriding function Is_Delta_Constraint (Self : Node) return Boolean; overriding function Is_Index_Constraint (Self : Node) return Boolean; overriding function Is_Discriminant_Constraint (Self : Node) return Boolean; overriding function Is_Attribute_Definition_Clause (Self : Node) return Boolean; overriding function Is_Enumeration_Representation_Clause (Self : Node) return Boolean; overriding function Is_Record_Representation_Clause (Self : Node) return Boolean; overriding function Is_At_Clause (Self : Node) return Boolean; overriding function Is_Exception_Handler (Self : Node) return Boolean; end Program.Nodes;
with Lv.Style; with Lv.Area; with Lv.Objx.Cont; package Lv.Objx.Page is subtype Instance is Obj_T; -- Scrollbar modes: shows when should the scrollbars be visible type Mode_T is (Sb_Mode_Off, -- Never show scrollbars Sb_Mode_On, -- Always show scrollbars Sb_Mode_Drag, -- Show scrollbars when page is being dragged Sb_Mode_Auto, -- Show scrollbars when the scrollable container is large enough to be scrolled Sb_Mode_Hide, -- Hide the scroll bar temporally Sb_Mode_Unhide); -- Unhide the previously hidden scrollbar. Recover it's type too type Style_T is (Style_Bg, Style_Scrl, Style_Sb); -- Create a page objects -- @param par pointer to an object, it will be the parent of the new page -- @param copy pointer to a page object, if not NULL then the new object will be copied from it -- @return pointer to the created page function Create (Par : Obj_T; Copy : Instance) return Instance; -- Delete all children of the scrl object, without deleting scrl child. -- @param self pointer to an object procedure Clean (Self : Instance); -- Get the press action of the page -- @param self pointer to a page object -- @return a function to call when the page is pressed function Pr_Action (Self : Instance) return Action_Func_T; -- Get the release action of the page -- @param self pointer to a page object -- @return a function to call when the page is released function Rel_Action (Self : Instance) return Action_Func_T; -- Get the scrollable object of a page -- @param self pointer to a page object -- @return pointer to a container which is the scrollable part of the page function Scrl (Arg1 : Instance) return Obj_T; ---------------------- -- Setter functions -- ---------------------- -- Set a release action for the page -- @param self pointer to a page object -- @param rel_action a function to call when the page is released procedure Set_Rel_Action (Self : Instance; Rel_Action : Action_Func_T); -- Set a press action for the page -- @param self pointer to a page object -- @param pr_action a function to call when the page is pressed procedure Set_Pr_Action (Self : Instance; Pr_Action : Action_Func_T); -- Set the scroll bar mode on a page -- @param self pointer to a page object -- @param sb_mode the new mode from 'lv_page_sb.mode_t' enum procedure Set_Sb_Mode (Self : Instance; Sb_Mode : Mode_T); -- Enable/Disable scrolling with arrows if the page is in group (arrows: LV_GROUP_KEY_LEFT/RIGHT/UP/DOWN) -- @param self pointer to a page object -- @param en true: enable scrolling with arrows procedure Set_Arrow_Scroll (Self : Instance; En : U_Bool); -- Set the fit attribute of the scrollable part of a page. -- It means it can set its size automatically to involve all children. -- (Can be set separately horizontally and vertically) -- @param self pointer to a page object -- @param hor_en true: enable horizontal fit -- @param ver_en true: enable vertical fit procedure Set_Scrl_Fit (Self : Instance; Hor_En : U_Bool; Ver_En : U_Bool); -- Set width of the scrollable part of a page -- @param self pointer to a page object -- @param w the new width of the scrollable (it ha no effect is horizontal fit is enabled) procedure Set_Scrl_Width (Self : Instance; W : Lv.Area.Coord_T); -- Set height of the scrollable part of a page -- @param self pointer to a page object -- @param h the new height of the scrollable (it ha no effect is vertical fit is enabled) procedure Set_Scrl_Height (Self : Instance; H : Lv.Area.Coord_T); -- Set the layout of the scrollable part of the page -- @param self pointer to a page object -- @param layout a layout from 'lv_cont_layout_t' procedure Set_Scrl_Layout (Self : Instance; Layout : Lv.Objx.Cont.Layout_T); -- Set a style of a page -- @param self pointer to a page object -- @param type which style should be set -- @param style pointer to a style procedure Set_Style (Self : Instance; Typ : Style_T; Style : Lv.Style.Style); ---------------------- -- Getter functions -- ---------------------- -- Set the scroll bar mode on a page -- @param self pointer to a page object -- @return the mode from 'lv_page_sb.mode_t' enum function Sb_Mode (Self : Instance) return Mode_T; -- Get the the scrolling with arrows (LV_GROUP_KEY_LEFT/RIGHT/UP/DOWN) is enabled or not -- @param self pointer to a page object -- @return true: scrolling with arrows is enabled function Arrow_Scroll (Self : Instance) return U_Bool; -- Get that width which can be set to the children to still not cause overflow (show scrollbars) -- @param self pointer to a page object -- @return the width which still fits into the page function Fit_Width (Self : Instance) return Lv.Area.Coord_T; -- Get that height which can be set to the children to still not cause overflow (show scrollbars) -- @param self pointer to a page object -- @return the height which still fits into the page function Fit_Height (Self : Instance) return Lv.Area.Coord_T; -- Get width of the scrollable part of a page -- @param self pointer to a page object -- @return the width of the scrollable function Scrl_Width (Self : Instance) return Lv.Area.Coord_T; -- Get height of the scrollable part of a page -- @param self pointer to a page object -- @return the height of the scrollable function Scrl_Height (Self : Instance) return Lv.Area.Coord_T; -- Get the layout of the scrollable part of a page -- @param self pointer to page object -- @return the layout from 'lv_cont_layout_t' function Scrl_Layout (Self : Instance) return Lv.Objx.Cont.Layout_T; -- Get horizontal fit attribute of the scrollable part of a page -- @param self pointer to a page object -- @return true: horizontal fit is enabled; false: disabled function Scrl_Hor_Fit (Self : Instance) return U_Bool; -- Get vertical fit attribute of the scrollable part of a page -- @param self pointer to a page object -- @return true: vertical fit is enabled; false: disabled function Scrl_Fit_Ver (Self : Instance) return U_Bool; -- Get a style of a page -- @param self pointer to page object -- @param type which style should be get -- @return style pointer to a style function Style (Self : Instance; Type_P : Style_T) return Lv.Style.Style; --------------------- -- Other functions -- --------------------- -- Glue the object to the page. After it the page can be moved (dragged) with this object too. -- @param obj pointer to an object on a page -- @param glue true: enable glue, false: disable glue procedure Glue_Obj (Self : Obj_T; Glue : U_Bool); -- Focus on an object. It ensures that the object will be visible on the page. -- @param self pointer to a page object -- @param obj pointer to an object to focus (must be on the page) -- @param anim_time scroll animation time in milliseconds (0: no animation) procedure Focus (Self : Instance; Ob : Obj_T; Anim_Time : Uint16_T); -- Scroll the page horizontally -- @param self pointer to a page object -- @param dist the distance to scroll (< 0: scroll left; > 0 scroll right) procedure Scroll_Hor (Self : Instance; Dist : Lv.Area.Coord_T); -- Scroll the page vertically -- @param self pointer to a page object -- @param dist the distance to scroll (< 0: scroll down; > 0 scroll up) procedure Scroll_Ver (Self : Instance; Dist : Lv.Area.Coord_T); ------------- -- Imports -- ------------- pragma Import (C, Create, "lv_page_create"); pragma Import (C, Clean, "lv_page_clean"); pragma Import (C, Pr_Action, "lv_page_get_pr_action"); pragma Import (C, Rel_Action, "lv_page_get_rel_action"); pragma Import (C, Scrl, "lv_page_get_scrl"); pragma Import (C, Set_Rel_Action, "lv_page_set_rel_action"); pragma Import (C, Set_Pr_Action, "lv_page_set_pr_action"); pragma Import (C, Set_Sb_Mode, "lv_page_set_sb_mode"); pragma Import (C, Set_Arrow_Scroll, "lv_page_set_arrow_scroll"); pragma Import (C, Set_Scrl_Fit, "lv_page_set_scrl_fit_inline"); pragma Import (C, Set_Scrl_Width, "lv_page_set_scrl_width_inline"); pragma Import (C, Set_Scrl_Height, "lv_page_set_scrl_height_inline"); pragma Import (C, Set_Scrl_Layout, "lv_page_set_scrl_layout_inline"); pragma Import (C, Set_Style, "lv_page_set_style"); pragma Import (C, Sb_Mode, "lv_page_get_sb_mode"); pragma Import (C, Arrow_Scroll, "lv_page_get_arrow_scroll"); pragma Import (C, Fit_Width, "lv_page_get_fit_width"); pragma Import (C, Fit_Height, "lv_page_get_fit_height"); pragma Import (C, Scrl_Width, "lv_page_get_scrl_width_inline"); pragma Import (C, Scrl_Height, "lv_page_get_scrl_height_inline"); pragma Import (C, Scrl_Layout, "lv_page_get_scrl_layout_inline"); pragma Import (C, Scrl_Hor_Fit, "lv_page_get_scrl_hor_fit_inline"); pragma Import (C, Scrl_Fit_Ver, "lv_page_get_scrl_fit_ver_inline"); pragma Import (C, Style, "lv_page_get_style"); pragma Import (C, Glue_Obj, "lv_page_glue_obj"); pragma Import (C, Focus, "lv_page_focus"); pragma Import (C, Scroll_Hor, "lv_page_scroll_hor"); pragma Import (C, Scroll_Ver, "lv_page_scroll_ver"); for Mode_T'Size use 8; for Mode_T use (Sb_Mode_Off => 0, Sb_Mode_On => 1, Sb_Mode_Drag => 2, Sb_Mode_Auto => 3, Sb_Mode_Hide => 4, Sb_Mode_Unhide => 5); for Style_T'Size use 8; for Style_T use (Style_Bg => 0, Style_Scrl => 1, Style_Sb => 2); end Lv.Objx.Page;
with Ada.Text_IO, Ada.Strings.Fixed; use Ada.Text_IO, Ada.Strings, Ada.Strings.Fixed; function "+" (S : String) return String is Item : constant Character := S (S'First); begin for Index in S'First + 1..S'Last loop if Item /= S (Index) then return Trim (Integer'Image (Index - S'First), Both) & Item & (+(S (Index..S'Last))); end if; end loop; return Trim (Integer'Image (S'Length), Both) & Item; end "+";
package ItsyBitsy_UART_Interrupt_Handlers is UART0_Data_Received : Boolean := False; private procedure UART0_IRQ_Handler with Export => True, Convention => C, External_Name => "isr_irq20"; end ItsyBitsy_UART_Interrupt_Handlers;
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.SDHC is pragma Preelaborate; --------------- -- Registers -- --------------- subtype SDHC_BSR_BLOCKSIZE_Field is HAL.UInt10; -- SDMA Buffer Boundary type BSR_BOUNDARYSelect is (-- 4k bytes Val_4K, -- 8k bytes Val_8K, -- 16k bytes Val_16K, -- 32k bytes Val_32K, -- 64k bytes Val_64K, -- 128k bytes Val_128K, -- 256k bytes Val_256K, -- 512k bytes Val_512K) with Size => 3; for BSR_BOUNDARYSelect use (Val_4K => 0, Val_8K => 1, Val_16K => 2, Val_32K => 3, Val_64K => 4, Val_128K => 5, Val_256K => 6, Val_512K => 7); -- Block Size type SDHC_BSR_Register is record -- Transfer Block Size BLOCKSIZE : SDHC_BSR_BLOCKSIZE_Field := 16#0#; -- unspecified Reserved_10_11 : HAL.UInt2 := 16#0#; -- SDMA Buffer Boundary BOUNDARY : BSR_BOUNDARYSelect := SAM_SVD.SDHC.Val_4K; -- unspecified Reserved_15_15 : HAL.Bit := 16#0#; end record with Volatile_Full_Access, Object_Size => 16, Bit_Order => System.Low_Order_First; for SDHC_BSR_Register use record BLOCKSIZE at 0 range 0 .. 9; Reserved_10_11 at 0 range 10 .. 11; BOUNDARY at 0 range 12 .. 14; Reserved_15_15 at 0 range 15 .. 15; end record; -- DMA Enable type TMR_DMAENSelect is (-- No data transfer or Non DMA data transfer DISABLE, -- DMA data transfer ENABLE) with Size => 1; for TMR_DMAENSelect use (DISABLE => 0, ENABLE => 1); -- Block Count Enable type TMR_BCENSelect is (-- Disable DISABLE, -- Enable ENABLE) with Size => 1; for TMR_BCENSelect use (DISABLE => 0, ENABLE => 1); -- Auto Command Enable type TMR_ACMDENSelect is (-- Auto Command Disabled DISABLED, -- Auto CMD12 Enable CMD12, -- Auto CMD23 Enable CMD23) with Size => 2; for TMR_ACMDENSelect use (DISABLED => 0, CMD12 => 1, CMD23 => 2); -- Data Transfer Direction Selection type TMR_DTDSELSelect is (-- Write (Host to Card) WRITE, -- Read (Card to Host) READ) with Size => 1; for TMR_DTDSELSelect use (WRITE => 0, READ => 1); -- Multi/Single Block Selection type TMR_MSBSELSelect is (-- Single Block SINGLE, -- Multiple Block MULTIPLE) with Size => 1; for TMR_MSBSELSelect use (SINGLE => 0, MULTIPLE => 1); -- Transfer Mode type SDHC_TMR_Register is record -- DMA Enable DMAEN : TMR_DMAENSelect := SAM_SVD.SDHC.DISABLE; -- Block Count Enable BCEN : TMR_BCENSelect := SAM_SVD.SDHC.DISABLE; -- Auto Command Enable ACMDEN : TMR_ACMDENSelect := SAM_SVD.SDHC.DISABLED; -- Data Transfer Direction Selection DTDSEL : TMR_DTDSELSelect := SAM_SVD.SDHC.WRITE; -- Multi/Single Block Selection MSBSEL : TMR_MSBSELSelect := SAM_SVD.SDHC.SINGLE; -- unspecified Reserved_6_15 : HAL.UInt10 := 16#0#; end record with Volatile_Full_Access, Object_Size => 16, Bit_Order => System.Low_Order_First; for SDHC_TMR_Register use record DMAEN at 0 range 0 .. 0; BCEN at 0 range 1 .. 1; ACMDEN at 0 range 2 .. 3; DTDSEL at 0 range 4 .. 4; MSBSEL at 0 range 5 .. 5; Reserved_6_15 at 0 range 6 .. 15; end record; -- Response Type type CR_RESPTYPSelect is (-- No response NONE, -- 136-bit response Val_136_BIT, -- 48-bit response Val_48_BIT, -- 48-bit response check busy after response Val_48_BIT_BUSY) with Size => 2; for CR_RESPTYPSelect use (NONE => 0, Val_136_BIT => 1, Val_48_BIT => 2, Val_48_BIT_BUSY => 3); -- Command CRC Check Enable type CR_CMDCCENSelect is (-- Disable DISABLE, -- Enable ENABLE) with Size => 1; for CR_CMDCCENSelect use (DISABLE => 0, ENABLE => 1); -- Command Index Check Enable type CR_CMDICENSelect is (-- Disable DISABLE, -- Enable ENABLE) with Size => 1; for CR_CMDICENSelect use (DISABLE => 0, ENABLE => 1); -- Data Present Select type CR_DPSELSelect is (-- No Data Present NO_DATA, -- Data Present DATA) with Size => 1; for CR_DPSELSelect use (NO_DATA => 0, DATA => 1); -- Command Type type CR_CMDTYPSelect is (-- Other commands NORMAL, -- CMD52 for writing Bus Suspend in CCCR SUSPEND, -- CMD52 for writing Function Select in CCCR RESUME, -- CMD12, CMD52 for writing I/O Abort in CCCR ABORT_k) with Size => 2; for CR_CMDTYPSelect use (NORMAL => 0, SUSPEND => 1, RESUME => 2, ABORT_k => 3); subtype SDHC_CR_CMDIDX_Field is HAL.UInt6; -- Command type SDHC_CR_Register is record -- Response Type RESPTYP : CR_RESPTYPSelect := SAM_SVD.SDHC.NONE; -- unspecified Reserved_2_2 : HAL.Bit := 16#0#; -- Command CRC Check Enable CMDCCEN : CR_CMDCCENSelect := SAM_SVD.SDHC.DISABLE; -- Command Index Check Enable CMDICEN : CR_CMDICENSelect := SAM_SVD.SDHC.DISABLE; -- Data Present Select DPSEL : CR_DPSELSelect := SAM_SVD.SDHC.NO_DATA; -- Command Type CMDTYP : CR_CMDTYPSelect := SAM_SVD.SDHC.NORMAL; -- Command Index CMDIDX : SDHC_CR_CMDIDX_Field := 16#0#; -- unspecified Reserved_14_15 : HAL.UInt2 := 16#0#; end record with Volatile_Full_Access, Object_Size => 16, Bit_Order => System.Low_Order_First; for SDHC_CR_Register use record RESPTYP at 0 range 0 .. 1; Reserved_2_2 at 0 range 2 .. 2; CMDCCEN at 0 range 3 .. 3; CMDICEN at 0 range 4 .. 4; DPSEL at 0 range 5 .. 5; CMDTYP at 0 range 6 .. 7; CMDIDX at 0 range 8 .. 13; Reserved_14_15 at 0 range 14 .. 15; end record; -- Response -- Response type SDHC_RR_Registers is array (0 .. 3) of HAL.UInt32; -- Command Inhibit (CMD) type PSR_CMDINHCSelect is (-- Can issue command using only CMD line CAN, -- Cannot issue command CANNOT) with Size => 1; for PSR_CMDINHCSelect use (CAN => 0, CANNOT => 1); -- Command Inhibit (DAT) type PSR_CMDINHDSelect is (-- Can issue command which uses the DAT line CAN, -- Cannot issue command which uses the DAT line CANNOT) with Size => 1; for PSR_CMDINHDSelect use (CAN => 0, CANNOT => 1); -- DAT Line Active type PSR_DLACTSelect is (-- DAT Line Inactive INACTIVE, -- DAT Line Active ACTIVE) with Size => 1; for PSR_DLACTSelect use (INACTIVE => 0, ACTIVE => 1); -- Re-Tuning Request type PSR_RTREQSelect is (-- Fixed or well-tuned sampling clock OK, -- Sampling clock needs re-tuning REQUIRED) with Size => 1; for PSR_RTREQSelect use (OK => 0, REQUIRED => 1); -- Write Transfer Active type PSR_WTACTSelect is (-- No valid data NO, -- Transferring data YES) with Size => 1; for PSR_WTACTSelect use (NO => 0, YES => 1); -- Read Transfer Active type PSR_RTACTSelect is (-- No valid data NO, -- Transferring data YES) with Size => 1; for PSR_RTACTSelect use (NO => 0, YES => 1); -- Buffer Write Enable type PSR_BUFWRENSelect is (-- Write disable DISABLE, -- Write enable ENABLE) with Size => 1; for PSR_BUFWRENSelect use (DISABLE => 0, ENABLE => 1); -- Buffer Read Enable type PSR_BUFRDENSelect is (-- Read disable DISABLE, -- Read enable ENABLE) with Size => 1; for PSR_BUFRDENSelect use (DISABLE => 0, ENABLE => 1); -- Card Inserted type PSR_CARDINSSelect is (-- Reset or Debouncing or No Card NO, -- Card inserted YES) with Size => 1; for PSR_CARDINSSelect use (NO => 0, YES => 1); -- Card State Stable type PSR_CARDSSSelect is (-- Reset or Debouncing NO, -- No Card or Insered YES) with Size => 1; for PSR_CARDSSSelect use (NO => 0, YES => 1); -- Card Detect Pin Level type PSR_CARDDPLSelect is (-- No card present (SDCD#=1) NO, -- Card present (SDCD#=0) YES) with Size => 1; for PSR_CARDDPLSelect use (NO => 0, YES => 1); -- Write Protect Pin Level type PSR_WRPPLSelect is (-- Write protected (SDWP#=0) PROTECTED_k, -- Write enabled (SDWP#=1) ENABLED) with Size => 1; for PSR_WRPPLSelect use (PROTECTED_k => 0, ENABLED => 1); subtype SDHC_PSR_DATLL_Field is HAL.UInt4; -- Present State type SDHC_PSR_Register is record -- Read-only. Command Inhibit (CMD) CMDINHC : PSR_CMDINHCSelect; -- Read-only. Command Inhibit (DAT) CMDINHD : PSR_CMDINHDSelect; -- Read-only. DAT Line Active DLACT : PSR_DLACTSelect; -- Read-only. Re-Tuning Request RTREQ : PSR_RTREQSelect; -- unspecified Reserved_4_7 : HAL.UInt4; -- Read-only. Write Transfer Active WTACT : PSR_WTACTSelect; -- Read-only. Read Transfer Active RTACT : PSR_RTACTSelect; -- Read-only. Buffer Write Enable BUFWREN : PSR_BUFWRENSelect; -- Read-only. Buffer Read Enable BUFRDEN : PSR_BUFRDENSelect; -- unspecified Reserved_12_15 : HAL.UInt4; -- Read-only. Card Inserted CARDINS : PSR_CARDINSSelect; -- Read-only. Card State Stable CARDSS : PSR_CARDSSSelect; -- Read-only. Card Detect Pin Level CARDDPL : PSR_CARDDPLSelect; -- Read-only. Write Protect Pin Level WRPPL : PSR_WRPPLSelect; -- Read-only. DAT[3:0] Line Level DATLL : SDHC_PSR_DATLL_Field; -- Read-only. CMD Line Level CMDLL : Boolean; -- unspecified Reserved_25_31 : HAL.UInt7; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for SDHC_PSR_Register use record CMDINHC at 0 range 0 .. 0; CMDINHD at 0 range 1 .. 1; DLACT at 0 range 2 .. 2; RTREQ at 0 range 3 .. 3; Reserved_4_7 at 0 range 4 .. 7; WTACT at 0 range 8 .. 8; RTACT at 0 range 9 .. 9; BUFWREN at 0 range 10 .. 10; BUFRDEN at 0 range 11 .. 11; Reserved_12_15 at 0 range 12 .. 15; CARDINS at 0 range 16 .. 16; CARDSS at 0 range 17 .. 17; CARDDPL at 0 range 18 .. 18; WRPPL at 0 range 19 .. 19; DATLL at 0 range 20 .. 23; CMDLL at 0 range 24 .. 24; Reserved_25_31 at 0 range 25 .. 31; end record; -- LED Control type HC1R_LEDCTRLSelect is (-- LED off OFF, -- LED on ON) with Size => 1; for HC1R_LEDCTRLSelect use (OFF => 0, ON => 1); -- Data Width type HC1R_DWSelect is (-- 1-bit mode Val_1BIT, -- 4-bit mode Val_4BIT) with Size => 1; for HC1R_DWSelect use (Val_1BIT => 0, Val_4BIT => 1); -- High Speed Enable type HC1R_HSENSelect is (-- Normal Speed mode NORMAL, -- High Speed mode HIGH) with Size => 1; for HC1R_HSENSelect use (NORMAL => 0, HIGH => 1); -- DMA Select type HC1R_DMASELSelect is (-- SDMA is selected SDMA, -- 32-bit Address ADMA2 is selected Val_32BIT) with Size => 2; for HC1R_DMASELSelect use (SDMA => 0, Val_32BIT => 2); -- Card Detect Test Level type HC1R_CARDDTLSelect is (-- No Card NO, -- Card Inserted YES) with Size => 1; for HC1R_CARDDTLSelect use (NO => 0, YES => 1); -- Card Detect Signal Selection type HC1R_CARDDSELSelect is (-- SDCD# is selected (for normal use) NORMAL, -- The Card Select Test Level is selected (for test purpose) TEST) with Size => 1; for HC1R_CARDDSELSelect use (NORMAL => 0, TEST => 1); -- Host Control 1 type SDHC_HC1R_Register is record -- LED Control LEDCTRL : HC1R_LEDCTRLSelect := SAM_SVD.SDHC.OFF; -- Data Width DW : HC1R_DWSelect := SAM_SVD.SDHC.Val_1BIT; -- High Speed Enable HSEN : HC1R_HSENSelect := SAM_SVD.SDHC.NORMAL; -- DMA Select DMASEL : HC1R_DMASELSelect := SAM_SVD.SDHC.SDMA; -- unspecified Reserved_5_5 : HAL.Bit := 16#0#; -- Card Detect Test Level CARDDTL : HC1R_CARDDTLSelect := SAM_SVD.SDHC.NO; -- Card Detect Signal Selection CARDDSEL : HC1R_CARDDSELSelect := SAM_SVD.SDHC.NORMAL; end record with Volatile_Full_Access, Object_Size => 8, Bit_Order => System.Low_Order_First; for SDHC_HC1R_Register use record LEDCTRL at 0 range 0 .. 0; DW at 0 range 1 .. 1; HSEN at 0 range 2 .. 2; DMASEL at 0 range 3 .. 4; Reserved_5_5 at 0 range 5 .. 5; CARDDTL at 0 range 6 .. 6; CARDDSEL at 0 range 7 .. 7; end record; -- Data Width type HC1R_EMMC_MODE_DWSelect is (-- 1-bit mode Val_1BIT, -- 4-bit mode Val_4BIT) with Size => 1; for HC1R_EMMC_MODE_DWSelect use (Val_1BIT => 0, Val_4BIT => 1); -- High Speed Enable type HC1R_EMMC_MODE_HSENSelect is (-- Normal Speed mode NORMAL, -- High Speed mode HIGH) with Size => 1; for HC1R_EMMC_MODE_HSENSelect use (NORMAL => 0, HIGH => 1); -- DMA Select type HC1R_EMMC_MODE_DMASELSelect is (-- SDMA is selected SDMA, -- 32-bit Address ADMA2 is selected Val_32BIT) with Size => 2; for HC1R_EMMC_MODE_DMASELSelect use (SDMA => 0, Val_32BIT => 2); -- Host Control 1 type SDHC_HC1R_EMMC_MODE_Register is record -- unspecified Reserved_0_0 : HAL.Bit := 16#0#; -- Data Width DW : HC1R_EMMC_MODE_DWSelect := SAM_SVD.SDHC.Val_1BIT; -- High Speed Enable HSEN : HC1R_EMMC_MODE_HSENSelect := SAM_SVD.SDHC.NORMAL; -- DMA Select DMASEL : HC1R_EMMC_MODE_DMASELSelect := SAM_SVD.SDHC.SDMA; -- unspecified Reserved_5_7 : HAL.UInt3 := 16#0#; end record with Volatile_Full_Access, Object_Size => 8, Bit_Order => System.Low_Order_First; for SDHC_HC1R_EMMC_MODE_Register use record Reserved_0_0 at 0 range 0 .. 0; DW at 0 range 1 .. 1; HSEN at 0 range 2 .. 2; DMASEL at 0 range 3 .. 4; Reserved_5_7 at 0 range 5 .. 7; end record; -- SD Bus Power type PCR_SDBPWRSelect is (-- Power off OFF, -- Power on ON) with Size => 1; for PCR_SDBPWRSelect use (OFF => 0, ON => 1); -- SD Bus Voltage Select type PCR_SDBVSELSelect is (-- 1.8V (Typ.) Val_1V8, -- 3.0V (Typ.) Val_3V0, -- 3.3V (Typ.) Val_3V3) with Size => 3; for PCR_SDBVSELSelect use (Val_1V8 => 5, Val_3V0 => 6, Val_3V3 => 7); -- Power Control type SDHC_PCR_Register is record -- SD Bus Power SDBPWR : PCR_SDBPWRSelect := SAM_SVD.SDHC.OFF; -- SD Bus Voltage Select SDBVSEL : PCR_SDBVSELSelect := SAM_SVD.SDHC.Val_3V3; -- unspecified Reserved_4_7 : HAL.UInt4 := 16#0#; end record with Volatile_Full_Access, Object_Size => 8, Bit_Order => System.Low_Order_First; for SDHC_PCR_Register use record SDBPWR at 0 range 0 .. 0; SDBVSEL at 0 range 1 .. 3; Reserved_4_7 at 0 range 4 .. 7; end record; -- Stop at Block Gap Request type BGCR_STPBGRSelect is (-- Transfer TRANSFER, -- Stop STOP) with Size => 1; for BGCR_STPBGRSelect use (TRANSFER => 0, STOP => 1); -- Continue Request type BGCR_CONTRSelect is (-- Not affected GO_ON, -- Restart RESTART) with Size => 1; for BGCR_CONTRSelect use (GO_ON => 0, RESTART => 1); -- Read Wait Control type BGCR_RWCTRLSelect is (-- Disable Read Wait Control DISABLE, -- Enable Read Wait Control ENABLE) with Size => 1; for BGCR_RWCTRLSelect use (DISABLE => 0, ENABLE => 1); -- Interrupt at Block Gap type BGCR_INTBGSelect is (-- Disabled DISABLED, -- Enabled ENABLED) with Size => 1; for BGCR_INTBGSelect use (DISABLED => 0, ENABLED => 1); -- Block Gap Control type SDHC_BGCR_Register is record -- Stop at Block Gap Request STPBGR : BGCR_STPBGRSelect := SAM_SVD.SDHC.TRANSFER; -- Continue Request CONTR : BGCR_CONTRSelect := SAM_SVD.SDHC.GO_ON; -- Read Wait Control RWCTRL : BGCR_RWCTRLSelect := SAM_SVD.SDHC.DISABLE; -- Interrupt at Block Gap INTBG : BGCR_INTBGSelect := SAM_SVD.SDHC.DISABLED; -- unspecified Reserved_4_7 : HAL.UInt4 := 16#0#; end record with Volatile_Full_Access, Object_Size => 8, Bit_Order => System.Low_Order_First; for SDHC_BGCR_Register use record STPBGR at 0 range 0 .. 0; CONTR at 0 range 1 .. 1; RWCTRL at 0 range 2 .. 2; INTBG at 0 range 3 .. 3; Reserved_4_7 at 0 range 4 .. 7; end record; -- Stop at Block Gap Request type BGCR_EMMC_MODE_STPBGRSelect is (-- Transfer TRANSFER, -- Stop STOP) with Size => 1; for BGCR_EMMC_MODE_STPBGRSelect use (TRANSFER => 0, STOP => 1); -- Continue Request type BGCR_EMMC_MODE_CONTRSelect is (-- Not affected GO_ON, -- Restart RESTART) with Size => 1; for BGCR_EMMC_MODE_CONTRSelect use (GO_ON => 0, RESTART => 1); -- Block Gap Control type SDHC_BGCR_EMMC_MODE_Register is record -- Stop at Block Gap Request STPBGR : BGCR_EMMC_MODE_STPBGRSelect := SAM_SVD.SDHC.TRANSFER; -- Continue Request CONTR : BGCR_EMMC_MODE_CONTRSelect := SAM_SVD.SDHC.GO_ON; -- unspecified Reserved_2_7 : HAL.UInt6 := 16#0#; end record with Volatile_Full_Access, Object_Size => 8, Bit_Order => System.Low_Order_First; for SDHC_BGCR_EMMC_MODE_Register use record STPBGR at 0 range 0 .. 0; CONTR at 0 range 1 .. 1; Reserved_2_7 at 0 range 2 .. 7; end record; -- Wakeup Event Enable on Card Interrupt type WCR_WKENCINTSelect is (-- Disable DISABLE, -- Enable ENABLE) with Size => 1; for WCR_WKENCINTSelect use (DISABLE => 0, ENABLE => 1); -- Wakeup Event Enable on Card Insertion type WCR_WKENCINSSelect is (-- Disable DISABLE, -- Enable ENABLE) with Size => 1; for WCR_WKENCINSSelect use (DISABLE => 0, ENABLE => 1); -- Wakeup Event Enable on Card Removal type WCR_WKENCREMSelect is (-- Disable DISABLE, -- Enable ENABLE) with Size => 1; for WCR_WKENCREMSelect use (DISABLE => 0, ENABLE => 1); -- Wakeup Control type SDHC_WCR_Register is record -- Wakeup Event Enable on Card Interrupt WKENCINT : WCR_WKENCINTSelect := SAM_SVD.SDHC.DISABLE; -- Wakeup Event Enable on Card Insertion WKENCINS : WCR_WKENCINSSelect := SAM_SVD.SDHC.DISABLE; -- Wakeup Event Enable on Card Removal WKENCREM : WCR_WKENCREMSelect := SAM_SVD.SDHC.DISABLE; -- unspecified Reserved_3_7 : HAL.UInt5 := 16#0#; end record with Volatile_Full_Access, Object_Size => 8, Bit_Order => System.Low_Order_First; for SDHC_WCR_Register use record WKENCINT at 0 range 0 .. 0; WKENCINS at 0 range 1 .. 1; WKENCREM at 0 range 2 .. 2; Reserved_3_7 at 0 range 3 .. 7; end record; -- Internal Clock Enable type CCR_INTCLKENSelect is (-- Stop OFF, -- Oscillate ON) with Size => 1; for CCR_INTCLKENSelect use (OFF => 0, ON => 1); -- Internal Clock Stable type CCR_INTCLKSSelect is (-- Not Ready NOT_READY, -- Ready READY) with Size => 1; for CCR_INTCLKSSelect use (NOT_READY => 0, READY => 1); -- SD Clock Enable type CCR_SDCLKENSelect is (-- Disable DISABLE, -- Enable ENABLE) with Size => 1; for CCR_SDCLKENSelect use (DISABLE => 0, ENABLE => 1); -- Clock Generator Select type CCR_CLKGSELSelect is (-- Divided Clock Mode DIV, -- Programmable Clock Mode PROG) with Size => 1; for CCR_CLKGSELSelect use (DIV => 0, PROG => 1); subtype SDHC_CCR_USDCLKFSEL_Field is HAL.UInt2; subtype SDHC_CCR_SDCLKFSEL_Field is HAL.UInt8; -- Clock Control type SDHC_CCR_Register is record -- Internal Clock Enable INTCLKEN : CCR_INTCLKENSelect := SAM_SVD.SDHC.OFF; -- Internal Clock Stable INTCLKS : CCR_INTCLKSSelect := SAM_SVD.SDHC.NOT_READY; -- SD Clock Enable SDCLKEN : CCR_SDCLKENSelect := SAM_SVD.SDHC.DISABLE; -- unspecified Reserved_3_4 : HAL.UInt2 := 16#0#; -- Clock Generator Select CLKGSEL : CCR_CLKGSELSelect := SAM_SVD.SDHC.DIV; -- Upper Bits of SDCLK Frequency Select USDCLKFSEL : SDHC_CCR_USDCLKFSEL_Field := 16#0#; -- SDCLK Frequency Select SDCLKFSEL : SDHC_CCR_SDCLKFSEL_Field := 16#0#; end record with Volatile_Full_Access, Object_Size => 16, Bit_Order => System.Low_Order_First; for SDHC_CCR_Register use record INTCLKEN at 0 range 0 .. 0; INTCLKS at 0 range 1 .. 1; SDCLKEN at 0 range 2 .. 2; Reserved_3_4 at 0 range 3 .. 4; CLKGSEL at 0 range 5 .. 5; USDCLKFSEL at 0 range 6 .. 7; SDCLKFSEL at 0 range 8 .. 15; end record; subtype SDHC_TCR_DTCVAL_Field is HAL.UInt4; -- Timeout Control type SDHC_TCR_Register is record -- Data Timeout Counter Value DTCVAL : SDHC_TCR_DTCVAL_Field := 16#0#; -- unspecified Reserved_4_7 : HAL.UInt4 := 16#0#; end record with Volatile_Full_Access, Object_Size => 8, Bit_Order => System.Low_Order_First; for SDHC_TCR_Register use record DTCVAL at 0 range 0 .. 3; Reserved_4_7 at 0 range 4 .. 7; end record; -- Software Reset For All type SRR_SWRSTALLSelect is (-- Work WORK, -- Reset RESET) with Size => 1; for SRR_SWRSTALLSelect use (WORK => 0, RESET => 1); -- Software Reset For CMD Line type SRR_SWRSTCMDSelect is (-- Work WORK, -- Reset RESET) with Size => 1; for SRR_SWRSTCMDSelect use (WORK => 0, RESET => 1); -- Software Reset For DAT Line type SRR_SWRSTDATSelect is (-- Work WORK, -- Reset RESET) with Size => 1; for SRR_SWRSTDATSelect use (WORK => 0, RESET => 1); -- Software Reset type SDHC_SRR_Register is record -- Software Reset For All SWRSTALL : SRR_SWRSTALLSelect := SAM_SVD.SDHC.WORK; -- Software Reset For CMD Line SWRSTCMD : SRR_SWRSTCMDSelect := SAM_SVD.SDHC.WORK; -- Software Reset For DAT Line SWRSTDAT : SRR_SWRSTDATSelect := SAM_SVD.SDHC.WORK; -- unspecified Reserved_3_7 : HAL.UInt5 := 16#0#; end record with Volatile_Full_Access, Object_Size => 8, Bit_Order => System.Low_Order_First; for SDHC_SRR_Register use record SWRSTALL at 0 range 0 .. 0; SWRSTCMD at 0 range 1 .. 1; SWRSTDAT at 0 range 2 .. 2; Reserved_3_7 at 0 range 3 .. 7; end record; -- Command Complete type NISTR_CMDCSelect is (-- No command complete NO, -- Command complete YES) with Size => 1; for NISTR_CMDCSelect use (NO => 0, YES => 1); -- Transfer Complete type NISTR_TRFCSelect is (-- Not complete NO, -- Command execution is completed YES) with Size => 1; for NISTR_TRFCSelect use (NO => 0, YES => 1); -- Block Gap Event type NISTR_BLKGESelect is (-- No Block Gap Event NO, -- Transaction stopped at block gap STOP) with Size => 1; for NISTR_BLKGESelect use (NO => 0, STOP => 1); -- DMA Interrupt type NISTR_DMAINTSelect is (-- No DMA Interrupt NO, -- DMA Interrupt is generated YES) with Size => 1; for NISTR_DMAINTSelect use (NO => 0, YES => 1); -- Buffer Write Ready type NISTR_BWRRDYSelect is (-- Not ready to write buffer NO, -- Ready to write buffer YES) with Size => 1; for NISTR_BWRRDYSelect use (NO => 0, YES => 1); -- Buffer Read Ready type NISTR_BRDRDYSelect is (-- Not ready to read buffer NO, -- Ready to read buffer YES) with Size => 1; for NISTR_BRDRDYSelect use (NO => 0, YES => 1); -- Card Insertion type NISTR_CINSSelect is (-- Card state stable or Debouncing NO, -- Card inserted YES) with Size => 1; for NISTR_CINSSelect use (NO => 0, YES => 1); -- Card Removal type NISTR_CREMSelect is (-- Card state stable or Debouncing NO, -- Card Removed YES) with Size => 1; for NISTR_CREMSelect use (NO => 0, YES => 1); -- Card Interrupt type NISTR_CINTSelect is (-- No Card Interrupt NO, -- Generate Card Interrupt YES) with Size => 1; for NISTR_CINTSelect use (NO => 0, YES => 1); -- Error Interrupt type NISTR_ERRINTSelect is (-- No Error NO, -- Error YES) with Size => 1; for NISTR_ERRINTSelect use (NO => 0, YES => 1); -- Normal Interrupt Status type SDHC_NISTR_Register is record -- Command Complete CMDC : NISTR_CMDCSelect := SAM_SVD.SDHC.NO; -- Transfer Complete TRFC : NISTR_TRFCSelect := SAM_SVD.SDHC.NO; -- Block Gap Event BLKGE : NISTR_BLKGESelect := SAM_SVD.SDHC.NO; -- DMA Interrupt DMAINT : NISTR_DMAINTSelect := SAM_SVD.SDHC.NO; -- Buffer Write Ready BWRRDY : NISTR_BWRRDYSelect := SAM_SVD.SDHC.NO; -- Buffer Read Ready BRDRDY : NISTR_BRDRDYSelect := SAM_SVD.SDHC.NO; -- Card Insertion CINS : NISTR_CINSSelect := SAM_SVD.SDHC.NO; -- Card Removal CREM : NISTR_CREMSelect := SAM_SVD.SDHC.NO; -- Card Interrupt CINT : NISTR_CINTSelect := SAM_SVD.SDHC.NO; -- unspecified Reserved_9_14 : HAL.UInt6 := 16#0#; -- Error Interrupt ERRINT : NISTR_ERRINTSelect := SAM_SVD.SDHC.NO; end record with Volatile_Full_Access, Object_Size => 16, Bit_Order => System.Low_Order_First; for SDHC_NISTR_Register use record CMDC at 0 range 0 .. 0; TRFC at 0 range 1 .. 1; BLKGE at 0 range 2 .. 2; DMAINT at 0 range 3 .. 3; BWRRDY at 0 range 4 .. 4; BRDRDY at 0 range 5 .. 5; CINS at 0 range 6 .. 6; CREM at 0 range 7 .. 7; CINT at 0 range 8 .. 8; Reserved_9_14 at 0 range 9 .. 14; ERRINT at 0 range 15 .. 15; end record; -- Command Complete type NISTR_EMMC_MODE_CMDCSelect is (-- No command complete NO, -- Command complete YES) with Size => 1; for NISTR_EMMC_MODE_CMDCSelect use (NO => 0, YES => 1); -- Transfer Complete type NISTR_EMMC_MODE_TRFCSelect is (-- Not complete NO, -- Command execution is completed YES) with Size => 1; for NISTR_EMMC_MODE_TRFCSelect use (NO => 0, YES => 1); -- Block Gap Event type NISTR_EMMC_MODE_BLKGESelect is (-- No Block Gap Event NO, -- Transaction stopped at block gap STOP) with Size => 1; for NISTR_EMMC_MODE_BLKGESelect use (NO => 0, STOP => 1); -- DMA Interrupt type NISTR_EMMC_MODE_DMAINTSelect is (-- No DMA Interrupt NO, -- DMA Interrupt is generated YES) with Size => 1; for NISTR_EMMC_MODE_DMAINTSelect use (NO => 0, YES => 1); -- Buffer Write Ready type NISTR_EMMC_MODE_BWRRDYSelect is (-- Not ready to write buffer NO, -- Ready to write buffer YES) with Size => 1; for NISTR_EMMC_MODE_BWRRDYSelect use (NO => 0, YES => 1); -- Buffer Read Ready type NISTR_EMMC_MODE_BRDRDYSelect is (-- Not ready to read buffer NO, -- Ready to read buffer YES) with Size => 1; for NISTR_EMMC_MODE_BRDRDYSelect use (NO => 0, YES => 1); -- Error Interrupt type NISTR_EMMC_MODE_ERRINTSelect is (-- No Error NO, -- Error YES) with Size => 1; for NISTR_EMMC_MODE_ERRINTSelect use (NO => 0, YES => 1); -- Normal Interrupt Status type SDHC_NISTR_EMMC_MODE_Register is record -- Command Complete CMDC : NISTR_EMMC_MODE_CMDCSelect := SAM_SVD.SDHC.NO; -- Transfer Complete TRFC : NISTR_EMMC_MODE_TRFCSelect := SAM_SVD.SDHC.NO; -- Block Gap Event BLKGE : NISTR_EMMC_MODE_BLKGESelect := SAM_SVD.SDHC.NO; -- DMA Interrupt DMAINT : NISTR_EMMC_MODE_DMAINTSelect := SAM_SVD.SDHC.NO; -- Buffer Write Ready BWRRDY : NISTR_EMMC_MODE_BWRRDYSelect := SAM_SVD.SDHC.NO; -- Buffer Read Ready BRDRDY : NISTR_EMMC_MODE_BRDRDYSelect := SAM_SVD.SDHC.NO; -- unspecified Reserved_6_13 : HAL.UInt8 := 16#0#; -- Boot Acknowledge Received BOOTAR : Boolean := False; -- Error Interrupt ERRINT : NISTR_EMMC_MODE_ERRINTSelect := SAM_SVD.SDHC.NO; end record with Volatile_Full_Access, Object_Size => 16, Bit_Order => System.Low_Order_First; for SDHC_NISTR_EMMC_MODE_Register use record CMDC at 0 range 0 .. 0; TRFC at 0 range 1 .. 1; BLKGE at 0 range 2 .. 2; DMAINT at 0 range 3 .. 3; BWRRDY at 0 range 4 .. 4; BRDRDY at 0 range 5 .. 5; Reserved_6_13 at 0 range 6 .. 13; BOOTAR at 0 range 14 .. 14; ERRINT at 0 range 15 .. 15; end record; -- Command Timeout Error type EISTR_CMDTEOSelect is (-- No Error NO, -- Timeout YES) with Size => 1; for EISTR_CMDTEOSelect use (NO => 0, YES => 1); -- Command CRC Error type EISTR_CMDCRCSelect is (-- No Error NO, -- CRC Error Generated YES) with Size => 1; for EISTR_CMDCRCSelect use (NO => 0, YES => 1); -- Command End Bit Error type EISTR_CMDENDSelect is (-- No error NO, -- End Bit Error Generated YES) with Size => 1; for EISTR_CMDENDSelect use (NO => 0, YES => 1); -- Command Index Error type EISTR_CMDIDXSelect is (-- No Error NO, -- Error YES) with Size => 1; for EISTR_CMDIDXSelect use (NO => 0, YES => 1); -- Data Timeout Error type EISTR_DATTEOSelect is (-- No Error NO, -- Timeout YES) with Size => 1; for EISTR_DATTEOSelect use (NO => 0, YES => 1); -- Data CRC Error type EISTR_DATCRCSelect is (-- No Error NO, -- Error YES) with Size => 1; for EISTR_DATCRCSelect use (NO => 0, YES => 1); -- Data End Bit Error type EISTR_DATENDSelect is (-- No Error NO, -- Error YES) with Size => 1; for EISTR_DATENDSelect use (NO => 0, YES => 1); -- Current Limit Error type EISTR_CURLIMSelect is (-- No Error NO, -- Power Fail YES) with Size => 1; for EISTR_CURLIMSelect use (NO => 0, YES => 1); -- Auto CMD Error type EISTR_ACMDSelect is (-- No Error NO, -- Error YES) with Size => 1; for EISTR_ACMDSelect use (NO => 0, YES => 1); -- ADMA Error type EISTR_ADMASelect is (-- No Error NO, -- Error YES) with Size => 1; for EISTR_ADMASelect use (NO => 0, YES => 1); -- Error Interrupt Status type SDHC_EISTR_Register is record -- Command Timeout Error CMDTEO : EISTR_CMDTEOSelect := SAM_SVD.SDHC.NO; -- Command CRC Error CMDCRC : EISTR_CMDCRCSelect := SAM_SVD.SDHC.NO; -- Command End Bit Error CMDEND : EISTR_CMDENDSelect := SAM_SVD.SDHC.NO; -- Command Index Error CMDIDX : EISTR_CMDIDXSelect := SAM_SVD.SDHC.NO; -- Data Timeout Error DATTEO : EISTR_DATTEOSelect := SAM_SVD.SDHC.NO; -- Data CRC Error DATCRC : EISTR_DATCRCSelect := SAM_SVD.SDHC.NO; -- Data End Bit Error DATEND : EISTR_DATENDSelect := SAM_SVD.SDHC.NO; -- Current Limit Error CURLIM : EISTR_CURLIMSelect := SAM_SVD.SDHC.NO; -- Auto CMD Error ACMD : EISTR_ACMDSelect := SAM_SVD.SDHC.NO; -- ADMA Error ADMA : EISTR_ADMASelect := SAM_SVD.SDHC.NO; -- unspecified Reserved_10_15 : HAL.UInt6 := 16#0#; end record with Volatile_Full_Access, Object_Size => 16, Bit_Order => System.Low_Order_First; for SDHC_EISTR_Register use record CMDTEO at 0 range 0 .. 0; CMDCRC at 0 range 1 .. 1; CMDEND at 0 range 2 .. 2; CMDIDX at 0 range 3 .. 3; DATTEO at 0 range 4 .. 4; DATCRC at 0 range 5 .. 5; DATEND at 0 range 6 .. 6; CURLIM at 0 range 7 .. 7; ACMD at 0 range 8 .. 8; ADMA at 0 range 9 .. 9; Reserved_10_15 at 0 range 10 .. 15; end record; -- Command Timeout Error type EISTR_EMMC_MODE_CMDTEOSelect is (-- No Error NO, -- Timeout YES) with Size => 1; for EISTR_EMMC_MODE_CMDTEOSelect use (NO => 0, YES => 1); -- Command CRC Error type EISTR_EMMC_MODE_CMDCRCSelect is (-- No Error NO, -- CRC Error Generated YES) with Size => 1; for EISTR_EMMC_MODE_CMDCRCSelect use (NO => 0, YES => 1); -- Command End Bit Error type EISTR_EMMC_MODE_CMDENDSelect is (-- No error NO, -- End Bit Error Generated YES) with Size => 1; for EISTR_EMMC_MODE_CMDENDSelect use (NO => 0, YES => 1); -- Command Index Error type EISTR_EMMC_MODE_CMDIDXSelect is (-- No Error NO, -- Error YES) with Size => 1; for EISTR_EMMC_MODE_CMDIDXSelect use (NO => 0, YES => 1); -- Data Timeout Error type EISTR_EMMC_MODE_DATTEOSelect is (-- No Error NO, -- Timeout YES) with Size => 1; for EISTR_EMMC_MODE_DATTEOSelect use (NO => 0, YES => 1); -- Data CRC Error type EISTR_EMMC_MODE_DATCRCSelect is (-- No Error NO, -- Error YES) with Size => 1; for EISTR_EMMC_MODE_DATCRCSelect use (NO => 0, YES => 1); -- Data End Bit Error type EISTR_EMMC_MODE_DATENDSelect is (-- No Error NO, -- Error YES) with Size => 1; for EISTR_EMMC_MODE_DATENDSelect use (NO => 0, YES => 1); -- Current Limit Error type EISTR_EMMC_MODE_CURLIMSelect is (-- No Error NO, -- Power Fail YES) with Size => 1; for EISTR_EMMC_MODE_CURLIMSelect use (NO => 0, YES => 1); -- Auto CMD Error type EISTR_EMMC_MODE_ACMDSelect is (-- No Error NO, -- Error YES) with Size => 1; for EISTR_EMMC_MODE_ACMDSelect use (NO => 0, YES => 1); -- ADMA Error type EISTR_EMMC_MODE_ADMASelect is (-- No Error NO, -- Error YES) with Size => 1; for EISTR_EMMC_MODE_ADMASelect use (NO => 0, YES => 1); -- Boot Acknowledge Error type EISTR_EMMC_MODE_BOOTAESelect is (-- FIFO contains at least one byte Val_0, -- FIFO is empty Val_1) with Size => 1; for EISTR_EMMC_MODE_BOOTAESelect use (Val_0 => 0, Val_1 => 1); -- Error Interrupt Status type SDHC_EISTR_EMMC_MODE_Register is record -- Command Timeout Error CMDTEO : EISTR_EMMC_MODE_CMDTEOSelect := SAM_SVD.SDHC.NO; -- Command CRC Error CMDCRC : EISTR_EMMC_MODE_CMDCRCSelect := SAM_SVD.SDHC.NO; -- Command End Bit Error CMDEND : EISTR_EMMC_MODE_CMDENDSelect := SAM_SVD.SDHC.NO; -- Command Index Error CMDIDX : EISTR_EMMC_MODE_CMDIDXSelect := SAM_SVD.SDHC.NO; -- Data Timeout Error DATTEO : EISTR_EMMC_MODE_DATTEOSelect := SAM_SVD.SDHC.NO; -- Data CRC Error DATCRC : EISTR_EMMC_MODE_DATCRCSelect := SAM_SVD.SDHC.NO; -- Data End Bit Error DATEND : EISTR_EMMC_MODE_DATENDSelect := SAM_SVD.SDHC.NO; -- Current Limit Error CURLIM : EISTR_EMMC_MODE_CURLIMSelect := SAM_SVD.SDHC.NO; -- Auto CMD Error ACMD : EISTR_EMMC_MODE_ACMDSelect := SAM_SVD.SDHC.NO; -- ADMA Error ADMA : EISTR_EMMC_MODE_ADMASelect := SAM_SVD.SDHC.NO; -- unspecified Reserved_10_11 : HAL.UInt2 := 16#0#; -- Boot Acknowledge Error BOOTAE : EISTR_EMMC_MODE_BOOTAESelect := SAM_SVD.SDHC.Val_0; -- unspecified Reserved_13_15 : HAL.UInt3 := 16#0#; end record with Volatile_Full_Access, Object_Size => 16, Bit_Order => System.Low_Order_First; for SDHC_EISTR_EMMC_MODE_Register use record CMDTEO at 0 range 0 .. 0; CMDCRC at 0 range 1 .. 1; CMDEND at 0 range 2 .. 2; CMDIDX at 0 range 3 .. 3; DATTEO at 0 range 4 .. 4; DATCRC at 0 range 5 .. 5; DATEND at 0 range 6 .. 6; CURLIM at 0 range 7 .. 7; ACMD at 0 range 8 .. 8; ADMA at 0 range 9 .. 9; Reserved_10_11 at 0 range 10 .. 11; BOOTAE at 0 range 12 .. 12; Reserved_13_15 at 0 range 13 .. 15; end record; -- Command Complete Status Enable type NISTER_CMDCSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for NISTER_CMDCSelect use (MASKED => 0, ENABLED => 1); -- Transfer Complete Status Enable type NISTER_TRFCSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for NISTER_TRFCSelect use (MASKED => 0, ENABLED => 1); -- Block Gap Event Status Enable type NISTER_BLKGESelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for NISTER_BLKGESelect use (MASKED => 0, ENABLED => 1); -- DMA Interrupt Status Enable type NISTER_DMAINTSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for NISTER_DMAINTSelect use (MASKED => 0, ENABLED => 1); -- Buffer Write Ready Status Enable type NISTER_BWRRDYSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for NISTER_BWRRDYSelect use (MASKED => 0, ENABLED => 1); -- Buffer Read Ready Status Enable type NISTER_BRDRDYSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for NISTER_BRDRDYSelect use (MASKED => 0, ENABLED => 1); -- Card Insertion Status Enable type NISTER_CINSSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for NISTER_CINSSelect use (MASKED => 0, ENABLED => 1); -- Card Removal Status Enable type NISTER_CREMSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for NISTER_CREMSelect use (MASKED => 0, ENABLED => 1); -- Card Interrupt Status Enable type NISTER_CINTSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for NISTER_CINTSelect use (MASKED => 0, ENABLED => 1); -- Normal Interrupt Status Enable type SDHC_NISTER_Register is record -- Command Complete Status Enable CMDC : NISTER_CMDCSelect := SAM_SVD.SDHC.MASKED; -- Transfer Complete Status Enable TRFC : NISTER_TRFCSelect := SAM_SVD.SDHC.MASKED; -- Block Gap Event Status Enable BLKGE : NISTER_BLKGESelect := SAM_SVD.SDHC.MASKED; -- DMA Interrupt Status Enable DMAINT : NISTER_DMAINTSelect := SAM_SVD.SDHC.MASKED; -- Buffer Write Ready Status Enable BWRRDY : NISTER_BWRRDYSelect := SAM_SVD.SDHC.MASKED; -- Buffer Read Ready Status Enable BRDRDY : NISTER_BRDRDYSelect := SAM_SVD.SDHC.MASKED; -- Card Insertion Status Enable CINS : NISTER_CINSSelect := SAM_SVD.SDHC.MASKED; -- Card Removal Status Enable CREM : NISTER_CREMSelect := SAM_SVD.SDHC.MASKED; -- Card Interrupt Status Enable CINT : NISTER_CINTSelect := SAM_SVD.SDHC.MASKED; -- unspecified Reserved_9_15 : HAL.UInt7 := 16#0#; end record with Volatile_Full_Access, Object_Size => 16, Bit_Order => System.Low_Order_First; for SDHC_NISTER_Register use record CMDC at 0 range 0 .. 0; TRFC at 0 range 1 .. 1; BLKGE at 0 range 2 .. 2; DMAINT at 0 range 3 .. 3; BWRRDY at 0 range 4 .. 4; BRDRDY at 0 range 5 .. 5; CINS at 0 range 6 .. 6; CREM at 0 range 7 .. 7; CINT at 0 range 8 .. 8; Reserved_9_15 at 0 range 9 .. 15; end record; -- Command Complete Status Enable type NISTER_EMMC_MODE_CMDCSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for NISTER_EMMC_MODE_CMDCSelect use (MASKED => 0, ENABLED => 1); -- Transfer Complete Status Enable type NISTER_EMMC_MODE_TRFCSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for NISTER_EMMC_MODE_TRFCSelect use (MASKED => 0, ENABLED => 1); -- Block Gap Event Status Enable type NISTER_EMMC_MODE_BLKGESelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for NISTER_EMMC_MODE_BLKGESelect use (MASKED => 0, ENABLED => 1); -- DMA Interrupt Status Enable type NISTER_EMMC_MODE_DMAINTSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for NISTER_EMMC_MODE_DMAINTSelect use (MASKED => 0, ENABLED => 1); -- Buffer Write Ready Status Enable type NISTER_EMMC_MODE_BWRRDYSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for NISTER_EMMC_MODE_BWRRDYSelect use (MASKED => 0, ENABLED => 1); -- Buffer Read Ready Status Enable type NISTER_EMMC_MODE_BRDRDYSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for NISTER_EMMC_MODE_BRDRDYSelect use (MASKED => 0, ENABLED => 1); -- Normal Interrupt Status Enable type SDHC_NISTER_EMMC_MODE_Register is record -- Command Complete Status Enable CMDC : NISTER_EMMC_MODE_CMDCSelect := SAM_SVD.SDHC.MASKED; -- Transfer Complete Status Enable TRFC : NISTER_EMMC_MODE_TRFCSelect := SAM_SVD.SDHC.MASKED; -- Block Gap Event Status Enable BLKGE : NISTER_EMMC_MODE_BLKGESelect := SAM_SVD.SDHC.MASKED; -- DMA Interrupt Status Enable DMAINT : NISTER_EMMC_MODE_DMAINTSelect := SAM_SVD.SDHC.MASKED; -- Buffer Write Ready Status Enable BWRRDY : NISTER_EMMC_MODE_BWRRDYSelect := SAM_SVD.SDHC.MASKED; -- Buffer Read Ready Status Enable BRDRDY : NISTER_EMMC_MODE_BRDRDYSelect := SAM_SVD.SDHC.MASKED; -- unspecified Reserved_6_13 : HAL.UInt8 := 16#0#; -- Boot Acknowledge Received Status Enable BOOTAR : Boolean := False; -- unspecified Reserved_15_15 : HAL.Bit := 16#0#; end record with Volatile_Full_Access, Object_Size => 16, Bit_Order => System.Low_Order_First; for SDHC_NISTER_EMMC_MODE_Register use record CMDC at 0 range 0 .. 0; TRFC at 0 range 1 .. 1; BLKGE at 0 range 2 .. 2; DMAINT at 0 range 3 .. 3; BWRRDY at 0 range 4 .. 4; BRDRDY at 0 range 5 .. 5; Reserved_6_13 at 0 range 6 .. 13; BOOTAR at 0 range 14 .. 14; Reserved_15_15 at 0 range 15 .. 15; end record; -- Command Timeout Error Status Enable type EISTER_CMDTEOSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for EISTER_CMDTEOSelect use (MASKED => 0, ENABLED => 1); -- Command CRC Error Status Enable type EISTER_CMDCRCSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for EISTER_CMDCRCSelect use (MASKED => 0, ENABLED => 1); -- Command End Bit Error Status Enable type EISTER_CMDENDSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for EISTER_CMDENDSelect use (MASKED => 0, ENABLED => 1); -- Command Index Error Status Enable type EISTER_CMDIDXSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for EISTER_CMDIDXSelect use (MASKED => 0, ENABLED => 1); -- Data Timeout Error Status Enable type EISTER_DATTEOSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for EISTER_DATTEOSelect use (MASKED => 0, ENABLED => 1); -- Data CRC Error Status Enable type EISTER_DATCRCSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for EISTER_DATCRCSelect use (MASKED => 0, ENABLED => 1); -- Data End Bit Error Status Enable type EISTER_DATENDSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for EISTER_DATENDSelect use (MASKED => 0, ENABLED => 1); -- Current Limit Error Status Enable type EISTER_CURLIMSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for EISTER_CURLIMSelect use (MASKED => 0, ENABLED => 1); -- Auto CMD Error Status Enable type EISTER_ACMDSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for EISTER_ACMDSelect use (MASKED => 0, ENABLED => 1); -- ADMA Error Status Enable type EISTER_ADMASelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for EISTER_ADMASelect use (MASKED => 0, ENABLED => 1); -- Error Interrupt Status Enable type SDHC_EISTER_Register is record -- Command Timeout Error Status Enable CMDTEO : EISTER_CMDTEOSelect := SAM_SVD.SDHC.MASKED; -- Command CRC Error Status Enable CMDCRC : EISTER_CMDCRCSelect := SAM_SVD.SDHC.MASKED; -- Command End Bit Error Status Enable CMDEND : EISTER_CMDENDSelect := SAM_SVD.SDHC.MASKED; -- Command Index Error Status Enable CMDIDX : EISTER_CMDIDXSelect := SAM_SVD.SDHC.MASKED; -- Data Timeout Error Status Enable DATTEO : EISTER_DATTEOSelect := SAM_SVD.SDHC.MASKED; -- Data CRC Error Status Enable DATCRC : EISTER_DATCRCSelect := SAM_SVD.SDHC.MASKED; -- Data End Bit Error Status Enable DATEND : EISTER_DATENDSelect := SAM_SVD.SDHC.MASKED; -- Current Limit Error Status Enable CURLIM : EISTER_CURLIMSelect := SAM_SVD.SDHC.MASKED; -- Auto CMD Error Status Enable ACMD : EISTER_ACMDSelect := SAM_SVD.SDHC.MASKED; -- ADMA Error Status Enable ADMA : EISTER_ADMASelect := SAM_SVD.SDHC.MASKED; -- unspecified Reserved_10_15 : HAL.UInt6 := 16#0#; end record with Volatile_Full_Access, Object_Size => 16, Bit_Order => System.Low_Order_First; for SDHC_EISTER_Register use record CMDTEO at 0 range 0 .. 0; CMDCRC at 0 range 1 .. 1; CMDEND at 0 range 2 .. 2; CMDIDX at 0 range 3 .. 3; DATTEO at 0 range 4 .. 4; DATCRC at 0 range 5 .. 5; DATEND at 0 range 6 .. 6; CURLIM at 0 range 7 .. 7; ACMD at 0 range 8 .. 8; ADMA at 0 range 9 .. 9; Reserved_10_15 at 0 range 10 .. 15; end record; -- Command Timeout Error Status Enable type EISTER_EMMC_MODE_CMDTEOSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for EISTER_EMMC_MODE_CMDTEOSelect use (MASKED => 0, ENABLED => 1); -- Command CRC Error Status Enable type EISTER_EMMC_MODE_CMDCRCSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for EISTER_EMMC_MODE_CMDCRCSelect use (MASKED => 0, ENABLED => 1); -- Command End Bit Error Status Enable type EISTER_EMMC_MODE_CMDENDSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for EISTER_EMMC_MODE_CMDENDSelect use (MASKED => 0, ENABLED => 1); -- Command Index Error Status Enable type EISTER_EMMC_MODE_CMDIDXSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for EISTER_EMMC_MODE_CMDIDXSelect use (MASKED => 0, ENABLED => 1); -- Data Timeout Error Status Enable type EISTER_EMMC_MODE_DATTEOSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for EISTER_EMMC_MODE_DATTEOSelect use (MASKED => 0, ENABLED => 1); -- Data CRC Error Status Enable type EISTER_EMMC_MODE_DATCRCSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for EISTER_EMMC_MODE_DATCRCSelect use (MASKED => 0, ENABLED => 1); -- Data End Bit Error Status Enable type EISTER_EMMC_MODE_DATENDSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for EISTER_EMMC_MODE_DATENDSelect use (MASKED => 0, ENABLED => 1); -- Current Limit Error Status Enable type EISTER_EMMC_MODE_CURLIMSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for EISTER_EMMC_MODE_CURLIMSelect use (MASKED => 0, ENABLED => 1); -- Auto CMD Error Status Enable type EISTER_EMMC_MODE_ACMDSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for EISTER_EMMC_MODE_ACMDSelect use (MASKED => 0, ENABLED => 1); -- ADMA Error Status Enable type EISTER_EMMC_MODE_ADMASelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for EISTER_EMMC_MODE_ADMASelect use (MASKED => 0, ENABLED => 1); -- Error Interrupt Status Enable type SDHC_EISTER_EMMC_MODE_Register is record -- Command Timeout Error Status Enable CMDTEO : EISTER_EMMC_MODE_CMDTEOSelect := SAM_SVD.SDHC.MASKED; -- Command CRC Error Status Enable CMDCRC : EISTER_EMMC_MODE_CMDCRCSelect := SAM_SVD.SDHC.MASKED; -- Command End Bit Error Status Enable CMDEND : EISTER_EMMC_MODE_CMDENDSelect := SAM_SVD.SDHC.MASKED; -- Command Index Error Status Enable CMDIDX : EISTER_EMMC_MODE_CMDIDXSelect := SAM_SVD.SDHC.MASKED; -- Data Timeout Error Status Enable DATTEO : EISTER_EMMC_MODE_DATTEOSelect := SAM_SVD.SDHC.MASKED; -- Data CRC Error Status Enable DATCRC : EISTER_EMMC_MODE_DATCRCSelect := SAM_SVD.SDHC.MASKED; -- Data End Bit Error Status Enable DATEND : EISTER_EMMC_MODE_DATENDSelect := SAM_SVD.SDHC.MASKED; -- Current Limit Error Status Enable CURLIM : EISTER_EMMC_MODE_CURLIMSelect := SAM_SVD.SDHC.MASKED; -- Auto CMD Error Status Enable ACMD : EISTER_EMMC_MODE_ACMDSelect := SAM_SVD.SDHC.MASKED; -- ADMA Error Status Enable ADMA : EISTER_EMMC_MODE_ADMASelect := SAM_SVD.SDHC.MASKED; -- unspecified Reserved_10_11 : HAL.UInt2 := 16#0#; -- Boot Acknowledge Error Status Enable BOOTAE : Boolean := False; -- unspecified Reserved_13_15 : HAL.UInt3 := 16#0#; end record with Volatile_Full_Access, Object_Size => 16, Bit_Order => System.Low_Order_First; for SDHC_EISTER_EMMC_MODE_Register use record CMDTEO at 0 range 0 .. 0; CMDCRC at 0 range 1 .. 1; CMDEND at 0 range 2 .. 2; CMDIDX at 0 range 3 .. 3; DATTEO at 0 range 4 .. 4; DATCRC at 0 range 5 .. 5; DATEND at 0 range 6 .. 6; CURLIM at 0 range 7 .. 7; ACMD at 0 range 8 .. 8; ADMA at 0 range 9 .. 9; Reserved_10_11 at 0 range 10 .. 11; BOOTAE at 0 range 12 .. 12; Reserved_13_15 at 0 range 13 .. 15; end record; -- Command Complete Signal Enable type NISIER_CMDCSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for NISIER_CMDCSelect use (MASKED => 0, ENABLED => 1); -- Transfer Complete Signal Enable type NISIER_TRFCSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for NISIER_TRFCSelect use (MASKED => 0, ENABLED => 1); -- Block Gap Event Signal Enable type NISIER_BLKGESelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for NISIER_BLKGESelect use (MASKED => 0, ENABLED => 1); -- DMA Interrupt Signal Enable type NISIER_DMAINTSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for NISIER_DMAINTSelect use (MASKED => 0, ENABLED => 1); -- Buffer Write Ready Signal Enable type NISIER_BWRRDYSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for NISIER_BWRRDYSelect use (MASKED => 0, ENABLED => 1); -- Buffer Read Ready Signal Enable type NISIER_BRDRDYSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for NISIER_BRDRDYSelect use (MASKED => 0, ENABLED => 1); -- Card Insertion Signal Enable type NISIER_CINSSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for NISIER_CINSSelect use (MASKED => 0, ENABLED => 1); -- Card Removal Signal Enable type NISIER_CREMSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for NISIER_CREMSelect use (MASKED => 0, ENABLED => 1); -- Card Interrupt Signal Enable type NISIER_CINTSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for NISIER_CINTSelect use (MASKED => 0, ENABLED => 1); -- Normal Interrupt Signal Enable type SDHC_NISIER_Register is record -- Command Complete Signal Enable CMDC : NISIER_CMDCSelect := SAM_SVD.SDHC.MASKED; -- Transfer Complete Signal Enable TRFC : NISIER_TRFCSelect := SAM_SVD.SDHC.MASKED; -- Block Gap Event Signal Enable BLKGE : NISIER_BLKGESelect := SAM_SVD.SDHC.MASKED; -- DMA Interrupt Signal Enable DMAINT : NISIER_DMAINTSelect := SAM_SVD.SDHC.MASKED; -- Buffer Write Ready Signal Enable BWRRDY : NISIER_BWRRDYSelect := SAM_SVD.SDHC.MASKED; -- Buffer Read Ready Signal Enable BRDRDY : NISIER_BRDRDYSelect := SAM_SVD.SDHC.MASKED; -- Card Insertion Signal Enable CINS : NISIER_CINSSelect := SAM_SVD.SDHC.MASKED; -- Card Removal Signal Enable CREM : NISIER_CREMSelect := SAM_SVD.SDHC.MASKED; -- Card Interrupt Signal Enable CINT : NISIER_CINTSelect := SAM_SVD.SDHC.MASKED; -- unspecified Reserved_9_15 : HAL.UInt7 := 16#0#; end record with Volatile_Full_Access, Object_Size => 16, Bit_Order => System.Low_Order_First; for SDHC_NISIER_Register use record CMDC at 0 range 0 .. 0; TRFC at 0 range 1 .. 1; BLKGE at 0 range 2 .. 2; DMAINT at 0 range 3 .. 3; BWRRDY at 0 range 4 .. 4; BRDRDY at 0 range 5 .. 5; CINS at 0 range 6 .. 6; CREM at 0 range 7 .. 7; CINT at 0 range 8 .. 8; Reserved_9_15 at 0 range 9 .. 15; end record; -- Command Complete Signal Enable type NISIER_EMMC_MODE_CMDCSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for NISIER_EMMC_MODE_CMDCSelect use (MASKED => 0, ENABLED => 1); -- Transfer Complete Signal Enable type NISIER_EMMC_MODE_TRFCSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for NISIER_EMMC_MODE_TRFCSelect use (MASKED => 0, ENABLED => 1); -- Block Gap Event Signal Enable type NISIER_EMMC_MODE_BLKGESelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for NISIER_EMMC_MODE_BLKGESelect use (MASKED => 0, ENABLED => 1); -- DMA Interrupt Signal Enable type NISIER_EMMC_MODE_DMAINTSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for NISIER_EMMC_MODE_DMAINTSelect use (MASKED => 0, ENABLED => 1); -- Buffer Write Ready Signal Enable type NISIER_EMMC_MODE_BWRRDYSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for NISIER_EMMC_MODE_BWRRDYSelect use (MASKED => 0, ENABLED => 1); -- Buffer Read Ready Signal Enable type NISIER_EMMC_MODE_BRDRDYSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for NISIER_EMMC_MODE_BRDRDYSelect use (MASKED => 0, ENABLED => 1); -- Normal Interrupt Signal Enable type SDHC_NISIER_EMMC_MODE_Register is record -- Command Complete Signal Enable CMDC : NISIER_EMMC_MODE_CMDCSelect := SAM_SVD.SDHC.MASKED; -- Transfer Complete Signal Enable TRFC : NISIER_EMMC_MODE_TRFCSelect := SAM_SVD.SDHC.MASKED; -- Block Gap Event Signal Enable BLKGE : NISIER_EMMC_MODE_BLKGESelect := SAM_SVD.SDHC.MASKED; -- DMA Interrupt Signal Enable DMAINT : NISIER_EMMC_MODE_DMAINTSelect := SAM_SVD.SDHC.MASKED; -- Buffer Write Ready Signal Enable BWRRDY : NISIER_EMMC_MODE_BWRRDYSelect := SAM_SVD.SDHC.MASKED; -- Buffer Read Ready Signal Enable BRDRDY : NISIER_EMMC_MODE_BRDRDYSelect := SAM_SVD.SDHC.MASKED; -- unspecified Reserved_6_13 : HAL.UInt8 := 16#0#; -- Boot Acknowledge Received Signal Enable BOOTAR : Boolean := False; -- unspecified Reserved_15_15 : HAL.Bit := 16#0#; end record with Volatile_Full_Access, Object_Size => 16, Bit_Order => System.Low_Order_First; for SDHC_NISIER_EMMC_MODE_Register use record CMDC at 0 range 0 .. 0; TRFC at 0 range 1 .. 1; BLKGE at 0 range 2 .. 2; DMAINT at 0 range 3 .. 3; BWRRDY at 0 range 4 .. 4; BRDRDY at 0 range 5 .. 5; Reserved_6_13 at 0 range 6 .. 13; BOOTAR at 0 range 14 .. 14; Reserved_15_15 at 0 range 15 .. 15; end record; -- Command Timeout Error Signal Enable type EISIER_CMDTEOSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for EISIER_CMDTEOSelect use (MASKED => 0, ENABLED => 1); -- Command CRC Error Signal Enable type EISIER_CMDCRCSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for EISIER_CMDCRCSelect use (MASKED => 0, ENABLED => 1); -- Command End Bit Error Signal Enable type EISIER_CMDENDSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for EISIER_CMDENDSelect use (MASKED => 0, ENABLED => 1); -- Command Index Error Signal Enable type EISIER_CMDIDXSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for EISIER_CMDIDXSelect use (MASKED => 0, ENABLED => 1); -- Data Timeout Error Signal Enable type EISIER_DATTEOSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for EISIER_DATTEOSelect use (MASKED => 0, ENABLED => 1); -- Data CRC Error Signal Enable type EISIER_DATCRCSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for EISIER_DATCRCSelect use (MASKED => 0, ENABLED => 1); -- Data End Bit Error Signal Enable type EISIER_DATENDSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for EISIER_DATENDSelect use (MASKED => 0, ENABLED => 1); -- Current Limit Error Signal Enable type EISIER_CURLIMSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for EISIER_CURLIMSelect use (MASKED => 0, ENABLED => 1); -- Auto CMD Error Signal Enable type EISIER_ACMDSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for EISIER_ACMDSelect use (MASKED => 0, ENABLED => 1); -- ADMA Error Signal Enable type EISIER_ADMASelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for EISIER_ADMASelect use (MASKED => 0, ENABLED => 1); -- Error Interrupt Signal Enable type SDHC_EISIER_Register is record -- Command Timeout Error Signal Enable CMDTEO : EISIER_CMDTEOSelect := SAM_SVD.SDHC.MASKED; -- Command CRC Error Signal Enable CMDCRC : EISIER_CMDCRCSelect := SAM_SVD.SDHC.MASKED; -- Command End Bit Error Signal Enable CMDEND : EISIER_CMDENDSelect := SAM_SVD.SDHC.MASKED; -- Command Index Error Signal Enable CMDIDX : EISIER_CMDIDXSelect := SAM_SVD.SDHC.MASKED; -- Data Timeout Error Signal Enable DATTEO : EISIER_DATTEOSelect := SAM_SVD.SDHC.MASKED; -- Data CRC Error Signal Enable DATCRC : EISIER_DATCRCSelect := SAM_SVD.SDHC.MASKED; -- Data End Bit Error Signal Enable DATEND : EISIER_DATENDSelect := SAM_SVD.SDHC.MASKED; -- Current Limit Error Signal Enable CURLIM : EISIER_CURLIMSelect := SAM_SVD.SDHC.MASKED; -- Auto CMD Error Signal Enable ACMD : EISIER_ACMDSelect := SAM_SVD.SDHC.MASKED; -- ADMA Error Signal Enable ADMA : EISIER_ADMASelect := SAM_SVD.SDHC.MASKED; -- unspecified Reserved_10_15 : HAL.UInt6 := 16#0#; end record with Volatile_Full_Access, Object_Size => 16, Bit_Order => System.Low_Order_First; for SDHC_EISIER_Register use record CMDTEO at 0 range 0 .. 0; CMDCRC at 0 range 1 .. 1; CMDEND at 0 range 2 .. 2; CMDIDX at 0 range 3 .. 3; DATTEO at 0 range 4 .. 4; DATCRC at 0 range 5 .. 5; DATEND at 0 range 6 .. 6; CURLIM at 0 range 7 .. 7; ACMD at 0 range 8 .. 8; ADMA at 0 range 9 .. 9; Reserved_10_15 at 0 range 10 .. 15; end record; -- Command Timeout Error Signal Enable type EISIER_EMMC_MODE_CMDTEOSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for EISIER_EMMC_MODE_CMDTEOSelect use (MASKED => 0, ENABLED => 1); -- Command CRC Error Signal Enable type EISIER_EMMC_MODE_CMDCRCSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for EISIER_EMMC_MODE_CMDCRCSelect use (MASKED => 0, ENABLED => 1); -- Command End Bit Error Signal Enable type EISIER_EMMC_MODE_CMDENDSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for EISIER_EMMC_MODE_CMDENDSelect use (MASKED => 0, ENABLED => 1); -- Command Index Error Signal Enable type EISIER_EMMC_MODE_CMDIDXSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for EISIER_EMMC_MODE_CMDIDXSelect use (MASKED => 0, ENABLED => 1); -- Data Timeout Error Signal Enable type EISIER_EMMC_MODE_DATTEOSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for EISIER_EMMC_MODE_DATTEOSelect use (MASKED => 0, ENABLED => 1); -- Data CRC Error Signal Enable type EISIER_EMMC_MODE_DATCRCSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for EISIER_EMMC_MODE_DATCRCSelect use (MASKED => 0, ENABLED => 1); -- Data End Bit Error Signal Enable type EISIER_EMMC_MODE_DATENDSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for EISIER_EMMC_MODE_DATENDSelect use (MASKED => 0, ENABLED => 1); -- Current Limit Error Signal Enable type EISIER_EMMC_MODE_CURLIMSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for EISIER_EMMC_MODE_CURLIMSelect use (MASKED => 0, ENABLED => 1); -- Auto CMD Error Signal Enable type EISIER_EMMC_MODE_ACMDSelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for EISIER_EMMC_MODE_ACMDSelect use (MASKED => 0, ENABLED => 1); -- ADMA Error Signal Enable type EISIER_EMMC_MODE_ADMASelect is (-- Masked MASKED, -- Enabled ENABLED) with Size => 1; for EISIER_EMMC_MODE_ADMASelect use (MASKED => 0, ENABLED => 1); -- Error Interrupt Signal Enable type SDHC_EISIER_EMMC_MODE_Register is record -- Command Timeout Error Signal Enable CMDTEO : EISIER_EMMC_MODE_CMDTEOSelect := SAM_SVD.SDHC.MASKED; -- Command CRC Error Signal Enable CMDCRC : EISIER_EMMC_MODE_CMDCRCSelect := SAM_SVD.SDHC.MASKED; -- Command End Bit Error Signal Enable CMDEND : EISIER_EMMC_MODE_CMDENDSelect := SAM_SVD.SDHC.MASKED; -- Command Index Error Signal Enable CMDIDX : EISIER_EMMC_MODE_CMDIDXSelect := SAM_SVD.SDHC.MASKED; -- Data Timeout Error Signal Enable DATTEO : EISIER_EMMC_MODE_DATTEOSelect := SAM_SVD.SDHC.MASKED; -- Data CRC Error Signal Enable DATCRC : EISIER_EMMC_MODE_DATCRCSelect := SAM_SVD.SDHC.MASKED; -- Data End Bit Error Signal Enable DATEND : EISIER_EMMC_MODE_DATENDSelect := SAM_SVD.SDHC.MASKED; -- Current Limit Error Signal Enable CURLIM : EISIER_EMMC_MODE_CURLIMSelect := SAM_SVD.SDHC.MASKED; -- Auto CMD Error Signal Enable ACMD : EISIER_EMMC_MODE_ACMDSelect := SAM_SVD.SDHC.MASKED; -- ADMA Error Signal Enable ADMA : EISIER_EMMC_MODE_ADMASelect := SAM_SVD.SDHC.MASKED; -- unspecified Reserved_10_11 : HAL.UInt2 := 16#0#; -- Boot Acknowledge Error Signal Enable BOOTAE : Boolean := False; -- unspecified Reserved_13_15 : HAL.UInt3 := 16#0#; end record with Volatile_Full_Access, Object_Size => 16, Bit_Order => System.Low_Order_First; for SDHC_EISIER_EMMC_MODE_Register use record CMDTEO at 0 range 0 .. 0; CMDCRC at 0 range 1 .. 1; CMDEND at 0 range 2 .. 2; CMDIDX at 0 range 3 .. 3; DATTEO at 0 range 4 .. 4; DATCRC at 0 range 5 .. 5; DATEND at 0 range 6 .. 6; CURLIM at 0 range 7 .. 7; ACMD at 0 range 8 .. 8; ADMA at 0 range 9 .. 9; Reserved_10_11 at 0 range 10 .. 11; BOOTAE at 0 range 12 .. 12; Reserved_13_15 at 0 range 13 .. 15; end record; -- Auto CMD12 Not Executed type ACESR_ACMD12NESelect is (-- Executed EXEC, -- Not executed NOT_EXEC) with Size => 1; for ACESR_ACMD12NESelect use (EXEC => 0, NOT_EXEC => 1); -- Auto CMD Timeout Error type ACESR_ACMDTEOSelect is (-- No error NO, -- Timeout YES) with Size => 1; for ACESR_ACMDTEOSelect use (NO => 0, YES => 1); -- Auto CMD CRC Error type ACESR_ACMDCRCSelect is (-- No error NO, -- CRC Error Generated YES) with Size => 1; for ACESR_ACMDCRCSelect use (NO => 0, YES => 1); -- Auto CMD End Bit Error type ACESR_ACMDENDSelect is (-- No error NO, -- End Bit Error Generated YES) with Size => 1; for ACESR_ACMDENDSelect use (NO => 0, YES => 1); -- Auto CMD Index Error type ACESR_ACMDIDXSelect is (-- No error NO, -- Error YES) with Size => 1; for ACESR_ACMDIDXSelect use (NO => 0, YES => 1); -- Command not Issued By Auto CMD12 Error type ACESR_CMDNISelect is (-- No error OK, -- Not Issued NOT_ISSUED) with Size => 1; for ACESR_CMDNISelect use (OK => 0, NOT_ISSUED => 1); -- Auto CMD Error Status type SDHC_ACESR_Register is record -- Read-only. Auto CMD12 Not Executed ACMD12NE : ACESR_ACMD12NESelect; -- Read-only. Auto CMD Timeout Error ACMDTEO : ACESR_ACMDTEOSelect; -- Read-only. Auto CMD CRC Error ACMDCRC : ACESR_ACMDCRCSelect; -- Read-only. Auto CMD End Bit Error ACMDEND : ACESR_ACMDENDSelect; -- Read-only. Auto CMD Index Error ACMDIDX : ACESR_ACMDIDXSelect; -- unspecified Reserved_5_6 : HAL.UInt2; -- Read-only. Command not Issued By Auto CMD12 Error CMDNI : ACESR_CMDNISelect; -- unspecified Reserved_8_15 : HAL.UInt8; end record with Volatile_Full_Access, Object_Size => 16, Bit_Order => System.Low_Order_First; for SDHC_ACESR_Register use record ACMD12NE at 0 range 0 .. 0; ACMDTEO at 0 range 1 .. 1; ACMDCRC at 0 range 2 .. 2; ACMDEND at 0 range 3 .. 3; ACMDIDX at 0 range 4 .. 4; Reserved_5_6 at 0 range 5 .. 6; CMDNI at 0 range 7 .. 7; Reserved_8_15 at 0 range 8 .. 15; end record; -- UHS Mode Select type HC2R_UHSMSSelect is (-- SDR12 SDR12, -- SDR25 SDR25, -- SDR50 SDR50, -- SDR104 SDR104, -- DDR50 DDR50) with Size => 3; for HC2R_UHSMSSelect use (SDR12 => 0, SDR25 => 1, SDR50 => 2, SDR104 => 3, DDR50 => 4); -- 1.8V Signaling Enable type HC2R_VS18ENSelect is (-- 3.3V Signaling S33V, -- 1.8V Signaling S18V) with Size => 1; for HC2R_VS18ENSelect use (S33V => 0, S18V => 1); -- Driver Strength Select type HC2R_DRVSELSelect is (-- Driver Type B is Selected (Default) B, -- Driver Type A is Selected A, -- Driver Type C is Selected C, -- Driver Type D is Selected D) with Size => 2; for HC2R_DRVSELSelect use (B => 0, A => 1, C => 2, D => 3); -- Execute Tuning type HC2R_EXTUNSelect is (-- Not Tuned or Tuning Completed NO, -- Execute Tuning REQUESTED) with Size => 1; for HC2R_EXTUNSelect use (NO => 0, REQUESTED => 1); -- Sampling Clock Select type HC2R_SLCKSELSelect is (-- Fixed clock is used to sample data FIXED, -- Tuned clock is used to sample data TUNED) with Size => 1; for HC2R_SLCKSELSelect use (FIXED => 0, TUNED => 1); -- Asynchronous Interrupt Enable type HC2R_ASINTENSelect is (-- Disabled DISABLED, -- Enabled ENABLED) with Size => 1; for HC2R_ASINTENSelect use (DISABLED => 0, ENABLED => 1); -- Preset Value Enable type HC2R_PVALENSelect is (-- SDCLK and Driver Strength are controlled by Host Controller HOST, -- Automatic Selection by Preset Value is Enabled AUTO) with Size => 1; for HC2R_PVALENSelect use (HOST => 0, AUTO => 1); -- Host Control 2 type SDHC_HC2R_Register is record -- UHS Mode Select UHSMS : HC2R_UHSMSSelect := SAM_SVD.SDHC.SDR12; -- 1.8V Signaling Enable VS18EN : HC2R_VS18ENSelect := SAM_SVD.SDHC.S33V; -- Driver Strength Select DRVSEL : HC2R_DRVSELSelect := SAM_SVD.SDHC.B; -- Execute Tuning EXTUN : HC2R_EXTUNSelect := SAM_SVD.SDHC.NO; -- Sampling Clock Select SLCKSEL : HC2R_SLCKSELSelect := SAM_SVD.SDHC.FIXED; -- unspecified Reserved_8_13 : HAL.UInt6 := 16#0#; -- Asynchronous Interrupt Enable ASINTEN : HC2R_ASINTENSelect := SAM_SVD.SDHC.DISABLED; -- Preset Value Enable PVALEN : HC2R_PVALENSelect := SAM_SVD.SDHC.HOST; end record with Volatile_Full_Access, Object_Size => 16, Bit_Order => System.Low_Order_First; for SDHC_HC2R_Register use record UHSMS at 0 range 0 .. 2; VS18EN at 0 range 3 .. 3; DRVSEL at 0 range 4 .. 5; EXTUN at 0 range 6 .. 6; SLCKSEL at 0 range 7 .. 7; Reserved_8_13 at 0 range 8 .. 13; ASINTEN at 0 range 14 .. 14; PVALEN at 0 range 15 .. 15; end record; -- HS200 Mode Enable type HC2R_EMMC_MODE_HS200ENSelect is (-- SDR12 SDR12, -- SDR25 SDR25, -- SDR50 SDR50, -- SDR104 SDR104, -- DDR50 DDR50) with Size => 4; for HC2R_EMMC_MODE_HS200ENSelect use (SDR12 => 0, SDR25 => 1, SDR50 => 2, SDR104 => 3, DDR50 => 4); -- Driver Strength Select type HC2R_EMMC_MODE_DRVSELSelect is (-- Driver Type B is Selected (Default) B, -- Driver Type A is Selected A, -- Driver Type C is Selected C, -- Driver Type D is Selected D) with Size => 2; for HC2R_EMMC_MODE_DRVSELSelect use (B => 0, A => 1, C => 2, D => 3); -- Execute Tuning type HC2R_EMMC_MODE_EXTUNSelect is (-- Not Tuned or Tuning Completed NO, -- Execute Tuning REQUESTED) with Size => 1; for HC2R_EMMC_MODE_EXTUNSelect use (NO => 0, REQUESTED => 1); -- Sampling Clock Select type HC2R_EMMC_MODE_SLCKSELSelect is (-- Fixed clock is used to sample data FIXED, -- Tuned clock is used to sample data TUNED) with Size => 1; for HC2R_EMMC_MODE_SLCKSELSelect use (FIXED => 0, TUNED => 1); -- Preset Value Enable type HC2R_EMMC_MODE_PVALENSelect is (-- SDCLK and Driver Strength are controlled by Host Controller HOST, -- Automatic Selection by Preset Value is Enabled AUTO) with Size => 1; for HC2R_EMMC_MODE_PVALENSelect use (HOST => 0, AUTO => 1); -- Host Control 2 type SDHC_HC2R_EMMC_MODE_Register is record -- HS200 Mode Enable HS200EN : HC2R_EMMC_MODE_HS200ENSelect := SAM_SVD.SDHC.SDR12; -- Driver Strength Select DRVSEL : HC2R_EMMC_MODE_DRVSELSelect := SAM_SVD.SDHC.B; -- Execute Tuning EXTUN : HC2R_EMMC_MODE_EXTUNSelect := SAM_SVD.SDHC.NO; -- Sampling Clock Select SLCKSEL : HC2R_EMMC_MODE_SLCKSELSelect := SAM_SVD.SDHC.FIXED; -- unspecified Reserved_8_14 : HAL.UInt7 := 16#0#; -- Preset Value Enable PVALEN : HC2R_EMMC_MODE_PVALENSelect := SAM_SVD.SDHC.HOST; end record with Volatile_Full_Access, Object_Size => 16, Bit_Order => System.Low_Order_First; for SDHC_HC2R_EMMC_MODE_Register use record HS200EN at 0 range 0 .. 3; DRVSEL at 0 range 4 .. 5; EXTUN at 0 range 6 .. 6; SLCKSEL at 0 range 7 .. 7; Reserved_8_14 at 0 range 8 .. 14; PVALEN at 0 range 15 .. 15; end record; -- Timeout Clock Frequency type CA0R_TEOCLKFSelect is (-- Get information via another method OTHER) with Size => 6; for CA0R_TEOCLKFSelect use (OTHER => 0); -- Timeout Clock Unit type CA0R_TEOCLKUSelect is (-- KHz KHZ, -- MHz MHZ) with Size => 1; for CA0R_TEOCLKUSelect use (KHZ => 0, MHZ => 1); -- Base Clock Frequency type CA0R_BASECLKFSelect is (-- Get information via another method OTHER) with Size => 8; for CA0R_BASECLKFSelect use (OTHER => 0); -- Max Block Length type CA0R_MAXBLKLSelect is (-- 512 bytes Val_512, -- 1024 bytes Val_1024, -- 2048 bytes Val_2048) with Size => 2; for CA0R_MAXBLKLSelect use (Val_512 => 0, Val_1024 => 1, Val_2048 => 2); -- 8-bit Support for Embedded Device type CA0R_ED8SUPSelect is (-- 8-bit Bus Width not Supported NO, -- 8-bit Bus Width Supported YES) with Size => 1; for CA0R_ED8SUPSelect use (NO => 0, YES => 1); -- ADMA2 Support type CA0R_ADMA2SUPSelect is (-- ADMA2 not Supported NO, -- ADMA2 Supported YES) with Size => 1; for CA0R_ADMA2SUPSelect use (NO => 0, YES => 1); -- High Speed Support type CA0R_HSSUPSelect is (-- High Speed not Supported NO, -- High Speed Supported YES) with Size => 1; for CA0R_HSSUPSelect use (NO => 0, YES => 1); -- SDMA Support type CA0R_SDMASUPSelect is (-- SDMA not Supported NO, -- SDMA Supported YES) with Size => 1; for CA0R_SDMASUPSelect use (NO => 0, YES => 1); -- Suspend/Resume Support type CA0R_SRSUPSelect is (-- Suspend/Resume not Supported NO, -- Suspend/Resume Supported YES) with Size => 1; for CA0R_SRSUPSelect use (NO => 0, YES => 1); -- Voltage Support 3.3V type CA0R_V33VSUPSelect is (-- 3.3V Not Supported NO, -- 3.3V Supported YES) with Size => 1; for CA0R_V33VSUPSelect use (NO => 0, YES => 1); -- Voltage Support 3.0V type CA0R_V30VSUPSelect is (-- 3.0V Not Supported NO, -- 3.0V Supported YES) with Size => 1; for CA0R_V30VSUPSelect use (NO => 0, YES => 1); -- Voltage Support 1.8V type CA0R_V18VSUPSelect is (-- 1.8V Not Supported NO, -- 1.8V Supported YES) with Size => 1; for CA0R_V18VSUPSelect use (NO => 0, YES => 1); -- 64-Bit System Bus Support type CA0R_SB64SUPSelect is (-- 32-bit Address Descriptors and System Bus NO, -- 64-bit Address Descriptors and System Bus YES) with Size => 1; for CA0R_SB64SUPSelect use (NO => 0, YES => 1); -- Asynchronous Interrupt Support type CA0R_ASINTSUPSelect is (-- Asynchronous Interrupt not Supported NO, -- Asynchronous Interrupt supported YES) with Size => 1; for CA0R_ASINTSUPSelect use (NO => 0, YES => 1); -- Slot Type type CA0R_SLTYPESelect is (-- Removable Card Slot REMOVABLE, -- Embedded Slot for One Device EMBEDDED) with Size => 2; for CA0R_SLTYPESelect use (REMOVABLE => 0, EMBEDDED => 1); -- Capabilities 0 type SDHC_CA0R_Register is record -- Read-only. Timeout Clock Frequency TEOCLKF : CA0R_TEOCLKFSelect; -- unspecified Reserved_6_6 : HAL.Bit; -- Read-only. Timeout Clock Unit TEOCLKU : CA0R_TEOCLKUSelect; -- Read-only. Base Clock Frequency BASECLKF : CA0R_BASECLKFSelect; -- Read-only. Max Block Length MAXBLKL : CA0R_MAXBLKLSelect; -- Read-only. 8-bit Support for Embedded Device ED8SUP : CA0R_ED8SUPSelect; -- Read-only. ADMA2 Support ADMA2SUP : CA0R_ADMA2SUPSelect; -- unspecified Reserved_20_20 : HAL.Bit; -- Read-only. High Speed Support HSSUP : CA0R_HSSUPSelect; -- Read-only. SDMA Support SDMASUP : CA0R_SDMASUPSelect; -- Read-only. Suspend/Resume Support SRSUP : CA0R_SRSUPSelect; -- Read-only. Voltage Support 3.3V V33VSUP : CA0R_V33VSUPSelect; -- Read-only. Voltage Support 3.0V V30VSUP : CA0R_V30VSUPSelect; -- Read-only. Voltage Support 1.8V V18VSUP : CA0R_V18VSUPSelect; -- unspecified Reserved_27_27 : HAL.Bit; -- Read-only. 64-Bit System Bus Support SB64SUP : CA0R_SB64SUPSelect; -- Read-only. Asynchronous Interrupt Support ASINTSUP : CA0R_ASINTSUPSelect; -- Read-only. Slot Type SLTYPE : CA0R_SLTYPESelect; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for SDHC_CA0R_Register use record TEOCLKF at 0 range 0 .. 5; Reserved_6_6 at 0 range 6 .. 6; TEOCLKU at 0 range 7 .. 7; BASECLKF at 0 range 8 .. 15; MAXBLKL at 0 range 16 .. 17; ED8SUP at 0 range 18 .. 18; ADMA2SUP at 0 range 19 .. 19; Reserved_20_20 at 0 range 20 .. 20; HSSUP at 0 range 21 .. 21; SDMASUP at 0 range 22 .. 22; SRSUP at 0 range 23 .. 23; V33VSUP at 0 range 24 .. 24; V30VSUP at 0 range 25 .. 25; V18VSUP at 0 range 26 .. 26; Reserved_27_27 at 0 range 27 .. 27; SB64SUP at 0 range 28 .. 28; ASINTSUP at 0 range 29 .. 29; SLTYPE at 0 range 30 .. 31; end record; -- SDR50 Support type CA1R_SDR50SUPSelect is (-- SDR50 is Not Supported NO, -- SDR50 is Supported YES) with Size => 1; for CA1R_SDR50SUPSelect use (NO => 0, YES => 1); -- SDR104 Support type CA1R_SDR104SUPSelect is (-- SDR104 is Not Supported NO, -- SDR104 is Supported YES) with Size => 1; for CA1R_SDR104SUPSelect use (NO => 0, YES => 1); -- DDR50 Support type CA1R_DDR50SUPSelect is (-- DDR50 is Not Supported NO, -- DDR50 is Supported YES) with Size => 1; for CA1R_DDR50SUPSelect use (NO => 0, YES => 1); -- Driver Type A Support type CA1R_DRVASUPSelect is (-- Driver Type A is Not Supported NO, -- Driver Type A is Supported YES) with Size => 1; for CA1R_DRVASUPSelect use (NO => 0, YES => 1); -- Driver Type C Support type CA1R_DRVCSUPSelect is (-- Driver Type C is Not Supported NO, -- Driver Type C is Supported YES) with Size => 1; for CA1R_DRVCSUPSelect use (NO => 0, YES => 1); -- Driver Type D Support type CA1R_DRVDSUPSelect is (-- Driver Type D is Not Supported NO, -- Driver Type D is Supported YES) with Size => 1; for CA1R_DRVDSUPSelect use (NO => 0, YES => 1); -- Timer Count for Re-Tuning type CA1R_TCNTRTSelect is (-- Re-Tuning Timer disabled DISABLED, -- 1 second Val_1S, -- 2 seconds Val_2S, -- 4 seconds Val_4S, -- 8 seconds Val_8S, -- 16 seconds Val_16S, -- 32 seconds Val_32S, -- 64 seconds Val_64S, -- 128 seconds Val_128S, -- 256 seconds Val_256S, -- 512 seconds Val_512S, -- 1024 seconds Val_1024S, -- Get information from other source OTHER) with Size => 4; for CA1R_TCNTRTSelect use (DISABLED => 0, Val_1S => 1, Val_2S => 2, Val_4S => 3, Val_8S => 4, Val_16S => 5, Val_32S => 6, Val_64S => 7, Val_128S => 8, Val_256S => 9, Val_512S => 10, Val_1024S => 11, OTHER => 15); -- Use Tuning for SDR50 type CA1R_TSDR50Select is (-- SDR50 does not require tuning NO, -- SDR50 requires tuning YES) with Size => 1; for CA1R_TSDR50Select use (NO => 0, YES => 1); -- Clock Multiplier type CA1R_CLKMULTSelect is (-- Clock Multiplier is Not Supported NO) with Size => 8; for CA1R_CLKMULTSelect use (NO => 0); -- Capabilities 1 type SDHC_CA1R_Register is record -- Read-only. SDR50 Support SDR50SUP : CA1R_SDR50SUPSelect; -- Read-only. SDR104 Support SDR104SUP : CA1R_SDR104SUPSelect; -- Read-only. DDR50 Support DDR50SUP : CA1R_DDR50SUPSelect; -- unspecified Reserved_3_3 : HAL.Bit; -- Read-only. Driver Type A Support DRVASUP : CA1R_DRVASUPSelect; -- Read-only. Driver Type C Support DRVCSUP : CA1R_DRVCSUPSelect; -- Read-only. Driver Type D Support DRVDSUP : CA1R_DRVDSUPSelect; -- unspecified Reserved_7_7 : HAL.Bit; -- Read-only. Timer Count for Re-Tuning TCNTRT : CA1R_TCNTRTSelect; -- unspecified Reserved_12_12 : HAL.Bit; -- Read-only. Use Tuning for SDR50 TSDR50 : CA1R_TSDR50Select; -- unspecified Reserved_14_15 : HAL.UInt2; -- Read-only. Clock Multiplier CLKMULT : CA1R_CLKMULTSelect; -- unspecified Reserved_24_31 : HAL.UInt8; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for SDHC_CA1R_Register use record SDR50SUP at 0 range 0 .. 0; SDR104SUP at 0 range 1 .. 1; DDR50SUP at 0 range 2 .. 2; Reserved_3_3 at 0 range 3 .. 3; DRVASUP at 0 range 4 .. 4; DRVCSUP at 0 range 5 .. 5; DRVDSUP at 0 range 6 .. 6; Reserved_7_7 at 0 range 7 .. 7; TCNTRT at 0 range 8 .. 11; Reserved_12_12 at 0 range 12 .. 12; TSDR50 at 0 range 13 .. 13; Reserved_14_15 at 0 range 14 .. 15; CLKMULT at 0 range 16 .. 23; Reserved_24_31 at 0 range 24 .. 31; end record; -- Maximum Current for 3.3V type MCCAR_MAXCUR33VSelect is (-- Get information via another method OTHER, -- 4mA Val_4MA, -- 8mA Val_8MA, -- 12mA Val_12MA) with Size => 8; for MCCAR_MAXCUR33VSelect use (OTHER => 0, Val_4MA => 1, Val_8MA => 2, Val_12MA => 3); -- Maximum Current for 3.0V type MCCAR_MAXCUR30VSelect is (-- Get information via another method OTHER, -- 4mA Val_4MA, -- 8mA Val_8MA, -- 12mA Val_12MA) with Size => 8; for MCCAR_MAXCUR30VSelect use (OTHER => 0, Val_4MA => 1, Val_8MA => 2, Val_12MA => 3); -- Maximum Current for 1.8V type MCCAR_MAXCUR18VSelect is (-- Get information via another method OTHER, -- 4mA Val_4MA, -- 8mA Val_8MA, -- 12mA Val_12MA) with Size => 8; for MCCAR_MAXCUR18VSelect use (OTHER => 0, Val_4MA => 1, Val_8MA => 2, Val_12MA => 3); -- Maximum Current Capabilities type SDHC_MCCAR_Register is record -- Read-only. Maximum Current for 3.3V MAXCUR33V : MCCAR_MAXCUR33VSelect; -- Read-only. Maximum Current for 3.0V MAXCUR30V : MCCAR_MAXCUR30VSelect; -- Read-only. Maximum Current for 1.8V MAXCUR18V : MCCAR_MAXCUR18VSelect; -- unspecified Reserved_24_31 : HAL.UInt8; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for SDHC_MCCAR_Register use record MAXCUR33V at 0 range 0 .. 7; MAXCUR30V at 0 range 8 .. 15; MAXCUR18V at 0 range 16 .. 23; Reserved_24_31 at 0 range 24 .. 31; end record; -- Force Event for Auto CMD12 Not Executed type FERACES_ACMD12NESelect is (-- No Interrupt NO, -- Interrupt is generated YES) with Size => 1; for FERACES_ACMD12NESelect use (NO => 0, YES => 1); -- Force Event for Auto CMD Timeout Error type FERACES_ACMDTEOSelect is (-- No Interrupt NO, -- Interrupt is generated YES) with Size => 1; for FERACES_ACMDTEOSelect use (NO => 0, YES => 1); -- Force Event for Auto CMD CRC Error type FERACES_ACMDCRCSelect is (-- No Interrupt NO, -- Interrupt is generated YES) with Size => 1; for FERACES_ACMDCRCSelect use (NO => 0, YES => 1); -- Force Event for Auto CMD End Bit Error type FERACES_ACMDENDSelect is (-- No Interrupt NO, -- Interrupt is generated YES) with Size => 1; for FERACES_ACMDENDSelect use (NO => 0, YES => 1); -- Force Event for Auto CMD Index Error type FERACES_ACMDIDXSelect is (-- No Interrupt NO, -- Interrupt is generated YES) with Size => 1; for FERACES_ACMDIDXSelect use (NO => 0, YES => 1); -- Force Event for Command Not Issued By Auto CMD12 Error type FERACES_CMDNISelect is (-- No Interrupt NO, -- Interrupt is generated YES) with Size => 1; for FERACES_CMDNISelect use (NO => 0, YES => 1); -- Force Event for Auto CMD Error Status type SDHC_FERACES_Register is record -- Write-only. Force Event for Auto CMD12 Not Executed ACMD12NE : FERACES_ACMD12NESelect := SAM_SVD.SDHC.NO; -- Write-only. Force Event for Auto CMD Timeout Error ACMDTEO : FERACES_ACMDTEOSelect := SAM_SVD.SDHC.NO; -- Write-only. Force Event for Auto CMD CRC Error ACMDCRC : FERACES_ACMDCRCSelect := SAM_SVD.SDHC.NO; -- Write-only. Force Event for Auto CMD End Bit Error ACMDEND : FERACES_ACMDENDSelect := SAM_SVD.SDHC.NO; -- Write-only. Force Event for Auto CMD Index Error ACMDIDX : FERACES_ACMDIDXSelect := SAM_SVD.SDHC.NO; -- unspecified Reserved_5_6 : HAL.UInt2 := 16#0#; -- Write-only. Force Event for Command Not Issued By Auto CMD12 Error CMDNI : FERACES_CMDNISelect := SAM_SVD.SDHC.NO; -- unspecified Reserved_8_15 : HAL.UInt8 := 16#0#; end record with Volatile_Full_Access, Object_Size => 16, Bit_Order => System.Low_Order_First; for SDHC_FERACES_Register use record ACMD12NE at 0 range 0 .. 0; ACMDTEO at 0 range 1 .. 1; ACMDCRC at 0 range 2 .. 2; ACMDEND at 0 range 3 .. 3; ACMDIDX at 0 range 4 .. 4; Reserved_5_6 at 0 range 5 .. 6; CMDNI at 0 range 7 .. 7; Reserved_8_15 at 0 range 8 .. 15; end record; -- Force Event for Command Timeout Error type FEREIS_CMDTEOSelect is (-- No Interrupt NO, -- Interrupt is generated YES) with Size => 1; for FEREIS_CMDTEOSelect use (NO => 0, YES => 1); -- Force Event for Command CRC Error type FEREIS_CMDCRCSelect is (-- No Interrupt NO, -- Interrupt is generated YES) with Size => 1; for FEREIS_CMDCRCSelect use (NO => 0, YES => 1); -- Force Event for Command End Bit Error type FEREIS_CMDENDSelect is (-- No Interrupt NO, -- Interrupt is generated YES) with Size => 1; for FEREIS_CMDENDSelect use (NO => 0, YES => 1); -- Force Event for Command Index Error type FEREIS_CMDIDXSelect is (-- No Interrupt NO, -- Interrupt is generated YES) with Size => 1; for FEREIS_CMDIDXSelect use (NO => 0, YES => 1); -- Force Event for Data Timeout Error type FEREIS_DATTEOSelect is (-- No Interrupt NO, -- Interrupt is generated YES) with Size => 1; for FEREIS_DATTEOSelect use (NO => 0, YES => 1); -- Force Event for Data CRC Error type FEREIS_DATCRCSelect is (-- No Interrupt NO, -- Interrupt is generated YES) with Size => 1; for FEREIS_DATCRCSelect use (NO => 0, YES => 1); -- Force Event for Data End Bit Error type FEREIS_DATENDSelect is (-- No Interrupt NO, -- Interrupt is generated YES) with Size => 1; for FEREIS_DATENDSelect use (NO => 0, YES => 1); -- Force Event for Current Limit Error type FEREIS_CURLIMSelect is (-- No Interrupt NO, -- Interrupt is generated YES) with Size => 1; for FEREIS_CURLIMSelect use (NO => 0, YES => 1); -- Force Event for Auto CMD Error type FEREIS_ACMDSelect is (-- No Interrupt NO, -- Interrupt is generated YES) with Size => 1; for FEREIS_ACMDSelect use (NO => 0, YES => 1); -- Force Event for ADMA Error type FEREIS_ADMASelect is (-- No Interrupt NO, -- Interrupt is generated YES) with Size => 1; for FEREIS_ADMASelect use (NO => 0, YES => 1); -- Force Event for Boot Acknowledge Error type FEREIS_BOOTAESelect is (-- No Interrupt NO, -- Interrupt is generated YES) with Size => 1; for FEREIS_BOOTAESelect use (NO => 0, YES => 1); -- Force Event for Error Interrupt Status type SDHC_FEREIS_Register is record -- Write-only. Force Event for Command Timeout Error CMDTEO : FEREIS_CMDTEOSelect := SAM_SVD.SDHC.NO; -- Write-only. Force Event for Command CRC Error CMDCRC : FEREIS_CMDCRCSelect := SAM_SVD.SDHC.NO; -- Write-only. Force Event for Command End Bit Error CMDEND : FEREIS_CMDENDSelect := SAM_SVD.SDHC.NO; -- Write-only. Force Event for Command Index Error CMDIDX : FEREIS_CMDIDXSelect := SAM_SVD.SDHC.NO; -- Write-only. Force Event for Data Timeout Error DATTEO : FEREIS_DATTEOSelect := SAM_SVD.SDHC.NO; -- Write-only. Force Event for Data CRC Error DATCRC : FEREIS_DATCRCSelect := SAM_SVD.SDHC.NO; -- Write-only. Force Event for Data End Bit Error DATEND : FEREIS_DATENDSelect := SAM_SVD.SDHC.NO; -- Write-only. Force Event for Current Limit Error CURLIM : FEREIS_CURLIMSelect := SAM_SVD.SDHC.NO; -- Write-only. Force Event for Auto CMD Error ACMD : FEREIS_ACMDSelect := SAM_SVD.SDHC.NO; -- Write-only. Force Event for ADMA Error ADMA : FEREIS_ADMASelect := SAM_SVD.SDHC.NO; -- unspecified Reserved_10_11 : HAL.UInt2 := 16#0#; -- Write-only. Force Event for Boot Acknowledge Error BOOTAE : FEREIS_BOOTAESelect := SAM_SVD.SDHC.NO; -- unspecified Reserved_13_15 : HAL.UInt3 := 16#0#; end record with Volatile_Full_Access, Object_Size => 16, Bit_Order => System.Low_Order_First; for SDHC_FEREIS_Register use record CMDTEO at 0 range 0 .. 0; CMDCRC at 0 range 1 .. 1; CMDEND at 0 range 2 .. 2; CMDIDX at 0 range 3 .. 3; DATTEO at 0 range 4 .. 4; DATCRC at 0 range 5 .. 5; DATEND at 0 range 6 .. 6; CURLIM at 0 range 7 .. 7; ACMD at 0 range 8 .. 8; ADMA at 0 range 9 .. 9; Reserved_10_11 at 0 range 10 .. 11; BOOTAE at 0 range 12 .. 12; Reserved_13_15 at 0 range 13 .. 15; end record; -- ADMA Error State type AESR_ERRSTSelect is (-- ST_STOP (Stop DMA) STOP, -- ST_FDS (Fetch Descriptor) FDS, -- ST_TFR (Transfer Data) TFR) with Size => 2; for AESR_ERRSTSelect use (STOP => 0, FDS => 1, TFR => 3); -- ADMA Length Mismatch Error type AESR_LMISSelect is (-- No Error NO, -- Error YES) with Size => 1; for AESR_LMISSelect use (NO => 0, YES => 1); -- ADMA Error Status type SDHC_AESR_Register is record -- Read-only. ADMA Error State ERRST : AESR_ERRSTSelect; -- Read-only. ADMA Length Mismatch Error LMIS : AESR_LMISSelect; -- unspecified Reserved_3_7 : HAL.UInt5; end record with Volatile_Full_Access, Object_Size => 8, Bit_Order => System.Low_Order_First; for SDHC_AESR_Register use record ERRST at 0 range 0 .. 1; LMIS at 0 range 2 .. 2; Reserved_3_7 at 0 range 3 .. 7; end record; subtype SDHC_PVR_SDCLKFSEL_Field is HAL.UInt10; -- Clock Generator Select Value for Initialization type PVR_CLKGSELSelect is (-- Host Controller Ver2.00 Compatible Clock Generator (Divider) DIV, -- Programmable Clock Generator PROG) with Size => 1; for PVR_CLKGSELSelect use (DIV => 0, PROG => 1); -- Driver Strength Select Value for Initialization type PVR_DRVSELSelect is (-- Driver Type B is Selected B, -- Driver Type A is Selected A, -- Driver Type C is Selected C, -- Driver Type D is Selected D) with Size => 2; for PVR_DRVSELSelect use (B => 0, A => 1, C => 2, D => 3); -- Preset Value n type SDHC_PVR_Register is record -- SDCLK Frequency Select Value for Initialization SDCLKFSEL : SDHC_PVR_SDCLKFSEL_Field := 16#0#; -- Clock Generator Select Value for Initialization CLKGSEL : PVR_CLKGSELSelect := SAM_SVD.SDHC.DIV; -- unspecified Reserved_11_13 : HAL.UInt3 := 16#0#; -- Driver Strength Select Value for Initialization DRVSEL : PVR_DRVSELSelect := SAM_SVD.SDHC.B; end record with Volatile_Full_Access, Object_Size => 16, Bit_Order => System.Low_Order_First; for SDHC_PVR_Register use record SDCLKFSEL at 0 range 0 .. 9; CLKGSEL at 0 range 10 .. 10; Reserved_11_13 at 0 range 11 .. 13; DRVSEL at 0 range 14 .. 15; end record; -- Preset Value n type SDHC_PVR_Registers is array (0 .. 7) of SDHC_PVR_Register; -- Slot Interrupt Status type SDHC_SISR_Register is record -- Read-only. Interrupt Signal for Each Slot INTSSL : Boolean; -- unspecified Reserved_1_15 : HAL.UInt15; end record with Volatile_Full_Access, Object_Size => 16, Bit_Order => System.Low_Order_First; for SDHC_SISR_Register use record INTSSL at 0 range 0 .. 0; Reserved_1_15 at 0 range 1 .. 15; end record; subtype SDHC_HCVR_SVER_Field is HAL.UInt8; subtype SDHC_HCVR_VVER_Field is HAL.UInt8; -- Host Controller Version type SDHC_HCVR_Register is record -- Read-only. Spec Version SVER : SDHC_HCVR_SVER_Field; -- Read-only. Vendor Version VVER : SDHC_HCVR_VVER_Field; end record with Volatile_Full_Access, Object_Size => 16, Bit_Order => System.Low_Order_First; for SDHC_HCVR_Register use record SVER at 0 range 0 .. 7; VVER at 0 range 8 .. 15; end record; -- e.MMC Command Type type MC1R_CMDTYPSelect is (-- Not a MMC specific command NORMAL, -- Wait IRQ Command WAITIRQ, -- Stream Command STREAM, -- Boot Command BOOT) with Size => 2; for MC1R_CMDTYPSelect use (NORMAL => 0, WAITIRQ => 1, STREAM => 2, BOOT => 3); -- MMC Control 1 type SDHC_MC1R_Register is record -- e.MMC Command Type CMDTYP : MC1R_CMDTYPSelect := SAM_SVD.SDHC.NORMAL; -- unspecified Reserved_2_2 : HAL.Bit := 16#0#; -- e.MMC HSDDR Mode DDR : Boolean := False; -- e.MMC Open Drain Mode OPD : Boolean := False; -- e.MMC Boot Acknowledge Enable BOOTA : Boolean := False; -- e.MMC Reset Signal RSTN : Boolean := False; -- e.MMC Force Card Detect FCD : Boolean := False; end record with Volatile_Full_Access, Object_Size => 8, Bit_Order => System.Low_Order_First; for SDHC_MC1R_Register use record CMDTYP at 0 range 0 .. 1; Reserved_2_2 at 0 range 2 .. 2; DDR at 0 range 3 .. 3; OPD at 0 range 4 .. 4; BOOTA at 0 range 5 .. 5; RSTN at 0 range 6 .. 6; FCD at 0 range 7 .. 7; end record; -- MMC Control 2 type SDHC_MC2R_Register is record -- Write-only. e.MMC Abort Wait IRQ SRESP : Boolean := False; -- Write-only. e.MMC Abort Boot ABOOT : Boolean := False; -- unspecified Reserved_2_7 : HAL.UInt6 := 16#0#; end record with Volatile_Full_Access, Object_Size => 8, Bit_Order => System.Low_Order_First; for SDHC_MC2R_Register use record SRESP at 0 range 0 .. 0; ABOOT at 0 range 1 .. 1; Reserved_2_7 at 0 range 2 .. 7; end record; -- AHB Maximum Burst type ACR_BMAXSelect is (INCR16, INCR8, INCR4, SINGLE) with Size => 2; for ACR_BMAXSelect use (INCR16 => 0, INCR8 => 1, INCR4 => 2, SINGLE => 3); -- AHB Control type SDHC_ACR_Register is record -- AHB Maximum Burst BMAX : ACR_BMAXSelect := SAM_SVD.SDHC.INCR16; -- unspecified Reserved_2_31 : HAL.UInt30 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for SDHC_ACR_Register use record BMAX at 0 range 0 .. 1; Reserved_2_31 at 0 range 2 .. 31; end record; -- Force SDCK Disabled type CC2R_FSDCLKDSelect is (-- No effect NOEFFECT, -- SDCLK can be stopped at any time after DATA transfer.SDCLK enable forcing -- for 8 SDCLK cycles is disabled DISABLE) with Size => 1; for CC2R_FSDCLKDSelect use (NOEFFECT => 0, DISABLE => 1); -- Clock Control 2 type SDHC_CC2R_Register is record -- Force SDCK Disabled FSDCLKD : CC2R_FSDCLKDSelect := SAM_SVD.SDHC.NOEFFECT; -- unspecified Reserved_1_31 : HAL.UInt31 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for SDHC_CC2R_Register use record FSDCLKD at 0 range 0 .. 0; Reserved_1_31 at 0 range 1 .. 31; end record; subtype SDHC_CACR_KEY_Field is HAL.UInt8; -- Capabilities Control type SDHC_CACR_Register is record -- Capabilities Registers Write Enable (Required to write the correct -- frequencies in the Capabilities Registers) CAPWREN : Boolean := False; -- unspecified Reserved_1_7 : HAL.UInt7 := 16#0#; -- Key (0x46) KEY : SDHC_CACR_KEY_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 SDHC_CACR_Register use record CAPWREN at 0 range 0 .. 0; Reserved_1_7 at 0 range 1 .. 7; KEY at 0 range 8 .. 15; Reserved_16_31 at 0 range 16 .. 31; end record; -- Non-intrusive debug enable type DBGR_NIDBGSelect is (-- Debugging is intrusive (reads of BDPR from debugger are considered and -- increment the internal buffer pointer) IDBG, -- Debugging is not intrusive (reads of BDPR from debugger are discarded and -- do not increment the internal buffer pointer) NIDBG) with Size => 1; for DBGR_NIDBGSelect use (IDBG => 0, NIDBG => 1); -- Debug type SDHC_DBGR_Register is record -- Non-intrusive debug enable NIDBG : DBGR_NIDBGSelect := SAM_SVD.SDHC.IDBG; -- unspecified Reserved_1_7 : HAL.UInt7 := 16#0#; end record with Volatile_Full_Access, Object_Size => 8, Bit_Order => System.Low_Order_First; for SDHC_DBGR_Register use record NIDBG at 0 range 0 .. 0; Reserved_1_7 at 0 range 1 .. 7; end record; ----------------- -- Peripherals -- ----------------- type SDHC0_Disc is (Default, CMD23_MODE, EMMC_MODE); -- SD/MMC Host Controller type SDHC0_Peripheral (Discriminent : SDHC0_Disc := Default) is record -- Block Size BSR : aliased SDHC_BSR_Register; -- Block Count BCR : aliased HAL.UInt16; -- Argument 1 ARG1R : aliased HAL.UInt32; -- Transfer Mode TMR : aliased SDHC_TMR_Register; -- Command CR : aliased SDHC_CR_Register; -- Response RR : aliased SDHC_RR_Registers; -- Buffer Data Port BDPR : aliased HAL.UInt32; -- Present State PSR : aliased SDHC_PSR_Register; -- Power Control PCR : aliased SDHC_PCR_Register; -- Wakeup Control WCR : aliased SDHC_WCR_Register; -- Clock Control CCR : aliased SDHC_CCR_Register; -- Timeout Control TCR : aliased SDHC_TCR_Register; -- Software Reset SRR : aliased SDHC_SRR_Register; -- Auto CMD Error Status ACESR : aliased SDHC_ACESR_Register; -- Capabilities 0 CA0R : aliased SDHC_CA0R_Register; -- Capabilities 1 CA1R : aliased SDHC_CA1R_Register; -- Maximum Current Capabilities MCCAR : aliased SDHC_MCCAR_Register; -- Force Event for Auto CMD Error Status FERACES : aliased SDHC_FERACES_Register; -- Force Event for Error Interrupt Status FEREIS : aliased SDHC_FEREIS_Register; -- ADMA Error Status AESR : aliased SDHC_AESR_Register; -- ADMA System Address n ASAR : aliased HAL.UInt32; -- Preset Value n PVR : aliased SDHC_PVR_Registers; -- Slot Interrupt Status SISR : aliased SDHC_SISR_Register; -- Host Controller Version HCVR : aliased SDHC_HCVR_Register; -- MMC Control 1 MC1R : aliased SDHC_MC1R_Register; -- MMC Control 2 MC2R : aliased SDHC_MC2R_Register; -- AHB Control ACR : aliased SDHC_ACR_Register; -- Clock Control 2 CC2R : aliased SDHC_CC2R_Register; -- Capabilities Control CACR : aliased SDHC_CACR_Register; -- Debug DBGR : aliased SDHC_DBGR_Register; case Discriminent is when Default => -- SDMA System Address / Argument 2 SSAR : aliased HAL.UInt32; -- Host Control 1 HC1R : aliased SDHC_HC1R_Register; -- Block Gap Control BGCR : aliased SDHC_BGCR_Register; -- Normal Interrupt Status NISTR : aliased SDHC_NISTR_Register; -- Error Interrupt Status EISTR : aliased SDHC_EISTR_Register; -- Normal Interrupt Status Enable NISTER : aliased SDHC_NISTER_Register; -- Error Interrupt Status Enable EISTER : aliased SDHC_EISTER_Register; -- Normal Interrupt Signal Enable NISIER : aliased SDHC_NISIER_Register; -- Error Interrupt Signal Enable EISIER : aliased SDHC_EISIER_Register; -- Host Control 2 HC2R : aliased SDHC_HC2R_Register; when CMD23_MODE => -- SDMA System Address / Argument 2 SSAR_CMD23_MODE : aliased HAL.UInt32; when EMMC_MODE => -- Host Control 1 HC1R_EMMC_MODE : aliased SDHC_HC1R_EMMC_MODE_Register; -- Block Gap Control BGCR_EMMC_MODE : aliased SDHC_BGCR_EMMC_MODE_Register; -- Normal Interrupt Status NISTR_EMMC_MODE : aliased SDHC_NISTR_EMMC_MODE_Register; -- Error Interrupt Status EISTR_EMMC_MODE : aliased SDHC_EISTR_EMMC_MODE_Register; -- Normal Interrupt Status Enable NISTER_EMMC_MODE : aliased SDHC_NISTER_EMMC_MODE_Register; -- Error Interrupt Status Enable EISTER_EMMC_MODE : aliased SDHC_EISTER_EMMC_MODE_Register; -- Normal Interrupt Signal Enable NISIER_EMMC_MODE : aliased SDHC_NISIER_EMMC_MODE_Register; -- Error Interrupt Signal Enable EISIER_EMMC_MODE : aliased SDHC_EISIER_EMMC_MODE_Register; -- Host Control 2 HC2R_EMMC_MODE : aliased SDHC_HC2R_EMMC_MODE_Register; end case; end record with Unchecked_Union, Volatile; for SDHC0_Peripheral use record BSR at 16#4# range 0 .. 15; BCR at 16#6# range 0 .. 15; ARG1R at 16#8# range 0 .. 31; TMR at 16#C# range 0 .. 15; CR at 16#E# range 0 .. 15; RR at 16#10# range 0 .. 127; BDPR at 16#20# range 0 .. 31; PSR at 16#24# range 0 .. 31; PCR at 16#29# range 0 .. 7; WCR at 16#2B# range 0 .. 7; CCR at 16#2C# range 0 .. 15; TCR at 16#2E# range 0 .. 7; SRR at 16#2F# range 0 .. 7; ACESR at 16#3C# range 0 .. 15; CA0R at 16#40# range 0 .. 31; CA1R at 16#44# range 0 .. 31; MCCAR at 16#48# range 0 .. 31; FERACES at 16#50# range 0 .. 15; FEREIS at 16#52# range 0 .. 15; AESR at 16#54# range 0 .. 7; ASAR at 16#58# range 0 .. 31; PVR at 16#60# range 0 .. 127; SISR at 16#FC# range 0 .. 15; HCVR at 16#FE# range 0 .. 15; MC1R at 16#204# range 0 .. 7; MC2R at 16#205# range 0 .. 7; ACR at 16#208# range 0 .. 31; CC2R at 16#20C# range 0 .. 31; CACR at 16#230# range 0 .. 31; DBGR at 16#234# range 0 .. 7; SSAR at 16#0# range 0 .. 31; HC1R at 16#28# range 0 .. 7; BGCR at 16#2A# range 0 .. 7; NISTR at 16#30# range 0 .. 15; EISTR at 16#32# range 0 .. 15; NISTER at 16#34# range 0 .. 15; EISTER at 16#36# range 0 .. 15; NISIER at 16#38# range 0 .. 15; EISIER at 16#3A# range 0 .. 15; HC2R at 16#3E# range 0 .. 15; SSAR_CMD23_MODE at 16#0# range 0 .. 31; HC1R_EMMC_MODE at 16#28# range 0 .. 7; BGCR_EMMC_MODE at 16#2A# range 0 .. 7; NISTR_EMMC_MODE at 16#30# range 0 .. 15; EISTR_EMMC_MODE at 16#32# range 0 .. 15; NISTER_EMMC_MODE at 16#34# range 0 .. 15; EISTER_EMMC_MODE at 16#36# range 0 .. 15; NISIER_EMMC_MODE at 16#38# range 0 .. 15; EISIER_EMMC_MODE at 16#3A# range 0 .. 15; HC2R_EMMC_MODE at 16#3E# range 0 .. 15; end record; -- SD/MMC Host Controller SDHC0_Periph : aliased SDHC0_Peripheral with Import, Address => SDHC0_Base; end SAM_SVD.SDHC;
with SDL.video; with SDL; with agar.core.types; with agar.core; package agar.gui.pixelformat is type pixel_format_t is new SDL.video.pixel_format_t; type pixel_format_access_t is access all pixel_format_t; function rgb (bits_per_pixel : agar.core.types.uint8_t; rmask : agar.core.types.uint32_t; gmask : agar.core.types.uint32_t; bmask : agar.core.types.uint32_t) return pixel_format_access_t; pragma import (c, rgb, "AG_PixelFormatRGB"); function rgba (bits_per_pixel : agar.core.types.uint8_t; rmask : agar.core.types.uint32_t; gmask : agar.core.types.uint32_t; bmask : agar.core.types.uint32_t; amask : agar.core.types.uint32_t) return pixel_format_access_t; pragma import (c, rgba, "AG_PixelFormatRGBA"); function indexed (bits_per_pixel : agar.core.types.uint8_t) return pixel_format_access_t; pragma import (c, indexed, "AG_PixelFormatIndexed"); procedure free (format : pixel_format_access_t); pragma import (c, free, "AG_PixelFormatFree"); end agar.gui.pixelformat;
-- -- Copyright (C) 2022 Jeremy Grosser <jeremy@synack.me> -- -- SPDX-License-Identifier: BSD-3-Clause -- -- nRF24L01+ 2.4 GHz GFSK modem -- -- This driver disables the Enhanced ShockBurst™ acknowledgement and checksum -- features and just acts like a dumb GFSK modem. You will need to add your -- own checksum, error correction codes, and acknowledgement protocol as -- needed. -- -- Think of the NRF_Address as more of a preamble than a way of ensuring that -- frames get to the right place. Add a header to your data if this is -- important to your application. -- -- Frequency hopping, data whitening and parity are good ideas. -- with Ada.Unchecked_Conversion; with HAL.SPI; use HAL.SPI; with HAL; use HAL; with HAL.GPIO; package NRF24L01 is type Device (Port : HAL.SPI.Any_SPI_Port; CS : HAL.GPIO.Any_GPIO_Point; CE : HAL.GPIO.Any_GPIO_Point) is tagged private; subtype NRF_Address_Width is Positive range 3 .. 5; type NRF_Address (Width : NRF_Address_Width) is record Addr : UInt8_Array (1 .. Width); end record; type NRF_Channel is range 2_400 .. 2_527; -- MHz, default 2_476 type NRF_Payload_Length is range 1 .. 32; type NRF_Transmit_Power is (Low_Power, -- -18 dBm Medium_Power, -- -12 dBm High_Power, -- -6 dBm Max_Power); -- 0 dBm (default) type NRF_Data_Rate is (Low_Rate, -- 125 Kbps Medium_Rate, -- 1 Mbps High_Rate); -- 2 Mbps (default) procedure Initialize (This : in out Device); procedure Interrupt (This : in out Device); -- Interrupt must be called upon the falling edge of the IRQ pin. Failure -- to do so will make Receive stop working and Transmit may keep the -- amplifier turned on for too long and and damage your chip. procedure Set_Channel (This : in out Device; MHz : NRF_Channel); procedure Set_Data_Rate (This : in out Device; Rate : NRF_Data_Rate); function Is_Transmitting (This : Device) return Boolean; procedure Transmit (This : in out Device; Addr : NRF_Address; Data : UInt8_Array; Power : NRF_Transmit_Power := Max_Power) with Pre => not This.Is_Transmitting; procedure Listen (This : in out Device; Addr : NRF_Address; Length : NRF_Payload_Length); procedure Receive (This : in out Device; Data : out UInt8_Array); procedure Power_Down (This : in out Device); function Data_Ready (This : in out Device) return Natural; -- Number of frames waiting in the receive FIFO. -- Don't call Receive if Data_Ready = 0 procedure Poll (This : in out Device); private type NRF_Mode is (Idle, Transmitting, Receiving); type Device (Port : HAL.SPI.Any_SPI_Port; CS : HAL.GPIO.Any_GPIO_Point; CE : HAL.GPIO.Any_GPIO_Point) is tagged record Mode : NRF_Mode := Idle; RX_DR : Natural with Atomic; Rate_Low : Boolean; Rate_High : Boolean; end record; type Register is (CONFIG, EN_AA, EN_RXADDR, SETUP_AW, SETUP_RETR, RF_CH, RF_SETUP, STATUS, OBSERVE_TX, RPD, RX_ADDR_P0, RX_ADDR_P1, RX_ADDR_P2, RX_ADDR_P3, RX_ADDR_P4, RX_ADDR_P5, TX_ADDR, RX_PW_P0, RX_PW_P1, RX_PW_P2, RX_PW_P3, RX_PW_P4, RX_PW_P5, FIFO_STATUS, DYNPD, FEATURE); for Register use (CONFIG => 16#00#, EN_AA => 16#01#, EN_RXADDR => 16#02#, SETUP_AW => 16#03#, SETUP_RETR => 16#04#, RF_CH => 16#05#, RF_SETUP => 16#06#, STATUS => 16#07#, OBSERVE_TX => 16#08#, RPD => 16#09#, RX_ADDR_P0 => 16#0A#, RX_ADDR_P1 => 16#0B#, RX_ADDR_P2 => 16#0C#, RX_ADDR_P3 => 16#0D#, RX_ADDR_P4 => 16#0E#, RX_ADDR_P5 => 16#0F#, TX_ADDR => 16#10#, RX_PW_P0 => 16#11#, RX_PW_P1 => 16#12#, RX_PW_P2 => 16#13#, RX_PW_P3 => 16#14#, RX_PW_P4 => 16#15#, RX_PW_P5 => 16#16#, FIFO_STATUS => 16#17#, DYNPD => 16#1C#, FEATURE => 16#1D#); type STATUS_Register is record RX_DR : Boolean := False; TX_DS : Boolean := False; MAX_RT : Boolean := False; RX_P_NO : UInt3 := 0; TX_FULL : Boolean := False; end record with Size => 8; for STATUS_Register use record RX_DR at 0 range 6 .. 6; TX_DS at 0 range 5 .. 5; MAX_RT at 0 range 4 .. 4; RX_P_NO at 0 range 1 .. 3; TX_FULL at 0 range 0 .. 0; end record; function To_STATUS_Register is new Ada.Unchecked_Conversion (Source => UInt8, Target => STATUS_Register); type CONFIG_PRIM_RX_Field is (PTX, PRX) with Size => 1; type CONFIG_Register is record MASK_RX_DR : Boolean := False; MASK_TX_DS : Boolean := False; MASK_MAX_RT : Boolean := False; EN_CRC : Boolean := True; CRCO : Boolean := False; PWR_UP : Boolean := False; PRIM_RX : CONFIG_PRIM_RX_Field := PTX; end record with Size => 8; for CONFIG_Register use record MASK_RX_DR at 0 range 6 .. 6; MASK_TX_DS at 0 range 5 .. 5; MASK_MAX_RT at 0 range 4 .. 4; EN_CRC at 0 range 3 .. 3; CRCO at 0 range 2 .. 2; PWR_UP at 0 range 1 .. 1; PRIM_RX at 0 range 0 .. 0; end record; function To_UInt8 is new Ada.Unchecked_Conversion (Source => CONFIG_Register, Target => UInt8); type RF_SETUP_Register is record CONT_WAVE : Boolean := False; RF_DR_LOW : Boolean := False; PLL_LOCK : Boolean := False; RF_DR_HIGH : Boolean := True; RF_PWR : UInt2 := 2#11#; end record with Size => 8; for RF_SETUP_Register use record CONT_WAVE at 0 range 7 .. 7; RF_DR_LOW at 0 range 5 .. 5; PLL_LOCK at 0 range 4 .. 4; RF_DR_HIGH at 0 range 3 .. 3; RF_PWR at 0 range 1 .. 2; end record; function To_UInt8 is new Ada.Unchecked_Conversion (Source => RF_SETUP_Register, Target => UInt8); procedure SPI_Transfer (This : in out Device; Data : in out SPI_Data_8b); procedure W_REGISTER (This : in out Device; Reg : Register; Data : UInt8_Array); procedure W_REGISTER (This : in out Device; Reg : Register; Data : UInt8); procedure R_REGISTER (This : in out Device; Reg : Register; Data : out UInt8); procedure FLUSH_TX (This : in out Device); procedure FLUSH_RX (This : in out Device); procedure W_TX_PAYLOAD (This : in out Device; Data : UInt8_Array); procedure R_RX_PAYLOAD (This : in out Device; Data : out UInt8_Array); procedure NOP (This : in out Device; Status : out STATUS_Register); procedure Clear_Status (This : in out Device); procedure Set_Transmit_Address (This : in out Device; Addr : NRF_Address); procedure Set_Receive_Address (This : in out Device; Addr : NRF_Address); end NRF24L01;
----------------------------------------------------------------------- -- net-dns -- DNS Network utilities -- Copyright (C) 2016, 2017 Stephane Carrez -- Written by Stephane Carrez (Stephane.Carrez@gmail.com) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Interfaces; use Interfaces; with Net.Headers; with Net.Utils; package body Net.DNS is -- The IN class for the DNS response (RFC 1035, 3.2.4. CLASS values). -- Other classes are not meaningly to us. IN_CLASS : constant Net.Uint16 := 16#0001#; procedure Skip_Query (Packet : in out Net.Buffers.Buffer_Type); protected body Request is procedure Set_Result (Addr : in Net.Ip_Addr; Time : in Net.Uint32) is begin Ip := Addr; Ttl := Time; Status := NOERROR; end Set_Result; procedure Set_Status (State : in Status_Type) is begin Status := State; end Set_Status; function Get_IP return Net.Ip_Addr is begin return Ip; end Get_IP; function Get_Status return Status_Type is begin return Status; end Get_Status; function Get_TTL return Net.Uint32 is begin return Ttl; end Get_TTL; end Request; function Get_Status (Request : in Query) return Status_Type is begin return Request.Result.Get_Status; end Get_Status; -- ------------------------------ -- Get the name defined for the DNS query. -- ------------------------------ function Get_Name (Request : in Query) return String is begin return Request.Name (1 .. Request.Name_Len); end Get_Name; -- ------------------------------ -- Get the IP address that was resolved by the DNS query. -- ------------------------------ function Get_Ip (Request : in Query) return Net.Ip_Addr is begin return Request.Result.Get_IP; end Get_Ip; -- ------------------------------ -- Get the TTL associated with the response. -- ------------------------------ function Get_Ttl (Request : in Query) return Net.Uint32 is begin return Request.Result.Get_TTL; end Get_Ttl; -- ------------------------------ -- Start a DNS resolution for the given hostname. -- ------------------------------ procedure Resolve (Request : access Query; Ifnet : access Net.Interfaces.Ifnet_Type'Class; Name : in String; Status : out Error_Code; Timeout : in Duration := 10.0) is use type Ada.Real_Time.Time; Xid : constant Uint32 := Net.Utils.Random; Addr : Net.Sockets.Sockaddr_In; To : Net.Sockets.Sockaddr_In; Buf : Net.Buffers.Buffer_Type; C : Character; Cnt : Net.Uint8; begin Request.Name_Len := Name'Length; Request.Name (1 .. Name'Length) := Name; Request.Result.Set_Status (PENDING); Addr.Port := Net.Uint16 (Shift_Right (Xid, 16)); Request.Xid := Net.Uint16 (Xid and 16#0ffff#); Request.Bind (Ifnet, Addr); Request.Deadline := Ada.Real_Time.Clock + Ada.Real_Time.To_Time_Span (Timeout); Net.Buffers.Allocate (Buf); Buf.Set_Type (Net.Buffers.UDP_PACKET); Buf.Put_Uint16 (Request.Xid); Buf.Put_Uint16 (16#0100#); Buf.Put_Uint16 (1); Buf.Put_Uint16 (0); Buf.Put_Uint16 (0); Buf.Put_Uint16 (0); for I in 1 .. Request.Name_Len loop C := Request.Name (I); if C = '.' or I = 1 then Cnt := (if I = 1 then 1 else 0); for J in I + 1 .. Request.Name_Len loop C := Request.Name (J); exit when C = '.'; Cnt := Cnt + 1; end loop; Buf.Put_Uint8 (Cnt); if I = 1 then Buf.Put_Uint8 (Character'Pos (Request.Name (1))); end if; else Buf.Put_Uint8 (Character'Pos (C)); end if; end loop; Buf.Put_Uint8 (0); Buf.Put_Uint16 (Net.Uint16 (A_RR)); Buf.Put_Uint16 (IN_CLASS); To.Port := Net.Headers.To_Network (53); To.Addr := Ifnet.Dns; Request.Send (To, Buf, Status); end Resolve; -- ------------------------------ -- Save the answer received from the DNS server. This operation is called for each answer -- found in the DNS response packet. The Index is incremented at each answer. For example -- a DNS server can return a CNAME_RR answer followed by an A_RR: the operation is called -- two times. -- -- This operation can be overriden to implement specific actions when an answer is received. -- ------------------------------ procedure Answer (Request : in out Query; Status : in Status_Type; Response : in Response_Type; Index : in Natural) is pragma Unreferenced (Index); begin if Status /= NOERROR then Request.Result.Set_Status (Status); elsif Response.Of_Type = A_RR then Request.Result.Set_Result (Response.Ip, Response.Ttl); end if; end Answer; procedure Skip_Query (Packet : in out Net.Buffers.Buffer_Type) is Cnt : Net.Uint8; begin loop Cnt := Packet.Get_Uint8; exit when Cnt = 0; Packet.Skip (Net.Uint16 (Cnt)); end loop; -- Skip QTYPE and QCLASS in query. Packet.Skip (2); Packet.Skip (2); end Skip_Query; overriding procedure Receive (Request : in out Query; From : in Net.Sockets.Sockaddr_In; Packet : in out Net.Buffers.Buffer_Type) is pragma Unreferenced (From); Val : Net.Uint16; Answers : Net.Uint16; Ttl : Net.Uint32; Len : Net.Uint16; Cls : Net.Uint16; Status : Status_Type; begin Val := Packet.Get_Uint16; if Val /= Request.Xid then return; end if; Val := Packet.Get_Uint16; if (Val and 16#ff00#) /= 16#8100# then return; end if; if (Val and 16#0F#) /= 0 then case Val and 16#0F# is when 1 => Status := FORMERR; when 2 => Status := SERVFAIL; when 3 => Status := NXDOMAIN; when 4 => Status := NOTIMP; when 5 => Status := REFUSED; when others => Status := OTHERERROR; end case; Query'Class (Request).Answer (Status, Response_Type '(Kind => V_NONE, Len => 0, Class => 0, Of_Type => 0, Ttl => 0), 0); return; end if; Val := Packet.Get_Uint16; Answers := Packet.Get_Uint16; if Val /= 1 or else Answers = 0 then Query'Class (Request).Answer (SERVFAIL, Response_Type '(Kind => V_NONE, Len => 0, Class => 0, Of_Type => 0, Ttl => 0), 0); return; end if; Packet.Skip (4); Skip_Query (Packet); for I in 1 .. Answers loop Packet.Skip (2); Val := Packet.Get_Uint16; Cls := Packet.Get_Uint16; Ttl := Packet.Get_Uint32; Len := Packet.Get_Uint16; if Cls = IN_CLASS and Len < Net.Uint16 (DNS_VALUE_MAX_LENGTH) then case RR_Type (Val) is when A_RR => declare Response : constant Response_Type := Response_Type '(Kind => V_IPV4, Len => Natural (Len), Of_Type => RR_Type (Val), Ttl => Ttl, Class => Cls, Ip => Packet.Get_Ip); begin Query'Class (Request).Answer (NOERROR, Response, Natural (I)); end; when CNAME_RR | TXT_RR | MX_RR | NS_RR | PTR_RR => declare Response : Response_Type := Response_Type '(Kind => V_TEXT, Len => Natural (Len), Of_Type => RR_Type (Val), Ttl => Ttl, Class => Cls, others => <>); begin for J in Response.Text'Range loop Response.Text (J) := Character'Val (Packet.Get_Uint8); end loop; Query'Class (Request).Answer (NOERROR, Response, Natural (I)); end; when others => -- Ignore this answer: we don't know its type. Packet.Skip (Len); end case; else -- Ignore this anwser. Packet.Skip (Len); end if; end loop; end Receive; end Net.DNS;
with System; package Pkg is type Generic_Interface is interface; function "=" (x, y: Generic_Interface) return Boolean is abstract; function Type_Name (x: Generic_Interface) return String is abstract; function Cast (x: Generic_Interface; iface: String) return System.Address is abstract; type Sequence is abstract interface and Generic_Interface; function Value (x: Sequence) return Integer is abstract; procedure Next (x: in out Sequence) is abstract; type Printable is abstract interface and Generic_Interface; procedure Print (x: Printable) is abstract; type Arithmetic is new Sequence and Printable with record val : Integer; end record; function "=" (x, y: Arithmetic) return Boolean; function Type_Name (x: Arithmetic) return String; function Cast (x: Arithmetic; iface: String) return System.Address; function Value (n: Arithmetic) return Integer; procedure Next (n: in out Arithmetic); procedure Print (n: Arithmetic); end Pkg;
with Ada.Text_IO; use Ada.Text_IO; with Ada.Integer_Text_IO; use Ada.Integer_Text_IO; procedure Signe_Entier is -- La procédure TODO affiche un message. procedure TODO is begin Put_Line ("Il faut remplacer TODO; par les instructions qui vont bien"); end; N1, N2: Integer; -- Entier lu au clavier dont on veut connaître le signe begin -- Demander les deux entiers N1 et N2 Get (N1); Get (N2); -- Afficher N1 et N2 chacun sur une ligne Put_Line ("Un par ligne :"); Put(N1); Put_Line(""); Put(N2); Put_Line(""); -- Afficher N1 et N2 alignés contre la marge Put_Line ("Un par ligne, alignés contre la marge :"); Put(N1, 1); Put_Line(""); Put(N2, 1); Put_Line(""); -- Afficher « Le premier nombre est {N1}, le second {N2}." Put_Line ("La phrase demandée :"); Put("Le premier nombre est "); Put(N1, 1); Put(", le second "); Put(N2, 1); Put_Line("."); -- Afficher « {N1} + {N2} = {N1 + N2} » Put_Line ("Addition :"); Put(N1, 1); Put(" + "); Put(N2, 1); Put(" = "); Put(N1 + N2, 1); Put_Line(""); end Signe_Entier;
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- S I N P U T . L -- -- -- -- S p e c -- -- -- -- $Revision$ -- -- -- Copyright (C) 1992-2001, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This child package contains the routines used to actually load a source -- file and create entries in the source file table. It also contains the -- routines to create virtual entries for instantiations. This is separated -- off into a child package to avoid a dependence of Sinput on Osint which -- would cause trouble in the tree read/write routines. with Types; use Types; package Sinput.L is ------------------------------------------- -- Subprograms for Loading Source Files -- ------------------------------------------- function Load_Source_File (N : File_Name_Type) return Source_File_Index; -- Given a source file name, returns the index of the corresponding entry -- in the source file table. If the file is not currently loaded, then -- this is the call that causes the source file to be read and an entry -- made in the table. A new entry in the table has the file name and time -- stamp entries set and the Casing entries set to Unknown. Version is set -- to all blanks, and the lines table is initialized but only the first -- entry is set (and Last_Line is set to 1). If the given source file -- cannot be opened, then the value returned is No_Source_File. function Load_Config_File (N : File_Name_Type) return Source_File_Index; -- Similar to Load_Source_File, except that the file name is always -- interpreted in the context of the current working directory. procedure Complete_Source_File_Entry; -- Called on completing the parsing of a source file. This call completes -- the source file table entry for the current source file. function Source_File_Is_Subunit (X : Source_File_Index) return Boolean; -- This function determines if a source file represents a subunit. It -- works by scanning for the first compilation unit token, and returning -- True if it is the token SEPARATE. It will return False otherwise, -- meaning that the file cannot possibly be a legal subunit. This -- function does NOT do a complete parse of the file, or build a -- tree. It is used in the main driver in the check for bad bodies. ------------------------------------------------- -- Subprograms for Dealing With Instantiations -- ------------------------------------------------- type Sloc_Adjustment is private; -- Type returned by Create_Instantiation_Source for use in subsequent -- calls to Adjust_Instantiation_Sloc. procedure Create_Instantiation_Source (Inst_Node : Entity_Id; Template_Id : Entity_Id; A : out Sloc_Adjustment); -- This procedure creates the source table entry for an instantiation. -- Inst_Node is the instantiation node, and Template_Id is the defining -- identifier of the generic declaration or body unit as appropriate. -- A is set to an adjustment factor to be used in subsequent calls to -- Adjust_Instantiation_Sloc. procedure Adjust_Instantiation_Sloc (N : Node_Id; A : Sloc_Adjustment); -- The instantiation tree is created by copying the tree of the generic -- template (including the original Sloc values), and then applying -- Adjust_Instantiation_Sloc to each copied node to adjust the Sloc -- to reference the source entry for the instantiation. ------------------------------------------------ -- Subprograms for Writing Debug Source Files -- ------------------------------------------------ procedure Create_Debug_Source (Source : Source_File_Index; Loc : out Source_Ptr); -- Given a source file, creates a new source file table entry to be used -- for the debug source file output (Debug_Generated_Code switch set). -- Loc is set to the initial Sloc value for the first line. This call -- also creates the debug source output file (using Create_Debug_File). procedure Write_Debug_Line (Str : String; Loc : in out Source_Ptr); -- This procedure is called to write a line to the debug source file -- previously created by Create_Debug_Source using Write_Debug_Info. -- Str is the source line to be written to the file (it does not include -- an end of line character). On entry Loc is the Sloc value previously -- returned by Create_Debug_Source or Write_Debug_Line, and on exit, -- Sloc is updated to point to the start of the next line to be written, -- taking into account the length of the ternminator that was written by -- Write_Debug_Info. procedure Close_Debug_Source; -- This procedure completes the source table entry for the debug file -- previously created by Create_Debug_Source, and written using the -- Write_Debug_Line procedure. It then calls Close_Debug_File to -- complete the writing of the file itself. private type Sloc_Adjustment is record Adjust : Source_Ptr; -- Adjustment factor. To be added to source location values in the -- source table entry for the template to get corresponding sloc -- values for the instantiation image of the template. This is not -- really a Source_Ptr value, but rather an offset, but it is more -- convenient to represent it as a Source_Ptr value and this is a -- private type anyway. Lo, Hi : Source_Ptr; -- Lo and hi values to which adjustment factor can legitimately -- be applied, used to ensure that no incorrect adjustments are -- made. Really it is a bug if anyone ever tries to adjust outside -- this range, but since we are only doing this anyway for getting -- better error messages, it is not critical end record; end Sinput.L;
with TLSF.Config; with TLSF.Mem_Block_Size; use TLSF.Mem_Block_Size; use TLSF.Config; package body TLSF.Bitmaps with SPARK_Mode is procedure Mapping_Insert (V : Size; FL : out First_Level_Index; SL : out Second_Level_Index) is First_Bit : Bit_Pos; Second_Level_Bits : Size; begin First_Bit := MSB_Index (V); pragma Assert (First_Bit >= SL_Index_Count_Log2); Second_Level_Bits := Extract_Bits(V, First_Bit - SL_Index_Count_Log2, First_Bit - 1); FL := First_Level_Index (First_Bit); SL := Second_Level_Index (Second_Level_Bits); end Mapping_Insert; procedure Mapping_Search (V : in out Size; FL : out First_Level_Index; SL : out Second_Level_Index) is First_Bit : Bit_Pos; begin First_Bit := MSB_Index (V) - 1; V := V + (2 ** (First_Bit - SL_Index_Count_Log2)) - 1; Mapping_Insert (V, FL, SL); end Mapping_Search; procedure Search_Present (bmp : Levels_Bitmap; FL : in out First_Level_Index; SL : in out Second_Level_Index) is SL_From : Second_Level_Index := SL; FL_bitmap : First_Level_Map renames bmp.First_Level; SL_bitmap : Second_Levels_Map renames bmp.Second_Levels; begin fl_idx_loop : for fl_idx in FL .. First_Level_Index'Last loop if FL_bitmap (fl_idx) = Present then for sl_idx in SL_From .. Second_Level_Index'Last loop if SL_bitmap (fl_idx) (sl_idx) = Present then FL := fl_idx; SL := sl_idx; exit fl_idx_loop; end if; end loop; end if; SL_From := Second_Level_Index'First; end loop fl_idx_loop; end Search_Present; procedure Set_Present (bmp : in out Levels_Bitmap; FL : First_Level_Index; SL : Second_Level_Index) is begin bmp.Second_Levels (FL) (SL) := Present; bmp.First_Level (FL) := Present; end Set_Present; function Second_Levels_Empty (Bmp : Levels_Bitmap; FL : First_Level_Index) return Boolean is (for all sl_idx in Second_Level_Index'Range => Bmp.Second_Levels (FL) (sl_idx) = Not_Present); procedure Set_Not_Present (Bmp : in out Levels_Bitmap; FL : First_Level_Index; SL : Second_Level_Index) is begin Bmp.Second_Levels (FL) (SL) := Not_Present; Bmp.First_Level (FL) := (if Second_Levels_Empty (Bmp, FL) then Not_Present else Present); end Set_Not_Present; function Free_Blocks_Present (Bmp : Levels_Bitmap; FL : First_Level_Index; SL : Second_Level_Index) return Boolean is begin return Bmp.Second_Levels(FL) (SL) = Present; end Free_Blocks_Present; procedure Init_Bitmap ( Bmp : out Levels_Bitmap) is begin Bmp := Levels_Bitmap'(First_Level => (others => Not_Present), Second_Levels => (others => (others => Not_Present))); end Init_Bitmap; end TLSF.Bitmaps;
-- //////////////////////////////////////////////////////////// -- // -- // SFML - Simple and Fast Multimedia Library -- // Copyright (C) 2007-2009 Laurent Gomila (laurent.gom@gmail.com) -- // -- // This software is provided 'as-is', without any express or implied warranty. -- // In no event will the authors be held liable for any damages arising from the use of this software. -- // -- // Permission is granted to anyone to use this software for any purpose, -- // including commercial applications, and to alter it and redistribute it freely, -- // subject to the following restrictions: -- // -- // 1. The origin of this software must not be misrepresented; -- // you must not claim that you wrote the original software. -- // If you use this software in a product, an acknowledgment -- // in the product documentation would be appreciated but is not required. -- // -- // 2. Altered source versions must be plainly marked as such, -- // and must not be misrepresented as being the original software. -- // -- // 3. This notice may not be removed or altered from any source distribution. -- // -- //////////////////////////////////////////////////////////// -- //////////////////////////////////////////////////////////// -- // Headers -- //////////////////////////////////////////////////////////// with Sf.Config; with Sf.Network.Types; package Sf.Network.Selector is use Sf.Config; use Sf.Network.Types; -- //////////////////////////////////////////////////////////// -- /// Create a new selector -- /// -- /// \return A new sfSelector object -- /// -- //////////////////////////////////////////////////////////// function sfSelectorTCP_Create return sfSelectorTCP_Ptr; function sfSelectorUDP_Create return sfSelectorUDP_Ptr; -- //////////////////////////////////////////////////////////// -- /// Destroy an existing selector -- /// -- /// \param Selector : Selector to delete -- /// -- //////////////////////////////////////////////////////////// procedure sfSelectorTCP_Destroy (Selector : sfSelectorTCP_Ptr); procedure sfSelectorUDP_Destroy (Selector : sfSelectorUDP_Ptr); -- //////////////////////////////////////////////////////////// -- /// Add a socket to watch to a selector -- /// -- /// \param Selector : Selector to add the socket to -- /// \param Socket : Socket to add -- /// -- //////////////////////////////////////////////////////////// procedure sfSelectorTCP_Add (Selector : sfSelectorTCP_Ptr; Socket : sfSocketTCP_Ptr); procedure sfSelectorUDP_Add (Selector : sfSelectorUDP_Ptr; Socket : sfSocketUDP_Ptr); -- //////////////////////////////////////////////////////////// -- /// Remove a socket from a selector -- /// -- /// \param Selector : Selector to remove the socket from -- /// \param Socket : Socket to remove -- /// -- //////////////////////////////////////////////////////////// procedure sfSelectorTCP_Remove (Selector : sfSelectorTCP_Ptr; Socket : sfSocketTCP_Ptr); procedure sfSelectorUDP_Remove (Selector : sfSelectorUDP_Ptr; Socket : sfSocketUDP_Ptr); -- //////////////////////////////////////////////////////////// -- /// Remove all sockets from a selector -- /// -- /// \param Selector : Selector to remove the socket from -- /// -- //////////////////////////////////////////////////////////// procedure sfSelectorTCP_Clear (Selector : sfSelectorTCP_Ptr); procedure sfSelectorUDP_Clear (Selector : sfSelectorUDP_Ptr); -- //////////////////////////////////////////////////////////// -- /// Wait and collect sockets which are ready for reading. -- /// This functions will return either when at least one socket -- /// is ready, or when the given time is out -- /// -- /// \param Selector : Selector to check -- /// \param Timeout : Maximum time to wait, in seconds (0 to disable timeout) -- /// -- /// \return Number of sockets ready -- /// -- //////////////////////////////////////////////////////////// function sfSelectorTCP_Wait (Selector : sfSelectorTCP_Ptr; Timeout : Float) return sfUint32; function sfSelectorUDP_Wait (Selector : sfSelectorUDP_Ptr; Timeout : Float) return sfUint32; -- //////////////////////////////////////////////////////////// -- /// After a call to Wait(), get the Index-th socket which is -- /// ready for reading. The total number of sockets ready -- /// is the integer returned by the previous call to Wait() -- /// -- /// \param Selector : Selector to check -- /// \param Index : Index of the socket to get -- /// -- /// \return The Index-th socket -- /// -- //////////////////////////////////////////////////////////// function sfSelectorTCP_GetSocketReady (Selector : sfSelectorTCP_Ptr; Index : sfUint32) return sfSocketTCP_Ptr; function sfSelectorUDP_GetSocketReady (Selector : sfSelectorUDP_Ptr; Index : sfUint32) return sfSocketUDP_Ptr; private pragma Import (C, sfSelectorTCP_Create, "sfSelectorTCP_Create"); pragma Import (C, sfSelectorUDP_Create, "sfSelectorUDP_Create"); pragma Import (C, sfSelectorTCP_Destroy, "sfSelectorTCP_Destroy"); pragma Import (C, sfSelectorUDP_Destroy, "sfSelectorUDP_Destroy"); pragma Import (C, sfSelectorTCP_Add, "sfSelectorTCP_Add"); pragma Import (C, sfSelectorUDP_Add, "sfSelectorUDP_Add"); pragma Import (C, sfSelectorTCP_Remove, "sfSelectorTCP_Remove"); pragma Import (C, sfSelectorUDP_Remove, "sfSelectorUDP_Remove"); pragma Import (C, sfSelectorTCP_Clear, "sfSelectorTCP_Clear"); pragma Import (C, sfSelectorUDP_Clear, "sfSelectorUDP_Clear"); pragma Import (C, sfSelectorTCP_Wait, "sfSelectorTCP_Wait"); pragma Import (C, sfSelectorUDP_Wait, "sfSelectorUDP_Wait"); pragma Import (C, sfSelectorTCP_GetSocketReady, "sfSelectorTCP_GetSocketReady"); pragma Import (C, sfSelectorUDP_GetSocketReady, "sfSelectorUDP_GetSocketReady"); end Sf.Network.Selector;
with Rejuvenation.Simple_Factory; use Rejuvenation.Simple_Factory; package body Generators is function Generate_Pattern (G : Generator) return Analysis_Unit is Str : constant String := G.SG (String_Vectors.To_Vector (To_String (G.Name), 1)); begin return Analyze_Fragment (Str, G.Rule); end Generate_Pattern; function Generate_Instance (G : Generator) return Analysis_Unit is Str : constant String := G.SG (G.Values); begin return Analyze_Fragment (Str, G.Rule); end Generate_Instance; end Generators;
----------------------------------------------------------------------- -- Util.Beans.Objects.To_Access -- Conversion utility -- Copyright (C) 2011 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. ----------------------------------------------------------------------- -- Convert the object to the corresponding access type. -- Returns null if the object is not a <b>TYPE_BEAN</b> or not of the given bean type. with Util.Beans.Basic; generic type T is limited new Util.Beans.Basic.Readonly_Bean with private; type T_Access is access all T'Class; function Util.Beans.Objects.To_Access (Value : in Object) return T_Access;
with DDS.ReadCondition; with DDS.DataReader; with DDS.DataWriter; with DDS.Request_Reply; package DDS.Request_Reply.Requester is type Ref is limited interface and DDS.Request_Reply.Ref; type Ref_Access is access all Ref'Class; function Get_Request_Data_Writer (Self : not null access Ref) return DDS.DataWriter.Ref_Access is abstract; function Get_Reply_Data_Reader (Self : not null access Ref) return DDS.DataReader.Ref_Access is abstract; function Touch_Samples (Self : not null access Ref; Max_Count : DDS.Integer; Read_Condition : DDS.ReadCondition.Ref_Access) return Integer is abstract; function Wait_For_Any_Sample (Self : not null access Ref; Max_Wait : DDS.Duration_T; Min_Sample_Count : DDS.Integer) return DDS.ReturnCode_T is abstract; end DDS.Request_Reply.Requester;
-- This file is covered by the Internet Software Consortium (ISC) License -- Reference: ../../License.txt package body AdaBase.Statement.Base.PostgreSQL is ------------------------ -- reformat_markers -- ------------------------ function reformat_markers (parameterized_sql : String) return String is masked : String := CT.redact_quotes (parameterized_sql); cvslen : Natural := masked'Length; begin for x in masked'Range loop if masked (x) = ASCII.Query then -- Reserve enough for 9999 markers (limit 1600 on PgSQL) -- Trailing whitespace is truncated by the return cvslen := cvslen + 4; end if; end loop; declare canvas : String (1 .. cvslen) := (others => ' '); polaris : Natural := 0; param : Natural := 0; begin for x in masked'Range loop if masked (x) = ASCII.Query then param := param + 1; declare marker : String := ASCII.Dollar & CT.int2str (param); begin for y in marker'Range loop polaris := polaris + 1; canvas (polaris) := marker (y); end loop; end; else polaris := polaris + 1; canvas (polaris) := parameterized_sql (x); end if; end loop; return canvas (1 .. polaris); end; end reformat_markers; -------------------- -- column_count -- -------------------- overriding function column_count (Stmt : PostgreSQL_statement) return Natural is begin return Stmt.num_columns; end column_count; ---------------------- -- last_insert_id -- ---------------------- overriding function last_insert_id (Stmt : PostgreSQL_statement) return Trax_ID is conn : CON.PostgreSQL_Connection_Access renames Stmt.pgsql_conn; begin if Stmt.insert_return then return Stmt.last_inserted; else return conn.select_last_val; end if; end last_insert_id; ---------------------- -- last_sql_state -- ---------------------- overriding function last_sql_state (Stmt : PostgreSQL_statement) return SQL_State is conn : CON.PostgreSQL_Connection_Access renames Stmt.pgsql_conn; begin return conn.SqlState (Stmt.result_handle); end last_sql_state; ------------------------ -- last_driver_code -- ------------------------ overriding function last_driver_code (Stmt : PostgreSQL_statement) return Driver_Codes is conn : CON.PostgreSQL_Connection_Access renames Stmt.pgsql_conn; begin return conn.driverCode (Stmt.result_handle); end last_driver_code; --------------------------- -- last_driver_message -- --------------------------- overriding function last_driver_message (Stmt : PostgreSQL_statement) return String is conn : CON.PostgreSQL_Connection_Access renames Stmt.pgsql_conn; begin return conn.driverMessage (Stmt.result_handle); end last_driver_message; -------------------- -- discard_rest -- -------------------- overriding procedure discard_rest (Stmt : out PostgreSQL_statement) is -- When asynchronous command mode becomes supported, this procedure -- would free the pgres object and indicate data exhausted somehow. -- In the standard buffered mode, we can only simulate it. conn : CON.PostgreSQL_Connection_Access renames Stmt.pgsql_conn; begin if Stmt.result_arrow < Stmt.size_of_rowset then Stmt.result_arrow := Stmt.size_of_rowset; Stmt.rows_leftover := True; conn.discard_pgresult (Stmt.result_handle); end if; end discard_rest; ------------------ -- execute #1 -- ------------------ overriding function execute (Stmt : out PostgreSQL_statement) return Boolean is conn : CON.PostgreSQL_Connection_Access renames Stmt.pgsql_conn; markers : constant Natural := Natural (Stmt.realmccoy.Length); status_successful : Boolean := True; data_present : Boolean := False; begin if Stmt.type_of_statement = direct_statement then raise INVALID_FOR_DIRECT_QUERY with "The execute command is for prepared statements only"; end if; Stmt.result_arrow := 0; Stmt.last_inserted := 0; Stmt.size_of_rowset := 0; Stmt.impacted := 0; Stmt.rows_leftover := False; Stmt.result_present := False; Stmt.successful_execution := False; conn.discard_pgresult (Stmt.result_handle); if markers > 0 then -- Check to make sure all prepared markers are bound for sx in Natural range 1 .. markers loop if not Stmt.realmccoy.Element (sx).bound then raise STMT_PREPARATION with "Prep Stmt column" & sx'Img & " unbound"; end if; end loop; -- Now bind the actual values to the markers declare canvas : CON.parameter_block (1 .. markers); msg : String := "Exec with" & markers'Img & " bound parameters"; begin for x in canvas'Range loop canvas (x).payload := Stmt.bind_text_value (x); canvas (x).is_null := Stmt.realmccoy.Element (x).null_data; canvas (x).binary := Stmt.realmccoy.Element (x).output_type = ft_chain; end loop; Stmt.log_nominal (statement_execution, msg); Stmt.result_handle := conn.execute_prepared_stmt (name => Stmt.show_statement_name, data => canvas); end; else -- No binding required, just execute the prepared statement Stmt.log_nominal (category => statement_execution, message => "Exec without bound parameters"); Stmt.result_handle := conn.execute_prepared_stmt (name => Stmt.show_statement_name); end if; case conn.examine_result (Stmt.result_handle) is when CON.executed => Stmt.successful_execution := True; when CON.returned_data => Stmt.successful_execution := True; Stmt.insert_return := Stmt.insert_prepsql; data_present := True; when CON.failed => Stmt.successful_execution := False; end case; if Stmt.successful_execution then if data_present then if Stmt.insert_return then Stmt.last_inserted := conn.returned_id (Stmt.result_handle); else Stmt.size_of_rowset := conn.rows_in_result (Stmt.result_handle); Stmt.result_present := True; end if; end if; Stmt.impacted := conn.rows_impacted (Stmt.result_handle); end if; return Stmt.successful_execution; end execute; ------------------ -- execute #2 -- ------------------ overriding function execute (Stmt : out PostgreSQL_statement; parameters : String; delimiter : Character := '|') return Boolean is function parameters_given return Natural; num_markers : constant Natural := Natural (Stmt.realmccoy.Length); function parameters_given return Natural is result : Natural := 1; begin for x in parameters'Range loop if parameters (x) = delimiter then result := result + 1; end if; end loop; return result; end parameters_given; begin if Stmt.type_of_statement = direct_statement then raise INVALID_FOR_DIRECT_QUERY with "The execute command is for prepared statements only"; end if; if num_markers /= parameters_given then raise STMT_PREPARATION with "Parameter number mismatch, " & num_markers'Img & " expected, but" & parameters_given'Img & " provided."; end if; declare index : Natural := 1; arrow : Natural := parameters'First; scans : Boolean := False; start : Natural := 1; stop : Natural := 0; begin for x in parameters'Range loop if parameters (x) = delimiter then if not scans then Stmt.auto_assign (index, ""); else Stmt.auto_assign (index, parameters (start .. stop)); scans := False; end if; index := index + 1; else stop := x; if not scans then start := x; scans := True; end if; end if; end loop; if not scans then Stmt.auto_assign (index, ""); else Stmt.auto_assign (index, parameters (start .. stop)); end if; end; return Stmt.execute; end execute; --------------------- -- rows_returned -- --------------------- overriding function rows_returned (Stmt : PostgreSQL_statement) return Affected_Rows is begin return Stmt.size_of_rowset; end rows_returned; ------------------- -- column_name -- ------------------- overriding function column_name (Stmt : PostgreSQL_statement; index : Positive) return String is maxlen : constant Natural := Natural (Stmt.column_info.Length); begin if index > maxlen then raise INVALID_COLUMN_INDEX with "Max index is" & maxlen'Img & " but" & index'Img & " attempted"; end if; return CT.USS (Stmt.column_info.Element (Index => index).field_name); end column_name; -------------------- -- column_table -- -------------------- overriding function column_table (Stmt : PostgreSQL_statement; index : Positive) return String is maxlen : constant Natural := Natural (Stmt.column_info.Length); begin if index > maxlen then raise INVALID_COLUMN_INDEX with "Max index is" & maxlen'Img & " but" & index'Img & " attempted"; end if; return CT.USS (Stmt.column_info.Element (Index => index).table); end column_table; -------------------------- -- column_native_type -- -------------------------- overriding function column_native_type (Stmt : PostgreSQL_statement; index : Positive) return field_types is maxlen : constant Natural := Natural (Stmt.column_info.Length); begin if index > maxlen then raise INVALID_COLUMN_INDEX with "Max index is" & maxlen'Img & " but" & index'Img & " attempted"; end if; return Stmt.column_info.Element (Index => index).field_type; end column_native_type; ------------------ -- fetch_next -- ------------------ overriding function fetch_next (Stmt : out PostgreSQL_statement) return ARS.Datarow is begin if Stmt.result_arrow >= Stmt.size_of_rowset then return ARS.Empty_Datarow; end if; Stmt.result_arrow := Stmt.result_arrow + 1; return Stmt.assemble_datarow (row_number => Stmt.result_arrow); end fetch_next; ----------------- -- fetch_all -- ----------------- overriding function fetch_all (Stmt : out PostgreSQL_statement) return ARS.Datarow_Set is maxrows : Natural := Natural (Stmt.rows_returned); tmpset : ARS.Datarow_Set (1 .. maxrows + 1); nullset : ARS.Datarow_Set (1 .. 0); index : Natural := 1; row : ARS.Datarow; begin if Stmt.result_arrow >= Stmt.size_of_rowset then return nullset; end if; declare remaining_rows : Trax_ID := Stmt.size_of_rowset - Stmt.result_arrow; return_set : ARS.Datarow_Set (1 .. Natural (remaining_rows)); begin for index in return_set'Range loop Stmt.result_arrow := Stmt.result_arrow + 1; return_set (index) := Stmt.assemble_datarow (Stmt.result_arrow); end loop; return return_set; end; end fetch_all; ------------------- -- fetch_bound -- ------------------- overriding function fetch_bound (Stmt : out PostgreSQL_statement) return Boolean is function null_value (column : Natural) return Boolean; function string_equivalent (column : Natural; binary : Boolean) return String; conn : CON.PostgreSQL_Connection_Access renames Stmt.pgsql_conn; function string_equivalent (column : Natural; binary : Boolean) return String is -- PostgreSQL result set is zero-indexed row_num : constant Natural := Natural (Stmt.result_arrow) - 1; col_num : constant Natural := column - 1; begin if binary then return conn.field_chain (Stmt.result_handle, row_num, col_num, Stmt.con_max_blob); else return conn.field_string (Stmt.result_handle, row_num, col_num); end if; end string_equivalent; function null_value (column : Natural) return Boolean is -- PostgreSQL result set is zero-indexed row_num : constant Natural := Natural (Stmt.result_arrow) - 1; col_num : constant Natural := column - 1; begin return conn.field_is_null (Stmt.result_handle, row_num, col_num); end null_value; begin if Stmt.result_arrow >= Stmt.size_of_rowset then return False; end if; Stmt.result_arrow := Stmt.result_arrow + 1; declare maxlen : constant Natural := Stmt.num_columns; begin for F in 1 .. maxlen loop declare dossier : bindrec renames Stmt.crate.Element (F); colinfo : column_info renames Stmt.column_info.Element (F); Tout : constant field_types := dossier.output_type; Tnative : constant field_types := colinfo.field_type; isnull : constant Boolean := null_value (F); errmsg : constant String := "native type : " & field_types'Image (Tnative) & " binding type : " & field_types'Image (Tout); smallerr : constant String := "Native unsigned type : " & field_types'Image (Tnative) & " is too small for " & field_types'Image (Tout) & " binding type"; ST : constant String := string_equivalent (F, colinfo.binary_format); begin if not dossier.bound then goto continue; end if; if isnull or else CT.IsBlank (ST) then set_as_null (dossier); goto continue; end if; -- Because PostgreSQL does not support unsigned integer -- types, allow binding NByteX binding to ByteX types, but -- remain strict on other type mismatches. case Tout is when ft_nbyte1 => case Tnative is when ft_byte1 | ft_byte2 | ft_byte3 | ft_byte4 | ft_byte8 | ft_nbyte2 | ft_nbyte3 | ft_nbyte4 | ft_nbyte8 => null; -- Fall through (all could fail to convert) when ft_nbyte1 => null; -- guaranteed to convert when others => raise BINDING_TYPE_MISMATCH with errmsg; end case; when ft_nbyte2 => case Tnative is when ft_byte2 | ft_byte3 | ft_byte4 | ft_byte8 | ft_nbyte3 | ft_nbyte4 | ft_nbyte8 => null; -- Fall through (all could fail to convert) when ft_nbyte1 | ft_nbyte2 => null; -- guaranteed to convert when ft_byte1 => raise BINDING_TYPE_MISMATCH with smallerr; when others => raise BINDING_TYPE_MISMATCH with errmsg; end case; when ft_nbyte3 => case Tnative is when ft_byte3 | ft_byte4 | ft_byte8 | ft_nbyte4 | ft_nbyte8 => null; -- Fall through (all could fail to convert) when ft_nbyte1 | ft_nbyte2 | ft_nbyte3 => null; -- guaranteed to convert when ft_byte1 | ft_byte2 => raise BINDING_TYPE_MISMATCH with smallerr; when others => raise BINDING_TYPE_MISMATCH with errmsg; end case; when ft_nbyte4 => case Tnative is when ft_byte4 | ft_byte8 | ft_nbyte8 => null; -- Fall through (all could fail to convert) when ft_nbyte1 | ft_nbyte2 | ft_nbyte3 | ft_nbyte4 => null; -- guaranteed to convert when ft_byte1 | ft_byte2 | ft_byte3 => raise BINDING_TYPE_MISMATCH with smallerr; when others => raise BINDING_TYPE_MISMATCH with errmsg; end case; when ft_nbyte8 => case Tnative is when ft_byte8 => null; -- Fall through (could fail to convert) when ft_nbyte1 | ft_nbyte2 | ft_nbyte3 | ft_nbyte4 | ft_nbyte8 => null; -- guaranteed to convert when ft_byte1 | ft_byte2 | ft_byte3 | ft_byte4 => raise BINDING_TYPE_MISMATCH with smallerr; when others => raise BINDING_TYPE_MISMATCH with errmsg; end case; when ft_byte1 => case Tnative is when ft_byte2 => null; -- smallest poss. type (could fail to conv) when ft_byte1 => null; -- guaranteed to convert but impossible case when others => raise BINDING_TYPE_MISMATCH with errmsg; end case; when ft_byte3 => case Tnative is when ft_byte4 => null; -- smallest poss. type (could fail to conv) when ft_byte1 | ft_byte2 | ft_byte3 => null; -- guaranteed to convert (1/3 imposs.) when others => raise BINDING_TYPE_MISMATCH with errmsg; end case; when ft_real18 => case Tnative is when ft_real9 | ft_real18 => null; -- guaranteed to convert without loss when others => raise BINDING_TYPE_MISMATCH with errmsg; end case; when ft_textual => case Tnative is when ft_settype => null; -- No support for Sets in pgsql, conv->str when ft_textual | ft_widetext | ft_supertext => null; when ft_utf8 => null; -- UTF8 needs contraints, allow textual when others => raise BINDING_TYPE_MISMATCH with errmsg; end case; when ft_settype => case Tnative is when ft_textual | ft_utf8 => null; -- No support for Sets in pgsql, conv->set when ft_settype => null; -- impossible when others => raise BINDING_TYPE_MISMATCH with errmsg; end case; when others => if Tnative /= Tout then raise BINDING_TYPE_MISMATCH with errmsg; end if; end case; case Tout is when ft_nbyte0 => dossier.a00.all := (ST = "t"); when ft_nbyte1 => dossier.a01.all := convert (ST); when ft_nbyte2 => dossier.a02.all := convert (ST); when ft_nbyte3 => dossier.a03.all := convert (ST); when ft_nbyte4 => dossier.a04.all := convert (ST); when ft_nbyte8 => dossier.a05.all := convert (ST); when ft_byte1 => dossier.a06.all := convert (ST); when ft_byte2 => dossier.a07.all := convert (ST); when ft_byte3 => dossier.a08.all := convert (ST); when ft_byte4 => dossier.a09.all := convert (ST); when ft_byte8 => dossier.a10.all := convert (ST); when ft_real9 => dossier.a11.all := convert (ST); when ft_real18 => dossier.a12.all := convert (ST); when ft_textual => dossier.a13.all := CT.SUS (ST); when ft_widetext => dossier.a14.all := convert (ST); when ft_supertext => dossier.a15.all := convert (ST); when ft_enumtype => dossier.a18.all := ARC.convert (ST); when ft_utf8 => dossier.a21.all := ST; when ft_geometry => dossier.a22.all := WKB.Translate_WKB (postgis_to_WKB (ST)); when ft_timestamp => begin dossier.a16.all := ARC.convert (ST); exception when AR.CONVERSION_FAILED => dossier.a16.all := AR.PARAM_IS_TIMESTAMP; end; when ft_chain => declare FL : Natural := dossier.a17.all'Length; DVLEN : Natural := ST'Length; begin if DVLEN > FL then raise BINDING_SIZE_MISMATCH with "native size : " & DVLEN'Img & " greater than binding size : " & FL'Img; end if; dossier.a17.all := ARC.convert (ST, FL); end; when ft_settype => declare FL : Natural := dossier.a19.all'Length; items : constant Natural := CT.num_set_items (ST); begin if items > FL then raise BINDING_SIZE_MISMATCH with "native size : " & items'Img & " greater than binding size : " & FL'Img; end if; dossier.a19.all := ARC.convert (ST, FL); end; when ft_bits => declare FL : Natural := dossier.a20.all'Length; DVLEN : Natural := ST'Length; begin if DVLEN > FL then raise BINDING_SIZE_MISMATCH with "native size : " & DVLEN'Img & " greater than binding size : " & FL'Img; end if; dossier.a20.all := ARC.convert (ST, FL); end; end case; end; <<continue>> end loop; end; if Stmt.result_arrow = Stmt.size_of_rowset then conn.discard_pgresult (Stmt.result_handle); end if; return True; end fetch_bound; ---------------------- -- fetch_next_set -- ---------------------- overriding procedure fetch_next_set (Stmt : out PostgreSQL_statement; data_present : out Boolean; data_fetched : out Boolean) is conn : CON.PostgreSQL_Connection_Access renames Stmt.pgsql_conn; next_call : constant String := Stmt.pop_result_set_reference; SQL : constant String := "FETCH ALL IN " & ASCII.Quotation & next_call & ASCII.Quotation; begin data_fetched := False; data_present := False; if CT.IsBlank (next_call) then return; end if; -- Clear existing results conn.discard_pgresult (Stmt.result_handle); Stmt.column_info.Clear; Stmt.alpha_markers.Clear; Stmt.headings_map.Clear; Stmt.crate.Clear; Stmt.realmccoy.Clear; Stmt.result_present := False; Stmt.rows_leftover := False; Stmt.insert_return := False; Stmt.impacted := 0; Stmt.assign_counter := 0; Stmt.size_of_rowset := 0; Stmt.num_columns := 0; Stmt.result_arrow := 0; Stmt.last_inserted := 0; -- execute next query if conn.direct_stmt_exec (Stmt.result_handle, SQL) then Stmt.log_nominal (category => miscellaneous, message => "Stored procs next set: " & SQL); case conn.examine_result (Stmt.result_handle) is when CON.executed => data_present := True; Stmt.successful_execution := True; when CON.returned_data => data_present := True; data_fetched := True; Stmt.successful_execution := True; Stmt.insert_return := Stmt.insert_prepsql; when CON.failed => Stmt.successful_execution := False; end case; if not Stmt.insert_return then Stmt.size_of_rowset := conn.rows_in_result (Stmt.result_handle); end if; if Stmt.insert_return then Stmt.last_inserted := conn.returned_id (Stmt.result_handle); end if; Stmt.scan_column_information (Stmt.result_handle); else Stmt.log_problem (category => miscellaneous, message => "Stored procs: Failed fetch next rowset " & next_call); end if; end fetch_next_set; ------------------ -- initialize -- ------------------ overriding procedure initialize (Object : in out PostgreSQL_statement) is use type CON.PostgreSQL_Connection_Access; conn : CON.PostgreSQL_Connection_Access renames Object.pgsql_conn; logcat : Log_Category; params : Natural; stmt_name : String := Object.show_statement_name; hold_result : aliased BND.PGresult_Access; begin if conn = null then return; end if; logger_access := Object.log_handler; Object.dialect := driver_postgresql; Object.connection := ACB.Base_Connection_Access (conn); Object.insert_prepsql := False; -------------------------------- -- Set SQL and log category -- -------------------------------- case Object.type_of_statement is when direct_statement => Object.sql_final := new String'(CT.trim_sql (Object.initial_sql.all)); logcat := statement_execution; when prepared_statement => Object.sql_final := new String'(reformat_markers (Object.transform_sql (Object.initial_sql.all))); logcat := statement_preparation; end case; -------------------------------------------------------- -- Detect INSERT commands (for INSERT .. RETURNING) -- -------------------------------------------------------- declare sql : String := Object.initial_sql.all; begin if sql'Length > 12 and then ACH.To_Upper (sql (sql'First .. sql'First + 6)) = "INSERT " then Object.insert_prepsql := True; end if; end; if Object.type_of_statement = prepared_statement then ----------------------------------- -- Prepared Statement handling -- ----------------------------------- if conn.prepare_statement (stmt => Object.prepared_stmt, name => stmt_name, sql => Object.sql_final.all) then Object.stmt_allocated := True; Object.log_nominal (category => logcat, message => stmt_name & " - " & Object.sql_final.all); else Object.log_problem (statement_preparation, conn.driverMessage (Object.prepared_stmt)); Object.log_problem (category => statement_preparation, message => "Failed to prepare SQL query: '" & Object.sql_final.all & "'", break => True); return; end if; --------------------------------------- -- Get column metadata (prep stmt) -- --------------------------------------- if conn.prepare_metadata (meta => hold_result, name => stmt_name) then Object.scan_column_information (hold_result); params := conn.markers_found (hold_result); conn.discard_pgresult (hold_result); else conn.discard_pgresult (hold_result); Object.log_problem (statement_preparation, conn.driverMessage (hold_result)); Object.log_problem (category => statement_preparation, message => "Failed to acquire prep statement metadata (" & stmt_name & ")", break => True); return; end if; ------------------------------------------------------ -- Check that we have as many markers as expected -- ------------------------------------------------------ declare errmsg : String := "marker mismatch," & Object.realmccoy.Length'Img & " expected but" & params'Img & " found by PostgreSQL"; begin if params /= Natural (Object.realmccoy.Length) then Object.log_problem (category => statement_preparation, message => errmsg, break => True); return; end if; end; else --------------------------------- -- Direct statement handling -- --------------------------------- if conn.direct_stmt_exec (stmt => Object.result_handle, sql => Object.sql_final.all) then Object.log_nominal (category => logcat, message => Object.sql_final.all); case conn.examine_result (Object.result_handle) is when CON.executed => Object.successful_execution := True; when CON.returned_data => Object.successful_execution := True; Object.insert_return := Object.insert_prepsql; when CON.failed => Object.successful_execution := False; end case; if not Object.insert_return then Object.size_of_rowset := conn.rows_in_result (Object.result_handle); end if; if Object.insert_return then Object.last_inserted := conn.returned_id (Object.result_handle); end if; Object.scan_column_information (Object.result_handle); Object.push_result_references (calls => Object.next_calls.all); else Object.log_problem (category => statement_execution, message => "Failed to execute a direct SQL query"); return; end if; end if; end initialize; ------------------------------- -- scan_column_information -- ------------------------------- procedure scan_column_information (Stmt : out PostgreSQL_statement; pgresult : BND.PGresult_Access) is function fn (raw : String) return CT.Text; function sn (raw : String) return String; function fn (raw : String) return CT.Text is begin return CT.SUS (sn (raw)); end fn; function sn (raw : String) return String is begin case Stmt.con_case_mode is when upper_case => return ACH.To_Upper (raw); when lower_case => return ACH.To_Lower (raw); when natural_case => return raw; end case; end sn; conn : CON.PostgreSQL_Connection_Access renames Stmt.pgsql_conn; begin Stmt.num_columns := conn.fields_count (pgresult); for index in Natural range 0 .. Stmt.num_columns - 1 loop declare info : column_info; brec : bindrec; name : String := conn.field_name (pgresult, index); table : String := conn.field_table (pgresult, index); begin brec.v00 := False; -- placeholder info.field_name := fn (name); info.table := fn (table); info.field_type := conn.field_type (pgresult, index); info.binary_format := info.field_type = ft_chain; Stmt.column_info.Append (New_Item => info); -- The following pre-populates for bind support Stmt.crate.Append (New_Item => brec); Stmt.headings_map.Insert (Key => sn (name), New_Item => Stmt.crate.Last_Index); end; end loop; end scan_column_information; ------------------- -- log_problem -- ------------------- procedure log_problem (statement : PostgreSQL_statement; category : Log_Category; message : String; pull_codes : Boolean := False; break : Boolean := False) is error_msg : CT.Text := CT.blank; error_code : Driver_Codes := 0; sqlstate : SQL_State := stateless; begin if pull_codes then error_msg := CT.SUS (statement.last_driver_message); error_code := statement.last_driver_code; sqlstate := statement.last_sql_state; end if; logger_access.all.log_problem (driver => statement.dialect, category => category, message => CT.SUS ("PROBLEM: " & message), error_msg => error_msg, error_code => error_code, sqlstate => sqlstate, break => break); end log_problem; -------------- -- Adjust -- -------------- overriding procedure Adjust (Object : in out PostgreSQL_statement) is begin -- The stmt object goes through this evolution: -- A) created in private_prepare() -- B) copied to new object in prepare(), A) destroyed -- C) copied to new object in program, B) destroyed -- We don't want to take any action until C) is destroyed, so add a -- reference counter upon each assignment. When finalize sees a -- value of "2", it knows it is the program-level statement and then -- it can release memory releases, but not before! Object.assign_counter := Object.assign_counter + 1; -- Since the finalization is looking for a specific reference -- counter, any further assignments would fail finalization, so -- just prohibit them outright. if Object.assign_counter > 2 then raise STMT_PREPARATION with "Statement objects cannot be re-assigned."; end if; end Adjust; ---------------- -- finalize -- ---------------- overriding procedure finalize (Object : in out PostgreSQL_statement) is conn : CON.PostgreSQL_Connection_Access renames Object.pgsql_conn; name : constant String := Object.show_statement_name; begin if Object.assign_counter /= 2 then return; end if; conn.discard_pgresult (Object.result_handle); if Object.stmt_allocated then if conn.autoCommit then if not conn.destroy_statement (name) then Object.log_problem (category => statement_preparation, message => "Deallocating statement resources: " & name, pull_codes => True); end if; else -- If we deallocate a prepared statement in the middle of a -- transaction, the transaction is marked aborted, so we have -- to postpone the deallocation until commit or rollback. -- Morever, the connector needs to handle it so we don't have -- to create variations of driver.commit and driver.rollback conn.destroy_later (Object.identifier); end if; conn.discard_pgresult (Object.prepared_stmt); end if; if Object.sql_final /= null then free_sql (Object.sql_final); end if; end finalize; ------------------------ -- assemble_datarow -- ------------------------ function assemble_datarow (Stmt : out PostgreSQL_statement; row_number : Trax_ID) return ARS.Datarow is function null_value (column : Natural) return Boolean; function string_equivalent (column : Natural; binary : Boolean) return String; result : ARS.Datarow; conn : CON.PostgreSQL_Connection_Access renames Stmt.pgsql_conn; maxlen : constant Natural := Natural (Stmt.column_info.Length); function string_equivalent (column : Natural; binary : Boolean) return String is -- PostgreSQL result set is zero-indexed row_num : constant Natural := Natural (row_number) - 1; col_num : constant Natural := column - 1; begin if binary then return conn.field_chain (Stmt.result_handle, row_num, col_num, Stmt.con_max_blob); else return conn.field_string (Stmt.result_handle, row_num, col_num); end if; end string_equivalent; function null_value (column : Natural) return Boolean is -- PostgreSQL result set is zero-indexed row_num : constant Natural := Natural (row_number) - 1; col_num : constant Natural := column - 1; begin return conn.field_is_null (Stmt.result_handle, row_num, col_num); end null_value; begin for F in 1 .. maxlen loop declare colinfo : column_info renames Stmt.column_info.Element (F); field : ARF.Std_Field; dvariant : ARF.Variant; last_one : constant Boolean := (F = maxlen); isnull : constant Boolean := null_value (F); heading : constant String := CT.USS (colinfo.field_name); ST : constant String := string_equivalent (F, colinfo.binary_format); begin if isnull then field := ARF.spawn_null_field (colinfo.field_type); else case colinfo.field_type is when ft_nbyte0 => dvariant := (datatype => ft_nbyte0, v00 => ST = "t"); when ft_nbyte1 => dvariant := (datatype => ft_nbyte1, v01 => convert (ST)); when ft_nbyte2 => dvariant := (datatype => ft_nbyte2, v02 => convert (ST)); when ft_nbyte3 => dvariant := (datatype => ft_nbyte3, v03 => convert (ST)); when ft_nbyte4 => dvariant := (datatype => ft_nbyte4, v04 => convert (ST)); when ft_nbyte8 => dvariant := (datatype => ft_nbyte8, v05 => convert (ST)); when ft_byte1 => dvariant := (datatype => ft_byte1, v06 => convert (ST)); when ft_byte2 => dvariant := (datatype => ft_byte2, v07 => convert (ST)); when ft_byte3 => dvariant := (datatype => ft_byte3, v08 => convert (ST)); when ft_byte4 => dvariant := (datatype => ft_byte4, v09 => convert (ST)); when ft_byte8 => dvariant := (datatype => ft_byte8, v10 => convert (ST)); when ft_real9 => dvariant := (datatype => ft_real9, v11 => convert (ST)); when ft_real18 => dvariant := (datatype => ft_real18, v12 => convert (ST)); when ft_textual => dvariant := (datatype => ft_textual, v13 => CT.SUS (ST)); when ft_widetext => dvariant := (datatype => ft_widetext, v14 => convert (ST)); when ft_supertext => dvariant := (datatype => ft_supertext, v15 => convert (ST)); when ft_utf8 => dvariant := (datatype => ft_utf8, v21 => CT.SUS (ST)); when ft_geometry => dvariant := (datatype => ft_geometry, v22 => CT.SUS (postgis_to_WKB (ST))); when ft_timestamp => begin dvariant := (datatype => ft_timestamp, v16 => ARC.convert (ST)); exception when AR.CONVERSION_FAILED => dvariant := (datatype => ft_textual, v13 => CT.SUS (ST)); end; when ft_enumtype => dvariant := (datatype => ft_enumtype, V18 => ARC.convert (CT.SUS (ST))); when ft_chain => null; when ft_settype => null; when ft_bits => null; end case; case colinfo.field_type is when ft_chain => field := ARF.spawn_field (binob => ARC.convert (ST)); when ft_bits => field := ARF.spawn_bits_field (ST); when ft_settype => field := ARF.spawn_field (enumset => ST); when others => field := ARF.spawn_field (data => dvariant, null_data => isnull); end case; end if; result.push (heading => heading, field => field, last_field => last_one); end; end loop; if Stmt.result_arrow = Stmt.size_of_rowset then conn.discard_pgresult (Stmt.result_handle); end if; return result; end assemble_datarow; --------------------------- -- show_statement_name -- --------------------------- function show_statement_name (Stmt : PostgreSQL_statement) return String is begin -- This is not documented, but the name has to be all lower case. -- This nugget was responsible for hours of tracking down -- prepared statement deallocation errors. return "adabase_" & CT.trim (Stmt.identifier'Img); end show_statement_name; ----------------------- -- bind_text_value -- ----------------------- function bind_text_value (Stmt : PostgreSQL_statement; marker : Positive) return AR.Textual is zone : bindrec renames Stmt.realmccoy.Element (marker); vartype : constant field_types := zone.output_type; use type AR.NByte0_Access; use type AR.NByte1_Access; use type AR.NByte2_Access; use type AR.NByte3_Access; use type AR.NByte4_Access; use type AR.NByte8_Access; use type AR.Byte1_Access; use type AR.Byte2_Access; use type AR.Byte3_Access; use type AR.Byte4_Access; use type AR.Byte8_Access; use type AR.Real9_Access; use type AR.Real18_Access; use type AR.Str1_Access; use type AR.Str2_Access; use type AR.Str4_Access; use type AR.Time_Access; use type AR.Enum_Access; use type AR.Chain_Access; use type AR.Settype_Access; use type AR.Bits_Access; use type AR.S_UTF8_Access; use type AR.Geometry_Access; hold : AR.Textual; begin case vartype is when ft_nbyte0 => if zone.a00 = null then hold := ARC.convert (zone.v00); else hold := ARC.convert (zone.a00.all); end if; when ft_nbyte1 => if zone.a01 = null then hold := ARC.convert (zone.v01); else hold := ARC.convert (zone.a01.all); end if; when ft_nbyte2 => if zone.a02 = null then hold := ARC.convert (zone.v02); else hold := ARC.convert (zone.a02.all); end if; when ft_nbyte3 => if zone.a03 = null then hold := ARC.convert (zone.v03); else hold := ARC.convert (zone.a03.all); end if; when ft_nbyte4 => if zone.a04 = null then hold := ARC.convert (zone.v04); else hold := ARC.convert (zone.a04.all); end if; when ft_nbyte8 => if zone.a05 = null then hold := ARC.convert (zone.v05); else hold := ARC.convert (zone.a05.all); end if; when ft_byte1 => if zone.a06 = null then hold := ARC.convert (zone.v06); else hold := ARC.convert (zone.a06.all); end if; when ft_byte2 => if zone.a07 = null then hold := ARC.convert (zone.v07); else hold := ARC.convert (zone.a07.all); end if; when ft_byte3 => if zone.a08 = null then hold := ARC.convert (zone.v08); else hold := ARC.convert (zone.a08.all); end if; when ft_byte4 => if zone.a09 = null then hold := ARC.convert (zone.v09); else hold := ARC.convert (zone.a09.all); end if; when ft_byte8 => if zone.a10 = null then hold := ARC.convert (zone.v10); else hold := ARC.convert (zone.a10.all); end if; when ft_real9 => if zone.a11 = null then hold := ARC.convert (zone.v11); else hold := ARC.convert (zone.a11.all); end if; when ft_real18 => if zone.a12 = null then hold := ARC.convert (zone.v12); else hold := ARC.convert (zone.a12.all); end if; when ft_textual => if zone.a13 = null then hold := zone.v13; else hold := zone.a13.all; end if; when ft_widetext => if zone.a14 = null then hold := ARC.convert (zone.v14); else hold := ARC.convert (zone.a14.all); end if; when ft_supertext => if zone.a15 = null then hold := ARC.convert (zone.v15); else hold := ARC.convert (zone.a15.all); end if; when ft_timestamp => if zone.a16 = null then hold := ARC.convert (zone.v16); else hold := ARC.convert (zone.a16.all); end if; when ft_chain => if zone.a17 = null then hold := zone.v17; else hold := ARC.convert (zone.a17.all); end if; when ft_enumtype => if zone.a18 = null then hold := ARC.convert (zone.v18); else hold := ARC.convert (zone.a18.all); end if; when ft_settype => if zone.a19 = null then hold := zone.v19; else hold := ARC.convert (zone.a19.all); end if; when ft_bits => if zone.a20 = null then hold := zone.v20; else hold := ARC.convert (zone.a20.all); end if; when ft_utf8 => if zone.a21 = null then hold := zone.v21; else hold := CT.SUS (zone.a21.all); end if; when ft_geometry => if zone.a22 = null then hold := CT.SUS (WKB.produce_WKT (zone.v22)); else hold := CT.SUS (Spatial_Data.Well_Known_Text (zone.a22.all)); end if; end case; return hold; end bind_text_value; --------------------------- -- returned_refcursors -- --------------------------- function returned_refcursors (Stmt : PostgreSQL_statement) return Boolean is conn : CON.PostgreSQL_Connection_Access renames Stmt.pgsql_conn; begin return Stmt.size_of_rowset > 0 and then conn.holds_refcursor (Stmt.result_handle, 0); end returned_refcursors; -------------------------------- -- pop_result_set_reference -- -------------------------------- function pop_result_set_reference (Stmt : out PostgreSQL_statement) return String is begin if Stmt.refcursors.Is_Empty then return ""; end if; declare answer : String := CT.USS (Stmt.refcursors.First_Element.payload); begin Stmt.refcursors.Delete_First; return answer; end; end pop_result_set_reference; ------------------------------ -- push_result_references -- ------------------------------ procedure push_result_references (Stmt : out PostgreSQL_statement; calls : String) is items : Natural; base : Natural; begin if CT.IsBlank (calls) then return; end if; items := CT.num_set_items (calls); if items = 1 then Stmt.refcursors.Append ((payload => CT.SUS (calls))); else base := calls'First; for x in Natural range 1 .. items - 1 loop for y in Natural range base .. calls'Last loop if calls (y) = ',' then declare len : Natural := y - base; Str : String (1 .. len) := calls (base .. y - 1); begin Stmt.refcursors.Append ((payload => CT.SUS (Str))); base := y + 1; end; exit; end if; end loop; end loop; declare len : Natural := calls'Last + 1 - base; Str : String (1 .. len) := calls (base .. calls'Last); begin Stmt.refcursors.Append ((payload => CT.SUS (Str))); end; end if; end push_result_references; ---------------------- -- postgis_to_WKB -- ---------------------- function postgis_to_WKB (postgis : String) return String is subtype hex_type is String (1 .. 2); function hex2char (hex : hex_type) return Character; -- Postgis is a string of hexidecimal values (e.g. 0 .. F) -- position 01-02 = endian (1 byte) -- position 03-04 = WKB type (1 byte, not 4 bytes) -- position 05-10 - internal, ignore (3 bytes) -- position 11-18 - SRID, ignore, 4 bytes -- position 19+ is stock WKB. -- Must always be evenly numbered (2 digits per byte) function hex2char (hex : hex_type) return Character is sixt : Character renames hex (1); ones : Character renames hex (2); zero : Natural := Character'Pos ('0'); alpha : Natural := Character'Pos ('A'); val : Natural; begin case sixt is when '0' .. '9' => val := 16 * (Character'Pos (sixt) - zero); when 'A' .. 'F' => val := 16 * (10 + Character'Pos (sixt) - alpha); when others => raise POSTGIS_READ_ERROR with "hex (1) invalid character: " & sixt; end case; case ones is when '0' .. '9' => val := val + (Character'Pos (ones) - zero); when 'A' .. 'F' => val := val + (10 + Character'Pos (ones) - alpha); when others => raise POSTGIS_READ_ERROR with "hex (2) invalid character: " & ones; end case; return Character'Val (val); end hex2char; output_size : constant Natural := (postgis'Length / 2) - 4; wkb_string : String (1 .. output_size) := (others => ASCII.NUL); canvas : String (1 .. postgis'Length) := postgis; endian_sign : constant hex_type := canvas (1 .. 2); geom_type : constant hex_type := canvas (3 .. 4); begin wkb_string (1) := hex2char (endian_sign); if Character'Pos (wkb_string (1)) = 1 then -- little endian wkb_string (2) := hex2char (geom_type); else -- big endian wkb_string (5) := hex2char (geom_type); end if; for chunk in 6 .. output_size loop wkb_string (chunk) := hex2char (canvas ((chunk * 2) + 7 .. (chunk * 2) + 8)); end loop; return wkb_string; end postgis_to_WKB; end AdaBase.Statement.Base.PostgreSQL;
------------------------------------------------------------------------------ -- Copyright (C) 2020 by Heisenbug Ltd. (gh+spat@heisenbug.eu) -- -- This work is free. You can redistribute it and/or modify it under the -- terms of the Do What The Fuck You Want To Public License, Version 2, -- as published by Sam Hocevar. See the LICENSE file for more details. ------------------------------------------------------------------------------ pragma License (Unrestricted); ------------------------------------------------------------------------------ -- -- SPARK Proof Analysis Tool -- -- S.P.A.T. - Provide atomic ids (counters) to facilitate stable sorting. -- Each instantiation provides its own local counter. -- ------------------------------------------------------------------------------ with GNATCOLL.Atomic; generic package SPAT.Unique_Ids is -- Sometimes entries are identical which makes sorting unstable. To -- counter the issue we add a unique id to each entry which serves as a -- last ditch sorting criterion, making two entries always distinct. -- CAREFUL: This approach only works if the order of elements being -- inserted does not change between runs (I'm thinking further -- parallelization here). But to make sure this works in a -- tasking context anyway we use atomic increments to generate -- our ids. -- Luckily GNATCOLL already serves us, so we don't need to wrap -- it into our own protected type (inefficient) or revert to -- compiler/target specific intrinsics. subtype Id is GNATCOLL.Atomic.Atomic_Counter; -- Our id type. -------------------------------------------------------------------------- -- Next -- -- Returns the next available id. -- Id is a modular type, so it wraps around instead of overflow, but we -- should never be able to exhaust an Id's range, anyway. -------------------------------------------------------------------------- function Next return Id with Volatile_Function => True; end SPAT.Unique_Ids;
type Queue is limited interface; procedure Enqueue (Lounge : in out Queue; Item : in out Element) is abstract; procedure Dequeue (Lounge : in out Queue; Item : in out Element) is abstract;
with Histogram; with PixelArray; with ImageRegions; package HistogramDescriptor is pragma Assertion_Policy (Pre => Check, Post => Check, Type_Invariant => Check); BinCount: Positive := 20; type Divergence is (JensenShannon, KullbackLeibler); type Data is tagged record horizontal: Histogram.Data(BinCount); vertical: Histogram.Data(BinCount); end record; function create(image: PixelArray.ImagePlane; region: ImageRegions.Rect) return Data with Pre => region.width /= 0 and region.height /= 0; function computeDivergence(h0, h1: Histogram.Data; method: Divergence) return Float with Pre => (h0.Size = h1.Size); end HistogramDescriptor;
-- C97115A.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 WHETHER AN ENTRY FAMILY INDEX EXPRESSION FOLLOWING AN OPEN -- GUARD IS EVALUATED DIRECTLY AFTER THE GUARD, OR ONLY AFTER ALL GUARDS -- HAVE BEEN EVALUATED, OR IN SOME MIXED ORDER SUCH THAT INDEX -- EXPRESSIONS ARE EVALUATED AFTER THEIR GUARDS ARE DETERMINED TO BE -- OPEN. -- RM 5/11/82 -- SPS 11/21/82 -- JBG 10/24/83 -- PWN 09/11/94 REMOVED PRAGMA PRIORITY FOR ADA 9X. with Impdef; WITH REPORT; USE REPORT; WITH SYSTEM; USE SYSTEM; PROCEDURE C97115A IS -- THE TASK WILL HAVE LAST PRIORITY ( PRIORITY'FIRST ) EVAL_ORDER : STRING (1..6) := ( 1..6 => '*' ); EVAL_ORD : STRING (1..6) := ( 1..6 => '*' ); INDEX : INTEGER := 0; FUNCTION F1 (X:INTEGER) RETURN INTEGER IS BEGIN INDEX := INDEX + 1; EVAL_ORDER (INDEX) := 'F'; -- 123: FGH EVAL_ORD (INDEX) := 'G'; -- 123: GGG ( 'G' FOR 'GUARD' ) RETURN ( IDENT_INT(7) ); END F1; FUNCTION F2 (X:INTEGER) RETURN INTEGER IS BEGIN INDEX := INDEX + 1; EVAL_ORDER (INDEX) := 'G'; EVAL_ORD (INDEX) := 'G'; RETURN ( IDENT_INT(7) ); END F2; FUNCTION F3 (X:INTEGER) RETURN INTEGER IS BEGIN INDEX := INDEX + 1; EVAL_ORDER (INDEX) := 'H'; EVAL_ORD (INDEX) := 'G'; RETURN ( IDENT_INT(7) ); END F3; FUNCTION I1 ( X:INTEGER ) RETURN BOOLEAN IS BEGIN INDEX := INDEX + 1; EVAL_ORDER (INDEX) := 'A'; -- 123: ABC EVAL_ORD (INDEX) := 'I'; -- 123: III ( 'I' FOR 'INDEX' ) RETURN ( IDENT_BOOL(TRUE) ); -- (THAT'S ENTRY-FAMILY INDEX) END I1; FUNCTION I2 ( X:INTEGER ) RETURN BOOLEAN IS BEGIN INDEX := INDEX + 1; EVAL_ORDER (INDEX) := 'B'; EVAL_ORD (INDEX) := 'I'; RETURN ( IDENT_BOOL(TRUE) ); END I2; FUNCTION I3 ( X:INTEGER ) RETURN BOOLEAN IS BEGIN INDEX := INDEX + 1; EVAL_ORDER (INDEX) := 'C'; EVAL_ORD (INDEX) := 'I'; RETURN ( IDENT_BOOL(TRUE) ); END I3; FUNCTION POS_OF (FUNC : CHARACTER) RETURN INTEGER IS BEGIN FOR I IN EVAL_ORDER'RANGE LOOP IF EVAL_ORDER(I) = FUNC THEN RETURN I; END IF; END LOOP; FAILED ("DID NOT FIND LETTER " & FUNC); RETURN 0; END POS_OF; BEGIN TEST ("C97115A", "CHECK THAT THE INDEX EXPRESSIONS ARE" & " EVALUATED AFTER THE GUARDS BUT" & " BEFORE THE RENDEZVOUS IS ATTEMPTED" ); DECLARE TASK T IS ENTRY E ( BOOLEAN ); ENTRY E1; END T; TASK BODY T IS BEGIN WHILE E1'COUNT = 0 -- IF E1 NOT YET CALLED, THEN GIVE LOOP -- THE MAIN TASK AN OPPORTUNITY DELAY 10.01 * Impdef.One_Second; -- TO ISSUE THE CALL. END LOOP; SELECT ACCEPT E1; OR WHEN 6 + F1(7) = 13 => ACCEPT E ( I1(17) ); OR WHEN 6 + F2(7) = 13 => ACCEPT E ( I2(17) ); OR WHEN 6 + F3(7) = 13 => ACCEPT E ( I3(17) ); END SELECT; END T; BEGIN T.E1; END; -- END OF BLOCK CONTAINING THE ENTRY CALLS COMMENT ("GUARD AND INDEX FUNCTIONS WERE CALLED IN ORDER " & EVAL_ORDER); COMMENT ("GUARD AND INDEX EXPRESSIONS WERE EVALUATED IN THE " & "ORDER " & EVAL_ORD); IF POS_OF ('F') > POS_OF ('A') OR POS_OF ('G') > POS_OF ('B') OR POS_OF ('H') > POS_OF ('C') THEN FAILED ("AN INDEX EXPRESSION WAS EVALUATED TOO EARLY"); END IF; RESULT; END C97115A;
-- { dg-do compile } -- { dg-options "-O2" } with Unchecked_Conversion; procedure Warn4 is type POSIX_Character is new Standard.Character; type POSIX_String is array (Positive range <>) of aliased POSIX_Character; type String_Ptr is access all String; type POSIX_String_Ptr is access all POSIX_String; function sptr_to_psptr is new Unchecked_Conversion -- { dg-warning "aliasing problem" } (String_Ptr, POSIX_String_Ptr); -- { dg-warning "" "" { target *-*-* } 14 } function To_POSIX_String (Str : String) return POSIX_String; function To_POSIX_String (Str : String) return POSIX_String is begin return sptr_to_psptr (Str'Unrestricted_Access).all; end To_POSIX_String; A : Boolean; S : String := "ABCD/abcd"; P : Posix_String := "ABCD/abcd"; begin A := To_POSIX_String (S) = P; end;
-- Standard Ada library specification -- Copyright (c) 2003-2018 Maxim Reznik <reznikmm@gmail.com> -- Copyright (c) 2004-2016 AXE Consultants -- Copyright (c) 2004, 2005, 2006 Ada-Europe -- Copyright (c) 2000 The MITRE Corporation, Inc. -- Copyright (c) 1992, 1993, 1994, 1995 Intermetrics, Inc. -- SPDX-License-Identifier: BSD-3-Clause and LicenseRef-AdaReferenceManual --------------------------------------------------------------------------- generic type Index_Type is (<>); type Element_Type is private; type Array_Type is array (Index_Type) of Element_Type; with function "<" (Left : in Element_Type; Right : in Element_Type) return Boolean is <>; procedure Ada.Containers.Generic_Constrained_Array_Sort (Container : in out Array_Type); pragma Pure (Ada.Containers.Generic_Constrained_Array_Sort);
with ada.text_io, es_impar_montana; use Ada.Text_Io; procedure Prueba_Es_Impar_Montana is n1:integer:=0; begin -- caso de prueba 1: n1:=165; Put_line(" 165 --> TRUE"); put("Y tu programa dice que:"); Put_line("--> "& Boolean'Image(es_impar_montana(n1))); new_line; -- caso de prueba 2: n1:=3769572; Put_line("3769572 --> TRUE"); put("Y tu programa dice que:"); Put_line("--> "& Boolean'Image(es_impar_montana(n1))); new_line; -- caso de prueba 3: n1:=1; Put_line(" 1 --> TRUE"); put("Y tu programa dice que:"); Put_line("--> "& Boolean'Image(es_impar_montana(n1))); new_line; -- caso de prueba 4: n1:= 25; Put_line(" 25 --> FALSE (numero par de digitos)"); put("Y tu programa dice que:"); Put_line("--> "& Boolean'Image(es_impar_montana(n1))); new_line; -- caso de prueba 5: n1:= 129; Put_line(" 129 --> FALSE (2 no es el maximo)"); put("Y tu programa dice que:"); Put_line("--> "& Boolean'Image(es_impar_montana(n1))); New_Line; -- caso de prueba 6: n1:= 356; Put_line(" 356 --> FALSE (5 no es el maximo)"); put("Y tu programa dice que:"); Put_line("--> "& Boolean'Image(es_impar_montana(n1))); new_line; end Prueba_Es_Impar_Montana;
-- Copyright (c) 2021 Devin Hill -- zlib License -- see LICENSE for details. package GBA.Audio is type Sweep_Shift_Type is range 0 .. 7; type Frequency_Direction is ( Increasing , Decreasing ); for Frequency_Direction use ( Increasing => 0 , Decreasing => 1 ); type Sweep_Duration_Type is range 0 .. 7; type Sweep_Control_Info is record Shift : Sweep_Shift_Type; Frequency_Change : Frequency_Direction; Duration : Sweep_Duration_Type; end record with Size => 16; for Sweep_Control_Info use record Shift at 0 range 0 .. 2; Frequency_Change at 0 range 3 .. 3; Duration at 0 range 4 .. 6; end record; type Sound_Duration_Type is range 0 .. 63; type Wave_Pattern_Duty_Type is range 0 .. 3; type Envelope_Step_Type is range 0 .. 7; type Envelope_Direction is ( Increasing , Decreasing ); for Envelope_Direction use ( Increasing => 1 , Decreasing => 0 ); type Initial_Volume_Type is range 0 .. 15; type Duty_Length_Info is record Duration : Sound_Duration_Type; Wave_Pattern_Duty : Wave_Pattern_Duty_Type; Envelope_Step_Time : Envelope_Step_Type; Envelope_Change : Envelope_Direction; Initial_Volume : Initial_Volume_Type; end record with Size => 16; for Duty_Length_Info use record Duration at 0 range 0 .. 5; Wave_Pattern_Duty at 0 range 6 .. 7; Envelope_Step_Time at 0 range 8 .. 10; Envelope_Direction at 0 range 11 .. 11; Initial_Volume at 0 range 12 .. 15; end record; type Frequency_Type is range 0 .. 2047; type Frequency_Control_Info is record Frequency : Frequency_Type; Use_Duration : Boolean; Initial : Boolean; end record with Size => 16; for Frequency_Control_Info use record Frequency at 0 range 0 .. 10; Use_Duration at 0 range 14 .. 14; Initial at 0 range 15 .. 15; end record; end GBA.Audio;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- -- S Y S T E M . O S _ I N T E R F A C E -- -- -- -- S p e c -- -- -- -- Copyright (C) 1991-2017, Florida State University -- -- Copyright (C) 1995-2020, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNARL was developed by the GNARL team at Florida State University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This is a NT (native) version of this package -- This package encapsulates all direct interfaces to OS services -- that are needed by the tasking run-time (libgnarl). For non tasking -- oriented services consider declaring them into system-win32. -- PLEASE DO NOT add any with-clauses to this package or remove the pragma -- Preelaborate. This package is designed to be a bottom-level (leaf) package. with Ada.Unchecked_Conversion; with Interfaces.C; with Interfaces.C.Strings; with System.Win32; package System.OS_Interface is pragma Preelaborate; pragma Linker_Options ("-mthreads"); subtype int is Interfaces.C.int; subtype long is Interfaces.C.long; subtype LARGE_INTEGER is System.Win32.LARGE_INTEGER; ------------------- -- General Types -- ------------------- subtype PSZ is Interfaces.C.Strings.chars_ptr; Null_Void : constant Win32.PVOID := System.Null_Address; ------------------------- -- Handles for objects -- ------------------------- subtype Thread_Id is Win32.HANDLE; ----------- -- Errno -- ----------- NO_ERROR : constant := 0; FUNC_ERR : constant := -1; ------------- -- Signals -- ------------- Max_Interrupt : constant := 31; type Signal is new int range 0 .. Max_Interrupt; for Signal'Size use int'Size; SIGINT : constant := 2; -- interrupt (Ctrl-C) SIGILL : constant := 4; -- illegal instruction (not reset) SIGFPE : constant := 8; -- floating point exception SIGSEGV : constant := 11; -- segmentation violation SIGTERM : constant := 15; -- software termination signal from kill SIGBREAK : constant := 21; -- break (Ctrl-Break) SIGABRT : constant := 22; -- used by abort, replace SIGIOT in the future type sigset_t is private; type isr_address is access procedure (sig : int); pragma Convention (C, isr_address); function intr_attach (sig : int; handler : isr_address) return long; pragma Import (C, intr_attach, "signal"); Intr_Attach_Reset : constant Boolean := True; -- True if intr_attach is reset after an interrupt handler is called procedure kill (sig : Signal); pragma Import (C, kill, "raise"); ------------ -- Clock -- ------------ procedure QueryPerformanceFrequency (lpPerformanceFreq : access LARGE_INTEGER); pragma Import (Stdcall, QueryPerformanceFrequency, "QueryPerformanceFrequency"); -- According to the spec, on XP and later than function cannot fail, -- so we ignore the return value and import it as a procedure. ------------- -- Threads -- ------------- type Thread_Body is access function (arg : System.Address) return System.Address; pragma Convention (C, Thread_Body); function Thread_Body_Access is new Ada.Unchecked_Conversion (System.Address, Thread_Body); procedure SwitchToThread; pragma Import (Stdcall, SwitchToThread, "SwitchToThread"); function GetThreadTimes (hThread : Win32.HANDLE; lpCreationTime : access Long_Long_Integer; lpExitTime : access Long_Long_Integer; lpKernelTime : access Long_Long_Integer; lpUserTime : access Long_Long_Integer) return Win32.BOOL; pragma Import (Stdcall, GetThreadTimes, "GetThreadTimes"); ----------------------- -- Critical sections -- ----------------------- type CRITICAL_SECTION is private; ------------------------------------------------------------- -- Thread Creation, Activation, Suspension And Termination -- ------------------------------------------------------------- type PTHREAD_START_ROUTINE is access function (pThreadParameter : Win32.PVOID) return Win32.DWORD; pragma Convention (Stdcall, PTHREAD_START_ROUTINE); function To_PTHREAD_START_ROUTINE is new Ada.Unchecked_Conversion (System.Address, PTHREAD_START_ROUTINE); function CreateThread (pThreadAttributes : access Win32.SECURITY_ATTRIBUTES; dwStackSize : Win32.DWORD; pStartAddress : PTHREAD_START_ROUTINE; pParameter : Win32.PVOID; dwCreationFlags : Win32.DWORD; pThreadId : access Win32.DWORD) return Win32.HANDLE; pragma Import (Stdcall, CreateThread, "CreateThread"); function BeginThreadEx (pThreadAttributes : access Win32.SECURITY_ATTRIBUTES; dwStackSize : Win32.DWORD; pStartAddress : PTHREAD_START_ROUTINE; pParameter : Win32.PVOID; dwCreationFlags : Win32.DWORD; pThreadId : not null access Win32.DWORD) return Win32.HANDLE; pragma Import (C, BeginThreadEx, "_beginthreadex"); Debug_Process : constant := 16#00000001#; Debug_Only_This_Process : constant := 16#00000002#; Create_Suspended : constant := 16#00000004#; Detached_Process : constant := 16#00000008#; Create_New_Console : constant := 16#00000010#; Create_New_Process_Group : constant := 16#00000200#; Create_No_window : constant := 16#08000000#; Profile_User : constant := 16#10000000#; Profile_Kernel : constant := 16#20000000#; Profile_Server : constant := 16#40000000#; Stack_Size_Param_Is_A_Reservation : constant := 16#00010000#; function GetExitCodeThread (hThread : Win32.HANDLE; pExitCode : not null access Win32.DWORD) return Win32.BOOL; pragma Import (Stdcall, GetExitCodeThread, "GetExitCodeThread"); function ResumeThread (hThread : Win32.HANDLE) return Win32.DWORD; pragma Import (Stdcall, ResumeThread, "ResumeThread"); function SuspendThread (hThread : Win32.HANDLE) return Win32.DWORD; pragma Import (Stdcall, SuspendThread, "SuspendThread"); procedure ExitThread (dwExitCode : Win32.DWORD); pragma Import (Stdcall, ExitThread, "ExitThread"); procedure EndThreadEx (dwExitCode : Win32.DWORD); pragma Import (C, EndThreadEx, "_endthreadex"); function TerminateThread (hThread : Win32.HANDLE; dwExitCode : Win32.DWORD) return Win32.BOOL; pragma Import (Stdcall, TerminateThread, "TerminateThread"); function GetCurrentThread return Win32.HANDLE; pragma Import (Stdcall, GetCurrentThread, "GetCurrentThread"); function GetCurrentProcess return Win32.HANDLE; pragma Import (Stdcall, GetCurrentProcess, "GetCurrentProcess"); function GetCurrentThreadId return Win32.DWORD; pragma Import (Stdcall, GetCurrentThreadId, "GetCurrentThreadId"); function TlsAlloc return Win32.DWORD; pragma Import (Stdcall, TlsAlloc, "TlsAlloc"); function TlsGetValue (dwTlsIndex : Win32.DWORD) return Win32.PVOID; pragma Import (Stdcall, TlsGetValue, "TlsGetValue"); function TlsSetValue (dwTlsIndex : Win32.DWORD; pTlsValue : Win32.PVOID) return Win32.BOOL; pragma Import (Stdcall, TlsSetValue, "TlsSetValue"); function TlsFree (dwTlsIndex : Win32.DWORD) return Win32.BOOL; pragma Import (Stdcall, TlsFree, "TlsFree"); TLS_Nothing : constant := Win32.DWORD'Last; procedure ExitProcess (uExitCode : Interfaces.C.unsigned); pragma Import (Stdcall, ExitProcess, "ExitProcess"); function WaitForSingleObject (hHandle : Win32.HANDLE; dwMilliseconds : Win32.DWORD) return Win32.DWORD; pragma Import (Stdcall, WaitForSingleObject, "WaitForSingleObject"); function WaitForSingleObjectEx (hHandle : Win32.HANDLE; dwMilliseconds : Win32.DWORD; fAlertable : Win32.BOOL) return Win32.DWORD; pragma Import (Stdcall, WaitForSingleObjectEx, "WaitForSingleObjectEx"); Wait_Infinite : constant := Win32.DWORD'Last; WAIT_TIMEOUT : constant := 16#0000_0102#; WAIT_FAILED : constant := 16#FFFF_FFFF#; ------------------------------------ -- Semaphores, Events and Mutexes -- ------------------------------------ function CreateSemaphore (pSemaphoreAttributes : access Win32.SECURITY_ATTRIBUTES; lInitialCount : Interfaces.C.long; lMaximumCount : Interfaces.C.long; pName : PSZ) return Win32.HANDLE; pragma Import (Stdcall, CreateSemaphore, "CreateSemaphoreA"); function OpenSemaphore (dwDesiredAccess : Win32.DWORD; bInheritHandle : Win32.BOOL; pName : PSZ) return Win32.HANDLE; pragma Import (Stdcall, OpenSemaphore, "OpenSemaphoreA"); function ReleaseSemaphore (hSemaphore : Win32.HANDLE; lReleaseCount : Interfaces.C.long; pPreviousCount : access Win32.LONG) return Win32.BOOL; pragma Import (Stdcall, ReleaseSemaphore, "ReleaseSemaphore"); function CreateEvent (pEventAttributes : access Win32.SECURITY_ATTRIBUTES; bManualReset : Win32.BOOL; bInitialState : Win32.BOOL; pName : PSZ) return Win32.HANDLE; pragma Import (Stdcall, CreateEvent, "CreateEventA"); function OpenEvent (dwDesiredAccess : Win32.DWORD; bInheritHandle : Win32.BOOL; pName : PSZ) return Win32.HANDLE; pragma Import (Stdcall, OpenEvent, "OpenEventA"); function SetEvent (hEvent : Win32.HANDLE) return Win32.BOOL; pragma Import (Stdcall, SetEvent, "SetEvent"); function ResetEvent (hEvent : Win32.HANDLE) return Win32.BOOL; pragma Import (Stdcall, ResetEvent, "ResetEvent"); function PulseEvent (hEvent : Win32.HANDLE) return Win32.BOOL; pragma Import (Stdcall, PulseEvent, "PulseEvent"); function CreateMutex (pMutexAttributes : access Win32.SECURITY_ATTRIBUTES; bInitialOwner : Win32.BOOL; pName : PSZ) return Win32.HANDLE; pragma Import (Stdcall, CreateMutex, "CreateMutexA"); function OpenMutex (dwDesiredAccess : Win32.DWORD; bInheritHandle : Win32.BOOL; pName : PSZ) return Win32.HANDLE; pragma Import (Stdcall, OpenMutex, "OpenMutexA"); function ReleaseMutex (hMutex : Win32.HANDLE) return Win32.BOOL; pragma Import (Stdcall, ReleaseMutex, "ReleaseMutex"); --------------------------------------------------- -- Accessing properties of Threads and Processes -- --------------------------------------------------- ----------------- -- Priorities -- ----------------- function SetThreadPriority (hThread : Win32.HANDLE; nPriority : Interfaces.C.int) return Win32.BOOL; pragma Import (Stdcall, SetThreadPriority, "SetThreadPriority"); function GetThreadPriority (hThread : Win32.HANDLE) return Interfaces.C.int; pragma Import (Stdcall, GetThreadPriority, "GetThreadPriority"); function SetPriorityClass (hProcess : Win32.HANDLE; dwPriorityClass : Win32.DWORD) return Win32.BOOL; pragma Import (Stdcall, SetPriorityClass, "SetPriorityClass"); procedure SetThreadPriorityBoost (hThread : Win32.HANDLE; DisablePriorityBoost : Win32.BOOL); pragma Import (Stdcall, SetThreadPriorityBoost, "SetThreadPriorityBoost"); Normal_Priority_Class : constant := 16#00000020#; Idle_Priority_Class : constant := 16#00000040#; High_Priority_Class : constant := 16#00000080#; Realtime_Priority_Class : constant := 16#00000100#; Thread_Priority_Idle : constant := -15; Thread_Priority_Lowest : constant := -2; Thread_Priority_Below_Normal : constant := -1; Thread_Priority_Normal : constant := 0; Thread_Priority_Above_Normal : constant := 1; Thread_Priority_Highest : constant := 2; Thread_Priority_Time_Critical : constant := 15; Thread_Priority_Error_Return : constant := Interfaces.C.long'Last; private type sigset_t is new Interfaces.C.unsigned_long; type CRITICAL_SECTION is record DebugInfo : System.Address; LockCount : Long_Integer; RecursionCount : Long_Integer; OwningThread : Win32.HANDLE; -- The above three fields control entering and exiting the critical -- section for the resource. LockSemaphore : Win32.HANDLE; SpinCount : Interfaces.C.size_t; end record; end System.OS_Interface;
-- { dg-do compile } -- { dg-options "-gnatws" } procedure Conv_Integer is S : constant := Integer'Size; type Regoff_T is range -1 .. 2 ** (S-1); for Regoff_T'Size use S; B : Integer; C : Regoff_T; begin B := Integer (C); end;
-- FastAPI -- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -- -- The version of the OpenAPI document: 0.1.0 -- -- -- NOTE: This package is auto generated by OpenAPI-Generator 4.0.0. -- https://openapi-generator.tech -- Do not edit the class manually. with Swagger.Streams; with Ada.Containers.Vectors; package .Models is -- ------------------------------ -- ValidationError -- ------------------------------ type ValidationErrorType is record Loc : Swagger.UString_Vectors.Vector; Msg : Swagger.UString; P_Type : Swagger.UString; end record; package ValidationErrorType_Vectors is new Ada.Containers.Vectors (Index_Type => Positive, Element_Type => ValidationErrorType); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in ValidationErrorType); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in ValidationErrorType_Vectors.Vector); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out ValidationErrorType); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out ValidationErrorType_Vectors.Vector); -- ------------------------------ -- HTTPValidationError -- ------------------------------ type HTTPValidationErrorType is record Detail : .Models.ValidationErrorType_Vectors.Vector; end record; package HTTPValidationErrorType_Vectors is new Ada.Containers.Vectors (Index_Type => Positive, Element_Type => HTTPValidationErrorType); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in HTTPValidationErrorType); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in HTTPValidationErrorType_Vectors.Vector); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out HTTPValidationErrorType); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out HTTPValidationErrorType_Vectors.Vector); -- ------------------------------ -- Body_apply_image_image_background_removal__post -- ------------------------------ type BodyApplyImageImageBackgroundRemovalPostType is record Image : Swagger.Http_Content_Type; end record; package BodyApplyImageImageBackgroundRemovalPostType_Vectors is new Ada.Containers.Vectors (Index_Type => Positive, Element_Type => BodyApplyImageImageBackgroundRemovalPostType); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in BodyApplyImageImageBackgroundRemovalPostType); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in BodyApplyImageImageBackgroundRemovalPostType_Vectors.Vector); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out BodyApplyImageImageBackgroundRemovalPostType); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out BodyApplyImageImageBackgroundRemovalPostType_Vectors.Vector); -- ------------------------------ -- Body_apply_image_image_colorization__post -- ------------------------------ type BodyApplyImageImageColorizationPostType is record Image : Swagger.Http_Content_Type; end record; package BodyApplyImageImageColorizationPostType_Vectors is new Ada.Containers.Vectors (Index_Type => Positive, Element_Type => BodyApplyImageImageColorizationPostType); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in BodyApplyImageImageColorizationPostType); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in BodyApplyImageImageColorizationPostType_Vectors.Vector); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out BodyApplyImageImageColorizationPostType); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out BodyApplyImageImageColorizationPostType_Vectors.Vector); -- ------------------------------ -- Body_apply_image_image_face_bluring__post -- ------------------------------ type BodyApplyImageImageFaceBluringPostType is record Image : Swagger.Http_Content_Type; end record; package BodyApplyImageImageFaceBluringPostType_Vectors is new Ada.Containers.Vectors (Index_Type => Positive, Element_Type => BodyApplyImageImageFaceBluringPostType); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in BodyApplyImageImageFaceBluringPostType); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in BodyApplyImageImageFaceBluringPostType_Vectors.Vector); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out BodyApplyImageImageFaceBluringPostType); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out BodyApplyImageImageFaceBluringPostType_Vectors.Vector); -- ------------------------------ -- Body_apply_image_image_super_resolution__post -- ------------------------------ type BodyApplyImageImageSuperResolutionPostType is record Image : Swagger.Http_Content_Type; end record; package BodyApplyImageImageSuperResolutionPostType_Vectors is new Ada.Containers.Vectors (Index_Type => Positive, Element_Type => BodyApplyImageImageSuperResolutionPostType); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in BodyApplyImageImageSuperResolutionPostType); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in BodyApplyImageImageSuperResolutionPostType_Vectors.Vector); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out BodyApplyImageImageSuperResolutionPostType); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out BodyApplyImageImageSuperResolutionPostType_Vectors.Vector); -- ------------------------------ -- Body_apply_image_image_uncolorization__post -- ------------------------------ type BodyApplyImageImageUncolorizationPostType is record Image : Swagger.Http_Content_Type; end record; package BodyApplyImageImageUncolorizationPostType_Vectors is new Ada.Containers.Vectors (Index_Type => Positive, Element_Type => BodyApplyImageImageUncolorizationPostType); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in BodyApplyImageImageUncolorizationPostType); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in BodyApplyImageImageUncolorizationPostType_Vectors.Vector); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out BodyApplyImageImageUncolorizationPostType); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out BodyApplyImageImageUncolorizationPostType_Vectors.Vector); -- ------------------------------ -- Body_apply_image_text_asciify__post -- ------------------------------ type BodyApplyImageTextAsciifyPostType is record Image : Swagger.Http_Content_Type; end record; package BodyApplyImageTextAsciifyPostType_Vectors is new Ada.Containers.Vectors (Index_Type => Positive, Element_Type => BodyApplyImageTextAsciifyPostType); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in BodyApplyImageTextAsciifyPostType); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in BodyApplyImageTextAsciifyPostType_Vectors.Vector); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out BodyApplyImageTextAsciifyPostType); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out BodyApplyImageTextAsciifyPostType_Vectors.Vector); -- ------------------------------ -- Body_apply_image_text_ocr__post -- ------------------------------ type BodyApplyImageTextOcrPostType is record Image : Swagger.Http_Content_Type; end record; package BodyApplyImageTextOcrPostType_Vectors is new Ada.Containers.Vectors (Index_Type => Positive, Element_Type => BodyApplyImageTextOcrPostType); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in BodyApplyImageTextOcrPostType); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in BodyApplyImageTextOcrPostType_Vectors.Vector); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out BodyApplyImageTextOcrPostType); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out BodyApplyImageTextOcrPostType_Vectors.Vector); end .Models;
with Ada.Text_Io; use Ada.Text_Io; procedure main is type vector is array (Integer range <>) of Integer; type vector_ptr is access vector; task type sort_split is entry PutArrayRange(vec_ptr: in vector_ptr; l, r : in Integer); entry GetResult(ok_ret : out boolean); end sort_split; type sort_split_ptr is access sort_split; task type sort is entry PutArray(value : in vector_ptr; l, r : in Integer); entry GetResult(ok_ret : out boolean); end sort; type sort_ptr is access sort; procedure merge(arr_ptr:in out vector_ptr; left1, right1, left2, right2 : in Integer) is i,j:Integer; tmp_arr : vector(left1..right2) := (others => -1); begin i:=0; j:=0; while left1 + i <= right1 and left2 + j <= right2 loop if arr_ptr(left1 + i) >= arr_ptr(left2 + j) then tmp_arr(left1 + i + j) := arr_ptr(left2 + j); j := j + 1; else tmp_arr(left1 + i + j) := arr_ptr(left1 + i); i := i + 1; end if; end loop; while left1 + i <= right1 loop tmp_arr(left1 + i + j) := arr_ptr(left1 + i); i:= i + 1; end loop; while left2 + j <= right2 loop tmp_arr(left1 + i + j) := arr_ptr(left2 + j); j := j + 1; end loop; for index in left1..right2 loop arr_ptr(index) := tmp_arr(index); end loop; end Merge; task body sort_split is arr : vector_ptr; left : Integer; right : Integer; sort_left : sort_ptr; sort_right : sort_ptr; tmp : Integer; ok : Boolean; begin -- Put(" sort_split "); accept PutArrayRange(vec_ptr: in vector_ptr; l, r : in Integer) do -- Put_Line("Splitting..."); arr := vec_ptr; left := l; right := r; tmp := left + right; tmp := tmp/2; -- tmp := Float'Floor(tmp2); -- Put("TMP:"); -- Put_Line(Integer'Image(tmp)); sort_left := new sort; sort_right := new sort; sort_left.PutArray(arr,left,tmp); sort_right.PutArray(arr,tmp+1,right); -- RECEIVE sort_left.GetResult(ok); sort_right.GetResult(ok); merge(arr, left,tmp,tmp+1,right); end PutArrayRange; accept GetResult(ok_ret: out boolean) do ok_ret := true; end GetResult; end sort_split; task body sort is arr : vector_ptr; left : Integer; right : Integer; kido : sort_split_ptr; -- tmp : Integer; ok:boolean; begin -- Put(" sort "); accept PutArray(value : in vector_ptr; l, r : in Integer) do arr := value; left := l; right := r; end PutArray; -- Put_Line("Going to sort..."); -- Put_Line(Integer'Image(arr'Length)); if (right - left) > 0 then -- Put_Line("Going to split"); kido := new sort_split; kido.PutArrayRange(arr, left, right); kido.GetResult(ok); end if; accept GetResult(ok_ret : out boolean) do ok_ret := true; end GetResult; end sort; arr : vector (1..15) := (1,5,2,6,7,1,6,7,3,3,4234,5,34,5,2); arr_ptr : vector_ptr; st : sort; ok : Boolean; begin Put_Line("BEFORE: "); arr_ptr := new vector(arr'range); for i in arr'range loop arr_ptr(i) := arr(i); end loop; for i in arr'range loop Put(Integer'Image(arr(i))); Put(","); end loop; Put_Line(""); -- Put_Line(Integer'Image(arr'First)); st.PutArray(arr_ptr,arr'First,arr'Last); st.GetResult(ok); Put_Line("AFTER: "); for i in arr_ptr'range loop Put(Integer'Image(arr_ptr(i))); Put(","); end loop; end main;
package Sort is SIZE : constant Integer := 40; SubType v_range is Integer Range -500..500; type m_array is array(1..SIZE) of v_range; procedure MergeSort(A : in out m_array); -- Internal functions procedure MergeSort(A : in out m_array; startIndex : Integer; endIndex : Integer); procedure ParallelMergeSort(A : in out m_array; startIndex : Integer; midIndex : Integer; endIndex : Integer); procedure Merge(A : in out m_array; startIndex, midIndex, endIndex : in Integer); end sort;
with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C; use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C; procedure aaa_021if is type stringptr is access all char_array; procedure PString(s : stringptr) is begin String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all)); end; procedure testA(a : in Boolean; b : in Boolean) is begin if a then if b then PString(new char_array'( To_C("A"))); else PString(new char_array'( To_C("B"))); end if; else if b then PString(new char_array'( To_C("C"))); else PString(new char_array'( To_C("D"))); end if; end if; end; procedure testB(a : in Boolean; b : in Boolean) is begin if a then PString(new char_array'( To_C("A"))); else if b then PString(new char_array'( To_C("B"))); else PString(new char_array'( To_C("C"))); end if; end if; end; procedure testC(a : in Boolean; b : in Boolean) is begin if a then if b then PString(new char_array'( To_C("A"))); else PString(new char_array'( To_C("B"))); end if; else PString(new char_array'( To_C("C"))); end if; end; procedure testD(a : in Boolean; b : in Boolean) is begin if a then if b then PString(new char_array'( To_C("A"))); else PString(new char_array'( To_C("B"))); end if; PString(new char_array'( To_C("C"))); else PString(new char_array'( To_C("D"))); end if; end; procedure testE(a : in Boolean; b : in Boolean) is begin if a then if b then PString(new char_array'( To_C("A"))); end if; else if b then PString(new char_array'( To_C("C"))); else PString(new char_array'( To_C("D"))); end if; PString(new char_array'( To_C("E"))); end if; end; procedure test(a : in Boolean; b : in Boolean) is begin testD(a, b); testE(a, b); PString(new char_array'( To_C("" & Character'Val(10)))); end; begin test(TRUE, TRUE); test(TRUE, FALSE); test(FALSE, TRUE); test(FALSE, FALSE); end;
with Ada.Text_IO; use Ada.Text_IO; package body Greetings is procedure Swear (Greeting : String; Speaker_Age : Person.Age := Person.Age'First) is begin if Speaker_Age >= Person.Adult_Age then Put_Line ((if Greeting = Hello then Swear_Hello elsif Greeting = Hi then Swear_Hi elsif Greeting = Good_Morning then Swear_Morning elsif Greeting = What_s_Up then Swear_Whats_Up else raise Unknown_Greeting)); else Put_Line (Hello); end if; end Swear; end Greetings;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- A D A . C H A R A C T E R S . H A N D L I N G -- -- -- -- S p e c -- -- -- -- Copyright (C) 1992-2005, Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. The copyright notice above, and the license provisions that follow -- -- apply solely to the contents of the part following the private keyword. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- -- Boston, MA 02110-1301, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ package Ada.Characters.Handling is pragma Preelaborate; pragma Pure_05; -- In accordance with Ada 2005 AI-362 ---------------------------------------- -- Character Classification Functions -- ---------------------------------------- function Is_Control (Item : Character) return Boolean; function Is_Graphic (Item : Character) return Boolean; function Is_Letter (Item : Character) return Boolean; function Is_Lower (Item : Character) return Boolean; function Is_Upper (Item : Character) return Boolean; function Is_Basic (Item : Character) return Boolean; function Is_Digit (Item : Character) return Boolean; function Is_Decimal_Digit (Item : Character) return Boolean renames Is_Digit; function Is_Hexadecimal_Digit (Item : Character) return Boolean; function Is_Alphanumeric (Item : Character) return Boolean; function Is_Special (Item : Character) return Boolean; --------------------------------------------------- -- Conversion Functions for Character and String -- --------------------------------------------------- function To_Lower (Item : Character) return Character; function To_Upper (Item : Character) return Character; function To_Basic (Item : Character) return Character; function To_Lower (Item : String) return String; function To_Upper (Item : String) return String; function To_Basic (Item : String) return String; ---------------------------------------------------------------------- -- Classifications of and Conversions Between Character and ISO 646 -- ---------------------------------------------------------------------- subtype ISO_646 is Character range Character'Val (0) .. Character'Val (127); function Is_ISO_646 (Item : Character) return Boolean; function Is_ISO_646 (Item : String) return Boolean; function To_ISO_646 (Item : Character; Substitute : ISO_646 := ' ') return ISO_646; function To_ISO_646 (Item : String; Substitute : ISO_646 := ' ') return String; ------------------------------------------------------ -- Classifications of Wide_Character and Characters -- ------------------------------------------------------ -- Ada 2005 AI 395: these functions are moved to Ada.Characters.Conversions -- and are considered obsolete in Ada.Characters.Handling. We deal with -- this by using the special Ada_05 form of pragma Obsolescent which is -- only active in Ada_05 mode. function Is_Character (Item : Wide_Character) return Boolean; pragma Obsolescent ("(Ada 2005) use Ada.Characters.Conversions.Is_Character", Ada_05); function Is_String (Item : Wide_String) return Boolean; pragma Obsolescent ("(Ada 2005) use Ada.Characters.Conversions.Is_String", Ada_05); ------------------------------------------------------ -- Conversions between Wide_Character and Character -- ------------------------------------------------------ -- Ada 2005 AI 395: these functions are moved to Ada.Characters.Conversions -- and are considered obsolete in Ada.Characters.Handling. We deal with -- this by using the special Ada_05 form of pragma Obsolescent which is -- only active in Ada_05 mode. function To_Character (Item : Wide_Character; Substitute : Character := ' ') return Character; pragma Obsolescent ("(Ada 2005) use Ada.Characters.Conversions.To_Character", Ada_05); function To_String (Item : Wide_String; Substitute : Character := ' ') return String; pragma Obsolescent ("(Ada 2005) use Ada.Characters.Conversions.To_String", Ada_05); function To_Wide_Character (Item : Character) return Wide_Character; pragma Obsolescent ("(Ada 2005) use Ada.Characters.Conversions.To_Wide_Character", Ada_05); function To_Wide_String (Item : String)return Wide_String; pragma Obsolescent ("(Ada 2005) use Ada.Characters.Conversions.To_Wide_String", Ada_05); private pragma Inline (Is_Control); pragma Inline (Is_Graphic); pragma Inline (Is_Letter); pragma Inline (Is_Lower); pragma Inline (Is_Upper); pragma Inline (Is_Basic); pragma Inline (Is_Digit); pragma Inline (Is_Hexadecimal_Digit); pragma Inline (Is_Alphanumeric); pragma Inline (Is_Special); pragma Inline (To_Lower); pragma Inline (To_Upper); pragma Inline (To_Basic); pragma Inline (Is_ISO_646); pragma Inline (Is_Character); pragma Inline (To_Character); pragma Inline (To_Wide_Character); end Ada.Characters.Handling;
pragma License (Unrestricted); -- implementation unit specialized for Darwin (or Linux, or Windows) package System.Long_Long_Elementary_Functions is pragma Pure; function logl (x : Long_Long_Float) return Long_Long_Float with Import, Convention => Intrinsic, External_Name => "__builtin_logl"; function Fast_Log (X : Long_Long_Float) return Long_Long_Float renames logl; function expl (x : Long_Long_Float) return Long_Long_Float with Import, Convention => Intrinsic, External_Name => "__builtin_expl"; function Fast_Exp (X : Long_Long_Float) return Long_Long_Float renames expl; function powl (x, y : Long_Long_Float) return Long_Long_Float with Import, Convention => Intrinsic, External_Name => "__builtin_powl"; function Fast_Pow (Left, Right : Long_Long_Float) return Long_Long_Float renames powl; function sinhl (x : Long_Long_Float) return Long_Long_Float with Import, Convention => Intrinsic, External_Name => "__builtin_sinhl"; function Fast_Sinh (X : Long_Long_Float) return Long_Long_Float renames sinhl; function coshl (x : Long_Long_Float) return Long_Long_Float with Import, Convention => Intrinsic, External_Name => "__builtin_coshl"; function Fast_Cosh (X : Long_Long_Float) return Long_Long_Float renames coshl; function tanhl (x : Long_Long_Float) return Long_Long_Float with Import, Convention => Intrinsic, External_Name => "__builtin_tanhl"; function Fast_Tanh (X : Long_Long_Float) return Long_Long_Float renames tanhl; function asinhl (x : Long_Long_Float) return Long_Long_Float with Import, Convention => Intrinsic, External_Name => "__builtin_asinhl"; function Fast_Arcsinh (X : Long_Long_Float) return Long_Long_Float renames asinhl; function acoshl (x : Long_Long_Float) return Long_Long_Float with Import, Convention => Intrinsic, External_Name => "__builtin_acoshl"; function Fast_Arccosh (X : Long_Long_Float) return Long_Long_Float renames acoshl; function atanhl (x : Long_Long_Float) return Long_Long_Float with Import, Convention => Intrinsic, External_Name => "__builtin_atanhl"; function Fast_Arctanh (X : Long_Long_Float) return Long_Long_Float renames atanhl; end System.Long_Long_Elementary_Functions;
-- AOC 2020, Day 1 with Ada.Containers.Vectors; package Day is type Expense is new Natural; function part1(filename : in String) return Expense; function part2(filename : in String) return Expense; private package Expense_Vector is new Ada.Containers.Vectors (Index_Type => Natural, Element_Type => Expense); function load_file(filename : in String) return Expense_Vector.Vector; function matching_product(expenses : in Expense_Vector.Vector) return Expense; function triple_matching_product(expenses : in Expense_Vector.Vector) return Expense; end Day;
with Ada.Text_Io; procedure CompileTimeCalculation is function Factorial (Int : in Integer) return Integer is begin if Int > 1 then return Int * Factorial(Int-1); else return 1; end if; end; Fact10 : Integer := Factorial(10); begin Ada.Text_Io.Put(Integer'Image(Fact10)); end CompileTimeCalculation;
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2012, Vadim Godunko <vgodunko@gmail.com> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with AMF.Internals.UML_Properties; with AMF.UML.Associations; with AMF.UML.Classes; with AMF.UML.Classifiers.Collections; with AMF.UML.Connectable_Element_Template_Parameters; with AMF.UML.Connector_Ends.Collections; with AMF.UML.Data_Types; with AMF.UML.Dependencies.Collections; with AMF.UML.Deployments.Collections; with AMF.UML.Extension_Ends; with AMF.UML.Interfaces; with AMF.UML.Multiplicity_Elements; with AMF.UML.Named_Elements; with AMF.UML.Namespaces; with AMF.UML.Packageable_Elements.Collections; with AMF.UML.Packages.Collections; with AMF.UML.Parameterable_Elements; with AMF.UML.Properties.Collections; with AMF.UML.Redefinable_Elements.Collections; with AMF.UML.Stereotypes; with AMF.UML.String_Expressions; with AMF.UML.Template_Parameters; with AMF.UML.Types.Collections; with AMF.UML.Value_Specifications; with AMF.Visitors; package AMF.Internals.UML_Extension_Ends is type UML_Extension_End_Proxy is limited new AMF.Internals.UML_Properties.UML_Property_Proxy and AMF.UML.Extension_Ends.UML_Extension_End with null record; overriding procedure Set_Lower (Self : not null access UML_Extension_End_Proxy; To : AMF.Optional_Integer); -- Setter of ExtensionEnd::lower. -- -- This redefinition changes the default multiplicity of association ends, -- since model elements are usually extended by 0 or 1 instance of the -- extension stereotype. overriding function Get_Type (Self : not null access constant UML_Extension_End_Proxy) return AMF.UML.Stereotypes.UML_Stereotype_Access; -- Getter of ExtensionEnd::type. -- -- References the type of the ExtensionEnd. Note that this association -- restricts the possible types of an ExtensionEnd to only be Stereotypes. overriding procedure Set_Type (Self : not null access UML_Extension_End_Proxy; To : AMF.UML.Stereotypes.UML_Stereotype_Access); -- Setter of ExtensionEnd::type. -- -- References the type of the ExtensionEnd. Note that this association -- restricts the possible types of an ExtensionEnd to only be Stereotypes. overriding function Get_Aggregation (Self : not null access constant UML_Extension_End_Proxy) return AMF.UML.UML_Aggregation_Kind; -- Getter of Property::aggregation. -- -- Specifies the kind of aggregation that applies to the Property. overriding procedure Set_Aggregation (Self : not null access UML_Extension_End_Proxy; To : AMF.UML.UML_Aggregation_Kind); -- Setter of Property::aggregation. -- -- Specifies the kind of aggregation that applies to the Property. overriding function Get_Association (Self : not null access constant UML_Extension_End_Proxy) return AMF.UML.Associations.UML_Association_Access; -- Getter of Property::association. -- -- References the association of which this property is a member, if any. overriding procedure Set_Association (Self : not null access UML_Extension_End_Proxy; To : AMF.UML.Associations.UML_Association_Access); -- Setter of Property::association. -- -- References the association of which this property is a member, if any. overriding function Get_Association_End (Self : not null access constant UML_Extension_End_Proxy) return AMF.UML.Properties.UML_Property_Access; -- Getter of Property::associationEnd. -- -- Designates the optional association end that owns a qualifier attribute. overriding procedure Set_Association_End (Self : not null access UML_Extension_End_Proxy; To : AMF.UML.Properties.UML_Property_Access); -- Setter of Property::associationEnd. -- -- Designates the optional association end that owns a qualifier attribute. overriding function Get_Class (Self : not null access constant UML_Extension_End_Proxy) return AMF.UML.Classes.UML_Class_Access; -- Getter of Property::class. -- -- References the Class that owns the Property. -- References the Class that owns the Property. overriding procedure Set_Class (Self : not null access UML_Extension_End_Proxy; To : AMF.UML.Classes.UML_Class_Access); -- Setter of Property::class. -- -- References the Class that owns the Property. -- References the Class that owns the Property. overriding function Get_Datatype (Self : not null access constant UML_Extension_End_Proxy) return AMF.UML.Data_Types.UML_Data_Type_Access; -- Getter of Property::datatype. -- -- The DataType that owns this Property. overriding procedure Set_Datatype (Self : not null access UML_Extension_End_Proxy; To : AMF.UML.Data_Types.UML_Data_Type_Access); -- Setter of Property::datatype. -- -- The DataType that owns this Property. overriding function Get_Default (Self : not null access constant UML_Extension_End_Proxy) return AMF.Optional_String; -- Getter of Property::default. -- -- A String that is evaluated to give a default value for the Property -- when an object of the owning Classifier is instantiated. -- Specifies a String that represents a value to be used when no argument -- is supplied for the Property. overriding procedure Set_Default (Self : not null access UML_Extension_End_Proxy; To : AMF.Optional_String); -- Setter of Property::default. -- -- A String that is evaluated to give a default value for the Property -- when an object of the owning Classifier is instantiated. -- Specifies a String that represents a value to be used when no argument -- is supplied for the Property. overriding function Get_Default_Value (Self : not null access constant UML_Extension_End_Proxy) return AMF.UML.Value_Specifications.UML_Value_Specification_Access; -- Getter of Property::defaultValue. -- -- A ValueSpecification that is evaluated to give a default value for the -- Property when an object of the owning Classifier is instantiated. overriding procedure Set_Default_Value (Self : not null access UML_Extension_End_Proxy; To : AMF.UML.Value_Specifications.UML_Value_Specification_Access); -- Setter of Property::defaultValue. -- -- A ValueSpecification that is evaluated to give a default value for the -- Property when an object of the owning Classifier is instantiated. overriding function Get_Interface (Self : not null access constant UML_Extension_End_Proxy) return AMF.UML.Interfaces.UML_Interface_Access; -- Getter of Property::interface. -- -- References the Interface that owns the Property overriding procedure Set_Interface (Self : not null access UML_Extension_End_Proxy; To : AMF.UML.Interfaces.UML_Interface_Access); -- Setter of Property::interface. -- -- References the Interface that owns the Property overriding function Get_Is_Derived (Self : not null access constant UML_Extension_End_Proxy) return Boolean; -- Getter of Property::isDerived. -- -- Specifies whether the Property is derived, i.e., whether its value or -- values can be computed from other information. -- If isDerived is true, the value of the attribute is derived from -- information elsewhere. overriding procedure Set_Is_Derived (Self : not null access UML_Extension_End_Proxy; To : Boolean); -- Setter of Property::isDerived. -- -- Specifies whether the Property is derived, i.e., whether its value or -- values can be computed from other information. -- If isDerived is true, the value of the attribute is derived from -- information elsewhere. overriding function Get_Is_Derived_Union (Self : not null access constant UML_Extension_End_Proxy) return Boolean; -- Getter of Property::isDerivedUnion. -- -- Specifies whether the property is derived as the union of all of the -- properties that are constrained to subset it. overriding procedure Set_Is_Derived_Union (Self : not null access UML_Extension_End_Proxy; To : Boolean); -- Setter of Property::isDerivedUnion. -- -- Specifies whether the property is derived as the union of all of the -- properties that are constrained to subset it. overriding function Get_Is_ID (Self : not null access constant UML_Extension_End_Proxy) return Boolean; -- Getter of Property::isID. -- -- True indicates this property can be used to uniquely identify an -- instance of the containing Class. overriding procedure Set_Is_ID (Self : not null access UML_Extension_End_Proxy; To : Boolean); -- Setter of Property::isID. -- -- True indicates this property can be used to uniquely identify an -- instance of the containing Class. overriding function Get_Is_Read_Only (Self : not null access constant UML_Extension_End_Proxy) return Boolean; -- Getter of Property::isReadOnly. -- -- If isReadOnly is true, the attribute may not be written to after -- initialization. -- If true, the attribute may only be read, and not written. overriding procedure Set_Is_Read_Only (Self : not null access UML_Extension_End_Proxy; To : Boolean); -- Setter of Property::isReadOnly. -- -- If isReadOnly is true, the attribute may not be written to after -- initialization. -- If true, the attribute may only be read, and not written. overriding function Get_Opposite (Self : not null access constant UML_Extension_End_Proxy) return AMF.UML.Properties.UML_Property_Access; -- Getter of Property::opposite. -- -- In the case where the property is one navigable end of a binary -- association with both ends navigable, this gives the other end. overriding procedure Set_Opposite (Self : not null access UML_Extension_End_Proxy; To : AMF.UML.Properties.UML_Property_Access); -- Setter of Property::opposite. -- -- In the case where the property is one navigable end of a binary -- association with both ends navigable, this gives the other end. overriding function Get_Owning_Association (Self : not null access constant UML_Extension_End_Proxy) return AMF.UML.Associations.UML_Association_Access; -- Getter of Property::owningAssociation. -- -- References the owning association of this property, if any. overriding procedure Set_Owning_Association (Self : not null access UML_Extension_End_Proxy; To : AMF.UML.Associations.UML_Association_Access); -- Setter of Property::owningAssociation. -- -- References the owning association of this property, if any. overriding function Get_Qualifier (Self : not null access constant UML_Extension_End_Proxy) return AMF.UML.Properties.Collections.Ordered_Set_Of_UML_Property; -- Getter of Property::qualifier. -- -- An optional list of ordered qualifier attributes for the end. If the -- list is empty, then the Association is not qualified. overriding function Get_Redefined_Property (Self : not null access constant UML_Extension_End_Proxy) return AMF.UML.Properties.Collections.Set_Of_UML_Property; -- Getter of Property::redefinedProperty. -- -- References the properties that are redefined by this property. overriding function Get_Subsetted_Property (Self : not null access constant UML_Extension_End_Proxy) return AMF.UML.Properties.Collections.Set_Of_UML_Property; -- Getter of Property::subsettedProperty. -- -- References the properties of which this property is constrained to be a -- subset. overriding function Get_End (Self : not null access constant UML_Extension_End_Proxy) return AMF.UML.Connector_Ends.Collections.Ordered_Set_Of_UML_Connector_End; -- Getter of ConnectableElement::end. -- -- Denotes a set of connector ends that attaches to this connectable -- element. overriding function Get_Template_Parameter (Self : not null access constant UML_Extension_End_Proxy) return AMF.UML.Connectable_Element_Template_Parameters.UML_Connectable_Element_Template_Parameter_Access; -- Getter of ConnectableElement::templateParameter. -- -- The ConnectableElementTemplateParameter for this ConnectableElement -- parameter. overriding procedure Set_Template_Parameter (Self : not null access UML_Extension_End_Proxy; To : AMF.UML.Connectable_Element_Template_Parameters.UML_Connectable_Element_Template_Parameter_Access); -- Setter of ConnectableElement::templateParameter. -- -- The ConnectableElementTemplateParameter for this ConnectableElement -- parameter. overriding function Get_Type (Self : not null access constant UML_Extension_End_Proxy) return AMF.UML.Types.UML_Type_Access; -- Getter of TypedElement::type. -- -- The type of the TypedElement. -- This information is derived from the return result for this Operation. overriding procedure Set_Type (Self : not null access UML_Extension_End_Proxy; To : AMF.UML.Types.UML_Type_Access); -- Setter of TypedElement::type. -- -- The type of the TypedElement. -- This information is derived from the return result for this Operation. overriding function Get_Client_Dependency (Self : not null access constant UML_Extension_End_Proxy) return AMF.UML.Dependencies.Collections.Set_Of_UML_Dependency; -- Getter of NamedElement::clientDependency. -- -- Indicates the dependencies that reference the client. overriding function Get_Name_Expression (Self : not null access constant UML_Extension_End_Proxy) return AMF.UML.String_Expressions.UML_String_Expression_Access; -- Getter of NamedElement::nameExpression. -- -- The string expression used to define the name of this named element. overriding procedure Set_Name_Expression (Self : not null access UML_Extension_End_Proxy; To : AMF.UML.String_Expressions.UML_String_Expression_Access); -- Setter of NamedElement::nameExpression. -- -- The string expression used to define the name of this named element. overriding function Get_Namespace (Self : not null access constant UML_Extension_End_Proxy) return AMF.UML.Namespaces.UML_Namespace_Access; -- Getter of NamedElement::namespace. -- -- Specifies the namespace that owns the NamedElement. overriding function Get_Qualified_Name (Self : not null access constant UML_Extension_End_Proxy) return AMF.Optional_String; -- Getter of NamedElement::qualifiedName. -- -- A name which allows the NamedElement to be identified within a -- hierarchy of nested Namespaces. It is constructed from the names of the -- containing namespaces starting at the root of the hierarchy and ending -- with the name of the NamedElement itself. overriding function Get_Owning_Template_Parameter (Self : not null access constant UML_Extension_End_Proxy) return AMF.UML.Template_Parameters.UML_Template_Parameter_Access; -- Getter of ParameterableElement::owningTemplateParameter. -- -- The formal template parameter that owns this element. overriding procedure Set_Owning_Template_Parameter (Self : not null access UML_Extension_End_Proxy; To : AMF.UML.Template_Parameters.UML_Template_Parameter_Access); -- Setter of ParameterableElement::owningTemplateParameter. -- -- The formal template parameter that owns this element. overriding function Get_Template_Parameter (Self : not null access constant UML_Extension_End_Proxy) return AMF.UML.Template_Parameters.UML_Template_Parameter_Access; -- Getter of ParameterableElement::templateParameter. -- -- The template parameter that exposes this element as a formal parameter. overriding procedure Set_Template_Parameter (Self : not null access UML_Extension_End_Proxy; To : AMF.UML.Template_Parameters.UML_Template_Parameter_Access); -- Setter of ParameterableElement::templateParameter. -- -- The template parameter that exposes this element as a formal parameter. overriding function Get_Deployed_Element (Self : not null access constant UML_Extension_End_Proxy) return AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element; -- Getter of DeploymentTarget::deployedElement. -- -- The set of elements that are manifested in an Artifact that is involved -- in Deployment to a DeploymentTarget. overriding function Get_Deployment (Self : not null access constant UML_Extension_End_Proxy) return AMF.UML.Deployments.Collections.Set_Of_UML_Deployment; -- Getter of DeploymentTarget::deployment. -- -- The set of Deployments for a DeploymentTarget. overriding function Get_Featuring_Classifier (Self : not null access constant UML_Extension_End_Proxy) return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier; -- Getter of Feature::featuringClassifier. -- -- The Classifiers that have this Feature as a feature. overriding function Get_Is_Static (Self : not null access constant UML_Extension_End_Proxy) return Boolean; -- Getter of Feature::isStatic. -- -- Specifies whether this feature characterizes individual instances -- classified by the classifier (false) or the classifier itself (true). overriding procedure Set_Is_Static (Self : not null access UML_Extension_End_Proxy; To : Boolean); -- Setter of Feature::isStatic. -- -- Specifies whether this feature characterizes individual instances -- classified by the classifier (false) or the classifier itself (true). overriding function Get_Is_Leaf (Self : not null access constant UML_Extension_End_Proxy) return Boolean; -- Getter of RedefinableElement::isLeaf. -- -- Indicates whether it is possible to further redefine a -- RedefinableElement. If the value is true, then it is not possible to -- further redefine the RedefinableElement. Note that this property is -- preserved through package merge operations; that is, the capability to -- redefine a RedefinableElement (i.e., isLeaf=false) must be preserved in -- the resulting RedefinableElement of a package merge operation where a -- RedefinableElement with isLeaf=false is merged with a matching -- RedefinableElement with isLeaf=true: the resulting RedefinableElement -- will have isLeaf=false. Default value is false. overriding procedure Set_Is_Leaf (Self : not null access UML_Extension_End_Proxy; To : Boolean); -- Setter of RedefinableElement::isLeaf. -- -- Indicates whether it is possible to further redefine a -- RedefinableElement. If the value is true, then it is not possible to -- further redefine the RedefinableElement. Note that this property is -- preserved through package merge operations; that is, the capability to -- redefine a RedefinableElement (i.e., isLeaf=false) must be preserved in -- the resulting RedefinableElement of a package merge operation where a -- RedefinableElement with isLeaf=false is merged with a matching -- RedefinableElement with isLeaf=true: the resulting RedefinableElement -- will have isLeaf=false. Default value is false. overriding function Get_Redefined_Element (Self : not null access constant UML_Extension_End_Proxy) return AMF.UML.Redefinable_Elements.Collections.Set_Of_UML_Redefinable_Element; -- Getter of RedefinableElement::redefinedElement. -- -- The redefinable element that is being redefined by this element. overriding function Get_Redefinition_Context (Self : not null access constant UML_Extension_End_Proxy) return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier; -- Getter of RedefinableElement::redefinitionContext. -- -- References the contexts that this element may be redefined from. overriding function Lower_Bound (Self : not null access constant UML_Extension_End_Proxy) return AMF.Optional_Integer; -- Operation ExtensionEnd::lowerBound. -- -- The query lowerBound() returns the lower bound of the multiplicity as -- an Integer. This is a redefinition of the default lower bound, which -- normally, for MultiplicityElements, evaluates to 1 if empty. overriding function Default (Self : not null access constant UML_Extension_End_Proxy) return AMF.Optional_String; -- Operation Property::default. -- -- Missing derivation for Property::/default : String overriding function Is_Attribute (Self : not null access constant UML_Extension_End_Proxy; P : AMF.UML.Properties.UML_Property_Access) return Boolean; -- Operation Property::isAttribute. -- -- The query isAttribute() is true if the Property is defined as an -- attribute of some classifier. overriding function Is_Compatible_With (Self : not null access constant UML_Extension_End_Proxy; P : AMF.UML.Parameterable_Elements.UML_Parameterable_Element_Access) return Boolean; -- Operation Property::isCompatibleWith. -- -- The query isCompatibleWith() determines if this parameterable element -- is compatible with the specified parameterable element. By default -- parameterable element P is compatible with parameterable element Q if -- the kind of P is the same or a subtype as the kind of Q. In addition, -- for properties, the type must be conformant with the type of the -- specified parameterable element. overriding function Is_Composite (Self : not null access constant UML_Extension_End_Proxy) return Boolean; -- Operation Property::isComposite. -- -- The value of isComposite is true only if aggregation is composite. overriding function Is_Consistent_With (Self : not null access constant UML_Extension_End_Proxy; Redefinee : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access) return Boolean; -- Operation Property::isConsistentWith. -- -- The query isConsistentWith() specifies, for any two Properties in a -- context in which redefinition is possible, whether redefinition would -- be logically consistent. A redefining property is consistent with a -- redefined property if the type of the redefining property conforms to -- the type of the redefined property, the multiplicity of the redefining -- property (if specified) is contained in the multiplicity of the -- redefined property. -- The query isConsistentWith() specifies, for any two Properties in a -- context in which redefinition is possible, whether redefinition would -- be logically consistent. A redefining property is consistent with a -- redefined property if the type of the redefining property conforms to -- the type of the redefined property, and the multiplicity of the -- redefining property (if specified) is contained in the multiplicity of -- the redefined property. overriding function Is_Navigable (Self : not null access constant UML_Extension_End_Proxy) return Boolean; -- Operation Property::isNavigable. -- -- The query isNavigable() indicates whether it is possible to navigate -- across the property. overriding function Opposite (Self : not null access constant UML_Extension_End_Proxy) return AMF.UML.Properties.UML_Property_Access; -- Operation Property::opposite. -- -- If this property is owned by a class, associated with a binary -- association, and the other end of the association is also owned by a -- class, then opposite gives the other end. overriding function Subsetting_Context (Self : not null access constant UML_Extension_End_Proxy) return AMF.UML.Types.Collections.Set_Of_UML_Type; -- Operation Property::subsettingContext. -- -- The query subsettingContext() gives the context for subsetting a -- property. It consists, in the case of an attribute, of the -- corresponding classifier, and in the case of an association end, all of -- the classifiers at the other ends. overriding function Ends (Self : not null access constant UML_Extension_End_Proxy) return AMF.UML.Connector_Ends.Collections.Set_Of_UML_Connector_End; -- Operation ConnectableElement::end. -- -- Missing derivation for ConnectableElement::/end : ConnectorEnd overriding function All_Owning_Packages (Self : not null access constant UML_Extension_End_Proxy) return AMF.UML.Packages.Collections.Set_Of_UML_Package; -- Operation NamedElement::allOwningPackages. -- -- The query allOwningPackages() returns all the directly or indirectly -- owning packages. overriding function Is_Distinguishable_From (Self : not null access constant UML_Extension_End_Proxy; N : AMF.UML.Named_Elements.UML_Named_Element_Access; Ns : AMF.UML.Namespaces.UML_Namespace_Access) return Boolean; -- Operation NamedElement::isDistinguishableFrom. -- -- The query isDistinguishableFrom() determines whether two NamedElements -- may logically co-exist within a Namespace. By default, two named -- elements are distinguishable if (a) they have unrelated types or (b) -- they have related types but different names. overriding function Namespace (Self : not null access constant UML_Extension_End_Proxy) return AMF.UML.Namespaces.UML_Namespace_Access; -- Operation NamedElement::namespace. -- -- Missing derivation for NamedElement::/namespace : Namespace overriding function Is_Template_Parameter (Self : not null access constant UML_Extension_End_Proxy) return Boolean; -- Operation ParameterableElement::isTemplateParameter. -- -- The query isTemplateParameter() determines if this parameterable -- element is exposed as a formal template parameter. overriding function Deployed_Element (Self : not null access constant UML_Extension_End_Proxy) return AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element; -- Operation DeploymentTarget::deployedElement. -- -- Missing derivation for DeploymentTarget::/deployedElement : -- PackageableElement overriding function Compatible_With (Self : not null access constant UML_Extension_End_Proxy; Other : AMF.UML.Multiplicity_Elements.UML_Multiplicity_Element_Access) return Boolean; -- Operation MultiplicityElement::compatibleWith. -- -- The operation compatibleWith takes another multiplicity as input. It -- checks if one multiplicity is compatible with another. overriding function Includes_Cardinality (Self : not null access constant UML_Extension_End_Proxy; C : Integer) return Boolean; -- Operation MultiplicityElement::includesCardinality. -- -- The query includesCardinality() checks whether the specified -- cardinality is valid for this multiplicity. overriding function Includes_Multiplicity (Self : not null access constant UML_Extension_End_Proxy; M : AMF.UML.Multiplicity_Elements.UML_Multiplicity_Element_Access) return Boolean; -- Operation MultiplicityElement::includesMultiplicity. -- -- The query includesMultiplicity() checks whether this multiplicity -- includes all the cardinalities allowed by the specified multiplicity. overriding function Iss (Self : not null access constant UML_Extension_End_Proxy; Lowerbound : Integer; Upperbound : Integer) return Boolean; -- Operation MultiplicityElement::is. -- -- The operation is determines if the upper and lower bound of the ranges -- are the ones given. overriding function Is_Redefinition_Context_Valid (Self : not null access constant UML_Extension_End_Proxy; Redefined : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access) return Boolean; -- Operation RedefinableElement::isRedefinitionContextValid. -- -- The query isRedefinitionContextValid() specifies whether the -- redefinition contexts of this RedefinableElement are properly related -- to the redefinition contexts of the specified RedefinableElement to -- allow this element to redefine the other. By default at least one of -- the redefinition contexts of this element must be a specialization of -- at least one of the redefinition contexts of the specified element. overriding procedure Enter_Element (Self : not null access constant UML_Extension_End_Proxy; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Control : in out AMF.Visitors.Traverse_Control); -- Dispatch call to corresponding subprogram of visitor interface. overriding procedure Leave_Element (Self : not null access constant UML_Extension_End_Proxy; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Control : in out AMF.Visitors.Traverse_Control); -- Dispatch call to corresponding subprogram of visitor interface. overriding procedure Visit_Element (Self : not null access constant UML_Extension_End_Proxy; Iterator : in out AMF.Visitors.Abstract_Iterator'Class; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Control : in out AMF.Visitors.Traverse_Control); -- Dispatch call to corresponding subprogram of iterator interface. end AMF.Internals.UML_Extension_Ends;
with openGL.Geometry.lit_colored, openGL.Primitive.indexed; package body openGL.Model.polygon.lit_colored is function new_Polygon (Vertices : in Vector_2_array; Color : in lucid_Color) return View is Self : constant View := new Item; begin Self.Color := Color; Self.Vertices (Vertices'Range) := Vertices; Self.vertex_Count := Vertices'Length; Self.define (Scale => (1.0, 1.0, 1.0)); return Self; end new_Polygon; type Geometry_view is access all Geometry.lit_colored.item'Class; -- NB: - An extra vertex is required at the end of each latitude ring. -- - This last vertex has the same site as the rings initial vertex. -- - The last vertex has 's' texture coord of 1.0, whereas -- the initial vertex has 's' texture coord of 0.0. -- overriding function to_GL_Geometries (Self : access Item; Textures : access Texture.name_Map_of_texture'Class; Fonts : in Font.font_id_Map_of_font) return Geometry.views is pragma unreferenced (Textures, Fonts); use Geometry, Geometry.lit_colored; vertex_Count : constant Index_t := Index_t (Self.vertex_Count); indices_Count : constant long_Index_t := long_Index_t (Self.vertex_Count); the_Vertices : aliased Geometry.lit_colored.Vertex_array := (1 .. vertex_Count => <>); the_Indices : aliased Indices := (1 .. indices_Count => <>); the_Geometry : constant Geometry_view := Geometry.lit_colored.new_Geometry; begin set_Vertices: begin for i in 1 .. vertex_Count loop the_Vertices (i).Site := Vector_3 (Self.Vertices (Integer (i)) & 0.0); the_Vertices (i).Normal := (0.0, 0.0, 1.0); the_Vertices (i).Color := Self.Color; end loop; end set_Vertices; --- Set Indices. -- for i in the_Indices'Range loop the_Indices (i) := Index_t (i); end loop; the_Geometry.is_Transparent (False); the_Geometry.Vertices_are (the_Vertices); declare the_Primitive : constant Primitive.indexed.view := Primitive.indexed.new_Primitive (Primitive.triangle_Fan, the_Indices); begin the_Geometry.add (Primitive.view (the_Primitive)); end; return (1 => Geometry.view (the_Geometry)); end to_GL_Geometries; end openGL.Model.polygon.lit_colored;
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- A D A . E X C E P T I O N S -- -- -- -- B o d y -- -- -- -- Copyright (C) 1992-2021, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- -- -- -- -- -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ package body Ada.Exceptions is procedure Last_Chance_Handler (Msg : System.Address; Line : Integer); pragma Import (C, Last_Chance_Handler, "__gnat_last_chance_handler"); pragma No_Return (Last_Chance_Handler); Empty_C_String : aliased constant String := (1 => ASCII.NUL); procedure Call_Last_Chance_Handler_With_Message (Message : String); pragma No_Return (Call_Last_Chance_Handler_With_Message); -- Convert an exception message string to a NUL terminated C string and -- call the last chance handler. procedure Call_Last_Chance_Handler_With_Message (Message : String) is C_Message : String (1 .. 80); -- A fixed length string is used to aid gnatstack analysis of the -- procedure. begin if Message'Length >= C_Message'Length then -- Truncate the message C_Message (1 .. 79) := Message (Message'First .. Message'First + 78); C_Message (80) := ASCII.NUL; else C_Message (1 .. Message'Length) := Message; C_Message (Message'Length + 1) := ASCII.NUL; end if; Last_Chance_Handler (C_Message'Address, 0); end Call_Last_Chance_Handler_With_Message; --------------------- -- Raise_Exception -- --------------------- procedure Raise_Exception (E : Exception_Id; Message : String := "") is pragma Unreferenced (E); -- Exception ID E is unused as raised exception go directly to the -- last chance handler on the ZFP runtime. Note it is essential -- for E to be unreferenced here to ensure the compiler removes -- references to Standard defined exceptions when it inlines this -- procedure, as these exceptions are located in the Standard library -- which is not part of ZFP runtime library. begin -- The last chance handler requires a NUL terminated C string as the Msg -- parameter. if Message'Length = 0 then -- Pass a NUL character to the last chance handler in the case of no -- message. Last_Chance_Handler (Empty_C_String'Address, 0); else -- While the compiler is efficient and passes NUL terminated literals -- to this procedure, users who directly call are not likely to be -- as thoughtful due to the String interface. Consequently we may -- need to append NUL to the Message. Since this procedure is inlined -- and NUL appending requires the stack, a seperate procedure is used -- to ensure the caller's stack is not unduly bloated. Call_Last_Chance_Handler_With_Message (Message); end if; end Raise_Exception; end Ada.Exceptions;
with SDL; with SDL.Clipboard; with SDL.Log; with SDL.Video.Windows; with SDL.Video.Windows.Makers; procedure Clipboard is W : SDL.Video.Windows.Window; begin SDL.Log.Set (Category => SDL.Log.Application, Priority => SDL.Log.Debug); if SDL.Initialise = True then SDL.Video.Windows.Makers.Create (Win => W, Title => "Test SDLAda 2.0 - हिन्दी समाचार", Position => SDL.Natural_Coordinates'(X => 100, Y => 100), Size => SDL.Positive_Sizes'(800, 640)); delay 2.0; if SDL.Clipboard.Is_Empty = True then SDL.Log.Put_Debug ("Clipboard is empty"); end if; SDL.Clipboard.Set ("Hello"); SDL.Log.Put_Debug ("Text on clipboard: " & SDL.Clipboard.Get); end if; SDL.Finalise; end Clipboard;
let num = 0; if num < 100 { reassign num = num + 1; print_expr_ln num; jump 10; jump 3; } jump 23; if num%15 == 0 { print_str_ln FIZZBUZZ; jump 3; } if num%3 == 0 { print_str_ln FIZZ; jump 3; } if num%5 == 0 { print_str_ln BUZZ; jump 3; } jump 3; print_str_ln DONE;
-- -- Copyright (C) 2017, AdaCore -- -- This spec has been automatically generated from M2Sxxx.svd pragma Ada_2012; pragma Style_Checks (Off); with System; -- Microcontroller Subsystem (MSS) -- - Hard 166 MHz 32-Bit ARM Cortex-M3 Processor (r2p1) -- Embedded Trace Macrocell (ETM) -- Memory Protection Unit (MPU) -- JTAG Debug (4 wires), SW Debug (SWD, 2wires), SW Viewer (SWV) -- - 64 KB Embedded SRAM (eSRAM) -- - Up to 512 KB Embedded Nonvolatile Memory (eNVM) -- - Triple Speed Ethernet (TSE) 10/100/1000 Mbps MAC -- - USB 2.0 High Speed On-The-Go (OTG) Controller with ULPI Interface -- - CAN Controller, 2.0B Compliant, Conforms to ISO11898-1 -- - 2 Each: SPI, I2C, Multi-Mode UARTs (MMUART) Peripherals -- - Hardware Based Watchdog Timer -- - 1 General Purpose 64-Bit (or two 32-bit) Timer(s) -- - Real-Time Calendar/Counter (RTC) -- - DDR Bridge (4 Port Data R/W Buffering Bridge to DDR Memory) with 64-Bit -- AXI IF -- - 2 AHB/APB Interfaces to FPGA Fabric (master/slave capable) -- - 2 DMA Controllers to Offload Data Transactions from the Cortex-M3 -- Processor -- - 8-Channel Peripheral DMA (PDMA) -- - High Performance DMA (HPDMA) -- -- Clocking Resources -- - Clock Sources -- Up to 2 High Precision 32 KHz to 20 MHz Main Crystal Oscillator -- 1 MHz Embedded RC Oscillator -- 50 MHz Embedded RC Oscillator -- - Up to 8 Clock Conditioning Circuits (CCCs) -- Output Clock with 8 Output Phases -- Frequency: Input 1 to 200 MHz, Output 20 to 400MHz -- -- High Speed Serial Interfaces -- - Up to 16 SERDES Lanes, Each Supporting: -- XGXS/XAUI Extension (to implement a 10 Gbps (XGMII) Ethernet PHY -- interface) -- Native SERDES Interface Facilitates Implementation of Serial RapidIO -- PCI Express (PCIe) Endpoint Controller -- -- High Speed Memory Interfaces -- - Up to 2 High Speed DDRx Memory Controllers -- MSS DDR (MDDR) and Fabric DDR (FDDR) Controllers -- Supports LPDDR/DDR2/DDR3 -- Maximum 333 MHz Clock Rate -- SECDED Enable/Disable Feature -- Supports Various DRAM Bus Width Modes, x16, x18, x32, x36 -- - SDRAM Support package Interfaces.SF2 is pragma Preelaborate; pragma No_Elaboration_Code_All; --------------- -- Base type -- --------------- type UInt32 is new Interfaces.Unsigned_32; type UInt16 is new Interfaces.Unsigned_16; type Byte is new Interfaces.Unsigned_8; type Bit is mod 2**1 with Size => 1; type UInt2 is mod 2**2 with Size => 2; type UInt3 is mod 2**3 with Size => 3; type UInt4 is mod 2**4 with Size => 4; type UInt5 is mod 2**5 with Size => 5; type UInt6 is mod 2**6 with Size => 6; type UInt7 is mod 2**7 with Size => 7; type UInt9 is mod 2**9 with Size => 9; type UInt10 is mod 2**10 with Size => 10; type UInt11 is mod 2**11 with Size => 11; type UInt12 is mod 2**12 with Size => 12; type UInt13 is mod 2**13 with Size => 13; type UInt14 is mod 2**14 with Size => 14; type UInt15 is mod 2**15 with Size => 15; type UInt17 is mod 2**17 with Size => 17; type UInt18 is mod 2**18 with Size => 18; type UInt19 is mod 2**19 with Size => 19; type UInt20 is mod 2**20 with Size => 20; type UInt21 is mod 2**21 with Size => 21; type UInt22 is mod 2**22 with Size => 22; type UInt23 is mod 2**23 with Size => 23; type UInt24 is mod 2**24 with Size => 24; type UInt25 is mod 2**25 with Size => 25; type UInt26 is mod 2**26 with Size => 26; type UInt27 is mod 2**27 with Size => 27; type UInt28 is mod 2**28 with Size => 28; type UInt29 is mod 2**29 with Size => 29; type UInt30 is mod 2**30 with Size => 30; type UInt31 is mod 2**31 with Size => 31; -------------------- -- Base addresses -- -------------------- System_Registers_Base : constant System.Address := System'To_Address (16#40038000#); MDDR_Base : constant System.Address := System'To_Address (16#40020800#); SERDES_0_PCIE_Base : constant System.Address := System'To_Address (16#40028000#); SERDES_0_LANE_0_Base : constant System.Address := System'To_Address (16#40029000#); SERDES_0_LANE_1_Base : constant System.Address := System'To_Address (16#20029400#); SERDES_0_LANE_2_Base : constant System.Address := System'To_Address (16#40029800#); SERDES_0_LANE_3_Base : constant System.Address := System'To_Address (16#40029C00#); SERDES_0_SYS_REG_Base : constant System.Address := System'To_Address (16#4002A000#); SERDES_1_PCIE_Base : constant System.Address := System'To_Address (16#4002C000#); SERDES_1_LANE_0_Base : constant System.Address := System'To_Address (16#4002D000#); SERDES_1_LANE_1_Base : constant System.Address := System'To_Address (16#4002D400#); SERDES_1_LANE_2_Base : constant System.Address := System'To_Address (16#4002D800#); SERDES_1_LANE_3_Base : constant System.Address := System'To_Address (16#4002DC00#); SERDES_1_SYS_REG_Base : constant System.Address := System'To_Address (16#4002E000#); MMUART_0_Base : constant System.Address := System'To_Address (16#40000000#); MMUART_1_Base : constant System.Address := System'To_Address (16#40010000#); GPIO_Base : constant System.Address := System'To_Address (16#40013000#); Watchdog_Base : constant System.Address := System'To_Address (16#40005000#); SPI_0_Base : constant System.Address := System'To_Address (16#40001000#); SPI_1_Base : constant System.Address := System'To_Address (16#40011000#); I2C0_Base : constant System.Address := System'To_Address (16#40002000#); I2C1_Base : constant System.Address := System'To_Address (16#40012000#); HPDMA_Base : constant System.Address := System'To_Address (16#40014000#); PDMA_Base : constant System.Address := System'To_Address (16#40003000#); COMBLK_Base : constant System.Address := System'To_Address (16#40016000#); RTC_Base : constant System.Address := System'To_Address (16#40017000#); CAN_Base : constant System.Address := System'To_Address (16#40015000#); AHB_to_eNVM_0_Base : constant System.Address := System'To_Address (16#60080000#); AHB_to_eNVM_1_Base : constant System.Address := System'To_Address (16#600C0000#); Timer_Base : constant System.Address := System'To_Address (16#40004000#); FDDR_Base : constant System.Address := System'To_Address (16#40021000#); Ethernet_MAC_Base : constant System.Address := System'To_Address (16#40041000#); USB_Base : constant System.Address := System'To_Address (16#40043000#); end Interfaces.SF2;
----------------------------------------------------------------------- -- security-oauth-servers -- OAuth Server Authentication Support -- Copyright (C) 2016, 2017, 2018 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.Calendar.Conversions; with Interfaces.C; with Util.Log.Loggers; with Util.Encoders.Base64; with Util.Encoders.SHA256; with Util.Encoders.HMAC.SHA256; package body Security.OAuth.Servers is use type Ada.Calendar.Time; Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create ("Security.OAuth.Servers"); -- ------------------------------ -- Check if the application has the given permission. -- ------------------------------ function Has_Permission (App : in Application; Permission : in Permissions.Permission_Index) return Boolean is begin return Security.Permissions.Has_Permission (App.Permissions, Permission); end Has_Permission; protected body Token_Cache is procedure Authenticate (Token : in String; Grant : in out Grant_Type) is Pos : Cache_Map.Cursor := Entries.Find (Token); begin if Cache_Map.Has_Element (Pos) then if Grant.Expires < Ada.Calendar.Clock then Entries.Delete (Pos); Grant.Status := Expired_Grant; else Grant.Auth := Cache_Map.Element (Pos).Auth; Grant.Expires := Cache_Map.Element (Pos).Expire; Grant.Status := Valid_Grant; end if; end if; end Authenticate; procedure Insert (Token : in String; Expire : in Ada.Calendar.Time; Principal : in Principal_Access) is begin Entries.Insert (Token, Cache_Entry '(Expire, Principal)); end Insert; procedure Remove (Token : in String) is begin Entries.Delete (Token); end Remove; procedure Timeout is begin null; end Timeout; end Token_Cache; -- ------------------------------ -- Set the auth private key. -- ------------------------------ procedure Set_Private_Key (Manager : in out Auth_Manager; Key : in String; Decode : in Boolean := False) is begin if Decode then declare Decoder : constant Util.Encoders.Decoder := Util.Encoders.Create (Util.Encoders.BASE_64_URL); Content : constant String := Decoder.Decode (Key); begin Manager.Private_Key := To_Unbounded_String (Content); end; else Manager.Private_Key := To_Unbounded_String (Key); end if; end Set_Private_Key; -- ------------------------------ -- Set the application manager to use and and applications. -- ------------------------------ procedure Set_Application_Manager (Manager : in out Auth_Manager; Repository : in Application_Manager_Access) is begin Manager.Repository := Repository; end Set_Application_Manager; -- ------------------------------ -- Set the realm manager to authentify users. -- ------------------------------ procedure Set_Realm_Manager (Manager : in out Auth_Manager; Realm : in Realm_Manager_Access) is begin Manager.Realm := Realm; end Set_Realm_Manager; -- ------------------------------ -- Authorize the access to the protected resource by the application and for the -- given principal. The resource owner has been verified and is represented by the -- <tt>Auth</tt> principal. Extract from the request parameters represented by -- <tt>Params</tt> the application client id, the scope and the expected response type. -- Handle the "Authorization Code Grant" and "Implicit Grant" defined in RFC 6749. -- ------------------------------ procedure Authorize (Realm : in out Auth_Manager; Params : in Security.Auth.Parameters'Class; Auth : in Principal_Access; Grant : out Grant_Type) is Method : constant String := Params.Get_Parameter (Security.OAuth.RESPONSE_TYPE); Client_Id : constant String := Params.Get_Parameter (Security.OAuth.CLIENT_ID); begin if Client_Id'Length = 0 then Grant.Status := Invalid_Grant; Grant.Error := INVALID_REQUEST'Access; return; end if; declare App : constant Application'Class := Realm.Repository.Find_Application (Client_Id); begin if Method = "code" then Realm.Authorize_Code (App, Params, Auth, Grant); elsif Method = "token" then Realm.Authorize_Token (App, Params, Auth, Grant); else Grant.Status := Invalid_Grant; Grant.Error := UNSUPPORTED_RESPONSE_TYPE'Access; Log.Warn ("Authorize method '{0}' is not supported", Method); end if; end; exception when Invalid_Application => Log.Warn ("Invalid client_id {0}", Client_Id); Grant.Status := Invalid_Grant; Grant.Error := INVALID_CLIENT'Access; return; when E : others => Log.Error ("Error while doing authorization for client_id " & Client_Id, E); Grant.Status := Invalid_Grant; Grant.Error := SERVER_ERROR'Access; end Authorize; -- ------------------------------ -- The <tt>Token</tt> procedure is the main entry point to get the access token and -- refresh token. The request parameters are accessed through the <tt>Params</tt> interface. -- The operation looks at the "grant_type" parameter to identify the access method. -- It also looks at the "client_id" to find the application for which the access token -- is created. Upon successful authentication, the operation returns a grant. -- ------------------------------ procedure Token (Realm : in out Auth_Manager; Params : in Security.Auth.Parameters'Class; Grant : out Grant_Type) is Method : constant String := Params.Get_Parameter (Security.OAuth.GRANT_TYPE); Client_Id : constant String := Params.Get_Parameter (Security.OAuth.CLIENT_ID); begin if Length (Realm.Private_Key) < MIN_KEY_LENGTH then Log.Error ("The private key is too short to generate a secure token"); Grant.Status := Invalid_Grant; Grant.Error := SERVER_ERROR'Access; return; end if; if Client_Id'Length = 0 then Grant.Status := Invalid_Grant; Grant.Error := INVALID_REQUEST'Access; return; end if; declare App : constant Application'Class := Realm.Repository.Find_Application (Client_Id); begin if Method = "authorization_code" then Realm.Token_From_Code (App, Params, Grant); elsif Method = "password" then Realm.Token_From_Password (App, Params, Grant); elsif Method = "refresh_token" then Grant.Error := UNSUPPORTED_GRANT_TYPE'Access; elsif Method = "client_credentials" then Grant.Error := UNSUPPORTED_GRANT_TYPE'Access; else Grant.Error := UNSUPPORTED_GRANT_TYPE'Access; Log.Warn ("Grant type '{0}' is not supported", Method); end if; end; exception when Invalid_Application => Log.Warn ("Invalid client_id '{0}'", Client_Id); Grant.Status := Invalid_Grant; Grant.Error := INVALID_CLIENT'Access; return; end Token; -- ------------------------------ -- Format the expiration date to a compact string. The date is transformed to a Unix -- date and encoded in LEB128 + base64url. -- ------------------------------ function Format_Expire (Expire : in Ada.Calendar.Time) return String is T : constant Interfaces.C.long := Ada.Calendar.Conversions.To_Unix_Time (Expire); begin return Util.Encoders.Base64.Encode (Interfaces.Unsigned_64 (T)); end Format_Expire; -- ------------------------------ -- Decode the expiration date that was extracted from the token. -- ------------------------------ function Parse_Expire (Expire : in String) return Ada.Calendar.Time is V : constant Interfaces.Unsigned_64 := Util.Encoders.Base64.Decode (Expire); begin return Ada.Calendar.Conversions.To_Ada_Time (Interfaces.C.long (V)); end Parse_Expire; -- Implement the RFC 6749: 4.1.1. Authorization Request for the authorization code grant. procedure Authorize_Code (Realm : in out Auth_Manager; App : in Application'Class; Params : in Security.Auth.Parameters'Class; Auth : in Principal_Access; Grant : out Grant_Type) is Callback : constant String := Params.Get_Parameter (Security.OAuth.REDIRECT_URI); Scope : constant String := Params.Get_Parameter (Security.OAuth.SCOPE); begin Grant.Request := Code_Grant; Grant.Status := Invalid_Grant; if Auth = null then Log.Info ("Authorization is denied"); Grant.Error := ACCESS_DENIED'Access; elsif App.Callback /= Callback then Log.Info ("Invalid application callback"); Grant.Error := UNAUTHORIZED_CLIENT'Access; else -- Manager'Class (Realm).Authorize (Auth, Scope); Grant.Expires := Ada.Calendar.Clock + Realm.Expire_Code; Grant.Expires_In := Realm.Expire_Code; Grant.Status := Valid_Grant; Grant.Auth := Auth; Realm.Create_Token (Realm.Realm.Authorize (App, Scope, Auth), Grant); end if; end Authorize_Code; -- Implement the RFC 6749: 4.2.1. Authorization Request for the implicit grant. procedure Authorize_Token (Realm : in out Auth_Manager; App : in Application'Class; Params : in Security.Auth.Parameters'Class; Auth : in Principal_Access; Grant : out Grant_Type) is Callback : constant String := Params.Get_Parameter (Security.OAuth.REDIRECT_URI); Scope : constant String := Params.Get_Parameter (Security.OAuth.SCOPE); begin Grant.Request := Implicit_Grant; Grant.Status := Invalid_Grant; if Auth = null then Log.Info ("Authorization is denied"); Grant.Error := ACCESS_DENIED'Access; elsif App.Callback /= Callback then Log.Info ("Invalid application callback"); Grant.Error := UNAUTHORIZED_CLIENT'Access; else Grant.Expires := Ada.Calendar.Clock + App.Expire_Timeout; Grant.Expires_In := App.Expire_Timeout; Grant.Status := Valid_Grant; Grant.Auth := Auth; Realm.Create_Token (Realm.Realm.Authorize (App, Scope, Grant.Auth), Grant); end if; end Authorize_Token; -- Make the access token from the authorization code that was created by the -- <tt>Authorize</tt> operation. Verify the client application, the redirect uri, the -- client secret and the validity of the authorization code. Extract from the -- authorization code the auth principal that was used for the grant and make the -- access token. procedure Token_From_Code (Realm : in out Auth_Manager; App : in Application'Class; Params : in Security.Auth.Parameters'Class; Grant : out Grant_Type) is Code : constant String := Params.Get_Parameter (Security.OAuth.CODE); Callback : constant String := Params.Get_Parameter (Security.OAuth.REDIRECT_URI); Secret : constant String := Params.Get_Parameter (Security.OAuth.CLIENT_SECRET); Token : Token_Validity; begin Grant.Request := Code_Grant; Grant.Status := Invalid_Grant; if Code'Length = 0 then Log.Info ("Missing authorization code request parameter"); Grant.Error := INVALID_REQUEST'Access; elsif App.Secret /= Secret then Log.Info ("Invalid application secret"); Grant.Error := UNAUTHORIZED_CLIENT'Access; elsif App.Callback /= Callback then Log.Info ("Invalid application callback"); Grant.Error := UNAUTHORIZED_CLIENT'Access; else Token := Realm.Validate (To_String (App.Client_Id), Code); Grant.Status := Token.Status; if Token.Status /= Valid_Grant then Log.Info ("Invalid authorization code {0}", Code); Grant.Error := ACCESS_DENIED'Access; else -- Verify the identification token and get the principal. Realm.Realm.Verify (Code (Token.Ident_Start .. Token.Ident_End), Grant.Auth); if Grant.Auth = null then Log.Info ("Access denied for authorization code {0}", Code); Grant.Error := ACCESS_DENIED'Access; else -- Extract user/session ident from code. Grant.Expires := Ada.Calendar.Clock + App.Expire_Timeout; Grant.Expires_In := App.Expire_Timeout; Grant.Error := null; Realm.Create_Token (Realm.Realm.Authorize (App, SCOPE, Grant.Auth), Grant); end if; end if; end if; end Token_From_Code; -- ------------------------------ -- Make the access token from the resource owner password credentials. The username, -- password and scope are extracted from the request and they are verified through the -- <tt>Verify</tt> procedure to obtain an associated principal. When successful, the -- principal describes the authorization and it is used to forge the access token. -- This operation implements the RFC 6749: 4.3. Resource Owner Password Credentials Grant. -- ------------------------------ procedure Token_From_Password (Realm : in out Auth_Manager; App : in Application'Class; Params : in Security.Auth.Parameters'Class; Grant : out Grant_Type) is Username : constant String := Params.Get_Parameter (Security.OAuth.USERNAME); Password : constant String := Params.Get_Parameter (Security.OAuth.PASSWORD); Scope : constant String := Params.Get_Parameter (Security.OAuth.SCOPE); Secret : constant String := Params.Get_Parameter (Security.OAuth.CLIENT_SECRET); begin Grant.Request := Password_Grant; Grant.Status := Invalid_Grant; if Username'Length = 0 then Log.Info ("Missing username request parameter"); Grant.Error := INVALID_REQUEST'Access; elsif Password'Length = 0 then Log.Info ("Missing password request parameter"); Grant.Error := INVALID_REQUEST'Access; elsif App.Secret /= Secret then Log.Info ("Invalid application secret"); Grant.Error := UNAUTHORIZED_CLIENT'Access; else -- Verify the username and password to get the principal. Realm.Realm.Verify (Username, Password, Grant.Auth); if Grant.Auth = null then Log.Info ("Access denied for {0}", Username); Grant.Error := ACCESS_DENIED'Access; else Grant.Status := Valid_Grant; Grant.Expires := Ada.Calendar.Clock + App.Expire_Timeout; Grant.Expires_In := App.Expire_Timeout; Grant.Error := null; Realm.Create_Token (Realm.Realm.Authorize (App, Scope, Grant.Auth), Grant); end if; end if; end Token_From_Password; -- ------------------------------ -- Create a HMAC-SHA1 of the data with the private key. -- This function can be overriden to use another signature algorithm. -- ------------------------------ function Sign (Realm : in Auth_Manager; Data : in String) return String is Ctx : Util.Encoders.HMAC.SHA256.Context; Result : Util.Encoders.SHA256.Base64_Digest; begin Util.Encoders.HMAC.SHA256.Set_Key (Ctx, To_String (Realm.Private_Key)); Util.Encoders.HMAC.SHA256.Update (Ctx, Data); Util.Encoders.HMAC.SHA256.Finish_Base64 (Ctx, Result, True); return Result; end Sign; -- ------------------------------ -- Forge an access token. The access token is signed by an HMAC-SHA256 signature. -- The returned token is formed as follows: -- <expiration>.<ident>.HMAC-SHA256(<private-key>, <expiration>.<ident>) -- See also RFC 6749: 5. Issuing an Access Token -- ------------------------------ procedure Create_Token (Realm : in Auth_Manager; Ident : in String; Grant : in out Grant_Type) is Exp : constant String := Format_Expire (Grant.Expires); Data : constant String := Exp & "." & Ident; Hmac : constant String := Auth_Manager'Class (Realm).Sign (Data); begin Grant.Token := Ada.Strings.Unbounded.To_Unbounded_String (Data & "." & Hmac); end Create_Token; -- Validate the token by checking that it is well formed, it has not expired -- and the HMAC-SHA256 signature is valid. Return the set of information to allow -- the extraction of the auth identification from the token public part. function Validate (Realm : in Auth_Manager; Client_Id : in String; Token : in String) return Token_Validity is Pos1 : constant Natural := Util.Strings.Index (Token, '.'); Pos2 : constant Natural := Util.Strings.Rindex (Token, '.'); Result : Token_Validity := (Status => Invalid_Grant, others => <>); begin -- Verify the access token validity. if Pos1 = 0 or Pos2 = 0 or Pos1 = Pos2 then Log.Info ("Authenticate bad formed access token {0}", Token); return Result; end if; -- Build the HMAC signature with the private key. declare Hmac : constant String := Auth_Manager'Class (Realm).Sign (Token (Token'First .. Pos2 - 1)); begin -- Check the HMAC signature part. if Token (Pos2 + 1 .. Token'Last) /= Hmac then Log.Info ("Bad signature for access token {0}", Token); return Result; end if; -- Signature is valid we can check the token expiration date. Result.Expire := Parse_Expire (Token (Token'First .. Pos1 - 1)); if Result.Expire < Ada.Calendar.Clock then Log.Info ("Token {0} has expired", Token); Result.Status := Expired_Grant; return Result; end if; Result.Ident_Start := Pos1 + 1; Result.Ident_End := Pos2 - 1; -- When an identifier is passed, verify it. if Client_Id'Length > 0 then Result.Ident_Start := Util.Strings.Index (Token, '.', Pos1 + 1); if Result.Ident_Start = 0 or else Client_Id /= Token (Pos1 + 1 .. Result.Ident_Start - 1) then Log.Info ("Token {0} was stealed for another application", Token); Result.Status := Stealed_Grant; return Result; end if; end if; -- The access token is valid. Result.Status := Valid_Grant; return Result; end; exception when E : others => -- No exception should ever be raised because we verify the signature first. Log.Error ("Token " & Token & " raised an exception", E); Result.Status := Invalid_Grant; return Result; end Validate; -- ------------------------------ -- Authenticate the access token and get a security principal that identifies the app/user. -- See RFC 6749, 7. Accessing Protected Resources. -- The access token is first searched in the cache. If it was found, it means the access -- token was already verified in the past, it is granted and associated with a principal. -- Otherwise, we have to verify the token signature first, then the expiration date and -- we extract from the token public part the auth identification. The <tt>Authenticate</tt> -- operation is then called to obtain the principal from the auth identification. -- When access token is invalid or authentification cannot be verified, a null principal -- is returned. The <tt>Grant</tt> data will hold the result of the grant with the reason -- of failures (if any). -- ------------------------------ procedure Authenticate (Realm : in out Auth_Manager; Token : in String; Grant : out Grant_Type) is Cacheable : Boolean; Check : Token_Validity; begin Check := Realm.Validate ("", Token); Grant.Status := Check.Status; Grant.Request := Access_Grant; Grant.Expires := Check.Expire; Grant.Auth := null; if Check.Status = Expired_Grant then Log.Info ("Access token {0} has expired", Token); elsif Check.Status /= Valid_Grant then Log.Info ("Access token {0} is invalid", Token); else Realm.Cache.Authenticate (Token, Grant); if Grant.Auth /= null then Log.Debug ("Authenticate access token {0} succeeded from cache", Token); return; end if; -- The access token is valid, well formed and has not expired. -- Get the associated principal (the only possibility it could fail is -- that it was revoked). Realm.Realm.Authenticate (Token (Check.Ident_Start .. Check.Ident_End), Grant.Auth, Cacheable); if Grant.Auth = null then Log.Info ("Access token {0} was revoked", Token); Grant.Status := Revoked_Grant; -- We are allowed to keep the token in the cache, insert it. elsif Cacheable then Realm.Cache.Insert (Token, Check.Expire, Grant.Auth); Log.Debug ("Access token {0} is granted and inserted in the cache", Token); else Log.Debug ("Access token {0} is granted", Token); end if; end if; end Authenticate; procedure Revoke (Realm : in out Auth_Manager; Token : in String) is Check : Token_Validity; Auth : Principal_Access; Cacheable : Boolean; begin Check := Realm.Validate ("", Token); if Check.Status = Valid_Grant then -- The access token is valid, well formed and has not expired. -- Get the associated principal (the only possibility it could fail is -- that it was revoked). Realm.Realm.Authenticate (Token (Check.Ident_Start .. Check.Ident_End), Auth, Cacheable); if Auth /= null then Realm.Cache.Remove (Token); Realm.Realm.Revoke (Auth); end if; end if; end Revoke; end Security.OAuth.Servers;
-- -- Jan & Uwe R. Zimmer, Australia, 2013 -- with Ada.Task_Identification; use Ada.Task_Identification; with Barrier_Type; use Barrier_Type; with Real_Type; use Real_Type; with Swarm_Configuration; use Swarm_Configuration; with Swarm_Structures; use Swarm_Structures; with Swarm_Structures_Base; use Swarm_Structures_Base; with Vectors_3D; use Vectors_3D; package Swarm_Control is pragma Elaborate_Body; protected Swarm_Monitor is function Id_Task return Swarm_Element_Index; function Id_Task (Id : Task_Id) return Swarm_Element_Index; function Position (Id : Task_Id) return Protected_Point_3D.Monitor_Ptr; function Velocity (Id : Task_Id) return Protected_Vector_3D.Monitor_Ptr; function Acceleration (Id : Task_Id) return Protected_Vector_3D.Monitor_Ptr; function Controls (Id : Task_Id) return Vehicle_Controls_P; function Comms (Id : Task_Id) return Vehicle_Comms_P; function Charge (Id : Task_Id) return Charge_Info; function Process_abort return Barrier_Ptr; procedure Append_Random_Swarm (No_Of_Swarm_Elements : Positive := Initial_No_of_Elements; Centre : Positions := Initial_Swarm_Position; Volume_Edge_Length : Real := Initual_Edge_Length); procedure Remove_Vehicle (Element_Ix : Swarm_Element_Index); function Centre_Of_Gravity return Vector_3D; function Mean_Velocity return Vector_3D; function Mean_Velocity return Real; function Maximal_Radius return Real; function Mean_Radius return Real; function Mean_Closest_Distance return Real; private Last_Vehicle_Id : Natural := 0; end Swarm_Monitor; Vehicle_could_not_be_created, Task_did_not_repond_to_Identfiy_Call, No_Such_Task : exception; procedure Remove_Vehicles (No_Of_Swarm_Elements : Positive := 1); procedure Set_Acceleration (Element_Index : Swarm_Element_Index); procedure Set_All_Accelerations; procedure Forward_Messages (Element_Index : Swarm_Element_Index); procedure Forward_All_Messages; procedure Move_Element (Element_Index : Swarm_Element_Index); procedure Move_All_Elements; procedure Update_Rotation (Element_Index : Swarm_Element_Index); procedure Update_All_Rotations; procedure Remove_Empties; end Swarm_Control;
with RASCAL.Utility; use RASCAL.Utility; with RASCAL.WimpTask; use RASCAL.WimpTask; with RASCAL.ToolboxWindow; use RASCAL.ToolboxWindow; with RASCAL.Toolbox; use RASCAL.Toolbox; with RASCAL.FileInternal; use RASCAL.FileInternal; with RASCAL.TaskManager; with Main; use Main; with Ada.Exceptions; with Reporter; package body Controller_Quit is -- package Utility renames RASCAL.Utility; package WimpTask renames RASCAL.WimpTask; package ToolboxWindow renames RASCAL.ToolboxWindow; package Toolbox renames RASCAL.Toolbox; package FileInternal renames RASCAL.FileInternal; package TaskManager renames RASCAL.TaskManager; -- procedure Save_WindowPosition is Target : FileHandle_Type(new UString'(U("<Choices$Write>.Meaning.Misc")),Write); begin if ToolboxWindow.Is_Open(main_objectid) then ToolboxWindow.Get_WindowPosition (main_objectid,x_pos,y_pos); end if; FileInternal.Put_String (Target,"XPOS:" & intstr(x_pos)); FileInternal.Put_String (Target,"YPOS:" & intstr(y_pos)); exception when e: others => Report_Error("POSSAVE",Ada.Exceptions.Exception_Information (e)); end Save_WindowPosition; -- procedure Handle (The : in TEL_Quit_Quit) is begin Save_WindowPosition; Set_Status(Main_Task,false); exception when e: others => Report_Error("TQUIT",Ada.Exceptions.Exception_Information (e)); end Handle; -- procedure Handle (The : in MEL_Message_Quit) is begin Save_WindowPosition; Set_Status(Main_Task,false); exception when e: others => Report_Error("MQUIT",Ada.Exceptions.Exception_Information (e)); end Handle; -- end Controller_Quit;
with Tkmrpc.Request; with Tkmrpc.Response; package Tkmrpc.Dispatchers.Ees is procedure Dispatch (Req : Request.Data_Type; Res : out Response.Data_Type); -- Dispatch EES request to concrete operation handler. end Tkmrpc.Dispatchers.Ees;
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2017, Universidad Politécnica de Madrid -- -- -- -- 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. -- -- -- ------------------------------------------------------------------------------- -- Implementation of the user interface using GTK with Gdk.Threads; with Gtk.Main; with Gtk.Window; use Gtk.Window; with Gtk.Grid; use Gtk.Grid; with Gtk.Enums; use Gtk.Enums; with Gtk.Button; use Gtk.Button; with Gtk.Label; use Gtk.Label; with Gtk.Text_View; use Gtk.Text_View; with Gtk.Text_Buffer; use Gtk.Text_Buffer; with Gtk.Text_Iter; use Gtk.Text_Iter; with Gtk.Scrolled_Window; use Gtk.Scrolled_Window; with Gtk.Widget; use Gtk.Widget; with Pango.Font; use Pango.Font; with TTC_Data.Strings; package body User_Interface is ---------------------- -- Graphic objects -- ---------------------- Window : Gtk_Window; Grid : Gtk_Grid; Label : Gtk_Label; Button : Gtk_Button; Scrolled : Gtk_Scrolled_Window; Text_Buffer : Gtk_Text_Buffer; Text : Gtk_Text_View; Iterator : Gtk_Text_Iter; --------------- -- Callbacks -- --------------- -- quit GUI procedure main_quit (Self : access Gtk_Widget_Record'Class) is begin Gtk.Main.Main_Quit; end main_quit; -- send a TC message procedure button_clicked(Self : access Gtk_Button_Record'Class) is begin null; -- TC_Sender.Send; end button_clicked; ---------- -- Init -- ---------- procedure Init is begin -- use thread-aware gdk Gdk.Threads.G_Init; Gdk.Threads.Init; Gtk.Main.Init; -- create window Gtk_New(Window); Window.Set_Title("Toy Satellite Ground Station"); Window.Set_Border_Width (10); Window.Set_Resizable (False); Window.On_Destroy (main_quit'Access); -- grid for placing widgets Gtk_New (Grid); Window.Add(Grid); -- TM area Gtk_New(Label, "Telemetry"); Grid.Attach(Label, 0, 0, 3, 1); Gtk_New(Text_Buffer); Gtk_New(Text, Text_Buffer); Text.Set_Editable(False); Text.Modify_Font(From_String("Monospace 10")); -- Text.Modify_Font(From_String("Menlo 12")); Gtk_New(Scrolled); Scrolled.Set_Policy(Policy_Automatic, Policy_Automatic); Scrolled.Set_Size_Request(60,400); Scrolled.Add(Text); Grid.Attach(Scrolled, 0,1,3,12); -- TC area Gtk_New(Label, "Telecommands"); Grid.Attach(Label, 3, 0, 1, 1); Gtk_New(Button, "Request HK"); Button.On_Clicked(button_clicked'Access); Grid.Attach(Button, 3,1,1,1); -- show window Grid.Set_Column_Homogeneous(True); Grid.Set_Column_Spacing(10); Grid.Set_Row_Spacing(10); Window.Show_All; -- GTK main loop Gdk.Threads.Enter; Gtk.Main.Main; Gdk.Threads.Leave; end Init; --------- -- Put -- --------- procedure Put (S : String) is begin Gdk.Threads.Enter; Text_Buffer.Insert_At_Cursor(" " & S & ASCII.LF); Text.Scroll_Mark_Onscreen(Text_Buffer.Get_Insert); Text.Show; Gdk.Threads.Leave; end Put; --------- -- Put -- --------- procedure Put (M : TM_Message) is begin Put (TTC_Data.Strings.Image (M)); end Put; end User_Interface;
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- G N A T . A L T I V E C . C O N V E R S I O N S -- -- -- -- B o d y -- -- -- -- Copyright (C) 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, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with Ada.Unchecked_Conversion; with System; use System; with GNAT.Altivec.Low_Level_Interface; use GNAT.Altivec.Low_Level_Interface; with GNAT.Altivec.Low_Level_Vectors; use GNAT.Altivec.Low_Level_Vectors; package body GNAT.Altivec.Conversions is function To_Varray_unsigned_char is new Ada.Unchecked_Conversion (Varray_signed_char, Varray_unsigned_char); function To_Varray_unsigned_char is new Ada.Unchecked_Conversion (Varray_bool_char, Varray_unsigned_char); function To_Varray_unsigned_short is new Ada.Unchecked_Conversion (Varray_signed_short, Varray_unsigned_short); function To_Varray_unsigned_short is new Ada.Unchecked_Conversion (Varray_bool_short, Varray_unsigned_short); function To_Varray_unsigned_short is new Ada.Unchecked_Conversion (Varray_pixel, Varray_unsigned_short); function To_Varray_unsigned_int is new Ada.Unchecked_Conversion (Varray_signed_int, Varray_unsigned_int); function To_Varray_unsigned_int is new Ada.Unchecked_Conversion (Varray_bool_int, Varray_unsigned_int); function To_Varray_unsigned_int is new Ada.Unchecked_Conversion (Varray_float, Varray_unsigned_int); function To_Varray_signed_char is new Ada.Unchecked_Conversion (Varray_unsigned_char, Varray_signed_char); function To_Varray_bool_char is new Ada.Unchecked_Conversion (Varray_unsigned_char, Varray_bool_char); function To_Varray_signed_short is new Ada.Unchecked_Conversion (Varray_unsigned_short, Varray_signed_short); function To_Varray_bool_short is new Ada.Unchecked_Conversion (Varray_unsigned_short, Varray_bool_short); function To_Varray_pixel is new Ada.Unchecked_Conversion (Varray_unsigned_short, Varray_pixel); function To_Varray_signed_int is new Ada.Unchecked_Conversion (Varray_unsigned_int, Varray_signed_int); function To_Varray_bool_int is new Ada.Unchecked_Conversion (Varray_unsigned_int, Varray_bool_int); function To_Varray_float is new Ada.Unchecked_Conversion (Varray_unsigned_int, Varray_float); function To_VUC is new Ada.Unchecked_Conversion (VUC_View, VUC); function To_VSC is new Ada.Unchecked_Conversion (VSC_View, VSC); function To_VBC is new Ada.Unchecked_Conversion (VBC_View, VBC); function To_VUS is new Ada.Unchecked_Conversion (VUS_View, VUS); function To_VSS is new Ada.Unchecked_Conversion (VSS_View, VSS); function To_VBS is new Ada.Unchecked_Conversion (VBS_View, VBS); function To_VUI is new Ada.Unchecked_Conversion (VUI_View, VUI); function To_VSI is new Ada.Unchecked_Conversion (VSI_View, VSI); function To_VBI is new Ada.Unchecked_Conversion (VBI_View, VBI); function To_VF is new Ada.Unchecked_Conversion (VF_View, VF); function To_VP is new Ada.Unchecked_Conversion (VP_View, VP); function To_VUC_View is new Ada.Unchecked_Conversion (VUC, VUC_View); function To_VSC_View is new Ada.Unchecked_Conversion (VSC, VSC_View); function To_VBC_View is new Ada.Unchecked_Conversion (VBC, VBC_View); function To_VUS_View is new Ada.Unchecked_Conversion (VUS, VUS_View); function To_VSS_View is new Ada.Unchecked_Conversion (VSS, VSS_View); function To_VBS_View is new Ada.Unchecked_Conversion (VBS, VBS_View); function To_VUI_View is new Ada.Unchecked_Conversion (VUI, VUI_View); function To_VSI_View is new Ada.Unchecked_Conversion (VSI, VSI_View); function To_VBI_View is new Ada.Unchecked_Conversion (VBI, VBI_View); function To_VF_View is new Ada.Unchecked_Conversion (VF, VF_View); function To_VP_View is new Ada.Unchecked_Conversion (VP, VP_View); pragma Warnings (Off, Default_Bit_Order); --------------- -- To_Vector -- --------------- function To_Vector (S : VSC_View) return VSC is begin if Default_Bit_Order = High_Order_First then return To_VSC (S); else declare Result : LL_VUC; VS : constant VUC_View := (Values => To_Varray_unsigned_char (S.Values)); begin Result := To_Vector (VS); return To_LL_VSC (Result); end; end if; end To_Vector; function To_Vector (S : VBC_View) return VBC is begin if Default_Bit_Order = High_Order_First then return To_VBC (S); else declare Result : LL_VUC; VS : constant VUC_View := (Values => To_Varray_unsigned_char (S.Values)); begin Result := To_Vector (VS); return To_LL_VBC (Result); end; end if; end To_Vector; function To_Vector (S : VSS_View) return VSS is begin if Default_Bit_Order = High_Order_First then return To_VSS (S); else declare Result : LL_VUS; VS : constant VUS_View := (Values => To_Varray_unsigned_short (S.Values)); begin Result := To_Vector (VS); return VSS (To_LL_VSS (Result)); end; end if; end To_Vector; function To_Vector (S : VBS_View) return VBS is begin if Default_Bit_Order = High_Order_First then return To_VBS (S); else declare Result : LL_VUS; VS : constant VUS_View := (Values => To_Varray_unsigned_short (S.Values)); begin Result := To_Vector (VS); return To_LL_VBS (Result); end; end if; end To_Vector; function To_Vector (S : VP_View) return VP is begin if Default_Bit_Order = High_Order_First then return To_VP (S); else declare Result : LL_VUS; VS : constant VUS_View := (Values => To_Varray_unsigned_short (S.Values)); begin Result := To_Vector (VS); return To_LL_VP (Result); end; end if; end To_Vector; function To_Vector (S : VSI_View) return VSI is begin if Default_Bit_Order = High_Order_First then return To_VSI (S); else declare Result : LL_VUI; VS : constant VUI_View := (Values => To_Varray_unsigned_int (S.Values)); begin Result := To_Vector (VS); return To_LL_VSI (Result); end; end if; end To_Vector; function To_Vector (S : VBI_View) return VBI is begin if Default_Bit_Order = High_Order_First then return To_VBI (S); else declare Result : LL_VUI; VS : constant VUI_View := (Values => To_Varray_unsigned_int (S.Values)); begin Result := To_Vector (VS); return To_LL_VBI (Result); end; end if; end To_Vector; function To_Vector (S : VF_View) return VF is begin if Default_Bit_Order = High_Order_First then return To_VF (S); else declare Result : LL_VUI; VS : constant VUI_View := (Values => To_Varray_unsigned_int (S.Values)); begin Result := To_Vector (VS); return To_LL_VF (Result); end; end if; end To_Vector; function To_Vector (S : VUC_View) return VUC is begin if Default_Bit_Order = High_Order_First then return To_VUC (S); else declare Result : VUC_View; begin for J in Vchar_Range'Range loop Result.Values (J) := S.Values (Vchar_Range'Last - J + Vchar_Range'First); end loop; return To_VUC (Result); end; end if; end To_Vector; function To_Vector (S : VUS_View) return VUS is begin if Default_Bit_Order = High_Order_First then return To_VUS (S); else declare Result : VUS_View; begin for J in Vshort_Range'Range loop Result.Values (J) := S.Values (Vshort_Range'Last - J + Vshort_Range'First); end loop; return To_VUS (Result); end; end if; end To_Vector; function To_Vector (S : VUI_View) return VUI is begin if Default_Bit_Order = High_Order_First then return To_VUI (S); else declare Result : VUI_View; begin for J in Vint_Range'Range loop Result.Values (J) := S.Values (Vint_Range'Last - J + Vint_Range'First); end loop; return To_VUI (Result); end; end if; end To_Vector; -------------- -- To_View -- -------------- function To_View (S : VSC) return VSC_View is begin if Default_Bit_Order = High_Order_First then return To_VSC_View (S); else declare Result : VUC_View; begin Result := To_View (To_LL_VUC (S)); return (Values => To_Varray_signed_char (Result.Values)); end; end if; end To_View; function To_View (S : VBC) return VBC_View is begin if Default_Bit_Order = High_Order_First then return To_VBC_View (S); else declare Result : VUC_View; begin Result := To_View (To_LL_VUC (S)); return (Values => To_Varray_bool_char (Result.Values)); end; end if; end To_View; function To_View (S : VSS) return VSS_View is begin if Default_Bit_Order = High_Order_First then return To_VSS_View (S); else declare Result : VUS_View; begin Result := To_View (To_LL_VUS (S)); return (Values => To_Varray_signed_short (Result.Values)); end; end if; end To_View; function To_View (S : VBS) return VBS_View is begin if Default_Bit_Order = High_Order_First then return To_VBS_View (S); else declare Result : VUS_View; begin Result := To_View (To_LL_VUS (S)); return (Values => To_Varray_bool_short (Result.Values)); end; end if; end To_View; function To_View (S : VP) return VP_View is begin if Default_Bit_Order = High_Order_First then return To_VP_View (S); else declare Result : VUS_View; begin Result := To_View (To_LL_VUS (S)); return (Values => To_Varray_pixel (Result.Values)); end; end if; end To_View; function To_View (S : VSI) return VSI_View is begin if Default_Bit_Order = High_Order_First then return To_VSI_View (S); else declare Result : VUI_View; begin Result := To_View (To_LL_VUI (S)); return (Values => To_Varray_signed_int (Result.Values)); end; end if; end To_View; function To_View (S : VBI) return VBI_View is begin if Default_Bit_Order = High_Order_First then return To_VBI_View (S); else declare Result : VUI_View; begin Result := To_View (To_LL_VUI (S)); return (Values => To_Varray_bool_int (Result.Values)); end; end if; end To_View; function To_View (S : VF) return VF_View is begin if Default_Bit_Order = High_Order_First then return To_VF_View (S); else declare Result : VUI_View; begin Result := To_View (To_LL_VUI (S)); return (Values => To_Varray_float (Result.Values)); end; end if; end To_View; function To_View (S : VUC) return VUC_View is begin if Default_Bit_Order = High_Order_First then return To_VUC_View (S); else declare VS : constant VUC_View := To_VUC_View (S); Result : VUC_View; begin for J in Vchar_Range'Range loop Result.Values (J) := VS.Values (Vchar_Range'Last - J + Vchar_Range'First); end loop; return Result; end; end if; end To_View; function To_View (S : VUS) return VUS_View is begin if Default_Bit_Order = High_Order_First then return To_VUS_View (S); else declare VS : constant VUS_View := To_VUS_View (S); Result : VUS_View; begin for J in Vshort_Range'Range loop Result.Values (J) := VS.Values (Vshort_Range'Last - J + Vshort_Range'First); end loop; return Result; end; end if; end To_View; function To_View (S : VUI) return VUI_View is begin if Default_Bit_Order = High_Order_First then return To_VUI_View (S); else declare VS : constant VUI_View := To_VUI_View (S); Result : VUI_View; begin for J in Vint_Range'Range loop Result.Values (J) := VS.Values (Vint_Range'Last - J + Vint_Range'First); end loop; return Result; end; end if; end To_View; end GNAT.Altivec.Conversions;
----------------------------------------------------------------------- -- css-core-styles -- Core CSS API definition -- Copyright (C) 2017, 2020 Stephane Carrez -- Written by Stephane Carrez (Stephane.Carrez@gmail.com) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- package body CSS.Core.Styles is -- ------------------------------ -- Get the type that identifies the rule. -- ------------------------------ overriding function Get_Type (Rule : in CSSStyleRule) return CSSRule_Type is pragma Unreferenced (Rule); begin return STYLE_RULE; end Get_Type; -- ------------------------------ -- If the reference is valid and represents a style rule, return it. -- Otherwise returns null. -- ------------------------------ function Value (Ref : in CSS.Core.Refs.Ref) return CSSStyleRule_Access is begin if Ref.Is_Null then return null; else declare V : constant CSS.Core.Refs.Element_Accessor := Ref.Value; begin if V in CSSStyleRule'Class then return CSSStyleRule'Class (V.Element.all)'Unchecked_Access; else return null; end if; end; end if; end Value; -- ------------------------------ -- If the cursor is valid and represents a style rule, return it. -- Otherwise returns null. -- ------------------------------ function Element (Pos : in CSS.Core.Vectors.Cursor) return CSSStyleRule_Access is begin return Value (CSS.Core.Vectors.Element (Pos)); end Element; -- ------------------------------ -- Get the type that identifies the rule. -- ------------------------------ overriding function Get_Type (Rule : in CSSPageRule) return CSSRule_Type is pragma Unreferenced (Rule); begin return PAGE_RULE; end Get_Type; -- ------------------------------ -- Get the type that identifies the rule. -- ------------------------------ overriding function Get_Type (Rule : in CSSFontfaceRule) return CSSRule_Type is pragma Unreferenced (Rule); begin return FONT_FACE_RULE; end Get_Type; end CSS.Core.Styles;
-- { dg-do compile } -- { dg-options "-O -gnatws" } package body Opt1 is function De_Linear_Index (Index : Natural; D : Natural; Ind_Lengths : Dimention_Length) return Dimension_Indexes is Len : Natural := 1; Tmp_Ind : Natural := Index; Tmp_Res : Natural; Result : Dimension_Indexes (1 .. D); begin for J in 1 .. D loop Len := Len * Ind_Lengths (J); end loop; for J in Result'Range loop Result (J) := Tmp_Res; Tmp_Ind := Tmp_Ind - Len * (Result (J) - 1); end loop; return Result; end; end Opt1;
with OpenGL.Thin; package body OpenGL.Light is function Enum_Value (Index : in Light_Index_t) return Thin.Enumeration_t is begin case Index is when Light_0 => return Thin.GL_LIGHT0; when Light_1 => return Thin.GL_LIGHT1; when Light_2 => return Thin.GL_LIGHT2; when Light_3 => return Thin.GL_LIGHT3; when Light_4 => return Thin.GL_LIGHT4; when Light_5 => return Thin.GL_LIGHT5; when Light_6 => return Thin.GL_LIGHT6; when Light_7 => return Thin.GL_LIGHT7; end case; end Enum_Value; procedure Enable (Index : in Light_Index_t) is begin Thin.Enable (Enum_Value (Index)); end Enable; procedure Disable (Index : in Light_Index_t) is begin Thin.Disable (Enum_Value (Index)); end Disable; function Is_Enabled (Index : in Light_Index_t) return Boolean is use type Thin.Boolean_t; begin return Thin.Is_Enabled (Enum_Value (Index)) = Thin.Boolean_t'Val (1); end Is_Enabled; end OpenGL.Light;
package body Centro_Mensajeria is LEnvios: Lista_Envios.Lista; Nombre: String(1..4); Ubicacion: String(1..4); procedure Localizar_Envios_Cercanos(Geo: in GeoLoc.Geo; out LCer: Lista_Envios.Lista) is LAux: Lista_Envios.Lista; EnvAux: Envios.Envio; GeoAux: GeoLoc.Geo; begin Listas_Envios.Crear_Vacia(LCer); Listas_Envios.Copiar(LAux, LEnvios); while not Listas_Envios.Es_Vacia(LAux) loop Listas_Envios.Obtener_Primero(LAux, EnvAux); Listas_Envios.Eliminar_Primero(LAux); GeoAux := Envios.GeoActual(EnvAux); if GeoLoc.Distancia(GeoAux, Geo) < 1.0 then Listas_Envios.Anadir(LCer, EnvAux); end if; end loop; end Localizar_Envios_Cercanos;