CombinedText stringlengths 4 3.42M |
|---|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012, Vadim Godunko <vgodunko@gmail.com> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
-- Fill is the abstract super class of all kinds of fills that are used to
-- paint the interior of graphical elements.
------------------------------------------------------------------------------
limited with AMF.DG.Canvases;
package AMF.DG.Fills is
pragma Preelaborate;
type DG_Fill is limited interface;
type DG_Fill_Access is
access all DG_Fill'Class;
for DG_Fill_Access'Storage_Size use 0;
not overriding function Get_Canvas
(Self : not null access constant DG_Fill)
return AMF.DG.Canvases.DG_Canvas_Access is abstract;
-- Getter of Fill::canvas.
--
-- a reference to the canvas that owns this fill.
not overriding procedure Set_Canvas
(Self : not null access DG_Fill;
To : AMF.DG.Canvases.DG_Canvas_Access) is abstract;
-- Setter of Fill::canvas.
--
-- a reference to the canvas that owns this fill.
not overriding function Get_Transform
(Self : not null access constant DG_Fill)
return AMF.DG.Sequence_Of_DG_Transform is abstract;
-- Getter of Fill::transform.
--
-- a list of zero or more transforms to apply to this fill.
end AMF.DG.Fills;
|
-----------------------------------------------------------------------
-- servlet-sessions.factory -- Servlet Sessions factory
-- Copyright (C) 2010, 2011, 2014, 2016, 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.Finalization;
with Util.Strings;
with Ada.Strings.Unbounded;
with Ada.Containers.Hashed_Maps;
with Ada.Numerics.Discrete_Random;
with Interfaces;
with Ada.Streams;
-- The <b>Servlet.Sessions.Factory</b> package is a factory for creating, searching
-- and deleting sessions.
package Servlet.Sessions.Factory is
type Session_Factory is new Ada.Finalization.Limited_Controlled with private;
-- Create a new session
procedure Create_Session (Factory : in out Session_Factory;
Result : out Session);
-- Allocate a unique and random session identifier. The default implementation
-- generates a 256 bit random number that it serializes as base64 in the string.
-- Upon successful completion, the sequence string buffer is allocated and
-- returned in <b>Id</b>. The buffer will be freed when the session is removed.
procedure Allocate_Session_Id (Factory : in out Session_Factory;
Id : out Ada.Strings.Unbounded.String_Access);
-- Deletes the session.
procedure Delete_Session (Factory : in out Session_Factory;
Sess : in out Session);
-- Finds the session knowing the session identifier.
-- If the session is found, the last access time is updated.
-- Otherwise, the null session object is returned.
procedure Find_Session (Factory : in out Session_Factory;
Id : in String;
Result : out Session);
-- Returns the maximum time interval, in seconds, that the servlet container will
-- keep this session open between client accesses. After this interval, the servlet
-- container will invalidate the session. The maximum time interval can be set with
-- the Set_Max_Inactive_Interval method.
-- A negative time indicates the session should never timeout.
function Get_Max_Inactive_Interval (Factory : in Session_Factory) return Duration;
-- Specifies the time, in seconds, between client requests before the servlet
-- container will invalidate this session. A negative time indicates the session
-- should never timeout.
procedure Set_Max_Inactive_Interval (Factory : in out Session_Factory;
Interval : in Duration);
-- Release all the sessions.
overriding
procedure Finalize (Factory : in out Session_Factory);
private
use Util.Strings;
package Session_Maps is new
Ada.Containers.Hashed_Maps (Key_Type => Name_Access,
Element_Type => Session,
Hash => Hash,
Equivalent_Keys => Util.Strings.Equivalent_Keys);
package Id_Random is new Ada.Numerics.Discrete_Random (Interfaces.Unsigned_32);
protected type Session_Cache is
-- Find the session in the session cache.
function Find (Id : in String) return Session;
-- Insert the session in the session cache.
procedure Insert (Sess : in Session);
-- Remove the session from the session cache.
procedure Delete (Sess : in out Session);
-- Generate a random bitstream.
procedure Generate_Id (Rand : out Ada.Streams.Stream_Element_Array);
-- Initialize the random generator.
procedure Initialize;
-- Clear the session cache.
procedure Clear;
private
-- Id to session map.
Sessions : Session_Maps.Map;
-- Random number generator used for ID generation.
Random : Id_Random.Generator;
end Session_Cache;
type Session_Factory is new Ada.Finalization.Limited_Controlled with record
-- The session cache.
Sessions : Session_Cache;
-- Max inactive time in seconds.
Max_Inactive : Duration := DEFAULT_INACTIVE_TIMEOUT;
-- Number of 32-bit random numbers used for the ID generation.
Id_Size : Ada.Streams.Stream_Element_Offset := 8;
end record;
-- Initialize the session factory.
overriding
procedure Initialize (Factory : in out Session_Factory);
end Servlet.Sessions.Factory;
|
pragma License (Unrestricted);
-- extended unit
with Ada.Strings.Wide_Functions.Maps;
package Ada.Strings.Bounded_Wide_Strings.Functions.Maps is
new Generic_Maps (Wide_Functions.Maps);
pragma Preelaborate (Ada.Strings.Bounded_Wide_Strings.Functions.Maps);
|
package Multiple_Interfaces is
type Camera is tagged null record;
type Mobile_Phone is limited Interface;
type Camera_Phone is new Camera and Mobile_Phone with null record;
end Multiple_Interfaces;
|
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE boost_serialization>
<boost_serialization signature="serialization::archive" version="11">
<syndb class_id="0" tracking_level="0" version="0">
<userIPLatency>-1</userIPLatency>
<userIPName></userIPName>
<cdfg class_id="1" tracking_level="1" version="0" object_id="_0">
<name>get</name>
<ret_bitwidth>32</ret_bitwidth>
<ports class_id="2" tracking_level="0" version="0">
<count>4</count>
<item_version>0</item_version>
<item class_id="3" tracking_level="1" version="0" object_id="_1">
<Value class_id="4" tracking_level="0" version="0">
<Obj class_id="5" tracking_level="0" version="0">
<type>1</type>
<id>1</id>
<name>gmem</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo class_id="6" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<direction>0</direction>
<if_type>4</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>data</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>data</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>key</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>key</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>val_r</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>val</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<direction>1</direction>
<if_type>0</if_type>
<array_size>0</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
</ports>
<nodes class_id="8" tracking_level="0" version="0">
<count>12</count>
<item_version>0</item_version>
<item class_id="9" tracking_level="1" version="0" object_id="_5">
<Value>
<Obj>
<type>0</type>
<id>5</id>
<name>key_read</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>key</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>26</item>
<item>27</item>
</oprand_edges>
<opcode>read</opcode>
</item>
<item class_id_reference="9" object_id="_6">
<Value>
<Obj>
<type>0</type>
<id>6</id>
<name>data_read</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>data</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>28</item>
<item>29</item>
</oprand_edges>
<opcode>read</opcode>
</item>
<item class_id_reference="9" object_id="_7">
<Value>
<Obj>
<type>0</type>
<id>7</id>
<name>tmp</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>30</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>31</item>
<item>32</item>
<item>34</item>
<item>36</item>
</oprand_edges>
<opcode>partselect</opcode>
</item>
<item class_id_reference="9" object_id="_8">
<Value>
<Obj>
<type>0</type>
<id>8</id>
<name>tmp_1_cast</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>33</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>37</item>
</oprand_edges>
<opcode>zext</opcode>
</item>
<item class_id_reference="9" object_id="_9">
<Value>
<Obj>
<type>0</type>
<id>16</id>
<name>tmp_cast</name>
<fileName>C:/Users/sskalick/Xilinx/hash/hash/src/main.cpp</fileName>
<fileDirectory>c:/Users/sskalick/Xilinx/hash/hash/SDDebug/_sds/vhls</fileDirectory>
<lineNumber>36</lineNumber>
<contextFuncName>get</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item class_id="11" tracking_level="0" version="0">
<first>c:/Users/sskalick/Xilinx/hash/hash/SDDebug/_sds/vhls</first>
<second class_id="12" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="13" tracking_level="0" version="0">
<first class_id="14" tracking_level="0" version="0">
<first>C:/Users/sskalick/Xilinx/hash/hash/src/main.cpp</first>
<second>get</second>
</first>
<second>36</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>33</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>38</item>
</oprand_edges>
<opcode>zext</opcode>
</item>
<item class_id_reference="9" object_id="_10">
<Value>
<Obj>
<type>0</type>
<id>17</id>
<name>data2_sum</name>
<fileName>C:/Users/sskalick/Xilinx/hash/hash/src/main.cpp</fileName>
<fileDirectory>c:/Users/sskalick/Xilinx/hash/hash/SDDebug/_sds/vhls</fileDirectory>
<lineNumber>36</lineNumber>
<contextFuncName>get</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>c:/Users/sskalick/Xilinx/hash/hash/SDDebug/_sds/vhls</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>C:/Users/sskalick/Xilinx/hash/hash/src/main.cpp</first>
<second>get</second>
</first>
<second>36</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>33</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>39</item>
<item>40</item>
</oprand_edges>
<opcode>add</opcode>
</item>
<item class_id_reference="9" object_id="_11">
<Value>
<Obj>
<type>0</type>
<id>18</id>
<name>data2_sum_cast</name>
<fileName>C:/Users/sskalick/Xilinx/hash/hash/src/main.cpp</fileName>
<fileDirectory>c:/Users/sskalick/Xilinx/hash/hash/SDDebug/_sds/vhls</fileDirectory>
<lineNumber>36</lineNumber>
<contextFuncName>get</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>c:/Users/sskalick/Xilinx/hash/hash/SDDebug/_sds/vhls</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>C:/Users/sskalick/Xilinx/hash/hash/src/main.cpp</first>
<second>get</second>
</first>
<second>36</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>41</item>
</oprand_edges>
<opcode>zext</opcode>
</item>
<item class_id_reference="9" object_id="_12">
<Value>
<Obj>
<type>0</type>
<id>19</id>
<name>gmem_addr</name>
<fileName>C:/Users/sskalick/Xilinx/hash/hash/src/main.cpp</fileName>
<fileDirectory>c:/Users/sskalick/Xilinx/hash/hash/SDDebug/_sds/vhls</fileDirectory>
<lineNumber>36</lineNumber>
<contextFuncName>get</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>c:/Users/sskalick/Xilinx/hash/hash/SDDebug/_sds/vhls</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>C:/Users/sskalick/Xilinx/hash/hash/src/main.cpp</first>
<second>get</second>
</first>
<second>36</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>42</item>
<item>43</item>
</oprand_edges>
<opcode>getelementptr</opcode>
</item>
<item class_id_reference="9" object_id="_13">
<Value>
<Obj>
<type>0</type>
<id>20</id>
<name>gmem_load_req</name>
<fileName>C:/Users/sskalick/Xilinx/hash/hash/src/main.cpp</fileName>
<fileDirectory>c:/Users/sskalick/Xilinx/hash/hash/SDDebug/_sds/vhls</fileDirectory>
<lineNumber>36</lineNumber>
<contextFuncName>get</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>c:/Users/sskalick/Xilinx/hash/hash/SDDebug/_sds/vhls</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>C:/Users/sskalick/Xilinx/hash/hash/src/main.cpp</first>
<second>get</second>
</first>
<second>36</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>45</item>
<item>46</item>
<item>48</item>
</oprand_edges>
<opcode>readreq</opcode>
</item>
<item class_id_reference="9" object_id="_14">
<Value>
<Obj>
<type>0</type>
<id>21</id>
<name>gmem_addr_read</name>
<fileName>C:/Users/sskalick/Xilinx/hash/hash/src/main.cpp</fileName>
<fileDirectory>c:/Users/sskalick/Xilinx/hash/hash/SDDebug/_sds/vhls</fileDirectory>
<lineNumber>36</lineNumber>
<contextFuncName>get</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>c:/Users/sskalick/Xilinx/hash/hash/SDDebug/_sds/vhls</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>C:/Users/sskalick/Xilinx/hash/hash/src/main.cpp</first>
<second>get</second>
</first>
<second>36</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>src</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>50</item>
<item>51</item>
<item>92</item>
</oprand_edges>
<opcode>read</opcode>
</item>
<item class_id_reference="9" object_id="_15">
<Value>
<Obj>
<type>0</type>
<id>22</id>
<name></name>
<fileName>C:/Users/sskalick/Xilinx/hash/hash/src/main.cpp</fileName>
<fileDirectory>c:/Users/sskalick/Xilinx/hash/hash/SDDebug/_sds/vhls</fileDirectory>
<lineNumber>36</lineNumber>
<contextFuncName>get</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>c:/Users/sskalick/Xilinx/hash/hash/SDDebug/_sds/vhls</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>C:/Users/sskalick/Xilinx/hash/hash/src/main.cpp</first>
<second>get</second>
</first>
<second>36</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>53</item>
<item>54</item>
<item>55</item>
</oprand_edges>
<opcode>write</opcode>
</item>
<item class_id_reference="9" object_id="_16">
<Value>
<Obj>
<type>0</type>
<id>23</id>
<name></name>
<fileName>C:/Users/sskalick/Xilinx/hash/hash/src/main.cpp</fileName>
<fileDirectory>c:/Users/sskalick/Xilinx/hash/hash/SDDebug/_sds/vhls</fileDirectory>
<lineNumber>38</lineNumber>
<contextFuncName>get</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>c:/Users/sskalick/Xilinx/hash/hash/SDDebug/_sds/vhls</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>C:/Users/sskalick/Xilinx/hash/hash/src/main.cpp</first>
<second>get</second>
</first>
<second>38</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>57</item>
</oprand_edges>
<opcode>ret</opcode>
</item>
</nodes>
<consts class_id="15" tracking_level="0" version="0">
<count>4</count>
<item_version>0</item_version>
<item class_id="16" tracking_level="1" version="0" object_id="_17">
<Value>
<Obj>
<type>2</type>
<id>33</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>2</content>
</item>
<item class_id_reference="16" object_id="_18">
<Value>
<Obj>
<type>2</type>
<id>35</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>31</content>
</item>
<item class_id_reference="16" object_id="_19">
<Value>
<Obj>
<type>2</type>
<id>47</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>1</content>
</item>
<item class_id_reference="16" object_id="_20">
<Value>
<Obj>
<type>2</type>
<id>56</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>0</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="_21">
<Obj>
<type>3</type>
<id>24</id>
<name>get</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>5</item>
<item>6</item>
<item>7</item>
<item>8</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>
</node_objs>
</item>
</blocks>
<edges class_id="19" tracking_level="0" version="0">
<count>19</count>
<item_version>0</item_version>
<item class_id="20" tracking_level="1" version="0" object_id="_22">
<id>27</id>
<edge_type>1</edge_type>
<source_obj>3</source_obj>
<sink_obj>5</sink_obj>
</item>
<item class_id_reference="20" object_id="_23">
<id>29</id>
<edge_type>1</edge_type>
<source_obj>2</source_obj>
<sink_obj>6</sink_obj>
</item>
<item class_id_reference="20" object_id="_24">
<id>32</id>
<edge_type>1</edge_type>
<source_obj>6</source_obj>
<sink_obj>7</sink_obj>
</item>
<item class_id_reference="20" object_id="_25">
<id>34</id>
<edge_type>1</edge_type>
<source_obj>33</source_obj>
<sink_obj>7</sink_obj>
</item>
<item class_id_reference="20" object_id="_26">
<id>36</id>
<edge_type>1</edge_type>
<source_obj>35</source_obj>
<sink_obj>7</sink_obj>
</item>
<item class_id_reference="20" object_id="_27">
<id>37</id>
<edge_type>1</edge_type>
<source_obj>7</source_obj>
<sink_obj>8</sink_obj>
</item>
<item class_id_reference="20" object_id="_28">
<id>38</id>
<edge_type>1</edge_type>
<source_obj>5</source_obj>
<sink_obj>16</sink_obj>
</item>
<item class_id_reference="20" object_id="_29">
<id>39</id>
<edge_type>1</edge_type>
<source_obj>16</source_obj>
<sink_obj>17</sink_obj>
</item>
<item class_id_reference="20" object_id="_30">
<id>40</id>
<edge_type>1</edge_type>
<source_obj>8</source_obj>
<sink_obj>17</sink_obj>
</item>
<item class_id_reference="20" object_id="_31">
<id>41</id>
<edge_type>1</edge_type>
<source_obj>17</source_obj>
<sink_obj>18</sink_obj>
</item>
<item class_id_reference="20" object_id="_32">
<id>42</id>
<edge_type>1</edge_type>
<source_obj>1</source_obj>
<sink_obj>19</sink_obj>
</item>
<item class_id_reference="20" object_id="_33">
<id>43</id>
<edge_type>1</edge_type>
<source_obj>18</source_obj>
<sink_obj>19</sink_obj>
</item>
<item class_id_reference="20" object_id="_34">
<id>46</id>
<edge_type>1</edge_type>
<source_obj>19</source_obj>
<sink_obj>20</sink_obj>
</item>
<item class_id_reference="20" object_id="_35">
<id>48</id>
<edge_type>1</edge_type>
<source_obj>47</source_obj>
<sink_obj>20</sink_obj>
</item>
<item class_id_reference="20" object_id="_36">
<id>51</id>
<edge_type>1</edge_type>
<source_obj>19</source_obj>
<sink_obj>21</sink_obj>
</item>
<item class_id_reference="20" object_id="_37">
<id>54</id>
<edge_type>1</edge_type>
<source_obj>4</source_obj>
<sink_obj>22</sink_obj>
</item>
<item class_id_reference="20" object_id="_38">
<id>55</id>
<edge_type>1</edge_type>
<source_obj>21</source_obj>
<sink_obj>22</sink_obj>
</item>
<item class_id_reference="20" object_id="_39">
<id>57</id>
<edge_type>1</edge_type>
<source_obj>56</source_obj>
<sink_obj>23</sink_obj>
</item>
<item class_id_reference="20" object_id="_40">
<id>92</id>
<edge_type>4</edge_type>
<source_obj>20</source_obj>
<sink_obj>21</sink_obj>
</item>
</edges>
</cdfg>
<cdfg_regions class_id="21" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="22" tracking_level="1" version="0" object_id="_41">
<mId>1</mId>
<mTag>get</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>24</item>
</basic_blocks>
<mII>-1</mII>
<mDepth>-1</mDepth>
<mMinTripCount>-1</mMinTripCount>
<mMaxTripCount>-1</mMaxTripCount>
<mMinLatency>8</mMinLatency>
<mMaxLatency>-1</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"></mDfPipe>
</item>
</cdfg_regions>
<fsm class_id="-1"></fsm>
<res class_id="-1"></res>
<node_label_latency class_id="26" tracking_level="0" version="0">
<count>12</count>
<item_version>0</item_version>
<item class_id="27" tracking_level="0" version="0">
<first>5</first>
<second class_id="28" tracking_level="0" version="0">
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>6</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>7</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>8</first>
<second>
<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>1</first>
<second>6</second>
</second>
</item>
<item>
<first>21</first>
<second>
<first>8</first>
<second>0</second>
</second>
</item>
<item>
<first>22</first>
<second>
<first>8</first>
<second>0</second>
</second>
</item>
<item>
<first>23</first>
<second>
<first>8</first>
<second>0</second>
</second>
</item>
</node_label_latency>
<bblk_ent_exit class_id="29" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="30" tracking_level="0" version="0">
<first>24</first>
<second class_id="31" tracking_level="0" version="0">
<first>0</first>
<second>8</second>
</second>
</item>
</bblk_ent_exit>
<regions class_id="32" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="33" tracking_level="1" version="0" object_id="_42">
<region_name>get</region_name>
<basic_blocks>
<count>1</count>
<item_version>0</item_version>
<item>24</item>
</basic_blocks>
<nodes>
<count>19</count>
<item_version>0</item_version>
<item>5</item>
<item>6</item>
<item>7</item>
<item>8</item>
<item>9</item>
<item>10</item>
<item>11</item>
<item>12</item>
<item>13</item>
<item>14</item>
<item>15</item>
<item>16</item>
<item>17</item>
<item>18</item>
<item>19</item>
<item>20</item>
<item>21</item>
<item>22</item>
<item>23</item>
</nodes>
<anchor_node>-1</anchor_node>
<region_type>2</region_type>
<interval>0</interval>
<pipe_depth>0</pipe_depth>
</item>
</regions>
<dp_fu_nodes class_id="34" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_fu_nodes>
<dp_fu_nodes_expression class_id="35" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_fu_nodes_expression>
<dp_fu_nodes_module>
<count>0</count>
<item_version>0</item_version>
</dp_fu_nodes_module>
<dp_fu_nodes_io>
<count>0</count>
<item_version>0</item_version>
</dp_fu_nodes_io>
<return_ports>
<count>0</count>
<item_version>0</item_version>
</return_ports>
<dp_mem_port_nodes class_id="36" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_mem_port_nodes>
<dp_reg_nodes>
<count>0</count>
<item_version>0</item_version>
</dp_reg_nodes>
<dp_regname_nodes>
<count>0</count>
<item_version>0</item_version>
</dp_regname_nodes>
<dp_reg_phi>
<count>0</count>
<item_version>0</item_version>
</dp_reg_phi>
<dp_regname_phi>
<count>0</count>
<item_version>0</item_version>
</dp_regname_phi>
<dp_port_io_nodes class_id="37" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_port_io_nodes>
<port2core class_id="38" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</port2core>
<node2core>
<count>0</count>
<item_version>0</item_version>
</node2core>
</syndb>
</boost_serialization>
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, Vadim Godunko <vgodunko@gmail.com> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
-- A protocol state machine is always defined in the context of a classifier.
-- It specifies which operations of the classifier can be called in which
-- state and under which condition, thus specifying the allowed call
-- sequences on the classifier's operations. A protocol state machine
-- presents the possible and permitted transitions on the instances of its
-- context classifier, together with the operations which carry the
-- transitions. In this manner, an instance lifecycle can be created for a
-- classifier, by specifying the order in which the operations can be
-- activated and the states through which an instance progresses during its
-- existence.
------------------------------------------------------------------------------
limited with AMF.UML.Protocol_Conformances.Collections;
with AMF.UML.State_Machines;
package AMF.UML.Protocol_State_Machines is
pragma Preelaborate;
type UML_Protocol_State_Machine is limited interface
and AMF.UML.State_Machines.UML_State_Machine;
type UML_Protocol_State_Machine_Access is
access all UML_Protocol_State_Machine'Class;
for UML_Protocol_State_Machine_Access'Storage_Size use 0;
not overriding function Get_Conformance
(Self : not null access constant UML_Protocol_State_Machine)
return AMF.UML.Protocol_Conformances.Collections.Set_Of_UML_Protocol_Conformance is abstract;
-- Getter of ProtocolStateMachine::conformance.
--
-- Conformance between protocol state machines.
end AMF.UML.Protocol_State_Machines;
|
------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Text_IO --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
-- "Software"), to deal in the Software without restriction, including --
-- without limitation the rights to use, copy, modify, merge, publish, --
-- distribute, distribute with modifications, sublicense, and/or sell --
-- copies of the Software, and to permit persons to whom the Software is --
-- furnished to do so, subject to the following conditions: --
-- --
-- The above copyright notice and this permission notice shall be included --
-- in all copies or substantial portions of the Software. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --
-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --
-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. --
-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, --
-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR --
-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR --
-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. --
-- --
-- Except as contained in this notice, the name(s) of the above copyright --
-- holders shall not be used in advertising or otherwise to promote the --
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer <Juergen.Pfeifer@T-Online.de> 1996
-- Version Control:
-- $Revision: 1.8 $
-- Binding Version 00.93
------------------------------------------------------------------------------
with System;
with System.Parameters;
with Ada.Text_IO;
with Ada.IO_Exceptions;
package Terminal_Interface.Curses.Text_IO is
use type Ada.Text_IO.Count;
subtype Count is Ada.Text_IO.Count;
subtype Positive_Count is Count range 1 .. Count'Last;
subtype Field is Integer range 0 .. System.Parameters.Field_Max;
subtype Number_Base is Integer range 2 .. 16;
type Type_Set is (Lower_Case, Upper_Case, Mixed_Case);
-- For most of the routines you will see a version without a Window
-- type parameter. They will operate on a default window, which can
-- be set by the user. It is initially equal to Standard_Window.
procedure Set_Window (Win : in Window);
-- Set Win as the default window
function Get_Window return Window;
-- Get the current default window
procedure Flush (Win : in Window);
procedure Flush;
--------------------------------------------
-- Specification of line and page lengths --
--------------------------------------------
-- There are no set routines in this package. I assume, that you allocate
-- the window with an appropriate size.
-- A scroll-window is interpreted as an page with unbounded page length,
-- i.e. it returns the conventional 0 as page length.
function Line_Length (Win : in Window) return Count;
function Line_Length return Count;
function Page_Length (Win : in Window) return Count;
function Page_Length return Count;
------------------------------------
-- Column, Line, and Page Control --
------------------------------------
procedure New_Line (Win : in Window; Spacing : in Positive_Count := 1);
procedure New_Line (Spacing : in Positive_Count := 1);
procedure New_Page (Win : in Window);
procedure New_Page;
procedure Set_Col (Win : in Window; To : in Positive_Count);
procedure Set_Col (To : in Positive_Count);
procedure Set_Line (Win : in Window; To : in Positive_Count);
procedure Set_Line (To : in Positive_Count);
function Col (Win : in Window) return Positive_Count;
function Col return Positive_Count;
function Line (Win : in Window) return Positive_Count;
function Line return Positive_Count;
-----------------------
-- Characters-Output --
-----------------------
procedure Put (Win : in Window; Item : in Character);
procedure Put (Item : in Character);
--------------------
-- Strings-Output --
--------------------
procedure Put (Win : in Window; Item : in String);
procedure Put (Item : in String);
procedure Put_Line
(Win : in Window;
Item : in String);
procedure Put_Line
(Item : in String);
-- Exceptions
Status_Error : exception renames Ada.IO_Exceptions.Status_Error;
Mode_Error : exception renames Ada.IO_Exceptions.Mode_Error;
Name_Error : exception renames Ada.IO_Exceptions.Name_Error;
Use_Error : exception renames Ada.IO_Exceptions.Use_Error;
Device_Error : exception renames Ada.IO_Exceptions.Device_Error;
End_Error : exception renames Ada.IO_Exceptions.End_Error;
Data_Error : exception renames Ada.IO_Exceptions.Data_Error;
Layout_Error : exception renames Ada.IO_Exceptions.Layout_Error;
end Terminal_Interface.Curses.Text_IO;
|
with STM32_SVD; use STM32_SVD;
with STM32_SVD.RCC; use STM32_SVD.RCC;
with STM32_SVD.PWR; use STM32_SVD.PWR;
with STM32_SVD.RTC; use STM32_SVD.RTC;
with STM32_SVD.EXTI; use STM32_SVD.EXTI;
with STM32_SVD.NVIC; use STM32_SVD.NVIC;
package body STM32GD.Clock.Source is
procedure Init_PLLCLK is
PLLMUL : UInt4;
begin
case Input is
when HSI =>
PLLMUL :=
(if Frequency / 4_000_000 >= 16 then 15
elsif Frequency / 4_000_000 >= 15 then 14
elsif Frequency / 4_000_000 >= 14 then 13
elsif Frequency / 4_000_000 >= 13 then 12
elsif Frequency / 4_000_000 >= 12 then 11
elsif Frequency / 4_000_000 >= 11 then 10
elsif Frequency / 4_000_000 >= 10 then 9
elsif Frequency / 4_000_000 >= 9 then 8
elsif Frequency / 4_000_000 >= 8 then 7
elsif Frequency / 4_000_000 >= 7 then 6
elsif Frequency / 4_000_000 >= 6 then 5
elsif Frequency / 4_000_000 >= 5 then 5
elsif Frequency / 4_000_000 >= 4 then 3
elsif Frequency / 4_000_000 >= 3 then 2
elsif Frequency / 4_000_000 >= 2 then 1
else 0);
RCC_Periph.CFGR.PLLSRC := 0;
when HSE =>
PLLMUL := 0;
RCC_Periph.CFGR.PLLSRC := 1;
when others =>
pragma Compile_Time_Error (Clock = PLLCLK and (Input /= HSI and Input /= HSE), "Invalid clock input for PLL clock");
end case;
RCC_Periph.CFGR.PLLMUL := PLLMUL;
RCC_Periph.CR.PLLON := 1;
while RCC_Periph.CR.PLLRDY = 0 loop null; end loop;
end Init_PLLCLK;
procedure Init_SYSCLK is
begin
case Input is
when HSI =>
RCC_Periph.CFGR.SW := 2#00#;
while RCC_Periph.CFGR.SWS /= 2#00# loop null; end loop;
when HSE =>
RCC_Periph.CFGR.SW := 2#01#;
while RCC_Periph.CFGR.SWS /= 2#01# loop null; end loop;
when PLLCLK =>
RCC_Periph.CFGR.SW := 2#10#;
while RCC_Periph.CFGR.SWS /= 2#10# loop null; end loop;
when others =>
pragma Compile_Time_Error (Clock = SYSCLK and (Input /= PLLCLK and Input /= HSI and Input /= HSE), "Invalid clock input for system clock");
end case;
end Init_SYSCLK;
procedure Init_RTCCLK is
Div_A : UInt7;
Div_S : UInt15;
begin
pragma Compile_Time_Error (Clock = RTCCLK and Frequency /= 1, "RTC clock can only run at 1Hz");
RCC_Periph.APB1ENR.PWREN := 1;
PWR_Periph.CR.DBP := 1;
RCC_Periph.BDCR.RTCEN := 1;
RTC_Periph.WPR.KEY := 16#CA#;
RTC_Periph.WPR.KEY := 16#53#;
RTC_Periph.ISR.INIT := 1;
while RTC_Periph.ISR.INITF = 0 loop null; end loop;
case Input is
when LSE => Div_A := 127; Div_S := 255;
RCC_Periph.BDCR.RTCSEL := 2#01#;
when LSI => Div_A := 63; Div_S := 624;
RCC_Periph.BDCR.RTCSEL := 2#10#;
when HSE => Div_A := 127; Div_S := UInt15 (Input_Frequency / 128);
RCC_Periph.BDCR.RTCSEL := 2#11#;
when others =>
pragma Compile_Time_Error (Clock = RTCCLK and (Input /= LSI and Input /= LSE and Input /= HSE), "Invalid clock input for RTC clock");
end case;
RTC_Periph.PRER.PREDIV_A := Div_A;
RTC_Periph.PRER.PREDIV_S := Div_S;
RTC_Periph.ISR.INIT := 0;
RTC_Periph.WPR.KEY := 16#FF#;
end Init_RTCCLK;
procedure Init_LSI is
begin
RCC_Periph.CSR.LSION := 1;
while RCC_Periph.CSR.LSIRDY = 0 loop null; end loop;
end Init_LSI;
procedure Init is
begin
case Clock is
when SYSCLK => Init_SYSCLK;
when PCLK => null;
when HSI => null;
when LSI => Init_LSI;
when LSE => null;
when HCLK => null;
when RTCCLK => Init_RTCCLK;
when PLLCLK => Init_PLLCLK;
end case;
end Init;
procedure Delay_us (us : Natural) is
begin
null;
end Delay_us;
procedure Delay_ms (ms : Natural) is
begin
null;
end Delay_ms;
procedure Delay_RTCCLK_s (s : Natural) is
begin
RTC_Periph.WPR.KEY := 16#CA#;
RTC_Periph.WPR.KEY := 16#53#;
RTC_Periph.CR.ALRAE := 0;
RTC_Periph.ISR.ALRAF := 0;
RTC_Periph.ISR.INIT := 1;
while RTC_Periph.ISR.INITF = 0 loop null; end loop;
RTC_Periph.TR := (SU => 0, ST => 0, MNU => 0, MNT => 0, HU => 0, HT => 0, PM => 0, Reserved_23_31 => 0, others => 0);
RTC_Periph.ALRMAR := (
SU => UInt4 (s mod 10), ST => UInt3 (s / 10),
MNU => UInt4 ((s / 60) mod 10), MNT => UInt3 ((s / 60) / 10),
HU => UInt4 ((s / 3600) mod 10), HT => UInt2 ((s / 3600) / 10),
DU => 0, DT => 0, PM => 0, MSK4 => 1, others => 0);
RTC_Periph.CR.ALRAE := 1;
RTC_Periph.CR.ALRAIE := 1;
EXTI_Periph.IMR.MR.Arr (17) := 1;
EXTI_Periph.RTSR.TR.Arr (17) := 1;
RTC_Periph.ISR.INIT := 0;
RTC_Periph.WPR.KEY := 16#FF#;
-- NVIC_Periph.ICPR := 16#FFFF_FFFF#;
-- NVIC_Periph.ICER := 16#0000_0000#;
NVIC_Periph.ISER := 2#00000000_00000000_00000000_00000100#;
WFI;
end Delay_RTCCLK_s;
procedure Delay_s (s : Natural) is
begin
case Clock is
when RTCCLK => Delay_RTCCLK_s (s);
when others => null;
end case;
end Delay_s;
function Millisecond_Counter return Unsigned_32 is
begin
return 0;
end Millisecond_Counter;
procedure Delay_Slow_Periods (P : Unsigned_16) is
begin
null;
end Delay_Slow_Periods;
function Maximum_Delay_ms return Unsigned_16 is
begin
return 0;
end Maximum_Delay_ms;
end STM32GD.Clock.Source;
|
with STM32.GPIO;
use STM32.GPIO;
with HAL.GPIO;
package Analog is
type Analog_Signal_Value is new Integer;
procedure Configure_Pin (Pin : GPIO_Point);
-- Configure a given pin as a analog and establishes his properties
procedure Start_Adquisition (Pin : GPIO_Point);
-- Start the adquisition of the analag pin value
function Get_Value (Pin: GPIO_Point) return Analog_Signal_Value;
-- Obtain the value of the analog pin. A minimum time of 10 microseconds
-- must be given between the procedure Start_Adquisition and this function.
end Analog;
|
--
-- Copyright (c) 2007-2009 Tero Koskinen <tero.koskinen@iki.fi>
--
-- 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.Text_IO;
with Ahven.AStrings;
package body Ahven.Listeners.Basic is
use Ahven.AStrings;
-- Because of Ada.Text_IO output capturing, the result
-- recording is happening in the End_Test procedure.
--
-- Add_{Pass,Failure,Error} procedures delegate result
-- saving to the Set_Last_Test_Info procedure, which
-- records the latest result to the listener.
procedure Set_Last_Test_Info (Listener : in out Basic_Listener;
Info : Context;
Result : Result_Type) is
begin
Listener.Last_Test_Result := Result;
if Info.Phase = TEST_RUN then
Results.Set_Routine_Name (Listener.Last_Info, Info.Routine_Name);
Results.Set_Test_Name (Listener.Last_Info, Info.Test_Name);
Results.Set_Message (Listener.Last_Info, Info.Message);
Results.Set_Long_Message (Listener.Last_Info, Info.Long_Message);
end if;
end Set_Last_Test_Info;
procedure Add_Pass (Listener : in out Basic_Listener;
Info : Context) is
begin
Set_Last_Test_Info (Listener, Info, PASS_RESULT);
end Add_Pass;
procedure Add_Failure (Listener : in out Basic_Listener;
Info : Context) is
begin
Set_Last_Test_Info (Listener, Info, FAILURE_RESULT);
end Add_Failure;
procedure Add_Skipped (Listener : in out Basic_Listener;
Info : Context) is
begin
Set_Last_Test_Info (Listener, Info, SKIPPED_RESULT);
end Add_Skipped;
procedure Add_Error (Listener : in out Basic_Listener;
Info : Context) is
begin
Set_Last_Test_Info (Listener, Info, ERROR_RESULT);
end Add_Error;
procedure Start_Test (Listener : in out Basic_Listener;
Info : Context) is
R : Result_Collection_Access := null;
begin
Listener.Start_Time := Ada.Calendar.Clock;
if Info.Test_Kind = CONTAINER then
R := new Result_Collection;
Set_Name (R.all, Info.Test_Name);
Set_Parent (R.all, Listener.Current_Result);
if Listener.Current_Result = null then
Add_Child (Listener.Main_Result, R);
else
Add_Child (Listener.Current_Result.all, R);
end if;
Listener.Current_Result := R;
elsif Listener.Capture_Output then
-- A test routine? Let's create a temporary file
-- and direct Ada.Text_IO output there (if requested).
Temporary_Output.Create_Temp (Listener.Output_File);
Temporary_Output.Redirect_Output (Listener.Output_File);
end if;
end Start_Test;
procedure End_Test (Listener : in out Basic_Listener;
Info : Context) is
use type Ada.Calendar.Time;
Execution_Time : constant Duration :=
Ada.Calendar.Clock - Listener.Start_Time;
procedure Add_Result (Collection : in out Result_Collection) is
My_Info : Result_Info := Listener.Last_Info;
begin
if Info.Phase = TEST_RUN then
Set_Routine_Name (My_Info, To_String (Info.Routine_Name));
end if;
-- It is possible that only Start_Test and End_Test
-- are called (e.g. for Test_Suite), so the latest
-- test result can be unset (set to NO_RESULT)
--
-- In that case, we simply jump to parent collection.
-- Otherwise, we record the result.
if Listener.Last_Test_Result /= NO_RESULT then
if Listener.Capture_Output then
-- End of the test routine, so we can restore
-- the normal output now and close the temporary file.
Temporary_Output.Restore_Output;
Temporary_Output.Close_Temp (Listener.Output_File);
-- Saving the name of the temporary file to the test result,
-- so the file can be deleted later
Set_Output_File
(My_Info, Temporary_Output.Get_Name (Listener.Output_File));
end if;
Set_Message (My_Info, Get_Message (Listener.Last_Info));
Set_Long_Message (My_Info, Get_Long_Message (Listener.Last_Info));
Results.Set_Execution_Time (My_Info, Execution_Time);
case Listener.Last_Test_Result is
when PASS_RESULT =>
Add_Pass (Collection, My_Info);
when FAILURE_RESULT =>
Add_Failure (Collection, My_Info);
when ERROR_RESULT | NO_RESULT =>
Add_Error (Collection, My_Info);
when SKIPPED_RESULT =>
Add_Skipped (Collection, My_Info);
end case;
Listener.Last_Test_Result := NO_RESULT;
else
Listener.Current_Result :=
Get_Parent (Listener.Current_Result.all);
end if;
end Add_Result;
begin
if Listener.Current_Result /= null then
Add_Result (Listener.Current_Result.all);
else
Add_Result (Listener.Main_Result);
end if;
end End_Test;
procedure Set_Output_Capture (Listener : in out Basic_Listener;
Capture : Boolean) is
begin
Listener.Capture_Output := Capture;
end Set_Output_Capture;
function Get_Output_Capture (Listener : Basic_Listener)
return Boolean is
begin
return Listener.Capture_Output;
end Get_Output_Capture;
procedure Remove_File (Name : String) is
Handle : Ada.Text_IO.File_Type;
begin
Ada.Text_IO.Open (Handle, Ada.Text_IO.Out_File, Name);
Ada.Text_IO.Delete (Handle);
exception
when others =>
null; -- For now we can safely ignore errors (like missing file)
end Remove_File;
procedure Remove_Files (Collection : in out Result_Collection) is
procedure Remove (Name : Bounded_String) is
begin
if Length (Name) > 0 then
Remove_File (To_String (Name));
end if;
end Remove;
procedure Remove_Loop (First_Item : Result_Info_Cursor) is
Loop_Iter : Result_Info_Cursor := First_Item;
begin
loop
exit when not Is_Valid (Loop_Iter);
Remove (Get_Output_File (Data (Loop_Iter)));
Loop_Iter := Next (Loop_Iter);
end loop;
end Remove_Loop;
Child_Iter : Result_Collection_Cursor;
begin
Remove_Loop (First_Pass (Collection));
Remove_Loop (First_Failure (Collection));
Remove_Loop (First_Error (Collection));
Remove_Loop (First_Skipped (Collection));
Child_Iter := First_Child (Collection);
Child_Loop:
loop
exit Child_Loop when not Is_Valid (Child_Iter);
Remove_Files (Data (Child_Iter).all);
Child_Iter := Next (Child_Iter);
end loop Child_Loop;
end Remove_Files;
procedure Finalize (Listener : in out Basic_Listener) is
begin
Remove_Files (Listener.Main_Result);
Results.Release (Listener.Main_Result);
end Finalize;
end Ahven.Listeners.Basic;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . P A C K _ 1 1 --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2014, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- Handling of packed arrays with Component_Size = 11
package System.Pack_11 is
pragma Preelaborate;
Bits : constant := 11;
type Bits_11 is mod 2 ** Bits;
for Bits_11'Size use Bits;
-- In all subprograms below, Rev_SSO is set True if the array has the
-- non-default scalar storage order.
function Get_11
(Arr : System.Address;
N : Natural;
Rev_SSO : Boolean) return Bits_11 with Inline;
-- Arr is the address of the packed array, N is the zero-based
-- subscript. This element is extracted and returned.
procedure Set_11
(Arr : System.Address;
N : Natural;
E : Bits_11;
Rev_SSO : Boolean) with Inline;
-- Arr is the address of the packed array, N is the zero-based
-- subscript. This element is set to the given value.
end System.Pack_11;
|
-- --
-- package Copyright (c) Dmitry A. Kazakov --
-- Strings_Edit.Float_Edit Luebeck --
-- Interface Spring, 2000 --
-- --
-- Last revision : 19:10 06 Jun 2014 --
-- --
-- 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 provides I/O for floating-point types (the
-- generic parameter Number). There is also a non-generic version
-- Strings_Edit.Floats.
--
generic
type Number is digits <>;
package Strings_Edit.Float_Edit is
subtype Number_Of is Number;
--
-- Get -- Get a floating-point number from the string
--
-- Source - The string to be processed
-- Pointer - The current position in the string
-- Value - The result
-- Base - The base of the expected number
-- First - The lowest allowed value
-- Last - The highest allowed value
-- ToFirst - Force value to First instead of exception
-- ToLast - Force value to Last instead of exception
--
-- This procedure gets a number from the string Source. The process
-- starts from Source (Pointer) position. The number in the string may
-- be in either floating-point or fixed-point format. The point may be
-- absent. The mantissa can have base 2..16 (defined by the parameter
-- Base). The exponent part (if appears) is introduced by 'e' or 'E'. It
-- is always decimal of Base radix. Space characters are allowed between
-- the mantissa and the exponent part as well as in the exponent part
-- around the exponent sign. If Base has the value 15 or 16 the exponent
-- part shall be separated by at least one space character from the
-- mantissa.
--
-- Exceptions:
--
-- Constraint_Error - The number is not in First..Last
-- Data_Error - Syntax error in the number
-- End_Error - There is no any number
-- Layout_Error - Pointer not in Source'First..Source'Last + 1
--
procedure Get
( Source : in String;
Pointer : in out Integer;
Value : out Number'Base;
Base : in NumberBase := 10;
First : in Number'Base := Number'Base'First;
Last : in Number'Base := Number'Base'Last;
ToFirst : in Boolean := False;
ToLast : in Boolean := False
);
--
-- Value -- String to floating-point conversion
--
-- Source - The string to be processed
-- Base - The base of the expected number
-- First - The lowest allowed value
-- Last - The highest allowed value
-- ToFirst - Force value to First instead of exception
-- ToLast - Force value to Last instead of exception
--
-- This function gets a floating-point number from the string Source.
-- The number can be surrounded by spaces and tabs. The whole string
-- Source should be matched. Otherwise the exception Data_Error is
-- propagated.
--
-- Returns :
--
-- The value
--
-- Exceptions:
--
-- Constraint_Error - The number is not in First..Last
-- Data_Error - Syntax error in the number
-- End_Error - There is no any number
--
function Value
( Source : in String;
Base : in NumberBase := 10;
First : in Number'Base := Number'First;
Last : in Number'Base := Number'Last;
ToFirst : in Boolean := False;
ToLast : in Boolean := False
) return Number'Base;
--
-- Put -- Put a floating-point number into a string
--
-- Destination - The string that accepts the output
-- Pointer - The current position in the string
-- Value - The value to be put
-- Base - The base used for the output
-- PutPlus - The plus should placed for positive numbers
-- RelSmall - Relative precision of the output
-- AbsSmall - Absolute one
-- Field - The output field
-- Justify - Alignment within the field
-- Fill - The fill character
--
-- This procedure places the number specified by the parameter Value
-- into the output string Destination. The string is written starting
-- from Destination (Pointer). The parameter Base indicates the number
-- base used for the output. Base itself does not appear in the output.
-- The exponent part (if used) is always decimal. PutPlus indicates
-- whether the plus sign should be placed if the number is positive.
-- There are two ways to specify the output precision.
--
-- (o) The parameter RelSmall determines the number of the right Base
-- places of the mantissa. For instance, with RelSmall = 3 and Base
-- = 10, the number 1.234567e+01 is represented as 12.3.
--
-- (o) The parameter AbsSmall determines the rightmost correct digit of
-- the mantissa. For example, with AbsSmall = 0, Base = 10, the
-- number 1.234567e+01 is represented as 12 (i.e. 12.34567 rounded
-- to 10**0).
--
-- From two parameters RelSmall and AbsSmall, the procedure chooses one,
-- that specifies the minimal number of mantissa digits, but no more
-- than the machine representation of the number allows. If the point
-- would appear in the rightmost position it is omited. The pure zero is
-- always represented as 0. If the desired number of digits may be
-- provided in the fixed-point format then the exponent part is not
-- used. For example, 1.234567e-04 gives 0.0001234567 because fixed- and
-- floating-point formats have the same length. But 1.234567e-05 will be
-- shown in the floating-point format. For bases 15 and 16 the exponent
-- part is separated from the mantissa by space (to avoid ambiguity:
-- F.Ee+2 is F.EE + 2 or F.E * 16**2?). The parameter Field defines the
-- output size. If it has the value zero, then the output field is equal
-- to the output length.
--
-- When the parameter Field is not zero then Justify specifies alignment
-- and Fill is the character used for filling. When Field is greater
-- than Destination'Last - Pointer + 1, the latter is used instead.
-- After successful completion Pointer is advanced to the first
-- character following the output or to Destination'Last + 1.
--
-- Exceptions:
--
-- Layout_Error -- Pointer is not in Destination'Range or there is
-- no room for the output.
--
procedure Put
( Destination : in out String;
Pointer : in out Integer;
Value : in Number'Base;
Base : in NumberBase := 10;
PutPlus : in Boolean := False;
RelSmall : in Positive := MaxSmall;
AbsSmall : in Integer := -MaxSmall;
Field : in Natural := 0;
Justify : in Alignment := Left;
Fill : in Character := ' '
);
--
-- Image -- Floating-point to string conversion
--
-- Value - The value to be converted
-- Base - The base used for the output
-- PutPlus - The plus should placed for positive numbers
-- RelSmall - Relative precision of the output
-- AbsSmall - Absolute one
--
-- This procedure converts the parameter Value to String. The parameter
-- Base indicates the number base used for the output. Base itself does
-- not appear in the output. The exponent part (if used) is always
-- decimal. PutPlus indicates whether the plus sign should be placed if
-- the number is positive. For precision parameters see Put.
--
-- Returns :
--
-- The result string
--
function Image
( Value : in Number'Base;
Base : in NumberBase := 10;
PutPlus : in Boolean := False;
RelSmall : in Positive := MaxSmall;
AbsSmall : in Integer := -MaxSmall
) return String;
end Strings_Edit.Float_Edit;
|
-- ___ _ ___ _ _ --
-- / __| |/ (_) | | Common SKilL implementation --
-- \__ \ ' <| | | |__ unknown base pools --
-- |___/_|\_\_|_|____| by: Timm Felden --
-- --
pragma Ada_2012;
with Ada.Unchecked_Conversion;
with Ada.Unchecked_Deallocation;
with Skill.Equals;
with Skill.Errors;
with Skill.Field_Declarations;
with Skill.Field_Types;
with Skill.Field_Types.Builtin;
with Skill.Files;
with Skill.Internal.File_Parsers;
with Skill.Internal.Parts;
with Skill.Streams;
with Skill.String_Pools;
with Skill.Types.Pools;
with Skill.Types;
with Skill.Containers.Vectors;
-- instantiated pool packages
-- GNAT Bug workaround; should be "new Base(...)" instead
package body Skill.Types.Pools.Sub is
-- API methods
function Get (This : access Pool_T; ID : Skill_ID_T) return P is
begin
if 0 = ID then
return null;
else
return To_P (This.Base.Data (ID));
end if;
end Get;
overriding function Make_Boxed_Instance (This : access Pool_T) return Box is
begin
raise Constraint_Error
with "one must not reflectively allocate an instance of an unknown type!";
return null;
end Make_Boxed_Instance;
----------------------
-- internal methods --
----------------------
-- constructor invoked by new_pool
function Make
(Super : Skill.Types.Pools.Pool;
Type_Id : Natural;
Name : String_Access) return Pools.Pool
is
function Convert is new Ada.Unchecked_Conversion
(Source => Pool,
Target => Skill.Types.Pools.Sub_Pool);
function Convert is new Ada.Unchecked_Conversion
(Source => Pool,
Target => Skill.Types.Pools.Pool);
This : Pool;
begin
This :=
new Pool_T'
(Name => Name,
Type_Id => Type_Id,
Super => Super,
Base => Super.Base,
Sub_Pools => Sub_Pool_Vector_P.Empty_Vector,
Next => null, -- can only be calculated after all types are known
Super_Type_Count => 1 + Super.Super_Type_Count,
Data_Fields_F =>
Skill.Field_Declarations.Field_Vector_P.Empty_Vector,
Known_Fields => No_Known_Fields,
Blocks => Skill.Internal.Parts.Blocks_P.Empty_Vector,
Cached_Size => 0,
Static_Data_Instances => 0,
New_Objects => New_Objects_P.Empty_Vector,
others => <>);
This.Super.Sub_Pools.Append (Convert (This));
return Convert (This);
exception
when E : others =>
raise Skill.Errors.Skill_Error
with "Generic sub pool allocation failed";
end Make;
procedure Free (This : access Pool_T) is
procedure Delete (This : Skill.Field_Declarations.Field_Declaration) is
begin
This.Free;
end Delete;
type P is access all Pool_T;
procedure Delete is new Ada.Unchecked_Deallocation (Pool_T, P);
D : P := P (This);
begin
This.Sub_Pools.Free;
This.Data_Fields_F.Foreach (Delete'Access);
This.Data_Fields_F.Free;
This.Blocks.Free;
This.Book.Free;
This.New_Objects.Free;
Delete (D);
end Free;
function Add_Field
(This : access Pool_T;
ID : Natural;
T : Field_Types.Field_Type;
Name : String_Access;
Restrictions : Field_Restrictions.Vector)
return Skill.Field_Declarations.Field_Declaration
is
type Super is access all Sub_Pool_T;
begin
return Super (This).Add_Field (ID, T, Name, Restrictions);
end Add_Field;
overriding procedure Resize_Pool (This : access Pool_T) is
ID : Skill_ID_T := 1 + Skill_ID_T (This.Blocks.Last_Element.BPO);
Size : Skill_ID_T := This.Blocks.Last_Element.Static_Count;
Data : Skill.Types.Annotation_Array := This.Base.Data;
SD : Book_P.Page;
R : P;
use Interfaces;
begin
This.Static_Data_Instances := This.Static_Data_Instances + Size;
if 0 = Size then
return;
end if;
SD := This.Book.Make_Page (Size);
-- set skill IDs and insert into data
for I in SD'Range loop
R := SD (I)'Access;
R.Skill_ID := ID;
Data (ID) := R.To_Annotation;
ID := ID + 1;
end loop;
end Resize_Pool;
function Offset_Box
(This : access Pool_T;
Target : Types.Box) return Types.v64
is
begin
if null = Unboxed (Target) then
return 1;
else
return Field_Types.Builtin.Offset_Single_V64
(Types.v64 (Unboxed (Target).Skill_ID));
end if;
end Offset_Box;
procedure Write_Box
(This : access Pool_T;
Output : Streams.Writer.Sub_Stream;
Target : Types.Box)
is
begin
if null = Unboxed (Target) then
Output.I8 (0);
else
Output.V64 (Types.v64 (Unboxed (Target).Skill_ID));
end if;
end Write_Box;
end Skill.Types.Pools.Sub;
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, Vadim Godunko <vgodunko@gmail.com> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
with AMF.Generic_Collections;
package AMF.UML.Events.Collections is
pragma Preelaborate;
package UML_Event_Collections is
new AMF.Generic_Collections
(UML_Event,
UML_Event_Access);
type Set_Of_UML_Event is
new UML_Event_Collections.Set with null record;
Empty_Set_Of_UML_Event : constant Set_Of_UML_Event;
type Ordered_Set_Of_UML_Event is
new UML_Event_Collections.Ordered_Set with null record;
Empty_Ordered_Set_Of_UML_Event : constant Ordered_Set_Of_UML_Event;
type Bag_Of_UML_Event is
new UML_Event_Collections.Bag with null record;
Empty_Bag_Of_UML_Event : constant Bag_Of_UML_Event;
type Sequence_Of_UML_Event is
new UML_Event_Collections.Sequence with null record;
Empty_Sequence_Of_UML_Event : constant Sequence_Of_UML_Event;
private
Empty_Set_Of_UML_Event : constant Set_Of_UML_Event
:= (UML_Event_Collections.Set with null record);
Empty_Ordered_Set_Of_UML_Event : constant Ordered_Set_Of_UML_Event
:= (UML_Event_Collections.Ordered_Set with null record);
Empty_Bag_Of_UML_Event : constant Bag_Of_UML_Event
:= (UML_Event_Collections.Bag with null record);
Empty_Sequence_Of_UML_Event : constant Sequence_Of_UML_Event
:= (UML_Event_Collections.Sequence with null record);
end AMF.UML.Events.Collections;
|
with Ada.Directories; use Ada.Directories;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- ADA.NUMERICS.GENERIC_COMPLEX.ELEMENTARY_FUNCTIONS --
-- --
-- S p e c --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. In accordance with the copyright of that document, you can freely --
-- copy and modify this specification, provided that if you redistribute a --
-- modified version, any changes that you have made are clearly indicated. --
-- --
------------------------------------------------------------------------------
with Ada.Numerics.Complex_Types;
with Ada.Numerics.Generic_Complex_Elementary_Functions;
package Ada.Numerics.Complex_Elementary_Functions is
new Ada.Numerics.Generic_Complex_Elementary_Functions
(Ada.Numerics.Complex_Types);
pragma Pure (Ada.Numerics.Complex_Elementary_Functions);
|
------------------------------------------------------------------------------
-- --
-- GNAT EXAMPLE --
-- --
-- Copyright (C) 2014, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with Ada.Real_Time; use Ada.Real_Time;
with Screen_Interface;
with Railroad;
package body Driver is
----------------
-- Controller --
----------------
task body Controller is
Period : constant Time_Span := Milliseconds (60);
-- arbitrary, but directly affects how fast the trains move
-- and how quickly the screen responds to touch
Next_Start : Time := Clock + Seconds (1);
Current : Screen_Interface.Touch_State;
Previous : Screen_Interface.Touch_State;
begin
delay until Next_Start;
Screen_Interface.Initialize;
Railroad.Initialize;
Current := Screen_Interface.Get_Touch_State;
Previous := Current;
loop
Current := Screen_Interface.Get_Touch_State;
if Current.Touch_Detected /= Previous.Touch_Detected then
if Current.Touch_Detected then
Railroad.On_Touch ((Current.X, Current.Y));
end if;
Previous := Current;
end if;
Railroad.Simulation_Step;
Railroad.Draw;
Next_Start := Next_Start + Period;
delay until Next_Start;
end loop;
end Controller;
end Driver;
|
------------------------------------------------------------------------------
-- Copyright (c) 2019, 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. --
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- Natools.Web.Simple_Pages.Dynamic_Multipages extends the multipage idea --
-- by allowing the generation of new pages through a POST request. --
-- Note that there was not enough code to share with the package --
-- Natools.Web.Simple_Pages.Multipages, so while inheriting conceptually --
-- from it, this package is completely independent. --
------------------------------------------------------------------------------
with Natools.S_Expressions;
with Natools.S_Expressions.Atom_Refs;
with Natools.S_Expressions.Lockable;
with Natools.Web.Containers;
with Natools.Web.Sites;
with Natools.Web.Tags;
private with Natools.Constant_Indefinite_Ordered_Maps;
private with Natools.References;
private with Natools.S_Expressions.Caches;
private with Natools.Storage_Pools;
package Natools.Web.Simple_Pages.Dynamic_Multipages is
type Page_Descriptor is record
Name : S_Expressions.Atom_Refs.Immutable_Reference;
Elements : Containers.Expression_Maps.Constant_Map;
Tags : Web.Tags.Tag_List;
Dates : Containers.Date_Maps.Constant_Map;
end record;
type Generator is interface;
procedure Respond
(Object : in out Generator;
Exchange : in out Sites.Exchange;
Extra_Path : in S_Expressions.Atom;
Descriptor : out Page_Descriptor;
Do_Post : out Boolean)
is abstract;
-- Handle the given HTTP exchange, filling in Descriptor and Do_Post
-- to add a new page to the multipage set.
type Generator_Constructor is not null access function
(Arguments : in out S_Expressions.Lockable.Descriptor'Class)
return Generator'Class;
procedure Register
(Name : in String;
Constructor : in Generator_Constructor);
type Adder is new Sites.Page with private;
overriding procedure Respond
(Object : in out Adder;
Exchange : in out Sites.Exchange;
Extra_Path : in S_Expressions.Atom);
type Loader is new Sites.Page_Loader with private;
overriding procedure Load
(Object : in out Loader;
Builder : in out Sites.Site_Builder;
Path : in S_Expressions.Atom);
function Create (File : in S_Expressions.Atom)
return Sites.Page_Loader'Class;
private
package Generator_Refs is new References
(Generator'Class,
Storage_Pools.Access_In_Default_Pool'Storage_Pool,
Storage_Pools.Access_In_Default_Pool'Storage_Pool);
type Default_Data is record
File_Path : S_Expressions.Atom_Refs.Immutable_Reference;
Web_Path : S_Expressions.Atom_Refs.Immutable_Reference;
Template : Page_Template;
Generator : Generator_Refs.Reference;
Generator_Path : S_Expressions.Atom_Refs.Immutable_Reference;
end record;
package Default_Data_Refs is new References
(Default_Data,
Storage_Pools.Access_In_Default_Pool'Storage_Pool,
Storage_Pools.Access_In_Default_Pool'Storage_Pool);
type Adder is new Sites.Page with record
Ref : Default_Data_Refs.Reference;
end record;
type Loader is new Sites.Page_Loader with record
File_Path : S_Expressions.Atom_Refs.Immutable_Reference;
end record;
package Constructor_Maps is new Constant_Indefinite_Ordered_Maps
(S_Expressions.Atom, Generator_Constructor, S_Expressions.Less_Than);
Constructor_DB : Constructor_Maps.Constant_Map;
end Natools.Web.Simple_Pages.Dynamic_Multipages;
|
-- This spec has been automatically generated from STM32L4x1.svd
pragma Restrictions (No_Elaboration_Code);
pragma Ada_2012;
pragma Style_Checks (Off);
with HAL;
with System;
package STM32_SVD.USART is
pragma Preelaborate;
---------------
-- Registers --
---------------
-- CR1_DEDT array
type CR1_DEDT_Field_Array is array (0 .. 4) of Boolean
with Component_Size => 1, Size => 5;
-- Type definition for CR1_DEDT
type CR1_DEDT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- DEDT as a value
Val : HAL.UInt5;
when True =>
-- DEDT as an array
Arr : CR1_DEDT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 5;
for CR1_DEDT_Field use record
Val at 0 range 0 .. 4;
Arr at 0 range 0 .. 4;
end record;
-- CR1_DEAT array
type CR1_DEAT_Field_Array is array (0 .. 4) of Boolean
with Component_Size => 1, Size => 5;
-- Type definition for CR1_DEAT
type CR1_DEAT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- DEAT as a value
Val : HAL.UInt5;
when True =>
-- DEAT as an array
Arr : CR1_DEAT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 5;
for CR1_DEAT_Field use record
Val at 0 range 0 .. 4;
Arr at 0 range 0 .. 4;
end record;
-- Control register 1
type CR1_Register is record
-- USART enable
UE : Boolean := False;
-- USART enable in Stop mode
UESM : Boolean := False;
-- Receiver enable
RE : Boolean := False;
-- Transmitter enable
TE : Boolean := False;
-- IDLE interrupt enable
IDLEIE : Boolean := False;
-- RXNE interrupt enable
RXNEIE : Boolean := False;
-- Transmission complete interrupt enable
TCIE : Boolean := False;
-- interrupt enable
TXEIE : Boolean := False;
-- PE interrupt enable
PEIE : Boolean := False;
-- Parity selection
PS : Boolean := False;
-- Parity control enable
PCE : Boolean := False;
-- Receiver wakeup method
WAKE : Boolean := False;
-- Word length
M0 : Boolean := False;
-- Mute mode enable
MME : Boolean := False;
-- Character match interrupt enable
CMIE : Boolean := False;
-- unspecified
Reserved_15_15 : HAL.Bit := 16#0#;
-- DEDT0
DEDT : CR1_DEDT_Field := (As_Array => False, Val => 16#0#);
-- DEAT0
DEAT : CR1_DEAT_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_26_27 : HAL.UInt2 := 16#0#;
-- Word length
M1 : Boolean := False;
-- unspecified
Reserved_29_31 : HAL.UInt3 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CR1_Register use record
UE at 0 range 0 .. 0;
UESM at 0 range 1 .. 1;
RE at 0 range 2 .. 2;
TE at 0 range 3 .. 3;
IDLEIE at 0 range 4 .. 4;
RXNEIE at 0 range 5 .. 5;
TCIE at 0 range 6 .. 6;
TXEIE at 0 range 7 .. 7;
PEIE at 0 range 8 .. 8;
PS at 0 range 9 .. 9;
PCE at 0 range 10 .. 10;
WAKE at 0 range 11 .. 11;
M0 at 0 range 12 .. 12;
MME at 0 range 13 .. 13;
CMIE at 0 range 14 .. 14;
Reserved_15_15 at 0 range 15 .. 15;
DEDT at 0 range 16 .. 20;
DEAT at 0 range 21 .. 25;
Reserved_26_27 at 0 range 26 .. 27;
M1 at 0 range 28 .. 28;
Reserved_29_31 at 0 range 29 .. 31;
end record;
subtype CR2_STOP_Field is HAL.UInt2;
subtype CR2_ADD0_3_Field is HAL.UInt4;
subtype CR2_ADD4_7_Field is HAL.UInt4;
-- Control register 2
type CR2_Register is record
-- unspecified
Reserved_0_3 : HAL.UInt4 := 16#0#;
-- 7-bit Address Detection/4-bit Address Detection
ADDM7 : Boolean := False;
-- unspecified
Reserved_5_10 : HAL.UInt6 := 16#0#;
-- Clock enable
CLKEN : Boolean := False;
-- STOP bits
STOP : CR2_STOP_Field := 16#0#;
-- unspecified
Reserved_14_14 : HAL.Bit := 16#0#;
-- Swap TX/RX pins
SWAP : Boolean := False;
-- RX pin active level inversion
RXINV : Boolean := False;
-- TX pin active level inversion
TXINV : Boolean := False;
-- Binary data inversion
TAINV : Boolean := False;
-- Most significant bit first
MSBFIRST : Boolean := False;
-- unspecified
Reserved_20_23 : HAL.UInt4 := 16#0#;
-- Address of the USART node
ADD0_3 : CR2_ADD0_3_Field := 16#0#;
-- Address of the USART node
ADD4_7 : CR2_ADD4_7_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CR2_Register use record
Reserved_0_3 at 0 range 0 .. 3;
ADDM7 at 0 range 4 .. 4;
Reserved_5_10 at 0 range 5 .. 10;
CLKEN at 0 range 11 .. 11;
STOP at 0 range 12 .. 13;
Reserved_14_14 at 0 range 14 .. 14;
SWAP at 0 range 15 .. 15;
RXINV at 0 range 16 .. 16;
TXINV at 0 range 17 .. 17;
TAINV at 0 range 18 .. 18;
MSBFIRST at 0 range 19 .. 19;
Reserved_20_23 at 0 range 20 .. 23;
ADD0_3 at 0 range 24 .. 27;
ADD4_7 at 0 range 28 .. 31;
end record;
subtype CR3_WUS_Field is HAL.UInt2;
-- Control register 3
type CR3_Register is record
-- Error interrupt enable
EIE : Boolean := False;
-- unspecified
Reserved_1_2 : HAL.UInt2 := 16#0#;
-- Half-duplex selection
HDSEL : Boolean := False;
-- unspecified
Reserved_4_5 : HAL.UInt2 := 16#0#;
-- DMA enable receiver
DMAR : Boolean := False;
-- DMA enable transmitter
DMAT : Boolean := False;
-- RTS enable
RTSE : Boolean := False;
-- CTS enable
CTSE : Boolean := False;
-- CTS interrupt enable
CTSIE : Boolean := False;
-- unspecified
Reserved_11_11 : HAL.Bit := 16#0#;
-- Overrun Disable
OVRDIS : Boolean := False;
-- DMA Disable on Reception Error
DDRE : Boolean := False;
-- Driver enable mode
DEM : Boolean := False;
-- Driver enable polarity selection
DEP : Boolean := False;
-- unspecified
Reserved_16_19 : HAL.UInt4 := 16#0#;
-- Wakeup from Stop mode interrupt flag selection
WUS : CR3_WUS_Field := 16#0#;
-- Wakeup from Stop mode interrupt enable
WUFIE : Boolean := False;
-- unspecified
Reserved_23_31 : HAL.UInt9 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CR3_Register use record
EIE at 0 range 0 .. 0;
Reserved_1_2 at 0 range 1 .. 2;
HDSEL at 0 range 3 .. 3;
Reserved_4_5 at 0 range 4 .. 5;
DMAR at 0 range 6 .. 6;
DMAT at 0 range 7 .. 7;
RTSE at 0 range 8 .. 8;
CTSE at 0 range 9 .. 9;
CTSIE at 0 range 10 .. 10;
Reserved_11_11 at 0 range 11 .. 11;
OVRDIS at 0 range 12 .. 12;
DDRE at 0 range 13 .. 13;
DEM at 0 range 14 .. 14;
DEP at 0 range 15 .. 15;
Reserved_16_19 at 0 range 16 .. 19;
WUS at 0 range 20 .. 21;
WUFIE at 0 range 22 .. 22;
Reserved_23_31 at 0 range 23 .. 31;
end record;
subtype BRR_BRR_Field is HAL.UInt20;
-- Baud rate register
type BRR_Register is record
-- BRR
BRR : BRR_BRR_Field := 16#0#;
-- unspecified
Reserved_20_31 : HAL.UInt12 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for BRR_Register use record
BRR at 0 range 0 .. 19;
Reserved_20_31 at 0 range 20 .. 31;
end record;
-- Request register
type RQR_Register is record
-- unspecified
Reserved_0_0 : HAL.Bit := 16#0#;
-- Write-only. Send break request
SBKRQ : Boolean := False;
-- Write-only. Mute mode request
MMRQ : Boolean := False;
-- Write-only. Receive data flush request
RXFRQ : Boolean := False;
-- unspecified
Reserved_4_31 : HAL.UInt28 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for RQR_Register use record
Reserved_0_0 at 0 range 0 .. 0;
SBKRQ at 0 range 1 .. 1;
MMRQ at 0 range 2 .. 2;
RXFRQ at 0 range 3 .. 3;
Reserved_4_31 at 0 range 4 .. 31;
end record;
-- Interrupt & status register
type ISR_Register is record
-- Read-only. PE
PE : Boolean;
-- Read-only. FE
FE : Boolean;
-- Read-only. NF
NF : Boolean;
-- Read-only. ORE
ORE : Boolean;
-- Read-only. IDLE
IDLE : Boolean;
-- Read-only. RXNE
RXNE : Boolean;
-- Read-only. TC
TC : Boolean;
-- Read-only. TXE
TXE : Boolean;
-- unspecified
Reserved_8_8 : HAL.Bit;
-- Read-only. CTSIF
CTSIF : Boolean;
-- Read-only. CTS
CTS : Boolean;
-- unspecified
Reserved_11_15 : HAL.UInt5;
-- Read-only. BUSY
BUSY : Boolean;
-- Read-only. CMF
CMF : Boolean;
-- Read-only. SBKF
SBKF : Boolean;
-- Read-only. RWU
RWU : Boolean;
-- Read-only. WUF
WUF : Boolean;
-- Read-only. TEACK
TEACK : Boolean;
-- Read-only. REACK
REACK : Boolean;
-- unspecified
Reserved_23_31 : HAL.UInt9;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for ISR_Register use record
PE at 0 range 0 .. 0;
FE at 0 range 1 .. 1;
NF at 0 range 2 .. 2;
ORE at 0 range 3 .. 3;
IDLE at 0 range 4 .. 4;
RXNE at 0 range 5 .. 5;
TC at 0 range 6 .. 6;
TXE at 0 range 7 .. 7;
Reserved_8_8 at 0 range 8 .. 8;
CTSIF at 0 range 9 .. 9;
CTS at 0 range 10 .. 10;
Reserved_11_15 at 0 range 11 .. 15;
BUSY at 0 range 16 .. 16;
CMF at 0 range 17 .. 17;
SBKF at 0 range 18 .. 18;
RWU at 0 range 19 .. 19;
WUF at 0 range 20 .. 20;
TEACK at 0 range 21 .. 21;
REACK at 0 range 22 .. 22;
Reserved_23_31 at 0 range 23 .. 31;
end record;
-- Interrupt flag clear register
type ICR_Register is record
-- Write-only. Parity error clear flag
PECF : Boolean := False;
-- Write-only. Framing error clear flag
FECF : Boolean := False;
-- Write-only. Noise detected clear flag
NCF : Boolean := False;
-- Write-only. Overrun error clear flag
ORECF : Boolean := False;
-- Write-only. Idle line detected clear flag
IDLECF : Boolean := False;
-- unspecified
Reserved_5_5 : HAL.Bit := 16#0#;
-- Write-only. Transmission complete clear flag
TCCF : Boolean := False;
-- unspecified
Reserved_7_8 : HAL.UInt2 := 16#0#;
-- Write-only. CTS clear flag
CTSCF : Boolean := False;
-- unspecified
Reserved_10_16 : HAL.UInt7 := 16#0#;
-- Write-only. Character match clear flag
CMCF : Boolean := False;
-- unspecified
Reserved_18_19 : HAL.UInt2 := 16#0#;
-- Write-only. Wakeup from Stop mode clear flag
WUCF : Boolean := False;
-- unspecified
Reserved_21_31 : HAL.UInt11 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for ICR_Register use record
PECF at 0 range 0 .. 0;
FECF at 0 range 1 .. 1;
NCF at 0 range 2 .. 2;
ORECF at 0 range 3 .. 3;
IDLECF at 0 range 4 .. 4;
Reserved_5_5 at 0 range 5 .. 5;
TCCF at 0 range 6 .. 6;
Reserved_7_8 at 0 range 7 .. 8;
CTSCF at 0 range 9 .. 9;
Reserved_10_16 at 0 range 10 .. 16;
CMCF at 0 range 17 .. 17;
Reserved_18_19 at 0 range 18 .. 19;
WUCF at 0 range 20 .. 20;
Reserved_21_31 at 0 range 21 .. 31;
end record;
subtype RDR_RDR_Field is HAL.UInt9;
-- Receive data register
type RDR_Register is record
-- Read-only. Receive data value
RDR : RDR_RDR_Field;
-- unspecified
Reserved_9_31 : HAL.UInt23;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for RDR_Register use record
RDR at 0 range 0 .. 8;
Reserved_9_31 at 0 range 9 .. 31;
end record;
subtype TDR_TDR_Field is HAL.UInt9;
-- Transmit data register
type TDR_Register is record
-- Transmit data value
TDR : TDR_TDR_Field := 16#0#;
-- unspecified
Reserved_9_31 : HAL.UInt23 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for TDR_Register use record
TDR at 0 range 0 .. 8;
Reserved_9_31 at 0 range 9 .. 31;
end record;
-- Control register 1
type CR1_Register_1 is record
-- USART enable
UE : Boolean := False;
-- USART enable in Stop mode
UESM : Boolean := False;
-- Receiver enable
RE : Boolean := False;
-- Transmitter enable
TE : Boolean := False;
-- IDLE interrupt enable
IDLEIE : Boolean := False;
-- RXNE interrupt enable
RXNEIE : Boolean := False;
-- Transmission complete interrupt enable
TCIE : Boolean := False;
-- interrupt enable
TXEIE : Boolean := False;
-- PE interrupt enable
PEIE : Boolean := False;
-- Parity selection
PS : Boolean := False;
-- Parity control enable
PCE : Boolean := False;
-- Receiver wakeup method
WAKE : Boolean := False;
-- Word length
M0 : Boolean := False;
-- Mute mode enable
MME : Boolean := False;
-- Character match interrupt enable
CMIE : Boolean := False;
-- Oversampling mode
OVER8 : Boolean := False;
-- DEDT0
DEDT : CR1_DEDT_Field := (As_Array => False, Val => 16#0#);
-- DEAT0
DEAT : CR1_DEAT_Field := (As_Array => False, Val => 16#0#);
-- Receiver timeout interrupt enable
RTOIE : Boolean := False;
-- End of Block interrupt enable
EOBIE : Boolean := False;
-- Word length
M1 : Boolean := False;
-- unspecified
Reserved_29_31 : HAL.UInt3 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CR1_Register_1 use record
UE at 0 range 0 .. 0;
UESM at 0 range 1 .. 1;
RE at 0 range 2 .. 2;
TE at 0 range 3 .. 3;
IDLEIE at 0 range 4 .. 4;
RXNEIE at 0 range 5 .. 5;
TCIE at 0 range 6 .. 6;
TXEIE at 0 range 7 .. 7;
PEIE at 0 range 8 .. 8;
PS at 0 range 9 .. 9;
PCE at 0 range 10 .. 10;
WAKE at 0 range 11 .. 11;
M0 at 0 range 12 .. 12;
MME at 0 range 13 .. 13;
CMIE at 0 range 14 .. 14;
OVER8 at 0 range 15 .. 15;
DEDT at 0 range 16 .. 20;
DEAT at 0 range 21 .. 25;
RTOIE at 0 range 26 .. 26;
EOBIE at 0 range 27 .. 27;
M1 at 0 range 28 .. 28;
Reserved_29_31 at 0 range 29 .. 31;
end record;
-- CR2_ABRMOD array
type CR2_ABRMOD_Field_Array is array (0 .. 1) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for CR2_ABRMOD
type CR2_ABRMOD_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- ABRMOD as a value
Val : HAL.UInt2;
when True =>
-- ABRMOD as an array
Arr : CR2_ABRMOD_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for CR2_ABRMOD_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- Control register 2
type CR2_Register_1 is record
-- unspecified
Reserved_0_3 : HAL.UInt4 := 16#0#;
-- 7-bit Address Detection/4-bit Address Detection
ADDM7 : Boolean := False;
-- LIN break detection length
LBDL : Boolean := False;
-- LIN break detection interrupt enable
LBDIE : Boolean := False;
-- unspecified
Reserved_7_7 : HAL.Bit := 16#0#;
-- Last bit clock pulse
LBCL : Boolean := False;
-- Clock phase
CPHA : Boolean := False;
-- Clock polarity
CPOL : Boolean := False;
-- Clock enable
CLKEN : Boolean := False;
-- STOP bits
STOP : CR2_STOP_Field := 16#0#;
-- LIN mode enable
LINEN : Boolean := False;
-- Swap TX/RX pins
SWAP : Boolean := False;
-- RX pin active level inversion
RXINV : Boolean := False;
-- TX pin active level inversion
TXINV : Boolean := False;
-- Binary data inversion
TAINV : Boolean := False;
-- Most significant bit first
MSBFIRST : Boolean := False;
-- Auto baud rate enable
ABREN : Boolean := False;
-- ABRMOD0
ABRMOD : CR2_ABRMOD_Field := (As_Array => False, Val => 16#0#);
-- Receiver timeout enable
RTOEN : Boolean := False;
-- Address of the USART node
ADD0_3 : CR2_ADD0_3_Field := 16#0#;
-- Address of the USART node
ADD4_7 : CR2_ADD4_7_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CR2_Register_1 use record
Reserved_0_3 at 0 range 0 .. 3;
ADDM7 at 0 range 4 .. 4;
LBDL at 0 range 5 .. 5;
LBDIE at 0 range 6 .. 6;
Reserved_7_7 at 0 range 7 .. 7;
LBCL at 0 range 8 .. 8;
CPHA at 0 range 9 .. 9;
CPOL at 0 range 10 .. 10;
CLKEN at 0 range 11 .. 11;
STOP at 0 range 12 .. 13;
LINEN at 0 range 14 .. 14;
SWAP at 0 range 15 .. 15;
RXINV at 0 range 16 .. 16;
TXINV at 0 range 17 .. 17;
TAINV at 0 range 18 .. 18;
MSBFIRST at 0 range 19 .. 19;
ABREN at 0 range 20 .. 20;
ABRMOD at 0 range 21 .. 22;
RTOEN at 0 range 23 .. 23;
ADD0_3 at 0 range 24 .. 27;
ADD4_7 at 0 range 28 .. 31;
end record;
subtype CR3_SCARCNT_Field is HAL.UInt3;
-- Control register 3
type CR3_Register_1 is record
-- Error interrupt enable
EIE : Boolean := False;
-- Ir mode enable
IREN : Boolean := False;
-- Ir low-power
IRLP : Boolean := False;
-- Half-duplex selection
HDSEL : Boolean := False;
-- Smartcard NACK enable
NACK : Boolean := False;
-- Smartcard mode enable
SCEN : Boolean := False;
-- DMA enable receiver
DMAR : Boolean := False;
-- DMA enable transmitter
DMAT : Boolean := False;
-- RTS enable
RTSE : Boolean := False;
-- CTS enable
CTSE : Boolean := False;
-- CTS interrupt enable
CTSIE : Boolean := False;
-- One sample bit method enable
ONEBIT : Boolean := False;
-- Overrun Disable
OVRDIS : Boolean := False;
-- DMA Disable on Reception Error
DDRE : Boolean := False;
-- Driver enable mode
DEM : Boolean := False;
-- Driver enable polarity selection
DEP : Boolean := False;
-- unspecified
Reserved_16_16 : HAL.Bit := 16#0#;
-- Smartcard auto-retry count
SCARCNT : CR3_SCARCNT_Field := 16#0#;
-- Wakeup from Stop mode interrupt flag selection
WUS : CR3_WUS_Field := 16#0#;
-- Wakeup from Stop mode interrupt enable
WUFIE : Boolean := False;
-- unspecified
Reserved_23_31 : HAL.UInt9 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CR3_Register_1 use record
EIE at 0 range 0 .. 0;
IREN at 0 range 1 .. 1;
IRLP at 0 range 2 .. 2;
HDSEL at 0 range 3 .. 3;
NACK at 0 range 4 .. 4;
SCEN at 0 range 5 .. 5;
DMAR at 0 range 6 .. 6;
DMAT at 0 range 7 .. 7;
RTSE at 0 range 8 .. 8;
CTSE at 0 range 9 .. 9;
CTSIE at 0 range 10 .. 10;
ONEBIT at 0 range 11 .. 11;
OVRDIS at 0 range 12 .. 12;
DDRE at 0 range 13 .. 13;
DEM at 0 range 14 .. 14;
DEP at 0 range 15 .. 15;
Reserved_16_16 at 0 range 16 .. 16;
SCARCNT at 0 range 17 .. 19;
WUS at 0 range 20 .. 21;
WUFIE at 0 range 22 .. 22;
Reserved_23_31 at 0 range 23 .. 31;
end record;
subtype BRR_DIV_Fraction_Field is HAL.UInt4;
subtype BRR_DIV_Mantissa_Field is HAL.UInt12;
-- Baud rate register
type BRR_Register_1 is record
-- DIV_Fraction
DIV_Fraction : BRR_DIV_Fraction_Field := 16#0#;
-- DIV_Mantissa
DIV_Mantissa : BRR_DIV_Mantissa_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for BRR_Register_1 use record
DIV_Fraction at 0 range 0 .. 3;
DIV_Mantissa at 0 range 4 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype GTPR_PSC_Field is HAL.UInt8;
subtype GTPR_GT_Field is HAL.UInt8;
-- Guard time and prescaler register
type GTPR_Register is record
-- Prescaler value
PSC : GTPR_PSC_Field := 16#0#;
-- Guard time value
GT : GTPR_GT_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for GTPR_Register use record
PSC at 0 range 0 .. 7;
GT at 0 range 8 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype RTOR_RTO_Field is HAL.UInt24;
subtype RTOR_BLEN_Field is HAL.UInt8;
-- Receiver timeout register
type RTOR_Register is record
-- Receiver timeout value
RTO : RTOR_RTO_Field := 16#0#;
-- Block Length
BLEN : RTOR_BLEN_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for RTOR_Register use record
RTO at 0 range 0 .. 23;
BLEN at 0 range 24 .. 31;
end record;
-- Request register
type RQR_Register_1 is record
-- Write-only. Auto baud rate request
ABRRQ : Boolean := False;
-- Write-only. Send break request
SBKRQ : Boolean := False;
-- Write-only. Mute mode request
MMRQ : Boolean := False;
-- Write-only. Receive data flush request
RXFRQ : Boolean := False;
-- Write-only. Transmit data flush request
TXFRQ : Boolean := False;
-- unspecified
Reserved_5_31 : HAL.UInt27 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for RQR_Register_1 use record
ABRRQ at 0 range 0 .. 0;
SBKRQ at 0 range 1 .. 1;
MMRQ at 0 range 2 .. 2;
RXFRQ at 0 range 3 .. 3;
TXFRQ at 0 range 4 .. 4;
Reserved_5_31 at 0 range 5 .. 31;
end record;
-- Interrupt & status register
type ISR_Register_1 is record
-- Read-only. PE
PE : Boolean;
-- Read-only. FE
FE : Boolean;
-- Read-only. NF
NF : Boolean;
-- Read-only. ORE
ORE : Boolean;
-- Read-only. IDLE
IDLE : Boolean;
-- Read-only. RXNE
RXNE : Boolean;
-- Read-only. TC
TC : Boolean;
-- Read-only. TXE
TXE : Boolean;
-- Read-only. LBDF
LBDF : Boolean;
-- Read-only. CTSIF
CTSIF : Boolean;
-- Read-only. CTS
CTS : Boolean;
-- Read-only. RTOF
RTOF : Boolean;
-- Read-only. EOBF
EOBF : Boolean;
-- unspecified
Reserved_13_13 : HAL.Bit;
-- Read-only. ABRE
ABRE : Boolean;
-- Read-only. ABRF
ABRF : Boolean;
-- Read-only. BUSY
BUSY : Boolean;
-- Read-only. CMF
CMF : Boolean;
-- Read-only. SBKF
SBKF : Boolean;
-- Read-only. RWU
RWU : Boolean;
-- Read-only. WUF
WUF : Boolean;
-- Read-only. TEACK
TEACK : Boolean;
-- Read-only. REACK
REACK : Boolean;
-- unspecified
Reserved_23_31 : HAL.UInt9;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for ISR_Register_1 use record
PE at 0 range 0 .. 0;
FE at 0 range 1 .. 1;
NF at 0 range 2 .. 2;
ORE at 0 range 3 .. 3;
IDLE at 0 range 4 .. 4;
RXNE at 0 range 5 .. 5;
TC at 0 range 6 .. 6;
TXE at 0 range 7 .. 7;
LBDF at 0 range 8 .. 8;
CTSIF at 0 range 9 .. 9;
CTS at 0 range 10 .. 10;
RTOF at 0 range 11 .. 11;
EOBF at 0 range 12 .. 12;
Reserved_13_13 at 0 range 13 .. 13;
ABRE at 0 range 14 .. 14;
ABRF at 0 range 15 .. 15;
BUSY at 0 range 16 .. 16;
CMF at 0 range 17 .. 17;
SBKF at 0 range 18 .. 18;
RWU at 0 range 19 .. 19;
WUF at 0 range 20 .. 20;
TEACK at 0 range 21 .. 21;
REACK at 0 range 22 .. 22;
Reserved_23_31 at 0 range 23 .. 31;
end record;
-- Interrupt flag clear register
type ICR_Register_1 is record
-- Write-only. Parity error clear flag
PECF : Boolean := False;
-- Write-only. Framing error clear flag
FECF : Boolean := False;
-- Write-only. Noise detected clear flag
NCF : Boolean := False;
-- Write-only. Overrun error clear flag
ORECF : Boolean := False;
-- Write-only. Idle line detected clear flag
IDLECF : Boolean := False;
-- unspecified
Reserved_5_5 : HAL.Bit := 16#0#;
-- Write-only. Transmission complete clear flag
TCCF : Boolean := False;
-- unspecified
Reserved_7_7 : HAL.Bit := 16#0#;
-- Write-only. LIN break detection clear flag
LBDCF : Boolean := False;
-- Write-only. CTS clear flag
CTSCF : Boolean := False;
-- unspecified
Reserved_10_10 : HAL.Bit := 16#0#;
-- Write-only. Receiver timeout clear flag
RTOCF : Boolean := False;
-- Write-only. End of block clear flag
EOBCF : Boolean := False;
-- unspecified
Reserved_13_16 : HAL.UInt4 := 16#0#;
-- Write-only. Character match clear flag
CMCF : Boolean := False;
-- unspecified
Reserved_18_19 : HAL.UInt2 := 16#0#;
-- Write-only. Wakeup from Stop mode clear flag
WUCF : Boolean := False;
-- unspecified
Reserved_21_31 : HAL.UInt11 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for ICR_Register_1 use record
PECF at 0 range 0 .. 0;
FECF at 0 range 1 .. 1;
NCF at 0 range 2 .. 2;
ORECF at 0 range 3 .. 3;
IDLECF at 0 range 4 .. 4;
Reserved_5_5 at 0 range 5 .. 5;
TCCF at 0 range 6 .. 6;
Reserved_7_7 at 0 range 7 .. 7;
LBDCF at 0 range 8 .. 8;
CTSCF at 0 range 9 .. 9;
Reserved_10_10 at 0 range 10 .. 10;
RTOCF at 0 range 11 .. 11;
EOBCF at 0 range 12 .. 12;
Reserved_13_16 at 0 range 13 .. 16;
CMCF at 0 range 17 .. 17;
Reserved_18_19 at 0 range 18 .. 19;
WUCF at 0 range 20 .. 20;
Reserved_21_31 at 0 range 21 .. 31;
end record;
-- Control register 3
type CR3_Register_2 is record
-- Error interrupt enable
EIE : Boolean := False;
-- Ir mode enable
IREN : Boolean := False;
-- Ir low-power
IRLP : Boolean := False;
-- Half-duplex selection
HDSEL : Boolean := False;
-- Smartcard NACK enable
NACK : Boolean := False;
-- Smartcard mode enable
SCEN : Boolean := False;
-- DMA enable receiver
DMAR : Boolean := False;
-- DMA enable transmitter
DMAT : Boolean := False;
-- RTS enable
RTSE : Boolean := False;
-- CTS enable
CTSE : Boolean := False;
-- CTS interrupt enable
CTSIE : Boolean := False;
-- One sample bit method enable
ONEBIT : Boolean := False;
-- Overrun Disable
OVRDIS : Boolean := False;
-- DMA Disable on Reception Error
DDRE : Boolean := False;
-- Driver enable mode
DEM : Boolean := False;
-- Driver enable polarity selection
DEP : Boolean := False;
-- unspecified
Reserved_16_16 : HAL.Bit := 16#0#;
-- Smartcard auto-retry count
SCARCNT : CR3_SCARCNT_Field := 16#0#;
-- Wakeup from Stop mode interrupt flag selection
WUS : CR3_WUS_Field := 16#0#;
-- Wakeup from Stop mode interrupt enable
WUFIE : Boolean := False;
-- USART Clock Enable in Stop mode
UCESM : Boolean := False;
-- Transmission complete before guard time interrupt enable
TCBGTIE : Boolean := False;
-- unspecified
Reserved_25_31 : HAL.UInt7 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CR3_Register_2 use record
EIE at 0 range 0 .. 0;
IREN at 0 range 1 .. 1;
IRLP at 0 range 2 .. 2;
HDSEL at 0 range 3 .. 3;
NACK at 0 range 4 .. 4;
SCEN at 0 range 5 .. 5;
DMAR at 0 range 6 .. 6;
DMAT at 0 range 7 .. 7;
RTSE at 0 range 8 .. 8;
CTSE at 0 range 9 .. 9;
CTSIE at 0 range 10 .. 10;
ONEBIT at 0 range 11 .. 11;
OVRDIS at 0 range 12 .. 12;
DDRE at 0 range 13 .. 13;
DEM at 0 range 14 .. 14;
DEP at 0 range 15 .. 15;
Reserved_16_16 at 0 range 16 .. 16;
SCARCNT at 0 range 17 .. 19;
WUS at 0 range 20 .. 21;
WUFIE at 0 range 22 .. 22;
UCESM at 0 range 23 .. 23;
TCBGTIE at 0 range 24 .. 24;
Reserved_25_31 at 0 range 25 .. 31;
end record;
subtype BRR_BRR_Field_1 is HAL.UInt12;
-- Baud rate register
type BRR_Register_2 is record
-- USARTDIV
BRR : BRR_BRR_Field_1 := 16#0#;
-- unspecified
Reserved_12_31 : HAL.UInt20 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for BRR_Register_2 use record
BRR at 0 range 0 .. 11;
Reserved_12_31 at 0 range 12 .. 31;
end record;
-- Interrupt & status register
type ISR_Register_2 is record
-- Read-only. PE
PE : Boolean;
-- Read-only. FE
FE : Boolean;
-- Read-only. NF
NF : Boolean;
-- Read-only. ORE
ORE : Boolean;
-- Read-only. IDLE
IDLE : Boolean;
-- Read-only. RXNE
RXNE : Boolean;
-- Read-only. TC
TC : Boolean;
-- Read-only. TXE
TXE : Boolean;
-- Read-only. LBDF
LBDF : Boolean;
-- Read-only. CTSIF
CTSIF : Boolean;
-- Read-only. CTS
CTS : Boolean;
-- Read-only. RTOF
RTOF : Boolean;
-- Read-only. EOBF
EOBF : Boolean;
-- unspecified
Reserved_13_13 : HAL.Bit;
-- Read-only. ABRE
ABRE : Boolean;
-- Read-only. ABRF
ABRF : Boolean;
-- Read-only. BUSY
BUSY : Boolean;
-- Read-only. CMF
CMF : Boolean;
-- Read-only. SBKF
SBKF : Boolean;
-- Read-only. RWU
RWU : Boolean;
-- Read-only. WUF
WUF : Boolean;
-- Read-only. TEACK
TEACK : Boolean;
-- Read-only. REACK
REACK : Boolean;
-- unspecified
Reserved_23_24 : HAL.UInt2;
-- Read-only. Transmission complete before guard time completion
TCBGT : Boolean;
-- unspecified
Reserved_26_31 : HAL.UInt6;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for ISR_Register_2 use record
PE at 0 range 0 .. 0;
FE at 0 range 1 .. 1;
NF at 0 range 2 .. 2;
ORE at 0 range 3 .. 3;
IDLE at 0 range 4 .. 4;
RXNE at 0 range 5 .. 5;
TC at 0 range 6 .. 6;
TXE at 0 range 7 .. 7;
LBDF at 0 range 8 .. 8;
CTSIF at 0 range 9 .. 9;
CTS at 0 range 10 .. 10;
RTOF at 0 range 11 .. 11;
EOBF at 0 range 12 .. 12;
Reserved_13_13 at 0 range 13 .. 13;
ABRE at 0 range 14 .. 14;
ABRF at 0 range 15 .. 15;
BUSY at 0 range 16 .. 16;
CMF at 0 range 17 .. 17;
SBKF at 0 range 18 .. 18;
RWU at 0 range 19 .. 19;
WUF at 0 range 20 .. 20;
TEACK at 0 range 21 .. 21;
REACK at 0 range 22 .. 22;
Reserved_23_24 at 0 range 23 .. 24;
TCBGT at 0 range 25 .. 25;
Reserved_26_31 at 0 range 26 .. 31;
end record;
-----------------
-- Peripherals --
-----------------
-- Universal synchronous asynchronous receiver transmitter
type LPUART1_Peripheral is record
-- Control register 1
CR1 : aliased CR1_Register;
-- Control register 2
CR2 : aliased CR2_Register;
-- Control register 3
CR3 : aliased CR3_Register;
-- Baud rate register
BRR : aliased BRR_Register;
-- Request register
RQR : aliased RQR_Register;
-- Interrupt & status register
ISR : aliased ISR_Register;
-- Interrupt flag clear register
ICR : aliased ICR_Register;
-- Receive data register
RDR : aliased RDR_Register;
-- Transmit data register
TDR : aliased TDR_Register;
end record
with Volatile;
for LPUART1_Peripheral use record
CR1 at 16#0# range 0 .. 31;
CR2 at 16#4# range 0 .. 31;
CR3 at 16#8# range 0 .. 31;
BRR at 16#C# range 0 .. 31;
RQR at 16#18# range 0 .. 31;
ISR at 16#1C# range 0 .. 31;
ICR at 16#20# range 0 .. 31;
RDR at 16#24# range 0 .. 31;
TDR at 16#28# range 0 .. 31;
end record;
-- Universal synchronous asynchronous receiver transmitter
LPUART1_Periph : aliased LPUART1_Peripheral
with Import, Address => System'To_Address (16#40008000#);
-- Universal synchronous asynchronous receiver transmitter
type UART4_Peripheral is record
-- Control register 1
CR1 : aliased CR1_Register_1;
-- Control register 2
CR2 : aliased CR2_Register_1;
-- Control register 3
CR3 : aliased CR3_Register_1;
-- Baud rate register
BRR : aliased BRR_Register_1;
-- Guard time and prescaler register
GTPR : aliased GTPR_Register;
-- Receiver timeout register
RTOR : aliased RTOR_Register;
-- Request register
RQR : aliased RQR_Register_1;
-- Interrupt & status register
ISR : aliased ISR_Register_1;
-- Interrupt flag clear register
ICR : aliased ICR_Register_1;
-- Receive data register
RDR : aliased RDR_Register;
-- Transmit data register
TDR : aliased TDR_Register;
end record
with Volatile;
for UART4_Peripheral use record
CR1 at 16#0# range 0 .. 31;
CR2 at 16#4# range 0 .. 31;
CR3 at 16#8# range 0 .. 31;
BRR at 16#C# range 0 .. 31;
GTPR at 16#10# range 0 .. 31;
RTOR at 16#14# range 0 .. 31;
RQR at 16#18# range 0 .. 31;
ISR at 16#1C# range 0 .. 31;
ICR at 16#20# range 0 .. 31;
RDR at 16#24# range 0 .. 31;
TDR at 16#28# range 0 .. 31;
end record;
-- Universal synchronous asynchronous receiver transmitter
UART4_Periph : aliased UART4_Peripheral
with Import, Address => System'To_Address (16#40004C00#);
-- Universal synchronous asynchronous receiver transmitter
USART1_Periph : aliased UART4_Peripheral
with Import, Address => System'To_Address (16#40013800#);
-- Universal synchronous asynchronous receiver transmitter
USART2_Periph : aliased UART4_Peripheral
with Import, Address => System'To_Address (16#40004400#);
-- Universal synchronous asynchronous receiver transmitter
type USART3_Peripheral is record
-- Control register 1
CR1 : aliased CR1_Register_1;
-- Control register 2
CR2 : aliased CR2_Register_1;
-- Control register 3
CR3 : aliased CR3_Register_2;
-- Baud rate register
BRR : aliased BRR_Register_2;
-- Guard time and prescaler register
GTPR : aliased GTPR_Register;
-- Receiver timeout register
RTOR : aliased RTOR_Register;
-- Request register
RQR : aliased RQR_Register_1;
-- Interrupt & status register
ISR : aliased ISR_Register_2;
-- Interrupt flag clear register
ICR : aliased ICR_Register_1;
-- Receive data register
RDR : aliased RDR_Register;
-- Transmit data register
TDR : aliased TDR_Register;
end record
with Volatile;
for USART3_Peripheral use record
CR1 at 16#0# range 0 .. 31;
CR2 at 16#4# range 0 .. 31;
CR3 at 16#8# range 0 .. 31;
BRR at 16#C# range 0 .. 31;
GTPR at 16#10# range 0 .. 31;
RTOR at 16#14# range 0 .. 31;
RQR at 16#18# range 0 .. 31;
ISR at 16#1C# range 0 .. 31;
ICR at 16#20# range 0 .. 31;
RDR at 16#24# range 0 .. 31;
TDR at 16#28# range 0 .. 31;
end record;
-- Universal synchronous asynchronous receiver transmitter
USART3_Periph : aliased USART3_Peripheral
with Import, Address => System'To_Address (16#40004800#);
end STM32_SVD.USART;
|
-- protected_refcounted_flyweights.ads
-- A package for ensuring resources are not duplicated in a manner similar
-- to the C++ Boost flyweight classes. This package provides a task-safe
-- implementation that uses reference counting to release resources when the
-- last reference is released
-- Copyright (c) 2016, James Humphry
--
-- Permission to use, copy, modify, and/or distribute this software for any
-- purpose with or without fee is hereby granted, provided that the above
-- copyright notice and this permission notice appear in all copies.
--
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
-- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
-- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-- PERFORMANCE OF THIS SOFTWARE.
pragma Profile (No_Implementation_Extensions);
with Ada.Containers;
with Flyweights.Refcounted_Lists;
with Flyweights.Protected_Hashtables;
with Flyweights.Refcounted_Ptrs;
generic
type Element(<>) is limited private;
type Element_Access is access Element;
with function Hash (E : Element) return Ada.Containers.Hash_Type;
Capacity : Ada.Containers.Hash_Type := 256;
with function "=" (Left, Right : in Element) return Boolean is <>;
package Protected_Refcounted_Flyweights is
package Lists is
new Flyweights.Refcounted_Lists(Element => Element,
Element_Access => Element_Access,
"=" => "=");
package Hashtables is
new Flyweights.Protected_Hashtables(Element => Element,
Element_Access => Element_Access,
Hash => Hash,
Lists_Spec => Lists.Lists_Spec,
Capacity => Capacity);
package Ptrs is
new Flyweights.Refcounted_Ptrs(Element => Element,
Element_Access => Element_Access,
Flyweight_Hashtables => Hashtables.Hashtables_Spec);
subtype Flyweight is Hashtables.Flyweight;
-- This Flyweight type is an implementation of the flyweight pattern, which
-- helps prevent the resource usage caused by the storage of duplicate
-- values. Reference counting is used to release resources when they are
-- no longer required. This implementation is protected so it is safe to
-- use even if multiple tasks could attempt to add or remove resources
-- simultaneously.
subtype E_Ref is Ptrs.E_Ref;
-- This is a generic generalised reference type which is used to make
-- Element_Ptr easier to use and which should not be stored or reused.
subtype Element_Ptr is Ptrs.Refcounted_Element_Ptr;
-- The Element_Ptr type points to a resource inside a Flyweight. It is
-- reference-counted (shared with Element_Ref) so that when the last
-- Element_Ptr or Element_Ref pointing to a resource is destroyed, the
-- resource will be deallocated as well. The 'Get' function returns an
-- access value to the resource.
use type Ptrs.Refcounted_Element_Ptr;
subtype Element_Ref is Ptrs.Refcounted_Element_Ref;
-- The Element_Ref type points to a resource inside a Flyweight. It is
-- reference-counted (shared with Element_Ptr) so that when the last
-- Element_Ptr or Element_Ref pointing to a resource is destroyed, the
-- resource will be deallocated as well. The Element_Ref type can be
-- implicitly derefenced to return the resource.
use type Ptrs.Refcounted_Element_Ref;
function P (P : Ptrs.Refcounted_Element_Ptr) return E_Ref
renames Ptrs.P;
-- P returns an E_Ref which is a generalised reference to the stored value.
-- This is an alternative to calling the Get function and dereferencing the
-- access value returned with '.all'.
function Get (P : Ptrs.Refcounted_Element_Ptr) return Element_Access
renames Ptrs.Get;
-- Get returns an access value that points to a resource inside a
-- Flyweight.
function Get (P : Ptrs.Refcounted_Element_Ref) return Element_Access
renames Ptrs.Get;
-- Get returns an access value that points to a resource inside a
-- Flyweight.
function Make_Ref (P : Ptrs.Refcounted_Element_Ptr'Class)
return Ptrs.Refcounted_Element_Ref
renames Ptrs.Make_Ref;
-- Make_Ref converts a Refcounted_Element_Ptr into a Refcounted_Element_Ref.
function Insert_Ptr (F : aliased in out Hashtables.Flyweight;
E : in out Element_Access)
return Ptrs.Refcounted_Element_Ptr
renames Ptrs.Insert_Ptr;
-- Insert_Ptr looks to see if the Element pointed to by E already exists
-- inside the Flyweight F. If so, the Element pointed to by E is deallocated
-- and E is set to the existing copy. Otherwise, F stores E for future use. A
-- Refcounted_Element_Ptr is returned.
function Make_Ptr (R : Ptrs.Refcounted_Element_Ref'Class)
return Ptrs.Refcounted_Element_Ptr
renames Ptrs.Make_Ptr;
-- Make_Ref converts a Refcounted_Element_Ref into a Refcounted_Element_Ptr.
function Insert_Ref (F : aliased in out Hashtables.Flyweight;
E : in out Element_Access)
return Ptrs.Refcounted_Element_Ref
renames Ptrs.Insert_Ref;
-- Insert_Ref looks to see if the Element pointed to by E already exists
-- inside the Flyweight F. If so, the Element pointed to by E is deallocated
-- and E is set to the existing copy. Otherwise, F stores E for future use. A
-- Refcounted_Element_Ref is returned.
-- Note - ideally Insert_Ptr and Insert_Ref could both be overloadings of
-- Insert. However this seems to cause problems for GNAT GPL 2015 so for now
-- the type is suffixed to the name.
end Protected_Refcounted_Flyweights;
|
-- This file is generated by SWIG. Please do not modify by hand.
--
with Interfaces;
with Interfaces.C;
with Interfaces.C.Pointers;
package xcb.xcb_render_free_picture_request_t is
-- Item
--
type Item is record
major_opcode : aliased Interfaces.Unsigned_8;
minor_opcode : aliased Interfaces.Unsigned_8;
length : aliased Interfaces.Unsigned_16;
picture : aliased xcb.xcb_render_picture_t;
end record;
-- Item_Array
--
type Item_Array is
array
(Interfaces.C
.size_t range <>) of aliased xcb.xcb_render_free_picture_request_t
.Item;
-- Pointer
--
package C_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t,
Element => xcb.xcb_render_free_picture_request_t.Item,
Element_Array => xcb.xcb_render_free_picture_request_t.Item_Array,
Default_Terminator => (others => <>));
subtype Pointer is C_Pointers.Pointer;
-- Pointer_Array
--
type Pointer_Array is
array
(Interfaces.C
.size_t range <>) of aliased xcb.xcb_render_free_picture_request_t
.Pointer;
-- Pointer_Pointer
--
package C_Pointer_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t,
Element => xcb.xcb_render_free_picture_request_t.Pointer,
Element_Array => xcb.xcb_render_free_picture_request_t.Pointer_Array,
Default_Terminator => null);
subtype Pointer_Pointer is C_Pointer_Pointers.Pointer;
end xcb.xcb_render_free_picture_request_t;
|
-- This spec has been automatically generated from STM32F7x9.svd
pragma Restrictions (No_Elaboration_Code);
pragma Ada_2012;
pragma Style_Checks (Off);
with HAL;
with System;
package STM32_SVD.DFSDM is
pragma Preelaborate;
---------------
-- Registers --
---------------
subtype DFSDM_CHCFG0R1_SITP_Field is HAL.UInt2;
subtype DFSDM_CHCFG0R1_SPICKSEL_Field is HAL.UInt2;
subtype DFSDM_CHCFG0R1_DATMPX_Field is HAL.UInt2;
subtype DFSDM_CHCFG0R1_DATPACK_Field is HAL.UInt2;
subtype DFSDM_CHCFG0R1_CKOUTDIV_Field is HAL.UInt8;
-- DFSDM channel configuration 0 register 1
type DFSDM_CHCFG0R1_Register is record
-- Serial interface type for channel 0
SITP : DFSDM_CHCFG0R1_SITP_Field := 16#0#;
-- SPI clock select for channel 0
SPICKSEL : DFSDM_CHCFG0R1_SPICKSEL_Field := 16#0#;
-- unspecified
Reserved_4_4 : HAL.Bit := 16#0#;
-- Short-circuit detector enable on channel 0
SCDEN : Boolean := False;
-- Clock absence detector enable on channel 0
CKABEN : Boolean := False;
-- Channel 0 enable
CHEN : Boolean := False;
-- Channel inputs selection
CHINSEL : Boolean := False;
-- unspecified
Reserved_9_11 : HAL.UInt3 := 16#0#;
-- Input data multiplexer for channel 0
DATMPX : DFSDM_CHCFG0R1_DATMPX_Field := 16#0#;
-- Data packing mode in DFSDM_CHDATINyR register
DATPACK : DFSDM_CHCFG0R1_DATPACK_Field := 16#0#;
-- Output serial clock divider
CKOUTDIV : DFSDM_CHCFG0R1_CKOUTDIV_Field := 16#0#;
-- unspecified
Reserved_24_29 : HAL.UInt6 := 16#0#;
-- Output serial clock source selection
CKOUTSRC : Boolean := False;
-- Global enable for DFSDM interface
DFSDMEN : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM_CHCFG0R1_Register use record
SITP at 0 range 0 .. 1;
SPICKSEL at 0 range 2 .. 3;
Reserved_4_4 at 0 range 4 .. 4;
SCDEN at 0 range 5 .. 5;
CKABEN at 0 range 6 .. 6;
CHEN at 0 range 7 .. 7;
CHINSEL at 0 range 8 .. 8;
Reserved_9_11 at 0 range 9 .. 11;
DATMPX at 0 range 12 .. 13;
DATPACK at 0 range 14 .. 15;
CKOUTDIV at 0 range 16 .. 23;
Reserved_24_29 at 0 range 24 .. 29;
CKOUTSRC at 0 range 30 .. 30;
DFSDMEN at 0 range 31 .. 31;
end record;
subtype DFSDM_CHCFG1R1_SITP_Field is HAL.UInt2;
subtype DFSDM_CHCFG1R1_SPICKSEL_Field is HAL.UInt2;
subtype DFSDM_CHCFG1R1_DATMPX_Field is HAL.UInt2;
subtype DFSDM_CHCFG1R1_DATPACK_Field is HAL.UInt2;
subtype DFSDM_CHCFG1R1_CKOUTDIV_Field is HAL.UInt8;
-- DFSDM channel configuration 1 register 1
type DFSDM_CHCFG1R1_Register is record
-- Serial interface type for channel 1
SITP : DFSDM_CHCFG1R1_SITP_Field := 16#0#;
-- SPI clock select for channel 1
SPICKSEL : DFSDM_CHCFG1R1_SPICKSEL_Field := 16#0#;
-- unspecified
Reserved_4_4 : HAL.Bit := 16#0#;
-- Short-circuit detector enable on channel 1
SCDEN : Boolean := False;
-- Clock absence detector enable on channel 1
CKABEN : Boolean := False;
-- Channel 1 enable
CHEN : Boolean := False;
-- Channel inputs selection
CHINSEL : Boolean := False;
-- unspecified
Reserved_9_11 : HAL.UInt3 := 16#0#;
-- Input data multiplexer for channel 1
DATMPX : DFSDM_CHCFG1R1_DATMPX_Field := 16#0#;
-- Data packing mode in DFSDM_CHDATINyR register
DATPACK : DFSDM_CHCFG1R1_DATPACK_Field := 16#0#;
-- Output serial clock divider
CKOUTDIV : DFSDM_CHCFG1R1_CKOUTDIV_Field := 16#0#;
-- unspecified
Reserved_24_29 : HAL.UInt6 := 16#0#;
-- Output serial clock source selection
CKOUTSRC : Boolean := False;
-- Global enable for DFSDM interface
DFSDMEN : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM_CHCFG1R1_Register use record
SITP at 0 range 0 .. 1;
SPICKSEL at 0 range 2 .. 3;
Reserved_4_4 at 0 range 4 .. 4;
SCDEN at 0 range 5 .. 5;
CKABEN at 0 range 6 .. 6;
CHEN at 0 range 7 .. 7;
CHINSEL at 0 range 8 .. 8;
Reserved_9_11 at 0 range 9 .. 11;
DATMPX at 0 range 12 .. 13;
DATPACK at 0 range 14 .. 15;
CKOUTDIV at 0 range 16 .. 23;
Reserved_24_29 at 0 range 24 .. 29;
CKOUTSRC at 0 range 30 .. 30;
DFSDMEN at 0 range 31 .. 31;
end record;
subtype DFSDM_CHCFG2R1_SITP_Field is HAL.UInt2;
subtype DFSDM_CHCFG2R1_SPICKSEL_Field is HAL.UInt2;
subtype DFSDM_CHCFG2R1_DATMPX_Field is HAL.UInt2;
subtype DFSDM_CHCFG2R1_DATPACK_Field is HAL.UInt2;
subtype DFSDM_CHCFG2R1_CKOUTDIV_Field is HAL.UInt8;
-- DFSDM channel configuration 2 register 1
type DFSDM_CHCFG2R1_Register is record
-- Serial interface type for channel 2
SITP : DFSDM_CHCFG2R1_SITP_Field := 16#0#;
-- SPI clock select for channel 2
SPICKSEL : DFSDM_CHCFG2R1_SPICKSEL_Field := 16#0#;
-- unspecified
Reserved_4_4 : HAL.Bit := 16#0#;
-- Short-circuit detector enable on channel 2
SCDEN : Boolean := False;
-- Clock absence detector enable on channel 2
CKABEN : Boolean := False;
-- Channel 2 enable
CHEN : Boolean := False;
-- Channel inputs selection
CHINSEL : Boolean := False;
-- unspecified
Reserved_9_11 : HAL.UInt3 := 16#0#;
-- Input data multiplexer for channel 2
DATMPX : DFSDM_CHCFG2R1_DATMPX_Field := 16#0#;
-- Data packing mode in DFSDM_CHDATINyR register
DATPACK : DFSDM_CHCFG2R1_DATPACK_Field := 16#0#;
-- Output serial clock divider
CKOUTDIV : DFSDM_CHCFG2R1_CKOUTDIV_Field := 16#0#;
-- unspecified
Reserved_24_29 : HAL.UInt6 := 16#0#;
-- Output serial clock source selection
CKOUTSRC : Boolean := False;
-- Global enable for DFSDM interface
DFSDMEN : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM_CHCFG2R1_Register use record
SITP at 0 range 0 .. 1;
SPICKSEL at 0 range 2 .. 3;
Reserved_4_4 at 0 range 4 .. 4;
SCDEN at 0 range 5 .. 5;
CKABEN at 0 range 6 .. 6;
CHEN at 0 range 7 .. 7;
CHINSEL at 0 range 8 .. 8;
Reserved_9_11 at 0 range 9 .. 11;
DATMPX at 0 range 12 .. 13;
DATPACK at 0 range 14 .. 15;
CKOUTDIV at 0 range 16 .. 23;
Reserved_24_29 at 0 range 24 .. 29;
CKOUTSRC at 0 range 30 .. 30;
DFSDMEN at 0 range 31 .. 31;
end record;
subtype DFSDM_CHCFG3R1_SITP_Field is HAL.UInt2;
subtype DFSDM_CHCFG3R1_SPICKSEL_Field is HAL.UInt2;
subtype DFSDM_CHCFG3R1_DATMPX_Field is HAL.UInt2;
subtype DFSDM_CHCFG3R1_DATPACK_Field is HAL.UInt2;
subtype DFSDM_CHCFG3R1_CKOUTDIV_Field is HAL.UInt8;
-- DFSDM channel configuration 3 register 1
type DFSDM_CHCFG3R1_Register is record
-- Serial interface type for channel 3
SITP : DFSDM_CHCFG3R1_SITP_Field := 16#0#;
-- SPI clock select for channel 3
SPICKSEL : DFSDM_CHCFG3R1_SPICKSEL_Field := 16#0#;
-- unspecified
Reserved_4_4 : HAL.Bit := 16#0#;
-- Short-circuit detector enable on channel 3
SCDEN : Boolean := False;
-- Clock absence detector enable on channel 3
CKABEN : Boolean := False;
-- Channel 3 enable
CHEN : Boolean := False;
-- Channel inputs selection
CHINSEL : Boolean := False;
-- unspecified
Reserved_9_11 : HAL.UInt3 := 16#0#;
-- Input data multiplexer for channel 3
DATMPX : DFSDM_CHCFG3R1_DATMPX_Field := 16#0#;
-- Data packing mode in DFSDM_CHDATINyR register
DATPACK : DFSDM_CHCFG3R1_DATPACK_Field := 16#0#;
-- Output serial clock divider
CKOUTDIV : DFSDM_CHCFG3R1_CKOUTDIV_Field := 16#0#;
-- unspecified
Reserved_24_29 : HAL.UInt6 := 16#0#;
-- Output serial clock source selection
CKOUTSRC : Boolean := False;
-- Global enable for DFSDM interface
DFSDMEN : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM_CHCFG3R1_Register use record
SITP at 0 range 0 .. 1;
SPICKSEL at 0 range 2 .. 3;
Reserved_4_4 at 0 range 4 .. 4;
SCDEN at 0 range 5 .. 5;
CKABEN at 0 range 6 .. 6;
CHEN at 0 range 7 .. 7;
CHINSEL at 0 range 8 .. 8;
Reserved_9_11 at 0 range 9 .. 11;
DATMPX at 0 range 12 .. 13;
DATPACK at 0 range 14 .. 15;
CKOUTDIV at 0 range 16 .. 23;
Reserved_24_29 at 0 range 24 .. 29;
CKOUTSRC at 0 range 30 .. 30;
DFSDMEN at 0 range 31 .. 31;
end record;
subtype DFSDM_CHCFG4R1_SITP_Field is HAL.UInt2;
subtype DFSDM_CHCFG4R1_SPICKSEL_Field is HAL.UInt2;
subtype DFSDM_CHCFG4R1_DATMPX_Field is HAL.UInt2;
subtype DFSDM_CHCFG4R1_DATPACK_Field is HAL.UInt2;
subtype DFSDM_CHCFG4R1_CKOUTDIV_Field is HAL.UInt8;
-- DFSDM channel configuration 4 register 1
type DFSDM_CHCFG4R1_Register is record
-- Serial interface type for channel 4
SITP : DFSDM_CHCFG4R1_SITP_Field := 16#0#;
-- SPI clock select for channel 4
SPICKSEL : DFSDM_CHCFG4R1_SPICKSEL_Field := 16#0#;
-- unspecified
Reserved_4_4 : HAL.Bit := 16#0#;
-- Short-circuit detector enable on channel 4
SCDEN : Boolean := False;
-- Clock absence detector enable on channel 4
CKABEN : Boolean := False;
-- Channel 4 enable
CHEN : Boolean := False;
-- Channel inputs selection
CHINSEL : Boolean := False;
-- unspecified
Reserved_9_11 : HAL.UInt3 := 16#0#;
-- Input data multiplexer for channel 4
DATMPX : DFSDM_CHCFG4R1_DATMPX_Field := 16#0#;
-- Data packing mode in DFSDM_CHDATINyR register
DATPACK : DFSDM_CHCFG4R1_DATPACK_Field := 16#0#;
-- Output serial clock divider
CKOUTDIV : DFSDM_CHCFG4R1_CKOUTDIV_Field := 16#0#;
-- unspecified
Reserved_24_29 : HAL.UInt6 := 16#0#;
-- Output serial clock source selection
CKOUTSRC : Boolean := False;
-- Global enable for DFSDM interface
DFSDMEN : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM_CHCFG4R1_Register use record
SITP at 0 range 0 .. 1;
SPICKSEL at 0 range 2 .. 3;
Reserved_4_4 at 0 range 4 .. 4;
SCDEN at 0 range 5 .. 5;
CKABEN at 0 range 6 .. 6;
CHEN at 0 range 7 .. 7;
CHINSEL at 0 range 8 .. 8;
Reserved_9_11 at 0 range 9 .. 11;
DATMPX at 0 range 12 .. 13;
DATPACK at 0 range 14 .. 15;
CKOUTDIV at 0 range 16 .. 23;
Reserved_24_29 at 0 range 24 .. 29;
CKOUTSRC at 0 range 30 .. 30;
DFSDMEN at 0 range 31 .. 31;
end record;
subtype DFSDM_CHCFG5R1_SITP_Field is HAL.UInt2;
subtype DFSDM_CHCFG5R1_SPICKSEL_Field is HAL.UInt2;
subtype DFSDM_CHCFG5R1_DATMPX_Field is HAL.UInt2;
subtype DFSDM_CHCFG5R1_DATPACK_Field is HAL.UInt2;
subtype DFSDM_CHCFG5R1_CKOUTDIV_Field is HAL.UInt8;
-- DFSDM channel configuration 5 register 1
type DFSDM_CHCFG5R1_Register is record
-- Serial interface type for channel 5
SITP : DFSDM_CHCFG5R1_SITP_Field := 16#0#;
-- SPI clock select for channel 5
SPICKSEL : DFSDM_CHCFG5R1_SPICKSEL_Field := 16#0#;
-- unspecified
Reserved_4_4 : HAL.Bit := 16#0#;
-- Short-circuit detector enable on channel 5
SCDEN : Boolean := False;
-- Clock absence detector enable on channel 5
CKABEN : Boolean := False;
-- Channel 5 enable
CHEN : Boolean := False;
-- Channel inputs selection
CHINSEL : Boolean := False;
-- unspecified
Reserved_9_11 : HAL.UInt3 := 16#0#;
-- Input data multiplexer for channel 5
DATMPX : DFSDM_CHCFG5R1_DATMPX_Field := 16#0#;
-- Data packing mode in DFSDM_CHDATINyR register
DATPACK : DFSDM_CHCFG5R1_DATPACK_Field := 16#0#;
-- Output serial clock divider
CKOUTDIV : DFSDM_CHCFG5R1_CKOUTDIV_Field := 16#0#;
-- unspecified
Reserved_24_29 : HAL.UInt6 := 16#0#;
-- Output serial clock source selection
CKOUTSRC : Boolean := False;
-- Global enable for DFSDM interface
DFSDMEN : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM_CHCFG5R1_Register use record
SITP at 0 range 0 .. 1;
SPICKSEL at 0 range 2 .. 3;
Reserved_4_4 at 0 range 4 .. 4;
SCDEN at 0 range 5 .. 5;
CKABEN at 0 range 6 .. 6;
CHEN at 0 range 7 .. 7;
CHINSEL at 0 range 8 .. 8;
Reserved_9_11 at 0 range 9 .. 11;
DATMPX at 0 range 12 .. 13;
DATPACK at 0 range 14 .. 15;
CKOUTDIV at 0 range 16 .. 23;
Reserved_24_29 at 0 range 24 .. 29;
CKOUTSRC at 0 range 30 .. 30;
DFSDMEN at 0 range 31 .. 31;
end record;
subtype DFSDM_CHCFG6R1_SITP_Field is HAL.UInt2;
subtype DFSDM_CHCFG6R1_SPICKSEL_Field is HAL.UInt2;
subtype DFSDM_CHCFG6R1_DATMPX_Field is HAL.UInt2;
subtype DFSDM_CHCFG6R1_DATPACK_Field is HAL.UInt2;
subtype DFSDM_CHCFG6R1_CKOUTDIV_Field is HAL.UInt8;
-- DFSDM channel configuration 6 register 1
type DFSDM_CHCFG6R1_Register is record
-- Serial interface type for channel 6
SITP : DFSDM_CHCFG6R1_SITP_Field := 16#0#;
-- SPI clock select for channel 6
SPICKSEL : DFSDM_CHCFG6R1_SPICKSEL_Field := 16#0#;
-- unspecified
Reserved_4_4 : HAL.Bit := 16#0#;
-- Short-circuit detector enable on channel 6
SCDEN : Boolean := False;
-- Clock absence detector enable on channel 6
CKABEN : Boolean := False;
-- Channel 6 enable
CHEN : Boolean := False;
-- Channel inputs selection
CHINSEL : Boolean := False;
-- unspecified
Reserved_9_11 : HAL.UInt3 := 16#0#;
-- Input data multiplexer for channel 6
DATMPX : DFSDM_CHCFG6R1_DATMPX_Field := 16#0#;
-- Data packing mode in DFSDM_CHDATINyR register
DATPACK : DFSDM_CHCFG6R1_DATPACK_Field := 16#0#;
-- Output serial clock divider
CKOUTDIV : DFSDM_CHCFG6R1_CKOUTDIV_Field := 16#0#;
-- unspecified
Reserved_24_29 : HAL.UInt6 := 16#0#;
-- Output serial clock source selection
CKOUTSRC : Boolean := False;
-- Global enable for DFSDM interface
DFSDMEN : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM_CHCFG6R1_Register use record
SITP at 0 range 0 .. 1;
SPICKSEL at 0 range 2 .. 3;
Reserved_4_4 at 0 range 4 .. 4;
SCDEN at 0 range 5 .. 5;
CKABEN at 0 range 6 .. 6;
CHEN at 0 range 7 .. 7;
CHINSEL at 0 range 8 .. 8;
Reserved_9_11 at 0 range 9 .. 11;
DATMPX at 0 range 12 .. 13;
DATPACK at 0 range 14 .. 15;
CKOUTDIV at 0 range 16 .. 23;
Reserved_24_29 at 0 range 24 .. 29;
CKOUTSRC at 0 range 30 .. 30;
DFSDMEN at 0 range 31 .. 31;
end record;
subtype DFSDM_CHCFG7R1_SITP_Field is HAL.UInt2;
subtype DFSDM_CHCFG7R1_SPICKSEL_Field is HAL.UInt2;
subtype DFSDM_CHCFG7R1_DATMPX_Field is HAL.UInt2;
subtype DFSDM_CHCFG7R1_DATPACK_Field is HAL.UInt2;
subtype DFSDM_CHCFG7R1_CKOUTDIV_Field is HAL.UInt8;
-- DFSDM channel configuration 7 register 1
type DFSDM_CHCFG7R1_Register is record
-- Serial interface type for channel 7
SITP : DFSDM_CHCFG7R1_SITP_Field := 16#0#;
-- SPI clock select for channel 7
SPICKSEL : DFSDM_CHCFG7R1_SPICKSEL_Field := 16#0#;
-- unspecified
Reserved_4_4 : HAL.Bit := 16#0#;
-- Short-circuit detector enable on channel 7
SCDEN : Boolean := False;
-- Clock absence detector enable on channel 7
CKABEN : Boolean := False;
-- Channel 7 enable
CHEN : Boolean := False;
-- Channel inputs selection
CHINSEL : Boolean := False;
-- unspecified
Reserved_9_11 : HAL.UInt3 := 16#0#;
-- Input data multiplexer for channel 7
DATMPX : DFSDM_CHCFG7R1_DATMPX_Field := 16#0#;
-- Data packing mode in DFSDM_CHDATINyR register
DATPACK : DFSDM_CHCFG7R1_DATPACK_Field := 16#0#;
-- Output serial clock divider
CKOUTDIV : DFSDM_CHCFG7R1_CKOUTDIV_Field := 16#0#;
-- unspecified
Reserved_24_29 : HAL.UInt6 := 16#0#;
-- Output serial clock source selection
CKOUTSRC : Boolean := False;
-- Global enable for DFSDM interface
DFSDMEN : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM_CHCFG7R1_Register use record
SITP at 0 range 0 .. 1;
SPICKSEL at 0 range 2 .. 3;
Reserved_4_4 at 0 range 4 .. 4;
SCDEN at 0 range 5 .. 5;
CKABEN at 0 range 6 .. 6;
CHEN at 0 range 7 .. 7;
CHINSEL at 0 range 8 .. 8;
Reserved_9_11 at 0 range 9 .. 11;
DATMPX at 0 range 12 .. 13;
DATPACK at 0 range 14 .. 15;
CKOUTDIV at 0 range 16 .. 23;
Reserved_24_29 at 0 range 24 .. 29;
CKOUTSRC at 0 range 30 .. 30;
DFSDMEN at 0 range 31 .. 31;
end record;
subtype DFSDM_CHCFG0R2_DTRBS_Field is HAL.UInt5;
subtype DFSDM_CHCFG0R2_OFFSET_Field is HAL.UInt24;
-- DFSDM channel configuration 0 register 2
type DFSDM_CHCFG0R2_Register is record
-- unspecified
Reserved_0_2 : HAL.UInt3 := 16#0#;
-- Data right bit-shift for channel 0
DTRBS : DFSDM_CHCFG0R2_DTRBS_Field := 16#0#;
-- 24-bit calibration offset for channel 0
OFFSET : DFSDM_CHCFG0R2_OFFSET_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM_CHCFG0R2_Register use record
Reserved_0_2 at 0 range 0 .. 2;
DTRBS at 0 range 3 .. 7;
OFFSET at 0 range 8 .. 31;
end record;
subtype DFSDM_CHCFG1R2_DTRBS_Field is HAL.UInt5;
subtype DFSDM_CHCFG1R2_OFFSET_Field is HAL.UInt24;
-- DFSDM channel configuration 1 register 2
type DFSDM_CHCFG1R2_Register is record
-- unspecified
Reserved_0_2 : HAL.UInt3 := 16#0#;
-- Data right bit-shift for channel 1
DTRBS : DFSDM_CHCFG1R2_DTRBS_Field := 16#0#;
-- 24-bit calibration offset for channel 1
OFFSET : DFSDM_CHCFG1R2_OFFSET_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM_CHCFG1R2_Register use record
Reserved_0_2 at 0 range 0 .. 2;
DTRBS at 0 range 3 .. 7;
OFFSET at 0 range 8 .. 31;
end record;
subtype DFSDM_CHCFG2R2_DTRBS_Field is HAL.UInt5;
subtype DFSDM_CHCFG2R2_OFFSET_Field is HAL.UInt24;
-- DFSDM channel configuration 2 register 2
type DFSDM_CHCFG2R2_Register is record
-- unspecified
Reserved_0_2 : HAL.UInt3 := 16#0#;
-- Data right bit-shift for channel 2
DTRBS : DFSDM_CHCFG2R2_DTRBS_Field := 16#0#;
-- 24-bit calibration offset for channel 2
OFFSET : DFSDM_CHCFG2R2_OFFSET_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM_CHCFG2R2_Register use record
Reserved_0_2 at 0 range 0 .. 2;
DTRBS at 0 range 3 .. 7;
OFFSET at 0 range 8 .. 31;
end record;
subtype DFSDM_CHCFG3R2_DTRBS_Field is HAL.UInt5;
subtype DFSDM_CHCFG3R2_OFFSET_Field is HAL.UInt24;
-- DFSDM channel configuration 3 register 2
type DFSDM_CHCFG3R2_Register is record
-- unspecified
Reserved_0_2 : HAL.UInt3 := 16#0#;
-- Data right bit-shift for channel 3
DTRBS : DFSDM_CHCFG3R2_DTRBS_Field := 16#0#;
-- 24-bit calibration offset for channel 3
OFFSET : DFSDM_CHCFG3R2_OFFSET_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM_CHCFG3R2_Register use record
Reserved_0_2 at 0 range 0 .. 2;
DTRBS at 0 range 3 .. 7;
OFFSET at 0 range 8 .. 31;
end record;
subtype DFSDM_CHCFG4R2_DTRBS_Field is HAL.UInt5;
subtype DFSDM_CHCFG4R2_OFFSET_Field is HAL.UInt24;
-- DFSDM channel configuration 4 register 2
type DFSDM_CHCFG4R2_Register is record
-- unspecified
Reserved_0_2 : HAL.UInt3 := 16#0#;
-- Data right bit-shift for channel 4
DTRBS : DFSDM_CHCFG4R2_DTRBS_Field := 16#0#;
-- 24-bit calibration offset for channel 4
OFFSET : DFSDM_CHCFG4R2_OFFSET_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM_CHCFG4R2_Register use record
Reserved_0_2 at 0 range 0 .. 2;
DTRBS at 0 range 3 .. 7;
OFFSET at 0 range 8 .. 31;
end record;
subtype DFSDM_CHCFG5R2_DTRBS_Field is HAL.UInt5;
subtype DFSDM_CHCFG5R2_OFFSET_Field is HAL.UInt24;
-- DFSDM channel configuration 5 register 2
type DFSDM_CHCFG5R2_Register is record
-- unspecified
Reserved_0_2 : HAL.UInt3 := 16#0#;
-- Data right bit-shift for channel 5
DTRBS : DFSDM_CHCFG5R2_DTRBS_Field := 16#0#;
-- 24-bit calibration offset for channel 5
OFFSET : DFSDM_CHCFG5R2_OFFSET_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM_CHCFG5R2_Register use record
Reserved_0_2 at 0 range 0 .. 2;
DTRBS at 0 range 3 .. 7;
OFFSET at 0 range 8 .. 31;
end record;
subtype DFSDM_CHCFG6R2_DTRBS_Field is HAL.UInt5;
subtype DFSDM_CHCFG6R2_OFFSET_Field is HAL.UInt24;
-- DFSDM channel configuration 6 register 2
type DFSDM_CHCFG6R2_Register is record
-- unspecified
Reserved_0_2 : HAL.UInt3 := 16#0#;
-- Data right bit-shift for channel 6
DTRBS : DFSDM_CHCFG6R2_DTRBS_Field := 16#0#;
-- 24-bit calibration offset for channel 6
OFFSET : DFSDM_CHCFG6R2_OFFSET_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM_CHCFG6R2_Register use record
Reserved_0_2 at 0 range 0 .. 2;
DTRBS at 0 range 3 .. 7;
OFFSET at 0 range 8 .. 31;
end record;
subtype DFSDM_CHCFG7R2_DTRBS_Field is HAL.UInt5;
subtype DFSDM_CHCFG7R2_OFFSET_Field is HAL.UInt24;
-- DFSDM channel configuration 7 register 2
type DFSDM_CHCFG7R2_Register is record
-- unspecified
Reserved_0_2 : HAL.UInt3 := 16#0#;
-- Data right bit-shift for channel 7
DTRBS : DFSDM_CHCFG7R2_DTRBS_Field := 16#0#;
-- 24-bit calibration offset for channel 7
OFFSET : DFSDM_CHCFG7R2_OFFSET_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM_CHCFG7R2_Register use record
Reserved_0_2 at 0 range 0 .. 2;
DTRBS at 0 range 3 .. 7;
OFFSET at 0 range 8 .. 31;
end record;
subtype DFSDM_AWSCD0R_SCDT_Field is HAL.UInt8;
subtype DFSDM_AWSCD0R_BKSCD_Field is HAL.UInt4;
subtype DFSDM_AWSCD0R_AWFOSR_Field is HAL.UInt5;
subtype DFSDM_AWSCD0R_AWFORD_Field is HAL.UInt2;
-- DFSDM analog watchdog and short-circuit detector register
type DFSDM_AWSCD0R_Register is record
-- short-circuit detector threshold for channel 0
SCDT : DFSDM_AWSCD0R_SCDT_Field := 16#0#;
-- unspecified
Reserved_8_11 : HAL.UInt4 := 16#0#;
-- Break signal assignment for short-circuit detector on channel 0
BKSCD : DFSDM_AWSCD0R_BKSCD_Field := 16#0#;
-- Analog watchdog filter oversampling ratio (decimation rate) on
-- channel 0
AWFOSR : DFSDM_AWSCD0R_AWFOSR_Field := 16#0#;
-- unspecified
Reserved_21_21 : HAL.Bit := 16#0#;
-- Analog watchdog Sinc filter order on channel 0
AWFORD : DFSDM_AWSCD0R_AWFORD_Field := 16#0#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM_AWSCD0R_Register use record
SCDT at 0 range 0 .. 7;
Reserved_8_11 at 0 range 8 .. 11;
BKSCD at 0 range 12 .. 15;
AWFOSR at 0 range 16 .. 20;
Reserved_21_21 at 0 range 21 .. 21;
AWFORD at 0 range 22 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
subtype DFSDM_AWSCD1R_SCDT_Field is HAL.UInt8;
subtype DFSDM_AWSCD1R_BKSCD_Field is HAL.UInt4;
subtype DFSDM_AWSCD1R_AWFOSR_Field is HAL.UInt5;
subtype DFSDM_AWSCD1R_AWFORD_Field is HAL.UInt2;
-- DFSDM analog watchdog and short-circuit detector register
type DFSDM_AWSCD1R_Register is record
-- short-circuit detector threshold for channel 1
SCDT : DFSDM_AWSCD1R_SCDT_Field := 16#0#;
-- unspecified
Reserved_8_11 : HAL.UInt4 := 16#0#;
-- Break signal assignment for short-circuit detector on channel 1
BKSCD : DFSDM_AWSCD1R_BKSCD_Field := 16#0#;
-- Analog watchdog filter oversampling ratio (decimation rate) on
-- channel 1
AWFOSR : DFSDM_AWSCD1R_AWFOSR_Field := 16#0#;
-- unspecified
Reserved_21_21 : HAL.Bit := 16#0#;
-- Analog watchdog Sinc filter order on channel 1
AWFORD : DFSDM_AWSCD1R_AWFORD_Field := 16#0#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM_AWSCD1R_Register use record
SCDT at 0 range 0 .. 7;
Reserved_8_11 at 0 range 8 .. 11;
BKSCD at 0 range 12 .. 15;
AWFOSR at 0 range 16 .. 20;
Reserved_21_21 at 0 range 21 .. 21;
AWFORD at 0 range 22 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
subtype DFSDM_AWSCD2R_SCDT_Field is HAL.UInt8;
subtype DFSDM_AWSCD2R_BKSCD_Field is HAL.UInt4;
subtype DFSDM_AWSCD2R_AWFOSR_Field is HAL.UInt5;
subtype DFSDM_AWSCD2R_AWFORD_Field is HAL.UInt2;
-- DFSDM analog watchdog and short-circuit detector register
type DFSDM_AWSCD2R_Register is record
-- short-circuit detector threshold for channel 2
SCDT : DFSDM_AWSCD2R_SCDT_Field := 16#0#;
-- unspecified
Reserved_8_11 : HAL.UInt4 := 16#0#;
-- Break signal assignment for short-circuit detector on channel 2
BKSCD : DFSDM_AWSCD2R_BKSCD_Field := 16#0#;
-- Analog watchdog filter oversampling ratio (decimation rate) on
-- channel 2
AWFOSR : DFSDM_AWSCD2R_AWFOSR_Field := 16#0#;
-- unspecified
Reserved_21_21 : HAL.Bit := 16#0#;
-- Analog watchdog Sinc filter order on channel 2
AWFORD : DFSDM_AWSCD2R_AWFORD_Field := 16#0#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM_AWSCD2R_Register use record
SCDT at 0 range 0 .. 7;
Reserved_8_11 at 0 range 8 .. 11;
BKSCD at 0 range 12 .. 15;
AWFOSR at 0 range 16 .. 20;
Reserved_21_21 at 0 range 21 .. 21;
AWFORD at 0 range 22 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
subtype DFSDM_AWSCD3R_SCDT_Field is HAL.UInt8;
subtype DFSDM_AWSCD3R_BKSCD_Field is HAL.UInt4;
subtype DFSDM_AWSCD3R_AWFOSR_Field is HAL.UInt5;
subtype DFSDM_AWSCD3R_AWFORD_Field is HAL.UInt2;
-- DFSDM analog watchdog and short-circuit detector register
type DFSDM_AWSCD3R_Register is record
-- short-circuit detector threshold for channel 3
SCDT : DFSDM_AWSCD3R_SCDT_Field := 16#0#;
-- unspecified
Reserved_8_11 : HAL.UInt4 := 16#0#;
-- Break signal assignment for short-circuit detector on channel 3
BKSCD : DFSDM_AWSCD3R_BKSCD_Field := 16#0#;
-- Analog watchdog filter oversampling ratio (decimation rate) on
-- channel 3
AWFOSR : DFSDM_AWSCD3R_AWFOSR_Field := 16#0#;
-- unspecified
Reserved_21_21 : HAL.Bit := 16#0#;
-- Analog watchdog Sinc filter order on channel 3
AWFORD : DFSDM_AWSCD3R_AWFORD_Field := 16#0#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM_AWSCD3R_Register use record
SCDT at 0 range 0 .. 7;
Reserved_8_11 at 0 range 8 .. 11;
BKSCD at 0 range 12 .. 15;
AWFOSR at 0 range 16 .. 20;
Reserved_21_21 at 0 range 21 .. 21;
AWFORD at 0 range 22 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
subtype DFSDM_AWSCD4R_SCDT_Field is HAL.UInt8;
subtype DFSDM_AWSCD4R_BKSCD_Field is HAL.UInt4;
subtype DFSDM_AWSCD4R_AWFOSR_Field is HAL.UInt5;
subtype DFSDM_AWSCD4R_AWFORD_Field is HAL.UInt2;
-- DFSDM analog watchdog and short-circuit detector register
type DFSDM_AWSCD4R_Register is record
-- short-circuit detector threshold for channel 4
SCDT : DFSDM_AWSCD4R_SCDT_Field := 16#0#;
-- unspecified
Reserved_8_11 : HAL.UInt4 := 16#0#;
-- Break signal assignment for short-circuit detector on channel 4
BKSCD : DFSDM_AWSCD4R_BKSCD_Field := 16#0#;
-- Analog watchdog filter oversampling ratio (decimation rate) on
-- channel 4
AWFOSR : DFSDM_AWSCD4R_AWFOSR_Field := 16#0#;
-- unspecified
Reserved_21_21 : HAL.Bit := 16#0#;
-- Analog watchdog Sinc filter order on channel 4
AWFORD : DFSDM_AWSCD4R_AWFORD_Field := 16#0#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM_AWSCD4R_Register use record
SCDT at 0 range 0 .. 7;
Reserved_8_11 at 0 range 8 .. 11;
BKSCD at 0 range 12 .. 15;
AWFOSR at 0 range 16 .. 20;
Reserved_21_21 at 0 range 21 .. 21;
AWFORD at 0 range 22 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
subtype DFSDM_AWSCD5R_SCDT_Field is HAL.UInt8;
subtype DFSDM_AWSCD5R_BKSCD_Field is HAL.UInt4;
subtype DFSDM_AWSCD5R_AWFOSR_Field is HAL.UInt5;
subtype DFSDM_AWSCD5R_AWFORD_Field is HAL.UInt2;
-- DFSDM analog watchdog and short-circuit detector register
type DFSDM_AWSCD5R_Register is record
-- short-circuit detector threshold for channel 5
SCDT : DFSDM_AWSCD5R_SCDT_Field := 16#0#;
-- unspecified
Reserved_8_11 : HAL.UInt4 := 16#0#;
-- Break signal assignment for short-circuit detector on channel 5
BKSCD : DFSDM_AWSCD5R_BKSCD_Field := 16#0#;
-- Analog watchdog filter oversampling ratio (decimation rate) on
-- channel 5
AWFOSR : DFSDM_AWSCD5R_AWFOSR_Field := 16#0#;
-- unspecified
Reserved_21_21 : HAL.Bit := 16#0#;
-- Analog watchdog Sinc filter order on channel 5
AWFORD : DFSDM_AWSCD5R_AWFORD_Field := 16#0#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM_AWSCD5R_Register use record
SCDT at 0 range 0 .. 7;
Reserved_8_11 at 0 range 8 .. 11;
BKSCD at 0 range 12 .. 15;
AWFOSR at 0 range 16 .. 20;
Reserved_21_21 at 0 range 21 .. 21;
AWFORD at 0 range 22 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
subtype DFSDM_AWSCD6R_SCDT_Field is HAL.UInt8;
subtype DFSDM_AWSCD6R_BKSCD_Field is HAL.UInt4;
subtype DFSDM_AWSCD6R_AWFOSR_Field is HAL.UInt5;
subtype DFSDM_AWSCD6R_AWFORD_Field is HAL.UInt2;
-- DFSDM analog watchdog and short-circuit detector register
type DFSDM_AWSCD6R_Register is record
-- short-circuit detector threshold for channel 6
SCDT : DFSDM_AWSCD6R_SCDT_Field := 16#0#;
-- unspecified
Reserved_8_11 : HAL.UInt4 := 16#0#;
-- Break signal assignment for short-circuit detector on channel 6
BKSCD : DFSDM_AWSCD6R_BKSCD_Field := 16#0#;
-- Analog watchdog filter oversampling ratio (decimation rate) on
-- channel 6
AWFOSR : DFSDM_AWSCD6R_AWFOSR_Field := 16#0#;
-- unspecified
Reserved_21_21 : HAL.Bit := 16#0#;
-- Analog watchdog Sinc filter order on channel 6
AWFORD : DFSDM_AWSCD6R_AWFORD_Field := 16#0#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM_AWSCD6R_Register use record
SCDT at 0 range 0 .. 7;
Reserved_8_11 at 0 range 8 .. 11;
BKSCD at 0 range 12 .. 15;
AWFOSR at 0 range 16 .. 20;
Reserved_21_21 at 0 range 21 .. 21;
AWFORD at 0 range 22 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
subtype DFSDM_AWSCD7R_SCDT_Field is HAL.UInt8;
subtype DFSDM_AWSCD7R_BKSCD_Field is HAL.UInt4;
subtype DFSDM_AWSCD7R_AWFOSR_Field is HAL.UInt5;
subtype DFSDM_AWSCD7R_AWFORD_Field is HAL.UInt2;
-- DFSDM analog watchdog and short-circuit detector register
type DFSDM_AWSCD7R_Register is record
-- short-circuit detector threshold for channel 7
SCDT : DFSDM_AWSCD7R_SCDT_Field := 16#0#;
-- unspecified
Reserved_8_11 : HAL.UInt4 := 16#0#;
-- Break signal assignment for short-circuit detector on channel 7
BKSCD : DFSDM_AWSCD7R_BKSCD_Field := 16#0#;
-- Analog watchdog filter oversampling ratio (decimation rate) on
-- channel 7
AWFOSR : DFSDM_AWSCD7R_AWFOSR_Field := 16#0#;
-- unspecified
Reserved_21_21 : HAL.Bit := 16#0#;
-- Analog watchdog Sinc filter order on channel 7
AWFORD : DFSDM_AWSCD7R_AWFORD_Field := 16#0#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM_AWSCD7R_Register use record
SCDT at 0 range 0 .. 7;
Reserved_8_11 at 0 range 8 .. 11;
BKSCD at 0 range 12 .. 15;
AWFOSR at 0 range 16 .. 20;
Reserved_21_21 at 0 range 21 .. 21;
AWFORD at 0 range 22 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
subtype DFSDM_CHWDAT0R_WDATA_Field is HAL.UInt16;
-- DFSDM channel watchdog filter data register
type DFSDM_CHWDAT0R_Register is record
-- Read-only. Input channel y watchdog data
WDATA : DFSDM_CHWDAT0R_WDATA_Field;
-- unspecified
Reserved_16_31 : HAL.UInt16;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM_CHWDAT0R_Register use record
WDATA at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype DFSDM_CHWDAT1R_WDATA_Field is HAL.UInt16;
-- DFSDM channel watchdog filter data register
type DFSDM_CHWDAT1R_Register is record
-- Read-only. Input channel y watchdog data
WDATA : DFSDM_CHWDAT1R_WDATA_Field;
-- unspecified
Reserved_16_31 : HAL.UInt16;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM_CHWDAT1R_Register use record
WDATA at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype DFSDM_CHWDAT2R_WDATA_Field is HAL.UInt16;
-- DFSDM channel watchdog filter data register
type DFSDM_CHWDAT2R_Register is record
-- Read-only. Input channel y watchdog data
WDATA : DFSDM_CHWDAT2R_WDATA_Field;
-- unspecified
Reserved_16_31 : HAL.UInt16;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM_CHWDAT2R_Register use record
WDATA at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype DFSDM_CHWDAT3R_WDATA_Field is HAL.UInt16;
-- DFSDM channel watchdog filter data register
type DFSDM_CHWDAT3R_Register is record
-- Read-only. Input channel y watchdog data
WDATA : DFSDM_CHWDAT3R_WDATA_Field;
-- unspecified
Reserved_16_31 : HAL.UInt16;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM_CHWDAT3R_Register use record
WDATA at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype DFSDM_CHWDAT4R_WDATA_Field is HAL.UInt16;
-- DFSDM channel watchdog filter data register
type DFSDM_CHWDAT4R_Register is record
-- Read-only. Input channel y watchdog data
WDATA : DFSDM_CHWDAT4R_WDATA_Field;
-- unspecified
Reserved_16_31 : HAL.UInt16;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM_CHWDAT4R_Register use record
WDATA at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype DFSDM_CHWDAT5R_WDATA_Field is HAL.UInt16;
-- DFSDM channel watchdog filter data register
type DFSDM_CHWDAT5R_Register is record
-- Read-only. Input channel y watchdog data
WDATA : DFSDM_CHWDAT5R_WDATA_Field;
-- unspecified
Reserved_16_31 : HAL.UInt16;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM_CHWDAT5R_Register use record
WDATA at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype DFSDM_CHWDAT6R_WDATA_Field is HAL.UInt16;
-- DFSDM channel watchdog filter data register
type DFSDM_CHWDAT6R_Register is record
-- Read-only. Input channel y watchdog data
WDATA : DFSDM_CHWDAT6R_WDATA_Field;
-- unspecified
Reserved_16_31 : HAL.UInt16;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM_CHWDAT6R_Register use record
WDATA at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype DFSDM_CHWDAT7R_WDATA_Field is HAL.UInt16;
-- DFSDM channel watchdog filter data register
type DFSDM_CHWDAT7R_Register is record
-- Read-only. Input channel y watchdog data
WDATA : DFSDM_CHWDAT7R_WDATA_Field;
-- unspecified
Reserved_16_31 : HAL.UInt16;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM_CHWDAT7R_Register use record
WDATA at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
-- DFSDM_CHDATIN0R_INDAT array element
subtype DFSDM_CHDATIN0R_INDAT_Element is HAL.UInt16;
-- DFSDM_CHDATIN0R_INDAT array
type DFSDM_CHDATIN0R_INDAT_Field_Array is array (0 .. 1)
of DFSDM_CHDATIN0R_INDAT_Element
with Component_Size => 16, Size => 32;
-- DFSDM channel data input register
type DFSDM_CHDATIN0R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- INDAT as a value
Val : HAL.UInt32;
when True =>
-- INDAT as an array
Arr : DFSDM_CHDATIN0R_INDAT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for DFSDM_CHDATIN0R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- DFSDM_CHDATIN1R_INDAT array element
subtype DFSDM_CHDATIN1R_INDAT_Element is HAL.UInt16;
-- DFSDM_CHDATIN1R_INDAT array
type DFSDM_CHDATIN1R_INDAT_Field_Array is array (0 .. 1)
of DFSDM_CHDATIN1R_INDAT_Element
with Component_Size => 16, Size => 32;
-- DFSDM channel data input register
type DFSDM_CHDATIN1R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- INDAT as a value
Val : HAL.UInt32;
when True =>
-- INDAT as an array
Arr : DFSDM_CHDATIN1R_INDAT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for DFSDM_CHDATIN1R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- DFSDM_CHDATIN2R_INDAT array element
subtype DFSDM_CHDATIN2R_INDAT_Element is HAL.UInt16;
-- DFSDM_CHDATIN2R_INDAT array
type DFSDM_CHDATIN2R_INDAT_Field_Array is array (0 .. 1)
of DFSDM_CHDATIN2R_INDAT_Element
with Component_Size => 16, Size => 32;
-- DFSDM channel data input register
type DFSDM_CHDATIN2R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- INDAT as a value
Val : HAL.UInt32;
when True =>
-- INDAT as an array
Arr : DFSDM_CHDATIN2R_INDAT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for DFSDM_CHDATIN2R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- DFSDM_CHDATIN3R_INDAT array element
subtype DFSDM_CHDATIN3R_INDAT_Element is HAL.UInt16;
-- DFSDM_CHDATIN3R_INDAT array
type DFSDM_CHDATIN3R_INDAT_Field_Array is array (0 .. 1)
of DFSDM_CHDATIN3R_INDAT_Element
with Component_Size => 16, Size => 32;
-- DFSDM channel data input register
type DFSDM_CHDATIN3R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- INDAT as a value
Val : HAL.UInt32;
when True =>
-- INDAT as an array
Arr : DFSDM_CHDATIN3R_INDAT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for DFSDM_CHDATIN3R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- DFSDM_CHDATIN4R_INDAT array element
subtype DFSDM_CHDATIN4R_INDAT_Element is HAL.UInt16;
-- DFSDM_CHDATIN4R_INDAT array
type DFSDM_CHDATIN4R_INDAT_Field_Array is array (0 .. 1)
of DFSDM_CHDATIN4R_INDAT_Element
with Component_Size => 16, Size => 32;
-- DFSDM channel data input register
type DFSDM_CHDATIN4R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- INDAT as a value
Val : HAL.UInt32;
when True =>
-- INDAT as an array
Arr : DFSDM_CHDATIN4R_INDAT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for DFSDM_CHDATIN4R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- DFSDM_CHDATIN5R_INDAT array element
subtype DFSDM_CHDATIN5R_INDAT_Element is HAL.UInt16;
-- DFSDM_CHDATIN5R_INDAT array
type DFSDM_CHDATIN5R_INDAT_Field_Array is array (0 .. 1)
of DFSDM_CHDATIN5R_INDAT_Element
with Component_Size => 16, Size => 32;
-- DFSDM channel data input register
type DFSDM_CHDATIN5R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- INDAT as a value
Val : HAL.UInt32;
when True =>
-- INDAT as an array
Arr : DFSDM_CHDATIN5R_INDAT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for DFSDM_CHDATIN5R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- DFSDM_CHDATIN6R_INDAT array element
subtype DFSDM_CHDATIN6R_INDAT_Element is HAL.UInt16;
-- DFSDM_CHDATIN6R_INDAT array
type DFSDM_CHDATIN6R_INDAT_Field_Array is array (0 .. 1)
of DFSDM_CHDATIN6R_INDAT_Element
with Component_Size => 16, Size => 32;
-- DFSDM channel data input register
type DFSDM_CHDATIN6R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- INDAT as a value
Val : HAL.UInt32;
when True =>
-- INDAT as an array
Arr : DFSDM_CHDATIN6R_INDAT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for DFSDM_CHDATIN6R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- DFSDM_CHDATIN7R_INDAT array element
subtype DFSDM_CHDATIN7R_INDAT_Element is HAL.UInt16;
-- DFSDM_CHDATIN7R_INDAT array
type DFSDM_CHDATIN7R_INDAT_Field_Array is array (0 .. 1)
of DFSDM_CHDATIN7R_INDAT_Element
with Component_Size => 16, Size => 32;
-- DFSDM channel data input register
type DFSDM_CHDATIN7R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- INDAT as a value
Val : HAL.UInt32;
when True =>
-- INDAT as an array
Arr : DFSDM_CHDATIN7R_INDAT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for DFSDM_CHDATIN7R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
subtype DFSDM0_CR1_JEXTSEL_Field is HAL.UInt5;
subtype DFSDM0_CR1_JEXTEN_Field is HAL.UInt2;
subtype DFSDM0_CR1_RCH_Field is HAL.UInt3;
-- DFSDM control register 1
type DFSDM0_CR1_Register is record
-- DFSDM enable
DFEN : Boolean := False;
-- Start a conversion of the injected group of channels
JSWSTART : Boolean := False;
-- unspecified
Reserved_2_2 : HAL.Bit := 16#0#;
-- Launch an injected conversion synchronously with the DFSDM0 JSWSTART
-- trigger
JSYNC : Boolean := False;
-- Scanning conversion mode for injected conversions
JSCAN : Boolean := False;
-- DMA channel enabled to read data for the injected channel group
JDMAEN : Boolean := False;
-- unspecified
Reserved_6_7 : HAL.UInt2 := 16#0#;
-- Trigger signal selection for launching injected conversions
JEXTSEL : DFSDM0_CR1_JEXTSEL_Field := 16#0#;
-- Trigger enable and trigger edge selection for injected conversions
JEXTEN : DFSDM0_CR1_JEXTEN_Field := 16#0#;
-- unspecified
Reserved_15_16 : HAL.UInt2 := 16#0#;
-- Software start of a conversion on the regular channel
RSWSTART : Boolean := False;
-- Continuous mode selection for regular conversions
RCONT : Boolean := False;
-- Launch regular conversion synchronously with DFSDM0
RSYNC : Boolean := False;
-- unspecified
Reserved_20_20 : HAL.Bit := 16#0#;
-- DMA channel enabled to read data for the regular conversion
RDMAEN : Boolean := False;
-- unspecified
Reserved_22_23 : HAL.UInt2 := 16#0#;
-- Regular channel selection
RCH : DFSDM0_CR1_RCH_Field := 16#0#;
-- unspecified
Reserved_27_28 : HAL.UInt2 := 16#0#;
-- Fast conversion mode selection for regular conversions
FAST : Boolean := False;
-- Analog watchdog fast mode select
AWFSEL : Boolean := False;
-- unspecified
Reserved_31_31 : HAL.Bit := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM0_CR1_Register use record
DFEN at 0 range 0 .. 0;
JSWSTART at 0 range 1 .. 1;
Reserved_2_2 at 0 range 2 .. 2;
JSYNC at 0 range 3 .. 3;
JSCAN at 0 range 4 .. 4;
JDMAEN at 0 range 5 .. 5;
Reserved_6_7 at 0 range 6 .. 7;
JEXTSEL at 0 range 8 .. 12;
JEXTEN at 0 range 13 .. 14;
Reserved_15_16 at 0 range 15 .. 16;
RSWSTART at 0 range 17 .. 17;
RCONT at 0 range 18 .. 18;
RSYNC at 0 range 19 .. 19;
Reserved_20_20 at 0 range 20 .. 20;
RDMAEN at 0 range 21 .. 21;
Reserved_22_23 at 0 range 22 .. 23;
RCH at 0 range 24 .. 26;
Reserved_27_28 at 0 range 27 .. 28;
FAST at 0 range 29 .. 29;
AWFSEL at 0 range 30 .. 30;
Reserved_31_31 at 0 range 31 .. 31;
end record;
subtype DFSDM1_CR1_JEXTSEL_Field is HAL.UInt5;
subtype DFSDM1_CR1_JEXTEN_Field is HAL.UInt2;
subtype DFSDM1_CR1_RCH_Field is HAL.UInt3;
-- DFSDM control register 1
type DFSDM1_CR1_Register is record
-- DFSDM enable
DFEN : Boolean := False;
-- Start a conversion of the injected group of channels
JSWSTART : Boolean := False;
-- unspecified
Reserved_2_2 : HAL.Bit := 16#0#;
-- Launch an injected conversion synchronously with the DFSDM0 JSWSTART
-- trigger
JSYNC : Boolean := False;
-- Scanning conversion mode for injected conversions
JSCAN : Boolean := False;
-- DMA channel enabled to read data for the injected channel group
JDMAEN : Boolean := False;
-- unspecified
Reserved_6_7 : HAL.UInt2 := 16#0#;
-- Trigger signal selection for launching injected conversions
JEXTSEL : DFSDM1_CR1_JEXTSEL_Field := 16#0#;
-- Trigger enable and trigger edge selection for injected conversions
JEXTEN : DFSDM1_CR1_JEXTEN_Field := 16#0#;
-- unspecified
Reserved_15_16 : HAL.UInt2 := 16#0#;
-- Software start of a conversion on the regular channel
RSWSTART : Boolean := False;
-- Continuous mode selection for regular conversions
RCONT : Boolean := False;
-- Launch regular conversion synchronously with DFSDM0
RSYNC : Boolean := False;
-- unspecified
Reserved_20_20 : HAL.Bit := 16#0#;
-- DMA channel enabled to read data for the regular conversion
RDMAEN : Boolean := False;
-- unspecified
Reserved_22_23 : HAL.UInt2 := 16#0#;
-- Regular channel selection
RCH : DFSDM1_CR1_RCH_Field := 16#0#;
-- unspecified
Reserved_27_28 : HAL.UInt2 := 16#0#;
-- Fast conversion mode selection for regular conversions
FAST : Boolean := False;
-- Analog watchdog fast mode select
AWFSEL : Boolean := False;
-- unspecified
Reserved_31_31 : HAL.Bit := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM1_CR1_Register use record
DFEN at 0 range 0 .. 0;
JSWSTART at 0 range 1 .. 1;
Reserved_2_2 at 0 range 2 .. 2;
JSYNC at 0 range 3 .. 3;
JSCAN at 0 range 4 .. 4;
JDMAEN at 0 range 5 .. 5;
Reserved_6_7 at 0 range 6 .. 7;
JEXTSEL at 0 range 8 .. 12;
JEXTEN at 0 range 13 .. 14;
Reserved_15_16 at 0 range 15 .. 16;
RSWSTART at 0 range 17 .. 17;
RCONT at 0 range 18 .. 18;
RSYNC at 0 range 19 .. 19;
Reserved_20_20 at 0 range 20 .. 20;
RDMAEN at 0 range 21 .. 21;
Reserved_22_23 at 0 range 22 .. 23;
RCH at 0 range 24 .. 26;
Reserved_27_28 at 0 range 27 .. 28;
FAST at 0 range 29 .. 29;
AWFSEL at 0 range 30 .. 30;
Reserved_31_31 at 0 range 31 .. 31;
end record;
subtype DFSDM2_CR1_JEXTSEL_Field is HAL.UInt5;
subtype DFSDM2_CR1_JEXTEN_Field is HAL.UInt2;
subtype DFSDM2_CR1_RCH_Field is HAL.UInt3;
-- DFSDM control register 1
type DFSDM2_CR1_Register is record
-- DFSDM enable
DFEN : Boolean := False;
-- Start a conversion of the injected group of channels
JSWSTART : Boolean := False;
-- unspecified
Reserved_2_2 : HAL.Bit := 16#0#;
-- Launch an injected conversion synchronously with the DFSDM0 JSWSTART
-- trigger
JSYNC : Boolean := False;
-- Scanning conversion mode for injected conversions
JSCAN : Boolean := False;
-- DMA channel enabled to read data for the injected channel group
JDMAEN : Boolean := False;
-- unspecified
Reserved_6_7 : HAL.UInt2 := 16#0#;
-- Trigger signal selection for launching injected conversions
JEXTSEL : DFSDM2_CR1_JEXTSEL_Field := 16#0#;
-- Trigger enable and trigger edge selection for injected conversions
JEXTEN : DFSDM2_CR1_JEXTEN_Field := 16#0#;
-- unspecified
Reserved_15_16 : HAL.UInt2 := 16#0#;
-- Software start of a conversion on the regular channel
RSWSTART : Boolean := False;
-- Continuous mode selection for regular conversions
RCONT : Boolean := False;
-- Launch regular conversion synchronously with DFSDM0
RSYNC : Boolean := False;
-- unspecified
Reserved_20_20 : HAL.Bit := 16#0#;
-- DMA channel enabled to read data for the regular conversion
RDMAEN : Boolean := False;
-- unspecified
Reserved_22_23 : HAL.UInt2 := 16#0#;
-- Regular channel selection
RCH : DFSDM2_CR1_RCH_Field := 16#0#;
-- unspecified
Reserved_27_28 : HAL.UInt2 := 16#0#;
-- Fast conversion mode selection for regular conversions
FAST : Boolean := False;
-- Analog watchdog fast mode select
AWFSEL : Boolean := False;
-- unspecified
Reserved_31_31 : HAL.Bit := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM2_CR1_Register use record
DFEN at 0 range 0 .. 0;
JSWSTART at 0 range 1 .. 1;
Reserved_2_2 at 0 range 2 .. 2;
JSYNC at 0 range 3 .. 3;
JSCAN at 0 range 4 .. 4;
JDMAEN at 0 range 5 .. 5;
Reserved_6_7 at 0 range 6 .. 7;
JEXTSEL at 0 range 8 .. 12;
JEXTEN at 0 range 13 .. 14;
Reserved_15_16 at 0 range 15 .. 16;
RSWSTART at 0 range 17 .. 17;
RCONT at 0 range 18 .. 18;
RSYNC at 0 range 19 .. 19;
Reserved_20_20 at 0 range 20 .. 20;
RDMAEN at 0 range 21 .. 21;
Reserved_22_23 at 0 range 22 .. 23;
RCH at 0 range 24 .. 26;
Reserved_27_28 at 0 range 27 .. 28;
FAST at 0 range 29 .. 29;
AWFSEL at 0 range 30 .. 30;
Reserved_31_31 at 0 range 31 .. 31;
end record;
subtype DFSDM3_CR1_JEXTSEL_Field is HAL.UInt5;
subtype DFSDM3_CR1_JEXTEN_Field is HAL.UInt2;
subtype DFSDM3_CR1_RCH_Field is HAL.UInt3;
-- DFSDM control register 1
type DFSDM3_CR1_Register is record
-- DFSDM enable
DFEN : Boolean := False;
-- Start a conversion of the injected group of channels
JSWSTART : Boolean := False;
-- unspecified
Reserved_2_2 : HAL.Bit := 16#0#;
-- Launch an injected conversion synchronously with the DFSDM0 JSWSTART
-- trigger
JSYNC : Boolean := False;
-- Scanning conversion mode for injected conversions
JSCAN : Boolean := False;
-- DMA channel enabled to read data for the injected channel group
JDMAEN : Boolean := False;
-- unspecified
Reserved_6_7 : HAL.UInt2 := 16#0#;
-- Trigger signal selection for launching injected conversions
JEXTSEL : DFSDM3_CR1_JEXTSEL_Field := 16#0#;
-- Trigger enable and trigger edge selection for injected conversions
JEXTEN : DFSDM3_CR1_JEXTEN_Field := 16#0#;
-- unspecified
Reserved_15_16 : HAL.UInt2 := 16#0#;
-- Software start of a conversion on the regular channel
RSWSTART : Boolean := False;
-- Continuous mode selection for regular conversions
RCONT : Boolean := False;
-- Launch regular conversion synchronously with DFSDM0
RSYNC : Boolean := False;
-- unspecified
Reserved_20_20 : HAL.Bit := 16#0#;
-- DMA channel enabled to read data for the regular conversion
RDMAEN : Boolean := False;
-- unspecified
Reserved_22_23 : HAL.UInt2 := 16#0#;
-- Regular channel selection
RCH : DFSDM3_CR1_RCH_Field := 16#0#;
-- unspecified
Reserved_27_28 : HAL.UInt2 := 16#0#;
-- Fast conversion mode selection for regular conversions
FAST : Boolean := False;
-- Analog watchdog fast mode select
AWFSEL : Boolean := False;
-- unspecified
Reserved_31_31 : HAL.Bit := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM3_CR1_Register use record
DFEN at 0 range 0 .. 0;
JSWSTART at 0 range 1 .. 1;
Reserved_2_2 at 0 range 2 .. 2;
JSYNC at 0 range 3 .. 3;
JSCAN at 0 range 4 .. 4;
JDMAEN at 0 range 5 .. 5;
Reserved_6_7 at 0 range 6 .. 7;
JEXTSEL at 0 range 8 .. 12;
JEXTEN at 0 range 13 .. 14;
Reserved_15_16 at 0 range 15 .. 16;
RSWSTART at 0 range 17 .. 17;
RCONT at 0 range 18 .. 18;
RSYNC at 0 range 19 .. 19;
Reserved_20_20 at 0 range 20 .. 20;
RDMAEN at 0 range 21 .. 21;
Reserved_22_23 at 0 range 22 .. 23;
RCH at 0 range 24 .. 26;
Reserved_27_28 at 0 range 27 .. 28;
FAST at 0 range 29 .. 29;
AWFSEL at 0 range 30 .. 30;
Reserved_31_31 at 0 range 31 .. 31;
end record;
subtype DFSDM0_CR2_EXCH_Field is HAL.UInt8;
subtype DFSDM0_CR2_AWDCH_Field is HAL.UInt8;
-- DFSDM control register 2
type DFSDM0_CR2_Register is record
-- Injected end of conversion interrupt enable
JEOCIE : Boolean := False;
-- Regular end of conversion interrupt enable
REOCIE : Boolean := False;
-- Injected data overrun interrupt enable
JOVRIE : Boolean := False;
-- Regular data overrun interrupt enable
ROVRIE : Boolean := False;
-- Analog watchdog interrupt enable
AWDIE : Boolean := False;
-- Short-circuit detector interrupt enable
SCDIE : Boolean := False;
-- Clock absence interrupt enable
CKABIE : Boolean := False;
-- unspecified
Reserved_7_7 : HAL.Bit := 16#0#;
-- Extremes detector channel selection
EXCH : DFSDM0_CR2_EXCH_Field := 16#0#;
-- Analog watchdog channel selection
AWDCH : DFSDM0_CR2_AWDCH_Field := 16#0#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM0_CR2_Register use record
JEOCIE at 0 range 0 .. 0;
REOCIE at 0 range 1 .. 1;
JOVRIE at 0 range 2 .. 2;
ROVRIE at 0 range 3 .. 3;
AWDIE at 0 range 4 .. 4;
SCDIE at 0 range 5 .. 5;
CKABIE at 0 range 6 .. 6;
Reserved_7_7 at 0 range 7 .. 7;
EXCH at 0 range 8 .. 15;
AWDCH at 0 range 16 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
subtype DFSDM1_CR2_EXCH_Field is HAL.UInt8;
subtype DFSDM1_CR2_AWDCH_Field is HAL.UInt8;
-- DFSDM control register 2
type DFSDM1_CR2_Register is record
-- Injected end of conversion interrupt enable
JEOCIE : Boolean := False;
-- Regular end of conversion interrupt enable
REOCIE : Boolean := False;
-- Injected data overrun interrupt enable
JOVRIE : Boolean := False;
-- Regular data overrun interrupt enable
ROVRIE : Boolean := False;
-- Analog watchdog interrupt enable
AWDIE : Boolean := False;
-- Short-circuit detector interrupt enable
SCDIE : Boolean := False;
-- Clock absence interrupt enable
CKABIE : Boolean := False;
-- unspecified
Reserved_7_7 : HAL.Bit := 16#0#;
-- Extremes detector channel selection
EXCH : DFSDM1_CR2_EXCH_Field := 16#0#;
-- Analog watchdog channel selection
AWDCH : DFSDM1_CR2_AWDCH_Field := 16#0#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM1_CR2_Register use record
JEOCIE at 0 range 0 .. 0;
REOCIE at 0 range 1 .. 1;
JOVRIE at 0 range 2 .. 2;
ROVRIE at 0 range 3 .. 3;
AWDIE at 0 range 4 .. 4;
SCDIE at 0 range 5 .. 5;
CKABIE at 0 range 6 .. 6;
Reserved_7_7 at 0 range 7 .. 7;
EXCH at 0 range 8 .. 15;
AWDCH at 0 range 16 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
subtype DFSDM2_CR2_EXCH_Field is HAL.UInt8;
subtype DFSDM2_CR2_AWDCH_Field is HAL.UInt8;
-- DFSDM control register 2
type DFSDM2_CR2_Register is record
-- Injected end of conversion interrupt enable
JEOCIE : Boolean := False;
-- Regular end of conversion interrupt enable
REOCIE : Boolean := False;
-- Injected data overrun interrupt enable
JOVRIE : Boolean := False;
-- Regular data overrun interrupt enable
ROVRIE : Boolean := False;
-- Analog watchdog interrupt enable
AWDIE : Boolean := False;
-- Short-circuit detector interrupt enable
SCDIE : Boolean := False;
-- Clock absence interrupt enable
CKABIE : Boolean := False;
-- unspecified
Reserved_7_7 : HAL.Bit := 16#0#;
-- Extremes detector channel selection
EXCH : DFSDM2_CR2_EXCH_Field := 16#0#;
-- Analog watchdog channel selection
AWDCH : DFSDM2_CR2_AWDCH_Field := 16#0#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM2_CR2_Register use record
JEOCIE at 0 range 0 .. 0;
REOCIE at 0 range 1 .. 1;
JOVRIE at 0 range 2 .. 2;
ROVRIE at 0 range 3 .. 3;
AWDIE at 0 range 4 .. 4;
SCDIE at 0 range 5 .. 5;
CKABIE at 0 range 6 .. 6;
Reserved_7_7 at 0 range 7 .. 7;
EXCH at 0 range 8 .. 15;
AWDCH at 0 range 16 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
subtype DFSDM3_CR2_EXCH_Field is HAL.UInt8;
subtype DFSDM3_CR2_AWDCH_Field is HAL.UInt8;
-- DFSDM control register 2
type DFSDM3_CR2_Register is record
-- Injected end of conversion interrupt enable
JEOCIE : Boolean := False;
-- Regular end of conversion interrupt enable
REOCIE : Boolean := False;
-- Injected data overrun interrupt enable
JOVRIE : Boolean := False;
-- Regular data overrun interrupt enable
ROVRIE : Boolean := False;
-- Analog watchdog interrupt enable
AWDIE : Boolean := False;
-- Short-circuit detector interrupt enable
SCDIE : Boolean := False;
-- Clock absence interrupt enable
CKABIE : Boolean := False;
-- unspecified
Reserved_7_7 : HAL.Bit := 16#0#;
-- Extremes detector channel selection
EXCH : DFSDM3_CR2_EXCH_Field := 16#0#;
-- Analog watchdog channel selection
AWDCH : DFSDM3_CR2_AWDCH_Field := 16#0#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM3_CR2_Register use record
JEOCIE at 0 range 0 .. 0;
REOCIE at 0 range 1 .. 1;
JOVRIE at 0 range 2 .. 2;
ROVRIE at 0 range 3 .. 3;
AWDIE at 0 range 4 .. 4;
SCDIE at 0 range 5 .. 5;
CKABIE at 0 range 6 .. 6;
Reserved_7_7 at 0 range 7 .. 7;
EXCH at 0 range 8 .. 15;
AWDCH at 0 range 16 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
subtype DFSDM0_ISR_CKABF_Field is HAL.UInt8;
subtype DFSDM0_ISR_SCDF_Field is HAL.UInt8;
-- DFSDM interrupt and status register
type DFSDM0_ISR_Register is record
-- Read-only. End of injected conversion flag
JEOCF : Boolean;
-- Read-only. End of regular conversion flag
REOCF : Boolean;
-- Read-only. Injected conversion overrun flag
JOVRF : Boolean;
-- Read-only. Regular conversion overrun flag
ROVRF : Boolean;
-- Read-only. Analog watchdog
AWDF : Boolean;
-- unspecified
Reserved_5_12 : HAL.UInt8;
-- Read-only. Injected conversion in progress status
JCIP : Boolean;
-- Read-only. Regular conversion in progress status
RCIP : Boolean;
-- unspecified
Reserved_15_15 : HAL.Bit;
-- Read-only. Clock absence flag
CKABF : DFSDM0_ISR_CKABF_Field;
-- Read-only. short-circuit detector flag
SCDF : DFSDM0_ISR_SCDF_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM0_ISR_Register use record
JEOCF at 0 range 0 .. 0;
REOCF at 0 range 1 .. 1;
JOVRF at 0 range 2 .. 2;
ROVRF at 0 range 3 .. 3;
AWDF at 0 range 4 .. 4;
Reserved_5_12 at 0 range 5 .. 12;
JCIP at 0 range 13 .. 13;
RCIP at 0 range 14 .. 14;
Reserved_15_15 at 0 range 15 .. 15;
CKABF at 0 range 16 .. 23;
SCDF at 0 range 24 .. 31;
end record;
subtype DFSDM1_ISR_CKABF_Field is HAL.UInt8;
subtype DFSDM1_ISR_SCDF_Field is HAL.UInt8;
-- DFSDM interrupt and status register
type DFSDM1_ISR_Register is record
-- Read-only. End of injected conversion flag
JEOCF : Boolean;
-- Read-only. End of regular conversion flag
REOCF : Boolean;
-- Read-only. Injected conversion overrun flag
JOVRF : Boolean;
-- Read-only. Regular conversion overrun flag
ROVRF : Boolean;
-- Read-only. Analog watchdog
AWDF : Boolean;
-- unspecified
Reserved_5_12 : HAL.UInt8;
-- Read-only. Injected conversion in progress status
JCIP : Boolean;
-- Read-only. Regular conversion in progress status
RCIP : Boolean;
-- unspecified
Reserved_15_15 : HAL.Bit;
-- Read-only. Clock absence flag
CKABF : DFSDM1_ISR_CKABF_Field;
-- Read-only. short-circuit detector flag
SCDF : DFSDM1_ISR_SCDF_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM1_ISR_Register use record
JEOCF at 0 range 0 .. 0;
REOCF at 0 range 1 .. 1;
JOVRF at 0 range 2 .. 2;
ROVRF at 0 range 3 .. 3;
AWDF at 0 range 4 .. 4;
Reserved_5_12 at 0 range 5 .. 12;
JCIP at 0 range 13 .. 13;
RCIP at 0 range 14 .. 14;
Reserved_15_15 at 0 range 15 .. 15;
CKABF at 0 range 16 .. 23;
SCDF at 0 range 24 .. 31;
end record;
subtype DFSDM2_ISR_CKABF_Field is HAL.UInt8;
subtype DFSDM2_ISR_SCDF_Field is HAL.UInt8;
-- DFSDM interrupt and status register
type DFSDM2_ISR_Register is record
-- Read-only. End of injected conversion flag
JEOCF : Boolean;
-- Read-only. End of regular conversion flag
REOCF : Boolean;
-- Read-only. Injected conversion overrun flag
JOVRF : Boolean;
-- Read-only. Regular conversion overrun flag
ROVRF : Boolean;
-- Read-only. Analog watchdog
AWDF : Boolean;
-- unspecified
Reserved_5_12 : HAL.UInt8;
-- Read-only. Injected conversion in progress status
JCIP : Boolean;
-- Read-only. Regular conversion in progress status
RCIP : Boolean;
-- unspecified
Reserved_15_15 : HAL.Bit;
-- Read-only. Clock absence flag
CKABF : DFSDM2_ISR_CKABF_Field;
-- Read-only. short-circuit detector flag
SCDF : DFSDM2_ISR_SCDF_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM2_ISR_Register use record
JEOCF at 0 range 0 .. 0;
REOCF at 0 range 1 .. 1;
JOVRF at 0 range 2 .. 2;
ROVRF at 0 range 3 .. 3;
AWDF at 0 range 4 .. 4;
Reserved_5_12 at 0 range 5 .. 12;
JCIP at 0 range 13 .. 13;
RCIP at 0 range 14 .. 14;
Reserved_15_15 at 0 range 15 .. 15;
CKABF at 0 range 16 .. 23;
SCDF at 0 range 24 .. 31;
end record;
subtype DFSDM3_ISR_CKABF_Field is HAL.UInt8;
subtype DFSDM3_ISR_SCDF_Field is HAL.UInt8;
-- DFSDM interrupt and status register
type DFSDM3_ISR_Register is record
-- Read-only. End of injected conversion flag
JEOCF : Boolean;
-- Read-only. End of regular conversion flag
REOCF : Boolean;
-- Read-only. Injected conversion overrun flag
JOVRF : Boolean;
-- Read-only. Regular conversion overrun flag
ROVRF : Boolean;
-- Read-only. Analog watchdog
AWDF : Boolean;
-- unspecified
Reserved_5_12 : HAL.UInt8;
-- Read-only. Injected conversion in progress status
JCIP : Boolean;
-- Read-only. Regular conversion in progress status
RCIP : Boolean;
-- unspecified
Reserved_15_15 : HAL.Bit;
-- Read-only. Clock absence flag
CKABF : DFSDM3_ISR_CKABF_Field;
-- Read-only. short-circuit detector flag
SCDF : DFSDM3_ISR_SCDF_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM3_ISR_Register use record
JEOCF at 0 range 0 .. 0;
REOCF at 0 range 1 .. 1;
JOVRF at 0 range 2 .. 2;
ROVRF at 0 range 3 .. 3;
AWDF at 0 range 4 .. 4;
Reserved_5_12 at 0 range 5 .. 12;
JCIP at 0 range 13 .. 13;
RCIP at 0 range 14 .. 14;
Reserved_15_15 at 0 range 15 .. 15;
CKABF at 0 range 16 .. 23;
SCDF at 0 range 24 .. 31;
end record;
subtype DFSDM0_ICR_CLRCKABF_Field is HAL.UInt8;
subtype DFSDM0_ICR_CLRSCDF_Field is HAL.UInt8;
-- DFSDM interrupt flag clear register
type DFSDM0_ICR_Register is record
-- unspecified
Reserved_0_1 : HAL.UInt2 := 16#0#;
-- Clear the injected conversion overrun flag
CLRJOVRF : Boolean := False;
-- Clear the regular conversion overrun flag
CLRROVRF : Boolean := False;
-- unspecified
Reserved_4_15 : HAL.UInt12 := 16#0#;
-- Clear the clock absence flag
CLRCKABF : DFSDM0_ICR_CLRCKABF_Field := 16#0#;
-- Clear the short-circuit detector flag
CLRSCDF : DFSDM0_ICR_CLRSCDF_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM0_ICR_Register use record
Reserved_0_1 at 0 range 0 .. 1;
CLRJOVRF at 0 range 2 .. 2;
CLRROVRF at 0 range 3 .. 3;
Reserved_4_15 at 0 range 4 .. 15;
CLRCKABF at 0 range 16 .. 23;
CLRSCDF at 0 range 24 .. 31;
end record;
subtype DFSDM1_ICR_CLRCKABF_Field is HAL.UInt8;
subtype DFSDM1_ICR_CLRSCDF_Field is HAL.UInt8;
-- DFSDM interrupt flag clear register
type DFSDM1_ICR_Register is record
-- unspecified
Reserved_0_1 : HAL.UInt2 := 16#0#;
-- Clear the injected conversion overrun flag
CLRJOVRF : Boolean := False;
-- Clear the regular conversion overrun flag
CLRROVRF : Boolean := False;
-- unspecified
Reserved_4_15 : HAL.UInt12 := 16#0#;
-- Clear the clock absence flag
CLRCKABF : DFSDM1_ICR_CLRCKABF_Field := 16#0#;
-- Clear the short-circuit detector flag
CLRSCDF : DFSDM1_ICR_CLRSCDF_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM1_ICR_Register use record
Reserved_0_1 at 0 range 0 .. 1;
CLRJOVRF at 0 range 2 .. 2;
CLRROVRF at 0 range 3 .. 3;
Reserved_4_15 at 0 range 4 .. 15;
CLRCKABF at 0 range 16 .. 23;
CLRSCDF at 0 range 24 .. 31;
end record;
subtype DFSDM2_ICR_CLRCKABF_Field is HAL.UInt8;
subtype DFSDM2_ICR_CLRSCDF_Field is HAL.UInt8;
-- DFSDM interrupt flag clear register
type DFSDM2_ICR_Register is record
-- unspecified
Reserved_0_1 : HAL.UInt2 := 16#0#;
-- Clear the injected conversion overrun flag
CLRJOVRF : Boolean := False;
-- Clear the regular conversion overrun flag
CLRROVRF : Boolean := False;
-- unspecified
Reserved_4_15 : HAL.UInt12 := 16#0#;
-- Clear the clock absence flag
CLRCKABF : DFSDM2_ICR_CLRCKABF_Field := 16#0#;
-- Clear the short-circuit detector flag
CLRSCDF : DFSDM2_ICR_CLRSCDF_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM2_ICR_Register use record
Reserved_0_1 at 0 range 0 .. 1;
CLRJOVRF at 0 range 2 .. 2;
CLRROVRF at 0 range 3 .. 3;
Reserved_4_15 at 0 range 4 .. 15;
CLRCKABF at 0 range 16 .. 23;
CLRSCDF at 0 range 24 .. 31;
end record;
subtype DFSDM3_ICR_CLRCKABF_Field is HAL.UInt8;
subtype DFSDM3_ICR_CLRSCDF_Field is HAL.UInt8;
-- DFSDM interrupt flag clear register
type DFSDM3_ICR_Register is record
-- unspecified
Reserved_0_1 : HAL.UInt2 := 16#0#;
-- Clear the injected conversion overrun flag
CLRJOVRF : Boolean := False;
-- Clear the regular conversion overrun flag
CLRROVRF : Boolean := False;
-- unspecified
Reserved_4_15 : HAL.UInt12 := 16#0#;
-- Clear the clock absence flag
CLRCKABF : DFSDM3_ICR_CLRCKABF_Field := 16#0#;
-- Clear the short-circuit detector flag
CLRSCDF : DFSDM3_ICR_CLRSCDF_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM3_ICR_Register use record
Reserved_0_1 at 0 range 0 .. 1;
CLRJOVRF at 0 range 2 .. 2;
CLRROVRF at 0 range 3 .. 3;
Reserved_4_15 at 0 range 4 .. 15;
CLRCKABF at 0 range 16 .. 23;
CLRSCDF at 0 range 24 .. 31;
end record;
subtype DFSDM0_JCHGR_JCHG_Field is HAL.UInt8;
-- DFSDM injected channel group selection register
type DFSDM0_JCHGR_Register is record
-- Injected channel group selection
JCHG : DFSDM0_JCHGR_JCHG_Field := 16#0#;
-- unspecified
Reserved_8_31 : HAL.UInt24 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM0_JCHGR_Register use record
JCHG at 0 range 0 .. 7;
Reserved_8_31 at 0 range 8 .. 31;
end record;
subtype DFSDM1_JCHGR_JCHG_Field is HAL.UInt8;
-- DFSDM injected channel group selection register
type DFSDM1_JCHGR_Register is record
-- Injected channel group selection
JCHG : DFSDM1_JCHGR_JCHG_Field := 16#0#;
-- unspecified
Reserved_8_31 : HAL.UInt24 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM1_JCHGR_Register use record
JCHG at 0 range 0 .. 7;
Reserved_8_31 at 0 range 8 .. 31;
end record;
subtype DFSDM2_JCHGR_JCHG_Field is HAL.UInt8;
-- DFSDM injected channel group selection register
type DFSDM2_JCHGR_Register is record
-- Injected channel group selection
JCHG : DFSDM2_JCHGR_JCHG_Field := 16#0#;
-- unspecified
Reserved_8_31 : HAL.UInt24 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM2_JCHGR_Register use record
JCHG at 0 range 0 .. 7;
Reserved_8_31 at 0 range 8 .. 31;
end record;
subtype DFSDM3_JCHGR_JCHG_Field is HAL.UInt8;
-- DFSDM injected channel group selection register
type DFSDM3_JCHGR_Register is record
-- Injected channel group selection
JCHG : DFSDM3_JCHGR_JCHG_Field := 16#0#;
-- unspecified
Reserved_8_31 : HAL.UInt24 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM3_JCHGR_Register use record
JCHG at 0 range 0 .. 7;
Reserved_8_31 at 0 range 8 .. 31;
end record;
subtype DFSDM0_FCR_IOSR_Field is HAL.UInt8;
subtype DFSDM0_FCR_FOSR_Field is HAL.UInt10;
subtype DFSDM0_FCR_FORD_Field is HAL.UInt3;
-- DFSDM filter control register
type DFSDM0_FCR_Register is record
-- Integrator oversampling ratio (averaging length)
IOSR : DFSDM0_FCR_IOSR_Field := 16#0#;
-- unspecified
Reserved_8_15 : HAL.UInt8 := 16#0#;
-- Sinc filter oversampling ratio (decimation rate)
FOSR : DFSDM0_FCR_FOSR_Field := 16#0#;
-- unspecified
Reserved_26_28 : HAL.UInt3 := 16#0#;
-- Sinc filter order
FORD : DFSDM0_FCR_FORD_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM0_FCR_Register use record
IOSR at 0 range 0 .. 7;
Reserved_8_15 at 0 range 8 .. 15;
FOSR at 0 range 16 .. 25;
Reserved_26_28 at 0 range 26 .. 28;
FORD at 0 range 29 .. 31;
end record;
subtype DFSDM1_FCR_IOSR_Field is HAL.UInt8;
subtype DFSDM1_FCR_FOSR_Field is HAL.UInt10;
subtype DFSDM1_FCR_FORD_Field is HAL.UInt3;
-- DFSDM filter control register
type DFSDM1_FCR_Register is record
-- Integrator oversampling ratio (averaging length)
IOSR : DFSDM1_FCR_IOSR_Field := 16#0#;
-- unspecified
Reserved_8_15 : HAL.UInt8 := 16#0#;
-- Sinc filter oversampling ratio (decimation rate)
FOSR : DFSDM1_FCR_FOSR_Field := 16#0#;
-- unspecified
Reserved_26_28 : HAL.UInt3 := 16#0#;
-- Sinc filter order
FORD : DFSDM1_FCR_FORD_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM1_FCR_Register use record
IOSR at 0 range 0 .. 7;
Reserved_8_15 at 0 range 8 .. 15;
FOSR at 0 range 16 .. 25;
Reserved_26_28 at 0 range 26 .. 28;
FORD at 0 range 29 .. 31;
end record;
subtype DFSDM2_FCR_IOSR_Field is HAL.UInt8;
subtype DFSDM2_FCR_FOSR_Field is HAL.UInt10;
subtype DFSDM2_FCR_FORD_Field is HAL.UInt3;
-- DFSDM filter control register
type DFSDM2_FCR_Register is record
-- Integrator oversampling ratio (averaging length)
IOSR : DFSDM2_FCR_IOSR_Field := 16#0#;
-- unspecified
Reserved_8_15 : HAL.UInt8 := 16#0#;
-- Sinc filter oversampling ratio (decimation rate)
FOSR : DFSDM2_FCR_FOSR_Field := 16#0#;
-- unspecified
Reserved_26_28 : HAL.UInt3 := 16#0#;
-- Sinc filter order
FORD : DFSDM2_FCR_FORD_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM2_FCR_Register use record
IOSR at 0 range 0 .. 7;
Reserved_8_15 at 0 range 8 .. 15;
FOSR at 0 range 16 .. 25;
Reserved_26_28 at 0 range 26 .. 28;
FORD at 0 range 29 .. 31;
end record;
subtype DFSDM3_FCR_IOSR_Field is HAL.UInt8;
subtype DFSDM3_FCR_FOSR_Field is HAL.UInt10;
subtype DFSDM3_FCR_FORD_Field is HAL.UInt3;
-- DFSDM filter control register
type DFSDM3_FCR_Register is record
-- Integrator oversampling ratio (averaging length)
IOSR : DFSDM3_FCR_IOSR_Field := 16#0#;
-- unspecified
Reserved_8_15 : HAL.UInt8 := 16#0#;
-- Sinc filter oversampling ratio (decimation rate)
FOSR : DFSDM3_FCR_FOSR_Field := 16#0#;
-- unspecified
Reserved_26_28 : HAL.UInt3 := 16#0#;
-- Sinc filter order
FORD : DFSDM3_FCR_FORD_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM3_FCR_Register use record
IOSR at 0 range 0 .. 7;
Reserved_8_15 at 0 range 8 .. 15;
FOSR at 0 range 16 .. 25;
Reserved_26_28 at 0 range 26 .. 28;
FORD at 0 range 29 .. 31;
end record;
subtype DFSDM0_JDATAR_JDATACH_Field is HAL.UInt3;
subtype DFSDM0_JDATAR_JDATA_Field is HAL.UInt24;
-- DFSDM data register for injected group
type DFSDM0_JDATAR_Register is record
-- Read-only. Injected channel most recently converted
JDATACH : DFSDM0_JDATAR_JDATACH_Field;
-- unspecified
Reserved_3_7 : HAL.UInt5;
-- Read-only. Injected group conversion data
JDATA : DFSDM0_JDATAR_JDATA_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM0_JDATAR_Register use record
JDATACH at 0 range 0 .. 2;
Reserved_3_7 at 0 range 3 .. 7;
JDATA at 0 range 8 .. 31;
end record;
subtype DFSDM1_JDATAR_JDATACH_Field is HAL.UInt3;
subtype DFSDM1_JDATAR_JDATA_Field is HAL.UInt24;
-- DFSDM data register for injected group
type DFSDM1_JDATAR_Register is record
-- Read-only. Injected channel most recently converted
JDATACH : DFSDM1_JDATAR_JDATACH_Field;
-- unspecified
Reserved_3_7 : HAL.UInt5;
-- Read-only. Injected group conversion data
JDATA : DFSDM1_JDATAR_JDATA_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM1_JDATAR_Register use record
JDATACH at 0 range 0 .. 2;
Reserved_3_7 at 0 range 3 .. 7;
JDATA at 0 range 8 .. 31;
end record;
subtype DFSDM2_JDATAR_JDATACH_Field is HAL.UInt3;
subtype DFSDM2_JDATAR_JDATA_Field is HAL.UInt24;
-- DFSDM data register for injected group
type DFSDM2_JDATAR_Register is record
-- Read-only. Injected channel most recently converted
JDATACH : DFSDM2_JDATAR_JDATACH_Field;
-- unspecified
Reserved_3_7 : HAL.UInt5;
-- Read-only. Injected group conversion data
JDATA : DFSDM2_JDATAR_JDATA_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM2_JDATAR_Register use record
JDATACH at 0 range 0 .. 2;
Reserved_3_7 at 0 range 3 .. 7;
JDATA at 0 range 8 .. 31;
end record;
subtype DFSDM3_JDATAR_JDATACH_Field is HAL.UInt3;
subtype DFSDM3_JDATAR_JDATA_Field is HAL.UInt24;
-- DFSDM data register for injected group
type DFSDM3_JDATAR_Register is record
-- Read-only. Injected channel most recently converted
JDATACH : DFSDM3_JDATAR_JDATACH_Field;
-- unspecified
Reserved_3_7 : HAL.UInt5;
-- Read-only. Injected group conversion data
JDATA : DFSDM3_JDATAR_JDATA_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM3_JDATAR_Register use record
JDATACH at 0 range 0 .. 2;
Reserved_3_7 at 0 range 3 .. 7;
JDATA at 0 range 8 .. 31;
end record;
subtype DFSDM0_RDATAR_RDATACH_Field is HAL.UInt3;
subtype DFSDM0_RDATAR_RDATA_Field is HAL.UInt24;
-- DFSDM data register for the regular channel
type DFSDM0_RDATAR_Register is record
-- Read-only. Regular channel most recently converted
RDATACH : DFSDM0_RDATAR_RDATACH_Field;
-- unspecified
Reserved_3_3 : HAL.Bit;
-- Read-only. Regular channel pending data
RPEND : Boolean;
-- unspecified
Reserved_5_7 : HAL.UInt3;
-- Read-only. Regular channel conversion data
RDATA : DFSDM0_RDATAR_RDATA_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM0_RDATAR_Register use record
RDATACH at 0 range 0 .. 2;
Reserved_3_3 at 0 range 3 .. 3;
RPEND at 0 range 4 .. 4;
Reserved_5_7 at 0 range 5 .. 7;
RDATA at 0 range 8 .. 31;
end record;
subtype DFSDM1_RDATAR_RDATACH_Field is HAL.UInt3;
subtype DFSDM1_RDATAR_RDATA_Field is HAL.UInt24;
-- DFSDM data register for the regular channel
type DFSDM1_RDATAR_Register is record
-- Read-only. Regular channel most recently converted
RDATACH : DFSDM1_RDATAR_RDATACH_Field;
-- unspecified
Reserved_3_3 : HAL.Bit;
-- Read-only. Regular channel pending data
RPEND : Boolean;
-- unspecified
Reserved_5_7 : HAL.UInt3;
-- Read-only. Regular channel conversion data
RDATA : DFSDM1_RDATAR_RDATA_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM1_RDATAR_Register use record
RDATACH at 0 range 0 .. 2;
Reserved_3_3 at 0 range 3 .. 3;
RPEND at 0 range 4 .. 4;
Reserved_5_7 at 0 range 5 .. 7;
RDATA at 0 range 8 .. 31;
end record;
subtype DFSDM2_RDATAR_RDATACH_Field is HAL.UInt3;
subtype DFSDM2_RDATAR_RDATA_Field is HAL.UInt24;
-- DFSDM data register for the regular channel
type DFSDM2_RDATAR_Register is record
-- Read-only. Regular channel most recently converted
RDATACH : DFSDM2_RDATAR_RDATACH_Field;
-- unspecified
Reserved_3_3 : HAL.Bit;
-- Read-only. Regular channel pending data
RPEND : Boolean;
-- unspecified
Reserved_5_7 : HAL.UInt3;
-- Read-only. Regular channel conversion data
RDATA : DFSDM2_RDATAR_RDATA_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM2_RDATAR_Register use record
RDATACH at 0 range 0 .. 2;
Reserved_3_3 at 0 range 3 .. 3;
RPEND at 0 range 4 .. 4;
Reserved_5_7 at 0 range 5 .. 7;
RDATA at 0 range 8 .. 31;
end record;
subtype DFSDM3_RDATAR_RDATACH_Field is HAL.UInt3;
subtype DFSDM3_RDATAR_RDATA_Field is HAL.UInt24;
-- DFSDM data register for the regular channel
type DFSDM3_RDATAR_Register is record
-- Read-only. Regular channel most recently converted
RDATACH : DFSDM3_RDATAR_RDATACH_Field;
-- unspecified
Reserved_3_3 : HAL.Bit;
-- Read-only. Regular channel pending data
RPEND : Boolean;
-- unspecified
Reserved_5_7 : HAL.UInt3;
-- Read-only. Regular channel conversion data
RDATA : DFSDM3_RDATAR_RDATA_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM3_RDATAR_Register use record
RDATACH at 0 range 0 .. 2;
Reserved_3_3 at 0 range 3 .. 3;
RPEND at 0 range 4 .. 4;
Reserved_5_7 at 0 range 5 .. 7;
RDATA at 0 range 8 .. 31;
end record;
subtype DFSDM0_AWHTR_BKAWH_Field is HAL.UInt4;
subtype DFSDM0_AWHTR_AWHT_Field is HAL.UInt24;
-- DFSDM analog watchdog high threshold register
type DFSDM0_AWHTR_Register is record
-- Break signal assignment to analog watchdog high threshold event
BKAWH : DFSDM0_AWHTR_BKAWH_Field := 16#0#;
-- unspecified
Reserved_4_7 : HAL.UInt4 := 16#0#;
-- Analog watchdog high threshold
AWHT : DFSDM0_AWHTR_AWHT_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM0_AWHTR_Register use record
BKAWH at 0 range 0 .. 3;
Reserved_4_7 at 0 range 4 .. 7;
AWHT at 0 range 8 .. 31;
end record;
subtype DFSDM1_AWHTR_BKAWH_Field is HAL.UInt4;
subtype DFSDM1_AWHTR_AWHT_Field is HAL.UInt24;
-- DFSDM analog watchdog high threshold register
type DFSDM1_AWHTR_Register is record
-- Break signal assignment to analog watchdog high threshold event
BKAWH : DFSDM1_AWHTR_BKAWH_Field := 16#0#;
-- unspecified
Reserved_4_7 : HAL.UInt4 := 16#0#;
-- Analog watchdog high threshold
AWHT : DFSDM1_AWHTR_AWHT_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM1_AWHTR_Register use record
BKAWH at 0 range 0 .. 3;
Reserved_4_7 at 0 range 4 .. 7;
AWHT at 0 range 8 .. 31;
end record;
subtype DFSDM2_AWHTR_BKAWH_Field is HAL.UInt4;
subtype DFSDM2_AWHTR_AWHT_Field is HAL.UInt24;
-- DFSDM analog watchdog high threshold register
type DFSDM2_AWHTR_Register is record
-- Break signal assignment to analog watchdog high threshold event
BKAWH : DFSDM2_AWHTR_BKAWH_Field := 16#0#;
-- unspecified
Reserved_4_7 : HAL.UInt4 := 16#0#;
-- Analog watchdog high threshold
AWHT : DFSDM2_AWHTR_AWHT_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM2_AWHTR_Register use record
BKAWH at 0 range 0 .. 3;
Reserved_4_7 at 0 range 4 .. 7;
AWHT at 0 range 8 .. 31;
end record;
subtype DFSDM3_AWHTR_BKAWH_Field is HAL.UInt4;
subtype DFSDM3_AWHTR_AWHT_Field is HAL.UInt24;
-- DFSDM analog watchdog high threshold register
type DFSDM3_AWHTR_Register is record
-- Break signal assignment to analog watchdog high threshold event
BKAWH : DFSDM3_AWHTR_BKAWH_Field := 16#0#;
-- unspecified
Reserved_4_7 : HAL.UInt4 := 16#0#;
-- Analog watchdog high threshold
AWHT : DFSDM3_AWHTR_AWHT_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM3_AWHTR_Register use record
BKAWH at 0 range 0 .. 3;
Reserved_4_7 at 0 range 4 .. 7;
AWHT at 0 range 8 .. 31;
end record;
subtype DFSDM0_AWLTR_BKAWL_Field is HAL.UInt4;
subtype DFSDM0_AWLTR_AWLT_Field is HAL.UInt24;
-- DFSDM analog watchdog low threshold register
type DFSDM0_AWLTR_Register is record
-- Break signal assignment to analog watchdog low threshold event
BKAWL : DFSDM0_AWLTR_BKAWL_Field := 16#0#;
-- unspecified
Reserved_4_7 : HAL.UInt4 := 16#0#;
-- Analog watchdog low threshold
AWLT : DFSDM0_AWLTR_AWLT_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM0_AWLTR_Register use record
BKAWL at 0 range 0 .. 3;
Reserved_4_7 at 0 range 4 .. 7;
AWLT at 0 range 8 .. 31;
end record;
subtype DFSDM1_AWLTR_BKAWL_Field is HAL.UInt4;
subtype DFSDM1_AWLTR_AWLT_Field is HAL.UInt24;
-- DFSDM analog watchdog low threshold register
type DFSDM1_AWLTR_Register is record
-- Break signal assignment to analog watchdog low threshold event
BKAWL : DFSDM1_AWLTR_BKAWL_Field := 16#0#;
-- unspecified
Reserved_4_7 : HAL.UInt4 := 16#0#;
-- Analog watchdog low threshold
AWLT : DFSDM1_AWLTR_AWLT_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM1_AWLTR_Register use record
BKAWL at 0 range 0 .. 3;
Reserved_4_7 at 0 range 4 .. 7;
AWLT at 0 range 8 .. 31;
end record;
subtype DFSDM2_AWLTR_BKAWL_Field is HAL.UInt4;
subtype DFSDM2_AWLTR_AWLT_Field is HAL.UInt24;
-- DFSDM analog watchdog low threshold register
type DFSDM2_AWLTR_Register is record
-- Break signal assignment to analog watchdog low threshold event
BKAWL : DFSDM2_AWLTR_BKAWL_Field := 16#0#;
-- unspecified
Reserved_4_7 : HAL.UInt4 := 16#0#;
-- Analog watchdog low threshold
AWLT : DFSDM2_AWLTR_AWLT_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM2_AWLTR_Register use record
BKAWL at 0 range 0 .. 3;
Reserved_4_7 at 0 range 4 .. 7;
AWLT at 0 range 8 .. 31;
end record;
subtype DFSDM3_AWLTR_BKAWL_Field is HAL.UInt4;
subtype DFSDM3_AWLTR_AWLT_Field is HAL.UInt24;
-- DFSDM analog watchdog low threshold register
type DFSDM3_AWLTR_Register is record
-- Break signal assignment to analog watchdog low threshold event
BKAWL : DFSDM3_AWLTR_BKAWL_Field := 16#0#;
-- unspecified
Reserved_4_7 : HAL.UInt4 := 16#0#;
-- Analog watchdog low threshold
AWLT : DFSDM3_AWLTR_AWLT_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM3_AWLTR_Register use record
BKAWL at 0 range 0 .. 3;
Reserved_4_7 at 0 range 4 .. 7;
AWLT at 0 range 8 .. 31;
end record;
subtype DFSDM0_AWSR_AWLTF_Field is HAL.UInt8;
subtype DFSDM0_AWSR_AWHTF_Field is HAL.UInt8;
-- DFSDM analog watchdog status register
type DFSDM0_AWSR_Register is record
-- Read-only. Analog watchdog low threshold flag
AWLTF : DFSDM0_AWSR_AWLTF_Field;
-- Read-only. Analog watchdog high threshold flag
AWHTF : DFSDM0_AWSR_AWHTF_Field;
-- unspecified
Reserved_16_31 : HAL.UInt16;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM0_AWSR_Register use record
AWLTF at 0 range 0 .. 7;
AWHTF at 0 range 8 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype DFSDM1_AWSR_AWLTF_Field is HAL.UInt8;
subtype DFSDM1_AWSR_AWHTF_Field is HAL.UInt8;
-- DFSDM analog watchdog status register
type DFSDM1_AWSR_Register is record
-- Read-only. Analog watchdog low threshold flag
AWLTF : DFSDM1_AWSR_AWLTF_Field;
-- Read-only. Analog watchdog high threshold flag
AWHTF : DFSDM1_AWSR_AWHTF_Field;
-- unspecified
Reserved_16_31 : HAL.UInt16;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM1_AWSR_Register use record
AWLTF at 0 range 0 .. 7;
AWHTF at 0 range 8 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype DFSDM2_AWSR_AWLTF_Field is HAL.UInt8;
subtype DFSDM2_AWSR_AWHTF_Field is HAL.UInt8;
-- DFSDM analog watchdog status register
type DFSDM2_AWSR_Register is record
-- Read-only. Analog watchdog low threshold flag
AWLTF : DFSDM2_AWSR_AWLTF_Field;
-- Read-only. Analog watchdog high threshold flag
AWHTF : DFSDM2_AWSR_AWHTF_Field;
-- unspecified
Reserved_16_31 : HAL.UInt16;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM2_AWSR_Register use record
AWLTF at 0 range 0 .. 7;
AWHTF at 0 range 8 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype DFSDM3_AWSR_AWLTF_Field is HAL.UInt8;
subtype DFSDM3_AWSR_AWHTF_Field is HAL.UInt8;
-- DFSDM analog watchdog status register
type DFSDM3_AWSR_Register is record
-- Read-only. Analog watchdog low threshold flag
AWLTF : DFSDM3_AWSR_AWLTF_Field;
-- Read-only. Analog watchdog high threshold flag
AWHTF : DFSDM3_AWSR_AWHTF_Field;
-- unspecified
Reserved_16_31 : HAL.UInt16;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM3_AWSR_Register use record
AWLTF at 0 range 0 .. 7;
AWHTF at 0 range 8 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype DFSDM0_AWCFR_CLRAWLTF_Field is HAL.UInt8;
subtype DFSDM0_AWCFR_CLRAWHTF_Field is HAL.UInt8;
-- DFSDM analog watchdog clear flag register
type DFSDM0_AWCFR_Register is record
-- Clear the analog watchdog low threshold flag
CLRAWLTF : DFSDM0_AWCFR_CLRAWLTF_Field := 16#0#;
-- Clear the analog watchdog high threshold flag
CLRAWHTF : DFSDM0_AWCFR_CLRAWHTF_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM0_AWCFR_Register use record
CLRAWLTF at 0 range 0 .. 7;
CLRAWHTF at 0 range 8 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype DFSDM1_AWCFR_CLRAWLTF_Field is HAL.UInt8;
subtype DFSDM1_AWCFR_CLRAWHTF_Field is HAL.UInt8;
-- DFSDM analog watchdog clear flag register
type DFSDM1_AWCFR_Register is record
-- Clear the analog watchdog low threshold flag
CLRAWLTF : DFSDM1_AWCFR_CLRAWLTF_Field := 16#0#;
-- Clear the analog watchdog high threshold flag
CLRAWHTF : DFSDM1_AWCFR_CLRAWHTF_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM1_AWCFR_Register use record
CLRAWLTF at 0 range 0 .. 7;
CLRAWHTF at 0 range 8 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype DFSDM2_AWCFR_CLRAWLTF_Field is HAL.UInt8;
subtype DFSDM2_AWCFR_CLRAWHTF_Field is HAL.UInt8;
-- DFSDM analog watchdog clear flag register
type DFSDM2_AWCFR_Register is record
-- Clear the analog watchdog low threshold flag
CLRAWLTF : DFSDM2_AWCFR_CLRAWLTF_Field := 16#0#;
-- Clear the analog watchdog high threshold flag
CLRAWHTF : DFSDM2_AWCFR_CLRAWHTF_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM2_AWCFR_Register use record
CLRAWLTF at 0 range 0 .. 7;
CLRAWHTF at 0 range 8 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype DFSDM3_AWCFR_CLRAWLTF_Field is HAL.UInt8;
subtype DFSDM3_AWCFR_CLRAWHTF_Field is HAL.UInt8;
-- DFSDM analog watchdog clear flag register
type DFSDM3_AWCFR_Register is record
-- Clear the analog watchdog low threshold flag
CLRAWLTF : DFSDM3_AWCFR_CLRAWLTF_Field := 16#0#;
-- Clear the analog watchdog high threshold flag
CLRAWHTF : DFSDM3_AWCFR_CLRAWHTF_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM3_AWCFR_Register use record
CLRAWLTF at 0 range 0 .. 7;
CLRAWHTF at 0 range 8 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype DFSDM0_EXMAX_EXMAXCH_Field is HAL.UInt3;
subtype DFSDM0_EXMAX_EXMAX_Field is HAL.UInt24;
-- DFSDM Extremes detector maximum register
type DFSDM0_EXMAX_Register is record
-- Read-only. Extremes detector maximum data channel
EXMAXCH : DFSDM0_EXMAX_EXMAXCH_Field;
-- unspecified
Reserved_3_7 : HAL.UInt5;
-- Read-only. Extremes detector maximum value
EXMAX : DFSDM0_EXMAX_EXMAX_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM0_EXMAX_Register use record
EXMAXCH at 0 range 0 .. 2;
Reserved_3_7 at 0 range 3 .. 7;
EXMAX at 0 range 8 .. 31;
end record;
subtype DFSDM1_EXMAX_EXMAXCH_Field is HAL.UInt3;
subtype DFSDM1_EXMAX_EXMAX_Field is HAL.UInt24;
-- DFSDM Extremes detector maximum register
type DFSDM1_EXMAX_Register is record
-- Read-only. Extremes detector maximum data channel
EXMAXCH : DFSDM1_EXMAX_EXMAXCH_Field;
-- unspecified
Reserved_3_7 : HAL.UInt5;
-- Read-only. Extremes detector maximum value
EXMAX : DFSDM1_EXMAX_EXMAX_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM1_EXMAX_Register use record
EXMAXCH at 0 range 0 .. 2;
Reserved_3_7 at 0 range 3 .. 7;
EXMAX at 0 range 8 .. 31;
end record;
subtype DFSDM2_EXMAX_EXMAXCH_Field is HAL.UInt3;
subtype DFSDM2_EXMAX_EXMAX_Field is HAL.UInt24;
-- DFSDM Extremes detector maximum register
type DFSDM2_EXMAX_Register is record
-- Read-only. Extremes detector maximum data channel
EXMAXCH : DFSDM2_EXMAX_EXMAXCH_Field;
-- unspecified
Reserved_3_7 : HAL.UInt5;
-- Read-only. Extremes detector maximum value
EXMAX : DFSDM2_EXMAX_EXMAX_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM2_EXMAX_Register use record
EXMAXCH at 0 range 0 .. 2;
Reserved_3_7 at 0 range 3 .. 7;
EXMAX at 0 range 8 .. 31;
end record;
subtype DFSDM3_EXMAX_EXMAXCH_Field is HAL.UInt3;
subtype DFSDM3_EXMAX_EXMAX_Field is HAL.UInt24;
-- DFSDM Extremes detector maximum register
type DFSDM3_EXMAX_Register is record
-- Read-only. Extremes detector maximum data channel
EXMAXCH : DFSDM3_EXMAX_EXMAXCH_Field;
-- unspecified
Reserved_3_7 : HAL.UInt5;
-- Read-only. Extremes detector maximum value
EXMAX : DFSDM3_EXMAX_EXMAX_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM3_EXMAX_Register use record
EXMAXCH at 0 range 0 .. 2;
Reserved_3_7 at 0 range 3 .. 7;
EXMAX at 0 range 8 .. 31;
end record;
subtype DFSDM0_EXMIN_EXMINCH_Field is HAL.UInt3;
subtype DFSDM0_EXMIN_EXMIN_Field is HAL.UInt24;
-- DFSDM Extremes detector minimum register
type DFSDM0_EXMIN_Register is record
-- Read-only. Extremes detector minimum data channel
EXMINCH : DFSDM0_EXMIN_EXMINCH_Field;
-- unspecified
Reserved_3_7 : HAL.UInt5;
-- Read-only. Extremes detector minimum value
EXMIN : DFSDM0_EXMIN_EXMIN_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM0_EXMIN_Register use record
EXMINCH at 0 range 0 .. 2;
Reserved_3_7 at 0 range 3 .. 7;
EXMIN at 0 range 8 .. 31;
end record;
subtype DFSDM1_EXMIN_EXMINCH_Field is HAL.UInt3;
subtype DFSDM1_EXMIN_EXMIN_Field is HAL.UInt24;
-- DFSDM Extremes detector minimum register
type DFSDM1_EXMIN_Register is record
-- Read-only. Extremes detector minimum data channel
EXMINCH : DFSDM1_EXMIN_EXMINCH_Field;
-- unspecified
Reserved_3_7 : HAL.UInt5;
-- Read-only. Extremes detector minimum value
EXMIN : DFSDM1_EXMIN_EXMIN_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM1_EXMIN_Register use record
EXMINCH at 0 range 0 .. 2;
Reserved_3_7 at 0 range 3 .. 7;
EXMIN at 0 range 8 .. 31;
end record;
subtype DFSDM2_EXMIN_EXMINCH_Field is HAL.UInt3;
subtype DFSDM2_EXMIN_EXMIN_Field is HAL.UInt24;
-- DFSDM Extremes detector minimum register
type DFSDM2_EXMIN_Register is record
-- Read-only. Extremes detector minimum data channel
EXMINCH : DFSDM2_EXMIN_EXMINCH_Field;
-- unspecified
Reserved_3_7 : HAL.UInt5;
-- Read-only. Extremes detector minimum value
EXMIN : DFSDM2_EXMIN_EXMIN_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM2_EXMIN_Register use record
EXMINCH at 0 range 0 .. 2;
Reserved_3_7 at 0 range 3 .. 7;
EXMIN at 0 range 8 .. 31;
end record;
subtype DFSDM3_EXMIN_EXMINCH_Field is HAL.UInt3;
subtype DFSDM3_EXMIN_EXMIN_Field is HAL.UInt24;
-- DFSDM Extremes detector minimum register
type DFSDM3_EXMIN_Register is record
-- Read-only. Extremes detector minimum data channel
EXMINCH : DFSDM3_EXMIN_EXMINCH_Field;
-- unspecified
Reserved_3_7 : HAL.UInt5;
-- Read-only. Extremes detector minimum value
EXMIN : DFSDM3_EXMIN_EXMIN_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM3_EXMIN_Register use record
EXMINCH at 0 range 0 .. 2;
Reserved_3_7 at 0 range 3 .. 7;
EXMIN at 0 range 8 .. 31;
end record;
subtype DFSDM0_CNVTIMR_CNVCNT_Field is HAL.UInt28;
-- DFSDM conversion timer register
type DFSDM0_CNVTIMR_Register is record
-- unspecified
Reserved_0_3 : HAL.UInt4;
-- Read-only. 28-bit timer counting conversion time
CNVCNT : DFSDM0_CNVTIMR_CNVCNT_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM0_CNVTIMR_Register use record
Reserved_0_3 at 0 range 0 .. 3;
CNVCNT at 0 range 4 .. 31;
end record;
subtype DFSDM1_CNVTIMR_CNVCNT_Field is HAL.UInt28;
-- DFSDM conversion timer register
type DFSDM1_CNVTIMR_Register is record
-- unspecified
Reserved_0_3 : HAL.UInt4;
-- Read-only. 28-bit timer counting conversion time
CNVCNT : DFSDM1_CNVTIMR_CNVCNT_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM1_CNVTIMR_Register use record
Reserved_0_3 at 0 range 0 .. 3;
CNVCNT at 0 range 4 .. 31;
end record;
subtype DFSDM2_CNVTIMR_CNVCNT_Field is HAL.UInt28;
-- DFSDM conversion timer register
type DFSDM2_CNVTIMR_Register is record
-- unspecified
Reserved_0_3 : HAL.UInt4;
-- Read-only. 28-bit timer counting conversion time
CNVCNT : DFSDM2_CNVTIMR_CNVCNT_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM2_CNVTIMR_Register use record
Reserved_0_3 at 0 range 0 .. 3;
CNVCNT at 0 range 4 .. 31;
end record;
subtype DFSDM3_CNVTIMR_CNVCNT_Field is HAL.UInt28;
-- DFSDM conversion timer register
type DFSDM3_CNVTIMR_Register is record
-- unspecified
Reserved_0_3 : HAL.UInt4;
-- Read-only. 28-bit timer counting conversion time
CNVCNT : DFSDM3_CNVTIMR_CNVCNT_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM3_CNVTIMR_Register use record
Reserved_0_3 at 0 range 0 .. 3;
CNVCNT at 0 range 4 .. 31;
end record;
-----------------
-- Peripherals --
-----------------
-- Digital filter for sigma delta modulators
type DFSDM_Peripheral is record
-- DFSDM channel configuration 0 register 1
DFSDM_CHCFG0R1 : aliased DFSDM_CHCFG0R1_Register;
-- DFSDM channel configuration 1 register 1
DFSDM_CHCFG1R1 : aliased DFSDM_CHCFG1R1_Register;
-- DFSDM channel configuration 2 register 1
DFSDM_CHCFG2R1 : aliased DFSDM_CHCFG2R1_Register;
-- DFSDM channel configuration 3 register 1
DFSDM_CHCFG3R1 : aliased DFSDM_CHCFG3R1_Register;
-- DFSDM channel configuration 4 register 1
DFSDM_CHCFG4R1 : aliased DFSDM_CHCFG4R1_Register;
-- DFSDM channel configuration 5 register 1
DFSDM_CHCFG5R1 : aliased DFSDM_CHCFG5R1_Register;
-- DFSDM channel configuration 6 register 1
DFSDM_CHCFG6R1 : aliased DFSDM_CHCFG6R1_Register;
-- DFSDM channel configuration 7 register 1
DFSDM_CHCFG7R1 : aliased DFSDM_CHCFG7R1_Register;
-- DFSDM channel configuration 0 register 2
DFSDM_CHCFG0R2 : aliased DFSDM_CHCFG0R2_Register;
-- DFSDM channel configuration 1 register 2
DFSDM_CHCFG1R2 : aliased DFSDM_CHCFG1R2_Register;
-- DFSDM channel configuration 2 register 2
DFSDM_CHCFG2R2 : aliased DFSDM_CHCFG2R2_Register;
-- DFSDM channel configuration 3 register 2
DFSDM_CHCFG3R2 : aliased DFSDM_CHCFG3R2_Register;
-- DFSDM channel configuration 4 register 2
DFSDM_CHCFG4R2 : aliased DFSDM_CHCFG4R2_Register;
-- DFSDM channel configuration 5 register 2
DFSDM_CHCFG5R2 : aliased DFSDM_CHCFG5R2_Register;
-- DFSDM channel configuration 6 register 2
DFSDM_CHCFG6R2 : aliased DFSDM_CHCFG6R2_Register;
-- DFSDM channel configuration 7 register 2
DFSDM_CHCFG7R2 : aliased DFSDM_CHCFG7R2_Register;
-- DFSDM analog watchdog and short-circuit detector register
DFSDM_AWSCD0R : aliased DFSDM_AWSCD0R_Register;
-- DFSDM analog watchdog and short-circuit detector register
DFSDM_AWSCD1R : aliased DFSDM_AWSCD1R_Register;
-- DFSDM analog watchdog and short-circuit detector register
DFSDM_AWSCD2R : aliased DFSDM_AWSCD2R_Register;
-- DFSDM analog watchdog and short-circuit detector register
DFSDM_AWSCD3R : aliased DFSDM_AWSCD3R_Register;
-- DFSDM analog watchdog and short-circuit detector register
DFSDM_AWSCD4R : aliased DFSDM_AWSCD4R_Register;
-- DFSDM analog watchdog and short-circuit detector register
DFSDM_AWSCD5R : aliased DFSDM_AWSCD5R_Register;
-- DFSDM analog watchdog and short-circuit detector register
DFSDM_AWSCD6R : aliased DFSDM_AWSCD6R_Register;
-- DFSDM analog watchdog and short-circuit detector register
DFSDM_AWSCD7R : aliased DFSDM_AWSCD7R_Register;
-- DFSDM channel watchdog filter data register
DFSDM_CHWDAT0R : aliased DFSDM_CHWDAT0R_Register;
-- DFSDM channel watchdog filter data register
DFSDM_CHWDAT1R : aliased DFSDM_CHWDAT1R_Register;
-- DFSDM channel watchdog filter data register
DFSDM_CHWDAT2R : aliased DFSDM_CHWDAT2R_Register;
-- DFSDM channel watchdog filter data register
DFSDM_CHWDAT3R : aliased DFSDM_CHWDAT3R_Register;
-- DFSDM channel watchdog filter data register
DFSDM_CHWDAT4R : aliased DFSDM_CHWDAT4R_Register;
-- DFSDM channel watchdog filter data register
DFSDM_CHWDAT5R : aliased DFSDM_CHWDAT5R_Register;
-- DFSDM channel watchdog filter data register
DFSDM_CHWDAT6R : aliased DFSDM_CHWDAT6R_Register;
-- DFSDM channel watchdog filter data register
DFSDM_CHWDAT7R : aliased DFSDM_CHWDAT7R_Register;
-- DFSDM channel data input register
DFSDM_CHDATIN0R : aliased DFSDM_CHDATIN0R_Register;
-- DFSDM channel data input register
DFSDM_CHDATIN1R : aliased DFSDM_CHDATIN1R_Register;
-- DFSDM channel data input register
DFSDM_CHDATIN2R : aliased DFSDM_CHDATIN2R_Register;
-- DFSDM channel data input register
DFSDM_CHDATIN3R : aliased DFSDM_CHDATIN3R_Register;
-- DFSDM channel data input register
DFSDM_CHDATIN4R : aliased DFSDM_CHDATIN4R_Register;
-- DFSDM channel data input register
DFSDM_CHDATIN5R : aliased DFSDM_CHDATIN5R_Register;
-- DFSDM channel data input register
DFSDM_CHDATIN6R : aliased DFSDM_CHDATIN6R_Register;
-- DFSDM channel data input register
DFSDM_CHDATIN7R : aliased DFSDM_CHDATIN7R_Register;
-- DFSDM control register 1
DFSDM0_CR1 : aliased DFSDM0_CR1_Register;
-- DFSDM control register 1
DFSDM1_CR1 : aliased DFSDM1_CR1_Register;
-- DFSDM control register 1
DFSDM2_CR1 : aliased DFSDM2_CR1_Register;
-- DFSDM control register 1
DFSDM3_CR1 : aliased DFSDM3_CR1_Register;
-- DFSDM control register 2
DFSDM0_CR2 : aliased DFSDM0_CR2_Register;
-- DFSDM control register 2
DFSDM1_CR2 : aliased DFSDM1_CR2_Register;
-- DFSDM control register 2
DFSDM2_CR2 : aliased DFSDM2_CR2_Register;
-- DFSDM control register 2
DFSDM3_CR2 : aliased DFSDM3_CR2_Register;
-- DFSDM interrupt and status register
DFSDM0_ISR : aliased DFSDM0_ISR_Register;
-- DFSDM interrupt and status register
DFSDM1_ISR : aliased DFSDM1_ISR_Register;
-- DFSDM interrupt and status register
DFSDM2_ISR : aliased DFSDM2_ISR_Register;
-- DFSDM interrupt and status register
DFSDM3_ISR : aliased DFSDM3_ISR_Register;
-- DFSDM interrupt flag clear register
DFSDM0_ICR : aliased DFSDM0_ICR_Register;
-- DFSDM interrupt flag clear register
DFSDM1_ICR : aliased DFSDM1_ICR_Register;
-- DFSDM interrupt flag clear register
DFSDM2_ICR : aliased DFSDM2_ICR_Register;
-- DFSDM interrupt flag clear register
DFSDM3_ICR : aliased DFSDM3_ICR_Register;
-- DFSDM injected channel group selection register
DFSDM0_JCHGR : aliased DFSDM0_JCHGR_Register;
-- DFSDM injected channel group selection register
DFSDM1_JCHGR : aliased DFSDM1_JCHGR_Register;
-- DFSDM injected channel group selection register
DFSDM2_JCHGR : aliased DFSDM2_JCHGR_Register;
-- DFSDM injected channel group selection register
DFSDM3_JCHGR : aliased DFSDM3_JCHGR_Register;
-- DFSDM filter control register
DFSDM0_FCR : aliased DFSDM0_FCR_Register;
-- DFSDM filter control register
DFSDM1_FCR : aliased DFSDM1_FCR_Register;
-- DFSDM filter control register
DFSDM2_FCR : aliased DFSDM2_FCR_Register;
-- DFSDM filter control register
DFSDM3_FCR : aliased DFSDM3_FCR_Register;
-- DFSDM data register for injected group
DFSDM0_JDATAR : aliased DFSDM0_JDATAR_Register;
-- DFSDM data register for injected group
DFSDM1_JDATAR : aliased DFSDM1_JDATAR_Register;
-- DFSDM data register for injected group
DFSDM2_JDATAR : aliased DFSDM2_JDATAR_Register;
-- DFSDM data register for injected group
DFSDM3_JDATAR : aliased DFSDM3_JDATAR_Register;
-- DFSDM data register for the regular channel
DFSDM0_RDATAR : aliased DFSDM0_RDATAR_Register;
-- DFSDM data register for the regular channel
DFSDM1_RDATAR : aliased DFSDM1_RDATAR_Register;
-- DFSDM data register for the regular channel
DFSDM2_RDATAR : aliased DFSDM2_RDATAR_Register;
-- DFSDM data register for the regular channel
DFSDM3_RDATAR : aliased DFSDM3_RDATAR_Register;
-- DFSDM analog watchdog high threshold register
DFSDM0_AWHTR : aliased DFSDM0_AWHTR_Register;
-- DFSDM analog watchdog high threshold register
DFSDM1_AWHTR : aliased DFSDM1_AWHTR_Register;
-- DFSDM analog watchdog high threshold register
DFSDM2_AWHTR : aliased DFSDM2_AWHTR_Register;
-- DFSDM analog watchdog high threshold register
DFSDM3_AWHTR : aliased DFSDM3_AWHTR_Register;
-- DFSDM analog watchdog low threshold register
DFSDM0_AWLTR : aliased DFSDM0_AWLTR_Register;
-- DFSDM analog watchdog low threshold register
DFSDM1_AWLTR : aliased DFSDM1_AWLTR_Register;
-- DFSDM analog watchdog low threshold register
DFSDM2_AWLTR : aliased DFSDM2_AWLTR_Register;
-- DFSDM analog watchdog low threshold register
DFSDM3_AWLTR : aliased DFSDM3_AWLTR_Register;
-- DFSDM analog watchdog status register
DFSDM0_AWSR : aliased DFSDM0_AWSR_Register;
-- DFSDM analog watchdog status register
DFSDM1_AWSR : aliased DFSDM1_AWSR_Register;
-- DFSDM analog watchdog status register
DFSDM2_AWSR : aliased DFSDM2_AWSR_Register;
-- DFSDM analog watchdog status register
DFSDM3_AWSR : aliased DFSDM3_AWSR_Register;
-- DFSDM analog watchdog clear flag register
DFSDM0_AWCFR : aliased DFSDM0_AWCFR_Register;
-- DFSDM analog watchdog clear flag register
DFSDM1_AWCFR : aliased DFSDM1_AWCFR_Register;
-- DFSDM analog watchdog clear flag register
DFSDM2_AWCFR : aliased DFSDM2_AWCFR_Register;
-- DFSDM analog watchdog clear flag register
DFSDM3_AWCFR : aliased DFSDM3_AWCFR_Register;
-- DFSDM Extremes detector maximum register
DFSDM0_EXMAX : aliased DFSDM0_EXMAX_Register;
-- DFSDM Extremes detector maximum register
DFSDM1_EXMAX : aliased DFSDM1_EXMAX_Register;
-- DFSDM Extremes detector maximum register
DFSDM2_EXMAX : aliased DFSDM2_EXMAX_Register;
-- DFSDM Extremes detector maximum register
DFSDM3_EXMAX : aliased DFSDM3_EXMAX_Register;
-- DFSDM Extremes detector minimum register
DFSDM0_EXMIN : aliased DFSDM0_EXMIN_Register;
-- DFSDM Extremes detector minimum register
DFSDM1_EXMIN : aliased DFSDM1_EXMIN_Register;
-- DFSDM Extremes detector minimum register
DFSDM2_EXMIN : aliased DFSDM2_EXMIN_Register;
-- DFSDM Extremes detector minimum register
DFSDM3_EXMIN : aliased DFSDM3_EXMIN_Register;
-- DFSDM conversion timer register
DFSDM0_CNVTIMR : aliased DFSDM0_CNVTIMR_Register;
-- DFSDM conversion timer register
DFSDM1_CNVTIMR : aliased DFSDM1_CNVTIMR_Register;
-- DFSDM conversion timer register
DFSDM2_CNVTIMR : aliased DFSDM2_CNVTIMR_Register;
-- DFSDM conversion timer register
DFSDM3_CNVTIMR : aliased DFSDM3_CNVTIMR_Register;
end record
with Volatile;
for DFSDM_Peripheral use record
DFSDM_CHCFG0R1 at 16#0# range 0 .. 31;
DFSDM_CHCFG1R1 at 16#4# range 0 .. 31;
DFSDM_CHCFG2R1 at 16#8# range 0 .. 31;
DFSDM_CHCFG3R1 at 16#C# range 0 .. 31;
DFSDM_CHCFG4R1 at 16#10# range 0 .. 31;
DFSDM_CHCFG5R1 at 16#14# range 0 .. 31;
DFSDM_CHCFG6R1 at 16#18# range 0 .. 31;
DFSDM_CHCFG7R1 at 16#1C# range 0 .. 31;
DFSDM_CHCFG0R2 at 16#20# range 0 .. 31;
DFSDM_CHCFG1R2 at 16#24# range 0 .. 31;
DFSDM_CHCFG2R2 at 16#28# range 0 .. 31;
DFSDM_CHCFG3R2 at 16#2C# range 0 .. 31;
DFSDM_CHCFG4R2 at 16#30# range 0 .. 31;
DFSDM_CHCFG5R2 at 16#34# range 0 .. 31;
DFSDM_CHCFG6R2 at 16#38# range 0 .. 31;
DFSDM_CHCFG7R2 at 16#3C# range 0 .. 31;
DFSDM_AWSCD0R at 16#40# range 0 .. 31;
DFSDM_AWSCD1R at 16#44# range 0 .. 31;
DFSDM_AWSCD2R at 16#48# range 0 .. 31;
DFSDM_AWSCD3R at 16#4C# range 0 .. 31;
DFSDM_AWSCD4R at 16#50# range 0 .. 31;
DFSDM_AWSCD5R at 16#54# range 0 .. 31;
DFSDM_AWSCD6R at 16#58# range 0 .. 31;
DFSDM_AWSCD7R at 16#5C# range 0 .. 31;
DFSDM_CHWDAT0R at 16#60# range 0 .. 31;
DFSDM_CHWDAT1R at 16#64# range 0 .. 31;
DFSDM_CHWDAT2R at 16#68# range 0 .. 31;
DFSDM_CHWDAT3R at 16#6C# range 0 .. 31;
DFSDM_CHWDAT4R at 16#70# range 0 .. 31;
DFSDM_CHWDAT5R at 16#74# range 0 .. 31;
DFSDM_CHWDAT6R at 16#78# range 0 .. 31;
DFSDM_CHWDAT7R at 16#7C# range 0 .. 31;
DFSDM_CHDATIN0R at 16#80# range 0 .. 31;
DFSDM_CHDATIN1R at 16#84# range 0 .. 31;
DFSDM_CHDATIN2R at 16#88# range 0 .. 31;
DFSDM_CHDATIN3R at 16#8C# range 0 .. 31;
DFSDM_CHDATIN4R at 16#90# range 0 .. 31;
DFSDM_CHDATIN5R at 16#94# range 0 .. 31;
DFSDM_CHDATIN6R at 16#98# range 0 .. 31;
DFSDM_CHDATIN7R at 16#9C# range 0 .. 31;
DFSDM0_CR1 at 16#A0# range 0 .. 31;
DFSDM1_CR1 at 16#A4# range 0 .. 31;
DFSDM2_CR1 at 16#A8# range 0 .. 31;
DFSDM3_CR1 at 16#AC# range 0 .. 31;
DFSDM0_CR2 at 16#B0# range 0 .. 31;
DFSDM1_CR2 at 16#B4# range 0 .. 31;
DFSDM2_CR2 at 16#B8# range 0 .. 31;
DFSDM3_CR2 at 16#BC# range 0 .. 31;
DFSDM0_ISR at 16#C0# range 0 .. 31;
DFSDM1_ISR at 16#C4# range 0 .. 31;
DFSDM2_ISR at 16#C8# range 0 .. 31;
DFSDM3_ISR at 16#CC# range 0 .. 31;
DFSDM0_ICR at 16#D0# range 0 .. 31;
DFSDM1_ICR at 16#D4# range 0 .. 31;
DFSDM2_ICR at 16#D8# range 0 .. 31;
DFSDM3_ICR at 16#DC# range 0 .. 31;
DFSDM0_JCHGR at 16#E0# range 0 .. 31;
DFSDM1_JCHGR at 16#E4# range 0 .. 31;
DFSDM2_JCHGR at 16#E8# range 0 .. 31;
DFSDM3_JCHGR at 16#EC# range 0 .. 31;
DFSDM0_FCR at 16#F0# range 0 .. 31;
DFSDM1_FCR at 16#F4# range 0 .. 31;
DFSDM2_FCR at 16#F8# range 0 .. 31;
DFSDM3_FCR at 16#FC# range 0 .. 31;
DFSDM0_JDATAR at 16#100# range 0 .. 31;
DFSDM1_JDATAR at 16#104# range 0 .. 31;
DFSDM2_JDATAR at 16#108# range 0 .. 31;
DFSDM3_JDATAR at 16#10C# range 0 .. 31;
DFSDM0_RDATAR at 16#110# range 0 .. 31;
DFSDM1_RDATAR at 16#114# range 0 .. 31;
DFSDM2_RDATAR at 16#118# range 0 .. 31;
DFSDM3_RDATAR at 16#11C# range 0 .. 31;
DFSDM0_AWHTR at 16#120# range 0 .. 31;
DFSDM1_AWHTR at 16#124# range 0 .. 31;
DFSDM2_AWHTR at 16#128# range 0 .. 31;
DFSDM3_AWHTR at 16#12C# range 0 .. 31;
DFSDM0_AWLTR at 16#130# range 0 .. 31;
DFSDM1_AWLTR at 16#134# range 0 .. 31;
DFSDM2_AWLTR at 16#138# range 0 .. 31;
DFSDM3_AWLTR at 16#13C# range 0 .. 31;
DFSDM0_AWSR at 16#140# range 0 .. 31;
DFSDM1_AWSR at 16#144# range 0 .. 31;
DFSDM2_AWSR at 16#148# range 0 .. 31;
DFSDM3_AWSR at 16#14C# range 0 .. 31;
DFSDM0_AWCFR at 16#150# range 0 .. 31;
DFSDM1_AWCFR at 16#154# range 0 .. 31;
DFSDM2_AWCFR at 16#158# range 0 .. 31;
DFSDM3_AWCFR at 16#15C# range 0 .. 31;
DFSDM0_EXMAX at 16#160# range 0 .. 31;
DFSDM1_EXMAX at 16#164# range 0 .. 31;
DFSDM2_EXMAX at 16#168# range 0 .. 31;
DFSDM3_EXMAX at 16#16C# range 0 .. 31;
DFSDM0_EXMIN at 16#170# range 0 .. 31;
DFSDM1_EXMIN at 16#174# range 0 .. 31;
DFSDM2_EXMIN at 16#178# range 0 .. 31;
DFSDM3_EXMIN at 16#17C# range 0 .. 31;
DFSDM0_CNVTIMR at 16#180# range 0 .. 31;
DFSDM1_CNVTIMR at 16#184# range 0 .. 31;
DFSDM2_CNVTIMR at 16#188# range 0 .. 31;
DFSDM3_CNVTIMR at 16#18C# range 0 .. 31;
end record;
-- Digital filter for sigma delta modulators
DFSDM_Periph : aliased DFSDM_Peripheral
with Import, Address => System'To_Address (16#40017400#);
end STM32_SVD.DFSDM;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- P R J . A T T R --
-- --
-- S p e c --
-- --
-- Copyright (C) 2001-2014, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING3. If not, go to --
-- http://www.gnu.org/licenses for a complete copy of the license. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package defines packages and attributes in GNAT project files.
-- There are predefined packages and attributes.
-- It is also possible to define new packages with their attributes
with Table;
with GNAT.Strings;
package Prj.Attr is
function Package_Name_List return GNAT.Strings.String_List;
-- Returns the list of valid package names, including those added by
-- procedures Register_New_Package below. The String_Access components of
-- the returned String_List should never be freed.
procedure Initialize;
-- Initialize the predefined project level attributes and the predefined
-- packages and their attribute. This procedure should be called by
-- Prj.Initialize.
type Attribute_Kind is (
Unknown,
-- The attribute does not exist
Single,
-- Single variable attribute (not an associative array)
Associative_Array,
-- Associative array attribute with a case sensitive index
Optional_Index_Associative_Array,
-- Associative array attribute with a case sensitive index and an
-- optional source index.
Case_Insensitive_Associative_Array,
-- Associative array attribute with a case insensitive index
Optional_Index_Case_Insensitive_Associative_Array
-- Associative array attribute with a case insensitive index and an
-- optional source index.
);
-- Characteristics of an attribute. Optional_Index indicates that there
-- may be an optional index in the index of the associative array, as in
-- for Switches ("files.ada" at 2) use ...
subtype Defined_Attribute_Kind is Attribute_Kind
range Single .. Optional_Index_Case_Insensitive_Associative_Array;
-- Subset of Attribute_Kinds that may be used for the attributes that is
-- used when defining a new package.
subtype All_Case_Insensitive_Associative_Array is Attribute_Kind range
Case_Insensitive_Associative_Array ..
Optional_Index_Case_Insensitive_Associative_Array;
-- Subtype including both cases of Case_Insensitive_Associative_Array
Max_Attribute_Name_Length : constant := 64;
-- The maximum length of attribute names
subtype Attribute_Name_Length is
Positive range 1 .. Max_Attribute_Name_Length;
type Attribute_Data (Name_Length : Attribute_Name_Length := 1) is record
Name : String (1 .. Name_Length);
-- The name of the attribute
Attr_Kind : Defined_Attribute_Kind;
-- The type of the attribute
Index_Is_File_Name : Boolean;
-- For associative arrays, indicate if the index is a file name, so
-- that the attribute kind may be modified depending on the case
-- sensitivity of file names. This is only taken into account when
-- Attr_Kind is Associative_Array or Optional_Index_Associative_Array.
Opt_Index : Boolean;
-- True if there may be an optional index in the value of the index,
-- as in:
-- "file.ada" at 2
-- ("main.adb", "file.ada" at 1)
Var_Kind : Defined_Variable_Kind;
-- The attribute value kind: single or list
Default : Attribute_Default_Value := Empty_Value;
-- The value of the attribute when referenced if the attribute has not
-- yet been declared.
end record;
-- Name and characteristics of an attribute in a package registered
-- explicitly with Register_New_Package (see below).
type Attribute_Data_Array is array (Positive range <>) of Attribute_Data;
-- A list of attribute name/characteristics to be used as parameter of
-- procedure Register_New_Package below.
-- In the subprograms below, when it is specified that the subprogram
-- "fails", procedure Prj.Com.Fail is called. Unless it is specified
-- otherwise, if Prj.Com.Fail returns, exception Prj.Prj_Error is raised.
procedure Register_New_Package
(Name : String;
Attributes : Attribute_Data_Array);
-- Add a new package with its attributes. This procedure can only be
-- called after Initialize, but before any other call to a service of
-- the Project Manager. Fail if the name of the package is empty or not
-- unique, or if the names of the attributes are not different.
----------------
-- Attributes --
----------------
type Attribute_Node_Id is private;
-- The type to refers to an attribute, self-initialized
Empty_Attribute : constant Attribute_Node_Id;
-- Indicates no attribute. Default value of Attribute_Node_Id objects
Attribute_First : constant Attribute_Node_Id;
-- First attribute node id of project level attributes
function Attribute_Node_Id_Of
(Name : Name_Id;
Starting_At : Attribute_Node_Id) return Attribute_Node_Id;
-- Returns the node id of an attribute at the project level or in
-- a package. Starting_At indicates the first known attribute node where
-- to start the search. Returns Empty_Attribute if the attribute cannot
-- be found.
function Attribute_Kind_Of
(Attribute : Attribute_Node_Id) return Attribute_Kind;
-- Returns the attribute kind of a known attribute. Returns Unknown if
-- Attribute is Empty_Attribute.
--
-- To use this function, the following code should be used:
--
-- Pkg : constant Package_Node_Id :=
-- Prj.Attr.Package_Node_Id_Of (Name => <package name>);
-- Att : constant Attribute_Node_Id :=
-- Prj.Attr.Attribute_Node_Id_Of
-- (Name => <attribute name>,
-- Starting_At => First_Attribute_Of (Pkg));
-- Kind : constant Attribute_Kind := Attribute_Kind_Of (Att);
--
-- However, do not use this function once you have an already parsed
-- project tree. Instead, given a Project_Node_Id corresponding to the
-- attribute declaration ("for Attr (index) use ..."), use for example:
--
-- if Case_Insensitive (Attr, Tree) then ...
procedure Set_Attribute_Kind_Of
(Attribute : Attribute_Node_Id;
To : Attribute_Kind);
-- Set the attribute kind of a known attribute. Does nothing if
-- Attribute is Empty_Attribute.
function Attribute_Name_Of (Attribute : Attribute_Node_Id) return Name_Id;
-- Returns the name of a known attribute. Returns No_Name if Attribute is
-- Empty_Attribute.
function Variable_Kind_Of
(Attribute : Attribute_Node_Id) return Variable_Kind;
-- Returns the variable kind of a known attribute. Returns Undefined if
-- Attribute is Empty_Attribute.
procedure Set_Variable_Kind_Of
(Attribute : Attribute_Node_Id;
To : Variable_Kind);
-- Set the variable kind of a known attribute. Does nothing if Attribute is
-- Empty_Attribute.
function Attribute_Default_Of
(Attribute : Attribute_Node_Id) return Attribute_Default_Value;
-- Returns the default of the attribute, Read_Only_Value for read only
-- attributes, Empty_Value when default not specified, or specified value.
function Optional_Index_Of (Attribute : Attribute_Node_Id) return Boolean;
-- Returns True if Attribute is a known attribute and may have an
-- optional index. Returns False otherwise.
function Is_Read_Only (Attribute : Attribute_Node_Id) return Boolean;
function Next_Attribute
(After : Attribute_Node_Id) return Attribute_Node_Id;
-- Returns the attribute that follow After in the list of project level
-- attributes or the list of attributes in a package.
-- Returns Empty_Attribute if After is either Empty_Attribute or is the
-- last of the list.
function Others_Allowed_For (Attribute : Attribute_Node_Id) return Boolean;
-- True iff the index for an associative array attributes may be others
--------------
-- Packages --
--------------
type Package_Node_Id is private;
-- Type to refer to a package, self initialized
Empty_Package : constant Package_Node_Id;
-- Default value of Package_Node_Id objects
Unknown_Package : constant Package_Node_Id;
-- Value of an unknown package that has been found but is unknown
procedure Register_New_Package (Name : String; Id : out Package_Node_Id);
-- Add a new package. Fails if Name (the package name) is empty or is
-- already the name of a package, and set Id to Empty_Package,
-- if Prj.Com.Fail returns. Initially, the new package has no attributes.
-- Id may be used to add attributes using procedure Register_New_Attribute
-- below.
procedure Register_New_Attribute
(Name : String;
In_Package : Package_Node_Id;
Attr_Kind : Defined_Attribute_Kind;
Var_Kind : Defined_Variable_Kind;
Index_Is_File_Name : Boolean := False;
Opt_Index : Boolean := False;
Default : Attribute_Default_Value := Empty_Value);
-- Add a new attribute to registered package In_Package. Fails if Name
-- (the attribute name) is empty, if In_Package is Empty_Package or if
-- the attribute name has a duplicate name. See definition of type
-- Attribute_Data above for the meaning of parameters Attr_Kind, Var_Kind,
-- Index_Is_File_Name, Opt_Index, and Default.
function Package_Node_Id_Of (Name : Name_Id) return Package_Node_Id;
-- Returns the package node id of the package with name Name. Returns
-- Empty_Package if there is no package with this name.
function First_Attribute_Of
(Pkg : Package_Node_Id) return Attribute_Node_Id;
-- Returns the first attribute in the list of attributes of package Pkg.
-- Returns Empty_Attribute if Pkg is Empty_Package or Unknown_Package.
private
----------------
-- Attributes --
----------------
Attributes_Initial : constant := 50;
Attributes_Increment : constant := 100;
Attribute_Node_Low_Bound : constant := 0;
Attribute_Node_High_Bound : constant := 099_999_999;
type Attr_Node_Id is
range Attribute_Node_Low_Bound .. Attribute_Node_High_Bound;
-- Index type for table Attrs in the body
type Attribute_Node_Id is record
Value : Attr_Node_Id := Attribute_Node_Low_Bound;
end record;
-- Full declaration of self-initialized private type
Empty_Attr : constant Attr_Node_Id := Attribute_Node_Low_Bound;
Empty_Attribute : constant Attribute_Node_Id := (Value => Empty_Attr);
First_Attribute : constant Attr_Node_Id := Attribute_Node_Low_Bound + 1;
First_Attribute_Node_Id : constant Attribute_Node_Id :=
(Value => First_Attribute);
Attribute_First : constant Attribute_Node_Id := First_Attribute_Node_Id;
--------------
-- Packages --
--------------
Packages_Initial : constant := 10;
Packages_Increment : constant := 100;
Package_Node_Low_Bound : constant := 0;
Package_Node_High_Bound : constant := 099_999_999;
type Pkg_Node_Id is
range Package_Node_Low_Bound .. Package_Node_High_Bound;
-- Index type for table Package_Attributes in the body
type Package_Node_Id is record
Value : Pkg_Node_Id := Package_Node_Low_Bound;
end record;
-- Full declaration of self-initialized private type
Empty_Pkg : constant Pkg_Node_Id := Package_Node_Low_Bound;
Empty_Package : constant Package_Node_Id := (Value => Empty_Pkg);
Unknown_Pkg : constant Pkg_Node_Id := Package_Node_High_Bound;
Unknown_Package : constant Package_Node_Id := (Value => Unknown_Pkg);
First_Package : constant Pkg_Node_Id := Package_Node_Low_Bound + 1;
First_Package_Node_Id : constant Package_Node_Id :=
(Value => First_Package);
Package_First : constant Package_Node_Id := First_Package_Node_Id;
----------------
-- Attributes --
----------------
type Attribute_Record is record
Name : Name_Id;
Var_Kind : Variable_Kind;
Optional_Index : Boolean;
Attr_Kind : Attribute_Kind;
Read_Only : Boolean;
Others_Allowed : Boolean;
Default : Attribute_Default_Value;
Next : Attr_Node_Id;
end record;
-- Data for an attribute
package Attrs is
new Table.Table (Table_Component_Type => Attribute_Record,
Table_Index_Type => Attr_Node_Id,
Table_Low_Bound => First_Attribute,
Table_Initial => Attributes_Initial,
Table_Increment => Attributes_Increment,
Table_Name => "Prj.Attr.Attrs");
-- The table of the attributes
--------------
-- Packages --
--------------
type Package_Record is record
Name : Name_Id;
Known : Boolean := True;
First_Attribute : Attr_Node_Id;
end record;
-- Data for a package
package Package_Attributes is
new Table.Table (Table_Component_Type => Package_Record,
Table_Index_Type => Pkg_Node_Id,
Table_Low_Bound => First_Package,
Table_Initial => Packages_Initial,
Table_Increment => Packages_Increment,
Table_Name => "Prj.Attr.Packages");
-- The table of the packages
end Prj.Attr;
|
with Tkmrpc.Types;
with Tkmrpc.Operations.Ike;
package Tkmrpc.Response.Ike.Ae_Reset is
Data_Size : constant := 0;
Padding_Size : constant := Response.Body_Size - Data_Size;
subtype Padding_Range is Natural range 1 .. Padding_Size;
subtype Padding_Type is Types.Byte_Sequence (Padding_Range);
type Response_Type is record
Header : Response.Header_Type;
Padding : Padding_Type;
end record;
for Response_Type use record
Header at 0 range 0 .. (Response.Header_Size * 8) - 1;
Padding at Response.Header_Size + Data_Size range
0 .. (Padding_Size * 8) - 1;
end record;
for Response_Type'Size use Response.Response_Size * 8;
Null_Response : constant Response_Type :=
Response_Type'
(Header =>
Response.Header_Type'(Operation => Operations.Ike.Ae_Reset,
Result => Results.Invalid_Operation,
Request_Id => 0),
Padding => Padding_Type'(others => 0));
end Tkmrpc.Response.Ike.Ae_Reset;
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Localization, Internationalization, Globalization for Ada --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2010, Vadim Godunko <vgodunko@gmail.com> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with Matreshka.Internals.Regexps.Engine;
package Matreshka.Internals.Regexps.Compiler.Generator is
pragma Preelaborate;
function Generate
(Pattern : not null Shared_Pattern_Access) return Engine.Program;
end Matreshka.Internals.Regexps.Compiler.Generator;
|
------------------------------------------------------------------------------
-- --
-- Copyright (C) 2017, AdaCore --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- 2. Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- 3. Neither the name of 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. --
-- --
------------------------------------------------------------------------------
package MicroBit.IOs is
type Pin_Id is range 0 .. 20;
type IO_Features is (Digital, Analog, Touch);
function Supports (Pin : Pin_Id; Feature : IO_Features) return Boolean is
(case Feature is
when Digital => (case Pin is
when 0 .. 16 | 19 .. 20 => True,
when others => False),
when Analog => (case Pin is
when 0 .. 4 | 10 => True,
when others => False),
when Touch => (case Pin is
when 0 | 1 | 2 => True,
when others => False));
procedure Set (Pin : Pin_Id; Value : Boolean)
with Pre => Supports (Pin, Digital);
function Set (Pin : Pin_Id) return Boolean
with Pre => Supports (Pin, Digital);
type Analog_Value is range 0 .. 1023;
procedure Write (Pin : Pin_Id; Value : Analog_Value)
with Pre => Supports (Pin, Analog);
function Analog (Pin : Pin_Id) return Analog_Value
with Pre => Supports (Pin, Analog);
function Touched (Pin : Pin_Id) return Boolean
with Pre => Supports (Pin, Touch);
end MicroBit.IOs;
|
------------------------------------------------------------------------------
-- Copyright (c) 2014, Natacha Porté --
-- --
-- Permission to use, copy, modify, and distribute this software for any --
-- purpose with or without fee is hereby granted, provided that the above --
-- copyright notice and this permission notice appear in all copies. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF --
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR --
-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES --
-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN --
-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF --
-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- Natools.S_Expressions.Templates.Dates provides a template interpreter --
-- for dates and times. --
------------------------------------------------------------------------------
with Ada.Calendar.Formatting;
with Ada.Calendar.Time_Zones;
with Ada.Streams;
with Natools.S_Expressions.Lockable;
package Natools.S_Expressions.Templates.Dates is
type Split_Time is record
Source : Ada.Calendar.Time;
Time_Zone : Ada.Calendar.Time_Zones.Time_Offset;
Year : Ada.Calendar.Year_Number;
Month : Ada.Calendar.Month_Number;
Day : Ada.Calendar.Day_Number;
Day_Of_Week : Ada.Calendar.Formatting.Day_Name;
Hour : Ada.Calendar.Formatting.Hour_Number;
Minute : Ada.Calendar.Formatting.Minute_Number;
Second : Ada.Calendar.Formatting.Second_Number;
Sub_Second : Ada.Calendar.Formatting.Second_Duration;
end record;
function Split
(Value : Ada.Calendar.Time;
Time_Zone : Ada.Calendar.Time_Zones.Time_Offset)
return Split_Time;
-- Pre process split time component from Value in Time_Zone
procedure Render
(Output : in out Ada.Streams.Root_Stream_Type'Class;
Template : in out Lockable.Descriptor'Class;
Value : in Split_Time);
-- Render the given time
procedure Render
(Output : in out Ada.Streams.Root_Stream_Type'Class;
Template : in out Lockable.Descriptor'Class;
Value : in Ada.Calendar.Time);
-- Render the given time considered in local time zone
procedure Render
(Output : in out Ada.Streams.Root_Stream_Type'Class;
Template : in out Lockable.Descriptor'Class;
Value : in Ada.Calendar.Time;
Time_Zone : Ada.Calendar.Time_Zones.Time_Offset);
-- Render the given time
end Natools.S_Expressions.Templates.Dates;
|
with SDL_video_h; use SDL_video_h;
with Interfaces.C; use Interfaces.C;
with Interfaces.C.Extensions; use Interfaces.C.Extensions;
with SDL_stdinc_h; use SDL_stdinc_h;
with SDL_surface_h; use SDL_surface_h;
package Display.Basic.Utils is
-- type RGBA_Color is record
-- R, G, B, A : Unsigned_8;
-- end record;
--
-- Color_Map : array (Color_Type) of RGBA_Color :=
-- (Black => ( 0, 0, 0, 255),
-- Blue => ( 0, 0, 255, 255),
-- Green => ( 0, 255, 0, 255),
-- Cyan => ( 0, 255, 255, 255),
-- Red => (255, 0, 0, 255),
-- Magenta => (255, 0, 255, 255),
-- Yellow => (255, 255, 0, 255),
-- White => (255, 255, 255, 255),
-- Gray => (125, 125, 125, 255)
-- );
function RGBA_To_Uint32(Screen : access SDL_Surface;
Color : RGBA_T) return Uint32;
procedure Put_Pixel_Slow (Screen : access SDL_Surface;
X, Y : Integer; Color : RGBA_T);
procedure Put_Pixel (Screen : access SDL_Surface;
X, Y : Integer; Color : Uint32);
type T_Internal_Canvas is record
Surface : access SDL_Surface;
Zoom_Factor : Float := 1.0;
Center : Screen_Point := (0, 0);
end record;
procedure Set_Zoom_Factor (Canvas : Canvas_Id; ZF : Float);
procedure Set_Center (Canvas : Canvas_ID; Center : Screen_Point);
function Get_Center (Canvas : Canvas_ID) return Screen_Point;
function Register_SDL_Surface(S : access SDL_Surface) return Canvas_ID;
function Get_Internal_Canvas(Canvas : Canvas_ID) return T_Internal_Canvas with Inline;
private
type Internal_Canvas_Array is array (Canvas_ID) of T_Internal_Canvas;
Internal_Canvas : Internal_Canvas_Array;
end Display.Basic.Utils;
|
------------------------------------------------------------------------------
-- --
-- GNAT EXAMPLE --
-- --
-- Copyright (C) 2016, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with Ada.Text_IO; use Ada.Text_IO;
with Dvidrv;
with Ada.Real_Time;
procedure Video is
begin
Put_Line ("Simple video example");
Dvidrv.Init;
Put_Line ("Done.");
delay until Ada.Real_Time.Time_Last;
end Video;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . P A C K _ 5 5 --
-- --
-- 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. --
-- --
------------------------------------------------------------------------------
with System.Storage_Elements;
with System.Unsigned_Types;
package body System.Pack_55 is
subtype Bit_Order is System.Bit_Order;
Reverse_Bit_Order : constant Bit_Order :=
Bit_Order'Val (1 - Bit_Order'Pos (System.Default_Bit_Order));
subtype Ofs is System.Storage_Elements.Storage_Offset;
subtype Uns is System.Unsigned_Types.Unsigned;
subtype N07 is System.Unsigned_Types.Unsigned range 0 .. 7;
use type System.Storage_Elements.Storage_Offset;
use type System.Unsigned_Types.Unsigned;
type Cluster is record
E0, E1, E2, E3, E4, E5, E6, E7 : Bits_55;
end record;
for Cluster use record
E0 at 0 range 0 * Bits .. 0 * Bits + Bits - 1;
E1 at 0 range 1 * Bits .. 1 * Bits + Bits - 1;
E2 at 0 range 2 * Bits .. 2 * Bits + Bits - 1;
E3 at 0 range 3 * Bits .. 3 * Bits + Bits - 1;
E4 at 0 range 4 * Bits .. 4 * Bits + Bits - 1;
E5 at 0 range 5 * Bits .. 5 * Bits + Bits - 1;
E6 at 0 range 6 * Bits .. 6 * Bits + Bits - 1;
E7 at 0 range 7 * Bits .. 7 * Bits + Bits - 1;
end record;
for Cluster'Size use Bits * 8;
for Cluster'Alignment use Integer'Min (Standard'Maximum_Alignment,
1 +
1 * Boolean'Pos (Bits mod 2 = 0) +
2 * Boolean'Pos (Bits mod 4 = 0));
-- Use maximum possible alignment, given the bit field size, since this
-- will result in the most efficient code possible for the field.
type Cluster_Ref is access Cluster;
type Rev_Cluster is new Cluster
with Bit_Order => Reverse_Bit_Order,
Scalar_Storage_Order => Reverse_Bit_Order;
type Rev_Cluster_Ref is access Rev_Cluster;
------------
-- Get_55 --
------------
function Get_55
(Arr : System.Address;
N : Natural;
Rev_SSO : Boolean) return Bits_55
is
A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8);
C : Cluster_Ref with Address => A'Address, Import;
RC : Rev_Cluster_Ref with Address => A'Address, Import;
begin
if Rev_SSO then
case N07 (Uns (N) mod 8) is
when 0 => return RC.E0;
when 1 => return RC.E1;
when 2 => return RC.E2;
when 3 => return RC.E3;
when 4 => return RC.E4;
when 5 => return RC.E5;
when 6 => return RC.E6;
when 7 => return RC.E7;
end case;
else
case N07 (Uns (N) mod 8) is
when 0 => return C.E0;
when 1 => return C.E1;
when 2 => return C.E2;
when 3 => return C.E3;
when 4 => return C.E4;
when 5 => return C.E5;
when 6 => return C.E6;
when 7 => return C.E7;
end case;
end if;
end Get_55;
------------
-- Set_55 --
------------
procedure Set_55
(Arr : System.Address;
N : Natural;
E : Bits_55;
Rev_SSO : Boolean)
is
A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8);
C : Cluster_Ref with Address => A'Address, Import;
RC : Rev_Cluster_Ref with Address => A'Address, Import;
begin
if Rev_SSO then
case N07 (Uns (N) mod 8) is
when 0 => RC.E0 := E;
when 1 => RC.E1 := E;
when 2 => RC.E2 := E;
when 3 => RC.E3 := E;
when 4 => RC.E4 := E;
when 5 => RC.E5 := E;
when 6 => RC.E6 := E;
when 7 => RC.E7 := E;
end case;
else
case N07 (Uns (N) mod 8) is
when 0 => C.E0 := E;
when 1 => C.E1 := E;
when 2 => C.E2 := E;
when 3 => C.E3 := E;
when 4 => C.E4 := E;
when 5 => C.E5 := E;
when 6 => C.E6 := E;
when 7 => C.E7 := E;
end case;
end if;
end Set_55;
end System.Pack_55;
|
-- C85018A.ADA
-- Grant of Unlimited Rights
--
-- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
-- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
-- unlimited rights in the software and documentation contained herein.
-- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
-- this public release, the Government intends to confer upon all
-- recipients unlimited rights equal to those held by the Government.
-- These rights include rights to use, duplicate, release or disclose the
-- released technical data and computer software in whole or in part, in
-- any manner and for any purpose whatsoever, and to have or permit others
-- to do so.
--
-- DISCLAIMER
--
-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
-- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
-- PARTICULAR PURPOSE OF SAID MATERIAL.
--*
-- CHECK THAT AN ENTRY FAMILY MEMBER CAN BE RENAMED WITH:
-- 1) DIFFERENT PARAMETER NAMES;
-- 2) DIFFERENT DEFAULT VALUES;
-- AND THAT THE NEW NAMES/DEFAULTS ARE USED WHEN THE NEW NAME
-- IS USED IN A CALL.
-- RJW 6/3/86
WITH REPORT; USE REPORT;
PROCEDURE C85018A IS
BEGIN
TEST( "C85018A", "CHECK THAT AN ENTRY FAMILY MEMBER CAN BE " &
"RENAMED AND THAT THE NEW NAMES/DEFAULTS ARE " &
"THOSE ASSOCIATED WITH THE RENAMED ENTITY" );
DECLARE
RESULTS : INTEGER;
TYPE TA IS ARRAY(1 .. 5) OF INTEGER;
TASK T IS
ENTRY ENT1 (BOOLEAN)
(A : INTEGER := 1; B : TA := (1 .. 5 => 1));
END T;
PROCEDURE ENTA (C : INTEGER := 1; D : TA := (1 .. 5 => 1))
RENAMES T.ENT1 (TRUE);
PROCEDURE ENTB (B : INTEGER := 1; A : TA := (1 .. 5 => 1))
RENAMES T.ENT1 (TRUE);
PROCEDURE ENTC (A : INTEGER := 2; B : TA := (1, 2, 3, 4, 5))
RENAMES T.ENT1 (TRUE);
PROCEDURE ENTD (C : INTEGER := 2; D : TA := (1, 2, 3, 4, 5))
RENAMES T.ENT1 (TRUE);
TASK BODY T IS
BEGIN
LOOP
SELECT
ACCEPT ENT1 (IDENT_BOOL (TRUE))
(A : INTEGER := 1;
B : TA := (1 .. 5 => 1)) DO
IF A IN 1 .. 5 THEN
RESULTS := B(A);
ELSE
RESULTS := 0;
END IF;
END;
OR
TERMINATE;
END SELECT;
END LOOP;
END T;
BEGIN
T.ENT1 (TRUE);
IF RESULTS /= 1 THEN
FAILED ( "PARAMETERS NOT PROPERLY INITIALIZED" );
END IF;
T.ENT1 (TRUE) (A => 6);
IF RESULTS /= 0 THEN
FAILED ( "INCORRECT RESULTS" );
END IF;
ENTA;
IF RESULTS /= 1 THEN
FAILED ( "CASE 1 : INCORRECT RESULTS (DEFAULT)" );
END IF;
ENTA(D => (5, 4, 3, 2, 1));
IF RESULTS /= 5 THEN
FAILED ( "CASE 1 : INCORRECT RESULTS" );
END IF;
ENTB;
IF RESULTS /= 1 THEN
FAILED ( "CASE 1 : INCORRECT RESULTS (DEFAULT)" );
END IF;
ENTB(A => (5, 4, 3, 2, 1), B => 2);
IF RESULTS /= 4 THEN
FAILED ( "CASE 1 : INCORRECT RESULTS " );
END IF;
ENTC;
IF RESULTS /= 2 THEN
FAILED ( "CASE 2 : INCORRECT RESULTS (DEFAULT)" );
END IF;
ENTC(3);
IF RESULTS /= 3 THEN
FAILED ( "CASE 2 : INCORRECT RESULTS " );
END IF;
ENTD;
IF RESULTS /= 2 THEN
FAILED ( "CASE 2 : INCORRECT RESULTS (DEFAULT)" );
END IF;
ENTD(4);
IF RESULTS /= 4 THEN
FAILED ( "CASE 2 : INCORRECT RESULTS " );
END IF;
END;
RESULT;
END C85018A;
|
------------------------------------------------------------------------------
-- --
-- Copyright (C) 2015-2017, AdaCore --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- 2. Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- 3. Neither the name of STMicroelectronics nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
-- --
-- COPYRIGHT(c) 2014 STMicroelectronics --
------------------------------------------------------------------------------
with STM32.GPIO; use STM32.GPIO;
package STM32.AFIO is
subtype GPIO_Pin_Index is Natural range 0 .. 15;
procedure Connect_External_Interrupt (Port : GPIO_Port; Pin : GPIO_Pin_Index);
procedure Connect_External_Interrupt
(Port : GPIO_Port; Pin : GPIO_Pin) with Inline;
procedure Connect_External_Interrupt
(Point : GPIO_Point) with Inline;
procedure Connect_External_Interrupt
(Port : GPIO_Port; Pins : GPIO_Pins) with Inline;
procedure Clear_External_Interrupt (Pin : GPIO_Pin) with Inline;
end STM32.AFIO;
|
<?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>load35</name>
<ret_bitwidth>0</ret_bitwidth>
<ports class_id="2" tracking_level="0" version="0">
<count>5</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>input_stream_0_0_V_V</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>to.V.V</originalName>
<rtlName></rtlName>
<coreName>FIFO_SRL</coreName>
</Obj>
<bitwidth>512</bitwidth>
</Value>
<direction>1</direction>
<if_type>3</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>var_input_0_0_V</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>from.V</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>512</bitwidth>
</Value>
<direction>0</direction>
<if_type>4</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>var_input_0_0_V_offset</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>FIFO</coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<direction>0</direction>
<if_type>3</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>coalesced_data_num</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>FIFO</coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<direction>0</direction>
<if_type>3</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>coalesced_data_num_out</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>FIFO</coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<direction>1</direction>
<if_type>3</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>18</count>
<item_version>0</item_version>
<item class_id="9" tracking_level="1" version="0" object_id="_6">
<Value>
<Obj>
<type>0</type>
<id>12</id>
<name>var_input_0_0_V_offset_read</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>44</item>
<item>45</item>
</oprand_edges>
<opcode>read</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>1.21</m_delay>
</item>
<item class_id_reference="9" object_id="_7">
<Value>
<Obj>
<type>0</type>
<id>13</id>
<name>var_input_0_0_V_offset1_i</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>26</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>47</item>
<item>48</item>
<item>50</item>
<item>52</item>
</oprand_edges>
<opcode>partselect</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
<item class_id_reference="9" object_id="_8">
<Value>
<Obj>
<type>0</type>
<id>14</id>
<name>tmp_i</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>53</item>
</oprand_edges>
<opcode>zext</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
<item class_id_reference="9" object_id="_9">
<Value>
<Obj>
<type>0</type>
<id>15</id>
<name>var_input_0_0_V_addr</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>512</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>54</item>
<item>55</item>
</oprand_edges>
<opcode>getelementptr</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
<item class_id_reference="9" object_id="_10">
<Value>
<Obj>
<type>0</type>
<id>19</id>
<name>coalesced_data_num_read</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>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>57</item>
<item>58</item>
</oprand_edges>
<opcode>read</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>1.21</m_delay>
</item>
<item class_id_reference="9" object_id="_11">
<Value>
<Obj>
<type>0</type>
<id>21</id>
<name></name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>60</item>
<item>61</item>
<item>62</item>
</oprand_edges>
<opcode>write</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>1.21</m_delay>
</item>
<item class_id_reference="9" object_id="_12">
<Value>
<Obj>
<type>0</type>
<id>22</id>
<name>tmp</name>
<fileName>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</fileName>
<fileDirectory>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</fileDirectory>
<lineNumber>9718</lineNumber>
<contextFuncName>jacobi2d_kernel</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item class_id="11" tracking_level="0" version="0">
<first>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</first>
<second class_id="12" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="13" tracking_level="0" version="0">
<first class_id="14" tracking_level="0" version="0">
<first>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</first>
<second>jacobi2d_kernel</second>
</first>
<second>9718</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>data_num</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>63</item>
</oprand_edges>
<opcode>trunc</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
<item class_id_reference="9" object_id="_13">
<Value>
<Obj>
<type>0</type>
<id>24</id>
<name>var_input_0_0_V_addr_i_rd_req</name>
<fileName>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</fileName>
<fileDirectory>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</fileDirectory>
<lineNumber>35</lineNumber>
<contextFuncName>load</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</first>
<second>jacobi2d_kernel</second>
</first>
<second>9718</second>
</item>
<item>
<first>
<first>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</first>
<second>load</second>
</first>
<second>35</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>65</item>
<item>66</item>
<item>67</item>
</oprand_edges>
<opcode>readreq</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>2.43</m_delay>
</item>
<item class_id_reference="9" object_id="_14">
<Value>
<Obj>
<type>0</type>
<id>25</id>
<name></name>
<fileName>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</fileName>
<fileDirectory>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</fileDirectory>
<lineNumber>32</lineNumber>
<contextFuncName>load</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</first>
<second>jacobi2d_kernel</second>
</first>
<second>9718</second>
</item>
<item>
<first>
<first>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</first>
<second>load</second>
</first>
<second>32</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>68</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.60</m_delay>
</item>
<item class_id_reference="9" object_id="_15">
<Value>
<Obj>
<type>0</type>
<id>27</id>
<name>i_i_i_i</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>i</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>31</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>70</item>
<item>71</item>
<item>72</item>
<item>73</item>
</oprand_edges>
<opcode>phi</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
<item class_id_reference="9" object_id="_16">
<Value>
<Obj>
<type>0</type>
<id>28</id>
<name>i_cast_i_i_i</name>
<fileName>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</fileName>
<fileDirectory>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</fileDirectory>
<lineNumber>32</lineNumber>
<contextFuncName>load</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</first>
<second>jacobi2d_kernel</second>
</first>
<second>9718</second>
</item>
<item>
<first>
<first>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</first>
<second>load</second>
</first>
<second>32</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>74</item>
</oprand_edges>
<opcode>zext</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
<item class_id_reference="9" object_id="_17">
<Value>
<Obj>
<type>0</type>
<id>29</id>
<name>tmp_i_i_i</name>
<fileName>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</fileName>
<fileDirectory>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</fileDirectory>
<lineNumber>32</lineNumber>
<contextFuncName>load</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</first>
<second>jacobi2d_kernel</second>
</first>
<second>9718</second>
</item>
<item>
<first>
<first>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</first>
<second>load</second>
</first>
<second>32</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>75</item>
<item>76</item>
</oprand_edges>
<opcode>icmp</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.85</m_delay>
</item>
<item class_id_reference="9" object_id="_18">
<Value>
<Obj>
<type>0</type>
<id>30</id>
<name>i</name>
<fileName>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</fileName>
<fileDirectory>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</fileDirectory>
<lineNumber>32</lineNumber>
<contextFuncName>load</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</first>
<second>jacobi2d_kernel</second>
</first>
<second>9718</second>
</item>
<item>
<first>
<first>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</first>
<second>load</second>
</first>
<second>32</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>i</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>31</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>77</item>
<item>79</item>
</oprand_edges>
<opcode>add</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.87</m_delay>
</item>
<item class_id_reference="9" object_id="_19">
<Value>
<Obj>
<type>0</type>
<id>31</id>
<name></name>
<fileName>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</fileName>
<fileDirectory>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</fileDirectory>
<lineNumber>32</lineNumber>
<contextFuncName>load</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</first>
<second>jacobi2d_kernel</second>
</first>
<second>9718</second>
</item>
<item>
<first>
<first>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</first>
<second>load</second>
</first>
<second>32</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>80</item>
<item>81</item>
<item>82</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
<item class_id_reference="9" object_id="_20">
<Value>
<Obj>
<type>0</type>
<id>36</id>
<name>tmp_V</name>
<fileName>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</fileName>
<fileDirectory>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</fileDirectory>
<lineNumber>35</lineNumber>
<contextFuncName>load</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</first>
<second>jacobi2d_kernel</second>
</first>
<second>9718</second>
</item>
<item>
<first>
<first>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</first>
<second>load</second>
</first>
<second>35</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>tmp.V</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>512</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>84</item>
<item>85</item>
<item>336</item>
</oprand_edges>
<opcode>read</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>2.43</m_delay>
</item>
<item class_id_reference="9" object_id="_21">
<Value>
<Obj>
<type>0</type>
<id>37</id>
<name>empty</name>
<fileName>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</fileName>
<fileDirectory>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</fileDirectory>
<lineNumber>35</lineNumber>
<contextFuncName>load</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</first>
<second>jacobi2d_kernel</second>
</first>
<second>9718</second>
</item>
<item>
<first>
<first>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</first>
<second>load</second>
</first>
<second>35</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>87</item>
<item>88</item>
<item>89</item>
</oprand_edges>
<opcode>nbwrite</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>1.21</m_delay>
</item>
<item class_id_reference="9" object_id="_22">
<Value>
<Obj>
<type>0</type>
<id>39</id>
<name></name>
<fileName>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</fileName>
<fileDirectory>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</fileDirectory>
<lineNumber>32</lineNumber>
<contextFuncName>load</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</first>
<second>jacobi2d_kernel</second>
</first>
<second>9718</second>
</item>
<item>
<first>
<first>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</first>
<second>load</second>
</first>
<second>32</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>90</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
<item class_id_reference="9" object_id="_23">
<Value>
<Obj>
<type>0</type>
<id>41</id>
<name></name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>0</count>
<item_version>0</item_version>
</oprand_edges>
<opcode>ret</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
</nodes>
<consts class_id="15" tracking_level="0" version="0">
<count>4</count>
<item_version>0</item_version>
<item class_id="16" tracking_level="1" version="0" object_id="_24">
<Value>
<Obj>
<type>2</type>
<id>49</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>6</content>
</item>
<item class_id_reference="16" object_id="_25">
<Value>
<Obj>
<type>2</type>
<id>51</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>31</content>
</item>
<item class_id_reference="16" object_id="_26">
<Value>
<Obj>
<type>2</type>
<id>69</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>31</bitwidth>
</Value>
<const_type>0</const_type>
<content>0</content>
</item>
<item class_id_reference="16" object_id="_27">
<Value>
<Obj>
<type>2</type>
<id>78</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>31</bitwidth>
</Value>
<const_type>0</const_type>
<content>1</content>
</item>
</consts>
<blocks class_id="17" tracking_level="0" version="0">
<count>4</count>
<item_version>0</item_version>
<item class_id="18" tracking_level="1" version="0" object_id="_28">
<Obj>
<type>3</type>
<id>26</id>
<name>entry</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>9</count>
<item_version>0</item_version>
<item>12</item>
<item>13</item>
<item>14</item>
<item>15</item>
<item>19</item>
<item>21</item>
<item>22</item>
<item>24</item>
<item>25</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_29">
<Obj>
<type>3</type>
<id>32</id>
<name></name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>5</count>
<item_version>0</item_version>
<item>27</item>
<item>28</item>
<item>29</item>
<item>30</item>
<item>31</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_30">
<Obj>
<type>3</type>
<id>40</id>
<name></name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>3</count>
<item_version>0</item_version>
<item>36</item>
<item>37</item>
<item>39</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_31">
<Obj>
<type>3</type>
<id>42</id>
<name>.exit</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>1</count>
<item_version>0</item_version>
<item>41</item>
</node_objs>
</item>
</blocks>
<edges class_id="19" tracking_level="0" version="0">
<count>35</count>
<item_version>0</item_version>
<item class_id="20" tracking_level="1" version="0" object_id="_32">
<id>45</id>
<edge_type>1</edge_type>
<source_obj>3</source_obj>
<sink_obj>12</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_33">
<id>48</id>
<edge_type>1</edge_type>
<source_obj>12</source_obj>
<sink_obj>13</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_34">
<id>50</id>
<edge_type>1</edge_type>
<source_obj>49</source_obj>
<sink_obj>13</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_35">
<id>52</id>
<edge_type>1</edge_type>
<source_obj>51</source_obj>
<sink_obj>13</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_36">
<id>53</id>
<edge_type>1</edge_type>
<source_obj>13</source_obj>
<sink_obj>14</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_37">
<id>54</id>
<edge_type>1</edge_type>
<source_obj>2</source_obj>
<sink_obj>15</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_38">
<id>55</id>
<edge_type>1</edge_type>
<source_obj>14</source_obj>
<sink_obj>15</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_39">
<id>58</id>
<edge_type>1</edge_type>
<source_obj>4</source_obj>
<sink_obj>19</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_40">
<id>61</id>
<edge_type>1</edge_type>
<source_obj>5</source_obj>
<sink_obj>21</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_41">
<id>62</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="_42">
<id>63</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="_43">
<id>66</id>
<edge_type>1</edge_type>
<source_obj>15</source_obj>
<sink_obj>24</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_44">
<id>67</id>
<edge_type>1</edge_type>
<source_obj>22</source_obj>
<sink_obj>24</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_45">
<id>68</id>
<edge_type>2</edge_type>
<source_obj>32</source_obj>
<sink_obj>25</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_46">
<id>70</id>
<edge_type>1</edge_type>
<source_obj>69</source_obj>
<sink_obj>27</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_47">
<id>71</id>
<edge_type>2</edge_type>
<source_obj>26</source_obj>
<sink_obj>27</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_48">
<id>72</id>
<edge_type>1</edge_type>
<source_obj>30</source_obj>
<sink_obj>27</sink_obj>
<is_back_edge>1</is_back_edge>
</item>
<item class_id_reference="20" object_id="_49">
<id>73</id>
<edge_type>2</edge_type>
<source_obj>40</source_obj>
<sink_obj>27</sink_obj>
<is_back_edge>1</is_back_edge>
</item>
<item class_id_reference="20" object_id="_50">
<id>74</id>
<edge_type>1</edge_type>
<source_obj>27</source_obj>
<sink_obj>28</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_51">
<id>75</id>
<edge_type>1</edge_type>
<source_obj>28</source_obj>
<sink_obj>29</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_52">
<id>76</id>
<edge_type>1</edge_type>
<source_obj>22</source_obj>
<sink_obj>29</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_53">
<id>77</id>
<edge_type>1</edge_type>
<source_obj>27</source_obj>
<sink_obj>30</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_54">
<id>79</id>
<edge_type>1</edge_type>
<source_obj>78</source_obj>
<sink_obj>30</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_55">
<id>80</id>
<edge_type>1</edge_type>
<source_obj>29</source_obj>
<sink_obj>31</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_56">
<id>81</id>
<edge_type>2</edge_type>
<source_obj>42</source_obj>
<sink_obj>31</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_57">
<id>82</id>
<edge_type>2</edge_type>
<source_obj>40</source_obj>
<sink_obj>31</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_58">
<id>85</id>
<edge_type>1</edge_type>
<source_obj>15</source_obj>
<sink_obj>36</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_59">
<id>88</id>
<edge_type>1</edge_type>
<source_obj>1</source_obj>
<sink_obj>37</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_60">
<id>89</id>
<edge_type>1</edge_type>
<source_obj>36</source_obj>
<sink_obj>37</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_61">
<id>90</id>
<edge_type>2</edge_type>
<source_obj>32</source_obj>
<sink_obj>39</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_62">
<id>332</id>
<edge_type>2</edge_type>
<source_obj>26</source_obj>
<sink_obj>32</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_63">
<id>333</id>
<edge_type>2</edge_type>
<source_obj>32</source_obj>
<sink_obj>40</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_64">
<id>334</id>
<edge_type>2</edge_type>
<source_obj>32</source_obj>
<sink_obj>42</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_65">
<id>335</id>
<edge_type>2</edge_type>
<source_obj>40</source_obj>
<sink_obj>32</sink_obj>
<is_back_edge>1</is_back_edge>
</item>
<item class_id_reference="20" object_id="_66">
<id>336</id>
<edge_type>4</edge_type>
<source_obj>24</source_obj>
<sink_obj>36</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
</edges>
</cdfg>
<cdfg_regions class_id="21" tracking_level="0" version="0">
<count>4</count>
<item_version>0</item_version>
<item class_id="22" tracking_level="1" version="0" object_id="_67">
<mId>1</mId>
<mTag>load35</mTag>
<mType>0</mType>
<sub_regions>
<count>3</count>
<item_version>0</item_version>
<item>2</item>
<item>3</item>
<item>4</item>
</sub_regions>
<basic_blocks>
<count>0</count>
<item_version>0</item_version>
</basic_blocks>
<mII>-1</mII>
<mDepth>-1</mDepth>
<mMinTripCount>-1</mMinTripCount>
<mMaxTripCount>-1</mMaxTripCount>
<mMinLatency>-1</mMinLatency>
<mMaxLatency>-1</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"></mDfPipe>
</item>
<item class_id_reference="22" object_id="_68">
<mId>2</mId>
<mTag>Entry</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>26</item>
</basic_blocks>
<mII>-1</mII>
<mDepth>-1</mDepth>
<mMinTripCount>-1</mMinTripCount>
<mMaxTripCount>-1</mMaxTripCount>
<mMinLatency>126</mMinLatency>
<mMaxLatency>126</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"></mDfPipe>
</item>
<item class_id_reference="22" object_id="_69">
<mId>3</mId>
<mTag>load_epoch</mTag>
<mType>1</mType>
<sub_regions>
<count>0</count>
<item_version>0</item_version>
</sub_regions>
<basic_blocks>
<count>2</count>
<item_version>0</item_version>
<item>32</item>
<item>40</item>
</basic_blocks>
<mII>1</mII>
<mDepth>3</mDepth>
<mMinTripCount>-1</mMinTripCount>
<mMaxTripCount>-1</mMaxTripCount>
<mMinLatency>-1</mMinLatency>
<mMaxLatency>-1</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"></mDfPipe>
</item>
<item class_id_reference="22" object_id="_70">
<mId>4</mId>
<mTag>Return</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>42</item>
</basic_blocks>
<mII>-1</mII>
<mDepth>-1</mDepth>
<mMinTripCount>-1</mMinTripCount>
<mMaxTripCount>-1</mMaxTripCount>
<mMinLatency>0</mMinLatency>
<mMaxLatency>0</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"></mDfPipe>
</item>
</cdfg_regions>
<fsm class_id="24" tracking_level="1" version="0" object_id="_71">
<states class_id="25" tracking_level="0" version="0">
<count>131</count>
<item_version>0</item_version>
<item class_id="26" tracking_level="1" version="0" object_id="_72">
<id>1</id>
<operations class_id="27" tracking_level="0" version="0">
<count>5</count>
<item_version>0</item_version>
<item class_id="28" tracking_level="1" version="0" object_id="_73">
<id>12</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_74">
<id>13</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_75">
<id>19</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_76">
<id>21</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_77">
<id>22</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_78">
<id>2</id>
<operations>
<count>3</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_79">
<id>14</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_80">
<id>15</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_81">
<id>24</id>
<stage>126</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_82">
<id>3</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_83">
<id>24</id>
<stage>125</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_84">
<id>4</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_85">
<id>24</id>
<stage>124</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_86">
<id>5</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_87">
<id>24</id>
<stage>123</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_88">
<id>6</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_89">
<id>24</id>
<stage>122</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_90">
<id>7</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_91">
<id>24</id>
<stage>121</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_92">
<id>8</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_93">
<id>24</id>
<stage>120</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_94">
<id>9</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_95">
<id>24</id>
<stage>119</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_96">
<id>10</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_97">
<id>24</id>
<stage>118</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_98">
<id>11</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_99">
<id>24</id>
<stage>117</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_100">
<id>12</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_101">
<id>24</id>
<stage>116</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_102">
<id>13</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_103">
<id>24</id>
<stage>115</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_104">
<id>14</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_105">
<id>24</id>
<stage>114</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_106">
<id>15</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_107">
<id>24</id>
<stage>113</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_108">
<id>16</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_109">
<id>24</id>
<stage>112</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_110">
<id>17</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_111">
<id>24</id>
<stage>111</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_112">
<id>18</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_113">
<id>24</id>
<stage>110</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_114">
<id>19</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_115">
<id>24</id>
<stage>109</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_116">
<id>20</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_117">
<id>24</id>
<stage>108</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_118">
<id>21</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_119">
<id>24</id>
<stage>107</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_120">
<id>22</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_121">
<id>24</id>
<stage>106</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_122">
<id>23</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_123">
<id>24</id>
<stage>105</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_124">
<id>24</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_125">
<id>24</id>
<stage>104</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_126">
<id>25</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_127">
<id>24</id>
<stage>103</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_128">
<id>26</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_129">
<id>24</id>
<stage>102</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_130">
<id>27</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_131">
<id>24</id>
<stage>101</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_132">
<id>28</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_133">
<id>24</id>
<stage>100</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_134">
<id>29</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_135">
<id>24</id>
<stage>99</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_136">
<id>30</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_137">
<id>24</id>
<stage>98</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_138">
<id>31</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_139">
<id>24</id>
<stage>97</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_140">
<id>32</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_141">
<id>24</id>
<stage>96</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_142">
<id>33</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_143">
<id>24</id>
<stage>95</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_144">
<id>34</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_145">
<id>24</id>
<stage>94</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_146">
<id>35</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_147">
<id>24</id>
<stage>93</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_148">
<id>36</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_149">
<id>24</id>
<stage>92</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_150">
<id>37</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_151">
<id>24</id>
<stage>91</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_152">
<id>38</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_153">
<id>24</id>
<stage>90</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_154">
<id>39</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_155">
<id>24</id>
<stage>89</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_156">
<id>40</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_157">
<id>24</id>
<stage>88</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_158">
<id>41</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_159">
<id>24</id>
<stage>87</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_160">
<id>42</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_161">
<id>24</id>
<stage>86</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_162">
<id>43</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_163">
<id>24</id>
<stage>85</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_164">
<id>44</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_165">
<id>24</id>
<stage>84</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_166">
<id>45</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_167">
<id>24</id>
<stage>83</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_168">
<id>46</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_169">
<id>24</id>
<stage>82</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_170">
<id>47</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_171">
<id>24</id>
<stage>81</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_172">
<id>48</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_173">
<id>24</id>
<stage>80</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_174">
<id>49</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_175">
<id>24</id>
<stage>79</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_176">
<id>50</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_177">
<id>24</id>
<stage>78</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_178">
<id>51</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_179">
<id>24</id>
<stage>77</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_180">
<id>52</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_181">
<id>24</id>
<stage>76</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_182">
<id>53</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_183">
<id>24</id>
<stage>75</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_184">
<id>54</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_185">
<id>24</id>
<stage>74</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_186">
<id>55</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_187">
<id>24</id>
<stage>73</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_188">
<id>56</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_189">
<id>24</id>
<stage>72</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_190">
<id>57</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_191">
<id>24</id>
<stage>71</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_192">
<id>58</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_193">
<id>24</id>
<stage>70</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_194">
<id>59</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_195">
<id>24</id>
<stage>69</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_196">
<id>60</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_197">
<id>24</id>
<stage>68</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_198">
<id>61</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_199">
<id>24</id>
<stage>67</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_200">
<id>62</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_201">
<id>24</id>
<stage>66</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_202">
<id>63</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_203">
<id>24</id>
<stage>65</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_204">
<id>64</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_205">
<id>24</id>
<stage>64</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_206">
<id>65</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_207">
<id>24</id>
<stage>63</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_208">
<id>66</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_209">
<id>24</id>
<stage>62</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_210">
<id>67</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_211">
<id>24</id>
<stage>61</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_212">
<id>68</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_213">
<id>24</id>
<stage>60</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_214">
<id>69</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_215">
<id>24</id>
<stage>59</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_216">
<id>70</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_217">
<id>24</id>
<stage>58</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_218">
<id>71</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_219">
<id>24</id>
<stage>57</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_220">
<id>72</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_221">
<id>24</id>
<stage>56</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_222">
<id>73</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_223">
<id>24</id>
<stage>55</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_224">
<id>74</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_225">
<id>24</id>
<stage>54</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_226">
<id>75</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_227">
<id>24</id>
<stage>53</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_228">
<id>76</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_229">
<id>24</id>
<stage>52</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_230">
<id>77</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_231">
<id>24</id>
<stage>51</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_232">
<id>78</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_233">
<id>24</id>
<stage>50</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_234">
<id>79</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_235">
<id>24</id>
<stage>49</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_236">
<id>80</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_237">
<id>24</id>
<stage>48</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_238">
<id>81</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_239">
<id>24</id>
<stage>47</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_240">
<id>82</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_241">
<id>24</id>
<stage>46</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_242">
<id>83</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_243">
<id>24</id>
<stage>45</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_244">
<id>84</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_245">
<id>24</id>
<stage>44</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_246">
<id>85</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_247">
<id>24</id>
<stage>43</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_248">
<id>86</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_249">
<id>24</id>
<stage>42</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_250">
<id>87</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_251">
<id>24</id>
<stage>41</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_252">
<id>88</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_253">
<id>24</id>
<stage>40</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_254">
<id>89</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_255">
<id>24</id>
<stage>39</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_256">
<id>90</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_257">
<id>24</id>
<stage>38</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_258">
<id>91</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_259">
<id>24</id>
<stage>37</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_260">
<id>92</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_261">
<id>24</id>
<stage>36</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_262">
<id>93</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_263">
<id>24</id>
<stage>35</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_264">
<id>94</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_265">
<id>24</id>
<stage>34</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_266">
<id>95</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_267">
<id>24</id>
<stage>33</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_268">
<id>96</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_269">
<id>24</id>
<stage>32</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_270">
<id>97</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_271">
<id>24</id>
<stage>31</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_272">
<id>98</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_273">
<id>24</id>
<stage>30</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_274">
<id>99</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_275">
<id>24</id>
<stage>29</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_276">
<id>100</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_277">
<id>24</id>
<stage>28</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_278">
<id>101</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_279">
<id>24</id>
<stage>27</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_280">
<id>102</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_281">
<id>24</id>
<stage>26</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_282">
<id>103</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_283">
<id>24</id>
<stage>25</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_284">
<id>104</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_285">
<id>24</id>
<stage>24</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_286">
<id>105</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_287">
<id>24</id>
<stage>23</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_288">
<id>106</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_289">
<id>24</id>
<stage>22</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_290">
<id>107</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_291">
<id>24</id>
<stage>21</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_292">
<id>108</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_293">
<id>24</id>
<stage>20</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_294">
<id>109</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_295">
<id>24</id>
<stage>19</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_296">
<id>110</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_297">
<id>24</id>
<stage>18</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_298">
<id>111</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_299">
<id>24</id>
<stage>17</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_300">
<id>112</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_301">
<id>24</id>
<stage>16</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_302">
<id>113</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_303">
<id>24</id>
<stage>15</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_304">
<id>114</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_305">
<id>24</id>
<stage>14</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_306">
<id>115</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_307">
<id>24</id>
<stage>13</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_308">
<id>116</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_309">
<id>24</id>
<stage>12</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_310">
<id>117</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_311">
<id>24</id>
<stage>11</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_312">
<id>118</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_313">
<id>24</id>
<stage>10</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_314">
<id>119</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_315">
<id>24</id>
<stage>9</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_316">
<id>120</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_317">
<id>24</id>
<stage>8</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_318">
<id>121</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_319">
<id>24</id>
<stage>7</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_320">
<id>122</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_321">
<id>24</id>
<stage>6</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_322">
<id>123</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_323">
<id>24</id>
<stage>5</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_324">
<id>124</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_325">
<id>24</id>
<stage>4</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_326">
<id>125</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_327">
<id>24</id>
<stage>3</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_328">
<id>126</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_329">
<id>24</id>
<stage>2</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_330">
<id>127</id>
<operations>
<count>13</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_331">
<id>6</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_332">
<id>7</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_333">
<id>8</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_334">
<id>9</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_335">
<id>10</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_336">
<id>11</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_337">
<id>16</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_338">
<id>17</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_339">
<id>18</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_340">
<id>20</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_341">
<id>23</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_342">
<id>24</id>
<stage>1</stage>
<latency>126</latency>
</item>
<item class_id_reference="28" object_id="_343">
<id>25</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_344">
<id>128</id>
<operations>
<count>5</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_345">
<id>27</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_346">
<id>28</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_347">
<id>29</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_348">
<id>30</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_349">
<id>31</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_350">
<id>129</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_351">
<id>36</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_352">
<id>130</id>
<operations>
<count>6</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_353">
<id>33</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_354">
<id>34</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_355">
<id>35</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_356">
<id>37</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_357">
<id>38</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_358">
<id>39</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_359">
<id>131</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_360">
<id>41</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
</states>
<transitions class_id="29" tracking_level="0" version="0">
<count>131</count>
<item_version>0</item_version>
<item class_id="30" tracking_level="1" version="0" object_id="_361">
<inState>1</inState>
<outState>2</outState>
<condition class_id="31" tracking_level="0" version="0">
<id>137</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="_362">
<inState>2</inState>
<outState>3</outState>
<condition>
<id>138</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="_363">
<inState>3</inState>
<outState>4</outState>
<condition>
<id>139</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="_364">
<inState>4</inState>
<outState>5</outState>
<condition>
<id>140</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="_365">
<inState>5</inState>
<outState>6</outState>
<condition>
<id>141</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="_366">
<inState>6</inState>
<outState>7</outState>
<condition>
<id>142</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="_367">
<inState>7</inState>
<outState>8</outState>
<condition>
<id>143</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="_368">
<inState>8</inState>
<outState>9</outState>
<condition>
<id>144</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="_369">
<inState>9</inState>
<outState>10</outState>
<condition>
<id>145</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="_370">
<inState>10</inState>
<outState>11</outState>
<condition>
<id>146</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="_371">
<inState>11</inState>
<outState>12</outState>
<condition>
<id>147</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="_372">
<inState>12</inState>
<outState>13</outState>
<condition>
<id>148</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="_373">
<inState>13</inState>
<outState>14</outState>
<condition>
<id>149</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="_374">
<inState>14</inState>
<outState>15</outState>
<condition>
<id>150</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="_375">
<inState>15</inState>
<outState>16</outState>
<condition>
<id>151</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="_376">
<inState>16</inState>
<outState>17</outState>
<condition>
<id>152</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="_377">
<inState>17</inState>
<outState>18</outState>
<condition>
<id>153</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="_378">
<inState>18</inState>
<outState>19</outState>
<condition>
<id>154</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="_379">
<inState>19</inState>
<outState>20</outState>
<condition>
<id>155</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="_380">
<inState>20</inState>
<outState>21</outState>
<condition>
<id>156</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="_381">
<inState>21</inState>
<outState>22</outState>
<condition>
<id>157</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="_382">
<inState>22</inState>
<outState>23</outState>
<condition>
<id>158</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="_383">
<inState>23</inState>
<outState>24</outState>
<condition>
<id>159</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="_384">
<inState>24</inState>
<outState>25</outState>
<condition>
<id>160</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="_385">
<inState>25</inState>
<outState>26</outState>
<condition>
<id>161</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="_386">
<inState>26</inState>
<outState>27</outState>
<condition>
<id>162</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="_387">
<inState>27</inState>
<outState>28</outState>
<condition>
<id>163</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="_388">
<inState>28</inState>
<outState>29</outState>
<condition>
<id>164</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="_389">
<inState>29</inState>
<outState>30</outState>
<condition>
<id>165</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="_390">
<inState>30</inState>
<outState>31</outState>
<condition>
<id>166</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="_391">
<inState>31</inState>
<outState>32</outState>
<condition>
<id>167</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="_392">
<inState>32</inState>
<outState>33</outState>
<condition>
<id>168</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="_393">
<inState>33</inState>
<outState>34</outState>
<condition>
<id>169</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="_394">
<inState>34</inState>
<outState>35</outState>
<condition>
<id>170</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="_395">
<inState>35</inState>
<outState>36</outState>
<condition>
<id>171</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="_396">
<inState>36</inState>
<outState>37</outState>
<condition>
<id>172</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="_397">
<inState>37</inState>
<outState>38</outState>
<condition>
<id>173</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="_398">
<inState>38</inState>
<outState>39</outState>
<condition>
<id>174</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="_399">
<inState>39</inState>
<outState>40</outState>
<condition>
<id>175</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="_400">
<inState>40</inState>
<outState>41</outState>
<condition>
<id>176</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="_401">
<inState>41</inState>
<outState>42</outState>
<condition>
<id>177</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="_402">
<inState>42</inState>
<outState>43</outState>
<condition>
<id>178</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="_403">
<inState>43</inState>
<outState>44</outState>
<condition>
<id>179</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="_404">
<inState>44</inState>
<outState>45</outState>
<condition>
<id>180</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="_405">
<inState>45</inState>
<outState>46</outState>
<condition>
<id>181</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="_406">
<inState>46</inState>
<outState>47</outState>
<condition>
<id>182</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="_407">
<inState>47</inState>
<outState>48</outState>
<condition>
<id>183</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="_408">
<inState>48</inState>
<outState>49</outState>
<condition>
<id>184</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="_409">
<inState>49</inState>
<outState>50</outState>
<condition>
<id>185</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="_410">
<inState>50</inState>
<outState>51</outState>
<condition>
<id>186</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="_411">
<inState>51</inState>
<outState>52</outState>
<condition>
<id>187</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="_412">
<inState>52</inState>
<outState>53</outState>
<condition>
<id>188</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="_413">
<inState>53</inState>
<outState>54</outState>
<condition>
<id>189</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="_414">
<inState>54</inState>
<outState>55</outState>
<condition>
<id>190</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="_415">
<inState>55</inState>
<outState>56</outState>
<condition>
<id>191</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="_416">
<inState>56</inState>
<outState>57</outState>
<condition>
<id>192</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="_417">
<inState>57</inState>
<outState>58</outState>
<condition>
<id>193</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="_418">
<inState>58</inState>
<outState>59</outState>
<condition>
<id>194</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="_419">
<inState>59</inState>
<outState>60</outState>
<condition>
<id>195</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="_420">
<inState>60</inState>
<outState>61</outState>
<condition>
<id>196</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="_421">
<inState>61</inState>
<outState>62</outState>
<condition>
<id>197</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="_422">
<inState>62</inState>
<outState>63</outState>
<condition>
<id>198</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="_423">
<inState>63</inState>
<outState>64</outState>
<condition>
<id>199</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="_424">
<inState>64</inState>
<outState>65</outState>
<condition>
<id>200</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="_425">
<inState>65</inState>
<outState>66</outState>
<condition>
<id>201</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="_426">
<inState>66</inState>
<outState>67</outState>
<condition>
<id>202</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="_427">
<inState>67</inState>
<outState>68</outState>
<condition>
<id>203</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="_428">
<inState>68</inState>
<outState>69</outState>
<condition>
<id>204</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="_429">
<inState>69</inState>
<outState>70</outState>
<condition>
<id>205</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="_430">
<inState>70</inState>
<outState>71</outState>
<condition>
<id>206</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="_431">
<inState>71</inState>
<outState>72</outState>
<condition>
<id>207</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="_432">
<inState>72</inState>
<outState>73</outState>
<condition>
<id>208</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="_433">
<inState>73</inState>
<outState>74</outState>
<condition>
<id>209</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="_434">
<inState>74</inState>
<outState>75</outState>
<condition>
<id>210</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="_435">
<inState>75</inState>
<outState>76</outState>
<condition>
<id>211</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="_436">
<inState>76</inState>
<outState>77</outState>
<condition>
<id>212</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="_437">
<inState>77</inState>
<outState>78</outState>
<condition>
<id>213</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="_438">
<inState>78</inState>
<outState>79</outState>
<condition>
<id>214</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="_439">
<inState>79</inState>
<outState>80</outState>
<condition>
<id>215</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="_440">
<inState>80</inState>
<outState>81</outState>
<condition>
<id>216</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="_441">
<inState>81</inState>
<outState>82</outState>
<condition>
<id>217</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="_442">
<inState>82</inState>
<outState>83</outState>
<condition>
<id>218</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="_443">
<inState>83</inState>
<outState>84</outState>
<condition>
<id>219</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="_444">
<inState>84</inState>
<outState>85</outState>
<condition>
<id>220</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="_445">
<inState>85</inState>
<outState>86</outState>
<condition>
<id>221</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="_446">
<inState>86</inState>
<outState>87</outState>
<condition>
<id>222</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="_447">
<inState>87</inState>
<outState>88</outState>
<condition>
<id>223</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="_448">
<inState>88</inState>
<outState>89</outState>
<condition>
<id>224</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="_449">
<inState>89</inState>
<outState>90</outState>
<condition>
<id>225</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="_450">
<inState>90</inState>
<outState>91</outState>
<condition>
<id>226</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="_451">
<inState>91</inState>
<outState>92</outState>
<condition>
<id>227</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="_452">
<inState>92</inState>
<outState>93</outState>
<condition>
<id>228</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="_453">
<inState>93</inState>
<outState>94</outState>
<condition>
<id>229</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="_454">
<inState>94</inState>
<outState>95</outState>
<condition>
<id>230</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="_455">
<inState>95</inState>
<outState>96</outState>
<condition>
<id>231</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="_456">
<inState>96</inState>
<outState>97</outState>
<condition>
<id>232</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="_457">
<inState>97</inState>
<outState>98</outState>
<condition>
<id>233</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="_458">
<inState>98</inState>
<outState>99</outState>
<condition>
<id>234</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="_459">
<inState>99</inState>
<outState>100</outState>
<condition>
<id>235</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="_460">
<inState>100</inState>
<outState>101</outState>
<condition>
<id>236</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="_461">
<inState>101</inState>
<outState>102</outState>
<condition>
<id>237</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="_462">
<inState>102</inState>
<outState>103</outState>
<condition>
<id>238</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="_463">
<inState>103</inState>
<outState>104</outState>
<condition>
<id>239</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="_464">
<inState>104</inState>
<outState>105</outState>
<condition>
<id>240</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="_465">
<inState>105</inState>
<outState>106</outState>
<condition>
<id>241</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="_466">
<inState>106</inState>
<outState>107</outState>
<condition>
<id>242</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="_467">
<inState>107</inState>
<outState>108</outState>
<condition>
<id>243</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="_468">
<inState>108</inState>
<outState>109</outState>
<condition>
<id>244</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="_469">
<inState>109</inState>
<outState>110</outState>
<condition>
<id>245</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="_470">
<inState>110</inState>
<outState>111</outState>
<condition>
<id>246</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="_471">
<inState>111</inState>
<outState>112</outState>
<condition>
<id>247</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="_472">
<inState>112</inState>
<outState>113</outState>
<condition>
<id>248</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="_473">
<inState>113</inState>
<outState>114</outState>
<condition>
<id>249</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="_474">
<inState>114</inState>
<outState>115</outState>
<condition>
<id>250</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="_475">
<inState>115</inState>
<outState>116</outState>
<condition>
<id>251</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="_476">
<inState>116</inState>
<outState>117</outState>
<condition>
<id>252</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="_477">
<inState>117</inState>
<outState>118</outState>
<condition>
<id>253</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="_478">
<inState>118</inState>
<outState>119</outState>
<condition>
<id>254</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="_479">
<inState>119</inState>
<outState>120</outState>
<condition>
<id>255</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="_480">
<inState>120</inState>
<outState>121</outState>
<condition>
<id>256</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="_481">
<inState>121</inState>
<outState>122</outState>
<condition>
<id>257</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="_482">
<inState>122</inState>
<outState>123</outState>
<condition>
<id>258</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>0</count>
<item_version>0</item_version>
</item>
</sop>
</condition>
</item>
<item class_id_reference="30" object_id="_483">
<inState>123</inState>
<outState>124</outState>
<condition>
<id>259</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>0</count>
<item_version>0</item_version>
</item>
</sop>
</condition>
</item>
<item class_id_reference="30" object_id="_484">
<inState>124</inState>
<outState>125</outState>
<condition>
<id>260</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>0</count>
<item_version>0</item_version>
</item>
</sop>
</condition>
</item>
<item class_id_reference="30" object_id="_485">
<inState>125</inState>
<outState>126</outState>
<condition>
<id>261</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>0</count>
<item_version>0</item_version>
</item>
</sop>
</condition>
</item>
<item class_id_reference="30" object_id="_486">
<inState>126</inState>
<outState>127</outState>
<condition>
<id>262</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>0</count>
<item_version>0</item_version>
</item>
</sop>
</condition>
</item>
<item class_id_reference="30" object_id="_487">
<inState>127</inState>
<outState>128</outState>
<condition>
<id>264</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>0</count>
<item_version>0</item_version>
</item>
</sop>
</condition>
</item>
<item class_id_reference="30" object_id="_488">
<inState>129</inState>
<outState>130</outState>
<condition>
<id>272</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>0</count>
<item_version>0</item_version>
</item>
</sop>
</condition>
</item>
<item class_id_reference="30" object_id="_489">
<inState>130</inState>
<outState>128</outState>
<condition>
<id>273</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>0</count>
<item_version>0</item_version>
</item>
</sop>
</condition>
</item>
<item class_id_reference="30" object_id="_490">
<inState>128</inState>
<outState>131</outState>
<condition>
<id>271</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>1</count>
<item_version>0</item_version>
<item class_id="34" tracking_level="0" version="0">
<first class_id="35" tracking_level="0" version="0">
<first>29</first>
<second>0</second>
</first>
<second>1</second>
</item>
</item>
</sop>
</condition>
</item>
<item class_id_reference="30" object_id="_491">
<inState>128</inState>
<outState>129</outState>
<condition>
<id>274</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>29</first>
<second>0</second>
</first>
<second>0</second>
</item>
</item>
</sop>
</condition>
</item>
</transitions>
</fsm>
<res class_id="-1"></res>
<node_label_latency class_id="37" tracking_level="0" version="0">
<count>18</count>
<item_version>0</item_version>
<item class_id="38" tracking_level="0" version="0">
<first>12</first>
<second class_id="39" tracking_level="0" version="0">
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>13</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>14</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>15</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>19</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>21</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>22</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>24</first>
<second>
<first>1</first>
<second>125</second>
</second>
</item>
<item>
<first>25</first>
<second>
<first>126</first>
<second>0</second>
</second>
</item>
<item>
<first>27</first>
<second>
<first>127</first>
<second>0</second>
</second>
</item>
<item>
<first>28</first>
<second>
<first>127</first>
<second>0</second>
</second>
</item>
<item>
<first>29</first>
<second>
<first>127</first>
<second>0</second>
</second>
</item>
<item>
<first>30</first>
<second>
<first>127</first>
<second>0</second>
</second>
</item>
<item>
<first>31</first>
<second>
<first>127</first>
<second>0</second>
</second>
</item>
<item>
<first>36</first>
<second>
<first>128</first>
<second>0</second>
</second>
</item>
<item>
<first>37</first>
<second>
<first>129</first>
<second>0</second>
</second>
</item>
<item>
<first>39</first>
<second>
<first>129</first>
<second>0</second>
</second>
</item>
<item>
<first>41</first>
<second>
<first>130</first>
<second>0</second>
</second>
</item>
</node_label_latency>
<bblk_ent_exit class_id="40" tracking_level="0" version="0">
<count>4</count>
<item_version>0</item_version>
<item class_id="41" tracking_level="0" version="0">
<first>26</first>
<second class_id="42" tracking_level="0" version="0">
<first>0</first>
<second>126</second>
</second>
</item>
<item>
<first>32</first>
<second>
<first>127</first>
<second>127</second>
</second>
</item>
<item>
<first>40</first>
<second>
<first>128</first>
<second>129</second>
</second>
</item>
<item>
<first>42</first>
<second>
<first>128</first>
<second>128</second>
</second>
</item>
</bblk_ent_exit>
<regions class_id="43" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="44" tracking_level="1" version="0" object_id="_492">
<region_name>load_epoch</region_name>
<basic_blocks>
<count>2</count>
<item_version>0</item_version>
<item>32</item>
<item>40</item>
</basic_blocks>
<nodes>
<count>0</count>
<item_version>0</item_version>
</nodes>
<anchor_node>-1</anchor_node>
<region_type>8</region_type>
<interval>1</interval>
<pipe_depth>3</pipe_depth>
</item>
</regions>
<dp_fu_nodes class_id="45" tracking_level="0" version="0">
<count>14</count>
<item_version>0</item_version>
<item class_id="46" tracking_level="0" version="0">
<first>114</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>12</item>
</second>
</item>
<item>
<first>120</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>19</item>
</second>
</item>
<item>
<first>126</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>21</item>
</second>
</item>
<item>
<first>134</first>
<second>
<count>126</count>
<item_version>0</item_version>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
</second>
</item>
<item>
<first>140</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>36</item>
</second>
</item>
<item>
<first>145</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>37</item>
</second>
</item>
<item>
<first>156</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>27</item>
</second>
</item>
<item>
<first>163</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>13</item>
</second>
</item>
<item>
<first>173</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>22</item>
</second>
</item>
<item>
<first>177</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>14</item>
</second>
</item>
<item>
<first>180</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>15</item>
</second>
</item>
<item>
<first>187</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>28</item>
</second>
</item>
<item>
<first>191</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>29</item>
</second>
</item>
<item>
<first>196</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>30</item>
</second>
</item>
</dp_fu_nodes>
<dp_fu_nodes_expression class_id="48" tracking_level="0" version="0">
<count>8</count>
<item_version>0</item_version>
<item class_id="49" tracking_level="0" version="0">
<first>i_cast_i_i_i_fu_187</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>28</item>
</second>
</item>
<item>
<first>i_fu_196</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>30</item>
</second>
</item>
<item>
<first>i_i_i_i_phi_fu_156</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>27</item>
</second>
</item>
<item>
<first>tmp_fu_173</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>22</item>
</second>
</item>
<item>
<first>tmp_i_fu_177</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>14</item>
</second>
</item>
<item>
<first>tmp_i_i_i_fu_191</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>29</item>
</second>
</item>
<item>
<first>var_input_0_0_V_addr_fu_180</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>15</item>
</second>
</item>
<item>
<first>var_input_0_0_V_offset1_i_fu_163</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>13</item>
</second>
</item>
</dp_fu_nodes_expression>
<dp_fu_nodes_module>
<count>0</count>
<item_version>0</item_version>
</dp_fu_nodes_module>
<dp_fu_nodes_io>
<count>6</count>
<item_version>0</item_version>
<item>
<first>StgValue_135_write_fu_126</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>21</item>
</second>
</item>
<item>
<first>coalesced_data_num_read_read_fu_120</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>19</item>
</second>
</item>
<item>
<first>empty_nbwrite_fu_145</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>37</item>
</second>
</item>
<item>
<first>grp_readreq_fu_134</first>
<second>
<count>126</count>
<item_version>0</item_version>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
<item>24</item>
</second>
</item>
<item>
<first>tmp_V_read_fu_140</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>36</item>
</second>
</item>
<item>
<first>var_input_0_0_V_offset_read_read_fu_114</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>12</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="50" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_mem_port_nodes>
<dp_reg_nodes>
<count>7</count>
<item_version>0</item_version>
<item>
<first>152</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>27</item>
</second>
</item>
<item>
<first>202</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>13</item>
</second>
</item>
<item>
<first>207</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>22</item>
</second>
</item>
<item>
<first>213</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>15</item>
</second>
</item>
<item>
<first>219</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>29</item>
</second>
</item>
<item>
<first>223</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>30</item>
</second>
</item>
<item>
<first>228</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>36</item>
</second>
</item>
</dp_reg_nodes>
<dp_regname_nodes>
<count>7</count>
<item_version>0</item_version>
<item>
<first>i_i_i_i_reg_152</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>27</item>
</second>
</item>
<item>
<first>i_reg_223</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>30</item>
</second>
</item>
<item>
<first>tmp_V_reg_228</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>36</item>
</second>
</item>
<item>
<first>tmp_i_i_i_reg_219</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>29</item>
</second>
</item>
<item>
<first>tmp_reg_207</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>22</item>
</second>
</item>
<item>
<first>var_input_0_0_V_addr_reg_213</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>15</item>
</second>
</item>
<item>
<first>var_input_0_0_V_offset1_i_reg_202</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>13</item>
</second>
</item>
</dp_regname_nodes>
<dp_reg_phi>
<count>1</count>
<item_version>0</item_version>
<item>
<first>152</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>27</item>
</second>
</item>
</dp_reg_phi>
<dp_regname_phi>
<count>1</count>
<item_version>0</item_version>
<item>
<first>i_i_i_i_reg_152</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>27</item>
</second>
</item>
</dp_regname_phi>
<dp_port_io_nodes class_id="51" tracking_level="0" version="0">
<count>5</count>
<item_version>0</item_version>
<item class_id="52" tracking_level="0" version="0">
<first>coalesced_data_num</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>coalesced_data_num_out</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>write</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>21</item>
</second>
</item>
</second>
</item>
<item>
<first>input_stream_0_0_V_V</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>nbwrite</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>37</item>
</second>
</item>
</second>
</item>
<item>
<first>var_input_0_0_V</first>
<second>
<count>0</count>
<item_version>0</item_version>
</second>
</item>
<item>
<first>var_input_0_0_V_offset</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>read</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>12</item>
</second>
</item>
</second>
</item>
</dp_port_io_nodes>
<port2core class_id="53" tracking_level="0" version="0">
<count>4</count>
<item_version>0</item_version>
<item class_id="54" tracking_level="0" version="0">
<first>1</first>
<second>FIFO_SRL</second>
</item>
<item>
<first>3</first>
<second>FIFO</second>
</item>
<item>
<first>4</first>
<second>FIFO</second>
</item>
<item>
<first>5</first>
<second>FIFO</second>
</item>
</port2core>
<node2core>
<count>0</count>
<item_version>0</item_version>
</node2core>
</syndb>
</boost_serialization>
|
------------------------------------------------------------------------------
-- G P S --
-- --
-- Copyright (C) 2007-2016, AdaCore --
-- --
-- This is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. This software is distributed in the hope that it will be useful, --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- --
-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public --
-- License for more details. You should have received a copy of the GNU --
-- General Public License distributed with this software; see file --
-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy --
-- of the license. --
------------------------------------------------------------------------------
-- This package provides a set of high-level subprograms for handling UTF8
-- encoding
with Basic_Types; use Basic_Types;
with GNAT.Strings; use GNAT.Strings;
with GNATCOLL.Iconv; use GNATCOLL.Iconv;
package UTF8_Utils is
function Unknown_To_UTF8
(Input : String;
Success : access Boolean) return UTF8_String;
-- Transform a string of unknown encoding to UTF-8.
-- The heuristics used is the following:
-- - if S already contains valid UTF-8, assume it is already encoded
-- in UTF8 (the statistical chances for this are very high)
-- - if S does not contain valid UTF-8, assume it is encoded using the
-- locale, and attempt to convert it from the locale to UTF-8.
-- Success is set to False if the conversion failed.
function Unknown_To_UTF8
(Input : String) return UTF8_String;
-- Same as above, but return "<could not convert to UTF8>" if the
-- conversion could not be done.
procedure Unknown_To_UTF8
(Input : String;
Output : out String_Access;
Success : out Boolean);
-- Same as above, but return Output as Unchecked_String_Access for
-- efficiency. Output is still in UTF8 format, and the caller is
-- responsible for freeing it.
-- In addition, if Input is already a valid UTF8 string, then Output
-- will be set to null: you should use Input in this case.
-- If Success is set to False, Output will also be set to null.
-- Warning: Never reference Output (Output'Range) or Output'Last,
-- use Output (1 .. Len) and Len instead.
function UTF8_To_Locale (Input : UTF8_String) return String;
-- Convert Input to the GPS locale (ie, the contents of the environment
-- variable CHARSET, defaulting to ISO-8859-1).
-- If Input could not be converted, Input is returned as-is.
function Locale_To_UTF8 (Input : String) return UTF8_String;
-- Convert Input from the GPS locale (ie, the contents of the environment
-- variable CHARSET, defaulting to ISO-8859-1).
-- If Input could not be converted, Input is returned as-is.
function UTF8_Next_Char
(Str : UTF8_String; Index : Positive) return Positive;
function UTF8_Next_Char
(Str : UTF8_Unbounded_String; Index : Positive) return Positive;
-- Find the start of the next UTF8 character after the Index-th byte.
-- Index has to be on the start of a character.
-- Index is set to a value greater than Str'Last if there is no more
-- character.
function UTF8_Prev_Char
(Str : UTF8_String; Index : Natural) return Natural;
-- Find the start of the previous UTF8 character before the Index-th byte.
-- Index has to be on the start of a character.
-- Index is set to 0 if there is no more character.
function UTF8_Get_Char (Input : UTF8_String) return Wide_Wide_Character;
-- Return first character of UTF8_String
function Latin_1_To_UTF8 (Input : String) return UTF8_String;
-- Convert Latin_1 string to UTF-8.
function Column_To_Index
(Buffer : UTF8_String; Column : Character_Offset_Type) return Natural;
-- Return index of first byte of UTF8 character in given Column
-- Return 0 in Column <= 0. Return Buffer'First when Column = 1
function UTF8_Length (Item : UTF8_String) return Natural;
-- Returns number of user visible characters in UTF8 encoded string.
function Validate (Object : Iconv_T; Input : Byte_Sequence) return Boolean;
-- Check if convertion of Text is possible using given Object
function Validate_UTF_8 (Input : Byte_Sequence) return Boolean;
-- Check whether Input is valid UTF-8
end UTF8_Utils;
|
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Command_Line; use Ada.Command_Line;
with Ada.Environment_Variables;
with Ada.Directories; use Ada.Directories;
with GNAT.OS_Lib; use GNAT.OS_Lib;
procedure Gnatpp is
-- Ada_Launch is the default name, but is meant to be renamed
-- to the executable name that this executable launches
package Env renames Ada.Environment_Variables;
package CL renames Ada.Command_Line;
package Fs renames Ada.Directories;
-- Env, CL, and CLenv are just abbreviations for:
-- Environment_Variables, Command_Line, and Command_Line.Environment
--app-id=gbchcmhmhahfdphkhkmpfmihenigjmpp
Root : String := "/opt/gps2016";
Pixbuf_Base : String := Root & "/lib/gps/gdk-pixbuf-2.0/2.10.0/";
Root_Build : String
:= Root & "/lib/gcc/x86_64-pc-linux-gnu/4.9.4/rts-native";
-- AdaCore GPS install location
Prog : String := Simple_Name(Command_Name);
Launch_Name : String := Root & "/bin/" & "gnatpp";
-- The file name to execute/launch
Launch_Arguments :
GNAT.OS_Lib.Argument_List (1 .. Argument_Count);
-- The arguments to give the executable
Launch_Status : Boolean;
-- The return status of the command + arguments
begin
Env.Set ("LD_LIBRARY_PATH", Root & "/lib/gps:"
& Root & "/lib:"
& Env.Value ("LD_LIBRARY_PATH", "/lib"));
Env.Set ("DYLD_FALLBACK_LIBRARY_PATH", Root & "/lib/gps:"
& Root & "/lib:"
& Env.Value ("DYLD_FALLBACK_LIBRARY_PATH", "/lib"));
Env.Set ("XDG_CONFIG_DIRS", Root & "/share");
Env.Set ("XDG_CONFIG_HOME", Root & "/etc");
Env.Set ("GTK_DATA_PREFIX", Root);
Env.Set ("GTK_EXE_PREFIX", Root);
Env.Set ("GI_TYPELIB_PATH", Root & "/lib/girepository-1.0");
Env.Set ("GSETTINGS_BACKEND", "memory");
-- Test that GPS with GTK is fully installed.
case Kind (Name => Root & "/lib/gps") is
when Directory =>
Env.Clear ("GTK2_RC_FILES");
when others =>
Set_Exit_Status (4);
return;
end case;
-- Test for very local font configuration
case Kind (Name => Root & "/etc/fonts/fonts.conf") is
when Ordinary_File =>
Env.Set ("FONTCONFIG_FILE", Root & "/etc/fonts/fonts.conf");
when others =>
Set_Exit_Status (4);
return;
end case;
-- Test for very local Pango configuration
if Fs.Exists (Name => Root & "/etc/pango/pangorc")
then
if Kind (Name => Root & "/etc/pango/pangorc") = Ordinary_File
then
Env.Set ("PANGO_RC_FILE", Root & "/etc/pango/pangorc");
end if;
-- else
-- Put_Line (Standard_Error, "Problem finding pangorc");
end if;
--Test that PixBuf in in place
case Kind (Name => Pixbuf_Base & "/loaders.cache") is
when Ordinary_File =>
Env.Set ("GDK_PIXBUF_MODULE_FILE", Pixbuf_Base & "/loaders.cache");
Env.Set ("GDK_PIXBUF_MODULEDIR", Pixbuf_Base & "/loaders");
when others =>
Put_Line (Standard_Error, "Problem finding PixBuf cache");
return;
end case;
-- Test that if CHARSET is set to use.
if Env.Value ("CHARSET", "") = ""
then
Env.Set ("CHARSET", "ISO-8859-1");
end if;
Env.Set ("PATH", Root & "/bin:/usr/bin:/bin");
Env.Set ("ADA_INCLUDE_PATH", Root_Build & "/adainclude"
& ":/usr/share/ada/adainclude:"
& "/usr/local/share/ada/adainclude");
Env.Set ("ADA_OBJECTS_PATH", Root_Build & "/adalib"
& ":/usr/share/ada/adalib:"
& "/usr/local/share/ada/adalib");
for N in 1 .. Argument_Count loop
Launch_Arguments (N) := new String'(Argument (N));
end loop;
-- Simply copy/convey all arguments to the new command launch.
--Put_Line (Launch_Name);
-- DEBUG ACTION - remove this statement when the performance is sufficient.
Spawn (Launch_Name, Launch_Arguments, Launch_Status);
-- Launch the new process with conveyed arguments and capture general
-- return status as Success or Failure. A number may be used in the future.
for N in 1 .. Launch_Arguments'Length
loop
null;
-- deallocate memory not in use anymore...
end loop;
if not Launch_Status
then
Set_Exit_Status (Failure);
else
Set_Exit_Status (Success);
end if;
--Give return status back to calling os/environment.
end Gnatpp;
|
------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Sample.Menu_Demo.Aux --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
-- "Software"), to deal in the Software without restriction, including --
-- without limitation the rights to use, copy, modify, merge, publish, --
-- distribute, distribute with modifications, sublicense, and/or sell --
-- copies of the Software, and to permit persons to whom the Software is --
-- furnished to do so, subject to the following conditions: --
-- --
-- The above copyright notice and this permission notice shall be included --
-- in all copies or substantial portions of the Software. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --
-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --
-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. --
-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, --
-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR --
-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR --
-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. --
-- --
-- Except as contained in this notice, the name(s) of the above copyright --
-- holders shall not be used in advertising or otherwise to promote the --
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.11 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels;
with Terminal_Interface.Curses.Menus; use Terminal_Interface.Curses.Menus;
package Sample.Menu_Demo.Aux is
procedure Geometry (M : Menu;
L : out Line_Count;
C : out Column_Count;
Y : out Line_Position;
X : out Column_Position);
-- Calculate the geometry for a panel being able to be used to display
-- the menu.
function Create (M : Menu;
Title : String;
Lin : Line_Position;
Col : Column_Position) return Panel;
-- Create a panel decorated with a frame and the title at the specified
-- position. The dimension of the panel is derived from the menus layout.
procedure Destroy (M : Menu;
P : in out Panel);
-- Destroy all the windowing structures associated with this menu and
-- panel.
function Get_Request (M : Menu; P : Panel) return Key_Code;
-- Centralized request driver for all menus in this sample. This
-- gives us a common key binding for all menus.
end Sample.Menu_Demo.Aux;
|
-- Copyright (c) 2019 Maxim Reznik <reznikmm@gmail.com>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
with Program.Elements.Definitions;
with Program.Lexical_Elements;
package Program.Elements.Component_Definitions is
pragma Pure (Program.Elements.Component_Definitions);
type Component_Definition is
limited interface and Program.Elements.Definitions.Definition;
type Component_Definition_Access is access all Component_Definition'Class
with Storage_Size => 0;
not overriding function Subtype_Indication
(Self : Component_Definition)
return not null Program.Elements.Element_Access is abstract;
not overriding function Has_Aliased
(Self : Component_Definition)
return Boolean is abstract;
type Component_Definition_Text is limited interface;
type Component_Definition_Text_Access is
access all Component_Definition_Text'Class with Storage_Size => 0;
not overriding function To_Component_Definition_Text
(Self : aliased in out Component_Definition)
return Component_Definition_Text_Access is abstract;
not overriding function Aliased_Token
(Self : Component_Definition_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
end Program.Elements.Component_Definitions;
|
with Zip.CRC, UnZip.Decompress.Huffman, BZip2;
with Ada.Text_IO, Interfaces;
with Ada.Streams.Stream_IO;
package body UnZip.Decompress is
procedure Decompress_data (
zip_file : Zip_Streams.Zipstream_Class;
format : PKZip_method;
mode : Write_mode;
output_file_name : String;
output_memory_access : out p_Stream_Element_Array;
feedback : Zip.Feedback_proc;
explode_literal_tree : Boolean;
explode_slide_8KB : Boolean;
end_data_descriptor : Boolean;
encrypted : Boolean;
password : in out Unbounded_String;
get_new_password : Get_password_proc;
hint : in out Zip.Headers.Data_descriptor
)
is
-- Disable AdaControl rule for detecting global variables,
-- they have become local here.
--## RULE OFF Directly_Accessed_Globals
--
-- I/O Buffers sizes
-- Size of input buffer
inbuf_size : constant := 16#8000#; -- (orig : 16#1000# B = 4 KB)
-- Size of sliding dictionary and output buffer
wsize : constant := 16#10000#; -- (orig : 16#8000# B = 32 KB)
--------------------------------------
-- Specifications of UnZ_* packages --
--------------------------------------
use Interfaces;
package UnZ_Glob is
-- I/O Buffers
-- > Sliding dictionary for unzipping, and output buffer as well
slide : Zip.Byte_Buffer (0 .. wsize);
slide_index : Integer := 0; -- Current Position in slide
-- > Input buffer
inbuf : Zip.Byte_Buffer (0 .. inbuf_size - 1);
inpos, readpos : Integer; -- pos. in input buffer, pos. read from file
compsize, -- compressed size of file
reachedsize, -- number of bytes read from zipfile
uncompsize, -- uncompressed size of file
effective_writes : -- count of effective bytes written (for feedback)
UnZip.File_size_type;
crc32val : Unsigned_32; -- crc calculated from data
Zip_EOF : Boolean; -- read over end of zip section for this file
uncompressed_index : Ada.Streams.Stream_Element_Offset;
end UnZ_Glob;
package UnZ_IO is
out_bin_file : Ada.Streams.Stream_IO.File_Type;
out_txt_file : Ada.Text_IO.File_Type;
last_char : Character := ' ';
procedure Init_Buffers;
package Decryption is
procedure Set_mode (crypted : Boolean);
function Get_mode return Boolean;
procedure Init (passwrd : String; crc_check : Unsigned_32);
procedure Decode (b : in out Unsigned_8);
pragma Inline (Decode);
end Decryption;
procedure Read_raw_byte (bt : out Unsigned_8);
pragma Inline (Read_raw_byte);
package Bit_buffer is
procedure Init;
-- Read at least n bits into the bit buffer, returns the n first bits
function Read (n : Natural) return Integer;
pragma Inline (Read);
function Read_U32 (n : Natural) return Unsigned_32;
pragma Inline (Read_U32);
-- Inverts (NOT operator) the result before masking by n bits
function Read_inverted (n : Natural) return Integer;
pragma Inline (Read_inverted);
-- Dump n bits no longer needed from the bit buffer
procedure Dump (n : Natural);
pragma Inline (Dump);
procedure Dump_to_byte_boundary;
function Read_and_dump (n : Natural) return Integer;
pragma Inline (Read_and_dump);
function Read_and_dump_U32 (n : Natural) return Unsigned_32;
pragma Inline (Read_and_dump_U32);
end Bit_buffer;
procedure Flush (x : Natural); -- directly from slide to output stream
procedure Flush_if_full (W : in out Integer; unflushed : in out Boolean);
pragma Inline (Flush_if_full);
procedure Flush_if_full (W : in out Integer);
pragma Inline (Flush_if_full);
procedure Copy (distance, copy_length : Natural;
index : in out Natural);
pragma Inline (Copy);
procedure Copy_or_zero (distance, copy_length : Natural;
index : in out Natural;
unflushed : in out Boolean);
pragma Inline (Copy_or_zero);
procedure Delete_output; -- an error has occured (bad compressed data)
end UnZ_IO;
package UnZ_Meth is
procedure Copy_stored;
procedure Unshrink;
subtype Reduction_factor is Integer range 1 .. 4;
procedure Unreduce (factor : Reduction_factor);
procedure Explode (literal_tree, slide_8_KB : Boolean);
deflate_e_mode : Boolean := False;
procedure Inflate;
procedure Bunzip2; -- Nov - 2009
end UnZ_Meth;
------------------------------
-- Bodies of UnZ_* packages --
------------------------------
package body UnZ_IO is
-- Centralize buffer initialisations - 29 - Jun - 2001
procedure Init_Buffers is
begin
UnZ_Glob.inpos := 0; -- Input buffer position
UnZ_Glob.readpos := -1; -- Nothing read
UnZ_Glob.slide_index := 0;
UnZ_Glob.reachedsize := 0;
UnZ_Glob.effective_writes := 0;
UnZ_Glob.Zip_EOF := False;
Zip.CRC.Init (UnZ_Glob.crc32val);
Bit_buffer.Init;
end Init_Buffers;
procedure Read_buffer is
begin
if full_trace then
pragma Warnings (Off, "this code can never be executed and has been deleted");
Ada.Text_IO.Put ("[Read_buffer .. .");
pragma Warnings (On, "this code can never be executed and has been deleted");
end if;
if UnZ_Glob.reachedsize > UnZ_Glob.compsize + 2 then
-- + 2 : last code is smaller than requested!
UnZ_Glob.readpos := UnZ_Glob.inbuf'Length;
-- Simulates reading - > no blocking
UnZ_Glob.Zip_EOF := True;
else
begin
Zip.BlockRead (
stream => zip_file,
buffer => UnZ_Glob.inbuf,
actually_read => UnZ_Glob.readpos
);
exception
when others => -- I/O error
UnZ_Glob.readpos := UnZ_Glob.inbuf'Length;
-- Simulates reading - > CRC error
UnZ_Glob.Zip_EOF := True;
end;
if UnZ_Glob.readpos = 0 then
UnZ_Glob.readpos := UnZ_Glob.inbuf'Length;
-- Simulates reading - > CRC error
UnZ_Glob.Zip_EOF := True;
end if;
UnZ_Glob.reachedsize :=
UnZ_Glob.reachedsize + UnZip.File_size_type (UnZ_Glob.readpos);
UnZ_Glob.readpos := UnZ_Glob.readpos - 1;
-- Reason : index of inbuf starts at 0
end if;
UnZ_Glob.inpos := 0;
if full_trace then
pragma Warnings (Off, "this code can never be executed and has been deleted");
Ada.Text_IO.Put_Line ("finished]");
pragma Warnings (On, "this code can never be executed and has been deleted");
end if;
end Read_buffer;
procedure Read_byte_no_decrypt (bt : out Zip.Byte) is
pragma Inline (Read_byte_no_decrypt);
begin
if UnZ_Glob.inpos > UnZ_Glob.readpos then
Read_buffer;
end if;
bt := UnZ_Glob.inbuf (UnZ_Glob.inpos);
UnZ_Glob.inpos := UnZ_Glob.inpos + 1;
end Read_byte_no_decrypt;
-- 27 - Jun - 2001 : Decryption - algorithm in Appnote.txt
package body Decryption is
type Decrypt_keys is array (0 .. 2) of Unsigned_32;
the_keys : Decrypt_keys;
decrypt_mode : Boolean;
procedure Set_mode (crypted : Boolean) is
begin
decrypt_mode := crypted;
end Set_mode;
function Get_mode return Boolean is
begin
return decrypt_mode;
end Get_mode;
procedure Update_keys (by : Zip.Byte; keys : in out Decrypt_keys) is
begin
Zip.CRC.Update (keys (0), (0 => by));
keys (1) := keys (1) + (keys (0) and 16#000000ff#);
keys (1) := keys (1) * 134775813 + 1;
Zip.CRC.Update (
keys (2),
(0 => Zip.Byte (Shift_Right (keys (1), 24)))
);
end Update_keys;
function Decrypt_byte (Key_2 : Unsigned_32) return Zip.Byte is
temp : Unsigned_32;
begin
temp := (Key_2 and 16#ffff#) or 2;
temp := temp * (16#ffff# and (temp xor 1));
return Zip.Byte (Shift_Right (temp, 8) and 16#ff#);
end Decrypt_byte;
procedure Init (passwrd : String; crc_check : Unsigned_32) is
buffer : array (0 .. 11) of Zip.Byte;
c : Zip.Byte;
begin
-- Step 1 - Initializing the encryption keys
the_keys := (
0 => 305419896,
1 => 591751049,
2 => 878082192
);
for i in passwrd'Range loop
Update_keys (Zip.Byte (Character'Pos (passwrd (i))), the_keys);
end loop;
-- Step 2 - Decrypting the encryption header
for i in buffer'Range loop
Read_byte_no_decrypt (c);
c := c xor Decrypt_byte (the_keys (2));
Update_keys (c, the_keys);
buffer (i) := c;
end loop;
if buffer (buffer'Last) /=
Zip.Byte (Shift_Right (crc_check, 24))
then
raise UnZip.Wrong_password;
end if;
end Init;
procedure Decode (b : in out Zip.Byte) is
begin
if decrypt_mode then
b := b xor Decrypt_byte (the_keys (2));
Update_keys (b, the_keys);
end if;
end Decode;
end Decryption;
procedure Read_raw_byte (bt : out Zip.Byte) is
begin
Read_byte_no_decrypt (bt);
Decryption.Decode (bt);
end Read_raw_byte;
package body Bit_buffer is
B : Unsigned_32;
K : Integer;
procedure Init is
begin
B := 0;
K := 0;
end Init;
procedure Need (n : Natural) is
pragma Inline (Need);
bt : Zip.Byte;
begin
while K < n loop
Read_raw_byte (bt);
B := B or Shift_Left (Unsigned_32 (bt), K);
K := K + 8;
end loop;
end Need;
procedure Dump (n : Natural) is
begin
B := Shift_Right (B, n);
K := K - n;
end Dump;
procedure Dump_to_byte_boundary is
begin
Dump (K mod 8);
end Dump_to_byte_boundary;
function Read_U32 (n : Natural) return Unsigned_32 is
begin
Need (n);
return B and (Shift_Left (1, n) - 1);
end Read_U32;
function Read_inverted (n : Natural) return Integer is
begin
Need (n);
return Integer ((not B) and (Shift_Left (1, n) - 1));
end Read_inverted;
function Read (n : Natural) return Integer is
begin
return Integer (Read_U32 (n));
end Read;
function Read_and_dump (n : Natural) return Integer is
res : Integer;
begin
res := Read (n);
Dump (n);
return res;
end Read_and_dump;
function Read_and_dump_U32 (n : Natural) return Unsigned_32 is
res : Unsigned_32;
begin
res := Read_U32 (n);
Dump (n);
return res;
end Read_and_dump_U32;
end Bit_buffer;
procedure Flush (x : Natural) is
use Zip, UnZip, Ada.Streams;
user_aborting : Boolean;
begin
if full_trace then
pragma Warnings (Off, "this code can never be executed and has been deleted");
Ada.Text_IO.Put ("[Flush .. .");
pragma Warnings (On, "this code can never be executed and has been deleted");
end if;
begin
case mode is
when write_to_binary_file =>
BlockWrite (Ada.Streams.Stream_IO.Stream (out_bin_file).all, UnZ_Glob.slide (0 .. x - 1));
when write_to_text_file =>
Zip.Write_as_text (
UnZ_IO.out_txt_file, UnZ_Glob.slide (0 .. x - 1), UnZ_IO.last_char
);
when write_to_memory =>
for i in 0 .. x - 1 loop
output_memory_access.all (UnZ_Glob.uncompressed_index) :=
Ada.Streams.Stream_Element (UnZ_Glob.slide (i));
UnZ_Glob.uncompressed_index := UnZ_Glob.uncompressed_index + 1;
end loop;
when just_test =>
null;
end case;
exception
when others =>
raise UnZip.Write_Error;
end;
Zip.CRC.Update (UnZ_Glob.crc32val, UnZ_Glob.slide (0 .. x - 1));
if feedback /= null then -- inform user
UnZ_Glob.effective_writes :=
UnZ_Glob.effective_writes + File_size_type (x);
if UnZ_Glob.uncompsize > 0 then
feedback.all (
percents_done => Natural (
(100.0 * Float (UnZ_Glob.effective_writes)) /
Float (UnZ_Glob.uncompsize)),
entry_skipped => False,
user_abort => user_aborting);
if user_aborting then
raise User_abort;
end if;
end if;
end if;
if full_trace then
pragma Warnings (Off, "this code can never be executed and has been deleted");
Ada.Text_IO.Put_Line ("finished]");
pragma Warnings (On, "this code can never be executed and has been deleted");
end if;
end Flush;
procedure Flush_if_full (W : in out Integer; unflushed : in out Boolean) is
begin
if W = wsize then
Flush (wsize);
W := 0;
unflushed := False;
end if;
end Flush_if_full;
procedure Flush_if_full (W : in out Integer) is
begin
if W = wsize then
Flush (wsize);
W := 0;
end if;
end Flush_if_full;
----------------------------------------------------
-- Reproduction of sequences in the output slide. --
----------------------------------------------------
-- Internal:
procedure Adjust_to_Slide (
source : in out Integer;
remain : in out Natural;
part : out Integer;
index : Integer)
is
pragma Inline (Adjust_to_Slide);
begin
source := source mod wsize;
-- source and index are now in 0 .. WSize - 1
if source > index then
part := wsize - source;
else
part := wsize - index;
end if;
-- NB : part is in 1 .. WSize (part cannot be 0)
if part > remain then
part := remain;
end if;
-- Now part <= remain
remain := remain - part;
-- NB : remain cannot be < 0
end Adjust_to_Slide;
procedure Copy_range (source, index : in out Natural; amount : Positive) is
pragma Inline (Copy_range);
begin
if full_trace then
pragma Warnings (Off, "this code can never be executed and has been deleted");
Ada.Text_IO.Put (
" (Copy_range : source=" & Integer'Image (source) &
" index=" & Integer'Image (index) &
" amount=" & Integer'Image (amount));
pragma Warnings (On, "this code can never be executed and has been deleted");
end if;
if abs (index - source) < amount then
if full_trace and then source < index then
pragma Warnings (Off, "this code can never be executed and has been deleted");
Ada.Text_IO.Put (
"; replicates" &
Integer'Image (amount) & " /" & Integer'Image (index - source) &
")"
);
-- . .. times the range source .. index - 1
pragma Warnings (On, "this code can never be executed and has been deleted");
end if;
-- if source >= index, the effect of copy is
-- just like the non - overlapping case
for count in reverse 1 .. amount loop
UnZ_Glob.slide (index) := UnZ_Glob.slide (source);
index := index + 1;
source := source + 1;
end loop;
else -- non - overlapping - > copy slice
UnZ_Glob.slide (index .. index + amount - 1) :=
UnZ_Glob.slide (source .. source + amount - 1);
index := index + amount;
source := source + amount;
end if;
if full_trace then
pragma Warnings (Off, "this code can never be executed and has been deleted");
Ada.Text_IO.Put (')');
pragma Warnings (On, "this code can never be executed and has been deleted");
end if;
end Copy_range;
-- The copying routines:
procedure Copy (
distance, copy_length : Natural;
index : in out Natural)
is
source, part, remain : Integer;
begin
if full_trace or else (some_trace and then distance > 32768 + 3) then
pragma Warnings (Off, "this code can never be executed and has been deleted");
Ada.Text_IO.Put (
"DLE (distance=" & Integer'Image (distance) &
" length=" & Integer'Image (copy_length) & ")"
);
pragma Warnings (On, "this code can never be executed and has been deleted");
end if;
source := index - distance;
remain := copy_length;
loop
Adjust_to_Slide (source, remain, part, index);
Copy_range (source, index, part);
Flush_if_full (index);
exit when remain = 0;
end loop;
end Copy;
procedure Copy_or_zero (
distance, copy_length : Natural;
index : in out Natural;
unflushed : in out Boolean)
is
source, part, remain : Integer;
begin
source := index - distance;
remain := copy_length;
loop
Adjust_to_Slide (source, remain, part, index);
if unflushed and then index <= source then
UnZ_Glob.slide (index .. index + part - 1) := (others => 0);
index := index + part;
source := source + part;
else
Copy_range (source, index, part);
end if;
Flush_if_full (index, unflushed);
exit when remain = 0;
end loop;
end Copy_or_zero;
procedure Delete_output is -- an error has occured (bad compressed data)
begin
if no_trace then -- if there is a trace, we are debugging
case mode is -- and want to keep the malformed file
when write_to_binary_file =>
Ada.Streams.Stream_IO.Delete (UnZ_IO.out_bin_file);
when write_to_text_file =>
Ada.Text_IO.Delete (UnZ_IO.out_txt_file);
when others =>
null;
end case;
end if;
end Delete_output;
end UnZ_IO;
package body UnZ_Meth is
--------[ Method : Unshrink ] --------
-- Original in Pascal written by Christian Ghisler.
Max_Code : constant := 8192;
Max_Stack : constant := 8192;
Initial_Code_Size : constant := 9;
Maximum_Code_Size : constant := 13;
First_Entry : constant := 257;
-- Rest of slide=write buffer =766 bytes
Write_Max : constant := wsize - 3 * (Max_Code - 256) - Max_Stack - 2;
Previous_Code : array (First_Entry .. Max_Code) of Integer;
Actual_Code : array (First_Entry .. Max_Code) of Zip.Byte;
Next_Free : Integer; -- Next free code in trie
Write_Ptr : Integer; -- Pointer to output buffer
Writebuf : Zip.Byte_Buffer (0 .. Write_Max); -- Write buffer
procedure Unshrink_Flush is
use Zip, UnZip, Ada.Streams, Ada.Streams.Stream_IO;
user_aborting : Boolean;
begin
if full_trace then
pragma Warnings (Off, "this code can never be executed and has been deleted");
Ada.Text_IO.Put ("[Unshrink_Flush]");
pragma Warnings (On, "this code can never be executed and has been deleted");
end if;
begin
case mode is
when write_to_binary_file =>
BlockWrite (Stream (UnZ_IO.out_bin_file).all, Writebuf (0 .. Write_Ptr - 1));
when write_to_text_file =>
Zip.Write_as_text (UnZ_IO.out_txt_file, Writebuf (0 .. Write_Ptr - 1), UnZ_IO.last_char);
when write_to_memory =>
for I in 0 .. Write_Ptr - 1 loop
output_memory_access.all (UnZ_Glob.uncompressed_index) :=
Stream_Element (Writebuf (I));
UnZ_Glob.uncompressed_index := UnZ_Glob.uncompressed_index + 1;
end loop;
when just_test =>
null;
end case;
exception
when others =>
raise UnZip.Write_Error;
end;
Zip.CRC.Update (UnZ_Glob.crc32val, Writebuf (0 .. Write_Ptr - 1));
if feedback /= null then -- inform user
UnZ_Glob.effective_writes :=
UnZ_Glob.effective_writes + File_size_type (Write_Ptr);
feedback.all (
percents_done => Natural (
(100.0 * Float (UnZ_Glob.effective_writes)) /
Float (UnZ_Glob.uncompsize)
),
entry_skipped => False,
user_abort => user_aborting);
if user_aborting then
raise User_abort;
end if;
end if;
end Unshrink_Flush;
procedure Write_Byte (B : Zip.Byte) is
begin
Writebuf (Write_Ptr) := B;
Write_Ptr := Write_Ptr + 1;
if Write_Ptr > Write_Max then
Unshrink_Flush;
Write_Ptr := 0;
end if;
end Write_Byte;
procedure Clear_Leaf_Nodes is
Pc : Integer; -- previous code
Act_Max_Code : Integer; -- max code to be searched for leaf nodes
begin
Act_Max_Code := Next_Free - 1;
for I in First_Entry .. Act_Max_Code loop
Previous_Code (I) :=
Integer (Unsigned_32 (Previous_Code (I)) or 16#8000#);
end loop;
for I in First_Entry .. Act_Max_Code loop
Pc := Previous_Code (I) mod 16#8000#;
if Pc > 256 then
Previous_Code (Pc) := Previous_Code (Pc) mod 16#8000#;
end if;
end loop;
-- Build new free list
Pc := -1;
Next_Free := -1;
for I in First_Entry .. Act_Max_Code loop
-- Either free before or marked now
if (Unsigned_32 (Previous_Code (I)) and 16#C000#) /= 0 then
-- Link last item to this item
if Pc = -1 then
Next_Free := I;
else
Previous_Code (Pc) := -I;
end if;
Pc := I;
end if;
end loop;
if Pc /= -1 then
Previous_Code (Pc) := -Act_Max_Code - 1;
end if;
end Clear_Leaf_Nodes;
procedure Unshrink is
Incode : Integer; -- Code read in
Last_Incode : Integer;
Last_Outcode : Zip.Byte;
Code_Size : Integer := Initial_Code_Size; -- Actual code size (9 .. 13)
Stack : Zip.Byte_Buffer (0 .. Max_Stack); -- Stack for output
Stack_Ptr : Integer := Max_Stack;
New_Code : Integer; -- Save new normal code read
Code_for_Special : constant := 256;
Code_Increase_size : constant := 1;
Code_Clear_table : constant := 2;
S : UnZip.File_size_type := UnZ_Glob.uncompsize;
-- Fix Jan - 2009 : replaces a remaining bits counter as Unsigned_*32* .. .
procedure Read_Code is
pragma Inline (Read_Code);
begin
Incode := UnZ_IO.Bit_buffer.Read_and_dump (Code_Size);
end Read_Code;
begin
Previous_Code := (others => 0);
Actual_Code := (others => 0);
Stack := (others => 0);
Writebuf := (others => 0);
if UnZ_Glob.compsize = Unsigned_32'Last then
-- Compressed Size was not in header!
raise UnZip.Not_supported;
elsif UnZ_Glob.uncompsize = 0 then
return; -- compression of a 0 - file with Shrink.pas
end if;
-- initialize free codes list
for I in Previous_Code'Range loop
Previous_Code (I) := -(I + 1);
end loop;
Next_Free := First_Entry;
Write_Ptr := 0;
Read_Code;
Last_Incode := Incode;
Last_Outcode := Zip.Byte (Incode);
Write_Byte (Last_Outcode);
S := S - 1;
while S > 0 and then not UnZ_Glob.Zip_EOF loop
Read_Code;
if Incode = Code_for_Special then
Read_Code;
case Incode is
when Code_Increase_size =>
Code_Size := Code_Size + 1;
if some_trace then
pragma Warnings (Off, "this code can never be executed and has been deleted");
Ada.Text_IO.Put (
"[LZW code size - >" & Integer'Image (Code_Size) & ']'
);
pragma Warnings (On, "this code can never be executed and has been deleted");
end if;
if Code_Size > Maximum_Code_Size then
raise Zip.Zip_file_Error;
end if;
when Code_Clear_table =>
Clear_Leaf_Nodes;
when others =>
raise Zip.Zip_file_Error;
end case;
else -- Normal code
New_Code := Incode;
if Incode < 256 then -- Simple char
Last_Outcode := Zip.Byte (Incode);
Write_Byte (Last_Outcode);
S := S - 1;
else
if Previous_Code (Incode) < 0 then
Stack (Stack_Ptr) := Last_Outcode;
Stack_Ptr := Stack_Ptr - 1;
Incode := Last_Incode;
end if;
while Incode > 256 loop
-- Test added 11 - Dec - 2007 for situations
-- happening on corrupt files:
if Stack_Ptr < Stack'First or else
Incode > Actual_Code'Last
then
raise Zip.Zip_file_Error;
end if;
Stack (Stack_Ptr) := Actual_Code (Incode);
Stack_Ptr := Stack_Ptr - 1;
Incode := Previous_Code (Incode);
end loop;
Last_Outcode := Zip.Byte (Incode mod 256);
Write_Byte (Last_Outcode);
for I in Stack_Ptr + 1 .. Max_Stack loop
Write_Byte (Stack (I));
end loop;
S := S - UnZip.File_size_type (Max_Stack - Stack_Ptr + 1);
Stack_Ptr := Max_Stack;
end if;
Incode := Next_Free;
if Incode <= Max_Code then
Next_Free := -Previous_Code (Incode);
-- Next node in free list
Previous_Code (Incode) := Last_Incode;
Actual_Code (Incode) := Last_Outcode;
end if;
Last_Incode := New_Code;
end if;
end loop;
if some_trace then
pragma Warnings (Off, "this code can never be executed and has been deleted");
Ada.Text_IO.Put ("[ Unshrink main loop finished ]");
pragma Warnings (On, "this code can never be executed and has been deleted");
end if;
Unshrink_Flush;
end Unshrink;
--------[ Method : Unreduce ] --------
procedure Unreduce (factor : Reduction_factor) is
-- Original slide limit : 16#4000#
DLE_code : constant := 144;
subtype Symbol_range is Integer range 0 .. 255;
subtype Follower_range is Integer range 0 .. 63; -- Appnote : <= 32 !
Followers : array (Symbol_range, Follower_range) of Symbol_range :=
(others => (others => 0));
Slen : array (Symbol_range) of Follower_range;
-- Bits taken by (x - 1) mod 256:
B_Table : constant array (Symbol_range) of Integer :=
(0 => 8,
1 .. 2 => 1,
3 .. 4 => 2,
5 .. 8 => 3,
9 .. 16 => 4,
17 .. 32 => 5,
33 .. 64 => 6,
65 .. 128 => 7,
129 .. 255 => 8);
procedure LoadFollowers is
list_followers : constant Boolean := some_trace;
procedure Show_symbol (S : Symbol_range) is
begin
if S in 32 .. 254 then
Ada.Text_IO.Put (Character'Val (S));
else
Ada.Text_IO.Put ('{' & Symbol_range'Image (S) & '}');
end if;
end Show_symbol;
begin
for X in reverse Symbol_range loop
Slen (X) := UnZ_IO.Bit_buffer.Read_and_dump (6);
if list_followers then
pragma Warnings (Off, "this code can never be executed and has been deleted");
Show_symbol (X);
Ada.Text_IO.Put (" - > (" & Integer'Image (Slen (X)) & ") ");
pragma Warnings (On, "this code can never be executed and has been deleted");
end if;
for I in 0 .. Slen (X) - 1 loop
Followers (X, I) := UnZ_IO.Bit_buffer.Read_and_dump (8);
if list_followers then
pragma Warnings (Off, "this code can never be executed and has been deleted");
Show_symbol (Followers (X, I));
pragma Warnings (On, "this code can never be executed and has been deleted");
end if;
end loop;
if list_followers then
pragma Warnings (Off, "this code can never be executed and has been deleted");
Ada.Text_IO.New_Line;
pragma Warnings (On, "this code can never be executed and has been deleted");
end if;
end loop;
end LoadFollowers;
unreduce_length,
char_read,
last_char : Integer := 0;
-- ^ some := 0 are useless, just to calm down ObjectAda 7.2.2
S : UnZip.File_size_type := UnZ_Glob.uncompsize;
-- number of bytes left to decompress
unflushed : Boolean := True;
maximum_AND_mask : constant Unsigned_32 := Shift_Left (1, 8 - factor) - 1;
procedure Out_byte (b : Zip.Byte) is
begin
S := S - 1;
UnZ_Glob.slide (UnZ_Glob.slide_index) := b;
UnZ_Glob.slide_index := UnZ_Glob.slide_index + 1;
UnZ_IO.Flush_if_full (UnZ_Glob.slide_index, unflushed);
end Out_byte;
V : Unsigned_32 := 0;
type State_type is (normal, length_a, length_b, distance);
state : State_type := normal;
begin
LoadFollowers;
while S > 0 and then not UnZ_Glob.Zip_EOF loop
-- 1/ Probabilistic expansion
if Slen (last_char) = 0 then
-- follower set is empty for this character
char_read := UnZ_IO.Bit_buffer.Read_and_dump (8);
elsif UnZ_IO.Bit_buffer.Read_and_dump (1) = 0 then
char_read := Followers (
last_char,
UnZ_IO.Bit_buffer.Read_and_dump (B_Table (Slen (last_char)))
);
else
char_read := UnZ_IO.Bit_buffer.Read_and_dump (8);
end if;
-- 2/ Expand the resulting Zip.Byte into repeated sequences
case state is
when normal =>
if char_read = DLE_code then
-- >> Next will be a DLE
state := length_a;
else
-- >> A single char
Out_byte (Zip.Byte (char_read));
end if;
when length_a =>
if char_read = 0 then
-- >> DLE_code & 0 - > was just the Zip.Byte coded DLE_code
Out_byte (DLE_code);
state := normal;
else
V := Unsigned_32 (char_read);
unreduce_length := Integer (V and maximum_AND_mask);
-- The remaining bits of V will be used for the distance
if unreduce_length = Integer (maximum_AND_mask) then
state := length_b;
-- >> length must be completed before reading distance
else
state := distance;
end if;
end if;
when length_b =>
unreduce_length := unreduce_length + char_read;
state := distance;
when distance =>
unreduce_length := unreduce_length + 3;
S := S - UnZip.File_size_type (unreduce_length);
UnZ_IO.Copy_or_zero (
distance => char_read + 1 + Integer (Shift_Right (V, 8 - factor) * 2**8),
copy_length => unreduce_length,
index => UnZ_Glob.slide_index,
unflushed => unflushed
);
state := normal;
end case;
last_char := char_read; -- store character for next iteration
end loop;
UnZ_IO.Flush (UnZ_Glob.slide_index);
end Unreduce;
--------[ Method : Explode ] --------
-- C code by info - zip group, translated to Pascal by Christian Ghisler
-- based on unz51g.zip
use UnZip.Decompress.Huffman;
procedure Get_Tree (L : out Length_array) is
I, K, J, B : Unsigned_32;
N : constant Unsigned_32 := L'Length;
L_Idx : Integer := L'First;
Bytebuf : Zip.Byte;
begin
if full_trace then
pragma Warnings (Off, "this code can never be executed and has been deleted");
Ada.Text_IO.Put_Line ("Begin UnZ_Expl.Get_tree");
pragma Warnings (On, "this code can never be executed and has been deleted");
end if;
UnZ_IO.Read_raw_byte (Bytebuf);
I := Unsigned_32 (Bytebuf) + 1;
K := 0;
loop
UnZ_IO.Read_raw_byte (Bytebuf);
J := Unsigned_32 (Bytebuf);
B := (J and 16#0F#) + 1;
J := (J and 16#F0#) / 16 + 1;
if K + J > N then
raise Zip.Zip_file_Error;
end if;
loop
L (L_Idx) := Natural (B);
L_Idx := L_Idx + 1;
K := K + 1;
J := J - 1;
exit when J = 0;
end loop;
I := I - 1;
exit when I = 0;
end loop;
if K /= N then
raise Zip.Zip_file_Error;
end if;
if full_trace then
pragma Warnings (Off, "this code can never be executed and has been deleted");
Ada.Text_IO.Put_Line ("End UnZ_Expl.Get_tree");
pragma Warnings (On, "this code can never be executed and has been deleted");
end if;
end Get_Tree;
procedure Explode_Lit ( -- method with 3 trees
Needed : Integer;
Tb, Tl, Td : p_Table_list;
Bb, Bl, Bd : Integer
)
is
S : Unsigned_32;
E, N, D : Integer;
W : Integer := 0;
Ct : p_HufT_table; -- current table
Ci : Natural; -- current index
unflushed : Boolean := True; -- true while slide not yet unflushed
begin
if full_trace then
pragma Warnings (Off, "this code can never be executed and has been deleted");
Ada.Text_IO.Put_Line ("Begin Explode_lit");
pragma Warnings (On, "this code can never be executed and has been deleted");
end if;
UnZ_IO.Bit_buffer.Init;
S := UnZ_Glob.uncompsize;
while S > 0 and then not UnZ_Glob.Zip_EOF loop
if UnZ_IO.Bit_buffer.Read_and_dump (1) /= 0 then -- 1 : Litteral
S := S - 1;
Ct := Tb.all.table;
Ci := UnZ_IO.Bit_buffer.Read_inverted (Bb);
loop
E := Ct.all (Ci).extra_bits;
exit when E <= 16;
if E = invalid then
raise Zip.Zip_file_Error;
end if;
UnZ_IO.Bit_buffer.Dump (Ct.all (Ci).bits);
E := E - 16;
Ct := Ct.all (Ci).next_table;
Ci := UnZ_IO.Bit_buffer.Read_inverted (E);
end loop;
UnZ_IO.Bit_buffer.Dump (Ct.all (Ci).bits);
UnZ_Glob.slide (W) := Zip.Byte (Ct.all (Ci).n);
W := W + 1;
UnZ_IO.Flush_if_full (W, unflushed);
else -- 0 : Copy
D := UnZ_IO.Bit_buffer.Read_and_dump (Needed);
Ct := Td.all.table;
Ci := UnZ_IO.Bit_buffer.Read_inverted (Bd);
loop
E := Ct.all (Ci).extra_bits;
exit when E <= 16;
if E = invalid then
raise Zip.Zip_file_Error;
end if;
UnZ_IO.Bit_buffer.Dump (Ct.all (Ci).bits);
E := E - 16;
Ct := Ct.all (Ci).next_table;
Ci := UnZ_IO.Bit_buffer.Read_inverted (E);
end loop;
UnZ_IO.Bit_buffer.Dump (Ct.all (Ci).bits);
D := D + Ct.all (Ci).n;
Ct := Tl.all.table;
Ci := UnZ_IO.Bit_buffer.Read_inverted (Bl);
loop
E := Ct.all (Ci).extra_bits;
exit when E <= 16;
if E = invalid then
raise Zip.Zip_file_Error;
end if;
UnZ_IO.Bit_buffer.Dump (Ct.all (Ci).bits);
E := E - 16;
Ct := Ct.all (Ci).next_table;
Ci := UnZ_IO.Bit_buffer.Read_inverted (E);
end loop;
UnZ_IO.Bit_buffer.Dump (Ct.all (Ci).bits);
N := Ct.all (Ci).n;
if E /= 0 then
N := N + UnZ_IO.Bit_buffer.Read_and_dump (8);
end if;
S := S - Unsigned_32 (N);
UnZ_IO.Copy_or_zero (
distance => D,
copy_length => N,
index => W,
unflushed => unflushed
);
end if;
end loop;
UnZ_IO.Flush (W);
if UnZ_Glob.Zip_EOF then
raise UnZip.Read_Error;
end if;
if full_trace then
pragma Warnings (Off, "this code can never be executed and has been deleted");
Ada.Text_IO.Put_Line ("End Explode_lit");
pragma Warnings (On, "this code can never be executed and has been deleted");
end if;
end Explode_Lit;
procedure Explode_Nolit ( -- method with 2 trees
Needed : Integer;
Tl, Td : p_Table_list;
Bl, Bd : Integer
)
is
S : Unsigned_32;
E, N, D : Integer;
W : Integer := 0;
Ct : p_HufT_table; -- current table
Ci : Natural; -- current index
unflushed : Boolean := True; -- true while slide not yet unflushed
begin
if full_trace then
pragma Warnings (Off, "this code can never be executed and has been deleted");
Ada.Text_IO.Put_Line ("Begin Explode_nolit");
pragma Warnings (On, "this code can never be executed and has been deleted");
end if;
UnZ_IO.Bit_buffer.Init;
S := UnZ_Glob.uncompsize;
while S > 0 and then not UnZ_Glob.Zip_EOF loop
if UnZ_IO.Bit_buffer.Read_and_dump (1) /= 0 then -- 1 : Litteral
S := S - 1;
UnZ_Glob.slide (W) :=
Zip.Byte (UnZ_IO.Bit_buffer.Read_and_dump (8));
W := W + 1;
UnZ_IO.Flush_if_full (W, unflushed);
else -- 0 : Copy
D := UnZ_IO.Bit_buffer.Read_and_dump (Needed);
Ct := Td.all.table;
Ci := UnZ_IO.Bit_buffer.Read_inverted (Bd);
loop
E := Ct.all (Ci).extra_bits;
exit when E <= 16;
if E = invalid then
raise Zip.Zip_file_Error;
end if;
UnZ_IO.Bit_buffer.Dump (Ct.all (Ci).bits);
E := E - 16;
Ct := Ct.all (Ci).next_table;
Ci := UnZ_IO.Bit_buffer.Read_inverted (E);
end loop;
UnZ_IO.Bit_buffer.Dump (Ct.all (Ci).bits);
D := D + Ct.all (Ci).n;
Ct := Tl.all.table;
Ci := UnZ_IO.Bit_buffer.Read_inverted (Bl);
loop
E := Ct.all (Ci).extra_bits;
exit when E <= 16;
if E = invalid then
raise Zip.Zip_file_Error;
end if;
UnZ_IO.Bit_buffer.Dump (Ct.all (Ci).bits);
E := E - 16;
Ct := Ct.all (Ci).next_table;
Ci := UnZ_IO.Bit_buffer.Read_inverted (E);
end loop;
UnZ_IO.Bit_buffer.Dump (Ct.all (Ci).bits);
N := Ct.all (Ci).n;
if E /= 0 then
N := N + UnZ_IO.Bit_buffer.Read_and_dump (8);
end if;
S := S - Unsigned_32 (N);
UnZ_IO.Copy_or_zero (
distance => D,
copy_length => N,
index => W,
unflushed => unflushed
);
end if;
end loop;
UnZ_IO.Flush (W);
if UnZ_Glob.Zip_EOF then
raise UnZip.Read_Error;
end if;
if full_trace then
pragma Warnings (Off, "this code can never be executed and has been deleted");
Ada.Text_IO.Put_Line ("End Explode_nolit");
pragma Warnings (On, "this code can never be executed and has been deleted");
end if;
end Explode_Nolit;
procedure Explode (literal_tree, slide_8_KB : Boolean) is
Tb, Tl, Td : p_Table_list;
Bb, Bl, Bd : Integer;
L : Length_array (0 .. 255);
huft_incomplete : Boolean;
cp_length_2_trees :
constant Length_array (0 .. 63) :=
(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65);
cp_length_3_trees :
constant Length_array (0 .. 63) :=
(3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66);
cp_dist_4KB :
constant Length_array (0 .. 63) :=
(1, 65, 129, 193, 257, 321, 385, 449, 513, 577, 641, 705,
769, 833, 897, 961, 1025, 1089, 1153, 1217, 1281, 1345, 1409, 1473,
1537, 1601, 1665, 1729, 1793, 1857, 1921, 1985, 2049, 2113, 2177,
2241, 2305, 2369, 2433, 2497, 2561, 2625, 2689, 2753, 2817, 2881,
2945, 3009, 3073, 3137, 3201, 3265, 3329, 3393, 3457, 3521, 3585,
3649, 3713, 3777, 3841, 3905, 3969, 4033);
cp_dist_8KB :
constant Length_array (0 .. 63) :=
(1, 129, 257, 385, 513, 641, 769, 897, 1025, 1153, 1281,
1409, 1537, 1665, 1793, 1921, 2049, 2177, 2305, 2433, 2561, 2689,
2817, 2945, 3073, 3201, 3329, 3457, 3585, 3713, 3841, 3969, 4097,
4225, 4353, 4481, 4609, 4737, 4865, 4993, 5121, 5249, 5377, 5505,
5633, 5761, 5889, 6017, 6145, 6273, 6401, 6529, 6657, 6785, 6913,
7041, 7169, 7297, 7425, 7553, 7681, 7809, 7937, 8065);
extra :
constant Length_array (0 .. 63) := (0 .. 62 => 0, 63 => 8);
begin
Bl := 7;
if UnZ_Glob.compsize > 200000 then
Bd := 8;
else
Bd := 7;
end if;
if literal_tree then
Bb := 9;
Get_Tree (L);
begin
HufT_build (L, 256, empty, empty, Tb, Bb, huft_incomplete);
if huft_incomplete then
HufT_free (Tb);
raise Zip.Zip_file_Error;
end if;
exception
when others =>
raise Zip.Zip_file_Error;
end;
begin
Get_Tree (L (0 .. 63));
exception
when others =>
HufT_free (Tb);
raise Zip.Zip_file_Error;
end;
begin
HufT_build (
L (0 .. 63), 0, cp_length_3_trees, extra, Tl, Bl, huft_incomplete
);
if huft_incomplete then
HufT_free (Tl);
HufT_free (Tb);
raise Zip.Zip_file_Error;
end if;
exception
when others =>
HufT_free (Tb);
raise Zip.Zip_file_Error;
end;
begin
Get_Tree (L (0 .. 63));
exception
when others =>
HufT_free (Tb);
HufT_free (Tl);
raise Zip.Zip_file_Error;
end;
begin
if slide_8_KB then
HufT_build (
L (0 .. 63), 0, cp_dist_8KB, extra, Td, Bd, huft_incomplete
);
if huft_incomplete then
HufT_free (Td);
HufT_free (Tl);
HufT_free (Tb);
raise Zip.Zip_file_Error;
end if;
-- Exploding, method : 8k slide, 3 trees
Explode_Lit (7, Tb, Tl, Td, Bb, Bl, Bd);
else
HufT_build (
L (0 .. 63), 0, cp_dist_4KB, extra, Td, Bd, huft_incomplete
);
if huft_incomplete then
HufT_free (Td);
HufT_free (Tl);
HufT_free (Tb);
raise Zip.Zip_file_Error;
end if;
-- Exploding, method : 4k slide, 3 trees
Explode_Lit (6, Tb, Tl, Td, Bb, Bl, Bd);
end if;
exception
when others =>
HufT_free (Tl);
HufT_free (Tb);
raise Zip.Zip_file_Error;
end;
HufT_free (Td);
HufT_free (Tl);
HufT_free (Tb);
else -- No literal tree
begin
Get_Tree (L (0 .. 63));
exception
when others =>
raise Zip.Zip_file_Error;
end;
begin
HufT_build (
L (0 .. 63), 0, cp_length_2_trees, extra, Tl, Bl, huft_incomplete
);
if huft_incomplete then
HufT_free (Tl);
raise Zip.Zip_file_Error;
end if;
exception
when others =>
raise Zip.Zip_file_Error;
end;
begin
Get_Tree (L (0 .. 63));
exception
when others =>
HufT_free (Tl);
raise Zip.Zip_file_Error;
end;
begin
if slide_8_KB then
HufT_build (
L (0 .. 63), 0, cp_dist_8KB, extra, Td, Bd, huft_incomplete
);
if huft_incomplete then
HufT_free (Td);
HufT_free (Tl);
raise Zip.Zip_file_Error;
end if;
-- Exploding, method : 8k slide, 2 trees
Explode_Nolit (7, Tl, Td, Bl, Bd);
else
HufT_build (
L (0 .. 63), 0, cp_dist_4KB, extra, Td, Bd, huft_incomplete
);
if huft_incomplete then
HufT_free (Td);
HufT_free (Tl);
raise Zip.Zip_file_Error;
end if;
-- Exploding, method : 4k slide, 2 trees
Explode_Nolit (6, Tl, Td, Bl, Bd);
end if;
exception
when others =>
HufT_free (Tl);
raise Zip.Zip_file_Error;
end;
HufT_free (Td);
HufT_free (Tl);
end if;
end Explode;
--------[ Method : Copy stored ] --------
procedure Copy_stored is
size : constant UnZip.File_size_type := UnZ_Glob.compsize;
read_in, absorbed : UnZip.File_size_type;
begin
absorbed := 0;
if UnZ_IO.Decryption.Get_mode then
absorbed := 12;
end if;
while absorbed < size loop
read_in := size - absorbed;
if read_in > wsize then
read_in := wsize;
end if;
begin
for I in 0 .. read_in - 1 loop
UnZ_IO.Read_raw_byte (UnZ_Glob.slide (Natural (I)));
end loop;
exception
when others =>
raise UnZip.Read_Error;
end;
begin
UnZ_IO.Flush (Natural (read_in)); -- Takes care of CRC too
exception
when others =>
raise UnZip.Write_Error;
end;
absorbed := absorbed + read_in;
end loop;
end Copy_stored;
--------[ Method : Inflate ] --------
procedure Inflate_Codes (Tl, Td : p_Table_list; Bl, Bd : Integer) is
CTE : p_HufT; -- current table element
inflate_length : Natural;
E : Integer; -- table entry flag/number of extra bits
W : Integer := UnZ_Glob.slide_index;
-- more local variable for slide index
begin
if full_trace then
pragma Warnings (Off, "this code can never be executed and has been deleted");
Ada.Text_IO.Put_Line ("Begin Inflate_codes");
pragma Warnings (On, "this code can never be executed and has been deleted");
end if;
-- inflate the coded data
-- pragma Warnings (Off, "variable ""Zip_EOF"" is not modified in loop body");
-- The loop is left through an "exit main_loop" statement.
-- Should be restructured.
main_loop :
loop
-- while not UnZ_Glob.Zip_EOF loop
-- pragma Warnings (On, "variable ""Zip_EOF"" is not modified in loop body");
CTE := Tl.all.table.all (UnZ_IO.Bit_buffer.Read (Bl))'Access;
loop
E := CTE.all.extra_bits;
exit when E <= 16;
if E = invalid then
raise Zip.Zip_file_Error;
end if;
-- then it's a literal
UnZ_IO.Bit_buffer.Dump (CTE.all.bits);
E := E - 16;
CTE := CTE.all.next_table.all (UnZ_IO.Bit_buffer.Read (E))'Access;
end loop;
UnZ_IO.Bit_buffer.Dump (CTE.all.bits);
case E is
when 16 => -- CTE.N is a Litteral
UnZ_Glob.slide (W) := Zip.Byte (CTE.all.n);
W := W + 1;
UnZ_IO.Flush_if_full (W);
when 15 => -- End of block (EOB, code 256)
if full_trace then
pragma Warnings (Off, "this code can never be executed and has been deleted");
Ada.Text_IO.Put_Line ("Exit Inflate_codes, e=15 - > EOB");
pragma Warnings (On, "this code can never be executed and has been deleted");
end if;
exit main_loop;
when others => -- We have a length/distance
-- Get length of block to copy:
inflate_length := CTE.all.n + UnZ_IO.Bit_buffer.Read_and_dump (E);
-- Decode distance of block to copy:
CTE := Td.all.table.all (UnZ_IO.Bit_buffer.Read (Bd))'Access;
loop
E := CTE.all.extra_bits;
exit when E <= 16;
if E = invalid then
raise Zip.Zip_file_Error;
end if;
UnZ_IO.Bit_buffer.Dump (CTE.all.bits);
E := E - 16;
CTE := CTE.all.next_table.all (UnZ_IO.Bit_buffer.Read (E))'Access;
end loop;
UnZ_IO.Bit_buffer.Dump (CTE.all.bits);
UnZ_IO.Copy (
distance => CTE.all.n + UnZ_IO.Bit_buffer.Read_and_dump (E),
copy_length => inflate_length,
index => W
);
end case;
end loop main_loop;
UnZ_Glob.slide_index := W;
if full_trace then
pragma Warnings (Off, "this code can never be executed and has been deleted");
Ada.Text_IO.Put_Line ("End Inflate_codes");
pragma Warnings (On, "this code can never be executed and has been deleted");
end if;
end Inflate_Codes;
procedure Inflate_stored_block is -- Actually, nothing to inflate
N : Integer;
begin
if full_trace then
pragma Warnings (Off, "this code can never be executed and has been deleted");
Ada.Text_IO.Put_Line ("Begin Inflate_stored_block");
pragma Warnings (On, "this code can never be executed and has been deleted");
end if;
UnZ_IO.Bit_buffer.Dump_to_byte_boundary;
-- Get the block length and its complement
N := UnZ_IO.Bit_buffer.Read_and_dump (16);
if N /= Integer (
(not UnZ_IO.Bit_buffer.Read_and_dump_U32 (16))
and 16#ffff#)
then
raise Zip.Zip_file_Error;
end if;
while N > 0 and then not UnZ_Glob.Zip_EOF loop
-- Read and output the non - compressed data
N := N - 1;
UnZ_Glob.slide (UnZ_Glob.slide_index) :=
Zip.Byte (UnZ_IO.Bit_buffer.Read_and_dump (8));
UnZ_Glob.slide_index := UnZ_Glob.slide_index + 1;
UnZ_IO.Flush_if_full (UnZ_Glob.slide_index);
end loop;
if full_trace then
pragma Warnings (Off, "this code can never be executed and has been deleted");
Ada.Text_IO.Put_Line ("End Inflate_stored_block");
pragma Warnings (On, "this code can never be executed and has been deleted");
end if;
end Inflate_stored_block;
-- Copy lengths for literal codes 257 .. 285
copy_lengths_literal : Length_array (0 .. 30) :=
(3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0);
-- Extra bits for literal codes 257 .. 285
extra_bits_literal : Length_array (0 .. 30) :=
(0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2,
3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, invalid, invalid);
-- Copy offsets for distance codes 0 .. 29 (30 .. 31 : deflate_e)
copy_offset_distance : constant Length_array (0 .. 31) :=
(1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
8193, 12289, 16385, 24577, 32769, 49153);
-- Extra bits for distance codes
extra_bits_distance : constant Length_array (0 .. 31) :=
(0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6,
7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14);
max_dist : Integer := 29; -- changed to 31 for deflate_e
procedure Inflate_fixed_block is
Tl, -- literal/length code table
Td : p_Table_list; -- distance code table
Bl, Bd : Integer; -- lookup bits for tl/bd
huft_incomplete : Boolean;
-- length list for HufT_build (literal table)
L : constant Length_array (0 .. 287) :=
(0 .. 143 => 8, 144 .. 255 => 9, 256 .. 279 => 7, 280 .. 287 => 8);
begin
if some_trace then
pragma Warnings (Off, "this code can never be executed and has been deleted");
Ada.Text_IO.Put_Line ("Begin Inflate_fixed_block");
pragma Warnings (On, "this code can never be executed and has been deleted");
end if;
-- make a complete, but wrong code set
Bl := 7;
HufT_build (
L, 257, copy_lengths_literal, extra_bits_literal,
Tl, Bl, huft_incomplete
);
-- Make an incomplete code set
Bd := 5;
begin
HufT_build (
(0 .. max_dist => 5), 0,
copy_offset_distance, extra_bits_distance,
Td, Bd, huft_incomplete
);
if huft_incomplete then
if full_trace then
pragma Warnings (Off, "this code can never be executed and has been deleted");
Ada.Text_IO.Put_Line (
"td is incomplete, pointer=null : " &
Boolean'Image (Td = null)
);
pragma Warnings (On, "this code can never be executed and has been deleted");
end if;
end if;
exception
when huft_out_of_memory | huft_error =>
HufT_free (Tl);
raise Zip.Zip_file_Error;
end;
Inflate_Codes (Tl, Td, Bl, Bd);
HufT_free (Tl); pragma Unreferenced (Tl);
HufT_free (Td); pragma Unreferenced (Td);
if some_trace then
pragma Warnings (Off, "this code can never be executed and has been deleted");
Ada.Text_IO.Put_Line ("End Inflate_fixed_block");
pragma Warnings (On, "this code can never be executed and has been deleted");
end if;
end Inflate_fixed_block;
procedure Inflate_dynamic_block is
bit_order : constant array (0 .. 18) of Natural :=
(16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15);
Lbits : constant := 9;
Dbits : constant := 6;
current_length : Natural;
defined, number_of_lengths : Natural;
Tl, -- literal/length code tables
Td : p_Table_list; -- distance code tables
CTE : p_HufT; -- current table element
Bl, Bd : Integer; -- lookup bits for tl/bd
Nb : Natural; -- number of bit length codes
Nl : Natural; -- number of literal length codes
Nd : Natural; -- number of distance codes
-- literal/length and distance code lengths
Ll : Length_array (0 .. 288 + 32 - 1) := (others => 0);
huft_incomplete : Boolean;
procedure Repeat_length_code (amount : Natural) is
begin
if defined + amount > number_of_lengths then
raise Zip.Zip_file_Error;
end if;
for c in reverse 1 .. amount loop
Ll (defined) := current_length;
defined := defined + 1;
end loop;
end Repeat_length_code;
begin
if some_trace then
pragma Warnings (Off, "this code can never be executed and has been deleted");
Ada.Text_IO.Put_Line ("Begin Inflate_dynamic_block");
pragma Warnings (On, "this code can never be executed and has been deleted");
end if;
-- Read in table lengths
Nl := 257 + UnZ_IO.Bit_buffer.Read_and_dump (5);
Nd := 1 + UnZ_IO.Bit_buffer.Read_and_dump (5);
Nb := 4 + UnZ_IO.Bit_buffer.Read_and_dump (4);
if Nl > 288 or else Nd > 32 then
raise Zip.Zip_file_Error;
end if;
-- Read in bit - length - code lengths.
-- The rest, Ll (Bit_Order (Nb .. 18)), is already = 0
for J in 0 .. Nb - 1 loop
Ll (bit_order (J)) := UnZ_IO.Bit_buffer.Read_and_dump (3);
end loop;
-- Build decoding table for trees --single level, 7 bit lookup
Bl := 7;
begin
HufT_build (
Ll (0 .. 18), 19, empty, empty, Tl, Bl, huft_incomplete
);
if huft_incomplete then
HufT_free (Tl);
raise Zip.Zip_file_Error;
end if;
exception
when others =>
raise Zip.Zip_file_Error;
end;
-- Read in literal and distance code lengths
number_of_lengths := Nl + Nd;
defined := 0;
current_length := 0;
while defined < number_of_lengths loop
CTE := Tl.all.table.all (UnZ_IO.Bit_buffer.Read (Bl))'Access;
UnZ_IO.Bit_buffer.Dump (CTE.all.bits);
case CTE.all.n is
when 0 .. 15 => -- length of code in bits (0 .. 15)
current_length := CTE.all.n;
Ll (defined) := current_length;
defined := defined + 1;
when 16 => -- repeat last length 3 to 6 times
Repeat_length_code (3 + UnZ_IO.Bit_buffer.Read_and_dump (2));
when 17 => -- 3 to 10 zero length codes
current_length := 0;
Repeat_length_code (3 + UnZ_IO.Bit_buffer.Read_and_dump (3));
when 18 => -- 11 to 138 zero length codes
current_length := 0;
Repeat_length_code (11 + UnZ_IO.Bit_buffer.Read_and_dump (7));
when others =>
if full_trace then
pragma Warnings (Off, "this code can never be executed and has been deleted");
Ada.Text_IO.Put_Line (
"Illegal length code : " &
Integer'Image (CTE.n)
);
pragma Warnings (On, "this code can never be executed and has been deleted");
end if;
end case;
end loop;
pragma Warnings (Off, """Tl"" modified by call, but value overwritten at line 1789");
HufT_free (Tl); -- free decoding table for trees
pragma Warnings (On, """Tl"" modified by call, but value overwritten at line 1789");
-- Build the decoding tables for literal/length codes
Bl := Lbits;
begin
HufT_build (
Ll (0 .. Nl - 1), 257,
copy_lengths_literal, extra_bits_literal,
Tl, Bl, huft_incomplete
);
if huft_incomplete then
HufT_free (Tl);
raise Zip.Zip_file_Error;
end if;
exception
when others =>
raise Zip.Zip_file_Error;
end;
-- Build the decoding tables for distance codes
Bd := Dbits;
begin
HufT_build (
Ll (Nl .. Nl + Nd - 1), 0,
copy_offset_distance, extra_bits_distance,
Td, Bd, huft_incomplete
);
if huft_incomplete then -- do nothing!
if some_trace then
pragma Warnings (Off, "this code can never be executed and has been deleted");
Ada.Text_IO.Put_Line ("PKZIP 1.93a bug workaround");
pragma Warnings (On, "this code can never be executed and has been deleted");
end if;
end if;
exception
when huft_out_of_memory | huft_error =>
HufT_free (Tl);
raise Zip.Zip_file_Error;
end;
-- Decompress until an end - of - block code
Inflate_Codes (Tl, Td, Bl, Bd);
HufT_free (Tl); pragma Unreferenced (Tl);
HufT_free (Td); pragma Unreferenced (Td);
if some_trace then
pragma Warnings (Off, "this code can never be executed and has been deleted");
Ada.Text_IO.Put_Line ("End Inflate_dynamic_block");
pragma Warnings (On, "this code can never be executed and has been deleted");
end if;
end Inflate_dynamic_block;
procedure Inflate_Block (last_block : out Boolean) is
begin
last_block := Boolean'Val (UnZ_IO.Bit_buffer.Read_and_dump (1));
case UnZ_IO.Bit_buffer.Read_and_dump (2) is -- Block type = 0, 1, 2, 3
when 0 => Inflate_stored_block;
when 1 => Inflate_fixed_block;
when 2 => Inflate_dynamic_block;
when others => raise Zip.Zip_file_Error; -- Bad block type (3)
end case;
end Inflate_Block;
procedure Inflate is
is_last_block : Boolean;
blocks : Positive := 1;
begin
if deflate_e_mode then
copy_lengths_literal (28) := 3; -- instead of 258
extra_bits_literal (28) := 16; -- instead of 0
max_dist := 31;
end if;
loop
Inflate_Block (is_last_block);
exit when is_last_block;
blocks := blocks + 1;
end loop;
UnZ_IO.Flush (UnZ_Glob.slide_index);
UnZ_Glob.slide_index := 0;
if some_trace then
pragma Warnings (Off, "this code can never be executed and has been deleted");
Ada.Text_IO.Put ("# blocks:" & Integer'Image (blocks));
pragma Warnings (On, "this code can never be executed and has been deleted");
end if;
end Inflate;
--------[ Method : BZip2 ] --------
procedure Bunzip2 is
type BZ_Buffer is array (Natural range <>) of Interfaces.Unsigned_8;
procedure Read (b : out BZ_Buffer) is
begin
for i in b'Range loop
exit when UnZ_Glob.Zip_EOF;
UnZ_IO.Read_raw_byte (b (i));
end loop;
end Read;
procedure Write (b : BZ_Buffer) is
begin
for i in b'Range loop
UnZ_Glob.slide (UnZ_Glob.slide_index) := b (i);
UnZ_Glob.slide_index := UnZ_Glob.slide_index + 1;
UnZ_IO.Flush_if_full (UnZ_Glob.slide_index);
end loop;
end Write;
package My_BZip2 is new BZip2
(Buffer => BZ_Buffer,
check_CRC => False, -- Already done by UnZ_IO
Read => Read,
Write => Write
);
begin
My_BZip2.Decompress;
UnZ_IO.Flush (UnZ_Glob.slide_index);
end Bunzip2;
end UnZ_Meth;
procedure Process (descriptor : out Zip.Headers.Data_descriptor)
is
start : Integer;
b : Unsigned_8;
dd_buffer : Zip.Byte_Buffer (1 .. 30);
begin
UnZ_IO.Bit_buffer.Dump_to_byte_boundary;
UnZ_IO.Read_raw_byte (b);
if b = 75 then -- 'K' ('P' is before, Java/JAR bug!)
dd_buffer (1) := 80;
dd_buffer (2) := 75;
start := 3;
else
dd_buffer (1) := b; -- hopefully = 80
start := 2;
end if;
for i in start .. 16 loop
UnZ_IO.Read_raw_byte (dd_buffer (i));
end loop;
Zip.Headers.Copy_and_check (dd_buffer, descriptor);
end Process;
tolerance_wrong_password : constant := 4; -- after that, error !
work_index : Ada.Streams.Stream_IO.Positive_Count;
use Zip, UnZ_Meth;
begin -- Decompress_Data
output_memory_access := null;
-- ^ this is an 'out' parameter, we have to set it anyway
case mode is
when write_to_binary_file =>
Ada.Streams.Stream_IO.Create (UnZ_IO.out_bin_file, Ada.Streams.Stream_IO.Out_File, output_file_name,
Form => To_String (Zip.Form_For_IO_Open_N_Create));
when write_to_text_file =>
Ada.Text_IO.Create (UnZ_IO.out_txt_file, Ada.Text_IO.Out_File, output_file_name,
Form => To_String (Zip.Form_For_IO_Open_N_Create));
when write_to_memory =>
output_memory_access := new
Ada.Streams.Stream_Element_Array (
1 .. Ada.Streams.Stream_Element_Offset (hint.uncompressed_size)
);
UnZ_Glob.uncompressed_index := output_memory_access'First;
when just_test =>
null;
end case;
UnZ_Glob.compsize := hint.compressed_size;
-- 2008 : from TT's version:
-- Avoid wraparound in read_buffer, when File_size_type'Last is given
-- as hint.compressed_size (unknown size)
if UnZ_Glob.compsize > File_size_type'Last - 2 then
UnZ_Glob.compsize := File_size_type'Last - 2;
end if;
UnZ_Glob.uncompsize := hint.uncompressed_size;
UnZ_IO.Init_Buffers;
UnZ_IO.Decryption.Set_mode (encrypted);
if encrypted then
work_index := Ada.Streams.Stream_IO.Positive_Count (Zip_Streams.Index (zip_file));
password_passes : for p in 1 .. tolerance_wrong_password loop
begin
UnZ_IO.Decryption.Init (To_String (password), hint.crc_32);
exit password_passes; -- the current password fits, then go on!
exception
when Wrong_password =>
if p = tolerance_wrong_password then
raise;
end if; -- alarm!
if get_new_password /= null then
get_new_password (password); -- ask for a new one
end if;
end;
-- Go back to data beginning:
begin
Zip_Streams.Set_Index (zip_file, Positive (work_index));
exception
when others =>
raise Read_Error;
end;
UnZ_IO.Init_Buffers;
end loop password_passes;
end if;
-- Unzip correct type
begin
case format is
when store => Copy_stored;
when shrink => Unshrink;
when reduce_1 => Unreduce (1);
when reduce_2 => Unreduce (2);
when reduce_3 => Unreduce (3);
when reduce_4 => Unreduce (4);
when implode =>
UnZ_Meth.Explode (explode_literal_tree, explode_slide_8KB);
when deflate | deflate_e =>
UnZ_Meth.deflate_e_mode := format = deflate_e;
UnZ_Meth.Inflate;
when Zip.bzip2 => UnZ_Meth.Bunzip2;
when others =>
raise Unsupported_method;
end case;
exception
when others =>
UnZ_IO.Delete_output;
raise;
end;
UnZ_Glob.crc32val := Zip.CRC.Final (UnZ_Glob.crc32val);
-- Decompression done !
if end_data_descriptor then -- Sizes and CRC at the end
declare
memo_uncomp_size : constant Unsigned_32 :=
hint.uncompressed_size;
begin
Process (hint); -- CRC for checking and sizes for informing user
if memo_uncomp_size < Unsigned_32'Last and then --
memo_uncomp_size /= hint.uncompressed_size
then
UnZ_IO.Delete_output;
raise Uncompressed_size_Error;
end if;
end;
end if;
if hint.crc_32 /= UnZ_Glob.crc32val then
UnZ_IO.Delete_output;
raise CRC_Error;
end if;
case mode is
when write_to_binary_file =>
Ada.Streams.Stream_IO.Close (UnZ_IO.out_bin_file);
when write_to_text_file =>
Ada.Text_IO.Close (UnZ_IO.out_txt_file);
when others =>
null;
end case;
exception
when others => -- close the file in case of an error, if not yet closed
case mode is -- or deleted
when write_to_binary_file =>
if Ada.Streams.Stream_IO.Is_Open (UnZ_IO.out_bin_file) then
Ada.Streams.Stream_IO.Close (UnZ_IO.out_bin_file);
end if;
when write_to_text_file =>
if Ada.Text_IO.Is_Open (UnZ_IO.out_txt_file) then
Ada.Text_IO.Close (UnZ_IO.out_txt_file);
end if;
when others =>
null;
end case;
raise;
end Decompress_data;
end UnZip.Decompress;
|
package body System.Interrupt_Numbers is
function Is_Reserved (Interrupt : C.signed_int) return Boolean is
begin
return Interrupt not in First_Interrupt_Id .. Last_Interrupt_Id
or else Interrupt = C.signal.SIGKILL
or else Interrupt = C.signal.SIGSTOP;
end Is_Reserved;
end System.Interrupt_Numbers;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- G N A T C M D --
-- --
-- B o d y --
-- --
-- Copyright (C) 1996-2016, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING3. If not, go to --
-- http://www.gnu.org/licenses for a complete copy of the license. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with Csets;
with Gnatvsn;
with Makeutl; use Makeutl;
with Namet; use Namet;
with Opt; use Opt;
with Osint; use Osint;
with Output; use Output;
with Prj; use Prj;
with Prj.Env;
with Prj.Ext; use Prj.Ext;
with Prj.Pars;
with Prj.Tree; use Prj.Tree;
with Prj.Util; use Prj.Util;
with Sdefault;
with Sinput.P;
with Snames; use Snames;
with Stringt;
with Switch; use Switch;
with Table;
with Tempdir;
with Types; use Types;
with Ada.Characters.Handling; use Ada.Characters.Handling;
with Ada.Command_Line; use Ada.Command_Line;
with Ada.Text_IO; use Ada.Text_IO;
with GNAT.Directory_Operations; use GNAT.Directory_Operations;
with GNAT.OS_Lib; use GNAT.OS_Lib;
procedure GNATCmd is
Gprbuild : constant String := "gprbuild";
Gprclean : constant String := "gprclean";
Gprname : constant String := "gprname";
Gprls : constant String := "gprls";
Error_Exit : exception;
-- Raise this exception if error detected
type Command_Type is
(Bind,
Chop,
Clean,
Compile,
Check,
Elim,
Find,
Krunch,
Link,
List,
Make,
Metric,
Name,
Preprocess,
Pretty,
Stack,
Stub,
Test,
Xref,
Undefined);
subtype Real_Command_Type is Command_Type range Bind .. Xref;
-- All real command types (excludes only Undefined).
type Alternate_Command is (Comp, Ls, Kr, Pp, Prep);
-- Alternate command label
Corresponding_To : constant array (Alternate_Command) of Command_Type :=
(Comp => Compile,
Ls => List,
Kr => Krunch,
Prep => Preprocess,
Pp => Pretty);
-- Mapping of alternate commands to commands
Call_GPR_Tool : Boolean := False;
-- True when a GPR tool should be called, if available
Project_Node_Tree : Project_Node_Tree_Ref;
Project_File : String_Access;
Project : Prj.Project_Id;
Current_Verbosity : Prj.Verbosity := Prj.Default;
Tool_Package_Name : Name_Id := No_Name;
Project_Tree : constant Project_Tree_Ref :=
new Project_Tree_Data (Is_Root_Tree => True);
-- The project tree
All_Projects : Boolean := False;
Temp_File_Name : Path_Name_Type := No_Path;
-- The name of the temporary text file to put a list of source/object
-- files to pass to a tool.
package First_Switches is new Table.Table
(Table_Component_Type => String_Access,
Table_Index_Type => Integer,
Table_Low_Bound => 1,
Table_Initial => 20,
Table_Increment => 100,
Table_Name => "Gnatcmd.First_Switches");
-- A table to keep the switches from the project file
package Last_Switches is new Table.Table
(Table_Component_Type => String_Access,
Table_Index_Type => Integer,
Table_Low_Bound => 1,
Table_Initial => 20,
Table_Increment => 100,
Table_Name => "Gnatcmd.Last_Switches");
----------------------------------
-- Declarations for GNATCMD use --
----------------------------------
The_Command : Command_Type;
-- The command specified in the invocation of the GNAT driver
Command_Arg : Positive := 1;
-- The index of the command in the arguments of the GNAT driver
My_Exit_Status : Exit_Status := Success;
-- The exit status of the spawned tool
type Command_Entry is record
Cname : String_Access;
-- Command name for GNAT xxx command
Unixcmd : String_Access;
-- Corresponding Unix command
Unixsws : Argument_List_Access;
-- List of switches to be used with the Unix command
end record;
Command_List : constant array (Real_Command_Type) of Command_Entry :=
(Bind =>
(Cname => new String'("BIND"),
Unixcmd => new String'("gnatbind"),
Unixsws => null),
Chop =>
(Cname => new String'("CHOP"),
Unixcmd => new String'("gnatchop"),
Unixsws => null),
Clean =>
(Cname => new String'("CLEAN"),
Unixcmd => new String'("gnatclean"),
Unixsws => null),
Compile =>
(Cname => new String'("COMPILE"),
Unixcmd => new String'("gnatmake"),
Unixsws => new Argument_List'(1 => new String'("-f"),
2 => new String'("-u"),
3 => new String'("-c"))),
Check =>
(Cname => new String'("CHECK"),
Unixcmd => new String'("gnatcheck"),
Unixsws => null),
Elim =>
(Cname => new String'("ELIM"),
Unixcmd => new String'("gnatelim"),
Unixsws => null),
Find =>
(Cname => new String'("FIND"),
Unixcmd => new String'("gnatfind"),
Unixsws => null),
Krunch =>
(Cname => new String'("KRUNCH"),
Unixcmd => new String'("gnatkr"),
Unixsws => null),
Link =>
(Cname => new String'("LINK"),
Unixcmd => new String'("gnatlink"),
Unixsws => null),
List =>
(Cname => new String'("LIST"),
Unixcmd => new String'("gnatls"),
Unixsws => null),
Make =>
(Cname => new String'("MAKE"),
Unixcmd => new String'("gnatmake"),
Unixsws => null),
Metric =>
(Cname => new String'("METRIC"),
Unixcmd => new String'("gnatmetric"),
Unixsws => null),
Name =>
(Cname => new String'("NAME"),
Unixcmd => new String'("gnatname"),
Unixsws => null),
Preprocess =>
(Cname => new String'("PREPROCESS"),
Unixcmd => new String'("gnatprep"),
Unixsws => null),
Pretty =>
(Cname => new String'("PRETTY"),
Unixcmd => new String'("gnatpp"),
Unixsws => null),
Stack =>
(Cname => new String'("STACK"),
Unixcmd => new String'("gnatstack"),
Unixsws => null),
Stub =>
(Cname => new String'("STUB"),
Unixcmd => new String'("gnatstub"),
Unixsws => null),
Test =>
(Cname => new String'("TEST"),
Unixcmd => new String'("gnattest"),
Unixsws => null),
Xref =>
(Cname => new String'("XREF"),
Unixcmd => new String'("gnatxref"),
Unixsws => null)
);
subtype SA is String_Access;
Naming_String : constant SA := new String'("naming");
Gnatls_String : constant SA := new String'("gnatls");
Packages_To_Check_By_Gnatls : constant String_List_Access :=
new String_List'((Naming_String, Gnatls_String));
Packages_To_Check : String_List_Access := Prj.All_Packages;
-----------------------
-- Local Subprograms --
-----------------------
procedure Check_Files;
-- For GNAT LIST -V, check if a project file is specified, without any file
-- arguments and without a switch -files=. If it is the case, invoke the
-- GNAT tool with the proper list of files, derived from the sources of
-- the project.
procedure Output_Version;
-- Output the version of this program
procedure Usage;
-- Display usage
-----------------
-- Check_Files --
-----------------
procedure Check_Files is
Add_Sources : Boolean := True;
Unit : Prj.Unit_Index;
Subunit : Boolean := False;
FD : File_Descriptor := Invalid_FD;
Status : Integer;
Success : Boolean;
procedure Add_To_Response_File
(File_Name : String;
Check_File : Boolean := True);
-- Include the file name passed as parameter in the response file for
-- the tool being called. If the response file can not be written then
-- the file name is passed in the parameter list of the tool. If the
-- Check_File parameter is True then the procedure verifies the
-- existence of the file before adding it to the response file.
--------------------------
-- Add_To_Response_File --
--------------------------
procedure Add_To_Response_File
(File_Name : String;
Check_File : Boolean := True)
is
begin
Name_Len := 0;
Add_Str_To_Name_Buffer (File_Name);
if not Check_File or else
Is_Regular_File (Name_Buffer (1 .. Name_Len))
then
if FD /= Invalid_FD then
Name_Len := Name_Len + 1;
Name_Buffer (Name_Len) := ASCII.LF;
Status := Write (FD, Name_Buffer (1)'Address, Name_Len);
if Status /= Name_Len then
Osint.Fail ("disk full");
end if;
else
Last_Switches.Increment_Last;
Last_Switches.Table (Last_Switches.Last) :=
new String'(File_Name);
end if;
end if;
end Add_To_Response_File;
-- Start of processing for Check_Files
begin
-- Check if there is at least one argument that is not a switch
for Index in 1 .. Last_Switches.Last loop
if Last_Switches.Table (Index) (1) /= '-'
or else (Last_Switches.Table (Index).all'Length > 7
and then Last_Switches.Table (Index) (1 .. 7) = "-files=")
then
Add_Sources := False;
exit;
end if;
end loop;
-- If all arguments are switches and there is no switch -files=, add the
-- path names of all the sources of the main project.
if Add_Sources then
Tempdir.Create_Temp_File (FD, Temp_File_Name);
Record_Temp_File (Project_Tree.Shared, Temp_File_Name);
Last_Switches.Increment_Last;
Last_Switches.Table (Last_Switches.Last) :=
new String'("-files=" & Get_Name_String (Temp_File_Name));
Unit := Units_Htable.Get_First (Project_Tree.Units_HT);
while Unit /= No_Unit_Index loop
-- We only need to put the library units, body or spec, but not
-- the subunits.
if Unit.File_Names (Impl) /= null
and then not Unit.File_Names (Impl).Locally_Removed
then
-- There is a body, check if it is for this project
if All_Projects
or else Unit.File_Names (Impl).Project = Project
then
Subunit := False;
if Unit.File_Names (Spec) = null
or else Unit.File_Names (Spec).Locally_Removed
then
-- We have a body with no spec: we need to check if
-- this is a subunit, because gnatls will complain
-- about subunits.
declare
Src_Ind : constant Source_File_Index :=
Sinput.P.Load_Project_File
(Get_Name_String
(Unit.File_Names (Impl).Path.Name));
begin
Subunit := Sinput.P.Source_File_Is_Subunit (Src_Ind);
end;
end if;
if not Subunit then
Add_To_Response_File
(Get_Name_String (Unit.File_Names (Impl).Display_File),
Check_File => False);
end if;
end if;
elsif Unit.File_Names (Spec) /= null
and then not Unit.File_Names (Spec).Locally_Removed
then
-- We have a spec with no body. Check if it is for this project
if All_Projects
or else Unit.File_Names (Spec).Project = Project
then
Add_To_Response_File
(Get_Name_String (Unit.File_Names (Spec).Display_File),
Check_File => False);
end if;
end if;
Unit := Units_Htable.Get_Next (Project_Tree.Units_HT);
end loop;
if FD /= Invalid_FD then
Close (FD, Success);
if not Success then
Osint.Fail ("disk full");
end if;
end if;
end if;
end Check_Files;
--------------------
-- Output_Version --
--------------------
procedure Output_Version is
begin
Put ("GNAT ");
Put_Line (Gnatvsn.Gnat_Version_String);
Put_Line ("Copyright 1996-" & Gnatvsn.Current_Year
& ", Free Software Foundation, Inc.");
end Output_Version;
-----------
-- Usage --
-----------
procedure Usage is
begin
Output_Version;
New_Line;
Put_Line ("List of available commands");
New_Line;
for C in Command_List'Range loop
Put ("gnat ");
Put (To_Lower (Command_List (C).Cname.all));
Set_Col (25);
Put (Program_Name (Command_List (C).Unixcmd.all, "gnat").all);
declare
Sws : Argument_List_Access renames Command_List (C).Unixsws;
begin
if Sws /= null then
for J in Sws'Range loop
Put (' ');
Put (Sws (J).all);
end loop;
end if;
end;
New_Line;
end loop;
New_Line;
end Usage;
procedure Check_Version_And_Help is new Check_Version_And_Help_G (Usage);
-- Start of processing for GNATCmd
begin
-- All output from GNATCmd is debugging or error output: send to stderr
Set_Standard_Error;
-- Initializations
Csets.Initialize;
Snames.Initialize;
Stringt.Initialize;
Prj.Tree.Initialize (Root_Environment, Gnatmake_Flags);
Project_Node_Tree := new Project_Node_Tree_Data;
Prj.Tree.Initialize (Project_Node_Tree);
Prj.Initialize (Project_Tree);
Last_Switches.Init;
Last_Switches.Set_Last (0);
First_Switches.Init;
First_Switches.Set_Last (0);
-- Put the command line in environment variable GNAT_DRIVER_COMMAND_LINE,
-- so that the spawned tool may know the way the GNAT driver was invoked.
Name_Len := 0;
Add_Str_To_Name_Buffer (Command_Name);
for J in 1 .. Argument_Count loop
Add_Char_To_Name_Buffer (' ');
Add_Str_To_Name_Buffer (Argument (J));
end loop;
Setenv ("GNAT_DRIVER_COMMAND_LINE", Name_Buffer (1 .. Name_Len));
-- Add the directory where the GNAT driver is invoked in front of the path,
-- if the GNAT driver is invoked with directory information.
declare
Command : constant String := Command_Name;
begin
for Index in reverse Command'Range loop
if Command (Index) = Directory_Separator then
declare
Absolute_Dir : constant String :=
Normalize_Pathname (Command (Command'First .. Index));
PATH : constant String :=
Absolute_Dir & Path_Separator & Getenv ("PATH").all;
begin
Setenv ("PATH", PATH);
end;
exit;
end if;
end loop;
end;
-- Scan the command line
-- First, scan to detect --version and/or --help
Check_Version_And_Help ("GNAT", "1996");
begin
loop
if Command_Arg <= Argument_Count
and then Argument (Command_Arg) = "-v"
then
Verbose_Mode := True;
Command_Arg := Command_Arg + 1;
elsif Command_Arg <= Argument_Count
and then Argument (Command_Arg) = "-dn"
then
Keep_Temporary_Files := True;
Command_Arg := Command_Arg + 1;
else
exit;
end if;
end loop;
-- If there is no command, just output the usage
if Command_Arg > Argument_Count then
Usage;
return;
end if;
The_Command := Real_Command_Type'Value (Argument (Command_Arg));
exception
when Constraint_Error =>
-- Check if it is an alternate command
declare
Alternate : Alternate_Command;
begin
Alternate := Alternate_Command'Value (Argument (Command_Arg));
The_Command := Corresponding_To (Alternate);
exception
when Constraint_Error =>
Usage;
Fail ("unknown command: " & Argument (Command_Arg));
end;
end;
-- Get the arguments from the command line and from the eventual
-- argument file(s) specified on the command line.
for Arg in Command_Arg + 1 .. Argument_Count loop
declare
The_Arg : constant String := Argument (Arg);
begin
-- Check if an argument file is specified
if The_Arg (The_Arg'First) = '@' then
declare
Arg_File : Ada.Text_IO.File_Type;
Line : String (1 .. 256);
Last : Natural;
begin
-- Open the file and fail if the file cannot be found
begin
Open (Arg_File, In_File,
The_Arg (The_Arg'First + 1 .. The_Arg'Last));
exception
when others =>
Put (Standard_Error, "Cannot open argument file """);
Put (Standard_Error,
The_Arg (The_Arg'First + 1 .. The_Arg'Last));
Put_Line (Standard_Error, """");
raise Error_Exit;
end;
-- Read line by line and put the content of each non-
-- empty line in the Last_Switches table.
while not End_Of_File (Arg_File) loop
Get_Line (Arg_File, Line, Last);
if Last /= 0 then
Last_Switches.Increment_Last;
Last_Switches.Table (Last_Switches.Last) :=
new String'(Line (1 .. Last));
end if;
end loop;
Close (Arg_File);
end;
else
-- It is not an argument file; just put the argument in
-- the Last_Switches table.
Last_Switches.Increment_Last;
Last_Switches.Table (Last_Switches.Last) := new String'(The_Arg);
end if;
end;
end loop;
declare
Program : String_Access;
Exec_Path : String_Access;
Get_Target : Boolean := False;
begin
if The_Command = Stack then
-- Never call gnatstack with a prefix
Program := new String'(Command_List (The_Command).Unixcmd.all);
else
Program :=
Program_Name (Command_List (The_Command).Unixcmd.all, "gnat");
-- If we want to invoke gnatmake/gnatclean with -P, then check if
-- gprbuild/gprclean is available; if it is, use gprbuild/gprclean
-- instead of gnatmake/gnatclean.
-- Ditto for gnatname -> gprname and gnatls -> gprls.
if The_Command = Make
or else The_Command = Compile
or else The_Command = Bind
or else The_Command = Link
or else The_Command = Clean
or else The_Command = Name
or else The_Command = List
then
declare
Switch : String_Access;
Dash_V_Switch : constant String := "-V";
begin
for J in 1 .. Last_Switches.Last loop
Switch := Last_Switches.Table (J);
if The_Command = List and then Switch.all = Dash_V_Switch
then
Call_GPR_Tool := False;
exit;
end if;
if Switch'Length >= 2
and then Switch (Switch'First .. Switch'First + 1) = "-P"
then
Call_GPR_Tool := True;
end if;
end loop;
if Call_GPR_Tool then
case The_Command is
when Bind
| Compile
| Link
| Make
=>
if Locate_Exec_On_Path (Gprbuild) /= null then
Program := new String'(Gprbuild);
Get_Target := True;
if The_Command = Bind then
First_Switches.Append (new String'("-b"));
elsif The_Command = Link then
First_Switches.Append (new String'("-l"));
end if;
elsif The_Command = Bind then
Fail
("'gnat bind -P' is no longer supported;" &
" use 'gprbuild -b' instead.");
elsif The_Command = Link then
Fail
("'gnat Link -P' is no longer supported;" &
" use 'gprbuild -l' instead.");
end if;
when Clean =>
if Locate_Exec_On_Path (Gprclean) /= null then
Program := new String'(Gprclean);
Get_Target := True;
end if;
when Name =>
if Locate_Exec_On_Path (Gprname) /= null then
Program := new String'(Gprname);
Get_Target := True;
end if;
when List =>
if Locate_Exec_On_Path (Gprls) /= null then
Program := new String'(Gprls);
Get_Target := True;
end if;
when others =>
null;
end case;
if Get_Target then
Find_Program_Name;
if Name_Len > 5 then
First_Switches.Append
(new String'
("--target=" & Name_Buffer (1 .. Name_Len - 5)));
end if;
end if;
end if;
end;
end if;
end if;
-- Locate the executable for the command
Exec_Path := Locate_Exec_On_Path (Program.all);
if Exec_Path = null then
Put_Line (Standard_Error, "could not locate " & Program.all);
raise Error_Exit;
end if;
-- If there are switches for the executable, put them as first switches
if Command_List (The_Command).Unixsws /= null then
for J in Command_List (The_Command).Unixsws'Range loop
First_Switches.Increment_Last;
First_Switches.Table (First_Switches.Last) :=
Command_List (The_Command).Unixsws (J);
end loop;
end if;
-- For FIND and XREF, look for switch -P. If it is specified, then
-- report an error indicating that the command is no longer supporting
-- project files.
if The_Command = Find or else The_Command = Xref then
declare
Argv : String_Access;
begin
for Arg_Num in 1 .. Last_Switches.Last loop
Argv := Last_Switches.Table (Arg_Num);
if Argv'Length >= 2 and then
Argv (Argv'First .. Argv'First + 1) = "-P"
then
if The_Command = Find then
Fail ("'gnat find -P' is no longer supported;");
else
Fail ("'gnat xref -P' is no longer supported;");
end if;
end if;
end loop;
end;
end if;
if The_Command = List and then not Call_GPR_Tool then
Tool_Package_Name := Name_Gnatls;
Packages_To_Check := Packages_To_Check_By_Gnatls;
-- Check that the switches are consistent. Detect project file
-- related switches.
Inspect_Switches : declare
Arg_Num : Positive := 1;
Argv : String_Access;
procedure Remove_Switch (Num : Positive);
-- Remove a project related switch from table Last_Switches
-------------------
-- Remove_Switch --
-------------------
procedure Remove_Switch (Num : Positive) is
begin
Last_Switches.Table (Num .. Last_Switches.Last - 1) :=
Last_Switches.Table (Num + 1 .. Last_Switches.Last);
Last_Switches.Decrement_Last;
end Remove_Switch;
-- Start of processing for Inspect_Switches
begin
while Arg_Num <= Last_Switches.Last loop
Argv := Last_Switches.Table (Arg_Num);
if Argv (Argv'First) = '-' then
if Argv'Length = 1 then
Fail ("switch character cannot be followed by a blank");
end if;
-- --subdirs=... Specify Subdirs
if Argv'Length > Makeutl.Subdirs_Option'Length
and then
Argv
(Argv'First ..
Argv'First + Makeutl.Subdirs_Option'Length - 1) =
Makeutl.Subdirs_Option
then
Subdirs :=
new String'
(Argv (Argv'First + Makeutl.Subdirs_Option'Length ..
Argv'Last));
Remove_Switch (Arg_Num);
-- -aPdir Add dir to the project search path
elsif Argv'Length > 3
and then Argv (Argv'First + 1 .. Argv'First + 2) = "aP"
then
Prj.Env.Add_Directories
(Root_Environment.Project_Path,
Argv (Argv'First + 3 .. Argv'Last));
-- Pass -aPdir to gnatls, but not to other tools
if The_Command = List then
Arg_Num := Arg_Num + 1;
else
Remove_Switch (Arg_Num);
end if;
-- -eL Follow links for files
elsif Argv.all = "-eL" then
Follow_Links_For_Files := True;
Follow_Links_For_Dirs := True;
Remove_Switch (Arg_Num);
-- -vPx Specify verbosity while parsing project files
elsif Argv'Length >= 3
and then Argv (Argv'First + 1 .. Argv'First + 2) = "vP"
then
if Argv'Length = 4
and then Argv (Argv'Last) in '0' .. '2'
then
case Argv (Argv'Last) is
when '0' =>
Current_Verbosity := Prj.Default;
when '1' =>
Current_Verbosity := Prj.Medium;
when '2' =>
Current_Verbosity := Prj.High;
when others =>
-- Cannot happen
raise Program_Error;
end case;
else
Fail ("invalid verbosity level: "
& Argv (Argv'First + 3 .. Argv'Last));
end if;
Remove_Switch (Arg_Num);
-- -Pproject_file Specify project file to be used
elsif Argv (Argv'First + 1) = 'P' then
-- Only one -P switch can be used
if Project_File /= null then
Fail
(Argv.all
& ": second project file forbidden (first is """
& Project_File.all & """)");
elsif Argv'Length = 2 then
-- There is space between -P and the project file
-- name. -P cannot be the last option.
if Arg_Num = Last_Switches.Last then
Fail ("project file name missing after -P");
else
Remove_Switch (Arg_Num);
Argv := Last_Switches.Table (Arg_Num);
-- After -P, there must be a project file name,
-- not another switch.
if Argv (Argv'First) = '-' then
Fail ("project file name missing after -P");
else
Project_File := new String'(Argv.all);
end if;
end if;
else
-- No space between -P and project file name
Project_File :=
new String'(Argv (Argv'First + 2 .. Argv'Last));
end if;
Remove_Switch (Arg_Num);
-- -Xexternal=value Specify an external reference to be
-- used in project files
elsif Argv'Length >= 5
and then Argv (Argv'First + 1) = 'X'
then
if not Check (Root_Environment.External,
Argv (Argv'First + 2 .. Argv'Last))
then
Fail
(Argv.all & " is not a valid external assignment.");
end if;
Remove_Switch (Arg_Num);
-- --unchecked-shared-lib-imports
elsif Argv.all = "--unchecked-shared-lib-imports" then
Opt.Unchecked_Shared_Lib_Imports := True;
Remove_Switch (Arg_Num);
-- gnat list -U
elsif
The_Command = List
and then Argv'Length = 2
and then Argv (2) = 'U'
then
All_Projects := True;
Remove_Switch (Arg_Num);
else
Arg_Num := Arg_Num + 1;
end if;
else
Arg_Num := Arg_Num + 1;
end if;
end loop;
end Inspect_Switches;
end if;
-- Add the default project search directories now, after the directories
-- that have been specified by switches -aP<dir>.
Prj.Env.Initialize_Default_Project_Path
(Root_Environment.Project_Path,
Target_Name => Sdefault.Target_Name.all);
-- If there is a project file specified, parse it, get the switches
-- for the tool and setup PATH environment variables.
if Project_File /= null then
Prj.Pars.Set_Verbosity (To => Current_Verbosity);
Prj.Pars.Parse
(Project => Project,
In_Tree => Project_Tree,
In_Node_Tree => Project_Node_Tree,
Project_File_Name => Project_File.all,
Env => Root_Environment,
Packages_To_Check => Packages_To_Check);
-- Prj.Pars.Parse calls Set_Standard_Output, reset to stderr
Set_Standard_Error;
if Project = Prj.No_Project then
Fail ("""" & Project_File.all & """ processing failed");
elsif Project.Qualifier = Aggregate then
Fail ("aggregate projects are not supported");
elsif Aggregate_Libraries_In (Project_Tree) then
Fail ("aggregate library projects are not supported");
end if;
-- Check if a package with the name of the tool is in the project
-- file and if there is one, get the switches, if any, and scan them.
declare
Pkg : constant Prj.Package_Id :=
Prj.Util.Value_Of
(Name => Tool_Package_Name,
In_Packages => Project.Decl.Packages,
Shared => Project_Tree.Shared);
Element : Package_Element;
Switches_Array : Array_Element_Id;
The_Switches : Prj.Variable_Value;
Current : Prj.String_List_Id;
The_String : String_Element;
Main : String_Access := null;
begin
if Pkg /= No_Package then
Element := Project_Tree.Shared.Packages.Table (Pkg);
-- Package Gnatls has a single attribute Switches, that is not
-- an associative array.
if The_Command = List then
The_Switches :=
Prj.Util.Value_Of
(Variable_Name => Snames.Name_Switches,
In_Variables => Element.Decl.Attributes,
Shared => Project_Tree.Shared);
-- Packages Binder (for gnatbind), Cross_Reference (for
-- gnatxref), Linker (for gnatlink), Finder (for gnatfind),
-- have an attributed Switches, an associative array, indexed
-- by the name of the file.
-- They also have an attribute Default_Switches, indexed by the
-- name of the programming language.
else
-- First check if there is a single main
for J in 1 .. Last_Switches.Last loop
if Last_Switches.Table (J) (1) /= '-' then
if Main = null then
Main := Last_Switches.Table (J);
else
Main := null;
exit;
end if;
end if;
end loop;
if Main /= null then
Switches_Array :=
Prj.Util.Value_Of
(Name => Name_Switches,
In_Arrays => Element.Decl.Arrays,
Shared => Project_Tree.Shared);
Name_Len := 0;
-- If the single main has been specified as an absolute
-- path, use only the simple file name. If the absolute
-- path is incorrect, an error will be reported by the
-- underlying tool and it does not make a difference
-- what switches are used.
if Is_Absolute_Path (Main.all) then
Add_Str_To_Name_Buffer (File_Name (Main.all));
else
Add_Str_To_Name_Buffer (Main.all);
end if;
The_Switches := Prj.Util.Value_Of
(Index => Name_Find,
Src_Index => 0,
In_Array => Switches_Array,
Shared => Project_Tree.Shared);
end if;
if The_Switches.Kind = Prj.Undefined then
Switches_Array :=
Prj.Util.Value_Of
(Name => Name_Default_Switches,
In_Arrays => Element.Decl.Arrays,
Shared => Project_Tree.Shared);
The_Switches := Prj.Util.Value_Of
(Index => Name_Ada,
Src_Index => 0,
In_Array => Switches_Array,
Shared => Project_Tree.Shared);
end if;
end if;
-- If there are switches specified in the package of the
-- project file corresponding to the tool, scan them.
case The_Switches.Kind is
when Prj.Undefined =>
null;
when Prj.Single =>
declare
Switch : constant String :=
Get_Name_String (The_Switches.Value);
begin
if Switch'Length > 0 then
First_Switches.Increment_Last;
First_Switches.Table (First_Switches.Last) :=
new String'(Switch);
end if;
end;
when Prj.List =>
Current := The_Switches.Values;
while Current /= Prj.Nil_String loop
The_String := Project_Tree.Shared.String_Elements.
Table (Current);
declare
Switch : constant String :=
Get_Name_String (The_String.Value);
begin
if Switch'Length > 0 then
First_Switches.Increment_Last;
First_Switches.Table (First_Switches.Last) :=
new String'(Switch);
end if;
end;
Current := The_String.Next;
end loop;
end case;
end if;
end;
if The_Command = Bind or else The_Command = Link then
if Project.Object_Directory.Name = No_Path then
Fail ("project " & Get_Name_String (Project.Display_Name)
& " has no object directory");
end if;
Change_Dir (Get_Name_String (Project.Object_Directory.Name));
end if;
-- Set up the env vars for project path files
Prj.Env.Set_Ada_Paths
(Project, Project_Tree, Including_Libraries => True);
if The_Command = List then
Check_Files;
end if;
end if;
-- Gather all the arguments and invoke the executable
declare
The_Args : Argument_List
(1 .. First_Switches.Last + Last_Switches.Last);
Arg_Num : Natural := 0;
begin
for J in 1 .. First_Switches.Last loop
Arg_Num := Arg_Num + 1;
The_Args (Arg_Num) := First_Switches.Table (J);
end loop;
for J in 1 .. Last_Switches.Last loop
Arg_Num := Arg_Num + 1;
The_Args (Arg_Num) := Last_Switches.Table (J);
end loop;
if Verbose_Mode then
Put (Exec_Path.all);
for Arg in The_Args'Range loop
Put (" " & The_Args (Arg).all);
end loop;
New_Line;
end if;
My_Exit_Status := Exit_Status (Spawn (Exec_Path.all, The_Args));
if not Keep_Temporary_Files then
Delete_All_Temp_Files (Project_Tree.Shared);
end if;
Set_Exit_Status (My_Exit_Status);
end;
end;
exception
when Error_Exit =>
Set_Exit_Status (Failure);
end GNATCmd;
|
-- Swagger Petstore
-- This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special_key` to test the authorization filters.
--
-- OpenAPI spec version: 1.0.0
-- Contact: apiteam@swagger.io
--
-- NOTE: This package is auto generated by the swagger code generator 2.4.0-SNAPSHOT.
-- https://github.com/swagger-api/swagger-codegen.git
-- Do not edit the class manually.
with Swagger.Streams;
with Ada.Containers.Vectors;
package Samples.Petstore.Models is
type Currency_Type is
record
end record;
package Currency_Type_Vectors is
new Ada.Containers.Vectors (Index_Type => Positive,
Element_Type => Currency_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in Currency_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in Currency_Type_Vectors.Vector);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out Currency_Type);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out Currency_Type_Vectors.Vector);
type Amount_Type is
record
Value : double;
Currency : Samples.Petstore.Models.Currency_Type;
end record;
package Amount_Type_Vectors is
new Ada.Containers.Vectors (Index_Type => Positive,
Element_Type => Amount_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in Amount_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in Amount_Type_Vectors.Vector);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out Amount_Type);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out Amount_Type_Vectors.Vector);
-- ------------------------------
-- An uploaded response
-- Describes the result of uploading an image resource
-- ------------------------------
type ApiResponse_Type is
record
Code : Swagger.Nullable_Integer;
P_Type : Swagger.Nullable_UString;
Message : Swagger.Nullable_UString;
end record;
package ApiResponse_Type_Vectors is
new Ada.Containers.Vectors (Index_Type => Positive,
Element_Type => ApiResponse_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in ApiResponse_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in ApiResponse_Type_Vectors.Vector);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out ApiResponse_Type);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out ApiResponse_Type_Vectors.Vector);
-- ------------------------------
-- Pet Tag
-- A tag for a pet
-- ------------------------------
type Tag_Type is
record
Id : Swagger.Nullable_Long;
Name : Swagger.Nullable_UString;
end record;
package Tag_Type_Vectors is
new Ada.Containers.Vectors (Index_Type => Positive,
Element_Type => Tag_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in Tag_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in Tag_Type_Vectors.Vector);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out Tag_Type);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out Tag_Type_Vectors.Vector);
-- ------------------------------
-- Pet category
-- A category for a pet
-- ------------------------------
type Category_Type is
record
Id : Swagger.Nullable_Long;
Name : Swagger.Nullable_UString;
end record;
package Category_Type_Vectors is
new Ada.Containers.Vectors (Index_Type => Positive,
Element_Type => Category_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in Category_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in Category_Type_Vectors.Vector);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out Category_Type);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out Category_Type_Vectors.Vector);
-- ------------------------------
-- a Pet
-- A pet for sale in the pet store
-- ------------------------------
type Pet_Type is
record
Id : Swagger.Nullable_Long;
Category : Samples.Petstore.Models.Category_Type;
Name : Swagger.UString;
Photo_Urls : Swagger.Nullable_UString_Vectors.Vector;
Tags : Samples.Petstore.Models.Tag_Type_Vectors.Vector;
Status : Swagger.Nullable_UString;
end record;
package Pet_Type_Vectors is
new Ada.Containers.Vectors (Index_Type => Positive,
Element_Type => Pet_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in Pet_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in Pet_Type_Vectors.Vector);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out Pet_Type);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out Pet_Type_Vectors.Vector);
-- ------------------------------
-- a User
-- A User who is purchasing from the pet store
-- ------------------------------
type User_Type is
record
Id : Swagger.Nullable_Long;
Username : Swagger.Nullable_UString;
First_Name : Swagger.Nullable_UString;
Last_Name : Swagger.Nullable_UString;
Email : Swagger.Nullable_UString;
Password : Swagger.Nullable_UString;
Phone : Swagger.Nullable_UString;
User_Status : Swagger.Nullable_Integer;
end record;
package User_Type_Vectors is
new Ada.Containers.Vectors (Index_Type => Positive,
Element_Type => User_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in User_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in User_Type_Vectors.Vector);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out User_Type);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out User_Type_Vectors.Vector);
-- ------------------------------
-- Pet Order
-- An order for a pets from the pet store
-- ------------------------------
type Order_Type is
record
Id : Swagger.Nullable_Long;
Pet_Id : Swagger.Nullable_Long;
Quantity : Swagger.Nullable_Integer;
Ship_Date : Swagger.Nullable_Date;
Status : Swagger.Nullable_UString;
Complete : Swagger.Nullable_Boolean;
end record;
package Order_Type_Vectors is
new Ada.Containers.Vectors (Index_Type => Positive,
Element_Type => Order_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in Order_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in Order_Type_Vectors.Vector);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out Order_Type);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out Order_Type_Vectors.Vector);
end Samples.Petstore.Models;
|
Pragma Ada_2012;
Pragma Wide_Character_Encoding( UTF8 );
With
System,
System.Address_Image,
Ada.Strings.Unbounded,
Ada.Strings.Less_Case_Insensitive,
Ada.Containers.Indefinite_Ordered_Maps,
Ada.Containers.Indefinite_Vectors,
Risi_Script.Types.Implementation;
Private Package Risi_Script.Types.Internals with Elaborate_Body is
------------------------
-- AUXILARY PACKAGES --
------------------------
Package Hash is new Ada.Containers.Indefinite_Ordered_Maps(
"=" => Risi_Script.Types.Implementation."=",
"<" => Ada.Strings.Less_Case_Insensitive,
Key_Type => String,
Element_Type => Risi_Script.Types.Implementation.Representation
);
Package List is new Ada.Containers.Indefinite_Vectors(
"=" => Risi_Script.Types.Implementation."=",
Index_Type => Positive,
Element_Type => Risi_Script.Types.Implementation.Representation
);
---------------------
-- AUXILARY TYPES --
---------------------
Type Integer_Type is new Long_Long_Integer;
SubType Array_Type is List.Vector;
SubType Hash_Type is Hash.Map;
SubType String_Type is Ada.Strings.Unbounded.Unbounded_String;
Type Real_Type is new Long_Long_Float;
Type Pointer_Type is new System.Address;
SubType Reference_Type is Risi_Script.Types.Implementation.Representation;
Type Fixed_Type is delta 10.0**(-4) digits 18 with Size => 64;
Type Boolean_Type is new Boolean;
Type Func_Type is not null access function(X, Y : Integer) return Integer;
------------------------
-- AUXILARY GENERICS --
------------------------
Generic
Type X;
with Function Create( Element : X ) return Risi_Script.Types.Implementation.Representation is <>;
Function To_Array(Value : X ) return Array_Type;
Generic
Type X;
with Function Create( Element : X ) return Risi_Script.Types.Implementation.Representation is <>;
Function To_Hash(Value : X ) return Hash_Type;
End Risi_Script.Types.Internals;
|
-----------------------------------------------------------------------
-- asf.beans -- Bean Registration and Factory
-- Copyright (C) 2009, 2010, 2011, 2015 Stephane Carrez
-- Written by Stephane Carrez (Stephane.Carrez@gmail.com)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Strings.Hash;
with Ada.Strings.Unbounded;
with Util.Beans.Basic;
with Util.Refs;
with EL.Beans;
with EL.Contexts;
with Ada.Containers.Hashed_Maps;
with Ada.Containers.Indefinite_Hashed_Maps;
private with Ada.Strings.Unbounded.Hash;
-- The <b>ASF.Beans</b> package is a registry for creating request, session
-- and application beans.
--
-- First, an application or a module registers in a class factory the class
-- of objects that can be created. Each class is represented by a <b>Class_Binding</b>
-- interface that allows to create instances of the given class. Each class
-- is associated with a unique name in the class factory (ie, the class name).
-- This step is done when the application or module is initialized.
--
-- Second, a set of application configuration files define the runtime bean objects
-- that can be created automatically when a request is processed. Each runtime bean
-- object is associated with a bean name, a bean type identifying the class of object,
-- and a scope that identifies the lifespan of the object.
--
-- When a request is processed and a bean must be created, the bean factory is
-- searched to find a the object class and object scope (a <b>Bean_Binding</b>).
-- The <b>Class_Binding</b> associated with the <b>Bean_Binding</b> is then used
-- to create the object.
package ASF.Beans is
-- Defines the scope of the bean instance.
type Scope_Type is
(
-- Application scope means the bean is shared by all sessions and requests
APPLICATION_SCOPE,
-- Session scope means the bean is created one for each session.
SESSION_SCOPE,
-- Request scope means the bean is created for each request
REQUEST_SCOPE,
ANY_SCOPE);
-- ------------------------------
-- Class Binding
-- ------------------------------
-- The <b>Class_Binding</b> provides an operation to create objects of a given class.
type Class_Binding is abstract new Util.Refs.Ref_Entity with null record;
type Class_Binding_Access is access all Class_Binding'Class;
procedure Create (Factory : in Class_Binding;
Name : in Ada.Strings.Unbounded.Unbounded_String;
Result : out Util.Beans.Basic.Readonly_Bean_Access) is abstract;
-- Simplified bean creation. A <b>Create_Bean_Access</b> function can be registered
-- as a simplified class binding to create bean instances.
type Create_Bean_Access is access function return Util.Beans.Basic.Readonly_Bean_Access;
-- ------------------------------
-- Bean initialization
-- ------------------------------
-- After a bean object is created, it can be initialized with a set of values defined
-- by the <b>EL.Beans.Param_Value</b> type which holds the bean property name as well
-- as an EL expression that will be evaluated to get the property value.
type Parameter_Bean is new Util.Refs.Ref_Entity with record
Params : EL.Beans.Param_Vectors.Vector;
end record;
type Parameter_Bean_Access is access all Parameter_Bean;
package Parameter_Bean_Ref is
new Util.Refs.Indefinite_References (Element_Type => Parameter_Bean,
Element_Access => Parameter_Bean_Access);
-- ------------------------------
-- Bean Factory
-- ------------------------------
-- The registry maintains a list of creation bindings which allow to create
-- a bean object of a particular type.
type Bean_Factory is limited private;
-- Register under the name identified by <b>Name</b> the class instance <b>Class</b>.
procedure Register_Class (Factory : in out Bean_Factory;
Name : in String;
Class : in Class_Binding_Access);
-- Register under the name identified by <b>Name</b> a function to create a bean.
-- This is a simplified class registration.
procedure Register_Class (Factory : in out Bean_Factory;
Name : in String;
Handler : in Create_Bean_Access);
-- Register all the definitions from a factory to a main factory.
procedure Register (Factory : in out Bean_Factory;
From : in Bean_Factory);
-- Register the bean identified by <b>Name</b> and associated with the class <b>Class</b>.
-- The class must have been registered by using the <b>Register</b> class operation.
-- The scope defines the scope of the bean.
procedure Register (Factory : in out Bean_Factory;
Name : in String;
Class : in String;
Params : in Parameter_Bean_Ref.Ref;
Scope : in Scope_Type := REQUEST_SCOPE);
-- Register the bean identified by <b>Name</b> and associated with the class <b>Class</b>.
-- The class must have been registered by using the <b>Register</b> class operation.
-- The scope defines the scope of the bean.
procedure Register (Factory : in out Bean_Factory;
Name : in String;
Class : in Class_Binding_Access;
Params : in Parameter_Bean_Ref.Ref;
Scope : in Scope_Type := REQUEST_SCOPE);
-- Create a bean by using the create operation registered for the name
procedure Create (Factory : in Bean_Factory;
Name : in Ada.Strings.Unbounded.Unbounded_String;
Context : in EL.Contexts.ELContext'Class;
Result : out Util.Beans.Basic.Readonly_Bean_Access;
Scope : out Scope_Type);
-- Create a map bean object that allows to associate name/value pairs in a bean.
function Create_Map_Bean return Util.Beans.Basic.Readonly_Bean_Access;
private
use Ada.Strings.Unbounded;
package Class_Binding_Ref is
new Util.Refs.Indefinite_References (Element_Type => Class_Binding'Class,
Element_Access => Class_Binding_Access);
package Registry_Maps is
new Ada.Containers.Indefinite_Hashed_Maps (Key_Type => String,
Element_Type => Class_Binding_Ref.Ref,
Hash => Ada.Strings.Hash,
Equivalent_Keys => "=",
"=" => Class_Binding_Ref."=");
-- ------------------------------
-- Default class binding record
-- ------------------------------
type Default_Class_Binding is new Class_Binding with record
Create : Create_Bean_Access;
end record;
type Default_Class_Binding_Access is access all Default_Class_Binding'Class;
-- Create a bean by using the registered create function.
procedure Create (Factory : in Default_Class_Binding;
Name : in Ada.Strings.Unbounded.Unbounded_String;
Result : out Util.Beans.Basic.Readonly_Bean_Access);
type Bean_Binding is record
Scope : Scope_Type;
Create : Class_Binding_Ref.Ref;
Params : Parameter_Bean_Ref.Ref;
end record;
package Bean_Maps is new
Ada.Containers.Hashed_Maps (Key_Type => Unbounded_String,
Element_Type => Bean_Binding,
Hash => Ada.Strings.Unbounded.Hash,
Equivalent_Keys => "=");
type Bean_Factory is limited record
Registry : Registry_Maps.Map;
Map : Bean_Maps.Map;
end record;
end ASF.Beans;
|
--
-- This file is part of the coreboot project.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 2 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
with HW.GFX.GMA;
with HW.GFX.GMA.Display_Probing;
use HW.GFX.GMA;
use HW.GFX.GMA.Display_Probing;
private package GMA.Mainboard is
-- For a three-pipe setup, bandwidth is shared between the 2nd and
-- the 3rd pipe. Thus, probe ports that likely have a high-resolution
-- display attached first.
-- FIXME: Only one of the digital ports is implemented as DP
-- but it's unknown which.
ports : constant Port_List :=
(DP1,
DP2,
DP3,
HDMI1,
HDMI2,
HDMI3,
Analog,
others => Disabled);
end GMA.Mainboard;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . P A C K _ 4 8 --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2005, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- Handling of packed arrays with Component_Size = 48
package System.Pack_48 is
pragma Preelaborate;
Bits : constant := 48;
type Bits_48 is mod 2 ** Bits;
for Bits_48'Size use Bits;
function Get_48 (Arr : System.Address; N : Natural) return Bits_48;
-- Arr is the address of the packed array, N is the zero-based
-- subscript. This element is extracted and returned.
procedure Set_48 (Arr : System.Address; N : Natural; E : Bits_48);
-- Arr is the address of the packed array, N is the zero-based
-- subscript. This element is set to the given value.
function GetU_48 (Arr : System.Address; N : Natural) return Bits_48;
-- Arr is the address of the packed array, N is the zero-based
-- subscript. This element is extracted and returned. This version
-- is used when Arr may represent an unaligned address.
procedure SetU_48 (Arr : System.Address; N : Natural; E : Bits_48);
-- Arr is the address of the packed array, N is the zero-based
-- subscript. This element is set to the given value. This version
-- is used when Arr may represent an unaligned address
end System.Pack_48;
|
package body Extools is
protected Resource is
entry Seize (Win : Window);
procedure Release ;
private
Busy : Boolean := False;
end Resource;
protected body Resource is
entry Seize (Win : Window) when not Busy is
begin
Busy := True;
Refresh(Win);
Busy := False;
end Seize;
procedure Release is
begin
Busy := False;
end Release;
end Resource;
procedure Refrosh (Win : Window := Standard_Window) is
begin
Resource.Seize(Win);
end Refrosh;
end Extools;
|
--------------------------------------------------------------------------------------------------------------------
-- Copyright (c) 2013-2020, Luke A. Guest
--
-- This software is provided 'as-is', without any express or implied
-- warranty. In no event will the authors be held liable for any damages
-- arising from the use of this software.
--
-- Permission is granted to anyone to use this software for any purpose,
-- including commercial applications, and to alter it and redistribute it
-- freely, subject to the following restrictions:
--
-- 1. The origin of this software must not be misrepresented; you must not
-- claim that you wrote the original software. If you use this software
-- in a product, an acknowledgment in the product documentation would be
-- appreciated but is not required.
--
-- 2. Altered source versions must be plainly marked as such, and must not be
-- misrepresented as being the original software.
--
-- 3. This notice may not be removed or altered from any source
-- distribution.
--------------------------------------------------------------------------------------------------------------------
-- SDL.Video.Rectangles
--
-- Rectangle bounding areas.
--------------------------------------------------------------------------------------------------------------------
with Interfaces.C;
package SDL.Video.Rectangles is
package C renames Interfaces.C;
Rectangle_Error : exception;
type Size_Arrays is array (C.size_t range <>) of aliased SDL.Sizes with
Convention => C;
subtype Point is SDL.Coordinates;
type Point_Arrays is array (C.size_t range <>) of aliased Point with
Convention => C;
type Line_Segment is
record
Start : SDL.Coordinates;
Finish : SDL.Coordinates;
end record with
Convention => C;
type Line_Arrays is array (C.size_t range <>) of aliased Line_Segment with
Convention => C;
-- TODO: Replace with Point and Sizes?
type Rectangle is
record
X : SDL.Coordinate;
Y : SDL.Coordinate;
Width : SDL.Natural_Dimension;
Height : SDL.Natural_Dimension;
end record with
Convention => C;
Null_Rectangle : constant Rectangle := (others => 0);
type Rectangle_Arrays is array (C.size_t range <>) of aliased Rectangle with
Convention => C;
type Rectangle_Access is access all Rectangle with
Convention => C;
function Enclose (Points : in Point_Arrays; Clip : in Rectangle; Enclosed : out Rectangle) return Boolean;
procedure Enclose (Points : in Point_Arrays; Enclosed : out Rectangle);
function Has_Intersected (A, B : in Rectangle) return Boolean;
function Intersects (A, B : in Rectangle; Intersection : out Rectangle) return Boolean;
function Clip_To (Clip_Area : in Rectangle; Line : in out Line_Segment) return Boolean;
function Union (A, B : in Rectangle) return Rectangle;
end SDL.Video.Rectangles;
|
-- openapi_ipify
-- OpenAPI client for ipify, a simple public IP address API
--
-- OpenAPI spec version: 0.9.0
-- Contact: blah@cliffano.com
--
-- NOTE: This package is auto generated by the swagger code generator 3.2.1-SNAPSHOT.
-- https://openapi-generator.tech
-- Do not edit the class manually.
with Swagger.Servers;
with .Models;
with Security.Permissions;
package .Skeletons is
use .Models;
type Server_Type is limited interface;
-- Get your public IP address
procedure Get_Ip
(Server : in out Server_Type;
Format : in Swagger.Nullable_UString;
Callback : in Swagger.Nullable_UString;
Result : out Swagger.Object;
Context : in out Swagger.Servers.Context_Type) is abstract;
generic
type Implementation_Type is limited new Server_Type with private;
package Skeleton is
procedure Register (Server : in out Swagger.Servers.Application_Type'Class);
-- Get your public IP address
procedure Get_Ip
(Req : in out Swagger.Servers.Request'Class;
Reply : in out Swagger.Servers.Response'Class;
Stream : in out Swagger.Servers.Output_Stream'Class;
Context : in out Swagger.Servers.Context_Type);
end Skeleton;
generic
type Implementation_Type is limited new Server_Type with private;
package Shared_Instance is
procedure Register (Server : in out Swagger.Servers.Application_Type'Class);
-- Get your public IP address
procedure Get_Ip
(Req : in out Swagger.Servers.Request'Class;
Reply : in out Swagger.Servers.Response'Class;
Stream : in out Swagger.Servers.Output_Stream'Class;
Context : in out Swagger.Servers.Context_Type);
private
protected Server is
-- Get your public IP address
procedure Get_Ip
(Format : in Swagger.Nullable_UString;
Callback : in Swagger.Nullable_UString;
Result : out Swagger.Object;
Context : in out Swagger.Servers.Context_Type);
private
Impl : Implementation_Type;
end Server;
end Shared_Instance;
end .Skeletons;
|
--
-- Copyright (C) 2015-2017 secunet Security Networks AG
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 2 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
with HW.GFX.GMA.Config;
with HW.GFX.GMA.Panel;
with HW.GFX.GMA.DP_Info;
with HW.Debug;
with GNAT.Source_Info;
package body HW.GFX.GMA.Connector_Info is
procedure Preferred_Link_Setting
(Port_Cfg : in out Port_Config;
Success : out Boolean)
is
DP_Port : constant GMA.DP_Port :=
(if Port_Cfg.Port = DIGI_A then
DP_A
else
(case Port_Cfg.PCH_Port is
when PCH_DP_B => DP_B,
when PCH_DP_C => DP_C,
when PCH_DP_D => DP_D,
when others => GMA.DP_Port'First));
begin
pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity));
if Port_Cfg.Display = DP then
if Port_Cfg.Port = DIGI_A then
if GMA.Config.Use_PP_VDD_Override then
Panel.VDD_Override;
else
Panel.On;
end if;
end if;
DP_Info.Read_Caps
(Link => Port_Cfg.DP,
Port => DP_Port,
Success => Success);
if Success then
DP_Info.Preferred_Link_Setting
(Link => Port_Cfg.DP,
Mode => Port_Cfg.Mode,
Success => Success);
pragma Debug (Success, DP_Info.Dump_Link_Setting (Port_Cfg.DP));
end if;
else
Success := True;
end if;
end Preferred_Link_Setting;
procedure Next_Link_Setting
(Port_Cfg : in out Port_Config;
Success : out Boolean)
is
begin
pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity));
if Port_Cfg.Display = DP then
DP_Info.Next_Link_Setting
(Link => Port_Cfg.DP,
Mode => Port_Cfg.Mode,
Success => Success);
pragma Debug (Success, DP_Info.Dump_Link_Setting (Port_Cfg.DP));
else
Success := False;
end if;
end Next_Link_Setting;
----------------------------------------------------------------------------
function Default_BPC (Port_Cfg : Port_Config) return HW.GFX.BPC_Type
is
begin
return
(if Port_Cfg.Port = DIGI_A or
(Port_Cfg.Is_FDI and Port_Cfg.PCH_Port = PCH_LVDS) or
Port_Cfg.Port = LVDS
then 6
else 8);
end Default_BPC;
end HW.GFX.GMA.Connector_Info;
|
-- This file is generated by SWIG. Please do not modify by hand.
--
with Interfaces;
with Interfaces.C;
with Interfaces.C.Pointers;
package xcb.xcb_mapping_notify_event_t is
-- Item
--
type Item is record
response_type : aliased Interfaces.Unsigned_8;
pad0 : aliased Interfaces.Unsigned_8;
sequence : aliased Interfaces.Unsigned_16;
request : aliased Interfaces.Unsigned_8;
first_keycode : aliased xcb.xcb_keycode_t;
count : aliased Interfaces.Unsigned_8;
pad1 : aliased Interfaces.Unsigned_8;
end record;
-- Item_Array
--
type Item_Array is
array
(Interfaces.C.size_t range <>) of aliased xcb.xcb_mapping_notify_event_t
.Item;
-- Pointer
--
package C_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t,
Element => xcb.xcb_mapping_notify_event_t.Item,
Element_Array => xcb.xcb_mapping_notify_event_t.Item_Array,
Default_Terminator => (others => <>));
subtype Pointer is C_Pointers.Pointer;
-- Pointer_Array
--
type Pointer_Array is
array
(Interfaces.C.size_t range <>) of aliased xcb.xcb_mapping_notify_event_t
.Pointer;
-- Pointer_Pointer
--
package C_Pointer_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t,
Element => xcb.xcb_mapping_notify_event_t.Pointer,
Element_Array => xcb.xcb_mapping_notify_event_t.Pointer_Array,
Default_Terminator => null);
subtype Pointer_Pointer is C_Pointer_Pointers.Pointer;
end xcb.xcb_mapping_notify_event_t;
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, Vadim Godunko <vgodunko@gmail.com> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
with AMF.Elements.Generic_Hash;
function AMF.CMOF.Packages.Hash is
new AMF.Elements.Generic_Hash (CMOF_Package, CMOF_Package_Access);
|
-----------------------------------------------------------------------
-- util-texts-builders -- Text builder
-- Copyright (C) 2013 Stephane Carrez
-- Written by Stephane Carrez (Stephane.Carrez@gmail.com)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Finalization;
-- == Description ==
-- The <tt>Util.Texts.Builders</tt> generic package was designed to provide string builders.
-- The interface was designed to reduce memory copies as much as possible.
--
-- * The <tt>Builder</tt> type holds a list of chunks into which texts are appended.
-- * The builder type holds an initial chunk whose capacity is defined when the builder
-- instance is declared.
-- * There is only an <tt>Append</tt> procedure which allows to append text to the builder.
-- This is the only time when a copy is made.
-- * The package defines the <tt>Iterate</tt> operation that allows to get the content
-- collected by the builder. When using the <tt>Iterate</tt> operation, no copy is
-- performed since chunks data are passed passed by reference.
-- * The type is limited to forbid copies of the builder instance.
--
-- == Example ==
-- First, instantiate the package for the element type (eg, String):
--
-- package String_Builder is new Util.Texts.Builders (Character, String);
--
-- Declare the string builder instance with its initial capacity:
--
-- Builder : String_Builder.Builder (256);
--
-- And append to it:
--
-- String_Builder.Append (Builder, "Hello");
--
-- To get the content collected in the builder instance, write a procedure that recieves
-- the chunk data as parameter:
--
-- procedure Collect (Item : in String) is ...
--
-- And use the <tt>Iterate</tt> operation:
--
-- String_Builder.Iterate (Builder, Collect'Access);
--
generic
type Element_Type is (<>);
type Input is array (Positive range <>) of Element_Type;
Chunk_Size : Positive := 80;
package Util.Texts.Builders is
pragma Preelaborate;
type Builder (Len : Positive) is limited private;
-- Get the length of the item builder.
function Length (Source : in Builder) return Natural;
-- Get the capacity of the builder.
function Capacity (Source : in Builder) return Natural;
-- Get the builder block size.
function Block_Size (Source : in Builder) return Positive;
-- Set the block size for the allocation of next chunks.
procedure Set_Block_Size (Source : in out Builder;
Size : in Positive);
-- Append the <tt>New_Item</tt> at the end of the source growing the buffer if necessary.
procedure Append (Source : in out Builder;
New_Item : in Input);
-- Append the <tt>New_Item</tt> at the end of the source growing the buffer if necessary.
procedure Append (Source : in out Builder;
New_Item : in Element_Type);
-- Clear the source freeing any storage allocated for the buffer.
procedure Clear (Source : in out Builder);
-- Iterate over the buffer content calling the <tt>Process</tt> procedure with each
-- chunk.
procedure Iterate (Source : in Builder;
Process : not null access procedure (Chunk : in Input));
-- Get the buffer content as an array.
function To_Array (Source : in Builder) return Input;
private
pragma Inline (Length);
pragma Inline (Iterate);
type Block;
type Block_Access is access all Block;
type Block (Len : Positive) is limited record
Next_Block : Block_Access;
Last : Natural := 0;
Content : Input (1 .. Len);
end record;
type Builder (Len : Positive) is new Ada.Finalization.Limited_Controlled with record
Current : Block_Access;
Block_Size : Positive := Chunk_Size;
Length : Natural := 0;
First : aliased Block (Len);
end record;
pragma Finalize_Storage_Only (Builder);
-- Setup the builder.
overriding
procedure Initialize (Source : in out Builder);
-- Finalize the builder releasing the storage.
overriding
procedure Finalize (Source : in out Builder);
end Util.Texts.Builders; |
-- From https://youtu.be/tj_sBZw9nS0
-- This took way too long to do, far too many different edge cases, also as it is
-- it doesn't handle the second to last example.
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Characters.Latin_1; use Ada.Characters.Latin_1;
-- p is a sequence of any of the following:
-- 1. a-z - stands for themselves.
-- 2. . - matches any character.
-- 3. * - matches zero of more of the preceding character.
--
-- s = "abc" p = "ab" => false
-- s = "aa" p = "a*" => true
-- s = "ab" p = ".*" => true
-- s = "ab" p = "." => false
-- s = "aab" p = "c*a*b*" => true
-- s = "aaa" p = "a*." => true
procedure Reg_Exp is
-- subtype Operations is Character with
-- Static_Predicate => Operations in 'a' .. 'z' | '.' | '*';
function Match (S, Pattern : in String) return Boolean is
function Look_Ahead (S : in String; Index : in Positive) return Character is
begin
-- Return NUL on end of string.
if Index + 1 > S'Last then
return NUL;
end if;
return S (Index + 1);
end Look_Ahead;
-- Read characters from the Pattern stack and match along the S stack as we go.
P_Index : Positive := Pattern'First;
S_Index : Positive := S'First;
Char : Character;
Op : Character;
Kleene : constant Character := '*';
Dot : constant Character := '.';
begin
-- Case for strings of length 1.
-- Pattern can only contain . or a-z.
if Pattern'Length = 1 then
if Pattern (Pattern'First) = Dot then
-- Make sure the string passed in is >=1.
if S'Length = 1 then
return True;
else
-- Cannot match substrings.
return False;
end if;
else
-- Case of matching a-z.
if S'Length = 1 and S (S'First) = Pattern (Pattern'First) then
return True;
else
return False;
end if;
end if;
end if;
-- Strings longer than 1.
while P_Index <= Pattern'Last loop
Char := Pattern (P_Index);
Op := Look_Ahead (Pattern, P_Index); -- Might be . or *
-- Op could be NUL, a-z, . or *
if Op /= NUL then
-- Op could be a-z, . or *
if Op = Kleene then
-- Skip to the Kleene closure.
P_Index := P_Index + 1;
-- Char may not exist in S!
-- Match against Char or Dot.
while S_Index <= S'Last and then
((Char = Dot and then S (S_Index) in 'a' .. 'z') or
S (S_Index) = Char)
loop
S_Index := S_Index + 1;
end loop;
else
-- At this point we need to match Char
if S_Index <= S'Last and then S (S_Index) = Char then
S_Index := S_Index + 1;
else
return False;
end if;
end if;
-- Skip past the character.
-- P_Index := P_Index + 1;
else
-- At this point we need to match Char
if S_Index <= S'Last and then S (S_Index) = Char then
S_Index := S_Index + 1;
else
return False;
end if;
end if;
-- Put_Line ("...");
P_Index := P_Index + 1;
end loop;
-- We haven't matched a full string's worth of data.
if S_Index <= S'Last then
return False;
end if;
return True;
end Match;
procedure Do_Match (S, Pattern : in String; Expect : in Boolean) is
begin
Put_Line ("S : " & S & " P : " & Pattern & " => " &
Boolean'Image (Match (S, Pattern)) &
" Expected : " & Boolean'Image (Expect));
end Do_Match;
begin
Do_Match (S => "abc", Pattern => "ab", Expect => False);
Do_Match (S => "aa", Pattern => "a*", Expect => True);
Do_Match (S => "ab", Pattern => ".*", Expect => True);
Do_Match (S => "ab", Pattern => ".", Expect => False);
Do_Match (S => "aab", Pattern => "c*a*b*", Expect => True);
Do_Match (S => "aaa", Pattern => "a*.", Expect => True);
Do_Match (S => "a", Pattern => "a", Expect => True);
end Reg_Exp; |
with Ada.Exceptions;
with Ada.Text_IO; use Ada.Text_IO;
with CORBA.Impl;
with CORBA.Object;
with CORBA.ORB;
with PortableServer.POA.Helper;
with PortableServer.POAManager;
with CorbaCBSG.CBSG.Impl;
with PolyORB.CORBA_P.CORBALOC;
-- Allow to specify how PolyORB should work
with PolyORB.Setup.No_Tasking_Server;
pragma Warnings (Off, PolyORB.Setup.No_Tasking_Server);
procedure Server is
begin
declare
-- Allow to get the parameters according to the CORBA Standard
-- For example, InitialRef
Argv : CORBA.ORB.Arg_List := CORBA.ORB.Command_Line_Arguments;
begin
-- Init of our bus named ORB
CORBA.ORB.Init (CORBA.ORB.To_CORBA_String ("ORB"), Argv);
declare
-- The PortableObjectAdapter is the place we "store" our objects
Root_POA : PortableServer.POA.Local_Ref;
-- We declare a reference to our distributed object
Ref : CORBA.Object.Ref;
-- And its implementation
Obj : constant CORBA.Impl.Object_Ptr := new CorbaCBSG.CBSG.Impl.Object;
begin
-- We get the root POA of our bus
-- It's a CORBA interface, so note the use of CORBA String instead of Ada ones
-- We then resolve it to an object reference
Root_POA := PortableServer.POA.Helper.To_Local_Ref
(CORBA.ORB.Resolve_Initial_References
(CORBA.ORB.To_CORBA_String ("RootPOA")));
-- We start our POA (in fact, the top-level one)
PortableServer.POAManager.Activate
(PortableServer.POA.Get_The_POAManager (Root_POA));
-- We create a reference on our object (the servant) to expose it to the outside world
Ref := PortableServer.POA.Servant_To_Reference
(Root_POA, PortableServer.Servant (Obj));
-- And we display its address, the IOR.
Put_Line
("'"
& CORBA.To_Standard_String (CORBA.Object.Object_To_String (Ref))
& "'");
New_Line;
-- And its shorter version, the corbaloc
-- unfortunately, corbaloc is not supported by every ORB implementation
Put_Line
("'"
& CORBA.To_Standard_String
(PolyORB.CORBA_P.CORBALOC.Object_To_Corbaloc (Ref))
& "'");
-- Launch the server. CORBA.ORB.Run is supposed to never return,
-- print a message if it does.
CORBA.ORB.Run;
Put_Line ("ORB main loop terminated!");
end;
end;
exception
-- Of course, we display a message in case of exception
when E : others =>
Put_Line
("CBSG server raised " & Ada.Exceptions.Exception_Information (E));
raise;
end Server;
|
-- C37213H.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, WHERE AN INDEX CONSTRAINT DEPENDS ON A RECORD
-- DISCRIMINANT WITH A DEFAULT VALUE AND THE RECORD TYPE IS NOT
-- EXPLICITLY CONSTRAINED, THAT THE NON-DISCRIMINANT EXPRESSIONS
-- IN THE INDEX CONSTRAINT ARE:
-- 1) EVALUATED WHEN THE RECORD COMPONENT SUBTYPE DEFINITION
-- IS ELABORATED,
-- 2) PROPERLY CHECKED FOR COMPATIBILITY ONLY IN AN ALLOCATION
-- OR OBJECT DECLARATION AND ONLY IF THE DISCRIMINANT-
-- DEPENDENT COMPONENT IS PRESENT IN THE SUBTYPE.
-- HISTORY:
-- JBG 10/17/86 CREATED ORIGINAL TEST.
-- VCL 10/23/87 MODIFIED THIS HEADER; MODIFIED THE CHECK OF
-- SUBTYPE 'SCONS', IN BOTH SUBPARTS OF THE TEST,
-- TO INDICATE FAILURE IF CONSTRAINT_ERROR IS RAISED
-- FOR THE SUBTYPE DECLARATION AND FAILURE IF
-- CONSTRAINT_ERROR IS NOT RAISED FOR AN OBJECT
-- DECLARATION OF THIS SUBTYPE; RELOCATED THE CALL TO
-- REPORT.TEST SO THAT IT COMES BEFORE ANY
-- DECLARATIONS; ADDED 'SEQUENCE_NUMBER' TO IDENTIFY
-- THE CURRENT SUBTEST (FOR EXCEPTIONS); CHANGE THE
-- TYPE OF THE DISCRIMINANT IN THE RECORD 'CONS'
-- TO AN INTEGER SUBTYPE.
-- VCL 03/30/88 MODIFIED HEADER AND MESSAGES OUTPUT BY REPORT
-- PACKAGE.
WITH REPORT; USE REPORT;
PROCEDURE C37213H IS
BEGIN
TEST ("C37213H", "THE NON-DISCRIMINANT EXPRESSIONS OF AN " &
"INDEX CONSTRAINT THAT DEPEND ON A " &
"DISCRIMINANT WITH A DEFAULT VALUE ARE " &
"PROPERLY EVALUATED AND CHECKED WHEN THE " &
"RECORD TYPE IS NOT EXPLICITLY CONSTRAINED AND " &
"THE COMPONENT IS AND IS NOT PRESENT IN THE " &
"SUBTYPE");
DECLARE
SEQUENCE_NUMBER : INTEGER;
SUBTYPE DISCR IS INTEGER RANGE -50..50;
SUBTYPE SM IS INTEGER RANGE 1..10;
TYPE MY_ARR IS ARRAY (SM RANGE <>) OF INTEGER;
F1_CONS : INTEGER := 2;
FUNCTION CHK (
CONS : INTEGER;
VALUE : INTEGER;
MESSAGE : STRING) RETURN BOOLEAN IS
BEGIN
IF CONS /= VALUE THEN
FAILED (MESSAGE & ": F1_CONS IS " &
INTEGER'IMAGE(F1_CONS));
END IF;
RETURN TRUE;
END CHK;
FUNCTION F1 RETURN INTEGER IS
BEGIN
F1_CONS := F1_CONS - IDENT_INT(1);
RETURN F1_CONS;
END F1;
BEGIN
-- CASE 1: DISCRIMINANT-DEPENDENT COMPONENT IS PRESENT.
SEQUENCE_NUMBER :=1;
DECLARE
TYPE CONS (D3 : DISCR := IDENT_INT(1)) IS
RECORD
CASE D3 IS
WHEN -5..10 =>
C1 : MY_ARR(F1..D3); -- F1 EVALUATED.
WHEN OTHERS =>
C2 : INTEGER := IDENT_INT(0);
END CASE;
END RECORD;
CHK1 : BOOLEAN := CHK (F1_CONS, 1, "F1 NOT EVALUATED");
X : CONS; -- F1 NOT EVALUATED AGAIN.
Y : CONS; -- F1 NOT EVALUATED AGAIN.
CHK2 : BOOLEAN := CHK (F1_CONS, 1, "F1 EVALUATED");
BEGIN
IF X.C1'FIRST /= 1 OR Y.C1'LAST /= 1 THEN
FAILED ("VALUES NOT CORRECT");
END IF;
END;
F1_CONS := 12;
SEQUENCE_NUMBER := 2;
DECLARE
TYPE CONS (D3 : DISCR := IDENT_INT(1)) IS
RECORD
CASE D3 IS
WHEN -5..10 =>
C1 : MY_ARR(D3..F1);
WHEN OTHERS =>
C2 : INTEGER := IDENT_INT(0);
END CASE;
END RECORD;
BEGIN
BEGIN
DECLARE
X : CONS;
BEGIN
FAILED ("INDEX CHECK NOT PERFORMED - 1");
IF X /= (1, (1, 1)) THEN
COMMENT ("INCORRECT VALUES FOR X - 1");
END IF;
END;
EXCEPTION
WHEN CONSTRAINT_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ("UNEXPECTED EXCEPTION RAISED - 1");
END;
BEGIN
DECLARE
SUBTYPE SCONS IS CONS;
BEGIN
DECLARE
X : SCONS;
BEGIN
FAILED ("INDEX CHECK NOT PERFORMED - 2");
IF X /= (1, (1, 1)) THEN
COMMENT ("INCORRECT VALUES FOR X " &
"- 2");
END IF;
END;
EXCEPTION
WHEN CONSTRAINT_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ("UNEXPECTED EXCEPTION RAISED " &
"- 2A");
END;
EXCEPTION
WHEN OTHERS =>
FAILED ("UNEXPECTED EXCEPTION RAISED - 2B");
END;
BEGIN
DECLARE
TYPE ARR IS ARRAY (1..5) OF CONS;
BEGIN
DECLARE
X : ARR;
BEGIN
FAILED ("INDEX CHECK NOT PERFORMED - 3");
IF X /= (1..5 => (1, (1, 1))) THEN
COMMENT ("INCORRECT VALUES FOR X " &
"- 3");
END IF;
END;
EXCEPTION
WHEN CONSTRAINT_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ("UNEXPECTED EXCEPTION RAISED " &
"- 3A");
END;
EXCEPTION
WHEN OTHERS =>
FAILED ("UNEXPECTED EXCEPTION RAISED - 3B");
END;
BEGIN
DECLARE
TYPE NREC IS
RECORD
C1 : CONS;
END RECORD;
BEGIN
DECLARE
X : NREC;
BEGIN
FAILED ("INDEX CHECK NOT PERFORMED - 4");
IF X /= (C1 => (1, (1, 1))) THEN
COMMENT ("INCORRECT VALUES FOR X " &
"- 4");
END IF;
END;
EXCEPTION
WHEN CONSTRAINT_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ("UNEXPECTED EXCEPTION RAISED " &
"- 4A");
END;
EXCEPTION
WHEN OTHERS =>
FAILED ("UNEXPECTED EXCEPTION RAISED - 4B");
END;
BEGIN
DECLARE
TYPE NREC IS NEW CONS;
BEGIN
DECLARE
X : NREC;
BEGIN
FAILED ("INDEX CHECK NOT PERFORMED - 5");
IF X /= (1, (1, 1)) THEN
COMMENT ("INCORRECT VALUES FOR X " &
"- 5");
END IF;
END;
EXCEPTION
WHEN CONSTRAINT_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ("UNEXPECTED EXCEPTION RAISED " &
"- 5A");
END;
EXCEPTION
WHEN OTHERS =>
FAILED ("UNEXPECTED EXCEPTION RAISED - 5B");
END;
BEGIN
DECLARE
TYPE ACC_CONS IS ACCESS CONS;
BEGIN
DECLARE
X : ACC_CONS;
BEGIN
X := NEW CONS;
FAILED ("INDEX CHECK NOT PERFORMED - 6");
IF X.ALL /= (1, (1, 1)) THEN
COMMENT ("INCORRECT VALUES FOR X " &
"- 6");
END IF;
EXCEPTION
WHEN CONSTRAINT_ERROR =>
NULL;
WHEN OTHERS =>
COMMENT ("UNEXPECTED EXCEPTION " &
"RAISED - 6A");
END;
EXCEPTION
WHEN OTHERS =>
COMMENT ("UNEXPECTED EXCEPTION RAISED " &
"- 6B");
END;
EXCEPTION
WHEN OTHERS =>
FAILED ("UNEXPECTED EXCEPTION RAISED - 6C");
END;
END;
-- CASE D2: DISCRIMINANT-DEPENDENT COMPONENT IS ABSENT.
F1_CONS := 2;
SEQUENCE_NUMBER := 3;
DECLARE
TYPE CONS (D3 : DISCR := IDENT_INT(-6)) IS
RECORD
CASE D3 IS
WHEN -5..10 =>
C1 : MY_ARR(D3..F1); -- F1 EVALUATED.
WHEN OTHERS =>
C2 : INTEGER := IDENT_INT(0);
END CASE;
END RECORD;
CHK1 : BOOLEAN := CHK (F1_CONS, 1, "F1 NOT EVALUATED");
X : CONS; -- F1 NOT EVALUATED AGAIN.
Y : CONS; -- F1 NOT EVALUATED AGAIN.
CHK2 : BOOLEAN := CHK (F1_CONS, 1, "F1 EVALUATED");
BEGIN
IF X /= (-6, 0) OR Y /= (-6, 0) THEN
FAILED ("VALUES NOT CORRECT");
END IF;
END;
F1_CONS := 12;
SEQUENCE_NUMBER := 4;
DECLARE
TYPE CONS (D3 : DISCR := IDENT_INT(11)) IS
RECORD
CASE D3 IS
WHEN -5..10 =>
C1 : MY_ARR(D3..F1);
WHEN OTHERS =>
C2 : INTEGER := IDENT_INT(0);
END CASE;
END RECORD;
BEGIN
BEGIN
DECLARE
X : CONS;
BEGIN
IF X /= (11, 0) THEN
FAILED ("X VALUE IS INCORRECT - 11");
END IF;
END;
EXCEPTION
WHEN OTHERS =>
FAILED ("UNEXPECTED EXCEPTION RAISED - 11");
END;
BEGIN
DECLARE
SUBTYPE SCONS IS CONS;
BEGIN
DECLARE
X : SCONS;
BEGIN
IF X /= (11, 0) THEN
FAILED ("X VALUE INCORRECT - 12");
END IF;
END;
EXCEPTION
WHEN OTHERS =>
FAILED ("UNEXPECTED EXCEPTION RAISED - " &
"12A");
END;
EXCEPTION
WHEN OTHERS =>
FAILED ("UNEXPECTED EXCEPTION RAISED - 12B");
END;
BEGIN
DECLARE
TYPE ARR IS ARRAY (1..5) OF CONS;
BEGIN
DECLARE
X : ARR;
BEGIN
IF X /= (1..5 => (11, 0)) THEN
FAILED ("X VALUE INCORRECT - 13");
END IF;
END;
EXCEPTION
WHEN OTHERS =>
FAILED ("UNEXPECTED EXCEPTION RAISED - " &
"13A");
END;
EXCEPTION
WHEN OTHERS =>
FAILED ("UNEXPECTED EXCEPTION RAISED - 13B");
END;
BEGIN
DECLARE
TYPE NREC IS
RECORD
C1 : CONS;
END RECORD;
BEGIN
DECLARE
X : NREC;
BEGIN
IF X /= (C1 => (11, 0)) THEN
FAILED ("X VALUE INCORRECT - 14");
END IF;
END;
EXCEPTION
WHEN OTHERS =>
FAILED ("UNEXPECTED EXCEPTION RAISED - " &
"14A");
END;
EXCEPTION
WHEN OTHERS =>
FAILED ("UNEXPECTED EXCEPTION RAISED - 14B");
END;
BEGIN
DECLARE
TYPE NREC IS NEW CONS;
BEGIN
DECLARE
X : NREC;
BEGIN
IF X /= (11, 0) THEN
FAILED ("X VALUE INCORRECT - 15");
END IF;
END;
EXCEPTION
WHEN CONSTRAINT_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ("UNEXPECTED EXCEPTION RAISED - " &
"15A");
END;
EXCEPTION
WHEN OTHERS =>
FAILED ("UNEXPECTED EXCEPTION RAISED - 15B");
END;
BEGIN
DECLARE
TYPE ACC_CONS IS ACCESS CONS;
X : ACC_CONS;
BEGIN
X := NEW CONS;
IF X.ALL /= (11, 0) THEN
FAILED ("X VALUE INCORRECT - 17");
END IF;
EXCEPTION
WHEN OTHERS =>
FAILED ("UNEXPECTED EXCEPTION RAISED - " &
"17A");
END;
EXCEPTION
WHEN OTHERS =>
FAILED ("UNEXPECTED EXCEPTION RAISED - 17B");
END;
END;
EXCEPTION
WHEN CONSTRAINT_ERROR =>
FAILED ("INDEX VALUES IMPROPERLY CHECKED - " &
INTEGER'IMAGE (SEQUENCE_NUMBER));
WHEN OTHERS =>
FAILED ("UNEXPECTED EXCEPTION RAISED " &
INTEGER'IMAGE (SEQUENCE_NUMBER));
END;
RESULT;
END C37213H;
|
-- C67005A.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 IF A RENAMING DECLARATION DECLARES AN EQUALITY OPERATOR, THE
-- TYPES OF THE PARAMETERS NEED NOT BE LIMITED TYPES.
-- JBG 9/28/83
WITH REPORT; USE REPORT;
PROCEDURE C67005A IS
BEGIN
TEST ("C67005A", "CHECK THAT AN EQUALITY OPERATOR DECLARED BY " &
"A RENAMING DECLARATION NEED NOT HAVE " &
"PARAMETERS OF A LIMITED TYPE");
DECLARE
GENERIC
TYPE LP IS LIMITED PRIVATE;
WITH FUNCTION EQUAL (L, R : LP) RETURN BOOLEAN;
PACKAGE EQUALITY_OPERATOR IS
FUNCTION "=" (L, R : LP) RETURN BOOLEAN;
END EQUALITY_OPERATOR;
PACKAGE BODY EQUALITY_OPERATOR IS
FUNCTION "=" (L, R : LP) RETURN BOOLEAN IS
BEGIN
RETURN EQUAL(L, R);
END "=";
END EQUALITY_OPERATOR;
PACKAGE POLAR_COORDINATES IS
TYPE POLAR_COORD IS
RECORD
R : INTEGER;
THETA : INTEGER;
END RECORD;
FUNCTION EQUAL (L, R : POLAR_COORD) RETURN BOOLEAN;
PACKAGE POLAR_EQUAL IS NEW EQUALITY_OPERATOR
(POLAR_COORD, EQUAL);
FUNCTION "=" (L, R : POLAR_COORD) RETURN BOOLEAN
RENAMES POLAR_EQUAL."=";
END POLAR_COORDINATES;
PACKAGE BODY POLAR_COORDINATES IS
FUNCTION EQUAL (L, R : POLAR_COORD) RETURN BOOLEAN IS
BEGIN
RETURN (L.THETA MOD 360) = (R.THETA MOD 360) AND
L.R = R.R;
END EQUAL;
END POLAR_COORDINATES;
USE POLAR_COORDINATES;
PACKAGE VARIABLES IS
P270 : POLAR_COORD := (R => 3, THETA => 270);
P360 : POLAR_COORD := (R => 3, THETA => IDENT_INT(360));
END VARIABLES;
USE VARIABLES;
BEGIN
IF P270 /= (3, -90) THEN
FAILED ("INCORRECT INEQUALITY OPERATOR");
END IF;
IF P360 = (3, 0) THEN
NULL;
ELSE
FAILED ("INCORRECT EQUALITY OPERATOR");
END IF;
RESULT;
END;
END C67005A;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S Y S T E M . V A L _ L L I --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2005, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package contains routines for scanning signed Long_Long_Integer
-- values for use in Text_IO.Integer_IO, and the Value attribute.
package System.Val_LLI is
pragma Pure;
function Scan_Long_Long_Integer
(Str : String;
Ptr : access Integer;
Max : Integer) return Long_Long_Integer;
-- This function scans the string starting at Str (Ptr.all) for a valid
-- integer according to the syntax described in (RM 3.5(43)). The substring
-- scanned extends no further than Str (Max). There are three cases for the
-- return:
--
-- If a valid integer is found after scanning past any initial spaces, then
-- Ptr.all is updated past the last character of the integer (but trailing
-- spaces are not scanned out).
--
-- If no valid integer is found, then Ptr.all points either to an initial
-- non-digit character, or to Max + 1 if the field is all spaces and the
-- exception Constraint_Error is raised.
--
-- If a syntactically valid integer is scanned, but the value is out of
-- range, or, in the based case, the base value is out of range or there
-- is an out of range digit, then Ptr.all points past the integer, and
-- Constraint_Error is raised.
--
-- Note: these rules correspond to the requirements for leaving the pointer
-- positioned in Text_Io.Get
--
-- Note: if Str is null, i.e. if Max is less than Ptr, then this is a
-- special case of an all-blank string, and Ptr is unchanged, and hence
-- is greater than Max as required in this case.
function Value_Long_Long_Integer (Str : String) return Long_Long_Integer;
-- Used in computing X'Value (Str) where X is a signed integer type whose
-- base range exceeds the base range of Integer. Str is the string argument
-- of the attribute. Constraint_Error is raised if the string is malformed,
-- or if the value is out of range.
end System.Val_LLI;
|
with Ada.Text_Io, Datos;
with Crear_Lista_Vacia, Esc, Ins, actualizar;
use Datos;
use Ada.Text_Io;
procedure Prueba_actualizar is
Lis: Lista; -- variables del programa principal
procedure Pedir_Return is
begin
Put_Line("pulsa return para continuar ");
Skip_Line;
end Pedir_Return;
begin
Put_Line("Programa de prueba: ");
Put_Line("*********");
Crear_Lista_Vacia(Lis);
Ins(Lis1, 0);
Ins(Lis1, 3);
Ins(Lis1, 5);
Put_Line("Caso de prueba 1: lista de dos elementos. Se quiere sumar la cantidad 5 al valor de la posicion 2 ");
Put_Line("Las listas iniciales contienen ");
Esc(Lis);
Put_Line("Ahora deberia escribir la siguiente lista ordenada: ");
Put_Line("<8, 5, 0>");
Esc(actualizar(Lis, 2,5));
New_Line;
New_Line;
Pedir_Return;
Put_Line("Se acabo la prueba. Agur ");
end Prueba_actualizar;
|
package body Multidimensional_Array is
procedure test(f: FullTime; p : PartTime; a : Afternoons) is
x : Fulltime := (others => (others => false));
y : Afternoons := ((false, false, false, false), (false, false, false, true), (false, false, true, false), (false, true, false, false));
z : Integer := Afternoons'Last(2);
begin
x(1,1) := f(2,2);
end test;
end Multidimensional_Array;
|
-- Copyright 2013-2021 Free Software Foundation, Inc.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
package body Pck is
procedure Do_Nothing (A : System.Address) is
begin
null;
end Do_Nothing;
end Pck;
|
-- Copyright (c) 2021 Bartek thindil Jasicki <thindil@laeran.pl>
--
-- 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 Tk.Widget; use Tk.Widget;
with Tcl.Strings; use Tcl.Strings;
-- ****h* Tk/Frame
-- FUNCTION
-- Provides code for manipulate Tk widget frame
-- SOURCE
package Tk.Frame is
-- ****
--## rule off REDUCEABLE_SCOPE
-- ****t* Frame/Frame.Tk_Frame
-- FUNCTION
-- The Tk identifier of the frame
-- HISTORY
-- 8.6.0 - Added
-- SOURCE
subtype Tk_Frame is Tk_Widget;
-- ****
-- ****s* Frame/Frame.Frame_Options
-- FUNCTION
-- Data structure for all available options for the Tk frame which can
-- be changed after creation of a widget
-- OPTIONS
-- Background - Normal Background color of the frame
-- Border_Width - The width of the frame's border
-- Height - Height of the frame.
-- Highlight_Background - Highlight traversal region background color for
-- the frame
-- Highlight_Color - Highlight traversal rectangle color for the
-- frame
-- Highlight_Thickness - The width of highlight traversal rectangle for the
-- frame
-- Menu - Menu widget which will be used as menubar in the
-- frame
-- Pad_X - Extra space requested for the frame in X-direction
-- Pad_Y - Extra space requested for the frame in Y-direction
-- Relief - 3-D effect desired for the frame
-- Width - Width of the frame
-- HISTORY
-- 8.6.0 - Added
-- SOURCE
type Frame_Options is new Widget_Options with record
Background: Tcl_String := Null_Tcl_String;
Border_Width: Pixel_Data := Empty_Pixel_Data;
Height: Pixel_Data := Empty_Pixel_Data;
Highlight_Background: Tcl_String := Null_Tcl_String;
Highlight_Color: Tcl_String := Null_Tcl_String;
Highlight_Thickness: Pixel_Data := Empty_Pixel_Data;
Pad_X: Pixel_Data := Empty_Pixel_Data;
Pad_Y: Pixel_Data := Empty_Pixel_Data;
Relief: Relief_Type := NONE;
Width: Pixel_Data := Empty_Pixel_Data;
end record;
-- ****
-- ****f* Frame/Frame.Configure
-- FUNCTION
-- Set the selected options for the selected frame
-- PARAMETERS
-- Frame_Widget - Tk_Frame which options will be set
-- Options - The record with new values for the frame options
-- HISTORY
-- 8.6.0 - Added
-- EXAMPLE
-- -- Set background to black for frame My_Frame
-- Configure(My_Frame, (Background => To_Tcl_String("black"), others => <>));
-- SEE ALSO
-- Frame.Get_Options
-- COMMANDS
-- Widget configure Options
-- SOURCE
procedure Configure(Frame_Widget: Tk_Frame; Options: Frame_Options) with
Pre'Class => Frame_Widget /= Null_Widget,
Test_Case => (Name => "Test_Configure_Frame", Mode => Nominal);
-- ****
-- ****d* Frame/Frame.Default_Frame_Options
-- FUNCTION
-- Default options for frame widget
-- HISTORY
-- 8.6.0 - Added
-- SOURCE
Default_Frame_Options: constant Frame_Options :=
Frame_Options'(others => <>);
-- ****
-- ****s* Frame/Frame.Frame_Create_Options
-- FUNCTION
-- Data structure for additional frame widget options which can be set
-- only during creating a widget
-- OPTIONS
-- Class - The name of the class for the widget
-- Color_Map - The name of the color map used by the widget. Can be
-- `new` or name of the color map from another widget
-- Container - If true, the widget will be used as container for another
-- embedded application
-- Visual - Type of visual information for the widget
-- HISTORY
-- 8.6.0 - Added
-- SOURCE
type Frame_Create_Options is new Frame_Options with record
Class: Tcl_String := Null_Tcl_String;
Color_Map: Tcl_String := Null_Tcl_String;
Container: Extended_Boolean := NONE;
Visual: Tcl_String := Null_Tcl_String;
end record;
-- ****
-- ****f* Frame/Frame.Options_To_String
-- FUNCTION
-- Convert Ada structure to Tcl command
-- PARAMETERS
-- Options - Ada Frame_Create_Options to convert
-- RESULT
-- String with Tcl command options
-- HISTORY
-- 8.6.0 - Added
-- SOURCE
function Options_To_String(Options: Frame_Create_Options) return String;
-- ****
-- ****f* Frame/Frame.Create_(function)
-- FUNCTION
-- Create a new Tk frame widget with the selected pathname and options
-- PARAMETERS
-- Path_Name - Tk pathname for the newly created frame
-- Options - Options for the newly created frame
-- Interpreter - Tcl interpreter on which the frame will be created. Can
-- be empty. Default value is the default Tcl interpreter
-- RESULT
-- The Tk identifier of the newly created frame widget or Null_Widget if
-- the frame cannot be created
-- HISTORY
-- 8.6.0 - Added
-- EXAMPLE
-- -- Create the frame with pathname .myframe and black background
-- My_Frame: constant Tk_Frame := Create(".myframe", (Background => To_Tcl_String("black"),
-- others => <>));
-- SEE ALSO
-- Frame.Create_(procedure)
-- COMMANDS
-- frame Path_Name Options
-- SOURCE
function Create
(Path_Name: Tk_Path_String; Options: Frame_Create_Options;
Interpreter: Tcl_Interpreter := Get_Interpreter) return Tk_Frame with
Pre'Class =>
(Path_Name'Length > 0
and then
Path_Name'Length + Options_To_String(Options => Options)'Length <=
Long_Long_Integer(Natural'Last) - 7) and
Interpreter /= Null_Interpreter,
Test_Case => (Name => "Test_Create_Frame1", Mode => Nominal);
-- ****
-- ****f* Frame/Frame.Create_(procedure)
-- FUNCTION
-- Create a new Tk frame widget with the selected pathname and options
-- PARAMETERS
-- Frame_Widget - Tk_Frame identifier which will be returned
-- Path_Name - Tk pathname for the newly created frame
-- Options - Options for the newly created frame
-- Interpreter - Tcl interpreter on which the toplelve will be created. Can
-- be empty. Default value is the default Tcl interpreter
-- OUTPUT
-- The Widget parameter as Tk identifier of the newly created frame widget or
-- Null_Widget if the frame cannot be created
-- HISTORY
-- 8.6.0 - Added
-- EXAMPLE
-- -- Create the frame with pathname .myframe
-- declare
-- My_Frame: Tk_Frame;
-- begin
-- Create(My_Frame, ".myframe", Default_Frame_Create_Options);
-- end;
-- SEE ALSO
-- Frame.Create_(function)
-- COMMANDS
-- frame Path_Name Options
-- SOURCE
procedure Create
(Frame_Widget: out Tk_Frame; Path_Name: Tk_Path_String;
Options: Frame_Create_Options;
Interpreter: Tcl_Interpreter := Get_Interpreter) with
Pre'Class => Path_Name'Length > 0 and Interpreter /= Null_Interpreter,
Test_Case => (Name => "Test_Create_Frame2", Mode => Nominal);
-- ****
-- ****f* Frame/Frame.Get_Options
-- FUNCTION
-- Get all values of Tk options of the selected frame
-- PARAMETERS
-- Frame_Widget - Tk_Frame which options' values will be taken
-- RESULT
-- Frame_Create_Options record with values of the selected frame
-- options
-- HISTORY
-- 8.6.0 - Added
-- EXAMPLE
-- -- Get all values of option of frame with pathname .myframe
-- My_Frame_Options: constant Frame_Create_Options := Get_Options(Get_Widget(".myframe"));
-- COMMANDS
-- Widget configure
-- SOURCE
function Get_Options
(Frame_Widget: Tk_Frame) return Frame_Create_Options with
Pre'Class => Frame_Widget /= Null_Widget,
Test_Case => (Name => "Test_Get_Options_Frame", Mode => Nominal);
-- ****
-- ****d* Frame/Frame.Default_Frame_Create_Options
-- FUNCTION
-- Default options used during creating Frame widget
-- HISTORY
-- 8.6.0 - Added
-- SOURCE
Default_Frame_Create_Options: constant Frame_Create_Options :=
Frame_Create_Options'(others => <>);
-- ****
--## rule on REDUCEABLE_SCOPE
end Tk.Frame;
|
<?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/>
<cdfg class_id="1" tracking_level="1" version="0" object_id="_0">
<name>dilate_0_0_2160_3840_0_3_3_1_1_s</name>
<ret_bitwidth>0</ret_bitwidth>
<ports class_id="2" tracking_level="0" version="0">
<count>4</count>
<item_version>0</item_version>
<item class_id="3" tracking_level="1" version="0" object_id="_1">
<Value class_id="4" tracking_level="0" version="0">
<Obj class_id="5" tracking_level="0" version="0">
<type>1</type>
<id>1</id>
<name>imgHelper2_4102</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo class_id="6" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName>FIFO_SRL</coreName>
<coreId>49</coreId>
</Obj>
<bitwidth>8</bitwidth>
</Value>
<direction>0</direction>
<if_type>3</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>imgHelper3_4103</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName>FIFO_SRL</coreName>
<coreId>49</coreId>
</Obj>
<bitwidth>8</bitwidth>
</Value>
<direction>1</direction>
<if_type>3</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>p_src_rows</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName>FIFO_SRL</coreName>
<coreId>49</coreId>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<direction>0</direction>
<if_type>3</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>p_src_cols</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName>FIFO_SRL</coreName>
<coreId>52</coreId>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<direction>0</direction>
<if_type>3</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>6</count>
<item_version>0</item_version>
<item class_id="9" tracking_level="1" version="0" object_id="_5">
<Value>
<Obj>
<type>0</type>
<id>11</id>
<name>p_src_rows_read</name>
<fileName>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip/vitis_lib/vision/L1/include/imgproc/xf_dilation.hpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>340</lineNumber>
<contextFuncName>dilate&lt;0, 0, 2160, 3840, 0, 3, 3, 1, 1&gt;</contextFuncName>
<contextNormFuncName>dilate_0_0_2160_3840_0_3_3_1_1_s</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item class_id="10" tracking_level="0" version="0">
<first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</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>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip/vitis_lib/vision/L1/include/imgproc/xf_dilation.hpp</first>
<second>dilate&lt;0, 0, 2160, 3840, 0, 3, 3, 1, 1&gt;</second>
</first>
<second>340</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control>auto</control>
<opType>fifo</opType>
<implIndex>srl</implIndex>
<coreName>FIFO_SRL</coreName>
<coreId>81</coreId>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>19</item>
<item>20</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>3.28</m_delay>
<m_topoIndex>1</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_6">
<Value>
<Obj>
<type>0</type>
<id>12</id>
<name>p_src_cols_read</name>
<fileName>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip/vitis_lib/vision/L1/include/imgproc/xf_dilation.hpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>341</lineNumber>
<contextFuncName>dilate&lt;0, 0, 2160, 3840, 0, 3, 3, 1, 1&gt;</contextFuncName>
<contextNormFuncName>dilate_0_0_2160_3840_0_3_3_1_1_s</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip/vitis_lib/vision/L1/include/imgproc/xf_dilation.hpp</first>
<second>dilate&lt;0, 0, 2160, 3840, 0, 3, 3, 1, 1&gt;</second>
</first>
<second>341</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control>auto</control>
<opType>fifo</opType>
<implIndex>srl</implIndex>
<coreName>FIFO_SRL</coreName>
<coreId>81</coreId>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>21</item>
<item>22</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>3.28</m_delay>
<m_topoIndex>2</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_7">
<Value>
<Obj>
<type>0</type>
<id>13</id>
<name>trunc_ln340</name>
<fileName>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip/vitis_lib/vision/L1/include/imgproc/xf_dilation.hpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>340</lineNumber>
<contextFuncName>dilate&lt;0, 0, 2160, 3840, 0, 3, 3, 1, 1&gt;</contextFuncName>
<contextNormFuncName>dilate_0_0_2160_3840_0_3_3_1_1_s</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip/vitis_lib/vision/L1/include/imgproc/xf_dilation.hpp</first>
<second>dilate&lt;0, 0, 2160, 3840, 0, 3, 3, 1, 1&gt;</second>
</first>
<second>340</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>trunc_ln340_fu_52_p1</rtlName>
<control/>
<opType/>
<implIndex/>
<coreName/>
<coreId>113</coreId>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>23</item>
</oprand_edges>
<opcode>trunc</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="_8">
<Value>
<Obj>
<type>0</type>
<id>14</id>
<name>trunc_ln341</name>
<fileName>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip/vitis_lib/vision/L1/include/imgproc/xf_dilation.hpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>341</lineNumber>
<contextFuncName>dilate&lt;0, 0, 2160, 3840, 0, 3, 3, 1, 1&gt;</contextFuncName>
<contextNormFuncName>dilate_0_0_2160_3840_0_3_3_1_1_s</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip/vitis_lib/vision/L1/include/imgproc/xf_dilation.hpp</first>
<second>dilate&lt;0, 0, 2160, 3840, 0, 3, 3, 1, 1&gt;</second>
</first>
<second>341</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>trunc_ln341_fu_57_p1</rtlName>
<control/>
<opType/>
<implIndex/>
<coreName/>
<coreId>113</coreId>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>24</item>
</oprand_edges>
<opcode>trunc</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="_9">
<Value>
<Obj>
<type>0</type>
<id>15</id>
<name>_ln376</name>
<fileName>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip/vitis_lib/vision/L1/include/imgproc/xf_dilation.hpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>376</lineNumber>
<contextFuncName>dilate&lt;0, 0, 2160, 3840, 0, 3, 3, 1, 1&gt;</contextFuncName>
<contextNormFuncName>dilate_0_0_2160_3840_0_3_3_1_1_s</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip/vitis_lib/vision/L1/include/imgproc/xf_dilation.hpp</first>
<second>dilate&lt;0, 0, 2160, 3840, 0, 3, 3, 1, 1&gt;</second>
</first>
<second>376</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>grp_xfdilate_2160_3840_1_0_1_0_3841_3_3_s_fu_42</rtlName>
<control/>
<opType/>
<implIndex/>
<coreName/>
<coreId>113</coreId>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>5</count>
<item_version>0</item_version>
<item>26</item>
<item>27</item>
<item>28</item>
<item>29</item>
<item>30</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>0.00</m_delay>
<m_topoIndex>5</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_10">
<Value>
<Obj>
<type>0</type>
<id>16</id>
<name>_ln0</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<coreId>49</coreId>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>0</count>
<item_version>0</item_version>
</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>6</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
</nodes>
<consts class_id="15" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="16" tracking_level="1" version="0" object_id="_11">
<Value>
<Obj>
<type>2</type>
<id>25</id>
<name>xfdilate_2160_3840_1_0_1_0_3841_3_3_s</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<coreId>97</coreId>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<const_type>6</const_type>
<content><constant:xfdilate<2160, 3840, 1, 0, 1, 0, 3841, 3, 3>></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="_12">
<Obj>
<type>3</type>
<id>17</id>
<name>dilate<0, 0, 2160, 3840, 0, 3, 3, 1, 1></name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<coreId>1768189039</coreId>
</Obj>
<node_objs>
<count>6</count>
<item_version>0</item_version>
<item>11</item>
<item>12</item>
<item>13</item>
<item>14</item>
<item>15</item>
<item>16</item>
</node_objs>
</item>
</blocks>
<edges class_id="19" tracking_level="0" version="0">
<count>9</count>
<item_version>0</item_version>
<item class_id="20" tracking_level="1" version="0" object_id="_13">
<id>20</id>
<edge_type>1</edge_type>
<source_obj>3</source_obj>
<sink_obj>11</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_14">
<id>22</id>
<edge_type>1</edge_type>
<source_obj>4</source_obj>
<sink_obj>12</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_15">
<id>23</id>
<edge_type>1</edge_type>
<source_obj>11</source_obj>
<sink_obj>13</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_16">
<id>24</id>
<edge_type>1</edge_type>
<source_obj>12</source_obj>
<sink_obj>14</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_17">
<id>26</id>
<edge_type>1</edge_type>
<source_obj>25</source_obj>
<sink_obj>15</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_18">
<id>27</id>
<edge_type>1</edge_type>
<source_obj>1</source_obj>
<sink_obj>15</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_19">
<id>28</id>
<edge_type>1</edge_type>
<source_obj>2</source_obj>
<sink_obj>15</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_20">
<id>29</id>
<edge_type>1</edge_type>
<source_obj>13</source_obj>
<sink_obj>15</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_21">
<id>30</id>
<edge_type>1</edge_type>
<source_obj>14</source_obj>
<sink_obj>15</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="_22">
<mId>1</mId>
<mTag>dilate<0, 0, 2160, 3840, 0, 3, 3, 1, 1></mTag>
<mNormTag>dilate_0_0_2160_3840_0_3_3_1_1_s</mNormTag>
<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>17</item>
</basic_blocks>
<mII>-1</mII>
<mDepth>-1</mDepth>
<mMinTripCount>-1</mMinTripCount>
<mMaxTripCount>-1</mMaxTripCount>
<mMinLatency>13</mMinLatency>
<mMaxLatency>8319373</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"/>
</item>
</cdfg_regions>
<fsm class_id="24" tracking_level="1" version="0" object_id="_23">
<states class_id="25" tracking_level="0" version="0">
<count>2</count>
<item_version>0</item_version>
<item class_id="26" tracking_level="1" version="0" object_id="_24">
<id>1</id>
<operations class_id="27" tracking_level="0" version="0">
<count>5</count>
<item_version>0</item_version>
<item class_id="28" tracking_level="1" version="0" object_id="_25">
<id>11</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_26">
<id>12</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_27">
<id>13</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_28">
<id>14</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_29">
<id>15</id>
<stage>2</stage>
<latency>2</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_30">
<id>2</id>
<operations>
<count>8</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_31">
<id>5</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_32">
<id>6</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_33">
<id>7</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_34">
<id>8</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_35">
<id>9</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_36">
<id>10</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_37">
<id>15</id>
<stage>1</stage>
<latency>2</latency>
</item>
<item class_id_reference="28" object_id="_38">
<id>16</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
</states>
<transitions class_id="29" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="30" tracking_level="1" version="0" object_id="_39">
<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>
</transitions>
</fsm>
<res class_id="34" tracking_level="1" version="0" object_id="_40">
<dp_component_resource class_id="35" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="36" tracking_level="0" version="0">
<first>grp_xfdilate_2160_3840_1_0_1_0_3841_3_3_s_fu_42 (xfdilate_2160_3840_1_0_1_0_3841_3_3_s)</first>
<second class_id="37" tracking_level="0" version="0">
<count>3</count>
<item_version>0</item_version>
<item class_id="38" tracking_level="0" version="0">
<first>BRAM</first>
<second>6</second>
</item>
<item>
<first>FF</first>
<second>611</second>
</item>
<item>
<first>LUT</first>
<second>819</second>
</item>
</second>
</item>
</dp_component_resource>
<dp_expression_resource>
<count>1</count>
<item_version>0</item_version>
<item>
<first>ap_block_state1 ( or ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>1</second>
</item>
<item>
<first>(1P1)</first>
<second>1</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>1</second>
</item>
</second>
</item>
</dp_expression_resource>
<dp_fifo_resource>
<count>0</count>
<item_version>0</item_version>
</dp_fifo_resource>
<dp_memory_resource>
<count>0</count>
<item_version>0</item_version>
</dp_memory_resource>
<dp_multiplexer_resource>
<count>6</count>
<item_version>0</item_version>
<item>
<first>ap_NS_fsm</first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0Size)</first>
<second>3</second>
</item>
<item>
<first>(1Bits)</first>
<second>1</second>
</item>
<item>
<first>(2Count)</first>
<second>3</second>
</item>
<item>
<first>LUT</first>
<second>13</second>
</item>
</second>
</item>
<item>
<first>ap_done</first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0Size)</first>
<second>2</second>
</item>
<item>
<first>(1Bits)</first>
<second>1</second>
</item>
<item>
<first>(2Count)</first>
<second>2</second>
</item>
<item>
<first>LUT</first>
<second>9</second>
</item>
</second>
</item>
<item>
<first>imgHelper2_4102_read</first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0Size)</first>
<second>2</second>
</item>
<item>
<first>(1Bits)</first>
<second>1</second>
</item>
<item>
<first>(2Count)</first>
<second>2</second>
</item>
<item>
<first>LUT</first>
<second>9</second>
</item>
</second>
</item>
<item>
<first>imgHelper3_4103_write</first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0Size)</first>
<second>2</second>
</item>
<item>
<first>(1Bits)</first>
<second>1</second>
</item>
<item>
<first>(2Count)</first>
<second>2</second>
</item>
<item>
<first>LUT</first>
<second>9</second>
</item>
</second>
</item>
<item>
<first>p_src_cols_blk_n</first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0Size)</first>
<second>2</second>
</item>
<item>
<first>(1Bits)</first>
<second>1</second>
</item>
<item>
<first>(2Count)</first>
<second>2</second>
</item>
<item>
<first>LUT</first>
<second>9</second>
</item>
</second>
</item>
<item>
<first>p_src_rows_blk_n</first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0Size)</first>
<second>2</second>
</item>
<item>
<first>(1Bits)</first>
<second>1</second>
</item>
<item>
<first>(2Count)</first>
<second>2</second>
</item>
<item>
<first>LUT</first>
<second>9</second>
</item>
</second>
</item>
</dp_multiplexer_resource>
<dp_register_resource>
<count>5</count>
<item_version>0</item_version>
<item>
<first>ap_CS_fsm</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>(Bits)</first>
<second>2</second>
</item>
<item>
<first>(Consts)</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>2</second>
</item>
</second>
</item>
<item>
<first>ap_done_reg</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>(Bits)</first>
<second>1</second>
</item>
<item>
<first>(Consts)</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>1</second>
</item>
</second>
</item>
<item>
<first>grp_xfdilate_2160_3840_1_0_1_0_3841_3_3_s_fu_42_ap_start_reg</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>(Bits)</first>
<second>1</second>
</item>
<item>
<first>(Consts)</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>1</second>
</item>
</second>
</item>
<item>
<first>trunc_ln340_reg_62</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>(Bits)</first>
<second>16</second>
</item>
<item>
<first>(Consts)</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>16</second>
</item>
</second>
</item>
<item>
<first>trunc_ln341_reg_67</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>(Bits)</first>
<second>16</second>
</item>
<item>
<first>(Consts)</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>16</second>
</item>
</second>
</item>
</dp_register_resource>
<dp_dsp_resource>
<count>1</count>
<item_version>0</item_version>
<item>
<first>grp_xfdilate_2160_3840_1_0_1_0_3841_3_3_s_fu_42</first>
<second>
<count>0</count>
<item_version>0</item_version>
</second>
</item>
</dp_dsp_resource>
<dp_component_map class_id="39" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="40" tracking_level="0" version="0">
<first>grp_xfdilate_2160_3840_1_0_1_0_3841_3_3_s_fu_42 (xfdilate_2160_3840_1_0_1_0_3841_3_3_s)</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>15</item>
</second>
</item>
</dp_component_map>
<dp_expression_map>
<count>0</count>
<item_version>0</item_version>
</dp_expression_map>
<dp_fifo_map>
<count>0</count>
<item_version>0</item_version>
</dp_fifo_map>
<dp_memory_map>
<count>0</count>
<item_version>0</item_version>
</dp_memory_map>
</res>
<node_label_latency class_id="41" tracking_level="0" version="0">
<count>6</count>
<item_version>0</item_version>
<item class_id="42" tracking_level="0" version="0">
<first>11</first>
<second class_id="43" tracking_level="0" version="0">
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>12</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>13</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>14</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>15</first>
<second>
<first>0</first>
<second>1</second>
</second>
</item>
<item>
<first>16</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
</node_label_latency>
<bblk_ent_exit class_id="44" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="45" tracking_level="0" version="0">
<first>17</first>
<second class_id="46" tracking_level="0" version="0">
<first>0</first>
<second>1</second>
</second>
</item>
</bblk_ent_exit>
<regions class_id="47" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</regions>
<dp_fu_nodes class_id="48" tracking_level="0" version="0">
<count>5</count>
<item_version>0</item_version>
<item class_id="49" tracking_level="0" version="0">
<first>30</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>11</item>
</second>
</item>
<item>
<first>36</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>12</item>
</second>
</item>
<item>
<first>42</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>15</item>
<item>15</item>
</second>
</item>
<item>
<first>52</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>13</item>
</second>
</item>
<item>
<first>57</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>14</item>
</second>
</item>
</dp_fu_nodes>
<dp_fu_nodes_expression class_id="51" tracking_level="0" version="0">
<count>2</count>
<item_version>0</item_version>
<item class_id="52" tracking_level="0" version="0">
<first>trunc_ln340_fu_52</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>13</item>
</second>
</item>
<item>
<first>trunc_ln341_fu_57</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>14</item>
</second>
</item>
</dp_fu_nodes_expression>
<dp_fu_nodes_module>
<count>1</count>
<item_version>0</item_version>
<item>
<first>grp_xfdilate_2160_3840_1_0_1_0_3841_3_3_s_fu_42</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>15</item>
<item>15</item>
</second>
</item>
</dp_fu_nodes_module>
<dp_fu_nodes_io>
<count>2</count>
<item_version>0</item_version>
<item>
<first>p_src_cols_read_read_fu_36</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>12</item>
</second>
</item>
<item>
<first>p_src_rows_read_read_fu_30</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>11</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="53" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_mem_port_nodes>
<dp_reg_nodes>
<count>2</count>
<item_version>0</item_version>
<item>
<first>62</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>13</item>
</second>
</item>
<item>
<first>67</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>14</item>
</second>
</item>
</dp_reg_nodes>
<dp_regname_nodes>
<count>2</count>
<item_version>0</item_version>
<item>
<first>trunc_ln340_reg_62</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>13</item>
</second>
</item>
<item>
<first>trunc_ln341_reg_67</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>14</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="54" tracking_level="0" version="0">
<count>4</count>
<item_version>0</item_version>
<item class_id="55" tracking_level="0" version="0">
<first>imgHelper2_4102</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>call</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>15</item>
</second>
</item>
</second>
</item>
<item>
<first>imgHelper3_4103</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>call</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>15</item>
</second>
</item>
</second>
</item>
<item>
<first>p_src_cols</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>read</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>12</item>
</second>
</item>
</second>
</item>
<item>
<first>p_src_rows</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>read</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>11</item>
</second>
</item>
</second>
</item>
</dp_port_io_nodes>
<port2core>
<count>4</count>
<item_version>0</item_version>
<item>
<first>1</first>
<second>
<first>1150</first>
<second>10</second>
</second>
</item>
<item>
<first>2</first>
<second>
<first>1151</first>
<second>10</second>
</second>
</item>
<item>
<first>3</first>
<second>
<first>1150</first>
<second>10</second>
</second>
</item>
<item>
<first>4</first>
<second>
<first>1150</first>
<second>10</second>
</second>
</item>
</port2core>
<node2core>
<count>3</count>
<item_version>0</item_version>
<item>
<first>11</first>
<second>
<first>1150</first>
<second>10</second>
</second>
</item>
<item>
<first>12</first>
<second>
<first>1150</first>
<second>10</second>
</second>
</item>
<item>
<first>15</first>
<second>
<first>-1</first>
<second>-1</second>
</second>
</item>
</node2core>
</syndb>
</boost_serialization>
|
-- This file was generated automatically: DO NOT MODIFY IT !
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;
package logger is
-- Provided interface "log_cmd"
procedure log_cmd(cmd_val: access asn1SccBase_commands_Motion2D);
pragma Export(C, log_cmd, "logger_PI_log_cmd");
end logger; |
-- ___ _ ___ _ _ --
-- / __| |/ (_) | | Common SKilL implementation --
-- \__ \ ' <| | | |__ iterator over static instances --
-- |___/_|\_\_|_|____| by: Timm Felden --
-- --
pragma Ada_2012;
with Skill.Types;
with Skill.Types.Pools;
package Skill.Iterators.Static_Data is
use Skill.Types;
use type Skill.Types.Pools.Pool;
-- @note in contrast to c++, this implementation uses type erasure as I dont
-- see how to solve elaboration otherwise
type Iterator is tagged record
Current : Skill.Types.Pools.Pool;
SecondIndex : Skill_ID_T;
LastBlock : Skill_ID_T;
Index : Skill_ID_T;
Last : Skill_ID_T;
end record;
function Make (First : Skill.Types.Pools.Pool := null) return Iterator;
procedure Init (This : access Iterator'Class;
First : Skill.Types.Pools.Pool := null);
function Element
(This : access Iterator'Class) return Annotation;
function Has_Next
(This : access Iterator'Class) return Boolean is
(This.Index /= This.Last);
function Next (This : access Iterator'Class) return Annotation;
end Skill.Iterators.Static_Data;
|
-- Copyright 2008-2021 Free Software Foundation, Inc.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
package Pck is
procedure Increment;
function Is_First return Boolean;
end Pck;
|
--
-- 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 HW.GFX.GMA.Registers;
package body HW.GFX.GMA.PCH.Sideband is
SBI_CTL_DEST_ICLK : constant := 0 * 2 ** 16;
SBI_CTL_DEST_MPHY : constant := 1 * 2 ** 16;
SBI_CTL_OP_IORD : constant := 2 * 2 ** 8;
SBI_CTL_OP_IOWR : constant := 3 * 2 ** 8;
SBI_CTL_OP_CRRD : constant := 6 * 2 ** 8;
SBI_CTL_OP_CRWR : constant := 7 * 2 ** 8;
SBI_RESPONSE_FAIL : constant := 1 * 2 ** 1;
SBI_BUSY : constant := 1 * 2 ** 0;
type Register_Array is array (Register_Type) of Word32;
Register_Addr : constant Register_Array := Register_Array'
(SBI_SSCDIVINTPHASE6 => 16#0600_0000#,
SBI_SSCCTL6 => 16#060c_0000#,
SBI_SSCAUXDIV => 16#0610_0000#);
----------------------------------------------------------------------------
procedure Read
(Dest : in Destination_Type;
Register : in Register_Type;
Value : out Word32)
is
begin
Registers.Wait_Unset_Mask
(Register => Registers.SBI_CTL_STAT,
Mask => SBI_BUSY);
Registers.Write
(Register => Registers.SBI_ADDR,
Value => Register_Addr (Register));
if Dest = SBI_ICLK then
Registers.Write
(Register => Registers.SBI_CTL_STAT,
Value => SBI_CTL_DEST_ICLK or SBI_CTL_OP_CRRD or SBI_BUSY);
else
Registers.Write
(Register => Registers.SBI_CTL_STAT,
Value => SBI_CTL_DEST_MPHY or SBI_CTL_OP_IORD or SBI_BUSY);
end if;
Registers.Wait_Unset_Mask
(Register => Registers.SBI_CTL_STAT,
Mask => SBI_BUSY);
Registers.Read
(Register => Registers.SBI_DATA,
Value => Value);
end Read;
procedure Write
(Dest : in Destination_Type;
Register : in Register_Type;
Value : in Word32)
is
begin
Registers.Wait_Unset_Mask
(Register => Registers.SBI_CTL_STAT,
Mask => SBI_BUSY);
Registers.Write
(Register => Registers.SBI_ADDR,
Value => Register_Addr (Register));
Registers.Write
(Register => Registers.SBI_DATA,
Value => Value);
if Dest = SBI_ICLK then
Registers.Write
(Register => Registers.SBI_CTL_STAT,
Value => SBI_CTL_DEST_ICLK or SBI_CTL_OP_CRWR or SBI_BUSY);
else
Registers.Write
(Register => Registers.SBI_CTL_STAT,
Value => SBI_CTL_DEST_MPHY or SBI_CTL_OP_IOWR or SBI_BUSY);
end if;
Registers.Wait_Unset_Mask
(Register => Registers.SBI_CTL_STAT,
Mask => SBI_BUSY);
end Write;
----------------------------------------------------------------------------
procedure Unset_Mask
(Dest : in Destination_Type;
Register : in Register_Type;
Mask : in Word32)
is
Value : Word32;
begin
Read (Dest, Register, Value);
Write (Dest, Register, Value and not Mask);
end Unset_Mask;
procedure Set_Mask
(Dest : in Destination_Type;
Register : in Register_Type;
Mask : in Word32)
is
Value : Word32;
begin
Read (Dest, Register, Value);
Write (Dest, Register, Value or Mask);
end Set_Mask;
procedure Unset_And_Set_Mask
(Dest : in Destination_Type;
Register : in Register_Type;
Mask_Unset : in Word32;
Mask_Set : in Word32)
is
Value : Word32;
begin
Read (Dest, Register, Value);
Write (Dest, Register, (Value and not Mask_Unset) or Mask_Set);
end Unset_And_Set_Mask;
end HW.GFX.GMA.PCH.Sideband;
|
-- { dg-do compile }
-- { dg-options "-O -gnatws" }
with Pack22_Pkg; use Pack22_Pkg;
procedure Pack22 is
package Role_Map is new Bit_Map_Generic;
type Role_List is new Role_Map.List;
Roles_1 : Role_List;
Roles_2 : Role_List;
Roles_3 : Role_List;
begin
Temp_buffer := (others => 1);
Temp_Buffer(2) := (0);
Roles_1 := Roles_2 xor Roles_3;
end;
|
-- Abstract :
--
-- A generalized LR parser.
--
-- In a child package of Parser.LR partly for historical reasons,
-- partly to allow McKenzie_Recover to be in a sibling package.
--
-- Copyright (C) 2002, 2003, 2009, 2010, 2013-2015, 2017 - 2019 Free Software Foundation, Inc.
--
-- This file is part of the WisiToken package.
--
-- The WisiToken package is free software; you can redistribute it
-- and/or modify it under terms of the GNU General Public License as
-- published by the Free Software Foundation; either version 3, or
-- (at your option) any later version. This library is distributed in
-- the hope that it will be useful, but WITHOUT ANY WARRANTY; without
-- even the implied warranty of MERCHAN- TABILITY 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.
pragma License (Modified_GPL);
with WisiToken.Parse.LR.Parser_Lists;
with WisiToken.Lexer;
with WisiToken.Parse;
with WisiToken.Syntax_Trees;
package WisiToken.Parse.LR.Parser is
Default_Max_Parallel : constant := 15;
type Language_Fixes_Access is access procedure
(Trace : in out WisiToken.Trace'Class;
Lexer : access constant WisiToken.Lexer.Instance'Class;
Parser_Label : in Natural;
Parse_Table : in WisiToken.Parse.LR.Parse_Table;
Terminals : in Base_Token_Arrays.Vector;
Tree : in Syntax_Trees.Tree;
Local_Config_Heap : in out Config_Heaps.Heap_Type;
Config : in Configuration);
-- Config encountered a parse table Error action, or failed a
-- semantic check; attempt to provide a language-specific fix,
-- enqueuing new configs on Local_Config_Heap.
--
-- For a failed semantic check, Config.Stack is in the pre-reduce
-- state, Config.Error_Token gives the nonterm token,
-- Config.Check_Token_Count the token count for the reduce. May be
-- called with Nonterm.Virtual = True or Tree.Valid_Indices (stack
-- top token_count items) false.
--
-- For an Error action, Config.Error_Token gives the terminal that
-- caused the error.
type Language_Matching_Begin_Tokens_Access is access procedure
(Tokens : in Token_ID_Array_1_3;
Config : in Configuration;
Matching_Tokens : out Token_ID_Arrays.Vector;
Forbid_Minimal_Complete : out Boolean);
-- Tokens (1) caused a parse error; Tokens (2 .. 3) are the following
-- tokens (Invalid_Token_ID if none). Set Matching_Tokens to a token
-- sequence that starts a production matching Tokens. If
-- Minimal_Complete would produce a bad solution at this error point,
-- set Forbid_Minimal_Complete True.
--
-- For example, if Tokens is a block end, return tokens that are the
-- corresponding block begin. If the error point is inside a
-- multi-token 'end' (ie 'end if;', or 'end <name>;'), set
-- Forbid_Minimal_Complete True.
type Language_String_ID_Set_Access is access function
(Descriptor : in WisiToken.Descriptor;
String_Literal_ID : in Token_ID)
return Token_ID_Set;
-- Return a Token_ID_Set containing String_Literal_ID and
-- nonterminals that can contain String_Literal_ID as part of an
-- expression. Used in placing a missing string quote.
type Post_Recover_Access is access procedure;
type Parser is new WisiToken.Parse.Base_Parser with record
Table : Parse_Table_Ptr;
Language_Fixes : Language_Fixes_Access;
Language_Matching_Begin_Tokens : Language_Matching_Begin_Tokens_Access;
Language_String_ID_Set : Language_String_ID_Set_Access;
String_Quote_Checked : Line_Number_Type := Invalid_Line_Number;
-- Max line checked for missing string quote.
Post_Recover : Post_Recover_Access;
-- Gather data for tests.
Shared_Tree : aliased Syntax_Trees.Base_Tree;
-- Each parser (normal and recover) has its own branched syntax tree,
-- all branched from this tree. Terminals are added to the tree when
-- they become the current token.
--
-- It is never the case that terminals are added to this shared tree
-- when there is more than one task active, so we don't need a
-- protected tree.
--
-- See WisiToken.LR.Parser_Lists Parser_State for more discussion of
-- Shared_Tree.
Parsers : aliased Parser_Lists.List;
Max_Parallel : SAL.Base_Peek_Type;
Terminate_Same_State : Boolean;
Enable_McKenzie_Recover : Boolean;
Recover_Log_File : Ada.Text_IO.File_Type;
end record;
overriding procedure Finalize (Object : in out LR.Parser.Parser);
-- Deep free Object.Table.
procedure New_Parser
(Parser : out LR.Parser.Parser;
Trace : not null access WisiToken.Trace'Class;
Lexer : in WisiToken.Lexer.Handle;
Table : in Parse_Table_Ptr;
Language_Fixes : in Language_Fixes_Access;
Language_Matching_Begin_Tokens : in Language_Matching_Begin_Tokens_Access;
Language_String_ID_Set : in Language_String_ID_Set_Access;
User_Data : in WisiToken.Syntax_Trees.User_Data_Access;
Max_Parallel : in SAL.Base_Peek_Type := Default_Max_Parallel;
Terminate_Same_State : in Boolean := True);
overriding procedure Parse (Shared_Parser : aliased in out LR.Parser.Parser);
-- Attempt a parse. Calls Parser.Lexer.Reset, runs lexer to end of
-- input setting Shared_Parser.Terminals, then parses tokens.
--
-- If an error is encountered, Parser.Lexer_Errors and
-- Parsers(*).Errors contain information about the errors. If a
-- recover strategy succeeds, no exception is raised. If recover does
-- not succeed, raises Syntax_Error.
--
-- For errors where no recovery is possible, raises Parse_Error with
-- an appropriate error message.
overriding function Tree (Shared_Parser : in Parser) return Syntax_Trees.Tree;
-- If there is one parser in Parsers, return its tree. Otherwise,
-- raise Parse_Error for an ambiguous parse.
overriding procedure Execute_Actions (Parser : in out LR.Parser.Parser);
-- Call User_Data.Delete_Token on any tokens deleted by error
-- recovery, then User_Data.Reduce and the grammar semantic actions
-- on all nonterms in the syntax tree.
overriding function Any_Errors (Parser : in LR.Parser.Parser) return Boolean;
-- Return True if any errors where encountered, recovered or not.
overriding procedure Put_Errors (Parser : in LR.Parser.Parser);
-- Put user-friendly error messages from the parse to
-- Ada.Text_IO.Current_Error.
end WisiToken.Parse.LR.Parser;
|
-----------------------------------------------------------------------
-- asf-lifecycles-tests - Tests for ASF lifecycles
-- Copyright (C) 2012 Stephane Carrez
-- Written by Stephane Carrez (Stephane.Carrez@gmail.com)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Unchecked_Deallocation;
with Util.Test_Caller;
with Util.Beans.Objects;
with ASF.Tests;
with ASF.Requests.Mockup;
with ASF.Responses.Mockup;
with ASF.Applications.Main;
with ASF.Applications.Tests;
package body ASF.Lifecycles.Tests is
use Util.Beans.Objects;
use ASF.Tests;
package Caller is new Util.Test_Caller (Test, "Lifecycles");
procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite) is
begin
Caller.Add_Test (Suite, "Test lifecycle (get)",
Test_Get_Lifecycle'Access);
Caller.Add_Test (Suite, "Test lifecycle (postback)",
Test_Post_Lifecycle'Access);
end Add_Tests;
-- ------------------------------
-- Initialize the test application
-- ------------------------------
overriding
procedure Set_Up (T : in out Test) is
pragma Unreferenced (T);
use type ASF.Applications.Main.Application_Access;
Fact : ASF.Applications.Main.Application_Factory;
begin
if ASF.Tests.Get_Application = null then
ASF.Tests.Initialize (Util.Tests.Get_Properties, Factory => Fact);
end if;
end Set_Up;
-- ------------------------------
-- Test a GET request and the lifecycles that this implies.
-- ------------------------------
procedure Test_Get_Lifecycle (T : in out Test) is
use ASF.Events.Phases;
Request : ASF.Requests.Mockup.Request;
Reply : ASF.Responses.Mockup.Response;
Form : aliased ASF.Applications.Tests.Form_Bean;
Listener : aliased Test_Phase_Listener;
Handler : constant Lifecycle_Access := ASF.Tests.Get_Application.Get_Lifecycle_Handler;
begin
Handler.Add_Phase_Listener (Listener'Unchecked_Access);
Request.Set_Attribute ("form", To_Object (Value => Form'Unchecked_Access,
Storage => STATIC));
Do_Get (Request, Reply, "/tests/form-text.html", "form-text.txt");
Listener.Check_Get_Counters (T, 1);
Listener.Check_Post_Counters (T, 0);
Handler.Remove_Phase_Listener (Listener'Unchecked_Access);
exception
when others =>
Handler.Remove_Phase_Listener (Listener'Unchecked_Access);
raise;
end Test_Get_Lifecycle;
-- ------------------------------
-- Test a GET+POST request with submitted values and an action method called on the bean.
-- ------------------------------
procedure Test_Post_Lifecycle (T : in out Test) is
Request : ASF.Requests.Mockup.Request;
Reply : ASF.Responses.Mockup.Response;
Form : aliased ASF.Applications.Tests.Form_Bean;
Listener : aliased Test_Phase_Listener;
Handler : constant Lifecycle_Access := ASF.Tests.Get_Application.Get_Lifecycle_Handler;
begin
Handler.Add_Phase_Listener (Listener'Unchecked_Access);
Request.Set_Attribute ("form", To_Object (Value => Form'Unchecked_Access,
Storage => STATIC));
Do_Get (Request, Reply, "/tests/form-text.html", "form-text.txt");
Request.Set_Parameter ("formText", "1");
Request.Set_Parameter ("name", "John");
Request.Set_Parameter ("password", "12345");
Request.Set_Parameter ("email", "john@gmail.com");
Request.Set_Parameter ("ok", "1");
Do_Post (Request, Reply, "/tests/form-text.html", "form-text-post.txt");
Listener.Check_Post_Counters (T, 1);
Listener.Check_Get_Counters (T, 2);
Handler.Remove_Phase_Listener (Listener'Unchecked_Access);
exception
when others =>
Handler.Remove_Phase_Listener (Listener'Unchecked_Access);
raise;
end Test_Post_Lifecycle;
-- ------------------------------
-- Check that the RESTORE_VIEW and RENDER_RESPONSE counters have the given value.
-- ------------------------------
procedure Check_Get_Counters (Listener : in Test_Phase_Listener;
T : in out Test'Class;
Value : in Natural) is
use ASF.Events.Phases;
begin
Util.Tests.Assert_Equals (T, Value, Listener.Before_Count (RESTORE_VIEW),
"Invalid before RESTORE_VIEW count");
Util.Tests.Assert_Equals (T, Value, Listener.After_Count (RESTORE_VIEW),
"Invalid after RESTORE_VIEW count");
Util.Tests.Assert_Equals (T, Value, Listener.Before_Count (RENDER_RESPONSE),
"Invalid before RENDER_RESPONSE count");
Util.Tests.Assert_Equals (T, Value, Listener.After_Count (RENDER_RESPONSE),
"Invalid after RENDER_RESPONSE count");
end Check_Get_Counters;
-- ------------------------------
-- Check that the APPLY_REQUESTS .. INVOKE_APPLICATION counters have the given value.
-- ------------------------------
procedure Check_Post_Counters (Listener : in Test_Phase_Listener;
T : in out Test'Class;
Value : in Natural) is
use ASF.Events.Phases;
begin
Util.Tests.Assert_Equals (T, Value, Listener.Before_Count (APPLY_REQUEST_VALUES),
"Invalid before APPLY_REQUEST_VALUES count");
Util.Tests.Assert_Equals (T, Value, Listener.After_Count (APPLY_REQUEST_VALUES),
"Invalid after APPLY_REQUEST_VALUES count");
Util.Tests.Assert_Equals (T, Value, Listener.Before_Count (PROCESS_VALIDATION),
"Invalid before PROCESS_VALIDATION count");
Util.Tests.Assert_Equals (T, Value, Listener.After_Count (PROCESS_VALIDATION),
"Invalid after PROCESS_VALIDATION count");
Util.Tests.Assert_Equals (T, Value, Listener.Before_Count (UPDATE_MODEL_VALUES),
"Invalid before UPDATE_MODEL_VALUES count");
Util.Tests.Assert_Equals (T, Value, Listener.After_Count (UPDATE_MODEL_VALUES),
"Invalid after UPDATE_MODEL_VALUES count");
Util.Tests.Assert_Equals (T, Value, Listener.Before_Count (INVOKE_APPLICATION),
"Invalid before INVOKE_APPLICATION count");
Util.Tests.Assert_Equals (T, Value, Listener.After_Count (INVOKE_APPLICATION),
"Invalid after INVOKE_APPLICATION count");
end Check_Post_Counters;
-- ------------------------------
-- Notifies that the lifecycle phase described by the event is about to begin.
-- ------------------------------
procedure Before_Phase (Listener : in Test_Phase_Listener;
Event : in ASF.Events.Phases.Phase_Event'Class) is
begin
Listener.Before_Count (Event.Phase) := Listener.Before_Count (Event.Phase) + 1;
end Before_Phase;
-- ------------------------------
-- Notifies that the lifecycle phase described by the event has finished.
-- ------------------------------
procedure After_Phase (Listener : in Test_Phase_Listener;
Event : in ASF.Events.Phases.Phase_Event'Class) is
begin
Listener.After_Count (Event.Phase) := Listener.After_Count (Event.Phase) + 1;
end After_Phase;
-- ------------------------------
-- Return the phase that this listener is interested in processing the <b>Phase_Event</b>
-- events. If the listener is interested by several events, it should return <b>ANY_PHASE</b>.
-- ------------------------------
function Get_Phase (Listener : in Test_Phase_Listener) return ASF.Events.Phases.Phase_Type is
begin
return Listener.Phase;
end Get_Phase;
overriding
procedure Initialize (Listener : in out Test_Phase_Listener) is
begin
Listener.After_Count := new Phase_Counters '(others => 0);
Listener.Before_Count := new Phase_Counters '(others => 0);
end Initialize;
overriding
procedure Finalize (Listener : in out Test_Phase_Listener) is
procedure Free is
new Ada.Unchecked_Deallocation (Object => Phase_Counters,
Name => Phase_Counters_Array);
begin
Free (Listener.After_Count);
Free (Listener.Before_Count);
end Finalize;
end ASF.Lifecycles.Tests;
|
------------------------------------------------------------------------------
-- Copyright (c) 2019, 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. --
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- Lithium.Photo_Process provides a programmable processor for JPEG images. --
------------------------------------------------------------------------------
with Natools.S_Expressions.Lockable;
private with Ada.Finalization;
private with Interfaces.C;
private with Natools.References;
private with Natools.S_Expressions.Atom_Refs;
private with Natools.Storage_Pools;
private with TurboJPEG_Thin;
package Lithium.Photo_Process is
package Sx renames Natools.S_Expressions;
type Process_Description is private;
function Create (Arguments : in out Sx.Lockable.Descriptor'Class)
return Process_Description;
package Orientations is
type Enum is
(Top_Left, Top_Right, Bottom_Right, Bottom_Left,
Left_Top, Right_Top, Right_Bottom, Left_Bottom);
end Orientations;
type Image is tagged private;
function Create
(File_Name : in String;
Orientation : in Orientations.Enum)
return Image;
procedure Run
(Object : in Image;
Base_Name : in String;
Description : in Process_Description);
private
type Process_Description is record
Max_Width : Natural := 0;
Max_Height : Natural := 0;
Quality : Natural := 85;
Path : Sx.Atom_Refs.Immutable_Reference;
Prefix : Sx.Atom_Refs.Immutable_Reference;
Suffix : Sx.Atom_Refs.Immutable_Reference;
end record;
type Buffer is new Ada.Finalization.Limited_Controlled with record
Data : TurboJPEG_Thin.Bytes.Pointer := null;
Size : Interfaces.C.unsigned_long := 0;
end record;
function Create (Size : in Interfaces.C.int) return Buffer;
function Create (File_Name : in String) return Buffer;
overriding procedure Finalize (Self : in out Buffer);
function Plane_Size
(Label : in TurboJPEG_Thin.Plane_Label;
Width, Height : in Positive;
Sub_Samp : in Interfaces.C.int)
return Interfaces.C.unsigned_long
is (TurboJPEG_Thin.Plane_Size_YUV
(TurboJPEG_Thin.Plane_Label'Pos (Label),
Interfaces.C.int (Width),
0, -- Stride
Interfaces.C.int (Height),
Sub_Samp));
function Create
(Label : in TurboJPEG_Thin.Plane_Label;
Width, Height : in Positive;
Sub_Samp : in Interfaces.C.int)
return Buffer
is (Create (Interfaces.C.int
(Plane_Size (Label, Width, Height, Sub_Samp))));
type Planes_Buffer is array (TurboJPEG_Thin.Plane_Label) of Buffer;
function "+" (Buffer : Planes_Buffer) return TurboJPEG_Thin.Planes_Buffer
is ((TurboJPEG_Thin.Y => Buffer (TurboJPEG_Thin.Y).Data,
TurboJPEG_Thin.Cb => Buffer (TurboJPEG_Thin.Cb).Data,
TurboJPEG_Thin.Cr => Buffer (TurboJPEG_Thin.Cr).Data));
type Image_Data is limited record
Width : Positive;
Height : Positive;
Sub_Samp : Interfaces.C.int;
Planes : Planes_Buffer;
end record;
function Create
(Width, Height : in Positive;
Sub_Samp : in Interfaces.C.int)
return Image_Data
is (Width => Width,
Height => Height,
Sub_Samp => Sub_Samp,
Planes =>
(TurboJPEG_Thin.Y
=> Create (TurboJPEG_Thin.Y, Width, Height, Sub_Samp),
TurboJPEG_Thin.Cb
=> Create (TurboJPEG_Thin.Cb, Width, Height, Sub_Samp),
TurboJPEG_Thin.Cr
=> Create (TurboJPEG_Thin.Cr, Width, Height, Sub_Samp)));
package Data_Refs is new Natools.References
(Image_Data,
Natools.Storage_Pools.Access_In_Default_Pool'Storage_Pool,
Natools.Storage_Pools.Access_In_Default_Pool'Storage_Pool);
type Image is tagged record
Ref : Data_Refs.Immutable_Reference;
end record;
end Lithium.Photo_Process;
|
-----------------------------------------------------------------------
-- awa-mail-components-messages -- Mail UI Message
-- Copyright (C) 2012 Stephane Carrez
-- Written by Stephane Carrez (Stephane.Carrez@gmail.com)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Unchecked_Deallocation;
with AWA.Mail.Clients;
package body AWA.Mail.Components.Messages is
-- ------------------------------
-- Set the mail message instance.
-- ------------------------------
procedure Set_Message (UI : in out UIMailMessage;
Message : in AWA.Mail.Clients.Mail_Message_Access) is
begin
UI.Message := Message;
end Set_Message;
-- ------------------------------
-- Get the mail message instance.
-- ------------------------------
overriding
function Get_Message (UI : in UIMailMessage) return AWA.Mail.Clients.Mail_Message_Access is
begin
return UI.Message;
end Get_Message;
-- ------------------------------
-- Render the end of the input component. Closes the DL/DD list.
-- ------------------------------
overriding
procedure Encode_End (UI : in UIMailMessage;
Context : in out ASF.Contexts.Faces.Faces_Context'Class) is
use type AWA.Mail.Clients.Mail_Message_Access;
begin
if UI.Message /= null and UI.Is_Rendered (Context) then
UI.Message.Send;
end if;
end Encode_End;
-- ------------------------------
-- Finalize and release the mail message.
-- ------------------------------
overriding
procedure Finalize (UI : in out UIMailMessage) is
procedure Free is
new Ada.Unchecked_Deallocation (Object => AWA.Mail.Clients.Mail_Message'Class,
Name => AWA.Mail.Clients.Mail_Message_Access);
begin
Free (UI.Message);
end Finalize;
-- ------------------------------
-- Render the mail subject and initializes the message with its content.
-- ------------------------------
overriding
procedure Encode_Children (UI : in UIMailSubject;
Context : in out ASF.Contexts.Faces.Faces_Context'Class) is
procedure Process (Content : in String);
procedure Process (Content : in String) is
Msg : constant AWA.Mail.Clients.Mail_Message_Access := UI.Get_Message;
begin
Msg.Set_Subject (Content);
end Process;
begin
UI.Wrap_Encode_Children (Context, Process'Access);
end Encode_Children;
-- ------------------------------
-- Render the mail body and initializes the message with its content.
-- ------------------------------
overriding
procedure Encode_Children (UI : in UIMailBody;
Context : in out ASF.Contexts.Faces.Faces_Context'Class) is
procedure Process (Content : in String);
procedure Process (Content : in String) is
Msg : constant AWA.Mail.Clients.Mail_Message_Access := UI.Get_Message;
begin
Msg.Set_Body (Content);
end Process;
begin
UI.Wrap_Encode_Children (Context, Process'Access);
end Encode_Children;
end AWA.Mail.Components.Messages;
|
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
procedure Create_Vector_Data(Xa,Ya,Za,Xb,Yb,Zb: in Integer; L,Vy,Vz: out Integer) is
begin
Put(Xa);
end Create_Vector_Data;
|
-- This file is generated by SWIG. Please do not modify by hand.
--
with Interfaces;
with Interfaces.C;
with Interfaces.C.Pointers;
package xcb.xcb_glx_get_mapdv_request_t is
-- Item
--
type Item is record
major_opcode : aliased Interfaces.Unsigned_8;
minor_opcode : aliased Interfaces.Unsigned_8;
length : aliased Interfaces.Unsigned_16;
context_tag : aliased xcb.xcb_glx_context_tag_t;
target : aliased Interfaces.Unsigned_32;
query : aliased Interfaces.Unsigned_32;
end record;
-- Item_Array
--
type Item_Array is
array
(Interfaces.C
.size_t range <>) of aliased xcb.xcb_glx_get_mapdv_request_t
.Item;
-- Pointer
--
package C_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t,
Element => xcb.xcb_glx_get_mapdv_request_t.Item,
Element_Array => xcb.xcb_glx_get_mapdv_request_t.Item_Array,
Default_Terminator => (others => <>));
subtype Pointer is C_Pointers.Pointer;
-- Pointer_Array
--
type Pointer_Array is
array
(Interfaces.C
.size_t range <>) of aliased xcb.xcb_glx_get_mapdv_request_t
.Pointer;
-- Pointer_Pointer
--
package C_Pointer_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t,
Element => xcb.xcb_glx_get_mapdv_request_t.Pointer,
Element_Array => xcb.xcb_glx_get_mapdv_request_t.Pointer_Array,
Default_Terminator => null);
subtype Pointer_Pointer is C_Pointer_Pointers.Pointer;
end xcb.xcb_glx_get_mapdv_request_t;
|
------------------------------------------------------------------------------
-- --
-- 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.Elements;
with AMF.Internals.Element_Collections;
with AMF.Internals.Helpers;
with AMF.Internals.Tables.UML_Attributes;
with AMF.Visitors.UML_Iterators;
with AMF.Visitors.UML_Visitors;
with League.Strings.Internals;
with Matreshka.Internals.Strings;
package body AMF.Internals.UML_Constraints is
-------------------
-- Enter_Element --
-------------------
overriding procedure Enter_Element
(Self : not null access constant UML_Constraint_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control) is
begin
if Visitor in AMF.Visitors.UML_Visitors.UML_Visitor'Class then
AMF.Visitors.UML_Visitors.UML_Visitor'Class
(Visitor).Enter_Constraint
(AMF.UML.Constraints.UML_Constraint_Access (Self),
Control);
end if;
end Enter_Element;
-------------------
-- Leave_Element --
-------------------
overriding procedure Leave_Element
(Self : not null access constant UML_Constraint_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control) is
begin
if Visitor in AMF.Visitors.UML_Visitors.UML_Visitor'Class then
AMF.Visitors.UML_Visitors.UML_Visitor'Class
(Visitor).Leave_Constraint
(AMF.UML.Constraints.UML_Constraint_Access (Self),
Control);
end if;
end Leave_Element;
-------------------
-- Visit_Element --
-------------------
overriding procedure Visit_Element
(Self : not null access constant UML_Constraint_Proxy;
Iterator : in out AMF.Visitors.Abstract_Iterator'Class;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control) is
begin
if Iterator in AMF.Visitors.UML_Iterators.UML_Iterator'Class then
AMF.Visitors.UML_Iterators.UML_Iterator'Class
(Iterator).Visit_Constraint
(Visitor,
AMF.UML.Constraints.UML_Constraint_Access (Self),
Control);
end if;
end Visit_Element;
-----------------------------
-- Get_Constrained_Element --
-----------------------------
overriding function Get_Constrained_Element
(Self : not null access constant UML_Constraint_Proxy)
return AMF.UML.Elements.Collections.Ordered_Set_Of_UML_Element is
begin
return
AMF.UML.Elements.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Constrained_Element
(Self.Element)));
end Get_Constrained_Element;
-----------------
-- Get_Context --
-----------------
overriding function Get_Context
(Self : not null access constant UML_Constraint_Proxy)
return AMF.UML.Namespaces.UML_Namespace_Access is
begin
return
AMF.UML.Namespaces.UML_Namespace_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Context
(Self.Element)));
end Get_Context;
-----------------
-- Set_Context --
-----------------
overriding procedure Set_Context
(Self : not null access UML_Constraint_Proxy;
To : AMF.UML.Namespaces.UML_Namespace_Access) is
begin
raise Program_Error;
end Set_Context;
-----------------------
-- Get_Specification --
-----------------------
overriding function Get_Specification
(Self : not null access constant UML_Constraint_Proxy)
return AMF.UML.Value_Specifications.UML_Value_Specification_Access is
begin
return
AMF.UML.Value_Specifications.UML_Value_Specification_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Specification
(Self.Element)));
end Get_Specification;
-----------------------
-- Set_Specification --
-----------------------
overriding procedure Set_Specification
(Self : not null access UML_Constraint_Proxy;
To : AMF.UML.Value_Specifications.UML_Value_Specification_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Specification
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Specification;
---------------------------
-- Get_Client_Dependency --
---------------------------
overriding function Get_Client_Dependency
(Self : not null access constant UML_Constraint_Proxy)
return AMF.UML.Dependencies.Collections.Set_Of_UML_Dependency is
begin
return
AMF.UML.Dependencies.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Client_Dependency
(Self.Element)));
end Get_Client_Dependency;
-------------------------
-- Get_Name_Expression --
-------------------------
overriding function Get_Name_Expression
(Self : not null access constant UML_Constraint_Proxy)
return AMF.UML.String_Expressions.UML_String_Expression_Access is
begin
return
AMF.UML.String_Expressions.UML_String_Expression_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Name_Expression
(Self.Element)));
end Get_Name_Expression;
-------------------------
-- Set_Name_Expression --
-------------------------
overriding procedure Set_Name_Expression
(Self : not null access UML_Constraint_Proxy;
To : AMF.UML.String_Expressions.UML_String_Expression_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Name_Expression
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Name_Expression;
-------------------
-- Get_Namespace --
-------------------
overriding function Get_Namespace
(Self : not null access constant UML_Constraint_Proxy)
return AMF.UML.Namespaces.UML_Namespace_Access is
begin
return
AMF.UML.Namespaces.UML_Namespace_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Namespace
(Self.Element)));
end Get_Namespace;
------------------------
-- Get_Qualified_Name --
------------------------
overriding function Get_Qualified_Name
(Self : not null access constant UML_Constraint_Proxy)
return AMF.Optional_String is
begin
declare
use type Matreshka.Internals.Strings.Shared_String_Access;
Aux : constant Matreshka.Internals.Strings.Shared_String_Access
:= AMF.Internals.Tables.UML_Attributes.Internal_Get_Qualified_Name (Self.Element);
begin
if Aux = null then
return (Is_Empty => True);
else
return (False, League.Strings.Internals.Create (Aux));
end if;
end;
end Get_Qualified_Name;
-----------------------------------
-- Get_Owning_Template_Parameter --
-----------------------------------
overriding function Get_Owning_Template_Parameter
(Self : not null access constant UML_Constraint_Proxy)
return AMF.UML.Template_Parameters.UML_Template_Parameter_Access is
begin
return
AMF.UML.Template_Parameters.UML_Template_Parameter_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Owning_Template_Parameter
(Self.Element)));
end Get_Owning_Template_Parameter;
-----------------------------------
-- Set_Owning_Template_Parameter --
-----------------------------------
overriding procedure Set_Owning_Template_Parameter
(Self : not null access UML_Constraint_Proxy;
To : AMF.UML.Template_Parameters.UML_Template_Parameter_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Owning_Template_Parameter
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Owning_Template_Parameter;
----------------------------
-- Get_Template_Parameter --
----------------------------
overriding function Get_Template_Parameter
(Self : not null access constant UML_Constraint_Proxy)
return AMF.UML.Template_Parameters.UML_Template_Parameter_Access is
begin
return
AMF.UML.Template_Parameters.UML_Template_Parameter_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Template_Parameter
(Self.Element)));
end Get_Template_Parameter;
----------------------------
-- Set_Template_Parameter --
----------------------------
overriding procedure Set_Template_Parameter
(Self : not null access UML_Constraint_Proxy;
To : AMF.UML.Template_Parameters.UML_Template_Parameter_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Template_Parameter
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Template_Parameter;
-------------------------
-- All_Owning_Packages --
-------------------------
overriding function All_Owning_Packages
(Self : not null access constant UML_Constraint_Proxy)
return AMF.UML.Packages.Collections.Set_Of_UML_Package is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "All_Owning_Packages unimplemented");
raise Program_Error with "Unimplemented procedure UML_Constraint_Proxy.All_Owning_Packages";
return All_Owning_Packages (Self);
end All_Owning_Packages;
-----------------------------
-- Is_Distinguishable_From --
-----------------------------
overriding function Is_Distinguishable_From
(Self : not null access constant UML_Constraint_Proxy;
N : AMF.UML.Named_Elements.UML_Named_Element_Access;
Ns : AMF.UML.Namespaces.UML_Namespace_Access)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Is_Distinguishable_From unimplemented");
raise Program_Error with "Unimplemented procedure UML_Constraint_Proxy.Is_Distinguishable_From";
return Is_Distinguishable_From (Self, N, Ns);
end Is_Distinguishable_From;
---------------
-- Namespace --
---------------
overriding function Namespace
(Self : not null access constant UML_Constraint_Proxy)
return AMF.UML.Namespaces.UML_Namespace_Access is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Namespace unimplemented");
raise Program_Error with "Unimplemented procedure UML_Constraint_Proxy.Namespace";
return Namespace (Self);
end Namespace;
------------------------
-- Is_Compatible_With --
------------------------
overriding function Is_Compatible_With
(Self : not null access constant UML_Constraint_Proxy;
P : AMF.UML.Parameterable_Elements.UML_Parameterable_Element_Access)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Is_Compatible_With unimplemented");
raise Program_Error with "Unimplemented procedure UML_Constraint_Proxy.Is_Compatible_With";
return Is_Compatible_With (Self, P);
end Is_Compatible_With;
---------------------------
-- Is_Template_Parameter --
---------------------------
overriding function Is_Template_Parameter
(Self : not null access constant UML_Constraint_Proxy)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Is_Template_Parameter unimplemented");
raise Program_Error with "Unimplemented procedure UML_Constraint_Proxy.Is_Template_Parameter";
return Is_Template_Parameter (Self);
end Is_Template_Parameter;
end AMF.Internals.UML_Constraints;
|
------------------------------------------------------------------------------
-- G E L A X A S I S --
-- ASIS implementation for Gela project, a portable Ada compiler --
-- http://gela.ada-ru.org --
-- - - - - - - - - - - - - - - - --
-- Read copyright and license at the end of this file --
------------------------------------------------------------------------------
-- $Revision: 209 $ $Date: 2013-11-30 21:03:24 +0200 (Сб., 30 нояб. 2013) $
with Asis.Definitions;
with Asis.Expressions;
package body XASIS.Static.Unsigned is
use Asis;
use XASIS.Integers;
use Asis.Expressions;
use XASIS.Static.Discrete;
function Modulus (Object : Type_Class) return Value;
function U
(Data : XASIS.Integers.Value;
Object : Type_Class) return Value;
function Eval
(Element : Asis.Expression;
Object : Type_Class) return Value;
----------
-- Eval --
----------
function Eval
(Element : Asis.Expression;
Object : Type_Class) return Value
is
Module : Value renames Modulus (Object);
Item : Value renames Evaluate (Element);
begin
if Is_Discrete (Module)
and then Is_Discrete (Item)
and then Item.Pos >= Module.Pos
then
Raise_Error (Exceed_Modulus);
end if;
return Item;
end Eval;
--------------
-- Evaluate --
--------------
function Evaluate
(Object : Type_Class;
Kind : Asis.Operator_Kinds;
Args : Asis.Association_List)
return Value
is
begin
case Kind is
when A_Unary_Plus_Operator | An_Abs_Operator =>
return Eval (Actual_Parameter (Args (1)), Object);
when A_Unary_Minus_Operator | A_Not_Operator =>
declare
Item : Value renames
Eval (Actual_Parameter (Args (1)), Object);
begin
if not Is_Discrete (Item) then
return Undefined;
elsif Kind = A_Unary_Minus_Operator then
return U (-Item.Pos, Object);
else
return U (-Item.Pos - One, Object);
end if;
end;
when A_Plus_Operator
| A_Minus_Operator
| A_Multiply_Operator
| A_Divide_Operator
| A_Mod_Operator
| A_Rem_Operator
| An_Exponentiate_Operator
=>
declare
Left : Value renames
Eval (Actual_Parameter (Args (1)), Object);
Right : Value renames
Eval (Actual_Parameter (Args (2)), Object);
begin
if Is_Discrete (Left) and Is_Discrete (Right) then
case Kind is
when A_Plus_Operator =>
return U (Left.Pos + Right.Pos, Object);
when A_Minus_Operator =>
return U (Left.Pos - Right.Pos, Object);
when A_Multiply_Operator =>
return U (Left.Pos * Right.Pos, Object);
when A_Divide_Operator =>
Check_Zero (Right);
return U (Left.Pos / Right.Pos, Object);
when A_Mod_Operator =>
Check_Zero (Right);
return U (Left.Pos mod Right.Pos, Object);
when A_Rem_Operator =>
Check_Zero (Right);
return U (Left.Pos rem Right.Pos, Object);
when An_Exponentiate_Operator =>
return U (Left.Pos ** Right.Pos, Object);
when others =>
null;
end case;
else
return Undefined;
end if;
end;
when others =>
return Evaluate (Discrete.Type_Class (Object), Kind, Args);
end case;
Raise_Error (Internal_Error);
return Undefined;
end Evaluate;
--------------
-- Evaluate --
--------------
function Evaluate
(Object : Type_Class;
Kind : Asis.Attribute_Kinds;
Args : Asis.Association_List) return Value is
begin
case Kind is
when A_Pred_Attribute =>
declare
Left : Value renames
Eval (Actual_Parameter (Args (1)), Object);
begin
if Is_Discrete (Left) then
return U (Left.Pos - XASIS.Integers.One, Object);
else
return Undefined;
end if;
end;
when A_Succ_Attribute =>
declare
Left : Value renames
Eval (Actual_Parameter (Args (1)), Object);
begin
if Is_Discrete (Left) then
return U (Left.Pos + XASIS.Integers.One, Object);
else
return Undefined;
end if;
end;
when A_Mod_Attribute =>
declare
Left : Value renames
Eval (Actual_Parameter (Args (1)), Object);
begin
if Is_Discrete (Left) then
return U (Left.Pos, Object);
else
return Undefined;
end if;
end;
when others =>
return Evaluate (Discrete.Type_Class (Object), Kind, Args);
end case;
end Evaluate;
--------------
-- Evaluate --
--------------
function Evaluate
(Object : Type_Class;
Kind : Asis.Attribute_Kinds;
Element : Asis.Expression) return Value is
begin
case Kind is
when A_Modulus_Attribute =>
return Modulus (Object);
when others =>
return Evaluate (Discrete.Type_Class (Object), Kind, Element);
end case;
end Evaluate;
-------------
-- Modulus --
-------------
function Modulus (Object : Type_Class) return Value is
use Asis.Definitions;
Def : constant Asis.Definition := Classes.Get_Definition (Object.Info);
begin
return Evaluate (Mod_Static_Expression (Def));
end Modulus;
-------
-- U --
-------
function U
(Data : XASIS.Integers.Value;
Object : Type_Class) return Value
is
Module : Value renames Modulus (Object);
begin
if Is_Discrete (Module) then
return I (Data mod Module.Pos);
else
return Undefined;
end if;
end U;
end XASIS.Static.Unsigned;
------------------------------------------------------------------------------
-- Copyright (c) 2006-2013, Maxim Reznik
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions are met:
--
-- * Redistributions of source code must retain the above copyright notice,
-- this list of conditions and the following disclaimer.
-- * Redistributions in binary form must reproduce the above copyright
-- notice, this list of conditions and the following disclaimer in the
-- documentation and/or other materials provided with the distribution.
-- * Neither the name of the Maxim Reznik, IE nor the names of its
-- contributors may be used to endorse or promote products derived from
-- this software without specific prior written permission.
--
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-- POSSIBILITY OF SUCH DAMAGE.
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
-- --
-- GNAT LIBRARY COMPONENTS --
-- --
-- ADA.CONTAINERS.BOUNDED_DOUBLY_LINKED_LISTS --
-- --
-- B o d y --
-- --
-- Copyright (C) 2004-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/>. --
-- --
-- This unit was originally developed by Matthew J Heaney. --
------------------------------------------------------------------------------
with System; use type System.Address;
with System.Put_Images;
package body Ada.Containers.Bounded_Doubly_Linked_Lists with
SPARK_Mode => Off
is
pragma Warnings (Off, "variable ""Busy*"" is not referenced");
pragma Warnings (Off, "variable ""Lock*"" is not referenced");
-- See comment in Ada.Containers.Helpers
-----------------------
-- Local Subprograms --
-----------------------
procedure Allocate
(Container : in out List;
New_Item : Element_Type;
New_Node : out Count_Type);
procedure Allocate
(Container : in out List;
Stream : not null access Root_Stream_Type'Class;
New_Node : out Count_Type);
procedure Free
(Container : in out List;
X : Count_Type);
procedure Insert_Internal
(Container : in out List;
Before : Count_Type;
New_Node : Count_Type);
procedure Splice_Internal
(Target : in out List;
Before : Count_Type;
Source : in out List);
procedure Splice_Internal
(Target : in out List;
Before : Count_Type;
Source : in out List;
Src_Pos : Count_Type;
Tgt_Pos : out Count_Type);
function Vet (Position : Cursor) return Boolean;
-- Checks invariants of the cursor and its designated container, as a
-- simple way of detecting dangling references (see operation Free for a
-- description of the detection mechanism), returning True if all checks
-- pass. Invocations of Vet are used here as the argument of pragma Assert,
-- so the checks are performed only when assertions are enabled.
---------
-- "=" --
---------
function "=" (Left, Right : List) return Boolean is
begin
if Left.Length /= Right.Length then
return False;
end if;
if Left.Length = 0 then
return True;
end if;
declare
-- Per AI05-0022, the container implementation is required to detect
-- element tampering by a generic actual subprogram.
Lock_Left : With_Lock (Left.TC'Unrestricted_Access);
Lock_Right : With_Lock (Right.TC'Unrestricted_Access);
LN : Node_Array renames Left.Nodes;
RN : Node_Array renames Right.Nodes;
LI : Count_Type := Left.First;
RI : Count_Type := Right.First;
begin
for J in 1 .. Left.Length loop
if LN (LI).Element /= RN (RI).Element then
return False;
end if;
LI := LN (LI).Next;
RI := RN (RI).Next;
end loop;
end;
return True;
end "=";
--------------
-- Allocate --
--------------
procedure Allocate
(Container : in out List;
New_Item : Element_Type;
New_Node : out Count_Type)
is
N : Node_Array renames Container.Nodes;
begin
if Container.Free >= 0 then
New_Node := Container.Free;
-- We always perform the assignment first, before we change container
-- state, in order to defend against exceptions duration assignment.
N (New_Node).Element := New_Item;
Container.Free := N (New_Node).Next;
else
-- A negative free store value means that the links of the nodes in
-- the free store have not been initialized. In this case, the nodes
-- are physically contiguous in the array, starting at the index that
-- is the absolute value of the Container.Free, and continuing until
-- the end of the array (Nodes'Last).
New_Node := abs Container.Free;
-- As above, we perform this assignment first, before modifying any
-- container state.
N (New_Node).Element := New_Item;
Container.Free := Container.Free - 1;
end if;
end Allocate;
procedure Allocate
(Container : in out List;
Stream : not null access Root_Stream_Type'Class;
New_Node : out Count_Type)
is
N : Node_Array renames Container.Nodes;
begin
if Container.Free >= 0 then
New_Node := Container.Free;
-- We always perform the assignment first, before we change container
-- state, in order to defend against exceptions duration assignment.
Element_Type'Read (Stream, N (New_Node).Element);
Container.Free := N (New_Node).Next;
else
-- A negative free store value means that the links of the nodes in
-- the free store have not been initialized. In this case, the nodes
-- are physically contiguous in the array, starting at the index that
-- is the absolute value of the Container.Free, and continuing until
-- the end of the array (Nodes'Last).
New_Node := abs Container.Free;
-- As above, we perform this assignment first, before modifying any
-- container state.
Element_Type'Read (Stream, N (New_Node).Element);
Container.Free := Container.Free - 1;
end if;
end Allocate;
------------
-- Append --
------------
procedure Append
(Container : in out List;
New_Item : Element_Type;
Count : Count_Type)
is
begin
Insert (Container, No_Element, New_Item, Count);
end Append;
procedure Append
(Container : in out List;
New_Item : Element_Type)
is
begin
Insert (Container, No_Element, New_Item, 1);
end Append;
------------
-- Assign --
------------
procedure Assign (Target : in out List; Source : List) is
SN : Node_Array renames Source.Nodes;
J : Count_Type;
begin
if Target'Address = Source'Address then
return;
end if;
if Checks and then Target.Capacity < Source.Length then
raise Capacity_Error -- ???
with "Target capacity is less than Source length";
end if;
Target.Clear;
J := Source.First;
while J /= 0 loop
Target.Append (SN (J).Element);
J := SN (J).Next;
end loop;
end Assign;
-----------
-- Clear --
-----------
procedure Clear (Container : in out List) is
N : Node_Array renames Container.Nodes;
X : Count_Type;
begin
if Container.Length = 0 then
pragma Assert (Container.First = 0);
pragma Assert (Container.Last = 0);
pragma Assert (Container.TC = (Busy => 0, Lock => 0));
return;
end if;
pragma Assert (Container.First >= 1);
pragma Assert (Container.Last >= 1);
pragma Assert (N (Container.First).Prev = 0);
pragma Assert (N (Container.Last).Next = 0);
TC_Check (Container.TC);
while Container.Length > 1 loop
X := Container.First;
pragma Assert (N (N (X).Next).Prev = Container.First);
Container.First := N (X).Next;
N (Container.First).Prev := 0;
Container.Length := Container.Length - 1;
Free (Container, X);
end loop;
X := Container.First;
pragma Assert (X = Container.Last);
Container.First := 0;
Container.Last := 0;
Container.Length := 0;
Free (Container, X);
end Clear;
------------------------
-- Constant_Reference --
------------------------
function Constant_Reference
(Container : aliased List;
Position : Cursor) return Constant_Reference_Type
is
begin
if Checks and then Position.Container = null then
raise Constraint_Error with "Position cursor has no element";
end if;
if Checks and then Position.Container /= Container'Unrestricted_Access
then
raise Program_Error with
"Position cursor designates wrong container";
end if;
pragma Assert (Vet (Position), "bad cursor in Constant_Reference");
declare
N : Node_Type renames Container.Nodes (Position.Node);
TC : constant Tamper_Counts_Access :=
Container.TC'Unrestricted_Access;
begin
return R : constant Constant_Reference_Type :=
(Element => N.Element'Access,
Control => (Controlled with TC))
do
Busy (TC.all);
end return;
end;
end Constant_Reference;
--------------
-- Contains --
--------------
function Contains
(Container : List;
Item : Element_Type) return Boolean
is
begin
return Find (Container, Item) /= No_Element;
end Contains;
----------
-- Copy --
----------
function Copy (Source : List; Capacity : Count_Type := 0) return List is
C : Count_Type;
begin
if Capacity < Source.Length then
if Checks and then Capacity /= 0 then
raise Capacity_Error
with "Requested capacity is less than Source length";
end if;
C := Source.Length;
else
C := Capacity;
end if;
return Target : List (Capacity => C) do
Assign (Target => Target, Source => Source);
end return;
end Copy;
------------
-- Delete --
------------
procedure Delete
(Container : in out List;
Position : in out Cursor;
Count : Count_Type := 1)
is
N : Node_Array renames Container.Nodes;
X : Count_Type;
begin
TC_Check (Container.TC);
if Checks and then Position.Node = 0 then
raise Constraint_Error with
"Position cursor has no element";
end if;
if Checks and then Position.Container /= Container'Unrestricted_Access
then
raise Program_Error with
"Position cursor designates wrong container";
end if;
pragma Assert (Vet (Position), "bad cursor in Delete");
pragma Assert (Container.First >= 1);
pragma Assert (Container.Last >= 1);
pragma Assert (N (Container.First).Prev = 0);
pragma Assert (N (Container.Last).Next = 0);
if Position.Node = Container.First then
Delete_First (Container, Count);
Position := No_Element;
return;
end if;
if Count = 0 then
Position := No_Element;
return;
end if;
for Index in 1 .. Count loop
pragma Assert (Container.Length >= 2);
X := Position.Node;
Container.Length := Container.Length - 1;
if X = Container.Last then
Position := No_Element;
Container.Last := N (X).Prev;
N (Container.Last).Next := 0;
Free (Container, X);
return;
end if;
Position.Node := N (X).Next;
N (N (X).Next).Prev := N (X).Prev;
N (N (X).Prev).Next := N (X).Next;
Free (Container, X);
end loop;
Position := No_Element;
end Delete;
------------------
-- Delete_First --
------------------
procedure Delete_First
(Container : in out List;
Count : Count_Type := 1)
is
N : Node_Array renames Container.Nodes;
X : Count_Type;
begin
TC_Check (Container.TC);
if Count >= Container.Length then
Clear (Container);
return;
end if;
if Count = 0 then
return;
end if;
for J in 1 .. Count loop
X := Container.First;
pragma Assert (N (N (X).Next).Prev = Container.First);
Container.First := N (X).Next;
N (Container.First).Prev := 0;
Container.Length := Container.Length - 1;
Free (Container, X);
end loop;
end Delete_First;
-----------------
-- Delete_Last --
-----------------
procedure Delete_Last
(Container : in out List;
Count : Count_Type := 1)
is
N : Node_Array renames Container.Nodes;
X : Count_Type;
begin
TC_Check (Container.TC);
if Count >= Container.Length then
Clear (Container);
return;
end if;
if Count = 0 then
return;
end if;
for J in 1 .. Count loop
X := Container.Last;
pragma Assert (N (N (X).Prev).Next = Container.Last);
Container.Last := N (X).Prev;
N (Container.Last).Next := 0;
Container.Length := Container.Length - 1;
Free (Container, X);
end loop;
end Delete_Last;
-------------
-- Element --
-------------
function Element (Position : Cursor) return Element_Type is
begin
if Checks and then Position.Node = 0 then
raise Constraint_Error with
"Position cursor has no element";
end if;
pragma Assert (Vet (Position), "bad cursor in Element");
return Position.Container.Nodes (Position.Node).Element;
end Element;
-----------
-- Empty --
-----------
function Empty (Capacity : Count_Type := 10) return List is
begin
return Result : List (Capacity) do
null;
end return;
end Empty;
--------------
-- Finalize --
--------------
procedure Finalize (Object : in out Iterator) is
begin
if Object.Container /= null then
Unbusy (Object.Container.TC);
end if;
end Finalize;
----------
-- Find --
----------
function Find
(Container : List;
Item : Element_Type;
Position : Cursor := No_Element) return Cursor
is
Nodes : Node_Array renames Container.Nodes;
Node : Count_Type := Position.Node;
begin
if Node = 0 then
Node := Container.First;
else
if Checks and then Position.Container /= Container'Unrestricted_Access
then
raise Program_Error with
"Position cursor designates wrong container";
end if;
pragma Assert (Vet (Position), "bad cursor in Find");
end if;
-- Per AI05-0022, the container implementation is required to detect
-- element tampering by a generic actual subprogram.
declare
Lock : With_Lock (Container.TC'Unrestricted_Access);
begin
while Node /= 0 loop
if Nodes (Node).Element = Item then
return Cursor'(Container'Unrestricted_Access, Node);
end if;
Node := Nodes (Node).Next;
end loop;
return No_Element;
end;
end Find;
-----------
-- First --
-----------
function First (Container : List) return Cursor is
begin
if Container.First = 0 then
return No_Element;
else
return Cursor'(Container'Unrestricted_Access, Container.First);
end if;
end First;
function First (Object : Iterator) return Cursor is
begin
-- The value of the iterator object's Node component influences the
-- behavior of the First (and Last) selector function.
-- When the Node component is 0, this means the iterator object was
-- constructed without a start expression, in which case the (forward)
-- iteration starts from the (logical) beginning of the entire sequence
-- of items (corresponding to Container.First, for a forward iterator).
-- Otherwise, this is iteration over a partial sequence of items. When
-- the Node component is positive, the iterator object was constructed
-- with a start expression, that specifies the position from which the
-- (forward) partial iteration begins.
if Object.Node = 0 then
return Bounded_Doubly_Linked_Lists.First (Object.Container.all);
else
return Cursor'(Object.Container, Object.Node);
end if;
end First;
-------------------
-- First_Element --
-------------------
function First_Element (Container : List) return Element_Type is
begin
if Checks and then Container.First = 0 then
raise Constraint_Error with "list is empty";
end if;
return Container.Nodes (Container.First).Element;
end First_Element;
----------
-- Free --
----------
procedure Free
(Container : in out List;
X : Count_Type)
is
pragma Assert (X > 0);
pragma Assert (X <= Container.Capacity);
N : Node_Array renames Container.Nodes;
pragma Assert (N (X).Prev >= 0); -- node is active
begin
-- The list container actually contains two lists: one for the "active"
-- nodes that contain elements that have been inserted onto the list,
-- and another for the "inactive" nodes for the free store.
-- We desire that merely declaring an object should have only minimal
-- cost; specially, we want to avoid having to initialize the free
-- store (to fill in the links), especially if the capacity is large.
-- The head of the free list is indicated by Container.Free. If its
-- value is non-negative, then the free store has been initialized in
-- the "normal" way: Container.Free points to the head of the list of
-- free (inactive) nodes, and the value 0 means the free list is empty.
-- Each node on the free list has been initialized to point to the next
-- free node (via its Next component), and the value 0 means that this
-- is the last free node.
-- If Container.Free is negative, then the links on the free store have
-- not been initialized. In this case the link values are implied: the
-- free store comprises the components of the node array started with
-- the absolute value of Container.Free, and continuing until the end of
-- the array (Nodes'Last).
-- If the list container is manipulated on one end only (for example if
-- the container were being used as a stack), then there is no need to
-- initialize the free store, since the inactive nodes are physically
-- contiguous (in fact, they lie immediately beyond the logical end
-- being manipulated). The only time we need to actually initialize the
-- nodes in the free store is if the node that becomes inactive is not
-- at the end of the list. The free store would then be discontiguous
-- and so its nodes would need to be linked in the traditional way.
-- ???
-- It might be possible to perform an optimization here. Suppose that
-- the free store can be represented as having two parts: one comprising
-- the non-contiguous inactive nodes linked together in the normal way,
-- and the other comprising the contiguous inactive nodes (that are not
-- linked together, at the end of the nodes array). This would allow us
-- to never have to initialize the free store, except in a lazy way as
-- nodes become inactive.
-- When an element is deleted from the list container, its node becomes
-- inactive, and so we set its Prev component to a negative value, to
-- indicate that it is now inactive. This provides a useful way to
-- detect a dangling cursor reference (and which is used in Vet).
N (X).Prev := -1; -- Node is deallocated (not on active list)
if Container.Free >= 0 then
-- The free store has previously been initialized. All we need to
-- do here is link the newly-free'd node onto the free list.
N (X).Next := Container.Free;
Container.Free := X;
elsif X + 1 = abs Container.Free then
-- The free store has not been initialized, and the node becoming
-- inactive immediately precedes the start of the free store. All
-- we need to do is move the start of the free store back by one.
-- Note: initializing Next to zero is not strictly necessary but
-- seems cleaner and marginally safer.
N (X).Next := 0;
Container.Free := Container.Free + 1;
else
-- The free store has not been initialized, and the node becoming
-- inactive does not immediately precede the free store. Here we
-- first initialize the free store (meaning the links are given
-- values in the traditional way), and then link the newly-free'd
-- node onto the head of the free store.
-- ???
-- See the comments above for an optimization opportunity. If the
-- next link for a node on the free store is negative, then this
-- means the remaining nodes on the free store are physically
-- contiguous, starting as the absolute value of that index value.
Container.Free := abs Container.Free;
if Container.Free > Container.Capacity then
Container.Free := 0;
else
for I in Container.Free .. Container.Capacity - 1 loop
N (I).Next := I + 1;
end loop;
N (Container.Capacity).Next := 0;
end if;
N (X).Next := Container.Free;
Container.Free := X;
end if;
end Free;
---------------------
-- Generic_Sorting --
---------------------
package body Generic_Sorting is
---------------
-- Is_Sorted --
---------------
function Is_Sorted (Container : List) return Boolean is
-- Per AI05-0022, the container implementation is required to detect
-- element tampering by a generic actual subprogram.
Lock : With_Lock (Container.TC'Unrestricted_Access);
Nodes : Node_Array renames Container.Nodes;
Node : Count_Type;
begin
Node := Container.First;
for J in 2 .. Container.Length loop
if Nodes (Nodes (Node).Next).Element < Nodes (Node).Element then
return False;
end if;
Node := Nodes (Node).Next;
end loop;
return True;
end Is_Sorted;
-----------
-- Merge --
-----------
procedure Merge
(Target : in out List;
Source : in out List)
is
begin
TC_Check (Target.TC);
TC_Check (Source.TC);
-- The semantics of Merge changed slightly per AI05-0021. It was
-- originally the case that if Target and Source denoted the same
-- container object, then the GNAT implementation of Merge did
-- nothing. However, it was argued that RM05 did not precisely
-- specify the semantics for this corner case. The decision of the
-- ARG was that if Target and Source denote the same non-empty
-- container object, then Program_Error is raised.
if Source.Is_Empty then
return;
end if;
if Checks and then Target'Address = Source'Address then
raise Program_Error with
"Target and Source denote same non-empty container";
end if;
if Checks and then Target.Length > Count_Type'Last - Source.Length
then
raise Constraint_Error with "new length exceeds maximum";
end if;
if Checks and then Target.Length + Source.Length > Target.Capacity
then
raise Capacity_Error with "new length exceeds target capacity";
end if;
-- Per AI05-0022, the container implementation is required to detect
-- element tampering by a generic actual subprogram.
declare
Lock_Target : With_Lock (Target.TC'Unchecked_Access);
Lock_Source : With_Lock (Source.TC'Unchecked_Access);
LN : Node_Array renames Target.Nodes;
RN : Node_Array renames Source.Nodes;
LI, LJ, RI, RJ : Count_Type;
begin
LI := Target.First;
RI := Source.First;
while RI /= 0 loop
pragma Assert (RN (RI).Next = 0
or else not (RN (RN (RI).Next).Element <
RN (RI).Element));
if LI = 0 then
Splice_Internal (Target, 0, Source);
exit;
end if;
pragma Assert (LN (LI).Next = 0
or else not (LN (LN (LI).Next).Element <
LN (LI).Element));
if RN (RI).Element < LN (LI).Element then
RJ := RI;
RI := RN (RI).Next;
Splice_Internal (Target, LI, Source, RJ, LJ);
else
LI := LN (LI).Next;
end if;
end loop;
end;
end Merge;
----------
-- Sort --
----------
procedure Sort (Container : in out List) is
N : Node_Array renames Container.Nodes;
procedure Partition (Pivot, Back : Count_Type);
-- What does this do ???
procedure Sort (Front, Back : Count_Type);
-- Internal procedure, what does it do??? rename it???
---------------
-- Partition --
---------------
procedure Partition (Pivot, Back : Count_Type) is
Node : Count_Type;
begin
Node := N (Pivot).Next;
while Node /= Back loop
if N (Node).Element < N (Pivot).Element then
declare
Prev : constant Count_Type := N (Node).Prev;
Next : constant Count_Type := N (Node).Next;
begin
N (Prev).Next := Next;
if Next = 0 then
Container.Last := Prev;
else
N (Next).Prev := Prev;
end if;
N (Node).Next := Pivot;
N (Node).Prev := N (Pivot).Prev;
N (Pivot).Prev := Node;
if N (Node).Prev = 0 then
Container.First := Node;
else
N (N (Node).Prev).Next := Node;
end if;
Node := Next;
end;
else
Node := N (Node).Next;
end if;
end loop;
end Partition;
----------
-- Sort --
----------
procedure Sort (Front, Back : Count_Type) is
Pivot : constant Count_Type :=
(if Front = 0 then Container.First else N (Front).Next);
begin
if Pivot /= Back then
Partition (Pivot, Back);
Sort (Front, Pivot);
Sort (Pivot, Back);
end if;
end Sort;
-- Start of processing for Sort
begin
if Container.Length <= 1 then
return;
end if;
pragma Assert (N (Container.First).Prev = 0);
pragma Assert (N (Container.Last).Next = 0);
TC_Check (Container.TC);
-- Per AI05-0022, the container implementation is required to detect
-- element tampering by a generic actual subprogram.
declare
Lock : With_Lock (Container.TC'Unchecked_Access);
begin
Sort (Front => 0, Back => 0);
end;
pragma Assert (N (Container.First).Prev = 0);
pragma Assert (N (Container.Last).Next = 0);
end Sort;
end Generic_Sorting;
------------------------
-- Get_Element_Access --
------------------------
function Get_Element_Access
(Position : Cursor) return not null Element_Access is
begin
return Position.Container.Nodes (Position.Node).Element'Access;
end Get_Element_Access;
-----------------
-- Has_Element --
-----------------
function Has_Element (Position : Cursor) return Boolean is
begin
pragma Assert (Vet (Position), "bad cursor in Has_Element");
return Position.Node /= 0;
end Has_Element;
------------
-- Insert --
------------
procedure Insert
(Container : in out List;
Before : Cursor;
New_Item : Element_Type;
Position : out Cursor;
Count : Count_Type := 1)
is
First_Node : Count_Type;
New_Node : Count_Type;
begin
TC_Check (Container.TC);
if Before.Container /= null then
if Checks and then Before.Container /= Container'Unrestricted_Access
then
raise Program_Error with
"Before cursor designates wrong list";
end if;
pragma Assert (Vet (Before), "bad cursor in Insert");
end if;
if Count = 0 then
Position := Before;
return;
end if;
if Checks and then Container.Length > Container.Capacity - Count then
raise Capacity_Error with "capacity exceeded";
end if;
Allocate (Container, New_Item, New_Node);
First_Node := New_Node;
Insert_Internal (Container, Before.Node, New_Node);
for Index in Count_Type'(2) .. Count loop
Allocate (Container, New_Item, New_Node);
Insert_Internal (Container, Before.Node, New_Node);
end loop;
Position := Cursor'(Container'Unchecked_Access, First_Node);
end Insert;
procedure Insert
(Container : in out List;
Before : Cursor;
New_Item : Element_Type;
Count : Count_Type := 1)
is
Position : Cursor;
pragma Unreferenced (Position);
begin
Insert (Container, Before, New_Item, Position, Count);
end Insert;
procedure Insert
(Container : in out List;
Before : Cursor;
Position : out Cursor;
Count : Count_Type := 1)
is
pragma Warnings (Off);
Default_Initialized_Item : Element_Type;
pragma Unmodified (Default_Initialized_Item);
-- OK to reference, see below. Note that we need to suppress both the
-- front end warning and the back end warning. In addition, pragma
-- Unmodified is needed to suppress the warning ``actual type for
-- "Element_Type" should be fully initialized type'' on certain
-- instantiations.
begin
-- There is no explicit element provided, but in an instance the element
-- type may be a scalar with a Default_Value aspect, or a composite
-- type with such a scalar component, or components with default
-- initialization, so insert the specified number of possibly
-- initialized elements at the given position.
Insert (Container, Before, Default_Initialized_Item, Position, Count);
pragma Warnings (On);
end Insert;
---------------------
-- Insert_Internal --
---------------------
procedure Insert_Internal
(Container : in out List;
Before : Count_Type;
New_Node : Count_Type)
is
N : Node_Array renames Container.Nodes;
begin
if Container.Length = 0 then
pragma Assert (Before = 0);
pragma Assert (Container.First = 0);
pragma Assert (Container.Last = 0);
Container.First := New_Node;
N (Container.First).Prev := 0;
Container.Last := New_Node;
N (Container.Last).Next := 0;
-- Before = zero means append
elsif Before = 0 then
pragma Assert (N (Container.Last).Next = 0);
N (Container.Last).Next := New_Node;
N (New_Node).Prev := Container.Last;
Container.Last := New_Node;
N (Container.Last).Next := 0;
-- Before = Container.First means prepend
elsif Before = Container.First then
pragma Assert (N (Container.First).Prev = 0);
N (Container.First).Prev := New_Node;
N (New_Node).Next := Container.First;
Container.First := New_Node;
N (Container.First).Prev := 0;
else
pragma Assert (N (Container.First).Prev = 0);
pragma Assert (N (Container.Last).Next = 0);
N (New_Node).Next := Before;
N (New_Node).Prev := N (Before).Prev;
N (N (Before).Prev).Next := New_Node;
N (Before).Prev := New_Node;
end if;
Container.Length := Container.Length + 1;
end Insert_Internal;
--------------
-- Is_Empty --
--------------
function Is_Empty (Container : List) return Boolean is
begin
return Container.Length = 0;
end Is_Empty;
-------------
-- Iterate --
-------------
procedure Iterate
(Container : List;
Process : not null access procedure (Position : Cursor))
is
Busy : With_Busy (Container.TC'Unrestricted_Access);
Node : Count_Type := Container.First;
begin
while Node /= 0 loop
Process (Cursor'(Container'Unrestricted_Access, Node));
Node := Container.Nodes (Node).Next;
end loop;
end Iterate;
function Iterate
(Container : List)
return List_Iterator_Interfaces.Reversible_Iterator'Class
is
begin
-- The value of the Node component influences the behavior of the First
-- and Last selector functions of the iterator object. When the Node
-- component is 0 (as is the case here), this means the iterator
-- object was constructed without a start expression. This is a
-- complete iterator, meaning that the iteration starts from the
-- (logical) beginning of the sequence of items.
-- Note: For a forward iterator, Container.First is the beginning, and
-- for a reverse iterator, Container.Last is the beginning.
return It : constant Iterator :=
Iterator'(Limited_Controlled with
Container => Container'Unrestricted_Access,
Node => 0)
do
Busy (Container.TC'Unrestricted_Access.all);
end return;
end Iterate;
function Iterate
(Container : List;
Start : Cursor)
return List_Iterator_Interfaces.Reversible_Iterator'class
is
begin
-- It was formerly the case that when Start = No_Element, the partial
-- iterator was defined to behave the same as for a complete iterator,
-- and iterate over the entire sequence of items. However, those
-- semantics were unintuitive and arguably error-prone (it is too easy
-- to accidentally create an endless loop), and so they were changed,
-- per the ARG meeting in Denver on 2011/11. However, there was no
-- consensus about what positive meaning this corner case should have,
-- and so it was decided to simply raise an exception. This does imply,
-- however, that it is not possible to use a partial iterator to specify
-- an empty sequence of items.
if Checks and then Start = No_Element then
raise Constraint_Error with
"Start position for iterator equals No_Element";
end if;
if Checks and then Start.Container /= Container'Unrestricted_Access then
raise Program_Error with
"Start cursor of Iterate designates wrong list";
end if;
pragma Assert (Vet (Start), "Start cursor of Iterate is bad");
-- The value of the Node component influences the behavior of the First
-- and Last selector functions of the iterator object. When the Node
-- component is positive (as is the case here), it means that this
-- is a partial iteration, over a subset of the complete sequence of
-- items. The iterator object was constructed with a start expression,
-- indicating the position from which the iteration begins. Note that
-- the start position has the same value irrespective of whether this
-- is a forward or reverse iteration.
return It : constant Iterator :=
Iterator'(Limited_Controlled with
Container => Container'Unrestricted_Access,
Node => Start.Node)
do
Busy (Container.TC'Unrestricted_Access.all);
end return;
end Iterate;
----------
-- Last --
----------
function Last (Container : List) return Cursor is
begin
if Container.Last = 0 then
return No_Element;
else
return Cursor'(Container'Unrestricted_Access, Container.Last);
end if;
end Last;
function Last (Object : Iterator) return Cursor is
begin
-- The value of the iterator object's Node component influences the
-- behavior of the Last (and First) selector function.
-- When the Node component is 0, this means the iterator object was
-- constructed without a start expression, in which case the (reverse)
-- iteration starts from the (logical) beginning of the entire sequence
-- (corresponding to Container.Last, for a reverse iterator).
-- Otherwise, this is iteration over a partial sequence of items. When
-- the Node component is positive, the iterator object was constructed
-- with a start expression, that specifies the position from which the
-- (reverse) partial iteration begins.
if Object.Node = 0 then
return Bounded_Doubly_Linked_Lists.Last (Object.Container.all);
else
return Cursor'(Object.Container, Object.Node);
end if;
end Last;
------------------
-- Last_Element --
------------------
function Last_Element (Container : List) return Element_Type is
begin
if Checks and then Container.Last = 0 then
raise Constraint_Error with "list is empty";
end if;
return Container.Nodes (Container.Last).Element;
end Last_Element;
------------
-- Length --
------------
function Length (Container : List) return Count_Type is
begin
return Container.Length;
end Length;
----------
-- Move --
----------
procedure Move
(Target : in out List;
Source : in out List)
is
N : Node_Array renames Source.Nodes;
X : Count_Type;
begin
TC_Check (Source.TC);
if Target'Address = Source'Address then
return;
end if;
if Checks and then Target.Capacity < Source.Length then
raise Capacity_Error with "Source length exceeds Target capacity";
end if;
-- Clear target, note that this checks busy bits of Target
Clear (Target);
while Source.Length > 1 loop
pragma Assert (Source.First in 1 .. Source.Capacity);
pragma Assert (Source.Last /= Source.First);
pragma Assert (N (Source.First).Prev = 0);
pragma Assert (N (Source.Last).Next = 0);
-- Copy first element from Source to Target
X := Source.First;
Append (Target, N (X).Element);
-- Unlink first node of Source
Source.First := N (X).Next;
N (Source.First).Prev := 0;
Source.Length := Source.Length - 1;
-- The representation invariants for Source have been restored. It is
-- now safe to free the unlinked node, without fear of corrupting the
-- active links of Source.
-- Note that the algorithm we use here models similar algorithms used
-- in the unbounded form of the doubly-linked list container. In that
-- case, Free is an instantation of Unchecked_Deallocation, which can
-- fail (because PE will be raised if controlled Finalize fails), so
-- we must defer the call until the last step. Here in the bounded
-- form, Free merely links the node we have just "deallocated" onto a
-- list of inactive nodes, so technically Free cannot fail. However,
-- for consistency, we handle Free the same way here as we do for the
-- unbounded form, with the pessimistic assumption that it can fail.
Free (Source, X);
end loop;
if Source.Length = 1 then
pragma Assert (Source.First in 1 .. Source.Capacity);
pragma Assert (Source.Last = Source.First);
pragma Assert (N (Source.First).Prev = 0);
pragma Assert (N (Source.Last).Next = 0);
-- Copy element from Source to Target
X := Source.First;
Append (Target, N (X).Element);
-- Unlink node of Source
Source.First := 0;
Source.Last := 0;
Source.Length := 0;
-- Return the unlinked node to the free store
Free (Source, X);
end if;
end Move;
----------
-- Next --
----------
procedure Next (Position : in out Cursor) is
begin
Position := Next (Position);
end Next;
function Next (Position : Cursor) return Cursor is
begin
if Position.Node = 0 then
return No_Element;
end if;
pragma Assert (Vet (Position), "bad cursor in Next");
declare
Nodes : Node_Array renames Position.Container.Nodes;
Node : constant Count_Type := Nodes (Position.Node).Next;
begin
if Node = 0 then
return No_Element;
else
return Cursor'(Position.Container, Node);
end if;
end;
end Next;
function Next
(Object : Iterator;
Position : Cursor) return Cursor
is
begin
if Position.Container = null then
return No_Element;
end if;
if Checks and then Position.Container /= Object.Container then
raise Program_Error with
"Position cursor of Next designates wrong list";
end if;
return Next (Position);
end Next;
-------------
-- Prepend --
-------------
procedure Prepend
(Container : in out List;
New_Item : Element_Type;
Count : Count_Type := 1)
is
begin
Insert (Container, First (Container), New_Item, Count);
end Prepend;
--------------
-- Previous --
--------------
procedure Previous (Position : in out Cursor) is
begin
Position := Previous (Position);
end Previous;
function Previous (Position : Cursor) return Cursor is
begin
if Position.Node = 0 then
return No_Element;
end if;
pragma Assert (Vet (Position), "bad cursor in Previous");
declare
Nodes : Node_Array renames Position.Container.Nodes;
Node : constant Count_Type := Nodes (Position.Node).Prev;
begin
if Node = 0 then
return No_Element;
else
return Cursor'(Position.Container, Node);
end if;
end;
end Previous;
function Previous
(Object : Iterator;
Position : Cursor) return Cursor
is
begin
if Position.Container = null then
return No_Element;
end if;
if Checks and then Position.Container /= Object.Container then
raise Program_Error with
"Position cursor of Previous designates wrong list";
end if;
return Previous (Position);
end Previous;
----------------------
-- Pseudo_Reference --
----------------------
function Pseudo_Reference
(Container : aliased List'Class) return Reference_Control_Type
is
TC : constant Tamper_Counts_Access := Container.TC'Unrestricted_Access;
begin
return R : constant Reference_Control_Type := (Controlled with TC) do
Busy (TC.all);
end return;
end Pseudo_Reference;
-------------------
-- Query_Element --
-------------------
procedure Query_Element
(Position : Cursor;
Process : not null access procedure (Element : Element_Type))
is
begin
if Checks and then Position.Node = 0 then
raise Constraint_Error with
"Position cursor has no element";
end if;
pragma Assert (Vet (Position), "bad cursor in Query_Element");
declare
Lock : With_Lock (Position.Container.TC'Unrestricted_Access);
C : List renames Position.Container.all'Unrestricted_Access.all;
N : Node_Type renames C.Nodes (Position.Node);
begin
Process (N.Element);
end;
end Query_Element;
---------------
-- Put_Image --
---------------
procedure Put_Image
(S : in out Ada.Strings.Text_Buffers.Root_Buffer_Type'Class; V : List)
is
First_Time : Boolean := True;
use System.Put_Images;
begin
Array_Before (S);
for X of V loop
if First_Time then
First_Time := False;
else
Simple_Array_Between (S);
end if;
Element_Type'Put_Image (S, X);
end loop;
Array_After (S);
end Put_Image;
----------
-- Read --
----------
procedure Read
(Stream : not null access Root_Stream_Type'Class;
Item : out List)
is
N : Count_Type'Base;
X : Count_Type;
begin
Clear (Item);
Count_Type'Base'Read (Stream, N);
if Checks and then N < 0 then
raise Program_Error with "bad list length (corrupt stream)";
end if;
if N = 0 then
return;
end if;
if Checks and then N > Item.Capacity then
raise Constraint_Error with "length exceeds capacity";
end if;
for Idx in 1 .. N loop
Allocate (Item, Stream, New_Node => X);
Insert_Internal (Item, Before => 0, New_Node => X);
end loop;
end Read;
procedure Read
(Stream : not null access Root_Stream_Type'Class;
Item : out Cursor)
is
begin
raise Program_Error with "attempt to stream list cursor";
end Read;
procedure Read
(Stream : not null access Root_Stream_Type'Class;
Item : out Reference_Type)
is
begin
raise Program_Error with "attempt to stream reference";
end Read;
procedure Read
(Stream : not null access Root_Stream_Type'Class;
Item : out Constant_Reference_Type)
is
begin
raise Program_Error with "attempt to stream reference";
end Read;
---------------
-- Reference --
---------------
function Reference
(Container : aliased in out List;
Position : Cursor) return Reference_Type
is
begin
if Checks and then Position.Container = null then
raise Constraint_Error with "Position cursor has no element";
end if;
if Checks and then Position.Container /= Container'Unrestricted_Access
then
raise Program_Error with
"Position cursor designates wrong container";
end if;
pragma Assert (Vet (Position), "bad cursor in function Reference");
declare
N : Node_Type renames Container.Nodes (Position.Node);
TC : constant Tamper_Counts_Access :=
Container.TC'Unrestricted_Access;
begin
return R : constant Reference_Type :=
(Element => N.Element'Access,
Control => (Controlled with TC))
do
Busy (TC.all);
end return;
end;
end Reference;
---------------------
-- Replace_Element --
---------------------
procedure Replace_Element
(Container : in out List;
Position : Cursor;
New_Item : Element_Type)
is
begin
TE_Check (Container.TC);
if Checks and then Position.Container = null then
raise Constraint_Error with "Position cursor has no element";
end if;
if Checks and then Position.Container /= Container'Unchecked_Access then
raise Program_Error with
"Position cursor designates wrong container";
end if;
pragma Assert (Vet (Position), "bad cursor in Replace_Element");
Container.Nodes (Position.Node).Element := New_Item;
end Replace_Element;
----------------------
-- Reverse_Elements --
----------------------
procedure Reverse_Elements (Container : in out List) is
N : Node_Array renames Container.Nodes;
I : Count_Type := Container.First;
J : Count_Type := Container.Last;
procedure Swap (L, R : Count_Type);
----------
-- Swap --
----------
procedure Swap (L, R : Count_Type) is
LN : constant Count_Type := N (L).Next;
LP : constant Count_Type := N (L).Prev;
RN : constant Count_Type := N (R).Next;
RP : constant Count_Type := N (R).Prev;
begin
if LP /= 0 then
N (LP).Next := R;
end if;
if RN /= 0 then
N (RN).Prev := L;
end if;
N (L).Next := RN;
N (R).Prev := LP;
if LN = R then
pragma Assert (RP = L);
N (L).Prev := R;
N (R).Next := L;
else
N (L).Prev := RP;
N (RP).Next := L;
N (R).Next := LN;
N (LN).Prev := R;
end if;
end Swap;
-- Start of processing for Reverse_Elements
begin
if Container.Length <= 1 then
return;
end if;
pragma Assert (N (Container.First).Prev = 0);
pragma Assert (N (Container.Last).Next = 0);
TC_Check (Container.TC);
Container.First := J;
Container.Last := I;
loop
Swap (L => I, R => J);
J := N (J).Next;
exit when I = J;
I := N (I).Prev;
exit when I = J;
Swap (L => J, R => I);
I := N (I).Next;
exit when I = J;
J := N (J).Prev;
exit when I = J;
end loop;
pragma Assert (N (Container.First).Prev = 0);
pragma Assert (N (Container.Last).Next = 0);
end Reverse_Elements;
------------------
-- Reverse_Find --
------------------
function Reverse_Find
(Container : List;
Item : Element_Type;
Position : Cursor := No_Element) return Cursor
is
Node : Count_Type := Position.Node;
begin
if Node = 0 then
Node := Container.Last;
else
if Checks and then Position.Container /= Container'Unrestricted_Access
then
raise Program_Error with
"Position cursor designates wrong container";
end if;
pragma Assert (Vet (Position), "bad cursor in Reverse_Find");
end if;
-- Per AI05-0022, the container implementation is required to detect
-- element tampering by a generic actual subprogram.
declare
Lock : With_Lock (Container.TC'Unrestricted_Access);
begin
while Node /= 0 loop
if Container.Nodes (Node).Element = Item then
return Cursor'(Container'Unrestricted_Access, Node);
end if;
Node := Container.Nodes (Node).Prev;
end loop;
return No_Element;
end;
end Reverse_Find;
---------------------
-- Reverse_Iterate --
---------------------
procedure Reverse_Iterate
(Container : List;
Process : not null access procedure (Position : Cursor))
is
Busy : With_Busy (Container.TC'Unrestricted_Access);
Node : Count_Type := Container.Last;
begin
while Node /= 0 loop
Process (Cursor'(Container'Unrestricted_Access, Node));
Node := Container.Nodes (Node).Prev;
end loop;
end Reverse_Iterate;
------------
-- Splice --
------------
procedure Splice
(Target : in out List;
Before : Cursor;
Source : in out List)
is
begin
TC_Check (Target.TC);
TC_Check (Source.TC);
if Before.Container /= null then
if Checks and then Before.Container /= Target'Unrestricted_Access then
raise Program_Error with
"Before cursor designates wrong container";
end if;
pragma Assert (Vet (Before), "bad cursor in Splice");
end if;
if Target'Address = Source'Address or else Source.Length = 0 then
return;
end if;
if Checks and then Target.Length > Count_Type'Last - Source.Length then
raise Constraint_Error with "new length exceeds maximum";
end if;
if Checks and then Target.Length + Source.Length > Target.Capacity then
raise Capacity_Error with "new length exceeds target capacity";
end if;
Splice_Internal (Target, Before.Node, Source);
end Splice;
procedure Splice
(Container : in out List;
Before : Cursor;
Position : Cursor)
is
N : Node_Array renames Container.Nodes;
begin
TC_Check (Container.TC);
if Before.Container /= null then
if Checks and then Before.Container /= Container'Unchecked_Access then
raise Program_Error with
"Before cursor designates wrong container";
end if;
pragma Assert (Vet (Before), "bad Before cursor in Splice");
end if;
if Checks and then Position.Node = 0 then
raise Constraint_Error with "Position cursor has no element";
end if;
if Checks and then Position.Container /= Container'Unrestricted_Access
then
raise Program_Error with
"Position cursor designates wrong container";
end if;
pragma Assert (Vet (Position), "bad Position cursor in Splice");
if Position.Node = Before.Node
or else N (Position.Node).Next = Before.Node
then
return;
end if;
pragma Assert (Container.Length >= 2);
if Before.Node = 0 then
pragma Assert (Position.Node /= Container.Last);
if Position.Node = Container.First then
Container.First := N (Position.Node).Next;
N (Container.First).Prev := 0;
else
N (N (Position.Node).Prev).Next := N (Position.Node).Next;
N (N (Position.Node).Next).Prev := N (Position.Node).Prev;
end if;
N (Container.Last).Next := Position.Node;
N (Position.Node).Prev := Container.Last;
Container.Last := Position.Node;
N (Container.Last).Next := 0;
return;
end if;
if Before.Node = Container.First then
pragma Assert (Position.Node /= Container.First);
if Position.Node = Container.Last then
Container.Last := N (Position.Node).Prev;
N (Container.Last).Next := 0;
else
N (N (Position.Node).Prev).Next := N (Position.Node).Next;
N (N (Position.Node).Next).Prev := N (Position.Node).Prev;
end if;
N (Container.First).Prev := Position.Node;
N (Position.Node).Next := Container.First;
Container.First := Position.Node;
N (Container.First).Prev := 0;
return;
end if;
if Position.Node = Container.First then
Container.First := N (Position.Node).Next;
N (Container.First).Prev := 0;
elsif Position.Node = Container.Last then
Container.Last := N (Position.Node).Prev;
N (Container.Last).Next := 0;
else
N (N (Position.Node).Prev).Next := N (Position.Node).Next;
N (N (Position.Node).Next).Prev := N (Position.Node).Prev;
end if;
N (N (Before.Node).Prev).Next := Position.Node;
N (Position.Node).Prev := N (Before.Node).Prev;
N (Before.Node).Prev := Position.Node;
N (Position.Node).Next := Before.Node;
pragma Assert (N (Container.First).Prev = 0);
pragma Assert (N (Container.Last).Next = 0);
end Splice;
procedure Splice
(Target : in out List;
Before : Cursor;
Source : in out List;
Position : in out Cursor)
is
Target_Position : Count_Type;
begin
if Target'Address = Source'Address then
Splice (Target, Before, Position);
return;
end if;
TC_Check (Target.TC);
TC_Check (Source.TC);
if Before.Container /= null then
if Checks and then Before.Container /= Target'Unrestricted_Access then
raise Program_Error with
"Before cursor designates wrong container";
end if;
pragma Assert (Vet (Before), "bad Before cursor in Splice");
end if;
if Checks and then Position.Node = 0 then
raise Constraint_Error with "Position cursor has no element";
end if;
if Checks and then Position.Container /= Source'Unrestricted_Access then
raise Program_Error with
"Position cursor designates wrong container";
end if;
pragma Assert (Vet (Position), "bad Position cursor in Splice");
if Checks and then Target.Length >= Target.Capacity then
raise Capacity_Error with "Target is full";
end if;
Splice_Internal
(Target => Target,
Before => Before.Node,
Source => Source,
Src_Pos => Position.Node,
Tgt_Pos => Target_Position);
Position := Cursor'(Target'Unrestricted_Access, Target_Position);
end Splice;
---------------------
-- Splice_Internal --
---------------------
procedure Splice_Internal
(Target : in out List;
Before : Count_Type;
Source : in out List)
is
N : Node_Array renames Source.Nodes;
X : Count_Type;
begin
-- This implements the corresponding Splice operation, after the
-- parameters have been vetted, and corner-cases disposed of.
pragma Assert (Target'Address /= Source'Address);
pragma Assert (Source.Length > 0);
pragma Assert (Source.First /= 0);
pragma Assert (N (Source.First).Prev = 0);
pragma Assert (Source.Last /= 0);
pragma Assert (N (Source.Last).Next = 0);
pragma Assert (Target.Length <= Count_Type'Last - Source.Length);
pragma Assert (Target.Length + Source.Length <= Target.Capacity);
while Source.Length > 1 loop
-- Copy first element of Source onto Target
Allocate (Target, N (Source.First).Element, New_Node => X);
Insert_Internal (Target, Before => Before, New_Node => X);
-- Unlink the first node from Source
X := Source.First;
pragma Assert (N (N (X).Next).Prev = X);
Source.First := N (X).Next;
N (Source.First).Prev := 0;
Source.Length := Source.Length - 1;
-- Return the Source node to its free store
Free (Source, X);
end loop;
-- Copy first (and only remaining) element of Source onto Target
Allocate (Target, N (Source.First).Element, New_Node => X);
Insert_Internal (Target, Before => Before, New_Node => X);
-- Unlink the node from Source
X := Source.First;
pragma Assert (X = Source.Last);
Source.First := 0;
Source.Last := 0;
Source.Length := 0;
-- Return the Source node to its free store
Free (Source, X);
end Splice_Internal;
procedure Splice_Internal
(Target : in out List;
Before : Count_Type; -- node of Target
Source : in out List;
Src_Pos : Count_Type; -- node of Source
Tgt_Pos : out Count_Type)
is
N : Node_Array renames Source.Nodes;
begin
-- This implements the corresponding Splice operation, after the
-- parameters have been vetted, and corner-cases handled.
pragma Assert (Target'Address /= Source'Address);
pragma Assert (Target.Length < Target.Capacity);
pragma Assert (Source.Length > 0);
pragma Assert (Source.First /= 0);
pragma Assert (N (Source.First).Prev = 0);
pragma Assert (Source.Last /= 0);
pragma Assert (N (Source.Last).Next = 0);
pragma Assert (Src_Pos /= 0);
Allocate (Target, N (Src_Pos).Element, New_Node => Tgt_Pos);
Insert_Internal (Target, Before => Before, New_Node => Tgt_Pos);
if Source.Length = 1 then
pragma Assert (Source.First = Source.Last);
pragma Assert (Src_Pos = Source.First);
Source.First := 0;
Source.Last := 0;
elsif Src_Pos = Source.First then
pragma Assert (N (N (Src_Pos).Next).Prev = Src_Pos);
Source.First := N (Src_Pos).Next;
N (Source.First).Prev := 0;
elsif Src_Pos = Source.Last then
pragma Assert (N (N (Src_Pos).Prev).Next = Src_Pos);
Source.Last := N (Src_Pos).Prev;
N (Source.Last).Next := 0;
else
pragma Assert (Source.Length >= 3);
pragma Assert (N (N (Src_Pos).Next).Prev = Src_Pos);
pragma Assert (N (N (Src_Pos).Prev).Next = Src_Pos);
N (N (Src_Pos).Next).Prev := N (Src_Pos).Prev;
N (N (Src_Pos).Prev).Next := N (Src_Pos).Next;
end if;
Source.Length := Source.Length - 1;
Free (Source, Src_Pos);
end Splice_Internal;
----------
-- Swap --
----------
procedure Swap
(Container : in out List;
I, J : Cursor)
is
begin
TE_Check (Container.TC);
if Checks and then I.Node = 0 then
raise Constraint_Error with "I cursor has no element";
end if;
if Checks and then J.Node = 0 then
raise Constraint_Error with "J cursor has no element";
end if;
if Checks and then I.Container /= Container'Unchecked_Access then
raise Program_Error with "I cursor designates wrong container";
end if;
if Checks and then J.Container /= Container'Unchecked_Access then
raise Program_Error with "J cursor designates wrong container";
end if;
if I.Node = J.Node then
return;
end if;
pragma Assert (Vet (I), "bad I cursor in Swap");
pragma Assert (Vet (J), "bad J cursor in Swap");
declare
EI : Element_Type renames Container.Nodes (I.Node).Element;
EJ : Element_Type renames Container.Nodes (J.Node).Element;
EI_Copy : constant Element_Type := EI;
begin
EI := EJ;
EJ := EI_Copy;
end;
end Swap;
----------------
-- Swap_Links --
----------------
procedure Swap_Links
(Container : in out List;
I, J : Cursor)
is
begin
TC_Check (Container.TC);
if Checks and then I.Node = 0 then
raise Constraint_Error with "I cursor has no element";
end if;
if Checks and then J.Node = 0 then
raise Constraint_Error with "J cursor has no element";
end if;
if Checks and then I.Container /= Container'Unrestricted_Access then
raise Program_Error with "I cursor designates wrong container";
end if;
if Checks and then J.Container /= Container'Unrestricted_Access then
raise Program_Error with "J cursor designates wrong container";
end if;
if I.Node = J.Node then
return;
end if;
pragma Assert (Vet (I), "bad I cursor in Swap_Links");
pragma Assert (Vet (J), "bad J cursor in Swap_Links");
declare
I_Next : constant Cursor := Next (I);
begin
if I_Next = J then
Splice (Container, Before => I, Position => J);
else
declare
J_Next : constant Cursor := Next (J);
begin
if J_Next = I then
Splice (Container, Before => J, Position => I);
else
pragma Assert (Container.Length >= 3);
Splice (Container, Before => I_Next, Position => J);
Splice (Container, Before => J_Next, Position => I);
end if;
end;
end if;
end;
end Swap_Links;
--------------------
-- Update_Element --
--------------------
procedure Update_Element
(Container : in out List;
Position : Cursor;
Process : not null access procedure (Element : in out Element_Type))
is
begin
if Checks and then Position.Node = 0 then
raise Constraint_Error with "Position cursor has no element";
end if;
if Checks and then Position.Container /= Container'Unchecked_Access then
raise Program_Error with
"Position cursor designates wrong container";
end if;
pragma Assert (Vet (Position), "bad cursor in Update_Element");
declare
Lock : With_Lock (Container.TC'Unchecked_Access);
N : Node_Type renames Container.Nodes (Position.Node);
begin
Process (N.Element);
end;
end Update_Element;
---------
-- Vet --
---------
function Vet (Position : Cursor) return Boolean is
begin
if Position.Node = 0 then
return Position.Container = null;
end if;
if Position.Container = null then
return False;
end if;
declare
L : List renames Position.Container.all;
N : Node_Array renames L.Nodes;
begin
if L.Length = 0 then
return False;
end if;
if L.First = 0 or L.First > L.Capacity then
return False;
end if;
if L.Last = 0 or L.Last > L.Capacity then
return False;
end if;
if N (L.First).Prev /= 0 then
return False;
end if;
if N (L.Last).Next /= 0 then
return False;
end if;
if Position.Node > L.Capacity then
return False;
end if;
-- An invariant of an active node is that its Previous and Next
-- components are non-negative. Operation Free sets the Previous
-- component of the node to the value -1 before actually deallocating
-- the node, to mark the node as inactive. (By "dellocating" we mean
-- only that the node is linked onto a list of inactive nodes used
-- for storage.) This marker gives us a simple way to detect a
-- dangling reference to a node.
if N (Position.Node).Prev < 0 then -- see Free
return False;
end if;
if N (Position.Node).Prev > L.Capacity then
return False;
end if;
if N (Position.Node).Next = Position.Node then
return False;
end if;
if N (Position.Node).Prev = Position.Node then
return False;
end if;
if N (Position.Node).Prev = 0
and then Position.Node /= L.First
then
return False;
end if;
pragma Assert (N (Position.Node).Prev /= 0
or else Position.Node = L.First);
if N (Position.Node).Next = 0
and then Position.Node /= L.Last
then
return False;
end if;
pragma Assert (N (Position.Node).Next /= 0
or else Position.Node = L.Last);
if L.Length = 1 then
return L.First = L.Last;
end if;
if L.First = L.Last then
return False;
end if;
if N (L.First).Next = 0 then
return False;
end if;
if N (L.Last).Prev = 0 then
return False;
end if;
if N (N (L.First).Next).Prev /= L.First then
return False;
end if;
if N (N (L.Last).Prev).Next /= L.Last then
return False;
end if;
if L.Length = 2 then
if N (L.First).Next /= L.Last then
return False;
end if;
if N (L.Last).Prev /= L.First then
return False;
end if;
return True;
end if;
if N (L.First).Next = L.Last then
return False;
end if;
if N (L.Last).Prev = L.First then
return False;
end if;
-- Eliminate earlier possibility
if Position.Node = L.First then
return True;
end if;
pragma Assert (N (Position.Node).Prev /= 0);
-- Eliminate another possibility
if Position.Node = L.Last then
return True;
end if;
pragma Assert (N (Position.Node).Next /= 0);
if N (N (Position.Node).Next).Prev /= Position.Node then
return False;
end if;
if N (N (Position.Node).Prev).Next /= Position.Node then
return False;
end if;
if L.Length = 3 then
if N (L.First).Next /= Position.Node then
return False;
end if;
if N (L.Last).Prev /= Position.Node then
return False;
end if;
end if;
return True;
end;
end Vet;
-----------
-- Write --
-----------
procedure Write
(Stream : not null access Root_Stream_Type'Class;
Item : List)
is
Node : Count_Type;
begin
Count_Type'Base'Write (Stream, Item.Length);
Node := Item.First;
while Node /= 0 loop
Element_Type'Write (Stream, Item.Nodes (Node).Element);
Node := Item.Nodes (Node).Next;
end loop;
end Write;
procedure Write
(Stream : not null access Root_Stream_Type'Class;
Item : Cursor)
is
begin
raise Program_Error with "attempt to stream list cursor";
end Write;
procedure Write
(Stream : not null access Root_Stream_Type'Class;
Item : Reference_Type)
is
begin
raise Program_Error with "attempt to stream reference";
end Write;
procedure Write
(Stream : not null access Root_Stream_Type'Class;
Item : Constant_Reference_Type)
is
begin
raise Program_Error with "attempt to stream reference";
end Write;
end Ada.Containers.Bounded_Doubly_Linked_Lists;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- D E B U G --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2020, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
package body Debug is
---------------------------------
-- Summary of Debug Flag Usage --
---------------------------------
-- Debug flags for compiler (GNAT1)
-- da Generate messages tracking semantic analyzer progress
-- db Show encoding of type names for debug output
-- dc List names of units as they are compiled
-- dd Dynamic allocation of tables messages generated
-- de List the entity table
-- df Full tree/source print (includes withed units)
-- dg Print source from tree (generated code only)
-- dh Generate listing showing loading of name table hash chains
-- di Generate messages for visibility linking/delinking
-- dj Suppress "junk null check" for access parameter values
-- dk Generate GNATBUG message on abort, even if previous errors
-- dl Generate unit load trace messages
-- dm Prevent special frontend inlining in GNATprove mode
-- dn Generate messages for node/list allocation
-- do Print source from tree (original code only)
-- dp Generate messages for parser scope stack push/pops
-- dq No auto-alignment of small records
-- dr Generate parser resynchronization messages
-- ds Print source from tree (including original and generated stuff)
-- dt Print full tree
-- du Uncheck categorization pragmas
-- dv Output trace of overload resolution
-- dw Print trace of semantic scope stack
-- dx Force expansion on, even if no code being generated
-- dy Print tree of package Standard
-- dz Print source of package Standard
-- dA All entities included in representation information output
-- dB Output debug encoding of type names and variants
-- dC Output debugging information on check suppression
-- dD Delete elaboration checks in inner level routines
-- dE Apply elaboration checks to predefined units
-- dF Alternative display for messages over multiple lines
-- dG Generate all warnings including those normally suppressed
-- dH Hold (kill) call to gigi
-- dI Inhibit internal name numbering in gnatG listing
-- dJ Prepend subprogram name in messages
-- dK Kill all error messages
-- dL Ignore external calls from instances for elaboration
-- dM Assume all variables are modified (no current values)
-- dN No file name information in exception messages
-- dO Output immediate error messages
-- dP Do not check for controlled objects in preelaborable packages
-- dQ Use old secondary stack method
-- dR Bypass check for correct version of s-rpc
-- dS Never convert numbers to machine numbers in Sem_Eval
-- dT Convert to machine numbers only for constant declarations
-- dU Enable garbage collection of unreachable entities
-- dV Enable viewing of all symbols in debugger
-- dW Disable warnings on calls for IN OUT parameters
-- dX Display messages on reads of potentially uninitialized scalars
-- dY Enable configurable run-time mode
-- dZ Generate listing showing the contents of the dispatch tables
-- d.a Force Target_Strict_Alignment mode to True
-- d.b Dump backend types
-- d.c Generate inline concatenation, do not call procedure
-- d.d Disable atomic synchronization
-- d.e Enable atomic synchronization
-- d.f Inhibit folding of static expressions
-- d.g Enable conversion of raise into goto
-- d.h Minimize the creation of public internal symbols for concatenation
-- d.i Ignore Warnings pragmas
-- d.j Generate listing of frontend inlined calls
-- d.k Kill referenced run-time library unit line numbers
-- d.l Use Ada 95 semantics for limited function returns
-- d.m For -gnatl, print full source only for main unit
-- d.n Print source file names
-- d.o Conservative elaboration order for indirect calls
-- d.p Use original Ada 95 semantics for Bit_Order (disable AI95-0133)
-- d.q Suppress optimizations on imported 'in'
-- d.r Disable reordering of components in record types
-- d.s Strict secondary stack management
-- d.t Disable static allocation of library level dispatch tables
-- d.u Enable Modify_Tree_For_C (update tree for c)
-- d.v Enforce SPARK elaboration rules in SPARK code
-- d.w Do not check for infinite loops
-- d.x No exception handlers
-- d.y Disable implicit pragma Elaborate_All on task bodies
-- d.z Restore previous support for frontend handling of Inline_Always
-- d.A Print Atree statistics
-- d.B Generate a bug box on abort_statement
-- d.C Generate concatenation call, do not generate inline code
-- d.D Disable errors on use of overriding keyword in Ada 95 mode
-- d.E Turn selected errors into warnings
-- d.F Debug mode for GNATprove
-- d.G Ignore calls through generic formal parameters for elaboration
-- d.H
-- d.I Do not ignore enum representation clauses in CodePeer mode
-- d.J Relaxed rules for pragma No_Return
-- d.K Do not reject components in extensions overlapping with parent
-- d.L Depend on back end for limited types in if and case expressions
-- d.M Relaxed RM semantics
-- d.N Add node to all entities
-- d.O Dump internal SCO tables
-- d.P Previous (non-optimized) handling of length comparisons
-- d.Q Previous (incomplete) style check for binary operators
-- d.R Restrictions in ali files in positional form
-- d.S Force Optimize_Alignment (Space)
-- d.T Force Optimize_Alignment (Time)
-- d.U Ignore indirect calls for static elaboration
-- d.V Do not verify validity of SCIL files (CodePeer mode)
-- d.W Print out debugging information for Walk_Library_Items
-- d.X Old treatment of indexing aspects
-- d.Y
-- d.Z Do not enable expansion in configurable run-time mode
-- d_a Stop elaboration checks on accept or select statement
-- d_b
-- d_c CUDA compilation : compile for the host
-- d_d
-- d_e Ignore entry calls and requeue statements for elaboration
-- d_f Issue info messages related to GNATprove usage
-- d_g
-- d_h
-- d_i Ignore activations and calls to instances for elaboration
-- d_j Read JSON files and populate Repinfo tables (opposite of -gnatRjs)
-- d_k
-- d_l
-- d_m
-- d_n
-- d_o
-- d_p Ignore assertion pragmas for elaboration
-- d_q
-- d_r
-- d_s Stop elaboration checks on synchronous suspension
-- d_t
-- d_u
-- d_v
-- d_w
-- d_x
-- d_y
-- d_z Enable Put_Image on tagged types
-- d_A Stop generation of ALI file
-- d_B Warn on build-in-place function calls
-- d_C
-- d_D
-- d_E
-- d_F Encode full invocation paths in ALI files
-- d_G
-- d_H
-- d_I
-- d_J
-- d_K (Reserved) Enable reporting a warning on known-problem issues
-- d_L Output trace information on elaboration checking
-- d_M
-- d_N
-- d_O
-- d_P
-- d_Q
-- d_R
-- d_S
-- d_T Output trace information on invocation path recording
-- d_U
-- d_V Enable verifications on the expanded tree
-- d_W
-- d_X
-- d_Y
-- d_Z
-- d1 Error msgs have node numbers where possible
-- d2 Eliminate error flags in verbose form error messages
-- d3 Dump bad node in Comperr on an abort
-- d4 Inhibit automatic krunch of predefined library unit files
-- d5 Debug output for tree read/write
-- d6 Default access unconstrained to thin pointers
-- d7 Suppress version/source stamp/compilation time for -gnatv/-gnatl
-- d8 Force opposite endianness in packed stuff
-- d9 Allow lock free implementation
-- d.1 Enable unnesting of nested procedures
-- d.2 Allow statements in declarative part
-- d.3 Output debugging information from Exp_Unst
-- d.4 Do not delete generated C file in case of errors
-- d.5 Do not generate imported subprogram definitions in C code
-- d.6 Do not avoid declaring unreferenced types in C code
-- d.7 Disable unsound heuristics in gnat2scil (for CP as SPARK prover)
-- d.8
-- d.9 Disable build-in-place for nonlimited types
-- d_1
-- d_2
-- d_3
-- d_4
-- d_5
-- d_6
-- d_7
-- d_8
-- d_9
-- Debug flags for binder (GNATBIND)
-- da All links (including internal units) listed if there is a cycle
-- db Output information from Better_Choice
-- dc List units as they are chosen
-- dd
-- de Elaboration dependencies including system units
-- df
-- dg
-- dh
-- di Ignore_Errors mode for reading ali files
-- dj
-- dk
-- dl
-- dm
-- dn List details of manipulation of Num_Pred values
-- do Use older preference for elaboration order
-- dp Use old preference for elaboration order
-- dq
-- dr
-- ds
-- dt
-- du List units as they are acquired
-- dv Verbose debugging printouts
-- dw
-- dx Force binder to read xref information from ali files
-- dy
-- dz
-- dA
-- dB
-- dC
-- dD
-- dE
-- dF
-- dG
-- dH
-- dI
-- dJ
-- dK
-- dL
-- dM
-- dN
-- dO
-- dP
-- dQ
-- dR
-- dS
-- dT
-- dU
-- dV
-- dW
-- dX
-- dY
-- dZ
-- d.a
-- d.b
-- d.c
-- d.d
-- d.e
-- d.f
-- d.g
-- d.h
-- d.i
-- d.j
-- d.k
-- d.l
-- d.m
-- d.n
-- d.o
-- d.p
-- d.q
-- d.r
-- d.s
-- d.t
-- d.u
-- d.v
-- d.w
-- d.x
-- d.y
-- d.z
-- d.A
-- d.B
-- d.C
-- d.D
-- d.E
-- d.F
-- d.G
-- d.H
-- d.I
-- d.J
-- d.K
-- d.L
-- d.M
-- d.N
-- d.O
-- d.P
-- d.Q
-- d.R
-- d.S
-- d.T
-- d.U
-- d.V
-- d.W
-- d.X
-- d.Y
-- d.Z
-- d.1
-- d.2
-- d.3
-- d.4
-- d.5
-- d.6
-- d.7
-- d.8
-- d.9
-- d_a Ignore the effects of pragma Elaborate_All
-- d_b Ignore the effects of pragma Elaborate_Body
-- d_c
-- d_d
-- d_e Ignore the effects of pragma Elaborate
-- d_f
-- d_g
-- d_h
-- d_i
-- d_j
-- d_k
-- d_l
-- d_m
-- d_n
-- d_o
-- d_p
-- d_q
-- d_r
-- d_s
-- d_t Output cycle-detection trace information
-- d_u
-- d_v
-- d_w
-- d_x
-- d_y
-- d_z
-- d_A Output ALI invocation tables
-- d_B
-- d_C Diagnose all cycles
-- d_D
-- d_E
-- d_F
-- d_G
-- d_H
-- d_I Output invocation graph
-- d_J
-- d_K
-- d_L Output library graph
-- d_M
-- d_N
-- d_O
-- d_P Output cycle paths
-- d_Q
-- d_R
-- d_S Output elaboration-order status
-- d_T Output elaboration-order trace information
-- d_U
-- d_V Validate bindo cycles, graphs, and order
-- d_W
-- d_X
-- d_Y
-- d_Z
-- d_1
-- d_2
-- d_3
-- d_4
-- d_5
-- d_6
-- d_7
-- d_8
-- d_9
-- Debug flags used in package Make and its clients (e.g. GNATMAKE)
-- da
-- db
-- dc
-- dd
-- de
-- df Only output file names, not path names, in log
-- dg
-- dh Generate listing showing loading of name table hash chains
-- di
-- dj
-- dk
-- dl
-- dm Display the number of maximum simultaneous compilations
-- dn Do not delete temp files created by gnatmake
-- do
-- dp Prints the contents of the Q used by Make.Compile_Sources
-- dq Prints source files as they are enqueued and dequeued
-- dr
-- ds
-- dt Display time stamps when there is a mismatch
-- du List units as their ali files are acquired
-- dv
-- dw Prints the list of units withed by the unit currently explored
-- dx
-- dy
-- dz
--------------------------------------------
-- Documentation for Compiler Debug Flags --
--------------------------------------------
-- da Generate messages tracking semantic analyzer progress. A message
-- is output showing each node as it gets analyzed, expanded,
-- resolved, or evaluated. This option is useful for finding out
-- exactly where a bomb during semantic analysis is occurring.
-- db In Exp_Dbug, certain type names are encoded to include debugging
-- information. This debug switch causes lines to be output showing
-- the encodings used.
-- dc List names of units as they are compiled. One line of output will
-- be generated at the start of compiling each unit (package or
-- subprogram).
-- dd Dynamic allocation of tables messages generated. Each time a
-- table is reallocated, a line is output indicating the expansion.
-- de List the entity table
-- df Full tree/source print (includes withed units). Normally the tree
-- output (dt) or recreated source output (dg,do,ds) includes only
-- the main unit. If df is set, then the output in either case
-- includes all compiled units (see also dg,do,ds,dt). Note that to
-- be effective, this switch must be used in combination with one or
-- more of dt, dg, do or ds.
-- dg Print the source recreated from the generated tree. In the case
-- where the tree has been rewritten this output includes only the
-- generated code, not the original code (see also df,do,ds,dz).
-- This flag differs from -gnatG in that the output also includes
-- non-source generated null statements, and freeze nodes, which
-- are normally omitted in -gnatG mode.
-- dh Generates a table at the end of a compilation showing how the hash
-- table chains built by the Namet package are loaded. This is useful
-- in ensuring that the hashing algorithm (in Namet.Hash) is working
-- effectively with typical sets of program identifiers.
-- di Generate messages for visibility linking/delinking
-- dj Suppress "junk null check" for access parameters. This flag permits
-- Ada programs to pass null parameters to access parameters, and to
-- explicitly check such access values against the null literal.
-- Neither of these is valid Ada, but both were allowed in versions of
-- GNAT before 3.10, so this switch can ease the transition process.
-- dk Immediate kill on abort. Normally on an abort (i.e. a call to
-- Comperr.Compiler_Abort), the GNATBUG message is not given if
-- there is a previous error. This debug switch bypasses this test
-- and gives the message unconditionally (useful for debugging).
-- dl Generate unit load trace messages. A line of traceback output is
-- generated each time a request is made to the library manager to
-- load a new unit.
-- dm Prevent special frontend inlining in GNATprove mode. In some cases,
-- some subprogram calls are inlined in GNATprove mode in order to
-- facilitate formal verification. This debug switch prevents that
-- inlining to happen.
-- dn Generate messages for node/list allocation. Each time a node or
-- list header is allocated, a line of output is generated. Certain
-- other basic tree operations also cause a line of output to be
-- generated. This option is useful in seeing where the parser is
-- blowing up.
-- do Print the source recreated from the generated tree. In the case
-- where the tree has been rewritten, this output includes only the
-- original code, not the generated code (see also df,dg,ds,dz).
-- dp Generate messages for parser scope stack push/pops. A line of
-- output by the parser each time the parser scope stack is either
-- pushed or popped. Useful in debugging situations where the
-- parser scope stack ends up incorrectly synchronized
-- dq In layout version 1.38, 2002/01/12, a circuit was implemented
-- to give decent default alignment to short records that had no
-- specific alignment set. This debug option restores the previous
-- behavior of giving such records poor alignments, typically 1.
-- This may be useful in dealing with transition.
-- dr Generate parser resynchronization messages. Normally the parser
-- resynchronizes quietly. With this debug option, two messages
-- are generated, one when the parser starts a resynchronization
-- skip, and another when it resumes parsing. Useful in debugging
-- inadequate error recovery situations.
-- ds Print the source recreated from the generated tree. In the case
-- where the tree has been rewritten this output includes both the
-- generated code and the original code with the generated code
-- being enlosed in curly brackets (see also df,do,ds,dz)
-- dt Print full tree. The generated tree is output (see also df,dy)
-- du Uncheck categorization pragmas. This debug switch causes the
-- elaboration control pragmas (Pure, Preelaborate, etc.) and the
-- categorization pragmas (Shared_Passive, Remote_Types, etc.) to be
-- ignored, so that normal checks are not made (this is particularly
-- useful for adding temporary debugging code to units that have
-- pragmas that are inconsistent with the debugging code added).
-- dv Output trace of overload resolution. Outputs messages for
-- overload attempts that involve cascaded errors, or where
-- an interpretation is incompatible with the context.
-- dw Write semantic scope stack messages. Each time a scope is created
-- or removed, a message is output (see the Sem_Ch8.Push_Scope and
-- Sem_Ch8.Pop_Scope subprograms).
-- dx Force expansion on, even if no code being generated. Normally the
-- expander is inhibited if no code is generated. This switch forces
-- expansion to proceed normally even if the backend is not being
-- called. This is particularly useful for debugging purposes when
-- using the front-end only version of the compiler (which normally
-- would never do any expansion).
-- dy Print tree of package Standard. Normally the tree print out does
-- not include package Standard, even if the -df switch is set. This
-- switch forces output of the internal tree built for Standard.
-- dz Print source of package Standard. Normally the source print out
-- does not include package Standard, even if the -df switch is set.
-- This switch forces output of the source recreated from the internal
-- tree built for Standard. Note that this differs from -gnatS in
-- that it prints from the actual tree using the normal Sprint
-- circuitry for printing trees.
-- dA Forces output of representation information, including full
-- information for all internal type and object entities, as well
-- as all user defined type and object entities including private
-- and incomplete types. This debug switch also automatically sets
-- the equivalent of -gnatRm.
-- dB Output debug encodings for types and variants. See Exp_Dbug for
-- exact form of the generated output.
-- dC Output trace information showing the decisions made during
-- check suppression activity in unit Checks.
-- dD Delete new elaboration checks. This flag causes GNAT to return
-- to the 3.13a elaboration semantics, and to suppress the fixing
-- of two bugs. The first is in the context of inner routines in
-- dynamic elaboration mode, when the subprogram we are in was
-- called at elaboration time by a unit that was also compiled with
-- dynamic elaboration checks. In this case, if A calls B calls C,
-- and all are in different units, we need an elaboration check at
-- each call. These nested checks were only put in recently (see
-- version 1.80 of Sem_Elab) and we provide this debug flag to
-- revert to the previous behavior in case of regressions. The
-- other behavior reverted by this flag is the treatment of the
-- Elaborate_Body pragma in static elaboration mode. This used to
-- be treated as not needing elaboration checking, but in fact in
-- general Elaborate_All is still required because of nested calls.
-- dE Apply compile time elaboration checking for with relations between
-- predefined units. Normally no checks are made.
-- dG Generate all warnings. Normally Errout suppresses warnings on
-- units that are not part of the main extended source, and also
-- suppresses warnings on instantiations in the main extended
-- source that duplicate warnings already posted on the template.
-- This switch stops both kinds of deletion and causes Errout to
-- post all warnings sent to it.
-- dH Inhibit call to gigi. This is useful for testing front end data
-- layout, and may be useful in other debugging situations where
-- you do not want gigi to intefere with the testing.
-- dI Inhibit internal name numbering in gnatDG listing. Any sequence of
-- the form <uppercase-letter><digits><lowercase-letter> appearing in
-- a name is replaced by <uppercase-letter>...<lowercase-letter>. This
-- is used in the fixed bugs run to minimize system and version
-- dependency in filed -gnatD or -gnatG output.
-- dJ Prepend the name of the enclosing subprogram in compiler messages
-- (errors, warnings, style checks). This is useful in particular to
-- integrate compiler warnings in static analysis tools such as
-- CodePeer.
-- dK Kill all error messages. This debug flag suppresses the output
-- of all error messages. It is used in regression tests where the
-- error messages are target dependent and irrelevant.
-- dL The compiler ignores calls in instances and invoke subprograms
-- which are external to the instance for both the static and dynamic
-- elaboration models.
-- dM Assume all variables have been modified, and ignore current value
-- indications. This debug flag disconnects the tracking of constant
-- values (see Exp_Ch2.Expand_Current_Value).
-- dN Do not generate file name information in exception messages
-- dO Output immediate error messages. This causes error messages to
-- be output as soon as they are generated (disconnecting several
-- circuits for improvement of messages, deletion of duplicate
-- messages etc). Useful to diagnose compiler bombs caused by
-- erroneous handling of error situations
-- dP Do not check for controlled objects in preelaborable packages.
-- RM 10.2.1(9) forbids the use of library level controlled objects
-- in preelaborable packages, but this restriction is a huge pain,
-- especially in the predefined library units.
-- dQ Use old method for determining what goes on the secondary stack.
-- This disables some newer optimizations. The intent is to use this
-- temporarily to measure before/after efficiency. ???Remove this
-- when we are done (see Sem_Util.Requires_Transient_Scope).
-- dR Bypass the check for a proper version of s-rpc being present
-- to use the -gnatz? switch. This allows debugging of the use
-- of stubs generation without needing to have GLADE (or some
-- other PCS installed).
-- dS Omit conversion of fpt numbers to exact machine numbers in
-- non-static evaluation contexts (see Check_Non_Static_Context).
-- This is intended for testing out timing problems with this
-- conversion circuit.
-- dT Similar to dS, but omits the conversions only in the case where
-- the parent is not a constant declaration.
-- dU Enable garbage collection of unreachable entities. This enables
-- both the reachability analysis and changing the Is_Public and
-- Is_Eliminated flags.
-- dV Enable viewing of all symbols in debugger. Causes debug information
-- to be generated for all symbols, including internal symbols. This
-- is enabled by default for -gnatD, but this switch allows this to
-- be enabled without generating modified source files. Note that the
-- use of -gnatdV ensures in the dwarf/elf case that all symbols that
-- are present in the elf tables are also in the dwarf tables (which
-- seems to be required by some tools). Another effect of dV is to
-- generate full qualified names, including internal names generated
-- for blocks and loops.
-- dW Disable warnings when a possibly uninitialized scalar value is
-- passed to an IN OUT parameter of a procedure. This usage is a
-- quite improper bounded error [erroneous in Ada 83] situation,
-- and would normally generate a warning. However, to ease the
-- task of transitioning incorrect legacy code, we provide this
-- undocumented feature for suppressing these warnings.
-- dY Enable configurable run-time mode, just as though the System file
-- had Configurable_Run_Time_Mode set to True. This is useful in
-- testing high integrity mode.
-- dZ Generate listing showing the contents of the dispatch tables. Each
-- line has an internally generated number used for references between
-- tagged types and primitives. For each primitive the output has the
-- following fields:
--
-- - Letter 'P' or letter 's': The former indicates that this
-- primitive will be located in a primary dispatch table. The
-- latter indicates that it will be located in a secondary
-- dispatch table.
--
-- - Name of the primitive. In case of predefined Ada primitives
-- the text "(predefined)" is added before the name, and these
-- acronyms are used: SR (Stream_Read), SW (Stream_Write), SI
-- (Stream_Input), SO (Stream_Output), DA (Deep_Adjust), DF
-- (Deep_Finalize). In addition Oeq identifies the equality
-- operator, and "_assign" the assignment.
--
-- - If the primitive covers interface types, two extra fields
-- referencing other primitives are generated: "Alias" references
-- the primitive of the tagged type that covers an interface
-- primitive, and "AI_Alias" references the covered interface
-- primitive.
--
-- - The expression "at #xx" indicates the slot of the dispatch
-- table occupied by such primitive in its corresponding primary
-- or secondary dispatch table.
--
-- - In case of abstract subprograms the text "is abstract" is
-- added at the end of the line.
-- d.a Force Target_Strict_Alignment to True, even on targets where it
-- would normally be false. Can be used for testing strict alignment
-- circuitry in the compiler.
-- d.b Dump back end types. During Create_Standard, the back end is
-- queried for all available types. This option shows them.
-- d.c Generate inline concatenation, instead of calling one of the
-- System.Concat_n.Str_Concat_n routines in cases where the latter
-- routines would normally be called.
-- d.d Disable atomic synchronization for all atomic variable references.
-- Pragma Enable_Atomic_Synchronization is ignored.
-- d.e Enable atomic synchronization for all atomic variable references.
-- Pragma Disable_Atomic_Synchronization is ignored, and also the
-- compiler switch -gnated is ignored.
-- d.f Suppress folding of static expressions. This of course results
-- in seriously non-conforming behavior, but is useful sometimes
-- when tracking down handling of complex expressions.
-- d.g Enables conversion of a raise statement into a goto when the
-- relevant handler is statically determinable. For now we only try
-- this if this debug flag is set. Later we will enable this more
-- generally by default.
-- d.h Minimize the creation of public internal symbols for concatenation
-- by enforcing a secondary stack-like handling of the final result.
-- The target of the concatenation is thus constrained in place and
-- initialized with the result instead of acting as its alias.
-- d.i Ignore all occurrences of pragma Warnings in the sources. This can
-- be used in particular to disable Warnings (Off) to check if any of
-- these statements are inappropriate.
-- d.k If an error message contains a reference to a location in an
-- internal unit, then suppress the line number in this reference.
-- d.j Generate listing of frontend inlined calls and inline calls passed
-- to the backend. This is useful to locate skipped calls that must be
-- inlined by the frontend.
-- d.l Use Ada 95 semantics for limited function returns. This may be
-- used to work around the incompatibility introduced by AI-318-2.
-- It is useful only in Ada 2005 and later.
-- d.m When -gnatl is used, the normal output includes full listings of
-- all files in the extended main source (body/spec/subunits). If this
-- debug switch is used, then the full listing is given only for the
-- main source (this corresponds to a previous behavior of -gnatl and
-- is used for running the ACATS tests).
-- d.n Print source file names as they are loaded. This is useful if the
-- compiler has a bug -- these are the files that need to be included
-- in a bug report.
-- d.o Conservative elaboration order for indirect calls. This causes
-- P'Access to be treated as a call in more cases.
-- d.p In Ada 95 (or 83) mode, use original Ada 95 behavior for the
-- interpretation of component clauses crossing byte boundaries when
-- using the non-default bit order (i.e. ignore AI95-0133).
-- d.q If an array variable or constant is not modified in Ada code, and
-- is passed to an 'in' parameter of a foreign-convention subprogram,
-- and that subprogram modifies the array, the Ada compiler normally
-- assumes that the array is not modified. This option suppresses such
-- optimizations. This option should not be used; the correct solution
-- is to declare the parameter 'in out'.
-- d.r Do not reorder components in record types.
-- d.s The compiler no longer attempts to optimize the calls to secondary
-- stack management routines SS_Mark and SS_Release. As a result, each
-- transient block tasked with secondary stack management will fulfill
-- its role unconditionally.
-- d.s The compiler does not generate calls to secondary stack management
-- routines SS_Mark and SS_Release for a transient block when there is
-- an enclosing scoping construct which already manages the secondary
-- stack.
-- d.t The compiler has been modified (a fairly extensive modification)
-- to generate static dispatch tables for library level tagged types.
-- This debug switch disables this modification and reverts to the
-- previous dynamic construction of tables. It is there as a possible
-- work around if we run into trouble with the new implementation.
-- d.u Sets Modify_Tree_For_C mode in which tree is modified to make it
-- easier to generate code using a C compiler.
-- d.v This flag enforces the elaboration rules defined in the SPARK
-- Reference Manual, chapter 7.7, to all SPARK code within a unit. As
-- a result, constructs which violate the rules in chapter 7.7 are no
-- longer accepted, even if the implementation is able to statically
-- ensure that accepting these constructs does not introduce the
-- possibility of failing an elaboration check.
-- d.w This flag turns off the scanning of loops to detect possible
-- infinite loops.
-- d.x No exception handlers in generated code. This causes exception
-- handlers to be eliminated from the generated code. They are still
-- fully compiled and analyzed, they just get eliminated from the
-- code generation step.
-- d.y Disable implicit pragma Elaborate_All on task bodies. When a task
-- body calls a procedure in the same package, and that procedure
-- calls a procedure in another package, the static elaboration
-- machinery adds an implicit Elaborate_All on the other package. This
-- switch disables the addition of the implicit pragma in such cases.
-- d.z Restore previous front-end support for Inline_Always. In default
-- mode, for targets that use the GCC back end, Inline_Always is
-- handled by the back end. Use of this switch restores the previous
-- handling of Inline_Always by the front end on such targets. For the
-- targets that do not use the GCC back end, this switch is ignored.
-- d.A Print Atree statistics
-- d.B Generate a bug box when we see an abort_statement, even though
-- there is no bug. Useful for testing Comperr.Compiler_Abort: write
-- some code containing an abort_statement, and compile it with
-- -gnatd.B. There is nothing special about abort_statements; it just
-- provides a way to control where the bug box is generated. See "when
-- N_Abort_Statement" in package body Expander.
-- d.C Generate call to System.Concat_n.Str_Concat_n routines in cases
-- where we would normally generate inline concatenation code.
-- d.D For compatibility with some Ada 95 compilers implementing only
-- one feature of Ada 2005 (overriding keyword), disable errors on use
-- of overriding keyword in Ada 95 mode.
-- d.E Turn selected errors into warnings. This debug switch causes a
-- specific set of error messages into warnings. Setting this switch
-- causes Opt.Error_To_Warning to be set to True. The intention is
-- that this be used for messages representing upwards incompatible
-- changes to Ada 2012 that cause previously correct programs to be
-- treated as illegal now. The following cases are affected:
--
-- Errors relating to overlapping subprogram parameters for cases
-- other than IN OUT parameters to functions.
--
-- Errors relating to the new rules about not defining equality
-- too late so that composition of equality can be assured.
--
-- Errors relating to overriding indicators on protected subprogram
-- bodies (not an Ada 2012 incompatibility, but might cause errors
-- for existing programs assuming they were legal because GNAT
-- formerly allowed them).
-- d.F Sets GNATprove_Mode to True. This allows debugging the frontend in
-- the special mode used by GNATprove.
-- d.G Previously the compiler ignored calls via generic formal parameters
-- when doing the analysis for the static elaboration model. This is
-- now fixed, but we provide this debug flag to revert to the previous
-- situation of ignoring such calls to aid in transition.
-- d.I Do not ignore enum representation clauses in CodePeer mode.
-- The default of ignoring representation clauses for enumeration
-- types in CodePeer is good for the majority of Ada code, but in some
-- cases being able to change this default might be useful to remove
-- some false positives.
-- d.J Relaxed rules for pragma No_Return. A pragma No_Return is illegal
-- if it applies to a body. This switch disables the legality check
-- for that. If the procedure does in fact return normally, execution
-- is erroneous, and therefore unpredictable.
-- d.K Do not reject components in extensions overlapping with the parent
-- component. Such components can be specified by means of a component
-- clause but they cannot be fully supported by the GCC type system.
-- This switch nevertheless allows them for the sake of compatibility.
-- d.L Normally the front end generates special expansion for conditional
-- expressions of a limited type. This debug flag removes this special
-- case expansion, leaving it up to the back end to handle conditional
-- expressions correctly.
-- d.M Relaxed RM semantics. This flag sets Opt.Relaxed_RM_Semantics
-- See Opt.Relaxed_RM_Semantics for more details.
-- d.N Enlarge entities by one node (but don't attempt to use this extra
-- node for storage of any flags or fields). This can be used to do
-- experiments on the impact of increasing entity sizes.
-- d.O Dump internal SCO tables. Before outputting the SCO information to
-- the ALI file, the internal SCO tables (SCO_Table/SCO_Unit_Table)
-- are dumped for debugging purposes.
-- d.P Previous non-optimized handling of length comparisons. Setting this
-- flag inhibits the effect of Optimize_Length_Comparison in Exp_Ch4.
-- This is there in case we find a situation where the optimization
-- malfunctions, to provide a work around.
-- d.Q Previous incomplete style checks for binary operators. Style checks
-- for token separation rules were incomplete and have been made
-- compliant with the documentation. For example, no warning was
-- issued for expressions such as 16-One or "A"&"B". Setting this flag
-- inhibits these new checks.
-- d.R As documented in lib-writ.ads, restrictions in the ali file can
-- have two forms, positional and named. The named notation is the
-- current preferred form, but the use of this debug switch will force
-- the use of the obsolescent positional form.
-- d.S Force Optimize_Alignment (Space) mode as the default
-- d.T Force Optimize_Alignment (Time) mode as the default
-- d.U Ignore indirect calls for static elaboration. The static
-- elaboration model is conservative, especially regarding indirect
-- calls. If you say Proc'Access, it will assume you might call
-- Proc. This can cause elaboration cycles at bind time. This flag
-- reverts to the behavior of earlier compilers, which ignored
-- indirect calls.
-- d.V Do not verify the validity of SCIL files (CodePeer mode). When
-- generating SCIL files for CodePeer, by default we verify that the
-- SCIL is well formed before saving it on disk. This switch can be
-- used to disable this checking, either to improve speed or to shut
-- down a false positive detected during the verification.
-- d.W Print out debugging information for Walk_Library_Items, including
-- the order in which units are walked. This is primarily for use in
-- debugging CodePeer mode.
-- d.X A previous version of GNAT allowed indexing aspects to be redefined
-- on derived container types, while the default iterator was
-- inherited from the parent type. This nonstandard extension is
-- preserved temporarily for use by the modeling project under debug
-- flag d.X.
-- d.Z Normally we always enable expansion in configurable run-time mode
-- to make sure we get error messages about unsupported features even
-- when compiling in -gnatc mode. But expansion is turned off in this
-- case if debug flag -gnatd.Z is used. This is to deal with the case
-- where we discover difficulties in this new processing.
-- d_a The compiler stops the examination of a task body once it reaches
-- an accept or select statement for the static elaboration model. The
-- behavior is similar to that of No_Entry_Calls_In_Elaboration_Code,
-- but does not penalize actual entry calls in elaboration code.
-- d_e The compiler ignores simple entry calls, asynchronous transfer of
-- control, conditional entry calls, timed entry calls, and requeue
-- statements in both the static and dynamic elaboration models.
-- d_f Issue info messages related to GNATprove usage to help users
-- understand analysis results. By default these are not issued as
-- beginners find them confusing. Set automatically by GNATprove when
-- switch --info is used.
-- d_i The compiler ignores calls and task activations when they target a
-- subprogram or task type defined in an external instance for both
-- the static and dynamic elaboration models.
-- d_j The compiler reads JSON files that would be generated by the same
-- compilation session if -gnatRjs was passed, in order to populate
-- the internal tables of the Repinfo unit from them.
-- d_p The compiler ignores calls to subprograms which verify the run-time
-- semantics of invariants and postconditions in both the static and
-- dynamic elaboration models.
-- d_s The compiler stops the examination of a task body once it reaches
-- a call to routine Ada.Synchronous_Task_Control.Suspend_Until_True
-- or Ada.Synchronous_Barriers.Wait_For_Release.
-- d_z Enable the default Put_Image on tagged types that are not
-- predefined.
-- d_A Do not generate ALI files by setting Opt.Disable_ALI_File.
-- d_B Warn on build-in-place function calls. This allows users to
-- inspect their code in case it triggers compiler bugs related
-- to build-in-place calls. See known-problem entries for details.
-- d_F The compiler encodes the full path from an invocation construct to
-- an external target, offering additional information to GNATBIND for
-- purposes of error diagnostics.
-- d_K (Reserved) Enable reporting a warning on known-problem issues of
-- previous releases. No action performed in the wavefront.
-- d_L Output trace information on elaboration checking. This debug switch
-- causes output to be generated showing each call or instantiation as
-- it is checked, and the progress of the recursive trace through
-- elaboration calls at compile time.
-- d_T The compiler outputs trace information to standard output whenever
-- an invocation path is recorded.
-- d_V Enable verification of the expanded code before calling the backend
-- and generate error messages on each inconsistency found.
-- d1 Error messages have node numbers where possible. Normally error
-- messages have only source locations. This option is useful when
-- debugging errors caused by expanded code, where the source location
-- does not give enough information.
-- d2 Suppress output of the error position flags for verbose form error
-- messages. The messages are still interspersed in the listing, but
-- without any error flags or extra blank lines. Also causes an extra
-- <<< to be output at the right margin. This is intended to be the
-- easiest format for checking conformance of ACATS B tests. This
-- flag also suppresses the additional messages explaining why a
-- non-static expression is non-static (see Sem_Eval.Why_Not_Static).
-- This avoids having to worry about these messages in ACATS testing.
-- Finally, this flag is also used for strict legality check, in
-- particular it will generate an error instead a warning when
-- encountering an unknown pragma.
-- d3 Causes Comperr to dump the contents of the node for which an abort
-- was detected (normally only the Node_Id of the node is output).
-- d4 Inhibits automatic krunching of predefined library unit file names.
-- Normally, as described in the spec of package Krunch, such files
-- are automatically krunched to 8 characters, with special treatment
-- of the prefixes Ada, System, and Interfaces. Setting this debug
-- switch disables this special treatment.
-- d5 Causes the tree read/write circuit to output detailed information
-- tracking the data that is read and written element by element.
-- d6 Normally access-to-unconstrained-array types are represented
-- using fat (double) pointers. Using this debug flag causes them
-- to default to thin. This can be used to test the performance
-- implications of using thin pointers, and also to test that the
-- compiler functions correctly with this choice.
-- d7 Normally a -gnatl or -gnatv listing includes the time stamp of the
-- source file and the time of the compilation. This debug flag can
-- be used to suppress this output, and also suppresses the message
-- with the version of the compiler. This is useful for regression
-- tests which need to have consistent output.
-- d8 This forces the packed stuff to generate code assuming the
-- opposite endianness from the actual correct value. Useful in
-- testing out code generation from the packed routines.
-- d9 This allows lock free implementation for protected objects
-- (see Exp_Ch9).
-- d.1 Sets Opt.Unnest_Subprogram_Mode to enable unnesting of subprograms.
-- This special pass does not actually unnest things, but it ensures
-- that a nested procedure does not contain any uplevel references.
-- See spec of Exp_Unst for full details.
-- d.2 Allow statements within declarative parts. This is not usually
-- allowed, but in some debugging contexts (e.g. testing the circuit
-- for unnesting of procedures), it is useful to allow this.
-- d.3 Output debugging information from Exp_Unst, including the name of
-- any unreachable subprograms that get deleted.
-- d.4 By default in case of an error during C generation, the .c or .h
-- file is deleted. This flag keeps the C file.
-- d.5 By default a subprogram imported generates a subprogram profile.
-- This debug flag disables this generation when generating C code,
-- assuming a proper #include will be used instead.
-- d.6 By default the C back-end avoids declaring types that are not
-- referenced by the generated C code. This debug flag restores the
-- output of all the types.
-- d.7 Indicates (to gnat2scil) that CodePeer is being invoked as a
-- prover by the SPARK tools and that therefore gnat2scil should
-- avoid SCIL generation strategies which can introduce soundness
-- issues (e.g., assuming that a low bound of an array parameter
-- of an unconstrained subtype belongs to the index subtype).
-- d.9 Enable build-in-place for function calls returning some nonlimited
-- types.
------------------------------------------
-- Documentation for Binder Debug Flags --
------------------------------------------
-- da Normally if there is an elaboration circularity, then in describing
-- the cycle, links involving internal units are omitted, since they
-- are irrelevant and confusing. This debug flag causes all links to
-- be listed, and is useful when diagnosing circularities introduced
-- by incorrect changes to the run-time library itself.
-- db Output debug information from Better_Choice in Binde, which uses
-- various heuristics to determine elaboration order in cases where
-- multiple orders are valid.
-- dc List units as they are chosen. As units are selected for addition to
-- the elaboration order, a line of output is generated showing which
-- unit has been selected.
-- de Similar to the effect of -e (output complete list of elaboration
-- dependencies) except that internal units are included in the
-- listing.
-- di Normally GNATBIND calls Read_Ali with Ignore_Errors set to False,
-- since the binder really needs correct version ALI files to do its
-- job. This debug flag causes Ignore_Errors mode to be set for the
-- binder (and is particularly useful for testing ignore errors mode).
-- dn List details of manipulation of Num_Pred values during execution of
-- the algorithm used to determine a correct order of elaboration. This
-- is useful in diagnosing any problems in its behavior.
-- do Use older elaboration order preference. The new preference rules
-- prefer specs with no bodies to specs with bodies, and between two
-- specs with bodies, prefers the one whose body is closer to being
-- able to be elaborated. This is a clear improvement, but we provide
-- this debug flag in case of regressions. Note: -do is even older
-- than -dp.
-- dp Use old elaboration order preference. The new preference rules
-- elaborate all units within a strongly connected component together,
-- with no other units in between. In particular, if a spec/body pair
-- can be elaborated together, it will be. In the new order, the binder
-- behaves as if every pragma Elaborate_All that would be legal is
-- present, even if it does not appear in the source code.
-- du List unit name and file name for each unit as it is read in
-- dv Verbose debugging printouts
-- dx Force the binder to read (and then ignore) the xref information
-- in ali files (used to check that read circuit is working OK).
-- d_a GNATBIND ignores the effects of pragma Elaborate_All in the case of
-- elaboration order and treats the associated dependency as a regular
-- with edge.
-- d_b GNATBIND ignores the effects of pragma Elaborate_Body in the case
-- of elaboration order and treats the spec and body as decoupled.
-- d_e GNATBIND ignores the effects of pragma Elaborate in the case of
-- elaboration order and no longer creates an implicit dependency on
-- the body of the argument.
-- d_t GNATBIND output trace information of cycle-detection activities to
-- standard output.
-- d_A GNATBIND output the contents of all ALI invocation-related tables
-- in textual format to standard output.
-- d_C GNATBIND diagnoses all unique cycles within the bind, rather than
-- just the most important one.
-- d_I GNATBIND outputs the contents of the invocation graph in textual
-- format to standard output.
-- d_L GNATBIND outputs the contents of the library graph in textual
-- format to standard output.
-- d_P GNATBIND outputs the cycle paths to standard output
-- d_S GNATBIND outputs trace information concerning the status of its
-- various phases to standard output.
-- d_T GNATBIND outputs trace information of elaboration order detection
-- activities to standard output.
-- d_V GNATBIND validates the invocation graph, library graph along with
-- its cycles, and the elaboration order.
--------------------------------------------
-- Documentation for gnatmake Debug Flags --
--------------------------------------------
-- df Only output file names, not path names, in log
-- dh Generate listing showing loading of name table hash chains,
-- same as for the compiler.
-- dm Issue a message indicating the maximum number of simultaneous
-- compilations.
-- dn Do not delete temporary files created by gnatmake at the end
-- of execution, such as temporary config pragma files, mapping
-- files or project path files. This debug switch is equivalent to
-- the standard switch --keep-temp-files. We retain the debug switch
-- for back compatibility with past usage.
-- dp Prints the Q used by routine Make.Compile_Sources every time
-- we go around the main compile loop of Make.Compile_Sources
-- dq Prints source files as they are enqueued and dequeued in the Q
-- used by routine Make.Compile_Sources. Useful to figure out the
-- order in which sources are recompiled.
-- dt When a time stamp mismatch has been found for an ALI file,
-- display the source file name, the time stamp expected and
-- the time stamp found.
-- du List unit name and file name for each unit as it is read in
-- dw Prints the list of units withed by the unit currently explored
-- during the main loop of Make.Compile_Sources.
---------------------------------------------
-- Documentation for gprbuild Debug Flags --
---------------------------------------------
-- dm Display the maximum number of simultaneous compilations.
-- dn Do not delete temporary files created by gprbuild at the end
-- of execution, such as temporary config pragma files, mapping
-- files or project path files. This debug switch is equivalent to
-- the standard switch --keep-temp-files. We retain the debug switch
-- for back compatibility with past usage.
-- dt When a time stamp mismatch has been found for an ALI file,
-- display the source file name, the time stamp expected and
-- the time stamp found.
--------------------
-- Set_Debug_Flag --
--------------------
procedure Set_Debug_Flag (C : Character; Val : Boolean := True) is
subtype Dig is Character range '1' .. '9';
subtype LLet is Character range 'a' .. 'z';
subtype ULet is Character range 'A' .. 'Z';
begin
if C in Dig then
case Dig (C) is
when '1' =>
Debug_Flag_1 := Val;
when '2' =>
Debug_Flag_2 := Val;
when '3' =>
Debug_Flag_3 := Val;
when '4' =>
Debug_Flag_4 := Val;
when '5' =>
Debug_Flag_5 := Val;
when '6' =>
Debug_Flag_6 := Val;
when '7' =>
Debug_Flag_7 := Val;
when '8' =>
Debug_Flag_8 := Val;
when '9' =>
Debug_Flag_9 := Val;
end case;
elsif C in ULet then
case ULet (C) is
when 'A' =>
Debug_Flag_AA := Val;
when 'B' =>
Debug_Flag_BB := Val;
when 'C' =>
Debug_Flag_CC := Val;
when 'D' =>
Debug_Flag_DD := Val;
when 'E' =>
Debug_Flag_EE := Val;
when 'F' =>
Debug_Flag_FF := Val;
when 'G' =>
Debug_Flag_GG := Val;
when 'H' =>
Debug_Flag_HH := Val;
when 'I' =>
Debug_Flag_II := Val;
when 'J' =>
Debug_Flag_JJ := Val;
when 'K' =>
Debug_Flag_KK := Val;
when 'L' =>
Debug_Flag_LL := Val;
when 'M' =>
Debug_Flag_MM := Val;
when 'N' =>
Debug_Flag_NN := Val;
when 'O' =>
Debug_Flag_OO := Val;
when 'P' =>
Debug_Flag_PP := Val;
when 'Q' =>
Debug_Flag_QQ := Val;
when 'R' =>
Debug_Flag_RR := Val;
when 'S' =>
Debug_Flag_SS := Val;
when 'T' =>
Debug_Flag_TT := Val;
when 'U' =>
Debug_Flag_UU := Val;
when 'V' =>
Debug_Flag_VV := Val;
when 'W' =>
Debug_Flag_WW := Val;
when 'X' =>
Debug_Flag_XX := Val;
when 'Y' =>
Debug_Flag_YY := Val;
when 'Z' =>
Debug_Flag_ZZ := Val;
end case;
else
case LLet (C) is
when 'a' =>
Debug_Flag_A := Val;
when 'b' =>
Debug_Flag_B := Val;
when 'c' =>
Debug_Flag_C := Val;
when 'd' =>
Debug_Flag_D := Val;
when 'e' =>
Debug_Flag_E := Val;
when 'f' =>
Debug_Flag_F := Val;
when 'g' =>
Debug_Flag_G := Val;
when 'h' =>
Debug_Flag_H := Val;
when 'i' =>
Debug_Flag_I := Val;
when 'j' =>
Debug_Flag_J := Val;
when 'k' =>
Debug_Flag_K := Val;
when 'l' =>
Debug_Flag_L := Val;
when 'm' =>
Debug_Flag_M := Val;
when 'n' =>
Debug_Flag_N := Val;
when 'o' =>
Debug_Flag_O := Val;
when 'p' =>
Debug_Flag_P := Val;
when 'q' =>
Debug_Flag_Q := Val;
when 'r' =>
Debug_Flag_R := Val;
when 's' =>
Debug_Flag_S := Val;
when 't' =>
Debug_Flag_T := Val;
when 'u' =>
Debug_Flag_U := Val;
when 'v' =>
Debug_Flag_V := Val;
when 'w' =>
Debug_Flag_W := Val;
when 'x' =>
Debug_Flag_X := Val;
when 'y' =>
Debug_Flag_Y := Val;
when 'z' =>
Debug_Flag_Z := Val;
end case;
end if;
end Set_Debug_Flag;
---------------------------
-- Set_Dotted_Debug_Flag --
---------------------------
procedure Set_Dotted_Debug_Flag (C : Character; Val : Boolean := True) is
subtype Dig is Character range '1' .. '9';
subtype LLet is Character range 'a' .. 'z';
subtype ULet is Character range 'A' .. 'Z';
begin
if C in Dig then
case Dig (C) is
when '1' =>
Debug_Flag_Dot_1 := Val;
when '2' =>
Debug_Flag_Dot_2 := Val;
when '3' =>
Debug_Flag_Dot_3 := Val;
when '4' =>
Debug_Flag_Dot_4 := Val;
when '5' =>
Debug_Flag_Dot_5 := Val;
when '6' =>
Debug_Flag_Dot_6 := Val;
when '7' =>
Debug_Flag_Dot_7 := Val;
when '8' =>
Debug_Flag_Dot_8 := Val;
when '9' =>
Debug_Flag_Dot_9 := Val;
end case;
elsif C in ULet then
case ULet (C) is
when 'A' =>
Debug_Flag_Dot_AA := Val;
when 'B' =>
Debug_Flag_Dot_BB := Val;
when 'C' =>
Debug_Flag_Dot_CC := Val;
when 'D' =>
Debug_Flag_Dot_DD := Val;
when 'E' =>
Debug_Flag_Dot_EE := Val;
when 'F' =>
Debug_Flag_Dot_FF := Val;
when 'G' =>
Debug_Flag_Dot_GG := Val;
when 'H' =>
Debug_Flag_Dot_HH := Val;
when 'I' =>
Debug_Flag_Dot_II := Val;
when 'J' =>
Debug_Flag_Dot_JJ := Val;
when 'K' =>
Debug_Flag_Dot_KK := Val;
when 'L' =>
Debug_Flag_Dot_LL := Val;
when 'M' =>
Debug_Flag_Dot_MM := Val;
when 'N' =>
Debug_Flag_Dot_NN := Val;
when 'O' =>
Debug_Flag_Dot_OO := Val;
when 'P' =>
Debug_Flag_Dot_PP := Val;
when 'Q' =>
Debug_Flag_Dot_QQ := Val;
when 'R' =>
Debug_Flag_Dot_RR := Val;
when 'S' =>
Debug_Flag_Dot_SS := Val;
when 'T' =>
Debug_Flag_Dot_TT := Val;
when 'U' =>
Debug_Flag_Dot_UU := Val;
when 'V' =>
Debug_Flag_Dot_VV := Val;
when 'W' =>
Debug_Flag_Dot_WW := Val;
when 'X' =>
Debug_Flag_Dot_XX := Val;
when 'Y' =>
Debug_Flag_Dot_YY := Val;
when 'Z' =>
Debug_Flag_Dot_ZZ := Val;
end case;
else
case LLet (C) is
when 'a' =>
Debug_Flag_Dot_A := Val;
when 'b' =>
Debug_Flag_Dot_B := Val;
when 'c' =>
Debug_Flag_Dot_C := Val;
when 'd' =>
Debug_Flag_Dot_D := Val;
when 'e' =>
Debug_Flag_Dot_E := Val;
when 'f' =>
Debug_Flag_Dot_F := Val;
when 'g' =>
Debug_Flag_Dot_G := Val;
when 'h' =>
Debug_Flag_Dot_H := Val;
when 'i' =>
Debug_Flag_Dot_I := Val;
when 'j' =>
Debug_Flag_Dot_J := Val;
when 'k' =>
Debug_Flag_Dot_K := Val;
when 'l' =>
Debug_Flag_Dot_L := Val;
when 'm' =>
Debug_Flag_Dot_M := Val;
when 'n' =>
Debug_Flag_Dot_N := Val;
when 'o' =>
Debug_Flag_Dot_O := Val;
when 'p' =>
Debug_Flag_Dot_P := Val;
when 'q' =>
Debug_Flag_Dot_Q := Val;
when 'r' =>
Debug_Flag_Dot_R := Val;
when 's' =>
Debug_Flag_Dot_S := Val;
when 't' =>
Debug_Flag_Dot_T := Val;
when 'u' =>
Debug_Flag_Dot_U := Val;
when 'v' =>
Debug_Flag_Dot_V := Val;
when 'w' =>
Debug_Flag_Dot_W := Val;
when 'x' =>
Debug_Flag_Dot_X := Val;
when 'y' =>
Debug_Flag_Dot_Y := Val;
when 'z' =>
Debug_Flag_Dot_Z := Val;
end case;
end if;
end Set_Dotted_Debug_Flag;
--------------------------------
-- Set_Underscored_Debug_Flag --
--------------------------------
procedure Set_Underscored_Debug_Flag
(C : Character;
Val : Boolean := True)
is
subtype Dig is Character range '1' .. '9';
subtype LLet is Character range 'a' .. 'z';
subtype ULet is Character range 'A' .. 'Z';
begin
if C in Dig then
case Dig (C) is
when '1' =>
Debug_Flag_Underscore_1 := Val;
when '2' =>
Debug_Flag_Underscore_2 := Val;
when '3' =>
Debug_Flag_Underscore_3 := Val;
when '4' =>
Debug_Flag_Underscore_4 := Val;
when '5' =>
Debug_Flag_Underscore_5 := Val;
when '6' =>
Debug_Flag_Underscore_6 := Val;
when '7' =>
Debug_Flag_Underscore_7 := Val;
when '8' =>
Debug_Flag_Underscore_8 := Val;
when '9' =>
Debug_Flag_Underscore_9 := Val;
end case;
elsif C in ULet then
case ULet (C) is
when 'A' =>
Debug_Flag_Underscore_AA := Val;
when 'B' =>
Debug_Flag_Underscore_BB := Val;
when 'C' =>
Debug_Flag_Underscore_CC := Val;
when 'D' =>
Debug_Flag_Underscore_DD := Val;
when 'E' =>
Debug_Flag_Underscore_EE := Val;
when 'F' =>
Debug_Flag_Underscore_FF := Val;
when 'G' =>
Debug_Flag_Underscore_GG := Val;
when 'H' =>
Debug_Flag_Underscore_HH := Val;
when 'I' =>
Debug_Flag_Underscore_II := Val;
when 'J' =>
Debug_Flag_Underscore_JJ := Val;
when 'K' =>
Debug_Flag_Underscore_KK := Val;
when 'L' =>
Debug_Flag_Underscore_LL := Val;
when 'M' =>
Debug_Flag_Underscore_MM := Val;
when 'N' =>
Debug_Flag_Underscore_NN := Val;
when 'O' =>
Debug_Flag_Underscore_OO := Val;
when 'P' =>
Debug_Flag_Underscore_PP := Val;
when 'Q' =>
Debug_Flag_Underscore_QQ := Val;
when 'R' =>
Debug_Flag_Underscore_RR := Val;
when 'S' =>
Debug_Flag_Underscore_SS := Val;
when 'T' =>
Debug_Flag_Underscore_TT := Val;
when 'U' =>
Debug_Flag_Underscore_UU := Val;
when 'V' =>
Debug_Flag_Underscore_VV := Val;
when 'W' =>
Debug_Flag_Underscore_WW := Val;
when 'X' =>
Debug_Flag_Underscore_XX := Val;
when 'Y' =>
Debug_Flag_Underscore_YY := Val;
when 'Z' =>
Debug_Flag_Underscore_ZZ := Val;
end case;
else
case LLet (C) is
when 'a' =>
Debug_Flag_Underscore_A := Val;
when 'b' =>
Debug_Flag_Underscore_B := Val;
when 'c' =>
Debug_Flag_Underscore_C := Val;
when 'd' =>
Debug_Flag_Underscore_D := Val;
when 'e' =>
Debug_Flag_Underscore_E := Val;
when 'f' =>
Debug_Flag_Underscore_F := Val;
when 'g' =>
Debug_Flag_Underscore_G := Val;
when 'h' =>
Debug_Flag_Underscore_H := Val;
when 'i' =>
Debug_Flag_Underscore_I := Val;
when 'j' =>
Debug_Flag_Underscore_J := Val;
when 'k' =>
Debug_Flag_Underscore_K := Val;
when 'l' =>
Debug_Flag_Underscore_L := Val;
when 'm' =>
Debug_Flag_Underscore_M := Val;
when 'n' =>
Debug_Flag_Underscore_N := Val;
when 'o' =>
Debug_Flag_Underscore_O := Val;
when 'p' =>
Debug_Flag_Underscore_P := Val;
when 'q' =>
Debug_Flag_Underscore_Q := Val;
when 'r' =>
Debug_Flag_Underscore_R := Val;
when 's' =>
Debug_Flag_Underscore_S := Val;
when 't' =>
Debug_Flag_Underscore_T := Val;
when 'u' =>
Debug_Flag_Underscore_U := Val;
when 'v' =>
Debug_Flag_Underscore_V := Val;
when 'w' =>
Debug_Flag_Underscore_W := Val;
when 'x' =>
Debug_Flag_Underscore_X := Val;
when 'y' =>
Debug_Flag_Underscore_Y := Val;
when 'z' =>
Debug_Flag_Underscore_Z := Val;
end case;
end if;
end Set_Underscored_Debug_Flag;
end Debug;
|
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE boost_serialization>
<boost_serialization signature="serialization::archive" version="14">
<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>linebuffer</name>
<ret_bitwidth>0</ret_bitwidth>
<ports class_id="2" tracking_level="0" version="0">
<count>2</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>in_stream_V_value_V</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>in_stream.V.value.V</originalName>
<rtlName></rtlName>
<coreName>FIFO_SRL</coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<direction>0</direction>
<if_type>3</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>out_stream_V_value_V</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>out_stream.V.value.V</originalName>
<rtlName></rtlName>
<coreName>FIFO_SRL</coreName>
</Obj>
<bitwidth>288</bitwidth>
</Value>
<direction>1</direction>
<if_type>3</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>2</count>
<item_version>0</item_version>
<item class_id="9" tracking_level="1" version="0" object_id="_3">
<Value>
<Obj>
<type>0</type>
<id>12</id>
<name></name>
<fileName>../../../lib_files/Linebuffer.h</fileName>
<fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_32_real/conv2d</fileDirectory>
<lineNumber>403</lineNumber>
<contextFuncName>linebuffer_2D&lt;1920, 1080, 1, 1, 1, 1, 3, 3, unsigned int&gt;</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item class_id="10" tracking_level="0" version="0">
<first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_32_real/conv2d</first>
<second class_id="11" tracking_level="0" version="0">
<count>4</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>../../../lib_files/Linebuffer.h</first>
<second>linebuffer&lt;1920, 1080, 1, 1, 1, 1, 1, 1, 3, 3, 1, 1, unsigned int&gt;</second>
</first>
<second>530</second>
</item>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>linebuffer_2D&lt;1920, 1080, 1, 1, 1, 1, 3, 3, unsigned int&gt;</second>
</first>
<second>403</second>
</item>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>linebuffer_3D&lt;1920, 1080, 1, 1, 1, 3, 3, 1, 1, unsigned int&gt;</second>
</first>
<second>492</second>
</item>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>linebuffer_4D&lt;1920, 1080, 1, 1, 1, 1, 1, 3, 3, 1, 1, unsigned int&gt;</second>
</first>
<second>505</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>16</item>
<item>17</item>
<item>18</item>
</oprand_edges>
<opcode>call</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_4">
<Value>
<Obj>
<type>0</type>
<id>13</id>
<name></name>
<fileName>../../../lib_files/Linebuffer.h</fileName>
<fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_32_real/conv2d</fileDirectory>
<lineNumber>531</lineNumber>
<contextFuncName>linebuffer&lt;1920, 1080, 1, 1, 1, 1, 1, 1, 3, 3, 1, 1, unsigned int&gt;</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_32_real/conv2d</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>linebuffer&lt;1920, 1080, 1, 1, 1, 1, 1, 1, 3, 3, 1, 1, unsigned int&gt;</second>
</first>
<second>531</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>0</count>
<item_version>0</item_version>
</oprand_edges>
<opcode>ret</opcode>
<m_Display>0</m_Display>
</item>
</nodes>
<consts class_id="15" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="16" tracking_level="1" version="0" object_id="_5">
<Value>
<Obj>
<type>2</type>
<id>15</id>
<name>call</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<const_type>6</const_type>
<content><constant:call></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="_6">
<Obj>
<type>3</type>
<id>14</id>
<name>linebuffer</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>2</count>
<item_version>0</item_version>
<item>12</item>
<item>13</item>
</node_objs>
</item>
</blocks>
<edges class_id="19" tracking_level="0" version="0">
<count>3</count>
<item_version>0</item_version>
<item class_id="20" tracking_level="1" version="0" object_id="_7">
<id>16</id>
<edge_type>1</edge_type>
<source_obj>15</source_obj>
<sink_obj>12</sink_obj>
</item>
<item class_id_reference="20" object_id="_8">
<id>17</id>
<edge_type>1</edge_type>
<source_obj>1</source_obj>
<sink_obj>12</sink_obj>
</item>
<item class_id_reference="20" object_id="_9">
<id>18</id>
<edge_type>1</edge_type>
<source_obj>2</source_obj>
<sink_obj>12</sink_obj>
</item>
</edges>
</cdfg>
<cdfg_regions class_id="21" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="22" tracking_level="1" version="0" object_id="_10">
<mId>1</mId>
<mTag>linebuffer</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>14</item>
</basic_blocks>
<mII>-1</mII>
<mDepth>-1</mDepth>
<mMinTripCount>-1</mMinTripCount>
<mMaxTripCount>-1</mMaxTripCount>
<mMinLatency>2077921</mMinLatency>
<mMaxLatency>-1</mMaxLatency>
<mIsDfPipe>1</mIsDfPipe>
<mDfPipe class_id="23" tracking_level="1" version="0" object_id="_11">
<port_list class_id="24" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</port_list>
<process_list class_id="25" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="26" tracking_level="1" version="0" object_id="_12">
<type>0</type>
<name>call_U0</name>
<ssdmobj_id>12</ssdmobj_id>
<pins class_id="27" tracking_level="0" version="0">
<count>2</count>
<item_version>0</item_version>
<item class_id="28" tracking_level="1" version="0" object_id="_13">
<port class_id="29" tracking_level="1" version="0" object_id="_14">
<name>in_stream_V_value_V</name>
<dir>0</dir>
<type>0</type>
</port>
<inst class_id="30" tracking_level="1" version="0" object_id="_15">
<type>0</type>
<name>call_U0</name>
<ssdmobj_id>12</ssdmobj_id>
</inst>
</item>
<item class_id_reference="28" object_id="_16">
<port class_id_reference="29" object_id="_17">
<name>out_stream_V_value_V</name>
<dir>0</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id_reference="_15"></inst>
</item>
</pins>
</item>
</process_list>
<channel_list class_id="31" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</channel_list>
<net_list class_id="32" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</net_list>
</mDfPipe>
</item>
</cdfg_regions>
<fsm class_id="33" tracking_level="1" version="0" object_id="_18">
<states class_id="34" tracking_level="0" version="0">
<count>2</count>
<item_version>0</item_version>
<item class_id="35" tracking_level="1" version="0" object_id="_19">
<id>1</id>
<operations class_id="36" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="37" tracking_level="1" version="0" object_id="_20">
<id>12</id>
<stage>2</stage>
<latency>2</latency>
</item>
</operations>
</item>
<item class_id_reference="35" object_id="_21">
<id>2</id>
<operations>
<count>11</count>
<item_version>0</item_version>
<item class_id_reference="37" object_id="_22">
<id>3</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="37" object_id="_23">
<id>4</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="37" object_id="_24">
<id>5</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="37" object_id="_25">
<id>6</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="37" object_id="_26">
<id>7</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="37" object_id="_27">
<id>8</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="37" object_id="_28">
<id>9</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="37" object_id="_29">
<id>10</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="37" object_id="_30">
<id>11</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="37" object_id="_31">
<id>12</id>
<stage>1</stage>
<latency>2</latency>
</item>
<item class_id_reference="37" object_id="_32">
<id>13</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
</states>
<transitions class_id="38" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="39" tracking_level="1" version="0" object_id="_33">
<inState>1</inState>
<outState>2</outState>
<condition class_id="40" tracking_level="0" version="0">
<id>0</id>
<sop class_id="41" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="42" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</item>
</sop>
</condition>
</item>
</transitions>
</fsm>
<res class_id="-1"></res>
<node_label_latency class_id="44" tracking_level="0" version="0">
<count>2</count>
<item_version>0</item_version>
<item class_id="45" tracking_level="0" version="0">
<first>12</first>
<second class_id="46" tracking_level="0" version="0">
<first>0</first>
<second>1</second>
</second>
</item>
<item>
<first>13</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
</node_label_latency>
<bblk_ent_exit class_id="47" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="48" tracking_level="0" version="0">
<first>14</first>
<second class_id="49" tracking_level="0" version="0">
<first>0</first>
<second>1</second>
</second>
</item>
</bblk_ent_exit>
<regions class_id="50" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="51" tracking_level="1" version="0" object_id="_34">
<region_name>linebuffer</region_name>
<basic_blocks>
<count>1</count>
<item_version>0</item_version>
<item>14</item>
</basic_blocks>
<nodes>
<count>11</count>
<item_version>0</item_version>
<item>3</item>
<item>4</item>
<item>5</item>
<item>6</item>
<item>7</item>
<item>8</item>
<item>9</item>
<item>10</item>
<item>11</item>
<item>12</item>
<item>13</item>
</nodes>
<anchor_node>-1</anchor_node>
<region_type>16</region_type>
<interval>0</interval>
<pipe_depth>0</pipe_depth>
</item>
</regions>
<dp_fu_nodes class_id="52" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="53" tracking_level="0" version="0">
<first>36</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>12</item>
<item>12</item>
</second>
</item>
</dp_fu_nodes>
<dp_fu_nodes_expression class_id="55" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_fu_nodes_expression>
<dp_fu_nodes_module>
<count>1</count>
<item_version>0</item_version>
<item class_id="56" tracking_level="0" version="0">
<first>grp_call_fu_36</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>12</item>
<item>12</item>
</second>
</item>
</dp_fu_nodes_module>
<dp_fu_nodes_io>
<count>0</count>
<item_version>0</item_version>
</dp_fu_nodes_io>
<return_ports>
<count>0</count>
<item_version>0</item_version>
</return_ports>
<dp_mem_port_nodes class_id="57" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_mem_port_nodes>
<dp_reg_nodes>
<count>0</count>
<item_version>0</item_version>
</dp_reg_nodes>
<dp_regname_nodes>
<count>0</count>
<item_version>0</item_version>
</dp_regname_nodes>
<dp_reg_phi>
<count>0</count>
<item_version>0</item_version>
</dp_reg_phi>
<dp_regname_phi>
<count>0</count>
<item_version>0</item_version>
</dp_regname_phi>
<dp_port_io_nodes class_id="58" tracking_level="0" version="0">
<count>2</count>
<item_version>0</item_version>
<item class_id="59" tracking_level="0" version="0">
<first>in_stream_V_value_V</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>call</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>12</item>
</second>
</item>
</second>
</item>
<item>
<first>out_stream_V_value_V</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>call</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>12</item>
</second>
</item>
</second>
</item>
</dp_port_io_nodes>
<port2core class_id="60" tracking_level="0" version="0">
<count>2</count>
<item_version>0</item_version>
<item class_id="61" tracking_level="0" version="0">
<first>1</first>
<second>FIFO_SRL</second>
</item>
<item>
<first>2</first>
<second>FIFO_SRL</second>
</item>
</port2core>
<node2core>
<count>0</count>
<item_version>0</item_version>
</node2core>
</syndb>
</boost_serialization>
|
-- Copyright 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
with Pck; use Pck;
procedure Foo is
type String_Access is access String;
String_P : String_Access := new String'("Hello");
Null_String : String_Access := null;
-- Same situation, but constrained array.
type Little_Array is array (1 .. 10) of Integer;
type Little_Array_Ptr is access all Little_Array;
Arr_Ptr: Little_Array_Ptr :=
new Little_Array'(21, 22, 23, 24, 25, 26, 27, 28, 29, 30);
begin
Do_Nothing (String_P'Address); -- STOP
Do_Nothing (Null_String'Address);
Do_Nothing (Arr_Ptr'Address);
end Foo;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . W C H _ W T S --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2021, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- --
-- --
-- --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package contains the routine used to convert wide strings and wide
-- wide strings to strings for use by wide and wide wide character attributes
-- (value, image etc.) and also by the numeric IO subpackages of
-- Ada.Text_IO.Wide_Text_IO and Ada.Text_IO.Wide_Wide_Text_IO.
with System.WCh_Con;
package System.WCh_WtS is
pragma Pure;
function Wide_String_To_String
(S : Wide_String;
EM : System.WCh_Con.WC_Encoding_Method) return String;
-- This routine simply takes its argument and converts it to a string,
-- using the internal compiler escape sequence convention (defined in
-- package Widechar) to translate characters that are out of range
-- of type String. In the context of the Wide_Value attribute, the
-- argument is the original attribute argument, and the result is used
-- in a call to the corresponding Value attribute function. If the method
-- for encoding is a shift-in, shift-out convention, then it is assumed
-- that normal (non-wide character) mode holds at the start and end of
-- the result string. EM indicates the wide character encoding method.
-- Note: in the WCEM_Brackets case, we only use the brackets encoding
-- for characters greater than 16#FF#. The lowest index of the returned
-- String is equal to S'First.
function Wide_Wide_String_To_String
(S : Wide_Wide_String;
EM : System.WCh_Con.WC_Encoding_Method) return String;
-- Same processing, except for Wide_Wide_String
end System.WCh_WtS;
|
------------------------------------------------------------------------------
-- --
-- Copyright (C) 2015-2016, AdaCore --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- 2. Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- 3. Neither the name of STMicroelectronics nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- Based on ft6x06.h from MCD Application Team
with Ada.Unchecked_Conversion;
with STM32.Board; use STM32.Board;
with STM32.Device; use STM32.Device;
with STM32.I2C; use STM32.I2C;
with STM32.GPIO; use STM32.GPIO;
with STM32.Setup;
with HAL.Touch_Panel; use HAL.Touch_Panel;
with FT6x06; use FT6x06;
with Ada.Real_Time; use Ada.Real_Time;
package body Touch_Panel_FT6x06 is
procedure TP_Init_Pins;
-- Initializes the Touch Panel GPIO pins
---------------
-- Init_Pins --
---------------
procedure TP_Init_Pins
is
begin
Enable_Clock (TP_INT);
Configure_IO (TP_INT,
(Speed => Speed_50MHz,
Mode => Mode_In,
Output_Type => Open_Drain,
Resistors => Pull_Up));
Lock (TP_INT);
end TP_Init_Pins;
----------------
-- Initialize --
----------------
function Initialize
(This : in out Touch_Panel;
Orientation : HAL.Framebuffer.Display_Orientation :=
HAL.Framebuffer.Default) return Boolean
is
begin
TP_Init_Pins;
delay until Clock + Milliseconds (200);
if not TP_I2C.Port_Enabled then
STM32.Setup.Setup_I2C_Master (Port => TP_I2C,
SDA => TP_I2C_SDA,
SCL => TP_I2C_SCL,
SDA_AF => TP_I2C_AF,
SCL_AF => TP_I2C_AF,
Clock_Speed => 100_000);
end if;
This.TP_Set_Use_Interrupts (False);
This.Set_Orientation (Orientation);
return This.Check_Id;
end Initialize;
----------------
-- Initialize --
----------------
procedure Initialize (This : in out Touch_Panel;
Orientation : HAL.Framebuffer.Display_Orientation :=
HAL.Framebuffer.Default) is
begin
if not This.Initialize (Orientation) then
raise Constraint_Error with "Cannot initialize the touch panel";
end if;
end Initialize;
---------------------
-- Set_Orientation --
---------------------
procedure Set_Orientation
(This : in out Touch_Panel;
Orientation : HAL.Framebuffer.Display_Orientation)
is
begin
case Orientation is
when HAL.Framebuffer.Default | HAL.Framebuffer.Landscape =>
This.Set_Bounds (LCD_Natural_Width,
LCD_Natural_Height,
Invert_Y);
when HAL.Framebuffer.Portrait =>
This.Set_Bounds (LCD_Natural_Width,
LCD_Natural_Height,
Swap_XY);
end case;
end Set_Orientation;
end Touch_Panel_FT6x06;
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, Vadim Godunko <vgodunko@gmail.com> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
with AMF.Generic_Collections;
package AMF.UML.Read_Structural_Feature_Actions.Collections is
pragma Preelaborate;
package UML_Read_Structural_Feature_Action_Collections is
new AMF.Generic_Collections
(UML_Read_Structural_Feature_Action,
UML_Read_Structural_Feature_Action_Access);
type Set_Of_UML_Read_Structural_Feature_Action is
new UML_Read_Structural_Feature_Action_Collections.Set with null record;
Empty_Set_Of_UML_Read_Structural_Feature_Action : constant Set_Of_UML_Read_Structural_Feature_Action;
type Ordered_Set_Of_UML_Read_Structural_Feature_Action is
new UML_Read_Structural_Feature_Action_Collections.Ordered_Set with null record;
Empty_Ordered_Set_Of_UML_Read_Structural_Feature_Action : constant Ordered_Set_Of_UML_Read_Structural_Feature_Action;
type Bag_Of_UML_Read_Structural_Feature_Action is
new UML_Read_Structural_Feature_Action_Collections.Bag with null record;
Empty_Bag_Of_UML_Read_Structural_Feature_Action : constant Bag_Of_UML_Read_Structural_Feature_Action;
type Sequence_Of_UML_Read_Structural_Feature_Action is
new UML_Read_Structural_Feature_Action_Collections.Sequence with null record;
Empty_Sequence_Of_UML_Read_Structural_Feature_Action : constant Sequence_Of_UML_Read_Structural_Feature_Action;
private
Empty_Set_Of_UML_Read_Structural_Feature_Action : constant Set_Of_UML_Read_Structural_Feature_Action
:= (UML_Read_Structural_Feature_Action_Collections.Set with null record);
Empty_Ordered_Set_Of_UML_Read_Structural_Feature_Action : constant Ordered_Set_Of_UML_Read_Structural_Feature_Action
:= (UML_Read_Structural_Feature_Action_Collections.Ordered_Set with null record);
Empty_Bag_Of_UML_Read_Structural_Feature_Action : constant Bag_Of_UML_Read_Structural_Feature_Action
:= (UML_Read_Structural_Feature_Action_Collections.Bag with null record);
Empty_Sequence_Of_UML_Read_Structural_Feature_Action : constant Sequence_Of_UML_Read_Structural_Feature_Action
:= (UML_Read_Structural_Feature_Action_Collections.Sequence with null record);
end AMF.UML.Read_Structural_Feature_Actions.Collections;
|
with MSPGD;
package MSPGD.GPIO is
pragma Preelaborate;
type Alt_Func_Type is (IO, Primary, Secondary, Device_Specific, Analog, Comparator);
type Direction_Type is (Input, Output);
type Resistor_Type is (None, Up, Down);
subtype Pin_Type is Integer range 0 .. 7;
subtype Port_Type is Unsigned_8 range 1 .. 8;
end MSPGD.GPIO;
|
-- Smart_Ptrs_Tests
-- Unit tests for Auto_Counters Smart_Ptrs package
-- Copyright (c) 2016, James Humphry - see LICENSE file for details
with AUnit.Assertions;
with Smart_Ptrs;
with Auto_Counters_Tests_Config;
package body Smart_Ptrs_Tests is
use AUnit.Assertions;
Resources_Released : Natural := 0;
procedure Deletion_Recorder (X : in out String) is
pragma Unreferenced (X);
begin
Resources_Released := Resources_Released + 1;
end Deletion_Recorder;
type String_Ptr is access String;
package String_Ptrs is new Smart_Ptrs(T => String,
T_Ptr => String_Ptr,
Counters => Counters,
Delete => Deletion_Recorder
);
use String_Ptrs;
--------------------
-- Register_Tests --
--------------------
procedure Register_Tests (T: in out Smart_Ptrs_Test) is
use AUnit.Test_Cases.Registration;
begin
for I of Test_Details_List loop
Register_Routine(T, I.T, To_String(I.D));
end loop;
end Register_Tests;
----------
-- Name --
----------
function Name (T : Smart_Ptrs_Test) return Test_String is
pragma Unreferenced (T);
begin
return Format ("Tests of Smart_Ptrs with " &
Counter_Type_Name);
end Name;
------------
-- Set_Up --
------------
procedure Set_Up (T : in out Smart_Ptrs_Test) is
begin
null;
end Set_Up;
---------------------
-- Check_Smart_Ptr --
---------------------
procedure Check_Smart_Ptr (T : in out Test_Cases.Test_Case'Class) is
pragma Unreferenced(T);
SP1 : Smart_Ptr := Make_Smart_Ptr(new String'("Hello, World!"));
SP2 : Smart_Ptr;
begin
Assert(Null_Smart_Ptr.Is_Null,
"Null_Smart_Ptr.Is_Null is not true");
Assert((not SP1.Is_Null and
SP1.Use_Count = 1 and
SP1.Unique and
SP1.Weak_Ptr_Count = 0),
"Initialized non-null Smart_Ptr has incorrect properties");
Assert((SP2.Is_Null and
SP2.Use_Count = 1 and
SP2.Unique and
SP2.Weak_Ptr_Count = 0),
"Initialized null Smart_Ptr has incorrect properties");
SP2 := SP1;
Assert(SP1 = SP2, "Assignment of Smart_Ptrs does not make them equal");
Assert(SP1.Use_Count = 2 and
not SP1.Unique and
SP1.Weak_Ptr_Count = 0,
"Assignment does not increase reference counts properly");
SP1.P := "World, Hello!";
Assert(SP2.P = "World, Hello!",
"Changing a value via a reference from one Smart_Ptr does not " &
"change the value accessed via an equal Smart_Ptr");
SP2.Get(6) := ':';
Assert(SP1.Get.all = "World: Hello!",
"Changing a value via an access value from one Smart_Ptr does " &
"not change the value accessed via an equal Smart_Ptr");
Resources_Released := 0;
declare
SP3 : constant Smart_Ptr := SP1;
begin
Assert(SP1 = SP3, "Creation of a Smart_Ptr in an inner block failed");
Assert(SP3.Use_Count = 3,
"Creation of a Smart_Ptr in a block fails to set counts");
end;
Assert(SP1.Use_Count = 2,
"Destruction of inner block Smart_Ptr does not reduce Use_Count");
Assert(Resources_Released = 0,
"Resources released incorrectly when 2 Smart_Ptr remain");
Resources_Released := 0;
SP2 := Null_Smart_Ptr;
Assert((SP2.Is_Null and
SP2.Use_Count = 1 and
SP2.Unique and
SP2.Weak_Ptr_Count = 0),
"Assigning null to a Smart_Ptr does not give correct properties");
Assert(Resources_Released = 0,
"Resources released incorrectly when 1 Smart_Ptr remains");
SP1 := Null_Smart_Ptr;
Assert((SP1.Is_Null and
SP1.Use_Count = 1 and
SP1.Unique and
SP1.Weak_Ptr_Count = 0),
"Assigning null to a Smart_Ptr does not give correct properties");
Assert(Resources_Released = 1,
"Resources were not released when last Smart_Ptr destroyed");
Assert(SP1 = SP2, "Null Smart_Ptrs are not equal");
end Check_Smart_Ptr;
---------------------
-- Check_Weak_Ptrs --
---------------------
procedure Check_Weak_Ptrs (T : in out Test_Cases.Test_Case'Class) is
pragma Unreferenced(T);
SP1 : Smart_Ptr := Make_Smart_Ptr(new String'("Hello, World!"));
SP2 : Smart_Ptr;
WP1 : constant Weak_Ptr := Make_Weak_Ptr(SP1);
procedure Make_WP_From_Null_SP is
WP2 : constant Weak_Ptr := Make_Weak_Ptr(SP2);
pragma Unreferenced (WP2);
begin
null;
end Make_WP_From_Null_SP;
Caught_Making_WP_From_Null_SP : Boolean := False;
Caught_Lock_On_Expired_WP : Boolean := False;
begin
Assert(SP1.Weak_Ptr_Count = 1,
"Initialized Weak_Ptr not reflected in Smart_Ptr");
Assert(WP1.Use_Count = 1,
"Weak_Ptr not reflecting the correct Use_Count");
Assert(not WP1.Expired,
"Weak_Ptr is (incorrectly) already expired just after creation");
if Auto_Counters_Tests_Config.Assertions_Enabled then
begin
Make_WP_From_Null_SP;
exception
when Smart_Ptr_Error =>
Caught_Making_WP_From_Null_SP := True;
end;
Assert(Caught_Making_WP_From_Null_SP,
"Make_Weak_ptr failed to raise exception when called on a null" &
"Smart_Ptr");
end if;
SP2 := WP1.Lock;
Assert(SP1 = SP2,
"Smart_Ptr recovered from Weak_Ptr /= original Smart_Ptr");
Assert(WP1.Use_Count = 2,
"Weak_Ptr has incorrect Use_Count after making new Smart_Ptr");
Assert(SP1.Use_Count = 2,
"Smart_Ptr made from Weak_Ptr has incorrect Use_Count");
SP2 := WP1.Lock_Or_Null;
Assert(SP1 = SP2,
"Smart_Ptr recovered from Weak_Ptr.Get /= original Smart_Ptr");
Assert(WP1.Use_Count = 2,
"Weak_Ptr has incorrect Use_Count after new Smart_Ptr via Get");
Assert(SP1.Use_Count = 2,
"Smart_Ptr made from Weak_Ptr.Get has incorrect Use_Count");
Resources_Released := 0;
SP2 := Null_Smart_Ptr;
Assert(SP1.Weak_Ptr_Count = 1,
"Weak_Ptr_Count incorrect after discarding Smart_Ptr");
Assert(WP1.Use_Count = 1,
"Weak_Ptr not reflecting the correct Use_Count");
Assert(not WP1.Expired,
"Weak_Ptr is already expired after only 1/2 Smart_Ptrs deleted");
Assert(Resources_Released = 0,
"Resources released incorrectly when 1 Smart_Ptr remains");
SP1 := Null_Smart_Ptr;
Assert(SP1.Weak_Ptr_Count = 0,
"Smart_Ptr does not have correct Weak_Ptr_Count after nulling");
Assert(Resources_Released = 1,
"Resources released incorrectly when only a Weak_Ptr remains");
Assert(WP1.Expired,
"Weak_Ptr should be expired as all Smart_Ptrs deleted");
Assert(WP1.Weak_Ptr_Count = 1,
"Weak_Ptr_Count incorrect after discarding all Smart_Ptr");
Assert(WP1.Use_Count = 0,
"Weak_Ptr not reflecting the correct Use_Count of 0");
begin
SP1 := WP1.Lock;
exception
when Smart_Ptr_Error =>
Caught_Lock_On_Expired_WP := True;
end;
Assert(Caught_Lock_On_Expired_WP,
"Weak_Ptr.Lock failed to raise exception when Lock was called " &
"on an expired Weak_Ptr");
SP1 := WP1.Lock_Or_Null;
Assert(SP1 = Null_Smart_Ptr,
"Weak_Ptr.Get failed to return a null Smart_Ptr when Get was " &
"called on an expired Weak_Ptr");
end Check_Weak_Ptrs;
-----------------
-- Check_WP_SR --
-----------------
procedure Check_WP_SR (T : in out Test_Cases.Test_Case'Class) is
pragma Unreferenced(T);
SR1 : constant Smart_Ref := Make_Smart_Ref(new String'("Hello, World!"));
WP1 : Weak_Ptr := Make_Weak_Ptr(SR1);
SP1 : Smart_Ptr;
Caught_Lock_On_Expired_WP : Boolean := False;
begin
Assert(SR1.Weak_Ptr_Count = 1,
"Initialized Weak_Ptr not reflected in Smart_Ref");
Assert(WP1.Use_Count = 1,
"Weak_Ptr not reflecting the correct Use_Count");
Assert(not WP1.Expired,
"Weak_Ptr is (incorrectly) already expired just after creation");
SP1 := WP1.Lock;
Assert(SR1 = SP1.P,
"Smart_Ptr recovered from Weak_Ptr /= original Smart_Ref");
Assert(WP1.Use_Count = 2,
"Weak_Ptr has incorrect Use_Count after making new Smart_Ptr");
Assert(SP1.Use_Count = 2,
"Smart_Ptr made from Weak_Ptr has incorrect Use_Count");
Resources_Released := 0;
declare
SR2 : constant Smart_Ref := WP1.Lock;
begin
Assert(SR2 = String'(SR1),
"Smart_Ref recovered from Weak_Ptr /= original Smart_Ref");
Assert(SR2.Use_Count = 3,
"Smart_Ref recovered from Weak_Ptr not adjusting Use_Count");
end;
Assert(Resources_Released = 0,
"Recovering and destroying Smart_Ref from Weak_Ptr has released " &
"resources despite remaining Smart_Ref and Smart_Ptr");
Assert(SR1.Use_Count = 2,
"Recovering and destroying Smart_Ref from Weak_Ptr has resulted " &
"in incorrect Use_Count on remaining Smart_Ref ");
Resources_Released := 0;
declare
SR3 : constant Smart_Ref
:= Make_Smart_Ref(new String'("Goodbye, World!"));
begin
WP1 := SR3.Make_Weak_Ptr;
end;
Assert(Resources_Released = 1,
"Creation of Weak_Ptr from Smart_Ref prevented resources from " &
"being released.");
Assert(WP1.Expired,
"Weak_Ptr not expired when source Smart_Ref is destroyed");
Assert(WP1.Use_Count = 0,
"Expired Weak_Ptr has incorrect Use_Count");
begin
declare
SR4 : constant Smart_Ref := WP1.Lock;
pragma Unreferenced (SR4);
begin
null;
end;
exception
when Smart_Ptr_Error =>
Caught_Lock_On_Expired_WP := True;
end;
Assert(Caught_Lock_On_Expired_WP,
"Weak_Ptr.Lock failed to raise exception when Lock was called " &
"on an expired Weak_Ptr");
end Check_WP_SR;
---------------------
-- Check_Smart_Ref --
---------------------
procedure Check_Smart_Ref (T : in out Test_Cases.Test_Case'Class) is
pragma Unreferenced(T);
SR1 : constant Smart_Ref := Make_Smart_Ref(new String'("Hello, World!"));
procedure Make_SR_from_Local is
S : aliased String := "Test";
SR : Smart_Ref(Element => S'Access);
pragma Unreferenced (SR);
begin
null;
end Make_SR_from_Local;
procedure Make_SR_from_null is
SR : Smart_Ref := Make_Smart_Ref(null);
pragma Unreferenced (SR);
begin
null;
end Make_SR_from_null;
Caught_Make_SR_from_Local : Boolean := False;
Caught_Make_SR_from_Null : Boolean := False;
begin
Assert((SR1.Use_Count = 1 and
SR1.Unique and
SR1.Weak_Ptr_Count = 0),
"Initialized Smart_Ref has incorrect properties");
Resources_Released := 0;
declare
SR2 : constant Smart_Ref := SR1;
begin
Assert(SR1.Element = SR2.Element,
"Assignment of Smart_Ref does not make them equal");
Assert(SR1.Use_Count = 2 and
not SR1.Unique and
SR1.Weak_Ptr_Count = 0,
"Assignment does not increase reference counts properly");
SR1 := "World, Hello!";
Assert(SR2 = "World, Hello!",
"Changing a value via a reference from one Smart_Ref does " &
"not change the value accessed via an equal Smart_Ref");
SR2.Get(6) := ':';
Assert(SR1.Get.all = "World: Hello!",
"Changing a value via an access value from one Smart_Ref " &
"does not change the value accessed via an equal Smart_Ref");
end;
Assert(SR1.Use_Count = 1,
"Destruction of inner block Smart_Ref does not reduce Use_Count");
Assert(Resources_Released = 0,
"Resources released incorrectly when 1 Smart_Ref remains");
Resources_Released := 0;
declare
SR3 : constant Smart_Ref := Make_Smart_Ref(new String'("Goodbye, World!"));
begin
Assert(SR3 = "Goodbye, World!", "Create of Smart_Ref not working");
end;
Assert(Resources_Released = 1,
"Resources not released when no Smart_Ref remain");
begin
Make_SR_from_Local;
exception
when Smart_Ptr_Error =>
Caught_Make_SR_from_Local := True;
end;
Assert(Caught_Make_SR_from_Local,
"Failed to identify Smart_Ref being set to a local");
if Auto_Counters_Tests_Config.Assertions_Enabled then
begin
Make_SR_from_null;
exception
when Smart_Ptr_Error =>
Caught_Make_SR_from_Null := True;
end;
Assert(Caught_Make_SR_from_Null,
"Failed to identify Smart_Ref being made from a null");
end if;
end Check_Smart_Ref;
-----------------
-- Check_SP_SR --
-----------------
procedure Check_SP_SR (T : in out Test_Cases.Test_Case'Class) is
pragma Unreferenced(T);
SR1 : constant Smart_Ref := Make_Smart_Ref(new String'("Smart_Ref"));
SP1 : constant Smart_Ptr := Make_Smart_Ptr(SR1);
SP2 : constant Smart_Ptr := Make_Smart_Ptr(new String'("Smart_Ptr"));
procedure Make_SR_from_null_SP is
SP : Smart_Ptr;
SR : Smart_Ref := Make_Smart_Ref(SP);
pragma Unreferenced (SR);
begin
null;
end Make_SR_from_null_SP;
Caught_Make_SR_from_Null_SP : Boolean := False;
begin
Assert(SR1 = SP1.P,
"Smart_Ptr and Smart_Ref do not have same contents after " &
"assignment");
Assert(SR1 = SP1.Get.all,
"Smart_Ptr and Smart_Ref do not have same contents after " &
"assignment (using Smart_Ptr.Get.all)");
Assert(SR1.Use_Count = 2 and SP1.Use_Count = 2,
"Smart_Ptr and Smart_Ref do not have correct Use_Count");
Resources_Released := 0;
declare
SR2 : constant Smart_Ref := Make_Smart_Ref(SP2);
begin
Assert(SR2.Use_Count = 2 and SP2.Use_Count = 2,
"Smart_Ptr and Smart_Ref do not have correct Use_Count");
end;
Assert(Resources_Released = 0,
"Destruction of Smart_Ref released storage despite remaining "&
"Smart_Ptr");
Assert(SP2.Use_Count = 1,
"Smart_Ptr does not have correct Use_Count after creation and" &
"destruction of a Smart_Ref linked to it");
if Auto_Counters_Tests_Config.Assertions_Enabled then
begin
Make_SR_from_null_SP;
exception
when Smart_Ptr_Error =>
Caught_Make_SR_from_Null_SP := True;
end;
Assert(Caught_Make_SR_from_Null_SP,
"Failed to identify Smart_Ref being made from a null Smart_Ptr");
end if;
end Check_SP_SR;
end Smart_Ptrs_Tests;
|
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE boost_serialization>
<boost_serialization signature="serialization::archive" version="14">
<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>fact</name>
<ret_bitwidth>64</ret_bitwidth>
<ports class_id="2" tracking_level="0" version="0">
<count>1</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>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>x</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>5</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>
</ports>
<nodes class_id="8" tracking_level="0" version="0">
<count>14</count>
<item_version>0</item_version>
<item class_id="9" tracking_level="1" version="0" object_id="_2">
<Value>
<Obj>
<type>0</type>
<id>2</id>
<name>x_read</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>x</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>5</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>26</item>
<item>27</item>
</oprand_edges>
<opcode>read</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_3">
<Value>
<Obj>
<type>0</type>
<id>3</id>
<name>tmp_cast</name>
<fileName>../source_files/src/dut.cpp</fileName>
<fileDirectory>/mnt/centos_share/Vivado_Projects/hls_scratchpad/hls_cmd_line_testing/hls_gui_proj</fileDirectory>
<lineNumber>5</lineNumber>
<contextFuncName>fact</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item class_id="11" tracking_level="0" version="0">
<first>/mnt/centos_share/Vivado_Projects/hls_scratchpad/hls_cmd_line_testing/hls_gui_proj</first>
<second class_id="12" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="13" tracking_level="0" version="0">
<first class_id="14" tracking_level="0" version="0">
<first>../source_files/src/dut.cpp</first>
<second>fact</second>
</first>
<second>5</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>6</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>28</item>
</oprand_edges>
<opcode>zext</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_4">
<Value>
<Obj>
<type>0</type>
<id>4</id>
<name>tmp_3</name>
<fileName>../source_files/src/dut.cpp</fileName>
<fileDirectory>/mnt/centos_share/Vivado_Projects/hls_scratchpad/hls_cmd_line_testing/hls_gui_proj</fileDirectory>
<lineNumber>5</lineNumber>
<contextFuncName>fact</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/centos_share/Vivado_Projects/hls_scratchpad/hls_cmd_line_testing/hls_gui_proj</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>../source_files/src/dut.cpp</first>
<second>fact</second>
</first>
<second>5</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>6</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>29</item>
<item>31</item>
</oprand_edges>
<opcode>add</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_5">
<Value>
<Obj>
<type>0</type>
<id>5</id>
<name></name>
<fileName>../source_files/src/dut.cpp</fileName>
<fileDirectory>/mnt/centos_share/Vivado_Projects/hls_scratchpad/hls_cmd_line_testing/hls_gui_proj</fileDirectory>
<lineNumber>5</lineNumber>
<contextFuncName>fact</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/centos_share/Vivado_Projects/hls_scratchpad/hls_cmd_line_testing/hls_gui_proj</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>../source_files/src/dut.cpp</first>
<second>fact</second>
</first>
<second>5</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>32</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_6">
<Value>
<Obj>
<type>0</type>
<id>7</id>
<name>result_int</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>result_int</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>34</item>
<item>35</item>
<item>36</item>
<item>37</item>
</oprand_edges>
<opcode>phi</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_7">
<Value>
<Obj>
<type>0</type>
<id>8</id>
<name>i</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>i</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>6</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>38</item>
<item>39</item>
<item>40</item>
<item>41</item>
</oprand_edges>
<opcode>phi</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_8">
<Value>
<Obj>
<type>0</type>
<id>9</id>
<name>exitcond</name>
<fileName>../source_files/src/dut.cpp</fileName>
<fileDirectory>/mnt/centos_share/Vivado_Projects/hls_scratchpad/hls_cmd_line_testing/hls_gui_proj</fileDirectory>
<lineNumber>5</lineNumber>
<contextFuncName>fact</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/centos_share/Vivado_Projects/hls_scratchpad/hls_cmd_line_testing/hls_gui_proj</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>../source_files/src/dut.cpp</first>
<second>fact</second>
</first>
<second>5</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>42</item>
<item>43</item>
</oprand_edges>
<opcode>icmp</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_9">
<Value>
<Obj>
<type>0</type>
<id>10</id>
<name></name>
<fileName>../source_files/src/dut.cpp</fileName>
<fileDirectory>/mnt/centos_share/Vivado_Projects/hls_scratchpad/hls_cmd_line_testing/hls_gui_proj</fileDirectory>
<lineNumber>5</lineNumber>
<contextFuncName>fact</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/centos_share/Vivado_Projects/hls_scratchpad/hls_cmd_line_testing/hls_gui_proj</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>../source_files/src/dut.cpp</first>
<second>fact</second>
</first>
<second>5</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>44</item>
<item>45</item>
<item>46</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_10">
<Value>
<Obj>
<type>0</type>
<id>12</id>
<name>i_cast1</name>
<fileName>../source_files/src/dut.cpp</fileName>
<fileDirectory>/mnt/centos_share/Vivado_Projects/hls_scratchpad/hls_cmd_line_testing/hls_gui_proj</fileDirectory>
<lineNumber>5</lineNumber>
<contextFuncName>fact</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/centos_share/Vivado_Projects/hls_scratchpad/hls_cmd_line_testing/hls_gui_proj</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>../source_files/src/dut.cpp</first>
<second>fact</second>
</first>
<second>5</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>47</item>
</oprand_edges>
<opcode>zext</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_11">
<Value>
<Obj>
<type>0</type>
<id>17</id>
<name>tmp_s</name>
<fileName>../source_files/src/dut.cpp</fileName>
<fileDirectory>/mnt/centos_share/Vivado_Projects/hls_scratchpad/hls_cmd_line_testing/hls_gui_proj</fileDirectory>
<lineNumber>7</lineNumber>
<contextFuncName>fact</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/centos_share/Vivado_Projects/hls_scratchpad/hls_cmd_line_testing/hls_gui_proj</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>../source_files/src/dut.cpp</first>
<second>fact</second>
</first>
<second>7</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>48</item>
</oprand_edges>
<opcode>sitodp</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_12">
<Value>
<Obj>
<type>0</type>
<id>18</id>
<name>result_int_2</name>
<fileName>../source_files/src/dut.cpp</fileName>
<fileDirectory>/mnt/centos_share/Vivado_Projects/hls_scratchpad/hls_cmd_line_testing/hls_gui_proj</fileDirectory>
<lineNumber>7</lineNumber>
<contextFuncName>fact</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/centos_share/Vivado_Projects/hls_scratchpad/hls_cmd_line_testing/hls_gui_proj</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>../source_files/src/dut.cpp</first>
<second>fact</second>
</first>
<second>7</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>result_int</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>49</item>
<item>50</item>
</oprand_edges>
<opcode>dmul</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_13">
<Value>
<Obj>
<type>0</type>
<id>20</id>
<name>i_2</name>
<fileName>../source_files/src/dut.cpp</fileName>
<fileDirectory>/mnt/centos_share/Vivado_Projects/hls_scratchpad/hls_cmd_line_testing/hls_gui_proj</fileDirectory>
<lineNumber>5</lineNumber>
<contextFuncName>fact</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/centos_share/Vivado_Projects/hls_scratchpad/hls_cmd_line_testing/hls_gui_proj</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>../source_files/src/dut.cpp</first>
<second>fact</second>
</first>
<second>5</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>i</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>6</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>51</item>
<item>52</item>
</oprand_edges>
<opcode>add</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_14">
<Value>
<Obj>
<type>0</type>
<id>21</id>
<name></name>
<fileName>../source_files/src/dut.cpp</fileName>
<fileDirectory>/mnt/centos_share/Vivado_Projects/hls_scratchpad/hls_cmd_line_testing/hls_gui_proj</fileDirectory>
<lineNumber>5</lineNumber>
<contextFuncName>fact</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/centos_share/Vivado_Projects/hls_scratchpad/hls_cmd_line_testing/hls_gui_proj</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>../source_files/src/dut.cpp</first>
<second>fact</second>
</first>
<second>5</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>53</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_15">
<Value>
<Obj>
<type>0</type>
<id>23</id>
<name></name>
<fileName>../source_files/src/dut.cpp</fileName>
<fileDirectory>/mnt/centos_share/Vivado_Projects/hls_scratchpad/hls_cmd_line_testing/hls_gui_proj</fileDirectory>
<lineNumber>9</lineNumber>
<contextFuncName>fact</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/mnt/centos_share/Vivado_Projects/hls_scratchpad/hls_cmd_line_testing/hls_gui_proj</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>../source_files/src/dut.cpp</first>
<second>fact</second>
</first>
<second>9</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>54</item>
</oprand_edges>
<opcode>ret</opcode>
<m_Display>0</m_Display>
</item>
</nodes>
<consts class_id="15" tracking_level="0" version="0">
<count>2</count>
<item_version>0</item_version>
<item class_id="16" tracking_level="1" version="0" object_id="_16">
<Value>
<Obj>
<type>2</type>
<id>30</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>6</bitwidth>
</Value>
<const_type>0</const_type>
<content>1</content>
</item>
<item class_id_reference="16" object_id="_17">
<Value>
<Obj>
<type>2</type>
<id>33</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<const_type>1</const_type>
<content>1</content>
</item>
</consts>
<blocks class_id="17" tracking_level="0" version="0">
<count>4</count>
<item_version>0</item_version>
<item class_id="18" tracking_level="1" version="0" object_id="_18">
<Obj>
<type>3</type>
<id>6</id>
<name></name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>4</count>
<item_version>0</item_version>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_19">
<Obj>
<type>3</type>
<id>11</id>
<name></name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>4</count>
<item_version>0</item_version>
<item>7</item>
<item>8</item>
<item>9</item>
<item>10</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_20">
<Obj>
<type>3</type>
<id>22</id>
<name></name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>5</count>
<item_version>0</item_version>
<item>12</item>
<item>17</item>
<item>18</item>
<item>20</item>
<item>21</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_21">
<Obj>
<type>3</type>
<id>24</id>
<name></name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>1</count>
<item_version>0</item_version>
<item>23</item>
</node_objs>
</item>
</blocks>
<edges class_id="19" tracking_level="0" version="0">
<count>30</count>
<item_version>0</item_version>
<item class_id="20" tracking_level="1" version="0" object_id="_22">
<id>27</id>
<edge_type>1</edge_type>
<source_obj>1</source_obj>
<sink_obj>2</sink_obj>
</item>
<item class_id_reference="20" object_id="_23">
<id>28</id>
<edge_type>1</edge_type>
<source_obj>2</source_obj>
<sink_obj>3</sink_obj>
</item>
<item class_id_reference="20" object_id="_24">
<id>29</id>
<edge_type>1</edge_type>
<source_obj>3</source_obj>
<sink_obj>4</sink_obj>
</item>
<item class_id_reference="20" object_id="_25">
<id>31</id>
<edge_type>1</edge_type>
<source_obj>30</source_obj>
<sink_obj>4</sink_obj>
</item>
<item class_id_reference="20" object_id="_26">
<id>32</id>
<edge_type>2</edge_type>
<source_obj>11</source_obj>
<sink_obj>5</sink_obj>
</item>
<item class_id_reference="20" object_id="_27">
<id>34</id>
<edge_type>1</edge_type>
<source_obj>33</source_obj>
<sink_obj>7</sink_obj>
</item>
<item class_id_reference="20" object_id="_28">
<id>35</id>
<edge_type>2</edge_type>
<source_obj>6</source_obj>
<sink_obj>7</sink_obj>
</item>
<item class_id_reference="20" object_id="_29">
<id>36</id>
<edge_type>1</edge_type>
<source_obj>18</source_obj>
<sink_obj>7</sink_obj>
</item>
<item class_id_reference="20" object_id="_30">
<id>37</id>
<edge_type>2</edge_type>
<source_obj>22</source_obj>
<sink_obj>7</sink_obj>
</item>
<item class_id_reference="20" object_id="_31">
<id>38</id>
<edge_type>1</edge_type>
<source_obj>30</source_obj>
<sink_obj>8</sink_obj>
</item>
<item class_id_reference="20" object_id="_32">
<id>39</id>
<edge_type>2</edge_type>
<source_obj>6</source_obj>
<sink_obj>8</sink_obj>
</item>
<item class_id_reference="20" object_id="_33">
<id>40</id>
<edge_type>1</edge_type>
<source_obj>20</source_obj>
<sink_obj>8</sink_obj>
</item>
<item class_id_reference="20" object_id="_34">
<id>41</id>
<edge_type>2</edge_type>
<source_obj>22</source_obj>
<sink_obj>8</sink_obj>
</item>
<item class_id_reference="20" object_id="_35">
<id>42</id>
<edge_type>1</edge_type>
<source_obj>8</source_obj>
<sink_obj>9</sink_obj>
</item>
<item class_id_reference="20" object_id="_36">
<id>43</id>
<edge_type>1</edge_type>
<source_obj>4</source_obj>
<sink_obj>9</sink_obj>
</item>
<item class_id_reference="20" object_id="_37">
<id>44</id>
<edge_type>1</edge_type>
<source_obj>9</source_obj>
<sink_obj>10</sink_obj>
</item>
<item class_id_reference="20" object_id="_38">
<id>45</id>
<edge_type>2</edge_type>
<source_obj>22</source_obj>
<sink_obj>10</sink_obj>
</item>
<item class_id_reference="20" object_id="_39">
<id>46</id>
<edge_type>2</edge_type>
<source_obj>24</source_obj>
<sink_obj>10</sink_obj>
</item>
<item class_id_reference="20" object_id="_40">
<id>47</id>
<edge_type>1</edge_type>
<source_obj>8</source_obj>
<sink_obj>12</sink_obj>
</item>
<item class_id_reference="20" object_id="_41">
<id>48</id>
<edge_type>1</edge_type>
<source_obj>12</source_obj>
<sink_obj>17</sink_obj>
</item>
<item class_id_reference="20" object_id="_42">
<id>49</id>
<edge_type>1</edge_type>
<source_obj>7</source_obj>
<sink_obj>18</sink_obj>
</item>
<item class_id_reference="20" object_id="_43">
<id>50</id>
<edge_type>1</edge_type>
<source_obj>17</source_obj>
<sink_obj>18</sink_obj>
</item>
<item class_id_reference="20" object_id="_44">
<id>51</id>
<edge_type>1</edge_type>
<source_obj>8</source_obj>
<sink_obj>20</sink_obj>
</item>
<item class_id_reference="20" object_id="_45">
<id>52</id>
<edge_type>1</edge_type>
<source_obj>30</source_obj>
<sink_obj>20</sink_obj>
</item>
<item class_id_reference="20" object_id="_46">
<id>53</id>
<edge_type>2</edge_type>
<source_obj>11</source_obj>
<sink_obj>21</sink_obj>
</item>
<item class_id_reference="20" object_id="_47">
<id>54</id>
<edge_type>1</edge_type>
<source_obj>7</source_obj>
<sink_obj>23</sink_obj>
</item>
<item class_id_reference="20" object_id="_48">
<id>84</id>
<edge_type>2</edge_type>
<source_obj>6</source_obj>
<sink_obj>11</sink_obj>
</item>
<item class_id_reference="20" object_id="_49">
<id>85</id>
<edge_type>2</edge_type>
<source_obj>11</source_obj>
<sink_obj>24</sink_obj>
</item>
<item class_id_reference="20" object_id="_50">
<id>86</id>
<edge_type>2</edge_type>
<source_obj>11</source_obj>
<sink_obj>22</sink_obj>
</item>
<item class_id_reference="20" object_id="_51">
<id>87</id>
<edge_type>2</edge_type>
<source_obj>22</source_obj>
<sink_obj>11</sink_obj>
</item>
</edges>
</cdfg>
<cdfg_regions class_id="21" tracking_level="0" version="0">
<count>4</count>
<item_version>0</item_version>
<item class_id="22" tracking_level="1" version="0" object_id="_52">
<mId>1</mId>
<mTag>fact</mTag>
<mType>0</mType>
<sub_regions>
<count>3</count>
<item_version>0</item_version>
<item>2</item>
<item>3</item>
<item>4</item>
</sub_regions>
<basic_blocks>
<count>0</count>
<item_version>0</item_version>
</basic_blocks>
<mII>-1</mII>
<mDepth>-1</mDepth>
<mMinTripCount>-1</mMinTripCount>
<mMaxTripCount>-1</mMaxTripCount>
<mMinLatency>193</mMinLatency>
<mMaxLatency>-1</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"></mDfPipe>
</item>
<item class_id_reference="22" object_id="_53">
<mId>2</mId>
<mTag>Entry</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>6</item>
</basic_blocks>
<mII>-1</mII>
<mDepth>-1</mDepth>
<mMinTripCount>-1</mMinTripCount>
<mMaxTripCount>-1</mMaxTripCount>
<mMinLatency>0</mMinLatency>
<mMaxLatency>-1</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"></mDfPipe>
</item>
<item class_id_reference="22" object_id="_54">
<mId>3</mId>
<mTag>fact_loop</mTag>
<mType>1</mType>
<sub_regions>
<count>0</count>
<item_version>0</item_version>
</sub_regions>
<basic_blocks>
<count>2</count>
<item_version>0</item_version>
<item>11</item>
<item>22</item>
</basic_blocks>
<mII>6</mII>
<mDepth>12</mDepth>
<mMinTripCount>0</mMinTripCount>
<mMaxTripCount>31</mMaxTripCount>
<mMinLatency>191</mMinLatency>
<mMaxLatency>-1</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"></mDfPipe>
</item>
<item class_id_reference="22" object_id="_55">
<mId>4</mId>
<mTag>Return</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>24</item>
</basic_blocks>
<mII>-1</mII>
<mDepth>-1</mDepth>
<mMinTripCount>-1</mMinTripCount>
<mMaxTripCount>-1</mMaxTripCount>
<mMinLatency>0</mMinLatency>
<mMaxLatency>-1</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"></mDfPipe>
</item>
</cdfg_regions>
<fsm class_id="-1"></fsm>
<res class_id="-1"></res>
<node_label_latency class_id="26" tracking_level="0" version="0">
<count>14</count>
<item_version>0</item_version>
<item class_id="27" tracking_level="0" version="0">
<first>2</first>
<second class_id="28" tracking_level="0" version="0">
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>3</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>4</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>5</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>7</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>8</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>9</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>10</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>12</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>17</first>
<second>
<first>1</first>
<second>5</second>
</second>
</item>
<item>
<first>18</first>
<second>
<first>7</first>
<second>5</second>
</second>
</item>
<item>
<first>20</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>21</first>
<second>
<first>12</first>
<second>0</second>
</second>
</item>
<item>
<first>23</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
</node_label_latency>
<bblk_ent_exit class_id="29" tracking_level="0" version="0">
<count>4</count>
<item_version>0</item_version>
<item class_id="30" tracking_level="0" version="0">
<first>6</first>
<second class_id="31" tracking_level="0" version="0">
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>11</first>
<second>
<first>1</first>
<second>1</second>
</second>
</item>
<item>
<first>22</first>
<second>
<first>1</first>
<second>12</second>
</second>
</item>
<item>
<first>24</first>
<second>
<first>2</first>
<second>2</second>
</second>
</item>
</bblk_ent_exit>
<regions class_id="32" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="33" tracking_level="1" version="0" object_id="_56">
<region_name>fact_loop</region_name>
<basic_blocks>
<count>2</count>
<item_version>0</item_version>
<item>11</item>
<item>22</item>
</basic_blocks>
<nodes>
<count>0</count>
<item_version>0</item_version>
</nodes>
<anchor_node>-1</anchor_node>
<region_type>8</region_type>
<interval>6</interval>
<pipe_depth>12</pipe_depth>
</item>
</regions>
<dp_fu_nodes class_id="34" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_fu_nodes>
<dp_fu_nodes_expression class_id="35" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_fu_nodes_expression>
<dp_fu_nodes_module>
<count>0</count>
<item_version>0</item_version>
</dp_fu_nodes_module>
<dp_fu_nodes_io>
<count>0</count>
<item_version>0</item_version>
</dp_fu_nodes_io>
<return_ports>
<count>0</count>
<item_version>0</item_version>
</return_ports>
<dp_mem_port_nodes class_id="36" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_mem_port_nodes>
<dp_reg_nodes>
<count>0</count>
<item_version>0</item_version>
</dp_reg_nodes>
<dp_regname_nodes>
<count>0</count>
<item_version>0</item_version>
</dp_regname_nodes>
<dp_reg_phi>
<count>0</count>
<item_version>0</item_version>
</dp_reg_phi>
<dp_regname_phi>
<count>0</count>
<item_version>0</item_version>
</dp_regname_phi>
<dp_port_io_nodes class_id="37" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_port_io_nodes>
<port2core class_id="38" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</port2core>
<node2core>
<count>0</count>
<item_version>0</item_version>
</node2core>
</syndb>
</boost_serialization>
|
-- Abstract :
--
-- External process parser for Ada mode
--
-- Copyright (C) 2017 - 2019 Free Software Foundation, Inc.
--
-- This program is free software; you can redistribute it and/or
-- modify it under terms of the GNU General Public License as
-- published by the Free Software Foundation; either version 3, or (at
-- your option) any later version. This program is distributed in the
-- hope that it will be useful, but WITHOUT ANY WARRANTY; without even
-- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-- PURPOSE. See the GNU General Public License for more details. You
-- should have received a copy of the GNU General Public License
-- distributed with this program; see file COPYING. If not, write to
-- the Free Software Foundation, 51 Franklin Street, Suite 500, Boston,
-- MA 02110-1335, USA.
pragma License (GPL);
with Ada_Process_Actions;
with Ada_Process_LR1_Main;
with Gen_Emacs_Wisi_LR_Text_Rep_Parse;
with WisiToken.Parse.LR.McKenzie_Recover.Ada;
with Wisi.Ada;
procedure Ada_Mode_Wisi_LR1_Parse is new Gen_Emacs_Wisi_LR_Text_Rep_Parse
(Parse_Data_Type => Wisi.Ada.Parse_Data_Type,
Language_Protocol_Version => Wisi.Ada.Language_Protocol_Version,
Name => "Ada_mode_wisi_lr1_parse",
Descriptor => Ada_Process_Actions.Descriptor,
Partial_Parse_Active => Ada_Process_Actions.Partial_Parse_Active,
Language_Fixes => WisiToken.Parse.LR.McKenzie_Recover.Ada.Language_Fixes'Access,
Language_Matching_Begin_Tokens => WisiToken.Parse.LR.McKenzie_Recover.Ada.Matching_Begin_Tokens'Access,
Language_String_ID_Set => WisiToken.Parse.LR.McKenzie_Recover.Ada.String_ID_Set'Access,
Text_Rep_File_Name => "ada_lr1_parse_table.txt",
Create_Parser => Ada_Process_LR1_Main.Create_Parser);
|
-- C47002A.ADA
-- Grant of Unlimited Rights
--
-- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
-- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
-- unlimited rights in the software and documentation contained herein.
-- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
-- this public release, the Government intends to confer upon all
-- recipients unlimited rights equal to those held by the Government.
-- These rights include rights to use, duplicate, release or disclose the
-- released technical data and computer software in whole or in part, in
-- any manner and for any purpose whatsoever, and to have or permit others
-- to do so.
--
-- DISCLAIMER
--
-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
-- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
-- PARTICULAR PURPOSE OF SAID MATERIAL.
--*
-- CHECK THAT VALUES BELONGING TO EACH CLASS OF TYPE CAN BE WRITTEN AS
-- THE OPERANDS OF QUALIFIED EXPRESSIONS.
-- THIS TEST IS FOR DISCRETE TYPES.
-- RJW 7/23/86
WITH REPORT; USE REPORT;
PROCEDURE C47002A IS
BEGIN
TEST( "C47002A", "CHECK THAT VALUES HAVING DISCRETE TYPES " &
"CAN BE WRITTEN AS THE OPERANDS OF " &
"QUALIFIED EXPRESSIONS" );
DECLARE -- ENUMERATION TYPES.
TYPE WEEK IS (SUN, MON, TUE, WED, THU, FRI, SAT);
TYPE WEEKEND IS (SAT, SUN);
TYPE CHAR IS ('B', 'A');
TYPE MYBOOL IS (TRUE, FALSE);
TYPE NBOOL IS NEW BOOLEAN;
BEGIN
IF WEEKEND'(SAT) >= SUN THEN
FAILED ( "INCORRECT RESULTS FOR TYPE WEEKEND" );
END IF;
IF CHAR'('B') >= 'A' THEN
FAILED ( "INCORRECT RESULTS FOR TYPE CHAR" );
END IF;
IF MYBOOL'(TRUE) >= FALSE THEN
FAILED ( "INCORRECT RESULTS FOR TYPE MYBOOL" );
END IF;
IF NBOOL'(TRUE) <= FALSE THEN
FAILED ( "INCORRECT RESULTS FOR TYPE NBOOL" );
END IF;
END;
DECLARE -- INTEGER TYPES.
TYPE RESULTS IS (INT1, INT2, INT3);
TYPE NEWINT IS NEW INTEGER;
TYPE INT IS RANGE -10 .. 10;
FUNCTION F (I : NEWINT) RETURN RESULTS IS
BEGIN
RETURN INT1;
END F;
FUNCTION F (I : INT) RETURN RESULTS IS
BEGIN
RETURN INT2;
END F;
FUNCTION F (I : INTEGER) RETURN RESULTS IS
BEGIN
RETURN INT3;
END F;
BEGIN
IF F (NEWINT'(5)) /= INT1 THEN
FAILED ( "INCORRECT RESULTS FOR TYPE NEWINT" );
END IF;
IF F (INT'(5)) /= INT2 THEN
FAILED ( "INCORRECT RESULTS FOR TYPE INT" );
END IF;
IF F (INTEGER'(5)) /= INT3 THEN
FAILED ( "INCORRECT RESULTS FOR TYPE INTEGER" );
END IF;
END;
RESULT;
END C47002A;
|
with System; use System;
package body Deferred_Const3_Pkg is
procedure Dummy is begin null; end;
begin
if C1'Address /= C'Address then
raise Program_Error;
end if;
if C2'Address /= C'Address then
raise Program_Error;
end if;
if C3'Address /= C'Address then
raise Program_Error;
end if;
end Deferred_Const3_Pkg;
|
pragma Ada_95;
pragma Warnings (Off);
pragma Source_File_Name (ada_main, Spec_File_Name => "b__main.ads");
pragma Source_File_Name (ada_main, Body_File_Name => "b__main.adb");
pragma Suppress (Overflow_Check);
with System.Restrictions;
with Ada.Exceptions;
package body ada_main is
E135 : Short_Integer; pragma Import (Ada, E135, "system__os_lib_E");
E013 : Short_Integer; pragma Import (Ada, E013, "system__soft_links_E");
E023 : Short_Integer; pragma Import (Ada, E023, "system__exception_table_E");
E128 : Short_Integer; pragma Import (Ada, E128, "ada__io_exceptions_E");
E046 : Short_Integer; pragma Import (Ada, E046, "ada__strings_E");
E048 : Short_Integer; pragma Import (Ada, E048, "ada__strings__maps_E");
E052 : Short_Integer; pragma Import (Ada, E052, "ada__strings__maps__constants_E");
E117 : Short_Integer; pragma Import (Ada, E117, "ada__tags_E");
E127 : Short_Integer; pragma Import (Ada, E127, "ada__streams_E");
E063 : Short_Integer; pragma Import (Ada, E063, "interfaces__c_E");
E090 : Short_Integer; pragma Import (Ada, E090, "interfaces__c__strings_E");
E025 : Short_Integer; pragma Import (Ada, E025, "system__exceptions_E");
E138 : Short_Integer; pragma Import (Ada, E138, "system__file_control_block_E");
E130 : Short_Integer; pragma Import (Ada, E130, "system__file_io_E");
E133 : Short_Integer; pragma Import (Ada, E133, "system__finalization_root_E");
E131 : Short_Integer; pragma Import (Ada, E131, "ada__finalization_E");
E105 : Short_Integer; pragma Import (Ada, E105, "system__task_info_E");
E061 : Short_Integer; pragma Import (Ada, E061, "system__object_reader_E");
E041 : Short_Integer; pragma Import (Ada, E041, "system__dwarf_lines_E");
E017 : Short_Integer; pragma Import (Ada, E017, "system__secondary_stack_E");
E146 : Short_Integer; pragma Import (Ada, E146, "system__tasking__initialization_E");
E036 : Short_Integer; pragma Import (Ada, E036, "system__traceback__symbolic_E");
E006 : Short_Integer; pragma Import (Ada, E006, "ada__real_time_E");
E125 : Short_Integer; pragma Import (Ada, E125, "ada__text_io_E");
E154 : Short_Integer; pragma Import (Ada, E154, "system__tasking__protected_objects_E");
E158 : Short_Integer; pragma Import (Ada, E158, "system__tasking__protected_objects__entries_E");
E162 : Short_Integer; pragma Import (Ada, E162, "system__tasking__queuing_E");
E168 : Short_Integer; pragma Import (Ada, E168, "system__tasking__stages_E");
Local_Priority_Specific_Dispatching : constant String := "";
Local_Interrupt_States : constant String := "";
Is_Elaborated : Boolean := False;
procedure finalize_library is
begin
E158 := E158 - 1;
declare
procedure F1;
pragma Import (Ada, F1, "system__tasking__protected_objects__entries__finalize_spec");
begin
F1;
end;
E125 := E125 - 1;
declare
procedure F2;
pragma Import (Ada, F2, "ada__text_io__finalize_spec");
begin
F2;
end;
declare
procedure F3;
pragma Import (Ada, F3, "system__file_io__finalize_body");
begin
E130 := E130 - 1;
F3;
end;
declare
procedure Reraise_Library_Exception_If_Any;
pragma Import (Ada, Reraise_Library_Exception_If_Any, "__gnat_reraise_library_exception_if_any");
begin
Reraise_Library_Exception_If_Any;
end;
end finalize_library;
procedure adafinal is
procedure s_stalib_adafinal;
pragma Import (C, s_stalib_adafinal, "system__standard_library__adafinal");
procedure Runtime_Finalize;
pragma Import (C, Runtime_Finalize, "__gnat_runtime_finalize");
begin
if not Is_Elaborated then
return;
end if;
Is_Elaborated := False;
Runtime_Finalize;
s_stalib_adafinal;
end adafinal;
type No_Param_Proc is access procedure;
procedure adainit is
Main_Priority : Integer;
pragma Import (C, Main_Priority, "__gl_main_priority");
Time_Slice_Value : Integer;
pragma Import (C, Time_Slice_Value, "__gl_time_slice_val");
WC_Encoding : Character;
pragma Import (C, WC_Encoding, "__gl_wc_encoding");
Locking_Policy : Character;
pragma Import (C, Locking_Policy, "__gl_locking_policy");
Queuing_Policy : Character;
pragma Import (C, Queuing_Policy, "__gl_queuing_policy");
Task_Dispatching_Policy : Character;
pragma Import (C, Task_Dispatching_Policy, "__gl_task_dispatching_policy");
Priority_Specific_Dispatching : System.Address;
pragma Import (C, Priority_Specific_Dispatching, "__gl_priority_specific_dispatching");
Num_Specific_Dispatching : Integer;
pragma Import (C, Num_Specific_Dispatching, "__gl_num_specific_dispatching");
Main_CPU : Integer;
pragma Import (C, Main_CPU, "__gl_main_cpu");
Interrupt_States : System.Address;
pragma Import (C, Interrupt_States, "__gl_interrupt_states");
Num_Interrupt_States : Integer;
pragma Import (C, Num_Interrupt_States, "__gl_num_interrupt_states");
Unreserve_All_Interrupts : Integer;
pragma Import (C, Unreserve_All_Interrupts, "__gl_unreserve_all_interrupts");
Detect_Blocking : Integer;
pragma Import (C, Detect_Blocking, "__gl_detect_blocking");
Default_Stack_Size : Integer;
pragma Import (C, Default_Stack_Size, "__gl_default_stack_size");
Leap_Seconds_Support : Integer;
pragma Import (C, Leap_Seconds_Support, "__gl_leap_seconds_support");
Bind_Env_Addr : System.Address;
pragma Import (C, Bind_Env_Addr, "__gl_bind_env_addr");
procedure Runtime_Initialize (Install_Handler : Integer);
pragma Import (C, Runtime_Initialize, "__gnat_runtime_initialize");
Finalize_Library_Objects : No_Param_Proc;
pragma Import (C, Finalize_Library_Objects, "__gnat_finalize_library_objects");
begin
if Is_Elaborated then
return;
end if;
Is_Elaborated := True;
Main_Priority := -1;
Time_Slice_Value := -1;
WC_Encoding := 'b';
Locking_Policy := ' ';
Queuing_Policy := ' ';
Task_Dispatching_Policy := ' ';
System.Restrictions.Run_Time_Restrictions :=
(Set =>
(False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, True, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False),
Value => (0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
Violated =>
(False, False, False, True, True, False, False, False,
False, False, False, True, True, True, False, False,
True, False, False, True, True, False, True, True,
False, True, True, True, True, False, False, False,
False, False, True, False, False, True, False, False,
False, False, True, False, False, False, True, False,
False, True, True, False, False, True, False, False,
True, False, True, False, True, True, True, False,
False, True, False, True, True, True, False, True,
True, False, True, True, True, True, False, False,
True, False, False, False, False, False, True, True,
False, False, False),
Count => (0, 0, 0, 0, 0, 2, 1, 0, 0, 0),
Unknown => (False, False, False, False, False, False, True, False, False, False));
Priority_Specific_Dispatching :=
Local_Priority_Specific_Dispatching'Address;
Num_Specific_Dispatching := 0;
Main_CPU := -1;
Interrupt_States := Local_Interrupt_States'Address;
Num_Interrupt_States := 0;
Unreserve_All_Interrupts := 0;
Detect_Blocking := 0;
Default_Stack_Size := -1;
Leap_Seconds_Support := 0;
Runtime_Initialize (1);
Finalize_Library_Objects := finalize_library'access;
System.Soft_Links'Elab_Spec;
System.Exception_Table'Elab_Body;
E023 := E023 + 1;
Ada.Io_Exceptions'Elab_Spec;
E128 := E128 + 1;
Ada.Strings'Elab_Spec;
E046 := E046 + 1;
Ada.Strings.Maps'Elab_Spec;
Ada.Strings.Maps.Constants'Elab_Spec;
E052 := E052 + 1;
Ada.Tags'Elab_Spec;
Ada.Streams'Elab_Spec;
E127 := E127 + 1;
Interfaces.C'Elab_Spec;
Interfaces.C.Strings'Elab_Spec;
System.Exceptions'Elab_Spec;
E025 := E025 + 1;
System.File_Control_Block'Elab_Spec;
E138 := E138 + 1;
System.Finalization_Root'Elab_Spec;
E133 := E133 + 1;
Ada.Finalization'Elab_Spec;
E131 := E131 + 1;
System.Task_Info'Elab_Spec;
E105 := E105 + 1;
System.Object_Reader'Elab_Spec;
System.Dwarf_Lines'Elab_Spec;
System.File_Io'Elab_Body;
E130 := E130 + 1;
E090 := E090 + 1;
E063 := E063 + 1;
Ada.Tags'Elab_Body;
E117 := E117 + 1;
E048 := E048 + 1;
System.Soft_Links'Elab_Body;
E013 := E013 + 1;
System.Os_Lib'Elab_Body;
E135 := E135 + 1;
System.Secondary_Stack'Elab_Body;
E017 := E017 + 1;
E041 := E041 + 1;
E061 := E061 + 1;
System.Traceback.Symbolic'Elab_Body;
E036 := E036 + 1;
System.Tasking.Initialization'Elab_Body;
E146 := E146 + 1;
Ada.Real_Time'Elab_Spec;
Ada.Real_Time'Elab_Body;
E006 := E006 + 1;
Ada.Text_Io'Elab_Spec;
Ada.Text_Io'Elab_Body;
E125 := E125 + 1;
System.Tasking.Protected_Objects'Elab_Body;
E154 := E154 + 1;
System.Tasking.Protected_Objects.Entries'Elab_Spec;
E158 := E158 + 1;
System.Tasking.Queuing'Elab_Body;
E162 := E162 + 1;
System.Tasking.Stages'Elab_Body;
E168 := E168 + 1;
end adainit;
procedure Ada_Main_Program;
pragma Import (Ada, Ada_Main_Program, "_ada_main");
function main
(argc : Integer;
argv : System.Address;
envp : System.Address)
return Integer
is
procedure Initialize (Addr : System.Address);
pragma Import (C, Initialize, "__gnat_initialize");
procedure Finalize;
pragma Import (C, Finalize, "__gnat_finalize");
SEH : aliased array (1 .. 2) of Integer;
Ensure_Reference : aliased System.Address := Ada_Main_Program_Name'Address;
pragma Volatile (Ensure_Reference);
begin
gnat_argc := argc;
gnat_argv := argv;
gnat_envp := envp;
Initialize (SEH'Address);
adainit;
Ada_Main_Program;
adafinal;
Finalize;
return (gnat_exit_status);
end;
-- BEGIN Object file/option list
-- D:\AGH - EAIIIB - INFORMATYKA\PWiR\Ada\Ada-Samples\MergeSort\main.o
-- -LD:\AGH - EAIIIB - INFORMATYKA\PWiR\Ada\Ada-Samples\MergeSort\
-- -LD:\AGH - EAIIIB - INFORMATYKA\PWiR\Ada\Ada-Samples\MergeSort\
-- -LD:/gnat/2016/lib/gcc/i686-pc-mingw32/4.9.4/adalib/
-- -static
-- -lgnarl
-- -lgnat
-- -Xlinker
-- --stack=0x200000,0x1000
-- -mthreads
-- -Wl,--stack=0x2000000
-- END Object file/option list
end ada_main;
|
with Ada.Text_IO; use Ada.Text_IO;
procedure Lunch is
-- Enumeration type
type Lunch_Spot_t is (WS, Nine, Home);
type Day_t is (Sun, Mon, Tue, Wed, Thu, Fri, Sat);
-- Subtype Weekday_t is a constrained Day_t
subtype Weekday_t is Day_t range Mon .. Fri;
-- Declaring a fixed-size array
Where_To_Eat : array(Day_t) of Lunch_Spot_t;
begin
-- Array is the same size as number of Day_t values
Where_To_Eat := (Home, Nine, WS, Nine, WS, Nine, Home);
-- Can loop over a fixed-size array, or over a type/subtype itself
for Day in Weekday_t loop
case Where_To_Eat (Day) is
when Home =>
Put_Line("Eating at home.");
when Nine =>
Put_Line("Eating on 9.");
when WS =>
Put_Line("Eating at Wise Sons");
-- case statement must include all cases
end case;
end loop;
end Lunch;
|
------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
-- "Software"), to deal in the Software without restriction, including --
-- without limitation the rights to use, copy, modify, merge, publish, --
-- distribute, distribute with modifications, sublicense, and/or sell --
-- copies of the Software, and to permit persons to whom the Software is --
-- furnished to do so, subject to the following conditions: --
-- --
-- The above copyright notice and this permission notice shall be included --
-- in all copies or substantial portions of the Software. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --
-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --
-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. --
-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, --
-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR --
-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR --
-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. --
-- --
-- Except as contained in this notice, the name(s) of the above copyright --
-- holders shall not be used in advertising or otherwise to promote the --
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer <Juergen.Pfeifer@T-Online.de> 1996
-- Version Control:
-- $Revision: 1.4 $
-- Binding Version 00.93
------------------------------------------------------------------------------
generic
type T is (<>);
package Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada is
pragma Preelaborate (Enumeration.Ada);
function Create (Set : Type_Set := Mixed_Case;
Case_Sensitive : Boolean := False;
Must_Be_Unique : Boolean := False)
return Enumeration_Field;
function Value (Fld : Field;
Buf : Buffer_Number := Buffer_Number'First) return T;
-- Translate the content of the fields buffer - indicated by the
-- buffer number - into an enumeration value. If the buffer is empty
-- or the content is invalid, a Constraint_Error is raises.
end Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S Y S T E M . V A X _ F L O A T _ O P E R A T I O N S --
-- --
-- B o d y --
-- --
-- $Revision$
-- --
-- Copyright (C) 1997-2000 Free Software Foundation, Inc. --
-- (Version for Alpha OpenVMS) --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with System.IO; use System.IO;
with System.Machine_Code; use System.Machine_Code;
package body System.Vax_Float_Operations is
-- Ensure this gets compiled with -O to avoid extra (and possibly
-- improper) memory stores.
pragma Optimize (Time);
-- Declare the functions that do the conversions between floating-point
-- formats. Call the operands IEEE float so they get passed in
-- FP registers.
function Cvt_G_T (X : T) return T;
function Cvt_T_G (X : T) return T;
function Cvt_T_F (X : T) return S;
pragma Import (C, Cvt_G_T, "OTS$CVT_FLOAT_G_T");
pragma Import (C, Cvt_T_G, "OTS$CVT_FLOAT_T_G");
pragma Import (C, Cvt_T_F, "OTS$CVT_FLOAT_T_F");
-- In each of the conversion routines that are done with OTS calls,
-- we define variables of the corresponding IEEE type so that they are
-- passed and kept in the proper register class.
------------
-- D_To_G --
------------
function D_To_G (X : D) return G is
A, B : T;
C : G;
begin
Asm ("ldg %0,%1", T'Asm_Output ("=f", A), D'Asm_Input ("m", X));
Asm ("cvtdg %1,%0", T'Asm_Output ("=f", B), T'Asm_Input ("f", A));
Asm ("stg %1,%0", G'Asm_Output ("=m", C), T'Asm_Input ("f", B));
return C;
end D_To_G;
------------
-- F_To_G --
------------
function F_To_G (X : F) return G is
A : T;
B : G;
begin
Asm ("ldf %0,%1", T'Asm_Output ("=f", A), F'Asm_Input ("m", X));
Asm ("stg %1,%0", G'Asm_Output ("=m", B), T'Asm_Input ("f", A));
return B;
end F_To_G;
------------
-- F_To_S --
------------
function F_To_S (X : F) return S is
A : T;
B : S;
begin
-- Because converting to a wider FP format is a no-op, we say
-- A is 64-bit even though we are loading 32 bits into it.
Asm ("ldf %0,%1", T'Asm_Output ("=f", A), F'Asm_Input ("m", X));
B := S (Cvt_G_T (A));
return B;
end F_To_S;
------------
-- G_To_D --
------------
function G_To_D (X : G) return D is
A, B : T;
C : D;
begin
Asm ("ldg %0,%1", T'Asm_Output ("=f", A), G'Asm_Input ("m", X));
Asm ("cvtgd %1,%0", T'Asm_Output ("=f", B), T'Asm_Input ("f", A));
Asm ("stg %1,%0", D'Asm_Output ("=m", C), T'Asm_Input ("f", B));
return C;
end G_To_D;
------------
-- G_To_F --
------------
function G_To_F (X : G) return F is
A : T;
B : S;
C : F;
begin
Asm ("ldg %0,%1", T'Asm_Output ("=f", A), G'Asm_Input ("m", X));
Asm ("cvtgf %1,%0", S'Asm_Output ("=f", B), T'Asm_Input ("f", A));
Asm ("stf %1,%0", F'Asm_Output ("=m", C), S'Asm_Input ("f", B));
return C;
end G_To_F;
------------
-- G_To_Q --
------------
function G_To_Q (X : G) return Q is
A : T;
B : Q;
begin
Asm ("ldg %0,%1", T'Asm_Output ("=f", A), G'Asm_Input ("m", X));
Asm ("cvtgq %1,%0", Q'Asm_Output ("=f", B), T'Asm_Input ("f", A));
return B;
end G_To_Q;
------------
-- G_To_T --
------------
function G_To_T (X : G) return T is
A, B : T;
begin
Asm ("ldg %0,%1", T'Asm_Output ("=f", A), G'Asm_Input ("m", X));
B := Cvt_G_T (A);
return B;
end G_To_T;
------------
-- F_To_Q --
------------
function F_To_Q (X : F) return Q is
begin
return G_To_Q (F_To_G (X));
end F_To_Q;
------------
-- Q_To_F --
------------
function Q_To_F (X : Q) return F is
A : S;
B : F;
begin
Asm ("cvtqf %1,%0", S'Asm_Output ("=f", A), Q'Asm_Input ("f", X));
Asm ("stf %1,%0", F'Asm_Output ("=m", B), S'Asm_Input ("f", A));
return B;
end Q_To_F;
------------
-- Q_To_G --
------------
function Q_To_G (X : Q) return G is
A : T;
B : G;
begin
Asm ("cvtqg %1,%0", T'Asm_Output ("=f", A), Q'Asm_Input ("f", X));
Asm ("stg %1,%0", G'Asm_Output ("=m", B), T'Asm_Input ("f", A));
return B;
end Q_To_G;
------------
-- S_To_F --
------------
function S_To_F (X : S) return F is
A : S;
B : F;
begin
A := Cvt_T_F (T (X));
Asm ("stf %1,%0", F'Asm_Output ("=m", B), S'Asm_Input ("f", A));
return B;
end S_To_F;
------------
-- T_To_D --
------------
function T_To_D (X : T) return D is
begin
return G_To_D (T_To_G (X));
end T_To_D;
------------
-- T_To_G --
------------
function T_To_G (X : T) return G is
A : T;
B : G;
begin
A := Cvt_T_G (X);
Asm ("stg %1,%0", G'Asm_Output ("=m", B), T'Asm_Input ("f", A));
return B;
end T_To_G;
-----------
-- Abs_F --
-----------
function Abs_F (X : F) return F is
A, B : S;
C : F;
begin
Asm ("ldf %0,%1", S'Asm_Output ("=f", A), F'Asm_Input ("m", X));
Asm ("cpys $f31,%1,%0", S'Asm_Output ("=f", B), S'Asm_Input ("f", A));
Asm ("stf %1,%0", F'Asm_Output ("=m", C), S'Asm_Input ("f", B));
return C;
end Abs_F;
-----------
-- Abs_G --
-----------
function Abs_G (X : G) return G is
A, B : T;
C : G;
begin
Asm ("ldg %0,%1", T'Asm_Output ("=f", A), G'Asm_Input ("m", X));
Asm ("cpys $f31,%1,%0", T'Asm_Output ("=f", B), T'Asm_Input ("f", A));
Asm ("stg %1,%0", G'Asm_Output ("=m", C), T'Asm_Input ("f", B));
return C;
end Abs_G;
-----------
-- Add_F --
-----------
function Add_F (X, Y : F) return F is
X1, Y1, R : S;
R1 : F;
begin
Asm ("ldf %0,%1", S'Asm_Output ("=f", X1), F'Asm_Input ("m", X));
Asm ("ldf %0,%1", S'Asm_Output ("=f", Y1), F'Asm_Input ("m", Y));
Asm ("addf %1,%2,%0", S'Asm_Output ("=f", R),
(S'Asm_Input ("f", X1), S'Asm_Input ("f", Y1)));
Asm ("stf %1,%0", F'Asm_Output ("=m", R1), S'Asm_Input ("f", R));
return R1;
end Add_F;
-----------
-- Add_G --
-----------
function Add_G (X, Y : G) return G is
X1, Y1, R : T;
R1 : G;
begin
Asm ("ldg %0,%1", T'Asm_Output ("=f", X1), G'Asm_Input ("m", X));
Asm ("ldg %0,%1", T'Asm_Output ("=f", Y1), G'Asm_Input ("m", Y));
Asm ("addg %1,%2,%0", T'Asm_Output ("=f", R),
(T'Asm_Input ("f", X1), T'Asm_Input ("f", Y1)));
Asm ("stg %1,%0", G'Asm_Output ("=m", R1), T'Asm_Input ("f", R));
return R1;
end Add_G;
--------------------
-- Debug_Output_D --
--------------------
procedure Debug_Output_D (Arg : D) is
begin
Put (D'Image (Arg));
end Debug_Output_D;
--------------------
-- Debug_Output_F --
--------------------
procedure Debug_Output_F (Arg : F) is
begin
Put (F'Image (Arg));
end Debug_Output_F;
--------------------
-- Debug_Output_G --
--------------------
procedure Debug_Output_G (Arg : G) is
begin
Put (G'Image (Arg));
end Debug_Output_G;
--------------------
-- Debug_String_D --
--------------------
Debug_String_Buffer : String (1 .. 32);
-- Buffer used by all Debug_String_x routines for returning result
function Debug_String_D (Arg : D) return System.Address is
Image_String : constant String := D'Image (Arg) & ASCII.NUL;
Image_Size : constant Integer := Image_String'Length;
begin
Debug_String_Buffer (1 .. Image_Size) := Image_String;
return Debug_String_Buffer (1)'Address;
end Debug_String_D;
--------------------
-- Debug_String_F --
--------------------
function Debug_String_F (Arg : F) return System.Address is
Image_String : constant String := F'Image (Arg) & ASCII.NUL;
Image_Size : constant Integer := Image_String'Length;
begin
Debug_String_Buffer (1 .. Image_Size) := Image_String;
return Debug_String_Buffer (1)'Address;
end Debug_String_F;
--------------------
-- Debug_String_G --
--------------------
function Debug_String_G (Arg : G) return System.Address is
Image_String : constant String := G'Image (Arg) & ASCII.NUL;
Image_Size : constant Integer := Image_String'Length;
begin
Debug_String_Buffer (1 .. Image_Size) := Image_String;
return Debug_String_Buffer (1)'Address;
end Debug_String_G;
-----------
-- Div_F --
-----------
function Div_F (X, Y : F) return F is
X1, Y1, R : S;
R1 : F;
begin
Asm ("ldf %0,%1", S'Asm_Output ("=f", X1), F'Asm_Input ("m", X));
Asm ("ldf %0,%1", S'Asm_Output ("=f", Y1), F'Asm_Input ("m", Y));
Asm ("divf %1,%2,%0", S'Asm_Output ("=f", R),
(S'Asm_Input ("f", X1), S'Asm_Input ("f", Y1)));
Asm ("stf %1,%0", F'Asm_Output ("=m", R1), S'Asm_Input ("f", R));
return R1;
end Div_F;
-----------
-- Div_G --
-----------
function Div_G (X, Y : G) return G is
X1, Y1, R : T;
R1 : G;
begin
Asm ("ldg %0,%1", T'Asm_Output ("=f", X1), G'Asm_Input ("m", X));
Asm ("ldg %0,%1", T'Asm_Output ("=f", Y1), G'Asm_Input ("m", Y));
Asm ("divg %1,%2,%0", T'Asm_Output ("=f", R),
(T'Asm_Input ("f", X1), T'Asm_Input ("f", Y1)));
Asm ("stg %1,%0", G'Asm_Output ("=m", R1), T'Asm_Input ("f", R));
return R1;
end Div_G;
----------
-- Eq_F --
----------
function Eq_F (X, Y : F) return Boolean is
X1, Y1, R : S;
begin
Asm ("ldf %0,%1", S'Asm_Output ("=f", X1), F'Asm_Input ("m", X));
Asm ("ldf %0,%1", S'Asm_Output ("=f", Y1), F'Asm_Input ("m", Y));
Asm ("cmpgeq %1,%2,%0", S'Asm_Output ("=f", R),
(S'Asm_Input ("f", X1), S'Asm_Input ("f", Y1)));
return R /= 0.0;
end Eq_F;
----------
-- Eq_G --
----------
function Eq_G (X, Y : G) return Boolean is
X1, Y1, R : T;
begin
Asm ("ldg %0,%1", T'Asm_Output ("=f", X1), G'Asm_Input ("m", X));
Asm ("ldg %0,%1", T'Asm_Output ("=f", Y1), G'Asm_Input ("m", Y));
Asm ("cmpgeq %1,%2,%0", T'Asm_Output ("=f", R),
(T'Asm_Input ("f", X1), T'Asm_Input ("f", Y1)));
return R /= 0.0;
end Eq_G;
----------
-- Le_F --
----------
function Le_F (X, Y : F) return Boolean is
X1, Y1, R : S;
begin
Asm ("ldf %0,%1", S'Asm_Output ("=f", X1), F'Asm_Input ("m", X));
Asm ("ldf %0,%1", S'Asm_Output ("=f", Y1), F'Asm_Input ("m", Y));
Asm ("cmpgle %1,%2,%0", S'Asm_Output ("=f", R),
(S'Asm_Input ("f", X1), S'Asm_Input ("f", Y1)));
return R /= 0.0;
end Le_F;
----------
-- Le_G --
----------
function Le_G (X, Y : G) return Boolean is
X1, Y1, R : T;
begin
Asm ("ldg %0,%1", T'Asm_Output ("=f", X1), G'Asm_Input ("m", X));
Asm ("ldg %0,%1", T'Asm_Output ("=f", Y1), G'Asm_Input ("m", Y));
Asm ("cmpgle %1,%2,%0", T'Asm_Output ("=f", R),
(T'Asm_Input ("f", X1), T'Asm_Input ("f", Y1)));
return R /= 0.0;
end Le_G;
----------
-- Lt_F --
----------
function Lt_F (X, Y : F) return Boolean is
X1, Y1, R : S;
begin
Asm ("ldf %0,%1", S'Asm_Output ("=f", X1), F'Asm_Input ("m", X));
Asm ("ldf %0,%1", S'Asm_Output ("=f", Y1), F'Asm_Input ("m", Y));
Asm ("cmpglt %1,%2,%0", S'Asm_Output ("=f", R),
(S'Asm_Input ("f", X1), S'Asm_Input ("f", Y1)));
return R /= 0.0;
end Lt_F;
----------
-- Lt_G --
----------
function Lt_G (X, Y : G) return Boolean is
X1, Y1, R : T;
begin
Asm ("ldg %0,%1", T'Asm_Output ("=f", X1), G'Asm_Input ("m", X));
Asm ("ldg %0,%1", T'Asm_Output ("=f", Y1), G'Asm_Input ("m", Y));
Asm ("cmpglt %1,%2,%0", T'Asm_Output ("=f", R),
(T'Asm_Input ("f", X1), T'Asm_Input ("f", Y1)));
return R /= 0.0;
end Lt_G;
-----------
-- Mul_F --
-----------
function Mul_F (X, Y : F) return F is
X1, Y1, R : S;
R1 : F;
begin
Asm ("ldf %0,%1", S'Asm_Output ("=f", X1), F'Asm_Input ("m", X));
Asm ("ldf %0,%1", S'Asm_Output ("=f", Y1), F'Asm_Input ("m", Y));
Asm ("mulf %1,%2,%0", S'Asm_Output ("=f", R),
(S'Asm_Input ("f", X1), S'Asm_Input ("f", Y1)));
Asm ("stf %1,%0", F'Asm_Output ("=m", R1), S'Asm_Input ("f", R));
return R1;
end Mul_F;
-----------
-- Mul_G --
-----------
function Mul_G (X, Y : G) return G is
X1, Y1, R : T;
R1 : G;
begin
Asm ("ldg %0,%1", T'Asm_Output ("=f", X1), G'Asm_Input ("m", X));
Asm ("ldg %0,%1", T'Asm_Output ("=f", Y1), G'Asm_Input ("m", Y));
Asm ("mulg %1,%2,%0", T'Asm_Output ("=f", R),
(T'Asm_Input ("f", X1), T'Asm_Input ("f", Y1)));
Asm ("stg %1,%0", G'Asm_Output ("=m", R1), T'Asm_Input ("f", R));
return R1;
end Mul_G;
-----------
-- Neg_F --
-----------
function Neg_F (X : F) return F is
A, B : S;
C : F;
begin
Asm ("ldf %0,%1", S'Asm_Output ("=f", A), F'Asm_Input ("m", X));
Asm ("cpysn %1,%1,%0", S'Asm_Output ("=f", B), S'Asm_Input ("f", A));
Asm ("stf %1,%0", F'Asm_Output ("=m", C), S'Asm_Input ("f", B));
return C;
end Neg_F;
-----------
-- Neg_G --
-----------
function Neg_G (X : G) return G is
A, B : T;
C : G;
begin
Asm ("ldg %0,%1", T'Asm_Output ("=f", A), G'Asm_Input ("m", X));
Asm ("cpysn %1,%1,%0", T'Asm_Output ("=f", B), T'Asm_Input ("f", A));
Asm ("stg %1,%0", G'Asm_Output ("=m", C), T'Asm_Input ("f", B));
return C;
end Neg_G;
--------
-- pd --
--------
procedure pd (Arg : D) is
begin
Put_Line (D'Image (Arg));
end pd;
--------
-- pf --
--------
procedure pf (Arg : F) is
begin
Put_Line (F'Image (Arg));
end pf;
--------
-- pg --
--------
procedure pg (Arg : G) is
begin
Put_Line (G'Image (Arg));
end pg;
-----------
-- Sub_F --
-----------
function Sub_F (X, Y : F) return F is
X1, Y1, R : S;
R1 : F;
begin
Asm ("ldf %0,%1", S'Asm_Output ("=f", X1), F'Asm_Input ("m", X));
Asm ("ldf %0,%1", S'Asm_Output ("=f", Y1), F'Asm_Input ("m", Y));
Asm ("subf %1,%2,%0", S'Asm_Output ("=f", R),
(S'Asm_Input ("f", X1), S'Asm_Input ("f", Y1)));
Asm ("stf %1,%0", F'Asm_Output ("=m", R1), S'Asm_Input ("f", R));
return R1;
end Sub_F;
-----------
-- Sub_G --
-----------
function Sub_G (X, Y : G) return G is
X1, Y1, R : T;
R1 : G;
begin
Asm ("ldg %0,%1", T'Asm_Output ("=f", X1), G'Asm_Input ("m", X));
Asm ("ldg %0,%1", T'Asm_Output ("=f", Y1), G'Asm_Input ("m", Y));
Asm ("subg %1,%2,%0", T'Asm_Output ("=f", R),
(T'Asm_Input ("f", X1), T'Asm_Input ("f", Y1)));
Asm ("stg %1,%0", G'Asm_Output ("=m", R1), T'Asm_Input ("f", R));
return R1;
end Sub_G;
end System.Vax_Float_Operations;
|
with Message.Reader; use Message.Reader;
Package body Message.Login is
procedure Read_Config (FileName : in String;
UserName : out Unbounded_String;
FullName : out Unbounded_String;
Password : out Unbounded_String) is
HeaderType, HeaderText, scratch : Unbounded_String;
File : File_Type;
begin
Open (File => File,
Mode => In_File,
Name => Filename);
scratch := SUIO.Get_Line(File);
while scratch /= "" loop
HeaderType := To_Unbounded_String(SU.Slice(scratch,1,SU.Index(scratch,":")-1));
HeaderText := To_Unbounded_String(SU.Slice(scratch,SU.Index(scratch,":")+2,SU.Length(scratch)));
if HeaderType = "UserName" then
UserName := HeaderText;
elsif HeaderType = "FullName" then
FullName := HeaderText;
elsif HeaderType = "Password" then
Password := HeaderText;
end if;
scratch := SUIO.Get_Line(File);
end loop;
Close (File);
exception
when End_Error =>
Close (File);
null;
end Read_Config;
-- function FileExists (Namen : Unbounded_String) return Boolean is
-- File : File_Type;
-- begin
-- Open (File => File,
-- Mode => In_File,
-- Name => To_String(Namen));
-- Close (File);
-- return True;
-- exception
-- when End_Error =>
-- Close (File);
-- return True;
-- when ADA.IO_EXCEPTIONS.NAME_ERROR =>
-- return False;
-- end FileExists;
procedure Create_User is
File : File_Type;
UserName, FullName, Password, Password2, Fname : Unbounded_String;
NowDate : Time := Clock;
Width,Columns : Column_Position := 50;
Length,Lines : Line_Position := 8;
Display_Window : Window;
begin
Get_Size(Number_Of_Lines => Lines,Number_Of_Columns => Columns);
Display_Window := Sub_Window(Win => Standard_Window,
Number_Of_Lines => Length,
Number_Of_Columns => Width,
First_Line_Position => (Lines - Length) / 2,
First_Column_Position => (Columns - Width) / 2);
Clear(Display_Window);
Box(Display_Window);
loop
Add (Display_Window,Line => 2,Column => 2,Str => "UserName : ");
Texaco.Line_Editor(Display_Window,
StartLine => 2,
StartColumn => 15,
Editlength => 16,
Edline => UserName,
MaxLength => 15,
SuppressSpaces => True);
-- FName := UserName & ".cfg";
Fname := To_Unbounded_String(Ada.Strings.Fixed.Translate(To_String(UserName),
Ada.Strings.Maps.Constants.Lower_Case_Map));
Fname := "users/" & FName & ".cfg";
if Exists (To_String(FName)) then
Display_Warning.Warning("That Username is already in use",Down => Integer(Length-1));
UserName := To_Unbounded_String("");
Redraw(Display_Window,0,Integer(Length)-1);
Refresh(Display_Window);
end if;
exit when UserName /= "";
end loop;
loop
Add (Display_Window,Line => 3,Column => 2,Str => "Full Name : ");
Texaco.Line_Editor(Display_Window,
StartLine => 3,
StartColumn => 15,
Editlength => 31,
Edline => FullName,
MaxLength => 30);
exit when FullName /= "";
end loop;
loop
Add (Display_Window,Line => 4,Column => 2,Str => "Password : ");
Texaco.Password_Editor(Display_Window,
StartLine => 4,
StartColumn => 15,
Edline => Password,
MaxLength => 15);
Add (Display_Window,Line => 5,Column => 2,Str => "Re-Type Password : ");
Texaco.Password_Editor(Display_Window,
StartLine => 5,
StartColumn => 21,
Edline => Password2,
MaxLength => 15);
if Password /= Password2 then
Display_Warning.Warning("Passwords Do Not Match",Down => Integer(Length-1));
Password := To_Unbounded_String("");
Password2 := To_Unbounded_String("");
end if;
exit when Password /= "";
end loop;
if Display_Warning.GetYN("Do You want to save this User Y/N",Down => Integer(Length-1)) then
-- FName := UserName & ".cfg";
Create (File => File,
Mode => Out_File,
Name => To_String(FName));
SUIO.Put_Line(File,"UserName: " & UserName);
SUIO.Put_Line(File,"FullName: " & FullName);
SUIO.Put_Line(File,"Password: " & Password);
SUIO.Put_Line(File,"CreateDate: " & To_Unbounded_String(Image (NowDate)));
SUIO.Put_Line(File,To_Unbounded_String(""));
Close (File);
end if;
Clear(Display_Window);
Refresh(Display_Window);
Delete (Win => Display_Window);
end Create_User;
procedure Login_User is
InputUserName, InputPassword, Fname, UserName,FullName,Password : Unbounded_String;
Width,Columns : Column_Position := 50;
Length,Lines : Line_Position := 8;
Display_Window : Window;
begin
Get_Size(Number_Of_Lines => Lines,Number_Of_Columns => Columns);
Display_Window := Sub_Window(Win => Standard_Window,
Number_Of_Lines => Length,
Number_Of_Columns => Width,
First_Line_Position => (Lines - Length) / 2,
First_Column_Position => (Columns - Width) / 2);
Clear(Display_Window);
Box(Display_Window);
loop
Add (Display_Window,Line => 2,Column => 2,Str => "UserName : ");
Texaco.Line_Editor(Display_Window,
StartLine => 2,
StartColumn => 15,
Editlength => 16,
Edline => InputUserName,
MaxLength => 15,
SuppressSpaces => True);
exit when InputUserName /= "";
end loop;
loop
Add (Display_Window,Line => 3,Column => 2,Str => "Password : ");
Texaco.Password_Editor(Display_Window,
StartLine => 3,
StartColumn => 15,
Edline => InputPassword,
MaxLength => 15);
exit when InputPassword /= "";
end loop;
Fname := To_Unbounded_String(Ada.Strings.Fixed.Translate(To_String(InputUserName),
Ada.Strings.Maps.Constants.Lower_Case_Map));
Fname := "users/" & Fname & ".cfg";
if Exists (To_String(FName)) then
Read_Config(To_String(Fname),UserName => UserName,
FullName => FullName,
Password => Password);
if InputPassword = Password then
UserLoggedIn := True;
UserLoggedName := UserName;
UserLoggedFullName := FullName;
Display_Warning.Warning(To_String("Logged in "& UserLoggedName),Down => Integer(Length-1));
else
Display_Warning.Warning("Login Failed",Down => Integer(Length-1));
end if;
else
Display_Warning.Warning("Login Failed",Down => Integer(Length-1));
end if;
Clear(Display_Window);
Refresh(Display_Window);
Delete (Win => Display_Window);
end Login_User;
end Message.Login;
|
-- Copyright 2016-2021 Bartek thindil Jasicki
--
-- This file is part of Steam Sky.
--
-- Steam Sky is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- Steam Sky 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 Steam Sky. If not, see <http://www.gnu.org/licenses/>.
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Ada.Strings.Unbounded.Hash;
with Ada.Containers.Vectors; use Ada.Containers;
with Ada.Containers.Hashed_Maps;
with DOM.Readers; use DOM.Readers;
with Game; use Game;
-- ****h* Items/Items
-- FUNCTION
-- Provice code for manipulate items
-- SOURCE
package Items is
-- ****
-- ****v* Items/Items.Items_Types
-- FUNCTION
-- Types of items
-- SOURCE
Items_Types: UnboundedString_Container.Vector;
-- ****
-- ****s* Items/Items.Object_Data
-- FUNCTION
-- Data structure for objects prototypes
-- PARAMETERS
-- Name - Name of item
-- Weight - Weight of item
-- IType - Type of item
-- Price - Price of item in bases
-- Value - Additional item data (damage for ammo, etc)
-- ShowType - Displayed type of item (can be group of items, renamed
-- type, etc)
-- Description - Description of item
-- Reputation - Minimal reputation in base needed to buy that module
-- SOURCE
type Object_Data is record
Name: Unbounded_String;
Weight: Positive := 1;
IType: Unbounded_String;
Price: Natural := 0;
Value: Integer_Container.Vector;
ShowType: Unbounded_String;
Description: Unbounded_String;
Reputation: Reputation_Range;
end record;
-- ****
-- ****t* Items/Items.Objects_Container
-- FUNCTION
-- Used to store items data
-- SOURCE
package Objects_Container is new Hashed_Maps
(Unbounded_String, Object_Data, Ada.Strings.Unbounded.Hash, "=");
-- ****
-- ****t* Items/Items.Items_Durability
-- FUNCTION
-- Used to mark items durability
-- SOURCE
subtype Items_Durability is Natural range 0 .. 101;
-- ****
-- ****d* Items/Items.Default_Item_Durability
-- FUNCTION
-- Default value for items durability
-- SOURCE
Default_Item_Durability: constant Items_Durability := 100;
-- ****
-- ****s* Items/Items.InventoryData
-- FUNCTION
-- Data structure for item in inventory
-- PARAMETERS
-- ProtoIndex - Index of prototype
-- Amount - Amount of item
-- Name - Name of item if different than default
-- Durability - Current durability of item
-- Price - Price for which item was bought
-- SOURCE
type InventoryData is record
ProtoIndex: Unbounded_String;
Amount: Positive := 1;
Name: Unbounded_String;
Durability: Items_Durability;
Price: Natural := 0;
end record;
-- ****
-- ****t* Items/Items.Inventory_Container
-- FUNCTION
-- Used to store inventory data
-- SOURCE
package Inventory_Container is new Vectors(Positive, InventoryData);
-- ****
-- ****v* Items/Items.Items_List
-- FUNCTION
-- List of item available in game
-- SOURCE
Items_List: Objects_Container.Map;
-- ****
-- ****v* Items/Items.Tools_List
-- FUNCTION
-- List of all tools types in game
-- SOURCE
Tools_List: UnboundedString_Container.Vector;
-- ****
-- ****v* Items/Items.Weapons_List
-- FUNCTION
-- List of indexes of all weapons in game
-- SOURCE
Weapons_List: UnboundedString_Container.Vector;
-- ****
-- ****v* Items/Items.Shields_List
-- FUNCTION
-- List of indexes of all shields in game
-- SOURCE
Shields_List: UnboundedString_Container.Vector;
-- ****
-- ****v* Items/Items.HeadArmors_List
-- FUNCTION
-- List of indexes of all head armors in game
-- SOURCE
HeadArmors_List: UnboundedString_Container.Vector;
-- ****
-- ****v* Items/Items.ChestArmors_List
-- FUNCTION
-- List of indexes of all chest armors in game
-- SOURCE
ChestArmors_List: UnboundedString_Container.Vector;
-- ****
-- ****v* Items/Items.ArmsArmors_List
-- FUNCTION
-- List of indexes of all arms armors in game
-- SOURCE
ArmsArmors_List: UnboundedString_Container.Vector;
-- ****
-- ****v* Items/Items.LegsArmors_List
-- FUNCTION
-- List of indexes of all legs armors in game
-- SOURCE
LegsArmors_List: UnboundedString_Container.Vector;
-- ****
-- ****f* Items/Items.LoadItems
-- FUNCTION
-- Load items from files
-- PARAMETERS
-- Reader - XML Reader from which items data will be read
-- SOURCE
procedure LoadItems(Reader: Tree_Reader);
-- ****
-- ****f* Items/Items.FindProtoItem
-- FUNCTION
-- Search for map index of selected item
-- PARAMETERS
-- ItemType - Item type of item which map index is looking for
-- RESULT
-- Map index of item or empty string if item not found
-- SOURCE
function FindProtoItem
(ItemType: Unbounded_String) return Unbounded_String with
Pre => (ItemType /= Null_Unbounded_String),
Test_Case => (Name => "Test_FindProtoItem", Mode => Nominal);
-- ****
-- ****f* Items/Items.GetItemDamage
-- FUNCTION
-- Get description of item damage
-- PARAMETERS
-- ItemDurability - Numeric value of current durability of the item
-- ToLower - If true, convert description to lower cases. Default
-- is false
-- RESULT
-- Description of item damage level
-- SOURCE
function GetItemDamage
(ItemDurability: Items_Durability; ToLower: Boolean := False)
return String with
Post => GetItemDamage'Result'Length > 0,
Test_Case => (Name => "Test_GetItemDamage", Mode => Nominal);
-- ****
-- ****f* Items/Items.GetItemName
-- FUNCTION
-- Get name of item in ship cargo or character inventory
-- Item - Item to get it name
-- DamageInfo - If true, include description of the item damage in name.
-- Default is true.
-- ToLower - If true, convert damage info to lower case. Default is
-- true.
-- RESULT
-- Name of item with additional damage level info
-- SOURCE
function GetItemName
(Item: InventoryData; DamageInfo, ToLower: Boolean := True)
return String with
Post => GetItemName'Result'Length > 0,
Test_Case => (Name => "Test_GetItemName", Mode => Nominal);
-- ****
-- ****f* Items/Items.DamageItem
-- FUNCTION
-- Check if item in ship cargo or character inventory was damaged
-- PARAMETERS
-- Inventory - Inventory in which selected item is
-- ItemIndex - Inventory index of selected item
-- SkillLevel - Level of skill character which uses that item. Default
-- is 0
-- MemberIndex - Index of crew member of player ship which uses that
-- item. Default is 0
-- RESULT
-- Updated inventory in which item was
-- SOURCE
procedure DamageItem
(Inventory: in out Inventory_Container.Vector; ItemIndex: Positive;
SkillLevel, MemberIndex: Natural := 0) with
Pre => (ItemIndex <= Inventory.Last_Index),
Test_Case => (Name => "Test_DamageItem", Mode => Nominal);
-- ****
-- ****f* Items/Items.FindItem
-- FUNCTION
-- Find item in ship cargo or character inventory
-- PARAMETERS
-- Inventory - Inventory in which item will be looking for
-- ProtoIndex - Prototype index of item. Can be empty if ItemType is set
-- ItemType - Type of item to search. Can be empty if ProtoIndex is set
-- Durability - Durability of item to search. Can be empty
-- Quality - Quality of item to search. Can be empty
-- RESULT
-- Iventory index of item or 0 if item was not found
-- SOURCE
function FindItem
(Inventory: Inventory_Container.Vector;
ProtoIndex, ItemType: Unbounded_String := Null_Unbounded_String;
Durability: Items_Durability := Items_Durability'Last;
Quality: Positive := 100) return Natural with
Post => FindItem'Result <= Inventory.Last_Index,
Test_Case => (Name => "Test_FindItem", Mode => Nominal);
-- ****
-- ****f* Items/Items.SetToolsList
-- FUNCTION
-- Fill tools types list
-- SOURCE
procedure SetToolsList;
-- ****
-- ****f* Items/Items.GetItemChanceToDamage
-- FUNCTION
-- Get item chance to damage info
-- PARAMETERS
-- ItemData: Numeric chance to damage for selected item
-- RESULT
-- String with chance to damage level description
-- SOURCE
function GetItemChanceToDamage(ItemData: Natural) return String with
Post => GetItemChanceToDamage'Result'Length > 0,
Test_Case => (Name => "Test_GetItemChanceToDamage", Mode => Nominal);
-- ****
end Items;
|
-------------------------------------------------------------------------------
-- Copyright (c) 2017, Daniel King
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions are met:
-- * Redistributions of source code must retain the above copyright
-- notice, this list of conditions and the following disclaimer.
-- * Redistributions in binary form must reproduce the above copyright
-- notice, this list of conditions and the following disclaimer in the
-- documentation and/or other materials provided with the distribution.
-- * The name of the copyright holder may not be used to endorse or promote
-- Products derived from this software without specific prior written
-- permission.
--
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
-- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-------------------------------------------------------------------------------
with AUnit.Test_Suites; use AUnit.Test_Suites;
package Parallel_Sponge_Suite is
function Suite return Access_Test_Suite;
end Parallel_Sponge_Suite;
|
-----------------------------------------------------------------------
-- streams.files.tests -- Unit tests for buffered streams
-- Copyright (C) 2012, 2018, 2019, 2021 Stephane Carrez
-- Written by Stephane Carrez (Stephane.Carrez@gmail.com)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Strings.Unbounded;
with Ada.Streams.Stream_IO;
with Ada.Strings.UTF_Encoding.Wide_Wide_Strings;
with Util.Test_Caller;
with Util.Streams.Files;
with Util.Streams.Texts;
package body Util.Streams.Texts.Tests is
pragma Wide_Character_Encoding (UTF8);
use Ada.Streams.Stream_IO;
use Util.Tests;
package Caller is new Util.Test_Caller (Test, "Streams.Texts");
procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite) is
begin
Caller.Add_Test (Suite, "Test Util.Streams.Texts.Open, Read_Line, Close",
Test_Read_Line'Access);
Caller.Add_Test (Suite, "Test Util.Streams.Texts.Write (Integer)",
Test_Write_Integer'Access);
Caller.Add_Test (Suite, "Test Util.Streams.Texts.Write (Long_Long_Integer)",
Test_Write_Long_Integer'Access);
Caller.Add_Test (Suite, "Test Util.Streams.Texts.Write (Unbounded_String)",
Test_Write'Access);
end Add_Tests;
-- ------------------------------
-- Test reading a text stream.
-- ------------------------------
procedure Test_Read_Line (T : in out Test) is
Stream : aliased Files.File_Stream;
Reader : Util.Streams.Texts.Reader_Stream;
Count : Natural := 0;
begin
Stream.Open (Name => "Makefile", Mode => In_File);
Reader.Initialize (From => Stream'Unchecked_Access);
while not Reader.Is_Eof loop
declare
Line : Ada.Strings.Unbounded.Unbounded_String;
begin
Reader.Read_Line (Line);
Count := Count + 1;
end;
end loop;
Stream.Close;
T.Assert (Count > 100, "Too few lines read");
end Test_Read_Line;
-- ------------------------------
-- Write on a text stream converting an integer and writing it.
-- ------------------------------
procedure Test_Write_Integer (T : in out Test) is
Stream : Print_Stream;
Buf : Ada.Strings.Unbounded.Unbounded_String;
begin
Stream.Initialize (Size => 4);
-- Write '0' (we don't want the Ada spurious space).
Stream.Write (Integer (0));
Assert_Equals (T, 1, Integer (Stream.Get_Size), "Invalid size for stream");
Stream.Flush (Buf);
Assert_Equals (T, 1, Ada.Strings.Unbounded.Length (Buf), "Invalid size for string");
Assert_Equals (T, "0", Ada.Strings.Unbounded.To_String (Buf), "Invalid stream content");
Assert_Equals (T, 0, Integer (Stream.Get_Size), "Invalid size for stream after Flush");
-- Write '1234'
Stream.Write (Integer (1234));
Assert_Equals (T, 4, Integer (Stream.Get_Size), "Invalid size for stream");
Stream.Flush (Buf);
Assert_Equals (T, 4, Ada.Strings.Unbounded.Length (Buf), "Invalid size for string");
Assert_Equals (T, "1234", Ada.Strings.Unbounded.To_String (Buf), "Invalid stream content");
Assert_Equals (T, 0, Integer (Stream.Get_Size), "Invalid size for stream after Flush");
-- Write '-234'
Stream.Write (Integer (-234));
Assert_Equals (T, 4, Integer (Stream.Get_Size), "Invalid size for stream");
Stream.Flush (Buf);
Assert_Equals (T, 4, Ada.Strings.Unbounded.Length (Buf), "Invalid size for string");
Assert_Equals (T, "-234", Ada.Strings.Unbounded.To_String (Buf), "Invalid stream content");
Assert_Equals (T, 0, Integer (Stream.Get_Size), "Invalid size for stream after Flush");
end Test_Write_Integer;
-- ------------------------------
-- Write on a text stream converting an integer and writing it.
-- ------------------------------
procedure Test_Write_Long_Integer (T : in out Test) is
Stream : Print_Stream;
Buf : Ada.Strings.Unbounded.Unbounded_String;
begin
Stream.Initialize (Size => 64);
-- Write '0' (we don't want the Ada spurious space).
Stream.Write (Long_Long_Integer (0));
Assert_Equals (T, 1, Integer (Stream.Get_Size), "Invalid size for stream");
Stream.Flush (Buf);
Assert_Equals (T, 1, Ada.Strings.Unbounded.Length (Buf), "Invalid size for string");
Assert_Equals (T, "0", Ada.Strings.Unbounded.To_String (Buf), "Invalid stream content");
Assert_Equals (T, 0, Integer (Stream.Get_Size), "Invalid size for stream after Flush");
-- Write '1234'
Stream.Write (Long_Long_Integer (123456789012345));
Assert_Equals (T, 15, Integer (Stream.Get_Size), "Invalid size for stream");
Stream.Flush (Buf);
Assert_Equals (T, 15, Ada.Strings.Unbounded.Length (Buf), "Invalid size for string");
Assert_Equals (T, "123456789012345", Ada.Strings.Unbounded.To_String (Buf),
"Invalid stream content");
Assert_Equals (T, 0, Integer (Stream.Get_Size), "Invalid size for stream after Flush");
-- Write '-2345678901234'
Stream.Write (Long_Long_Integer (-2345678901234));
Assert_Equals (T, 14, Integer (Stream.Get_Size), "Invalid size for stream");
Stream.Flush (Buf);
Assert_Equals (T, 14, Ada.Strings.Unbounded.Length (Buf), "Invalid size for string");
Assert_Equals (T, "-2345678901234", Ada.Strings.Unbounded.To_String (Buf),
"Invalid stream content");
Assert_Equals (T, 0, Integer (Stream.Get_Size), "Invalid size for stream after Flush");
end Test_Write_Long_Integer;
-- ------------------------------
-- Write on a text stream converting an integer and writing it.
-- ------------------------------
procedure Test_Write (T : in out Test) is
use Ada.Strings.UTF_Encoding.Wide_Wide_Strings;
Stream : Print_Stream;
Buf : Ada.Strings.Unbounded.Unbounded_String;
Expect : constant Wide_Wide_String := "àéúíòࠀ€ಜ࠴𝄞" & Wide_Wide_Character'Val (16#0A#);
begin
Stream.Initialize (Size => 60);
Stream.Write (Ada.Strings.Unbounded.To_Unbounded_String ("hello"));
Assert_Equals (T, 5, Integer (Stream.Get_Size), "Invalid size for stream");
Stream.Flush (Buf);
Assert_Equals (T, 5, Ada.Strings.Unbounded.Length (Buf), "Invalid size for string");
Assert_Equals (T, "hello", Ada.Strings.Unbounded.To_String (Buf), "Invalid stream content");
Assert_Equals (T, 0, Integer (Stream.Get_Size), "Invalid size for stream after Flush");
-- Wide string
Stream.Write (Ada.Strings.Wide_Wide_Unbounded.To_Unbounded_Wide_Wide_String ("hello"));
Assert_Equals (T, 5, Integer (Stream.Get_Size), "Invalid size for stream");
Stream.Flush (Buf);
Assert_Equals (T, 5, Ada.Strings.Unbounded.Length (Buf), "Invalid size for string");
Assert_Equals (T, "hello", Ada.Strings.Unbounded.To_String (Buf), "Invalid stream content");
Assert_Equals (T, 0, Integer (Stream.Get_Size), "Invalid size for stream after Flush");
-- Wide string
Stream.Write_Wide (Expect);
Assert_Equals (T, 27, Integer (Stream.Get_Size), "Invalid size for stream");
Stream.Flush (Buf);
Assert_Equals (T, 27, Ada.Strings.Unbounded.Length (Buf), "Invalid size for string");
Assert_Equals (T, Encode (Expect),
Ada.Strings.Unbounded.To_String (Buf),
"Invalid stream content");
Assert_Equals (T, 0, Integer (Stream.Get_Size), "Invalid size for stream after Flush");
end Test_Write;
end Util.Streams.Texts.Tests;
|
-----------------------------------------------------------------------
-- AWA.Countries.Models -- AWA.Countries.Models
-----------------------------------------------------------------------
-- File generated by ada-gen DO NOT MODIFY
-- Template used: templates/model/package-body.xhtml
-- Ada Generator: https://ada-gen.googlecode.com/svn/trunk Revision 1095
-----------------------------------------------------------------------
-- Copyright (C) 2016 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;
package body AWA.Countries.Models is
use type ADO.Objects.Object_Record_Access;
use type ADO.Objects.Object_Ref;
use type ADO.Objects.Object_Record;
pragma Warnings (Off, "formal parameter * is not referenced");
function Country_Key (Id : in ADO.Identifier) return ADO.Objects.Object_Key is
Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER,
Of_Class => COUNTRY_DEF'Access);
begin
ADO.Objects.Set_Value (Result, Id);
return Result;
end Country_Key;
function Country_Key (Id : in String) return ADO.Objects.Object_Key is
Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER,
Of_Class => COUNTRY_DEF'Access);
begin
ADO.Objects.Set_Value (Result, Id);
return Result;
end Country_Key;
function "=" (Left, Right : Country_Ref'Class) return Boolean is
begin
return ADO.Objects.Object_Ref'Class (Left) = ADO.Objects.Object_Ref'Class (Right);
end "=";
procedure Set_Field (Object : in out Country_Ref'Class;
Impl : out Country_Access) is
Result : ADO.Objects.Object_Record_Access;
begin
Object.Prepare_Modify (Result);
Impl := Country_Impl (Result.all)'Access;
end Set_Field;
-- Internal method to allocate the Object_Record instance
procedure Allocate (Object : in out Country_Ref) is
Impl : Country_Access;
begin
Impl := new Country_Impl;
Impl.Geonameid := 0;
ADO.Objects.Set_Object (Object, Impl.all'Access);
end Allocate;
-- ----------------------------------------
-- Data object: Country
-- ----------------------------------------
procedure Set_Id (Object : in out Country_Ref;
Value : in ADO.Identifier) is
Impl : Country_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Key_Value (Impl.all, 1, Value);
end Set_Id;
function Get_Id (Object : in Country_Ref)
return ADO.Identifier is
Impl : constant Country_Access
:= Country_Impl (Object.Get_Object.all)'Access;
begin
return Impl.Get_Key_Value;
end Get_Id;
procedure Set_Name (Object : in out Country_Ref;
Value : in String) is
Impl : Country_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_String (Impl.all, 2, Impl.Name, Value);
end Set_Name;
procedure Set_Name (Object : in out Country_Ref;
Value : in Ada.Strings.Unbounded.Unbounded_String) is
Impl : Country_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Unbounded_String (Impl.all, 2, Impl.Name, Value);
end Set_Name;
function Get_Name (Object : in Country_Ref)
return String is
begin
return Ada.Strings.Unbounded.To_String (Object.Get_Name);
end Get_Name;
function Get_Name (Object : in Country_Ref)
return Ada.Strings.Unbounded.Unbounded_String is
Impl : constant Country_Access
:= Country_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Name;
end Get_Name;
procedure Set_Continent (Object : in out Country_Ref;
Value : in String) is
Impl : Country_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_String (Impl.all, 3, Impl.Continent, Value);
end Set_Continent;
procedure Set_Continent (Object : in out Country_Ref;
Value : in Ada.Strings.Unbounded.Unbounded_String) is
Impl : Country_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Unbounded_String (Impl.all, 3, Impl.Continent, Value);
end Set_Continent;
function Get_Continent (Object : in Country_Ref)
return String is
begin
return Ada.Strings.Unbounded.To_String (Object.Get_Continent);
end Get_Continent;
function Get_Continent (Object : in Country_Ref)
return Ada.Strings.Unbounded.Unbounded_String is
Impl : constant Country_Access
:= Country_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Continent;
end Get_Continent;
procedure Set_Currency (Object : in out Country_Ref;
Value : in String) is
Impl : Country_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_String (Impl.all, 4, Impl.Currency, Value);
end Set_Currency;
procedure Set_Currency (Object : in out Country_Ref;
Value : in Ada.Strings.Unbounded.Unbounded_String) is
Impl : Country_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Unbounded_String (Impl.all, 4, Impl.Currency, Value);
end Set_Currency;
function Get_Currency (Object : in Country_Ref)
return String is
begin
return Ada.Strings.Unbounded.To_String (Object.Get_Currency);
end Get_Currency;
function Get_Currency (Object : in Country_Ref)
return Ada.Strings.Unbounded.Unbounded_String is
Impl : constant Country_Access
:= Country_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Currency;
end Get_Currency;
procedure Set_Iso_Code (Object : in out Country_Ref;
Value : in String) is
Impl : Country_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_String (Impl.all, 5, Impl.Iso_Code, Value);
end Set_Iso_Code;
procedure Set_Iso_Code (Object : in out Country_Ref;
Value : in Ada.Strings.Unbounded.Unbounded_String) is
Impl : Country_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Unbounded_String (Impl.all, 5, Impl.Iso_Code, Value);
end Set_Iso_Code;
function Get_Iso_Code (Object : in Country_Ref)
return String is
begin
return Ada.Strings.Unbounded.To_String (Object.Get_Iso_Code);
end Get_Iso_Code;
function Get_Iso_Code (Object : in Country_Ref)
return Ada.Strings.Unbounded.Unbounded_String is
Impl : constant Country_Access
:= Country_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Iso_Code;
end Get_Iso_Code;
procedure Set_Geonameid (Object : in out Country_Ref;
Value : in Integer) is
Impl : Country_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Integer (Impl.all, 6, Impl.Geonameid, Value);
end Set_Geonameid;
function Get_Geonameid (Object : in Country_Ref)
return Integer is
Impl : constant Country_Access
:= Country_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Geonameid;
end Get_Geonameid;
procedure Set_Languages (Object : in out Country_Ref;
Value : in String) is
Impl : Country_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_String (Impl.all, 7, Impl.Languages, Value);
end Set_Languages;
procedure Set_Languages (Object : in out Country_Ref;
Value : in Ada.Strings.Unbounded.Unbounded_String) is
Impl : Country_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Unbounded_String (Impl.all, 7, Impl.Languages, Value);
end Set_Languages;
function Get_Languages (Object : in Country_Ref)
return String is
begin
return Ada.Strings.Unbounded.To_String (Object.Get_Languages);
end Get_Languages;
function Get_Languages (Object : in Country_Ref)
return Ada.Strings.Unbounded.Unbounded_String is
Impl : constant Country_Access
:= Country_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Languages;
end Get_Languages;
procedure Set_Tld (Object : in out Country_Ref;
Value : in String) is
Impl : Country_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_String (Impl.all, 8, Impl.Tld, Value);
end Set_Tld;
procedure Set_Tld (Object : in out Country_Ref;
Value : in Ada.Strings.Unbounded.Unbounded_String) is
Impl : Country_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Unbounded_String (Impl.all, 8, Impl.Tld, Value);
end Set_Tld;
function Get_Tld (Object : in Country_Ref)
return String is
begin
return Ada.Strings.Unbounded.To_String (Object.Get_Tld);
end Get_Tld;
function Get_Tld (Object : in Country_Ref)
return Ada.Strings.Unbounded.Unbounded_String is
Impl : constant Country_Access
:= Country_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Tld;
end Get_Tld;
procedure Set_Currency_Code (Object : in out Country_Ref;
Value : in String) is
Impl : Country_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_String (Impl.all, 9, Impl.Currency_Code, Value);
end Set_Currency_Code;
procedure Set_Currency_Code (Object : in out Country_Ref;
Value : in Ada.Strings.Unbounded.Unbounded_String) is
Impl : Country_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Unbounded_String (Impl.all, 9, Impl.Currency_Code, Value);
end Set_Currency_Code;
function Get_Currency_Code (Object : in Country_Ref)
return String is
begin
return Ada.Strings.Unbounded.To_String (Object.Get_Currency_Code);
end Get_Currency_Code;
function Get_Currency_Code (Object : in Country_Ref)
return Ada.Strings.Unbounded.Unbounded_String is
Impl : constant Country_Access
:= Country_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Currency_Code;
end Get_Currency_Code;
-- Copy of the object.
procedure Copy (Object : in Country_Ref;
Into : in out Country_Ref) is
Result : Country_Ref;
begin
if not Object.Is_Null then
declare
Impl : constant Country_Access
:= Country_Impl (Object.Get_Load_Object.all)'Access;
Copy : constant Country_Access
:= new Country_Impl;
begin
ADO.Objects.Set_Object (Result, Copy.all'Access);
Copy.Copy (Impl.all);
Copy.Name := Impl.Name;
Copy.Continent := Impl.Continent;
Copy.Currency := Impl.Currency;
Copy.Iso_Code := Impl.Iso_Code;
Copy.Geonameid := Impl.Geonameid;
Copy.Languages := Impl.Languages;
Copy.Tld := Impl.Tld;
Copy.Currency_Code := Impl.Currency_Code;
end;
end if;
Into := Result;
end Copy;
procedure Find (Object : in out Country_Ref;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean) is
Impl : constant Country_Access := new Country_Impl;
begin
Impl.Find (Session, Query, Found);
if Found then
ADO.Objects.Set_Object (Object, Impl.all'Access);
else
ADO.Objects.Set_Object (Object, null);
Destroy (Impl);
end if;
end Find;
procedure Load (Object : in out Country_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier) is
Impl : constant Country_Access := new Country_Impl;
Found : Boolean;
Query : ADO.SQL.Query;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Impl.Find (Session, Query, Found);
if not Found then
Destroy (Impl);
raise ADO.Objects.NOT_FOUND;
end if;
ADO.Objects.Set_Object (Object, Impl.all'Access);
end Load;
procedure Load (Object : in out Country_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier;
Found : out Boolean) is
Impl : constant Country_Access := new Country_Impl;
Query : ADO.SQL.Query;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Impl.Find (Session, Query, Found);
if not Found then
Destroy (Impl);
else
ADO.Objects.Set_Object (Object, Impl.all'Access);
end if;
end Load;
procedure Save (Object : in out Country_Ref;
Session : in out ADO.Sessions.Master_Session'Class) is
Impl : ADO.Objects.Object_Record_Access := Object.Get_Object;
begin
if Impl = null then
Impl := new Country_Impl;
ADO.Objects.Set_Object (Object, Impl);
end if;
if not ADO.Objects.Is_Created (Impl.all) then
Impl.Create (Session);
else
Impl.Save (Session);
end if;
end Save;
procedure Delete (Object : in out Country_Ref;
Session : in out ADO.Sessions.Master_Session'Class) is
Impl : constant ADO.Objects.Object_Record_Access := Object.Get_Object;
begin
if Impl /= null then
Impl.Delete (Session);
end if;
end Delete;
-- --------------------
-- Free the object
-- --------------------
procedure Destroy (Object : access Country_Impl) is
type Country_Impl_Ptr is access all Country_Impl;
procedure Unchecked_Free is new Ada.Unchecked_Deallocation
(Country_Impl, Country_Impl_Ptr);
pragma Warnings (Off, "*redundant conversion*");
Ptr : Country_Impl_Ptr := Country_Impl (Object.all)'Access;
pragma Warnings (On, "*redundant conversion*");
begin
Unchecked_Free (Ptr);
end Destroy;
procedure Find (Object : in out Country_Impl;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean) is
Stmt : ADO.Statements.Query_Statement
:= Session.Create_Statement (Query, COUNTRY_DEF'Access);
begin
Stmt.Execute;
if Stmt.Has_Elements then
Object.Load (Stmt, Session);
Stmt.Next;
Found := not Stmt.Has_Elements;
else
Found := False;
end if;
end Find;
overriding
procedure Load (Object : in out Country_Impl;
Session : in out ADO.Sessions.Session'Class) is
Found : Boolean;
Query : ADO.SQL.Query;
Id : constant ADO.Identifier := Object.Get_Key_Value;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Object.Find (Session, Query, Found);
if not Found then
raise ADO.Objects.NOT_FOUND;
end if;
end Load;
procedure Save (Object : in out Country_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Stmt : ADO.Statements.Update_Statement
:= Session.Create_Statement (COUNTRY_DEF'Access);
begin
if Object.Is_Modified (1) then
Stmt.Save_Field (Name => COL_0_1_NAME, -- id
Value => Object.Get_Key);
Object.Clear_Modified (1);
end if;
if Object.Is_Modified (2) then
Stmt.Save_Field (Name => COL_1_1_NAME, -- name
Value => Object.Name);
Object.Clear_Modified (2);
end if;
if Object.Is_Modified (3) then
Stmt.Save_Field (Name => COL_2_1_NAME, -- continent
Value => Object.Continent);
Object.Clear_Modified (3);
end if;
if Object.Is_Modified (4) then
Stmt.Save_Field (Name => COL_3_1_NAME, -- currency
Value => Object.Currency);
Object.Clear_Modified (4);
end if;
if Object.Is_Modified (5) then
Stmt.Save_Field (Name => COL_4_1_NAME, -- iso_code
Value => Object.Iso_Code);
Object.Clear_Modified (5);
end if;
if Object.Is_Modified (6) then
Stmt.Save_Field (Name => COL_5_1_NAME, -- geonameid
Value => Object.Geonameid);
Object.Clear_Modified (6);
end if;
if Object.Is_Modified (7) then
Stmt.Save_Field (Name => COL_6_1_NAME, -- languages
Value => Object.Languages);
Object.Clear_Modified (7);
end if;
if Object.Is_Modified (8) then
Stmt.Save_Field (Name => COL_7_1_NAME, -- tld
Value => Object.Tld);
Object.Clear_Modified (8);
end if;
if Object.Is_Modified (9) then
Stmt.Save_Field (Name => COL_8_1_NAME, -- currency_code
Value => Object.Currency_Code);
Object.Clear_Modified (9);
end if;
if Stmt.Has_Save_Fields then
Stmt.Set_Filter (Filter => "id = ?");
Stmt.Add_Param (Value => Object.Get_Key);
declare
Result : Integer;
begin
Stmt.Execute (Result);
if Result /= 1 then
if Result /= 0 then
raise ADO.Objects.UPDATE_ERROR;
end if;
end if;
end;
end if;
end Save;
procedure Create (Object : in out Country_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Query : ADO.Statements.Insert_Statement
:= Session.Create_Statement (COUNTRY_DEF'Access);
Result : Integer;
begin
Session.Allocate (Id => Object);
Query.Save_Field (Name => COL_0_1_NAME, -- id
Value => Object.Get_Key);
Query.Save_Field (Name => COL_1_1_NAME, -- name
Value => Object.Name);
Query.Save_Field (Name => COL_2_1_NAME, -- continent
Value => Object.Continent);
Query.Save_Field (Name => COL_3_1_NAME, -- currency
Value => Object.Currency);
Query.Save_Field (Name => COL_4_1_NAME, -- iso_code
Value => Object.Iso_Code);
Query.Save_Field (Name => COL_5_1_NAME, -- geonameid
Value => Object.Geonameid);
Query.Save_Field (Name => COL_6_1_NAME, -- languages
Value => Object.Languages);
Query.Save_Field (Name => COL_7_1_NAME, -- tld
Value => Object.Tld);
Query.Save_Field (Name => COL_8_1_NAME, -- currency_code
Value => Object.Currency_Code);
Query.Execute (Result);
if Result /= 1 then
raise ADO.Objects.INSERT_ERROR;
end if;
ADO.Objects.Set_Created (Object);
end Create;
procedure Delete (Object : in out Country_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Stmt : ADO.Statements.Delete_Statement
:= Session.Create_Statement (COUNTRY_DEF'Access);
begin
Stmt.Set_Filter (Filter => "id = ?");
Stmt.Add_Param (Value => Object.Get_Key);
Stmt.Execute;
end Delete;
-- ------------------------------
-- Get the bean attribute identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in Country_Ref;
Name : in String) return Util.Beans.Objects.Object is
Obj : ADO.Objects.Object_Record_Access;
Impl : access Country_Impl;
begin
if From.Is_Null then
return Util.Beans.Objects.Null_Object;
end if;
Obj := From.Get_Load_Object;
Impl := Country_Impl (Obj.all)'Access;
if Name = "id" then
return ADO.Objects.To_Object (Impl.Get_Key);
elsif Name = "name" then
return Util.Beans.Objects.To_Object (Impl.Name);
elsif Name = "continent" then
return Util.Beans.Objects.To_Object (Impl.Continent);
elsif Name = "currency" then
return Util.Beans.Objects.To_Object (Impl.Currency);
elsif Name = "iso_code" then
return Util.Beans.Objects.To_Object (Impl.Iso_Code);
elsif Name = "geonameid" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (Impl.Geonameid));
elsif Name = "languages" then
return Util.Beans.Objects.To_Object (Impl.Languages);
elsif Name = "tld" then
return Util.Beans.Objects.To_Object (Impl.Tld);
elsif Name = "currency_code" then
return Util.Beans.Objects.To_Object (Impl.Currency_Code);
end if;
return Util.Beans.Objects.Null_Object;
end Get_Value;
-- ------------------------------
-- Load the object from current iterator position
-- ------------------------------
procedure Load (Object : in out Country_Impl;
Stmt : in out ADO.Statements.Query_Statement'Class;
Session : in out ADO.Sessions.Session'Class) is
pragma Unreferenced (Session);
begin
Object.Set_Key_Value (Stmt.Get_Identifier (0));
Object.Name := Stmt.Get_Unbounded_String (1);
Object.Continent := Stmt.Get_Unbounded_String (2);
Object.Currency := Stmt.Get_Unbounded_String (3);
Object.Iso_Code := Stmt.Get_Unbounded_String (4);
Object.Geonameid := Stmt.Get_Integer (5);
Object.Languages := Stmt.Get_Unbounded_String (6);
Object.Tld := Stmt.Get_Unbounded_String (7);
Object.Currency_Code := Stmt.Get_Unbounded_String (8);
ADO.Objects.Set_Created (Object);
end Load;
function City_Key (Id : in ADO.Identifier) return ADO.Objects.Object_Key is
Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER,
Of_Class => CITY_DEF'Access);
begin
ADO.Objects.Set_Value (Result, Id);
return Result;
end City_Key;
function City_Key (Id : in String) return ADO.Objects.Object_Key is
Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER,
Of_Class => CITY_DEF'Access);
begin
ADO.Objects.Set_Value (Result, Id);
return Result;
end City_Key;
function "=" (Left, Right : City_Ref'Class) return Boolean is
begin
return ADO.Objects.Object_Ref'Class (Left) = ADO.Objects.Object_Ref'Class (Right);
end "=";
procedure Set_Field (Object : in out City_Ref'Class;
Impl : out City_Access) is
Result : ADO.Objects.Object_Record_Access;
begin
Object.Prepare_Modify (Result);
Impl := City_Impl (Result.all)'Access;
end Set_Field;
-- Internal method to allocate the Object_Record instance
procedure Allocate (Object : in out City_Ref) is
Impl : City_Access;
begin
Impl := new City_Impl;
Impl.Zip_Code := 0;
Impl.Latitude := 0;
Impl.Longitude := 0;
ADO.Objects.Set_Object (Object, Impl.all'Access);
end Allocate;
-- ----------------------------------------
-- Data object: City
-- ----------------------------------------
procedure Set_Id (Object : in out City_Ref;
Value : in ADO.Identifier) is
Impl : City_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Key_Value (Impl.all, 1, Value);
end Set_Id;
function Get_Id (Object : in City_Ref)
return ADO.Identifier is
Impl : constant City_Access
:= City_Impl (Object.Get_Object.all)'Access;
begin
return Impl.Get_Key_Value;
end Get_Id;
procedure Set_Name (Object : in out City_Ref;
Value : in String) is
Impl : City_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_String (Impl.all, 2, Impl.Name, Value);
end Set_Name;
procedure Set_Name (Object : in out City_Ref;
Value : in Ada.Strings.Unbounded.Unbounded_String) is
Impl : City_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Unbounded_String (Impl.all, 2, Impl.Name, Value);
end Set_Name;
function Get_Name (Object : in City_Ref)
return String is
begin
return Ada.Strings.Unbounded.To_String (Object.Get_Name);
end Get_Name;
function Get_Name (Object : in City_Ref)
return Ada.Strings.Unbounded.Unbounded_String is
Impl : constant City_Access
:= City_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Name;
end Get_Name;
procedure Set_Zip_Code (Object : in out City_Ref;
Value : in Integer) is
Impl : City_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Integer (Impl.all, 3, Impl.Zip_Code, Value);
end Set_Zip_Code;
function Get_Zip_Code (Object : in City_Ref)
return Integer is
Impl : constant City_Access
:= City_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Zip_Code;
end Get_Zip_Code;
procedure Set_Latitude (Object : in out City_Ref;
Value : in Integer) is
Impl : City_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Integer (Impl.all, 4, Impl.Latitude, Value);
end Set_Latitude;
function Get_Latitude (Object : in City_Ref)
return Integer is
Impl : constant City_Access
:= City_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Latitude;
end Get_Latitude;
procedure Set_Longitude (Object : in out City_Ref;
Value : in Integer) is
Impl : City_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Integer (Impl.all, 5, Impl.Longitude, Value);
end Set_Longitude;
function Get_Longitude (Object : in City_Ref)
return Integer is
Impl : constant City_Access
:= City_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Longitude;
end Get_Longitude;
procedure Set_Region (Object : in out City_Ref;
Value : in AWA.Countries.Models.Region_Ref'Class) is
Impl : City_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Object (Impl.all, 6, Impl.Region, Value);
end Set_Region;
function Get_Region (Object : in City_Ref)
return AWA.Countries.Models.Region_Ref'Class is
Impl : constant City_Access
:= City_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Region;
end Get_Region;
procedure Set_Country (Object : in out City_Ref;
Value : in AWA.Countries.Models.Country_Ref'Class) is
Impl : City_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Object (Impl.all, 7, Impl.Country, Value);
end Set_Country;
function Get_Country (Object : in City_Ref)
return AWA.Countries.Models.Country_Ref'Class is
Impl : constant City_Access
:= City_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Country;
end Get_Country;
-- Copy of the object.
procedure Copy (Object : in City_Ref;
Into : in out City_Ref) is
Result : City_Ref;
begin
if not Object.Is_Null then
declare
Impl : constant City_Access
:= City_Impl (Object.Get_Load_Object.all)'Access;
Copy : constant City_Access
:= new City_Impl;
begin
ADO.Objects.Set_Object (Result, Copy.all'Access);
Copy.Copy (Impl.all);
Copy.Name := Impl.Name;
Copy.Zip_Code := Impl.Zip_Code;
Copy.Latitude := Impl.Latitude;
Copy.Longitude := Impl.Longitude;
Copy.Region := Impl.Region;
Copy.Country := Impl.Country;
end;
end if;
Into := Result;
end Copy;
procedure Find (Object : in out City_Ref;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean) is
Impl : constant City_Access := new City_Impl;
begin
Impl.Find (Session, Query, Found);
if Found then
ADO.Objects.Set_Object (Object, Impl.all'Access);
else
ADO.Objects.Set_Object (Object, null);
Destroy (Impl);
end if;
end Find;
procedure Load (Object : in out City_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier) is
Impl : constant City_Access := new City_Impl;
Found : Boolean;
Query : ADO.SQL.Query;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Impl.Find (Session, Query, Found);
if not Found then
Destroy (Impl);
raise ADO.Objects.NOT_FOUND;
end if;
ADO.Objects.Set_Object (Object, Impl.all'Access);
end Load;
procedure Load (Object : in out City_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier;
Found : out Boolean) is
Impl : constant City_Access := new City_Impl;
Query : ADO.SQL.Query;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Impl.Find (Session, Query, Found);
if not Found then
Destroy (Impl);
else
ADO.Objects.Set_Object (Object, Impl.all'Access);
end if;
end Load;
procedure Save (Object : in out City_Ref;
Session : in out ADO.Sessions.Master_Session'Class) is
Impl : ADO.Objects.Object_Record_Access := Object.Get_Object;
begin
if Impl = null then
Impl := new City_Impl;
ADO.Objects.Set_Object (Object, Impl);
end if;
if not ADO.Objects.Is_Created (Impl.all) then
Impl.Create (Session);
else
Impl.Save (Session);
end if;
end Save;
procedure Delete (Object : in out City_Ref;
Session : in out ADO.Sessions.Master_Session'Class) is
Impl : constant ADO.Objects.Object_Record_Access := Object.Get_Object;
begin
if Impl /= null then
Impl.Delete (Session);
end if;
end Delete;
-- --------------------
-- Free the object
-- --------------------
procedure Destroy (Object : access City_Impl) is
type City_Impl_Ptr is access all City_Impl;
procedure Unchecked_Free is new Ada.Unchecked_Deallocation
(City_Impl, City_Impl_Ptr);
pragma Warnings (Off, "*redundant conversion*");
Ptr : City_Impl_Ptr := City_Impl (Object.all)'Access;
pragma Warnings (On, "*redundant conversion*");
begin
Unchecked_Free (Ptr);
end Destroy;
procedure Find (Object : in out City_Impl;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean) is
Stmt : ADO.Statements.Query_Statement
:= Session.Create_Statement (Query, CITY_DEF'Access);
begin
Stmt.Execute;
if Stmt.Has_Elements then
Object.Load (Stmt, Session);
Stmt.Next;
Found := not Stmt.Has_Elements;
else
Found := False;
end if;
end Find;
overriding
procedure Load (Object : in out City_Impl;
Session : in out ADO.Sessions.Session'Class) is
Found : Boolean;
Query : ADO.SQL.Query;
Id : constant ADO.Identifier := Object.Get_Key_Value;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Object.Find (Session, Query, Found);
if not Found then
raise ADO.Objects.NOT_FOUND;
end if;
end Load;
procedure Save (Object : in out City_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Stmt : ADO.Statements.Update_Statement
:= Session.Create_Statement (CITY_DEF'Access);
begin
if Object.Is_Modified (1) then
Stmt.Save_Field (Name => COL_0_2_NAME, -- id
Value => Object.Get_Key);
Object.Clear_Modified (1);
end if;
if Object.Is_Modified (2) then
Stmt.Save_Field (Name => COL_1_2_NAME, -- name
Value => Object.Name);
Object.Clear_Modified (2);
end if;
if Object.Is_Modified (3) then
Stmt.Save_Field (Name => COL_2_2_NAME, -- zip_code
Value => Object.Zip_Code);
Object.Clear_Modified (3);
end if;
if Object.Is_Modified (4) then
Stmt.Save_Field (Name => COL_3_2_NAME, -- latitude
Value => Object.Latitude);
Object.Clear_Modified (4);
end if;
if Object.Is_Modified (5) then
Stmt.Save_Field (Name => COL_4_2_NAME, -- longitude
Value => Object.Longitude);
Object.Clear_Modified (5);
end if;
if Object.Is_Modified (6) then
Stmt.Save_Field (Name => COL_5_2_NAME, -- region_id
Value => Object.Region);
Object.Clear_Modified (6);
end if;
if Object.Is_Modified (7) then
Stmt.Save_Field (Name => COL_6_2_NAME, -- country_id
Value => Object.Country);
Object.Clear_Modified (7);
end if;
if Stmt.Has_Save_Fields then
Stmt.Set_Filter (Filter => "id = ?");
Stmt.Add_Param (Value => Object.Get_Key);
declare
Result : Integer;
begin
Stmt.Execute (Result);
if Result /= 1 then
if Result /= 0 then
raise ADO.Objects.UPDATE_ERROR;
end if;
end if;
end;
end if;
end Save;
procedure Create (Object : in out City_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Query : ADO.Statements.Insert_Statement
:= Session.Create_Statement (CITY_DEF'Access);
Result : Integer;
begin
Session.Allocate (Id => Object);
Query.Save_Field (Name => COL_0_2_NAME, -- id
Value => Object.Get_Key);
Query.Save_Field (Name => COL_1_2_NAME, -- name
Value => Object.Name);
Query.Save_Field (Name => COL_2_2_NAME, -- zip_code
Value => Object.Zip_Code);
Query.Save_Field (Name => COL_3_2_NAME, -- latitude
Value => Object.Latitude);
Query.Save_Field (Name => COL_4_2_NAME, -- longitude
Value => Object.Longitude);
Query.Save_Field (Name => COL_5_2_NAME, -- region_id
Value => Object.Region);
Query.Save_Field (Name => COL_6_2_NAME, -- country_id
Value => Object.Country);
Query.Execute (Result);
if Result /= 1 then
raise ADO.Objects.INSERT_ERROR;
end if;
ADO.Objects.Set_Created (Object);
end Create;
procedure Delete (Object : in out City_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Stmt : ADO.Statements.Delete_Statement
:= Session.Create_Statement (CITY_DEF'Access);
begin
Stmt.Set_Filter (Filter => "id = ?");
Stmt.Add_Param (Value => Object.Get_Key);
Stmt.Execute;
end Delete;
-- ------------------------------
-- Get the bean attribute identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in City_Ref;
Name : in String) return Util.Beans.Objects.Object is
Obj : ADO.Objects.Object_Record_Access;
Impl : access City_Impl;
begin
if From.Is_Null then
return Util.Beans.Objects.Null_Object;
end if;
Obj := From.Get_Load_Object;
Impl := City_Impl (Obj.all)'Access;
if Name = "id" then
return ADO.Objects.To_Object (Impl.Get_Key);
elsif Name = "name" then
return Util.Beans.Objects.To_Object (Impl.Name);
elsif Name = "zip_code" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (Impl.Zip_Code));
elsif Name = "latitude" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (Impl.Latitude));
elsif Name = "longitude" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (Impl.Longitude));
end if;
return Util.Beans.Objects.Null_Object;
end Get_Value;
-- ------------------------------
-- Load the object from current iterator position
-- ------------------------------
procedure Load (Object : in out City_Impl;
Stmt : in out ADO.Statements.Query_Statement'Class;
Session : in out ADO.Sessions.Session'Class) is
begin
Object.Set_Key_Value (Stmt.Get_Identifier (0));
Object.Name := Stmt.Get_Unbounded_String (1);
Object.Zip_Code := Stmt.Get_Integer (2);
Object.Latitude := Stmt.Get_Integer (3);
Object.Longitude := Stmt.Get_Integer (4);
if not Stmt.Is_Null (5) then
Object.Region.Set_Key_Value (Stmt.Get_Identifier (5), Session);
end if;
if not Stmt.Is_Null (6) then
Object.Country.Set_Key_Value (Stmt.Get_Identifier (6), Session);
end if;
ADO.Objects.Set_Created (Object);
end Load;
function Country_Neighbor_Key (Id : in ADO.Identifier) return ADO.Objects.Object_Key is
Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER,
Of_Class => COUNTRY_NEIGHBOR_DEF'Access);
begin
ADO.Objects.Set_Value (Result, Id);
return Result;
end Country_Neighbor_Key;
function Country_Neighbor_Key (Id : in String) return ADO.Objects.Object_Key is
Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER,
Of_Class => COUNTRY_NEIGHBOR_DEF'Access);
begin
ADO.Objects.Set_Value (Result, Id);
return Result;
end Country_Neighbor_Key;
function "=" (Left, Right : Country_Neighbor_Ref'Class) return Boolean is
begin
return ADO.Objects.Object_Ref'Class (Left) = ADO.Objects.Object_Ref'Class (Right);
end "=";
procedure Set_Field (Object : in out Country_Neighbor_Ref'Class;
Impl : out Country_Neighbor_Access) is
Result : ADO.Objects.Object_Record_Access;
begin
Object.Prepare_Modify (Result);
Impl := Country_Neighbor_Impl (Result.all)'Access;
end Set_Field;
-- Internal method to allocate the Object_Record instance
procedure Allocate (Object : in out Country_Neighbor_Ref) is
Impl : Country_Neighbor_Access;
begin
Impl := new Country_Neighbor_Impl;
ADO.Objects.Set_Object (Object, Impl.all'Access);
end Allocate;
-- ----------------------------------------
-- Data object: Country_Neighbor
-- ----------------------------------------
procedure Set_Id (Object : in out Country_Neighbor_Ref;
Value : in ADO.Identifier) is
Impl : Country_Neighbor_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Key_Value (Impl.all, 1, Value);
end Set_Id;
function Get_Id (Object : in Country_Neighbor_Ref)
return ADO.Identifier is
Impl : constant Country_Neighbor_Access
:= Country_Neighbor_Impl (Object.Get_Object.all)'Access;
begin
return Impl.Get_Key_Value;
end Get_Id;
procedure Set_Neighbor_Of (Object : in out Country_Neighbor_Ref;
Value : in AWA.Countries.Models.Country_Ref'Class) is
Impl : Country_Neighbor_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Object (Impl.all, 2, Impl.Neighbor_Of, Value);
end Set_Neighbor_Of;
function Get_Neighbor_Of (Object : in Country_Neighbor_Ref)
return AWA.Countries.Models.Country_Ref'Class is
Impl : constant Country_Neighbor_Access
:= Country_Neighbor_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Neighbor_Of;
end Get_Neighbor_Of;
procedure Set_Neighbor (Object : in out Country_Neighbor_Ref;
Value : in AWA.Countries.Models.Country_Ref'Class) is
Impl : Country_Neighbor_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Object (Impl.all, 3, Impl.Neighbor, Value);
end Set_Neighbor;
function Get_Neighbor (Object : in Country_Neighbor_Ref)
return AWA.Countries.Models.Country_Ref'Class is
Impl : constant Country_Neighbor_Access
:= Country_Neighbor_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Neighbor;
end Get_Neighbor;
-- Copy of the object.
procedure Copy (Object : in Country_Neighbor_Ref;
Into : in out Country_Neighbor_Ref) is
Result : Country_Neighbor_Ref;
begin
if not Object.Is_Null then
declare
Impl : constant Country_Neighbor_Access
:= Country_Neighbor_Impl (Object.Get_Load_Object.all)'Access;
Copy : constant Country_Neighbor_Access
:= new Country_Neighbor_Impl;
begin
ADO.Objects.Set_Object (Result, Copy.all'Access);
Copy.Copy (Impl.all);
Copy.Neighbor_Of := Impl.Neighbor_Of;
Copy.Neighbor := Impl.Neighbor;
end;
end if;
Into := Result;
end Copy;
procedure Find (Object : in out Country_Neighbor_Ref;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean) is
Impl : constant Country_Neighbor_Access := new Country_Neighbor_Impl;
begin
Impl.Find (Session, Query, Found);
if Found then
ADO.Objects.Set_Object (Object, Impl.all'Access);
else
ADO.Objects.Set_Object (Object, null);
Destroy (Impl);
end if;
end Find;
procedure Load (Object : in out Country_Neighbor_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier) is
Impl : constant Country_Neighbor_Access := new Country_Neighbor_Impl;
Found : Boolean;
Query : ADO.SQL.Query;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Impl.Find (Session, Query, Found);
if not Found then
Destroy (Impl);
raise ADO.Objects.NOT_FOUND;
end if;
ADO.Objects.Set_Object (Object, Impl.all'Access);
end Load;
procedure Load (Object : in out Country_Neighbor_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier;
Found : out Boolean) is
Impl : constant Country_Neighbor_Access := new Country_Neighbor_Impl;
Query : ADO.SQL.Query;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Impl.Find (Session, Query, Found);
if not Found then
Destroy (Impl);
else
ADO.Objects.Set_Object (Object, Impl.all'Access);
end if;
end Load;
procedure Save (Object : in out Country_Neighbor_Ref;
Session : in out ADO.Sessions.Master_Session'Class) is
Impl : ADO.Objects.Object_Record_Access := Object.Get_Object;
begin
if Impl = null then
Impl := new Country_Neighbor_Impl;
ADO.Objects.Set_Object (Object, Impl);
end if;
if not ADO.Objects.Is_Created (Impl.all) then
Impl.Create (Session);
else
Impl.Save (Session);
end if;
end Save;
procedure Delete (Object : in out Country_Neighbor_Ref;
Session : in out ADO.Sessions.Master_Session'Class) is
Impl : constant ADO.Objects.Object_Record_Access := Object.Get_Object;
begin
if Impl /= null then
Impl.Delete (Session);
end if;
end Delete;
-- --------------------
-- Free the object
-- --------------------
procedure Destroy (Object : access Country_Neighbor_Impl) is
type Country_Neighbor_Impl_Ptr is access all Country_Neighbor_Impl;
procedure Unchecked_Free is new Ada.Unchecked_Deallocation
(Country_Neighbor_Impl, Country_Neighbor_Impl_Ptr);
pragma Warnings (Off, "*redundant conversion*");
Ptr : Country_Neighbor_Impl_Ptr := Country_Neighbor_Impl (Object.all)'Access;
pragma Warnings (On, "*redundant conversion*");
begin
Unchecked_Free (Ptr);
end Destroy;
procedure Find (Object : in out Country_Neighbor_Impl;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean) is
Stmt : ADO.Statements.Query_Statement
:= Session.Create_Statement (Query, COUNTRY_NEIGHBOR_DEF'Access);
begin
Stmt.Execute;
if Stmt.Has_Elements then
Object.Load (Stmt, Session);
Stmt.Next;
Found := not Stmt.Has_Elements;
else
Found := False;
end if;
end Find;
overriding
procedure Load (Object : in out Country_Neighbor_Impl;
Session : in out ADO.Sessions.Session'Class) is
Found : Boolean;
Query : ADO.SQL.Query;
Id : constant ADO.Identifier := Object.Get_Key_Value;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Object.Find (Session, Query, Found);
if not Found then
raise ADO.Objects.NOT_FOUND;
end if;
end Load;
procedure Save (Object : in out Country_Neighbor_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Stmt : ADO.Statements.Update_Statement
:= Session.Create_Statement (COUNTRY_NEIGHBOR_DEF'Access);
begin
if Object.Is_Modified (1) then
Stmt.Save_Field (Name => COL_0_3_NAME, -- id
Value => Object.Get_Key);
Object.Clear_Modified (1);
end if;
if Object.Is_Modified (2) then
Stmt.Save_Field (Name => COL_1_3_NAME, -- neighbor_of_id
Value => Object.Neighbor_Of);
Object.Clear_Modified (2);
end if;
if Object.Is_Modified (3) then
Stmt.Save_Field (Name => COL_2_3_NAME, -- neighbor_id
Value => Object.Neighbor);
Object.Clear_Modified (3);
end if;
if Stmt.Has_Save_Fields then
Stmt.Set_Filter (Filter => "id = ?");
Stmt.Add_Param (Value => Object.Get_Key);
declare
Result : Integer;
begin
Stmt.Execute (Result);
if Result /= 1 then
if Result /= 0 then
raise ADO.Objects.UPDATE_ERROR;
end if;
end if;
end;
end if;
end Save;
procedure Create (Object : in out Country_Neighbor_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Query : ADO.Statements.Insert_Statement
:= Session.Create_Statement (COUNTRY_NEIGHBOR_DEF'Access);
Result : Integer;
begin
Session.Allocate (Id => Object);
Query.Save_Field (Name => COL_0_3_NAME, -- id
Value => Object.Get_Key);
Query.Save_Field (Name => COL_1_3_NAME, -- neighbor_of_id
Value => Object.Neighbor_Of);
Query.Save_Field (Name => COL_2_3_NAME, -- neighbor_id
Value => Object.Neighbor);
Query.Execute (Result);
if Result /= 1 then
raise ADO.Objects.INSERT_ERROR;
end if;
ADO.Objects.Set_Created (Object);
end Create;
procedure Delete (Object : in out Country_Neighbor_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Stmt : ADO.Statements.Delete_Statement
:= Session.Create_Statement (COUNTRY_NEIGHBOR_DEF'Access);
begin
Stmt.Set_Filter (Filter => "id = ?");
Stmt.Add_Param (Value => Object.Get_Key);
Stmt.Execute;
end Delete;
-- ------------------------------
-- Get the bean attribute identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in Country_Neighbor_Ref;
Name : in String) return Util.Beans.Objects.Object is
Obj : ADO.Objects.Object_Record_Access;
Impl : access Country_Neighbor_Impl;
begin
if From.Is_Null then
return Util.Beans.Objects.Null_Object;
end if;
Obj := From.Get_Load_Object;
Impl := Country_Neighbor_Impl (Obj.all)'Access;
if Name = "id" then
return ADO.Objects.To_Object (Impl.Get_Key);
end if;
return Util.Beans.Objects.Null_Object;
end Get_Value;
-- ------------------------------
-- Load the object from current iterator position
-- ------------------------------
procedure Load (Object : in out Country_Neighbor_Impl;
Stmt : in out ADO.Statements.Query_Statement'Class;
Session : in out ADO.Sessions.Session'Class) is
begin
Object.Set_Key_Value (Stmt.Get_Identifier (0));
if not Stmt.Is_Null (1) then
Object.Neighbor_Of.Set_Key_Value (Stmt.Get_Identifier (1), Session);
end if;
if not Stmt.Is_Null (2) then
Object.Neighbor.Set_Key_Value (Stmt.Get_Identifier (2), Session);
end if;
ADO.Objects.Set_Created (Object);
end Load;
function Region_Key (Id : in ADO.Identifier) return ADO.Objects.Object_Key is
Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER,
Of_Class => REGION_DEF'Access);
begin
ADO.Objects.Set_Value (Result, Id);
return Result;
end Region_Key;
function Region_Key (Id : in String) return ADO.Objects.Object_Key is
Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER,
Of_Class => REGION_DEF'Access);
begin
ADO.Objects.Set_Value (Result, Id);
return Result;
end Region_Key;
function "=" (Left, Right : Region_Ref'Class) return Boolean is
begin
return ADO.Objects.Object_Ref'Class (Left) = ADO.Objects.Object_Ref'Class (Right);
end "=";
procedure Set_Field (Object : in out Region_Ref'Class;
Impl : out Region_Access) is
Result : ADO.Objects.Object_Record_Access;
begin
Object.Prepare_Modify (Result);
Impl := Region_Impl (Result.all)'Access;
end Set_Field;
-- Internal method to allocate the Object_Record instance
procedure Allocate (Object : in out Region_Ref) is
Impl : Region_Access;
begin
Impl := new Region_Impl;
Impl.Geonameid := 0;
ADO.Objects.Set_Object (Object, Impl.all'Access);
end Allocate;
-- ----------------------------------------
-- Data object: Region
-- ----------------------------------------
procedure Set_Id (Object : in out Region_Ref;
Value : in ADO.Identifier) is
Impl : Region_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Key_Value (Impl.all, 1, Value);
end Set_Id;
function Get_Id (Object : in Region_Ref)
return ADO.Identifier is
Impl : constant Region_Access
:= Region_Impl (Object.Get_Object.all)'Access;
begin
return Impl.Get_Key_Value;
end Get_Id;
procedure Set_Name (Object : in out Region_Ref;
Value : in String) is
Impl : Region_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_String (Impl.all, 2, Impl.Name, Value);
end Set_Name;
procedure Set_Name (Object : in out Region_Ref;
Value : in Ada.Strings.Unbounded.Unbounded_String) is
Impl : Region_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Unbounded_String (Impl.all, 2, Impl.Name, Value);
end Set_Name;
function Get_Name (Object : in Region_Ref)
return String is
begin
return Ada.Strings.Unbounded.To_String (Object.Get_Name);
end Get_Name;
function Get_Name (Object : in Region_Ref)
return Ada.Strings.Unbounded.Unbounded_String is
Impl : constant Region_Access
:= Region_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Name;
end Get_Name;
procedure Set_Geonameid (Object : in out Region_Ref;
Value : in Integer) is
Impl : Region_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Integer (Impl.all, 3, Impl.Geonameid, Value);
end Set_Geonameid;
function Get_Geonameid (Object : in Region_Ref)
return Integer is
Impl : constant Region_Access
:= Region_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Geonameid;
end Get_Geonameid;
procedure Set_Country (Object : in out Region_Ref;
Value : in AWA.Countries.Models.Country_Ref'Class) is
Impl : Region_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Object (Impl.all, 4, Impl.Country, Value);
end Set_Country;
function Get_Country (Object : in Region_Ref)
return AWA.Countries.Models.Country_Ref'Class is
Impl : constant Region_Access
:= Region_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Country;
end Get_Country;
-- Copy of the object.
procedure Copy (Object : in Region_Ref;
Into : in out Region_Ref) is
Result : Region_Ref;
begin
if not Object.Is_Null then
declare
Impl : constant Region_Access
:= Region_Impl (Object.Get_Load_Object.all)'Access;
Copy : constant Region_Access
:= new Region_Impl;
begin
ADO.Objects.Set_Object (Result, Copy.all'Access);
Copy.Copy (Impl.all);
Copy.Name := Impl.Name;
Copy.Geonameid := Impl.Geonameid;
Copy.Country := Impl.Country;
end;
end if;
Into := Result;
end Copy;
procedure Find (Object : in out Region_Ref;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean) is
Impl : constant Region_Access := new Region_Impl;
begin
Impl.Find (Session, Query, Found);
if Found then
ADO.Objects.Set_Object (Object, Impl.all'Access);
else
ADO.Objects.Set_Object (Object, null);
Destroy (Impl);
end if;
end Find;
procedure Load (Object : in out Region_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier) is
Impl : constant Region_Access := new Region_Impl;
Found : Boolean;
Query : ADO.SQL.Query;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Impl.Find (Session, Query, Found);
if not Found then
Destroy (Impl);
raise ADO.Objects.NOT_FOUND;
end if;
ADO.Objects.Set_Object (Object, Impl.all'Access);
end Load;
procedure Load (Object : in out Region_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier;
Found : out Boolean) is
Impl : constant Region_Access := new Region_Impl;
Query : ADO.SQL.Query;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Impl.Find (Session, Query, Found);
if not Found then
Destroy (Impl);
else
ADO.Objects.Set_Object (Object, Impl.all'Access);
end if;
end Load;
procedure Save (Object : in out Region_Ref;
Session : in out ADO.Sessions.Master_Session'Class) is
Impl : ADO.Objects.Object_Record_Access := Object.Get_Object;
begin
if Impl = null then
Impl := new Region_Impl;
ADO.Objects.Set_Object (Object, Impl);
end if;
if not ADO.Objects.Is_Created (Impl.all) then
Impl.Create (Session);
else
Impl.Save (Session);
end if;
end Save;
procedure Delete (Object : in out Region_Ref;
Session : in out ADO.Sessions.Master_Session'Class) is
Impl : constant ADO.Objects.Object_Record_Access := Object.Get_Object;
begin
if Impl /= null then
Impl.Delete (Session);
end if;
end Delete;
-- --------------------
-- Free the object
-- --------------------
procedure Destroy (Object : access Region_Impl) is
type Region_Impl_Ptr is access all Region_Impl;
procedure Unchecked_Free is new Ada.Unchecked_Deallocation
(Region_Impl, Region_Impl_Ptr);
pragma Warnings (Off, "*redundant conversion*");
Ptr : Region_Impl_Ptr := Region_Impl (Object.all)'Access;
pragma Warnings (On, "*redundant conversion*");
begin
Unchecked_Free (Ptr);
end Destroy;
procedure Find (Object : in out Region_Impl;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean) is
Stmt : ADO.Statements.Query_Statement
:= Session.Create_Statement (Query, REGION_DEF'Access);
begin
Stmt.Execute;
if Stmt.Has_Elements then
Object.Load (Stmt, Session);
Stmt.Next;
Found := not Stmt.Has_Elements;
else
Found := False;
end if;
end Find;
overriding
procedure Load (Object : in out Region_Impl;
Session : in out ADO.Sessions.Session'Class) is
Found : Boolean;
Query : ADO.SQL.Query;
Id : constant ADO.Identifier := Object.Get_Key_Value;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Object.Find (Session, Query, Found);
if not Found then
raise ADO.Objects.NOT_FOUND;
end if;
end Load;
procedure Save (Object : in out Region_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Stmt : ADO.Statements.Update_Statement
:= Session.Create_Statement (REGION_DEF'Access);
begin
if Object.Is_Modified (1) then
Stmt.Save_Field (Name => COL_0_4_NAME, -- id
Value => Object.Get_Key);
Object.Clear_Modified (1);
end if;
if Object.Is_Modified (2) then
Stmt.Save_Field (Name => COL_1_4_NAME, -- name
Value => Object.Name);
Object.Clear_Modified (2);
end if;
if Object.Is_Modified (3) then
Stmt.Save_Field (Name => COL_2_4_NAME, -- geonameid
Value => Object.Geonameid);
Object.Clear_Modified (3);
end if;
if Object.Is_Modified (4) then
Stmt.Save_Field (Name => COL_3_4_NAME, -- country_id
Value => Object.Country);
Object.Clear_Modified (4);
end if;
if Stmt.Has_Save_Fields then
Stmt.Set_Filter (Filter => "id = ?");
Stmt.Add_Param (Value => Object.Get_Key);
declare
Result : Integer;
begin
Stmt.Execute (Result);
if Result /= 1 then
if Result /= 0 then
raise ADO.Objects.UPDATE_ERROR;
end if;
end if;
end;
end if;
end Save;
procedure Create (Object : in out Region_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Query : ADO.Statements.Insert_Statement
:= Session.Create_Statement (REGION_DEF'Access);
Result : Integer;
begin
Session.Allocate (Id => Object);
Query.Save_Field (Name => COL_0_4_NAME, -- id
Value => Object.Get_Key);
Query.Save_Field (Name => COL_1_4_NAME, -- name
Value => Object.Name);
Query.Save_Field (Name => COL_2_4_NAME, -- geonameid
Value => Object.Geonameid);
Query.Save_Field (Name => COL_3_4_NAME, -- country_id
Value => Object.Country);
Query.Execute (Result);
if Result /= 1 then
raise ADO.Objects.INSERT_ERROR;
end if;
ADO.Objects.Set_Created (Object);
end Create;
procedure Delete (Object : in out Region_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Stmt : ADO.Statements.Delete_Statement
:= Session.Create_Statement (REGION_DEF'Access);
begin
Stmt.Set_Filter (Filter => "id = ?");
Stmt.Add_Param (Value => Object.Get_Key);
Stmt.Execute;
end Delete;
-- ------------------------------
-- Get the bean attribute identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in Region_Ref;
Name : in String) return Util.Beans.Objects.Object is
Obj : ADO.Objects.Object_Record_Access;
Impl : access Region_Impl;
begin
if From.Is_Null then
return Util.Beans.Objects.Null_Object;
end if;
Obj := From.Get_Load_Object;
Impl := Region_Impl (Obj.all)'Access;
if Name = "id" then
return ADO.Objects.To_Object (Impl.Get_Key);
elsif Name = "name" then
return Util.Beans.Objects.To_Object (Impl.Name);
elsif Name = "geonameid" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (Impl.Geonameid));
end if;
return Util.Beans.Objects.Null_Object;
end Get_Value;
-- ------------------------------
-- Load the object from current iterator position
-- ------------------------------
procedure Load (Object : in out Region_Impl;
Stmt : in out ADO.Statements.Query_Statement'Class;
Session : in out ADO.Sessions.Session'Class) is
begin
Object.Set_Key_Value (Stmt.Get_Identifier (0));
Object.Name := Stmt.Get_Unbounded_String (1);
Object.Geonameid := Stmt.Get_Integer (2);
if not Stmt.Is_Null (3) then
Object.Country.Set_Key_Value (Stmt.Get_Identifier (3), Session);
end if;
ADO.Objects.Set_Created (Object);
end Load;
end AWA.Countries.Models;
|
-- Copyright (c) 2019 Maxim Reznik <reznikmm@gmail.com>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
with Program.Elements.Definitions;
package Program.Elements.Type_Definitions is
pragma Pure (Program.Elements.Type_Definitions);
type Type_Definition is
limited interface and Program.Elements.Definitions.Definition;
type Type_Definition_Access is access all Type_Definition'Class
with Storage_Size => 0;
end Program.Elements.Type_Definitions;
|
with
AdaM.Factory;
package body AdaM.context_Clause
is
-- Storage Pool
--
record_Version : constant := 1;
pool_Size : constant := 5_000;
package Pool is new AdaM.Factory.Pools (".adam-store",
"context_Clauses",
pool_Size,
record_Version,
context_Clause.item,
context_Clause.view);
-- Forge
--
procedure define (Self : in out Item)
is
begin
null;
end define;
procedure destruct (Self : in out Item)
is
begin
null;
end destruct;
function new_Subprogram return View
is
new_View : constant context_Clause.view := Pool.new_Item;
begin
define (context_Clause.item (new_View.all));
return new_View;
end new_Subprogram;
procedure free (Self : in out context_Clause.view)
is
begin
destruct (context_Clause.item (Self.all));
Pool.free (Self);
end free;
-- Attributes
--
overriding
function Id (Self : access Item) return AdaM.Id
is
begin
return Pool.to_Id (Self);
end Id;
-- Streams
--
procedure View_write (Stream : not null access Ada.Streams.Root_Stream_Type'Class;
Self : in View)
renames Pool.View_write;
procedure View_read (Stream : not null access Ada.Streams.Root_Stream_Type'Class;
Self : out View)
renames Pool.View_read;
end AdaM.context_Clause;
|
-- Abstract :
--
-- A simple bounded sorted vector of definite items, in Spark.
--
-- Copyright (C) 2018 - 2020 Free Software Foundation, Inc.
--
-- This library is free software; you can redistribute it and/or modify it
-- under terms of the GNU General Public License as published by the Free
-- Software Foundation; either version 3, or (at your option) any later
-- version. This library is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-
-- TABILITY 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.
pragma License (Modified_GPL);
generic
type Element_Type is private;
with function Element_Compare (Left, Right : in Element_Type) return Compare_Result;
Capacity : in Ada.Containers.Count_Type;
package SAL.Gen_Bounded_Definite_Vectors_Sorted
with Spark_Mode
is
use all type Ada.Containers.Count_Type;
No_Index : constant Base_Peek_Type := 0;
type Vector is private with
Default_Initial_Condition => Last_Index (Vector) = No_Index;
function Length (Container : in Vector) return Ada.Containers.Count_Type with
Post => Length'Result in 0 .. Capacity;
function Is_Full (Container : in Vector) return Boolean with
Post => Is_Full'Result = (Length (Container) = Capacity);
procedure Clear (Container : in out Vector) with
Post => Last_Index (Container) = No_Index;
function First_Index (Container : in Vector) return Peek_Type
is (Peek_Type'First) with
Depends => (First_Index'Result => null, null => Container);
function Last_Index (Container : in Vector) return Base_Peek_Type with
Inline;
function Element (Container : in Vector; Index : in Peek_Type) return Element_Type with
Pre => Index in First_Index (Container) .. Last_Index (Container);
function Is_Sorted (Container : in Vector) return Boolean is
-- See comment on similar Is_Sorted below
(for all I in First_Index (Container) .. Last_Index (Container) - 1 =>
(for all J in I + 1 .. Last_Index (Container) =>
Element_Compare (Element (Container, I), Element (Container, J)) in Less | Equal));
procedure Insert
(Container : in out Vector;
New_Item : in Element_Type;
Ignore_If_Equal : in Boolean := False) with
Pre => Last_Index (Container) < Peek_Type (Capacity),
Post => Is_Sorted (Container) and
(if Ignore_If_Equal then
(Last_Index (Container) = Last_Index (Container'Old) or
Last_Index (Container) = Last_Index (Container'Old) + 1)
else
Last_Index (Container) = Last_Index (Container'Old) + 1);
-- Insert New_Item in sorted position. Items are sorted in increasing
-- order according to Element_Compare. New_Item is inserted after
-- Equal items, unless Ignore_If_Equal is true, in which case
-- New_Item is not inserted.
private
type Array_Type is array (Peek_Type range 1 .. Peek_Type (Capacity)) of aliased Element_Type;
function Is_Sorted (Container : in Array_Type; Last : in Base_Peek_Type) return Boolean
-- This is too hard for gnatprove (in 2019):
-- is (for all I in Container'First .. Last - 1 =>
-- Element_Compare (Container (I), Container (I + 1)) in Less | Equal)
-- This works:
is (for all I in Container'First .. Last - 1 =>
(for all J in I + 1 .. Last =>
Element_Compare (Container (I), Container (J)) in Less | Equal))
with Pre => Last <= Container'Last;
subtype Index_Type is Base_Peek_Type range No_Index .. Base_Peek_Type (Capacity);
-- Helps with proofs
type Vector is record
Elements : Array_Type;
Last : Index_Type := No_Index;
end record with
Type_Invariant => Last <= Elements'Last and Is_Sorted (Vector.Elements, Vector.Last);
pragma Annotate (GNATprove, Intentional, "type ""Vector"" is not fully initialized",
"Only items in Elements with index <= Last are accessed");
end SAL.Gen_Bounded_Definite_Vectors_Sorted;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.