hexsha
stringlengths 40
40
| size
int64 3
1.05M
| ext
stringclasses 163
values | lang
stringclasses 53
values | max_stars_repo_path
stringlengths 3
945
| max_stars_repo_name
stringlengths 4
112
| max_stars_repo_head_hexsha
stringlengths 40
78
| max_stars_repo_licenses
sequencelengths 1
10
| max_stars_count
float64 1
191k
⌀ | max_stars_repo_stars_event_min_datetime
stringlengths 24
24
⌀ | max_stars_repo_stars_event_max_datetime
stringlengths 24
24
⌀ | max_issues_repo_path
stringlengths 3
945
| max_issues_repo_name
stringlengths 4
113
| max_issues_repo_head_hexsha
stringlengths 40
78
| max_issues_repo_licenses
sequencelengths 1
10
| max_issues_count
float64 1
116k
⌀ | max_issues_repo_issues_event_min_datetime
stringlengths 24
24
⌀ | max_issues_repo_issues_event_max_datetime
stringlengths 24
24
⌀ | max_forks_repo_path
stringlengths 3
945
| max_forks_repo_name
stringlengths 4
113
| max_forks_repo_head_hexsha
stringlengths 40
78
| max_forks_repo_licenses
sequencelengths 1
10
| max_forks_count
float64 1
105k
⌀ | max_forks_repo_forks_event_min_datetime
stringlengths 24
24
⌀ | max_forks_repo_forks_event_max_datetime
stringlengths 24
24
⌀ | content
stringlengths 3
1.05M
| avg_line_length
float64 1
966k
| max_line_length
int64 1
977k
| alphanum_fraction
float64 0
1
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4a66476cade673659401c4610ee8b9ff15d318f3 | 7,020 | ada | Ada | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c6/c64104a.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 7 | 2020-05-02T17:34:05.000Z | 2021-10-17T10:15:18.000Z | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c6/c64104a.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | null | null | null | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c6/c64104a.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 2 | 2020-07-27T00:22:36.000Z | 2021-04-01T09:41:02.000Z | -- C64104A.ADA
-- Grant of Unlimited Rights
--
-- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
-- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
-- unlimited rights in the software and documentation contained herein.
-- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
-- this public release, the Government intends to confer upon all
-- recipients unlimited rights equal to those held by the Government.
-- These rights include rights to use, duplicate, release or disclose the
-- released technical data and computer software in whole or in part, in
-- any manner and for any purpose whatsoever, and to have or permit others
-- to do so.
--
-- DISCLAIMER
--
-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
-- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
-- PARTICULAR PURPOSE OF SAID MATERIAL.
--*
-- OBJECTIVE:
-- CHECK THAT CONSTRAINT_ERROR IS RAISED FOR OUT OF RANGE SCALAR
-- ARGUMENTS. SUBTESTS ARE:
-- (A) STATIC IN ARGUMENT.
-- (B) DYNAMIC IN ARGUMENT.
-- (C) IN OUT, OUT OF RANGE ON CALL.
-- (D) OUT, OUT OF RANGE ON RETURN.
-- (E) IN OUT, OUT OF RANGE ON RETURN.
-- HISTORY:
-- DAS 01/14/81
-- CPP 07/03/84
-- LB 11/20/86 ADDED CODE TO ENSURE IN SUBTESTS WHICH CHECK
-- RETURNED VALUES, THAT SUBPROGRAMS ARE ACTUALLY
-- CALLED.
-- JET 08/04/87 FIXED HEADER FOR STANDARD FORMAT.
WITH REPORT; USE REPORT;
PROCEDURE C64104A IS
SUBTYPE DIGIT IS INTEGER RANGE 0..9;
CALLED : BOOLEAN;
D : DIGIT;
I : INTEGER;
M1 : CONSTANT INTEGER := IDENT_INT(-1);
COUNT : INTEGER := 0;
SUBTYPE SI IS INTEGER RANGE M1 .. 10;
PROCEDURE P1 (PIN : IN DIGIT; WHO : STRING) IS -- (A), (B)
BEGIN
FAILED ("EXCEPTION NOT RAISED BEFORE CALL - P1 " & WHO);
EXCEPTION
WHEN OTHERS =>
FAILED ("EXCEPTION RAISED IN P1 FOR " & WHO);
END P1;
PROCEDURE P2 (PINOUT : IN OUT DIGIT; WHO : STRING) IS -- (C)
BEGIN
FAILED ("EXCEPTION NOT RAISED BEFORE CALL - P2 " & WHO);
EXCEPTION
WHEN OTHERS =>
FAILED ("EXCEPTION RAISED IN P2 FOR " & WHO);
END P2;
PROCEDURE P3 (POUT : OUT SI; WHO : STRING) IS -- (D)
BEGIN
IF WHO = "10" THEN
POUT := IDENT_INT(10); -- (10 IS NOT A DIGIT)
ELSE
POUT := -1;
END IF;
CALLED := TRUE;
EXCEPTION
WHEN OTHERS =>
FAILED ("EXCEPTION RAISED IN P3 FOR " & WHO);
END P3;
PROCEDURE P4 (PINOUT : IN OUT INTEGER; WHO : STRING) IS -- (E)
BEGIN
IF WHO = "10" THEN
PINOUT := 10; -- (10 IS NOT A DIGIT)
ELSE
PINOUT := IDENT_INT(-1);
END IF;
CALLED := TRUE;
EXCEPTION
WHEN OTHERS =>
FAILED ("EXCEPTION RAISED IN P4 FOR" & WHO);
END P4;
BEGIN
TEST ("C64104A", "CHECK THAT CONSTRAINT_ERROR IS RAISED " &
"FOR OUT OF RANGE SCALAR ARGUMENTS");
BEGIN -- (A)
P1 (10, "10");
FAILED ("CONSTRAINT_ERROR NOT RAISED FOR P1 (10)");
EXCEPTION
WHEN CONSTRAINT_ERROR =>
COUNT := COUNT + 1;
WHEN OTHERS =>
FAILED ("WRONG EXCEPTION RAISED FOR P1 (10)");
END; -- (A)
BEGIN -- (B)
P1 (IDENT_INT (-1), "-1");
FAILED ("CONSTRAINT_ERROR NOT RAISED FOR P1 (" &
"IDENT_INT (-1))");
EXCEPTION
WHEN CONSTRAINT_ERROR =>
COUNT := COUNT + 1;
WHEN OTHERS =>
FAILED ("WRONG EXCEPTION RAISED FOR P1 (" &
"IDENT_INT (-1))");
END; --(B)
BEGIN -- (C)
I := IDENT_INT (10);
P2 (I, "10");
FAILED ("CONSTRAINT_ERROR NOT RAISED FOR P2 (10)");
EXCEPTION
WHEN CONSTRAINT_ERROR =>
COUNT := COUNT + 1;
WHEN OTHERS =>
FAILED ("WRONG EXCEPTION RAISED FOR P2 (10)");
END; -- (C)
BEGIN -- (C1)
I := IDENT_INT (-1);
P2 (I, "-1");
FAILED ("CONSTRAINT_ERROR NOT RAISED FOR P2 (-1)");
EXCEPTION
WHEN CONSTRAINT_ERROR =>
COUNT := COUNT + 1;
WHEN OTHERS =>
FAILED ("WRONG EXCEPTION RAISED FOR P2 (-1)");
END; -- (C1)
BEGIN -- (D)
CALLED := FALSE;
D := IDENT_INT (1);
P3 (D, "10");
FAILED ("CONSTRAINT_ERROR NOT RAISED ON RETURN FROM" &
" P3 (10)");
EXCEPTION
WHEN CONSTRAINT_ERROR =>
COUNT := COUNT + 1;
IF NOT CALLED THEN
FAILED ("SUBPROGRAM P3 WAS NOT CALLED");
END IF;
WHEN OTHERS =>
FAILED ("WRONG EXCEPTION RAISED FOR P3 (10)");
END; -- (D)
BEGIN -- (D1)
CALLED := FALSE;
D := IDENT_INT (1);
P3 (D, "-1");
FAILED ("CONSTRAINT_ERROR NOT RAISED ON RETURN FROM" &
" P3 (-1)");
EXCEPTION
WHEN CONSTRAINT_ERROR =>
COUNT := COUNT + 1;
IF NOT CALLED THEN
FAILED ("SUBPROGRAM P3 WAS NOT CALLED");
END IF;
WHEN OTHERS =>
FAILED ("WRONG EXCEPTION RAISED FOR P3 (-1)");
END; -- (D1)
BEGIN -- (E)
CALLED := FALSE;
D := 9;
P4 (D, "10");
FAILED ("CONSTRAINT_ERROR NOT RAISED ON RETURN FROM" &
" P4 (10)");
EXCEPTION
WHEN CONSTRAINT_ERROR =>
COUNT := COUNT + 1;
IF NOT CALLED THEN
FAILED ("SUBPROGRAM P4 WAS NOT CALLED");
END IF;
WHEN OTHERS =>
FAILED ("WRONG EXCEPTION RAISED FOR P4 (10)");
END; -- (E)
BEGIN -- (E1)
CALLED := FALSE;
D := 0;
P4 (D, "-1");
FAILED ("CONSTRAINT_ERROR NOT RAISED ON RETURN FROM" &
" P4 (-1)");
EXCEPTION
WHEN CONSTRAINT_ERROR =>
COUNT := COUNT + 1;
IF NOT CALLED THEN
FAILED ("SUBPROGRAM P4 WAS NOT CALLED");
END IF;
WHEN OTHERS =>
FAILED ("WRONG EXCEPTION RAISED FOR P4 (-1)");
END; -- (E1)
IF (COUNT /= 8) THEN
FAILED ("INCORRECT NUMBER OF CONSTRAINT_ERRORS RAISED");
END IF;
RESULT;
END C64104A;
| 32.5 | 79 | 0.503989 |
d05379e9f7ab2800561018cff0ad5caca6285e9a | 7,469 | adb | Ada | hls_cmd_line_testing/cmd_line_proj/hls_sin_proj/solution1/.autopilot/db/p_source_files_sr.sched.adb | benjmarshall/hls_scratchpad | d57b22ac4cca28b8b331150feb4d1f9c0697d6ff | [
"MIT"
] | 1 | 2017-11-17T00:25:21.000Z | 2017-11-17T00:25:21.000Z | hls_cmd_line_testing/hls_gui_proj/hls_sin_proj/solution1/.autopilot/db/p_source_files_sr.sched.adb | benjmarshall/hls_scratchpad | d57b22ac4cca28b8b331150feb4d1f9c0697d6ff | [
"MIT"
] | null | null | null | hls_cmd_line_testing/hls_gui_proj/hls_sin_proj/solution1/.autopilot/db/p_source_files_sr.sched.adb | benjmarshall/hls_scratchpad | d57b22ac4cca28b8b331150feb4d1f9c0697d6ff | [
"MIT"
] | null | null | null | <?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>p_source_files_sr</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>p_read</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>64</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>2</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>p_read_1</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>6</item>
<item>7</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></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>1</count>
<item_version>0</item_version>
<item>8</item>
</oprand_edges>
<opcode>ret</opcode>
<m_Display>0</m_Display>
</item>
</nodes>
<consts class_id="11" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</consts>
<blocks class_id="12" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="13" tracking_level="1" version="0" object_id="_4">
<Obj>
<type>3</type>
<id>4</id>
<name>__../source_files/sr</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>2</item>
<item>3</item>
</node_objs>
</item>
</blocks>
<edges class_id="14" tracking_level="0" version="0">
<count>2</count>
<item_version>0</item_version>
<item class_id="15" tracking_level="1" version="0" object_id="_5">
<id>7</id>
<edge_type>1</edge_type>
<source_obj>1</source_obj>
<sink_obj>2</sink_obj>
</item>
<item class_id_reference="15" object_id="_6">
<id>8</id>
<edge_type>1</edge_type>
<source_obj>2</source_obj>
<sink_obj>3</sink_obj>
</item>
</edges>
</cdfg>
<cdfg_regions class_id="16" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="17" tracking_level="1" version="0" object_id="_7">
<mId>1</mId>
<mTag>__../source_files/sr</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>4</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="21" tracking_level="0" version="0">
<count>2</count>
<item_version>0</item_version>
<item class_id="22" tracking_level="0" version="0">
<first>2</first>
<second class_id="23" 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>
</node_label_latency>
<bblk_ent_exit class_id="24" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="25" tracking_level="0" version="0">
<first>4</first>
<second class_id="26" tracking_level="0" version="0">
<first>0</first>
<second>0</second>
</second>
</item>
</bblk_ent_exit>
<regions class_id="27" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</regions>
<dp_fu_nodes class_id="28" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_fu_nodes>
<dp_fu_nodes_expression class_id="29" 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="30" 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="31" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_port_io_nodes>
<port2core class_id="32" 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>
| 27.869403 | 70 | 0.644397 |
d0cfa9d9769d40e1d23ae7f37aae5f71d5791886 | 5,908 | ada | Ada | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c4/c49022a.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 7 | 2020-05-02T17:34:05.000Z | 2021-10-17T10:15:18.000Z | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c4/c49022a.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | null | null | null | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c4/c49022a.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 2 | 2020-07-27T00:22:36.000Z | 2021-04-01T09:41:02.000Z | -- C49022A.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 NAMED NUMBER DECLARATIONS (INTEGER) MAY USE EXPRESSIONS
-- WITH INTEGERS.
-- BAW 29 SEPT 80
-- TBN 10/28/85 RENAMED FROM C4A001A.ADA. ADDED RELATIONAL
-- OPERATORS AND USE OF NAMED NUMBERS.
WITH REPORT;
PROCEDURE C49022A IS
USE REPORT;
ADD1 : CONSTANT := 1 + 1;
ADD2 : CONSTANT := 1 + (-1);
ADD3 : CONSTANT := (-1) + 1;
ADD4 : CONSTANT := (-1) + (-1);
SUB1 : CONSTANT := 1 - 1;
SUB2 : CONSTANT := 1 - (-1);
SUB3 : CONSTANT := (-1) - 1;
SUB4 : CONSTANT := (-1) - (-1);
MUL1 : CONSTANT := 1 * 1;
MUL2 : CONSTANT := 1 * (-1);
MUL3 : CONSTANT := (-1) * 1;
MUL4 : CONSTANT := (-1) * (-1);
DIV1 : CONSTANT := 1 / 1;
DIV2 : CONSTANT := 1 / (-1);
DIV3 : CONSTANT := (-1) / 1;
DIV4 : CONSTANT := (-1) / (-1);
REM1 : CONSTANT := 14 REM 5;
REM2 : CONSTANT := 14 REM(-5);
REM3 : CONSTANT :=(-14) REM 5;
REM4 : CONSTANT :=(-14) REM(-5);
MOD1 : CONSTANT := 4 MOD 3;
MOD2 : CONSTANT := 4 MOD (-3);
MOD3 : CONSTANT := (-4) MOD 3;
MOD4 : CONSTANT := (-4) MOD (-3);
EXP1 : CONSTANT := 1 ** 1;
EXP2 : CONSTANT := (-1) ** 1;
ABS1 : CONSTANT := ABS( - 10 );
ABS2 : CONSTANT := ABS( + 10 );
TOT1 : CONSTANT := ADD1 + SUB1 - MUL1 + DIV1 - REM3 + MOD2 - EXP1;
LES1 : CONSTANT := BOOLEAN'POS (1 < 2);
LES2 : CONSTANT := BOOLEAN'POS (1 < (-2));
LES3 : CONSTANT := BOOLEAN'POS ((-1) < (-2));
LES4 : CONSTANT := BOOLEAN'POS (ADD1 < SUB1);
GRE1 : CONSTANT := BOOLEAN'POS (2 > 1);
GRE2 : CONSTANT := BOOLEAN'POS ((-1) > 2);
GRE3 : CONSTANT := BOOLEAN'POS ((-1) > (-2));
GRE4 : CONSTANT := BOOLEAN'POS (ADD1 > SUB1);
LEQ1 : CONSTANT := BOOLEAN'POS (1 <= 1);
LEQ2 : CONSTANT := BOOLEAN'POS ((-1) <= 1);
LEQ3 : CONSTANT := BOOLEAN'POS ((-1) <= (-2));
LEQ4 : CONSTANT := BOOLEAN'POS (ADD2 <= SUB3);
GEQ1 : CONSTANT := BOOLEAN'POS (2 >= 1);
GEQ2 : CONSTANT := BOOLEAN'POS ((-2) >= 1);
GEQ3 : CONSTANT := BOOLEAN'POS ((-2) >= (-1));
GEQ4 : CONSTANT := BOOLEAN'POS (ADD2 >= SUB3);
EQU1 : CONSTANT := BOOLEAN'POS (2 = 2);
EQU2 : CONSTANT := BOOLEAN'POS ((-2) = 2);
EQU3 : CONSTANT := BOOLEAN'POS ((-2) = (-2));
EQU4 : CONSTANT := BOOLEAN'POS (ADD2 = SUB3);
NEQ1 : CONSTANT := BOOLEAN'POS (2 /= 2);
NEQ2 : CONSTANT := BOOLEAN'POS ((-2) /= 1);
NEQ3 : CONSTANT := BOOLEAN'POS ((-2) /= (-2));
NEQ4 : CONSTANT := BOOLEAN'POS (ADD2 /= SUB3);
BEGIN
TEST("C49022A","CHECK THAT NAMED NUMBER DECLARATIONS (INTEGER) " &
"MAY USE EXPRESSIONS WITH INTEGERS");
IF ADD1 /= 2 OR ADD2 /= 0 OR ADD3 /= 0 OR ADD4 /= -2 THEN
FAILED("ERROR IN THE ADDING OPERATOR +");
END IF;
IF SUB1 /= 0 OR SUB2 /= 2 OR SUB3 /= -2 OR SUB4 /= 0 THEN
FAILED("ERROR IN THE ADDING OPERATOR -");
END IF;
IF MUL1 /= 1 OR MUL2 /= -1 OR MUL3 /= -1 OR MUL4 /= 1 THEN
FAILED("ERROR IN THE MULTIPLYING OPERATOR *");
END IF;
IF DIV1 /= 1 OR DIV2 /= -1 OR DIV3 /= -1 OR DIV4 /= 1 THEN
FAILED("ERROR IN THE MULTIPLYING OPERATOR /");
END IF;
IF REM1 /= 4 OR REM2 /= 4 OR REM3 /= -4 OR REM4 /= -4 THEN
FAILED("ERROR IN THE MULTIPLYING OPERATOR REM");
END IF;
IF MOD1 /= 1 OR MOD2 /= -2 OR MOD3 /= 2 OR MOD4 /= -1 THEN
FAILED("ERROR IN THE MULTIPLYING OPERATOR MOD");
END IF;
IF EXP1 /= 1 OR EXP2 /= -1 THEN
FAILED("ERROR IN THE EXPONENTIATING OPERATOR");
END IF;
IF ABS1 /= 10 OR ABS2 /= 10 THEN
FAILED("ERROR IN THE ABS OPERATOR");
END IF;
IF TOT1 /= 3 THEN
FAILED("ERROR IN USING NAMED NUMBERS WITH OPERATORS");
END IF;
IF LES1 /= 1 OR LES2 /= 0 OR LES3 /= 0 OR LES4 /= 0 THEN
FAILED("ERROR IN THE LESS THAN OPERATOR");
END IF;
IF GRE1 /= 1 OR GRE2 /= 0 OR GRE3 /= 1 OR GRE4 /= 1 THEN
FAILED("ERROR IN THE GREATER THAN OPERATOR");
END IF;
IF LEQ1 /= 1 OR LEQ2 /= 1 OR LEQ3 /= 0 OR LEQ4 /= 0 THEN
FAILED("ERROR IN THE LESS THAN EQUAL OPERATOR");
END IF;
IF GEQ1 /= 1 OR GEQ2 /= 0 OR GEQ3 /= 0 OR GEQ4 /= 1 THEN
FAILED("ERROR IN THE GREATER THAN EQUAL OPERATOR");
END IF;
IF EQU1 /= 1 OR EQU2 /= 0 OR EQU3 /= 1 OR EQU4 /= 0 THEN
FAILED("ERROR IN THE EQUAL OPERATOR");
END IF;
IF NEQ1 /= 0 OR NEQ2 /= 1 OR NEQ3 /= 0 OR NEQ4 /= 1 THEN
FAILED("ERROR IN THE NOT EQUAL OPERATOR");
END IF;
RESULT;
END C49022A;
| 37.157233 | 79 | 0.549763 |
dc7e5995f7c944da561eba205acb570d1368747b | 8,498 | adb | Ada | tests/clienttest.adb | ray2501/AdaBaseXClient | 016641d451a02015ca73cb25c5e9458f17b3904d | [
"MIT"
] | null | null | null | tests/clienttest.adb | ray2501/AdaBaseXClient | 016641d451a02015ca73cb25c5e9458f17b3904d | [
"MIT"
] | null | null | null | tests/clienttest.adb | ray2501/AdaBaseXClient | 016641d451a02015ca73cb25c5e9458f17b3904d | [
"MIT"
] | 1 | 2021-07-08T01:14:51.000Z | 2021-07-08T01:14:51.000Z | with Ahven; use Ahven;
with AdaBaseXClient; use AdaBaseXClient;
--
-- Requires BaseX server when testing
--
package body ClientTest is
procedure Initialize (T : in out Test) is
begin
Set_Name (T, "My tests");
T.Add_Test_Routine
(Routine => Unknown_Fail'Access, Name => "Unknown_Fail");
T.Add_Test_Routine
(Routine => Port_Fail'Access, Name => "Port_Fail");
T.Add_Test_Routine
(Routine => Connect_Auth'Access, Name => "Connect_Auth");
T.Add_Test_Routine
(Routine => Connect_Pass'Access, Name => "Connect_Pass");
T.Add_Test_Routine
(Routine => Execute_Test'Access, Name => "Execute_Test");
T.Add_Test_Routine
(Routine => Execute_Fail'Access, Name => "Execute_Fail");
T.Add_Test_Routine
(Routine => Create_Drop'Access, Name => "Create_Drop");
T.Add_Test_Routine (Routine => Add_Test'Access, Name => "Add_Test");
T.Add_Test_Routine
(Routine => Replace_Test'Access, Name => "Replace_Test");
T.Add_Test_Routine
(Routine => Query_Test'Access, Name => "Query_Test");
T.Add_Test_Routine
(Routine => Query_Bind'Access, Name => "Query_Bind");
end Initialize;
procedure Unknown_Fail is
result : Boolean;
begin
result := Connect ("unknown", 1_984);
Fail (Message => "Exception expected");
exception
when Error : BaseXException =>
null;
end Unknown_Fail;
procedure Port_Fail is
result : Boolean;
begin
result := Connect ("localhost", 1_985);
Fail (Message => "Exception expected");
exception
when Error : BaseXException =>
null;
end Port_Fail;
procedure Connect_Auth is
result : Boolean;
begin
result := Connect ("localhost", 1_984);
Assert (Condition => result = True, Message => "Connect test");
result := Authenticate ("unknown", "test");
Assert (Condition => result = False, Message => "Auth test");
Close;
end Connect_Auth;
procedure Connect_Pass is
result : Boolean;
begin
result := Connect ("localhost", 1_984);
Assert (Condition => result = True, Message => "Connect test");
result := Authenticate ("admin", "admin");
Assert (Condition => result = True, Message => "Auth test");
Close;
end Connect_Pass;
procedure Execute_Test is
result : Boolean;
begin
result := Connect ("localhost", 1_984);
Assert (Condition => result = True, Message => "Connect test");
result := Authenticate ("admin", "admin");
Assert (Condition => result = True, Message => "Auth test");
declare
Response : String := Execute ("xquery 1+1");
begin
Assert (Condition => Response = "2", Message => "Execute test");
end;
Close;
end Execute_Test;
procedure Execute_Fail is
result : Boolean;
begin
result := Connect ("localhost", 1_984);
Assert (Condition => result = True, Message => "Connect test");
result := Authenticate ("admin", "admin");
Assert (Condition => result = True, Message => "Auth test");
declare
Response : String := Execute ("xquery unknown");
begin
Fail (Message => "Exception expected");
end;
exception
when Error : BaseXException =>
Close;
end Execute_Fail;
procedure Create_Drop is
result : Boolean;
begin
result := Connect ("localhost", 1_984);
Assert (Condition => result = True, Message => "Connect test");
result := Authenticate ("admin", "admin");
Assert (Condition => result = True, Message => "Auth test");
declare
Response : String := Create ("database", "<x>Hello World!</x>");
begin
null;
end;
declare
Response : String := Execute ("xquery /");
begin
Assert
(Condition => Response = "<x>Hello World!</x>",
Message => "Query database");
end;
declare
Response : String := Execute ("drop db database");
begin
null;
end;
Close;
end Create_Drop;
procedure Add_Test is
result : Boolean;
begin
result := Connect ("localhost", 1_984);
Assert (Condition => result = True, Message => "Connect test");
result := Authenticate ("admin", "admin");
Assert (Condition => result = True, Message => "Auth test");
declare
Response : String := Create ("database", "");
begin
null;
end;
declare
Response : String := Add ("Ada.xml", "<x>Hello Ada!</x>");
begin
null;
end;
declare
Response : String := Execute ("xquery /");
begin
Assert
(Condition => Response = "<x>Hello Ada!</x>",
Message => "Query database");
end;
declare
Response : String := Execute ("drop db database");
begin
null;
end;
Close;
end Add_Test;
procedure Replace_Test is
result : Boolean;
begin
result := Connect ("localhost", 1_984);
Assert (Condition => result = True, Message => "Connect test");
result := Authenticate ("admin", "admin");
Assert (Condition => result = True, Message => "Auth test");
declare
Response : String := Create ("database", "");
begin
null;
end;
declare
Response : String := Add ("Ada.xml", "<x>Hello Ada!</x>");
begin
null;
end;
declare
Response : String :=
Replace ("Ada.xml", "<x>Ada is awesome!</x>");
begin
null;
end;
declare
Response : String := Execute ("xquery /");
begin
Assert
(Condition => Response = "<x>Ada is awesome!</x>",
Message => "Query database");
end;
declare
Response : String := Execute ("drop db database");
begin
null;
end;
Close;
end Replace_Test;
procedure Query_Test is
result : Boolean;
begin
result := Connect ("localhost", 1_984);
Assert (Condition => result = True, Message => "Connect test");
result := Authenticate ("admin", "admin");
Assert (Condition => result = True, Message => "Auth test");
declare
Response : Query := CreateQuery ("1+1");
V : String_Vectors.Vector;
begin
V := Response.Results;
Assert (Condition => V (0) = "2", Message => "Query test");
Response.Close;
end;
Close;
end Query_Test;
procedure Query_Bind is
result : Boolean;
begin
result := Connect ("localhost", 1_984);
Assert (Condition => result = True, Message => "Connect test");
result := Authenticate ("admin", "admin");
Assert (Condition => result = True, Message => "Auth test");
declare
Response : Query :=
CreateQuery
("declare variable $name external; for $i in 1 to 1 return element { $name } { $i }");
begin
Response.Bind ("name", "number", "");
declare
Res : String := Response.Execute;
begin
Assert
(Condition => Res = "<number>1</number>",
Message => "Query bind");
end;
Response.Close;
end;
Close;
end Query_Bind;
end ClientTest;
| 25.673716 | 109 | 0.48988 |
1814b07bd0133497cc2054e281cde9db26b33467 | 387 | adb | Ada | source/sets-io.adb | jquorning/CELLE | 0584a22bd48464c2727751fca9dbca079e217b0c | [
"blessing"
] | null | null | null | source/sets-io.adb | jquorning/CELLE | 0584a22bd48464c2727751fca9dbca079e217b0c | [
"blessing"
] | null | null | null | source/sets-io.adb | jquorning/CELLE | 0584a22bd48464c2727751fca9dbca079e217b0c | [
"blessing"
] | null | null | null |
with Ada.Text_IO;
package body Sets.IO is
procedure Put (Set : in Set_Type) is
use Ada.Text_IO;
begin
if Set = Null_Set then
Put ("<null>");
else
for Bit of Set.all loop
if Bit then
Put ("1");
else
Put (" ");
end if;
end loop;
end if;
end Put;
end Sets.IO;
| 16.826087 | 39 | 0.45478 |
209b06d1fbf91f9bb3be08a05266a30e962f4e97 | 6,633 | ada | Ada | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c3/c34014u.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 7 | 2020-05-02T17:34:05.000Z | 2021-10-17T10:15:18.000Z | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c3/c34014u.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | null | null | null | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c3/c34014u.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 2 | 2020-07-27T00:22:36.000Z | 2021-04-01T09:41:02.000Z | -- C34014U.ADA
-- Grant of Unlimited Rights
--
-- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
-- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
-- unlimited rights in the software and documentation contained herein.
-- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
-- this public release, the Government intends to confer upon all
-- recipients unlimited rights equal to those held by the Government.
-- These rights include rights to use, duplicate, release or disclose the
-- released technical data and computer software in whole or in part, in
-- any manner and for any purpose whatsoever, and to have or permit others
-- to do so.
--
-- DISCLAIMER
--
-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
-- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
-- PARTICULAR PURPOSE OF SAID MATERIAL.
--*
-- OBJECTIVE:
-- CHECK THAT A DERIVED OPERATOR IS VISIBLE AND FURTHER DERIVABLE
-- UNDER APPROPRIATE CIRCUMSTANCES.
-- CHECK WHEN THE DERIVED OPERATOR IS IMPLICITLY DECLARED IN THE
-- PRIVATE PART OF A PACKAGE AFTER AN EXPLICIT DECLARATION OF A
-- HOMOGRAPHIC OPERATOR IN THE VISIBLE PART.
-- HISTORY:
-- JRK 09/23/87 CREATED ORIGINAL TEST.
WITH REPORT; USE REPORT;
PROCEDURE C34014U IS
PACKAGE P IS
TYPE T IS RANGE -100 .. 100;
FUNCTION "+" (X : T) RETURN T;
END P;
USE P;
PACKAGE BODY P IS
FUNCTION "+" (X : T) RETURN T IS
BEGIN
RETURN X + T (IDENT_INT (1));
END "+";
END P;
BEGIN
TEST ("C34014U", "CHECK THAT A DERIVED OPERATOR IS VISIBLE " &
"AND FURTHER DERIVABLE UNDER APPROPRIATE " &
"CIRCUMSTANCES. CHECK WHEN THE DERIVED " &
"OPERATOR IS IMPLICITLY DECLARED IN THE " &
"PRIVATE PART OF A PACKAGE AFTER AN EXPLICIT " &
"DECLARATION OF A HOMOGRAPHIC OPERATOR IN " &
"THE VISIBLE PART");
-----------------------------------------------------------------
COMMENT ("NEW OPERATOR DECLARED BY SUBPROGRAM DECLARATION");
DECLARE
PACKAGE Q IS
TYPE QT IS PRIVATE;
C0 : CONSTANT QT;
C2 : CONSTANT QT;
FUNCTION "+" (Y : QT) RETURN QT;
TYPE QR1 IS
RECORD
C : QT := +C0;
END RECORD;
PRIVATE
TYPE QT IS NEW T;
C0 : CONSTANT QT := 0;
C2 : CONSTANT QT := 2;
TYPE QR2 IS
RECORD
C : QT := +0;
END RECORD;
TYPE QS IS NEW QT;
END Q;
USE Q;
PACKAGE BODY Q IS
FUNCTION "+" (Y : QT) RETURN QT IS
BEGIN
RETURN Y + QT (IDENT_INT (2));
END "+";
PACKAGE R IS
X : QR1;
Y : QR2;
Z : QS := +0;
END R;
USE R;
BEGIN
IF X.C /= 2 THEN
FAILED ("NEW OPERATOR NOT VISIBLE - SUBPROG " &
"DECL - 1");
END IF;
IF Y.C /= 2 THEN
FAILED ("NEW OPERATOR NOT VISIBLE - SUBPROG " &
"DECL - 2");
END IF;
IF Z /= 2 THEN
FAILED ("NEW OPERATOR NOT DERIVED - SUBPROG " &
"DECL - 1");
END IF;
END Q;
PACKAGE R IS
Y : QT := +C0;
TYPE RT IS NEW QT;
Z : RT := +RT(C0);
END R;
USE R;
BEGIN
IF Y /= C2 THEN
FAILED ("NEW OPERATOR NOT VISIBLE - SUBPROG DECL - 3");
END IF;
IF Z /= RT (C2) THEN
FAILED ("NEW OPERATOR NOT DERIVED - SUBPROG DECL - 2");
END IF;
END;
-----------------------------------------------------------------
COMMENT ("NEW OPERATOR DECLARED BY RENAMING");
DECLARE
PACKAGE Q IS
TYPE QT IS PRIVATE;
C0 : CONSTANT QT;
C2 : CONSTANT QT;
FUNCTION G (X : QT) RETURN QT;
FUNCTION "+" (Y : QT) RETURN QT RENAMES G;
TYPE QR1 IS
RECORD
C : QT := +C0;
END RECORD;
PRIVATE
TYPE QT IS NEW T;
C0 : CONSTANT QT := 0;
C2 : CONSTANT QT := 2;
TYPE QR2 IS
RECORD
C : QT := +0;
END RECORD;
TYPE QS IS NEW QT;
END Q;
USE Q;
PACKAGE BODY Q IS
FUNCTION G (X : QT) RETURN QT IS
BEGIN
RETURN X + QT (IDENT_INT (2));
END G;
PACKAGE R IS
X : QR1;
Y : QR2;
Z : QS := +0;
END R;
USE R;
BEGIN
IF X.C /= 2 THEN
FAILED ("NEW OPERATOR NOT VISIBLE - RENAMING - " &
"1");
END IF;
IF Y.C /= 2 THEN
FAILED ("NEW OPERATOR NOT VISIBLE - RENAMING - " &
"2");
END IF;
IF Z /= 2 THEN
FAILED ("NEW OPERATOR NOT DERIVED - RENAMING - " &
"1");
END IF;
END Q;
PACKAGE R IS
Y : QT := +C0;
TYPE RT IS NEW QT;
Z : RT := +RT(C0);
END R;
USE R;
BEGIN
IF Y /= C2 THEN
FAILED ("NEW OPERATOR NOT VISIBLE - RENAMING - 3");
END IF;
IF Z /= RT (C2) THEN
FAILED ("NEW OPERATOR NOT DERIVED - RENAMING - 2");
END IF;
END;
-----------------------------------------------------------------
RESULT;
END C34014U;
| 31.140845 | 79 | 0.429971 |
182b5085c701384cbf4a4b1d20b2065b3b5837fa | 3,642 | ads | Ada | src/asf-navigations-mappers.ads | jquorning/ada-asf | ddc697c5dfa4e22c57c6958f4cff27e14d02ce98 | [
"Apache-2.0"
] | 12 | 2015-01-18T23:02:20.000Z | 2022-03-25T15:30:30.000Z | src/asf-navigations-mappers.ads | jquorning/ada-asf | ddc697c5dfa4e22c57c6958f4cff27e14d02ce98 | [
"Apache-2.0"
] | 3 | 2021-01-06T09:44:02.000Z | 2022-02-04T20:20:53.000Z | src/asf-navigations-mappers.ads | jquorning/ada-asf | ddc697c5dfa4e22c57c6958f4cff27e14d02ce98 | [
"Apache-2.0"
] | 4 | 2016-04-12T05:29:00.000Z | 2022-01-24T23:53:59.000Z | -----------------------------------------------------------------------
-- asf-navigations-mappers -- Read XML navigation files
-- Copyright (C) 2010, 2011, 2017, 2018 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Util.Beans.Objects;
with Util.Serialize.Mappers.Record_Mapper;
with EL.Contexts;
-- The <b>ASF.Navigations.Reader</b> package defines an XML mapper that can be used
-- to read the XML navigation files.
package ASF.Navigations.Mappers is
type Navigation_Case_Fields is (FROM_VIEW_ID, OUTCOME, ACTION, TO_VIEW, REDIRECT, CONDITION,
CONTENT, CONTENT_TYPE, NAVIGATION_CASE, NAVIGATION_RULE,
STATUS);
-- ------------------------------
-- Navigation Config Reader
-- ------------------------------
-- When reading and parsing the XML navigation file, the <b>Nav_Config</b> object
-- is populated by calls through the <b>Set_Member</b> procedure. The data is
-- collected and when the end of the navigation case element is reached,
-- the new navigation case is inserted in the navigation handler.
type Nav_Config is limited record
Outcome : Util.Beans.Objects.Object;
Action : Util.Beans.Objects.Object;
To_View : Util.Beans.Objects.Object;
From_View : Util.Beans.Objects.Object;
Redirect : Boolean := False;
Condition : Util.Beans.Objects.Object;
Content : Util.Beans.Objects.Object;
Content_Type : Util.Beans.Objects.Object;
Status : Natural := 0;
Context : EL.Contexts.ELContext_Access;
Handler : Navigation_Handler_Access;
end record;
type Nav_Config_Access is access all Nav_Config;
-- Save in the navigation config object the value associated with the given field.
-- When the <b>NAVIGATION_CASE</b> field is reached, insert the new navigation rule
-- that was collected in the navigation handler.
procedure Set_Member (N : in out Nav_Config;
Field : in Navigation_Case_Fields;
Value : in Util.Beans.Objects.Object);
-- Setup the XML parser to read the navigation rules.
generic
Mapper : in out Util.Serialize.Mappers.Processing;
Handler : in Navigation_Handler_Access;
Context : in EL.Contexts.ELContext_Access;
package Reader_Config is
Config : aliased Nav_Config;
end Reader_Config;
private
-- Reset the navigation config before parsing a new rule.
procedure Reset (N : in out Nav_Config);
package Navigation_Mapper is
new Util.Serialize.Mappers.Record_Mapper (Element_Type => Nav_Config,
Element_Type_Access => Nav_Config_Access,
Fields => Navigation_Case_Fields,
Set_Member => Set_Member);
end ASF.Navigations.Mappers;
| 44.414634 | 95 | 0.621087 |
cb2b6a9a7a3b92de72f124d913252f1c24b4a265 | 21,038 | adb | Ada | software/hal/boards/stm32_common/sdcard/media_reader-sdcard.adb | TUM-EI-RCS/StratoX | 5fdd04e01a25efef6052376f43ce85b5bc973392 | [
"BSD-3-Clause"
] | 12 | 2017-06-08T14:19:57.000Z | 2022-03-09T02:48:59.000Z | software/hal/boards/stm32_common/sdcard/media_reader-sdcard.adb | TUM-EI-RCS/StratoX | 5fdd04e01a25efef6052376f43ce85b5bc973392 | [
"BSD-3-Clause"
] | 6 | 2017-06-08T13:13:50.000Z | 2020-05-15T09:32:43.000Z | software/hal/boards/stm32_common/sdcard/media_reader-sdcard.adb | TUM-EI-RCS/StratoX | 5fdd04e01a25efef6052376f43ce85b5bc973392 | [
"BSD-3-Clause"
] | 3 | 2017-06-30T14:05:06.000Z | 2022-02-17T12:20:45.000Z | -- Based on AdaCore's Ada Drivers Library,
-- see https://github.com/AdaCore/Ada_Drivers_Library,
-- checkout 93b5f269341f970698af18f9182fac82a0be66c3.
-- Copyright (C) Adacore
--
-- Tailored to StratoX project.
-- Author: Martin Becker ([email protected])
with STM32.Device; use STM32.Device;
with STM32.DMA; use STM32.DMA;
with STM32.GPIO; use STM32.GPIO;
with STM32.SDMMC; use STM32.SDMMC;
with Cortex_M.Cache;
with HAL;
with HIL.Devices;
with Ada.Unchecked_Conversion;
with Media_Reader.SDCard.Config; use Media_Reader.SDCard.Config;
package body Media_Reader.SDCard is
-- Tx_IRQ : constant Interrupt_ID :=
-- Ada.Interrupts.Names.DMA2_Stream6_Interrupt;
Use_DMA : Boolean := True;
procedure Ensure_Card_Informations
(Controller : in out SDCard_Controller) with Inline_Always;
procedure Set_DMA (on : Boolean) is
begin
Use_DMA := on;
end Set_DMA;
------------
-- DMA_Rx --
------------
-- on-chip DMA facility signals end of DMA transfer
protected DMA_Interrupt_Handler is
pragma Interrupt_Priority (HIL.Devices.IRQ_PRIO_SDIO);
procedure Set_Transfer_State;
-- Informes the DMA Int handler that a transfer is about to start
procedure Clear_Transfer_State;
function Buffer_Error return Boolean;
entry Wait_Transfer (Status : out DMA_Error_Code);
private
procedure Interrupt_RX
with Attach_Handler => Rx_IRQ, Unreferenced;
procedure Interrupt_TX
with Attach_Handler => Tx_IRQ, Unreferenced;
Finished : Boolean := True;
DMA_Status : DMA_Error_Code := DMA_No_Error;
Had_Buffer_Error : Boolean := False;
end DMA_Interrupt_Handler;
------------------
-- SDMMC_Status --
------------------
-- on-chip SD controller signals 'data end' and flags
protected SDMMC_Interrupt_Handler is
pragma Interrupt_Priority (HIL.Devices.IRQ_PRIO_SDIO - 1);
procedure Set_Transfer_State (Controller : SDCard_Controller);
procedure Clear_Transfer_State;
entry Wait_Transfer (Status : out SD_Error);
private
procedure Interrupt
with Attach_Handler => SDCard.Config.SD_Interrupt,
Unreferenced;
Finished : Boolean := True;
SD_Status : SD_Error;
Device : SDMMC_Controller;
end SDMMC_Interrupt_Handler;
----------------
-- Initialize --
----------------
procedure Initialize
(Controller : in out SDCard_Controller)
is
begin
-- Enable the SDIO clock
Enable_Clock_Device;
Reset_Device;
-- Enable the DMA2 clock
Enable_Clock (SD_DMA);
-- Enable the GPIOs
Enable_Clock (SD_Pins); -- & SD_Detect_Pin); not every board has a pin
-- GPIO configuration for the SDIO pins
Configure_IO
(SD_Pins,
(Mode => Mode_AF,
Output_Type => Push_Pull,
Speed => Speed_High,
Resistors => Pull_Up));
Configure_Alternate_Function (SD_Pins, GPIO_AF_SDIO); -- essential!
-- GPIO configuration for the SD-Detect pin
-- Configure_IO
-- (SD_Detect_Pin,
-- (Mode => Mode_In,
-- Output_Type => Open_Drain,
-- Speed => Speed_High,
-- Resistors => Pull_Up));
Controller.Device :=
STM32.SDMMC.As_Controller (SD_Device'Access);
Disable (SD_DMA, SD_DMA_Rx_Stream);
-- see http://blog.frankvh.com/2011/12/30/stm32f2xx-stm32f4xx-sdio-interface-part-2/, comment 5+6.
Configure
(SD_DMA,
SD_DMA_Rx_Stream,
(Channel => SD_DMA_Rx_Channel,
Direction => Peripheral_To_Memory,
Increment_Peripheral_Address => False,
Increment_Memory_Address => True,
Peripheral_Data_Format => Words, -- essential: the memory buffer must be aligned to this setting. was words. Nothing helps.
Memory_Data_Format => Words,
Operation_Mode => Peripheral_Flow_Control_Mode, -- https://github.com/lvniqi/STM32F4xx_DSP_StdPeriph_Lib_V1.3.0 uses Normal Mode
Priority => Priority_Medium, -- SD is not so important.
FIFO_Enabled => True, -- datasheet recommends True. False doesn't help.
FIFO_Threshold => FIFO_Threshold_Full_Configuration, -- was: FIFO_Threshold_Full_Configuration,
Memory_Burst_Size => Memory_Burst_Inc4, -- was Inc4
Peripheral_Burst_Size => Peripheral_Burst_Inc4)); -- was Inc4. Single does not help
Clear_All_Status (SD_DMA, SD_DMA_Rx_Stream);
Disable (SD_DMA, SD_DMA_Tx_Stream);
Configure
(SD_DMA,
SD_DMA_Tx_Stream,
(Channel => SD_DMA_Tx_Channel, -- OK
Direction => Memory_To_Peripheral, -- OK
Increment_Peripheral_Address => False, -- OK
Increment_Memory_Address => True, -- OK
Peripheral_Data_Format => Words, -- was: Words
Memory_Data_Format => Words, -- was: Words
Operation_Mode => Peripheral_Flow_Control_Mode, -- was: periph. but technically 'Normal' seems better
Priority => Priority_Very_High, -- OK
FIFO_Enabled => True, -- OK
FIFO_Threshold => FIFO_Threshold_Full_Configuration, -- only full allowed. see manual.
Memory_Burst_Size => Memory_Burst_Inc4, -- OK
Peripheral_Burst_Size => Peripheral_Burst_Inc4)); -- OK
Clear_All_Status (SD_DMA, SD_DMA_Tx_Stream);
end Initialize;
------------------
-- Card_Present --
------------------
function Card_Present
(Controller : in out SDCard_Controller) return Boolean
is
pragma Unreferenced (Controller);
begin
-- if STM32.GPIO.Set (SD_Detect_Pin) then
-- -- No card
-- Controller.Has_Info := False;
-- Controller.Card_Detected := False;
-- else
-- -- Card detected. Just wait a bit to unbounce the signal from the
-- -- detect pin
-- if not Controller.Card_Detected then
-- delay until Clock + Milliseconds (50);
-- end if;
--
-- Controller.Card_Detected := not STM32.GPIO.Set (SD_Detect_Pin);
-- end if;
--
-- return Controller.Card_Detected;
return True; -- in general there is no detect pin. so assume it is there.
end Card_Present;
------------------------------
-- Ensure_Card_Informations --
------------------------------
procedure Ensure_Card_Informations
(Controller : in out SDCard_Controller)
is
Ret : SD_Error;
begin
if Controller.Has_Info then
return;
end if;
Ret := STM32.SDMMC.Initialize
(Controller.Device, Controller.Info);
if Ret = OK then
Controller.Has_Info := True;
else
Controller.Has_Info := False;
end if;
end Ensure_Card_Informations;
--------------------------
-- Get_Card_information --
--------------------------
function Get_Card_Information
(Controller : in out SDCard_Controller)
return STM32.SDMMC.Card_Information
is
begin
Ensure_Card_Informations (Controller);
if not Controller.Has_Info then
-- Issue reading the SD-card information
Ensure_Card_Informations (Controller);
end if;
if not Controller.Has_Info then
raise Device_Error; -- TODO: remove
end if;
return Controller.Info;
end Get_Card_Information;
----------------
-- Block_Size --
----------------
overriding function Block_Size
(Controller : in out SDCard_Controller)
return Unsigned_32
is
begin
Ensure_Card_Informations (Controller);
return Controller.Info.Card_Block_Size;
end Block_Size;
---------------------------
-- DMA_Interrupt_Handler --
---------------------------
protected body DMA_Interrupt_Handler
is
function Buffer_Error return Boolean is (Had_Buffer_Error);
-------------------
-- Wait_Transfer --
-------------------
entry Wait_Transfer (Status : out DMA_Error_Code) when Finished is
begin
Status := DMA_Status;
end Wait_Transfer;
------------------------
-- Set_Transfer_State --
------------------------
procedure Set_Transfer_State
is
begin
Finished := False;
DMA_Status := DMA_No_Error;
Had_Buffer_Error := False;
end Set_Transfer_State;
--------------------------
-- Clear_Transfer_State --
--------------------------
procedure Clear_Transfer_State
is
begin
Finished := True;
DMA_Status := DMA_Transfer_Error;
end Clear_Transfer_State;
---------------
-- Interrupt --
---------------
procedure Interrupt_RX is
begin
if Status (SD_DMA, SD_DMA_Rx_Stream, Transfer_Complete_Indicated) then
Disable_Interrupt
(SD_DMA, SD_DMA_Rx_Stream, Transfer_Complete_Interrupt);
Clear_Status
(SD_DMA, SD_DMA_Rx_Stream, Transfer_Complete_Indicated);
DMA_Status := DMA_No_Error;
Finished := True;
end if;
if Status (SD_DMA, SD_DMA_Rx_Stream, FIFO_Error_Indicated) then
Disable_Interrupt (SD_DMA, SD_DMA_Rx_Stream, FIFO_Error_Interrupt);
Clear_Status (SD_DMA, SD_DMA_Rx_Stream, FIFO_Error_Indicated);
-- see Interrupt_TX
Had_Buffer_Error := True;
end if;
if Status (SD_DMA, SD_DMA_Rx_Stream, Transfer_Error_Indicated) then
Disable_Interrupt
(SD_DMA, SD_DMA_Rx_Stream, Transfer_Error_Interrupt);
Clear_Status (SD_DMA, SD_DMA_Rx_Stream, Transfer_Error_Indicated);
DMA_Status := DMA_Transfer_Error;
Finished := True;
end if;
if Finished then
for Int in STM32.DMA.DMA_Interrupt loop
Disable_Interrupt (SD_DMA, SD_DMA_Rx_Stream, Int);
end loop;
end if;
end Interrupt_RX;
procedure Interrupt_TX is
begin
if Status (SD_DMA, SD_DMA_Tx_Stream, Transfer_Complete_Indicated) then
Disable_Interrupt
(SD_DMA, SD_DMA_Tx_Stream, Transfer_Complete_Interrupt);
Clear_Status
(SD_DMA, SD_DMA_Tx_Stream, Transfer_Complete_Indicated);
DMA_Status := DMA_No_Error;
Finished := True;
end if;
if Status (SD_DMA, SD_DMA_Tx_Stream, FIFO_Error_Indicated) then
-- this signal can be ignored when transfer is completed
-- however, it comes before Transfer_Complete_Indicated and
-- We cannot use the value of the NDT register either, because
-- it's a race condition (the register lacks behind).
-- As a result, we have to ignore it.
Disable_Interrupt (SD_DMA, SD_DMA_Tx_Stream, FIFO_Error_Interrupt);
Clear_Status (SD_DMA, SD_DMA_Tx_Stream, FIFO_Error_Indicated);
Had_Buffer_Error := True;
-- declare
-- ndt : constant Unsigned_16 := Current_Counter (Unit => SD_DMA, Stream => SD_DMA_Tx_Stream);
-- ctr : Unsigned_16;
-- begin
-- if Operating_Mode (Unit => SD_DMA, Stream => SD_DMA_Tx_Stream) = Peripheral_Flow_Control_Mode then
-- ctr := 16#ffff# - ndt;
-- else
-- ctr := ndt;
-- end if;
-- if ctr /= Expected then
-- DMA_Status := DMA_FIFO_Error;
-- Finished := True;
-- end if;
-- end;
end if;
if Status (SD_DMA, SD_DMA_Tx_Stream, Transfer_Error_Indicated) then
Disable_Interrupt
(SD_DMA, SD_DMA_Tx_Stream, Transfer_Error_Interrupt);
Clear_Status (SD_DMA, SD_DMA_Tx_Stream, Transfer_Error_Indicated);
DMA_Status := DMA_Transfer_Error;
Finished := True;
end if;
if Finished then
for Int in STM32.DMA.DMA_Interrupt loop
Disable_Interrupt (SD_DMA, SD_DMA_Tx_Stream, Int);
end loop;
end if;
end Interrupt_TX;
end DMA_Interrupt_Handler;
-----------------------------
-- SDMMC_Interrupt_Handler --
-----------------------------
protected body SDMMC_Interrupt_Handler
is
-------------------
-- Wait_Transfer --
-------------------
entry Wait_Transfer (Status : out SD_Error) when Finished is
begin
Status := SD_Status;
end Wait_Transfer;
----------------------
-- Set_Transferring --
----------------------
procedure Set_Transfer_State (Controller : SDCard_Controller)
is
begin
Finished := False;
Device := Controller.Device;
end Set_Transfer_State;
--------------------------
-- Clear_Transfer_State --
--------------------------
procedure Clear_Transfer_State
is
begin
Finished := True;
SD_Status := Error;
end Clear_Transfer_State;
---------------
-- Interrupt --
---------------
procedure Interrupt
is
begin
Finished := True;
if Get_Flag (Device, Data_End) then
Clear_Flag (Device, Data_End);
SD_Status := OK;
elsif Get_Flag (Device, Data_CRC_Fail) then
Clear_Flag (Device, Data_CRC_Fail);
SD_Status := CRC_Check_Fail;
elsif Get_Flag (Device, Data_Timeout) then
Clear_Flag (Device, Data_Timeout);
SD_Status := Timeout_Error;
elsif Get_Flag (Device, RX_Overrun) then
Clear_Flag (Device, RX_Overrun);
SD_Status := Rx_Overrun;
elsif Get_Flag (Device, TX_Underrun) then
Clear_Flag (Device, TX_Underrun);
SD_Status := Tx_Underrun;
end if;
for Int in SDMMC_Interrupts loop
Disable_Interrupt (Device, Int);
end loop;
end Interrupt;
end SDMMC_Interrupt_Handler;
overriding function Write_Block
(Controller : in out SDCard_Controller;
Block_Number : Unsigned_32;
Data : Block) return Boolean
is
Ret : SD_Error;
DMA_Err : DMA_Error_Code;
begin
Ensure_Card_Informations (Controller);
if Use_DMA then
-- Flush the data cache
Cortex_M.Cache.Invalidate_DCache
(Start => Data (Data'First)'Address,
Len => Data'Length);
DMA_Interrupt_Handler.Set_Transfer_State;
SDMMC_Interrupt_Handler.Set_Transfer_State (Controller);
Clear_All_Status (SD_DMA, SD_DMA_Tx_Stream);
Ret := Write_Blocks_DMA
(Controller.Device,
Unsigned_64 (Block_Number) *
Unsigned_64 (Controller.Info.Card_Block_Size),
SD_DMA,
SD_DMA_Tx_Stream,
SD_Data (Data));
-- this always leaves the last 12 byte standing. Why?
-- also...NDTR is not what it should be.
if Ret /= OK then
DMA_Interrupt_Handler.Clear_Transfer_State;
SDMMC_Interrupt_Handler.Clear_Transfer_State;
Abort_Transfer (SD_DMA, SD_DMA_Tx_Stream, DMA_Err);
return False;
end if;
DMA_Interrupt_Handler.Wait_Transfer (DMA_Err); -- this unblocks
SDMMC_Interrupt_Handler.Wait_Transfer (Ret); -- TX underrun!
-- this seems slow. Do we have to wait?
loop
-- FIXME: some people claim, that this goes wrong with multiblock, see
-- http://blog.frankvh.com/2011/09/04/stm32f2xx-sdio-sd-card-interface/
exit when not Get_Flag (Controller.Device, TX_Active);
end loop;
Clear_All_Status (SD_DMA, SD_DMA_Tx_Stream);
Disable (SD_DMA, SD_DMA_Tx_Stream);
declare
data_incomplete : constant Boolean :=
DMA_Interrupt_Handler.Buffer_Error and then
Items_Transferred (SD_DMA, SD_DMA_Tx_Stream) /= Data'Length / 4;
begin
return Ret = OK and then DMA_Err = DMA_No_Error and then not data_incomplete;
end;
else
Ret := Write_Blocks (Controller.Device,
Unsigned_64 (Block_Number) *
Unsigned_64 (Controller.Info.Card_Block_Size),
SD_Data (Data));
return Ret = OK;
end if;
end Write_Block;
----------------
-- Read_Block --
----------------
overriding function Read_Block
(Controller : in out SDCard_Controller;
Block_Number : Unsigned_32;
Data : out Block) return Boolean
is
Ret : SD_Error;
DMA_Err : DMA_Error_Code;
subtype Word_Data is SD_Data (1 .. 4);
function To_Data is new Ada.Unchecked_Conversion
(HAL.Word, Word_Data);
begin
Ensure_Card_Informations (Controller);
if Use_DMA then
DMA_Interrupt_Handler.Set_Transfer_State;
SDMMC_Interrupt_Handler.Set_Transfer_State (Controller);
Ret := Read_Blocks_DMA
(Controller.Device,
Unsigned_64 (Block_Number) *
Unsigned_64 (Controller.Info.Card_Block_Size),
SD_DMA,
SD_DMA_Rx_Stream,
SD_Data (Data));
if Ret /= OK then
DMA_Interrupt_Handler.Clear_Transfer_State;
SDMMC_Interrupt_Handler.Clear_Transfer_State;
Abort_Transfer (SD_DMA, SD_DMA_Rx_Stream, DMA_Err);
return False;
end if;
SDMMC_Interrupt_Handler.Wait_Transfer (Ret); -- this unblocks: ret= ok
DMA_Interrupt_Handler.Wait_Transfer (DMA_Err); -- this unblocks: DMA_err = no err
-- following two lines are supposed to flush the FIFO, see manual RM0090 DMA Controller/FIFO Flush
--Disable (SD_DMA, SD_DMA_Rx_Stream);
--Clear_All_Status (SD_DMA, SD_DMA_Rx_Stream);
-- not working
-- Workaround: DMA leaves a tail in the SDIO FIFO buffer. We don'T know why, yet.
-- one reason might be mentioned in AN4031 sec.4.9.1: "When managing peripheral reads
-- over DMA memory port, software must ensure that 4x extra words are read from the
-- peripheral. This is to guarantee that last valid data are transferred-out from
-- DMA FIFO". However, in our case data is in SDIO FIFO.
-- ALso, we don't know how long, but it should be < 32bit*16, since otherwise FIFO would
-- be more than half full and thus trigger another DMA burst.
-- Read the tail, count how long it is, and then copy over to the target buffer.
declare
Tail_Data : SD_Data ( 0 .. 15 );
k : Unsigned_32 := Tail_Data'First;
next_data : Unsigned_32;
begin
while Get_Flag (Controller.Device, RX_Active) loop
if k < Tail_Data'Length then
Tail_Data (k .. k + 3) := To_Data (Read_FIFO (Controller.Device)); -- 4 bytes per FIFO element
k := k + 4;
end if;
end loop;
if k > 0 then
k := k - 1;
next_data := Unsigned_32 (Data'Last) - k;
Data (Unsigned_16 (next_data) .. Data'Last) := Block (Tail_Data (0 .. k));
end if;
end;
-- after having removed the tail, this doesn't block anymore.
loop
exit when not Get_Flag (Controller.Device, RX_Active); -- now that FIFO is empty, that works.
end loop;
Clear_All_Status (SD_DMA, SD_DMA_Rx_Stream);
Disable (SD_DMA, SD_DMA_Rx_Stream);
-- Flush the data cache
Cortex_M.Cache.Invalidate_DCache
(Start => Data (Data'First)'Address,
Len => Data'Length);
declare
data_incomplete : constant Boolean :=
DMA_Interrupt_Handler.Buffer_Error and then
Items_Transferred (SD_DMA, SD_DMA_Tx_Stream) /= Data'Length / 4;
begin
return Ret = OK and then DMA_Err = DMA_No_Error and then not data_incomplete;
end;
else
-- polling => rx overrun possible
Ret := Read_Blocks (Controller.Device,
Unsigned_64 (Block_Number) *
Unsigned_64 (Controller.Info.Card_Block_Size),
SD_Data (Data));
return Ret = OK;
end if;
end Read_Block;
end Media_Reader.SDCard;
| 32.974922 | 152 | 0.579238 |
2080685710e2063aa1e0ff868c6603f1d2495b79 | 17,773 | ads | Ada | source/amf/uml/amf-internals-uml_data_store_nodes.ads | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 24 | 2016-11-29T06:59:41.000Z | 2021-08-30T11:55:16.000Z | source/amf/uml/amf-internals-uml_data_store_nodes.ads | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 2 | 2019-01-16T05:15:20.000Z | 2019-02-03T10:03:32.000Z | source/amf/uml/amf-internals-uml_data_store_nodes.ads | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 4 | 2017-07-18T07:11:05.000Z | 2020-06-21T03:02:25.000Z | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with AMF.Internals.UML_Named_Elements;
with AMF.UML.Activities;
with AMF.UML.Activity_Edges.Collections;
with AMF.UML.Activity_Groups.Collections;
with AMF.UML.Activity_Nodes.Collections;
with AMF.UML.Activity_Partitions.Collections;
with AMF.UML.Behaviors;
with AMF.UML.Classifiers.Collections;
with AMF.UML.Data_Store_Nodes;
with AMF.UML.Dependencies.Collections;
with AMF.UML.Interruptible_Activity_Regions.Collections;
with AMF.UML.Named_Elements;
with AMF.UML.Namespaces;
with AMF.UML.Packages.Collections;
with AMF.UML.Redefinable_Elements.Collections;
with AMF.UML.States.Collections;
with AMF.UML.String_Expressions;
with AMF.UML.Structured_Activity_Nodes;
with AMF.UML.Types;
with AMF.UML.Value_Specifications;
with AMF.Visitors;
package AMF.Internals.UML_Data_Store_Nodes is
type UML_Data_Store_Node_Proxy is
limited new AMF.Internals.UML_Named_Elements.UML_Named_Element_Proxy
and AMF.UML.Data_Store_Nodes.UML_Data_Store_Node with null record;
overriding function Get_In_State
(Self : not null access constant UML_Data_Store_Node_Proxy)
return AMF.UML.States.Collections.Set_Of_UML_State;
-- Getter of ObjectNode::inState.
--
-- The required states of the object available at this point in the
-- activity.
overriding function Get_Is_Control_Type
(Self : not null access constant UML_Data_Store_Node_Proxy)
return Boolean;
-- Getter of ObjectNode::isControlType.
--
-- Tells whether the type of the object node is to be treated as control.
overriding procedure Set_Is_Control_Type
(Self : not null access UML_Data_Store_Node_Proxy;
To : Boolean);
-- Setter of ObjectNode::isControlType.
--
-- Tells whether the type of the object node is to be treated as control.
overriding function Get_Ordering
(Self : not null access constant UML_Data_Store_Node_Proxy)
return AMF.UML.UML_Object_Node_Ordering_Kind;
-- Getter of ObjectNode::ordering.
--
-- Tells whether and how the tokens in the object node are ordered for
-- selection to traverse edges outgoing from the object node.
overriding procedure Set_Ordering
(Self : not null access UML_Data_Store_Node_Proxy;
To : AMF.UML.UML_Object_Node_Ordering_Kind);
-- Setter of ObjectNode::ordering.
--
-- Tells whether and how the tokens in the object node are ordered for
-- selection to traverse edges outgoing from the object node.
overriding function Get_Selection
(Self : not null access constant UML_Data_Store_Node_Proxy)
return AMF.UML.Behaviors.UML_Behavior_Access;
-- Getter of ObjectNode::selection.
--
-- Selects tokens for outgoing edges.
overriding procedure Set_Selection
(Self : not null access UML_Data_Store_Node_Proxy;
To : AMF.UML.Behaviors.UML_Behavior_Access);
-- Setter of ObjectNode::selection.
--
-- Selects tokens for outgoing edges.
overriding function Get_Upper_Bound
(Self : not null access constant UML_Data_Store_Node_Proxy)
return AMF.UML.Value_Specifications.UML_Value_Specification_Access;
-- Getter of ObjectNode::upperBound.
--
-- The maximum number of tokens allowed in the node. Objects cannot flow
-- into the node if the upper bound is reached.
overriding procedure Set_Upper_Bound
(Self : not null access UML_Data_Store_Node_Proxy;
To : AMF.UML.Value_Specifications.UML_Value_Specification_Access);
-- Setter of ObjectNode::upperBound.
--
-- The maximum number of tokens allowed in the node. Objects cannot flow
-- into the node if the upper bound is reached.
overriding function Get_Activity
(Self : not null access constant UML_Data_Store_Node_Proxy)
return AMF.UML.Activities.UML_Activity_Access;
-- Getter of ActivityNode::activity.
--
-- Activity containing the node.
overriding procedure Set_Activity
(Self : not null access UML_Data_Store_Node_Proxy;
To : AMF.UML.Activities.UML_Activity_Access);
-- Setter of ActivityNode::activity.
--
-- Activity containing the node.
overriding function Get_In_Group
(Self : not null access constant UML_Data_Store_Node_Proxy)
return AMF.UML.Activity_Groups.Collections.Set_Of_UML_Activity_Group;
-- Getter of ActivityNode::inGroup.
--
-- Groups containing the node.
overriding function Get_In_Interruptible_Region
(Self : not null access constant UML_Data_Store_Node_Proxy)
return AMF.UML.Interruptible_Activity_Regions.Collections.Set_Of_UML_Interruptible_Activity_Region;
-- Getter of ActivityNode::inInterruptibleRegion.
--
-- Interruptible regions containing the node.
overriding function Get_In_Partition
(Self : not null access constant UML_Data_Store_Node_Proxy)
return AMF.UML.Activity_Partitions.Collections.Set_Of_UML_Activity_Partition;
-- Getter of ActivityNode::inPartition.
--
-- Partitions containing the node.
overriding function Get_In_Structured_Node
(Self : not null access constant UML_Data_Store_Node_Proxy)
return AMF.UML.Structured_Activity_Nodes.UML_Structured_Activity_Node_Access;
-- Getter of ActivityNode::inStructuredNode.
--
-- Structured activity node containing the node.
overriding procedure Set_In_Structured_Node
(Self : not null access UML_Data_Store_Node_Proxy;
To : AMF.UML.Structured_Activity_Nodes.UML_Structured_Activity_Node_Access);
-- Setter of ActivityNode::inStructuredNode.
--
-- Structured activity node containing the node.
overriding function Get_Incoming
(Self : not null access constant UML_Data_Store_Node_Proxy)
return AMF.UML.Activity_Edges.Collections.Set_Of_UML_Activity_Edge;
-- Getter of ActivityNode::incoming.
--
-- Edges that have the node as target.
overriding function Get_Outgoing
(Self : not null access constant UML_Data_Store_Node_Proxy)
return AMF.UML.Activity_Edges.Collections.Set_Of_UML_Activity_Edge;
-- Getter of ActivityNode::outgoing.
--
-- Edges that have the node as source.
overriding function Get_Redefined_Node
(Self : not null access constant UML_Data_Store_Node_Proxy)
return AMF.UML.Activity_Nodes.Collections.Set_Of_UML_Activity_Node;
-- Getter of ActivityNode::redefinedNode.
--
-- Inherited nodes replaced by this node in a specialization of the
-- activity.
overriding function Get_Is_Leaf
(Self : not null access constant UML_Data_Store_Node_Proxy)
return Boolean;
-- Getter of RedefinableElement::isLeaf.
--
-- Indicates whether it is possible to further redefine a
-- RedefinableElement. If the value is true, then it is not possible to
-- further redefine the RedefinableElement. Note that this property is
-- preserved through package merge operations; that is, the capability to
-- redefine a RedefinableElement (i.e., isLeaf=false) must be preserved in
-- the resulting RedefinableElement of a package merge operation where a
-- RedefinableElement with isLeaf=false is merged with a matching
-- RedefinableElement with isLeaf=true: the resulting RedefinableElement
-- will have isLeaf=false. Default value is false.
overriding procedure Set_Is_Leaf
(Self : not null access UML_Data_Store_Node_Proxy;
To : Boolean);
-- Setter of RedefinableElement::isLeaf.
--
-- Indicates whether it is possible to further redefine a
-- RedefinableElement. If the value is true, then it is not possible to
-- further redefine the RedefinableElement. Note that this property is
-- preserved through package merge operations; that is, the capability to
-- redefine a RedefinableElement (i.e., isLeaf=false) must be preserved in
-- the resulting RedefinableElement of a package merge operation where a
-- RedefinableElement with isLeaf=false is merged with a matching
-- RedefinableElement with isLeaf=true: the resulting RedefinableElement
-- will have isLeaf=false. Default value is false.
overriding function Get_Redefined_Element
(Self : not null access constant UML_Data_Store_Node_Proxy)
return AMF.UML.Redefinable_Elements.Collections.Set_Of_UML_Redefinable_Element;
-- Getter of RedefinableElement::redefinedElement.
--
-- The redefinable element that is being redefined by this element.
overriding function Get_Redefinition_Context
(Self : not null access constant UML_Data_Store_Node_Proxy)
return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier;
-- Getter of RedefinableElement::redefinitionContext.
--
-- References the contexts that this element may be redefined from.
overriding function Get_Client_Dependency
(Self : not null access constant UML_Data_Store_Node_Proxy)
return AMF.UML.Dependencies.Collections.Set_Of_UML_Dependency;
-- Getter of NamedElement::clientDependency.
--
-- Indicates the dependencies that reference the client.
overriding function Get_Name_Expression
(Self : not null access constant UML_Data_Store_Node_Proxy)
return AMF.UML.String_Expressions.UML_String_Expression_Access;
-- Getter of NamedElement::nameExpression.
--
-- The string expression used to define the name of this named element.
overriding procedure Set_Name_Expression
(Self : not null access UML_Data_Store_Node_Proxy;
To : AMF.UML.String_Expressions.UML_String_Expression_Access);
-- Setter of NamedElement::nameExpression.
--
-- The string expression used to define the name of this named element.
overriding function Get_Namespace
(Self : not null access constant UML_Data_Store_Node_Proxy)
return AMF.UML.Namespaces.UML_Namespace_Access;
-- Getter of NamedElement::namespace.
--
-- Specifies the namespace that owns the NamedElement.
overriding function Get_Qualified_Name
(Self : not null access constant UML_Data_Store_Node_Proxy)
return AMF.Optional_String;
-- Getter of NamedElement::qualifiedName.
--
-- A name which allows the NamedElement to be identified within a
-- hierarchy of nested Namespaces. It is constructed from the names of the
-- containing namespaces starting at the root of the hierarchy and ending
-- with the name of the NamedElement itself.
overriding function Get_Type
(Self : not null access constant UML_Data_Store_Node_Proxy)
return AMF.UML.Types.UML_Type_Access;
-- Getter of TypedElement::type.
--
-- The type of the TypedElement.
-- This information is derived from the return result for this Operation.
overriding procedure Set_Type
(Self : not null access UML_Data_Store_Node_Proxy;
To : AMF.UML.Types.UML_Type_Access);
-- Setter of TypedElement::type.
--
-- The type of the TypedElement.
-- This information is derived from the return result for this Operation.
overriding function Is_Consistent_With
(Self : not null access constant UML_Data_Store_Node_Proxy;
Redefinee : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access)
return Boolean;
-- Operation RedefinableElement::isConsistentWith.
--
-- The query isConsistentWith() specifies, for any two RedefinableElements
-- in a context in which redefinition is possible, whether redefinition
-- would be logically consistent. By default, this is false; this
-- operation must be overridden for subclasses of RedefinableElement to
-- define the consistency conditions.
overriding function Is_Redefinition_Context_Valid
(Self : not null access constant UML_Data_Store_Node_Proxy;
Redefined : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access)
return Boolean;
-- Operation RedefinableElement::isRedefinitionContextValid.
--
-- The query isRedefinitionContextValid() specifies whether the
-- redefinition contexts of this RedefinableElement are properly related
-- to the redefinition contexts of the specified RedefinableElement to
-- allow this element to redefine the other. By default at least one of
-- the redefinition contexts of this element must be a specialization of
-- at least one of the redefinition contexts of the specified element.
overriding function All_Owning_Packages
(Self : not null access constant UML_Data_Store_Node_Proxy)
return AMF.UML.Packages.Collections.Set_Of_UML_Package;
-- Operation NamedElement::allOwningPackages.
--
-- The query allOwningPackages() returns all the directly or indirectly
-- owning packages.
overriding function Is_Distinguishable_From
(Self : not null access constant UML_Data_Store_Node_Proxy;
N : AMF.UML.Named_Elements.UML_Named_Element_Access;
Ns : AMF.UML.Namespaces.UML_Namespace_Access)
return Boolean;
-- Operation NamedElement::isDistinguishableFrom.
--
-- The query isDistinguishableFrom() determines whether two NamedElements
-- may logically co-exist within a Namespace. By default, two named
-- elements are distinguishable if (a) they have unrelated types or (b)
-- they have related types but different names.
overriding function Namespace
(Self : not null access constant UML_Data_Store_Node_Proxy)
return AMF.UML.Namespaces.UML_Namespace_Access;
-- Operation NamedElement::namespace.
--
-- Missing derivation for NamedElement::/namespace : Namespace
overriding procedure Enter_Element
(Self : not null access constant UML_Data_Store_Node_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control);
-- Dispatch call to corresponding subprogram of visitor interface.
overriding procedure Leave_Element
(Self : not null access constant UML_Data_Store_Node_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control);
-- Dispatch call to corresponding subprogram of visitor interface.
overriding procedure Visit_Element
(Self : not null access constant UML_Data_Store_Node_Proxy;
Iterator : in out AMF.Visitors.Abstract_Iterator'Class;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control);
-- Dispatch call to corresponding subprogram of iterator interface.
end AMF.Internals.UML_Data_Store_Nodes;
| 46.648294 | 106 | 0.685253 |
200cbcbdad22d692bbfd0a388ad89bc05c77ffaf | 288 | ada | Ada | Task/Quine/Ada/quine.ada | mullikine/RosettaCodeData | 4f0027c6ce83daa36118ee8b67915a13cd23ab67 | [
"Info-ZIP"
] | 1 | 2018-11-09T22:08:38.000Z | 2018-11-09T22:08:38.000Z | Task/Quine/Ada/quine.ada | mullikine/RosettaCodeData | 4f0027c6ce83daa36118ee8b67915a13cd23ab67 | [
"Info-ZIP"
] | null | null | null | Task/Quine/Ada/quine.ada | mullikine/RosettaCodeData | 4f0027c6ce83daa36118ee8b67915a13cd23ab67 | [
"Info-ZIP"
] | 1 | 2018-11-09T22:08:40.000Z | 2018-11-09T22:08:40.000Z | with Ada.Text_IO;procedure Self is Q:Character:='"';A:String:="with Ada.Text_IO;procedure Self is Q:Character:='';A:String:=;begin Ada.Text_IO.Put_Line(A(1..49)&Q&A(50..61)&Q&A&Q&A(62..A'Last));end Self;";begin Ada.Text_IO.Put_Line(A(1..49)&Q&A(50..61)&Q&A&Q&A(62..A'Last));end Self;
| 144 | 287 | 0.680556 |
2065d19533faf4e9e698a6f37af08c8b4884cf6d | 4,096 | ads | Ada | source/amf/utp/amf-utp-suts.ads | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 24 | 2016-11-29T06:59:41.000Z | 2021-08-30T11:55:16.000Z | source/amf/utp/amf-utp-suts.ads | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 2 | 2019-01-16T05:15:20.000Z | 2019-02-03T10:03:32.000Z | source/amf/utp/amf-utp-suts.ads | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 4 | 2017-07-18T07:11:05.000Z | 2020-06-21T03:02:25.000Z | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012, Vadim Godunko <[email protected]> --
-- 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.
------------------------------------------------------------------------------
limited with AMF.UML.Properties;
package AMF.Utp.SUTs is
pragma Preelaborate;
type Utp_SUT is limited interface;
type Utp_SUT_Access is
access all Utp_SUT'Class;
for Utp_SUT_Access'Storage_Size use 0;
not overriding function Get_Base_Property
(Self : not null access constant Utp_SUT)
return AMF.UML.Properties.UML_Property_Access is abstract;
-- Getter of SUT::base_Property.
--
not overriding procedure Set_Base_Property
(Self : not null access Utp_SUT;
To : AMF.UML.Properties.UML_Property_Access) is abstract;
-- Setter of SUT::base_Property.
--
end AMF.Utp.SUTs;
| 57.690141 | 78 | 0.435303 |
4a1cd56aed5505572a14f55a233385bae8125e30 | 20,363 | adb | Ada | llvm-gcc-4.2-2.9/gcc/ada/s-interr-sigaction.adb | vidkidz/crossbridge | ba0bf94aee0ce6cf7eb5be882382e52bc57ba396 | [
"MIT"
] | 1 | 2016-04-09T02:58:13.000Z | 2016-04-09T02:58:13.000Z | llvm-gcc-4.2-2.9/gcc/ada/s-interr-sigaction.adb | vidkidz/crossbridge | ba0bf94aee0ce6cf7eb5be882382e52bc57ba396 | [
"MIT"
] | null | null | null | llvm-gcc-4.2-2.9/gcc/ada/s-interr-sigaction.adb | vidkidz/crossbridge | ba0bf94aee0ce6cf7eb5be882382e52bc57ba396 | [
"MIT"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . I N T E R R U P T S --
-- --
-- B o d y --
-- --
-- Copyright (C) 1998-2006, Free Software Fundation --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNARL; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNARL was developed by the GNARL team at Florida State University. --
-- Extensive contributions were provided by Ada Core Technologies, Inc. --
-- --
------------------------------------------------------------------------------
-- This is the IRIX & NT version of this package
with Ada.Task_Identification;
-- used for Task_Id
with Ada.Exceptions;
-- used for Raise_Exception
with System.Storage_Elements;
-- used for To_Address
-- To_Integer
with System.Task_Primitives.Operations;
-- used for Self
-- Sleep
-- Wakeup
-- Write_Lock
-- Unlock
with System.Tasking.Utilities;
-- used for Make_Independent
with System.Tasking.Rendezvous;
-- used for Call_Simple
with System.Tasking.Initialization;
-- used for Defer_Abort
-- Undefer_Abort
with System.Interrupt_Management;
with System.Parameters;
-- used for Single_Lock
with Interfaces.C;
-- used for int
with Unchecked_Conversion;
package body System.Interrupts is
use Parameters;
use Tasking;
use Ada.Exceptions;
use System.OS_Interface;
use Interfaces.C;
package STPO renames System.Task_Primitives.Operations;
package IMNG renames System.Interrupt_Management;
subtype int is Interfaces.C.int;
function To_System is new Unchecked_Conversion
(Ada.Task_Identification.Task_Id, Task_Id);
type Handler_Kind is (Unknown, Task_Entry, Protected_Procedure);
type Handler_Desc is record
Kind : Handler_Kind := Unknown;
T : Task_Id;
E : Task_Entry_Index;
H : Parameterless_Handler;
Static : Boolean := False;
end record;
task type Server_Task (Interrupt : Interrupt_ID) is
pragma Interrupt_Priority (System.Interrupt_Priority'Last);
end Server_Task;
type Server_Task_Access is access Server_Task;
Handlers : array (Interrupt_ID) of Task_Id;
Descriptors : array (Interrupt_ID) of Handler_Desc;
Interrupt_Count : array (Interrupt_ID) of Integer := (others => 0);
pragma Volatile_Components (Interrupt_Count);
procedure Attach_Handler
(New_Handler : Parameterless_Handler;
Interrupt : Interrupt_ID;
Static : Boolean;
Restoration : Boolean);
-- This internal procedure is needed to finalize protected objects
-- that contain interrupt handlers.
procedure Signal_Handler (Sig : Interrupt_ID);
-- This procedure is used to handle all the signals
-- Type and Head, Tail of the list containing Registered Interrupt
-- Handlers. These definitions are used to register the handlers
-- specified by the pragma Interrupt_Handler.
--------------------------
-- Handler Registration --
--------------------------
type Registered_Handler;
type R_Link is access all Registered_Handler;
type Registered_Handler is record
H : System.Address := System.Null_Address;
Next : R_Link := null;
end record;
Registered_Handlers : R_Link := null;
function Is_Registered (Handler : Parameterless_Handler) return Boolean;
-- See if the Handler has been "pragma"ed using Interrupt_Handler.
-- Always consider a null handler as registered.
type Handler_Ptr is access procedure (Sig : Interrupt_ID);
function TISR is new Unchecked_Conversion (Handler_Ptr, isr_address);
--------------------
-- Signal_Handler --
--------------------
procedure Signal_Handler (Sig : Interrupt_ID) is
Handler : Task_Id renames Handlers (Sig);
begin
if Intr_Attach_Reset and then
intr_attach (int (Sig), TISR (Signal_Handler'Access)) = FUNC_ERR
then
raise Program_Error;
end if;
if Handler /= null then
Interrupt_Count (Sig) := Interrupt_Count (Sig) + 1;
STPO.Wakeup (Handler, Interrupt_Server_Idle_Sleep);
end if;
end Signal_Handler;
-----------------
-- Is_Reserved --
-----------------
function Is_Reserved (Interrupt : Interrupt_ID) return Boolean is
begin
return IMNG.Reserve (IMNG.Interrupt_ID (Interrupt));
end Is_Reserved;
-----------------------
-- Is_Entry_Attached --
-----------------------
function Is_Entry_Attached (Interrupt : Interrupt_ID) return Boolean is
begin
if Is_Reserved (Interrupt) then
Raise_Exception (Program_Error'Identity, "Interrupt" &
Interrupt_ID'Image (Interrupt) & " is reserved");
end if;
return Descriptors (Interrupt).T /= Null_Task;
end Is_Entry_Attached;
-------------------------
-- Is_Handler_Attached --
-------------------------
function Is_Handler_Attached (Interrupt : Interrupt_ID) return Boolean is
begin
if Is_Reserved (Interrupt) then
Raise_Exception (Program_Error'Identity, "Interrupt" &
Interrupt_ID'Image (Interrupt) & " is reserved");
end if;
return Descriptors (Interrupt).Kind /= Unknown;
end Is_Handler_Attached;
----------------
-- Is_Ignored --
----------------
function Is_Ignored (Interrupt : Interrupt_ID) return Boolean is
begin
raise Program_Error;
return False;
end Is_Ignored;
------------------
-- Unblocked_By --
------------------
function Unblocked_By (Interrupt : Interrupt_ID) return Task_Id is
begin
raise Program_Error;
return Null_Task;
end Unblocked_By;
----------------------
-- Ignore_Interrupt --
----------------------
procedure Ignore_Interrupt (Interrupt : Interrupt_ID) is
begin
raise Program_Error;
end Ignore_Interrupt;
------------------------
-- Unignore_Interrupt --
------------------------
procedure Unignore_Interrupt (Interrupt : Interrupt_ID) is
begin
raise Program_Error;
end Unignore_Interrupt;
-------------------------------------
-- Has_Interrupt_Or_Attach_Handler --
-------------------------------------
function Has_Interrupt_Or_Attach_Handler
(Object : access Dynamic_Interrupt_Protection) return Boolean
is
pragma Unreferenced (Object);
begin
return True;
end Has_Interrupt_Or_Attach_Handler;
--------------
-- Finalize --
--------------
procedure Finalize (Object : in out Static_Interrupt_Protection) is
begin
-- ??? loop to be executed only when we're not doing library level
-- finalization, since in this case all interrupt tasks are gone.
for N in reverse Object.Previous_Handlers'Range loop
Attach_Handler
(New_Handler => Object.Previous_Handlers (N).Handler,
Interrupt => Object.Previous_Handlers (N).Interrupt,
Static => Object.Previous_Handlers (N).Static,
Restoration => True);
end loop;
Tasking.Protected_Objects.Entries.Finalize
(Tasking.Protected_Objects.Entries.Protection_Entries (Object));
end Finalize;
-------------------------------------
-- Has_Interrupt_Or_Attach_Handler --
-------------------------------------
function Has_Interrupt_Or_Attach_Handler
(Object : access Static_Interrupt_Protection) return Boolean
is
pragma Unreferenced (Object);
begin
return True;
end Has_Interrupt_Or_Attach_Handler;
----------------------
-- Install_Handlers --
----------------------
procedure Install_Handlers
(Object : access Static_Interrupt_Protection;
New_Handlers : New_Handler_Array)
is
begin
for N in New_Handlers'Range loop
-- We need a lock around this ???
Object.Previous_Handlers (N).Interrupt := New_Handlers (N).Interrupt;
Object.Previous_Handlers (N).Static := Descriptors
(New_Handlers (N).Interrupt).Static;
-- We call Exchange_Handler and not directly Interrupt_Manager.
-- Exchange_Handler so we get the Is_Reserved check.
Exchange_Handler
(Old_Handler => Object.Previous_Handlers (N).Handler,
New_Handler => New_Handlers (N).Handler,
Interrupt => New_Handlers (N).Interrupt,
Static => True);
end loop;
end Install_Handlers;
---------------------
-- Current_Handler --
---------------------
function Current_Handler
(Interrupt : Interrupt_ID) return Parameterless_Handler
is
begin
if Is_Reserved (Interrupt) then
raise Program_Error;
end if;
if Descriptors (Interrupt).Kind = Protected_Procedure then
return Descriptors (Interrupt).H;
else
return null;
end if;
end Current_Handler;
--------------------
-- Attach_Handler --
--------------------
procedure Attach_Handler
(New_Handler : Parameterless_Handler;
Interrupt : Interrupt_ID;
Static : Boolean := False) is
begin
Attach_Handler (New_Handler, Interrupt, Static, False);
end Attach_Handler;
procedure Attach_Handler
(New_Handler : Parameterless_Handler;
Interrupt : Interrupt_ID;
Static : Boolean;
Restoration : Boolean)
is
New_Task : Server_Task_Access;
begin
if Is_Reserved (Interrupt) then
raise Program_Error;
end if;
if not Restoration and then not Static
-- Tries to overwrite a static Interrupt Handler with dynamic handle
and then
(Descriptors (Interrupt).Static
-- New handler not specified as an Interrupt Handler by a pragma
or else not Is_Registered (New_Handler))
then
Raise_Exception (Program_Error'Identity,
"Trying to overwrite a static Interrupt Handler with a " &
"dynamic Handler");
end if;
if Handlers (Interrupt) = null then
New_Task := new Server_Task (Interrupt);
Handlers (Interrupt) := To_System (New_Task.all'Identity);
end if;
if intr_attach (int (Interrupt),
TISR (Signal_Handler'Access)) = FUNC_ERR
then
raise Program_Error;
end if;
if New_Handler = null then
-- The null handler means we are detaching the handler
Descriptors (Interrupt) :=
(Kind => Unknown, T => null, E => 0, H => null, Static => False);
else
Descriptors (Interrupt).Kind := Protected_Procedure;
Descriptors (Interrupt).H := New_Handler;
Descriptors (Interrupt).Static := Static;
end if;
end Attach_Handler;
----------------------
-- Exchange_Handler --
----------------------
procedure Exchange_Handler
(Old_Handler : out Parameterless_Handler;
New_Handler : Parameterless_Handler;
Interrupt : Interrupt_ID;
Static : Boolean := False)
is
begin
if Is_Reserved (Interrupt) then
raise Program_Error;
end if;
if Descriptors (Interrupt).Kind = Task_Entry then
-- In case we have an Interrupt Entry already installed.
-- raise a program error. (propagate it to the caller).
Raise_Exception (Program_Error'Identity,
"An interrupt is already installed");
end if;
Old_Handler := Current_Handler (Interrupt);
Attach_Handler (New_Handler, Interrupt, Static);
end Exchange_Handler;
--------------------
-- Detach_Handler --
--------------------
procedure Detach_Handler
(Interrupt : Interrupt_ID;
Static : Boolean := False)
is
begin
if Is_Reserved (Interrupt) then
raise Program_Error;
end if;
if Descriptors (Interrupt).Kind = Task_Entry then
Raise_Exception (Program_Error'Identity,
"Trying to detach an Interrupt Entry");
end if;
if not Static and then Descriptors (Interrupt).Static then
Raise_Exception (Program_Error'Identity,
"Trying to detach a static Interrupt Handler");
end if;
Descriptors (Interrupt) :=
(Kind => Unknown, T => null, E => 0, H => null, Static => False);
if intr_attach (int (Interrupt), null) = FUNC_ERR then
raise Program_Error;
end if;
end Detach_Handler;
---------------
-- Reference --
---------------
function Reference (Interrupt : Interrupt_ID) return System.Address is
Signal : constant System.Address :=
System.Storage_Elements.To_Address
(System.Storage_Elements.Integer_Address (Interrupt));
begin
if Is_Reserved (Interrupt) then
-- Only usable Interrupts can be used for binding it to an Entry
raise Program_Error;
end if;
return Signal;
end Reference;
--------------------------------
-- Register_Interrupt_Handler --
--------------------------------
procedure Register_Interrupt_Handler (Handler_Addr : System.Address) is
begin
Registered_Handlers :=
new Registered_Handler'(H => Handler_Addr, Next => Registered_Handlers);
end Register_Interrupt_Handler;
-------------------
-- Is_Registered --
-------------------
-- See if the Handler has been "pragma"ed using Interrupt_Handler.
-- Always consider a null handler as registered.
function Is_Registered (Handler : Parameterless_Handler) return Boolean is
Ptr : R_Link := Registered_Handlers;
type Fat_Ptr is record
Object_Addr : System.Address;
Handler_Addr : System.Address;
end record;
function To_Fat_Ptr is new Unchecked_Conversion
(Parameterless_Handler, Fat_Ptr);
Fat : Fat_Ptr;
begin
if Handler = null then
return True;
end if;
Fat := To_Fat_Ptr (Handler);
while Ptr /= null loop
if Ptr.H = Fat.Handler_Addr then
return True;
end if;
Ptr := Ptr.Next;
end loop;
return False;
end Is_Registered;
-----------------------------
-- Bind_Interrupt_To_Entry --
-----------------------------
procedure Bind_Interrupt_To_Entry
(T : Task_Id;
E : Task_Entry_Index;
Int_Ref : System.Address)
is
Interrupt : constant Interrupt_ID :=
Interrupt_ID (Storage_Elements.To_Integer (Int_Ref));
New_Task : Server_Task_Access;
begin
if Is_Reserved (Interrupt) then
raise Program_Error;
end if;
if Descriptors (Interrupt).Kind /= Unknown then
Raise_Exception (Program_Error'Identity,
"A binding for this interrupt is already present");
end if;
if Handlers (Interrupt) = null then
New_Task := new Server_Task (Interrupt);
Handlers (Interrupt) := To_System (New_Task.all'Identity);
end if;
if intr_attach (int (Interrupt),
TISR (Signal_Handler'Access)) = FUNC_ERR
then
raise Program_Error;
end if;
Descriptors (Interrupt).Kind := Task_Entry;
Descriptors (Interrupt).T := T;
Descriptors (Interrupt).E := E;
-- Indicate the attachment of Interrupt Entry in ATCB. This is needed so
-- that when an Interrupt Entry task terminates the binding can be
-- cleaned up. The call to unbinding must be make by the task before it
-- terminates.
T.Interrupt_Entry := True;
end Bind_Interrupt_To_Entry;
------------------------------
-- Detach_Interrupt_Entries --
------------------------------
procedure Detach_Interrupt_Entries (T : Task_Id) is
begin
for J in Interrupt_ID loop
if not Is_Reserved (J) then
if Descriptors (J).Kind = Task_Entry
and then Descriptors (J).T = T
then
Descriptors (J).Kind := Unknown;
if intr_attach (int (J), null) = FUNC_ERR then
raise Program_Error;
end if;
end if;
end if;
end loop;
-- Indicate in ATCB that no Interrupt Entries are attached
T.Interrupt_Entry := True;
end Detach_Interrupt_Entries;
---------------------
-- Block_Interrupt --
---------------------
procedure Block_Interrupt (Interrupt : Interrupt_ID) is
begin
raise Program_Error;
end Block_Interrupt;
-----------------------
-- Unblock_Interrupt --
-----------------------
procedure Unblock_Interrupt (Interrupt : Interrupt_ID) is
begin
raise Program_Error;
end Unblock_Interrupt;
----------------
-- Is_Blocked --
----------------
function Is_Blocked (Interrupt : Interrupt_ID) return Boolean is
begin
raise Program_Error;
return False;
end Is_Blocked;
task body Server_Task is
Desc : Handler_Desc renames Descriptors (Interrupt);
Self_Id : constant Task_Id := STPO.Self;
Temp : Parameterless_Handler;
begin
Utilities.Make_Independent;
loop
while Interrupt_Count (Interrupt) > 0 loop
Interrupt_Count (Interrupt) := Interrupt_Count (Interrupt) - 1;
begin
case Desc.Kind is
when Unknown =>
null;
when Task_Entry =>
Rendezvous.Call_Simple (Desc.T, Desc.E, Null_Address);
when Protected_Procedure =>
Temp := Desc.H;
Temp.all;
end case;
exception
when others => null;
end;
end loop;
Initialization.Defer_Abort (Self_Id);
if Single_Lock then
STPO.Lock_RTS;
end if;
STPO.Write_Lock (Self_Id);
Self_Id.Common.State := Interrupt_Server_Idle_Sleep;
STPO.Sleep (Self_Id, Interrupt_Server_Idle_Sleep);
Self_Id.Common.State := Runnable;
STPO.Unlock (Self_Id);
if Single_Lock then
STPO.Unlock_RTS;
end if;
Initialization.Undefer_Abort (Self_Id);
-- Undefer abort here to allow a window for this task to be aborted
-- at the time of system shutdown.
end loop;
end Server_Task;
end System.Interrupts;
| 29.945588 | 79 | 0.576831 |
cb0fdf76d8005c6d5d3bf260e6e5205ce8fe79af | 3,666 | ads | Ada | orka/src/gl/interface/gl-viewports.ads | onox/orka | 9edf99559a16ffa96dfdb208322f4d18efbcbac6 | [
"Apache-2.0"
] | 52 | 2016-07-30T23:00:28.000Z | 2022-02-05T11:54:55.000Z | orka/src/gl/interface/gl-viewports.ads | onox/orka | 9edf99559a16ffa96dfdb208322f4d18efbcbac6 | [
"Apache-2.0"
] | 79 | 2016-08-01T18:36:48.000Z | 2022-02-27T12:14:20.000Z | orka/src/gl/interface/gl-viewports.ads | onox/orka | 9edf99559a16ffa96dfdb208322f4d18efbcbac6 | [
"Apache-2.0"
] | 4 | 2018-04-28T22:36:26.000Z | 2020-11-14T23:00:29.000Z | -- SPDX-License-Identifier: Apache-2.0
--
-- Copyright (c) 2013 Felix Krause <[email protected]>
-- Copyright (c) 2017 onox <[email protected]>
--
-- 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 GL.Types;
private with GL.Low_Level;
package GL.Viewports is
pragma Preelaborate;
use GL.Types;
-----------------------------------------------------------------------------
-- Viewports --
-----------------------------------------------------------------------------
type Viewport is record
X, Y, Width, Height : Single;
end record;
type Depth_Range is record
Near, Far : Double;
end record;
type Scissor_Rectangle is record
Left, Bottom : Int;
Width, Height : Size;
end record;
type Viewport_List is array (UInt range <>) of Viewport
with Convention => C;
type Depth_Range_List is array (UInt range <>) of Depth_Range
with Convention => C;
type Scissor_Rectangle_List is array (UInt range <>) of Scissor_Rectangle
with Convention => C;
function Maximum_Viewports return Size
with Post => Maximum_Viewports'Result >= 16;
function Viewport_Subpixel_Bits return Size;
function Origin_Range return Singles.Vector2;
-- Return the minimum and maximum X and Y of the origin (lower left
-- corner) of a viewport
function Maximum_Extent return Singles.Vector2;
-- Return the maximum width and height of a viewport
procedure Set_Viewports (List : Viewport_List);
function Get_Viewport (Index : UInt) return Viewport;
procedure Set_Depth_Ranges (List : Depth_Range_List);
function Get_Depth_Range (Index : UInt) return Depth_Range;
procedure Set_Scissor_Rectangles (List : Scissor_Rectangle_List);
function Get_Scissor_Rectangle (Index : UInt) return Scissor_Rectangle;
-----------------------------------------------------------------------------
-- Clipping --
-----------------------------------------------------------------------------
type Viewport_Origin is (Lower_Left, Upper_Left);
type Depth_Mode is (Negative_One_To_One, Zero_To_One);
procedure Set_Clipping (Origin : Viewport_Origin; Depth : Depth_Mode);
-- Set the origin of the viewport and the range of the clip planes
--
-- Controls how clip space is mapped to window space. Both Direct3D and
-- OpenGL expect a vertex position of (-1, -1) to map to the lower-left
-- corner of the viewport.
--
-- Direct3D expects the UV coordinate of (0, 0) to correspond to the
-- upper-left corner of a randered image, while OpenGL expects it in
-- the lower-left corner.
function Origin return Viewport_Origin;
function Depth return Depth_Mode;
private
for Viewport_Origin use
(Lower_Left => 16#8CA1#,
Upper_Left => 16#8CA2#);
for Viewport_Origin'Size use Low_Level.Enum'Size;
for Depth_Mode use
(Negative_One_To_One => 16#935E#,
Zero_To_One => 16#935F#);
for Depth_Mode'Size use Low_Level.Enum'Size;
end GL.Viewports;
| 33.327273 | 80 | 0.623022 |
0e32aa228a8dbfeb21742b43c862414e4c9df8cb | 6,062 | ads | Ada | src/generated/sys_utypes_h.ads | csb6/libtcod-ada | 89c2a75eb357a8468ccb0a6476391a6b388f00b4 | [
"BSD-3-Clause"
] | null | null | null | src/generated/sys_utypes_h.ads | csb6/libtcod-ada | 89c2a75eb357a8468ccb0a6476391a6b388f00b4 | [
"BSD-3-Clause"
] | null | null | null | src/generated/sys_utypes_h.ads | csb6/libtcod-ada | 89c2a75eb357a8468ccb0a6476391a6b388f00b4 | [
"BSD-3-Clause"
] | null | null | null | pragma Ada_2012;
pragma Style_Checks (Off);
with Interfaces.C; use Interfaces.C;
with i386_utypes_h;
package sys_utypes_h is
-- * Copyright (c) 2003-2007 Apple Inc. All rights reserved.
-- *
-- * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
-- *
-- * This file contains Original Code and/or Modifications of Original Code
-- * as defined in and that are subject to the Apple Public Source License
-- * Version 2.0 (the 'License'). You may not use this file except in
-- * compliance with the License. The rights granted to you under the License
-- * may not be used to create, or enable the creation or redistribution of,
-- * unlawful or unlicensed copies of an Apple operating system, or to
-- * circumvent, violate, or enable the circumvention or violation of, any
-- * terms of an Apple operating system software license agreement.
-- *
-- * Please obtain a copy of the License at
-- * http://www.opensource.apple.com/apsl/ and read it before using this file.
-- *
-- * The Original Code and all software distributed under the License are
-- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
-- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
-- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
-- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
-- * Please see the License for the specific language governing rights and
-- * limitations under the License.
-- *
-- * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
--
-- * Type definitions; takes common type definitions that must be used
-- * in multiple header files due to [XSI], removes them from the system
-- * space, and puts them in the implementation space.
--
-- total blocks
subtype uu_darwin_blkcnt_t is i386_utypes_h.uu_int64_t; -- /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types.h:55
-- preferred block size
subtype uu_darwin_blksize_t is i386_utypes_h.uu_int32_t; -- /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types.h:56
-- dev_t
subtype uu_darwin_dev_t is i386_utypes_h.uu_int32_t; -- /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types.h:57
-- Used by statvfs and fstatvfs
subtype uu_darwin_fsblkcnt_t is unsigned; -- /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types.h:58
-- Used by statvfs and fstatvfs
subtype uu_darwin_fsfilcnt_t is unsigned; -- /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types.h:59
-- [???] process and group IDs
subtype uu_darwin_gid_t is i386_utypes_h.uu_uint32_t; -- /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types.h:60
-- [XSI] pid_t, uid_t, or gid_t
subtype uu_darwin_id_t is i386_utypes_h.uu_uint32_t; -- /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types.h:61
-- [???] Used for 64 bit inodes
subtype uu_darwin_ino64_t is i386_utypes_h.uu_uint64_t; -- /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types.h:62
-- [???] Used for inodes
subtype uu_darwin_ino_t is uu_darwin_ino64_t; -- /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types.h:64
-- [???] Used for inodes
-- Used by mach
subtype uu_darwin_mach_port_name_t is i386_utypes_h.uu_darwin_natural_t; -- /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types.h:68
-- Used by mach
subtype uu_darwin_mach_port_t is uu_darwin_mach_port_name_t; -- /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types.h:69
-- [???] Some file attributes
subtype uu_darwin_mode_t is i386_utypes_h.uu_uint16_t; -- /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types.h:70
-- [???] Used for file sizes
subtype uu_darwin_off_t is i386_utypes_h.uu_int64_t; -- /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types.h:71
-- [???] process and group IDs
subtype uu_darwin_pid_t is i386_utypes_h.uu_int32_t; -- /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types.h:72
-- [???] signal set
subtype uu_darwin_sigset_t is i386_utypes_h.uu_uint32_t; -- /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types.h:73
-- [???] microseconds
subtype uu_darwin_suseconds_t is i386_utypes_h.uu_int32_t; -- /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types.h:74
-- [???] user IDs
subtype uu_darwin_uid_t is i386_utypes_h.uu_uint32_t; -- /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types.h:75
-- [???] microseconds
subtype uu_darwin_useconds_t is i386_utypes_h.uu_uint32_t; -- /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types.h:76
type uu_darwin_uuid_t is array (0 .. 15) of aliased unsigned_char; -- /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types.h:77
subtype uu_darwin_uuid_string_t is Interfaces.C.char_array (0 .. 36); -- /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types.h:78
end sys_utypes_h;
| 60.019802 | 202 | 0.763114 |
dc01ca8809c8b0db69ca09b9649959e1f2c0de95 | 4,459 | ada | Ada | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c5/c52104q.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 7 | 2020-05-02T17:34:05.000Z | 2021-10-17T10:15:18.000Z | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c5/c52104q.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | null | null | null | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c5/c52104q.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 2 | 2020-07-27T00:22:36.000Z | 2021-04-01T09:41:02.000Z | -- C52104Q.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 LENGTHS MUST MATCH IN ARRAY AND SLICE ASSIGNMENTS.
-- MORE SPECIFICALLY, TEST THAT ATTEMPTED ASSIGNMENTS BETWEEN
-- ARRAYS WITH NON-MATCHING LENGTHS LEAVE THE DESTINATION ARRAY
-- INTACT AND CAUSE CONSTRAINT_ERROR TO BE RAISED.
-- (OVERLAPS BETWEEN THE OPERANDS OF THE ASSIGNMENT STATEMENT
-- ARE TREATED ELSEWHERE.)
-- THIS IS THE SECOND FILE IN
-- DIVISION D : NULL LENGTHS NOT DETERMINABLE STATICALLY.
-- RM 07/20/81
-- SPS 3/22/83
-- JBG 4/24/84
WITH REPORT;
PROCEDURE C52104Q IS
USE REPORT ;
BEGIN
TEST( "C52104Q" , "CHECK THAT IN ARRAY ASSIGNMENTS AND IN SLICE" &
" ASSIGNMENTS THE LENGTHS MUST MATCH" );
-- ( EACH DIVISION COMPRISES 3 FILES,
-- COVERING RESPECTIVELY THE FIRST
-- 3 , NEXT 2 , AND LAST 3 OF THE 8
-- SELECTIONS FOR THE DIVISION.)
-------------------------------------------------------------------
-- (13) UNSLICED ONE-DIMENSIONAL ARRAY OBJECTS WHOSE TYPEMARKS
-- WERE DEFINED USING THE "BOX" SYMBOL
-- AND FOR WHICH THE COMPONENT TYPE IS 'CHARACTER' .
DECLARE
TYPE TABOX3 IS ARRAY( NATURAL RANGE <> ) OF CHARACTER ;
ARRX31 : TABOX3( IDENT_INT(11)..IDENT_INT(10) ) := "" ;
BEGIN
-- ARRAY ASSIGNMENT (WITH STRING AGGREGATE):
ARRX31 := "AZ" ;
FAILED( "EXCEPTION NOT RAISED - SUBTEST 13" );
EXCEPTION
WHEN CONSTRAINT_ERROR =>
-- CHECKING THE VALUES AFTER THE SLICE ASSIGNMENT:
IF ARRX31 /= ""
THEN
FAILED( "ARRAY ASSIGNMENT NOT CORRECT (13)" );
END IF;
WHEN OTHERS =>
FAILED( "WRONG EXCEPTION RAISED - SUBTEST 13" );
END ;
-------------------------------------------------------------------
-- (14) SLICED ONE-DIMENSIONAL ARRAY OBJECTS WHOSE TYPEMARKS
-- WERE DEFINED USING THE "BOX" SYMBOL
-- AND FOR WHICH THE COMPONENT TYPE IS 'CHARACTER' .
DECLARE
TYPE TABOX4 IS ARRAY( INTEGER RANGE <> ) OF CHARACTER ;
SUBTYPE TABOX42 IS TABOX4( IDENT_INT(11)..IDENT_INT(15) );
ARRX42 : TABOX42 ;
BEGIN
-- INITIALIZATION OF LHS ARRAY:
ARRX42 := "QUINC" ;
-- NULL SLICE ASSIGNMENT:
ARRX42( IDENT_INT(13)..IDENT_INT(12) ) := "ABCD" ;
FAILED( "EXCEPTION NOT RAISED - SUBTEST 14" );
EXCEPTION
WHEN CONSTRAINT_ERROR =>
-- CHECKING THE VALUES AFTER THE SLICE ASSIGNMENT:
IF ARRX42 /= "QUINC" OR
ARRX42( IDENT_INT(11)..IDENT_INT(15) ) /= "QUINC"
THEN
FAILED( "LHS ARRAY ALTERED (14)" );
END IF;
WHEN OTHERS =>
FAILED( "WRONG EXCEPTION RAISED - SUBTEST 14" );
END ;
-------------------------------------------------------------------
RESULT ;
END C52104Q;
| 30.333333 | 79 | 0.54362 |
20d35957619ee347320cb55070451bbf4416fc24 | 3,527 | adb | Ada | src/tools/Dependency_Graph_Extractor/src/extraction-direct_calls.adb | selroc/Renaissance-Ada | 39230b34aced4a9d83831be346ca103136c53715 | [
"BSD-3-Clause"
] | 1 | 2022-03-08T13:00:47.000Z | 2022-03-08T13:00:47.000Z | src/tools/Dependency_Graph_Extractor/src/extraction-direct_calls.adb | selroc/Renaissance-Ada | 39230b34aced4a9d83831be346ca103136c53715 | [
"BSD-3-Clause"
] | null | null | null | src/tools/Dependency_Graph_Extractor/src/extraction-direct_calls.adb | selroc/Renaissance-Ada | 39230b34aced4a9d83831be346ca103136c53715 | [
"BSD-3-Clause"
] | null | null | null | pragma Assertion_Policy(Check);
with Libadalang.Analysis;
with Extraction.Node_Edge_Types;
with Extraction.Utilities;
package body Extraction.Direct_Calls is
use type LALCO.Ada_Node_Kind_Type;
function Is_Duplicate_Callsite(Name : LAL.Name) return Boolean is
function Is_Node_Duplicating_Parent(Node : LAL.Name) return Boolean is
Parent : constant LAL.Ada_Node'Class := Node.Parent;
begin
if Parent.Kind = LALCO.Ada_Call_Expr
and then Node = Parent.As_Call_Expr.F_Name
then
declare
Call_Expr : LAL.Call_Expr := Parent.As_Call_Expr;
begin
if Call_Expr.P_Called_Subp_Spec = LAL.No_Ada_Node
and then Call_Expr.Parent.Kind = LALCO.Ada_Call_Expr
and then Call_Expr.Parent.As_Call_Expr.P_Called_Subp_Spec.Kind = LALCO.Ada_Entry_Spec
then
Call_Expr := Call_Expr.Parent.As_Call_Expr;
end if;
return Node.P_Called_Subp_Spec = Call_Expr.P_Called_Subp_Spec;
end;
else
return Parent.Kind = LALCO.Ada_Dotted_Name
and then Node = Parent.As_Dotted_Name.F_Suffix;
end if;
end Is_Node_Duplicating_Parent;
begin
if Name.Kind = LALCO.Ada_Dotted_Name
or else Name.Kind in LALCO.Ada_Base_Id
then
return Is_Node_Duplicating_Parent(Name);
else
pragma Assert(Name.Kind = LALCO.Ada_Call_Expr, "Expected call expression");
return False;
end if;
end Is_Duplicate_Callsite;
function Is_Direct_Call(Node : LAL.Ada_Node'Class) return Boolean is
begin
case Node.Kind is
when LALCO.Ada_Name =>
return Node.As_Name.P_Is_Direct_Call
and then not Is_Duplicate_Callsite(Node.As_Name);
when LALCO.Ada_Un_Op_Range =>
return not Utilities.Get_Referenced_Decl(Node.As_Un_Op.F_Op).Is_Null;
when LALCO.Ada_Bin_Op_Range =>
return not Utilities.Get_Referenced_Decl(Node.As_Bin_Op.F_Op).Is_Null;
when others =>
return False;
end case;
end Is_Direct_Call;
function Get_Target(Expr : LAL.Expr'Class) return LAL.Basic_Decl is
begin
case LALCO.Ada_Expr(Expr.Kind) is
when LALCO.Ada_Name =>
return Utilities.Get_Parent_Basic_Decl(Expr.As_Name.P_Called_Subp_Spec);
when LALCO.Ada_Bin_Op_Range =>
return Utilities.Get_Referenced_Decl(Expr.As_Bin_Op.F_Op);
when LALCO.Ada_Un_Op_Range =>
return Utilities.Get_Referenced_Decl(Expr.As_Un_Op.F_Op);
when others =>
raise Internal_Extraction_Error with "Cases in Is_Direct_Call and Get_Target do not match";
end case;
end Get_Target;
procedure Extract_Edges
(Node : LAL.Ada_Node'Class;
Graph : Graph_Operations.Graph_Context)
is
begin
if Is_Direct_Call(Node) then
declare
Expr : constant LAL.Expr := Node.As_Expr;
Source : constant LAL.Basic_Decl := Utilities.Get_Parent_Basic_Decl(Expr);
Target : constant LAL.Basic_Decl := Get_Target(Expr);
Edge_Attrs : constant GW.Attribute_Value_Sets.Map := Node_Edge_Types.Get_Edge_Attributes(Expr);
begin
Graph.Write_Edge(Source, Target, Node_Edge_Types.Edge_Type_Calls, Edge_Attrs);
end;
end if;
end Extract_Edges;
end Extraction.Direct_Calls;
| 37.126316 | 107 | 0.650128 |
4a2e80335d43ba7c74ec6970153dd5dc771c7c0b | 6,599 | ads | Ada | support/MinGW/lib/gcc/mingw32/9.2.0/adainclude/a-sequio.ads | orb-zhuchen/Orb | 6da2404b949ac28bde786e08bf4debe4a27cd3a0 | [
"CNRI-Python-GPL-Compatible",
"MIT"
] | null | null | null | support/MinGW/lib/gcc/mingw32/9.2.0/adainclude/a-sequio.ads | orb-zhuchen/Orb | 6da2404b949ac28bde786e08bf4debe4a27cd3a0 | [
"CNRI-Python-GPL-Compatible",
"MIT"
] | null | null | null | support/MinGW/lib/gcc/mingw32/9.2.0/adainclude/a-sequio.ads | orb-zhuchen/Orb | 6da2404b949ac28bde786e08bf4debe4a27cd3a0 | [
"CNRI-Python-GPL-Compatible",
"MIT"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- A D A . S E Q U E N T I A L _ I O --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2019, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
-- apply solely to the contents of the part following the private keyword. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with Ada.IO_Exceptions;
with System.Sequential_IO;
generic
type Element_Type (<>) is private;
package Ada.Sequential_IO is
pragma Compile_Time_Warning
(Element_Type'Has_Access_Values,
"Element_Type for Sequential_IO instance has access values");
pragma Compile_Time_Warning
(Element_Type'Has_Tagged_Values,
"Element_Type for Sequential_IO instance has tagged values");
type File_Type is limited private with Default_Initial_Condition;
type File_Mode is (In_File, Out_File, Append_File);
-- The following representation clause allows the use of unchecked
-- conversion for rapid translation between the File_Mode type
-- used in this package and System.File_IO.
for File_Mode use
(In_File => 0, -- System.File_IO.File_Mode'Pos (In_File)
Out_File => 2, -- System.File_IO.File_Mode'Pos (Out_File)
Append_File => 3); -- System.File_IO.File_Mode'Pos (Append_File)
---------------------
-- File management --
---------------------
procedure Create
(File : in out File_Type;
Mode : File_Mode := Out_File;
Name : String := "";
Form : String := "");
procedure Open
(File : in out File_Type;
Mode : File_Mode;
Name : String;
Form : String := "");
procedure Close (File : in out File_Type);
procedure Delete (File : in out File_Type);
procedure Reset (File : in out File_Type; Mode : File_Mode);
procedure Reset (File : in out File_Type);
function Mode (File : File_Type) return File_Mode;
function Name (File : File_Type) return String;
function Form (File : File_Type) return String;
function Is_Open (File : File_Type) return Boolean;
procedure Flush (File : File_Type);
---------------------------------
-- Input and output operations --
---------------------------------
procedure Read (File : File_Type; Item : out Element_Type);
procedure Write (File : File_Type; Item : Element_Type);
function End_Of_File (File : File_Type) return Boolean;
----------------
-- Exceptions --
----------------
Status_Error : exception renames IO_Exceptions.Status_Error;
Mode_Error : exception renames IO_Exceptions.Mode_Error;
Name_Error : exception renames IO_Exceptions.Name_Error;
Use_Error : exception renames IO_Exceptions.Use_Error;
Device_Error : exception renames IO_Exceptions.Device_Error;
End_Error : exception renames IO_Exceptions.End_Error;
Data_Error : exception renames IO_Exceptions.Data_Error;
private
-- The following procedures have a File_Type formal of mode IN OUT because
-- they may close the original file. The Close operation may raise an
-- exception, but in that case we want any assignment to the formal to
-- be effective anyway, so it must be passed by reference (or the caller
-- will be left with a dangling pointer).
pragma Export_Procedure
(Internal => Close,
External => "",
Mechanism => Reference);
pragma Export_Procedure
(Internal => Delete,
External => "",
Mechanism => Reference);
pragma Export_Procedure
(Internal => Reset,
External => "",
Parameter_Types => (File_Type),
Mechanism => Reference);
pragma Export_Procedure
(Internal => Reset,
External => "",
Parameter_Types => (File_Type, File_Mode),
Mechanism => (File => Reference));
type File_Type is new System.Sequential_IO.File_Type;
-- All subprograms are inlined
pragma Inline (Close);
pragma Inline (Create);
pragma Inline (Delete);
pragma Inline (End_Of_File);
pragma Inline (Form);
pragma Inline (Is_Open);
pragma Inline (Mode);
pragma Inline (Name);
pragma Inline (Open);
pragma Inline (Read);
pragma Inline (Reset);
pragma Inline (Write);
end Ada.Sequential_IO;
| 40.987578 | 78 | 0.545083 |
c5e2279ef184960032659604bee4f3288e0ab0fc | 4,733 | ads | Ada | source/amf/mofext/amf-mof-tags-collections.ads | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 24 | 2016-11-29T06:59:41.000Z | 2021-08-30T11:55:16.000Z | source/amf/mofext/amf-mof-tags-collections.ads | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 2 | 2019-01-16T05:15:20.000Z | 2019-02-03T10:03:32.000Z | source/amf/mofext/amf-mof-tags-collections.ads | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 4 | 2017-07-18T07:11:05.000Z | 2020-06-21T03:02:25.000Z | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012, Vadim Godunko <[email protected]> --
-- 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.MOF.Tags.Collections is
pragma Preelaborate;
package MOF_Tag_Collections is
new AMF.Generic_Collections
(MOF_Tag,
MOF_Tag_Access);
type Set_Of_MOF_Tag is
new MOF_Tag_Collections.Set with null record;
Empty_Set_Of_MOF_Tag : constant Set_Of_MOF_Tag;
type Ordered_Set_Of_MOF_Tag is
new MOF_Tag_Collections.Ordered_Set with null record;
Empty_Ordered_Set_Of_MOF_Tag : constant Ordered_Set_Of_MOF_Tag;
type Bag_Of_MOF_Tag is
new MOF_Tag_Collections.Bag with null record;
Empty_Bag_Of_MOF_Tag : constant Bag_Of_MOF_Tag;
type Sequence_Of_MOF_Tag is
new MOF_Tag_Collections.Sequence with null record;
Empty_Sequence_Of_MOF_Tag : constant Sequence_Of_MOF_Tag;
private
Empty_Set_Of_MOF_Tag : constant Set_Of_MOF_Tag
:= (MOF_Tag_Collections.Set with null record);
Empty_Ordered_Set_Of_MOF_Tag : constant Ordered_Set_Of_MOF_Tag
:= (MOF_Tag_Collections.Ordered_Set with null record);
Empty_Bag_Of_MOF_Tag : constant Bag_Of_MOF_Tag
:= (MOF_Tag_Collections.Bag with null record);
Empty_Sequence_Of_MOF_Tag : constant Sequence_Of_MOF_Tag
:= (MOF_Tag_Collections.Sequence with null record);
end AMF.MOF.Tags.Collections;
| 51.445652 | 78 | 0.488063 |
20dc4e62c2bdfd038bebb1274e0eeb0a79dcae34 | 10,035 | ads | Ada | support/MinGW/lib/gcc/mingw32/9.2.0/adainclude/s-stratt.ads | orb-zhuchen/Orb | 6da2404b949ac28bde786e08bf4debe4a27cd3a0 | [
"CNRI-Python-GPL-Compatible",
"MIT"
] | null | null | null | support/MinGW/lib/gcc/mingw32/9.2.0/adainclude/s-stratt.ads | orb-zhuchen/Orb | 6da2404b949ac28bde786e08bf4debe4a27cd3a0 | [
"CNRI-Python-GPL-Compatible",
"MIT"
] | null | null | null | support/MinGW/lib/gcc/mingw32/9.2.0/adainclude/s-stratt.ads | orb-zhuchen/Orb | 6da2404b949ac28bde786e08bf4debe4a27cd3a0 | [
"CNRI-Python-GPL-Compatible",
"MIT"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . S T R E A M _ A T T R I B U T E S --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2019, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package contains the implementations of the stream attributes for
-- elementary types. These are the subprograms that are directly accessed
-- by occurrences of the stream attributes where the type is elementary.
-- We only provide the subprograms for the standard base types. For user
-- defined types, the subprogram for the corresponding root type is called
-- with an appropriate conversion.
with System;
with System.Unsigned_Types;
with Ada.Streams;
package System.Stream_Attributes is
pragma Preelaborate;
pragma Suppress (Accessibility_Check, Stream_Attributes);
-- No need to check accessibility on arguments of subprograms
package UST renames System.Unsigned_Types;
subtype RST is Ada.Streams.Root_Stream_Type'Class;
subtype SEC is Ada.Streams.Stream_Element_Count;
-- Enumeration types are usually transferred using the routine for the
-- corresponding integer. The exception is that special routines are
-- provided for Boolean and the character types, in case the protocol
-- in use provides specially for these types.
-- Access types use either a thin pointer (single address) or fat pointer
-- (double address) form. The following types are used to hold access
-- values using unchecked conversions.
type Thin_Pointer is record
P1 : System.Address;
end record;
type Fat_Pointer is record
P1 : System.Address;
P2 : System.Address;
end record;
------------------------------------
-- Treatment of enumeration types --
------------------------------------
-- In this interface, there are no specific routines for general input
-- or output of enumeration types. Generally, enumeration types whose
-- representation is unsigned (no negative representation values) are
-- treated as unsigned integers, and enumeration types that do have
-- negative representation values are treated as signed integers.
-- An exception is that there are specialized routines for Boolean,
-- Character, and Wide_Character types, but these specialized routines
-- are used only if the type in question has a standard representation.
-- For the case of a non-standard representation (one where the size of
-- the first subtype is specified, or where an enumeration representation
-- clause is given), these three types are treated like any other cases
-- of enumeration types, as described above.
---------------------
-- Input Functions --
---------------------
-- Functions for S'Input attribute. These functions are also used for
-- S'Read, with the obvious transformation, since the input operation
-- is the same for all elementary types (no bounds or discriminants
-- are involved).
function I_AD (Stream : not null access RST) return Fat_Pointer;
function I_AS (Stream : not null access RST) return Thin_Pointer;
function I_B (Stream : not null access RST) return Boolean;
function I_C (Stream : not null access RST) return Character;
function I_F (Stream : not null access RST) return Float;
function I_I (Stream : not null access RST) return Integer;
function I_LF (Stream : not null access RST) return Long_Float;
function I_LI (Stream : not null access RST) return Long_Integer;
function I_LLF (Stream : not null access RST) return Long_Long_Float;
function I_LLI (Stream : not null access RST) return Long_Long_Integer;
function I_LLU (Stream : not null access RST) return UST.Long_Long_Unsigned;
function I_LU (Stream : not null access RST) return UST.Long_Unsigned;
function I_SF (Stream : not null access RST) return Short_Float;
function I_SI (Stream : not null access RST) return Short_Integer;
function I_SSI (Stream : not null access RST) return Short_Short_Integer;
function I_SSU (Stream : not null access RST) return
UST.Short_Short_Unsigned;
function I_SU (Stream : not null access RST) return UST.Short_Unsigned;
function I_U (Stream : not null access RST) return UST.Unsigned;
function I_WC (Stream : not null access RST) return Wide_Character;
function I_WWC (Stream : not null access RST) return Wide_Wide_Character;
-----------------------
-- Output Procedures --
-----------------------
-- Procedures for S'Write attribute. These procedures are also used for
-- 'Output, since for elementary types there is no difference between
-- 'Write and 'Output because there are no discriminants or bounds to
-- be written.
procedure W_AD (Stream : not null access RST; Item : Fat_Pointer);
procedure W_AS (Stream : not null access RST; Item : Thin_Pointer);
procedure W_B (Stream : not null access RST; Item : Boolean);
procedure W_C (Stream : not null access RST; Item : Character);
procedure W_F (Stream : not null access RST; Item : Float);
procedure W_I (Stream : not null access RST; Item : Integer);
procedure W_LF (Stream : not null access RST; Item : Long_Float);
procedure W_LI (Stream : not null access RST; Item : Long_Integer);
procedure W_LLF (Stream : not null access RST; Item : Long_Long_Float);
procedure W_LLI (Stream : not null access RST; Item : Long_Long_Integer);
procedure W_LLU (Stream : not null access RST; Item :
UST.Long_Long_Unsigned);
procedure W_LU (Stream : not null access RST; Item : UST.Long_Unsigned);
procedure W_SF (Stream : not null access RST; Item : Short_Float);
procedure W_SI (Stream : not null access RST; Item : Short_Integer);
procedure W_SSI (Stream : not null access RST; Item : Short_Short_Integer);
procedure W_SSU (Stream : not null access RST; Item :
UST.Short_Short_Unsigned);
procedure W_SU (Stream : not null access RST; Item : UST.Short_Unsigned);
procedure W_U (Stream : not null access RST; Item : UST.Unsigned);
procedure W_WC (Stream : not null access RST; Item : Wide_Character);
procedure W_WWC (Stream : not null access RST; Item : Wide_Wide_Character);
function Block_IO_OK return Boolean;
-- Package System.Stream_Attributes has several bodies - the default one
-- distributed with GNAT, and s-stratt-xdr.adb, which is based on the XDR
-- standard. Both bodies share the same spec. The role of this function is
-- to indicate whether the current version of System.Stream_Attributes
-- supports block IO. See System.Strings.Stream_Ops (s-ststop) for details.
private
pragma Inline (I_AD);
pragma Inline (I_AS);
pragma Inline (I_B);
pragma Inline (I_C);
pragma Inline (I_F);
pragma Inline (I_I);
pragma Inline (I_LF);
pragma Inline (I_LI);
pragma Inline (I_LLF);
pragma Inline (I_LLI);
pragma Inline (I_LLU);
pragma Inline (I_LU);
pragma Inline (I_SF);
pragma Inline (I_SI);
pragma Inline (I_SSI);
pragma Inline (I_SSU);
pragma Inline (I_SU);
pragma Inline (I_U);
pragma Inline (I_WC);
pragma Inline (I_WWC);
pragma Inline (W_AD);
pragma Inline (W_AS);
pragma Inline (W_B);
pragma Inline (W_C);
pragma Inline (W_F);
pragma Inline (W_I);
pragma Inline (W_LF);
pragma Inline (W_LI);
pragma Inline (W_LLF);
pragma Inline (W_LLI);
pragma Inline (W_LLU);
pragma Inline (W_LU);
pragma Inline (W_SF);
pragma Inline (W_SI);
pragma Inline (W_SSI);
pragma Inline (W_SSU);
pragma Inline (W_SU);
pragma Inline (W_U);
pragma Inline (W_WC);
pragma Inline (W_WWC);
pragma Inline (Block_IO_OK);
end System.Stream_Attributes;
| 48.245192 | 79 | 0.61435 |
dc258b2f0d007de2cd9a047c8b2694a2e2d4c6a5 | 3,141 | adb | Ada | src/fltk-widgets-buttons-light.adb | micahwelf/FLTK-Ada | 83e0c58ea98e5ede2cbbb158b42eae44196c3ba7 | [
"Unlicense"
] | 1 | 2020-12-18T15:20:13.000Z | 2020-12-18T15:20:13.000Z | src/fltk-widgets-buttons-light.adb | micahwelf/FLTK-Ada | 83e0c58ea98e5ede2cbbb158b42eae44196c3ba7 | [
"Unlicense"
] | null | null | null | src/fltk-widgets-buttons-light.adb | micahwelf/FLTK-Ada | 83e0c58ea98e5ede2cbbb158b42eae44196c3ba7 | [
"Unlicense"
] | null | null | null |
with
Interfaces.C,
System;
use type
System.Address;
package body FLTK.Widgets.Buttons.Light is
procedure light_button_set_draw_hook
(W, D : in System.Address);
pragma Import (C, light_button_set_draw_hook, "light_button_set_draw_hook");
pragma Inline (light_button_set_draw_hook);
procedure light_button_set_handle_hook
(W, H : in System.Address);
pragma Import (C, light_button_set_handle_hook, "light_button_set_handle_hook");
pragma Inline (light_button_set_handle_hook);
function new_fl_light_button
(X, Y, W, H : in Interfaces.C.int;
Text : in Interfaces.C.char_array)
return System.Address;
pragma Import (C, new_fl_light_button, "new_fl_light_button");
pragma Inline (new_fl_light_button);
procedure free_fl_light_button
(B : in System.Address);
pragma Import (C, free_fl_light_button, "free_fl_light_button");
pragma Inline (free_fl_light_button);
procedure fl_light_button_draw
(W : in System.Address);
pragma Import (C, fl_light_button_draw, "fl_light_button_draw");
pragma Inline (fl_light_button_draw);
function fl_light_button_handle
(W : in System.Address;
E : in Interfaces.C.int)
return Interfaces.C.int;
pragma Import (C, fl_light_button_handle, "fl_light_button_handle");
pragma Inline (fl_light_button_handle);
procedure Finalize
(This : in out Light_Button) is
begin
if This.Void_Ptr /= System.Null_Address and then
This in Light_Button'Class
then
free_fl_light_button (This.Void_Ptr);
This.Void_Ptr := System.Null_Address;
end if;
Finalize (Button (This));
end Finalize;
package body Forge is
function Create
(X, Y, W, H : in Integer;
Text : in String)
return Light_Button is
begin
return This : Light_Button do
This.Void_Ptr := new_fl_light_button
(Interfaces.C.int (X),
Interfaces.C.int (Y),
Interfaces.C.int (W),
Interfaces.C.int (H),
Interfaces.C.To_C (Text));
fl_widget_set_user_data
(This.Void_Ptr,
Widget_Convert.To_Address (This'Unchecked_Access));
light_button_set_draw_hook (This.Void_Ptr, Draw_Hook'Address);
light_button_set_handle_hook (This.Void_Ptr, Handle_Hook'Address);
end return;
end Create;
end Forge;
procedure Draw
(This : in out Light_Button) is
begin
fl_light_button_draw (This.Void_Ptr);
end Draw;
function Handle
(This : in out Light_Button;
Event : in Event_Kind)
return Event_Outcome is
begin
return Event_Outcome'Val
(fl_light_button_handle (This.Void_Ptr, Event_Kind'Pos (Event)));
end Handle;
end FLTK.Widgets.Buttons.Light;
| 26.175 | 84 | 0.608405 |
0e362d9777ccae92f89401e39d081c7652fc928a | 64,473 | adb | Ada | .emacs.d/elpa/ada-ref-man-2012.5/progs/arm_texi.adb | caqg/linux-home | eed631aae6f5e59e4f46e14f1dff443abca5fa28 | [
"Linux-OpenIB"
] | null | null | null | .emacs.d/elpa/ada-ref-man-2012.5/progs/arm_texi.adb | caqg/linux-home | eed631aae6f5e59e4f46e14f1dff443abca5fa28 | [
"Linux-OpenIB"
] | null | null | null | .emacs.d/elpa/ada-ref-man-2012.5/progs/arm_texi.adb | caqg/linux-home | eed631aae6f5e59e4f46e14f1dff443abca5fa28 | [
"Linux-OpenIB"
] | null | null | null | with Ada.Exceptions;
with Ada.Strings.Fixed;
package body ARM_Texinfo is
-- Copyright (C) 2003, 2007, 2010 - 2013, 2015, 2017, 2018 Stephen Leake. All Rights Reserved.
-- E-Mail: [email protected]
--
-- 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 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 gnu-3-0.txt. If not, write to
-- the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
-- MA 02111-1307, USA.
-- ---------------------------------------
--
-- Edit History:
--
-- Ancient - S L - Developed package as add-on to Arm_Form.
-- 10/19/11 - RLB - Integrated outside-developed package into Arm_Form.
-- Commented out/replaced Ada 2005 features (this is
-- Ada 95 code). Updated for a few other changes since
-- the last update.
-- 10/25/11 - RLB - Added old insertion version to Revised_Clause_Header.
-- 4/ 1/12 - S L - Implemented remaining Texinfo implementation.
-- 4/22/12 - S L - Move @dircategory, @direntry before first @node.
-- 4/28/12 - S L - Add @w{} after @anchor; otherwise following whitespace
-- is dropped.
-- 8/31/12 - RLB - Added Output_Path.
-- 10/18/12 - RLB - Added additional hanging styles.
-- 11/26/12 - RLB - Added subdivision names to Clause_Header and
-- Revised_Clause_Header.
-- 3/12/13 - S L - use correct version in direntry
use Ada.Text_IO;
Indentation : constant := 5;
-- VERSION: This is fragile; it changes with each version of the manual.
Index_Clause_Name : constant String := "Index";
Operators_Clause : constant String := "operators";
Last_Index_Clause : constant Character := 'Y';
----------
-- local subprograms
procedure Check_Not_In_Paragraph (Output_Object : in Texinfo_Output_Type)
is begin
if Output_Object.In_Paragraph then
Ada.Exceptions.Raise_Exception
(ARM_Output.Not_Valid_Error'Identity,
"In paragraph");
end if;
end Check_Not_In_Paragraph;
procedure Check_Valid (Output_Object : in Texinfo_Output_Type)
is begin
if not Output_Object.Is_Valid then
Ada.Exceptions.Raise_Exception
(ARM_Output.Not_Valid_Error'Identity,
"Not valid object");
end if;
end Check_Valid;
procedure Unexpected_State (Output_Object : in Texinfo_Output_Type)
is begin
Ada.Exceptions.Raise_Exception
(ARM_Output.Not_Valid_Error'Identity,
"Unexpected state: " & State_Type'Image (Output_Object.State));
end Unexpected_State;
procedure Escape_Put
(Output_Object : in Texinfo_Output_Type;
Char : in Character;
Preserve_Space : in Boolean := False)
is begin
-- Escape special chars
if Char = '@' then
Put (Output_Object.File, "@@");
elsif Char = '{' then
Put (Output_Object.File, "@{");
elsif Char = '}' then
Put (Output_Object.File, "@}");
elsif Char = ''' then
-- Avoid makeinfo converting '' into "
Put (Output_Object.File, "'@w{}");
elsif Char = '`' then
-- Avoid makeinfo converting `` into "
Put (Output_Object.File, "`@w{}");
elsif Char = '-' then
Put (Output_Object.File, "@minus{}");
elsif Char = ' ' and Preserve_Space then
-- Don't allow collapsing spaces
Put (Output_Object.File, "@w{ }");
elsif Char = '\' then
-- This confuses texi2dvi if not escaped.
Put (Output_Object.File, "@code{\}");
else
Put (Output_Object.File, Char);
end if;
end Escape_Put;
procedure Escape_Put
(Output_Object : in Texinfo_Output_Type;
Text : in String;
Preserve_Space : in Boolean := False)
is begin
for I in Text'Range loop
Escape_Put (Output_Object, Text (I), Preserve_Space);
end loop;
end Escape_Put;
procedure End_Title_Page (Output_Object : in out Texinfo_Output_Type)
is
use ARM_Contents;
procedure Put_Top_Menu_Item
(Title : in Title_Type;
Level : in Level_Type;
Clause_Number : in Clause_Number_Type;
Version : in ARM_Contents.Change_Version_Type;
Quit : out Boolean)
is
pragma Unreferenced (Version); -- we are only concerned with version 2
First_Part : String (1 .. 14); -- Get all Titles aligned.
begin
Quit := False;
case Level is
when Section | Normative_Annex | Informative_Annex | Plain_Annex =>
Ada.Strings.Fixed.Move
(Source =>
"* " &
Make_Clause_Number (Level, Clause_Number) &
" ::",
Target => First_Part);
Put_Line (Output_Object.File, First_Part & Title);
when Unnumbered_Section | Clause | Subclause | Subsubclause =>
null;
when ARM_Contents.Dead_Clause =>
raise Program_Error with "Dead_Clause header??";
-- No headers for dead clauses.
end case;
end Put_Top_Menu_Item;
procedure Put_Top_Menu is new For_Each (Put_Top_Menu_Item);
begin
New_Line (Output_Object.File); -- Terminate unneeded "@center"
Put_Line (Output_Object.File, "@menu");
Put_Line (Output_Object.File, "* Front Matter:: Copyright, Foreword, etc."); -- Not a section in ARM sources
Put_Top_Menu;
Put_Line (Output_Object.File, "* Index :: Index"); -- Not in ARM sources
Put_Line (Output_Object.File, "@end menu");
-- @node current
Put_Line (Output_Object.File, "@node Front Matter");
Put_Line (Output_Object.File, "@chapter Front Matter");
end End_Title_Page;
procedure Get_Clause_Section
(Clause_String : in String;
Section_Number : out ARM_Contents.Section_Number_Type;
Clause_Integer : out Natural)
is
-- This is a partial inverse of ARM_Contents.Make_Clause_Number.
--
-- Clause_String has "section.clause.subclause", possibly no subclause.
--
-- "section" can be a number, a letter "N", or "Annex N", where
--
-- 'N' = Character'Val (Character'Pos('A') + (Section_Number - ANNEX_START)
Section_Dot : constant Natural := Ada.Strings.Fixed.Index (Source => Clause_String, Pattern => ".");
Clause_Dot : constant Natural := Ada.Strings.Fixed.Index
(Source => Clause_String (Section_Dot + 1 .. Clause_String'Last),
Pattern => ".");
use type ARM_Contents.Section_Number_Type;
begin
if Section_Dot = 8 then
-- Section is "Annex N"
Section_Number := ARM_Contents.ANNEX_START +
Character'Pos (Clause_String (Clause_String'First + 6)) - Character'Pos ('A');
elsif Character'Pos (Clause_String (Clause_String'First)) >= Character'Pos ('A') then
-- Section is letter.
Section_Number := ARM_Contents.ANNEX_START +
Character'Pos (Clause_String (Clause_String'First)) - Character'Pos ('A');
else
Section_Number := ARM_Contents.Section_Number_Type'Value
(Clause_String (Clause_String'First .. Section_Dot - 1));
end if;
if Clause_Dot = 0 then
Clause_Integer := Natural'Value
(Clause_String (Section_Dot + 1 .. Clause_String'Last));
else
Clause_Integer := Natural'Value
(Clause_String (Section_Dot + 1 .. Clause_Dot - 1));
end if;
end Get_Clause_Section;
procedure Handle_Indent
(Output_Object : in Texinfo_Output_Type;
Texinfo_Item : in String;
Extra_Indent : in ARM_Output.Paragraph_Indent_Type := 0)
is
use type ARM_Output.Paragraph_Indent_Type;
begin
for I in 1 .. Output_Object.Indent + Extra_Indent loop
Put_Line (Output_Object.File, Texinfo_Item);
end loop;
end Handle_Indent;
procedure Add_To_Column_Item (Output_Object : in out Texinfo_Output_Type; Text : in String)
is begin
if Output_Object.Column_Text (Output_Object.Current_Column) = null or else
Output_Object.Column_Text (Output_Object.Current_Column).Row /= Output_Object.Current_Row
then
-- Start a new row.
Output_Object.Column_Text (Output_Object.Current_Column) :=
new Column_Text_Item_Type'
(Text => (others => ' '),
Length => 0,
Row => Output_Object.Current_Row,
Next => Output_Object.Column_Text (Output_Object.Current_Column));
end if;
if Output_Object.Column_Text (Output_Object.Current_Column).Length + Text'Length >
Output_Object.Column_Text (Output_Object.Current_Column).Text'Length
then
Ada.Exceptions.Raise_Exception
(ARM_Output.Not_Valid_Error'Identity,
"Column item full, but more text: " &
Output_Object.Column_Text (Output_Object.Current_Column).Text
(1 .. Output_Object.Column_Text (Output_Object.Current_Column).Length));
else
declare
Current_Text : Column_Text_Item_Type renames Output_Object.Column_Text (Output_Object.Current_Column).all;
begin
Current_Text.Text (Current_Text.Length + 1 .. Current_Text.Length + Text'Length) := Text;
Current_Text.Length := Current_Text.Length + Text'Length;
if Output_Object.Column_Widths (Output_Object.Current_Column) < Current_Text.Length then
Output_Object.Column_Widths (Output_Object.Current_Column) := Current_Text.Length;
end if;
end;
end if;
end Add_To_Column_Item;
procedure Pad_Columns (Output_Object : in out Texinfo_Output_Type)
-- Ensure that all columns have the same number of (possibly
-- empty) rows, for table headers.
is
Item : Column_Text_Ptr;
First_New_Row : Natural;
begin
for Col in 1 .. Output_Object.Column_Count loop
Item := Output_Object.Column_Text (Col);
if Item = null then
First_New_Row := 1;
else
First_New_Row := Item.Row + 1;
end if;
for I in First_New_Row .. Output_Object.Max_Row loop
Output_Object.Column_Text (Col) :=
new Column_Text_Item_Type'
(Text => (others => ' '),
Length => 1,
Row => I,
Next => Output_Object.Column_Text (Col));
end loop;
end loop;
end Pad_Columns;
procedure Output_Column_Widths (Output_Object : in out Texinfo_Output_Type)
is begin
New_Line (Output_Object.File);
Put (Output_Object.File, "@multitable ");
for I in 1 .. Output_Object.Column_Count loop
Put
(Output_Object.File,
" {" &
String'(1 .. Output_Object.Column_Widths (I) => 'w') &
"}");
end loop;
end Output_Column_Widths;
procedure Output_Columns (Output_Object : in out Texinfo_Output_Type)
is
Row : Natural := 1;
Item : Column_Text_Ptr;
Temp : Column_Text_Ptr;
begin
Rows :
loop
New_Line (Output_Object.File);
Put (Output_Object.File, "@item ");
-- For all columns, output the items for this row. Note that
-- the last row is at the front of each column list; the
-- first row is at the end. We delete the rows as we output
-- them, so the one we want is always at the end of the
-- column list.
Columns :
for Col in 1 .. Output_Object.Column_Count loop
Item := Output_Object.Column_Text (Col);
if Item = null then
-- Previously finished column
null;
elsif Item.Next = null then
-- This is the last item in the column.
if Item.Row /= Row then
-- This column is empty for this row.
Item := null;
else
-- Output Item, and mark that we're done outputing
-- this column.
Output_Object.Column_Text (Col) := null;
end if;
else
-- Find first item for this row in the column.
while Item.Next /= null and then Item.Next.Row /= Row loop
Item := Item.Next;
end loop;
-- Output Item.Next, take it out of list.
Temp := Item;
Item := Item.Next;
Temp.Next := null;
end if;
if Item /= null then
-- Output the item
Escape_Put (Output_Object, Item.Text (1 .. Item.Length), Preserve_Space => True);
Free (Item);
if Col /= Output_Object.Column_Count then
Put (Output_Object.File, " @tab ");
end if;
else
-- This column is empty for this row
if Col < Output_Object.Column_Count then
Put (Output_Object.File, " @tab ");
end if;
end if;
end loop Columns;
if Output_Object.Column_Text = Column_Text_Ptrs_Type'(others => null) then
-- We've output everything.
exit Rows;
end if;
-- End the row:
Row := Row + 1;
end loop Rows;
end Output_Columns;
procedure Index_Menu (Output_Object : in out Texinfo_Output_Type)
is begin
Put_Line (Output_Object.File, "@menu");
Put_Line (Output_Object.File, "* operators::");
Put_Line (Output_Object.File, "* A::");
Put_Line (Output_Object.File, "* B::");
Put_Line (Output_Object.File, "* C::");
Put_Line (Output_Object.File, "* D::");
Put_Line (Output_Object.File, "* E::");
Put_Line (Output_Object.File, "* F::");
Put_Line (Output_Object.File, "* G::");
Put_Line (Output_Object.File, "* H::");
Put_Line (Output_Object.File, "* I::");
Put_Line (Output_Object.File, "* J::");
Put_Line (Output_Object.File, "* K::");
Put_Line (Output_Object.File, "* L::");
Put_Line (Output_Object.File, "* M::");
Put_Line (Output_Object.File, "* N::");
Put_Line (Output_Object.File, "* O::");
Put_Line (Output_Object.File, "* P::");
Put_Line (Output_Object.File, "* Q::");
Put_Line (Output_Object.File, "* R::");
Put_Line (Output_Object.File, "* S::");
Put_Line (Output_Object.File, "* T::");
Put_Line (Output_Object.File, "* U::");
Put_Line (Output_Object.File, "* V::");
Put_Line (Output_Object.File, "* W::");
Put_Line (Output_Object.File, "* X::");
Put_Line (Output_Object.File, "* Y::");
-- Put_Line (Output_Object.File, "* Z::"); -- VERSION: No entries in Z
Put_Line (Output_Object.File, "@end menu");
-- @node current
Put_Line (Output_Object.File, "@node " & Operators_Clause);
Put_Line (Output_Object.File, "@section operators");
end Index_Menu;
----------
-- Public subprograms. Alphabetical order
procedure AI_Reference
(Output_Object : in out Texinfo_Output_Type;
Text : in String;
AI_Number : in String)
is begin
Ordinary_Text (Output_Object, AI_Number & Text);
end AI_Reference;
procedure Category_Header
(Output_Object : in out Texinfo_Output_Type;
Header_Text : String)
is begin
Check_Not_In_Paragraph (Output_Object);
-- Can't be in a multi-column setting.
--
-- Don't use @heading; that causes a weird underline in info,
-- that isn't centered!
Put_Line (Output_Object.File, "@center @emph{" & Header_Text & "}");
New_Line (Output_Object.File, 2);
end Category_Header;
procedure Clause_Header
(Output_Object : in out Texinfo_Output_Type;
Header_Text : in String;
Level : in ARM_Contents.Level_Type;
Clause_Number : in String;
Top_Level_Subdivision_Name : in ARM_Output.Top_Level_Subdivision_Name_Kind;
No_Page_Break : in Boolean := False)
is
pragma Unreferenced (No_Page_Break);
pragma Unreferenced (Top_Level_Subdivision_Name);
Title : constant String := Clause_Number & " " & Header_Text;
use ARM_Contents;
Section_Number : Section_Number_Type;
Clause_Integer : Natural;
procedure Put_Clause_Menu_Item
(Item_Title : in Title_Type;
Item_Level : in Level_Type;
Item_Clause_Number : in Clause_Number_Type;
Version : in ARM_Contents.Change_Version_Type;
Quit : out Boolean)
is
pragma Unreferenced (Version); -- only version 2
First_Part : String (1 .. 14); -- Get all Titles aligned.
begin
Quit := False;
case Item_Level is
when Section | Unnumbered_Section |
Normative_Annex | Informative_Annex | Plain_Annex |
Subclause | Subsubclause =>
-- We are doing Clause here
null;
when Clause =>
if Item_Clause_Number.Section < Section_Number then
null;
elsif Item_Clause_Number.Section = Section_Number then
Ada.Strings.Fixed.Move
(Source =>
"* " &
Make_Clause_Number (Item_Level, Item_Clause_Number) &
" ::",
Target => First_Part);
Put_Line (Output_Object.File, First_Part & Item_Title);
else
Quit := True;
end if;
when Dead_Clause =>
raise Program_Error with "Dead Clause in menu??"; -- No dead clauses should be output.
end case;
end Put_Clause_Menu_Item;
procedure Put_Clause_Menu is new For_Each (Put_Clause_Menu_Item);
procedure Put_Subclause_Menu_Item
(Item_Title : in Title_Type;
Item_Level : in Level_Type;
Item_Clause_Number : in Clause_Number_Type;
Version : in ARM_Contents.Change_Version_Type;
Quit : out Boolean)
is
pragma Unreferenced (Version); -- only version 2
First_Part : String (1 .. 14); -- Get all Titles aligned.
begin
Quit := False;
case Item_Level is
when Section | Unnumbered_Section |
Normative_Annex | Informative_Annex | Plain_Annex |
Clause | Subsubclause =>
-- We are doing Subclause here
null;
when Subclause =>
if Item_Clause_Number.Section < Section_Number then
null;
elsif Item_Clause_Number.Section = Section_Number then
if Item_Clause_Number.Clause < Clause_Integer then
null;
elsif Item_Clause_Number.Clause = Clause_Integer then
Ada.Strings.Fixed.Move
(Source =>
"* " &
Make_Clause_Number (Item_Level, Item_Clause_Number) &
" ::",
Target => First_Part);
Put_Line (Output_Object.File, First_Part & Item_Title);
else
Quit := True;
end if;
else
Quit := True;
end if;
when Dead_Clause =>
raise Program_Error with "Dead clause in submenu??"; -- No dead clauses should be output.
end case;
end Put_Subclause_Menu_Item;
procedure Put_Subclause_Menu is new For_Each (Put_Subclause_Menu_Item);
begin
Check_Not_In_Paragraph (Output_Object);
-- Handle special cases
if Clause_Number = "" and Header_Text = "Table of Contents" then
-- Actual contents output in TOC_Marker below.
return;
elsif Header_Text = "The Standard Libraries" then
-- This section has no content; don't confuse makeinfo.
return;
elsif Header_Text = Index_Clause_Name then
Put_Line (Output_Object.File, "@node " & Index_Clause_Name);
Put_Line (Output_Object.File, "@chapter Index");
Output_Object.State := Index_Start;
return;
end if;
case Level is
when Section | Normative_Annex | Informative_Annex | Plain_Annex =>
-- Menu of these done at @node Top
null;
when Unnumbered_Section =>
-- Unnumbered sections are not in ARM_Contents, but there's
-- currently only one of them, so they are not worth adding;
-- just hard-code the menu here.
Get_Clause_Section (Clause_Number, Section_Number, Clause_Integer);
if Section_Number = 0 and Clause_Integer = 1 then
Put_Line (Output_Object.File, "@menu");
Put_Line (Output_Object.File, "* 0.1 :: Foreword to this version of the Ada Reference Manual");
Put_Line (Output_Object.File, "* 0.2 :: Foreword");
Put_Line (Output_Object.File, "* 0.3 :: Introduction");
Put_Line (Output_Object.File, "* 0.99 :: International Standard");
Put_Line (Output_Object.File, "@end menu");
end if;
when Clause =>
-- Output menu of Clauses in this section, if we haven't already
Get_Clause_Section (Clause_Number, Section_Number, Clause_Integer);
if Output_Object.Menu_Section /= Section_Number then
Put_Line (Output_Object.File, "@menu");
Put_Clause_Menu;
Put_Line (Output_Object.File, "@end menu");
Output_Object.Menu_Section := Section_Number;
Output_Object.Menu_Clause := 0;
end if;
when Subclause =>
-- Output menu of Subclauses in this Clause, if we haven't already
Get_Clause_Section (Clause_Number, Section_Number, Clause_Integer);
if Output_Object.Menu_Section = Section_Number and
Output_Object.Menu_Clause /= Clause_Integer
then
Put_Line (Output_Object.File, "@menu");
Put_Subclause_Menu;
Put_Line (Output_Object.File, "@end menu");
Output_Object.Menu_Clause := Clause_Integer;
end if;
when Subsubclause =>
Ada.Exceptions.Raise_Exception
(ARM_Output.Not_Valid_Error'Identity,
"Clause_Header: Subsubclause");
when Dead_Clause =>
Ada.Exceptions.Raise_Exception
(ARM_Output.Not_Valid_Error'Identity,
"Clause_Header: Dead_clause");
end case;
Put_Line (Output_Object.File, "@node " & Clause_Number);
case Level is
when Section =>
Put_Line (Output_Object.File, "@chapter " & Title);
when Normative_Annex | Informative_Annex | Plain_Annex =>
Put_Line (Output_Object.File, "@chapter " & Title);
when Clause | Unnumbered_Section =>
Put_Line (Output_Object.File, "@section " & Title);
when Subclause =>
Put_Line (Output_Object.File, "@subsection " & Title);
when Subsubclause =>
Put_Line (Output_Object.File, "@subsubsection " & Title);
when Dead_Clause =>
raise Program_Error with "Dead_Clause in header?"; -- No output of dead clauses.
end case;
end Clause_Header;
procedure Clause_Reference
(Output_Object : in out Texinfo_Output_Type;
Text : in String;
Clause_Number : in String)
is begin
case Output_Object.State is
when Contents =>
null;
when Multi_Column | Table_Header =>
-- If this happens, we need to store escaped text in columns.
Ada.Exceptions.Raise_Exception
(ARM_Output.Not_Valid_Error'Identity,
"clause reference in multi-column");
when Normal =>
if Text = Clause_Number then
Put
(Output_Object.File,
"@ref{" &
Clause_Number &
"}");
else
Put
(Output_Object.File,
"@ref{" &
Clause_Number &
"} " &
Text);
end if;
when Title | Index_Start | Index =>
Unexpected_State (Output_Object);
end case;
end Clause_Reference;
procedure Close (Output_Object : in out Texinfo_Output_Type)
is begin
Check_Valid (Output_Object);
Put_Line (Output_Object.File, "@bye");
Close (Output_Object.File);
Output_Object.Is_Valid := False;
end Close;
procedure Create
(Output_Object : in out Texinfo_Output_Type;
File_Prefix : in String;
Output_Path : in String;
Change_Version : in ARM_Contents.Change_Version_Type;
Title : in String)
is
File_Name : constant String := Output_Path &
Ada.Strings.Fixed.Trim (File_Prefix, Ada.Strings.Right) &
".texinfo";
begin
if Output_Object.Is_Valid then
Ada.Exceptions.Raise_Exception
(ARM_Output.Not_Valid_Error'Identity,
"Already valid object");
end if;
Output_Object.Is_Valid := True;
Create (Output_Object.File, Out_File, File_Name);
Put_Line (Output_Object.File, "\input texinfo");
Put_Line (Output_Object.File, "@documentencoding ISO-8859-1");
Put_Line (Output_Object.File, "@dircategory GNU Ada tools");
Put_Line (Output_Object.File, "@direntry");
case Change_Version is
when '2' =>
Put_Line (Output_Object.File, "* Ada Reference Manual: (arm2005).");
Put_Line (Output_Object.File, "* Annotated ARM: (arm2005).");
when '3' =>
Put_Line (Output_Object.File, "* Ada Reference Manual: (arm2012).");
Put_Line (Output_Object.File, "* Annotated ARM: (arm2012).");
when '4' =>
Put_Line (Output_Object.File, "* Ada Reference Manual TC1: (arm2012).");
Put_Line (Output_Object.File, "* Annotated ARM TC1: (arm2012).");
when others =>
Ada.Exceptions.Raise_Exception
(ARM_Output.Not_Valid_Error'Identity,
"unsupported Change_Version");
end case;
Put_Line (Output_Object.File, "@end direntry");
Put_Line (Output_Object.File, "@settitle " & Title);
Put_Line (Output_Object.File, "@paragraphindent none");
Put_Line (Output_Object.File, "@exampleindent" & Integer'Image (Indentation));
Put_Line (Output_Object.File, "@node Top");
Put_Line (Output_Object.File, "@top " & Title);
Output_Object.State := ARM_Texinfo.Title;
Output_Object.First_Word_Last := 0;
end Create;
procedure DR_Reference
(Output_Object : in out Texinfo_Output_Type;
Text : in String;
DR_Number : in String)
is begin
Ordinary_Text (Output_Object, DR_Number & Text);
end DR_Reference;
procedure End_Hang_Item (Output_Object : in out Texinfo_Output_Type)
is
use ARM_Output;
begin
Output_Object.End_Hang_Seen := True;
case Output_Object.Style is
when Normal |
Wide_Above |
Small |
Small_Wide_Above |
Header |
Small_Header |
Syntax_Summary =>
Handle_Indent (Output_Object, "@quotation");
when Index |
Title =>
null;
when Examples |
Small_Examples |
Swiss_Examples |
Small_Swiss_Examples =>
Handle_Indent (Output_Object, "@example");
when Bulleted |
Small_Bulleted =>
Handle_Indent (Output_Object, "@itemize");
when Nested_Bulleted |
Small_Nested_Bulleted =>
Handle_Indent (Output_Object, "@itemize", Extra_Indent => 1);
when Enumerated |
Small_Enumerated =>
-- Number has just been output; start text.
Put (Output_Object.File, "@w{ }");
when Giant_Hanging |
Small_Giant_Hanging |
Wide_Hanging |
Small_Wide_Hanging |
Medium_Hanging |
Small_Medium_Hanging |
Narrow_Hanging |
Small_Narrow_Hanging |
Hanging_in_Bulleted |
Small_Hanging_in_Bulleted =>
New_Line (Output_Object.File);
Handle_Indent (Output_Object, "@quotation");
end case;
end End_Hang_Item;
procedure Text_Format
(Output_Object : in out Texinfo_Output_Type;
Format : in ARM_Output.Format_Type)
is begin
-- We only handle italic, for annotated syntax item names
if Format.Italic /= Output_Object.Format.Italic then
-- Info format does not support fonts, so we use <>
Put (Output_Object.File, (if Format.Italic then '<' else '>'));
end if;
Output_Object.Format := Format;
end Text_Format;
procedure End_Paragraph (Output_Object : in out Texinfo_Output_Type)
is
use ARM_Output;
begin
Output_Object.In_Paragraph := False;
case Output_Object.State is
when Contents =>
null;
when Multi_Column =>
-- Skip a row, to separate paragraphs in a column.
Output_Object.Current_Row := Output_Object.Current_Row + 2;
when Title =>
if Output_Object.Line_Empty then
null;
else
New_Line (Output_Object.File, 2);
Put (Output_Object.File, "@center ");
Output_Object.Line_Empty := True;
end if;
when Normal =>
case Output_Object.Style is
when Normal |
Wide_Above |
Small |
Small_Wide_Above |
Header |
Small_Header |
Syntax_Summary =>
New_Line (Output_Object.File);
Handle_Indent (Output_Object, "@end quotation");
New_Line (Output_Object.File);
when Index |
Title =>
New_Line (Output_Object.File, 2);
when Examples |
Small_Examples |
Swiss_Examples |
Small_Swiss_Examples =>
New_Line (Output_Object.File);
Handle_Indent (Output_Object, "@end example");
New_Line (Output_Object.File);
when Bulleted |
Small_Bulleted =>
New_Line (Output_Object.File);
Handle_Indent (Output_Object, "@end itemize");
New_Line (Output_Object.File);
when Nested_Bulleted |
Small_Nested_Bulleted =>
New_Line (Output_Object.File);
Handle_Indent (Output_Object, "@end itemize", Extra_Indent => 1);
New_Line (Output_Object.File);
when Enumerated |
Small_Enumerated =>
New_Line (Output_Object.File);
Handle_Indent (Output_Object, "@end itemize");
New_Line (Output_Object.File);
when Giant_Hanging |
Small_Giant_Hanging |
Wide_Hanging |
Small_Wide_Hanging |
Medium_Hanging |
Small_Medium_Hanging |
Narrow_Hanging |
Small_Narrow_Hanging |
Hanging_in_Bulleted |
Small_Hanging_in_Bulleted =>
New_Line (Output_Object.File);
if Output_Object.End_Hang_Seen then
Handle_Indent (Output_Object, "@end quotation");
end if;
New_Line (Output_Object.File);
end case;
when Index_Start =>
Output_Object.State := Index;
Index_Menu (Output_Object);
when Index =>
-- Keep index items tightly grouped.
Put_Line (Output_Object.File, "@*");
when Table_Header =>
Unexpected_State (Output_Object);
end case;
end End_Paragraph;
procedure Hard_Space (Output_Object : in out Texinfo_Output_Type)
is begin
case Output_Object.State is
when Contents =>
null;
when Multi_Column | Table_Header =>
-- Can't do line breaks in columns
Add_To_Column_Item (Output_Object, " ");
when Title =>
if Output_Object.Line_Empty then
null;
else
Put (Output_Object.File, "@w{ }");
end if;
when Normal | Index_Start | Index =>
Put (Output_Object.File, "@w{ }");
end case;
end Hard_Space;
procedure Index_Line_Break
(Output_Object : in out Texinfo_Output_Type;
Clear_Keep_with_Next : in Boolean)
is
pragma Unreferenced (Clear_Keep_with_Next);
begin
Put_Line (Output_Object.File, "@*");
end Index_Line_Break;
procedure Index_Reference
(Output_Object : in out Texinfo_Output_Type;
Text : in String;
Index_Key : in Natural;
Clause_Number : in String)
is
pragma Unreferenced (Clause_Number);
-- Text is clause_number & paragraph number (optional).
begin
Put (Output_Object.File, "@ref{" & Integer'Image (Index_Key) & ", " & Text & "}");
end Index_Reference;
procedure Index_Target
(Output_Object : in out Texinfo_Output_Type;
Index_Key : in Natural)
is begin
-- Add an empty non-break object, because @anchor ignores
-- whitespace after it, which often occurs in the current
-- Scribe-like source.
Put (Output_Object.File, "@anchor{" & Integer'Image (Index_Key) & "}@w{}");
end Index_Target;
procedure Line_Break (Output_Object : in out Texinfo_Output_Type)
is
use ARM_Output;
begin
case Output_Object.State is
when Title =>
if Output_Object.Line_Empty then
null;
else
Put_Line (Output_Object.File, "@*");
Output_Object.Line_Empty := True;
end if;
when Contents =>
null;
when Multi_Column | Table_Header =>
Output_Object.Current_Row := Output_Object.Current_Row + 1;
if Output_Object.Max_Row < Output_Object.Current_Row then
Output_Object.Max_Row := Output_Object.Current_Row;
end if;
when Index_Start =>
-- This doesn't happen
Ada.Exceptions.Raise_Exception
(ARM_Output.Not_Valid_Error'Identity,
"Line_Break Index_Start");
when Normal | Index =>
case Output_Object.Style is
when Normal |
Wide_Above |
Small |
Small_Wide_Above |
Header |
Small_Header |
Syntax_Summary |
Index |
Title =>
Put_Line (Output_Object.File, "@*");
when Examples |
Small_Examples |
Swiss_Examples |
Small_Swiss_Examples =>
New_Line (Output_Object.File);
when Bulleted |
Small_Bulleted |
Nested_Bulleted |
Small_Nested_Bulleted |
Enumerated |
Small_Enumerated |
Giant_Hanging |
Small_Giant_Hanging |
Wide_Hanging |
Small_Wide_Hanging |
Medium_Hanging |
Small_Medium_Hanging |
Narrow_Hanging |
Small_Narrow_Hanging |
Hanging_in_Bulleted |
Small_Hanging_in_Bulleted =>
Put_Line (Output_Object.File, "@*");
end case;
end case;
end Line_Break;
procedure Local_Link
(Output_Object : in out Texinfo_Output_Type;
Text : in String;
Target : in String;
Clause_Number : in String)
is
pragma Unreferenced (Target);
pragma Unreferenced (Clause_Number);
begin
-- These are typically references to words in the grammar
-- summary. Mildly useful, but the best we can do is:
--
-- "@ref{" & Target & "," & Text & "}"
--
-- makeinfo prepends 'see' and postpends '.', so it screws up
-- the text. For example, section 2.1 (1) ends up with "the
-- @ref{S0229, compilation}s." => "the see compilation: S0229."
-- Emacs info-mode suppresses the ': S0229', but not the 'see'
-- and the trailing '.'. So we just output the text.
Ordinary_Text (Output_Object, Text);
end Local_Link;
procedure Local_Link_End
(Output_Object : in out Texinfo_Output_Type;
Target : in String;
Clause_Number : in String)
is begin
-- These work better than local links, because they are not in
-- the middle of plurals. First use is section 3.1 (1).
Put (Output_Object.File, " (@pxref{" & Target & "," & Clause_Number & "})");
end Local_Link_End;
procedure Local_Link_Start
(Output_Object : in out Texinfo_Output_Type;
Target : in String;
Clause_Number : in String)
is
pragma Unreferenced (Output_Object);
pragma Unreferenced (Target);
pragma Unreferenced (Clause_Number);
begin
-- implemented in Local_Link_End
null;
end Local_Link_Start;
procedure Local_Target
(Output_Object : in out Texinfo_Output_Type;
Text : in String;
Target : in String)
is begin
-- Add an empty non-break object, because @anchor ignores
-- whitespace after it, which often occurs in the current
-- Scheme source.
Put (Output_Object.File, "@anchor{" & Target & "}@w{}");
Ordinary_Text (Output_Object, Text);
end Local_Target;
procedure New_Column (Output_Object : in out Texinfo_Output_Type)
is begin
if Output_Object.Column_Count >= 4 then
Output_Object.Current_Column := Output_Object.Current_Column + 1;
Output_Object.Current_Row := 1;
end if;
end New_Column;
procedure New_Page
(Output_Object : in out Texinfo_Output_Type;
Kind : ARM_Output.Page_Kind_Type := ARM_Output.Any_Page)
is
pragma Unreferenced (Kind);
pragma Unreferenced (Output_Object);
begin
-- No such thing in Info.
null;
end New_Page;
procedure Ordinary_Character
(Output_Object : in out Texinfo_Output_Type;
Char : in Character)
is
Copyright : constant String := "Copyright";
begin
case Output_Object.State is
when Contents =>
null;
when Multi_Column | Table_Header =>
Add_To_Column_Item (Output_Object, "" & Char);
when Title =>
-- Check for end of title page; indicated by line starting with "Copyright"
if Output_Object.Line_Empty then
if Output_Object.First_Word_Last > 0 then
if Copyright (Output_Object.First_Word_Last + 1) = Char then
Output_Object.First_Word_Last := Output_Object.First_Word_Last + 1;
Output_Object.First_Word (Output_Object.First_Word_Last) := Char;
if Output_Object.First_Word_Last = Copyright'Last then
End_Title_Page (Output_Object);
Output_Object.State := Normal;
Ordinary_Text (Output_Object, Output_Object.First_Word (1 .. Output_Object.First_Word_Last));
end if;
else
-- First word is not Copyright; output it
Ordinary_Text (Output_Object, Output_Object.First_Word (1 .. Output_Object.First_Word_Last));
Output_Object.Line_Empty := False;
end if;
else
-- No non-space seen yet
if Char = ' ' then
null;
elsif Char = Copyright (1) then
Output_Object.First_Word_Last := 1;
Output_Object.First_Word (1) := Char;
else
Escape_Put (Output_Object, Char);
Output_Object.Line_Empty := False;
end if;
end if;
else
-- Line already has stuff on it
Escape_Put (Output_Object, Char);
end if;
when Normal =>
Output_Object.Line_Empty := Char /= ' ';
Escape_Put (Output_Object, Char);
when Index_Start =>
Escape_Put (Output_Object, Char);
if Char = '&' then
-- give debugger a place to break
Put_Line ("first index entry");
end if;
when Index =>
case Char is
when ' ' | ',' | '[' | ']' =>
Put (Output_Object.File, Char);
when 'A' .. Last_Index_Clause =>
-- Index section heading
-- @node current
Put_Line (Output_Object.File, "@node " & Char);
-- Add non-break space so Emacs info will use big bold
-- font for single letter titles.
Put_Line (Output_Object.File, "@section " & Char & "@w{ }");
when others =>
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Unexpected char in Index: " & Char);
end case;
end case;
end Ordinary_Character;
procedure Ordinary_Text
(Output_Object : in out Texinfo_Output_Type;
Text : in String)
is begin
case Output_Object.State is
when Contents =>
null;
when Multi_Column | Table_Header =>
Add_To_Column_Item (Output_Object, Text);
when Normal | Title | Index_Start | Index =>
Output_Object.Line_Empty := False;
Escape_Put (Output_Object, Text);
end case;
end Ordinary_Text;
procedure Picture
(Output_Object : in out Texinfo_Output_Type;
Name : in String;
Descr : in String;
Alignment : in ARM_Output.Picture_Alignment;
Height, Width : in Natural;
Border : in ARM_Output.Border_Kind)
is
pragma Unreferenced (Border);
pragma Unreferenced (Width);
pragma Unreferenced (Height);
pragma Unreferenced (Alignment);
pragma Unreferenced (Name);
begin
Ada.Exceptions.Raise_Exception
(ARM_Output.Not_Valid_Error'Identity,
"Picture: " & Descr);
end Picture;
procedure Revised_Clause_Header
(Output_Object : in out Texinfo_Output_Type;
New_Header_Text : in String;
Old_Header_Text : in String;
Level : in ARM_Contents.Level_Type;
Clause_Number : in String;
Version : in ARM_Contents.Change_Version_Type;
Old_Version : in ARM_Contents.Change_Version_Type;
Top_Level_Subdivision_Name : in ARM_Output.Top_Level_Subdivision_Name_Kind;
No_Page_Break : in Boolean := False)
is
pragma Unreferenced (Version);
pragma Unreferenced (Old_Version);
pragma Unreferenced (Old_Header_Text);
begin
Clause_Header (Output_Object, New_Header_Text, Level, Clause_Number,
Top_Level_Subdivision_Name, No_Page_Break);
end Revised_Clause_Header;
procedure Section
(Output_Object : in out Texinfo_Output_Type;
Section_Title : in String;
Section_Name : in String)
is
pragma Unreferenced (Section_Name);
pragma Unreferenced (Section_Title);
pragma Unreferenced (Output_Object);
begin
-- This is redundant with the various Clause functions
null;
end Section;
procedure Separator_Line
(Output_Object : in out Texinfo_Output_Type;
Is_Thin : Boolean := True)
is begin
-- Can't be in a multi-column setting.
New_Line (Output_Object.File);
if Is_Thin then
Put_Line (Output_Object.File, "----------");
else
Put_Line (Output_Object.File, "==========");
end if;
end Separator_Line;
procedure Set_Columns
(Output_Object : in out Texinfo_Output_Type;
Number_of_Columns : in ARM_Output.Column_Count)
is begin
Check_Valid (Output_Object);
Check_Not_In_Paragraph (Output_Object);
-- 2 and 3 column formats are displayed without any columns.
-- This is mainly used for the syntax cross-reference and
-- index, and these definitely look better without columns.
--
-- 4 or more columns are output as a table. Note that we assume
-- such items are formated with explicit New_Column calls, and
-- do not contain any nested paragraph formats.
case Output_Object.State is
when Normal =>
if Number_of_Columns >= 4 then
Output_Object.State := Multi_Column;
Output_Object.Current_Column := 1;
Output_Object.Current_Row := 1;
Output_Object.Column_Widths := (others => 0);
-- Accumulate all column rows in Output_Text, then output
-- when done, so we can set the correct column width in
-- the header. Each column is a linked list of allocated
-- Column_Text_Item_Type.
else
null;
end if;
when Multi_Column =>
if Number_of_Columns = 1 then
-- Finished accumulating columns, output the columns as a table.
Output_Column_Widths (Output_Object);
Output_Columns (Output_Object);
New_Line (Output_Object.File);
Put_Line (Output_Object.File, "@end multitable");
New_Line (Output_Object.File);
Output_Object.State := Normal;
else
Ada.Exceptions.Raise_Exception
(ARM_Output.Not_Valid_Error'Identity, "New multi-column section before end of old");
end if;
when Index_Start | Index =>
null;
when Table_Header | Contents | Title =>
Unexpected_State (Output_Object);
end case;
Output_Object.Column_Count := Number_of_Columns;
end Set_Columns;
procedure Soft_Hyphen_Break (Output_Object : in out Texinfo_Output_Type)
is begin
Put (Output_Object.File, "@-");
end Soft_Hyphen_Break;
procedure Soft_Line_Break (Output_Object : in out Texinfo_Output_Type)
is begin
case Output_Object.State is
when Contents | Title =>
null;
when Normal | Index_Start | Index =>
Put (Output_Object.File, "@-");
when Multi_Column | Table_Header =>
Unexpected_State (Output_Object);
end case;
end Soft_Line_Break;
procedure Special_Character
(Output_Object : in out Texinfo_Output_Type;
Char : in ARM_Output.Special_Character_Type)
is begin
-- We use Ordinary_Text, so this is output to columns when appropriate.
case Char is
when ARM_Output.EM_Dash =>
Ordinary_Text (Output_Object, "--");
when ARM_Output.EN_Dash =>
Ordinary_Text (Output_Object, "-"); -- used for '-' in binary_adding_operator
when ARM_Output.GEQ =>
Ordinary_Text (Output_Object, ">=");
when ARM_Output.LEQ =>
Ordinary_Text (Output_Object, "<=");
when ARM_Output.NEQ =>
Ordinary_Text (Output_Object, "/=");
when ARM_Output.PI =>
Ordinary_Text (Output_Object, "PI");
when ARM_Output.Left_Ceiling =>
case Output_Object.State is
when Multi_Column | Table_Header =>
Ada.Exceptions.Raise_Exception
(ARM_Output.Not_Valid_Error'Identity,
"Info does not support ceiling in multi-column");
when Contents =>
null;
when Normal | Index_Start | Index =>
Put (Output_Object.File, "@code{ceiling(");
when Title =>
Unexpected_State (Output_Object);
end case;
when ARM_Output.Right_Ceiling =>
case Output_Object.State is
when Multi_Column | Table_Header =>
Ada.Exceptions.Raise_Exception
(ARM_Output.Not_Valid_Error'Identity,
"Info does not support ceiling in multi-column");
when Contents =>
null;
when Normal | Index_Start | Index =>
Put (Output_Object.File, ")}");
when Title =>
Unexpected_State (Output_Object);
end case;
when ARM_Output.Left_Floor =>
case Output_Object.State is
when Multi_Column | Table_Header =>
Ada.Exceptions.Raise_Exception
(ARM_Output.Not_Valid_Error'Identity,
"Info does not support floor in multi-column");
when Contents =>
null;
when Normal | Index_Start | Index =>
Put (Output_Object.File, "@code{floor(");
when Title =>
Unexpected_State (Output_Object);
end case;
when ARM_Output.Right_Floor =>
case Output_Object.State is
when Multi_Column | Table_Header =>
Ada.Exceptions.Raise_Exception
(ARM_Output.Not_Valid_Error'Identity,
"Info does not support floor in multi-column");
when Contents =>
null;
when Normal | Index_Start | Index =>
Put (Output_Object.File, ")}");
when Title =>
Unexpected_State (Output_Object);
end case;
when ARM_Output.Thin_Space =>
Ordinary_Text (Output_Object, " ");
when ARM_Output.Left_Quote =>
Ordinary_Text (Output_Object, "`");
when ARM_Output.Right_Quote =>
Ordinary_Text (Output_Object, "'");
when ARM_Output.Left_Double_Quote =>
Ordinary_Text (Output_Object, """");
when ARM_Output.Right_Double_Quote =>
Ordinary_Text (Output_Object, """");
when ARM_Output.Small_Dotless_I =>
Ordinary_Text (Output_Object, "i");
when ARM_Output.Capital_Dotted_I =>
Ordinary_Text (Output_Object, "I");
end case;
end Special_Character;
procedure Start_Paragraph
(Output_Object : in out Texinfo_Output_Type;
Style : in ARM_Output.Paragraph_Style_Type;
Indent : in ARM_Output.Paragraph_Indent_Type;
Number : in String;
No_Prefix : in Boolean := False;
Tab_Stops : in ARM_Output.Tab_Info := ARM_Output.NO_TABS;
No_Breaks : in Boolean := False;
Keep_with_Next : in Boolean := False;
Space_After : in ARM_Output.Space_After_Type := ARM_Output.Normal;
Justification : in ARM_Output.Justification_Type := ARM_Output.Default)
is
pragma Unreferenced (Justification);
pragma Unreferenced (Space_After);
pragma Unreferenced (Keep_with_Next);
pragma Unreferenced (No_Breaks);
pragma Unreferenced (Tab_Stops);
use ARM_Output;
begin
Check_Valid (Output_Object);
Check_Not_In_Paragraph (Output_Object);
-- Note: makeinfo will do most of the formatting, so No_Breaks,
-- Keep_with_Next, Space_After, and Justification have no
-- effect here. In addition, info format has no support for
-- fonts, so the font aspects of Style are ignored as well. But
-- we try to respect the indentation and margin aspects.
-- TexInfo does not directly support tabs, but does use a fixed
-- font, so we could emulate them. But then we'd have to track
-- output characters; let's see if we really need it.
case Output_Object.State is
when Contents =>
null;
when Normal =>
if Number'Length > 0 then
Put_Line (Output_Object.File, Number & " @*");
end if;
Output_Object.In_Paragraph := True;
Output_Object.Style := Style;
Output_Object.Indent := Indent;
case Style is
when Normal |
Wide_Above |
Small |
Small_Wide_Above |
Header |
Small_Header |
Syntax_Summary =>
Handle_Indent (Output_Object, "@quotation");
when Index |
Title =>
null;
when Examples |
Small_Examples |
Swiss_Examples |
Small_Swiss_Examples =>
Handle_Indent (Output_Object, "@example");
when Bulleted |
Small_Bulleted =>
Handle_Indent (Output_Object, "@itemize @bullet");
if not No_Prefix then
Put (Output_Object.File, "@item ");
end if;
when Nested_Bulleted |
Small_Nested_Bulleted =>
Handle_Indent (Output_Object, "@itemize @bullet", Extra_Indent => 1);
if not No_Prefix then
Put (Output_Object.File, "@item ");
end if;
when Enumerated |
Small_Enumerated =>
Handle_Indent (Output_Object, "@itemize @w{}");
Put (Output_Object.File, "@item ");
when Giant_Hanging |
Small_Giant_Hanging |
Wide_Hanging |
Small_Wide_Hanging |
Medium_Hanging |
Small_Medium_Hanging |
Narrow_Hanging |
Small_Narrow_Hanging |
Hanging_in_Bulleted |
Small_Hanging_in_Bulleted =>
if No_Prefix then
-- Still in hanging part
Handle_Indent (Output_Object, "@quotation");
Output_Object.End_Hang_Seen := True;
else
Output_Object.End_Hang_Seen := False;
end if;
end case;
when Index_Start | Index | Title | Multi_Column | Table_Header =>
if Number'Length > 0 then
Unexpected_State (Output_Object);
end if;
Output_Object.In_Paragraph := True;
Output_Object.Style := Style;
Output_Object.Indent := Indent;
end case;
end Start_Paragraph;
procedure Start_Table
(Output_Object : in out Texinfo_Output_Type;
Columns : in ARM_Output.Column_Count;
First_Column_Width : in ARM_Output.Column_Count;
Last_Column_Width : in ARM_Output.Column_Count;
Alignment : in ARM_Output.Column_Text_Alignment;
No_Page_Break : in Boolean;
Has_Border : in Boolean;
Small_Text_Size : in Boolean;
Header_Kind : in ARM_Output.Header_Kind_Type)
is
pragma Unreferenced (Small_Text_Size);
pragma Unreferenced (Has_Border);
pragma Unreferenced (No_Page_Break);
pragma Unreferenced (Alignment);
pragma Unreferenced (Last_Column_Width);
pragma Unreferenced (First_Column_Width);
use ARM_Output;
begin
Output_Object.Column_Count := Columns;
case Header_Kind is
when Both_Caption_and_Header =>
New_Line (Output_Object.File);
-- Next text output will be the caption, which we don't
-- format in any special way (first example is F.3.2 (19)).
-- Then Table_Marker (End_Caption) is called, which will
-- start the actual table.
when Header_Only =>
-- Same as Table_Marker, End_Caption.
case Columns is
when 1 =>
Ada.Exceptions.Raise_Exception
(ARM_Output.Not_Valid_Error'Identity,
"Table with 1 column");
when 2 =>
-- @table doesn't work inside @display; PDFTex fails with @table here.
-- https://lists.gnu.org/archive/html/bug-texinfo/2004-10/txtJLetHrEhdc.txt
New_Line (Output_Object.File);
Put_Line (Output_Object.File, "@multitable {wwwwwwwwww} {wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww}");
Put (Output_Object.File, "@headitem ");
when others =>
New_Line (Output_Object.File);
Put (Output_Object.File, "@multitable");
Output_Object.State := Table_Header;
Output_Object.Current_Column := 1;
Output_Object.Current_Row := 1;
Output_Object.Max_Row := 0;
-- The next text output via Ordinary_Text or
-- Ordinary_Character is the table headers. We
-- capture them in Output_Object.Column_Text, and
-- use them to set the table column widths.
end case;
when No_Headers =>
null;
end case;
end Start_Table;
procedure Tab (Output_Object : in out Texinfo_Output_Type)
is begin
case Output_Object.State is
when Contents =>
null;
when Multi_Column | Table_Header =>
Ada.Exceptions.Raise_Exception
(ARM_Output.Not_Valid_Error'Identity,
"Tab in multi-column");
when Title =>
if Output_Object.Line_Empty then
null;
else
Put (Output_Object.File, "@w{ }");
end if;
when Normal | Index_Start | Index =>
-- Just three spaces for now, for indented trees
Put (Output_Object.File, "@w{ }");
end case;
end Tab;
procedure Table_Marker
(Output_Object : in out Texinfo_Output_Type;
Marker : in ARM_Output.Table_Marker_Type)
is begin
case Marker is
when ARM_Output.End_Caption =>
-- Start the actual table
case Output_Object.Column_Count is
when 1 =>
Ada.Exceptions.Raise_Exception
(ARM_Output.Not_Valid_Error'Identity,
"Table with 1 column");
when 2 =>
New_Line (Output_Object.File);
Put_Line (Output_Object.File, "@multitable {wwwwwwwwww} {wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww}");
Put (Output_Object.File, "@headitem ");
when others =>
New_Line (Output_Object.File);
Put (Output_Object.File, "@multitable");
Output_Object.State := Table_Header;
Output_Object.Current_Column := 1;
Output_Object.Current_Row := 1;
Output_Object.Max_Row := 0;
-- The next text output via Ordinary_Text or
-- Ordinary_Character is the table headers. We
-- capture them in Output_Object.Column_Text, and
-- use them to set the table column widths.
end case;
when ARM_Output.End_Item =>
case Output_Object.State is
when Table_Header =>
Output_Object.Current_Column := Output_Object.Current_Column + 1;
Output_Object.Current_Row := 1;
when Normal =>
case Output_Object.Column_Count is
when 2 =>
New_Line (Output_Object.File);
Put (Output_Object.File, "@tab ");
when others =>
Put (Output_Object.File, " @tab ");
end case;
when Multi_Column | Contents | Title | Index_Start | Index =>
Unexpected_State (Output_Object);
end case;
when ARM_Output.End_Header =>
case Output_Object.State is
when Table_Header =>
Output_Object.State := Normal;
for I in 1 .. Output_Object.Column_Count loop
Put
(Output_Object.File,
" {" &
Output_Object.Column_Text (I).Text (1 .. Output_Object.Column_Text (I).Length) &
"}");
end loop;
New_Line (Output_Object.File);
Put (Output_Object.File, "@item ");
Pad_Columns (Output_Object);
Output_Columns (Output_Object);
New_Line (Output_Object.File);
Put (Output_Object.File, "@item ");
Output_Object.Current_Column := 1;
when Normal =>
-- A two-column table; header has been output
New_Line (Output_Object.File);
Put (Output_Object.File, "@item ");
when Contents | Multi_Column | Title | Index_Start | Index =>
Unexpected_State (Output_Object);
end case;
when ARM_Output.End_Row | ARM_Output.End_Row_Next_Is_Last =>
New_Line (Output_Object.File);
Put (Output_Object.File, "@item ");
Output_Object.Current_Column := 1;
when ARM_Output.End_Table =>
case Output_Object.Column_Count is
when 2 =>
New_Line (Output_Object.File);
Put_Line (Output_Object.File, "@end multitable");
when others =>
Put_Line (Output_Object.File, "@end multitable");
end case;
end case;
end Table_Marker;
procedure TOC_Marker
(Output_Object : in out Texinfo_Output_Type;
For_Start : in Boolean)
is begin
-- We use menus, not @contents (since makeinfo ignores
-- @contents in info mode). The menus (including the top menu)
-- are generated from data stored in ARM_Contents during the
-- scan pass.
if For_Start then
Output_Object.State := Contents;
-- Ignore futher output until For_Start = False.
else
Output_Object.State := Normal;
end if;
end TOC_Marker;
procedure Unicode_Character
(Output_Object : in out Texinfo_Output_Type;
Char : in ARM_Output.Unicode_Type)
is begin
-- Used in section 2.3 Identifiers examples, 2.5 character
-- literals examples, 2.6 string literals examples, 3.3.1
-- Object Declarations examples, 4.4 Expressions examples
Put (Output_Object.File, "[Unicode" & ARM_Output.Unicode_Type'Image (Char) & "]");
end Unicode_Character;
procedure URL_Link
(Output_Object : in out Texinfo_Output_Type;
Text : in String;
URL : in String)
is begin
Put (Output_Object.File, "@uref{" & URL & "," & Text & "}");
end URL_Link;
end ARM_Texinfo;
| 34.982637 | 119 | 0.571619 |
dcd8f1e0a45fe3ab2707f8f4b122b09276a6222b | 42 | ads | Ada | source/stm32.ads | Vovanium/stm32-ada | e0833747326d89fb16e492cd396bf49ba5a6734a | [
"MIT"
] | 1 | 2019-04-13T12:56:08.000Z | 2019-04-13T12:56:08.000Z | source/stm32.ads | Vovanium/stm32-ada | e0833747326d89fb16e492cd396bf49ba5a6734a | [
"MIT"
] | null | null | null | source/stm32.ads | Vovanium/stm32-ada | e0833747326d89fb16e492cd396bf49ba5a6734a | [
"MIT"
] | null | null | null | package STM32 is
pragma Pure;
end STM32;
| 10.5 | 16 | 0.761905 |
2067915385e319afc5542d6c083966ff4c0376ea | 6,673 | adb | Ada | regtests/gen-artifacts-xmi-tests.adb | Letractively/ada-gen | d06d03821057f9177f2350e32dd09e467df08612 | [
"Apache-2.0"
] | null | null | null | regtests/gen-artifacts-xmi-tests.adb | Letractively/ada-gen | d06d03821057f9177f2350e32dd09e467df08612 | [
"Apache-2.0"
] | null | null | null | regtests/gen-artifacts-xmi-tests.adb | Letractively/ada-gen | d06d03821057f9177f2350e32dd09e467df08612 | [
"Apache-2.0"
] | null | null | null | -----------------------------------------------------------------------
-- gen-xmi-tests -- Tests for xmi
-- Copyright (C) 2012 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- 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 Util.Test_Caller;
with Gen.Configs;
with Gen.Generator;
package body Gen.Artifacts.XMI.Tests is
use Ada.Strings.Unbounded;
package Caller is new Util.Test_Caller (Test, "Gen.XMI");
procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite) is
begin
Caller.Add_Test (Suite, "Test Gen.XMI.Read_UML_Configuration",
Test_Read_XMI'Access);
Caller.Add_Test (Suite, "Test Gen.XMI.Find_Element",
Test_Find_Element'Access);
Caller.Add_Test (Suite, "Test Gen.XMI.Find_Element",
Test_Find_Tag_Definition'Access);
end Add_Tests;
-- ------------------------------
-- Test reading the XMI files defines in the Dynamo UML configuration repository.
-- ------------------------------
procedure Test_Read_XMI (T : in out Test) is
procedure Check (Namespace : in String;
Name : in String;
Id : in String);
A : Artifact;
G : Gen.Generator.Handler;
C : constant String := Util.Tests.Get_Parameter ("config_dir", "config");
use type Gen.Model.XMI.Model_Element_Access;
procedure Check (Namespace : in String;
Name : in String;
Id : in String) is
Empty : Gen.Model.XMI.Model_Map.Map;
XMI_Id : constant Unbounded_String := To_Unbounded_String (Namespace & "#" & Id);
N : constant Gen.Model.XMI.Model_Element_Access := Gen.Model.XMI.Find (A.Nodes,
Empty,
XMI_Id);
begin
T.Assert (N /= null, "Cannot find UML element " & To_String (XMI_Id));
Util.Tests.Assert_Equals (T, Name, To_String (N.Name), "Invalid element name");
end Check;
begin
Gen.Generator.Initialize (G, Ada.Strings.Unbounded.To_Unbounded_String (C), False);
A.Read_Model (G.Get_Parameter (Gen.Configs.GEN_UML_DIR) & "/Dynamo.xmi", G);
-- ArgoUML Integer DataType
Check ("default-uml14.xmi", "Integer",
"-84-17--56-5-43645a83:11466542d86:-8000:000000000000087C");
-- ArgoUML String DataType
Check ("default-uml14.xmi", "String",
"-84-17--56-5-43645a83:11466542d86:-8000:000000000000087E");
-- ArgoUML documentation TagDefinition
Check ("default-uml14.xmi", "documentation",
".:000000000000087C");
-- ArgoUML type Stereotype
Check ("default-uml14.xmi", "type",
".:0000000000000842");
-- Persistence Table Stereotype
Check ("Dynamo.xmi", "Table",
"127-0-1-1--44304ba0:139c0f2a59c:-8000:0000000000001D4F");
Check ("Dynamo.xmi", "PK",
"127-0-1-1--44304ba0:139c0f2a59c:-8000:0000000000001D50");
Check ("Dynamo.xmi", "FK",
"127-0-1-1--44304ba0:139c0f2a59c:-8000:0000000000001F70");
Check ("Dynamo.xmi", "Bean",
"127-0-1-1--44304ba0:139c0f2a59c:-8000:0000000000001F72");
end Test_Read_XMI;
-- ------------------------------
-- Test searching an XMI element by using a qualified name.
-- ------------------------------
procedure Test_Find_Element (T : in out Test) is
A : Artifact;
G : Gen.Generator.Handler;
C : constant String := Util.Tests.Get_Parameter ("config_dir", "config");
use Gen.Model.XMI;
function Find_Stereotype is
new Gen.Model.XMI.Find_Element (Element_Type => Stereotype_Element,
Element_Type_Access => Stereotype_Element_Access);
begin
Gen.Generator.Initialize (G, Ada.Strings.Unbounded.To_Unbounded_String (C), False);
A.Read_Model (G.Get_Parameter (Gen.Configs.GEN_UML_DIR) & "/Dynamo.xmi", G);
declare
S : Gen.Model.XMI.Stereotype_Element_Access;
begin
S := Find_Stereotype (A.Nodes, "Dynamo.xmi", "ADO.Table", Gen.Model.XMI.BY_NAME);
T.Assert (S /= null, "Stereotype not found");
S := Find_Stereotype (A.Nodes, "Dynamo.xmi", "ADO.PK", Gen.Model.XMI.BY_NAME);
T.Assert (S /= null, "Stereotype not found");
S := Find_Stereotype (A.Nodes, "Dynamo.xmi", "ADO.FK", Gen.Model.XMI.BY_NAME);
T.Assert (S /= null, "Stereotype not found");
S := Find_Stereotype (A.Nodes, "Dynamo.xmi", "ADO.DataModel", Gen.Model.XMI.BY_NAME);
T.Assert (S /= null, "Stereotype not found");
S := Find_Stereotype (A.Nodes, "Dynamo.xmi", "AWA.Bean", Gen.Model.XMI.BY_NAME);
T.Assert (S /= null, "Stereotype not found");
end;
end Test_Find_Element;
-- Test searching an XMI Tag definition element by using its name.
procedure Test_Find_Tag_Definition (T : in out Test) is
A : Artifact;
G : Gen.Generator.Handler;
C : constant String := Util.Tests.Get_Parameter ("config_dir", "config");
use Gen.Model.XMI;
function Find_Tag_Definition is
new Gen.Model.XMI.Find_Element (Element_Type => Tag_Definition_Element,
Element_Type_Access => Tag_Definition_Element_Access);
begin
Gen.Generator.Initialize (G, Ada.Strings.Unbounded.To_Unbounded_String (C), False);
A.Read_Model (G.Get_Parameter (Gen.Configs.GEN_UML_DIR) & "/Dynamo.xmi", G);
declare
Tag : Tag_Definition_Element_Access;
begin
Tag := Find_Tag_Definition (A.Nodes, "Dynamo.xmi", "[email protected]",
Gen.Model.XMI.BY_NAME);
T.Assert (Tag /= null, "Tag definition not found");
end;
end Test_Find_Tag_Definition;
end Gen.Artifacts.XMI.Tests;
| 41.447205 | 94 | 0.587592 |
4a3f4e494dc4ad5b94411b5d9ab89a3428b2f885 | 4,056 | adb | Ada | software/hal/boards/pixracer_v1/stm32-board.adb | TUM-EI-RCS/StratoX | 5fdd04e01a25efef6052376f43ce85b5bc973392 | [
"BSD-3-Clause"
] | 12 | 2017-06-08T14:19:57.000Z | 2022-03-09T02:48:59.000Z | software/hal/boards/pixracer_v1/stm32-board.adb | TUM-EI-RCS/StratoX | 5fdd04e01a25efef6052376f43ce85b5bc973392 | [
"BSD-3-Clause"
] | 6 | 2017-06-08T13:13:50.000Z | 2020-05-15T09:32:43.000Z | software/hal/boards/pixracer_v1/stm32-board.adb | TUM-EI-RCS/StratoX | 5fdd04e01a25efef6052376f43ce85b5bc973392 | [
"BSD-3-Clause"
] | 3 | 2017-06-30T14:05:06.000Z | 2022-02-17T12:20:45.000Z | ------------------------------------------------------------------------------
-- --
-- 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. --
-- --
-- --
-- This file is based on: --
-- --
-- @file stm32f429i_discovery.c --
-- @author MCD Application Team --
-- @version V1.1.0 --
-- @date 19-June-2014 --
-- @brief This file provides set of firmware functions to manage Leds --
-- and push-button available on Pixracer V1 board Kit from --
-- --
-- COPYRIGHT(c) 2014 STMicroelectronics --
------------------------------------------------------------------------------
with HAL.SPI;
package body STM32.Board is
------------------
-- All_LEDs_Off --
------------------
procedure All_LEDs_Off is
begin
Set (All_LEDs); -- leds are invertedly driven
end All_LEDs_Off;
-----------------
-- All_LEDs_On --
-----------------
procedure All_LEDs_On is
begin
Clear (All_LEDs); -- leds are invertedly driven
end All_LEDs_On;
---------------------
-- Initialize_LEDs --
---------------------
procedure Initialize_LEDs is
Conf : GPIO_Port_Configuration;
begin
Enable_Clock (All_LEDs);
Conf.Mode := Mode_Out;
Conf.Output_Type := Push_Pull;
Conf.Speed := Speed_100MHz;
Conf.Resistors := Floating;
Configure_IO (All_LEDs, Conf);
end Initialize_LEDs;
end STM32.Board;
| 48.285714 | 78 | 0.458333 |
200333188c257506e6cfc40ee2dc5900a8196531 | 112 | ads | Ada | gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/specs/pack3_pkg.ads | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 7 | 2020-05-02T17:34:05.000Z | 2021-10-17T10:15:18.000Z | gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/specs/pack3_pkg.ads | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | null | null | null | gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/specs/pack3_pkg.ads | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 2 | 2020-07-27T00:22:36.000Z | 2021-04-01T09:41:02.000Z | -- { dg-excess-errors "no code generated" }
package Pack3_Pkg is
function F return Integer;
end Pack3_Pkg;
| 14 | 43 | 0.723214 |
dca4a79086e2890e8f216fc85e5e143e9e458d8f | 26,141 | ads | Ada | tools/aflex/src/misc_defs.ads | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 24 | 2016-11-29T06:59:41.000Z | 2021-08-30T11:55:16.000Z | tools/aflex/src/misc_defs.ads | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 2 | 2019-01-16T05:15:20.000Z | 2019-02-03T10:03:32.000Z | tools/aflex/src/misc_defs.ads | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 4 | 2017-07-18T07:11:05.000Z | 2020-06-21T03:02:25.000Z | -- Copyright (c) 1990 Regents of the University of California.
-- All rights reserved.
--
-- This software was developed by John Self of the Arcadia project
-- at the University of California, Irvine.
--
-- Redistribution and use in source and binary forms are permitted
-- provided that the above copyright notice and this paragraph are
-- duplicated in all such forms and that any documentation,
-- advertising materials, and other materials related to such
-- distribution and use acknowledge that the software was developed
-- by the University of California, Irvine. The name of the
-- University may not be used to endorse or promote products derived
-- from this software without specific prior written permission.
-- THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
-- IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
-- WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-- TITLE miscellaneous definitions
-- AUTHOR: John Self (UCI)
-- DESCRIPTION contains all global variables used in aflex.
-- also some subprograms which are commonly used.
-- NOTES The real purpose of this file is to contain all miscellaneous
-- items (functions, MACROS, variables definitions) which were at the
-- top level of flex.
-- $Header: /co/ua/self/arcadia/alex/ada/RCS/misc_defsS.a,v 1.8 90/01/04 13:39:
-- 33 self Exp Locker: self $
-- 02/16/98 Wolfgang Lohmann([email protected]):
-- Changed constant CSize from 127 to Pos(Last Char) for porting to gnat
with Ada.Strings.Unbounded;
with Ada.Strings.Wide_Wide_Maps;
with Ada.Strings.Wide_Wide_Unbounded;
with Ada.Unchecked_Deallocation;
with Ada.Wide_Wide_Text_IO;
with Matreshka.Internals.Unicode.Ucd;
with Unicode;
package MISC_DEFS is
use Ada.Strings.Unbounded;
-- UMASS CODES :
Ayacc_Extension_Flag : Boolean := False;
-- Indicates whether or not aflex generated codes will be
-- used by Ayacc extension. Ayacc extension has more power
-- in error recovery. True means that generated codes will
-- be used by Ayacc extension.
-- END OF UMASS CODES.
-- various definitions that were in parse.y
PAT, SCNUM, EPS, HEADCNT, TRAILCNT, ANYCCL, LASTCHAR, ACTVP, RULELEN : INTEGER
;
TRLCONTXT, XCLUFLG, CCLSORTED, VARLENGTH, VARIABLE_TRAIL_RULE : BOOLEAN;
MADEANY : BOOLEAN := FALSE; -- whether we've made the '.' character class
PREVIOUS_CONTINUED_ACTION : BOOLEAN; -- whether the previous rule's action wa
-- s '|'
-- These typees are needed for the various allocators.
type UNBOUNDED_INT_ARRAY is array ( INTEGER range <> ) of INTEGER;
type INT_PTR is access UNBOUNDED_INT_ARRAY;
type INT_STAR is access INTEGER;
type UNBOUNDED_INT_STAR_ARRAY is array ( INTEGER range <> ) of INT_PTR;
type INT_STAR_PTR is access UNBOUNDED_INT_STAR_ARRAY;
type UNBOUNDED_VSTRING_ARRAY is
array (Integer range <>)
of Ada.Strings.Wide_Wide_Unbounded.Unbounded_Wide_Wide_String;
type VSTRING_PTR is access UNBOUNDED_VSTRING_ARRAY;
type BOOLEAN_ARRAY is array ( INTEGER range <> ) of BOOLEAN;
type BOOLEAN_PTR is access BOOLEAN_ARRAY;
type CHAR_ARRAY is array ( INTEGER range <> ) of CHARACTER;
type CHAR_PTR is access CHAR_ARRAY;
type Unicode_Character_Array is
array (Integer range <>) of Unicode.Unicode_Character;
type Unicode_Character_Array_Access is access Unicode_Character_Array;
-- different types of states; values are useful as masks, as well, for
-- routines like check_trailing_context()
type STATE_ENUM is (STATE_NORMAL, STATE_TRAILING_CONTEXT);
type UNBOUNDED_STATE_ENUM_ARRAY is array ( INTEGER range <> ) of STATE_ENUM;
type STATE_ENUM_PTR is access UNBOUNDED_STATE_ENUM_ARRAY;
-- different types of rules
type RULE_ENUM is (RULE_NORMAL, RULE_VARIABLE);
type UNBOUNDED_RULE_ENUM_ARRAY is array ( INTEGER range <> ) of RULE_ENUM;
type RULE_ENUM_PTR is access UNBOUNDED_RULE_ENUM_ARRAY;
type DFAACC_TYPE is
record
DFAACC_SET : INT_PTR;
DFAACC_STATE : INTEGER;
end record;
type UNBOUNDED_DFAACC_ARRAY is array ( INTEGER range <> ) of DFAACC_TYPE;
type DFAACC_PTR is access UNBOUNDED_DFAACC_ARRAY;
-- special chk[] values marking the slots taking by end-of-buffer and action
-- numbers
EOB_POSITION : constant INTEGER := - 1;
ACTION_POSITION : constant INTEGER := - 2;
-- number of data items per line for -f output
NUMDATAITEMS : constant INTEGER := 10;
-- number of lines of data in -f output before inserting a blank line for
-- readability.
NUMDATALINES : constant INTEGER := 10;
-- transition_struct_out() definitions
TRANS_STRUCT_PRINT_LENGTH : constant INTEGER := 15;
-- returns true if an nfa state has an epsilon out-transition slot
-- that can be used. This definition is currently not used.
function FREE_EPSILON ( STATE : in INTEGER) return BOOLEAN;
-- returns true if an nfa state has an epsilon out-transition character
-- and both slots are free
function SUPER_FREE_EPSILON (STATE : in INTEGER) return BOOLEAN;
-- maximum number of NFA states that can comprise a DFA state. It's real
-- big because if there's a lot of rules, the initial state will have a
-- huge epsilon closure.
INITIAL_MAX_DFA_SIZE : constant INTEGER := 750;
MAX_DFA_SIZE_INCREMENT : constant INTEGER := 750;
-- a note on the following masks. They are used to mark accepting numbers
-- as being special. As such, they implicitly limit the number of accepting
-- numbers (i.e., rules) because if there are too many rules the rule numbers
-- will overload the mask bits. Fortunately, this limit is \large/ (0x2000 ==
-- 8192) so unlikely to actually cause any problems. A check is made in
-- new_rule() to ensure that this limit is not reached.
-- mask to mark a trailing context accepting number
-- #define YY_TRAILING_MASK 0x2000
YY_TRAILING_MASK : constant INTEGER := 16#2000#;
-- mask to mark the accepting number of the "head" of a trailing context rule
-- #define YY_TRAILING_HEAD_MASK 0x4000
YY_TRAILING_HEAD_MASK : constant INTEGER := 16#4000#;
-- maximum number of rules, as outlined in the above note
MAX_RULE : constant INTEGER := YY_TRAILING_MASK - 1;
-- NIL must be 0. If not, its special meaning when making equivalence classes
-- (it marks the representative of a given e.c.) will be unidentifiable
NIL : constant INTEGER := 0;
JAM : constant INTEGER := - 1; -- to mark a missing DFA transition
NO_TRANSITION : constant INTEGER := NIL;
UNIQUE : constant INTEGER := - 1; -- marks a symbol as an e.c. representative
INFINITY : constant INTEGER := - 1; -- for x{5,} constructions
-- size of input alphabet - should be size of ASCII set
--CSIZE : constant INTEGER := 127;
-- 98/02/21 Wolfgang Lohmann
--CSIZE : constant INTEGER := Character'Pos(Character'Last);
CSIZE : constant Integer :=
Wide_Wide_Character'Pos (Unicode.Unicode_Character'Last);
INITIAL_MAX_CCLS : constant INTEGER := 100; -- max number of unique character
-- classes
MAX_CCLS_INCREMENT : constant INTEGER := 100;
-- size of table holding members of character classes
Initial_Max_CCL_Table_Size : constant INTEGER := 16#1_0000#;
MAX_CCL_TBL_SIZE_INCREMENT : constant INTEGER := 16#1_0000#;
INITIAL_MAX_RULES : constant INTEGER := 100;
-- default maximum number of rules
MAX_RULES_INCREMENT : constant INTEGER := 100;
INITIAL_MNS : constant INTEGER := 2000; -- default maximum number of nfa stat
-- es
MNS_INCREMENT : constant INTEGER := 1000; -- amount to bump above by if it's
-- not enough
INITIAL_MAX_DFAS : constant INTEGER := 1000; -- default maximum number of dfa
-- states
MAX_DFAS_INCREMENT : constant INTEGER := 1000;
JAMSTATE_CONST : constant INTEGER := - 32766; -- marks a reference to the sta
-- te that always jams
-- enough so that if it's subtracted from an NFA state number, the result
-- is guaranteed to be negative
MARKER_DIFFERENCE : constant INTEGER := 32000;
MAXIMUM_MNS : constant INTEGER := 31999;
-- maximum number of nxt/chk pairs for non-templates
INITIAL_MAX_XPAIRS : constant INTEGER := 2000;
MAX_XPAIRS_INCREMENT : constant INTEGER := 2000;
-- maximum number of nxt/chk pairs needed for templates
INITIAL_MAX_TEMPLATE_XPAIRS : constant INTEGER := 2500;
MAX_TEMPLATE_XPAIRS_INCREMENT : constant INTEGER := 2500;
SYM_EPSILON : constant INTEGER := 0; -- to mark transitions on the symbol eps
-- ilon
INITIAL_MAX_SCS : constant INTEGER := 40; -- maximum number of start conditio
-- ns
MAX_SCS_INCREMENT : constant INTEGER := 40; -- amount to bump by if it's not
-- enough
ONE_STACK_SIZE : constant INTEGER := 500; -- stack of states with only one ou
-- t-transition
SAME_TRANS : constant INTEGER := - 1; -- transition is the same as "default"
-- entry for state
-- the following percentages are used to tune table compression:
--
-- the percentage the number of out-transitions a state must be of the
-- number of equivalence classes in order to be considered for table
-- compaction by using protos
PROTO_SIZE_PERCENTAGE : constant INTEGER := 15;
-- the percentage the number of homogeneous out-transitions of a state
-- must be of the number of total out-transitions of the state in order
-- that the state's transition table is first compared with a potential
-- template of the most common out-transition instead of with the first
--proto in the proto queue
CHECK_COM_PERCENTAGE : constant INTEGER := 50;
-- the percentage the number of differences between a state's transition
-- table and the proto it was first compared with must be of the total
-- number of out-transitions of the state in order to keep the first
-- proto as a good match and not search any further
FIRST_MATCH_DIFF_PERCENTAGE : constant INTEGER := 10;
-- the percentage the number of differences between a state's transition
-- table and the most similar proto must be of the state's total number
-- of out-transitions to use the proto as an acceptable close match
ACCEPTABLE_DIFF_PERCENTAGE : constant INTEGER := 50;
-- the percentage the number of homogeneous out-transitions of a state
-- must be of the number of total out-transitions of the state in order
-- to consider making a template from the state
TEMPLATE_SAME_PERCENTAGE : constant INTEGER := 60;
-- the percentage the number of differences between a state's transition
-- table and the most similar proto must be of the state's total number
-- of out-transitions to create a new proto from the state
NEW_PROTO_DIFF_PERCENTAGE : constant INTEGER := 20;
-- the percentage the total number of out-transitions of a state must be
-- of the number of equivalence classes in order to consider trying to
-- fit the transition table into "holes" inside the nxt/chk table.
INTERIOR_FIT_PERCENTAGE : constant INTEGER := 15;
-- size of region set aside to cache the complete transition table of
-- protos on the proto queue to enable quick comparisons
PROT_SAVE_SIZE : constant INTEGER := 2000;
MSP : constant INTEGER := 50; -- maximum number of saved protos (protos on th
-- e proto queue)
-- maximum number of out-transitions a state can have that we'll rummage
-- around through the interior of the internal fast table looking for a
-- spot for it
MAX_XTIONS_FULL_INTERIOR_FIT : constant INTEGER := 4;
-- maximum number of rules which will be reported as being associated
-- with a DFA state
MAX_ASSOC_RULES : constant INTEGER := 100;
-- number that, if used to subscript an array, has a good chance of producing
-- an error; should be small enough to fit into a short
BAD_SUBSCRIPT : constant INTEGER := - 32767;
-- Declarations for global variables.
-- variables for symbol tables:
-- sctbl - start-condition symbol table
-- ndtbl - name-definition symbol table
-- ccltab - character class text symbol table
type HASH_ENTRY;
type HASH_LINK is access HASH_ENTRY;
type HASH_ENTRY is
record
PREV : HASH_LINK;
NEXT : HASH_LINK;
NAME : Ada.Strings.Wide_Wide_Unbounded.Unbounded_Wide_Wide_String;
STR_VAL : Ada.Strings.Wide_Wide_Unbounded.Unbounded_Wide_Wide_String;
INT_VAL : INTEGER;
end record;
type HASH_TABLE is array ( INTEGER range <> ) of HASH_LINK;
NAME_TABLE_HASH_SIZE : constant INTEGER := 101;
START_COND_HASH_SIZE : constant INTEGER := 101;
CCL_HASH_SIZE : constant INTEGER := 101;
subtype NDTBL_TYPE is HASH_TABLE (0 .. NAME_TABLE_HASH_SIZE - 1);
NDTBL : NDTBL_TYPE;
subtype SCTBL_TYPE is HASH_TABLE (0 .. START_COND_HASH_SIZE - 1);
SCTBL : SCTBL_TYPE;
subtype CCLTAB_TYPE is HASH_TABLE (0 .. CCL_HASH_SIZE);
CCLTAB : CCLTAB_TYPE;
-- variables for flags:
-- printstats - if true (-v), dump statistics
-- syntaxerror - true if a syntax error has been found
-- eofseen - true if we've seen an eof in the input file
-- ddebug - if true (-d), make a "debug" scanner
-- trace - if true (-T), trace processing
-- spprdflt - if true (-s), suppress the default rule
-- interactive - if true (-I), generate an interactive scanner
-- caseins - if true (-i), generate a case-insensitive scanner
-- useecs - if true (-ce flag), use equivalence classes
-- fulltbl - if true (-cf flag), don't compress the DFA state table
-- usemecs - if true (-cm flag), use meta-equivalence classes
-- gen_line_dirs - if true (i.e., no -L flag), generate #line directives
-- performance_report - if true (i.e., -p flag), generate a report relating
-- to scanner performance
-- backtrack_report - if true (i.e., -b flag), generate "lex.backtrack" file
-- listing backtracking states
-- continued_action - true if this rule's action is to "fall through" to
-- the next rule's action (i.e., the '|' action)
PRINTSTATS, DDEBUG, SPPRDFLT,
INTERACTIVE, CASEINS, USEECS, FULLTBL, USEMECS,
GEN_LINE_DIRS, PERFORMANCE_REPORT, BACKTRACK_REPORT,
TRACE, EOFSEEN, CONTINUED_ACTION : BOOLEAN;
SYNTAXERROR : BOOLEAN;
-- variables used in the aflex input routines:
-- datapos - characters on current output line
-- dataline - number of contiguous lines of data in current data
-- statement. Used to generate readable -f output
-- skelfile - the skeleton file
-- yyin - input file
-- temp_action_file - temporary file to hold actions
-- backtrack_file - file to summarize backtracking states to
-- infilename - name of input file
-- linenum - current input line number
DATAPOS, DATALINE, LINENUM : INTEGER;
SKELFILE, YYIN : Ada.Wide_Wide_Text_IO.File_Type;
TEMP_ACTION_FILE : Ada.Wide_Wide_Text_IO.File_Type;
DEF_FILE : Ada.Wide_Wide_Text_IO.File_Type;
BACKTRACK_FILE : Ada.Wide_Wide_Text_IO.File_Type;
In_File_Name : Unbounded_String;
-- variables for stack of states having only one out-transition:
-- onestate - state number
-- onesym - transition symbol
-- onenext - target state
-- onedef - default base entry
-- onesp - stack pointer
ONESTATE, ONESYM, ONENEXT, ONEDEF : array (0 .. ONE_STACK_SIZE - 1) of INTEGER
;
ONESP : INTEGER;
-- variables for nfa machine data:
-- current_mns - current maximum on number of NFA states
-- num_rules - number of the last accepting state; also is number of
-- rules created so far
-- current_max_rules - current maximum number of rules
-- lastnfa - last nfa state number created
-- firstst - physically the first state of a fragment
-- lastst - last physical state of fragment
-- finalst - last logical state of fragment
-- transchar - transition character
-- trans1 - transition state
-- trans2 - 2nd transition state for epsilons
-- accptnum - accepting number
-- assoc_rule - rule associated with this NFA state (or 0 if none)
-- state_type - a STATE_xxx type identifying whether the state is part
-- of a normal rule, the leading state in a trailing context
-- rule (i.e., the state which marks the transition from
-- recognizing the text-to-be-matched to the beginning of
-- the trailing context), or a subsequent state in a trailing
-- context rule
-- rule_type - a RULE_xxx type identifying whether this a a ho-hum
-- normal rule or one which has variable head & trailing
-- context
-- rule_linenum - line number associated with rule
CURRENT_MNS, NUM_RULES, CURRENT_MAX_RULES, LASTNFA : INTEGER;
FIRSTST, LASTST, FINALST, TRANSCHAR, TRANS1, TRANS2 : INT_PTR;
ACCPTNUM, ASSOC_RULE, RULE_LINENUM : INT_PTR;
RULE_TYPE : RULE_ENUM_PTR;
STATE_TYPE : STATE_ENUM_PTR;
-- global holding current type of state we're making
CURRENT_STATE_ENUM : STATE_ENUM;
-- true if the input rules include a rule with both variable-length head
-- and trailing context, false otherwise
VARIABLE_TRAILING_CONTEXT_RULES : BOOLEAN;
-- variables for protos:
-- numtemps - number of templates created
-- numprots - number of protos created
-- protprev - backlink to a more-recently used proto
-- protnext - forward link to a less-recently used proto
-- prottbl - base/def table entry for proto
-- protcomst - common state of proto
-- firstprot - number of the most recently used proto
-- lastprot - number of the least recently used proto
-- protsave contains the entire state array for protos
NUMTEMPS, NUMPROTS, FIRSTPROT, LASTPROT : INTEGER;
PROTPREV, PROTNEXT, PROTTBL, PROTCOMST : array (0 .. MSP - 1) of INTEGER;
PROTSAVE : array (0 .. PROT_SAVE_SIZE - 1) of INTEGER;
-- variables for managing equivalence classes:
-- numecs - number of equivalence classes
-- nextecm - forward link of Equivalence Class members
-- ecgroup - class number or backward link of EC members
-- nummecs - number of meta-equivalence classes (used to compress
-- templates)
-- tecfwd - forward link of meta-equivalence classes members
-- * tecbck - backward link of MEC's
NUMECS, NUMMECS : INTEGER;
subtype C_SIZE_ARRAY is UNBOUNDED_INT_ARRAY (0 .. CSIZE);
type C_Size_Array_Access is access all C_SIZE_ARRAY;
procedure Free is
new Ada.Unchecked_Deallocation (C_Size_Array, C_Size_Array_Access);
type C_SIZE_BOOL_ARRAY is array (0 .. CSIZE) of BOOLEAN;
NEXTECM, ECGROUP, TECFWD, TECBCK : C_SIZE_ARRAY;
ECGROUP_Plane :
array (Unicode.Primary_Stage_Index) of Unicode.Primary_Stage_Index;
-- Mapping between primary index of code point and primary index of
-- secondary plane of ECGROUP which is used for this primary index.
-- Value not equal to index means use of another shared plane to compact
-- data.
ECGROUP_Use_Count :
array (Unicode.Primary_Stage_Index) of Integer;
-- Use count for each plane of packed data. It is used to select most used
-- plane as others choice of aggregate and make code more clean.
-- variables for start conditions:
-- lastsc - last start condition created
-- current_max_scs - current limit on number of start conditions
-- scset - set of rules active in start condition
-- scbol - set of rules active only at the beginning of line in a s.c.
-- scxclu - true if start condition is exclusive
-- sceof - true if start condition has EOF rule
-- scname - start condition name
-- actvsc - stack of active start conditions for the current rule
LASTSC, CURRENT_MAX_SCS : INTEGER;
SCSET, SCBOL : INT_PTR;
SCXCLU, SCEOF : BOOLEAN_PTR;
ACTVSC : INT_PTR;
SCNAME : VSTRING_PTR;
-- variables for dfa machine data:
-- current_max_dfa_size - current maximum number of NFA states in DFA
-- current_max_xpairs - current maximum number of non-template xtion pairs
-- current_max_template_xpairs - current maximum number of template pairs
-- current_max_dfas - current maximum number DFA states
-- lastdfa - last dfa state number created
-- nxt - state to enter upon reading character
-- chk - check value to see if "nxt" applies
-- tnxt - internal nxt table for templates
-- base - offset into "nxt" for given state
-- def - where to go if "chk" disallows "nxt" entry
-- tblend - last "nxt/chk" table entry being used
-- firstfree - first empty entry in "nxt/chk" table
-- dss - nfa state set for each dfa
-- dfasiz - size of nfa state set for each dfa
-- dfaacc - accepting set for each dfa state (or accepting number, if
-- -r is not given)
-- accsiz - size of accepting set for each dfa state
-- dhash - dfa state hash value
-- numas - number of DFA accepting states created; note that this
-- is not necessarily the same value as num_rules, which is the analogous
-- value for the NFA
-- numsnpairs - number of state/nextstate transition pairs
-- jambase - position in base/def where the default jam table starts
-- jamstate - state number corresponding to "jam" state
-- end_of_buffer_state - end-of-buffer dfa state number
CURRENT_MAX_DFA_SIZE, CURRENT_MAX_XPAIRS : INTEGER;
CURRENT_MAX_TEMPLATE_XPAIRS, CURRENT_MAX_DFAS : INTEGER;
LASTDFA, LASTTEMP : INTEGER;
NXT, CHK, TNXT : INT_PTR;
BASE, DEF , DFASIZ : INT_PTR;
TBLEND, FIRSTFREE : INTEGER;
DSS : INT_STAR_PTR;
DFAACC : DFAACC_PTR;
-- type declaration for dfaacc_type moved above
ACCSIZ, DHASH : INT_PTR;
END_OF_BUFFER_STATE, NUMSNPAIRS, JAMBASE, JAMSTATE, NUMAS : INTEGER;
-- variables for ccl information:
-- lastccl - ccl index of the last created ccl
-- current_maxccls - current limit on the maximum number of unique ccl's
-- cclmap - maps a ccl index to its set pointer
-- ccllen - gives the length of a ccl
-- cclng - true for a given ccl if the ccl is negated
-- cclreuse - counts how many times a ccl is re-used
-- current_max_ccl_tbl_size - current limit on number of characters needed
-- to represent the unique ccl's
-- ccltbl - holds the characters in each ccl - indexed by cclmap
Current_Max_CCL_Table_Size, LASTCCL, CURRENT_MAXCCLS, CCLREUSE : Integer;
CCLMAP, CCLLEN, CCLNG : INT_PTR;
CCLTBL : Unicode_Character_Array_Access;
type Wide_Wide_Character_Set_Array is
array (Positive range <>)
of Ada.Strings.Wide_Wide_Maps.Wide_Wide_Character_Set;
type Wide_Wide_Character_Set_Array_Access is
access all Wide_Wide_Character_Set_Array;
CCL_Sets : Wide_Wide_Character_Set_Array_Access;
-- variables for miscellaneous information:
-- starttime - real-time when we started
-- endtime - real-time when we ended
-- nmstr - last NAME scanned by the scanner
-- sectnum - section number currently being parsed
-- nummt - number of empty nxt/chk table entries
-- hshcol - number of hash collisions detected by snstods
-- dfaeql - number of times a newly created dfa was equal to an old one
-- numeps - number of epsilon NFA states created
-- eps2 - number of epsilon states which have 2 out-transitions
-- num_reallocs - number of times it was necessary to realloc() a group
-- of arrays
-- tmpuses - number of DFA states that chain to templates
-- totnst - total number of NFA states used to make DFA states
-- peakpairs - peak number of transition pairs we had to store internally
-- numuniq - number of unique transitions
-- numdup - number of duplicate transitions
-- hshsave - number of hash collisions saved by checking number of states
-- num_backtracking - number of DFA states requiring back-tracking
-- bol_needed - whether scanner needs beginning-of-line recognition
NMSTR : Ada.Strings.Wide_Wide_Unbounded.Unbounded_Wide_Wide_String;
SECTNUM, NUMMT, HSHCOL, DFAEQL, NUMEPS, EPS2, NUM_REALLOCS : INTEGER;
TMPUSES, TOTNST, PEAKPAIRS, NUMUNIQ, NUMDUP, HSHSAVE : INTEGER;
NUM_BACKTRACKING : INTEGER;
BOL_NEEDED : BOOLEAN;
type Boolean_Property_Array is
array (Matreshka.Internals.Unicode.Ucd.Boolean_Properties) of Integer;
Boolean_CCL : Boolean_Property_Array := (others => 0);
Boolean_NCCL : Boolean_Property_Array := (others => 0);
function ALLOCATE_INTEGER_ARRAY (SIZE : in INTEGER) return INT_PTR;
function ALLOCATE_INT_PTR_ARRAY (SIZE : in INTEGER) return INT_STAR_PTR;
function ALLOCATE_VSTRING_ARRAY (SIZE : in INTEGER) return VSTRING_PTR;
function ALLOCATE_DFAACC_UNION (SIZE : in INTEGER) return DFAACC_PTR;
function Allocate_Unicode_Character_Array
(Size : Integer)
return Unicode_Character_Array_Access;
function ALLOCATE_RULE_ENUM_ARRAY (SIZE : in INTEGER) return RULE_ENUM_PTR;
function ALLOCATE_STATE_ENUM_ARRAY (SIZE : in INTEGER) return STATE_ENUM_PTR;
function ALLOCATE_BOOLEAN_ARRAY (SIZE : in INTEGER) return BOOLEAN_PTR;
function Allocate_Wide_Wide_Character_Set_Array
(Size : Natural) return Wide_Wide_Character_Set_Array_Access;
procedure REALLOCATE_INTEGER_ARRAY (ARR : in out INT_PTR;
SIZE : in INTEGER);
procedure Reallocate_Wide_Wide_Character_Set_Array
(Item : in out Wide_Wide_Character_Set_Array_Access;
Size : Natural);
procedure REALLOCATE_INT_PTR_ARRAY (ARR : in out INT_STAR_PTR;
SIZE : in INTEGER);
procedure REALLOCATE_VSTRING_ARRAY (ARR : in out VSTRING_PTR;
SIZE : in INTEGER);
procedure REALLOCATE_DFAACC_UNION (ARR : in out DFAACC_PTR;
SIZE : in INTEGER);
procedure Reallocate_Unicode_Character_Array
(Item : in out Unicode_Character_Array_Access;
Size : Integer);
procedure REALLOCATE_RULE_ENUM_ARRAY (ARR : in out RULE_ENUM_PTR;
SIZE : in INTEGER);
procedure REALLOCATE_STATE_ENUM_ARRAY (ARR : in out STATE_ENUM_PTR;
SIZE : in INTEGER);
procedure REALLOCATE_BOOLEAN_ARRAY (ARR : in out BOOLEAN_PTR;
SIZE : in INTEGER);
end MISC_DEFS;
| 40.973354 | 80 | 0.716193 |
d0ead6241d55b598a9de7213526c53f4b8ee84e3 | 4,172 | ads | Ada | Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/s-exctab.ads | djamal2727/Main-Bearing-Analytical-Model | 2f00c2219c71be0175c6f4f8f1d4cca231d97096 | [
"Apache-2.0"
] | null | null | null | Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/s-exctab.ads | djamal2727/Main-Bearing-Analytical-Model | 2f00c2219c71be0175c6f4f8f1d4cca231d97096 | [
"Apache-2.0"
] | null | null | null | Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/s-exctab.ads | djamal2727/Main-Bearing-Analytical-Model | 2f00c2219c71be0175c6f4f8f1d4cca231d97096 | [
"Apache-2.0"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S Y S T E M . E X C E P T I O N _ T A B L E --
-- --
-- S p e c --
-- --
-- Copyright (C) 1996-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. --
-- --
------------------------------------------------------------------------------
-- This package implements the interface used to maintain a table of
-- registered exception names, for the implementation of the mapping
-- of names to exceptions (used for exception streams and attributes)
pragma Compiler_Unit_Warning;
with System.Standard_Library;
package System.Exception_Table is
pragma Elaborate_Body;
package SSL renames System.Standard_Library;
procedure Register_Exception (X : SSL.Exception_Data_Ptr);
pragma Inline (Register_Exception);
-- Register an exception in the hash table mapping. This function is
-- called during elaboration of library packages. For exceptions that
-- are declared within subprograms, the registration occurs the first
-- time that an exception is elaborated during a call of the subprogram.
--
-- Note: all calls to Register_Exception other than those to register the
-- predefined exceptions are suppressed if the application is compiled
-- with pragma Restrictions (No_Exception_Registration).
function Internal_Exception
(X : String;
Create_If_Not_Exist : Boolean := True) return SSL.Exception_Data_Ptr;
-- Given an exception_name X, returns a pointer to the actual internal
-- exception data. A new entry is created in the table if X does not
-- exist yet and Create_If_Not_Exist is True. If it is false and X
-- does not exist yet, null is returned.
function Registered_Exceptions_Count return Natural;
-- Return the number of currently registered exceptions
type Exception_Data_Array is array (Natural range <>)
of SSL.Exception_Data_Ptr;
procedure Get_Registered_Exceptions
(List : out Exception_Data_Array;
Last : out Integer);
-- Return the list of registered exceptions
end System.Exception_Table;
| 54.894737 | 78 | 0.532359 |
187f88f029132162e0b021d84a2a60f2d216cd6d | 8,818 | adb | Ada | src/bbqueue.adb | skade/bbqueue-spark | a39f7f6ef9e2b027c4f68b17e70989ef57dbebcd | [
"MIT"
] | 8 | 2020-12-19T00:55:03.000Z | 2021-08-10T22:12:14.000Z | src/bbqueue.adb | skade/bbqueue-spark | a39f7f6ef9e2b027c4f68b17e70989ef57dbebcd | [
"MIT"
] | 1 | 2022-02-15T10:41:18.000Z | 2022-02-15T10:41:18.000Z | src/bbqueue.adb | skade/bbqueue-spark | a39f7f6ef9e2b027c4f68b17e70989ef57dbebcd | [
"MIT"
] | 2 | 2021-08-11T17:00:13.000Z | 2022-01-13T17:58:23.000Z | -- with Ada.Text_IO; use Ada.Text_IO;
with Atomic; use Atomic;
package body BBqueue
with SPARK_Mode => On
is
-----------
-- Grant --
-----------
procedure Grant (This : in out Offsets_Only;
G : in out Write_Grant;
Size : Count)
is
Read, Write, Start : Count;
Max : constant Count := This.Size;
Already_Inverted : Boolean;
In_Progress : Boolean;
begin
if Size = 0 then
G.Result := Empty;
G.Slice := Empty_Slice;
return;
end if;
Test_And_Set (This.Write_In_Progress, In_Progress, Acq_Rel);
if In_Progress then
G.Result := Grant_In_Progress;
G.Slice := Empty_Slice;
return;
end if;
if Size > This.Size then
Clear (This.Write_In_Progress, Release);
G.Result := Insufficient_Size;
G.Slice := Empty_Slice;
return;
end if;
-- Writer component. Must never write to `read`,
-- be careful writing to `load`
Write := Atomic_Count.Load (This.Write, Acquire);
Read := Atomic_Count.Load (This.Read, Acquire);
Already_Inverted := Write < Read;
if Already_Inverted then
-- The original comparison is ((Write + Size) < Read), it is modified
-- to avoid integer overflow.
if Count'Last - Size >= Write
and then
(Write + Size) < Read
then
-- Inverted, room is still available
Start := Write;
else
-- Inverted, no room is available
Clear (This.Write_In_Progress, Release);
G.Result := Insufficient_Size;
G.Slice := Empty_Slice;
This.Granted_Write_Size := 0;
return;
end if;
else
-- The original comparison is ((Write + Size) <= Max), it is modified
-- to avoid integer overflow.
if Count'Last - Size >= Write
and then
(Write + Size) <= Max
then
-- Non inverted condition
Start := Write;
else
-- Not inverted, but need to go inverted
-- NOTE: We check Size < Read, NOT <=, because
-- write must never == read in an inverted condition, since
-- we will then not be able to tell if we are inverted or not
if Size < Read then
Start := 0;
else
-- Inverted, no room is available
Clear (This.Write_In_Progress, Release);
G.Result := Insufficient_Size;
G.Slice := Empty_Slice;
This.Granted_Write_Size := 0;
return;
end if;
end if;
end if;
-- This is what we want to prove: the granted slice is in the writeable
-- area.
pragma Assert (Size /= 0);
pragma Assert (In_Writable_Area (This, Start));
pragma Assert (In_Writable_Area (This, Start + Size - 1));
Atomic_Count.Store (This.Reserve, Start + Size, Release);
This.Granted_Write_Size := Size;
G.Result := Valid;
G.Slice := (Size, Start, Start + Size - 1);
end Grant;
------------
-- Commit --
------------
procedure Commit (This : in out Offsets_Only;
G : in out Write_Grant;
Size : Count := Count'Last)
is
Used, Write, Last, New_Write : Count;
Max : constant Count := This.Size;
Len : constant Count := This.Granted_Write_Size;
begin
-- If there is no grant in progress, return early. This
-- generally means we are dropping the grant within a
-- wrapper structure
if not Set (This.Write_In_Progress, Acquire) then
return;
end if;
-- Writer component. Must never write to READ,
-- be careful writing to LAST
-- Saturate the grant commit
Used := Count'Min (Len, Size);
Write := Atomic_Count.Load (This.Write, Acquire);
Atomic_Count.Sub (This.Reserve, Len - Used, Acq_Rel);
Last := Atomic_Count.Load (This.Last, Acquire);
New_Write := Atomic_Count.Load (This.Reserve, Acquire);
if (New_Write < Write) and then (Write /= Max) then
-- We have already wrapped, but we are skipping some bytes at the end
-- of the ring. Mark `last` where the write pointer used to be to hold
-- the line here
Atomic_Count.Store (This.Last, Write, Release);
elsif New_Write > Last then
-- We're about to pass the last pointer, which was previously the
-- artificial end of the ring. Now that we've passed it, we can
-- "unlock" the section that was previously skipped.
--
-- Since new_write is strictly larger than last, it is safe to move
-- this as the other thread will still be halted by the (about to be
-- updated) write value
Atomic_Count.Store (This.Last, Max, Release);
end if;
-- else: If new_write == last, either:
-- * last == max, so no need to write, OR
-- * If we write in the end chunk again, we'll update last to max next
-- time
-- * If we write to the start chunk in a wrap, we'll update last when we
-- move write backwards
-- Write must be updated AFTER last, otherwise read could think it was
-- time to invert early!
Atomic_Count.Store (This.Write, New_Write, Release);
-- Nothing granted anymore
This.Granted_Write_Size := 0;
G.Result := Empty;
G.Slice := Empty_Slice;
-- Allow subsequent grants
Clear (This.Write_In_Progress, Release);
end Commit;
----------
-- Read --
----------
procedure Read (This : in out Offsets_Only;
G : in out Read_Grant;
Max : Count := Count'Last)
is
Read, Write, Last, Size : Count;
In_Progress : Boolean;
begin
Test_And_Set (This.Read_In_Progress, In_Progress, Acq_Rel);
if In_Progress then
G.Result := Grant_In_Progress;
G.Slice := Empty_Slice;
return;
end if;
Write := Atomic_Count.Load (This.Write, Acquire);
Read := Atomic_Count.Load (This.Read, Acquire);
Last := Atomic_Count.Load (This.Last, Acquire);
-- Resolve the inverted case or end of read
if Read = Last and then Write < Read then
Read := 0;
-- This has some room for error, the other thread reads this
-- Impact to Grant:
-- Grant checks if read < write to see if inverted. If not
-- inverted, but no space left, Grant will initiate an inversion,
-- but will not trigger it
-- Impact to Commit:
-- Commit does not check read, but if Grant has started an
-- inversion, grant could move Last to the prior write position
-- MOVING READ BACKWARDS!
Atomic_Count.Store (This.Read, 0, Release);
end if;
Size := (if Write < Read then Last - Read else Write - Read);
-- Bound the slice with the maximum size requested by the user
Size := Count'Min (Size, Max);
if Size = 0 then
Clear (This.Read_In_Progress);
G.Result := Empty;
G.Slice := Empty_Slice;
return;
end if;
-- This is what we want to prove: the granted slice is in the readable
-- area.
pragma Assert (Size /= 0);
pragma Assert (In_Readable_Area (This, Read));
pragma Assert (In_Readable_Area (This, Read + Size - 1));
This.Granted_Read_Size := Size;
G.Result := Valid;
G.Slice := (Size, Read, Read + Size - 1);
end Read;
-------------
-- Release --
-------------
procedure Release (This : in out Offsets_Only;
G : in out Read_Grant;
Size : Count := Count'Last)
is
Used : Count;
begin
-- Saturate the grant commit
Used := Count'Min (This.Granted_Read_Size, Size);
-- If there is no grant in progress, return early. This
-- generally means we are dropping the grant within a
-- wrapper structure
if not Set (This.Read_In_Progress, Acquire) then
return;
end if;
-- This should always be checked by the public interfaces
-- debug_assert! (used <= self.buf.len ());
-- This should be fine, purely incrementing
Atomic_Count.Add (This.Read, Used, Release);
-- Nothing granted anymore
This.Granted_Read_Size := 0;
G.Result := Empty;
G.Slice := Empty_Slice;
-- Allow subsequent read
Clear (This.Read_In_Progress, Release);
end Release;
end BBqueue;
| 31.049296 | 80 | 0.561238 |
202ca8b5fbccfb1548301a4571a96b400704f2d6 | 739 | ads | Ada | specs/ada/common/tkmrpc-results.ads | DrenfongWong/tkm-rpc | 075d22871cf81d497aac656c7f03a513278b641c | [
"BSD-3-Clause"
] | null | null | null | specs/ada/common/tkmrpc-results.ads | DrenfongWong/tkm-rpc | 075d22871cf81d497aac656c7f03a513278b641c | [
"BSD-3-Clause"
] | null | null | null | specs/ada/common/tkmrpc-results.ads | DrenfongWong/tkm-rpc | 075d22871cf81d497aac656c7f03a513278b641c | [
"BSD-3-Clause"
] | null | null | null | with Interfaces;
package Tkmrpc.Results is
type Result_Type is new Interfaces.Unsigned_64;
Ok : constant Result_Type := 16#0000000000000000#;
Invalid_Operation : constant Result_Type := 16#0000000000000101#;
Invalid_Id : constant Result_Type := 16#0000000000000102#;
Invalid_State : constant Result_Type := 16#0000000000000103#;
Invalid_Parameter : constant Result_Type := 16#0000000000000104#;
Random_Failure : constant Result_Type := 16#0000000000000201#;
Sign_Failure : constant Result_Type := 16#0000000000000202#;
Aborted : constant Result_Type := 16#0000000000000301#;
Math_Error : constant Result_Type := 16#0000000000000401#;
end Tkmrpc.Results;
| 41.055556 | 68 | 0.714479 |
cb1df5bfbbb495b11337e41a2e41bc2f1e45809c | 4,572 | ads | Ada | tools/xml2ayacc/xml_io/xml_io-base_readers_streams.ads | faelys/gela-asis | 48a3bee90eda9f0c9d958b4e3c80a5a9b1c65253 | [
"BSD-3-Clause"
] | 4 | 2016-02-05T15:51:56.000Z | 2022-03-25T20:38:32.000Z | tools/xml2ayacc/xml_io/xml_io-base_readers_streams.ads | faelys/gela-asis | 48a3bee90eda9f0c9d958b4e3c80a5a9b1c65253 | [
"BSD-3-Clause"
] | null | null | null | tools/xml2ayacc/xml_io/xml_io-base_readers_streams.ads | faelys/gela-asis | 48a3bee90eda9f0c9d958b4e3c80a5a9b1c65253 | [
"BSD-3-Clause"
] | null | null | null | ------------------------------------------------------------------------------
-- G E L A A S I S --
-- ASIS implementation for Gela project, a portable Ada compiler --
-- http://gela.ada-ru.org --
-- - - - - - - - - - - - - - - - --
-- Read copyright and license at the end of this file --
------------------------------------------------------------------------------
-- $Revision: 209 $ $Date: 2013-11-30 21:03:24 +0200 (Сб., 30 нояб. 2013) $
with Text_Streams;
with XML_IO.Internals;
with XML_IO.Base_Readers;
generic
with package Implementation is new XML_IO.Internals.Implementation (<>);
type Input_Stream (Input : access Text_Streams.Text_Stream'Class) is
limited private;
with procedure Read
(Input : in out Input_Stream;
Buffer : in out Implementation.XML_String;
Free : out Natural);
package XML_IO.Base_Readers_Streams is
package Base_Readers renames Implementation.Readers;
subtype XML_String is Implementation.XML_String;
type Reader (Input : access Text_Streams.Text_Stream'Class;
Buffer_Size : Positive) is
new Base_Readers.Reader with private;
function More_Pieces (Parser : in Reader) return Boolean;
function Piece_Kind (Parser : in Reader) return Piece_Kinds;
function Encoding (Parser : in Reader) return XML_String;
function Standalone (Parser : in Reader) return Boolean;
function Text (Parser : in Reader) return XML_String;
function Name (Parser : in Reader) return XML_String;
function Attribute_Count (Parser : in Reader) return List_Count;
procedure Initialize (Parser : in out Reader);
procedure Next (Parser : in out Reader);
function Attribute_Name
(Parser : in Reader;
Index : in List_Index) return XML_String;
function Attribute_Value
(Parser : in Reader;
Index : in List_Index) return XML_String;
function Attribute_Value
(Parser : in Reader;
Name : in XML_String;
Default : in XML_String := Implementation.Nil_Literal;
Raise_Error : in Boolean := False) return XML_String;
Default_Buffer_Size : constant Positive := 8192;
private
type Reader (Input : access Text_Streams.Text_Stream'Class;
Buffer_Size : Positive) is
new Implementation.Reader with record
Stream : Input_Stream (Input);
Buffer : Xml_String (1 .. Buffer_Size);
end record;
procedure Read
(Parser : in out Reader;
Buffer : in out XML_String;
Last : out Natural);
end XML_IO.Base_Readers_Streams;
------------------------------------------------------------------------------
-- 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.
------------------------------------------------------------------------------
| 42.333333 | 79 | 0.62336 |
205acb3018f6f73d6f0ad9b402299e89fb695a46 | 912 | adb | Ada | gdb/testsuite/gdb.ada/arrayparam/foo.adb | greyblue9/binutils-gdb | 05377632b124fe7600eea7f4ee0e9a35d1b0cbdc | [
"BSD-3-Clause"
] | 1 | 2020-10-14T03:24:35.000Z | 2020-10-14T03:24:35.000Z | gdb/testsuite/gdb.ada/arrayparam/foo.adb | greyblue9/binutils-gdb | 05377632b124fe7600eea7f4ee0e9a35d1b0cbdc | [
"BSD-3-Clause"
] | null | null | null | gdb/testsuite/gdb.ada/arrayparam/foo.adb | greyblue9/binutils-gdb | 05377632b124fe7600eea7f4ee0e9a35d1b0cbdc | [
"BSD-3-Clause"
] | null | null | null | -- 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/>.
with Pck; use Pck;
procedure Foo is
My_String : constant String := "Hello World";
begin
First := ASCII.NUL;
Last := ASCII.NUL;
Length := -1;
Call_Me (My_String); -- STOP
end Foo;
| 33.777778 | 73 | 0.713816 |
208fb313c88d62d4bc9edddc96f1647537cd2740 | 205 | adb | Ada | bits/src/shift/axiom/logic_right/bitoperations-shift-axiom-logic_right.adb | vasil-sd/ada-tlsf | c30cfaf5f0b87ebb6e4dd479e50b3f9b11381ddd | [
"MIT"
] | 3 | 2020-02-21T15:42:14.000Z | 2020-04-08T09:42:32.000Z | bits/src/shift/axiom/logic_right/bitoperations-shift-axiom-logic_right.adb | vasil-sd/ada-tlsf | c30cfaf5f0b87ebb6e4dd479e50b3f9b11381ddd | [
"MIT"
] | null | null | null | bits/src/shift/axiom/logic_right/bitoperations-shift-axiom-logic_right.adb | vasil-sd/ada-tlsf | c30cfaf5f0b87ebb6e4dd479e50b3f9b11381ddd | [
"MIT"
] | 1 | 2020-02-21T15:29:26.000Z | 2020-02-21T15:29:26.000Z | package body BitOperations.Shift.Axiom.Logic_Right with
SPARK_Mode => Off is
procedure Equal_Div_By_Power_2 (Value : Modular; Amount : Natural) is null;
end BitOperations.Shift.Axiom.Logic_Right;
| 29.285714 | 78 | 0.785366 |
20d4cfa84c45ddda664cb09d41e6d368f2544fa7 | 511 | ads | Ada | tests/factions-test_data-tests-relations_container-test_data-tests.ads | thindil/steamsky | d5d7fea622f7994c91017c4cd7ba5e188153556c | [
"TCL",
"MIT"
] | 80 | 2017-04-08T23:14:07.000Z | 2022-02-10T22:30:51.000Z | tests/factions-test_data-tests-relations_container-test_data-tests.ads | thindil/steamsky | d5d7fea622f7994c91017c4cd7ba5e188153556c | [
"TCL",
"MIT"
] | 89 | 2017-06-24T08:18:26.000Z | 2021-11-12T04:37:36.000Z | tests/factions-test_data-tests-relations_container-test_data-tests.ads | thindil/steamsky | d5d7fea622f7994c91017c4cd7ba5e188153556c | [
"TCL",
"MIT"
] | 9 | 2018-04-14T16:37:25.000Z | 2020-03-21T14:33:49.000Z | -- This package has been generated automatically by GNATtest.
-- Do not edit any part of it, see GNATtest documentation for more details.
-- begin read only
with Gnattest_Generated;
package Factions.Test_Data.Tests.Relations_Container.Test_Data.Tests is
type Test is new GNATtest_Generated.GNATtest_Standard.Factions.Test_Data
.Tests
.Relations_Container
.Test_Data
.New_Test with
null record;
end Factions.Test_Data.Tests.Relations_Container.Test_Data.Tests;
-- end read only
| 28.388889 | 76 | 0.774951 |
0ecaf99c30af27af9c05e70ea3bc9c2610ad1e1f | 1,493 | ads | Ada | src/server/openapi-servers-operation.ads | mgrojo/swagger-ada | ba592a8c9cd76304bef8f1d48738069b8c73b4a6 | [
"Apache-2.0"
] | null | null | null | src/server/openapi-servers-operation.ads | mgrojo/swagger-ada | ba592a8c9cd76304bef8f1d48738069b8c73b4a6 | [
"Apache-2.0"
] | null | null | null | src/server/openapi-servers-operation.ads | mgrojo/swagger-ada | ba592a8c9cd76304bef8f1d48738069b8c73b4a6 | [
"Apache-2.0"
] | null | null | null | -----------------------------------------------------------------------
-- openapi-server-operation -- Rest server operation
-- Copyright (C) 2017, 2018, 2022 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- 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 Security.Permissions;
generic
with procedure Handler (Req : in out OpenAPI.Servers.Request'Class;
Reply : in out OpenAPI.Servers.Response'Class;
Stream : in out OpenAPI.Servers.Output_Stream'Class;
Context : in out OpenAPI.Servers.Context_Type);
Method : Method_Type := Servlet.Rest.GET;
URI : String;
Permission : Security.Permissions.Permission_Index := Security.Permissions.NONE;
package OpenAPI.Servers.Operation is
function Definition return Descriptor_Access;
end OpenAPI.Servers.Operation;
| 46.65625 | 83 | 0.634293 |
d0e20d7bc39c35fc974b09b157d13b7214d2d510 | 7,831 | ads | Ada | opengl/src/interface/gl-types.ads | Cre8or/OpenGLAda | 91f12a2d4ca2aa7379dd8c83c80e4eca45fd0c06 | [
"MIT"
] | 79 | 2015-04-20T23:10:02.000Z | 2022-03-04T13:50:56.000Z | opengl/src/interface/gl-types.ads | Cre8or/OpenGLAda | 91f12a2d4ca2aa7379dd8c83c80e4eca45fd0c06 | [
"MIT"
] | 126 | 2015-09-10T10:41:34.000Z | 2022-03-20T11:25:40.000Z | opengl/src/interface/gl-types.ads | Cre8or/OpenGLAda | 91f12a2d4ca2aa7379dd8c83c80e4eca45fd0c06 | [
"MIT"
] | 20 | 2015-03-17T07:15:57.000Z | 2022-02-02T17:12:11.000Z | -- part of OpenGLAda, (c) 2017 Felix Krause
-- released under the terms of the MIT license, see the file "COPYING"
with Interfaces.C.Pointers;
with GL.Algebra;
package GL.Types is
pragma Preelaborate;
-- These are the types you can and should use with OpenGL functions
-- (particularly when dealing with buffer objects).
-- Types that are only used internally, but may be needed when interfacing
-- with OpenGL-related library APIs can be found in GL.Low_Level.
-- signed integer types
type Byte is new C.signed_char;
type Short is new C.short;
type Int is new C.int;
type Long is new C.long;
subtype Size is Int range 0 .. Int'Last;
subtype Long_Size is Long range 0 .. Long'Last;
-- unsigned integer types
type UByte is new C.unsigned_char;
type UShort is new C.unsigned_short;
type UInt is new C.unsigned;
-- floating point types ("Single" is used to avoid conflicts with Float)
type Single is new C.C_float;
type Double is new C.double;
-- array types
type UShort_Array is array (Size range <>) of aliased UShort;
type Int_Array is array (Size range <>) of aliased Int;
type UInt_Array is array (Size range <>) of aliased UInt;
type Single_Array is array (Size range <>) of aliased Single;
type Double_Array is array (Size range <>) of aliased Double;
pragma Convention (C, UShort_Array);
pragma Convention (C, Int_Array);
pragma Convention (C, UInt_Array);
pragma Convention (C, Single_Array);
pragma Convention (C, Double_Array);
-- type descriptors
type Numeric_Type is (Byte_Type, UByte_Type, Short_Type,
UShort_Type, Int_Type, UInt_Type,
Single_Type, Double_Type);
type Signed_Numeric_Type is (Byte_Type, Short_Type, Int_Type,
Single_Type, Double_Type);
type Unsigned_Numeric_Type is (UByte_Type, UShort_Type, UInt_Type);
-- doesn't really fit here, but there's no other place it fits better
type Connection_Mode is (Points, Lines, Line_Loop, Line_Strip, Triangles,
Triangle_Strip, Triangle_Fan, Quads, Quad_Strip,
Polygon, Lines_Adjacency, Line_Strip_Adjacency,
Triangles_Adjacency, Triangle_Strip_Adjacency,
Patches);
type Compare_Function is (Never, Less, Equal, LEqual, Greater, Not_Equal,
GEqual, Always);
type Orientation is (Clockwise, Counter_Clockwise);
-- counts the number of components for vertex attributes
subtype Component_Count is Int range 1 .. 4;
package Bytes is new GL.Algebra (Element_Type => Byte,
Index_Type => Size,
Null_Value => 0,
One_Value => 1);
package Shorts is new GL.Algebra (Element_Type => Short,
Index_Type => Size,
Null_Value => 0,
One_Value => 1);
package Ints is new GL.Algebra (Element_Type => Int,
Index_Type => Size,
Null_Value => 0,
One_Value => 1);
package Longs is new GL.Algebra (Element_Type => Long,
Index_Type => Size,
Null_Value => 0,
One_Value => 1);
package UBytes is new GL.Algebra (Element_Type => UByte,
Index_Type => Size,
Null_Value => 0,
One_Value => 1);
package UShorts is new GL.Algebra (Element_Type => UShort,
Index_Type => Size,
Null_Value => 0,
One_Value => 1);
package UInts is new GL.Algebra (Element_Type => UInt,
Index_Type => Size,
Null_Value => 0,
One_Value => 1);
package Singles is new GL.Algebra (Element_Type => Single,
Index_Type => Size,
Null_Value => 0.0,
One_Value => 1.0);
package Doubles is new GL.Algebra (Element_Type => Double,
Index_Type => Size,
Null_Value => 0.0,
One_Value => 1.0);
-- pointer types (for use with data transfer functions
package UShort_Pointers is new Interfaces.C.Pointers
(Size, UShort, UShort_Array, UShort'Last);
package Int_Pointers is new Interfaces.C.Pointers
(Size, Int, Int_Array, Int'Last);
package UInt_Pointers is new Interfaces.C.Pointers
(Size, UInt, UInt_Array, UInt'Last);
package Single_Pointers is new Interfaces.C.Pointers
(Size, Single, Single_Array, 0.0);
private
for Numeric_Type use (Byte_Type => 16#1400#,
UByte_Type => 16#1401#,
Short_Type => 16#1402#,
UShort_Type => 16#1403#,
Int_Type => 16#1404#,
UInt_Type => 16#1405#,
Single_Type => 16#1406#,
Double_Type => 16#140A#);
for Numeric_Type'Size use UInt'Size;
for Signed_Numeric_Type use (Byte_Type => 16#1400#,
Short_Type => 16#1402#,
Int_Type => 16#1404#,
Single_Type => 16#1406#,
Double_Type => 16#140A#);
for Signed_Numeric_Type'Size use UInt'Size;
for Unsigned_Numeric_Type use (UByte_Type => 16#1401#,
UShort_Type => 16#1403#,
UInt_Type => 16#1405#);
for Unsigned_Numeric_Type'Size use UInt'Size;
for Connection_Mode use (Points => 16#0000#,
Lines => 16#0001#,
Line_Loop => 16#0002#,
Line_Strip => 16#0003#,
Triangles => 16#0004#,
Triangle_Strip => 16#0005#,
Triangle_Fan => 16#0006#,
Quads => 16#0007#,
Quad_Strip => 16#0008#,
Polygon => 16#0009#,
Lines_Adjacency => 16#000A#,
Line_Strip_Adjacency => 16#000B#,
Triangles_Adjacency => 16#000C#,
Triangle_Strip_Adjacency => 16#000D#,
Patches => 16#000E#);
for Connection_Mode'Size use UInt'Size;
for Compare_Function use (Never => 16#0200#,
Less => 16#0201#,
Equal => 16#0202#,
LEqual => 16#0203#,
Greater => 16#0204#,
Not_Equal => 16#0205#,
GEqual => 16#0206#,
Always => 16#0207#);
for Compare_Function'Size use UInt'Size;
for Orientation use (Clockwise => 16#0900#, Counter_Clockwise => 16#0901#);
for Orientation'Size use UInt'Size;
end GL.Types;
| 43.265193 | 78 | 0.486783 |
231a75b2e439c9b1c9070b3a1a87486168290c84 | 503 | adb | Ada | qsort_demo.adb | M1nified/Ada-Samples | 0943d028b533f43a8eb56b291189311edc77e15c | [
"MIT"
] | null | null | null | qsort_demo.adb | M1nified/Ada-Samples | 0943d028b533f43a8eb56b291189311edc77e15c | [
"MIT"
] | null | null | null | qsort_demo.adb | M1nified/Ada-Samples | 0943d028b533f43a8eb56b291189311edc77e15c | [
"MIT"
] | null | null | null | -- przykłady: pakiet, select w zasdaniu, access do zadania jako parametr wywołania
with Qsort;
with Ada.Text_Io;
use Qsort,Ada.Text_Io;
procedure Qsort_demo is
Arr1 : vector := (1,6,2,67,3);
Arr1_ptr : vector_ptr;
begin
Arr1_ptr := new vector(Arr1'range);
Put_Line(Integer'Image(Arr1'Length));
Put_Line(Integer'Image(Arr1'Length));
Put_Line(Integer'Image(Arr1_ptr'Length));
for i in Arr1'range loop
Arr1_ptr(i) := Arr1(i);
end loop;
Qsort.Sort(Arr1_ptr);
null;
end Qsort_demo;
| 23.952381 | 82 | 0.717694 |
4a904af7c0265f2afa96caca3d7b41411a07e601 | 22,679 | ads | Ada | tools-src/gnu/gcc/gcc/ada/g-os_lib.ads | modern-tomato/tomato | 96f09fab4929c6ddde5c9113f1b2476ad37133c4 | [
"FSFAP"
] | 80 | 2015-01-02T10:14:04.000Z | 2021-06-07T06:29:49.000Z | tools-src/gnu/gcc/gcc/ada/g-os_lib.ads | modern-tomato/tomato | 96f09fab4929c6ddde5c9113f1b2476ad37133c4 | [
"FSFAP"
] | 9 | 2015-05-14T11:03:12.000Z | 2018-01-04T07:12:58.000Z | tools-src/gnu/gcc/gcc/ada/g-os_lib.ads | modern-tomato/tomato | 96f09fab4929c6ddde5c9113f1b2476ad37133c4 | [
"FSFAP"
] | 69 | 2015-01-02T10:45:56.000Z | 2021-09-06T07:52:13.000Z | ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- G N A T . O S _ L I B --
-- --
-- S p e c --
-- --
-- $Revision$
-- --
-- Copyright (C) 1995-2001 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- 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. --
-- --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- Operating system interface facilities
-- This package contains types and procedures for interfacing to the
-- underlying OS. It is used by the GNAT compiler and by tools associated
-- with the GNAT compiler, and therefore works for the various operating
-- systems to which GNAT has been ported. This package will undoubtedly
-- grow as new services are needed by various tools.
-- This package tends to use fairly low-level Ada in order to not bring
-- in large portions of the RTL. For example, functions return access
-- to string as part of avoiding functions returning unconstrained types;
-- types related to dates are defined here instead of using the types
-- from Calendar, since use of Calendar forces linking in of tasking code.
-- Except where specifically noted, these routines are portable across
-- all GNAT implementations on all supported operating systems.
with System;
with Unchecked_Deallocation;
package GNAT.OS_Lib is
pragma Elaborate_Body (OS_Lib);
type String_Access is access all String;
-- General purpose string access type
procedure Free is new Unchecked_Deallocation
(Object => String, Name => String_Access);
type String_List is array (Positive range <>) of String_Access;
type String_List_Access is access all String_List;
-- General purpose array and pointer for list of string accesses
---------------------
-- Time/Date Stuff --
---------------------
-- The OS's notion of time is represented by the private type OS_Time.
-- This is the type returned by the File_Time_Stamp functions to obtain
-- the time stamp of a specified file. Functions and a procedure (modeled
-- after the similar subprograms in package Calendar) are provided for
-- extracting information from a value of this type. Although these are
-- called GM, the intention is not that they provide GMT times in all
-- cases but rather the actual (time-zone independent) time stamp of the
-- file (of course in Unix systems, this *is* in GMT form).
type OS_Time is private;
subtype Year_Type is Integer range 1900 .. 2099;
subtype Month_Type is Integer range 1 .. 12;
subtype Day_Type is Integer range 1 .. 31;
subtype Hour_Type is Integer range 0 .. 23;
subtype Minute_Type is Integer range 0 .. 59;
subtype Second_Type is Integer range 0 .. 59;
function GM_Year (Date : OS_Time) return Year_Type;
function GM_Month (Date : OS_Time) return Month_Type;
function GM_Day (Date : OS_Time) return Day_Type;
function GM_Hour (Date : OS_Time) return Hour_Type;
function GM_Minute (Date : OS_Time) return Minute_Type;
function GM_Second (Date : OS_Time) return Second_Type;
procedure GM_Split
(Date : OS_Time;
Year : out Year_Type;
Month : out Month_Type;
Day : out Day_Type;
Hour : out Hour_Type;
Minute : out Minute_Type;
Second : out Second_Type);
----------------
-- File Stuff --
----------------
-- These routines give access to the open/creat/close/read/write level
-- of I/O routines in the typical C library (these functions are not
-- part of the ANSI C standard, but are typically available in all
-- systems). See also package Interfaces.C_Streams for access to the
-- stream level routines.
-- Note on file names. If a file name is passed as type String in any
-- of the following specifications, then the name is a normal Ada string
-- and need not be NUL-terminated. However, a trailing NUL character is
-- permitted, and will be ignored (more accurately, the NUL and any
-- characters that follow it will be ignored).
type File_Descriptor is private;
-- Corresponds to the int file handle values used in the C routines,
Standin : constant File_Descriptor;
Standout : constant File_Descriptor;
Standerr : constant File_Descriptor;
-- File descriptors for standard input output files
Invalid_FD : constant File_Descriptor;
-- File descriptor returned when error in opening/creating file;
type Mode is (Binary, Text);
for Mode'Size use Integer'Size;
for Mode use (Binary => 0, Text => 1);
-- Used in all the Open and Create calls to specify if the file is to be
-- opened in binary mode or text mode. In systems like Unix, this has no
-- effect, but in systems capable of text mode translation, the use of
-- Text as the mode parameter causes the system to do CR/LF translation
-- and also to recognize the DOS end of file character on input. The use
-- of Text where appropriate allows programs to take a portable Unix view
-- of DOs-format files and process them appropriately.
function Open_Read
(Name : String;
Fmode : Mode)
return File_Descriptor;
-- Open file Name for reading, returning file descriptor File descriptor
-- returned is Invalid_FD if file cannot be opened.
function Open_Read_Write
(Name : String;
Fmode : Mode)
return File_Descriptor;
-- Open file Name for both reading and writing, returning file
-- descriptor. File descriptor returned is Invalid_FD if file cannot be
-- opened.
function Create_File
(Name : String;
Fmode : Mode)
return File_Descriptor;
-- Creates new file with given name for writing, returning file descriptor
-- for subsequent use in Write calls. File descriptor returned is
-- Invalid_FD if file cannot be successfully created
function Create_New_File
(Name : String;
Fmode : Mode)
return File_Descriptor;
-- Create new file with given name for writing, returning file descriptor
-- for subsequent use in Write calls. This differs from Create_File in
-- that it fails if the file already exists. File descriptor returned is
-- Invalid_FD if the file exists or cannot be created.
Temp_File_Len : constant Integer := 12;
-- Length of name returned by Create_Temp_File call (GNAT-XXXXXX & NUL)
subtype Temp_File_Name is String (1 .. Temp_File_Len);
-- String subtype set by Create_Temp_File
procedure Create_Temp_File
(FD : out File_Descriptor;
Name : out Temp_File_Name);
-- Create and open for writing a temporary file. The name of the
-- file and the File Descriptor are returned. The File Descriptor
-- returned is Invalid_FD in the case of failure. No mode parameter
-- is provided. Since this is a temporary file, there is no point in
-- doing text translation on it.
procedure Close (FD : File_Descriptor);
pragma Import (C, Close, "close");
-- Close file referenced by FD
procedure Delete_File (Name : String; Success : out Boolean);
-- Deletes file. Success is set True or False indicating if the delete is
-- successful.
procedure Rename_File
(Old_Name : String;
New_Name : String;
Success : out Boolean);
-- Rename a file. Successis set True or False indicating if the rename is
-- successful.
function Read
(FD : File_Descriptor;
A : System.Address;
N : Integer)
return Integer;
pragma Import (C, Read, "read");
-- Read N bytes to address A from file referenced by FD. Returned value
-- is count of bytes actually read, which can be less than N at EOF.
function Write
(FD : File_Descriptor;
A : System.Address;
N : Integer)
return Integer;
pragma Import (C, Write, "write");
-- Write N bytes from address A to file referenced by FD. The returned
-- value is the number of bytes written, which can be less than N if
-- a disk full condition was detected.
Seek_Cur : constant := 1;
Seek_End : constant := 2;
Seek_Set : constant := 0;
-- Used to indicate origin for Lseek call
procedure Lseek
(FD : File_Descriptor;
offset : Long_Integer;
origin : Integer);
pragma Import (C, Lseek, "lseek");
-- Sets the current file pointer to the indicated offset value,
-- relative to the current position (origin = SEEK_CUR), end of
-- file (origin = SEEK_END), or start of file (origin = SEEK_SET).
function File_Length (FD : File_Descriptor) return Long_Integer;
pragma Import (C, File_Length, "__gnat_file_length");
-- Get length of file from file descriptor FD
function File_Time_Stamp (Name : String) return OS_Time;
-- Given the name of a file or directory, Name, obtains and returns the
-- time stamp. This function can be used for an unopend file.
function File_Time_Stamp (FD : File_Descriptor) return OS_Time;
-- Get time stamp of file from file descriptor FD
function Normalize_Pathname
(Name : String;
Directory : String := "")
return String;
-- Returns a file name as an absolute path name, resolving all relative
-- directories, and symbolic links. The parameter Directory is a fully
-- resolved path name for a directory, or the empty string (the default).
-- Name is the name of a file, which is either relative to the given
-- directory name, if Directory is non-null, or to the current working
-- directory if Directory is null. The result returned is the normalized
-- name of the file. For most cases, if two file names designate the same
-- file through different paths, Normalize_Pathname will return the same
-- canonical name in both cases. However, there are cases when this is
-- not true; for example, this is not true in Unix for two hard links
-- designating the same file.
--
-- If Name cannot be resolved or is null on entry (for example if there is
-- a circularity in symbolic links: A is a symbolic link for B, while B is
-- a symbolic link for A), then Normalize_Pathname returns an empty string.
--
-- In VMS, if Name follows the VMS syntax file specification, it is first
-- converted into Unix syntax. If the conversion fails, Normalize_Pathname
-- returns an empty string.
function Is_Absolute_Path (Name : String) return Boolean;
-- Returns True if Name is an absolute path name, i.e. it designates
-- a directory absolutely, rather than relative to another directory.
function Is_Regular_File (Name : String) return Boolean;
-- Determines if the given string, Name, is the name of an existing
-- regular file. Returns True if so, False otherwise.
function Is_Directory (Name : String) return Boolean;
-- Determines if the given string, Name, is the name of a directory.
-- Returns True if so, False otherwise.
function Is_Writable_File (Name : String) return Boolean;
-- Determines if the given string, Name, is the name of an existing
-- file that is writable. Returns True if so, False otherwise.
function Locate_Exec_On_Path
(Exec_Name : String)
return String_Access;
-- Try to locate an executable whose name is given by Exec_Name in the
-- directories listed in the environment Path. If the Exec_Name doesn't
-- have the executable suffix, it will be appended before the search.
-- Otherwise works like Locate_Regular_File below.
--
-- Note that this function allocates some memory for the returned value.
-- This memory needs to be deallocated after use.
function Locate_Regular_File
(File_Name : String;
Path : String)
return String_Access;
-- Try to locate a regular file whose name is given by File_Name in the
-- directories listed in Path. If a file is found, its full pathname is
-- returned; otherwise, a null pointer is returned. If the File_Name given
-- is an absolute pathname, then Locate_Regular_File just checks that the
-- file exists and is a regular file. Otherwise, the Path argument is
-- parsed according to OS conventions, and for each directory in the Path
-- a check is made if File_Name is a relative pathname of a regular file
-- from that directory.
--
-- Note that this function allocates some memory for the returned value.
-- This memory needs to be deallocated after use.
function Get_Debuggable_Suffix return String_Access;
-- Return the debuggable suffix convention. Usually this is the same as
-- the convention for Get_Executable_Suffix.
--
-- Note that this function allocates some memory for the returned value.
-- This memory needs to be deallocated after use.
function Get_Executable_Suffix return String_Access;
-- Return the executable suffix convention.
--
-- Note that this function allocates some memory for the returned value.
-- This memory needs to be deallocated after use.
function Get_Object_Suffix return String_Access;
-- Return the object suffix convention.
--
-- Note that this function allocates some memory for the returned value.
-- This memory needs to be deallocated after use.
-- The following section contains low-level routines using addresses to
-- pass file name and executable name. In each routine the name must be
-- Nul-Terminated. For complete documentation refer to the equivalent
-- routine (but using string) defined above.
subtype C_File_Name is System.Address;
-- This subtype is used to document that a parameter is the address
-- of a null-terminated string containing the name of a file.
function Open_Read
(Name : C_File_Name;
Fmode : Mode)
return File_Descriptor;
function Open_Read_Write
(Name : C_File_Name;
Fmode : Mode)
return File_Descriptor;
function Create_File
(Name : C_File_Name;
Fmode : Mode)
return File_Descriptor;
function Create_New_File
(Name : C_File_Name;
Fmode : Mode)
return File_Descriptor;
procedure Delete_File (Name : C_File_Name; Success : out Boolean);
procedure Rename_File
(Old_Name : C_File_Name;
New_Name : C_File_Name;
Success : out Boolean);
function File_Time_Stamp (Name : C_File_Name) return OS_Time;
function Is_Regular_File (Name : C_File_Name) return Boolean;
function Is_Directory (Name : C_File_Name) return Boolean;
function Is_Writable_File (Name : C_File_Name) return Boolean;
function Locate_Regular_File
(File_Name : C_File_Name;
Path : C_File_Name)
return String_Access;
------------------
-- Subprocesses --
------------------
subtype Argument_List is String_List;
-- Type used for argument list in call to Spawn. The lower bound
-- of the array should be 1, and the length of the array indicates
-- the number of arguments.
subtype Argument_List_Access is String_List_Access;
-- Type used to return an Argument_List without dragging in secondary
-- stack.
procedure Spawn
(Program_Name : String;
Args : Argument_List;
Success : out Boolean);
-- The first parameter of function Spawn is the name of the executable.
-- The second parameter contains the arguments to be passed to the
-- program. Success is False if the named program could not be spawned
-- or its execution completed unsuccessfully. Note that the caller will
-- be blocked until the execution of the spawned program is complete.
-- For maximum portability, use a full path name for the Program_Name
-- argument. On some systems (notably Unix systems) a simple file
-- name may also work (if the executable can be located in the path).
--
-- Note: Arguments that contain spaces and/or quotes such as
-- "--GCC=gcc -v" or "--GCC=""gcc-v""" are not portable
-- across OSes. They may or may not have the desired effect.
function Spawn
(Program_Name : String;
Args : Argument_List)
return Integer;
-- Like above, but as function returning the exact exit status
type Process_Id is private;
-- A private type used to identify a process activated by the following
-- non-blocking call. The only meaningful operation on this type is a
-- comparison for equality.
Invalid_Pid : constant Process_Id;
-- A special value used to indicate errors, as described below.
function Non_Blocking_Spawn
(Program_Name : String;
Args : Argument_List)
return Process_Id;
-- This is a non blocking call. The Process_Id of the spawned process
-- is returned. Parameters are to be used as in Spawn. If Invalid_Id
-- is returned the program could not be spawned.
procedure Wait_Process (Pid : out Process_Id; Success : out Boolean);
-- Wait for the completion of any of the processes created by previous
-- calls to Non_Blocking_Spawn. The caller will be suspended until one
-- of these processes terminates (normally or abnormally). If any of
-- these subprocesses terminates prior to the call to Wait_Process (and
-- has not been returned by a previous call to Wait_Process), then the
-- call to Wait_Process is immediate. Pid identifies the process that
-- has terminated (matching the value returned from Non_Blocking_Spawn).
-- Success is set to True if this sub-process terminated successfully.
-- If Pid = Invalid_Id, there were no subprocesses left to wait on.
function Argument_String_To_List
(Arg_String : String)
return Argument_List_Access;
-- Take a string that is a program and it's arguments and parse it into
-- an Argument_List.
-------------------
-- Miscellaneous --
-------------------
function Getenv (Name : String) return String_Access;
-- Get the value of the environment variable. Returns an access
-- to the empty string if the environment variable does not exist
-- or has an explicit null value (in some operating systems these
-- are distinct cases, in others they are not; this interface
-- abstracts away that difference.
procedure Setenv (Name : String; Value : String);
-- Set the value of the environment variable Name to Value. This call
-- modifies the current environment, but does not modify the parent
-- process environment. After a call to Setenv, Getenv (Name) will
-- always return a String_Access referencing the same String as Value.
-- This is true also for the null string case (the actual effect may
-- be to either set an explicit null as the value, or to remove the
-- entry, this is operating system dependent). Note that any following
-- calls to Spawn will pass an environment to the spawned process that
-- includes the changes made by Setenv calls. This procedure is not
-- available under VMS.
procedure OS_Exit (Status : Integer);
pragma Import (C, OS_Exit, "__gnat_os_exit");
-- Exit to OS with given status code (program is terminated)
procedure OS_Abort;
pragma Import (C, OS_Abort, "abort");
-- Exit to OS signalling an abort (traceback or other appropriate
-- diagnostic information should be given if possible, or entry made
-- to the debugger if that is possible).
function Errno return Integer;
pragma Import (C, Errno, "__get_errno");
-- Return the task-safe last error number.
procedure Set_Errno (Errno : Integer);
pragma Import (C, Set_Errno, "__set_errno");
-- Set the task-safe error number.
Directory_Separator : constant Character;
-- The character that is used to separate parts of a pathname.
Path_Separator : constant Character;
-- The character to separate paths in an environment variable value.
private
pragma Import (C, Path_Separator, "__gnat_path_separator");
pragma Import (C, Directory_Separator, "__gnat_dir_separator");
type OS_Time is new Integer;
type File_Descriptor is new Integer;
Standin : constant File_Descriptor := 0;
Standout : constant File_Descriptor := 1;
Standerr : constant File_Descriptor := 2;
Invalid_FD : constant File_Descriptor := -1;
type Process_Id is new Integer;
Invalid_Pid : constant Process_Id := -1;
end GNAT.OS_Lib;
| 43.781853 | 79 | 0.661978 |
235a0b0298eb4aef4b0f80cc08ee149efb9de571 | 770 | ads | Ada | src/gdb/gdb-7.11/gdb/testsuite/gdb.ada/cond_lang/mixed.ads | alrooney/unum-sdk | bbccb10b0cd3500feccbbef22e27ea111c3d18eb | [
"Apache-2.0"
] | 31 | 2018-08-01T21:25:24.000Z | 2022-02-14T07:52:34.000Z | src/gdb/gdb-7.11/gdb/testsuite/gdb.ada/cond_lang/mixed.ads | alrooney/unum-sdk | bbccb10b0cd3500feccbbef22e27ea111c3d18eb | [
"Apache-2.0"
] | 40 | 2018-12-03T19:48:52.000Z | 2021-03-10T06:34:26.000Z | src/gdb/gdb-7.11/gdb/testsuite/gdb.ada/cond_lang/mixed.ads | alrooney/unum-sdk | bbccb10b0cd3500feccbbef22e27ea111c3d18eb | [
"Apache-2.0"
] | 20 | 2018-11-16T21:19:22.000Z | 2021-10-18T23:08:24.000Z | -- Copyright 2010-2016 Free Software Foundation, Inc.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
package Mixed is
procedure Start_Test;
end Mixed;
| 36.666667 | 73 | 0.738961 |
4ae01e2244f502fcbfcec52e7c1957ed16c1d9c4 | 4,970 | adb | Ada | src/lumen-shader.adb | darkestkhan/lumen | d560f322a8efccac7ed5d16db1d2d188245836ba | [
"0BSD"
] | 8 | 2015-07-20T18:20:10.000Z | 2021-01-29T21:09:02.000Z | src/lumen-shader.adb | darkestkhan/lumen | d560f322a8efccac7ed5d16db1d2d188245836ba | [
"0BSD"
] | 10 | 2015-07-20T18:48:45.000Z | 2016-05-07T19:23:31.000Z | src/lumen-shader.adb | darkestkhan/lumen | d560f322a8efccac7ed5d16db1d2d188245836ba | [
"0BSD"
] | 1 | 2018-11-18T17:01:15.000Z | 2018-11-18T17:01:15.000Z |
-- Lumen.Shader -- Helper routines to fetch shader source, load it, and compile
--
-- Chip Richards, NiEstu, Phoenix AZ, Winter 2013
-- This code is covered by the ISC License:
--
-- Copyright © 2010, NiEstu
--
-- 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.
with Ada.Directories;
with Ada.Streams.Stream_IO;
with Interfaces.C;
with System;
with Lumen.Binary;
use type Lumen.Binary.Byte;
package body Lumen.Shader is
---------------------------------------------------------------------------
-- Read shader source from a disk file
procedure From_File (Shader_Type : in GL.Enum;
Name : in String;
ID : out GL.UInt;
Success : out Boolean) is
Result : GL.UInt;
Size : constant Ada.Directories.File_Size :=
Ada.Directories.Size (Name);
Status : GL.Int;
begin -- From_File
-- Tell the GPU to create a new shader
Result := GL.Create_Shader (Shader_Type);
ID := Result;
-- Read shader source from file
declare
use Ada.Streams;
use type Ada.Directories.File_Size;
File : Stream_IO.File_Type;
-- +1 = room for terminating NUL
Source : Stream_Element_Array (1 ..
Stream_Element_Offset (Size + 1));
Last : Stream_Element_Offset;
Source_Ptr : GL.Pointer := Source'Address;
begin
-- Open the file and try to read it all in one gulp, then close it
Stream_IO.Open (File, Stream_IO.In_File, Name);
Stream_IO.Read (File, Source, Last);
Stream_IO.Close (File);
-- Double-check that we got it all
if Last /= Stream_Element_Offset (Size) then
raise Read_Error with "Got only" &
Stream_Element_Offset'Image (Last) &
" bytes out of" &
Ada.Directories.File_Size'Image (Size);
end if;
-- Add a NUL byte to the end of the source string
Source (Source'Last) := 0;
-- Pump the shader source down to the GPU
GL.Shader_Source (Result, 1, Source_Ptr'Address, System.Null_Address);
end;
-- Tell it to compile the source
GL.Compile_Shader (Result);
-- Check that compile worked, return status to caller
GL.Get_Shader (Result, GL.GL_COMPILE_STATUS, Status'Address);
Success := GL.Bool (Status) = GL.GL_TRUE;
return;
end From_File;
---------------------------------------------------------------------------
-- Use shader source provided in a string
procedure From_String (Shader_Type : in GL.Enum;
Source : in String;
ID : out GL.UInt;
Success : out Boolean) is
Result : GL.UInt;
-- doesn't hurt if caller already did it
Text : String := Source & ASCII.NUL;
Source_Ptr : GL.Pointer := Text'Address;
Status : GL.Int;
begin -- From_String
-- Tell the GPU to create a new shader
Result := GL.Create_Shader (Shader_Type);
ID := Result;
-- Pump the shader source down to the GPU
GL.Shader_Source (Result, 1, Source_Ptr'Address, System.Null_Address);
-- Tell it to compile the source
GL.Compile_Shader (Result);
-- Check that compile worked
GL.Get_Shader (Result, GL.GL_COMPILE_STATUS, Status'Address);
Success := GL.Bool (Status) = GL.GL_TRUE;
return;
end From_String;
---------------------------------------------------------------------------
function Get_Info_Log (Shader : GL.UInt) return String is
Log_Len : GL.Int;
begin -- Get_Info_Log
GL.Get_Shader (Shader, GL.GL_INFO_LOG_LENGTH, Log_Len'Address);
declare
Log : Interfaces.C.char_array (1 .. Interfaces.C.size_t (Log_Len));
Got : GL.SizeI;
begin
GL.Get_Shader_Info_Log (Shader, Log'Length, Got'Address, Log'Address);
return Interfaces.C.To_Ada (Log);
end;
end Get_Info_Log;
---------------------------------------------------------------------------
end Lumen.Shader;
| 32.48366 | 79 | 0.571227 |
181d4239f8ea99ef3552a7945b7d4d46f1eca537 | 40,832 | adb | Ada | Acceleration/memcached/hls/flashModel_prj/solution1/.autopilot/db/flashModel.adb | pratik0509/HLSx_Xilinx_edit | 14bdbcdb3107aa225e46a0bfe7d4a2a426e9e1ca | [
"BSD-3-Clause"
] | null | null | null | Acceleration/memcached/hls/flashModel_prj/solution1/.autopilot/db/flashModel.adb | pratik0509/HLSx_Xilinx_edit | 14bdbcdb3107aa225e46a0bfe7d4a2a426e9e1ca | [
"BSD-3-Clause"
] | null | null | null | Acceleration/memcached/hls/flashModel_prj/solution1/.autopilot/db/flashModel.adb | pratik0509/HLSx_Xilinx_edit | 14bdbcdb3107aa225e46a0bfe7d4a2a426e9e1ca | [
"BSD-3-Clause"
] | 1 | 2018-11-13T17:59:49.000Z | 2018-11-13T17:59:49.000Z | <?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>flashModel</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>rdCmdIn_V</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo class_id="6" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>rdCmdIn.V</originalName>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>48</bitwidth>
</Value>
<direction>0</direction>
<if_type>0</if_type>
<array_size>0</array_size>
<bit_vecs class_id="7" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_2">
<Value>
<Obj>
<type>1</type>
<id>2</id>
<name>rdDataOut_V_V</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>rdDataOut.V.V</originalName>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<direction>1</direction>
<if_type>0</if_type>
<array_size>0</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_3">
<Value>
<Obj>
<type>1</type>
<id>3</id>
<name>wrCmdIn_V</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>wrCmdIn.V</originalName>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>48</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>wrDataIn_V_V</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>wrDataIn.V.V</originalName>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<direction>0</direction>
<if_type>0</if_type>
<array_size>0</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
</ports>
<nodes class_id="8" tracking_level="0" version="0">
<count>3</count>
<item_version>0</item_version>
<item class_id="9" tracking_level="1" version="0" object_id="_5">
<Value>
<Obj>
<type>0</type>
<id>24</id>
<name/>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName>flashCmdAggregator_U0</rtlName>
<coreName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>29</item>
<item>30</item>
<item>31</item>
<item>36</item>
</oprand_edges>
<opcode>call</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>2.39</m_delay>
</item>
<item class_id_reference="9" object_id="_6">
<Value>
<Obj>
<type>0</type>
<id>25</id>
<name/>
<fileName>sources/otherModules/flashModel/flashModel.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>118</lineNumber>
<contextFuncName>flashModel</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item class_id="11" tracking_level="0" version="0">
<first>/home/pratik0509/Projects/HLx_Examples/Acceleration/memcached/hls</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>sources/otherModules/flashModel/flashModel.cpp</first>
<second>flashModel</second>
</first>
<second>118</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>flashMemAccess_U0</rtlName>
<coreName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>11</count>
<item_version>0</item_version>
<item>33</item>
<item>34</item>
<item>35</item>
<item>37</item>
<item>38</item>
<item>39</item>
<item>40</item>
<item>41</item>
<item>42</item>
<item>184</item>
<item>185</item>
</oprand_edges>
<opcode>call</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="_7">
<Value>
<Obj>
<type>0</type>
<id>26</id>
<name/>
<fileName>sources/otherModules/flashModel/flashModel.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>119</lineNumber>
<contextFuncName>flashModel</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/pratik0509/Projects/HLx_Examples/Acceleration/memcached/hls</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>sources/otherModules/flashModel/flashModel.cpp</first>
<second>flashModel</second>
</first>
<second>119</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<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>2</count>
<item_version>0</item_version>
<item class_id="16" tracking_level="1" version="0" object_id="_8">
<Value>
<Obj>
<type>2</type>
<id>28</id>
<name>flashCmdAggregator</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<const_type>6</const_type>
<content><constant:flashCmdAggregator></content>
</item>
<item class_id_reference="16" object_id="_9">
<Value>
<Obj>
<type>2</type>
<id>32</id>
<name>flashMemAccess</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<const_type>6</const_type>
<content><constant:flashMemAccess></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="_10">
<Obj>
<type>3</type>
<id>27</id>
<name>flashModel</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<node_objs>
<count>3</count>
<item_version>0</item_version>
<item>24</item>
<item>25</item>
<item>26</item>
</node_objs>
</item>
</blocks>
<edges class_id="19" tracking_level="0" version="0">
<count>15</count>
<item_version>0</item_version>
<item class_id="20" tracking_level="1" version="0" object_id="_11">
<id>29</id>
<edge_type>1</edge_type>
<source_obj>28</source_obj>
<sink_obj>24</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_12">
<id>30</id>
<edge_type>1</edge_type>
<source_obj>1</source_obj>
<sink_obj>24</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_13">
<id>31</id>
<edge_type>1</edge_type>
<source_obj>3</source_obj>
<sink_obj>24</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_14">
<id>33</id>
<edge_type>1</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="_15">
<id>34</id>
<edge_type>1</edge_type>
<source_obj>2</source_obj>
<sink_obj>25</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_16">
<id>35</id>
<edge_type>1</edge_type>
<source_obj>4</source_obj>
<sink_obj>25</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_17">
<id>36</id>
<edge_type>1</edge_type>
<source_obj>5</source_obj>
<sink_obj>24</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_18">
<id>37</id>
<edge_type>1</edge_type>
<source_obj>6</source_obj>
<sink_obj>25</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_19">
<id>38</id>
<edge_type>1</edge_type>
<source_obj>7</source_obj>
<sink_obj>25</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_20">
<id>39</id>
<edge_type>1</edge_type>
<source_obj>8</source_obj>
<sink_obj>25</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_21">
<id>40</id>
<edge_type>1</edge_type>
<source_obj>9</source_obj>
<sink_obj>25</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_22">
<id>41</id>
<edge_type>1</edge_type>
<source_obj>5</source_obj>
<sink_obj>25</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_23">
<id>42</id>
<edge_type>1</edge_type>
<source_obj>10</source_obj>
<sink_obj>25</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_24">
<id>184</id>
<edge_type>4</edge_type>
<source_obj>24</source_obj>
<sink_obj>25</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_25">
<id>185</id>
<edge_type>4</edge_type>
<source_obj>24</source_obj>
<sink_obj>25</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="_26">
<mId>1</mId>
<mTag>flashModel</mTag>
<mType>0</mType>
<sub_regions>
<count>0</count>
<item_version>0</item_version>
</sub_regions>
<basic_blocks>
<count>1</count>
<item_version>0</item_version>
<item>27</item>
</basic_blocks>
<mII>-1</mII>
<mDepth>-1</mDepth>
<mMinTripCount>-1</mMinTripCount>
<mMaxTripCount>-1</mMaxTripCount>
<mMinLatency>3</mMinLatency>
<mMaxLatency>3</mMaxLatency>
<mIsDfPipe>1</mIsDfPipe>
<mDfPipe class_id="23" tracking_level="1" version="0" object_id="_27">
<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>2</count>
<item_version>0</item_version>
<item class_id="26" tracking_level="1" version="0" object_id="_28">
<type>0</type>
<name>flashCmdAggregator_U0</name>
<ssdmobj_id>24</ssdmobj_id>
<pins class_id="27" tracking_level="0" version="0">
<count>3</count>
<item_version>0</item_version>
<item class_id="28" tracking_level="1" version="0" object_id="_29">
<port class_id="29" tracking_level="1" version="0" object_id="_30">
<name>rdCmdIn_V</name>
<dir>3</dir>
<type>0</type>
</port>
<inst class_id="30" tracking_level="1" version="0" object_id="_31">
<type>0</type>
<name>flashCmdAggregator_U0</name>
<ssdmobj_id>24</ssdmobj_id>
</inst>
</item>
<item class_id_reference="28" object_id="_32">
<port class_id_reference="29" object_id="_33">
<name>wrCmdIn_V</name>
<dir>3</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_31"/>
</item>
<item class_id_reference="28" object_id="_34">
<port class_id_reference="29" object_id="_35">
<name>flashAggregateMemCmd_1</name>
<dir>0</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id_reference="_31"/>
</item>
</pins>
</item>
<item class_id_reference="26" object_id="_36">
<type>0</type>
<name>flashMemAccess_U0</name>
<ssdmobj_id>25</ssdmobj_id>
<pins>
<count>8</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_37">
<port class_id_reference="29" object_id="_38">
<name>rdDataOut_V_V</name>
<dir>3</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id="_39">
<type>0</type>
<name>flashMemAccess_U0</name>
<ssdmobj_id>25</ssdmobj_id>
</inst>
</item>
<item class_id_reference="28" object_id="_40">
<port class_id_reference="29" object_id="_41">
<name>wrDataIn_V_V</name>
<dir>3</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_39"/>
</item>
<item class_id_reference="28" object_id="_42">
<port class_id_reference="29" object_id="_43">
<name>memState</name>
<dir>3</dir>
<type>2</type>
</port>
<inst class_id_reference="30" object_id_reference="_39"/>
</item>
<item class_id_reference="28" object_id="_44">
<port class_id_reference="29" object_id="_45">
<name>inputWord_address_V</name>
<dir>3</dir>
<type>2</type>
</port>
<inst class_id_reference="30" object_id_reference="_39"/>
</item>
<item class_id_reference="28" object_id="_46">
<port class_id_reference="29" object_id="_47">
<name>inputWord_count_V</name>
<dir>3</dir>
<type>2</type>
</port>
<inst class_id_reference="30" object_id_reference="_39"/>
</item>
<item class_id_reference="28" object_id="_48">
<port class_id_reference="29" object_id="_49">
<name>inputWord_rdOrWr_V</name>
<dir>3</dir>
<type>2</type>
</port>
<inst class_id_reference="30" object_id_reference="_39"/>
</item>
<item class_id_reference="28" object_id="_50">
<port class_id_reference="29" object_id="_51">
<name>flashAggregateMemCmd_1</name>
<dir>0</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_39"/>
</item>
<item class_id_reference="28" object_id="_52">
<port class_id_reference="29" object_id="_53">
<name>memArray_V</name>
<dir>2</dir>
<type>2</type>
</port>
<inst class_id_reference="30" object_id_reference="_39"/>
</item>
</pins>
</item>
</process_list>
<channel_list class_id="31" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="32" tracking_level="1" version="0" object_id="_54">
<type>1</type>
<name>flashAggregateMemCmd_1</name>
<ssdmobj_id>5</ssdmobj_id>
<ctype>0</ctype>
<depth>16</depth>
<bitwidth>46</bitwidth>
<source class_id_reference="28" object_id="_55">
<port class_id_reference="29" object_id="_56">
<name>in</name>
<dir>3</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_31"/>
</source>
<sink class_id_reference="28" object_id="_57">
<port class_id_reference="29" object_id="_58">
<name>out</name>
<dir>3</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id_reference="_39"/>
</sink>
</item>
</channel_list>
<net_list class_id="33" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</net_list>
</mDfPipe>
</item>
</cdfg_regions>
<fsm class_id="34" tracking_level="1" version="0" object_id="_59">
<states class_id="35" tracking_level="0" version="0">
<count>5</count>
<item_version>0</item_version>
<item class_id="36" tracking_level="1" version="0" object_id="_60">
<id>1</id>
<operations class_id="37" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="38" tracking_level="1" version="0" object_id="_61">
<id>24</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
<item class_id_reference="36" object_id="_62">
<id>2</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="38" object_id="_63">
<id>25</id>
<stage>3</stage>
<latency>3</latency>
</item>
</operations>
</item>
<item class_id_reference="36" object_id="_64">
<id>3</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="38" object_id="_65">
<id>25</id>
<stage>2</stage>
<latency>3</latency>
</item>
</operations>
</item>
<item class_id_reference="36" object_id="_66">
<id>4</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="38" object_id="_67">
<id>25</id>
<stage>1</stage>
<latency>3</latency>
</item>
</operations>
</item>
<item class_id_reference="36" object_id="_68">
<id>5</id>
<operations>
<count>14</count>
<item_version>0</item_version>
<item class_id_reference="38" object_id="_69">
<id>11</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_70">
<id>12</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_71">
<id>13</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_72">
<id>14</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_73">
<id>15</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_74">
<id>16</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_75">
<id>17</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_76">
<id>18</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_77">
<id>19</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_78">
<id>20</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_79">
<id>21</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_80">
<id>22</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_81">
<id>23</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_82">
<id>26</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
</states>
<transitions class_id="39" tracking_level="0" version="0">
<count>4</count>
<item_version>0</item_version>
<item class_id="40" tracking_level="1" version="0" object_id="_83">
<inState>1</inState>
<outState>2</outState>
<condition class_id="41" tracking_level="0" version="0">
<id>0</id>
<sop class_id="42" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="43" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</item>
</sop>
</condition>
</item>
<item class_id_reference="40" object_id="_84">
<inState>2</inState>
<outState>3</outState>
<condition>
<id>1</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>0</count>
<item_version>0</item_version>
</item>
</sop>
</condition>
</item>
<item class_id_reference="40" object_id="_85">
<inState>3</inState>
<outState>4</outState>
<condition>
<id>2</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="40" object_id="_86">
<inState>4</inState>
<outState>5</outState>
<condition>
<id>3</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>0</count>
<item_version>0</item_version>
</item>
</sop>
</condition>
</item>
</transitions>
</fsm>
<res class_id="44" tracking_level="1" version="0" object_id="_87">
<dp_component_resource class_id="45" tracking_level="0" version="0">
<count>2</count>
<item_version>0</item_version>
<item class_id="46" tracking_level="0" version="0">
<first>flashCmdAggregator_U0 (flashCmdAggregator)</first>
<second class_id="47" tracking_level="0" version="0">
<count>2</count>
<item_version>0</item_version>
<item class_id="48" tracking_level="0" version="0">
<first>FF</first>
<second>2</second>
</item>
<item>
<first>LUT</first>
<second>57</second>
</item>
</second>
</item>
<item>
<first>flashMemAccess_U0 (flashMemAccess)</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>BRAM</first>
<second>256</second>
</item>
<item>
<first>FF</first>
<second>189</second>
</item>
<item>
<first>LUT</first>
<second>221</second>
</item>
</second>
</item>
</dp_component_resource>
<dp_expression_resource>
<count>0</count>
<item_version>0</item_version>
</dp_expression_resource>
<dp_fifo_resource>
<count>1</count>
<item_version>0</item_version>
<item>
<first>flashAggregateMemCmd_1_U</first>
<second>
<count>6</count>
<item_version>0</item_version>
<item>
<first>(0Depth)</first>
<second>16</second>
</item>
<item>
<first>(1Bits)</first>
<second>46</second>
</item>
<item>
<first>(2Size:D*B)</first>
<second>736</second>
</item>
<item>
<first>BRAM</first>
<second>3</second>
</item>
<item>
<first>FF</first>
<second>62</second>
</item>
<item>
<first>LUT</first>
<second>47</second>
</item>
</second>
</item>
</dp_fifo_resource>
<dp_memory_resource>
<count>0</count>
<item_version>0</item_version>
</dp_memory_resource>
<dp_multiplexer_resource>
<count>0</count>
<item_version>0</item_version>
</dp_multiplexer_resource>
<dp_register_resource>
<count>0</count>
<item_version>0</item_version>
</dp_register_resource>
<dp_dsp_resource>
<count>2</count>
<item_version>0</item_version>
<item>
<first>flashCmdAggregator_U0</first>
<second>
<count>0</count>
<item_version>0</item_version>
</second>
</item>
<item>
<first>flashMemAccess_U0</first>
<second>
<count>0</count>
<item_version>0</item_version>
</second>
</item>
</dp_dsp_resource>
<dp_component_map class_id="49" tracking_level="0" version="0">
<count>2</count>
<item_version>0</item_version>
<item class_id="50" tracking_level="0" version="0">
<first>flashCmdAggregator_U0 (flashCmdAggregator)</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>24</item>
</second>
</item>
<item>
<first>flashMemAccess_U0 (flashMemAccess)</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>25</item>
</second>
</item>
</dp_component_map>
<dp_expression_map>
<count>0</count>
<item_version>0</item_version>
</dp_expression_map>
<dp_fifo_map>
<count>1</count>
<item_version>0</item_version>
<item>
<first>flashAggregateMemCmd_1_U</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>52</item>
</second>
</item>
</dp_fifo_map>
<dp_memory_map>
<count>0</count>
<item_version>0</item_version>
</dp_memory_map>
</res>
<node_label_latency class_id="51" tracking_level="0" version="0">
<count>3</count>
<item_version>0</item_version>
<item class_id="52" tracking_level="0" version="0">
<first>24</first>
<second class_id="53" tracking_level="0" version="0">
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>25</first>
<second>
<first>1</first>
<second>2</second>
</second>
</item>
<item>
<first>26</first>
<second>
<first>4</first>
<second>0</second>
</second>
</item>
</node_label_latency>
<bblk_ent_exit class_id="54" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="55" tracking_level="0" version="0">
<first>27</first>
<second class_id="56" tracking_level="0" version="0">
<first>0</first>
<second>4</second>
</second>
</item>
</bblk_ent_exit>
<regions class_id="57" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="58" tracking_level="1" version="0" object_id="_88">
<region_name>flashModel</region_name>
<basic_blocks>
<count>1</count>
<item_version>0</item_version>
<item>27</item>
</basic_blocks>
<nodes>
<count>16</count>
<item_version>0</item_version>
<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>
<item>24</item>
<item>25</item>
<item>26</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="59" tracking_level="0" version="0">
<count>2</count>
<item_version>0</item_version>
<item class_id="60" tracking_level="0" version="0">
<first>58</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>25</item>
<item>25</item>
<item>25</item>
</second>
</item>
<item>
<first>78</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>24</item>
</second>
</item>
</dp_fu_nodes>
<dp_fu_nodes_expression class_id="62" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_fu_nodes_expression>
<dp_fu_nodes_module>
<count>2</count>
<item_version>0</item_version>
<item class_id="63" tracking_level="0" version="0">
<first>StgValue_6_flashCmdAggregator_fu_78</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>24</item>
</second>
</item>
<item>
<first>grp_flashMemAccess_fu_58</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>25</item>
<item>25</item>
<item>25</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="64" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="65" tracking_level="0" version="0">
<first class_id="66" tracking_level="0" version="0">
<first>memArray_V</first>
<second>100</second>
</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>25</item>
</second>
</item>
</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="67" tracking_level="0" version="0">
<count>4</count>
<item_version>0</item_version>
<item class_id="68" tracking_level="0" version="0">
<first>rdCmdIn_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>24</item>
</second>
</item>
</second>
</item>
<item>
<first>rdDataOut_V_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>25</item>
</second>
</item>
</second>
</item>
<item>
<first>wrCmdIn_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>24</item>
</second>
</item>
</second>
</item>
<item>
<first>wrDataIn_V_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>25</item>
</second>
</item>
</second>
</item>
</dp_port_io_nodes>
<port2core class_id="69" 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>
| 33.745455 | 98 | 0.481975 |
0e9222b58663332caeb10d57fd41f03b6d2e99c6 | 5,522 | ada | Ada | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c3/c34007f.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 7 | 2020-05-02T17:34:05.000Z | 2021-10-17T10:15:18.000Z | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c3/c34007f.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | null | null | null | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c3/c34007f.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 2 | 2020-07-27T00:22:36.000Z | 2021-04-01T09:41:02.000Z | -- C34007F.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.
--*
-- FOR DERIVED ACCESS TYPES WHOSE DESIGNATED TYPE IS A ONE-DIMENSIONAL
-- ARRAY TYPE:
-- CHECK THAT ALL VALUES OF THE PARENT (BASE) TYPE ARE PRESENT FOR THE
-- DERIVED (BASE) TYPE WHEN THE DERIVED TYPE DEFINITION IS
-- CONSTRAINED.
-- CHECK THAT ANY CONSTRAINT IMPOSED ON THE PARENT SUBTYPE IS ALSO
-- IMPOSED ON THE DERIVED SUBTYPE.
-- JRK 9/25/86
WITH REPORT; USE REPORT;
PROCEDURE C34007F IS
SUBTYPE COMPONENT IS INTEGER;
TYPE DESIGNATED IS ARRAY (NATURAL RANGE <>) OF COMPONENT;
SUBTYPE SUBDESIGNATED IS DESIGNATED (5 .. 7);
PACKAGE PKG IS
TYPE PARENT IS ACCESS DESIGNATED;
FUNCTION CREATE ( F, L : NATURAL;
C : COMPONENT;
DUMMY : PARENT -- TO RESOLVE OVERLOADING.
) RETURN PARENT;
END PKG;
USE PKG;
TYPE T IS NEW PARENT (IDENT_INT (5) .. IDENT_INT (7));
SUBTYPE SUBPARENT IS PARENT (5 .. 7);
TYPE S IS NEW SUBPARENT;
X : T := NEW SUBDESIGNATED'(OTHERS => 2);
Y : S := NEW SUBDESIGNATED'(OTHERS => 2);
PACKAGE BODY PKG IS
FUNCTION CREATE
( F, L : NATURAL;
C : COMPONENT;
DUMMY : PARENT
) RETURN PARENT
IS
A : PARENT := NEW DESIGNATED (F .. L);
B : COMPONENT := C;
BEGIN
FOR I IN F .. L LOOP
A (I) := B;
B := B + 1;
END LOOP;
RETURN A;
END CREATE;
END PKG;
BEGIN
TEST ("C34007F", "CHECK THAT ALL VALUES OF THE PARENT (BASE) " &
"TYPE ARE PRESENT FOR THE DERIVED (BASE) TYPE " &
"WHEN THE DERIVED TYPE DEFINITION IS " &
"CONSTRAINED. ALSO CHECK THAT ANY CONSTRAINT " &
"IMPOSED ON THE PARENT SUBTYPE IS ALSO IMPOSED " &
"ON THE DERIVED SUBTYPE. CHECK FOR DERIVED " &
"ACCESS TYPES WHOSE DESIGNATED TYPE IS A " &
"ONE-DIMENSIONAL ARRAY TYPE");
-- CHECK THAT BASE TYPE VALUES NOT IN THE SUBTYPE ARE PRESENT.
IF CREATE (2, 3, 4, X) . ALL /= (4, 5) OR
CREATE (2, 3, 4, Y) . ALL /= (4, 5) THEN
FAILED ("CAN'T CREATE BASE TYPE VALUES OUTSIDE THE SUBTYPE");
END IF;
IF CREATE (2, 3, 4, X) IN T OR
CREATE (2, 3, 4, Y) IN S THEN
FAILED ("INCORRECT ""IN""");
END IF;
-- CHECK THE DERIVED SUBTYPE CONSTRAINT.
IF X'FIRST /= 5 OR X'LAST /= 7 OR
Y'FIRST /= 5 OR Y'LAST /= 7 THEN
FAILED ("INCORRECT 'FIRST OR 'LAST");
END IF;
BEGIN
X := NEW SUBDESIGNATED'(1, 2, 3);
Y := NEW SUBDESIGNATED'(1, 2, 3);
IF PARENT (X) = PARENT (Y) OR -- USE X AND Y.
X.ALL /= Y.ALL THEN
FAILED ("INCORRECT ALLOCATOR OR CONVERSION TO PARENT");
END IF;
EXCEPTION
WHEN OTHERS =>
FAILED ("EXCEPTION RAISED BY OK ASSIGNMENT");
END;
BEGIN
X := NEW DESIGNATED'(6 .. 8 => 0);
FAILED ("CONSTRAINT_ERROR NOT RAISED -- " &
"X := NEW DESIGNATED'(6 .. 8 => 0)");
IF X = NULL OR ELSE X.ALL = (0, 0, 0) THEN -- USE X.
COMMENT ("X ALTERED -- " &
"X := NEW DESIGNATED'(6 .. 8 => 0)");
END IF;
EXCEPTION
WHEN CONSTRAINT_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ("WRONG EXCEPTION RAISED -- " &
"X := NEW DESIGNATED'(6 .. 8 => 0)");
END;
BEGIN
Y := NEW DESIGNATED'(6 .. 8 => 0);
FAILED ("CONSTRAINT_ERROR NOT RAISED -- " &
"Y := NEW DESIGNATED'(6 .. 8 => 0)");
IF Y = NULL OR ELSE Y.ALL = (0, 0, 0) THEN -- USE Y.
COMMENT ("Y ALTERED -- " &
"Y := NEW DESIGNATED'(6 .. 8 => 0)");
END IF;
EXCEPTION
WHEN CONSTRAINT_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ("WRONG EXCEPTION RAISED -- " &
"Y := NEW DESIGNATED'(6 .. 8 => 0)");
END;
RESULT;
END C34007F;
| 33.670732 | 79 | 0.525172 |
205474f2b0106809263b84cc7666b3ee00e029d0 | 113 | adb | Ada | apps/bootloader/main.adb | ekoeppen/MSP430_Generic_Ada_Drivers | 12b8238ea22dbb0c0c6c63ca46bfa7e2cb80334a | [
"MIT"
] | null | null | null | apps/bootloader/main.adb | ekoeppen/MSP430_Generic_Ada_Drivers | 12b8238ea22dbb0c0c6c63ca46bfa7e2cb80334a | [
"MIT"
] | null | null | null | apps/bootloader/main.adb | ekoeppen/MSP430_Generic_Ada_Drivers | 12b8238ea22dbb0c0c6c63ca46bfa7e2cb80334a | [
"MIT"
] | null | null | null | with Startup;
with Bootloader;
procedure Main is
pragma Preelaborate;
begin
Bootloader.Start;
end Main;
| 10.272727 | 23 | 0.752212 |
4a1946d13dffc0e14b2cfb138b4a73ea708b77f1 | 1,682 | adb | Ada | test/floats/test_floats-read.adb | skill-lang/skillAdaTestSuite | 279ea0c0cd489c2e39d7532a3b68c564497101e2 | [
"BSD-3-Clause"
] | 1 | 2019-02-09T22:04:10.000Z | 2019-02-09T22:04:10.000Z | test/floats/test_floats-read.adb | skill-lang/skillAdaTestSuite | 279ea0c0cd489c2e39d7532a3b68c564497101e2 | [
"BSD-3-Clause"
] | null | null | null | test/floats/test_floats-read.adb | skill-lang/skillAdaTestSuite | 279ea0c0cd489c2e39d7532a3b68c564497101e2 | [
"BSD-3-Clause"
] | null | null | null | package body Test_Floats.Read is
package Skill renames Floats.Api;
procedure Initialize (T : in out Test) is
begin
Set_Name (T, "Test_Floats.Read");
Ahven.Framework.Add_Test_Routine (T, Float'Access, "test float");
Ahven.Framework.Add_Test_Routine (T, Double'Access, "test double");
end Initialize;
procedure Float is
State : access Skill_State := new Skill_State;
begin
Skill.Read (State, "resources/float.check9220858943794241342.sf");
declare
X : Float_Test_Type_Access := Get_Float_Test (State, 1);
begin
Ahven.Assert (X.Get_Zero = 0.0, "is not zero");
Ahven.Assert (X.Get_Minus_Zero = -0.0, "is not minus zero");
Ahven.Assert (X.Get_Zero = X.Get_Minus_Zero, "zero /= minus zero");
Ahven.Assert (X.Get_Two = 2.0, "is not two");
Ahven.Assert (X.Get_Pi = Ada.Numerics.Pi, "is not PI");
Ahven.Assert (X.Get_NaN /= X.Get_NaN, "is not NaN");
end;
end Float;
procedure Double is
State : access Skill_State := new Skill_State;
begin
Skill.Read (State, "resources/float.check9220858943794241342.sf");
declare
X : Double_Test_Type_Access := Get_Double_Test (State, 1);
begin
Ahven.Assert (X.Get_Zero = 0.0, "is not zero");
Ahven.Assert (X.Get_Minus_Zero = -0.0, "is not minus zero");
Ahven.Assert (X.Get_Zero = X.Get_Minus_Zero, "zero /= minus zero");
Ahven.Assert (X.Get_Two = 2.0, "is not two");
Ahven.Assert (X.Get_Pi = Ada.Numerics.Pi, "is not PI");
Ahven.Assert (X.Get_NaN /= X.Get_NaN, "is not NaN");
end;
end Double;
end Test_Floats.Read;
| 35.787234 | 76 | 0.627229 |
20a48d6a0299804069ef5057a4140b9f6eed48fd | 4,771 | adb | Ada | source/nodes/program-nodes-array_component_associations.adb | reznikmm/gela | 20134f1d154fb763812e73860c6f4b04f353df79 | [
"MIT"
] | null | null | null | source/nodes/program-nodes-array_component_associations.adb | reznikmm/gela | 20134f1d154fb763812e73860c6f4b04f353df79 | [
"MIT"
] | null | null | null | source/nodes/program-nodes-array_component_associations.adb | reznikmm/gela | 20134f1d154fb763812e73860c6f4b04f353df79 | [
"MIT"
] | 1 | 2019-10-16T09:05:27.000Z | 2019-10-16T09:05:27.000Z | -- SPDX-FileCopyrightText: 2019 Max Reznik <[email protected]>
--
-- SPDX-License-Identifier: MIT
-------------------------------------------------------------
package body Program.Nodes.Array_Component_Associations is
function Create
(Choices : Program.Element_Vectors.Element_Vector_Access;
Arrow_Token : Program.Lexical_Elements.Lexical_Element_Access;
Component_Value : Program.Elements.Expressions.Expression_Access;
Box_Token : Program.Lexical_Elements.Lexical_Element_Access)
return Array_Component_Association is
begin
return Result : Array_Component_Association :=
(Choices => Choices, Arrow_Token => Arrow_Token,
Component_Value => Component_Value, Box_Token => Box_Token,
Enclosing_Element => null)
do
Initialize (Result);
end return;
end Create;
function Create
(Choices : Program.Element_Vectors.Element_Vector_Access;
Component_Value : Program.Elements.Expressions.Expression_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return Implicit_Array_Component_Association is
begin
return Result : Implicit_Array_Component_Association :=
(Choices => Choices, Component_Value => Component_Value,
Is_Part_Of_Implicit => Is_Part_Of_Implicit,
Is_Part_Of_Inherited => Is_Part_Of_Inherited,
Is_Part_Of_Instance => Is_Part_Of_Instance, Enclosing_Element => null)
do
Initialize (Result);
end return;
end Create;
overriding function Choices
(Self : Base_Array_Component_Association)
return Program.Element_Vectors.Element_Vector_Access is
begin
return Self.Choices;
end Choices;
overriding function Component_Value
(Self : Base_Array_Component_Association)
return Program.Elements.Expressions.Expression_Access is
begin
return Self.Component_Value;
end Component_Value;
overriding function Arrow_Token
(Self : Array_Component_Association)
return Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Arrow_Token;
end Arrow_Token;
overriding function Box_Token
(Self : Array_Component_Association)
return Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Box_Token;
end Box_Token;
overriding function Is_Part_Of_Implicit
(Self : Implicit_Array_Component_Association)
return Boolean is
begin
return Self.Is_Part_Of_Implicit;
end Is_Part_Of_Implicit;
overriding function Is_Part_Of_Inherited
(Self : Implicit_Array_Component_Association)
return Boolean is
begin
return Self.Is_Part_Of_Inherited;
end Is_Part_Of_Inherited;
overriding function Is_Part_Of_Instance
(Self : Implicit_Array_Component_Association)
return Boolean is
begin
return Self.Is_Part_Of_Instance;
end Is_Part_Of_Instance;
procedure Initialize
(Self : in out Base_Array_Component_Association'Class) is
begin
for Item in Self.Choices.Each_Element loop
Set_Enclosing_Element (Item.Element, Self'Unchecked_Access);
end loop;
if Self.Component_Value.Assigned then
Set_Enclosing_Element (Self.Component_Value, Self'Unchecked_Access);
end if;
null;
end Initialize;
overriding function Is_Array_Component_Association
(Self : Base_Array_Component_Association)
return Boolean is
pragma Unreferenced (Self);
begin
return True;
end Is_Array_Component_Association;
overriding function Is_Association
(Self : Base_Array_Component_Association)
return Boolean is
pragma Unreferenced (Self);
begin
return True;
end Is_Association;
overriding procedure Visit
(Self : not null access Base_Array_Component_Association;
Visitor : in out Program.Element_Visitors.Element_Visitor'Class) is
begin
Visitor.Array_Component_Association (Self);
end Visit;
overriding function To_Array_Component_Association_Text
(Self : in out Array_Component_Association)
return Program.Elements.Array_Component_Associations
.Array_Component_Association_Text_Access is
begin
return Self'Unchecked_Access;
end To_Array_Component_Association_Text;
overriding function To_Array_Component_Association_Text
(Self : in out Implicit_Array_Component_Association)
return Program.Elements.Array_Component_Associations
.Array_Component_Association_Text_Access is
pragma Unreferenced (Self);
begin
return null;
end To_Array_Component_Association_Text;
end Program.Nodes.Array_Component_Associations;
| 33.131944 | 79 | 0.731712 |
20d12cfb0683f9afbacf2a89a16d129c63804372 | 11,439 | adb | Ada | virtual_memory/memory.adb | SMerrony/dgemua | 138b09f814c3576e45fe8d25303a6c2329999757 | [
"MIT"
] | 2 | 2021-03-26T08:25:38.000Z | 2021-06-08T03:10:12.000Z | virtual_memory/memory.adb | SMerrony/dgemua | 138b09f814c3576e45fe8d25303a6c2329999757 | [
"MIT"
] | null | null | null | virtual_memory/memory.adb | SMerrony/dgemua | 138b09f814c3576e45fe8d25303a6c2329999757 | [
"MIT"
] | null | null | null | -- MIT License
-- Copyright (c) 2021 Stephen Merrony
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
-- The above copyright notice and this permission notice shall be included in all
-- copies or substantial portions of the Software.
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-- SOFTWARE.
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Ada.Text_IO;
with Debug_Logs; use Debug_Logs;
package body Memory is
protected body RAM is
procedure Init (Debug_Logging : in Boolean) is
begin
Logging := Debug_Logging;
-- always need to map user page 0
Map_Page (Ring_7_Page_0, false);
First_Shared_Page := (2 ** 31) - 1;
Num_Shared_Pages := 0;
Num_Unshared_Pages := 0;
end Init;
procedure Map_Page (Page : in Natural; Is_Shared : in Boolean) is
New_Page : Page_T := (others => 0);
begin
if Page_Mapped(Page) then
raise Page_Already_Mapped with Page'Image;
else
VRAM.Include(Page, New_Page);
if Is_Shared then
Num_Shared_Pages := Num_Shared_Pages + 1;
if Page < First_Shared_Page then
First_Shared_Page := Page;
end if;
else
Num_Unshared_Pages := Num_Unshared_Pages + 1;
Last_Unshared_Page := Page;
end if;
end if;
Ada.Text_IO.Put_Line ("Memory: Mapped " &
(if Is_Shared then "Shared" else "Unshared") &
" page " & Int_To_String(Page, Hex, 8));
end Map_Page;
function Page_Mapped (Page : in Natural) return Boolean is (VRAM.Contains(Page));
function Address_Mapped (Addr : in Phys_Addr_T) return Boolean is
(VRAM.Contains(Natural(Shift_Right(Addr, 10))));
procedure Map_Range (Start_Addr : in Phys_Addr_T;
Region : in Memory_Region;
Is_Shared : in Boolean) is
Loc : Phys_Addr_T;
begin
for Offset in Region'Range loop
Loc := Start_Addr + Phys_Addr_T(Offset - Region'First);
-- if we have hit a page boundary then check it's mapped
if (Loc and 16#03ff#) = 0 then
if not Address_Mapped(Loc) then
Map_Page(Natural(Shift_Right(Loc, 10)), Is_Shared);
Ada.Text_IO.Put_Line ("Memory: Mapped " &
(if Is_Shared then "Shared" else "Unshared") &
" page " & Int_To_String(Natural(Shift_Right(Loc, 10)), Hex, 8) &
" for " & Dword_To_String(Dword_T(Loc), Hex, 8));
end if;
end if;
Write_Word(Loc, Region(Offset));
end loop;
end Map_Range;
procedure Map_Shared_Pages (Start_Addr : in Phys_Addr_T; Pages : in Page_Arr_T) is
Page_Start : Phys_Addr_T;
begin
for P in Pages'Range loop
Page_Start := Start_Addr + Phys_Addr_T(P * Words_Per_Page);
if not Address_Mapped (Page_Start) then
Map_Page(Natural(Shift_Right(Page_Start,10)), true);
end if;
for W in 0 .. Words_Per_Page - 1 loop
Write_Word(Page_Start + Phys_Addr_T(W), Pages(P)(W));
end loop;
end loop;
end Map_Shared_Pages;
function Get_Last_Unshared_Page return Dword_T is
(Dword_T(Last_Unshared_Page));
function Get_First_Shared_Page return Dword_T is
(Dword_T(First_Shared_Page));
function Get_Num_Shared_Pages return Dword_T is
(Dword_T(Num_Shared_Pages));
function Get_Num_Unshared_Pages return Dword_T is
(Dword_T(Num_Unshared_Pages));
function Read_Word (Word_Addr : in Phys_Addr_T) return Word_T is
pragma Suppress (Index_Check);
Page : Natural := Natural(Shift_Right(Word_Addr, 10));
begin
if not Page_Mapped(Page) then
raise Read_From_Unmapped_Page with Int_To_String(Page, Hex, 8) &
" Unmapped Read for address: " & Dword_To_String(Dword_T(Word_Addr), Octal, 11);
end if;
return VRAM(Page)(Integer(Word_Addr and 16#03ff#));
end Read_Word;
function Read_Dword (Word_Addr : in Phys_Addr_T) return Dword_T is
Page : Natural := Natural(Shift_Right(Word_Addr, 10));
Hi_WD : Word_T := Read_Word(Word_Addr);
Lo_WD : Word_T := Read_Word(Word_Addr + 1);
begin
return Dword_From_Two_Words(Hi_WD, Lo_WD);
end Read_Dword;
function Read_Qword (Word_Addr : in Phys_Addr_T) return Qword_T is
DW_L, DW_R : Dword_T;
begin
DW_L := Read_Dword (Word_Addr);
DW_R := Read_Dword (Word_Addr + 2);
return Shift_Left(Qword_T(DW_L), 32) or Qword_T(DW_R);
end Read_Qword;
procedure Write_Word (Word_Addr : in Phys_Addr_T; Datum : Word_T) is
Page : Natural := Natural(Shift_Right(Word_Addr, 10));
begin
if not Page_Mapped(Page) then
raise Write_To_Unmapped_Page with Page'Image;
end if;
VRAM(Page)(Integer(Word_Addr and 16#03ff#)) := Datum;
end Write_Word;
procedure Write_Dword (Word_Addr : in Phys_Addr_T; Datum : Dword_T) is
begin
Write_Word(Word_Addr, Upper_Word(Datum));
Write_Word(Word_Addr + 1, Lower_Word(Datum));
end Write_Dword;
procedure Write_Qword (Word_Addr : in Phys_Addr_T; Datum : Qword_T) is
begin
Write_Dword(Word_Addr, Dword_T(Shift_Right(Datum, 32)));
Write_Dword(Word_Addr + 2, Dword_T(Datum and 16#0000_ffff#));
end Write_Qword;
function Read_Byte (Word_Addr : in Phys_Addr_T; Low_Byte : in Boolean) return Byte_T
is
W : Word_T;
begin
W := Read_Word (Word_Addr);
if not Low_Byte then
W := Shift_Right (W, 8);
end if;
return Byte_T (W and 16#00ff#);
end Read_Byte;
function Read_Byte_BA (BA : in Dword_T) return Byte_T is
LB : Boolean := Test_DW_Bit (BA, 31);
begin
return Read_Byte (Phys_Addr_T(Shift_Right(BA, 1)), LB);
end Read_Byte_BA;
function Read_Bytes_BA (BA : in Dword_T; Num : in Natural) return Byte_Arr_T is
Bytes : Byte_Arr_T (0 .. Num-1);
begin
for B in Bytes'Range loop
Bytes(B) := Read_Byte_BA (BA + Dword_T(B));
end loop;
return Bytes;
end Read_Bytes_BA;
function Read_String_BA (BA : in Dword_T; Keep_NUL : in Boolean) return String is
Is_Low_Byte : Boolean := Test_DW_Bit (BA, 31);
Byte, Low_Byte : Byte_T;
Offset : Dword_T := 0;
U_Str : Unbounded_String;
begin
loop
Byte := Read_Byte_BA (BA + Offset);
exit when Byte = 0;
U_Str := U_Str & Byte_To_Char(Byte);
Offset := Offset + 1;
end loop;
if Keep_NUL then
return To_String(U_Str) & ASCII.NUL;
else
return To_String(U_Str);
end if;
end Read_String_BA;
procedure Write_String_BA (BA : in Dword_T; Str : in String) is
-- Write an AOS/VS "String" into memory, appending a NUL character
Offset : Dword_T := 0;
begin
for C in Str'Range loop
Write_Byte_BA (BA + Offset, Byte_T(Character'Pos(Str(C))));
Offset := Offset + 1;
end loop;
Write_Byte_BA (BA + Offset, 0);
end Write_String_BA;
function Read_Byte_Eclipse_BA (Segment : in Phys_Addr_T; BA_16 : in Word_T) return Byte_T is
Low_Byte : Boolean := Test_W_Bit(BA_16, 15);
Addr : Phys_Addr_T;
begin
Addr := Shift_Right(Phys_Addr_T(BA_16), 1) or Segment;
return Read_Byte(Addr, Low_Byte);
end Read_Byte_Eclipse_BA;
procedure Write_Byte_Eclipse_BA (Segment : in Phys_Addr_T; BA_16 : in Word_T; Datum : in Byte_T) is
Low_Byte : Boolean := Test_W_Bit(BA_16, 15);
Addr : Phys_Addr_T;
begin
Addr := Shift_Right(Phys_Addr_T(BA_16), 1) or Segment;
Write_Byte (Addr, Low_Byte, Datum);
end Write_Byte_Eclipse_BA;
procedure Write_Byte (Word_Addr : in Phys_Addr_T; Low_Byte : in Boolean; Byt : in Byte_T) is
Wd : Word_T := Read_Word(Word_Addr);
begin
if Low_Byte then
Wd := (Wd and 16#ff00#) or Word_T(Byt);
else
Wd := Shift_Left(Word_T(Byt), 8) or (Wd and 16#00ff#);
end if;
Write_Word(Word_Addr, Wd);
end Write_Byte;
procedure Write_Byte_BA (BA : in Dword_T; Datum : in Byte_T) is
LB : Boolean := Test_DW_Bit (BA, 31);
begin
Write_Byte (Phys_Addr_T(Shift_Right(BA, 1)), LB, Datum);
end Write_Byte_BA;
procedure Copy_Byte_BA (Src, Dest : in Dword_T) is
Src_LB : Boolean := Test_DW_Bit (Src, 31);
Dest_LB : Boolean := Test_DW_Bit (Dest, 31);
Byt : Byte_T;
begin
Byt := Read_Byte (Phys_Addr_T(Shift_Right(Src, 1)), Src_LB);
Write_Byte (Phys_Addr_T(Shift_Right(Dest, 1)), Dest_LB, Byt);
end Copy_Byte_BA;
end RAM;
protected body Narrow_Stack is
procedure Push (Segment : in Phys_Addr_T; Datum : in Word_T) is
New_NSP : Word_T := RAM.Read_Word (NSP_Loc or Segment) + 1;
begin
RAM.Write_Word (NSP_Loc or Segment, New_NSP);
RAM.Write_Word (Phys_Addr_T (New_NSP) or Segment, Datum);
end Push;
function Pop (Segment : in Phys_Addr_T) return Word_T is
Old_NSP : Word_T := RAM.Read_Word (NSP_Loc or Segment);
Datum : Word_T := RAM.Read_Word (Phys_Addr_T (Old_NSP) or Segment);
begin
RAM.Write_Word (NSP_Loc or Segment, Old_NSP - 1);
return Datum;
end Pop;
end Narrow_Stack;
end Memory; | 40.420495 | 107 | 0.574001 |
d0a0d2feb11491f4511e678c788cb6c387c78427 | 1,442 | ads | Ada | src/fltk-devices-surfaces-copy.ads | micahwelf/FLTK-Ada | 83e0c58ea98e5ede2cbbb158b42eae44196c3ba7 | [
"Unlicense"
] | 1 | 2020-12-18T15:20:13.000Z | 2020-12-18T15:20:13.000Z | src/fltk-devices-surfaces-copy.ads | micahwelf/FLTK-Ada | 83e0c58ea98e5ede2cbbb158b42eae44196c3ba7 | [
"Unlicense"
] | null | null | null | src/fltk-devices-surfaces-copy.ads | micahwelf/FLTK-Ada | 83e0c58ea98e5ede2cbbb158b42eae44196c3ba7 | [
"Unlicense"
] | null | null | null |
with
FLTK.Widgets.Groups.Windows;
package FLTK.Devices.Surfaces.Copy is
type Copy_Surface is new Surface_Device with private;
type Copy_Surface_Reference (Data : not null access Copy_Surface'Class) is
limited null record with Implicit_Dereference => Data;
package Forge is
function Create
(W, H : in Natural)
return Copy_Surface;
end Forge;
function Get_W
(This : in Copy_Surface)
return Integer;
function Get_H
(This : in Copy_Surface)
return Integer;
procedure Draw_Widget
(This : in out Copy_Surface;
Item : in FLTK.Widgets.Widget'Class;
Offset_X, Offset_Y : in Integer := 0);
procedure Draw_Decorated_Window
(This : in out Copy_Surface;
Item : in FLTK.Widgets.Groups.Windows.Window'Class;
Offset_X, Offset_Y : in Integer := 0);
procedure Set_Current
(This : in out Copy_Surface);
private
type Copy_Surface is new Surface_Device with null record;
overriding procedure Finalize
(This : in out Copy_Surface);
pragma Inline (Get_W);
pragma Inline (Get_H);
pragma Inline (Draw_Widget);
pragma Inline (Draw_Decorated_Window);
pragma Inline (Set_Current);
end FLTK.Devices.Surfaces.Copy;
| 17.585366 | 81 | 0.598474 |
dcd28faded3c3177c8f07f75608b4fce824d7bc1 | 2,573 | adb | Ada | ordinary/runge_5th_order_demo_1.adb | jscparker/math_packages | b112a90338014d5c2dfae3f7265ee30841fb6cfd | [
"ISC",
"MIT"
] | 30 | 2018-12-09T01:15:04.000Z | 2022-03-20T16:14:54.000Z | ordinary/runge_5th_order_demo_1.adb | jscparker/math_packages | b112a90338014d5c2dfae3f7265ee30841fb6cfd | [
"ISC",
"MIT"
] | null | null | null | ordinary/runge_5th_order_demo_1.adb | jscparker/math_packages | b112a90338014d5c2dfae3f7265ee30841fb6cfd | [
"ISC",
"MIT"
] | null | null | null | with Runge_5th;
with Text_IO; use Text_IO;
with Sinu;
with Ada.Numerics.Generic_Elementary_Functions;
procedure runge_5th_order_demo_1 is
type Real is digits 15;
package Sinusoid is new Sinu (Real);
use Sinusoid;
package Sin_Integrate is new
Runge_5th (Real, Dyn_Index, Dynamical_Variable, F, "*", "+", "-", Norm);
use Sin_Integrate;
package mth is new Ada.Numerics.Generic_Elementary_Functions(Real);
use mth;
package rio is new Float_IO(Real);
use rio;
package iio is new Integer_IO(Step_Integer);
use iio;
Initial_Condition : Dynamical_Variable;
Previous_Y, Final_Y : Dynamical_Variable;
Final_Time, Starting_Time : Real;
Previous_t, Final_t : Real;
Delta_t : Real;
Steps : Step_Integer;
Error_Tolerance : Real := 1.0E-12;
Error_Control_Desired : Boolean := False;
begin
new_line;
put ("Test integrates an equation whose solution is Sin(t).");
new_line;
put ("The equation is (d/dt)**2 (Y) = -Y. (Y = Sin(t) has a period of 2*Pi.)");
new_line(2);
put ("Enter number of time steps (try 1024): ");
get (Steps);
new_line;
put ("Every time the integration advances this number of steps, ERROR is printed.");
new_line;
-- choose initial conditions
Initial_Condition(0) := 0.0;
Initial_Condition(1) := 1.0;
Starting_Time := 0.0;
Final_Time := 64.0; --about 10 periods of Y = Sin
Previous_Y := Initial_Condition;
Previous_t := Starting_Time;
Delta_t := Final_Time - Starting_Time;
for i in 1..28 loop
Final_t := Previous_t + Delta_t;
Integrate
(Final_State => Final_Y, -- the result (output).
Final_Time => Final_t, -- integrate out to here (input).
Initial_State => Previous_Y, -- input an initial condition (input).
Initial_Time => Previous_t, -- start integrating here (input).
No_Of_Steps => Steps); -- if no err control, use this no_of_steps
Previous_Y := Final_Y;
Previous_t := Final_t;
-- Start over.
--put ("Final value of numerically integrated sin: ");
--put (Final_Y(0), Aft => 7);
new_line;
put ("Time = t =");
put (Final_t, Aft => 7);
put (", Error = Sin(t)-Y = ");
put (Sin (Real (Final_t)) - Final_Y(0), Aft => 7);
end loop;
new_line(2);
put ("Total elapsed time is:");
put (Final_t / (2.0*3.14159265), Aft => 7);
put (" in units of 2 pi.");
end;
| 28.910112 | 87 | 0.601632 |
d00d23b7942e043ec0d01ffb449cd679d4ce8772 | 12,475 | ads | Ada | gcc-gcc-7_3_0-release/gcc/ada/s-stalib.ads | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 7 | 2020-05-02T17:34:05.000Z | 2021-10-17T10:15:18.000Z | gcc-gcc-7_3_0-release/gcc/ada/s-stalib.ads | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | null | null | null | gcc-gcc-7_3_0-release/gcc/ada/s-stalib.ads | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 2 | 2020-07-27T00:22:36.000Z | 2021-04-01T09:41:02.000Z | ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S Y S T E M . S T A N D A R D _ L I B R A R Y --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2015, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package is included in all programs. It contains declarations that
-- are required to be part of every Ada program. A special mechanism is
-- required to ensure that these are loaded, since it may be the case in
-- some programs that the only references to these required packages are
-- from C code or from code generated directly by Gigi, and in both cases
-- the binder is not aware of such references.
-- System.Standard_Library also includes data that must be present in every
-- program, in particular data for all the standard exceptions, and also some
-- subprograms that must be present in every program.
-- The binder unconditionally includes s-stalib.ali, which ensures that this
-- package and the packages it references are included in all Ada programs,
-- together with the included data.
pragma Compiler_Unit_Warning;
pragma Polling (Off);
-- We must turn polling off for this unit, because otherwise we get
-- elaboration circularities with Ada.Exceptions if polling is on.
with Ada.Unchecked_Conversion;
package System.Standard_Library is
-- Historical note: pragma Preelaborate was surrounded by a pair of pragma
-- Warnings (Off/On) to circumvent a bootstrap issue.
pragma Preelaborate;
subtype Big_String is String (1 .. Positive'Last);
pragma Suppress_Initialization (Big_String);
-- Type used to obtain string access to given address. Initialization is
-- suppressed, since we never want to have variables of this type, and
-- we never want to attempt initialiazation of virtual variables of this
-- type (e.g. when pragma Normalize_Scalars is used).
type Big_String_Ptr is access all Big_String;
for Big_String_Ptr'Storage_Size use 0;
-- We use this access type to pass a pointer to an area of storage to be
-- accessed as a string. Of course when this pointer is used, it is the
-- responsibility of the accessor to ensure proper bounds. The storage
-- size clause ensures we do not allocate variables of this type.
function To_Ptr is
new Ada.Unchecked_Conversion (System.Address, Big_String_Ptr);
-------------------------------------
-- Exception Declarations and Data --
-------------------------------------
type Raise_Action is access procedure;
-- A pointer to a procedure used in the Raise_Hook field
type Exception_Data;
type Exception_Data_Ptr is access all Exception_Data;
-- An equivalent of Exception_Id that is public
-- The following record defines the underlying representation of exceptions
-- WARNING: Any changes to this may need to be reflected in the following
-- locations in the compiler and runtime code:
-- 1. The Internal_Exception routine in s-exctab.adb
-- 2. The processing in gigi that tests Not_Handled_By_Others
-- 3. Expand_N_Exception_Declaration in Exp_Ch11
-- 4. The construction of the exception type in Cstand
type Exception_Data is record
Not_Handled_By_Others : Boolean;
-- Normally set False, indicating that the exception is handled in the
-- usual way by others (i.e. an others handler handles the exception).
-- Set True to indicate that this exception is not caught by others
-- handlers, but must be explicitly named in a handler. This latter
-- setting is currently used by the Abort_Signal.
Lang : Character;
-- A character indicating the language raising the exception.
-- Set to "A" for exceptions defined by an Ada program.
-- Set to "C" for imported C++ exceptions.
Name_Length : Natural;
-- Length of fully expanded name of exception
Full_Name : System.Address;
-- Fully expanded name of exception, null terminated
-- You can use To_Ptr to convert this to a string.
HTable_Ptr : Exception_Data_Ptr;
-- Hash table pointer used to link entries together in the hash table
-- built (by Register_Exception in s-exctab.adb) for converting between
-- identities and names.
Foreign_Data : Address;
-- Data for imported exceptions. Not used in the Ada case. This
-- represents the address of the RTTI for the C++ case.
Raise_Hook : Raise_Action;
-- This field can be used to place a "hook" on an exception. If the
-- value is non-null, then it points to a procedure which is called
-- whenever the exception is raised. This call occurs immediately,
-- before any other actions taken by the raise (and in particular
-- before any unwinding of the stack occurs).
end record;
-- Definitions for standard predefined exceptions defined in Standard,
-- Why are the NULs necessary here, seems like they should not be
-- required, since Gigi is supposed to add a Nul to each name ???
Constraint_Error_Name : constant String := "CONSTRAINT_ERROR" & ASCII.NUL;
Program_Error_Name : constant String := "PROGRAM_ERROR" & ASCII.NUL;
Storage_Error_Name : constant String := "STORAGE_ERROR" & ASCII.NUL;
Tasking_Error_Name : constant String := "TASKING_ERROR" & ASCII.NUL;
Abort_Signal_Name : constant String := "_ABORT_SIGNAL" & ASCII.NUL;
Numeric_Error_Name : constant String := "NUMERIC_ERROR" & ASCII.NUL;
-- This is used only in the Ada 83 case, but it is not worth having a
-- separate version of s-stalib.ads for use in Ada 83 mode.
Constraint_Error_Def : aliased Exception_Data :=
(Not_Handled_By_Others => False,
Lang => 'A',
Name_Length => Constraint_Error_Name'Length,
Full_Name => Constraint_Error_Name'Address,
HTable_Ptr => null,
Foreign_Data => Null_Address,
Raise_Hook => null);
Numeric_Error_Def : aliased Exception_Data :=
(Not_Handled_By_Others => False,
Lang => 'A',
Name_Length => Numeric_Error_Name'Length,
Full_Name => Numeric_Error_Name'Address,
HTable_Ptr => null,
Foreign_Data => Null_Address,
Raise_Hook => null);
Program_Error_Def : aliased Exception_Data :=
(Not_Handled_By_Others => False,
Lang => 'A',
Name_Length => Program_Error_Name'Length,
Full_Name => Program_Error_Name'Address,
HTable_Ptr => null,
Foreign_Data => Null_Address,
Raise_Hook => null);
Storage_Error_Def : aliased Exception_Data :=
(Not_Handled_By_Others => False,
Lang => 'A',
Name_Length => Storage_Error_Name'Length,
Full_Name => Storage_Error_Name'Address,
HTable_Ptr => null,
Foreign_Data => Null_Address,
Raise_Hook => null);
Tasking_Error_Def : aliased Exception_Data :=
(Not_Handled_By_Others => False,
Lang => 'A',
Name_Length => Tasking_Error_Name'Length,
Full_Name => Tasking_Error_Name'Address,
HTable_Ptr => null,
Foreign_Data => Null_Address,
Raise_Hook => null);
Abort_Signal_Def : aliased Exception_Data :=
(Not_Handled_By_Others => True,
Lang => 'A',
Name_Length => Abort_Signal_Name'Length,
Full_Name => Abort_Signal_Name'Address,
HTable_Ptr => null,
Foreign_Data => Null_Address,
Raise_Hook => null);
pragma Export (C, Constraint_Error_Def, "constraint_error");
pragma Export (C, Numeric_Error_Def, "numeric_error");
pragma Export (C, Program_Error_Def, "program_error");
pragma Export (C, Storage_Error_Def, "storage_error");
pragma Export (C, Tasking_Error_Def, "tasking_error");
pragma Export (C, Abort_Signal_Def, "_abort_signal");
Local_Partition_ID : Natural := 0;
-- This variable contains the local Partition_ID that will be used when
-- building exception occurrences. In distributed mode, it will be
-- set by each partition to the correct value during the elaboration.
type Exception_Trace_Kind is
(RM_Convention,
-- No particular trace is requested, only unhandled exceptions
-- in the environment task (following the RM) will be printed.
-- This is the default behavior.
Every_Raise,
-- Denotes the initial raise event for any exception occurrence, either
-- explicit or due to a specific language rule, within the context of a
-- task or not.
Unhandled_Raise,
-- Denotes the raise events corresponding to exceptions for which there
-- is no user defined handler. This includes unhandled exceptions in
-- task bodies.
Unhandled_Raise_In_Main
-- Same as Unhandled_Raise, except exceptions in task bodies are not
-- included. Same as RM_Convention, except (1) the message is printed as
-- soon as the environment task completes due to an unhandled exception
-- (before awaiting the termination of dependent tasks, and before
-- library-level finalization), and (2) a symbolic traceback is given
-- if possible. This is the default behavior if the binder switch -E is
-- used.
);
-- Provide a way to denote different kinds of automatic traces related
-- to exceptions that can be requested.
Exception_Trace : Exception_Trace_Kind := RM_Convention;
pragma Atomic (Exception_Trace);
-- By default, follow the RM convention
-----------------
-- Subprograms --
-----------------
procedure Abort_Undefer_Direct;
pragma Inline (Abort_Undefer_Direct);
-- A little procedure that just calls Abort_Undefer.all, for use in
-- clean up procedures, which only permit a simple subprogram name.
procedure Adafinal;
-- Performs the Ada Runtime finalization the first time it is invoked.
-- All subsequent calls are ignored.
end System.Standard_Library;
| 47.253788 | 79 | 0.608898 |
4aa8307fcf13813c8f30bde1fc35474fe53fac9c | 1,752 | adb | Ada | samples/upload_server.adb | jquorning/ada-servlet | 97db5fcdd59e01441c717b95a9e081aa7d6a7bbe | [
"Apache-2.0"
] | 6 | 2018-01-04T07:19:46.000Z | 2020-12-27T14:49:44.000Z | samples/upload_server.adb | jquorning/ada-servlet | 97db5fcdd59e01441c717b95a9e081aa7d6a7bbe | [
"Apache-2.0"
] | 9 | 2020-12-20T15:29:18.000Z | 2022-02-04T20:13:58.000Z | samples/upload_server.adb | jquorning/ada-servlet | 97db5fcdd59e01441c717b95a9e081aa7d6a7bbe | [
"Apache-2.0"
] | 2 | 2021-01-06T08:32:38.000Z | 2022-01-24T23:46:36.000Z | -----------------------------------------------------------------------
-- upload_server -- Example of server with a servlet
-- Copyright (C) 2012, 2015, 2018, 2021 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- 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 Servlet.Server.Web;
with Servlet.Core;
with Upload_Servlet;
with Util.Log.Loggers;
procedure Upload_Server is
CONFIG_PATH : constant String := "samples.properties";
Upload : aliased Upload_Servlet.Servlet;
App : aliased Servlet.Core.Servlet_Registry;
WS : Servlet.Server.Web.AWS_Container;
Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create ("Upload_Server");
begin
Util.Log.Loggers.Initialize (CONFIG_PATH);
-- Register the servlets and filters
App.Add_Servlet (Name => "upload", Server => Upload'Unchecked_Access);
-- Define servlet mappings
App.Add_Mapping (Name => "upload", Pattern => "*.html");
WS.Register_Application ("/upload", App'Unchecked_Access);
Log.Info ("Connect you browser to: http://localhost:8080/upload/upload.html");
WS.Start;
delay 6000.0;
end Upload_Server;
| 35.755102 | 91 | 0.6621 |
cbdfe0844803a321fc51e4093c62c3e28ef32f70 | 2,462 | adb | Ada | software/hal/boards/pixhawk/hil/hil-clock.adb | TUM-EI-RCS/StratoX | 5fdd04e01a25efef6052376f43ce85b5bc973392 | [
"BSD-3-Clause"
] | 12 | 2017-06-08T14:19:57.000Z | 2022-03-09T02:48:59.000Z | software/hal/boards/pixhawk/hil/hil-clock.adb | TUM-EI-RCS/StratoX | 5fdd04e01a25efef6052376f43ce85b5bc973392 | [
"BSD-3-Clause"
] | 6 | 2017-06-08T13:13:50.000Z | 2020-05-15T09:32:43.000Z | software/hal/boards/pixhawk/hil/hil-clock.adb | TUM-EI-RCS/StratoX | 5fdd04e01a25efef6052376f43ce85b5bc973392 | [
"BSD-3-Clause"
] | 3 | 2017-06-30T14:05:06.000Z | 2022-02-17T12:20:45.000Z | -- Institution: Technische Universität München
-- Department: Realtime Computer Systems (RCS)
-- Project: StratoX
--
-- Authors: Emanuel Regnath ([email protected])
with STM32.Device;
with HIL.Config;
-- @summary
-- Target-specific mapping for HIL of Clock
package body HIL.Clock with
SPARK_Mode => Off
is
procedure configure is
begin
-- GPIOs
STM32.Device.Enable_Clock(STM32.Device.GPIO_A );
STM32.Device.Enable_Clock(STM32.Device.GPIO_B);
STM32.Device.Enable_Clock(STM32.Device.GPIO_C);
STM32.Device.Enable_Clock(STM32.Device.GPIO_D);
STM32.Device.Enable_Clock(STM32.Device.GPIO_E);
-- SPI
STM32.Device.Enable_Clock(STM32.Device.SPI_1);
-- I2C
STM32.Device.Enable_Clock( STM32.Device.I2C_1 ); -- I2C
-- UART (UART3 is Ser2 is Telemtrie2)
STM32.Device.Enable_Clock( STM32.Device.USART_3 );
STM32.Device.Enable_Clock( STM32.Device.UART_4 ); -- GPS
STM32.Device.Enable_Clock( STM32.Device.USART_6 ); -- PX4IO
STM32.Device.Enable_Clock( STM32.Device.USART_7 ); -- SER 5
-- Timers
case HIL.Config.BUZZER_PORT is
when HIL.Config.BUZZER_USE_AUX5 =>
STM32.Device.Enable_Clock (STM32.Device.Timer_4); -- AUX buzzer
STM32.Device.Reset (STM32.Device.Timer_4); -- without this not reliable
when HIL.Config.BUZZER_USE_PORT =>
STM32.Device.Enable_Clock (STM32.Device.Timer_2); -- regular buzzer port
STM32.Device.Reset (STM32.Device.Timer_2); -- without this not reliable
end case;
STM32.Device.Reset( STM32.Device.GPIO_A );
STM32.Device.Reset( STM32.Device.GPIO_B );
STM32.Device.Reset( STM32.Device.GPIO_C );
STM32.Device.Reset( STM32.Device.GPIO_D );
STM32.Device.Reset( STM32.Device.GPIO_E );
STM32.Device.Reset( STM32.Device.SPI_1 );
STM32.Device.Reset( STM32.Device.USART_3 );
STM32.Device.Reset( STM32.Device.UART_4 );
STM32.Device.Reset( STM32.Device.USART_6 );
STM32.Device.Reset( STM32.Device.USART_7 );
end configure;
-- get number of systicks since POR
function getSysTick return Natural is
begin
null;
return 0;
end getSysTick;
-- get system time since POR
function getSysTime return Ada.Real_Time.Time is
begin
return Ada.Real_Time.Clock;
end getSysTime;
end HIL.Clock;
| 31.164557 | 84 | 0.657189 |
dca82e03f939247d809851434beeaa1c1b6598a6 | 1,141 | ads | Ada | src/ada-libc/src/libc-stddef.ads | mstewartgallus/linted | 4d4cf9390353ea045b95671474ab278456793a35 | [
"Apache-2.0"
] | null | null | null | src/ada-libc/src/libc-stddef.ads | mstewartgallus/linted | 4d4cf9390353ea045b95671474ab278456793a35 | [
"Apache-2.0"
] | null | null | null | src/ada-libc/src/libc-stddef.ads | mstewartgallus/linted | 4d4cf9390353ea045b95671474ab278456793a35 | [
"Apache-2.0"
] | null | null | null | -- Copyright 2015 Steven Stewart-Gallus
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-- implied. See the License for the specific language governing
-- permissions and limitations under the License.
with Interfaces.C;
package Libc.Stddef is
pragma Pure;
-- unsupported macro: NULL __null
-- arg-macro: procedure offsetof (TYPE, MEMBER)
-- __builtin_offsetof (TYPE, MEMBER)
subtype ptrdiff_t is
Interfaces.C
.ptrdiff_t; -- /usr/lib/gcc/x86_64-linux-gnu/4.6/include/stddef.h:150
subtype size_t is
Interfaces.C
.size_t; -- /usr/lib/gcc/x86_64-linux-gnu/4.6/include/stddef.h:212
-- subtype wchar_t is Interfaces.C.wchar_t;
-- subtype wint_t is Interfaces.C.unsigned;
end Libc.Stddef;
| 34.575758 | 77 | 0.715162 |
c5621b9114ef35f2e296974103a2f5b148128228 | 6,462 | ads | Ada | source/nodes/program-nodes-formal_type_declarations.ads | optikos/oasis | 9f64d46d26d964790d69f9db681c874cfb3bf96d | [
"MIT"
] | null | null | null | source/nodes/program-nodes-formal_type_declarations.ads | optikos/oasis | 9f64d46d26d964790d69f9db681c874cfb3bf96d | [
"MIT"
] | null | null | null | source/nodes/program-nodes-formal_type_declarations.ads | optikos/oasis | 9f64d46d26d964790d69f9db681c874cfb3bf96d | [
"MIT"
] | 2 | 2019-09-14T23:18:50.000Z | 2019-10-02T10:11:40.000Z | -- Copyright (c) 2019 Maxim Reznik <[email protected]>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
with Program.Lexical_Elements;
with Program.Elements.Defining_Identifiers;
with Program.Elements.Definitions;
with Program.Elements.Formal_Type_Definitions;
with Program.Elements.Aspect_Specifications;
with Program.Elements.Formal_Type_Declarations;
with Program.Element_Visitors;
package Program.Nodes.Formal_Type_Declarations is
pragma Preelaborate;
type Formal_Type_Declaration is
new Program.Nodes.Node
and Program.Elements.Formal_Type_Declarations.Formal_Type_Declaration
and Program.Elements.Formal_Type_Declarations
.Formal_Type_Declaration_Text
with private;
function Create
(Type_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Discriminant_Part : Program.Elements.Definitions.Definition_Access;
Is_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Definition : not null Program.Elements.Formal_Type_Definitions
.Formal_Type_Definition_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return Formal_Type_Declaration;
type Implicit_Formal_Type_Declaration is
new Program.Nodes.Node
and Program.Elements.Formal_Type_Declarations.Formal_Type_Declaration
with private;
function Create
(Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Discriminant_Part : Program.Elements.Definitions.Definition_Access;
Definition : not null Program.Elements.Formal_Type_Definitions
.Formal_Type_Definition_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return Implicit_Formal_Type_Declaration
with Pre =>
Is_Part_Of_Implicit or Is_Part_Of_Inherited or Is_Part_Of_Instance;
private
type Base_Formal_Type_Declaration is
abstract new Program.Nodes.Node
and Program.Elements.Formal_Type_Declarations.Formal_Type_Declaration
with record
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Discriminant_Part : Program.Elements.Definitions.Definition_Access;
Definition : not null Program.Elements.Formal_Type_Definitions
.Formal_Type_Definition_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
end record;
procedure Initialize
(Self : aliased in out Base_Formal_Type_Declaration'Class);
overriding procedure Visit
(Self : not null access Base_Formal_Type_Declaration;
Visitor : in out Program.Element_Visitors.Element_Visitor'Class);
overriding function Name
(Self : Base_Formal_Type_Declaration)
return not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
overriding function Discriminant_Part
(Self : Base_Formal_Type_Declaration)
return Program.Elements.Definitions.Definition_Access;
overriding function Definition
(Self : Base_Formal_Type_Declaration)
return not null Program.Elements.Formal_Type_Definitions
.Formal_Type_Definition_Access;
overriding function Aspects
(Self : Base_Formal_Type_Declaration)
return Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
overriding function Is_Formal_Type_Declaration_Element
(Self : Base_Formal_Type_Declaration)
return Boolean;
overriding function Is_Declaration_Element
(Self : Base_Formal_Type_Declaration)
return Boolean;
type Formal_Type_Declaration is
new Base_Formal_Type_Declaration
and Program.Elements.Formal_Type_Declarations
.Formal_Type_Declaration_Text
with record
Type_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Is_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
end record;
overriding function To_Formal_Type_Declaration_Text
(Self : aliased in out Formal_Type_Declaration)
return Program.Elements.Formal_Type_Declarations
.Formal_Type_Declaration_Text_Access;
overriding function Type_Token
(Self : Formal_Type_Declaration)
return not null Program.Lexical_Elements.Lexical_Element_Access;
overriding function Is_Token
(Self : Formal_Type_Declaration)
return not null Program.Lexical_Elements.Lexical_Element_Access;
overriding function With_Token
(Self : Formal_Type_Declaration)
return Program.Lexical_Elements.Lexical_Element_Access;
overriding function Semicolon_Token
(Self : Formal_Type_Declaration)
return not null Program.Lexical_Elements.Lexical_Element_Access;
type Implicit_Formal_Type_Declaration is
new Base_Formal_Type_Declaration
with record
Is_Part_Of_Implicit : Boolean;
Is_Part_Of_Inherited : Boolean;
Is_Part_Of_Instance : Boolean;
end record;
overriding function To_Formal_Type_Declaration_Text
(Self : aliased in out Implicit_Formal_Type_Declaration)
return Program.Elements.Formal_Type_Declarations
.Formal_Type_Declaration_Text_Access;
overriding function Is_Part_Of_Implicit
(Self : Implicit_Formal_Type_Declaration)
return Boolean;
overriding function Is_Part_Of_Inherited
(Self : Implicit_Formal_Type_Declaration)
return Boolean;
overriding function Is_Part_Of_Instance
(Self : Implicit_Formal_Type_Declaration)
return Boolean;
end Program.Nodes.Formal_Type_Declarations;
| 37.569767 | 78 | 0.742804 |
180a703a05bb50dd5ecd3c1a117cfdaab3e75162 | 3,469 | adb | Ada | src/rejuvenation-nested.adb | TNO/Rejuvenation-Ada | 8113ec28da3923ccde40d76cbab70e0e614f4b75 | [
"BSD-3-Clause"
] | 1 | 2022-03-08T13:00:47.000Z | 2022-03-08T13:00:47.000Z | src/libraries/Rejuvenation_Lib/src/rejuvenation-nested.adb | selroc/Renaissance-Ada | 39230b34aced4a9d83831be346ca103136c53715 | [
"BSD-3-Clause"
] | null | null | null | src/libraries/Rejuvenation_Lib/src/rejuvenation-nested.adb | selroc/Renaissance-Ada | 39230b34aced4a9d83831be346ca103136c53715 | [
"BSD-3-Clause"
] | null | null | null | with Ada.Assertions; use Ada.Assertions;
with Ada.Strings.Fixed; use Ada.Strings.Fixed;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
package body Rejuvenation.Nested is
function Remove_Nested_Flags
(Source : String; On_Flag : String; Off_Flag : String;
Depth : Natural := 0) return String
is
function Next_Flag_Location
(From : Positive; Flag : String) return Positive;
function Next_Flag_Location
(From : Positive; Flag : String) return Positive
is
I : constant Natural := Index (Source, Flag, From);
begin
return (if I = 0 then Source'Last + 1 else I);
end Next_Flag_Location;
function Next_On_Flag_Location (From : Positive) return Positive is
(Next_Flag_Location (From, On_Flag));
function Next_Off_Flag_Location (From : Positive) return Positive is
(Next_Flag_Location (From, Off_Flag));
Current_Location : Natural := Source'First;
Current_Depth : Natural := Depth;
On_Location : Positive := Next_On_Flag_Location (Current_Location);
Off_Location : Positive := Next_Off_Flag_Location (Current_Location);
Final : Unbounded_String := Null_Unbounded_String;
begin
loop
if On_Location > Source'Last and then Off_Location > Source'Last then
Assert
(Check => Current_Depth = 0,
Message =>
"Unexpectedly at Current_Depth " & Current_Depth'Image);
Append (Final, Source (Current_Location .. Source'Last));
return To_String (Final);
elsif On_Location < Off_Location then
declare
Next_Location : constant Positive :=
On_Location + On_Flag'Length;
Last : constant Positive :=
(if Current_Depth = 0 then Next_Location - 1
else On_Location - 1);
begin
Current_Depth := Current_Depth + 1;
Append (Final, Source (Current_Location .. Last));
Current_Location := Next_Location;
Assert
(Check => Current_Location <= Off_Location,
Message => "Invariant violated");
On_Location := Next_On_Flag_Location (Current_Location);
end;
else
Assert
(Check => Off_Location < On_Location,
Message => "On and Off token can't occur at same location");
declare
Next_Location : constant Positive :=
Off_Location + Off_Flag'Length;
Last : constant Positive :=
(if Current_Depth = 1 then Next_Location - 1
else Off_Location - 1);
begin
Assert
(Check => Current_Depth > 0,
Message =>
"Current_Depth is zero at offset " & Off_Location'Image);
Current_Depth := Current_Depth - 1;
Append (Final, Source (Current_Location .. Last));
Current_Location := Next_Location;
Assert
(Check => Current_Location <= On_Location,
Message => "Invariant violated");
Off_Location := Next_Off_Flag_Location (Current_Location);
end;
end if;
end loop;
end Remove_Nested_Flags;
end Rejuvenation.Nested;
| 40.337209 | 79 | 0.571346 |
20bced07892da5c555d63bfad48085950541d1c0 | 2,382 | adb | Ada | awa/plugins/awa-images/regtests/awa-images-services-tests.adb | Letractively/ada-awa | 3c82a4d29ed6c1209a2ac7d5fe123c142f3cffbe | [
"Apache-2.0"
] | null | null | null | awa/plugins/awa-images/regtests/awa-images-services-tests.adb | Letractively/ada-awa | 3c82a4d29ed6c1209a2ac7d5fe123c142f3cffbe | [
"Apache-2.0"
] | null | null | null | awa/plugins/awa-images/regtests/awa-images-services-tests.adb | Letractively/ada-awa | 3c82a4d29ed6c1209a2ac7d5fe123c142f3cffbe | [
"Apache-2.0"
] | null | null | null | -----------------------------------------------------------------------
-- awa-storages-services-tests -- Unit tests for storage service
-- Copyright (C) 2012, 2013 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Util.Test_Caller;
with Security.Contexts;
with AWA.Services.Contexts;
with AWA.Tests.Helpers.Users;
with AWA.Images.Modules;
package body AWA.Images.Services.Tests is
use Util.Tests;
use ADO;
package Caller is new Util.Test_Caller (Test, "Images.Services");
procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite) is
begin
Caller.Add_Test (Suite, "Test AWA.Images.Create_Image",
Test_Create_Image'Access);
end Add_Tests;
-- ------------------------------
-- Test creation of a storage object
-- ------------------------------
procedure Test_Create_Image (T : in out Test) is
Sec_Ctx : Security.Contexts.Security_Context;
Context : AWA.Services.Contexts.Service_Context;
Source : constant String := Util.Tests.Get_Path ("regtests/files/images/bast-12.jpg");
Thumb : constant String
:= Util.Tests.Get_Test_Path ("regtests/result/bast-12-thumb.jpg");
Width : Natural;
Height : Natural;
begin
AWA.Tests.Helpers.Users.Login (Context, Sec_Ctx, "[email protected]");
T.Manager := AWA.Images.Modules.Get_Image_Manager;
T.Manager.Create_Thumbnail (Source, Thumb, Width, Height);
Util.Tests.Assert_Equals (T, 1720, Width, "Invalid image width");
Util.Tests.Assert_Equals (T, 1098, Height, "Invalid image height");
end Test_Create_Image;
end AWA.Images.Services.Tests;
| 39.7 | 96 | 0.625105 |
1844a4f42ed048180c7e4a68617daa51164b0e6b | 2,492 | adb | Ada | chat_client_2.adb | cborao/Ada-P3 | a099243531f259158eb30450868c31e81783174c | [
"MIT"
] | null | null | null | chat_client_2.adb | cborao/Ada-P3 | a099243531f259158eb30450868c31e81783174c | [
"MIT"
] | null | null | null | chat_client_2.adb | cborao/Ada-P3 | a099243531f259158eb30450868c31e81783174c | [
"MIT"
] | null | null | null |
--PRÁCTICA 3: CÉSAR BORAO MORATINOS (Chat_Client_2)
with Handlers;
with Ada.Text_IO;
with Chat_Messages;
with Lower_Layer_UDP;
with Ada.Command_Line;
with Ada.Strings.Unbounded;
procedure Chat_Client_2 is
package ATI renames Ada.Text_IO;
package CM renames Chat_Messages;
package LLU renames Lower_Layer_UDP;
package ACL renames Ada.Command_Line;
package ASU renames Ada.Strings.Unbounded;
use type CM.Message_Type;
Server_EP: LLU.End_Point_Type;
Port: Integer;
Nick: ASU.Unbounded_String;
Client_EP_Receive: LLU.End_Point_Type;
Client_EP_Handler: LLU.End_Point_Type;
Buffer_In: aliased LLU.Buffer_Type(1024);
Buffer_Out: aliased LLU.Buffer_Type(1024);
Mess: CM.Message_Type;
Expired: Boolean;
Accepted: Boolean;
Comment: ASU.Unbounded_String;
begin
--Binding
Port := Integer'Value(ACL.Argument(2));
Server_EP := LLU.Build(LLU.To_IP(ACL.Argument(1)),Port);
Nick := ASU.To_Unbounded_String(ACL.Argument(3));
LLU.Bind_Any(Client_EP_Receive);
LLU.Bind_Any(Client_EP_Handler, Handlers.Client_Handler'Access);
LLU.Reset(Buffer_In);
if ACL.Argument_Count = 3 then
if ASU.To_String(Nick) /= "server" then
--Init Message
CM.Init_Message(Server_EP,Client_EP_Receive,
Client_EP_Handler,Nick,Buffer_Out'Access);
LLU.Receive(Client_EP_Receive, Buffer_In'Access, 10.0, Expired);
if Expired then
ATI.Put_Line("Server unreachable");
else
--Server Reply
Mess := CM.Message_Type'Input(Buffer_In'Access);
Accepted := Boolean'Input(Buffer_In'Access);
LLU.Reset(Buffer_In);
if Accepted then
ATI.Put_Line("Mini-Chat v2.0: Welcome "
& ASU.To_String(Nick));
loop
ATI.Put(">> ");
Comment := ASU.To_Unbounded_String(ATI.Get_Line);
exit when ASU.To_String(Comment) = ".quit";
--Writer Message
CM.Writer_Message(Server_EP,Client_EP_Handler,
Nick,Comment,Buffer_Out'Access);
end loop;
--Logout Message
CM.Logout_Message(Server_EP,Client_EP_Handler,
Nick,Buffer_Out'Access);
else
ATI.Put_Line("Mini-Chat v2.0: IGNORED new user " &
ASU.To_String(Nick) & ", nick already used");
end if;
end if;
else
ATI.New_Line;
ATI.Put_Line("Nick 'server' not avaliable, try again");
ATI.New_Line;
end if;
else
ATI.New_Line;
ATI.Put_Line("Client Usage: [user] [Port] <nick>");
ATI.New_Line;
end if;
LLU.Finalize;
end Chat_Client_2;
| 25.171717 | 67 | 0.691413 |
cb6e114362d841a5a2a423643f6d1f4c87170bd6 | 927 | adb | Ada | gnu/src/gdb/gdb/testsuite/gdb.ada/var_rec_arr/pck.adb | ghsecuritylab/ellcc-mirror | b03a4afac74d50cf0987554b8c0cd8209bcb92a2 | [
"BSD-2-Clause"
] | null | null | null | gnu/src/gdb/gdb/testsuite/gdb.ada/var_rec_arr/pck.adb | ghsecuritylab/ellcc-mirror | b03a4afac74d50cf0987554b8c0cd8209bcb92a2 | [
"BSD-2-Clause"
] | null | null | null | gnu/src/gdb/gdb/testsuite/gdb.ada/var_rec_arr/pck.adb | ghsecuritylab/ellcc-mirror | b03a4afac74d50cf0987554b8c0cd8209bcb92a2 | [
"BSD-2-Clause"
] | null | null | null | -- Copyright 2015 Free Software Foundation, Inc.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
package body Pck is
function Ident (R : Record_Type) return Record_Type is
begin
return R;
end Ident;
procedure Do_Nothing (A : System.Address) is
begin
null;
end Do_Nothing;
end Pck;
| 31.965517 | 73 | 0.719525 |
18617ac46add4a5d5066780639a09995ad342444 | 3,547 | ads | Ada | Ada95/samples/sample-explanation.ads | mvaisakh/android_external_libncurses | d44c8a16d7f1ed276d0de0b3f6f1a5596c5f556f | [
"DOC",
"Unlicense"
] | 35 | 2015-03-07T13:26:22.000Z | 2021-11-06T16:18:59.000Z | Ada95/samples/sample-explanation.ads | mvaisakh/android_external_libncurses | d44c8a16d7f1ed276d0de0b3f6f1a5596c5f556f | [
"DOC",
"Unlicense"
] | 3 | 2017-04-07T21:02:48.000Z | 2017-04-08T17:59:35.000Z | Ada95/samples/sample-explanation.ads | mvaisakh/android_external_libncurses | d44c8a16d7f1ed276d0de0b3f6f1a5596c5f556f | [
"DOC",
"Unlicense"
] | 19 | 2015-06-16T06:13:44.000Z | 2021-07-24T02:37:45.000Z | ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Sample.Explanation --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
-- "Software"), to deal in the Software without restriction, including --
-- without limitation the rights to use, copy, modify, merge, publish, --
-- distribute, distribute with modifications, sublicense, and/or sell --
-- copies of the Software, and to permit persons to whom the Software is --
-- furnished to do so, subject to the following conditions: --
-- --
-- The above copyright notice and this permission notice shall be included --
-- in all copies or substantial portions of the Software. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --
-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --
-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. --
-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, --
-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR --
-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR --
-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. --
-- --
-- Except as contained in this notice, the name(s) of the above copyright --
-- holders shall not be used in advertising or otherwise to promote the --
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.10 $
-- Binding Version 01.00
------------------------------------------------------------------------------
-- Poor mans help system. This scans a sequential file for key lines and
-- then reads the lines up to the next key. Those lines are presented in
-- a window as help or explanation.
--
package Sample.Explanation is
procedure Explain (Key : in String);
-- Retrieve the text associated with this key and display it.
procedure Explain_Context;
-- Explain the current context.
procedure Notepad (Key : in String);
-- Put a note on the screen and maintain it with the context
Explanation_Not_Found : exception;
Explanation_Error : exception;
end Sample.Explanation;
| 59.116667 | 78 | 0.455878 |
c52c8fbdc82ca0fc57bc3d61a5a6964770ac5e2a | 7,002 | adb | Ada | bb-runtimes/runtimes/ravenscar-full-stm32f3x4/gnat/a-stuten.adb | JCGobbi/Nucleo-STM32F334R8 | 2a0b1b4b2664c92773703ac5e95dcb71979d051c | [
"BSD-3-Clause"
] | null | null | null | bb-runtimes/runtimes/ravenscar-full-stm32f3x4/gnat/a-stuten.adb | JCGobbi/Nucleo-STM32F334R8 | 2a0b1b4b2664c92773703ac5e95dcb71979d051c | [
"BSD-3-Clause"
] | null | null | null | bb-runtimes/runtimes/ravenscar-full-stm32f3x4/gnat/a-stuten.adb | JCGobbi/Nucleo-STM32F334R8 | 2a0b1b4b2664c92773703ac5e95dcb71979d051c | [
"BSD-3-Clause"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- A D A . S T R I N G S . U T F _ E N C O D I N G --
-- --
-- B o d y --
-- --
-- Copyright (C) 2010-2021, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- --
-- --
-- --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
package body Ada.Strings.UTF_Encoding is
use Interfaces;
--------------
-- Encoding --
--------------
function Encoding
(Item : UTF_String;
Default : Encoding_Scheme := UTF_8) return Encoding_Scheme
is
begin
if Item'Length >= 2 then
if Item (Item'First .. Item'First + 1) = BOM_16BE then
return UTF_16BE;
elsif Item (Item'First .. Item'First + 1) = BOM_16LE then
return UTF_16LE;
elsif Item'Length >= 3
and then Item (Item'First .. Item'First + 2) = BOM_8
then
return UTF_8;
end if;
end if;
return Default;
end Encoding;
-----------------
-- From_UTF_16 --
-----------------
function From_UTF_16
(Item : UTF_16_Wide_String;
Output_Scheme : UTF_XE_Encoding;
Output_BOM : Boolean := False) return UTF_String
is
BSpace : constant Natural := 2 * Boolean'Pos (Output_BOM);
Result : UTF_String (1 .. 2 * Item'Length + BSpace);
Len : Natural;
C : Unsigned_16;
Iptr : Natural;
begin
if Output_BOM then
Result (1 .. 2) :=
(if Output_Scheme = UTF_16BE then BOM_16BE else BOM_16LE);
Len := 2;
else
Len := 0;
end if;
-- Skip input BOM
Iptr := Item'First;
if Iptr <= Item'Last and then Item (Iptr) = BOM_16 (1) then
Iptr := Iptr + 1;
end if;
-- UTF-16BE case
if Output_Scheme = UTF_16BE then
while Iptr <= Item'Last loop
C := To_Unsigned_16 (Item (Iptr));
Result (Len + 1) := Character'Val (Shift_Right (C, 8));
Result (Len + 2) := Character'Val (C and 16#00_FF#);
Len := Len + 2;
Iptr := Iptr + 1;
end loop;
-- UTF-16LE case
else
while Iptr <= Item'Last loop
C := To_Unsigned_16 (Item (Iptr));
Result (Len + 1) := Character'Val (C and 16#00_FF#);
Result (Len + 2) := Character'Val (Shift_Right (C, 8));
Len := Len + 2;
Iptr := Iptr + 1;
end loop;
end if;
return Result (1 .. Len);
end From_UTF_16;
--------------------------
-- Raise_Encoding_Error --
--------------------------
procedure Raise_Encoding_Error (Index : Natural) is
Val : constant String := Index'Img;
begin
raise Encoding_Error with
"bad input at Item (" & Val (Val'First + 1 .. Val'Last) & ')';
end Raise_Encoding_Error;
---------------
-- To_UTF_16 --
---------------
function To_UTF_16
(Item : UTF_String;
Input_Scheme : UTF_XE_Encoding;
Output_BOM : Boolean := False) return UTF_16_Wide_String
is
Result : UTF_16_Wide_String (1 .. Item'Length / 2 + 1);
Len : Natural;
Iptr : Natural;
begin
if Item'Length mod 2 /= 0 then
raise Encoding_Error with "UTF-16BE/LE string has odd length";
end if;
-- Deal with input BOM, skip if OK, error if bad BOM
Iptr := Item'First;
if Item'Length >= 2 then
if Item (Iptr .. Iptr + 1) = BOM_16BE then
if Input_Scheme = UTF_16BE then
Iptr := Iptr + 2;
else
Raise_Encoding_Error (Iptr);
end if;
elsif Item (Iptr .. Iptr + 1) = BOM_16LE then
if Input_Scheme = UTF_16LE then
Iptr := Iptr + 2;
else
Raise_Encoding_Error (Iptr);
end if;
elsif Item'Length >= 3 and then Item (Iptr .. Iptr + 2) = BOM_8 then
Raise_Encoding_Error (Iptr);
end if;
end if;
-- Output BOM if specified
if Output_BOM then
Result (1) := BOM_16 (1);
Len := 1;
else
Len := 0;
end if;
-- UTF-16BE case
if Input_Scheme = UTF_16BE then
while Iptr < Item'Last loop
Len := Len + 1;
Result (Len) :=
Wide_Character'Val
(Character'Pos (Item (Iptr)) * 256 +
Character'Pos (Item (Iptr + 1)));
Iptr := Iptr + 2;
end loop;
-- UTF-16LE case
else
while Iptr < Item'Last loop
Len := Len + 1;
Result (Len) :=
Wide_Character'Val
(Character'Pos (Item (Iptr)) +
Character'Pos (Item (Iptr + 1)) * 256);
Iptr := Iptr + 2;
end loop;
end if;
return Result (1 .. Len);
end To_UTF_16;
end Ada.Strings.UTF_Encoding;
| 33.342857 | 78 | 0.428306 |
4ad41d9414f80f9568d6cbf9c118a9d128857224 | 5,238 | adb | Ada | support/MinGW/lib/gcc/mingw32/9.2.0/adainclude/s-wwdwch.adb | orb-zhuchen/Orb | 6da2404b949ac28bde786e08bf4debe4a27cd3a0 | [
"CNRI-Python-GPL-Compatible",
"MIT"
] | null | null | null | support/MinGW/lib/gcc/mingw32/9.2.0/adainclude/s-wwdwch.adb | orb-zhuchen/Orb | 6da2404b949ac28bde786e08bf4debe4a27cd3a0 | [
"CNRI-Python-GPL-Compatible",
"MIT"
] | null | null | null | support/MinGW/lib/gcc/mingw32/9.2.0/adainclude/s-wwdwch.adb | orb-zhuchen/Orb | 6da2404b949ac28bde786e08bf4debe4a27cd3a0 | [
"CNRI-Python-GPL-Compatible",
"MIT"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . W W D _ W C H A R --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2019, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with Interfaces; use Interfaces;
with System.WWd_Char;
package body System.Wwd_WChar is
------------------------------------
-- Wide_Wide_Width_Wide_Character --
------------------------------------
-- This is the case where we are talking about the Wide_Wide_Image of
-- a Wide_Character, which is always the same character sequence as the
-- Wide_Image of the same Wide_Character.
function Wide_Wide_Width_Wide_Character
(Lo, Hi : Wide_Character) return Natural
is
begin
return Wide_Width_Wide_Character (Lo, Hi);
end Wide_Wide_Width_Wide_Character;
------------------------------------
-- Wide_Wide_Width_Wide_Wide_Char --
------------------------------------
function Wide_Wide_Width_Wide_Wide_Char
(Lo, Hi : Wide_Wide_Character) return Natural
is
LV : constant Unsigned_32 := Wide_Wide_Character'Pos (Lo);
HV : constant Unsigned_32 := Wide_Wide_Character'Pos (Hi);
begin
-- Return zero if empty range
if LV > HV then
return 0;
-- Return max value (12) for wide character (Hex_hhhhhhhh)
elsif HV > 255 then
return 12;
-- If any characters in normal character range, then use normal
-- Wide_Wide_Width attribute on this range to find out a starting point.
-- Otherwise start with zero.
else
return
System.WWd_Char.Wide_Wide_Width_Character
(Lo => Character'Val (LV),
Hi => Character'Val (Unsigned_32'Min (255, HV)));
end if;
end Wide_Wide_Width_Wide_Wide_Char;
-------------------------------
-- Wide_Width_Wide_Character --
-------------------------------
function Wide_Width_Wide_Character
(Lo, Hi : Wide_Character) return Natural
is
LV : constant Unsigned_32 := Wide_Character'Pos (Lo);
HV : constant Unsigned_32 := Wide_Character'Pos (Hi);
begin
-- Return zero if empty range
if LV > HV then
return 0;
-- Return max value (12) for wide character (Hex_hhhhhhhh)
elsif HV > 255 then
return 12;
-- If any characters in normal character range, then use normal
-- Wide_Wide_Width attribute on this range to find out a starting point.
-- Otherwise start with zero.
else
return
System.WWd_Char.Wide_Width_Character
(Lo => Character'Val (LV),
Hi => Character'Val (Unsigned_32'Min (255, HV)));
end if;
end Wide_Width_Wide_Character;
------------------------------------
-- Wide_Width_Wide_Wide_Character --
------------------------------------
function Wide_Width_Wide_Wide_Character
(Lo, Hi : Wide_Wide_Character) return Natural
is
begin
return Wide_Wide_Width_Wide_Wide_Char (Lo, Hi);
end Wide_Width_Wide_Wide_Character;
end System.Wwd_WChar;
| 39.984733 | 79 | 0.490454 |
0edf76a99257b309218c613b5015ee9669a72df7 | 1,351 | ads | Ada | specs/ada/common/tkmrpc-response.ads | DrenfongWong/tkm-rpc | 075d22871cf81d497aac656c7f03a513278b641c | [
"BSD-3-Clause"
] | null | null | null | specs/ada/common/tkmrpc-response.ads | DrenfongWong/tkm-rpc | 075d22871cf81d497aac656c7f03a513278b641c | [
"BSD-3-Clause"
] | null | null | null | specs/ada/common/tkmrpc-response.ads | DrenfongWong/tkm-rpc | 075d22871cf81d497aac656c7f03a513278b641c | [
"BSD-3-Clause"
] | null | null | null | with Tkmrpc.Types;
with Tkmrpc.Results;
with Tkmrpc.Operations;
package Tkmrpc.Response is
Response_Size : constant := 1024;
Header_Size : constant := 24;
Body_Size : constant := Response_Size - Header_Size;
type Header_Type is record
Operation : Operations.Operation_Type;
Request_Id : Types.Request_Id_Type;
Result : Results.Result_Type;
end record;
for Header_Type use record
Operation at 0 range 0 .. (8 * 8) - 1;
Request_Id at 8 range 0 .. (8 * 8) - 1;
Result at 16 range 0 .. (8 * 8) - 1;
end record;
for Header_Type'Size use Header_Size * 8;
subtype Padded_Data_Range is Natural range 1 .. Body_Size;
subtype Padded_Data_Type is Types.Byte_Sequence (Padded_Data_Range);
type Data_Type is record
Header : Header_Type;
Padded_Data : Padded_Data_Type;
end record;
for Data_Type use record
Header at 0 range 0 .. (Header_Size * 8) - 1;
Padded_Data at Header_Size range 0 .. (Body_Size * 8) - 1;
end record;
for Data_Type'Size use Response_Size * 8;
Null_Data : constant Data_Type := Data_Type'
(Header => Header_Type'
(Operation => 0,
Request_Id => 0,
Result => Results.Invalid_Operation),
Padded_Data => Padded_Data_Type'(others => 0));
end Tkmrpc.Response;
| 30.022222 | 71 | 0.648409 |
cb24a23e41b156308841809e456febfa2f524787 | 878 | ada | Ada | Task/Bitwise-IO/Ada/bitwise-io-3.ada | mullikine/RosettaCodeData | 4f0027c6ce83daa36118ee8b67915a13cd23ab67 | [
"Info-ZIP"
] | 1 | 2018-11-09T22:08:38.000Z | 2018-11-09T22:08:38.000Z | Task/Bitwise-IO/Ada/bitwise-io-3.ada | mullikine/RosettaCodeData | 4f0027c6ce83daa36118ee8b67915a13cd23ab67 | [
"Info-ZIP"
] | null | null | null | Task/Bitwise-IO/Ada/bitwise-io-3.ada | mullikine/RosettaCodeData | 4f0027c6ce83daa36118ee8b67915a13cd23ab67 | [
"Info-ZIP"
] | 1 | 2018-11-09T22:08:40.000Z | 2018-11-09T22:08:40.000Z | with Ada.Streams.Stream_IO; use Ada.Streams.Stream_IO;
with Bit_Streams; use Bit_Streams;
procedure Test_Bit_Streams is
File : File_Type;
ABACUS : Bit_Array :=
( 1,0,0,0,0,0,1, -- A, big endian
1,0,0,0,0,1,0, -- B
1,0,0,0,0,0,1, -- A
1,0,0,0,0,1,1, -- C
1,0,1,0,1,0,1, -- U
1,0,1,0,0,1,1 -- S
);
Data : Bit_Array (ABACUS'Range);
begin
Create (File, Out_File, "abacus.dat");
declare
Bits : Bit_Stream (Stream (File));
begin
Write (Bits, ABACUS);
end;
Close (File);
Open (File, In_File, "abacus.dat");
declare
Bits : Bit_Stream (Stream (File));
begin
Read (Bits, Data);
end;
Close (File);
if Data /= ABACUS then
raise Data_Error;
end if;
end Test_Bit_Streams;
| 25.823529 | 55 | 0.505695 |
dc486d6a27e919b4110a88b2629b99a777f4bd7c | 3,553 | adb | Ada | Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/s-exnlli.adb | djamal2727/Main-Bearing-Analytical-Model | 2f00c2219c71be0175c6f4f8f1d4cca231d97096 | [
"Apache-2.0"
] | null | null | null | Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/s-exnlli.adb | djamal2727/Main-Bearing-Analytical-Model | 2f00c2219c71be0175c6f4f8f1d4cca231d97096 | [
"Apache-2.0"
] | null | null | null | Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/s-exnlli.adb | djamal2727/Main-Bearing-Analytical-Model | 2f00c2219c71be0175c6f4f8f1d4cca231d97096 | [
"Apache-2.0"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . E X N _ L L I --
-- --
-- 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 System.Exn_LLI is
---------------------------
-- Exn_Long_Long_Integer --
---------------------------
function Exn_Long_Long_Integer
(Left : Long_Long_Integer;
Right : Natural)
return Long_Long_Integer
is
pragma Suppress (Division_Check);
pragma Suppress (Overflow_Check);
Result : Long_Long_Integer := 1;
Factor : Long_Long_Integer := Left;
Exp : Natural := Right;
begin
-- We use the standard logarithmic approach, Exp gets shifted right
-- testing successive low order bits and Factor is the value of the
-- base raised to the next power of 2.
-- Note: it is not worth special casing base values -1, 0, +1 since
-- the expander does this when the base is a literal, and other cases
-- will be extremely rare.
if Exp /= 0 then
loop
if Exp rem 2 /= 0 then
Result := Result * Factor;
end if;
Exp := Exp / 2;
exit when Exp = 0;
Factor := Factor * Factor;
end loop;
end if;
return Result;
end Exn_Long_Long_Integer;
end System.Exn_LLI;
| 47.373333 | 78 | 0.430622 |
0e959f5155ec3ea59b56262af46f939ecea8ee8c | 4,606 | adb | Ada | middleware/src/audio/simple_synthesizer.adb | shakram02/Ada_Drivers_Library | a407ca7ddbc2d9756647016c2f8fd8ef24a239ff | [
"BSD-3-Clause"
] | 192 | 2016-06-01T18:32:04.000Z | 2022-03-26T22:52:31.000Z | middleware/src/audio/simple_synthesizer.adb | morbos/Ada_Drivers_Library | a4ab26799be60997c38735f4056160c4af597ef7 | [
"BSD-3-Clause"
] | 239 | 2016-05-26T20:02:01.000Z | 2022-03-31T09:46:56.000Z | middleware/src/audio/simple_synthesizer.adb | morbos/Ada_Drivers_Library | a4ab26799be60997c38735f4056160c4af597ef7 | [
"BSD-3-Clause"
] | 142 | 2016-06-05T08:12:20.000Z | 2022-03-24T17:37:17.000Z | ------------------------------------------------------------------------------
-- --
-- Copyright (C) 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 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. --
-- --
------------------------------------------------------------------------------
with Interfaces; use Interfaces;
package body Simple_Synthesizer is
------------------------
-- Set_Note_Frequency --
------------------------
procedure Set_Note_Frequency
(This : in out Synthesizer;
Note : Float)
is
begin
This.Note := Note;
end Set_Note_Frequency;
-------------------
-- Set_Frequency --
-------------------
overriding procedure Set_Frequency
(This : in out Synthesizer;
Frequency : Audio_Frequency)
is
begin
This.Frequency := Frequency;
end Set_Frequency;
--------------
-- Transmit --
--------------
overriding procedure Transmit
(This : in out Synthesizer;
Data : Audio_Buffer)
is
begin
raise Program_Error with "This Synthesizer doesn't take input";
end Transmit;
-------------
-- Receive --
-------------
overriding procedure Receive
(This : in out Synthesizer;
Data : out Audio_Buffer)
is
function Next_Sample return Integer_16;
Rate : constant Float :=
Float (Audio_Frequency'Enum_Rep (This.Frequency));
Note : constant Float := This.Note;
Amplitude : constant Float := Float (This.Amplitude);
Delt : constant Float := 2.0 / (Rate * (1.0 / Note));
-----------------
-- Next_Sample --
-----------------
function Next_Sample return Integer_16 is
begin
This.Last_Sample := This.Last_Sample + Delt;
if This.Last_Sample > 1.0 then
This.Last_Sample := -1.0;
end if;
return Integer_16 (This.Last_Sample * Amplitude);
end Next_Sample;
Tmp : Integer_16;
begin
if This.Stereo then
if Data'Length mod 2 /= 0 then
raise Program_Error with
"Audio buffer for stereo output should have even length";
end if;
for Index in 0 .. (Data'Length / 2) - 1 loop
Tmp := Next_Sample;
Data ((Index * 2) + Data'First) := Tmp;
Data ((Index * 2) + Data'First + 1) := Tmp;
end loop;
else
for Elt of Data loop
Elt := Next_Sample;
end loop;
end if;
end Receive;
end Simple_Synthesizer;
| 37.447154 | 78 | 0.517369 |
209b91c403f4ad2436a84c9da17d15dfae341e29 | 3,999 | adb | Ada | src/rejuvenation-find_and_replacer.adb | TNO/Rejuvenation-Ada | 8113ec28da3923ccde40d76cbab70e0e614f4b75 | [
"BSD-3-Clause"
] | null | null | null | src/rejuvenation-find_and_replacer.adb | TNO/Rejuvenation-Ada | 8113ec28da3923ccde40d76cbab70e0e614f4b75 | [
"BSD-3-Clause"
] | null | null | null | src/rejuvenation-find_and_replacer.adb | TNO/Rejuvenation-Ada | 8113ec28da3923ccde40d76cbab70e0e614f4b75 | [
"BSD-3-Clause"
] | null | null | null | with Rejuvenation.Finder; use Rejuvenation.Finder;
with Rejuvenation.Placeholders; use Rejuvenation.Placeholders;
with Rejuvenation.Replacer; use Rejuvenation.Replacer;
with String_Maps; use String_Maps;
package body Rejuvenation.Find_And_Replacer is
function Accept_All_Matches (Match : Match_Pattern) return Boolean is
pragma Unreferenced (Match);
-- In Ada 2022 replace with aspect on formal parameter Match
-- + make function expression!
begin
return True;
end Accept_All_Matches;
procedure Find_And_Replace
(TR : in out Text_Rewrite'Class; Node : Ada_Node'Class;
Find_Pattern, Replace_Pattern : Pattern;
Accept_Match : not null access function
(Match : Match_Pattern) return Boolean :=
Accept_All_Matches'Access;
Before, After : Node_Location := No_Trivia)
is
function Get_Placeholder_Replacement (Match : Match_Pattern) return Map;
function Get_Placeholder_Replacement (Match : Match_Pattern) return Map
is
Result : Map;
begin
for Placeholder_Name of Rejuvenation.Placeholders
.Get_Placeholder_Names
(Replace_Pattern.As_Ada_Node)
loop
declare
Placeholder_Nodes : constant Node_List.Vector :=
Match.Get_Placeholder_As_Nodes (Placeholder_Name);
begin
if Placeholder_Nodes.Length = 0 then
Result.Insert (Placeholder_Name, "");
else
declare
TN : Text_Rewrite :=
Make_Text_Rewrite_Nodes
(Placeholder_Nodes.First_Element,
Placeholder_Nodes.Last_Element, All_Trivia,
All_Trivia);
-- always include comments of place holders
begin
for Node of Placeholder_Nodes loop
Find_And_Replace
(TN, Node, Find_Pattern, Replace_Pattern,
Accept_Match, Before, After);
end loop;
Result.Insert (Placeholder_Name, TN.ApplyToString);
end;
end if;
end;
end loop;
return Result;
end Get_Placeholder_Replacement;
Matches : constant Match_Pattern_List.Vector :=
(if Find_Pattern.As_Ada_Node.Kind in Ada_Ada_List then
Find_Non_Contained_Sub_List (Node, Find_Pattern)
else Find_Non_Contained_Full (Node, Find_Pattern));
begin
for Match of Matches loop
if Accept_Match (Match) then
declare
Match_Nodes : constant Node_List.Vector := Match.Get_Nodes;
Replacements : constant Map :=
Get_Placeholder_Replacement (Match);
begin
TR.Replace
(Match_Nodes.First_Element, Match_Nodes.Last_Element,
Replace (Replace_Pattern.As_Ada_Node, Replacements), Before,
After, Node.Unit.Get_Charset);
end;
end if;
end loop;
end Find_And_Replace;
function Find_And_Replace
(File_Path : String; Find_Pattern, Replace_Pattern : Pattern;
Accept_Match : not null access function
(Match : Match_Pattern) return Boolean :=
Accept_All_Matches'Access;
Before, After : Node_Location := No_Trivia) return Boolean
is
Ctx : constant Analysis_Context := Create_Context;
File_Unit : constant Analysis_Unit := Ctx.Get_From_File (File_Path);
TR : Text_Rewrite_Unit := Make_Text_Rewrite_Unit (File_Unit);
begin
Find_And_Replace
(TR, File_Unit.Root, Find_Pattern, Replace_Pattern, Accept_Match,
Before, After);
TR.Apply;
return TR.HasReplacements;
end Find_And_Replace;
end Rejuvenation.Find_And_Replacer;
| 39.594059 | 78 | 0.605151 |
cb505f2565b8331fb1b07e8013b988b7301806b6 | 5,400 | ada | Ada | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c4/c45220c.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 7 | 2020-05-02T17:34:05.000Z | 2021-10-17T10:15:18.000Z | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c4/c45220c.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | null | null | null | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c4/c45220c.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 2 | 2020-07-27T00:22:36.000Z | 2021-04-01T09:41:02.000Z | -- C45220C.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 '=' AND '/=' PRODUCE CORRECT RESULTS ON
-- OPERANDS OF A TYPE DERIVED FROM THE TYPE 'BOOLEAN'
-- (IN PARTICULAR, FOR OPERANDS HAVING DIFFERENT SUBTYPES).
-- THIS TEST IS DERIVED FROM C45220A.ADA .
-- RM 27 OCTOBER 1980
-- JWC 7/8/85 RENAMED TO -AB
WITH REPORT ;
PROCEDURE C45220C IS
USE REPORT;
TYPE NB IS NEW BOOLEAN ;
SUBTYPE T1 IS NB RANGE NB'(FALSE)..NB'(FALSE) ;
SUBTYPE T2 IS NB RANGE NB'(TRUE )..NB'(TRUE );
SUBTYPE T3 IS NB RANGE NB'(FALSE)..NB'(TRUE );
SUBTYPE T4 IS T3 RANGE NB'(TRUE )..NB'(TRUE );
FVAR1 : T1 := NB'(FALSE) ;
TVAR1 : T2 := NB'(TRUE );
FVAR2 : T3 := NB'(FALSE) ;
TVAR2 : T4 := NB'(TRUE );
ERROR_COUNT : INTEGER := 0 ; -- INITIAL VALUE ESSENTIAL
PROCEDURE BUMP IS
BEGIN
ERROR_COUNT := ERROR_COUNT + 1 ;
END BUMP ;
FUNCTION IDENT_NEW_BOOL( THE_ARGUMENT : NB ) RETURN NB IS
BEGIN
IF EQUAL(2,2) THEN RETURN THE_ARGUMENT;
ELSE RETURN NB'(FALSE) ;
END IF;
END ;
BEGIN
TEST( "C45220C" , "CHECK THAT '=' AND '/=' PRODUCE CORRECT" &
" RESULTS ON DERIVED-BOOLEAN-TYPE OPERANDS" ) ;
-- 32 CASES ( 2 * 2 ORDERED PAIRS OF OPERAND VALUES,
-- 2 OPERATORS : '=' , '/=' ,
-- 4 VARIABLE/LITERAL FOR LEFT OPERAND,
-- VARIABLE/LITERAL FOR RIGHT OPERAND.
-- 'BUMP' MEANS 'BUMP THE ERROR COUNT'
FVAR1 := IDENT_NEW_BOOL( NB'(FALSE) ) ;
TVAR1 := IDENT_NEW_BOOL( NB'(TRUE )) ;
FVAR2 := IDENT_NEW_BOOL( NB'(FALSE) ) ;
TVAR2 := IDENT_NEW_BOOL( NB'(TRUE )) ;
IF NB'(FALSE) = NB'(FALSE) THEN NULL ; ELSE BUMP ; END IF;
IF FVAR1 = NB'(FALSE) THEN NULL ; ELSE BUMP ; END IF;
IF NB'(FALSE) = FVAR2 THEN NULL ; ELSE BUMP ; END IF;
IF FVAR2 = FVAR1 THEN NULL ; ELSE BUMP ; END IF;
IF NB'(FALSE) = NB'(TRUE ) THEN BUMP ; END IF;
IF FVAR1 = NB'(TRUE ) THEN BUMP ; END IF;
IF NB'(FALSE) = TVAR2 THEN BUMP ; END IF;
IF FVAR2 = TVAR1 THEN BUMP ; END IF;
IF NB'(TRUE ) = NB'(FALSE) THEN BUMP ; END IF;
IF NB'(TRUE ) = FVAR1 THEN BUMP ; END IF;
IF TVAR2 = NB'(FALSE) THEN BUMP ; END IF;
IF TVAR1 = FVAR2 THEN BUMP ; END IF;
IF NB'(TRUE ) = NB'(TRUE ) THEN NULL ; ELSE BUMP ; END IF;
IF TVAR1 = NB'(TRUE ) THEN NULL ; ELSE BUMP ; END IF;
IF NB'(TRUE ) = TVAR2 THEN NULL ; ELSE BUMP ; END IF;
IF TVAR2 = TVAR1 THEN NULL ; ELSE BUMP ; END IF;
IF NB'(FALSE) /= NB'(FALSE) THEN BUMP ; END IF;
IF FVAR1 /= NB'(FALSE) THEN BUMP ; END IF;
IF NB'(FALSE) /= FVAR2 THEN BUMP ; END IF;
IF FVAR2 /= FVAR1 THEN BUMP ; END IF;
IF NB'(FALSE) /= NB'(TRUE ) THEN NULL ; ELSE BUMP ; END IF;
IF FVAR1 /= NB'(TRUE ) THEN NULL ; ELSE BUMP ; END IF;
IF NB'(FALSE) /= TVAR2 THEN NULL ; ELSE BUMP ; END IF;
IF FVAR2 /= TVAR1 THEN NULL ; ELSE BUMP ; END IF;
IF NB'(TRUE ) /= NB'(FALSE) THEN NULL ; ELSE BUMP ; END IF;
IF NB'(TRUE ) /= FVAR1 THEN NULL ; ELSE BUMP ; END IF;
IF TVAR2 /= NB'(FALSE) THEN NULL ; ELSE BUMP ; END IF;
IF TVAR1 /= FVAR2 THEN NULL ; ELSE BUMP ; END IF;
IF NB'(TRUE ) /= NB'(TRUE ) THEN BUMP ; END IF;
IF TVAR1 /= NB'(TRUE ) THEN BUMP ; END IF;
IF NB'(TRUE ) /= TVAR2 THEN BUMP ; END IF;
IF TVAR2 /= TVAR1 THEN BUMP ; END IF;
IF ERROR_COUNT /=0 THEN
FAILED( "(IN)EQUALITY OF N_BOOLEAN VALUES - FAILURE1" );
END IF;
RESULT ;
END C45220C;
| 38.848921 | 79 | 0.524815 |
209a5589c9dc4887391a37e43fcfcc29dfadd082 | 8,250 | ads | Ada | bb-runtimes/src/system/system-xi-m1agl-sfp.ads | JCGobbi/Nucleo-STM32F334R8 | 2a0b1b4b2664c92773703ac5e95dcb71979d051c | [
"BSD-3-Clause"
] | null | null | null | bb-runtimes/src/system/system-xi-m1agl-sfp.ads | JCGobbi/Nucleo-STM32F334R8 | 2a0b1b4b2664c92773703ac5e95dcb71979d051c | [
"BSD-3-Clause"
] | null | null | null | bb-runtimes/src/system/system-xi-m1agl-sfp.ads | JCGobbi/Nucleo-STM32F334R8 | 2a0b1b4b2664c92773703ac5e95dcb71979d051c | [
"BSD-3-Clause"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M --
-- --
-- S p e c --
-- (ARM Cortex M4 Version) --
-- --
-- Copyright (C) 1992-2020, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
-- apply solely to the contents of the part following the private keyword. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
pragma Restrictions (No_Exception_Propagation);
-- Only local exception handling is supported in this profile
pragma Restrictions (No_Exception_Registration);
-- Disable exception name registration. This capability is not used because
-- it is only required by exception stream attributes which are not supported
-- in this run time.
pragma Restrictions (No_Implicit_Dynamic_Code);
-- Pointers to nested subprograms are not allowed in this run time, in order
-- to prevent the compiler from building "trampolines".
pragma Restrictions (No_Finalization);
-- Controlled types are not supported in this run time
pragma Profile (Ravenscar);
-- This is a Ravenscar run time
pragma Restrictions (No_Task_At_Interrupt_Priority);
-- On Cortex-M, it is not possible to have tasks at Interrupt_Priority, as
-- the context switch is triggered by the Pend_SV interrupt, which is at
-- lowest priority.
package System is
pragma Pure;
-- Note that we take advantage of the implementation permission to make
-- this unit Pure instead of Preelaborable; see RM 13.7.1(15). In Ada
-- 2005, this is Pure in any case (AI-362).
pragma No_Elaboration_Code_All;
-- Allow the use of that restriction in units that WITH this unit
type Name is (SYSTEM_NAME_GNAT);
System_Name : constant Name := SYSTEM_NAME_GNAT;
-- System-Dependent Named Numbers
Min_Int : constant := -2 ** (Standard'Max_Integer_Size - 1);
Max_Int : constant := 2 ** (Standard'Max_Integer_Size - 1) - 1;
Max_Binary_Modulus : constant := 2 ** Standard'Max_Integer_Size;
Max_Nonbinary_Modulus : constant := 2 ** Integer'Size - 1;
Max_Base_Digits : constant := Long_Long_Float'Digits;
Max_Digits : constant := Long_Long_Float'Digits;
Max_Mantissa : constant := Standard'Max_Integer_Size - 1;
Fine_Delta : constant := 2.0 ** (-Max_Mantissa);
Tick : constant := 0.000_001;
-- Storage-related Declarations
type Address is private;
pragma Preelaborable_Initialization (Address);
Null_Address : constant Address;
Storage_Unit : constant := 8;
Word_Size : constant := 32;
Memory_Size : constant := 2 ** 32;
-- Address comparison
function "<" (Left, Right : Address) return Boolean;
function "<=" (Left, Right : Address) return Boolean;
function ">" (Left, Right : Address) return Boolean;
function ">=" (Left, Right : Address) return Boolean;
function "=" (Left, Right : Address) return Boolean;
pragma Import (Intrinsic, "<");
pragma Import (Intrinsic, "<=");
pragma Import (Intrinsic, ">");
pragma Import (Intrinsic, ">=");
pragma Import (Intrinsic, "=");
-- Other System-Dependent Declarations
type Bit_Order is (High_Order_First, Low_Order_First);
Default_Bit_Order : constant Bit_Order :=
Bit_Order'Val (Standard'Default_Bit_Order);
pragma Warnings (Off, Default_Bit_Order); -- kill constant condition warning
-- Priority-related Declarations (RM D.1)
Max_Interrupt_Priority : constant Positive := 255;
Max_Priority : constant Positive := 254;
subtype Any_Priority is Integer range 0 .. 255;
subtype Priority is Any_Priority range 0 .. 254;
subtype Interrupt_Priority is Any_Priority range 255 .. 255;
Default_Priority : constant Priority := 120;
private
type Address is mod Memory_Size;
Null_Address : constant Address := 0;
--------------------------------------
-- System Implementation Parameters --
--------------------------------------
-- These parameters provide information about the target that is used by
-- the compiler. They are in the private part of System, where they can be
-- accessed using the special circuitry in the Targparm unit whose source
-- should be consulted for more detailed descriptions of the individual
-- switch values.
Atomic_Sync_Default : constant Boolean := False;
Backend_Divide_Checks : constant Boolean := False;
Backend_Overflow_Checks : constant Boolean := True;
Command_Line_Args : constant Boolean := False;
Configurable_Run_Time : constant Boolean := True;
Denorm : constant Boolean := True;
Duration_32_Bits : constant Boolean := False;
Exit_Status_Supported : constant Boolean := False;
Fractional_Fixed_Ops : constant Boolean := False;
Frontend_Layout : constant Boolean := False;
Machine_Overflows : constant Boolean := False;
Machine_Rounds : constant Boolean := True;
Preallocated_Stacks : constant Boolean := True;
Signed_Zeros : constant Boolean := True;
Stack_Check_Default : constant Boolean := False;
Stack_Check_Probes : constant Boolean := False;
Stack_Check_Limits : constant Boolean := False;
Support_Aggregates : constant Boolean := True;
Support_Composite_Assign : constant Boolean := True;
Support_Composite_Compare : constant Boolean := True;
Support_Long_Shifts : constant Boolean := True;
Always_Compatible_Rep : constant Boolean := True;
Suppress_Standard_Library : constant Boolean := True;
Use_Ada_Main_Program_Name : constant Boolean := False;
Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
end System;
| 47.687861 | 79 | 0.576364 |
0e2522f4b25da38a67b5e3ea923bb005bf5c7127 | 1,815 | ada | Ada | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/ca/ca1012a1.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 7 | 2020-05-02T17:34:05.000Z | 2021-10-17T10:15:18.000Z | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/ca/ca1012a1.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | null | null | null | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/ca/ca1012a1.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 2 | 2020-07-27T00:22:36.000Z | 2021-04-01T09:41:02.000Z | -- CA1012A1.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.
--*
-- GENERIC PROCEDURE BODY.
-- DECLARATION IS IN CA1012A0.DEP.
-- INSTANTIATION IN CA1012A4M.DEP.
-- APPLICABILITY CRITERIA:
-- THIS UNIT MUST BE ACCEPTED BY ALL ADA 95 IMPLEMENTATIONS.
-- HISTORY:
-- WKB 07/20/81 CREATED ORIGINAL TEST.
-- PWB 02/19/86 ADDED COMMENTS TO DESCRIBE RELATION TO OTHER FILES
-- IN TEST AND POSSIBLE NON-APPLICABILITY.
-- BCB 01/05/88 MODIFIED HEADER.
-- RLB 09/13/99 UPDATED APPLICABILITY CRITERIA FOR ADA 95.
PROCEDURE CA1012A0 (I : IN OUT INDEX) IS
BEGIN
I := I + 1;
END CA1012A0;
| 39.456522 | 78 | 0.678788 |
cb2a41269f8478820b059fe2824cd4be10ec3d42 | 7,708 | ads | Ada | tools/scitools/conf/understand/ada/ada05/s-ficobl.ads | brucegua/moocos | 575c161cfa35e220f10d042e2e5ca18773691695 | [
"Apache-2.0"
] | 1 | 2020-01-20T21:26:46.000Z | 2020-01-20T21:26:46.000Z | tools/scitools/conf/understand/ada/ada05/s-ficobl.ads | brucegua/moocos | 575c161cfa35e220f10d042e2e5ca18773691695 | [
"Apache-2.0"
] | null | null | null | tools/scitools/conf/understand/ada/ada05/s-ficobl.ads | brucegua/moocos | 575c161cfa35e220f10d042e2e5ca18773691695 | [
"Apache-2.0"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . F I L E _ C O N T R O L _ B L O C K --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
--
--
--
--
--
--
--
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package contains the declaration of the basic file control block
-- shared between Text_IO, Sequential_IO, Direct_IO and Streams.Stream_IO.
-- The actual control blocks are derived from this block by extension. The
-- control block is itself derived from Ada.Streams.Root_Stream_Type which
-- facilitates implementation of Stream_IO.Stream and Text_Streams.Stream.
with Ada.Streams;
with Interfaces.C_Streams;
package System.File_Control_Block is
----------------------------
-- Ada File Control Block --
----------------------------
-- The Ada file control block is an abstract extension of the root
-- stream type. This allows a file to be treated directly as a stream
-- for the purposes of Stream_IO, or stream operations on a text file.
-- The individual I/O packages extend this type with package specific
-- fields to create the concrete types to which the routines in this
-- package can be applied.
-- The type File_Type in the individual packages is an access to the
-- extended file control block. The value is null if the file is not
-- open, and a pointer to the control block if the file is open.
type Pstring is access all String;
-- Used to hold name and form strings
type File_Mode is (In_File, Inout_File, Out_File, Append_File);
-- File mode (union of file modes permitted by individual packages,
-- the types File_Mode in the individual packages are declared to
-- allow easy conversion to and from this general type.
type Shared_Status_Type is (Yes, No, None);
-- This type is used to define the sharing status of a file. The default
-- setting of None is used if no "shared=xxx" appears in the form string
-- when a file is created or opened. For a file with Shared_Status set to
-- None, Use_Error will be raised if any other file is opened or created
-- with the same full name. Yes/No are set in response to the presence
-- of "shared=yes" or "shared=no" in the form string. In either case it
-- is permissible to have multiple files opened with the same full name.
-- All files opened simultaneously with "shared=yes" will share the same
-- stream with the semantics specified in the RM for file sharing. All
-- files opened with "shared=no" will have their own stream.
type AFCB;
type AFCB_Ptr is access all AFCB'Class;
type AFCB is abstract new Ada.Streams.Root_Stream_Type with record
Stream : Interfaces.C_Streams.FILEs;
-- The file descriptor
Name : Pstring;
-- A pointer to the file name. The file name is null for temporary
-- files, and also for standard files (stdin, stdout, stderr). The
-- name is always null-terminated if it is non-null.
Form : Pstring;
-- A pointer to the form string. This is the string used in the
-- fopen call, and must be supplied by the caller (there are no
-- defaults at this level). The string is always null-terminated.
Mode : File_Mode;
-- The file mode. No checks are made that the mode is consistent
-- with the form used to fopen the file.
Is_Regular_File : Boolean;
-- A flag indicating if the file is a regular file
Is_Temporary_File : Boolean;
-- A flag set only for temporary files (i.e. files created using the
-- Create function with a null name parameter, using tmpfile). This
-- is currently not used since temporary files are deleted by the
-- operating system, but it is set properly in case some systems
-- need this information in the future.
Is_System_File : Boolean;
-- A flag set only for system files (stdin, stdout, stderr)
Is_Text_File : Boolean;
-- A flag set if the file was opened in text mode
Shared_Status : Shared_Status_Type;
-- Indicates sharing status of file, see description of type above
Access_Method : Character;
-- Set to 'Q', 'S', 'T, 'D' for Sequential_IO, Stream_IO, Text_IO
-- Direct_IO file (used to validate file sharing request).
Next : AFCB_Ptr;
Prev : AFCB_Ptr;
-- All open files are kept on a doubly linked chain, with these
-- pointers used to maintain the next and previous pointers.
end record;
----------------------------------
-- Primitive Operations of AFCB --
----------------------------------
-- Note that we inherit the abstract operations Read and Write from
-- the base type. These must be overridden by the individual file
-- access methods to provide Stream Read/Write access.
function AFCB_Allocate (Control_Block : AFCB) return AFCB_Ptr is abstract;
-- Given a control block, allocate space for a control block of the same
-- type on the heap, and return the pointer to this allocated block. Note
-- that the argument Control_Block is not used other than as the argument
-- that controls which version of AFCB_Allocate is called.
procedure AFCB_Close (File : access AFCB) is abstract;
-- Performs any specialized close actions on a file before the file is
-- actually closed at the system level. This is called by Close, and
-- the reason we need the primitive operation is for the automatic
-- close operations done as part of finalization.
procedure AFCB_Free (File : access AFCB) is abstract;
-- Frees the AFCB referenced by the given parameter. It is not necessary
-- to free the strings referenced by the Form and Name fields, but if the
-- extension has any other heap objects, they must be freed as well. This
-- procedure must be overridden by each individual file package.
end System.File_Control_Block;
| 48.477987 | 78 | 0.606642 |
20e45fed2437370136dee4c6ffed6fddb1516945 | 1,470 | adb | Ada | source/slim-messages-server_setd.adb | reznikmm/slimp | acbbb895ba9c2a2dfb28e5065e630326ce958502 | [
"MIT"
] | null | null | null | source/slim-messages-server_setd.adb | reznikmm/slimp | acbbb895ba9c2a2dfb28e5065e630326ce958502 | [
"MIT"
] | null | null | null | source/slim-messages-server_setd.adb | reznikmm/slimp | acbbb895ba9c2a2dfb28e5065e630326ce958502 | [
"MIT"
] | null | null | null | -- Copyright (c) 2019 Maxim Reznik <[email protected]>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
with Slim.Message_Visiters;
package body Slim.Messages.Server_setd is
List : constant Field_Description_Array :=
(1 => (Uint_8_Field, 1)); -- Setting's code
----------
-- Read --
----------
overriding function Read
(Data : not null access
League.Stream_Element_Vectors.Stream_Element_Vector)
return Setd_Message is
begin
return Result : Setd_Message do
Read_Fields (Result, List, Data.all);
end return;
end Read;
-------------------------
-- Request_Player_Name --
-------------------------
not overriding procedure Request_Player_Name (Self : in out Setd_Message) is
begin
Self.Data_8 := (1 => 0);
end Request_Player_Name;
-----------
-- Visit --
-----------
overriding procedure Visit
(Self : not null access Setd_Message;
Visiter : in out Slim.Message_Visiters.Visiter'Class) is
begin
Visiter.setd (Self);
end Visit;
-----------
-- Write --
-----------
overriding procedure Write
(Self : Setd_Message;
Tag : out Message_Tag;
Data : out League.Stream_Element_Vectors.Stream_Element_Vector) is
begin
Tag := "setd";
Write_Fields (Self, List, Data);
end Write;
end Slim.Messages.Server_setd;
| 23.709677 | 79 | 0.570748 |
201d6b8636cc46af5dfa890dde6850660cd5cfee | 31,288 | adb | Ada | src/gnat/prj-attr.adb | My-Colaborations/dynamo | 09704417a23050d5bb52d48a65a14a1c2d926184 | [
"Apache-2.0"
] | null | null | null | src/gnat/prj-attr.adb | My-Colaborations/dynamo | 09704417a23050d5bb52d48a65a14a1c2d926184 | [
"Apache-2.0"
] | null | null | null | src/gnat/prj-attr.adb | My-Colaborations/dynamo | 09704417a23050d5bb52d48a65a14a1c2d926184 | [
"Apache-2.0"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- P R J . A T T R --
-- --
-- B o d y --
-- --
-- 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. --
-- --
------------------------------------------------------------------------------
with Osint;
with Prj.Com; use Prj.Com;
with GNAT.Case_Util; use GNAT.Case_Util;
package body Prj.Attr is
use GNAT;
-- Data for predefined attributes and packages
-- Names are in lower case and end with '#' or 'D'
-- Package names are preceded by 'P'
-- Attribute names are preceded by two or three letters:
-- The first letter is one of
-- 'S' for Single
-- 's' for Single with optional index
-- 'L' for List
-- 'l' for List of strings with optional indexes
-- The second letter is one of
-- 'V' for single variable
-- 'A' for associative array
-- 'a' for case insensitive associative array
-- 'b' for associative array, case insensitive if file names are case
-- insensitive
-- 'c' same as 'b', with optional index
-- The third optional letter is
-- 'R' the attribute is read-only
-- 'O' others is allowed as an index for an associative array
-- If the character after the name in lower case letter is a 'D' (for
-- default), then 'D' must be followed by an enumeration value of type
-- Attribute_Default_Value, followed by a '#'.
-- Example:
-- "SVobject_dirDdot_value#"
-- End is indicated by two consecutive '#'.
Initialization_Data : constant String :=
-- project level attributes
-- General
"SVRname#" &
"SVRproject_dir#" &
"lVmain#" &
"LVlanguages#" &
"Lbroots#" &
"SVexternally_built#" &
-- Directories
"SVobject_dirDdot_value#" &
"SVexec_dirDobject_dir_value#" &
"LVsource_dirsDdot_value#" &
"Lainherit_source_path#" &
"LVexcluded_source_dirs#" &
"LVignore_source_sub_dirs#" &
-- Source files
"LVsource_files#" &
"LVlocally_removed_files#" &
"LVexcluded_source_files#" &
"SVsource_list_file#" &
"SVexcluded_source_list_file#" &
"LVinterfaces#" &
-- Projects (in aggregate projects)
"LVproject_files#" &
"LVproject_path#" &
"SAexternal#" &
-- Libraries
"SVlibrary_dir#" &
"SVlibrary_name#" &
"SVlibrary_kind#" &
"SVlibrary_version#" &
"LVlibrary_interface#" &
"SVlibrary_standalone#" &
"LVlibrary_encapsulated_options#" &
"SVlibrary_encapsulated_supported#" &
"SVlibrary_auto_init#" &
"LVleading_library_options#" &
"LVlibrary_options#" &
"Lalibrary_rpath_options#" &
"SVlibrary_src_dir#" &
"SVlibrary_ali_dir#" &
"SVlibrary_gcc#" &
"SVlibrary_symbol_file#" &
"SVlibrary_symbol_policy#" &
"SVlibrary_reference_symbol_file#" &
-- Configuration - General
"SVdefault_language#" &
"LVrun_path_option#" &
"SVrun_path_origin#" &
"SVseparate_run_path_options#" &
"Satoolchain_version#" &
"Satoolchain_description#" &
"Saobject_generated#" &
"Saobjects_linked#" &
"SVtargetDtarget_value#" &
"SaruntimeDruntime_value#" &
-- Configuration - Libraries
"SVlibrary_builder#" &
"SVlibrary_support#" &
-- Configuration - Archives
"LVarchive_builder#" &
"LVarchive_builder_append_option#" &
"LVarchive_indexer#" &
"SVarchive_suffix#" &
"LVlibrary_partial_linker#" &
-- Configuration - Shared libraries
"SVshared_library_prefix#" &
"SVshared_library_suffix#" &
"SVsymbolic_link_supported#" &
"SVlibrary_major_minor_id_supported#" &
"SVlibrary_auto_init_supported#" &
"LVshared_library_minimum_switches#" &
"LVlibrary_version_switches#" &
"SVlibrary_install_name_option#" &
"Saruntime_library_dir#" &
"Saruntime_source_dir#" &
-- package Naming
-- Some attributes are obsolescent, and renamed in the tree (see
-- Prj.Dect.Rename_Obsolescent_Attributes).
"Pnaming#" &
"Saspecification_suffix#" & -- Always renamed to "spec_suffix" in tree
"Saspec_suffix#" &
"Saimplementation_suffix#" & -- Always renamed to "body_suffix" in tree
"Sabody_suffix#" &
"SVseparate_suffix#" &
"SVcasing#" &
"SVdot_replacement#" &
"saspecification#" & -- Always renamed to "spec" in project tree
"saspec#" &
"saimplementation#" & -- Always renamed to "body" in project tree
"sabody#" &
"Laspecification_exceptions#" &
"Laimplementation_exceptions#" &
-- package Compiler
"Pcompiler#" &
"Ladefault_switches#" &
"LcOswitches#" &
"SVlocal_configuration_pragmas#" &
"Salocal_config_file#" &
-- Configuration - Compiling
"Sadriver#" &
"Salanguage_kind#" &
"Sadependency_kind#" &
"Larequired_switches#" &
"Laleading_required_switches#" &
"Latrailing_required_switches#" &
"Lapic_option#" &
"Sapath_syntax#" &
"Lasource_file_switches#" &
"Saobject_file_suffix#" &
"Laobject_file_switches#" &
"Lamulti_unit_switches#" &
"Samulti_unit_object_separator#" &
-- Configuration - Mapping files
"Lamapping_file_switches#" &
"Samapping_spec_suffix#" &
"Samapping_body_suffix#" &
-- Configuration - Config files
"Laconfig_file_switches#" &
"Saconfig_body_file_name#" &
"Saconfig_body_file_name_index#" &
"Saconfig_body_file_name_pattern#" &
"Saconfig_spec_file_name#" &
"Saconfig_spec_file_name_index#" &
"Saconfig_spec_file_name_pattern#" &
"Saconfig_file_unique#" &
-- Configuration - Dependencies
"Ladependency_switches#" &
"Ladependency_driver#" &
-- Configuration - Search paths
"Lainclude_switches#" &
"Sainclude_path#" &
"Sainclude_path_file#" &
"Laobject_path_switches#" &
-- package Builder
"Pbuilder#" &
"Ladefault_switches#" &
"LcOswitches#" &
"Lcglobal_compilation_switches#" &
"Scexecutable#" &
"SVexecutable_suffix#" &
"SVglobal_configuration_pragmas#" &
"Saglobal_config_file#" &
-- package gnatls
"Pgnatls#" &
"LVswitches#" &
-- package Binder
"Pbinder#" &
"Ladefault_switches#" &
"LcOswitches#" &
-- Configuration - Binding
"Sadriver#" &
"Larequired_switches#" &
"Saprefix#" &
"Saobjects_path#" &
"Saobjects_path_file#" &
-- package Linker
"Plinker#" &
"LVrequired_switches#" &
"Ladefault_switches#" &
"LcOleading_switches#" &
"LcOswitches#" &
"LcOtrailing_switches#" &
"LVlinker_options#" &
"SVmap_file_option#" &
-- Configuration - Linking
"SVdriver#" &
-- Configuration - Response files
"SVmax_command_line_length#" &
"SVresponse_file_format#" &
"LVresponse_file_switches#" &
-- package Clean
"Pclean#" &
"LVswitches#" &
"Lasource_artifact_extensions#" &
"Laobject_artifact_extensions#" &
"LVartifacts_in_exec_dir#" &
"LVartifacts_in_object_dir#" &
-- package Cross_Reference
"Pcross_reference#" &
"Ladefault_switches#" &
"LbOswitches#" &
-- package Finder
"Pfinder#" &
"Ladefault_switches#" &
"LbOswitches#" &
-- package Pretty_Printer
"Ppretty_printer#" &
"Ladefault_switches#" &
"LbOswitches#" &
-- package gnatstub
"Pgnatstub#" &
"Ladefault_switches#" &
"LbOswitches#" &
-- package Check
"Pcheck#" &
"Ladefault_switches#" &
"LbOswitches#" &
-- package Eliminate
"Peliminate#" &
"Ladefault_switches#" &
"LbOswitches#" &
-- package Metrics
"Pmetrics#" &
"Ladefault_switches#" &
"LbOswitches#" &
-- package Ide
"Pide#" &
"Ladefault_switches#" &
"SVremote_host#" &
"SVprogram_host#" &
"SVcommunication_protocol#" &
"Sacompiler_command#" &
"SVdebugger_command#" &
"SVgnatlist#" &
"SVvcs_kind#" &
"SVvcs_file_check#" &
"SVvcs_log_check#" &
"SVdocumentation_dir#" &
-- package Install
"Pinstall#" &
"SVprefix#" &
"SVsources_subdir#" &
"SVexec_subdir#" &
"SVlib_subdir#" &
"SVproject_subdir#" &
"SVactive#" &
"LAartifacts#" &
"SVmode#" &
"SVinstall_name#" &
-- package Remote
"Premote#" &
"SVroot_dir#" &
"LVexcluded_patterns#" &
"LVincluded_patterns#" &
"LVincluded_artifact_patterns#" &
-- package Stack
"Pstack#" &
"LVswitches#" &
"#";
Initialized : Boolean := False;
-- A flag to avoid multiple initialization
Package_Names : String_List_Access := new Strings.String_List (1 .. 20);
Last_Package_Name : Natural := 0;
-- Package_Names (1 .. Last_Package_Name) contains the list of the known
-- package names, coming from the Initialization_Data string or from
-- calls to one of the two procedures Register_New_Package.
procedure Add_Package_Name (Name : String);
-- Add a package name in the Package_Name list, extending it, if necessary
function Name_Id_Of (Name : String) return Name_Id;
-- Returns the Name_Id for Name in lower case
----------------------
-- Add_Package_Name --
----------------------
procedure Add_Package_Name (Name : String) is
begin
if Last_Package_Name = Package_Names'Last then
declare
New_List : constant Strings.String_List_Access :=
new Strings.String_List (1 .. Package_Names'Last * 2);
begin
New_List (Package_Names'Range) := Package_Names.all;
Package_Names := New_List;
end;
end if;
Last_Package_Name := Last_Package_Name + 1;
Package_Names (Last_Package_Name) := new String'(Name);
end Add_Package_Name;
--------------------------
-- Attribute_Default_Of --
--------------------------
function Attribute_Default_Of
(Attribute : Attribute_Node_Id) return Attribute_Default_Value
is
begin
if Attribute = Empty_Attribute then
return Empty_Value;
else
return Attrs.Table (Attribute.Value).Default;
end if;
end Attribute_Default_Of;
-----------------------
-- Attribute_Kind_Of --
-----------------------
function Attribute_Kind_Of
(Attribute : Attribute_Node_Id) return Attribute_Kind
is
begin
if Attribute = Empty_Attribute then
return Unknown;
else
return Attrs.Table (Attribute.Value).Attr_Kind;
end if;
end Attribute_Kind_Of;
-----------------------
-- Attribute_Name_Of --
-----------------------
function Attribute_Name_Of (Attribute : Attribute_Node_Id) return Name_Id is
begin
if Attribute = Empty_Attribute then
return No_Name;
else
return Attrs.Table (Attribute.Value).Name;
end if;
end Attribute_Name_Of;
--------------------------
-- Attribute_Node_Id_Of --
--------------------------
function Attribute_Node_Id_Of
(Name : Name_Id;
Starting_At : Attribute_Node_Id) return Attribute_Node_Id
is
Id : Attr_Node_Id := Starting_At.Value;
begin
while Id /= Empty_Attr
and then Attrs.Table (Id).Name /= Name
loop
Id := Attrs.Table (Id).Next;
end loop;
return (Value => Id);
end Attribute_Node_Id_Of;
----------------
-- Initialize --
----------------
procedure Initialize is
Start : Positive := Initialization_Data'First;
Finish : Positive := Start;
Current_Package : Pkg_Node_Id := Empty_Pkg;
Current_Attribute : Attr_Node_Id := Empty_Attr;
Is_An_Attribute : Boolean := False;
Var_Kind : Variable_Kind := Undefined;
Optional_Index : Boolean := False;
Attr_Kind : Attribute_Kind := Single;
Package_Name : Name_Id := No_Name;
Attribute_Name : Name_Id := No_Name;
First_Attribute : Attr_Node_Id := Attr.First_Attribute;
Read_Only : Boolean;
Others_Allowed : Boolean;
Default : Attribute_Default_Value;
function Attribute_Location return String;
-- Returns a string depending if we are in the project level attributes
-- or in the attributes of a package.
------------------------
-- Attribute_Location --
------------------------
function Attribute_Location return String is
begin
if Package_Name = No_Name then
return "project level attributes";
else
return "attribute of package """ &
Get_Name_String (Package_Name) & """";
end if;
end Attribute_Location;
-- Start of processing for Initialize
begin
-- Don't allow Initialize action to be repeated
if Initialized then
return;
end if;
-- Make sure the two tables are empty
Attrs.Init;
Package_Attributes.Init;
while Initialization_Data (Start) /= '#' loop
Is_An_Attribute := True;
case Initialization_Data (Start) is
when 'P' =>
-- New allowed package
Start := Start + 1;
Finish := Start;
while Initialization_Data (Finish) /= '#' loop
Finish := Finish + 1;
end loop;
Package_Name :=
Name_Id_Of (Initialization_Data (Start .. Finish - 1));
for Index in First_Package .. Package_Attributes.Last loop
if Package_Name = Package_Attributes.Table (Index).Name then
Osint.Fail ("duplicate name """
& Initialization_Data (Start .. Finish - 1)
& """ in predefined packages.");
end if;
end loop;
Is_An_Attribute := False;
Current_Attribute := Empty_Attr;
Package_Attributes.Increment_Last;
Current_Package := Package_Attributes.Last;
Package_Attributes.Table (Current_Package) :=
(Name => Package_Name,
Known => True,
First_Attribute => Empty_Attr);
Start := Finish + 1;
Add_Package_Name (Get_Name_String (Package_Name));
when 'S' =>
Var_Kind := Single;
Optional_Index := False;
when 's' =>
Var_Kind := Single;
Optional_Index := True;
when 'L' =>
Var_Kind := List;
Optional_Index := False;
when 'l' =>
Var_Kind := List;
Optional_Index := True;
when others =>
raise Program_Error;
end case;
if Is_An_Attribute then
-- New attribute
Start := Start + 1;
case Initialization_Data (Start) is
when 'V' =>
Attr_Kind := Single;
when 'A' =>
Attr_Kind := Associative_Array;
when 'a' =>
Attr_Kind := Case_Insensitive_Associative_Array;
when 'b' =>
if Osint.File_Names_Case_Sensitive then
Attr_Kind := Associative_Array;
else
Attr_Kind := Case_Insensitive_Associative_Array;
end if;
when 'c' =>
if Osint.File_Names_Case_Sensitive then
Attr_Kind := Optional_Index_Associative_Array;
else
Attr_Kind :=
Optional_Index_Case_Insensitive_Associative_Array;
end if;
when others =>
raise Program_Error;
end case;
Start := Start + 1;
Read_Only := False;
Others_Allowed := False;
Default := Empty_Value;
if Initialization_Data (Start) = 'R' then
Read_Only := True;
Default := Read_Only_Value;
Start := Start + 1;
elsif Initialization_Data (Start) = 'O' then
Others_Allowed := True;
Start := Start + 1;
end if;
Finish := Start;
while Initialization_Data (Finish) /= '#'
and then
Initialization_Data (Finish) /= 'D'
loop
Finish := Finish + 1;
end loop;
Attribute_Name :=
Name_Id_Of (Initialization_Data (Start .. Finish - 1));
if Initialization_Data (Finish) = 'D' then
Start := Finish + 1;
Finish := Start;
while Initialization_Data (Finish) /= '#' loop
Finish := Finish + 1;
end loop;
declare
Default_Name : constant String :=
Initialization_Data (Start .. Finish - 1);
pragma Unsuppress (All_Checks);
begin
Default := Attribute_Default_Value'Value (Default_Name);
exception
when Constraint_Error =>
Osint.Fail
("illegal default value """ &
Default_Name &
""" for attribute " &
Get_Name_String (Attribute_Name));
end;
end if;
Attrs.Increment_Last;
if Current_Attribute = Empty_Attr then
First_Attribute := Attrs.Last;
if Current_Package /= Empty_Pkg then
Package_Attributes.Table (Current_Package).First_Attribute
:= Attrs.Last;
end if;
else
-- Check that there are no duplicate attributes
for Index in First_Attribute .. Attrs.Last - 1 loop
if Attribute_Name = Attrs.Table (Index).Name then
Osint.Fail ("duplicate attribute """
& Initialization_Data (Start .. Finish - 1)
& """ in " & Attribute_Location);
end if;
end loop;
Attrs.Table (Current_Attribute).Next :=
Attrs.Last;
end if;
Current_Attribute := Attrs.Last;
Attrs.Table (Current_Attribute) :=
(Name => Attribute_Name,
Var_Kind => Var_Kind,
Optional_Index => Optional_Index,
Attr_Kind => Attr_Kind,
Read_Only => Read_Only,
Others_Allowed => Others_Allowed,
Default => Default,
Next => Empty_Attr);
Start := Finish + 1;
end if;
end loop;
Initialized := True;
end Initialize;
------------------
-- Is_Read_Only --
------------------
function Is_Read_Only (Attribute : Attribute_Node_Id) return Boolean is
begin
return Attrs.Table (Attribute.Value).Read_Only;
end Is_Read_Only;
----------------
-- Name_Id_Of --
----------------
function Name_Id_Of (Name : String) return Name_Id is
begin
Name_Len := 0;
Add_Str_To_Name_Buffer (Name);
To_Lower (Name_Buffer (1 .. Name_Len));
return Name_Find;
end Name_Id_Of;
--------------------
-- Next_Attribute --
--------------------
function Next_Attribute
(After : Attribute_Node_Id) return Attribute_Node_Id
is
begin
if After = Empty_Attribute then
return Empty_Attribute;
else
return (Value => Attrs.Table (After.Value).Next);
end if;
end Next_Attribute;
-----------------------
-- Optional_Index_Of --
-----------------------
function Optional_Index_Of (Attribute : Attribute_Node_Id) return Boolean is
begin
if Attribute = Empty_Attribute then
return False;
else
return Attrs.Table (Attribute.Value).Optional_Index;
end if;
end Optional_Index_Of;
function Others_Allowed_For
(Attribute : Attribute_Node_Id) return Boolean
is
begin
if Attribute = Empty_Attribute then
return False;
else
return Attrs.Table (Attribute.Value).Others_Allowed;
end if;
end Others_Allowed_For;
-----------------------
-- Package_Name_List --
-----------------------
function Package_Name_List return Strings.String_List is
begin
return Package_Names (1 .. Last_Package_Name);
end Package_Name_List;
------------------------
-- Package_Node_Id_Of --
------------------------
function Package_Node_Id_Of (Name : Name_Id) return Package_Node_Id is
begin
for Index in Package_Attributes.First .. Package_Attributes.Last loop
if Package_Attributes.Table (Index).Name = Name then
if Package_Attributes.Table (Index).Known then
return (Value => Index);
else
return Unknown_Package;
end if;
end if;
end loop;
-- If there is no package with this name, return Empty_Package
return Empty_Package;
end Package_Node_Id_Of;
----------------------------
-- Register_New_Attribute --
----------------------------
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)
is
Attr_Name : Name_Id;
First_Attr : Attr_Node_Id := Empty_Attr;
Curr_Attr : Attr_Node_Id;
Real_Attr_Kind : Attribute_Kind;
begin
if Name'Length = 0 then
Fail ("cannot register an attribute with no name");
raise Project_Error;
end if;
if In_Package = Empty_Package then
Fail ("attempt to add attribute """
& Name
& """ to an undefined package");
raise Project_Error;
end if;
Attr_Name := Name_Id_Of (Name);
First_Attr :=
Package_Attributes.Table (In_Package.Value).First_Attribute;
-- Check if attribute name is a duplicate
Curr_Attr := First_Attr;
while Curr_Attr /= Empty_Attr loop
if Attrs.Table (Curr_Attr).Name = Attr_Name then
Fail ("duplicate attribute name """
& Name
& """ in package """
& Get_Name_String
(Package_Attributes.Table (In_Package.Value).Name)
& """");
raise Project_Error;
end if;
Curr_Attr := Attrs.Table (Curr_Attr).Next;
end loop;
Real_Attr_Kind := Attr_Kind;
-- If Index_Is_File_Name, change the attribute kind if necessary
if Index_Is_File_Name and then not Osint.File_Names_Case_Sensitive then
case Attr_Kind is
when Associative_Array =>
Real_Attr_Kind := Case_Insensitive_Associative_Array;
when Optional_Index_Associative_Array =>
Real_Attr_Kind :=
Optional_Index_Case_Insensitive_Associative_Array;
when others =>
null;
end case;
end if;
-- Add the new attribute
Attrs.Increment_Last;
Attrs.Table (Attrs.Last) :=
(Name => Attr_Name,
Var_Kind => Var_Kind,
Optional_Index => Opt_Index,
Attr_Kind => Real_Attr_Kind,
Read_Only => False,
Others_Allowed => False,
Default => Default,
Next => First_Attr);
Package_Attributes.Table (In_Package.Value).First_Attribute :=
Attrs.Last;
end Register_New_Attribute;
--------------------------
-- Register_New_Package --
--------------------------
procedure Register_New_Package (Name : String; Id : out Package_Node_Id) is
Pkg_Name : Name_Id;
Found : Boolean := False;
begin
if Name'Length = 0 then
Fail ("cannot register a package with no name");
Id := Empty_Package;
return;
end if;
Pkg_Name := Name_Id_Of (Name);
for Index in Package_Attributes.First .. Package_Attributes.Last loop
if Package_Attributes.Table (Index).Name = Pkg_Name then
if Package_Attributes.Table (Index).Known then
Fail ("cannot register a package with a non unique name """
& Name
& """");
Id := Empty_Package;
return;
else
Found := True;
Id := (Value => Index);
exit;
end if;
end if;
end loop;
if not Found then
Package_Attributes.Increment_Last;
Id := (Value => Package_Attributes.Last);
end if;
Package_Attributes.Table (Id.Value) :=
(Name => Pkg_Name,
Known => True,
First_Attribute => Empty_Attr);
Add_Package_Name (Get_Name_String (Pkg_Name));
end Register_New_Package;
procedure Register_New_Package
(Name : String;
Attributes : Attribute_Data_Array)
is
Pkg_Name : Name_Id;
Attr_Name : Name_Id;
First_Attr : Attr_Node_Id := Empty_Attr;
Curr_Attr : Attr_Node_Id;
Attr_Kind : Attribute_Kind;
begin
if Name'Length = 0 then
Fail ("cannot register a package with no name");
raise Project_Error;
end if;
Pkg_Name := Name_Id_Of (Name);
for Index in Package_Attributes.First .. Package_Attributes.Last loop
if Package_Attributes.Table (Index).Name = Pkg_Name then
Fail ("cannot register a package with a non unique name """
& Name
& """");
raise Project_Error;
end if;
end loop;
for Index in Attributes'Range loop
Attr_Name := Name_Id_Of (Attributes (Index).Name);
Curr_Attr := First_Attr;
while Curr_Attr /= Empty_Attr loop
if Attrs.Table (Curr_Attr).Name = Attr_Name then
Fail ("duplicate attribute name """
& Attributes (Index).Name
& """ in new package """
& Name
& """");
raise Project_Error;
end if;
Curr_Attr := Attrs.Table (Curr_Attr).Next;
end loop;
Attr_Kind := Attributes (Index).Attr_Kind;
if Attributes (Index).Index_Is_File_Name
and then not Osint.File_Names_Case_Sensitive
then
case Attr_Kind is
when Associative_Array =>
Attr_Kind := Case_Insensitive_Associative_Array;
when Optional_Index_Associative_Array =>
Attr_Kind :=
Optional_Index_Case_Insensitive_Associative_Array;
when others =>
null;
end case;
end if;
Attrs.Increment_Last;
Attrs.Table (Attrs.Last) :=
(Name => Attr_Name,
Var_Kind => Attributes (Index).Var_Kind,
Optional_Index => Attributes (Index).Opt_Index,
Attr_Kind => Attr_Kind,
Read_Only => False,
Others_Allowed => False,
Default => Attributes (Index).Default,
Next => First_Attr);
First_Attr := Attrs.Last;
end loop;
Package_Attributes.Increment_Last;
Package_Attributes.Table (Package_Attributes.Last) :=
(Name => Pkg_Name,
Known => True,
First_Attribute => First_Attr);
Add_Package_Name (Get_Name_String (Pkg_Name));
end Register_New_Package;
---------------------------
-- Set_Attribute_Kind_Of --
---------------------------
procedure Set_Attribute_Kind_Of
(Attribute : Attribute_Node_Id;
To : Attribute_Kind)
is
begin
if Attribute /= Empty_Attribute then
Attrs.Table (Attribute.Value).Attr_Kind := To;
end if;
end Set_Attribute_Kind_Of;
--------------------------
-- Set_Variable_Kind_Of --
--------------------------
procedure Set_Variable_Kind_Of
(Attribute : Attribute_Node_Id;
To : Variable_Kind)
is
begin
if Attribute /= Empty_Attribute then
Attrs.Table (Attribute.Value).Var_Kind := To;
end if;
end Set_Variable_Kind_Of;
----------------------
-- Variable_Kind_Of --
----------------------
function Variable_Kind_Of
(Attribute : Attribute_Node_Id) return Variable_Kind
is
begin
if Attribute = Empty_Attribute then
return Undefined;
else
return Attrs.Table (Attribute.Value).Var_Kind;
end if;
end Variable_Kind_Of;
------------------------
-- First_Attribute_Of --
------------------------
function First_Attribute_Of
(Pkg : Package_Node_Id) return Attribute_Node_Id
is
begin
if Pkg = Empty_Package or else Pkg = Unknown_Package then
return Empty_Attribute;
else
return
(Value => Package_Attributes.Table (Pkg.Value).First_Attribute);
end if;
end First_Attribute_Of;
end Prj.Attr;
| 28.730946 | 79 | 0.548102 |
2042326b7f97a351a1ee06713bb0ba3b60b12385 | 17,906 | ads | Ada | tools/scitools/conf/understand/ada/ada12/a-swmwco.ads | brucegua/moocos | 575c161cfa35e220f10d042e2e5ca18773691695 | [
"Apache-2.0"
] | 1 | 2020-01-20T21:26:46.000Z | 2020-01-20T21:26:46.000Z | tools/scitools/conf/understand/ada/ada12/a-swmwco.ads | brucegua/moocos | 575c161cfa35e220f10d042e2e5ca18773691695 | [
"Apache-2.0"
] | null | null | null | tools/scitools/conf/understand/ada/ada12/a-swmwco.ads | brucegua/moocos | 575c161cfa35e220f10d042e2e5ca18773691695 | [
"Apache-2.0"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- A D A . S T R I N G S . W I D E _ M A P S . W I D E _ C O N S T A N T S --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
-- apply solely to the contents of the part following the private keyword. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- --
-- --
-- --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with Ada.Characters.Wide_Latin_1;
package Ada.Strings.Wide_Maps.Wide_Constants is
pragma Preelaborate;
Control_Set : constant Wide_Maps.Wide_Character_Set;
Graphic_Set : constant Wide_Maps.Wide_Character_Set;
Letter_Set : constant Wide_Maps.Wide_Character_Set;
Lower_Set : constant Wide_Maps.Wide_Character_Set;
Upper_Set : constant Wide_Maps.Wide_Character_Set;
Basic_Set : constant Wide_Maps.Wide_Character_Set;
Decimal_Digit_Set : constant Wide_Maps.Wide_Character_Set;
Hexadecimal_Digit_Set : constant Wide_Maps.Wide_Character_Set;
Alphanumeric_Set : constant Wide_Maps.Wide_Character_Set;
Special_Graphic_Set : constant Wide_Maps.Wide_Character_Set;
ISO_646_Set : constant Wide_Maps.Wide_Character_Set;
Character_Set : constant Wide_Maps.Wide_Character_Set;
Lower_Case_Map : constant Wide_Maps.Wide_Character_Mapping;
-- Maps to lower case for letters, else identity
Upper_Case_Map : constant Wide_Maps.Wide_Character_Mapping;
-- Maps to upper case for letters, else identity
Basic_Map : constant Wide_Maps.Wide_Character_Mapping;
-- Maps to basic letter for letters, else identity
private
package W renames Ada.Characters.Wide_Latin_1;
subtype WC is Wide_Character;
Control_Ranges : aliased constant Wide_Character_Ranges :=
((W.NUL, W.US),
(W.DEL, W.APC));
Control_Set : constant Wide_Character_Set :=
(AF.Controlled with
Control_Ranges'Unrestricted_Access);
Graphic_Ranges : aliased constant Wide_Character_Ranges :=
((W.Space, W.Tilde),
(WC'Val (256), WC'Last));
Graphic_Set : constant Wide_Character_Set :=
(AF.Controlled with
Graphic_Ranges'Unrestricted_Access);
Letter_Ranges : aliased constant Wide_Character_Ranges :=
(('A', 'Z'),
(W.LC_A, W.LC_Z),
(W.UC_A_Grave, W.UC_O_Diaeresis),
(W.UC_O_Oblique_Stroke, W.LC_O_Diaeresis),
(W.LC_O_Oblique_Stroke, W.LC_Y_Diaeresis));
Letter_Set : constant Wide_Character_Set :=
(AF.Controlled with
Letter_Ranges'Unrestricted_Access);
Lower_Ranges : aliased constant Wide_Character_Ranges :=
(1 => (W.LC_A, W.LC_Z),
2 => (W.LC_German_Sharp_S, W.LC_O_Diaeresis),
3 => (W.LC_O_Oblique_Stroke, W.LC_Y_Diaeresis));
Lower_Set : constant Wide_Character_Set :=
(AF.Controlled with
Lower_Ranges'Unrestricted_Access);
Upper_Ranges : aliased constant Wide_Character_Ranges :=
(1 => ('A', 'Z'),
2 => (W.UC_A_Grave, W.UC_O_Diaeresis),
3 => (W.UC_O_Oblique_Stroke, W.UC_Icelandic_Thorn));
Upper_Set : constant Wide_Character_Set :=
(AF.Controlled with
Upper_Ranges'Unrestricted_Access);
Basic_Ranges : aliased constant Wide_Character_Ranges :=
(1 => ('A', 'Z'),
2 => (W.LC_A, W.LC_Z),
3 => (W.UC_AE_Diphthong, W.UC_AE_Diphthong),
4 => (W.LC_AE_Diphthong, W.LC_AE_Diphthong),
5 => (W.LC_German_Sharp_S, W.LC_German_Sharp_S),
6 => (W.UC_Icelandic_Thorn, W.UC_Icelandic_Thorn),
7 => (W.LC_Icelandic_Thorn, W.LC_Icelandic_Thorn),
8 => (W.UC_Icelandic_Eth, W.UC_Icelandic_Eth),
9 => (W.LC_Icelandic_Eth, W.LC_Icelandic_Eth));
Basic_Set : constant Wide_Character_Set :=
(AF.Controlled with
Basic_Ranges'Unrestricted_Access);
Decimal_Digit_Ranges : aliased constant Wide_Character_Ranges :=
(1 => ('0', '9'));
Decimal_Digit_Set : constant Wide_Character_Set :=
(AF.Controlled with
Decimal_Digit_Ranges'Unrestricted_Access);
Hexadecimal_Digit_Ranges : aliased constant Wide_Character_Ranges :=
(1 => ('0', '9'),
2 => ('A', 'F'),
3 => (W.LC_A, W.LC_F));
Hexadecimal_Digit_Set : constant Wide_Character_Set :=
(AF.Controlled with
Hexadecimal_Digit_Ranges'Unrestricted_Access);
Alphanumeric_Ranges : aliased constant Wide_Character_Ranges :=
(1 => ('0', '9'),
2 => ('A', 'Z'),
3 => (W.LC_A, W.LC_Z),
4 => (W.UC_A_Grave, W.UC_O_Diaeresis),
5 => (W.UC_O_Oblique_Stroke, W.LC_O_Diaeresis),
6 => (W.LC_O_Oblique_Stroke, W.LC_Y_Diaeresis));
Alphanumeric_Set : constant Wide_Character_Set :=
(AF.Controlled with
Alphanumeric_Ranges'Unrestricted_Access);
Special_Graphic_Ranges : aliased constant Wide_Character_Ranges :=
(1 => (Wide_Space, W.Solidus),
2 => (W.Colon, W.Commercial_At),
3 => (W.Left_Square_Bracket, W.Grave),
4 => (W.Left_Curly_Bracket, W.Tilde),
5 => (W.No_Break_Space, W.Inverted_Question),
6 => (W.Multiplication_Sign, W.Multiplication_Sign),
7 => (W.Division_Sign, W.Division_Sign));
Special_Graphic_Set : constant Wide_Character_Set :=
(AF.Controlled with
Special_Graphic_Ranges'Unrestricted_Access);
ISO_646_Ranges : aliased constant Wide_Character_Ranges :=
(1 => (W.NUL, W.DEL));
ISO_646_Set : constant Wide_Character_Set :=
(AF.Controlled with
ISO_646_Ranges'Unrestricted_Access);
Character_Ranges : aliased constant Wide_Character_Ranges :=
(1 => (W.NUL, WC'Val (255)));
Character_Set : constant Wide_Character_Set :=
(AF.Controlled with
Character_Ranges'Unrestricted_Access);
Lower_Case_Mapping : aliased constant Wide_Character_Mapping_Values :=
(Length => 56,
Domain =>
"ABCDEFGHIJKLMNOPQRSTUVWXYZ" &
W.UC_A_Grave &
W.UC_A_Acute &
W.UC_A_Circumflex &
W.UC_A_Tilde &
W.UC_A_Diaeresis &
W.UC_A_Ring &
W.UC_AE_Diphthong &
W.UC_C_Cedilla &
W.UC_E_Grave &
W.UC_E_Acute &
W.UC_E_Circumflex &
W.UC_E_Diaeresis &
W.UC_I_Grave &
W.UC_I_Acute &
W.UC_I_Circumflex &
W.UC_I_Diaeresis &
W.UC_Icelandic_Eth &
W.UC_N_Tilde &
W.UC_O_Grave &
W.UC_O_Acute &
W.UC_O_Circumflex &
W.UC_O_Tilde &
W.UC_O_Diaeresis &
W.UC_O_Oblique_Stroke &
W.UC_U_Grave &
W.UC_U_Acute &
W.UC_U_Circumflex &
W.UC_U_Diaeresis &
W.UC_Y_Acute &
W.UC_Icelandic_Thorn,
Rangev =>
"abcdefghijklmnopqrstuvwxyz" &
W.LC_A_Grave &
W.LC_A_Acute &
W.LC_A_Circumflex &
W.LC_A_Tilde &
W.LC_A_Diaeresis &
W.LC_A_Ring &
W.LC_AE_Diphthong &
W.LC_C_Cedilla &
W.LC_E_Grave &
W.LC_E_Acute &
W.LC_E_Circumflex &
W.LC_E_Diaeresis &
W.LC_I_Grave &
W.LC_I_Acute &
W.LC_I_Circumflex &
W.LC_I_Diaeresis &
W.LC_Icelandic_Eth &
W.LC_N_Tilde &
W.LC_O_Grave &
W.LC_O_Acute &
W.LC_O_Circumflex &
W.LC_O_Tilde &
W.LC_O_Diaeresis &
W.LC_O_Oblique_Stroke &
W.LC_U_Grave &
W.LC_U_Acute &
W.LC_U_Circumflex &
W.LC_U_Diaeresis &
W.LC_Y_Acute &
W.LC_Icelandic_Thorn);
Lower_Case_Map : constant Wide_Character_Mapping :=
(AF.Controlled with
Map => Lower_Case_Mapping'Unrestricted_Access);
Upper_Case_Mapping : aliased constant Wide_Character_Mapping_Values :=
(Length => 56,
Domain =>
"abcdefghijklmnopqrstuvwxyz" &
W.LC_A_Grave &
W.LC_A_Acute &
W.LC_A_Circumflex &
W.LC_A_Tilde &
W.LC_A_Diaeresis &
W.LC_A_Ring &
W.LC_AE_Diphthong &
W.LC_C_Cedilla &
W.LC_E_Grave &
W.LC_E_Acute &
W.LC_E_Circumflex &
W.LC_E_Diaeresis &
W.LC_I_Grave &
W.LC_I_Acute &
W.LC_I_Circumflex &
W.LC_I_Diaeresis &
W.LC_Icelandic_Eth &
W.LC_N_Tilde &
W.LC_O_Grave &
W.LC_O_Acute &
W.LC_O_Circumflex &
W.LC_O_Tilde &
W.LC_O_Diaeresis &
W.LC_O_Oblique_Stroke &
W.LC_U_Grave &
W.LC_U_Acute &
W.LC_U_Circumflex &
W.LC_U_Diaeresis &
W.LC_Y_Acute &
W.LC_Icelandic_Thorn,
Rangev =>
"ABCDEFGHIJKLMNOPQRSTUVWXYZ" &
W.UC_A_Grave &
W.UC_A_Acute &
W.UC_A_Circumflex &
W.UC_A_Tilde &
W.UC_A_Diaeresis &
W.UC_A_Ring &
W.UC_AE_Diphthong &
W.UC_C_Cedilla &
W.UC_E_Grave &
W.UC_E_Acute &
W.UC_E_Circumflex &
W.UC_E_Diaeresis &
W.UC_I_Grave &
W.UC_I_Acute &
W.UC_I_Circumflex &
W.UC_I_Diaeresis &
W.UC_Icelandic_Eth &
W.UC_N_Tilde &
W.UC_O_Grave &
W.UC_O_Acute &
W.UC_O_Circumflex &
W.UC_O_Tilde &
W.UC_O_Diaeresis &
W.UC_O_Oblique_Stroke &
W.UC_U_Grave &
W.UC_U_Acute &
W.UC_U_Circumflex &
W.UC_U_Diaeresis &
W.UC_Y_Acute &
W.UC_Icelandic_Thorn);
Upper_Case_Map : constant Wide_Character_Mapping :=
(AF.Controlled with
Upper_Case_Mapping'Unrestricted_Access);
Basic_Mapping : aliased constant Wide_Character_Mapping_Values :=
(Length => 55,
Domain =>
W.UC_A_Grave &
W.UC_A_Acute &
W.UC_A_Circumflex &
W.UC_A_Tilde &
W.UC_A_Diaeresis &
W.UC_A_Ring &
W.UC_C_Cedilla &
W.UC_E_Grave &
W.UC_E_Acute &
W.UC_E_Circumflex &
W.UC_E_Diaeresis &
W.UC_I_Grave &
W.UC_I_Acute &
W.UC_I_Circumflex &
W.UC_I_Diaeresis &
W.UC_N_Tilde &
W.UC_O_Grave &
W.UC_O_Acute &
W.UC_O_Circumflex &
W.UC_O_Tilde &
W.UC_O_Diaeresis &
W.UC_O_Oblique_Stroke &
W.UC_U_Grave &
W.UC_U_Acute &
W.UC_U_Circumflex &
W.UC_U_Diaeresis &
W.UC_Y_Acute &
W.LC_A_Grave &
W.LC_A_Acute &
W.LC_A_Circumflex &
W.LC_A_Tilde &
W.LC_A_Diaeresis &
W.LC_A_Ring &
W.LC_C_Cedilla &
W.LC_E_Grave &
W.LC_E_Acute &
W.LC_E_Circumflex &
W.LC_E_Diaeresis &
W.LC_I_Grave &
W.LC_I_Acute &
W.LC_I_Circumflex &
W.LC_I_Diaeresis &
W.LC_N_Tilde &
W.LC_O_Grave &
W.LC_O_Acute &
W.LC_O_Circumflex &
W.LC_O_Tilde &
W.LC_O_Diaeresis &
W.LC_O_Oblique_Stroke &
W.LC_U_Grave &
W.LC_U_Acute &
W.LC_U_Circumflex &
W.LC_U_Diaeresis &
W.LC_Y_Acute &
W.LC_Y_Diaeresis,
Rangev =>
'A' & -- UC_A_Grave
'A' & -- UC_A_Acute
'A' & -- UC_A_Circumflex
'A' & -- UC_A_Tilde
'A' & -- UC_A_Diaeresis
'A' & -- UC_A_Ring
'C' & -- UC_C_Cedilla
'E' & -- UC_E_Grave
'E' & -- UC_E_Acute
'E' & -- UC_E_Circumflex
'E' & -- UC_E_Diaeresis
'I' & -- UC_I_Grave
'I' & -- UC_I_Acute
'I' & -- UC_I_Circumflex
'I' & -- UC_I_Diaeresis
'N' & -- UC_N_Tilde
'O' & -- UC_O_Grave
'O' & -- UC_O_Acute
'O' & -- UC_O_Circumflex
'O' & -- UC_O_Tilde
'O' & -- UC_O_Diaeresis
'O' & -- UC_O_Oblique_Stroke
'U' & -- UC_U_Grave
'U' & -- UC_U_Acute
'U' & -- UC_U_Circumflex
'U' & -- UC_U_Diaeresis
'Y' & -- UC_Y_Acute
'a' & -- LC_A_Grave
'a' & -- LC_A_Acute
'a' & -- LC_A_Circumflex
'a' & -- LC_A_Tilde
'a' & -- LC_A_Diaeresis
'a' & -- LC_A_Ring
'c' & -- LC_C_Cedilla
'e' & -- LC_E_Grave
'e' & -- LC_E_Acute
'e' & -- LC_E_Circumflex
'e' & -- LC_E_Diaeresis
'i' & -- LC_I_Grave
'i' & -- LC_I_Acute
'i' & -- LC_I_Circumflex
'i' & -- LC_I_Diaeresis
'n' & -- LC_N_Tilde
'o' & -- LC_O_Grave
'o' & -- LC_O_Acute
'o' & -- LC_O_Circumflex
'o' & -- LC_O_Tilde
'o' & -- LC_O_Diaeresis
'o' & -- LC_O_Oblique_Stroke
'u' & -- LC_U_Grave
'u' & -- LC_U_Acute
'u' & -- LC_U_Circumflex
'u' & -- LC_U_Diaeresis
'y' & -- LC_Y_Acute
'y'); -- LC_Y_Diaeresis
Basic_Map : constant Wide_Character_Mapping :=
(AF.Controlled with
Basic_Mapping'Unrestricted_Access);
end Ada.Strings.Wide_Maps.Wide_Constants;
| 39.702882 | 78 | 0.46046 |
0ef9e703fb5e3200e0f2cb60445aca264554d3ec | 3,562 | ads | Ada | tools-src/gnu/gcc/gcc/ada/s-expgen.ads | modern-tomato/tomato | 96f09fab4929c6ddde5c9113f1b2476ad37133c4 | [
"FSFAP"
] | 80 | 2015-01-02T10:14:04.000Z | 2021-06-07T06:29:49.000Z | tools-src/gnu/gcc/gcc/ada/s-expgen.ads | modern-tomato/tomato | 96f09fab4929c6ddde5c9113f1b2476ad37133c4 | [
"FSFAP"
] | 9 | 2015-05-14T11:03:12.000Z | 2018-01-04T07:12:58.000Z | tools-src/gnu/gcc/gcc/ada/s-expgen.ads | modern-tomato/tomato | 96f09fab4929c6ddde5c9113f1b2476ad37133c4 | [
"FSFAP"
] | 69 | 2015-01-02T10:45:56.000Z | 2021-09-06T07:52:13.000Z | ------------------------------------------------------------------------------
-- --
-- GNAT RUNTIME COMPONENTS --
-- --
-- S Y S T E M . E X P _ G E N --
-- --
-- S p e c --
-- --
-- $Revision$
-- --
-- Copyright (C) 1992,1993,1994,1995 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package contains the generic functions which are instantiated with
-- predefined integer and real types to generate the runtime exponentiation
-- functions called by expanded code generated by Expand_Op_Expon. This
-- version of the package contains routines that are compiled with overflow
-- checks enabled, so they are called for exponentiation operations which
-- require overflow checking
package System.Exp_Gen is
pragma Pure (System.Exp_Gen);
-- Exponentiation for float types (checks on)
generic
type Type_Of_Base is digits <>;
function Exp_Float_Type
(Left : Type_Of_Base;
Right : Integer)
return Type_Of_Base;
-- Exponentiation for signed integer types (checks on)
generic
type Type_Of_Base is range <>;
function Exp_Integer_Type
(Left : Type_Of_Base;
Right : Natural)
return Type_Of_Base;
end System.Exp_Gen;
| 53.164179 | 79 | 0.479787 |
2015830e9257c6711090716ea822abfb2c19f9e1 | 1,770 | ads | Ada | 3-mid/impact/source/3d/collision/narrowphase/impact-d3-collision-convex_raycast-subsimplex.ads | charlie5/lace | e9b7dc751d500ff3f559617a6fc3089ace9dc134 | [
"0BSD"
] | 20 | 2015-11-04T09:23:59.000Z | 2022-01-14T10:21:42.000Z | 3-mid/impact/source/3d/collision/narrowphase/impact-d3-collision-convex_raycast-subsimplex.ads | charlie5/lace | e9b7dc751d500ff3f559617a6fc3089ace9dc134 | [
"0BSD"
] | 2 | 2015-11-04T17:05:56.000Z | 2015-12-08T03:16:13.000Z | 3-mid/impact/source/3d/collision/narrowphase/impact-d3-collision-convex_raycast-subsimplex.ads | charlie5/lace | e9b7dc751d500ff3f559617a6fc3089ace9dc134 | [
"0BSD"
] | 1 | 2015-12-07T12:53:52.000Z | 2015-12-07T12:53:52.000Z | with impact.d3.collision.convex_Raycast,
impact.d3.Shape.convex,
impact.d3.collision.simplex_Solver;
package impact.d3.collision.convex_Raycast.subsimplex
--
-- impact.d3.collision.convex_Raycast.subsimplex implements Gino van den Bergens' paper ...
-- "Ray Casting against bteral Convex Objects with Application to Continuous Collision Detection".
--
-- GJK based Ray Cast, optimized version.
--
-- Objects should not start in overlap, otherwise results are not defined.
--
is
type Item is new impact.d3.collision.convex_Raycast.Item with private;
function to_convex_Raycast (shapeA, shapeB : in impact.d3.Shape.convex.view;
simplexSolver : access impact.d3.collision.simplex_Solver.Item'Class) return Item;
overriding function calcTimeOfImpact (Self : access Item; fromA, toA : in Transform_3d;
fromB, toB : in Transform_3d;
result : access impact.d3.collision.convex_Raycast.CastResult'Class) return Boolean;
--
-- SimsimplexConvexCast calculateTimeOfImpact calculates the time of impact+normal for the linear cast (sweep) between two moving objects.
--
-- Precondition is that objects should not penetration/overlap at the start from the interval. Overlap can be tested using impact.d3.collision.Detector.discrete.gjk_pair.
private
type Item is new impact.d3.collision.convex_Raycast.Item with
record
m_simplexSolver : access impact.d3.collision.simplex_Solver.Item'Class;
m_convexA,
m_convexB : access impact.d3.Shape.convex.Item'Class;
end record;
end impact.d3.collision.convex_Raycast.subsimplex;
| 34.705882 | 174 | 0.689266 |
cbdf269b1d3d18a41cd4a08655d45c80994853a3 | 4,944 | adb | Ada | testsuite/league/character_cursor_test.adb | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 24 | 2016-11-29T06:59:41.000Z | 2021-08-30T11:55:16.000Z | testsuite/league/character_cursor_test.adb | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 2 | 2019-01-16T05:15:20.000Z | 2019-02-03T10:03:32.000Z | testsuite/league/character_cursor_test.adb | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 4 | 2017-07-18T07:11:05.000Z | 2020-06-21T03:02:25.000Z | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Localization, Internationalization, Globalization for Ada --
-- --
-- Testsuite Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2009-2011, Vadim Godunko <[email protected]> --
-- 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 League.Application;
with League.Strings.Cursors.Characters;
procedure Character_Cursor_Test is
use League.Strings;
use League.Strings.Cursors.Characters;
C1 : constant Wide_Wide_String := "123";
C2 : constant Wide_Wide_String
:= Wide_Wide_Character'Val (16#10000#)
& "b"
& Wide_Wide_Character'Val (16#10001#);
procedure Do_Test (C : Wide_Wide_String);
procedure Do_Test (C : Wide_Wide_String) is
S : Universal_String := To_Universal_String (C);
J : Character_Cursor;
N : Natural;
begin
-- Test forward iterator and backward iterator.
J.First (S);
N := C'First;
while J.Has_Element loop
if C (N) /= J.Element then
raise Program_Error;
end if;
J.Next;
N := N + 1;
end loop;
J.Previous;
N := N - 1;
while J.Has_Element loop
if C (N) /= J.Element then
raise Program_Error;
end if;
J.Previous;
N := N - 1;
end loop;
-- Test backward iterator and forward iterator.
J.Last (S);
N := C'Last;
while J.Has_Element loop
if C (N) /= J.Element then
raise Program_Error;
end if;
J.Previous;
N := N - 1;
end loop;
J.Next;
N := N + 1;
while J.Has_Element loop
if C (N) /= J.Element then
raise Program_Error;
end if;
J.Next;
N := N + 1;
end loop;
end Do_Test;
begin
Do_Test (C1);
Do_Test (C2);
end Character_Cursor_Test;
| 40.195122 | 78 | 0.444377 |
cbf56f73a699510dc67064edba5053d37dea396a | 20,341 | adb | Ada | sources/driver/md_driver.adb | reznikmm/markdown | af47bd45427f1c016c0a2a11e86fa2d1b1c82315 | [
"MIT"
] | null | null | null | sources/driver/md_driver.adb | reznikmm/markdown | af47bd45427f1c016c0a2a11e86fa2d1b1c82315 | [
"MIT"
] | null | null | null | sources/driver/md_driver.adb | reznikmm/markdown | af47bd45427f1c016c0a2a11e86fa2d1b1c82315 | [
"MIT"
] | null | null | null | -- SPDX-FileCopyrightText: 2020 Max Reznik <[email protected]>
--
-- SPDX-License-Identifier: MIT
----------------------------------------------------------------
with Ada.Characters.Wide_Wide_Latin_1;
with Ada.Wide_Wide_Text_IO;
with League.Strings;
with League.String_Vectors;
with XML.SAX.Attributes;
-- with XML.SAX.HTML5_Writers;
-- with XML.SAX.Pretty_Writers;
with Custom_Writers;
with XML.SAX.Output_Destinations.Strings;
with Markdown.ATX_Headings;
with Markdown.Blockquotes;
with Markdown.Fenced_Code_Blocks;
with Markdown.HTML_Blocks;
with Markdown.Indented_Code_Blocks;
with Markdown.Inline_Parsers;
with Markdown.Link_Reference_Definitions;
with Markdown.List_Items;
with Markdown.Paragraphs;
with Markdown.Parsers;
with Markdown.Thematic_Breaks;
with Markdown.Visitors;
with Markdown.Lists;
procedure MD_Driver is
LF : constant Wide_Wide_Character := Ada.Characters.Wide_Wide_Latin_1.LF;
New_Line : constant Wide_Wide_String := (1 => LF);
function Trim_Doctype (Text : League.Strings.Universal_String)
return League.Strings.Universal_String;
package Visitors is
type Visitor is limited new Markdown.Visitors.Visitor with record
Parser : Markdown.Parsers.Parser;
Is_Tight : Boolean := False;
New_Line : League.Strings.Universal_String;
Namespace : League.Strings.Universal_String;
Writer : aliased Custom_Writers.Writer;
Output : aliased XML.SAX.Output_Destinations.Strings
.String_Output_Destination;
end record;
overriding procedure ATX_Heading
(Self : in out Visitor;
Block : Markdown.ATX_Headings.ATX_Heading);
overriding procedure Blockquote
(Self : in out Visitor;
Block : in out Markdown.Blockquotes.Blockquote);
overriding procedure Fenced_Code_Block
(Self : in out Visitor;
Block : Markdown.Fenced_Code_Blocks.Fenced_Code_Block);
overriding procedure HTML_Block
(Self : in out Visitor;
Block : Markdown.HTML_Blocks.HTML_Block);
overriding procedure Indented_Code_Block
(Self : in out Visitor;
Block : Markdown.Indented_Code_Blocks.Indented_Code_Block);
overriding procedure List
(Self : in out Visitor;
Block : Markdown.Lists.List);
overriding procedure List_Item
(Self : in out Visitor;
Block : in out Markdown.List_Items.List_Item);
overriding procedure Paragraph
(Self : in out Visitor;
Block : Markdown.Paragraphs.Paragraph);
overriding procedure Thematic_Break
(Self : in out Visitor;
Value : Markdown.Thematic_Breaks.Thematic_Break);
end Visitors;
function "+" (Text : Wide_Wide_String)
return League.Strings.Universal_String
renames League.Strings.To_Universal_String;
package body Visitors is
procedure Write_Annotated_Text
(Self : in out Visitor'Class;
Text : Markdown.Inline_Parsers.Annotated_Text);
overriding procedure ATX_Heading
(Self : in out Visitor;
Block : Markdown.ATX_Headings.ATX_Heading)
is
Image : Wide_Wide_String := Block.Level'Wide_Wide_Image;
Lines : League.String_Vectors.Universal_String_Vector;
Empty : XML.SAX.Attributes.SAX_Attributes renames
XML.SAX.Attributes.Empty_SAX_Attributes;
begin
Lines.Append (Block.Title);
Image (1) := 'h';
Self.Writer.Start_Element
(Namespace_URI => Self.Namespace,
Local_Name => +Image,
Attributes => Empty);
Self.Write_Annotated_Text (Self.Parser.Parse_Inlines (Lines));
Self.Writer.End_Element
(Namespace_URI => Self.Namespace,
Local_Name => +Image);
end ATX_Heading;
overriding procedure Blockquote
(Self : in out Visitor;
Block : in out Markdown.Blockquotes.Blockquote)
is
Empty : XML.SAX.Attributes.SAX_Attributes renames
XML.SAX.Attributes.Empty_SAX_Attributes;
begin
Self.Writer.Start_Element
(Namespace_URI => Self.Namespace,
Local_Name => +"blockquote",
Attributes => Empty);
Block.Visit_Children (Self);
Self.Writer.End_Element
(Namespace_URI => Self.Namespace,
Local_Name => +"blockquote");
end Blockquote;
overriding procedure Fenced_Code_Block
(Self : in out Visitor;
Block : Markdown.Fenced_Code_Blocks.Fenced_Code_Block)
is
use type League.Strings.Universal_String;
Words : constant League.String_Vectors.Universal_String_Vector :=
Block.Info_String.Split (' ', League.Strings.Skip_Empty);
Lines : constant League.String_Vectors.Universal_String_Vector :=
Block.Lines;
Attr : XML.SAX.Attributes.SAX_Attributes;
begin
Self.Writer.Start_Element
(Namespace_URI => Self.Namespace,
Local_Name => +"pre",
Attributes => Attr);
if not Block.Info_String.Is_Empty then
Attr.Set_Value
(Namespace_URI => Self.Namespace,
Local_Name => +"class",
Value => "language-" & Words (1));
end if;
Self.Writer.Start_Element
(Namespace_URI => Self.Namespace,
Local_Name => +"code",
Attributes => Attr);
for J in 1 .. Lines.Length loop
Self.Writer.Characters (Lines (J));
Self.Writer.Characters (Self.New_Line);
end loop;
Self.Writer.End_Element
(Namespace_URI => Self.Namespace,
Local_Name => +"code");
Self.Writer.End_Element
(Namespace_URI => Self.Namespace,
Local_Name => +"pre");
end Fenced_Code_Block;
overriding procedure HTML_Block
(Self : in out Visitor;
Block : Markdown.HTML_Blocks.HTML_Block)
is
Lines : constant League.String_Vectors.Universal_String_Vector :=
Block.Lines;
begin
for J in 1 .. Lines.Length loop
if J > 1 then
Self.Writer.Characters (Self.New_Line);
end if;
Self.Writer.Unescaped_Characters (Lines (J));
end loop;
end HTML_Block;
overriding procedure Indented_Code_Block
(Self : in out Visitor;
Block : Markdown.Indented_Code_Blocks.Indented_Code_Block)
is
Lines : constant League.String_Vectors.Universal_String_Vector :=
Block.Lines;
Empty : XML.SAX.Attributes.SAX_Attributes renames
XML.SAX.Attributes.Empty_SAX_Attributes;
begin
Self.Writer.Start_Element
(Namespace_URI => Self.Namespace,
Local_Name => +"pre",
Attributes => Empty);
Self.Writer.Start_Element
(Namespace_URI => Self.Namespace,
Local_Name => +"code",
Attributes => Empty);
for J in 1 .. Lines.Length loop
Self.Writer.Characters (Lines (J));
Self.Writer.Characters (Self.New_Line);
end loop;
Self.Writer.End_Element
(Namespace_URI => Self.Namespace,
Local_Name => +"code");
Self.Writer.End_Element
(Namespace_URI => Self.Namespace,
Local_Name => +"pre");
end Indented_Code_Block;
overriding procedure List
(Self : in out Visitor;
Block : Markdown.Lists.List)
is
Attr : XML.SAX.Attributes.SAX_Attributes;
Is_Tight : constant Boolean := Self.Is_Tight;
Name : League.Strings.Universal_String;
begin
if Block.Is_Ordered then
declare
Start : constant Wide_Wide_String :=
Block.Start'Wide_Wide_Image;
begin
Name := +"ol";
if Start /= " 1" then
Attr.Set_Value
(Namespace_URI => Self.Namespace,
Local_Name => +"start",
Value => +Start (2 .. Start'Last));
end if;
end;
else
Name := +"ul";
end if;
Self.Is_Tight := not Block.Is_Loose;
Self.Writer.Start_Element
(Namespace_URI => Self.Namespace,
Local_Name => Name,
Attributes => Attr);
Block.Visit_Children (Self);
Self.Writer.End_Element
(Namespace_URI => Self.Namespace,
Local_Name => Name);
Self.Is_Tight := Is_Tight;
end List;
overriding procedure List_Item
(Self : in out Visitor;
Block : in out Markdown.List_Items.List_Item)
is
Empty : XML.SAX.Attributes.SAX_Attributes renames
XML.SAX.Attributes.Empty_SAX_Attributes;
begin
Self.Writer.Start_Element
(Namespace_URI => Self.Namespace,
Local_Name => +"li",
Attributes => Empty);
Block.Visit_Children (Self);
Self.Writer.End_Element
(Namespace_URI => Self.Namespace,
Local_Name => +"li");
end List_Item;
overriding procedure Paragraph
(Self : in out Visitor;
Block : Markdown.Paragraphs.Paragraph)
is
Lines : constant League.String_Vectors.Universal_String_Vector :=
Block.Lines;
Text : constant Markdown.Inline_Parsers.Annotated_Text :=
Self.Parser.Parse_Inlines (Lines);
Image : Wide_Wide_String := Block.Setext_Heading'Wide_Wide_Image;
Empty : XML.SAX.Attributes.SAX_Attributes renames
XML.SAX.Attributes.Empty_SAX_Attributes;
begin
if Self.Is_Tight then
Self.Write_Annotated_Text (Text);
elsif Block.Setext_Heading = 0 then
Self.Writer.Start_Element
(Namespace_URI => Self.Namespace,
Local_Name => +"p",
Attributes => Empty);
Self.Write_Annotated_Text (Text);
Self.Writer.End_Element
(Namespace_URI => Self.Namespace,
Local_Name => +"p");
else
Image (1) := 'h';
Self.Writer.Start_Element
(Namespace_URI => Self.Namespace,
Local_Name => +Image,
Attributes => Empty);
Self.Write_Annotated_Text (Text);
Self.Writer.End_Element
(Namespace_URI => Self.Namespace,
Local_Name => +Image);
end if;
end Paragraph;
overriding procedure Thematic_Break
(Self : in out Visitor;
Value : Markdown.Thematic_Breaks.Thematic_Break)
is
pragma Unreferenced (Value);
Empty : XML.SAX.Attributes.SAX_Attributes renames
XML.SAX.Attributes.Empty_SAX_Attributes;
begin
Self.Writer.Start_Element
(Namespace_URI => Self.Namespace,
Local_Name => +"hr",
Attributes => Empty);
Self.Writer.End_Element
(Namespace_URI => Self.Namespace,
Local_Name => +"hr");
end Thematic_Break;
procedure Write_Annotated_Text
(Self : in out Visitor'Class;
Text : Markdown.Inline_Parsers.Annotated_Text)
is
procedure Write
(From : in out Positive;
Next : in out Positive;
Limit : Natural);
Empty : XML.SAX.Attributes.SAX_Attributes renames
XML.SAX.Attributes.Empty_SAX_Attributes;
procedure Write
(From : in out Positive;
Next : in out Positive;
Limit : Natural) is
begin
while From <= Text.Annotation.Last_Index and then
Text.Annotation (From).To <= Limit
loop
declare
Item : constant Markdown.Inline_Parsers.Annotation :=
Text.Annotation (From);
begin
if Next <= Item.From - 1 then
Self.Writer.Characters
(Text.Plain_Text.Slice
(Next, Item.From - 1).To_Wide_Wide_String);
Next := Item.From;
end if;
From := From + 1;
case Item.Kind is
when Markdown.Inline_Parsers.Soft_Line_Break =>
Next := Next + 1;
Self.Writer.Characters (Self.New_Line);
when Markdown.Inline_Parsers.Emphasis =>
Self.Writer.Start_Element
(Namespace_URI => Self.Namespace,
Local_Name => +"em",
Attributes => Empty);
Write (From, Next, Item.To);
Self.Writer.End_Element
(Namespace_URI => Self.Namespace,
Local_Name => +"em");
when Markdown.Inline_Parsers.Strong =>
Self.Writer.Start_Element
(Namespace_URI => Self.Namespace,
Local_Name => +"strong",
Attributes => Empty);
Write (From, Next, Item.To);
Self.Writer.End_Element
(Namespace_URI => Self.Namespace,
Local_Name => +"strong");
when Markdown.Inline_Parsers.Code_Span =>
Self.Writer.Start_Element
(Namespace_URI => Self.Namespace,
Local_Name => +"code",
Attributes => Empty);
Write (From, Next, Item.To);
Self.Writer.End_Element
(Namespace_URI => Self.Namespace,
Local_Name => +"code");
when Markdown.Inline_Parsers.Link =>
declare
Attr : XML.SAX.Attributes.SAX_Attributes;
Title : constant League.Strings.Universal_String :=
Item.Title.Join (' ');
begin
Attr.Set_Value
(Self.Namespace, +"href", Item.Destination);
if not Title.Is_Empty then
Attr.Set_Value
(Self.Namespace, +"title", Title);
end if;
Self.Writer.Start_Element
(Namespace_URI => Self.Namespace,
Local_Name => +"a",
Attributes => Attr);
Write (From, Next, Item.To);
Self.Writer.End_Element
(Namespace_URI => Self.Namespace,
Local_Name => +"a");
end;
when Markdown.Inline_Parsers.Open_HTML_Tag =>
declare
Attr : XML.SAX.Attributes.SAX_Attributes;
begin
for J of Item.Attr loop
if J.Value.Is_Empty then
Attr.Set_Value
(Self.Namespace, J.Name, J.Name);
else
Attr.Set_Value
(Self.Namespace, J.Name, J.Value.Join (LF));
end if;
end loop;
Self.Writer.Start_Element
(Namespace_URI => Self.Namespace,
Local_Name => Item.Tag,
Attributes => Attr);
if Item.Is_Empty then
Self.Writer.End_Element
(Namespace_URI => Self.Namespace,
Local_Name => Item.Tag);
end if;
end;
when Markdown.Inline_Parsers.Close_HTML_Tag =>
Self.Writer.End_Element
(Namespace_URI => Self.Namespace,
Local_Name => Item.Tag);
when Markdown.Inline_Parsers.HTML_Comment =>
Self.Writer.Comment (Item.HTML_Comment.Join (LF));
when Markdown.Inline_Parsers
.HTML_Processing_Instruction =>
Self.Writer.Processing_Instruction
(Item.HTML_PI.Join (LF));
when Markdown.Inline_Parsers.HTML_Declaration =>
Self.Writer.Comment (Item.HTML_Decl.Join (LF));
when Markdown.Inline_Parsers.HTML_CDATA =>
Self.Writer.Start_CDATA;
Self.Writer.Characters (Item.HTML_CDATA.Join (LF));
Self.Writer.End_CDATA;
end case;
end;
end loop;
if Next <= Limit then
Self.Writer.Characters
(Text.Plain_Text.Slice
(Next, Limit).To_Wide_Wide_String);
Next := Limit + 1;
end if;
end Write;
Next : Positive := 1; -- Position in Text,Plain_Text
From : Positive := Text.Annotation.First_Index;
begin
Write (From, Next, Text.Plain_Text.Length);
end Write_Annotated_Text;
end Visitors;
------------------
-- Trim_Doctype --
------------------
function Trim_Doctype (Text : League.Strings.Universal_String)
return League.Strings.Universal_String
is
Pos : constant Positive := Text.Index (">");
Result : League.Strings.Universal_String :=
Text.Slice (Pos + 1, Text.Length - 8);
begin
if Result.Ends_With (New_Line) then
Result := Result.Head_To (Result.Length - 1);
end if;
return Result;
end Trim_Doctype;
Visitor : Visitors.Visitor;
Parser : Markdown.Parsers.Parser renames Visitor.Parser;
Empty : XML.SAX.Attributes.SAX_Attributes;
Result : League.Strings.Universal_String;
begin
Parser.Register (Markdown.ATX_Headings.Filter'Access);
Parser.Register (Markdown.Blockquotes.Filter'Access);
Parser.Register (Markdown.Thematic_Breaks.Filter'Access);
Parser.Register (Markdown.Indented_Code_Blocks.Filter'Access);
Parser.Register (Markdown.Fenced_Code_Blocks.Filter'Access);
Parser.Register (Markdown.HTML_Blocks.Filter'Access);
Parser.Register (Markdown.Link_Reference_Definitions.Filter'Access);
Parser.Register (Markdown.List_Items.Filter'Access);
Parser.Register (Markdown.Paragraphs.Filter'Access);
Visitor.Writer.Set_Output_Destination (Visitor.Output'Unchecked_Access);
Visitor.New_Line := +New_Line;
Visitor.Namespace := +"http://www.w3.org/1999/xhtml";
while not Ada.Wide_Wide_Text_IO.End_Of_File loop
declare
Line : constant League.Strings.Universal_String :=
League.Strings.To_Universal_String
(Ada.Wide_Wide_Text_IO.Get_Line);
begin
Parser.Append_Line (Line);
end;
end loop;
Parser.Stop;
Visitor.Writer.Start_Document;
Visitor.Writer.Start_Prefix_Mapping
(Prefix => +"",
Namespace_URI => Visitor.Namespace);
Visitor.Writer.Start_Element
(Namespace_URI => Visitor.Namespace,
Local_Name => +"html",
Attributes => Empty);
Parser.Visit (Visitor);
Visitor.Writer.End_Element
(Namespace_URI => Visitor.Namespace,
Local_Name => +"html");
Visitor.Writer.End_Document;
Result := Trim_Doctype (Visitor.Output.Get_Text);
if not Result.Is_Empty then
Ada.Wide_Wide_Text_IO.Put_Line (Result.To_Wide_Wide_String);
end if;
end MD_Driver;
| 35.623468 | 79 | 0.548006 |
2045e53710553419c26b778ed9573dbc3db2c40e | 3,976 | ads | Ada | tools-src/gnu/gcc/gcc/ada/a-tiflau.ads | modern-tomato/tomato | 96f09fab4929c6ddde5c9113f1b2476ad37133c4 | [
"FSFAP"
] | 80 | 2015-01-02T10:14:04.000Z | 2021-06-07T06:29:49.000Z | tools-src/gnu/gcc/gcc/ada/a-tiflau.ads | modern-tomato/tomato | 96f09fab4929c6ddde5c9113f1b2476ad37133c4 | [
"FSFAP"
] | 9 | 2015-05-14T11:03:12.000Z | 2018-01-04T07:12:58.000Z | tools-src/gnu/gcc/gcc/ada/a-tiflau.ads | modern-tomato/tomato | 96f09fab4929c6ddde5c9113f1b2476ad37133c4 | [
"FSFAP"
] | 69 | 2015-01-02T10:45:56.000Z | 2021-09-06T07:52:13.000Z | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- A D A . T E X T _ I O . F L O A T _ A U X --
-- --
-- S p e c --
-- --
-- $Revision$
-- --
-- Copyright (C) 1992-1997 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- 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 the routines for Ada.Text_IO.Float_IO that are
-- shared among separate instantiations of this package. The routines in
-- this package are identical semantically to those in Float_IO itself,
-- except that generic parameter Num has been replaced by Long_Long_Float,
-- and the default parameters have been removed because they are supplied
-- explicitly by the calls from within the generic template. This package
-- is also used by Ada.Text_IO.Fixed_IO, and Ada.Text_IO.Decimal_IO.
private package Ada.Text_IO.Float_Aux is
procedure Load_Real
(File : in File_Type;
Buf : out String;
Ptr : in out Natural);
-- This is an auxiliary routine that is used to load a possibly signed
-- real literal value from the input file into Buf, starting at Ptr + 1.
procedure Get
(File : in File_Type;
Item : out Long_Long_Float;
Width : in Field);
procedure Put
(File : in File_Type;
Item : in Long_Long_Float;
Fore : in Field;
Aft : in Field;
Exp : in Field);
procedure Gets
(From : in String;
Item : out Long_Long_Float;
Last : out Positive);
procedure Puts
(To : out String;
Item : in Long_Long_Float;
Aft : in Field;
Exp : in Field);
end Ada.Text_IO.Float_Aux;
| 51.636364 | 78 | 0.487928 |
0e5121841c4d82a13266b4e3e658d4816d9a5b9d | 694 | ads | Ada | src/trendy_test-assertions-discrete.ads | jquorning/trendy_test | a0e147369f723969740eb25995cf22ba74282127 | [
"Apache-2.0"
] | 7 | 2021-08-01T05:43:59.000Z | 2021-10-03T09:55:35.000Z | src/trendy_test-assertions-discrete.ads | jquorning/trendy_test | a0e147369f723969740eb25995cf22ba74282127 | [
"Apache-2.0"
] | 2 | 2021-08-07T13:37:45.000Z | 2022-03-12T14:47:26.000Z | src/trendy_test-assertions-discrete.ads | jquorning/trendy_test | a0e147369f723969740eb25995cf22ba74282127 | [
"Apache-2.0"
] | 1 | 2022-03-11T18:21:18.000Z | 2022-03-11T18:21:18.000Z | with Trendy_Test.Generics;
generic
type T is (<>);
package Trendy_Test.Assertions.Discrete is
-- Defaults all operations to what is visible.
procedure Assert_EQ is new Trendy_Test.Generics.Assert_Discrete (T, "=", "=");
procedure Assert_NE is new Trendy_Test.Generics.Assert_Discrete (T, "/=", "/=");
procedure Assert_LT is new Trendy_Test.Generics.Assert_Discrete (T, "<", "<");
procedure Assert_GT is new Trendy_Test.Generics.Assert_Discrete (T, ">", ">");
procedure Assert_LE is new Trendy_Test.Generics.Assert_Discrete (T, "<=", "<=");
procedure Assert_GE is new Trendy_Test.Generics.Assert_Discrete (T, ">=", ">=");
end Trendy_Test.Assertions.Discrete;
| 40.823529 | 84 | 0.707493 |
205d33a708bddaa4558e74c24815f373dd005192 | 10,504 | adb | Ada | linear_algebra/givens_qr_method.adb | jscparker/math_packages | b112a90338014d5c2dfae3f7265ee30841fb6cfd | [
"ISC",
"MIT"
] | 30 | 2018-12-09T01:15:04.000Z | 2022-03-20T16:14:54.000Z | linear_algebra/givens_qr_method.adb | jscparker/math_packages | b112a90338014d5c2dfae3f7265ee30841fb6cfd | [
"ISC",
"MIT"
] | null | null | null | linear_algebra/givens_qr_method.adb | jscparker/math_packages | b112a90338014d5c2dfae3f7265ee30841fb6cfd | [
"ISC",
"MIT"
] | null | null | null |
---------------------------------------------------------------------------
-- package body Givens_QR_Method
-- Copyright (C) 2011-2018 Jonathan S. Parker
--
-- 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.
---------------------------------------------------------------------------
with Ada.Numerics;
with Ada.Numerics.Generic_Elementary_Functions;
with Givens_Rotation;
package body Givens_QR_Method is
package math is new Ada.Numerics.Generic_Elementary_Functions (Real);
use math;
package Rotate is new Givens_Rotation (Real); use Rotate;
Zero : constant Real := +0.0;
One : constant Real := +1.0;
Two : constant Real := +2.0;
function Identity return A_Matrix is
Q : A_Matrix;
begin
Q := (others => (others => Zero));
for c in C_Index loop
Q(c, c) := One;
end loop;
return Q;
end Identity;
type Rotation is record
sn : Real := Zero;
cn : Real := One;
cn_minus_1 : Real := Zero;
sn_minus_1 : Real := Zero;
P_bigger_than_L : Boolean := True;
Skip_Rotation : Boolean := True;
Pivot_Col : C_Index := C_Index'First;
Hi_Row : R_Index := R_Index'First;
Lo_Row : R_Index := R_Index'First;
end record;
---------------------------------
-- Lower_Diagonal_QR_Iteration --
---------------------------------
-- Operates only on square real blocks.
procedure Lower_Diagonal_QR_Iteration
(A : in out A_Matrix;
Q : in out A_Matrix;
Shift : in Real;
Starting_Col : in C_Index := C_Index'First;
Final_Col : in C_Index := C_Index'Last)
is
Hi_Row, Lo_Row : R_Index;
P, L : Real;
Rotations : array (C_Index) of Rotation;
sn, cn : Real;
cn_minus_1 : Real;
sn_minus_1 : Real;
P_bigger_than_L : Boolean;
Skip_Rotation : Boolean;
-------------------------------------------
-- e_Multiply_A_on_RHS_with_Transpose_of --
-------------------------------------------
-- multiply A on the right by R_transpose:
-- A = A * R_transpose
--
-- Use enhanced precision rotations here.
procedure e_Multiply_A_on_RHS_with_Transpose_of
(R : in Rotation)
is
sn : constant Real := R.sn;
cn : constant Real := R.cn;
cn_minus_1 : constant Real := R.cn_minus_1;
sn_minus_1 : constant Real := R.sn_minus_1;
P_bigger_than_L : constant Boolean := R.P_bigger_than_L;
Skip_Rotation : constant Boolean := R.Skip_Rotation;
Pivot_Row : constant R_Index := R.Hi_Row;
Low_Row : constant R_Index := R.Lo_Row;
A_pvt, A_low : Real;
begin
if Skip_Rotation then return; end if;
-- Rotate corresponding columns. Multiply on RHS by transpose
-- of above givens matrix (second step of similarity transformation).
-- (Low_Row is Lo visually, but its index is higher than Pivot's.)
if P_bigger_than_L then -- |s| < |c|
for r in Starting_Col .. Final_Col loop
A_pvt := A(r, Pivot_Row);
A_low := A(r, Low_Row);
A(r, Pivot_Row) := A_pvt + (cn_minus_1*A_pvt + sn * A_low);
A(r, Low_Row) := A_low + (-sn * A_pvt + cn_minus_1*A_low);
end loop;
else -- Abs_P <= Abs_L, so abs t := abs (P / L) <= 1
for r in Starting_Col .. Final_Col loop
A_pvt := A(r, Pivot_Row);
A_low := A(r, Low_Row);
A(r, Pivot_Row) := A_low + (cn * A_pvt + sn_minus_1*A_low);
A(r, Low_Row) :=-A_pvt + (-sn_minus_1*A_pvt + cn * A_low);
end loop;
end if;
end e_Multiply_A_on_RHS_with_Transpose_of;
-----------------------------------------
-- Rotate_to_Kill_Element_Lo_of_pCol --
-----------------------------------------
-- Try to zero out A(Lo_Row, Pivot_Col) with a similarity transformation.
-- In other words, multiply A on left by R:
--
-- A = R * A
--
-- and multiply Q on right by R_transpose:
--
-- Q = Q * R_transpose
procedure Rotate_to_Kill_Element_Lo_of_pCol
(R : in Rotation)
is
sn : constant Real := R.sn;
cn : constant Real := R.cn;
cn_minus_1 : constant Real := R.cn_minus_1;
sn_minus_1 : constant Real := R.sn_minus_1;
P_bigger_than_L : constant Boolean := R.P_bigger_than_L;
Skip_Rotation : constant Boolean := R.Skip_Rotation;
Pivot_Col : constant C_Index := R.Pivot_Col;
Pivot_Row : constant R_Index := R.Hi_Row;
Low_Row : constant R_Index := R.Lo_Row;
A_pvt, A_low, Q_pvt, Q_low : Real;
begin
if Skip_Rotation then return; end if;
if P_bigger_than_L then -- |s| < |c|
--for c in Starting_Col .. Final_Col loop
for c in Pivot_Col .. Final_Col loop -- works only for upper hessenbergs
A_pvt := A(Pivot_Row, c);
A_low := A(Low_Row, c);
A(Pivot_Row, c) := A_pvt + (cn_minus_1*A_pvt + sn * A_low);
A(Low_Row, c) := A_low + (-sn * A_pvt + cn_minus_1*A_low);
end loop;
else -- Abs_P <= Abs_L, so abs t := abs (P / L) <= 1
--for c in Starting_Col .. Final_Col loop
for c in Pivot_Col .. Final_Col loop -- works only for upper hessenbergs
A_pvt := A(Pivot_Row, c);
A_low := A(Low_Row, c);
A(Pivot_Row, c) := A_low + (cn * A_pvt + sn_minus_1*A_low);
A(Low_Row, c) :=-A_pvt + (-sn_minus_1*A_pvt + cn * A_low);
end loop;
end if;
-- Rotate corresponding columns of Q. (Multiply on RHS by transpose
-- of above givens matrix to accumulate full Q.)
if P_bigger_than_L then -- |s| < |c|
for r in Starting_Col .. Final_Col loop
Q_pvt := Q(r, Pivot_Row);
Q_low := Q(r, Low_Row);
Q(r, Pivot_Row) := Q_pvt + (cn_minus_1*Q_pvt + sn * Q_low);
Q(r, Low_Row) := Q_low + (-sn * Q_pvt + cn_minus_1*Q_low);
end loop;
else -- Abs_P <= Abs_L, so abs t := abs (P / L) <= 1
for r in Starting_Col .. Final_Col loop
Q_pvt := Q(r, Pivot_Row);
Q_low := Q(r, Low_Row);
Q(r, Pivot_Row) := Q_low + (cn * Q_pvt + sn_minus_1*Q_low);
Q(r, Low_Row) :=-Q_pvt + (-sn_minus_1*Q_pvt + cn * Q_low);
end loop;
end if;
end Rotate_to_Kill_Element_Lo_of_pCol;
-- Sum = Small + Large. Lost_Bits = Small - (Sum - Large)
procedure Sum_with_Dropped_Bits
(A, B : in Real;
Sum : out Real;
Dropped_Bits : out Real)
is
begin
Sum := A + B;
if Abs A > Abs B then
Dropped_Bits := B - (Sum - A);
else
Dropped_Bits := A - (Sum - B);
end if;
end Sum_with_Dropped_Bits;
type Diag_Storage is array(C_Index) of Real;
Lost_Bits : Diag_Storage;
hypot : Real := Zero;
begin
if (Final_Col - Starting_Col) < 2 then return; end if;
Lost_Bits := (others => 0.0);
-- Subtract 'Shift' from each diagonal element of A.
-- Sum = A(c, c) + (-Shift)
-- Sum = Small + Large. Lost_Bits = Small - (Sum - Large)
declare
Sum, Dropped_Bits : Real;
begin
if Abs Shift > Zero then
for c in Starting_Col .. Final_Col loop
Sum_with_Dropped_Bits (A(c,c), -Shift, Sum, Dropped_Bits);
A(c, c) := Sum;
Lost_Bits(c) := Dropped_Bits;
end loop;
else
Lost_Bits := (others => 0.0);
end if;
end;
for Pivot_Col in Starting_Col .. Final_Col-1 loop
Hi_Row := Pivot_Col;
Lo_Row := Hi_Row + 1;
P := A(Hi_Row, Pivot_Col);
L := A(Lo_Row, Pivot_Col);
Get_Rotation_That_Zeros_Out_Low
(P, L, sn, cn, cn_minus_1, sn_minus_1, hypot, P_bigger_than_L, Skip_Rotation);
Rotations(Pivot_Col).sn := sn;
Rotations(Pivot_Col).cn := cn;
Rotations(Pivot_Col).cn_minus_1 := cn_minus_1;
Rotations(Pivot_Col).sn_minus_1 := sn_minus_1;
Rotations(Pivot_Col).P_bigger_than_L := P_bigger_than_L;
Rotations(Pivot_Col).Skip_Rotation := Skip_Rotation;
Rotations(Pivot_Col).Pivot_Col := Pivot_Col;
Rotations(Pivot_Col).Hi_Row := Hi_Row;
Rotations(Pivot_Col).Lo_Row := Lo_Row;
--Rotations(Pivot_Col).Skip_Rotation := false; -- for testing
Rotate_to_Kill_Element_Lo_of_pCol (Rotations(Pivot_Col));
-- Zeroes out A(Lo_Row, Pivot_Col)
-- Updates A and Q as global memory.
-- Applies rotation by multiplying Givens Matrix on LHS of A.
-- Then multiplies transpose of Givens Matrix on RHS of Q.
A(Lo_Row, Pivot_Col) := Zero;
A(Hi_Row, Pivot_Col) := Real'Copy_Sign(hypot, A(Hi_Row, Pivot_Col));
end loop; -- over Pivot_Col
-- These can be done inside the above loop (after a delay of 1 step):
for Pivot_Col in Starting_Col .. Final_Col-1 loop
e_Multiply_A_on_RHS_with_Transpose_of (Rotations(Pivot_Col));
end loop;
-- Add Shift back to A:
for c in Starting_Col .. Final_Col loop
A(c, c) := (A(c, c) + Shift) + Lost_Bits(c); -- best default
end loop;
end Lower_Diagonal_QR_Iteration;
end Givens_QR_Method;
| 34.89701 | 88 | 0.54703 |
205452c6a5fb91c66f380d62995282f99317d40c | 2,970 | ads | Ada | generated/simple_webapps-commands-upload_servers.ads | faelys/simple-webapps | 32f4f567cddb54a1703c9b6a8232f01073c92a44 | [
"0BSD"
] | 1 | 2017-03-13T21:40:47.000Z | 2017-03-13T21:40:47.000Z | generated/simple_webapps-commands-upload_servers.ads | faelys/simple-webapps | 32f4f567cddb54a1703c9b6a8232f01073c92a44 | [
"0BSD"
] | null | null | null | generated/simple_webapps-commands-upload_servers.ads | faelys/simple-webapps | 32f4f567cddb54a1703c9b6a8232f01073c92a44 | [
"0BSD"
] | null | null | null | -- Generated at 2014-07-02 17:53:59 +0000 by Natools.Static_Hash_Maps
-- from src/simple_webapps-upload_servers-commands.sx
package Simple_Webapps.Commands.Upload_Servers is
pragma Pure;
type Config_Command is
(Config_Error,
Set_Storage_File,
Set_Directory,
Set_Error_Template,
Set_HMAC_Key,
Set_Index_Template,
Set_Input_Dir,
Set_Max_Expiration,
Set_Report_Template,
Set_Static_Dir);
type File_Command is
(File_Error,
Set_Name,
Set_Comment,
Set_Download,
Set_Expiration,
Set_MIME_Type,
Set_Upload);
function To_Config_Command (Key : String) return Config_Command;
function To_File_Command (Key : String) return File_Command;
private
Map_1_Key_0 : aliased constant String := "backend";
Map_1_Key_1 : aliased constant String := "directory";
Map_1_Key_2 : aliased constant String := "error-template";
Map_1_Key_3 : aliased constant String := "hmac-key";
Map_1_Key_4 : aliased constant String := "index-template";
Map_1_Key_5 : aliased constant String := "input-directory";
Map_1_Key_6 : aliased constant String := "max-expiration";
Map_1_Key_7 : aliased constant String := "report-template";
Map_1_Key_8 : aliased constant String := "static";
Map_1_Key_9 : aliased constant String := "static-dir";
Map_1_Key_10 : aliased constant String := "static-resources";
Map_1_Keys : constant array (0 .. 10) of access constant String
:= (Map_1_Key_0'Access,
Map_1_Key_1'Access,
Map_1_Key_2'Access,
Map_1_Key_3'Access,
Map_1_Key_4'Access,
Map_1_Key_5'Access,
Map_1_Key_6'Access,
Map_1_Key_7'Access,
Map_1_Key_8'Access,
Map_1_Key_9'Access,
Map_1_Key_10'Access);
Map_1_Elements : constant array (0 .. 10) of Config_Command
:= (Set_Storage_File,
Set_Directory,
Set_Error_Template,
Set_HMAC_Key,
Set_Index_Template,
Set_Input_Dir,
Set_Max_Expiration,
Set_Report_Template,
Set_Static_Dir,
Set_Static_Dir,
Set_Static_Dir);
Map_2_Key_0 : aliased constant String := "name";
Map_2_Key_1 : aliased constant String := "comment";
Map_2_Key_2 : aliased constant String := "download-key";
Map_2_Key_3 : aliased constant String := "expire";
Map_2_Key_4 : aliased constant String := "mime-type";
Map_2_Key_5 : aliased constant String := "upload";
Map_2_Keys : constant array (0 .. 5) of access constant String
:= (Map_2_Key_0'Access,
Map_2_Key_1'Access,
Map_2_Key_2'Access,
Map_2_Key_3'Access,
Map_2_Key_4'Access,
Map_2_Key_5'Access);
Map_2_Elements : constant array (0 .. 5) of File_Command
:= (Set_Name,
Set_Comment,
Set_Download,
Set_Expiration,
Set_MIME_Type,
Set_Upload);
end Simple_Webapps.Commands.Upload_Servers;
| 32.637363 | 70 | 0.67037 |
20dde796676d0dbd539ab023e9150afef498845a | 7,551 | adb | Ada | utilities/ada-split.adb | leo-brewin/adm-bssn-numerical | 9e32c201272e9a41e7535475fe381e450b99b058 | [
"MIT"
] | 1 | 2022-01-25T11:36:06.000Z | 2022-01-25T11:36:06.000Z | utilities/ada-split.adb | leo-brewin/adm-bssn-numerical | 9e32c201272e9a41e7535475fe381e450b99b058 | [
"MIT"
] | null | null | null | utilities/ada-split.adb | leo-brewin/adm-bssn-numerical | 9e32c201272e9a41e7535475fe381e450b99b058 | [
"MIT"
] | null | null | null | with Ada.Text_IO; use Ada.Text_IO;
with Support; use Support;
with Support.Cmdline; use Support.Cmdline;
with Support.Strings; use Support.Strings;
with Support.RegEx; use Support.RegEx;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Ada.Directories;
procedure Ada_Split is
src : File_Type;
max_recurse_depth : Constant := 10;
recurse_depth : Integer := 0;
src_file_name : String := read_command_arg ('i',"<no-source>");
out_file_name : String := read_command_arg ('o',"<no-output>");
type tag_type is (beg_tag, end_tag, neither);
function Path_Exists (the_path_name : string) return boolean renames Ada.Directories.Exists;
function File_Exists (the_file_name : string) return boolean renames Ada.Directories.Exists;
procedure write_file
(parent : String; -- " -- beg03: foo/bah/cat.tex"
child : String) -- " --- beg04: foo/bah/moo/cow/dog.tex"
is
re_beg_tag : String := "^[\t ]*(--|#|%) beg[0-9]{2}:";
re_end_tag : String := "^[\t ]*(--|#|%) end[0-9]{2}:";
function full_dir (text : String) return String is -- text := " -- beg01: ./foo/bah/cat.tex"
re_dirname : String := "([_a-zA-Z0-9./-]*\/)"; -- as per dirname in bash
begin
return grep (text,re_dirname,1,fail => ""); -- returns "./foo/bah/"
end full_dir;
function full_file (text : String) return String is -- text := " -- beg01: ./foo/bah/cat.tex"
re_file : String := re_beg_tag & " (.+)";
begin
return grep (text,re_file,2,fail => ""); -- returns "./foo/bah/cat.tex"
end full_file;
function relative_path
(parent : String; -- " -- beg03: foo/bah/cat.tex"
child : String) -- " -- beg04: foo/bah/moo/cow/dog.tex"
Return String -- relative path of the child to the parent, e.g., "moo/cow/dog.tex"
is
re_dirname : String := "([_a-zA-Z0-9./-]*\/)"; -- as per dirname in bash
re_basename : String := re_beg_tag & " " &re_dirname & "(.+)"; -- as per basename in bash
parent_dir : String := trim ( grep (parent,re_dirname,1,fail => "./") ); -- "foo/bah/"
child_dir : String := trim ( grep (child,re_dirname,1,fail => "./") ); -- "foo/bah/moo/cow/"
child_file : String := trim ( grep (child,re_basename,3,fail => "??.txt") ); -- "dog.tex"
begin
-- strip parent_directory from front of child
return trim ( child_dir(child_dir'first+get_strlen(parent_dir)..child_dir'last)&str(child_file) ); -- "moo/cow/dog.tex"
end relative_path;
function absolute_indent (text : String) return Integer is
indent : Integer;
begin
indent := 0;
for i in text'Range loop
if text (i) /= ' ' then
indent := max(0,i-1);
exit;
end if;
end loop;
return indent;
end absolute_indent;
function relative_indent
(parent : String;
child : String)
Return Integer
is
begin
return absolute_indent(child) - absolute_indent(parent);
end relative_indent;
function classify (the_line : String) return tag_type is
begin
if grep (the_line,re_beg_tag) then return beg_tag;
elsif grep (the_line,re_end_tag) then return end_tag;
else return neither;
end if;
end classify;
begin
recurse_depth := recurse_depth + 1;
if recurse_depth > max_recurse_depth then
Put_Line ("> split-mrg: Recursion limit reached (max = "&str(max_recurse_depth)&"), exit");
halt(1);
end if;
declare
txt : File_Type;
the_dir : String := full_dir (child);
the_file : String := full_file (child);
the_path : String := relative_path (parent, child);
the_indent : Integer := absolute_indent (child);
procedure write_path (parent : String; child : String) is
the_path : String := relative_path (parent, child);
the_indent : Integer := relative_indent (parent, child);
begin
put_line (txt,spc(the_indent)&"$Input{"""&the_path&"""}");
end write_path;
procedure write_line (the_line : String; the_indent : Integer) is
begin
if the_indent > get_strlen(the_line)
then put_line (txt, str(the_line));
else put_line (txt, str(the_line(the_indent+1..the_line'last)));
end if;
end write_line;
begin
if not Path_Exists (the_dir) then
Ada.Directories.Create_Path (the_dir);
end if;
if File_Exists (the_file)
then Open (txt, out_file, the_file);
else Create (txt, out_file, the_file);
end if;
loop
begin
declare
the_line : String := Get_Line (src);
begin
case classify (the_line) is
when beg_tag => write_path (child, the_line);
write_file (child, the_line);
when end_tag => exit;
when others => write_line (the_line, the_indent);
end case;
end;
exception
when end_error => exit;
end;
end loop;
Close (txt);
end;
recurse_depth := recurse_depth - 1;
end write_file;
procedure show_info is
begin
Put_Line ("------------------------------------------------------------------------------");
Put_Line (" Splits a previously merged source into its component files.");
Put_Line (" Usage:");
Put_Line (" split-mrg -i <source> [-o <output>] [-h]");
Put_Line (" Files:");
Put_Line (" <source> : the merged source, must contain merge markup lines like");
Put_Line (" -- beg03: ./foo/bah/cow.ad");
Put_Line (" <output> : optional, use this to avoid overwriting original source template");
Put_Line (" Options:");
Put_Line (" -h : help, show this help message, then exit");
Put_Line (" Example:");
Put_Line (" split-mrg -i foo.adb");
Put_Line (" split-mrg -i foo.adb -o bah.adt");
Put_Line ("------------------------------------------------------------------------------");
end show_info;
procedure initialize is
begin
if find_command_arg ('h') then
show_info;
halt(0);
end if;
if not File_Exists (src_file_name) then
Put_Line ("> split-mrg: Source file """ & cut (src_file_name) & """ not found, exit.");
halt(1);
end if;
end initialize;
begin
initialize;
-- split the merged source into its component parts
Open (src, In_File, src_file_name);
if find_command_arg ('o') then
Skip_Line (src);
write_file ("-- beg01: ./", "-- beg01: ./"&out_file_name);
else
write_file ("-- beg01: ./", Get_Line(src));
end if;
Close (src);
if recurse_depth /= 0 then
Put_Line("> split-mrg: error during split");
Put_Line("> recursion depth should be zero, actual value: "&str(recurse_depth));
end if;
end Ada_Split;
| 34.958333 | 129 | 0.535293 |
dcd67c4b24087fc3c567a549399b83a28a7a8084 | 1,192 | adb | Ada | gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/discr24.adb | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 7 | 2020-05-02T17:34:05.000Z | 2021-10-17T10:15:18.000Z | gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/discr24.adb | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | null | null | null | gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/discr24.adb | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 2 | 2020-07-27T00:22:36.000Z | 2021-04-01T09:41:02.000Z | -- { dg-do run }
-- { dg-options "-gnatp" }
procedure Discr24 is
type Family_Type is (Family_Inet, Family_Inet6);
type Port_Type is new Natural;
subtype Inet_Addr_Comp_Type is Natural range 0 .. 255;
type Inet_Addr_VN_Type is array (Natural range <>) of Inet_Addr_Comp_Type;
subtype Inet_Addr_V4_Type is Inet_Addr_VN_Type (1 .. 4);
subtype Inet_Addr_V6_Type is Inet_Addr_VN_Type (1 .. 16);
type Inet_Addr_Type (Family : Family_Type := Family_Inet) is record
case Family is
when Family_Inet =>
Sin_V4 : Inet_Addr_V4_Type := (others => 0);
when Family_Inet6 =>
Sin_V6 : Inet_Addr_V6_Type := (others => 0);
end case;
end record;
type Sock_Addr_Type (Family : Family_Type := Family_Inet) is record
Addr : Inet_Addr_Type (Family);
Port : Port_Type;
end record;
function F return Inet_Addr_Type is
begin
return Inet_Addr_Type'
(Family => Family_Inet, Sin_V4 => (192, 168, 169, 170));
end F;
SA : Sock_Addr_Type;
begin
SA.Addr.Sin_V4 := (172, 16, 17, 18);
SA.Port := 1111;
SA.Addr := F;
if SA.Port /= 1111 then
raise Program_Error;
end if;
end;
| 25.361702 | 77 | 0.645134 |
0e10866b406b280c0000439546451dce3df5892e | 8,111 | adb | Ada | source/directories/machine-w64-mingw32/s-nadivo.adb | ytomino/drake | 4e4bdcd8b8e23a11a29b31d3a8861fdf60090ea2 | [
"MIT"
] | 33 | 2015-04-04T09:19:36.000Z | 2021-11-10T05:33:34.000Z | source/directories/machine-w64-mingw32/s-nadivo.adb | ytomino/drake | 4e4bdcd8b8e23a11a29b31d3a8861fdf60090ea2 | [
"MIT"
] | 8 | 2017-11-14T13:05:07.000Z | 2018-08-09T15:28:49.000Z | source/directories/machine-w64-mingw32/s-nadivo.adb | ytomino/drake | 4e4bdcd8b8e23a11a29b31d3a8861fdf60090ea2 | [
"MIT"
] | 9 | 2015-02-03T17:09:53.000Z | 2021-11-12T01:16:05.000Z | with Ada.Exception_Identification.From_Here;
with System.Address_To_Named_Access_Conversions;
with System.Standard_Allocators;
with System.Storage_Elements;
with System.Zero_Terminated_WStrings;
with C.string;
with C.winerror;
package body System.Native_Directories.Volumes is
use Ada.Exception_Identification.From_Here;
use type File_Size;
use type Storage_Elements.Storage_Offset;
use type C.size_t;
use type C.windef.DWORD;
use type C.windef.WINBOOL;
use type C.winnt.LPWSTR;
use type C.winnt.HANDLE; -- C.void_ptr
use type C.winnt.WCHAR;
package LPWSTR_Conv is
new Address_To_Named_Access_Conversions (C.winnt.WCHAR, C.winnt.LPWSTR);
procedure GetVolumeInformation (
FS : aliased in out File_System;
FileSystemNameBuffer : C.winnt.LPWSTR;
FileSystemNameSize : C.windef.DWORD);
procedure GetVolumeInformation (
FS : aliased in out File_System;
FileSystemNameBuffer : C.winnt.LPWSTR;
FileSystemNameSize : C.windef.DWORD) is
begin
if FileSystemNameBuffer /= null or else not FS.Valid then
if C.winbase.GetVolumeInformation (
FS.Root_Path,
null,
0,
FS.VolumeSerialNumber'Access,
null,
FS.FileSystemFlags'Access,
FileSystemNameBuffer,
FileSystemNameSize) =
C.windef.FALSE
then
Raise_Exception (IO_Exception_Id (C.winbase.GetLastError));
end if;
FS.Valid := True;
-- save NTFS or not
if not FS.Is_NTFS_Valid and then FileSystemNameBuffer /= null then
declare
NTFS : constant C.winnt.WCHAR_array (0 .. 4) := (
C.winnt.WCHAR'Val (Wide_Character'Pos ('N')),
C.winnt.WCHAR'Val (Wide_Character'Pos ('T')),
C.winnt.WCHAR'Val (Wide_Character'Pos ('F')),
C.winnt.WCHAR'Val (Wide_Character'Pos ('S')),
C.winnt.WCHAR'Val (0));
FileSystem_All : C.winnt.WCHAR_array (0 .. 4); -- at least
for FileSystem_All'Address use
LPWSTR_Conv.To_Address (FileSystemNameBuffer);
begin
FS.Is_NTFS := FileSystem_All (0) = NTFS (0)
and then FileSystem_All (1) = NTFS (1)
and then FileSystem_All (2) = NTFS (2)
and then FileSystem_All (3) = NTFS (3)
and then FileSystem_All (4) = NTFS (4);
end;
FS.Is_NTFS_Valid := True;
end if;
end if;
end GetVolumeInformation;
-- implementation
function Is_Assigned (FS : File_System) return Boolean is
begin
return FS.Root_Path /= null;
end Is_Assigned;
procedure Get (Name : String; FS : aliased out File_System) is
W_Name : aliased C.winnt.WCHAR_array (
0 ..
Name'Length * Zero_Terminated_WStrings.Expanding);
Root_Path : aliased C.winnt.WCHAR_array (0 .. C.windef.MAX_PATH - 1);
Root_Path_Length : C.size_t;
begin
Zero_Terminated_WStrings.To_C (Name, W_Name (0)'Access);
if C.winbase.GetVolumePathName (
W_Name (0)'Access,
Root_Path (0)'Access,
Root_Path'Length) =
C.windef.FALSE
then
Raise_Exception (Named_IO_Exception_Id (C.winbase.GetLastError));
end if;
Root_Path_Length := C.string.wcslen (Root_Path (0)'Access);
declare
Dest : constant Address :=
Standard_Allocators.Allocate (
(Storage_Elements.Storage_Offset (Root_Path_Length) + 1)
* (C.winnt.WCHAR'Size / Standard'Storage_Unit));
Dest_All : C.winnt.WCHAR_array (0 .. Root_Path_Length);
for Dest_All'Address use Dest;
begin
FS.Root_Path_Length := Root_Path_Length;
Dest_All := Root_Path (0 .. Root_Path_Length);
FS.Root_Path := LPWSTR_Conv.To_Pointer (Dest);
end;
FS.Valid := False;
FS.Is_NTFS_Valid := False;
end Get;
procedure Finalize (FS : in out File_System) is
begin
Standard_Allocators.Free (LPWSTR_Conv.To_Address (FS.Root_Path));
end Finalize;
function Size (FS : File_System) return File_Size is
FreeBytesAvailable : aliased C.winnt.ULARGE_INTEGER;
TotalNumberOfBytes : aliased C.winnt.ULARGE_INTEGER;
begin
if C.winbase.GetDiskFreeSpaceEx (
FS.Root_Path,
FreeBytesAvailable'Access,
TotalNumberOfBytes'Access,
null) =
C.windef.FALSE
then
Raise_Exception (IO_Exception_Id (C.winbase.GetLastError));
end if;
return File_Size (TotalNumberOfBytes.QuadPart);
end Size;
function Free_Space (FS : File_System) return File_Size is
FreeBytesAvailable : aliased C.winnt.ULARGE_INTEGER;
TotalNumberOfBytes : aliased C.winnt.ULARGE_INTEGER;
begin
if C.winbase.GetDiskFreeSpaceEx (
FS.Root_Path,
FreeBytesAvailable'Access,
TotalNumberOfBytes'Access,
null) =
C.windef.FALSE
then
Raise_Exception (IO_Exception_Id (C.winbase.GetLastError));
end if;
return File_Size (FreeBytesAvailable.QuadPart);
end Free_Space;
function Format_Name (FS : aliased in out File_System) return String is
FileSystem : aliased C.winnt.WCHAR_array (0 .. C.windef.MAX_PATH - 1);
begin
GetVolumeInformation (
FS,
FileSystem (0)'Unchecked_Access,
FileSystem'Length);
return Zero_Terminated_WStrings.Value (FileSystem (0)'Access);
end Format_Name;
function Directory (FS : File_System) return String is
begin
return Zero_Terminated_WStrings.Value (
FS.Root_Path,
FS.Root_Path_Length);
end Directory;
function Device (FS : File_System) return String is
VolumeName : aliased C.winnt.WCHAR_array (0 .. C.windef.MAX_PATH - 1);
begin
if C.winbase.GetVolumeNameForVolumeMountPoint (
FS.Root_Path,
VolumeName (0)'Access,
VolumeName'Length) =
C.windef.FALSE
then
declare
Error : constant C.windef.DWORD := C.winbase.GetLastError;
begin
case Error is
when C.winerror.ERROR_PATH_NOT_FOUND =>
-- is it a network drive ?
-- should it call WNetGetConnection32 to get the UNC path?
Raise_Exception (Name_Error'Identity);
when others =>
Raise_Exception (IO_Exception_Id (Error));
end case;
end;
end if;
return Zero_Terminated_WStrings.Value (VolumeName (0)'Access);
end Device;
function Case_Preserving (FS : aliased in out File_System) return Boolean is
begin
GetVolumeInformation (FS, null, 0);
return (FS.FileSystemFlags and C.winbase.FS_CASE_IS_PRESERVED) /= 0;
end Case_Preserving;
function Case_Sensitive (FS : aliased in out File_System) return Boolean is
begin
if FS.Is_NTFS_Valid then
-- GetVolumeInformation reports FS_CASE_SENSITIVE at NTFS
-- though NTFS is case insensitive in the truth.
if FS.Is_NTFS then
return False;
else
GetVolumeInformation (FS, null, 0);
return (FS.FileSystemFlags and C.winbase.FS_CASE_SENSITIVE) /= 0;
end if;
else
declare
FileSystem : aliased
C.winnt.WCHAR_array (0 .. C.windef.MAX_PATH - 1);
begin
GetVolumeInformation (
FS,
FileSystem (0)'Unchecked_Access,
FileSystem'Length);
end;
return (FS.FileSystemFlags and C.winbase.FS_CASE_SENSITIVE) /= 0
and then not FS.Is_NTFS;
end if;
end Case_Sensitive;
function Identity (FS : aliased in out File_System) return File_System_Id is
begin
GetVolumeInformation (FS, null, 0);
return FS.VolumeSerialNumber;
end Identity;
end System.Native_Directories.Volumes;
| 35.574561 | 79 | 0.620639 |
2362d8192f7d5f9f6e0cd0807050a9e509232f6c | 1,491 | adb | Ada | tests/gl/gl_test-immediate.adb | Roldak/OpenGLAda | 6807605b7321249d71286fa25231bdfd537d3eac | [
"MIT"
] | 79 | 2015-04-20T23:10:02.000Z | 2022-03-04T13:50:56.000Z | tests/gl/gl_test-immediate.adb | Roldak/OpenGLAda | 6807605b7321249d71286fa25231bdfd537d3eac | [
"MIT"
] | 126 | 2015-09-10T10:41:34.000Z | 2022-03-20T11:25:40.000Z | tests/gl/gl_test-immediate.adb | Roldak/OpenGLAda | 6807605b7321249d71286fa25231bdfd537d3eac | [
"MIT"
] | 20 | 2015-03-17T07:15:57.000Z | 2022-02-02T17:12:11.000Z | -- part of OpenGLAda, (c) 2017 Felix Krause
-- released under the terms of the MIT license, see the file "COPYING"
with GL.Buffers; use GL.Buffers;
with GL.Immediate; use GL.Immediate;
with GL.Fixed.Matrix; use GL.Fixed.Matrix;
with GL.Types.Colors; use GL.Types;
use GL.Fixed;
with GL_Test.Display_Backend;
procedure GL_Test.Immediate is
use GL.Types.Doubles;
begin
Display_Backend.Init;
Display_Backend.Open_Window (Width => 500, Height => 500);
Projection.Load_Identity;
Projection.Apply_Orthogonal (-1.0, 1.0, -1.0, 1.0, -1.0, 1.0);
while not Display_Backend.Escape_Pressed and
Display_Backend.Window_Opened loop
Clear (Buffer_Bits'(others => True));
Projection.Push;
for I in 1 .. 12 loop
declare
Token : Input_Token := Start (Line_Strip);
begin
Set_Color (Colors.Color'(1.0, 0.0, 0.0, 0.0));
Token.Add_Vertex (Vector4'(0.1, 0.4, 0.0, 1.0));
Token.Add_Vertex (Vector4'(0.1, 0.6, 0.0, 1.0));
Token.Add_Vertex (Vector4'(-0.1, 0.6, 0.0, 1.0));
Token.Add_Vertex (Vector4'(-0.1, 0.4, 0.0, 1.0));
end;
Projection.Apply_Rotation (360.0 / 12.0, 0.0, 0.0, 1.0);
end loop;
Projection.Pop;
Projection.Apply_Rotation (0.8, 0.0, 0.0, 1.0);
GL.Flush;
Display_Backend.Swap_Buffers;
Display_Backend.Poll_Events;
end loop;
Display_Backend.Shutdown;
end GL_Test.Immediate;
| 27.611111 | 71 | 0.619048 |
dca7804b20680245a81f4b5d226126a93cba9093 | 1,301 | ads | Ada | orka/src/gl/implementation/gl-debug_types.ads | onox/orka | 9edf99559a16ffa96dfdb208322f4d18efbcbac6 | [
"Apache-2.0"
] | 52 | 2016-07-30T23:00:28.000Z | 2022-02-05T11:54:55.000Z | orka/src/gl/implementation/gl-debug_types.ads | onox/orka | 9edf99559a16ffa96dfdb208322f4d18efbcbac6 | [
"Apache-2.0"
] | 79 | 2016-08-01T18:36:48.000Z | 2022-02-27T12:14:20.000Z | orka/src/gl/implementation/gl-debug_types.ads | onox/orka | 9edf99559a16ffa96dfdb208322f4d18efbcbac6 | [
"Apache-2.0"
] | 4 | 2018-04-28T22:36:26.000Z | 2020-11-14T23:00:29.000Z | -- SPDX-License-Identifier: Apache-2.0
--
-- Copyright (c) 2017 onox <[email protected]>
--
-- 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 GL.Types;
with GL.Debug;
private package GL.Debug_Types is
pragma Preelaborate;
use GL.Types;
use GL.Debug;
type Source_Array is array (Size range <>) of Source;
type Type_Array is array (Size range <>) of Message_Type;
type Severity_Array is array (Size range <>) of Severity;
type Source_Array_Access is access all Source_Array;
type Type_Array_Access is access all Type_Array;
type Severity_Array_Access is access all Severity_Array;
type UInt_Array_Access is access all UInt_Array;
type Size_Array_Access is access all Size_Array;
type String_Access is access String;
end GL.Debug_Types;
| 32.525 | 76 | 0.742506 |
dcaccb354143194d33089282c762c6d220b6f403 | 13,392 | ads | Ada | arch/ARM/STM32/drivers/stm32-dac.ads | shakram02/Ada_Drivers_Library | a407ca7ddbc2d9756647016c2f8fd8ef24a239ff | [
"BSD-3-Clause"
] | 192 | 2016-06-01T18:32:04.000Z | 2022-03-26T22:52:31.000Z | arch/ARM/STM32/drivers/stm32-dac.ads | morbos/Ada_Drivers_Library | a4ab26799be60997c38735f4056160c4af597ef7 | [
"BSD-3-Clause"
] | 239 | 2016-05-26T20:02:01.000Z | 2022-03-31T09:46:56.000Z | arch/ARM/STM32/drivers/stm32-dac.ads | morbos/Ada_Drivers_Library | a4ab26799be60997c38735f4056160c4af597ef7 | [
"BSD-3-Clause"
] | 142 | 2016-06-05T08:12:20.000Z | 2022-03-24T17:37:17.000Z | ------------------------------------------------------------------------------
-- --
-- Copyright (C) 2015, AdaCore --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- 2. Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- 3. Neither the name of STMicroelectronics nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
-- --
-- This file is based on: --
-- --
-- @file stm32f4xx_hal_dac.h and stm32f4xx_hal_dac_ex.h --
-- @author MCD Application Team --
-- @version V1.3.1 --
-- @date 25-March-2015 --
-- @brief Header file of DAC HAL module. --
-- --
-- COPYRIGHT(c) 2014 STMicroelectronics --
------------------------------------------------------------------------------
-- This file provides interfaces for the digital-to-analog converters on the
-- STM32F4 (ARM Cortex M4F) microcontrollers from ST Microelectronics.
with System; use System;
private with STM32_SVD.DAC;
package STM32.DAC is
type Digital_To_Analog_Converter is limited private;
type DAC_Channel is (Channel_1, Channel_2);
-- Note that Channel 1 is tied to GPIO pin PA4, and Channel 2 to PA5
procedure Enable
(This : in out Digital_To_Analog_Converter;
Channel : DAC_Channel)
with
Inline,
Post => Enabled (This, Channel);
-- Powers up the channel. The channel is then enabled after a startup
-- time "Twakeup" specified in the datasheet.
--
-- NB: When no hardware trigger has been selected, the value in the
-- DAC_DHRx register is transfered automatically to the DOR register.
-- Therefore, in that case enabling the channel starts the output
-- conversion on that channel. See the RM, section 14.3.4 "DAC
-- conversion" second and third paragraphs.
procedure Disable
(This : in out Digital_To_Analog_Converter;
Channel : DAC_Channel)
with
Inline,
Post => not Enabled (This, Channel);
-- When the software trigger has been selected, disabling the channel stops
-- the output conversion on that channel.
function Enabled
(This : Digital_To_Analog_Converter;
Channel : DAC_Channel)
return Boolean;
type DAC_Resolution is (DAC_Resolution_12_Bits, DAC_Resolution_8_Bits);
Max_12bit_Resolution : constant := 16#0FFF#;
Max_8bit_Resolution : constant := 16#00FF#;
type Data_Alignment is (Left_Aligned, Right_Aligned);
procedure Set_Output
(This : in out Digital_To_Analog_Converter;
Channel : DAC_Channel;
Value : UInt32;
Resolution : DAC_Resolution;
Alignment : Data_Alignment);
-- For the specified channel, writes the output Value to the data holding
-- register within This corresponding to the Resolution and Alignment.
--
-- The output voltage = ((Value / Max_nbit_Counts) * VRef+), where VRef+ is
-- the reference input voltage and the 'n' of Max_nbit_Counts is either 12
-- or 8.
procedure Trigger_Conversion_By_Software
(This : in out Digital_To_Analog_Converter;
Channel : DAC_Channel)
with
Pre => Trigger_Selection (This, Channel) = Software_Trigger and
Trigger_Enabled (This, Channel);
-- Cause the conversion to occur and the output to appear, per 14.3.6 "DAC
-- trigger selection" in the RM. This routine is needed when the Software
-- Trigger has been selected and the trigger has been enabled, otherwise no
-- conversion occurs. If you don't enable the trigger any prior selection
-- has no effect, but note that when no *hardware* trigger is selected the
-- output happens automatically when the channel is enabled. See the RM,
-- section 14.3.4 "DAC conversion" second and third paragraphs.
function Converted_Output_Value
(This : Digital_To_Analog_Converter;
Channel : DAC_Channel)
return UInt32;
-- Returns the latest output value for the specified channel.
procedure Set_Dual_Output_Voltages
(This : in out Digital_To_Analog_Converter;
Channel_1_Value : UInt32;
Channel_2_Value : UInt32;
Resolution : DAC_Resolution;
Alignment : Data_Alignment);
type Dual_Channel_Output is record
Channel_1_Data : UInt16;
Channel_2_Data : UInt16;
end record;
function Converted_Dual_Output_Value (This : Digital_To_Analog_Converter)
return Dual_Channel_Output;
-- Returns the combination of the latest output values for both channels.
procedure Enable_Output_Buffer
(This : in out Digital_To_Analog_Converter;
Channel : DAC_Channel)
with Post => Output_Buffer_Enabled (This, Channel);
procedure Disable_Output_Buffer
(This : in out Digital_To_Analog_Converter;
Channel : DAC_Channel)
with Post => not Output_Buffer_Enabled (This, Channel);
function Output_Buffer_Enabled
(This : Digital_To_Analog_Converter;
Channel : DAC_Channel)
return Boolean;
type External_Event_Trigger_Selection is
(Timer_6_Output_Trigger,
Timer_8_Output_Trigger,
Timer_7_Output_Trigger,
Timer_5_Output_Trigger,
Timer_2_Output_Trigger,
Timer_4_Output_Trigger,
EXTI_Line_9_Trigger, -- any GPIO_x Pin_9
Software_Trigger);
procedure Select_Trigger
(This : in out Digital_To_Analog_Converter;
Channel : DAC_Channel;
Trigger : External_Event_Trigger_Selection)
with
Pre => not Trigger_Enabled (This, Channel), -- per note in RM, pg 435
Post => Trigger_Selection (This, Channel) = Trigger and
not Trigger_Enabled (This, Channel);
-- If the software trigger is selected, output conversion starts once the
-- channel is enabled.
function Trigger_Selection
(This : Digital_To_Analog_Converter;
Channel : DAC_Channel)
return External_Event_Trigger_Selection;
procedure Enable_Trigger
(This : in out Digital_To_Analog_Converter;
Channel : DAC_Channel)
with Post => Trigger_Enabled (This, Channel);
procedure Disable_Trigger
(This : in out Digital_To_Analog_Converter;
Channel : DAC_Channel)
with Post => not Trigger_Enabled (This, Channel);
function Trigger_Enabled
(This : Digital_To_Analog_Converter;
Channel : DAC_Channel)
return Boolean;
procedure Enable_DMA
(This : in out Digital_To_Analog_Converter;
Channel : DAC_Channel)
with Post => DMA_Enabled (This, Channel);
procedure Disable_DMA
(This : in out Digital_To_Analog_Converter;
Channel : DAC_Channel)
with Post => not DMA_Enabled (This, Channel);
function DMA_Enabled
(This : Digital_To_Analog_Converter;
Channel : DAC_Channel)
return Boolean;
type DAC_Status_Flag is
(DMA_Underrun_Channel_1,
DMA_Underrun_Channel_2);
-- For the indicated channel, the currently selected trigger is driving the
-- channel conversion at a frequency higher than the DMA service capability
-- rate
function Status
(This : Digital_To_Analog_Converter;
Flag : DAC_Status_Flag)
return Boolean;
procedure Clear_Status
(This : in out Digital_To_Analog_Converter;
Flag : DAC_Status_Flag)
with
Inline,
Post => not Status (This, Flag);
type DAC_Interrupts is
(DMA_Underrun_Channel_1,
DMA_Underrun_Channel_2);
procedure Enable_Interrupts
(This : in out Digital_To_Analog_Converter;
Source : DAC_Interrupts)
with
Inline,
Post => Interrupt_Enabled (This, Source);
procedure Disable_Interrupts
(This : in out Digital_To_Analog_Converter;
Source : DAC_Interrupts)
with
Inline,
Post => not Interrupt_Enabled (This, Source);
function Interrupt_Enabled
(This : Digital_To_Analog_Converter;
Source : DAC_Interrupts)
return Boolean
with Inline;
function Interrupt_Source
(This : Digital_To_Analog_Converter)
return DAC_Interrupts
with Inline;
procedure Clear_Interrupt_Pending
(This : in out Digital_To_Analog_Converter;
Channel : DAC_Channel)
with Inline;
type Wave_Generation_Selection is
(No_Wave_Generation,
Noise_Wave,
Triangle_Wave);
type Noise_Wave_Mask_Selection is
(LFSR_Unmask_Bit0,
LFSR_Unmask_Bits1_0,
LFSR_Unmask_Bits2_0,
LFSR_Unmask_Bits3_0,
LFSR_Unmask_Bits4_0,
LFSR_Unmask_Bits5_0,
LFSR_Unmask_Bits6_0,
LFSR_Unmask_Bits7_0,
LFSR_Unmask_Bits8_0,
LFSR_Unmask_Bits9_0,
LFSR_Unmask_Bits10_0,
LFSR_Unmask_Bits11_0);
-- Unmask LFSR bits for noise wave generation
type Triangle_Wave_Amplitude_Selection is
(Triangle_Amplitude_1, -- Select max triangle amplitude of 1
Triangle_Amplitude_3, -- Select max triangle amplitude of 3
Triangle_Amplitude_7, -- Select max triangle amplitude of 7
Triangle_Amplitude_15, -- Select max triangle amplitude of 15
Triangle_Amplitude_31, -- Select max triangle amplitude of 31
Triangle_Amplitude_63, -- Select max triangle amplitude of 63
Triangle_Amplitude_127, -- Select max triangle amplitude of 127
Triangle_Amplitude_255, -- Select max triangle amplitude of 255
Triangle_Amplitude_511, -- Select max triangle amplitude of 511
Triangle_Amplitude_1023, -- Select max triangle amplitude of 1023
Triangle_Amplitude_2047, -- Select max triangle amplitude of 2047
Triangle_Amplitude_4095); -- Select max triangle amplitude of 4095
type Wave_Generation (Kind : Wave_Generation_Selection) is record
case Kind is
when No_Wave_Generation =>
null;
when Noise_Wave =>
Mask : Noise_Wave_Mask_Selection;
when Triangle_Wave =>
Amplitude : Triangle_Wave_Amplitude_Selection;
end case;
end record;
Wave_Generation_Disabled : constant Wave_Generation :=
(Kind => No_Wave_Generation);
procedure Select_Wave_Generation
(This : in out Digital_To_Analog_Converter;
Channel : DAC_Channel;
Selection : Wave_Generation)
with Post => Selected_Wave_Generation (This, Channel) = Selection;
function Selected_Wave_Generation
(This : Digital_To_Analog_Converter;
Channel : DAC_Channel)
return Wave_Generation;
function Data_Address
(This : Digital_To_Analog_Converter;
Channel : DAC_Channel;
Resolution : DAC_Resolution;
Alignment : Data_Alignment)
return Address;
-- Returns the address of the Data Holding register within This, for the
-- specified Channel, at the specified Resolution and Alignment.
--
-- This function is stricly for use with DMA, all others use the API above.
private
type Digital_To_Analog_Converter is new STM32_SVD.DAC.DAC_Peripheral;
end STM32.DAC;
| 39.388235 | 79 | 0.635305 |
0e4d1d4a9c0ae76b20804a72bac5fa90432dede2 | 120,360 | adb | Ada | final-project/repositories/Deep_Learning_Inference_Accelerator_with_CNNIOT/MSOC_final-main/finalpool_hls/solution1/.autopilot/db/conv_read.bind.adb | bol-edu/2020-fall-ntu | 5e009875dec5a3bbcebd1b3fae327990371d1b6a | [
"MIT"
] | 7 | 2021-02-10T17:59:48.000Z | 2021-09-27T15:02:56.000Z | final-project/repositories/Deep_Learning_Inference_Accelerator_with_CNNIOT/MSOC_final-main/finalpool_hls/solution1/.autopilot/db/conv_read.bind.adb | bol-edu/2020-fall-ntu | 5e009875dec5a3bbcebd1b3fae327990371d1b6a | [
"MIT"
] | null | null | null | final-project/repositories/Deep_Learning_Inference_Accelerator_with_CNNIOT/MSOC_final-main/finalpool_hls/solution1/.autopilot/db/conv_read.bind.adb | bol-edu/2020-fall-ntu | 5e009875dec5a3bbcebd1b3fae327990371d1b6a | [
"MIT"
] | 1 | 2022-03-22T01:46:01.000Z | 2022-03-22T01:46:01.000Z | <?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>conv_read</name>
<ret_bitwidth>32</ret_bitwidth>
<ports class_id="2" tracking_level="0" version="0">
<count>9</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>cofm</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>cofm</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>512</bitwidth>
</Value>
<direction>2</direction>
<if_type>0</if_type>
<array_size>0</array_size>
<bit_vecs class_id="7" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_2">
<Value>
<Obj>
<type>1</type>
<id>2</id>
<name>ofm_buff0_0</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>ofm_buff0[0]</originalName>
<rtlName></rtlName>
<coreName>RAM</coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<direction>0</direction>
<if_type>1</if_type>
<array_size>56</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>ofm_buff0_1</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>ofm_buff0[1]</originalName>
<rtlName></rtlName>
<coreName>RAM</coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<direction>0</direction>
<if_type>1</if_type>
<array_size>56</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>ofm_buff0_2</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>ofm_buff0[2]</originalName>
<rtlName></rtlName>
<coreName>RAM</coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<direction>0</direction>
<if_type>1</if_type>
<array_size>56</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>ofm_buff0_3</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>ofm_buff0[3]</originalName>
<rtlName></rtlName>
<coreName>RAM</coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<direction>0</direction>
<if_type>1</if_type>
<array_size>56</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_6">
<Value>
<Obj>
<type>1</type>
<id>6</id>
<name>ofm_buff0_4</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>ofm_buff0[4]</originalName>
<rtlName></rtlName>
<coreName>RAM</coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<direction>0</direction>
<if_type>1</if_type>
<array_size>56</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_7">
<Value>
<Obj>
<type>1</type>
<id>7</id>
<name>ofm_buff0_5</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>ofm_buff0[5]</originalName>
<rtlName></rtlName>
<coreName>RAM</coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<direction>0</direction>
<if_type>1</if_type>
<array_size>56</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_8">
<Value>
<Obj>
<type>1</type>
<id>8</id>
<name>cofm_counter_read</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>cofm_counter</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="_9">
<Value>
<Obj>
<type>1</type>
<id>9</id>
<name>enable</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>enable</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<direction>0</direction>
<if_type>0</if_type>
<array_size>0</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
</ports>
<nodes class_id="8" tracking_level="0" version="0">
<count>36</count>
<item_version>0</item_version>
<item class_id="9" tracking_level="1" version="0" object_id="_10">
<Value>
<Obj>
<type>0</type>
<id>11</id>
<name>enable_read</name>
<fileName>finalpool.cpp</fileName>
<fileDirectory>D:\Course\mSOC\final</fileDirectory>
<lineNumber>217</lineNumber>
<contextFuncName>conv_read</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item class_id="10" tracking_level="0" version="0">
<first>D:\Course\mSOC\final</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>finalpool.cpp</first>
<second>conv_read</second>
</first>
<second>217</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>enable</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>58</item>
<item>59</item>
</oprand_edges>
<opcode>read</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>1</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_11">
<Value>
<Obj>
<type>0</type>
<id>12</id>
<name>cofm_counter_read_1</name>
<fileName>finalpool.cpp</fileName>
<fileDirectory>D:\Course\mSOC\final</fileDirectory>
<lineNumber>217</lineNumber>
<contextFuncName>conv_read</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>D:\Course\mSOC\final</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>finalpool.cpp</first>
<second>conv_read</second>
</first>
<second>217</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>cofm_counter</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>61</item>
<item>62</item>
</oprand_edges>
<opcode>read</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>2</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_12">
<Value>
<Obj>
<type>0</type>
<id>13</id>
<name>_ln219</name>
<fileName>finalpool.cpp</fileName>
<fileDirectory>D:\Course\mSOC\final</fileDirectory>
<lineNumber>219</lineNumber>
<contextFuncName>conv_read</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>D:\Course\mSOC\final</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>finalpool.cpp</first>
<second>conv_read</second>
</first>
<second>219</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>63</item>
<item>64</item>
<item>65</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>1.76</m_delay>
<m_topoIndex>3</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_13">
<Value>
<Obj>
<type>0</type>
<id>15</id>
<name>add_ln221</name>
<fileName>finalpool.cpp</fileName>
<fileDirectory>D:\Course\mSOC\final</fileDirectory>
<lineNumber>221</lineNumber>
<contextFuncName>conv_read</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>D:\Course\mSOC\final</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>finalpool.cpp</first>
<second>conv_read</second>
</first>
<second>221</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>66</item>
<item>68</item>
</oprand_edges>
<opcode>add</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>2.55</m_delay>
<m_topoIndex>4</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_14">
<Value>
<Obj>
<type>0</type>
<id>16</id>
<name>_ln221</name>
<fileName>finalpool.cpp</fileName>
<fileDirectory>D:\Course\mSOC\final</fileDirectory>
<lineNumber>221</lineNumber>
<contextFuncName>conv_read</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>D:\Course\mSOC\final</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>finalpool.cpp</first>
<second>conv_read</second>
</first>
<second>221</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>69</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>1.76</m_delay>
<m_topoIndex>5</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_15">
<Value>
<Obj>
<type>0</type>
<id>18</id>
<name>j_0</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>j</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>6</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>70</item>
<item>71</item>
<item>73</item>
<item>74</item>
</oprand_edges>
<opcode>phi</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>6</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_16">
<Value>
<Obj>
<type>0</type>
<id>19</id>
<name>icmp_ln221</name>
<fileName>finalpool.cpp</fileName>
<fileDirectory>D:\Course\mSOC\final</fileDirectory>
<lineNumber>221</lineNumber>
<contextFuncName>conv_read</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>D:\Course\mSOC\final</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>finalpool.cpp</first>
<second>conv_read</second>
</first>
<second>221</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>77</item>
</oprand_edges>
<opcode>icmp</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>1.42</m_delay>
<m_topoIndex>7</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_17">
<Value>
<Obj>
<type>0</type>
<id>21</id>
<name>j</name>
<fileName>finalpool.cpp</fileName>
<fileDirectory>D:\Course\mSOC\final</fileDirectory>
<lineNumber>221</lineNumber>
<contextFuncName>conv_read</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>D:\Course\mSOC\final</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>finalpool.cpp</first>
<second>conv_read</second>
</first>
<second>221</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>j</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>6</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>78</item>
<item>80</item>
</oprand_edges>
<opcode>add</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>1.82</m_delay>
<m_topoIndex>8</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_18">
<Value>
<Obj>
<type>0</type>
<id>22</id>
<name>_ln221</name>
<fileName>finalpool.cpp</fileName>
<fileDirectory>D:\Course\mSOC\final</fileDirectory>
<lineNumber>221</lineNumber>
<contextFuncName>conv_read</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>D:\Course\mSOC\final</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>finalpool.cpp</first>
<second>conv_read</second>
</first>
<second>221</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>81</item>
<item>82</item>
<item>83</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>9</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_19">
<Value>
<Obj>
<type>0</type>
<id>26</id>
<name>zext_ln224</name>
<fileName>finalpool.cpp</fileName>
<fileDirectory>D:\Course\mSOC\final</fileDirectory>
<lineNumber>224</lineNumber>
<contextFuncName>conv_read</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>D:\Course\mSOC\final</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>finalpool.cpp</first>
<second>conv_read</second>
</first>
<second>224</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>84</item>
</oprand_edges>
<opcode>zext</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>10</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_20">
<Value>
<Obj>
<type>0</type>
<id>27</id>
<name>ofm_buff0_0_addr</name>
<fileName>finalpool.cpp</fileName>
<fileDirectory>D:\Course\mSOC\final</fileDirectory>
<lineNumber>224</lineNumber>
<contextFuncName>conv_read</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>D:\Course\mSOC\final</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>finalpool.cpp</first>
<second>conv_read</second>
</first>
<second>224</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>6</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>85</item>
<item>87</item>
<item>88</item>
</oprand_edges>
<opcode>getelementptr</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>11</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_21">
<Value>
<Obj>
<type>0</type>
<id>28</id>
<name>ofm_buff0_0_load</name>
<fileName>finalpool.cpp</fileName>
<fileDirectory>D:\Course\mSOC\final</fileDirectory>
<lineNumber>224</lineNumber>
<contextFuncName>conv_read</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>D:\Course\mSOC\final</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>finalpool.cpp</first>
<second>conv_read</second>
</first>
<second>224</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>89</item>
</oprand_edges>
<opcode>load</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>3.25</m_delay>
<m_topoIndex>12</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_22">
<Value>
<Obj>
<type>0</type>
<id>29</id>
<name>bitcast_ln224</name>
<fileName>finalpool.cpp</fileName>
<fileDirectory>D:\Course\mSOC\final</fileDirectory>
<lineNumber>224</lineNumber>
<contextFuncName>conv_read</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>D:\Course\mSOC\final</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>finalpool.cpp</first>
<second>conv_read</second>
</first>
<second>224</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>90</item>
</oprand_edges>
<opcode>bitcast</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>23</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_23">
<Value>
<Obj>
<type>0</type>
<id>30</id>
<name>cofm_read</name>
<fileName>finalpool.cpp</fileName>
<fileDirectory>D:\Course\mSOC\final</fileDirectory>
<lineNumber>224</lineNumber>
<contextFuncName>conv_read</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>D:\Course\mSOC\final</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>finalpool.cpp</first>
<second>conv_read</second>
</first>
<second>224</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>512</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>92</item>
<item>93</item>
</oprand_edges>
<opcode>read</opcode>
<m_Display>1</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>1</m_isLCDNode>
<m_isStartOfPath>1</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>24</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_24">
<Value>
<Obj>
<type>0</type>
<id>31</id>
<name>ofm_buff0_1_addr</name>
<fileName>finalpool.cpp</fileName>
<fileDirectory>D:\Course\mSOC\final</fileDirectory>
<lineNumber>225</lineNumber>
<contextFuncName>conv_read</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>D:\Course\mSOC\final</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>finalpool.cpp</first>
<second>conv_read</second>
</first>
<second>225</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>6</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>94</item>
<item>95</item>
<item>96</item>
</oprand_edges>
<opcode>getelementptr</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>13</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_25">
<Value>
<Obj>
<type>0</type>
<id>32</id>
<name>ofm_buff0_1_load</name>
<fileName>finalpool.cpp</fileName>
<fileDirectory>D:\Course\mSOC\final</fileDirectory>
<lineNumber>225</lineNumber>
<contextFuncName>conv_read</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>D:\Course\mSOC\final</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>finalpool.cpp</first>
<second>conv_read</second>
</first>
<second>225</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>97</item>
</oprand_edges>
<opcode>load</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>3.25</m_delay>
<m_topoIndex>14</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_26">
<Value>
<Obj>
<type>0</type>
<id>33</id>
<name>bitcast_ln225</name>
<fileName>finalpool.cpp</fileName>
<fileDirectory>D:\Course\mSOC\final</fileDirectory>
<lineNumber>225</lineNumber>
<contextFuncName>conv_read</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>D:\Course\mSOC\final</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>finalpool.cpp</first>
<second>conv_read</second>
</first>
<second>225</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>98</item>
</oprand_edges>
<opcode>bitcast</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>25</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_27">
<Value>
<Obj>
<type>0</type>
<id>34</id>
<name>ofm_buff0_2_addr</name>
<fileName>finalpool.cpp</fileName>
<fileDirectory>D:\Course\mSOC\final</fileDirectory>
<lineNumber>226</lineNumber>
<contextFuncName>conv_read</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>D:\Course\mSOC\final</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>finalpool.cpp</first>
<second>conv_read</second>
</first>
<second>226</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>6</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>99</item>
<item>100</item>
<item>101</item>
</oprand_edges>
<opcode>getelementptr</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>15</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_28">
<Value>
<Obj>
<type>0</type>
<id>35</id>
<name>ofm_buff0_2_load</name>
<fileName>finalpool.cpp</fileName>
<fileDirectory>D:\Course\mSOC\final</fileDirectory>
<lineNumber>226</lineNumber>
<contextFuncName>conv_read</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>D:\Course\mSOC\final</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>finalpool.cpp</first>
<second>conv_read</second>
</first>
<second>226</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>102</item>
</oprand_edges>
<opcode>load</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>3.25</m_delay>
<m_topoIndex>16</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_29">
<Value>
<Obj>
<type>0</type>
<id>36</id>
<name>bitcast_ln226</name>
<fileName>finalpool.cpp</fileName>
<fileDirectory>D:\Course\mSOC\final</fileDirectory>
<lineNumber>226</lineNumber>
<contextFuncName>conv_read</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>D:\Course\mSOC\final</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>finalpool.cpp</first>
<second>conv_read</second>
</first>
<second>226</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>103</item>
</oprand_edges>
<opcode>bitcast</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>26</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_30">
<Value>
<Obj>
<type>0</type>
<id>37</id>
<name>ofm_buff0_3_addr</name>
<fileName>finalpool.cpp</fileName>
<fileDirectory>D:\Course\mSOC\final</fileDirectory>
<lineNumber>227</lineNumber>
<contextFuncName>conv_read</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>D:\Course\mSOC\final</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>finalpool.cpp</first>
<second>conv_read</second>
</first>
<second>227</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>6</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>104</item>
<item>105</item>
<item>106</item>
</oprand_edges>
<opcode>getelementptr</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>17</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_31">
<Value>
<Obj>
<type>0</type>
<id>38</id>
<name>ofm_buff0_3_load</name>
<fileName>finalpool.cpp</fileName>
<fileDirectory>D:\Course\mSOC\final</fileDirectory>
<lineNumber>227</lineNumber>
<contextFuncName>conv_read</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>D:\Course\mSOC\final</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>finalpool.cpp</first>
<second>conv_read</second>
</first>
<second>227</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>107</item>
</oprand_edges>
<opcode>load</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>3.25</m_delay>
<m_topoIndex>18</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_32">
<Value>
<Obj>
<type>0</type>
<id>39</id>
<name>bitcast_ln227</name>
<fileName>finalpool.cpp</fileName>
<fileDirectory>D:\Course\mSOC\final</fileDirectory>
<lineNumber>227</lineNumber>
<contextFuncName>conv_read</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>D:\Course\mSOC\final</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>finalpool.cpp</first>
<second>conv_read</second>
</first>
<second>227</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>108</item>
</oprand_edges>
<opcode>bitcast</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>27</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_33">
<Value>
<Obj>
<type>0</type>
<id>40</id>
<name>ofm_buff0_4_addr</name>
<fileName>finalpool.cpp</fileName>
<fileDirectory>D:\Course\mSOC\final</fileDirectory>
<lineNumber>228</lineNumber>
<contextFuncName>conv_read</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>D:\Course\mSOC\final</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>finalpool.cpp</first>
<second>conv_read</second>
</first>
<second>228</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>6</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>109</item>
<item>110</item>
<item>111</item>
</oprand_edges>
<opcode>getelementptr</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>19</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_34">
<Value>
<Obj>
<type>0</type>
<id>41</id>
<name>ofm_buff0_4_load</name>
<fileName>finalpool.cpp</fileName>
<fileDirectory>D:\Course\mSOC\final</fileDirectory>
<lineNumber>228</lineNumber>
<contextFuncName>conv_read</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>D:\Course\mSOC\final</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>finalpool.cpp</first>
<second>conv_read</second>
</first>
<second>228</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>112</item>
</oprand_edges>
<opcode>load</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>3.25</m_delay>
<m_topoIndex>20</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_35">
<Value>
<Obj>
<type>0</type>
<id>42</id>
<name>bitcast_ln228</name>
<fileName>finalpool.cpp</fileName>
<fileDirectory>D:\Course\mSOC\final</fileDirectory>
<lineNumber>228</lineNumber>
<contextFuncName>conv_read</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>D:\Course\mSOC\final</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>finalpool.cpp</first>
<second>conv_read</second>
</first>
<second>228</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>113</item>
</oprand_edges>
<opcode>bitcast</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>28</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_36">
<Value>
<Obj>
<type>0</type>
<id>43</id>
<name>ofm_buff0_5_addr</name>
<fileName>finalpool.cpp</fileName>
<fileDirectory>D:\Course\mSOC\final</fileDirectory>
<lineNumber>229</lineNumber>
<contextFuncName>conv_read</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>D:\Course\mSOC\final</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>finalpool.cpp</first>
<second>conv_read</second>
</first>
<second>229</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>6</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>114</item>
<item>115</item>
<item>116</item>
</oprand_edges>
<opcode>getelementptr</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>21</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_37">
<Value>
<Obj>
<type>0</type>
<id>44</id>
<name>ofm_buff0_5_load</name>
<fileName>finalpool.cpp</fileName>
<fileDirectory>D:\Course\mSOC\final</fileDirectory>
<lineNumber>229</lineNumber>
<contextFuncName>conv_read</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>D:\Course\mSOC\final</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>finalpool.cpp</first>
<second>conv_read</second>
</first>
<second>229</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>117</item>
</oprand_edges>
<opcode>load</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>3.25</m_delay>
<m_topoIndex>22</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_38">
<Value>
<Obj>
<type>0</type>
<id>45</id>
<name>bitcast_ln229</name>
<fileName>finalpool.cpp</fileName>
<fileDirectory>D:\Course\mSOC\final</fileDirectory>
<lineNumber>229</lineNumber>
<contextFuncName>conv_read</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>D:\Course\mSOC\final</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>finalpool.cpp</first>
<second>conv_read</second>
</first>
<second>229</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>118</item>
</oprand_edges>
<opcode>bitcast</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>29</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_39">
<Value>
<Obj>
<type>0</type>
<id>46</id>
<name>tmp_s</name>
<fileName>finalpool.cpp</fileName>
<fileDirectory>D:\Course\mSOC\final</fileDirectory>
<lineNumber>229</lineNumber>
<contextFuncName>conv_read</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>D:\Course\mSOC\final</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>finalpool.cpp</first>
<second>conv_read</second>
</first>
<second>229</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>192</bitwidth>
</Value>
<oprand_edges>
<count>7</count>
<item_version>0</item_version>
<item>120</item>
<item>121</item>
<item>122</item>
<item>123</item>
<item>124</item>
<item>125</item>
<item>126</item>
</oprand_edges>
<opcode>bitconcatenate</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>30</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_40">
<Value>
<Obj>
<type>0</type>
<id>47</id>
<name>cofm_b5_addr1516_par</name>
<fileName>finalpool.cpp</fileName>
<fileDirectory>D:\Course\mSOC\final</fileDirectory>
<lineNumber>229</lineNumber>
<contextFuncName>conv_read</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>D:\Course\mSOC\final</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>finalpool.cpp</first>
<second>conv_read</second>
</first>
<second>229</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>512</bitwidth>
</Value>
<oprand_edges>
<count>5</count>
<item_version>0</item_version>
<item>128</item>
<item>129</item>
<item>130</item>
<item>132</item>
<item>134</item>
</oprand_edges>
<opcode>partset</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>31</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_41">
<Value>
<Obj>
<type>0</type>
<id>48</id>
<name>cofm_write_ln229</name>
<fileName>finalpool.cpp</fileName>
<fileDirectory>D:\Course\mSOC\final</fileDirectory>
<lineNumber>229</lineNumber>
<contextFuncName>conv_read</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>D:\Course\mSOC\final</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>finalpool.cpp</first>
<second>conv_read</second>
</first>
<second>229</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>5</count>
<item_version>0</item_version>
<item>136</item>
<item>137</item>
<item>138</item>
<item>201</item>
<item>2147483647</item>
</oprand_edges>
<opcode>write</opcode>
<m_Display>1</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>1</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>32</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_42">
<Value>
<Obj>
<type>0</type>
<id>50</id>
<name>_ln221</name>
<fileName>finalpool.cpp</fileName>
<fileDirectory>D:\Course\mSOC\final</fileDirectory>
<lineNumber>221</lineNumber>
<contextFuncName>conv_read</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>D:\Course\mSOC\final</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>finalpool.cpp</first>
<second>conv_read</second>
</first>
<second>221</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>139</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>33</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_43">
<Value>
<Obj>
<type>0</type>
<id>52</id>
<name>_ln0</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>1</count>
<item_version>0</item_version>
<item>140</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>1.76</m_delay>
<m_topoIndex>34</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_44">
<Value>
<Obj>
<type>0</type>
<id>54</id>
<name>cofm_counter_1</name>
<fileName>finalpool.cpp</fileName>
<fileDirectory>D:\Course\mSOC\final</fileDirectory>
<lineNumber>217</lineNumber>
<contextFuncName>conv_read</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>D:\Course\mSOC\final</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>finalpool.cpp</first>
<second>conv_read</second>
</first>
<second>217</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>141</item>
<item>142</item>
<item>143</item>
<item>144</item>
</oprand_edges>
<opcode>phi</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>35</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_45">
<Value>
<Obj>
<type>0</type>
<id>55</id>
<name>_ln244</name>
<fileName>finalpool.cpp</fileName>
<fileDirectory>D:\Course\mSOC\final</fileDirectory>
<lineNumber>244</lineNumber>
<contextFuncName>conv_read</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>D:\Course\mSOC\final</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>finalpool.cpp</first>
<second>conv_read</second>
</first>
<second>244</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>145</item>
</oprand_edges>
<opcode>ret</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>36</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
</nodes>
<consts class_id="15" tracking_level="0" version="0">
<count>7</count>
<item_version>0</item_version>
<item class_id="16" tracking_level="1" version="0" object_id="_46">
<Value>
<Obj>
<type>2</type>
<id>67</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>56</content>
</item>
<item class_id_reference="16" object_id="_47">
<Value>
<Obj>
<type>2</type>
<id>72</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>6</bitwidth>
</Value>
<const_type>0</const_type>
<content>0</content>
</item>
<item class_id_reference="16" object_id="_48">
<Value>
<Obj>
<type>2</type>
<id>76</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>56</content>
</item>
<item class_id_reference="16" object_id="_49">
<Value>
<Obj>
<type>2</type>
<id>79</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="_50">
<Value>
<Obj>
<type>2</type>
<id>86</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<const_type>0</const_type>
<content>0</content>
</item>
<item class_id_reference="16" object_id="_51">
<Value>
<Obj>
<type>2</type>
<id>131</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>
<item class_id_reference="16" object_id="_52">
<Value>
<Obj>
<type>2</type>
<id>133</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>191</content>
</item>
</consts>
<blocks class_id="17" tracking_level="0" version="0">
<count>6</count>
<item_version>0</item_version>
<item class_id="18" tracking_level="1" version="0" object_id="_53">
<Obj>
<type>3</type>
<id>14</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>11</item>
<item>12</item>
<item>13</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_54">
<Obj>
<type>3</type>
<id>17</id>
<name>.preheader.preheader</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>2</count>
<item_version>0</item_version>
<item>15</item>
<item>16</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_55">
<Obj>
<type>3</type>
<id>23</id>
<name>.preheader</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>4</count>
<item_version>0</item_version>
<item>18</item>
<item>19</item>
<item>21</item>
<item>22</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_56">
<Obj>
<type>3</type>
<id>51</id>
<name>hls_label_6</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>24</count>
<item_version>0</item_version>
<item>26</item>
<item>27</item>
<item>28</item>
<item>29</item>
<item>30</item>
<item>31</item>
<item>32</item>
<item>33</item>
<item>34</item>
<item>35</item>
<item>36</item>
<item>37</item>
<item>38</item>
<item>39</item>
<item>40</item>
<item>41</item>
<item>42</item>
<item>43</item>
<item>44</item>
<item>45</item>
<item>46</item>
<item>47</item>
<item>48</item>
<item>50</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_57">
<Obj>
<type>3</type>
<id>53</id>
<name>.loopexit.loopexit</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>52</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_58">
<Obj>
<type>3</type>
<id>56</id>
<name>.loopexit</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>54</item>
<item>55</item>
</node_objs>
</item>
</blocks>
<edges class_id="19" tracking_level="0" version="0">
<count>79</count>
<item_version>0</item_version>
<item class_id="20" tracking_level="1" version="0" object_id="_59">
<id>59</id>
<edge_type>1</edge_type>
<source_obj>9</source_obj>
<sink_obj>11</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_60">
<id>62</id>
<edge_type>1</edge_type>
<source_obj>8</source_obj>
<sink_obj>12</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_61">
<id>63</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="_62">
<id>64</id>
<edge_type>2</edge_type>
<source_obj>56</source_obj>
<sink_obj>13</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_63">
<id>65</id>
<edge_type>2</edge_type>
<source_obj>17</source_obj>
<sink_obj>13</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_64">
<id>66</id>
<edge_type>1</edge_type>
<source_obj>12</source_obj>
<sink_obj>15</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_65">
<id>68</id>
<edge_type>1</edge_type>
<source_obj>67</source_obj>
<sink_obj>15</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_66">
<id>69</id>
<edge_type>2</edge_type>
<source_obj>23</source_obj>
<sink_obj>16</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_67">
<id>70</id>
<edge_type>1</edge_type>
<source_obj>21</source_obj>
<sink_obj>18</sink_obj>
<is_back_edge>1</is_back_edge>
</item>
<item class_id_reference="20" object_id="_68">
<id>71</id>
<edge_type>2</edge_type>
<source_obj>51</source_obj>
<sink_obj>18</sink_obj>
<is_back_edge>1</is_back_edge>
</item>
<item class_id_reference="20" object_id="_69">
<id>73</id>
<edge_type>1</edge_type>
<source_obj>72</source_obj>
<sink_obj>18</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_70">
<id>74</id>
<edge_type>2</edge_type>
<source_obj>17</source_obj>
<sink_obj>18</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_71">
<id>75</id>
<edge_type>1</edge_type>
<source_obj>18</source_obj>
<sink_obj>19</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_72">
<id>77</id>
<edge_type>1</edge_type>
<source_obj>76</source_obj>
<sink_obj>19</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_73">
<id>78</id>
<edge_type>1</edge_type>
<source_obj>18</source_obj>
<sink_obj>21</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_74">
<id>80</id>
<edge_type>1</edge_type>
<source_obj>79</source_obj>
<sink_obj>21</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_75">
<id>81</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="_76">
<id>82</id>
<edge_type>2</edge_type>
<source_obj>51</source_obj>
<sink_obj>22</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_77">
<id>83</id>
<edge_type>2</edge_type>
<source_obj>53</source_obj>
<sink_obj>22</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_78">
<id>84</id>
<edge_type>1</edge_type>
<source_obj>18</source_obj>
<sink_obj>26</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_79">
<id>85</id>
<edge_type>1</edge_type>
<source_obj>2</source_obj>
<sink_obj>27</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_80">
<id>87</id>
<edge_type>1</edge_type>
<source_obj>86</source_obj>
<sink_obj>27</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_81">
<id>88</id>
<edge_type>1</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="_82">
<id>89</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="_83">
<id>90</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="_84">
<id>93</id>
<edge_type>1</edge_type>
<source_obj>1</source_obj>
<sink_obj>30</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_85">
<id>94</id>
<edge_type>1</edge_type>
<source_obj>3</source_obj>
<sink_obj>31</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_86">
<id>95</id>
<edge_type>1</edge_type>
<source_obj>86</source_obj>
<sink_obj>31</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_87">
<id>96</id>
<edge_type>1</edge_type>
<source_obj>26</source_obj>
<sink_obj>31</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_88">
<id>97</id>
<edge_type>1</edge_type>
<source_obj>31</source_obj>
<sink_obj>32</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_89">
<id>98</id>
<edge_type>1</edge_type>
<source_obj>32</source_obj>
<sink_obj>33</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_90">
<id>99</id>
<edge_type>1</edge_type>
<source_obj>4</source_obj>
<sink_obj>34</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_91">
<id>100</id>
<edge_type>1</edge_type>
<source_obj>86</source_obj>
<sink_obj>34</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_92">
<id>101</id>
<edge_type>1</edge_type>
<source_obj>26</source_obj>
<sink_obj>34</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_93">
<id>102</id>
<edge_type>1</edge_type>
<source_obj>34</source_obj>
<sink_obj>35</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_94">
<id>103</id>
<edge_type>1</edge_type>
<source_obj>35</source_obj>
<sink_obj>36</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_95">
<id>104</id>
<edge_type>1</edge_type>
<source_obj>5</source_obj>
<sink_obj>37</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_96">
<id>105</id>
<edge_type>1</edge_type>
<source_obj>86</source_obj>
<sink_obj>37</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_97">
<id>106</id>
<edge_type>1</edge_type>
<source_obj>26</source_obj>
<sink_obj>37</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_98">
<id>107</id>
<edge_type>1</edge_type>
<source_obj>37</source_obj>
<sink_obj>38</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_99">
<id>108</id>
<edge_type>1</edge_type>
<source_obj>38</source_obj>
<sink_obj>39</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_100">
<id>109</id>
<edge_type>1</edge_type>
<source_obj>6</source_obj>
<sink_obj>40</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_101">
<id>110</id>
<edge_type>1</edge_type>
<source_obj>86</source_obj>
<sink_obj>40</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_102">
<id>111</id>
<edge_type>1</edge_type>
<source_obj>26</source_obj>
<sink_obj>40</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_103">
<id>112</id>
<edge_type>1</edge_type>
<source_obj>40</source_obj>
<sink_obj>41</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_104">
<id>113</id>
<edge_type>1</edge_type>
<source_obj>41</source_obj>
<sink_obj>42</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_105">
<id>114</id>
<edge_type>1</edge_type>
<source_obj>7</source_obj>
<sink_obj>43</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_106">
<id>115</id>
<edge_type>1</edge_type>
<source_obj>86</source_obj>
<sink_obj>43</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_107">
<id>116</id>
<edge_type>1</edge_type>
<source_obj>26</source_obj>
<sink_obj>43</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_108">
<id>117</id>
<edge_type>1</edge_type>
<source_obj>43</source_obj>
<sink_obj>44</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_109">
<id>118</id>
<edge_type>1</edge_type>
<source_obj>44</source_obj>
<sink_obj>45</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_110">
<id>121</id>
<edge_type>1</edge_type>
<source_obj>45</source_obj>
<sink_obj>46</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_111">
<id>122</id>
<edge_type>1</edge_type>
<source_obj>42</source_obj>
<sink_obj>46</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_112">
<id>123</id>
<edge_type>1</edge_type>
<source_obj>39</source_obj>
<sink_obj>46</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_113">
<id>124</id>
<edge_type>1</edge_type>
<source_obj>36</source_obj>
<sink_obj>46</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_114">
<id>125</id>
<edge_type>1</edge_type>
<source_obj>33</source_obj>
<sink_obj>46</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_115">
<id>126</id>
<edge_type>1</edge_type>
<source_obj>29</source_obj>
<sink_obj>46</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_116">
<id>129</id>
<edge_type>1</edge_type>
<source_obj>30</source_obj>
<sink_obj>47</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_117">
<id>130</id>
<edge_type>1</edge_type>
<source_obj>46</source_obj>
<sink_obj>47</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_118">
<id>132</id>
<edge_type>1</edge_type>
<source_obj>131</source_obj>
<sink_obj>47</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_119">
<id>134</id>
<edge_type>1</edge_type>
<source_obj>133</source_obj>
<sink_obj>47</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_120">
<id>137</id>
<edge_type>1</edge_type>
<source_obj>1</source_obj>
<sink_obj>48</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_121">
<id>138</id>
<edge_type>1</edge_type>
<source_obj>47</source_obj>
<sink_obj>48</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_122">
<id>139</id>
<edge_type>2</edge_type>
<source_obj>23</source_obj>
<sink_obj>50</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_123">
<id>140</id>
<edge_type>2</edge_type>
<source_obj>56</source_obj>
<sink_obj>52</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_124">
<id>141</id>
<edge_type>1</edge_type>
<source_obj>12</source_obj>
<sink_obj>54</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_125">
<id>142</id>
<edge_type>2</edge_type>
<source_obj>14</source_obj>
<sink_obj>54</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_126">
<id>143</id>
<edge_type>1</edge_type>
<source_obj>15</source_obj>
<sink_obj>54</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_127">
<id>144</id>
<edge_type>2</edge_type>
<source_obj>53</source_obj>
<sink_obj>54</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_128">
<id>145</id>
<edge_type>1</edge_type>
<source_obj>54</source_obj>
<sink_obj>55</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_129">
<id>194</id>
<edge_type>2</edge_type>
<source_obj>14</source_obj>
<sink_obj>17</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_130">
<id>195</id>
<edge_type>2</edge_type>
<source_obj>14</source_obj>
<sink_obj>56</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_131">
<id>196</id>
<edge_type>2</edge_type>
<source_obj>17</source_obj>
<sink_obj>23</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_132">
<id>197</id>
<edge_type>2</edge_type>
<source_obj>23</source_obj>
<sink_obj>53</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_133">
<id>198</id>
<edge_type>2</edge_type>
<source_obj>23</source_obj>
<sink_obj>51</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_134">
<id>199</id>
<edge_type>2</edge_type>
<source_obj>51</source_obj>
<sink_obj>23</sink_obj>
<is_back_edge>1</is_back_edge>
</item>
<item class_id_reference="20" object_id="_135">
<id>200</id>
<edge_type>2</edge_type>
<source_obj>53</source_obj>
<sink_obj>56</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_136">
<id>201</id>
<edge_type>4</edge_type>
<source_obj>30</source_obj>
<sink_obj>48</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_137">
<id>2147483647</id>
<edge_type>1</edge_type>
<source_obj>48</source_obj>
<sink_obj>30</sink_obj>
<is_back_edge>1</is_back_edge>
</item>
</edges>
</cdfg>
<cdfg_regions class_id="21" tracking_level="0" version="0">
<count>5</count>
<item_version>0</item_version>
<item class_id="22" tracking_level="1" version="0" object_id="_138">
<mId>1</mId>
<mTag>conv_read</mTag>
<mType>0</mType>
<sub_regions>
<count>4</count>
<item_version>0</item_version>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</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>115</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"></mDfPipe>
</item>
<item class_id_reference="22" object_id="_139">
<mId>2</mId>
<mTag>Entry</mTag>
<mType>0</mType>
<sub_regions>
<count>0</count>
<item_version>0</item_version>
</sub_regions>
<basic_blocks>
<count>2</count>
<item_version>0</item_version>
<item>14</item>
<item>17</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>
<item class_id_reference="22" object_id="_140">
<mId>3</mId>
<mTag>Loop 1</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>23</item>
<item>51</item>
</basic_blocks>
<mII>2</mII>
<mDepth>3</mDepth>
<mMinTripCount>56</mMinTripCount>
<mMaxTripCount>56</mMaxTripCount>
<mMinLatency>112</mMinLatency>
<mMaxLatency>112</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"></mDfPipe>
</item>
<item class_id_reference="22" object_id="_141">
<mId>4</mId>
<mTag>Region 1</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>53</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>
<item class_id_reference="22" object_id="_142">
<mId>5</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>56</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="_143">
<states class_id="25" tracking_level="0" version="0">
<count>6</count>
<item_version>0</item_version>
<item class_id="26" tracking_level="1" version="0" object_id="_144">
<id>1</id>
<operations class_id="27" tracking_level="0" version="0">
<count>6</count>
<item_version>0</item_version>
<item class_id="28" tracking_level="1" version="0" object_id="_145">
<id>10</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_146">
<id>11</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_147">
<id>12</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_148">
<id>13</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_149">
<id>15</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_150">
<id>16</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_151">
<id>2</id>
<operations>
<count>18</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_152">
<id>18</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_153">
<id>19</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_154">
<id>20</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_155">
<id>21</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_156">
<id>22</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_157">
<id>26</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_158">
<id>27</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_159">
<id>28</id>
<stage>2</stage>
<latency>2</latency>
</item>
<item class_id_reference="28" object_id="_160">
<id>31</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_161">
<id>32</id>
<stage>2</stage>
<latency>2</latency>
</item>
<item class_id_reference="28" object_id="_162">
<id>34</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_163">
<id>35</id>
<stage>2</stage>
<latency>2</latency>
</item>
<item class_id_reference="28" object_id="_164">
<id>37</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_165">
<id>38</id>
<stage>2</stage>
<latency>2</latency>
</item>
<item class_id_reference="28" object_id="_166">
<id>40</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_167">
<id>41</id>
<stage>2</stage>
<latency>2</latency>
</item>
<item class_id_reference="28" object_id="_168">
<id>43</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_169">
<id>44</id>
<stage>2</stage>
<latency>2</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_170">
<id>3</id>
<operations>
<count>15</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_171">
<id>28</id>
<stage>1</stage>
<latency>2</latency>
</item>
<item class_id_reference="28" object_id="_172">
<id>29</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_173">
<id>30</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_174">
<id>32</id>
<stage>1</stage>
<latency>2</latency>
</item>
<item class_id_reference="28" object_id="_175">
<id>33</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_176">
<id>35</id>
<stage>1</stage>
<latency>2</latency>
</item>
<item class_id_reference="28" object_id="_177">
<id>36</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_178">
<id>38</id>
<stage>1</stage>
<latency>2</latency>
</item>
<item class_id_reference="28" object_id="_179">
<id>39</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_180">
<id>41</id>
<stage>1</stage>
<latency>2</latency>
</item>
<item class_id_reference="28" object_id="_181">
<id>42</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_182">
<id>44</id>
<stage>1</stage>
<latency>2</latency>
</item>
<item class_id_reference="28" object_id="_183">
<id>45</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_184">
<id>46</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_185">
<id>47</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_186">
<id>4</id>
<operations>
<count>5</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_187">
<id>24</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_188">
<id>25</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_189">
<id>48</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_190">
<id>49</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_191">
<id>50</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_192">
<id>5</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_193">
<id>52</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_194">
<id>6</id>
<operations>
<count>2</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_195">
<id>54</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_196">
<id>55</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
</states>
<transitions class_id="29" tracking_level="0" version="0">
<count>7</count>
<item_version>0</item_version>
<item class_id="30" tracking_level="1" version="0" object_id="_197">
<inState>1</inState>
<outState>6</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>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>11</first>
<second>0</second>
</first>
<second>1</second>
</item>
</item>
</sop>
</condition>
</item>
<item class_id_reference="30" object_id="_198">
<inState>1</inState>
<outState>2</outState>
<condition>
<id>-1</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>11</first>
<second>0</second>
</first>
<second>0</second>
</item>
</item>
</sop>
</condition>
</item>
<item class_id_reference="30" object_id="_199">
<inState>5</inState>
<outState>6</outState>
<condition>
<id>-1</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>0</count>
<item_version>0</item_version>
</item>
</sop>
</condition>
</item>
<item class_id_reference="30" object_id="_200">
<inState>3</inState>
<outState>4</outState>
<condition>
<id>-1</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>0</count>
<item_version>0</item_version>
</item>
</sop>
</condition>
</item>
<item class_id_reference="30" object_id="_201">
<inState>4</inState>
<outState>2</outState>
<condition>
<id>-1</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>0</count>
<item_version>0</item_version>
</item>
</sop>
</condition>
</item>
<item class_id_reference="30" object_id="_202">
<inState>2</inState>
<outState>5</outState>
<condition>
<id>-1</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>19</first>
<second>0</second>
</first>
<second>0</second>
</item>
</item>
</sop>
</condition>
</item>
<item class_id_reference="30" object_id="_203">
<inState>2</inState>
<outState>3</outState>
<condition>
<id>-1</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>19</first>
<second>0</second>
</first>
<second>1</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>36</count>
<item_version>0</item_version>
<item class_id="38" tracking_level="0" version="0">
<first>11</first>
<second class_id="39" 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>15</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>18</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>19</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>21</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>22</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>26</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>27</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>28</first>
<second>
<first>1</first>
<second>1</second>
</second>
</item>
<item>
<first>29</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>30</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>31</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>32</first>
<second>
<first>1</first>
<second>1</second>
</second>
</item>
<item>
<first>33</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>34</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>35</first>
<second>
<first>1</first>
<second>1</second>
</second>
</item>
<item>
<first>36</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>37</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>38</first>
<second>
<first>1</first>
<second>1</second>
</second>
</item>
<item>
<first>39</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>40</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>41</first>
<second>
<first>1</first>
<second>1</second>
</second>
</item>
<item>
<first>42</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>43</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>44</first>
<second>
<first>1</first>
<second>1</second>
</second>
</item>
<item>
<first>45</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>46</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>47</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>48</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>50</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>52</first>
<second>
<first>4</first>
<second>0</second>
</second>
</item>
<item>
<first>54</first>
<second>
<first>5</first>
<second>0</second>
</second>
</item>
<item>
<first>55</first>
<second>
<first>5</first>
<second>0</second>
</second>
</item>
</node_label_latency>
<bblk_ent_exit class_id="40" tracking_level="0" version="0">
<count>6</count>
<item_version>0</item_version>
<item class_id="41" tracking_level="0" version="0">
<first>14</first>
<second class_id="42" tracking_level="0" version="0">
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>17</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>23</first>
<second>
<first>1</first>
<second>1</second>
</second>
</item>
<item>
<first>51</first>
<second>
<first>1</first>
<second>3</second>
</second>
</item>
<item>
<first>53</first>
<second>
<first>2</first>
<second>2</second>
</second>
</item>
<item>
<first>56</first>
<second>
<first>3</first>
<second>3</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="_204">
<region_name>Loop 1</region_name>
<basic_blocks>
<count>2</count>
<item_version>0</item_version>
<item>23</item>
<item>51</item>
</basic_blocks>
<nodes>
<count>0</count>
<item_version>0</item_version>
</nodes>
<anchor_node>-1</anchor_node>
<region_type>8</region_type>
<interval>2</interval>
<pipe_depth>3</pipe_depth>
</item>
</regions>
<dp_fu_nodes class_id="45" tracking_level="0" version="0">
<count>30</count>
<item_version>0</item_version>
<item class_id="46" tracking_level="0" version="0">
<first>68</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>11</item>
</second>
</item>
<item>
<first>74</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>12</item>
</second>
</item>
<item>
<first>80</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>30</item>
</second>
</item>
<item>
<first>86</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>48</item>
</second>
</item>
<item>
<first>93</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>27</item>
</second>
</item>
<item>
<first>100</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>28</item>
<item>28</item>
</second>
</item>
<item>
<first>106</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>31</item>
</second>
</item>
<item>
<first>113</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>32</item>
<item>32</item>
</second>
</item>
<item>
<first>119</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>34</item>
</second>
</item>
<item>
<first>126</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>35</item>
<item>35</item>
</second>
</item>
<item>
<first>132</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>37</item>
</second>
</item>
<item>
<first>139</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>38</item>
<item>38</item>
</second>
</item>
<item>
<first>145</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>40</item>
</second>
</item>
<item>
<first>152</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>41</item>
<item>41</item>
</second>
</item>
<item>
<first>158</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>43</item>
</second>
</item>
<item>
<first>165</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>44</item>
<item>44</item>
</second>
</item>
<item>
<first>175</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>18</item>
</second>
</item>
<item>
<first>185</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>54</item>
</second>
</item>
<item>
<first>191</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>15</item>
</second>
</item>
<item>
<first>197</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>19</item>
</second>
</item>
<item>
<first>203</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>21</item>
</second>
</item>
<item>
<first>209</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>26</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>33</item>
</second>
</item>
<item>
<first>227</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>36</item>
</second>
</item>
<item>
<first>231</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>39</item>
</second>
</item>
<item>
<first>235</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>42</item>
</second>
</item>
<item>
<first>239</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>45</item>
</second>
</item>
<item>
<first>243</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>46</item>
</second>
</item>
<item>
<first>259</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>47</item>
</second>
</item>
</dp_fu_nodes>
<dp_fu_nodes_expression class_id="48" tracking_level="0" version="0">
<count>20</count>
<item_version>0</item_version>
<item class_id="49" tracking_level="0" version="0">
<first>add_ln221_fu_191</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>15</item>
</second>
</item>
<item>
<first>bitcast_ln224_fu_219</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>29</item>
</second>
</item>
<item>
<first>bitcast_ln225_fu_223</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>33</item>
</second>
</item>
<item>
<first>bitcast_ln226_fu_227</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>36</item>
</second>
</item>
<item>
<first>bitcast_ln227_fu_231</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>39</item>
</second>
</item>
<item>
<first>bitcast_ln228_fu_235</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>42</item>
</second>
</item>
<item>
<first>bitcast_ln229_fu_239</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>45</item>
</second>
</item>
<item>
<first>cofm_b5_addr1516_par_fu_259</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>47</item>
</second>
</item>
<item>
<first>cofm_counter_1_phi_fu_185</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>54</item>
</second>
</item>
<item>
<first>icmp_ln221_fu_197</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>19</item>
</second>
</item>
<item>
<first>j_0_phi_fu_175</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>18</item>
</second>
</item>
<item>
<first>j_fu_203</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>21</item>
</second>
</item>
<item>
<first>ofm_buff0_0_addr_gep_fu_93</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>27</item>
</second>
</item>
<item>
<first>ofm_buff0_1_addr_gep_fu_106</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>31</item>
</second>
</item>
<item>
<first>ofm_buff0_2_addr_gep_fu_119</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>34</item>
</second>
</item>
<item>
<first>ofm_buff0_3_addr_gep_fu_132</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>37</item>
</second>
</item>
<item>
<first>ofm_buff0_4_addr_gep_fu_145</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>40</item>
</second>
</item>
<item>
<first>ofm_buff0_5_addr_gep_fu_158</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>43</item>
</second>
</item>
<item>
<first>tmp_s_fu_243</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>46</item>
</second>
</item>
<item>
<first>zext_ln224_fu_209</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>26</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>4</count>
<item_version>0</item_version>
<item>
<first>cofm_counter_read_1_read_fu_74</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>12</item>
</second>
</item>
<item>
<first>cofm_read_read_fu_80</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>30</item>
</second>
</item>
<item>
<first>enable_read_read_fu_68</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>11</item>
</second>
</item>
<item>
<first>write_ln229_write_fu_86</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>48</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>6</count>
<item_version>0</item_version>
<item class_id="51" tracking_level="0" version="0">
<first class_id="52" tracking_level="0" version="0">
<first>ofm_buff0_0</first>
<second>0</second>
</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>28</item>
<item>28</item>
</second>
</item>
<item>
<first>
<first>ofm_buff0_1</first>
<second>0</second>
</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>32</item>
<item>32</item>
</second>
</item>
<item>
<first>
<first>ofm_buff0_2</first>
<second>0</second>
</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>35</item>
<item>35</item>
</second>
</item>
<item>
<first>
<first>ofm_buff0_3</first>
<second>0</second>
</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>38</item>
<item>38</item>
</second>
</item>
<item>
<first>
<first>ofm_buff0_4</first>
<second>0</second>
</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>41</item>
<item>41</item>
</second>
</item>
<item>
<first>
<first>ofm_buff0_5</first>
<second>0</second>
</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>44</item>
<item>44</item>
</second>
</item>
</dp_mem_port_nodes>
<dp_reg_nodes>
<count>14</count>
<item_version>0</item_version>
<item>
<first>171</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>18</item>
</second>
</item>
<item>
<first>182</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>54</item>
</second>
</item>
<item>
<first>271</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>11</item>
</second>
</item>
<item>
<first>275</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>12</item>
</second>
</item>
<item>
<first>280</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>15</item>
</second>
</item>
<item>
<first>285</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>19</item>
</second>
</item>
<item>
<first>289</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>21</item>
</second>
</item>
<item>
<first>294</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>27</item>
</second>
</item>
<item>
<first>299</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>31</item>
</second>
</item>
<item>
<first>304</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>34</item>
</second>
</item>
<item>
<first>309</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>37</item>
</second>
</item>
<item>
<first>314</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>40</item>
</second>
</item>
<item>
<first>319</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>43</item>
</second>
</item>
<item>
<first>324</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>47</item>
</second>
</item>
</dp_reg_nodes>
<dp_regname_nodes>
<count>14</count>
<item_version>0</item_version>
<item>
<first>add_ln221_reg_280</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>15</item>
</second>
</item>
<item>
<first>cofm_b5_addr1516_par_reg_324</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>47</item>
</second>
</item>
<item>
<first>cofm_counter_1_reg_182</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>54</item>
</second>
</item>
<item>
<first>cofm_counter_read_1_reg_275</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>12</item>
</second>
</item>
<item>
<first>enable_read_reg_271</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>11</item>
</second>
</item>
<item>
<first>icmp_ln221_reg_285</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>19</item>
</second>
</item>
<item>
<first>j_0_reg_171</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>18</item>
</second>
</item>
<item>
<first>j_reg_289</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>21</item>
</second>
</item>
<item>
<first>ofm_buff0_0_addr_reg_294</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>27</item>
</second>
</item>
<item>
<first>ofm_buff0_1_addr_reg_299</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>31</item>
</second>
</item>
<item>
<first>ofm_buff0_2_addr_reg_304</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>34</item>
</second>
</item>
<item>
<first>ofm_buff0_3_addr_reg_309</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>37</item>
</second>
</item>
<item>
<first>ofm_buff0_4_addr_reg_314</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>40</item>
</second>
</item>
<item>
<first>ofm_buff0_5_addr_reg_319</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>43</item>
</second>
</item>
</dp_regname_nodes>
<dp_reg_phi>
<count>2</count>
<item_version>0</item_version>
<item>
<first>171</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>18</item>
</second>
</item>
<item>
<first>182</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>54</item>
</second>
</item>
</dp_reg_phi>
<dp_regname_phi>
<count>2</count>
<item_version>0</item_version>
<item>
<first>cofm_counter_1_reg_182</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>54</item>
</second>
</item>
<item>
<first>j_0_reg_171</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>18</item>
</second>
</item>
</dp_regname_phi>
<dp_port_io_nodes class_id="53" tracking_level="0" version="0">
<count>9</count>
<item_version>0</item_version>
<item class_id="54" tracking_level="0" version="0">
<first>cofm</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>read</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>30</item>
</second>
</item>
<item>
<first>write</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>48</item>
</second>
</item>
</second>
</item>
<item>
<first>cofm_counter_read</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>enable</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>
<item>
<first>ofm_buff0_0(p0)</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>load</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>28</item>
<item>28</item>
</second>
</item>
</second>
</item>
<item>
<first>ofm_buff0_1(p0)</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>load</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>32</item>
<item>32</item>
</second>
</item>
</second>
</item>
<item>
<first>ofm_buff0_2(p0)</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>load</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>35</item>
<item>35</item>
</second>
</item>
</second>
</item>
<item>
<first>ofm_buff0_3(p0)</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>load</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>38</item>
<item>38</item>
</second>
</item>
</second>
</item>
<item>
<first>ofm_buff0_4(p0)</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>load</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>41</item>
<item>41</item>
</second>
</item>
</second>
</item>
<item>
<first>ofm_buff0_5(p0)</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>load</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>44</item>
<item>44</item>
</second>
</item>
</second>
</item>
</dp_port_io_nodes>
<port2core class_id="55" tracking_level="0" version="0">
<count>6</count>
<item_version>0</item_version>
<item class_id="56" tracking_level="0" version="0">
<first>2</first>
<second>RAM</second>
</item>
<item>
<first>3</first>
<second>RAM</second>
</item>
<item>
<first>4</first>
<second>RAM</second>
</item>
<item>
<first>5</first>
<second>RAM</second>
</item>
<item>
<first>6</first>
<second>RAM</second>
</item>
<item>
<first>7</first>
<second>RAM</second>
</item>
</port2core>
<node2core>
<count>0</count>
<item_version>0</item_version>
</node2core>
</syndb>
</boost_serialization>
| 25.264484 | 73 | 0.592606 |
0ef7f0be605e36ba672dbc1296ec4f35739e8e99 | 13,754 | ads | Ada | SVD2ada/svd/stm32_svd-gpio.ads | JCGobbi/Nucleo-STM32G474RE | 8dc1c4948ffeb11841eed10f1c3708f00fa1d832 | [
"BSD-3-Clause"
] | null | null | null | SVD2ada/svd/stm32_svd-gpio.ads | JCGobbi/Nucleo-STM32G474RE | 8dc1c4948ffeb11841eed10f1c3708f00fa1d832 | [
"BSD-3-Clause"
] | null | null | null | SVD2ada/svd/stm32_svd-gpio.ads | JCGobbi/Nucleo-STM32G474RE | 8dc1c4948ffeb11841eed10f1c3708f00fa1d832 | [
"BSD-3-Clause"
] | null | null | null | pragma Style_Checks (Off);
-- This spec has been automatically generated from STM32G474xx.svd
pragma Restrictions (No_Elaboration_Code);
with HAL;
with System;
package STM32_SVD.GPIO is
pragma Preelaborate;
---------------
-- Registers --
---------------
-- MODER array element
subtype MODER_Element is HAL.UInt2;
-- MODER array
type MODER_Field_Array is array (0 .. 15) of MODER_Element
with Component_Size => 2, Size => 32;
-- GPIO port mode register
type MODER_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MODER as a value
Val : HAL.UInt32;
when True =>
-- MODER as an array
Arr : MODER_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for MODER_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- OTYPER_OT array
type OTYPER_OT_Field_Array is array (0 .. 15) of Boolean
with Component_Size => 1, Size => 16;
-- Type definition for OTYPER_OT
type OTYPER_OT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- OT as a value
Val : HAL.UInt16;
when True =>
-- OT as an array
Arr : OTYPER_OT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 16;
for OTYPER_OT_Field use record
Val at 0 range 0 .. 15;
Arr at 0 range 0 .. 15;
end record;
-- GPIO port output type register
type OTYPER_Register is record
-- Port x configuration bits (y = 0..15)
OT : OTYPER_OT_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for OTYPER_Register use record
OT at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
-- OSPEEDR array element
subtype OSPEEDR_Element is HAL.UInt2;
-- OSPEEDR array
type OSPEEDR_Field_Array is array (0 .. 15) of OSPEEDR_Element
with Component_Size => 2, Size => 32;
-- GPIO port output speed register
type OSPEEDR_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- OSPEEDR as a value
Val : HAL.UInt32;
when True =>
-- OSPEEDR as an array
Arr : OSPEEDR_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for OSPEEDR_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- PUPDR array element
subtype PUPDR_Element is HAL.UInt2;
-- PUPDR array
type PUPDR_Field_Array is array (0 .. 15) of PUPDR_Element
with Component_Size => 2, Size => 32;
-- GPIO port pull-up/pull-down register
type PUPDR_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- PUPDR as a value
Val : HAL.UInt32;
when True =>
-- PUPDR as an array
Arr : PUPDR_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for PUPDR_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- IDR array
type IDR_Field_Array is array (0 .. 15) of Boolean
with Component_Size => 1, Size => 16;
-- Type definition for IDR
type IDR_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- IDR as a value
Val : HAL.UInt16;
when True =>
-- IDR as an array
Arr : IDR_Field_Array;
end case;
end record
with Unchecked_Union, Size => 16;
for IDR_Field use record
Val at 0 range 0 .. 15;
Arr at 0 range 0 .. 15;
end record;
-- GPIO port input data register
type IDR_Register is record
-- Read-only. Port input data (y = 0..15)
IDR : IDR_Field;
-- unspecified
Reserved_16_31 : HAL.UInt16;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for IDR_Register use record
IDR at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
-- ODR array
type ODR_Field_Array is array (0 .. 15) of Boolean
with Component_Size => 1, Size => 16;
-- Type definition for ODR
type ODR_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- ODR as a value
Val : HAL.UInt16;
when True =>
-- ODR as an array
Arr : ODR_Field_Array;
end case;
end record
with Unchecked_Union, Size => 16;
for ODR_Field use record
Val at 0 range 0 .. 15;
Arr at 0 range 0 .. 15;
end record;
-- GPIO port output data register
type ODR_Register is record
-- Port output data (y = 0..15)
ODR : ODR_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for ODR_Register use record
ODR at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
-- BSRR_BS array
type BSRR_BS_Field_Array is array (0 .. 15) of Boolean
with Component_Size => 1, Size => 16;
-- Type definition for BSRR_BS
type BSRR_BS_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- BS as a value
Val : HAL.UInt16;
when True =>
-- BS as an array
Arr : BSRR_BS_Field_Array;
end case;
end record
with Unchecked_Union, Size => 16;
for BSRR_BS_Field use record
Val at 0 range 0 .. 15;
Arr at 0 range 0 .. 15;
end record;
-- BSRR_BR array
type BSRR_BR_Field_Array is array (0 .. 15) of Boolean
with Component_Size => 1, Size => 16;
-- Type definition for BSRR_BR
type BSRR_BR_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- BR as a value
Val : HAL.UInt16;
when True =>
-- BR as an array
Arr : BSRR_BR_Field_Array;
end case;
end record
with Unchecked_Union, Size => 16;
for BSRR_BR_Field use record
Val at 0 range 0 .. 15;
Arr at 0 range 0 .. 15;
end record;
-- GPIO port bit set/reset register
type BSRR_Register is record
-- Write-only. Port x set bit y (y= 0..15)
BS : BSRR_BS_Field := (As_Array => False, Val => 16#0#);
-- Write-only. Port x set bit y (y= 0..15)
BR : BSRR_BR_Field := (As_Array => False, Val => 16#0#);
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for BSRR_Register use record
BS at 0 range 0 .. 15;
BR at 0 range 16 .. 31;
end record;
-- LCKR_LCK array
type LCKR_LCK_Field_Array is array (0 .. 15) of Boolean
with Component_Size => 1, Size => 16;
-- Type definition for LCKR_LCK
type LCKR_LCK_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- LCK as a value
Val : HAL.UInt16;
when True =>
-- LCK as an array
Arr : LCKR_LCK_Field_Array;
end case;
end record
with Unchecked_Union, Size => 16;
for LCKR_LCK_Field use record
Val at 0 range 0 .. 15;
Arr at 0 range 0 .. 15;
end record;
-- GPIO port configuration lock register
type LCKR_Register is record
-- Port x lock bit y (y= 0..15)
LCK : LCKR_LCK_Field := (As_Array => False, Val => 16#0#);
-- Port x lock bit y (y= 0..15)
LCKK : Boolean := False;
-- unspecified
Reserved_17_31 : HAL.UInt15 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for LCKR_Register use record
LCK at 0 range 0 .. 15;
LCKK at 0 range 16 .. 16;
Reserved_17_31 at 0 range 17 .. 31;
end record;
-- AFRL array element
subtype AFRL_Element is HAL.UInt4;
-- AFRL array
type AFRL_Field_Array is array (0 .. 7) of AFRL_Element
with Component_Size => 4, Size => 32;
-- GPIO alternate function low register
type AFRL_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- AFRL as a value
Val : HAL.UInt32;
when True =>
-- AFRL as an array
Arr : AFRL_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for AFRL_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- AFRH array element
subtype AFRH_Element is HAL.UInt4;
-- AFRH array
type AFRH_Field_Array is array (8 .. 15) of AFRH_Element
with Component_Size => 4, Size => 32;
-- GPIO alternate function high register
type AFRH_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- AFRH as a value
Val : HAL.UInt32;
when True =>
-- AFRH as an array
Arr : AFRH_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for AFRH_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- BRR_BR array
type BRR_BR_Field_Array is array (0 .. 15) of Boolean
with Component_Size => 1, Size => 16;
-- Type definition for BRR_BR
type BRR_BR_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- BR as a value
Val : HAL.UInt16;
when True =>
-- BR as an array
Arr : BRR_BR_Field_Array;
end case;
end record
with Unchecked_Union, Size => 16;
for BRR_BR_Field use record
Val at 0 range 0 .. 15;
Arr at 0 range 0 .. 15;
end record;
-- GPIO port bit reset register
type BRR_Register is record
-- Write-only. Port Reset bit
BR : BRR_BR_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for BRR_Register use record
BR at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
-----------------
-- Peripherals --
-----------------
-- General-purpose I/Os
type GPIO_Peripheral is record
-- GPIO port mode register
MODER : aliased MODER_Register;
-- GPIO port output type register
OTYPER : aliased OTYPER_Register;
-- GPIO port output speed register
OSPEEDR : aliased OSPEEDR_Register;
-- GPIO port pull-up/pull-down register
PUPDR : aliased PUPDR_Register;
-- GPIO port input data register
IDR : aliased IDR_Register;
-- GPIO port output data register
ODR : aliased ODR_Register;
-- GPIO port bit set/reset register
BSRR : aliased BSRR_Register;
-- GPIO port configuration lock register
LCKR : aliased LCKR_Register;
-- GPIO alternate function low register
AFRL : aliased AFRL_Register;
-- GPIO alternate function high register
AFRH : aliased AFRH_Register;
-- GPIO port bit reset register
BRR : aliased BRR_Register;
end record
with Volatile;
for GPIO_Peripheral use record
MODER at 16#0# range 0 .. 31;
OTYPER at 16#4# range 0 .. 31;
OSPEEDR at 16#8# range 0 .. 31;
PUPDR at 16#C# range 0 .. 31;
IDR at 16#10# range 0 .. 31;
ODR at 16#14# range 0 .. 31;
BSRR at 16#18# range 0 .. 31;
LCKR at 16#1C# range 0 .. 31;
AFRL at 16#20# range 0 .. 31;
AFRH at 16#24# range 0 .. 31;
BRR at 16#28# range 0 .. 31;
end record;
-- General-purpose I/Os
GPIOA_Periph : aliased GPIO_Peripheral
with Import, Address => GPIOA_Base;
-- General-purpose I/Os
GPIOB_Periph : aliased GPIO_Peripheral
with Import, Address => GPIOB_Base;
-- General-purpose I/Os
GPIOC_Periph : aliased GPIO_Peripheral
with Import, Address => GPIOC_Base;
-- General-purpose I/Os
GPIOD_Periph : aliased GPIO_Peripheral
with Import, Address => GPIOD_Base;
-- General-purpose I/Os
GPIOE_Periph : aliased GPIO_Peripheral
with Import, Address => GPIOE_Base;
-- General-purpose I/Os
GPIOF_Periph : aliased GPIO_Peripheral
with Import, Address => GPIOF_Base;
-- General-purpose I/Os
GPIOG_Periph : aliased GPIO_Peripheral
with Import, Address => GPIOG_Base;
end STM32_SVD.GPIO;
| 27.955285 | 79 | 0.585212 |
dc988d65218b1a9873c94e3adda84ca329b738b7 | 2,714 | ads | Ada | examples/shared/common/lch_full/last_chance_handler.ads | shakram02/Ada_Drivers_Library | a407ca7ddbc2d9756647016c2f8fd8ef24a239ff | [
"BSD-3-Clause"
] | 192 | 2016-06-01T18:32:04.000Z | 2022-03-26T22:52:31.000Z | examples/shared/common/lch_full/last_chance_handler.ads | morbos/Ada_Drivers_Library | a4ab26799be60997c38735f4056160c4af597ef7 | [
"BSD-3-Clause"
] | 239 | 2016-05-26T20:02:01.000Z | 2022-03-31T09:46:56.000Z | examples/shared/common/lch_full/last_chance_handler.ads | morbos/Ada_Drivers_Library | a4ab26799be60997c38735f4056160c4af597ef7 | [
"BSD-3-Clause"
] | 142 | 2016-06-05T08:12:20.000Z | 2022-03-24T17:37:17.000Z | ------------------------------------------------------------------------------
-- --
-- Copyright (C) 2015, AdaCore --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- 2. Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- 3. Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- This version is for use with the ravenscar-full runtime.
with Ada.Exceptions; use Ada.Exceptions;
package Last_Chance_Handler is
procedure Last_Chance_Handler (Error : Exception_Occurrence);
pragma Export (C, Last_Chance_Handler, "__gnat_last_chance_handler");
pragma No_Return (Last_Chance_Handler);
end Last_Chance_Handler;
| 63.116279 | 78 | 0.539794 |
cba242c2cfaec21b84769de0b9516908772164ab | 3,814 | ads | Ada | rts/gcc-9/adainclude/a-except.ads | letsbyteit/build-avr-ada-toolchain | 7c5dddbc69e6e2df8c30971417dc50d2f2b29794 | [
"MIT"
] | 7 | 2019-09-17T20:54:13.000Z | 2021-12-20T04:31:40.000Z | rts/gcc-9/adainclude/a-except.ads | letsbyteit/build-avr-ada-toolchain | 7c5dddbc69e6e2df8c30971417dc50d2f2b29794 | [
"MIT"
] | 6 | 2019-05-08T14:20:48.000Z | 2022-01-20T18:58:30.000Z | rts/gcc-9/adainclude/a-except.ads | letsbyteit/build-avr-ada-toolchain | 7c5dddbc69e6e2df8c30971417dc50d2f2b29794 | [
"MIT"
] | 8 | 2019-07-09T09:18:51.000Z | 2022-01-15T20:28:50.000Z | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- A D A . E X C E P T I O N S --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2011, Free Software Foundation, Inc. --
-- Copyright (C) 2012, Rolf Ebert --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
-- apply solely to the contents of the part following the private keyword. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This version of Ada.Exceptions is a simplified version for use in
-- AVR-Ada. It supports simplified exception handling without
-- exception propagation, i.e. restriction No_Exception_Propagation
-- is set.
--
-- You also have to define __gnat_last_chance_handler somewhere in
-- your code as the typical binder generated last-chance-handler is
-- stripped in AVR-Ada.
with System;
package Ada.Exceptions is
pragma Preelaborate;
type Exception_Id is private;
pragma Preelaborable_Initialization (Exception_Id);
Null_Id : constant Exception_Id;
procedure Raise_Exception (E : Exception_Id; Message : String := "");
pragma No_Return (Raise_Exception);
-- will always call __gnat_last_chance_handler. The Message
-- string should be null terminated for easier debugging.
private
------------------
-- Exception_Id --
------------------
type Exception_Id is access all System.Address;
Null_Id : constant Exception_Id := null;
pragma Inline_Always (Raise_Exception);
end Ada.Exceptions;
| 52.246575 | 78 | 0.477976 |
c52f90d60fcabfbc0e84ffacd9d2c53a988a429e | 4,457 | adb | Ada | examples/shared/hello_world_blinky/src/blinky.adb | morbos/Ada_Drivers_Library | a4ab26799be60997c38735f4056160c4af597ef7 | [
"BSD-3-Clause"
] | 2 | 2018-05-16T03:56:39.000Z | 2019-07-31T13:53:56.000Z | examples/shared/hello_world_blinky/src/blinky.adb | morbos/Ada_Drivers_Library | a4ab26799be60997c38735f4056160c4af597ef7 | [
"BSD-3-Clause"
] | null | null | null | examples/shared/hello_world_blinky/src/blinky.adb | morbos/Ada_Drivers_Library | a4ab26799be60997c38735f4056160c4af597ef7 | [
"BSD-3-Clause"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- 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 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. --
-- --
------------------------------------------------------------------------------
-- A simple example that blinks all the LEDs simultaneously, w/o tasking.
-- It does not use the various convenience functions defined elsewhere, but
-- instead works directly with the GPIO driver to configure and control the
-- LEDs.
-- Note that this code is independent of the specific MCU device and board
-- in use because we use names and constants that are common across all of
-- them. For example, "All_LEDs" refers to different GPIO pins on different
-- boards, and indeed defines a different number of LEDs on different boards.
-- The gpr file determines which board is actually used.
with Last_Chance_Handler; pragma Unreferenced (Last_Chance_Handler);
-- The "last chance handler" is the user-defined routine that is called when
-- an exception is propagated. We need it in the executable, therefore it
-- must be somewhere in the closure of the context clauses.
with STM32.Device; use STM32.Device;
with STM32.Board; use STM32.Board;
with STM32.GPIO; use STM32.GPIO;
with Ada.Real_Time; use Ada.Real_Time;
procedure Blinky is
Period : constant Time_Span := Milliseconds (200); -- arbitrary
Next_Release : Time := Clock;
procedure Initialize_LEDs;
-- Enables the clock and configures the GPIO pins and port connected to the
-- LEDs on the target board so that we can drive them via GPIO commands.
-- Note that the STM32.Board package provides a procedure (with the same
-- name) to do this directly, for convenience, but we do not use it here
-- for the sake of illustration.
procedure Initialize_LEDs is
Configuration : GPIO_Port_Configuration;
begin
Enable_Clock (All_LEDs);
Configuration.Mode := Mode_Out;
Configuration.Output_Type := Push_Pull;
Configuration.Speed := Speed_100MHz;
Configuration.Resistors := Floating;
Configure_IO (All_LEDs, Configuration);
end Initialize_LEDs;
begin
Initialize_LEDs;
loop
Toggle (All_LEDs);
Next_Release := Next_Release + Period;
delay until Next_Release;
end loop;
end Blinky;
| 50.078652 | 79 | 0.608481 |
dc40a9d262e4c61c4fee1633103264bd67e6e4a9 | 3,602 | ads | Ada | source/amf/uml/amf-uml-interfaces-hash.ads | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 24 | 2016-11-29T06:59:41.000Z | 2021-08-30T11:55:16.000Z | source/amf/uml/amf-uml-interfaces-hash.ads | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 2 | 2019-01-16T05:15:20.000Z | 2019-02-03T10:03:32.000Z | source/amf/uml/amf-uml-interfaces-hash.ads | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 4 | 2017-07-18T07:11:05.000Z | 2020-06-21T03:02:25.000Z | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, Vadim Godunko <[email protected]> --
-- 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.UML.Interfaces.Hash is
new AMF.Elements.Generic_Hash (UML_Interface, UML_Interface_Access);
| 72.04 | 78 | 0.400888 |
d0aadedc75be312b3fe478e1d135292be3fe0b27 | 3,864 | adb | Ada | source/league/league-json-streams-boolean_stream_operations.adb | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 24 | 2016-11-29T06:59:41.000Z | 2021-08-30T11:55:16.000Z | source/league/league-json-streams-boolean_stream_operations.adb | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 2 | 2019-01-16T05:15:20.000Z | 2019-02-03T10:03:32.000Z | source/league/league-json-streams-boolean_stream_operations.adb | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 4 | 2017-07-18T07:11:05.000Z | 2020-06-21T03:02:25.000Z | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Localization, Internationalization, Globalization for Ada --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
package body League.JSON.Streams.Boolean_Stream_Operations is
----------
-- Read --
----------
procedure Read
(Stream : in out JSON_Stream'Class;
Item : out Boolean) is
begin
Item := Stream.Read.To_Boolean;
end Read;
-----------
-- Write --
-----------
procedure Write
(Stream : in out JSON_Stream'Class;
Item : Boolean) is
begin
Stream.Write (League.JSON.Values.To_JSON_Value (Item));
end Write;
end League.JSON.Streams.Boolean_Stream_Operations;
| 55.2 | 78 | 0.423913 |
dcf511f064e9df51406c14b29b56c7860a117531 | 360 | ads | Ada | src/regex.ads | skordal/ada-regex | cda71d076184f9dc607c132343b60678b8dc2ec8 | [
"MIT"
] | 2 | 2020-04-15T06:02:06.000Z | 2021-05-12T23:09:18.000Z | src/regex.ads | skordal/ada-regex | cda71d076184f9dc607c132343b60678b8dc2ec8 | [
"MIT"
] | null | null | null | src/regex.ads | skordal/ada-regex | cda71d076184f9dc607c132343b60678b8dc2ec8 | [
"MIT"
] | null | null | null | -- Ada regular expression library
-- (c) Kristian Klomsten Skordal 2020 <[email protected]>
-- Report bugs and issues on <https://github.com/skordal/ada-regex>
package Regex is
pragma Pure;
-- Main package for the regular expression library.
-- Include Regex.Regular_Expressions to get the main library functionality.
end Regex;
| 30 | 79 | 0.747222 |
0ed69372d42d10567c3b18a1b7fcc64b16c56a2f | 1,573 | adb | Ada | example/avr/src/avr_blink_led_e.adb | martinmoene/kalman-estimator-ada | ab70f54d67966773388b5ad1b233f0927601d5b6 | [
"BSL-1.0"
] | 2 | 2019-09-26T20:54:57.000Z | 2019-09-27T11:57:11.000Z | example/avr/src/avr_blink_led_e.adb | martinmoene/kalman-estimator-ada | ab70f54d67966773388b5ad1b233f0927601d5b6 | [
"BSL-1.0"
] | null | null | null | example/avr/src/avr_blink_led_e.adb | martinmoene/kalman-estimator-ada | ab70f54d67966773388b5ad1b233f0927601d5b6 | [
"BSL-1.0"
] | null | null | null | -- Copyright 2019 by Martin Moene
--
-- https://github.com/martinmoene/kalman-estimator-ada
--
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
with system.machine_code; use system.machine_code;
with interfaces; use interfaces;
with system;
procedure avr_blink_led_e is
led_ddr : unsigned_8;
led_port : unsigned_8;
led_pin : constant := 5;
-- led_msk : constant := 2#0010_0000#;
led_ms : constant := 200;
for led_port'address use system'to_address ( 16#25# );
for led_ddr'address use system'to_address ( 16#24# );
function bitmask( pin : in natural ) return unsigned_8 is
begin
return shift_left( 1, pin );
end bitmask;
procedure delay_ms( ms : in natural ) is
f_cpu_hz : constant := 12_000_000;
ms_count : constant := f_cpu_hz / ( 7 * 1000 );
begin
for i in 1 .. ms loop
for k in 1 .. ms_count loop
asm ("nop", volatile => true );
end loop;
end loop;
end delay_ms;
procedure blink_ms( n : in natural; ms : in natural ) is
begin
for i in 1 .. n loop
led_port := led_port xor bitmask ( led_pin );
delay_ms( ms );
end loop;
end blink_ms;
begin
led_port := 2#1111_1111#;
led_ddr := led_ddr or bitmask( led_pin );
--blink_ms( 7, led_ms );
loop
delay_ms( led_ms );
led_port := led_port xor bitmask( led_pin );
end loop;
end avr_blink_led_e;
| 27.596491 | 86 | 0.616656 |
20858f8b4150712bddacb5ebc41dcd6cb730f654 | 369 | ads | Ada | arch/ARM/STM32/driversL5/stm32-sau.ads | morbos/Ada_Drivers_Library | a4ab26799be60997c38735f4056160c4af597ef7 | [
"BSD-3-Clause"
] | 2 | 2018-05-16T03:56:39.000Z | 2019-07-31T13:53:56.000Z | arch/ARM/STM32/driversL5/stm32-sau.ads | morbos/Ada_Drivers_Library | a4ab26799be60997c38735f4056160c4af597ef7 | [
"BSD-3-Clause"
] | null | null | null | arch/ARM/STM32/driversL5/stm32-sau.ads | morbos/Ada_Drivers_Library | a4ab26799be60997c38735f4056160c4af597ef7 | [
"BSD-3-Clause"
] | null | null | null | with System;
with STM32_SVD.SAU; use STM32_SVD.SAU;
package STM32.SAU is
type SAU_Regions is range 0 .. 7;
procedure Add_Region (Region_Num : SAU_Regions;
Addr : UInt32;
Size : UInt32;
NSC : Boolean);
procedure Enable_SAU;
procedure All_NS;
end STM32.SAU;
| 19.421053 | 50 | 0.533875 |
c53a09459c02a2773aed26949625813688f4fb5e | 1,818 | ads | Ada | 3-mid/opengl/source/lean/model/opengl-model-hexagon_column-lit_colored_textured_rounded.ads | charlie5/lace-alire | 9ace9682cf4daac7adb9f980c2868d6225b8111c | [
"0BSD"
] | 1 | 2022-01-20T07:13:42.000Z | 2022-01-20T07:13:42.000Z | 3-mid/opengl/source/lean/model/opengl-model-hexagon_column-lit_colored_textured_rounded.ads | charlie5/lace-alire | 9ace9682cf4daac7adb9f980c2868d6225b8111c | [
"0BSD"
] | null | null | null | 3-mid/opengl/source/lean/model/opengl-model-hexagon_column-lit_colored_textured_rounded.ads | charlie5/lace-alire | 9ace9682cf4daac7adb9f980c2868d6225b8111c | [
"0BSD"
] | null | null | null | with
openGL.Geometry,
openGL.Texture;
package openGL.Model.hexagon_Column.lit_colored_textured_rounded
--
-- Models a lit, colored and textured column with six rounded sides.
--
-- The shaft of the column appears rounded, whereas the top and bottom appear as hexagons.
--
is
type Item is new Model.hexagon_Column.item with private;
type View is access all Item'Class;
---------
--- Faces
--
type hex_Face is
record
center_Color : lucid_Color; -- The color of the center of the hex.
Colors : lucid_Colors (1 .. 6); -- The color of each of the faces 4 vertices.
Texture : asset_Name := null_Asset; -- The texture to be applied to the face.
end record;
type shaft_Face is
record
Color : lucid_Color; -- The color of the shaft.
Texture : asset_Name := openGL.null_Asset; -- The texture to be applied to the shaft.
end record;
---------
--- Forge
--
function new_hexagon_Column (Radius : in Real;
Height : in Real;
Upper,
Lower : in hex_Face;
Shaft : in shaft_Face) return View;
--------------
--- Attributes
--
overriding
function to_GL_Geometries (Self : access Item; Textures : access Texture.name_Map_of_texture'Class;
Fonts : in Font.font_id_Map_of_font) return Geometry.views;
private
type Item is new Model.hexagon_Column.item with
record
upper_Face,
lower_Face : hex_Face;
Shaft : shaft_Face;
end record;
end openGL.Model.hexagon_Column.lit_colored_textured_rounded;
| 27.969231 | 118 | 0.566557 |
2053dd5962c6b3e099cd7e52ef8aa2d613e87571 | 4,785 | ads | Ada | bb-runtimes/runtimes/ravenscar-full-stm32f3x4/gnat/g-except.ads | JCGobbi/Nucleo-STM32F334R8 | 2a0b1b4b2664c92773703ac5e95dcb71979d051c | [
"BSD-3-Clause"
] | null | null | null | bb-runtimes/runtimes/ravenscar-full-stm32f3x4/gnat/g-except.ads | JCGobbi/Nucleo-STM32F334R8 | 2a0b1b4b2664c92773703ac5e95dcb71979d051c | [
"BSD-3-Clause"
] | null | null | null | bb-runtimes/runtimes/ravenscar-full-stm32f3x4/gnat/g-except.ads | JCGobbi/Nucleo-STM32F334R8 | 2a0b1b4b2664c92773703ac5e95dcb71979d051c | [
"BSD-3-Clause"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- G N A T . E X C E P T I O N S --
-- --
-- S p e c --
-- --
-- Copyright (C) 2000-2021, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- --
-- --
-- --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package provides an interface for raising predefined exceptions
-- with an exception message. It can be used from Pure units.
-- There is no prohibition in Ada that prevents exceptions being raised
-- from within pure units. The raise statement is perfectly acceptable.
-- However, it is not normally possible to raise an exception with a
-- message because the routine Ada.Exceptions.Raise_Exception is not in
-- a Pure unit. This is an annoying and unnecessary restriction and this
-- package allows for raising the standard predefined exceptions at least.
package GNAT.Exceptions is
pragma Pure;
type Exception_Type is limited null record;
-- Type used to specify which exception to raise
-- Really Exception_Type is Exception_Id, but Exception_Id can't be
-- used directly since it is declared in the non-pure unit Ada.Exceptions,
-- Exception_Id is in fact simply a pointer to the type Exception_Data
-- declared in System.Standard_Library (which is also non-pure). So what
-- we do is to define it here as a by reference type (any by reference
-- type would do), and then Import the definitions from Standard_Library.
-- Since this is a by reference type, these will be passed by reference,
-- which has the same effect as passing a pointer.
-- This type is not private because keeping it by reference would require
-- defining it in a way (e.g. using a tagged type) that would drag in other
-- run-time files, which is unwanted in the case of e.g. Ravenscar where we
-- want to minimize the number of run-time files needed by default.
CE : constant Exception_Type; -- Constraint_Error
PE : constant Exception_Type; -- Program_Error
SE : constant Exception_Type; -- Storage_Error
TE : constant Exception_Type; -- Tasking_Error
-- One of these constants is used in the call to specify the exception
procedure Raise_Exception (E : Exception_Type; Message : String);
pragma Import (Ada, Raise_Exception, "__gnat_raise_exception");
pragma No_Return (Raise_Exception);
-- Raise specified exception with specified message
private
pragma Import (C, CE, "constraint_error");
pragma Import (C, PE, "program_error");
pragma Import (C, SE, "storage_error");
pragma Import (C, TE, "tasking_error");
-- References to the exception structures in the standard library
end GNAT.Exceptions;
| 57.650602 | 79 | 0.515361 |
4a73defb02b312b6a4a9b12da1a652dea94c1dd9 | 39,353 | ads | Ada | SVD2ada/svd/stm32_svd-exti.ads | JCGobbi/Nucleo-STM32H743ZI | bb0b5a66e9ac8b3dbe381f9909df5ed5d77dad1c | [
"BSD-3-Clause"
] | null | null | null | SVD2ada/svd/stm32_svd-exti.ads | JCGobbi/Nucleo-STM32H743ZI | bb0b5a66e9ac8b3dbe381f9909df5ed5d77dad1c | [
"BSD-3-Clause"
] | null | null | null | SVD2ada/svd/stm32_svd-exti.ads | JCGobbi/Nucleo-STM32H743ZI | bb0b5a66e9ac8b3dbe381f9909df5ed5d77dad1c | [
"BSD-3-Clause"
] | null | null | null | pragma Style_Checks (Off);
-- This spec has been automatically generated from STM32H743x.svd
pragma Restrictions (No_Elaboration_Code);
with HAL;
with System;
package STM32_SVD.EXTI is
pragma Preelaborate;
---------------
-- Registers --
---------------
-- RTSR1_TR array
type RTSR1_TR_Field_Array is array (0 .. 21) of Boolean
with Component_Size => 1, Size => 22;
-- Type definition for RTSR1_TR
type RTSR1_TR_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TR as a value
Val : HAL.UInt22;
when True =>
-- TR as an array
Arr : RTSR1_TR_Field_Array;
end case;
end record
with Unchecked_Union, Size => 22;
for RTSR1_TR_Field use record
Val at 0 range 0 .. 21;
Arr at 0 range 0 .. 21;
end record;
-- EXTI rising trigger selection register
type RTSR1_Register is record
-- Rising trigger event configuration bit of Configurable Event input
TR : RTSR1_TR_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_22_31 : HAL.UInt10 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for RTSR1_Register use record
TR at 0 range 0 .. 21;
Reserved_22_31 at 0 range 22 .. 31;
end record;
-- FTSR1_TR array
type FTSR1_TR_Field_Array is array (0 .. 21) of Boolean
with Component_Size => 1, Size => 22;
-- Type definition for FTSR1_TR
type FTSR1_TR_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TR as a value
Val : HAL.UInt22;
when True =>
-- TR as an array
Arr : FTSR1_TR_Field_Array;
end case;
end record
with Unchecked_Union, Size => 22;
for FTSR1_TR_Field use record
Val at 0 range 0 .. 21;
Arr at 0 range 0 .. 21;
end record;
-- EXTI falling trigger selection register
type FTSR1_Register is record
-- Rising trigger event configuration bit of Configurable Event input
TR : FTSR1_TR_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_22_31 : HAL.UInt10 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for FTSR1_Register use record
TR at 0 range 0 .. 21;
Reserved_22_31 at 0 range 22 .. 31;
end record;
-- SWIER1_SWIER array
type SWIER1_SWIER_Field_Array is array (0 .. 21) of Boolean
with Component_Size => 1, Size => 22;
-- Type definition for SWIER1_SWIER
type SWIER1_SWIER_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- SWIER as a value
Val : HAL.UInt22;
when True =>
-- SWIER as an array
Arr : SWIER1_SWIER_Field_Array;
end case;
end record
with Unchecked_Union, Size => 22;
for SWIER1_SWIER_Field use record
Val at 0 range 0 .. 21;
Arr at 0 range 0 .. 21;
end record;
-- EXTI software interrupt event register
type SWIER1_Register is record
-- Rising trigger event configuration bit of Configurable Event input
SWIER : SWIER1_SWIER_Field :=
(As_Array => False, Val => 16#0#);
-- unspecified
Reserved_22_31 : HAL.UInt10 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for SWIER1_Register use record
SWIER at 0 range 0 .. 21;
Reserved_22_31 at 0 range 22 .. 31;
end record;
-- D3PMR1_MR array
type D3PMR1_MR_Field_Array is array (0 .. 15) of Boolean
with Component_Size => 1, Size => 16;
-- Type definition for D3PMR1_MR
type D3PMR1_MR_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MR as a value
Val : HAL.UInt16;
when True =>
-- MR as an array
Arr : D3PMR1_MR_Field_Array;
end case;
end record
with Unchecked_Union, Size => 16;
for D3PMR1_MR_Field use record
Val at 0 range 0 .. 15;
Arr at 0 range 0 .. 15;
end record;
-- D3PMR1_MR array
type D3PMR1_MR_Field_Array_1 is array (19 .. 21) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for D3PMR1_MR
type D3PMR1_MR_Field_1
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MR as a value
Val : HAL.UInt3;
when True =>
-- MR as an array
Arr : D3PMR1_MR_Field_Array_1;
end case;
end record
with Unchecked_Union, Size => 3;
for D3PMR1_MR_Field_1 use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- EXTI D3 pending mask register
type D3PMR1_Register is record
-- Rising trigger event configuration bit of Configurable Event input
MR : D3PMR1_MR_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_16_18 : HAL.UInt3 := 16#0#;
-- Rising trigger event configuration bit of Configurable Event input
MR_1 : D3PMR1_MR_Field_1 := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_22_24 : HAL.UInt3 := 16#0#;
-- Rising trigger event configuration bit of Configurable Event input
MR25 : Boolean := False;
-- unspecified
Reserved_26_31 : HAL.UInt6 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for D3PMR1_Register use record
MR at 0 range 0 .. 15;
Reserved_16_18 at 0 range 16 .. 18;
MR_1 at 0 range 19 .. 21;
Reserved_22_24 at 0 range 22 .. 24;
MR25 at 0 range 25 .. 25;
Reserved_26_31 at 0 range 26 .. 31;
end record;
-- D3PCR1L_PCS array element
subtype D3PCR1L_PCS_Element is HAL.UInt2;
-- D3PCR1L_PCS array
type D3PCR1L_PCS_Field_Array is array (0 .. 15) of D3PCR1L_PCS_Element
with Component_Size => 2, Size => 32;
-- EXTI D3 pending clear selection register low
type D3PCR1L_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- PCS as a value
Val : HAL.UInt32;
when True =>
-- PCS as an array
Arr : D3PCR1L_PCS_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for D3PCR1L_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- D3PCR1H_PCS array element
subtype D3PCR1H_PCS_Element is HAL.UInt2;
-- D3PCR1H_PCS array
type D3PCR1H_PCS_Field_Array is array (19 .. 21) of D3PCR1H_PCS_Element
with Component_Size => 2, Size => 6;
-- Type definition for D3PCR1H_PCS
type D3PCR1H_PCS_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- PCS as a value
Val : HAL.UInt6;
when True =>
-- PCS as an array
Arr : D3PCR1H_PCS_Field_Array;
end case;
end record
with Unchecked_Union, Size => 6;
for D3PCR1H_PCS_Field use record
Val at 0 range 0 .. 5;
Arr at 0 range 0 .. 5;
end record;
subtype D3PCR1H_PCS25_Field is HAL.UInt2;
-- EXTI D3 pending clear selection register high
type D3PCR1H_Register is record
-- unspecified
Reserved_0_5 : HAL.UInt6 := 16#0#;
-- D3 Pending request clear input signal selection on Event input x =
-- truncate ((n+32)/2)
PCS : D3PCR1H_PCS_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_12_17 : HAL.UInt6 := 16#0#;
-- D3 Pending request clear input signal selection on Event input x =
-- truncate ((n+32)/2)
PCS25 : D3PCR1H_PCS25_Field := 16#0#;
-- unspecified
Reserved_20_31 : HAL.UInt12 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for D3PCR1H_Register use record
Reserved_0_5 at 0 range 0 .. 5;
PCS at 0 range 6 .. 11;
Reserved_12_17 at 0 range 12 .. 17;
PCS25 at 0 range 18 .. 19;
Reserved_20_31 at 0 range 20 .. 31;
end record;
-- EXTI rising trigger selection register
type RTSR2_Register is record
-- unspecified
Reserved_0_16 : HAL.UInt17 := 16#0#;
-- Rising trigger event configuration bit of Configurable Event input
-- x+32
TR49 : Boolean := False;
-- unspecified
Reserved_18_18 : HAL.Bit := 16#0#;
-- Rising trigger event configuration bit of Configurable Event input
-- x+32
TR51 : Boolean := False;
-- unspecified
Reserved_20_31 : HAL.UInt12 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for RTSR2_Register use record
Reserved_0_16 at 0 range 0 .. 16;
TR49 at 0 range 17 .. 17;
Reserved_18_18 at 0 range 18 .. 18;
TR51 at 0 range 19 .. 19;
Reserved_20_31 at 0 range 20 .. 31;
end record;
-- EXTI falling trigger selection register
type FTSR2_Register is record
-- unspecified
Reserved_0_16 : HAL.UInt17 := 16#0#;
-- Falling trigger event configuration bit of Configurable Event input
-- x+32
TR49 : Boolean := False;
-- unspecified
Reserved_18_18 : HAL.Bit := 16#0#;
-- Falling trigger event configuration bit of Configurable Event input
-- x+32
TR51 : Boolean := False;
-- unspecified
Reserved_20_31 : HAL.UInt12 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for FTSR2_Register use record
Reserved_0_16 at 0 range 0 .. 16;
TR49 at 0 range 17 .. 17;
Reserved_18_18 at 0 range 18 .. 18;
TR51 at 0 range 19 .. 19;
Reserved_20_31 at 0 range 20 .. 31;
end record;
-- EXTI software interrupt event register
type SWIER2_Register is record
-- unspecified
Reserved_0_16 : HAL.UInt17 := 16#0#;
-- Software interrupt on line x+32
SWIER49 : Boolean := False;
-- unspecified
Reserved_18_18 : HAL.Bit := 16#0#;
-- Software interrupt on line x+32
SWIER51 : Boolean := False;
-- unspecified
Reserved_20_31 : HAL.UInt12 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for SWIER2_Register use record
Reserved_0_16 at 0 range 0 .. 16;
SWIER49 at 0 range 17 .. 17;
Reserved_18_18 at 0 range 18 .. 18;
SWIER51 at 0 range 19 .. 19;
Reserved_20_31 at 0 range 20 .. 31;
end record;
-- D3PMR2_MR array
type D3PMR2_MR_Field_Array is array (34 .. 35) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for D3PMR2_MR
type D3PMR2_MR_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MR as a value
Val : HAL.UInt2;
when True =>
-- MR as an array
Arr : D3PMR2_MR_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for D3PMR2_MR_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- D3PMR2_MR array
type D3PMR2_MR_Field_Array_1 is array (48 .. 53) of Boolean
with Component_Size => 1, Size => 6;
-- Type definition for D3PMR2_MR
type D3PMR2_MR_Field_1
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MR as a value
Val : HAL.UInt6;
when True =>
-- MR as an array
Arr : D3PMR2_MR_Field_Array_1;
end case;
end record
with Unchecked_Union, Size => 6;
for D3PMR2_MR_Field_1 use record
Val at 0 range 0 .. 5;
Arr at 0 range 0 .. 5;
end record;
-- EXTI D3 pending mask register
type D3PMR2_Register is record
-- unspecified
Reserved_0_1 : HAL.UInt2 := 16#0#;
-- D3 Pending Mask on Event input x+32
MR : D3PMR2_MR_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_4_8 : HAL.UInt5 := 16#0#;
-- D3 Pending Mask on Event input x+32
MR41 : Boolean := False;
-- unspecified
Reserved_10_15 : HAL.UInt6 := 16#0#;
-- D3 Pending Mask on Event input x+32
MR_1 : D3PMR2_MR_Field_1 := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_22_31 : HAL.UInt10 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for D3PMR2_Register use record
Reserved_0_1 at 0 range 0 .. 1;
MR at 0 range 2 .. 3;
Reserved_4_8 at 0 range 4 .. 8;
MR41 at 0 range 9 .. 9;
Reserved_10_15 at 0 range 10 .. 15;
MR_1 at 0 range 16 .. 21;
Reserved_22_31 at 0 range 22 .. 31;
end record;
-- D3PCR2L_PCS array element
subtype D3PCR2L_PCS_Element is HAL.UInt2;
-- D3PCR2L_PCS array
type D3PCR2L_PCS_Field_Array is array (34 .. 35) of D3PCR2L_PCS_Element
with Component_Size => 2, Size => 4;
-- Type definition for D3PCR2L_PCS
type D3PCR2L_PCS_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- PCS as a value
Val : HAL.UInt4;
when True =>
-- PCS as an array
Arr : D3PCR2L_PCS_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for D3PCR2L_PCS_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
subtype D3PCR2L_PCS41_Field is HAL.UInt2;
-- EXTI D3 pending clear selection register low
type D3PCR2L_Register is record
-- unspecified
Reserved_0_3 : HAL.UInt4 := 16#0#;
-- D3 Pending request clear input signal selection on Event input x =
-- truncate ((n+64)/2)
PCS : D3PCR2L_PCS_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_8_17 : HAL.UInt10 := 16#0#;
-- D3 Pending request clear input signal selection on Event input x =
-- truncate ((n+64)/2)
PCS41 : D3PCR2L_PCS41_Field := 16#0#;
-- unspecified
Reserved_20_31 : HAL.UInt12 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for D3PCR2L_Register use record
Reserved_0_3 at 0 range 0 .. 3;
PCS at 0 range 4 .. 7;
Reserved_8_17 at 0 range 8 .. 17;
PCS41 at 0 range 18 .. 19;
Reserved_20_31 at 0 range 20 .. 31;
end record;
-- D3PCR2H_PCS array element
subtype D3PCR2H_PCS_Element is HAL.UInt2;
-- D3PCR2H_PCS array
type D3PCR2H_PCS_Field_Array is array (48 .. 53) of D3PCR2H_PCS_Element
with Component_Size => 2, Size => 12;
-- Type definition for D3PCR2H_PCS
type D3PCR2H_PCS_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- PCS as a value
Val : HAL.UInt12;
when True =>
-- PCS as an array
Arr : D3PCR2H_PCS_Field_Array;
end case;
end record
with Unchecked_Union, Size => 12;
for D3PCR2H_PCS_Field use record
Val at 0 range 0 .. 11;
Arr at 0 range 0 .. 11;
end record;
-- EXTI D3 pending clear selection register high
type D3PCR2H_Register is record
-- Pending request clear input signal selection on Event input x=
-- truncate ((n+96)/2)
PCS : D3PCR2H_PCS_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_12_31 : HAL.UInt20 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for D3PCR2H_Register use record
PCS at 0 range 0 .. 11;
Reserved_12_31 at 0 range 12 .. 31;
end record;
-- RTSR3_TR array
type RTSR3_TR_Field_Array is array (84 .. 86) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for RTSR3_TR
type RTSR3_TR_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TR as a value
Val : HAL.UInt3;
when True =>
-- TR as an array
Arr : RTSR3_TR_Field_Array;
end case;
end record
with Unchecked_Union, Size => 3;
for RTSR3_TR_Field use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- EXTI rising trigger selection register
type RTSR3_Register is record
-- unspecified
Reserved_0_17 : HAL.UInt18 := 16#0#;
-- Rising trigger event configuration bit of Configurable Event input
-- x+64
TR82 : Boolean := False;
-- unspecified
Reserved_19_19 : HAL.Bit := 16#0#;
-- Rising trigger event configuration bit of Configurable Event input
-- x+64
TR : RTSR3_TR_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_23_31 : HAL.UInt9 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for RTSR3_Register use record
Reserved_0_17 at 0 range 0 .. 17;
TR82 at 0 range 18 .. 18;
Reserved_19_19 at 0 range 19 .. 19;
TR at 0 range 20 .. 22;
Reserved_23_31 at 0 range 23 .. 31;
end record;
-- FTSR3_TR array
type FTSR3_TR_Field_Array is array (84 .. 86) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for FTSR3_TR
type FTSR3_TR_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TR as a value
Val : HAL.UInt3;
when True =>
-- TR as an array
Arr : FTSR3_TR_Field_Array;
end case;
end record
with Unchecked_Union, Size => 3;
for FTSR3_TR_Field use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- EXTI falling trigger selection register
type FTSR3_Register is record
-- unspecified
Reserved_0_17 : HAL.UInt18 := 16#0#;
-- Falling trigger event configuration bit of Configurable Event input
-- x+64
TR82 : Boolean := False;
-- unspecified
Reserved_19_19 : HAL.Bit := 16#0#;
-- Falling trigger event configuration bit of Configurable Event input
-- x+64
TR : FTSR3_TR_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_23_31 : HAL.UInt9 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for FTSR3_Register use record
Reserved_0_17 at 0 range 0 .. 17;
TR82 at 0 range 18 .. 18;
Reserved_19_19 at 0 range 19 .. 19;
TR at 0 range 20 .. 22;
Reserved_23_31 at 0 range 23 .. 31;
end record;
-- SWIER3_SWIER array
type SWIER3_SWIER_Field_Array is array (84 .. 86) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for SWIER3_SWIER
type SWIER3_SWIER_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- SWIER as a value
Val : HAL.UInt3;
when True =>
-- SWIER as an array
Arr : SWIER3_SWIER_Field_Array;
end case;
end record
with Unchecked_Union, Size => 3;
for SWIER3_SWIER_Field use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- EXTI software interrupt event register
type SWIER3_Register is record
-- unspecified
Reserved_0_17 : HAL.UInt18 := 16#0#;
-- Software interrupt on line x+64
SWIER82 : Boolean := False;
-- unspecified
Reserved_19_19 : HAL.Bit := 16#0#;
-- Software interrupt on line x+64
SWIER : SWIER3_SWIER_Field :=
(As_Array => False, Val => 16#0#);
-- unspecified
Reserved_23_31 : HAL.UInt9 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for SWIER3_Register use record
Reserved_0_17 at 0 range 0 .. 17;
SWIER82 at 0 range 18 .. 18;
Reserved_19_19 at 0 range 19 .. 19;
SWIER at 0 range 20 .. 22;
Reserved_23_31 at 0 range 23 .. 31;
end record;
-- EXTI D3 pending mask register
type D3PMR3_Register is record
-- unspecified
Reserved_0_23 : HAL.UInt24 := 16#0#;
-- D3 Pending Mask on Event input x+64
MR88 : Boolean := False;
-- unspecified
Reserved_25_31 : HAL.UInt7 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for D3PMR3_Register use record
Reserved_0_23 at 0 range 0 .. 23;
MR88 at 0 range 24 .. 24;
Reserved_25_31 at 0 range 25 .. 31;
end record;
subtype D3PCR3H_PCS88_Field is HAL.UInt2;
-- EXTI D3 pending clear selection register high
type D3PCR3H_Register is record
-- unspecified
Reserved_0_17 : HAL.UInt18 := 16#0#;
-- D3 Pending request clear input signal selection on Event input x=
-- truncate N+160/2
PCS88 : D3PCR3H_PCS88_Field := 16#0#;
-- unspecified
Reserved_20_31 : HAL.UInt12 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for D3PCR3H_Register use record
Reserved_0_17 at 0 range 0 .. 17;
PCS88 at 0 range 18 .. 19;
Reserved_20_31 at 0 range 20 .. 31;
end record;
-- CPUIMR1_MR array
type CPUIMR1_MR_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- EXTI interrupt mask register
type CPUIMR1_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MR as a value
Val : HAL.UInt32;
when True =>
-- MR as an array
Arr : CPUIMR1_MR_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CPUIMR1_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- CPUEMR1_MR array
type CPUEMR1_MR_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- EXTI event mask register
type CPUEMR1_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MR as a value
Val : HAL.UInt32;
when True =>
-- MR as an array
Arr : CPUEMR1_MR_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CPUEMR1_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- CPUPR1_PR array
type CPUPR1_PR_Field_Array is array (0 .. 21) of Boolean
with Component_Size => 1, Size => 22;
-- Type definition for CPUPR1_PR
type CPUPR1_PR_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- PR as a value
Val : HAL.UInt22;
when True =>
-- PR as an array
Arr : CPUPR1_PR_Field_Array;
end case;
end record
with Unchecked_Union, Size => 22;
for CPUPR1_PR_Field use record
Val at 0 range 0 .. 21;
Arr at 0 range 0 .. 21;
end record;
-- EXTI pending register
type CPUPR1_Register is record
-- CPU Event mask on Event input x
PR : CPUPR1_PR_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_22_31 : HAL.UInt10 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CPUPR1_Register use record
PR at 0 range 0 .. 21;
Reserved_22_31 at 0 range 22 .. 31;
end record;
-- CPUIMR2_MR array
type CPUIMR2_MR_Field_Array is array (0 .. 12) of Boolean
with Component_Size => 1, Size => 13;
-- Type definition for CPUIMR2_MR
type CPUIMR2_MR_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MR as a value
Val : HAL.UInt13;
when True =>
-- MR as an array
Arr : CPUIMR2_MR_Field_Array;
end case;
end record
with Unchecked_Union, Size => 13;
for CPUIMR2_MR_Field use record
Val at 0 range 0 .. 12;
Arr at 0 range 0 .. 12;
end record;
-- CPUIMR2_MR array
type CPUIMR2_MR_Field_Array_1 is array (14 .. 31) of Boolean
with Component_Size => 1, Size => 18;
-- Type definition for CPUIMR2_MR
type CPUIMR2_MR_Field_1
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MR as a value
Val : HAL.UInt18;
when True =>
-- MR as an array
Arr : CPUIMR2_MR_Field_Array_1;
end case;
end record
with Unchecked_Union, Size => 18;
for CPUIMR2_MR_Field_1 use record
Val at 0 range 0 .. 17;
Arr at 0 range 0 .. 17;
end record;
-- EXTI interrupt mask register
type CPUIMR2_Register is record
-- CPU Interrupt Mask on Direct Event input x+32
MR : CPUIMR2_MR_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_13_13 : HAL.Bit := 16#0#;
-- CPU Interrupt Mask on Direct Event input x+32
MR_1 : CPUIMR2_MR_Field_1 :=
(As_Array => False, Val => 16#0#);
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CPUIMR2_Register use record
MR at 0 range 0 .. 12;
Reserved_13_13 at 0 range 13 .. 13;
MR_1 at 0 range 14 .. 31;
end record;
-- CPUEMR2_MR array
type CPUEMR2_MR_Field_Array is array (32 .. 44) of Boolean
with Component_Size => 1, Size => 13;
-- Type definition for CPUEMR2_MR
type CPUEMR2_MR_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MR as a value
Val : HAL.UInt13;
when True =>
-- MR as an array
Arr : CPUEMR2_MR_Field_Array;
end case;
end record
with Unchecked_Union, Size => 13;
for CPUEMR2_MR_Field use record
Val at 0 range 0 .. 12;
Arr at 0 range 0 .. 12;
end record;
-- CPUEMR2_MR array
type CPUEMR2_MR_Field_Array_1 is array (46 .. 63) of Boolean
with Component_Size => 1, Size => 18;
-- Type definition for CPUEMR2_MR
type CPUEMR2_MR_Field_1
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MR as a value
Val : HAL.UInt18;
when True =>
-- MR as an array
Arr : CPUEMR2_MR_Field_Array_1;
end case;
end record
with Unchecked_Union, Size => 18;
for CPUEMR2_MR_Field_1 use record
Val at 0 range 0 .. 17;
Arr at 0 range 0 .. 17;
end record;
-- EXTI event mask register
type CPUEMR2_Register is record
-- CPU Interrupt Mask on Direct Event input x+32
MR : CPUEMR2_MR_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_13_13 : HAL.Bit := 16#0#;
-- CPU Interrupt Mask on Direct Event input x+32
MR_1 : CPUEMR2_MR_Field_1 :=
(As_Array => False, Val => 16#0#);
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CPUEMR2_Register use record
MR at 0 range 0 .. 12;
Reserved_13_13 at 0 range 13 .. 13;
MR_1 at 0 range 14 .. 31;
end record;
-- EXTI pending register
type CPUPR2_Register is record
-- unspecified
Reserved_0_16 : HAL.UInt17;
-- Read-only. Configurable event inputs x+32 Pending bit
PR49 : Boolean;
-- unspecified
Reserved_18_18 : HAL.Bit;
-- Read-only. Configurable event inputs x+32 Pending bit
PR51 : Boolean;
-- unspecified
Reserved_20_31 : HAL.UInt12;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CPUPR2_Register use record
Reserved_0_16 at 0 range 0 .. 16;
PR49 at 0 range 17 .. 17;
Reserved_18_18 at 0 range 18 .. 18;
PR51 at 0 range 19 .. 19;
Reserved_20_31 at 0 range 20 .. 31;
end record;
-- CPUIMR3_MR array
type CPUIMR3_MR_Field_Array is array (64 .. 80) of Boolean
with Component_Size => 1, Size => 17;
-- Type definition for CPUIMR3_MR
type CPUIMR3_MR_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MR as a value
Val : HAL.UInt17;
when True =>
-- MR as an array
Arr : CPUIMR3_MR_Field_Array;
end case;
end record
with Unchecked_Union, Size => 17;
for CPUIMR3_MR_Field use record
Val at 0 range 0 .. 16;
Arr at 0 range 0 .. 16;
end record;
-- CPUIMR3_MR array
type CPUIMR3_MR_Field_Array_1 is array (84 .. 88) of Boolean
with Component_Size => 1, Size => 5;
-- Type definition for CPUIMR3_MR
type CPUIMR3_MR_Field_1
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MR as a value
Val : HAL.UInt5;
when True =>
-- MR as an array
Arr : CPUIMR3_MR_Field_Array_1;
end case;
end record
with Unchecked_Union, Size => 5;
for CPUIMR3_MR_Field_1 use record
Val at 0 range 0 .. 4;
Arr at 0 range 0 .. 4;
end record;
-- EXTI interrupt mask register
type CPUIMR3_Register is record
-- Read-only. CPU Interrupt Mask on Direct Event input x+64
MR : CPUIMR3_MR_Field;
-- unspecified
Reserved_17_17 : HAL.Bit;
-- Read-only. CPU Interrupt Mask on Direct Event input x+64
MR82 : Boolean;
-- unspecified
Reserved_19_19 : HAL.Bit;
-- Read-only. CPU Interrupt Mask on Direct Event input x+64
MR_1 : CPUIMR3_MR_Field_1;
-- unspecified
Reserved_25_31 : HAL.UInt7;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CPUIMR3_Register use record
MR at 0 range 0 .. 16;
Reserved_17_17 at 0 range 17 .. 17;
MR82 at 0 range 18 .. 18;
Reserved_19_19 at 0 range 19 .. 19;
MR_1 at 0 range 20 .. 24;
Reserved_25_31 at 0 range 25 .. 31;
end record;
-- CPUEMR3_MR array
type CPUEMR3_MR_Field_Array is array (64 .. 80) of Boolean
with Component_Size => 1, Size => 17;
-- Type definition for CPUEMR3_MR
type CPUEMR3_MR_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MR as a value
Val : HAL.UInt17;
when True =>
-- MR as an array
Arr : CPUEMR3_MR_Field_Array;
end case;
end record
with Unchecked_Union, Size => 17;
for CPUEMR3_MR_Field use record
Val at 0 range 0 .. 16;
Arr at 0 range 0 .. 16;
end record;
-- CPUEMR3_MR array
type CPUEMR3_MR_Field_Array_1 is array (84 .. 88) of Boolean
with Component_Size => 1, Size => 5;
-- Type definition for CPUEMR3_MR
type CPUEMR3_MR_Field_1
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MR as a value
Val : HAL.UInt5;
when True =>
-- MR as an array
Arr : CPUEMR3_MR_Field_Array_1;
end case;
end record
with Unchecked_Union, Size => 5;
for CPUEMR3_MR_Field_1 use record
Val at 0 range 0 .. 4;
Arr at 0 range 0 .. 4;
end record;
-- EXTI event mask register
type CPUEMR3_Register is record
-- Read-only. CPU Event mask on Event input x+64
MR : CPUEMR3_MR_Field;
-- unspecified
Reserved_17_17 : HAL.Bit;
-- Read-only. CPU Event mask on Event input x+64
MR82 : Boolean;
-- unspecified
Reserved_19_19 : HAL.Bit;
-- Read-only. CPU Event mask on Event input x+64
MR_1 : CPUEMR3_MR_Field_1;
-- unspecified
Reserved_25_31 : HAL.UInt7;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CPUEMR3_Register use record
MR at 0 range 0 .. 16;
Reserved_17_17 at 0 range 17 .. 17;
MR82 at 0 range 18 .. 18;
Reserved_19_19 at 0 range 19 .. 19;
MR_1 at 0 range 20 .. 24;
Reserved_25_31 at 0 range 25 .. 31;
end record;
-- CPUPR3_PR array
type CPUPR3_PR_Field_Array is array (84 .. 86) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for CPUPR3_PR
type CPUPR3_PR_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- PR as a value
Val : HAL.UInt3;
when True =>
-- PR as an array
Arr : CPUPR3_PR_Field_Array;
end case;
end record
with Unchecked_Union, Size => 3;
for CPUPR3_PR_Field use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- EXTI pending register
type CPUPR3_Register is record
-- unspecified
Reserved_0_17 : HAL.UInt18;
-- Read-only. Configurable event inputs x+64 Pending bit
PR82 : Boolean;
-- unspecified
Reserved_19_19 : HAL.Bit;
-- Read-only. Configurable event inputs x+64 Pending bit
PR : CPUPR3_PR_Field;
-- unspecified
Reserved_23_31 : HAL.UInt9;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CPUPR3_Register use record
Reserved_0_17 at 0 range 0 .. 17;
PR82 at 0 range 18 .. 18;
Reserved_19_19 at 0 range 19 .. 19;
PR at 0 range 20 .. 22;
Reserved_23_31 at 0 range 23 .. 31;
end record;
-----------------
-- Peripherals --
-----------------
-- External interrupt/event controller
type EXTI_Peripheral is record
-- EXTI rising trigger selection register
RTSR1 : aliased RTSR1_Register;
-- EXTI falling trigger selection register
FTSR1 : aliased FTSR1_Register;
-- EXTI software interrupt event register
SWIER1 : aliased SWIER1_Register;
-- EXTI D3 pending mask register
D3PMR1 : aliased D3PMR1_Register;
-- EXTI D3 pending clear selection register low
D3PCR1L : aliased D3PCR1L_Register;
-- EXTI D3 pending clear selection register high
D3PCR1H : aliased D3PCR1H_Register;
-- EXTI rising trigger selection register
RTSR2 : aliased RTSR2_Register;
-- EXTI falling trigger selection register
FTSR2 : aliased FTSR2_Register;
-- EXTI software interrupt event register
SWIER2 : aliased SWIER2_Register;
-- EXTI D3 pending mask register
D3PMR2 : aliased D3PMR2_Register;
-- EXTI D3 pending clear selection register low
D3PCR2L : aliased D3PCR2L_Register;
-- EXTI D3 pending clear selection register high
D3PCR2H : aliased D3PCR2H_Register;
-- EXTI rising trigger selection register
RTSR3 : aliased RTSR3_Register;
-- EXTI falling trigger selection register
FTSR3 : aliased FTSR3_Register;
-- EXTI software interrupt event register
SWIER3 : aliased SWIER3_Register;
-- EXTI D3 pending mask register
D3PMR3 : aliased D3PMR3_Register;
-- EXTI D3 pending clear selection register high
D3PCR3H : aliased D3PCR3H_Register;
-- EXTI interrupt mask register
CPUIMR1 : aliased CPUIMR1_Register;
-- EXTI event mask register
CPUEMR1 : aliased CPUEMR1_Register;
-- EXTI pending register
CPUPR1 : aliased CPUPR1_Register;
-- EXTI interrupt mask register
CPUIMR2 : aliased CPUIMR2_Register;
-- EXTI event mask register
CPUEMR2 : aliased CPUEMR2_Register;
-- EXTI pending register
CPUPR2 : aliased CPUPR2_Register;
-- EXTI interrupt mask register
CPUIMR3 : aliased CPUIMR3_Register;
-- EXTI event mask register
CPUEMR3 : aliased CPUEMR3_Register;
-- EXTI pending register
CPUPR3 : aliased CPUPR3_Register;
end record
with Volatile;
for EXTI_Peripheral use record
RTSR1 at 16#0# range 0 .. 31;
FTSR1 at 16#4# range 0 .. 31;
SWIER1 at 16#8# range 0 .. 31;
D3PMR1 at 16#C# range 0 .. 31;
D3PCR1L at 16#10# range 0 .. 31;
D3PCR1H at 16#14# range 0 .. 31;
RTSR2 at 16#20# range 0 .. 31;
FTSR2 at 16#24# range 0 .. 31;
SWIER2 at 16#28# range 0 .. 31;
D3PMR2 at 16#2C# range 0 .. 31;
D3PCR2L at 16#30# range 0 .. 31;
D3PCR2H at 16#34# range 0 .. 31;
RTSR3 at 16#40# range 0 .. 31;
FTSR3 at 16#44# range 0 .. 31;
SWIER3 at 16#48# range 0 .. 31;
D3PMR3 at 16#4C# range 0 .. 31;
D3PCR3H at 16#54# range 0 .. 31;
CPUIMR1 at 16#80# range 0 .. 31;
CPUEMR1 at 16#84# range 0 .. 31;
CPUPR1 at 16#88# range 0 .. 31;
CPUIMR2 at 16#90# range 0 .. 31;
CPUEMR2 at 16#94# range 0 .. 31;
CPUPR2 at 16#98# range 0 .. 31;
CPUIMR3 at 16#A0# range 0 .. 31;
CPUEMR3 at 16#A4# range 0 .. 31;
CPUPR3 at 16#A8# range 0 .. 31;
end record;
-- External interrupt/event controller
EXTI_Periph : aliased EXTI_Peripheral
with Import, Address => EXTI_Base;
end STM32_SVD.EXTI;
| 30.91359 | 79 | 0.589663 |
dc4426e3657876ddb20868f0810ac2ff2d1d8d4f | 184 | adb | Ada | Des_Ada/src/mainSequential.adb | VMika/Des_Ada | fcadb38aa9118e668329c3443d3b6e4c83456acc | [
"MIT"
] | null | null | null | Des_Ada/src/mainSequential.adb | VMika/Des_Ada | fcadb38aa9118e668329c3443d3b6e4c83456acc | [
"MIT"
] | null | null | null | Des_Ada/src/mainSequential.adb | VMika/Des_Ada | fcadb38aa9118e668329c3443d3b6e4c83456acc | [
"MIT"
] | null | null | null |
WITH P_DesHandler;
USE P_DesHandler;
----------
-- Main --
----------
procedure mainSequential is
DesAlg : aliased DesHandler;
begin
DesAlg.Process;
end mainSequential;
| 10.222222 | 33 | 0.641304 |
c5e28fbf08a1ad36315f1a821dcbbbd18b8ba71c | 4,025 | adb | Ada | 2021/day09/part2.adb | noeppi-noeppi/aoc | c73aa7e6ffd78a9f48f15cb3fc3810b61db573e8 | [
"Apache-2.0"
] | 2 | 2020-12-25T10:04:38.000Z | 2021-12-05T15:29:19.000Z | 2021/day09/part2.adb | noeppi-noeppi/aoc | c73aa7e6ffd78a9f48f15cb3fc3810b61db573e8 | [
"Apache-2.0"
] | null | null | null | 2021/day09/part2.adb | noeppi-noeppi/aoc | c73aa7e6ffd78a9f48f15cb3fc3810b61db573e8 | [
"Apache-2.0"
] | null | null | null | with Ada.Text_IO;
procedure part2 is
type Index is range 0 .. 200;
type LargeIndex is range 0 .. 1000;
type Cell is range 0 .. 9;
type Row is array (Index) of Cell;
type Grid is array (Index) of Row;
type BasinRow is array (Index) of Integer;
type BasinGrid is array (Index) of BasinRow;
type BasinList is array (LargeIndex) of Integer;
type RowResult is record
parsedRow: Row;
width: Integer;
end record;
type GridResult is record
parsedGrid: Grid;
width: Integer;
height: Integer;
end record;
procedure writeln(n: integer) is
str : String := Integer'Image(n);
begin
Ada.Text_IO.Put_Line(str);
end writeln;
function parseCell(chr: Character) return Cell is
begin
return Cell(Character'Pos(chr) - 48);
end parseCell;
function readln return RowResult is
line: String(1 .. 200) := (others => ' ');
len: integer;
resultRow: Row;
result: RowResult;
begin
Ada.Text_IO.Get_Line(line, len);
for i in 1 .. len loop
resultRow(Index(i)) := parseCell(line(i));
end loop;
result := (resultRow, len);
return result;
end readln;
function readg return GridResult is
line: RowResult;
width: Integer;
height: Integer := 0;
the_grid: Grid;
result: GridResult;
begin
line := readln;
while line.width /= 0 loop
height := height + 1;
width := line.width;
the_grid(Index(height)) := line.parsedRow;
line := readln;
end loop;
result := (the_grid, width, height);
return result;
end readg;
function e(the_grid: Grid; x: Integer; y: Integer) return Integer is
begin
return Integer(the_grid(Index(y))(Index(x)));
end;
function e(the_grid: BasinGrid; x: Integer; y: Integer) return Integer is
begin
return the_grid(Index(y))(Index(x));
end;
procedure s(the_grid: in out BasinGrid; x: Integer; y: Integer; v: Integer) is
begin
the_grid(Index(y))(Index(x)) := v;
end;
procedure mark_basins(the_grid: Grid; basins: in out BasinGrid; list: in out BasinList; id: Integer; x: Integer; y: Integer; width: Integer; height: Integer) is
begin
if x >= 1 and x <= width and y >= 1 and y <= height
and e(the_grid, x, y) /= 9 and e(basins, x, y) = 0 then
s(basins, x, y, id);
list(LargeIndex(id)) := list(LargeIndex(id)) + 1;
mark_basins(the_grid, basins, list, id, x - 1, y, width, height);
mark_basins(the_grid, basins, list, id, x + 1, y, width, height);
mark_basins(the_grid, basins, list, id, x, y - 1, width, height);
mark_basins(the_grid, basins, list, id, x, y + 1, width, height);
end if;
end;
grid_result: GridResult;
the_grid: Grid;
width: Integer;
height: Integer;
basins: BasinGrid;
basin_list: BasinList;
next_id: Integer := 0;
basin1: Integer := 0;
basin2: Integer := 0;
basin3: Integer := 0;
value: Integer;
begin
grid_result := readg;
the_grid := grid_result.parsedGrid;
width := grid_result.width;
height := grid_result.height;
for x in 1 .. width loop
for y in 1 .. height loop
s(basins, x, y, 0);
end loop;
end loop;
for x in 1 .. width loop
for y in 1 .. height loop
if e(the_grid, x, y) /= 9 and e(basins, x, y) = 0 then
next_id := next_id + 1;
mark_basins(the_grid, basins, basin_list, next_id, x, y, width, height);
end if;
end loop;
end loop;
for i in 1 .. next_id loop
value := basin_list(LargeIndex(i));
if value > basin1 then
basin3 := basin2;
basin2 := basin1;
basin1 := value;
elsif value > basin2 then
basin3 := basin2;
basin2 := value;
elsif value > basin3 then
basin3 := value;
end if;
end loop;
writeln(basin1 * basin2 * basin3);
end part2;
| 27.380952 | 163 | 0.589565 |
Subsets and Splits