Commit cecdc03e authored by jjhugues's avatar jjhugues
Browse files

Merge branch 'master' of https://github.com/OpenAADL/ocarina

parents 9587f0c5 d0033403
......@@ -19,7 +19,7 @@ osx_image: xcode8.3
env:
global:
- TOOLS_DIR=$HOME/build_tools
- GNAT_TAR_PATH=$TOOLS_DIR/gnat-gpl-2016-bin.tar.gz
- INSTALL_DIR=$HOME/tools
################################################################################
# Host to run the various tests
......@@ -36,25 +36,19 @@ os:
cache:
directories:
- $HOME/build_tools
- $HOME/tools
# 2/ Check Python installation
before_install:
- which python
# 3/ Install GNAT GPL 2016
# 3/ Install GNAT
install:
# Check if the GNAT package is already available in the cache directory. If
# not, download it.
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then test -f $GNAT_TAR_PATH ||( mkdir -p $TOOLS_DIR && wget http://mirrors.cdn.adacore.com/art/5739cefdc7a447658e0b016b -O $GNAT_TAR_PATH); fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then test -f $GNAT_TAR_PATH ||( mkdir -p $TOOLS_DIR && wget http://mirrors.cdn.adacore.com/art/573a396cc7a447658d00e430 -O $GNAT_TAR_PATH); fi
# Extract GNAT from its package
- tar -xf $GNAT_TAR_PATH
# Add GNAT to $PATH
- export PATH=$PWD/gnat-gpl-2016-x86_64-linux-bin/bin/:$PWD/gnat-gpl-2016-x86_64-darwin-bin/bin/:$PATH
- git clone https://github.com/OpenAADL/ocarina-build.git ; ( cd ocarina-build ; ./build_ocarina.sh --install-gnat-ce ; cd $HOME)
- export PATH=$HOME/tools/bin:$PATH
- echo $PATH
################################################################################
# Main processing starts here
......@@ -65,7 +59,7 @@ script:
- gnatls -v
# Just build
- git clone https://github.com/OpenAADL/ocarina-build.git ; ( cd ocarina-build ; ./build_ocarina.sh --scenario=travis-ci )
- ( cd ocarina-build ; ./build_ocarina.sh --scenario=travis-ci )
# Codecov.io
after_success:
......
......@@ -29,8 +29,8 @@
-- --
------------------------------------------------------------------------------
--- This package provides accessors to the property set of the
--- ARINC653 annex document, published as part of AS5506/1A standard.
-- This package provides accessors to the property set of the
-- ARINC653 annex document, published as part of AS5506/1A standard.
package Ocarina.Backends.Properties.ARINC653 is
......
......@@ -792,60 +792,60 @@ package body Ocarina.Backends.PO_HI_Ada.Activity is
O : Node_Id;
begin
-- Create the spec of the parameterless subprogram that
-- executes the thread job.
if Has_Ports (E) then
-- Create the spec of the subprograms to interact with
-- thread ports.
case P is
when Thread_Periodic =>
N :=
Message_Comment
("Periodic task : " &
Get_Name_String (Display_Name (Identifier (S))));
Append_Node_To_List (N, ADN.Visible_Part (Current_Package));
case P is
when Thread_Periodic =>
N :=
Message_Comment
("Periodic task : " &
Get_Name_String (Display_Name (Identifier (S))));
Append_Node_To_List (N, ADN.Visible_Part (Current_Package));
when Thread_Sporadic =>
N :=
Message_Comment
("Sporadic task : " &
Get_Name_String (Display_Name (Identifier (S))));
Append_Node_To_List (N, ADN.Visible_Part (Current_Package));
when Thread_Sporadic =>
N :=
Message_Comment
("Sporadic task : " &
Get_Name_String (Display_Name (Identifier (S))));
Append_Node_To_List (N, ADN.Visible_Part (Current_Package));
when Thread_Hybrid =>
N :=
Message_Comment
("Hybrid task : " &
Get_Name_String (Display_Name (Identifier (S))));
Append_Node_To_List (N, ADN.Visible_Part (Current_Package));
when Thread_Hybrid =>
N :=
Message_Comment
("Hybrid task : " &
Get_Name_String (Display_Name (Identifier (S))));
Append_Node_To_List (N, ADN.Visible_Part (Current_Package));
when Thread_Aperiodic =>
N :=
Message_Comment
("Aperiodic task : " &
Get_Name_String (Display_Name (Identifier (S))));
Append_Node_To_List (N, ADN.Visible_Part (Current_Package));
when Thread_Aperiodic =>
N :=
Message_Comment
("Aperiodic task : " &
Get_Name_String (Display_Name (Identifier (S))));
Append_Node_To_List (N, ADN.Visible_Part (Current_Package));
when Thread_Background =>
N :=
Message_Comment
("Background task : " &
Get_Name_String (Display_Name (Identifier (S))));
Append_Node_To_List (N, ADN.Visible_Part (Current_Package));
when Thread_Background =>
N :=
Message_Comment
("Background task : " &
Get_Name_String (Display_Name (Identifier (S))));
Append_Node_To_List (N, ADN.Visible_Part (Current_Package));
when Thread_ISR =>
N :=
Message_Comment
("ISR task : " &
Get_Name_String (Display_Name (Identifier (S))));
Append_Node_To_List (N, ADN.Visible_Part (Current_Package));
when Thread_ISR =>
N :=
Message_Comment
("ISR task : " &
Get_Name_String (Display_Name (Identifier (S))));
Append_Node_To_List (N, ADN.Visible_Part (Current_Package));
when others =>
Display_Located_Error
(AIN.Loc (E),
"Unsupported dispatch protocol",
Fatal => True);
end case;
when others =>
Display_Located_Error
(AIN.Loc (E),
"Unsupported dispatch protocol",
Fatal => True);
end case;
if Has_Ports (E) then
-- The data types and the interrogation routines
-- generated from a thread are not instance specific. We
-- generate them once per thread component. This allows
......@@ -2526,106 +2526,109 @@ package body Ocarina.Backends.PO_HI_Ada.Activity is
-- Implement the routines that allow user code to
-- manipulate the thread.
Runtime_Routine_Bodies (E);
end if;
case P is
when Thread_Periodic =>
N :=
Message_Comment
("Periodic task : " &
Get_Name_String (Display_Name (Identifier (S))));
Append_Node_To_List (N, ADN.Statements (Current_Package));
when Thread_Sporadic =>
N :=
Message_Comment
("Sporadic task : " &
Get_Name_String (Display_Name (Identifier (S))));
Append_Node_To_List (N, ADN.Statements (Current_Package));
when Thread_Aperiodic =>
N :=
Message_Comment
("Aperiodic task : " &
Get_Name_String (Display_Name (Identifier (S))));
Append_Node_To_List (N, ADN.Statements (Current_Package));
case P is
when Thread_Periodic =>
N :=
Message_Comment
("Periodic task : " &
Get_Name_String (Display_Name (Identifier (S))));
Append_Node_To_List (N, ADN.Statements (Current_Package));
when Thread_Background =>
N :=
Message_Comment
("Background task : " &
Get_Name_String (Display_Name (Identifier (S))));
Append_Node_To_List (N, ADN.Statements (Current_Package));
when Thread_Sporadic =>
N :=
Message_Comment
("Sporadic task : " &
Get_Name_String (Display_Name (Identifier (S))));
Append_Node_To_List (N, ADN.Statements (Current_Package));
when Thread_ISR =>
N :=
Message_Comment
("ISR task : " &
Get_Name_String (Display_Name (Identifier (S))));
Append_Node_To_List (N, ADN.Statements (Current_Package));
when Thread_Aperiodic =>
N :=
Message_Comment
("Aperiodic task : " &
Get_Name_String (Display_Name (Identifier (S))));
Append_Node_To_List (N, ADN.Statements (Current_Package));
when Thread_Hybrid =>
N :=
Message_Comment
("Hybrid task : " &
Get_Name_String (Display_Name (Identifier (S))));
Append_Node_To_List (N, ADN.Statements (Current_Package));
when Thread_Background =>
N :=
Message_Comment
("Background task : " &
Get_Name_String (Display_Name (Identifier (S))));
Append_Node_To_List (N, ADN.Statements (Current_Package));
-- Hybrid threads requires an extra driver thread to be
-- created.
when Thread_ISR =>
N :=
Message_Comment
("ISR task : " &
Get_Name_String (Display_Name (Identifier (S))));
Append_Node_To_List (N, ADN.Statements (Current_Package));
declare
Aggr : constant List_Id := New_List (ADN.K_Component_List);
begin
Has_Hybrid_Threads := True;
when Thread_Hybrid =>
N :=
Message_Comment
("Hybrid task : " &
Get_Name_String (Display_Name (Identifier (S))));
Append_Node_To_List (N, ADN.Statements (Current_Package));
-- Hybrid threads requires an extra driver thread to be
-- created.
declare
Aggr : constant List_Id :=
New_List (ADN.K_Component_List);
begin
Has_Hybrid_Threads := True;
if Hybrid_Thread_Elements = No_List then
Hybrid_Thread_Elements :=
New_List (ADN.K_Element_List);
end if;
if Hybrid_Thread_Elements = No_List then
Hybrid_Thread_Elements := New_List (ADN.K_Element_List);
end if;
-- Append the element association corresponding to
-- E to the hybrid task set.
-- Append the element association corresponding to
-- E to the hybrid task set.
N := Extract_Enumerator (E);
Append_Node_To_List (N, Aggr);
N := Extract_Enumerator (E);
Append_Node_To_List (N, Aggr);
-- We know that the last node added to the feature
-- list of E is the one appended at exapnsion time
-- and corresponding to the fake event part that
-- will receive the dispatch messages from the
-- driver.
-- We know that the last node added to the feature
-- list of E is the one appended at exapnsion time
-- and corresponding to the fake event part that
-- will receive the dispatch messages from the
-- driver.
N := Extract_Enumerator (Last_Node (Features (E)));
Append_Node_To_List (N, Aggr);
N := Extract_Enumerator (Last_Node (Features (E)));
Append_Node_To_List (N, Aggr);
N := Map_Ada_Time (Get_Thread_Period (E));
Append_Node_To_List (N, Aggr);
N := Map_Ada_Time (Get_Thread_Period (E));
Append_Node_To_List (N, Aggr);
N := RE (RE_System_Startup_Time);
Append_Node_To_List (N, Aggr);
N := RE (RE_System_Startup_Time);
Append_Node_To_List (N, Aggr);
N := RE (RE_True);
Append_Node_To_List (N, Aggr);
N := RE (RE_True);
Append_Node_To_List (N, Aggr);
N :=
Make_Qualified_Expression
(RE (RE_Hybrid_Task_Info),
Make_Record_Aggregate (Aggr));
N :=
Make_Qualified_Expression
(RE (RE_Hybrid_Task_Info),
Make_Record_Aggregate (Aggr));
Last_Hybrid_Thread_Index := Last_Hybrid_Thread_Index + 1;
Last_Hybrid_Thread_Index := Last_Hybrid_Thread_Index + 1;
N :=
Make_Element_Association
(Make_Literal
(New_Integer_Value
(Last_Hybrid_Thread_Index, 1, 10)),
N);
Append_Node_To_List (N, Hybrid_Thread_Elements);
end;
N :=
Make_Element_Association
(Make_Literal
(New_Integer_Value (Last_Hybrid_Thread_Index, 1, 10)),
N);
Append_Node_To_List (N, Hybrid_Thread_Elements);
end;
when others =>
raise Program_Error;
end case;
when others =>
raise Program_Error;
end case;
Runtime_Routine_Bodies (E);
end if;
if Has_Modes (E) then
-- If the thread has operational modes, then generate the
......
......@@ -2496,6 +2496,12 @@ package body Ocarina.Backends.PO_HI_Ada.Job is
begin
Check_Thread_Consistency (E);
if Has_Ports (E) then
Add_With_Package
(E => RU (Ru_PolyORB_HI_Generated_Activity),
Used => True);
end if;
-- If the thread contains operational modes. we update the
-- value of the current mode depending on the received
-- events.
......@@ -2916,10 +2922,6 @@ package body Ocarina.Backends.PO_HI_Ada.Job is
S : constant Node_Id := Parent_Subcomponent (E);
N : Node_Id;
begin
Add_With_Package -- XXX
(E => RU (Ru_PolyORB_HI_Generated_Activity),
Used => True);
case P is
when Thread_Periodic =>
N :=
......
......@@ -338,11 +338,15 @@ package body Ocarina.Backends.PO_HI_Ada.Main is
Thread_Aperiodic |
Thread_Background |
Thread_ISR =>
Add_With_Package
(E => RU (RU_PolyORB_HI_Generated_Activity, False),
Used => False,
Warnings_Off => True,
Elaborated => True);
if Has_Ports (E) then
Add_With_Package
(E => RU (RU_PolyORB_HI_Generated_Activity, False),
Used => False,
Warnings_Off => True,
Elaborated => True);
end if;
Add_With_Package
(E => RU (Ru_Polyorb_Hi_Generated_Job, False),
Used => False,
......
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2009 Telecom ParisTech, 2010-2018 ESA & ISAE. --
-- Copyright (C) 2009 Telecom ParisTech, 2010-2019 ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- --
......@@ -3232,10 +3232,9 @@ package body Ocarina.Analyzer.AADL.Links is
while Present (List_Node) loop
-- A property type is a list of record_type element
-- XXX should use case insensitive match ?
if Ocarina.ME_AADL.AADL_Tree.Nodes.Display_Name
if Ocarina.ME_AADL.AADL_Tree.Nodes.Name
(Identifier (List_Node)) =
Display_Name (Identifier (Property_Container))
Name (Identifier (Property_Container))
then
Unit_Type := Unwind_Units_Type (Root, List_Node);
exit;
......
headers_ocarina: headers_ocarina.adb
$(GNATMAKE) -gnat05 $(srcdir)/headers_ocarina.adb
$(GNATMAKE) $(srcdir)/headers_ocarina.adb
EXTRA_DIST= $(srcdir)/reconfig
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment