...
 
Commits (34)
ignore:
- "tools/mknodes"
- "src/transfo"
- "doc"
......@@ -30,6 +30,7 @@ AC_CHECK_PROG(GNATCLEAN, gnatclean, gnatclean)
AC_CHECK_PROG(GNATLS, gnatls, gnatls)
AC_EXEEXT
AM_PATH_PYTHON
AM_GPRBUILD
dnl we need a GNU flavoured sed
AC_CHECK_PROG(HAVE_GNUSED,gnused,yes,no)
......@@ -60,11 +61,11 @@ PATH_KIND=`$GNATLS -v 2>&1 \
case ${PATH_KIND} in
"WINDOWS" | "UNIX" )
AC_MSG_RESULT($PATH_KIND)
;;
;;
* )
AC_MSG_WARN([gnatls ("$GNATLS") uses an unknown path kind: "${PATH_KIND}. Assuming UNIX path"])
PATH_KIND=UNIX
;;
AC_MSG_WARN([gnatls ("$GNATLS") uses an unknown path kind: "${PATH_KIND}. Assuming UNIX path"])
PATH_KIND=UNIX
;;
esac
AC_SUBST(PATH_KIND)
......@@ -212,26 +213,26 @@ AS_HELP_STRING([--with-ocarina-runtimes=x], [enumerate runtimes]),
do
case ${R} in
all )
for P in aadlib polyorb-hi-ada polyorb-hi-c
for P in aadlib polyorb-hi-ada polyorb-hi-c
do
if test -d ${root}/resources/runtime/${P}
then
RUNTIME_LIST="${RUNTIME_LIST}${P} "
if test -d ${root}/resources/runtime/${P}
then
RUNTIME_LIST="${RUNTIME_LIST}${P} "
else
AC_MSG_ERROR([runtime ${P} not found])
fi
fi
done
AM_CONDITIONAL(AADLIB, true)
AM_CONDITIONAL(PO_HI_ADA, true)
AM_CONDITIONAL(PO_HI_C, true)
;;
AM_CONDITIONAL(PO_HI_C, true)
;;
none )
AM_CONDITIONAL(AADLIB, false)
AM_CONDITIONAL(PO_HI_ADA, false)
AM_CONDITIONAL(PO_HI_C, false)
;;
AM_CONDITIONAL(PO_HI_ADA, false)
AM_CONDITIONAL(PO_HI_C, false)
;;
aadlib )
if test -d ${root}/resources/runtime/${R}
......@@ -240,43 +241,43 @@ AS_HELP_STRING([--with-ocarina-runtimes=x], [enumerate runtimes]),
else
AC_MSG_ERROR([runtime ${R} not found])
fi
AM_CONDITIONAL(AADLIB, true)
;;
AM_CONDITIONAL(AADLIB, true)
;;
pok )
pok )
if test -d ${root}/resources/runtime/${R}
then
RUNTIME_LIST="${RUNTIME_LIST}${R} "
else
AC_MSG_ERROR([runtime ${R} not found])
fi
AM_CONDITIONAL(POK, true)
;;
AM_CONDITIONAL(POK, true)
;;
polyorb-hi-ada )
polyorb-hi-ada )
if test -d ${root}/resources/runtime/${R}
then
RUNTIME_LIST="${RUNTIME_LIST}${R} "
else
AC_MSG_ERROR([runtime ${R} not found])
fi
AM_CONDITIONAL(PO_HI_ADA, true)
;;
AM_CONDITIONAL(PO_HI_ADA, true)
;;
polyorb-hi-c )
polyorb-hi-c )
if test -d ${root}/resources/runtime/${R}
then
RUNTIME_LIST="${RUNTIME_LIST}${R} "
else
AC_MSG_ERROR([runtime ${R} not found])
fi
AM_CONDITIONAL(PO_HI_C, true)
;;
AM_CONDITIONAL(PO_HI_C, true)
;;
* )
AC_MSG_ERROR([unknown runtime ${R}])
;;
* )
AC_MSG_ERROR([unknown runtime ${R}])
;;
esac
done
RUNTIME_LIST=`echo "$RUNTIME_LIST" | sed 's/ $//'`
......@@ -287,7 +288,7 @@ AS_HELP_STRING([--with-ocarina-runtimes=x], [enumerate runtimes]),
do
if test -d ${root}/resources/runtime/${P}
then
RUNTIME_LIST="${RUNTIME_LIST}${P} "
RUNTIME_LIST="${RUNTIME_LIST}${P} "
fi
done
......@@ -406,42 +407,42 @@ dnl may, one day, be edited automatically to remove
dnl some entries.
AC_OUTPUT([
Makefile
doc/Makefile
doc/real/Makefile
examples/Makefile
examples/real/Makefile
examples/real/lib/Makefile
examples/real/resources/Makefile
examples/real/safety/Makefile
examples/real/security/Makefile
projects/Makefile
projects-distrib/Makefile
resources/Makefile
resources/behavioural_properties/Makefile
resources/runtime/Makefile
resources/runtime/aadl_xml/Makefile
resources/runtime/alloy/Makefile
resources/runtime/cheddar/Makefile
resources/runtime/lnt/Makefile
resources/runtime/python/Makefile
projects/ocarina.gpr
projects-distrib/ocarina/ocarina_core.gpr
src/main/Makefile
src/config/ocarina-configuration.adb
src/frontends/Makefile
src/config/Makefile
src/core/Makefile
src/transfo/Makefile
src/backends/Makefile
src/python/Makefile
src/Makefile
support/Makefile
support/strip_wrapper.sh
tools/Makefile
tools/gendoc.py
tools/compare.py
ocarina-config
Makefile
doc/Makefile
doc/real/Makefile
examples/Makefile
examples/real/Makefile
examples/real/lib/Makefile
examples/real/resources/Makefile
examples/real/safety/Makefile
examples/real/security/Makefile
projects/Makefile
projects-distrib/Makefile
resources/Makefile
resources/behavioural_properties/Makefile
resources/runtime/Makefile
resources/runtime/aadl_xml/Makefile
resources/runtime/alloy/Makefile
resources/runtime/cheddar/Makefile
resources/runtime/lnt/Makefile
resources/runtime/python/Makefile
projects/ocarina.gpr
projects-distrib/ocarina/ocarina_core.gpr
src/main/Makefile
src/config/ocarina-configuration.adb
src/frontends/Makefile
src/config/Makefile
src/core/Makefile
src/transfo/Makefile
src/backends/Makefile
src/python/Makefile
src/Makefile
support/Makefile
support/strip_wrapper.sh
tools/Makefile
tools/gendoc.py
tools/compare.py
ocarina-config
])
AC_MSG_NOTICE(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
......
......@@ -95,7 +95,7 @@ PARALLEL_GNATMAKE_FLAGS = -j4
all-local: $(BUILD_DIRS) maybe-generate-tree-files $(PYTHON_TARGET) $(BUILD_STAMPS)
$(BUILD_STAMPS): %-build:
$(INIT_ADA_PROJECT_PATH) $(GNATMAKE_FOR_TARGET) \
$(INIT_ADA_PROJECT_PATH) $(GPRBUILD) \
$(PARALLEL_GNATMAKE_FLAGS) -P $* $(GNATFLAGS) $(GNAT_LIB_FLAGS) \
-XABS_SRC_DIR="$(PL_DEP_ABS_SRC_DIR)" \
-XABS_BUILD_DIR="$(PL_DEP_ABS_BUILD_DIR)" \
......@@ -148,7 +148,7 @@ build-mknodes:
if [ -f $(MKNODES_SRC_DIR)/mknodes.gpr ]; then \
mkdir -p $(MKNODES_BUILD_DIR)/objects; \
$(INIT_ADA_PROJECT_PATH) \
$(GNATMAKE) -P $(MKNODES_SRC_DIR)/mknodes.gpr \
$(GPRBUILD) -P $(MKNODES_SRC_DIR)/mknodes.gpr \
-XABS_SRC_DIR="$(PL_DEP_ABS_SRC_DIR)" \
-XABS_BUILD_DIR="$(PL_DEP_ABS_BUILD_DIR)" \
$(AP_FLAGS) \
......
......@@ -31,8 +31,9 @@ property set AADL_Project is
Supported_Connection_QoS: type enumeration (GuaranteedDelivery, OrderedDelivery, SecureDelivery);
Supported_Scheduling_Protocols: type enumeration -- Updated for Cheddar
Supported_Scheduling_Protocols: type enumeration
(SporadicServer, RMS, FixedTimeline,
-- for Cheddar
PARAMETRIC_PROTOCOL,
EDF,
EARLIEST_DEADLINE_FIRST_PROTOCOL,
......@@ -50,7 +51,10 @@ property set AADL_Project is
HIERARCHICAL_CYCLIC_PROTOCOL,
HIERARCHICAL_ROUND_ROBIN_PROTOCOL,
HIERARCHICAL_FIXED_PRIORITY_PROTOCOL,
HIERARCHICAL_PARAMETRIC_PROTOCOL);
HIERARCHICAL_PARAMETRIC_PROTOCOL,
-- for AADL Inspector
RM, DM, HPF, ARINC653, static, cyclic
);
Supported_Source_Languages: type enumeration -- Updated for TASTE/Ocarina
(Ada95,
......
property set Code_Generation_Properties is
Convention: enumeration (AADL, Legacy) => Legacy applies to (subprogram);
Parameter_Usage: enumeration (By_Value, By_Reference)
applies to (data access, parameter);
Return_Parameter: aadlboolean => false applies to (parameter);
-- if true, out parameter is actually a return parameter
end Code_Generation_Properties;
......@@ -194,6 +194,11 @@ package Ocarina.Backends.C_Tree.Nutils is
M_Deadline,
M_Period,
M_Flags,
M_Nb_Dispatch_Triggers_Of_Each_Transition,
M_Nb_Transitions,
M_Dispatch_Triggers_Of_All_Transitions,
M_Nb_Of_All_Dispatch_Events,
M_States_Attributes,
M_Vars);
MN : array (Member_Id) of Name_Id;
......@@ -224,12 +229,15 @@ package Ocarina.Backends.C_Tree.Nutils is
V_Error_Status,
V_Out,
V_In,
V_Next_Complete_State,
V_Index_Transition_To_Execute,
V_Message);
VN : array (Variable_Id) of Name_Id;
type Function_Id is
(F_Process_Request, F_Register_Source, F_Init_Lane, F_Sizeof, F_Create);
(F_Process_Request, F_Register_Source, F_Init_Lane, F_Sizeof,
F_Malloc, F_Create);
FN : array (Function_Id) of Name_Id;
......
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2019 ESA & ISAE. --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2020 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- --
......@@ -69,14 +69,18 @@ package body Ocarina.Backends.Build_Utils is
(Filename : Name_Id;
Directory : Name_Id;
Basename : out Name_Id;
Dirname : out Name_Id);
-- Dirname and Basename corresponds to Dir_Name and Base_Name of
-- an intermediate filename. If Filename is an absolute path, this
-- intermediate filename is Filename. If Filename is a relative
-- path, the intermediate filename is either relative to
-- Directory, if Directory is non-null, or to the current working
-- directory if Directory is null. Directory may be relative to
-- the current directory in which case it is also normalized.
Dirname : out Name_Id;
Relative_Path : Boolean := False);
-- Split the path made of Filename and Directory into Basename and
-- Dirname (with regular shell interpretations)
--
-- * If Relative_Path is true, and if Directory is not Ocarina
-- install directory (case of runtime library elements), then we
-- disregard Directory and assume the base directory to be "../.."
-- relative to the generated code directory.
--
-- * If Relative_Path is false, the full directory path is
-- resolved and is absolute to the user environment.
function Resolve_Language (E : Node_Id) return Supported_Source_Language;
-- Fetches the Source_Language property of E. If the property is
......@@ -153,23 +157,52 @@ package body Ocarina.Backends.Build_Utils is
(Filename : Name_Id;
Directory : Name_Id;
Basename : out Name_Id;
Dirname : out Name_Id)
Dirname : out Name_Id;
Relative_Path : Boolean := False)
is
Temp_Dirname : Name_Id := No_Name;
AADL_Library_File : Boolean := False;
begin
if Directory = No_Name then
if Relative_Path then
Temp_Dirname := Get_String_Name
(Normalize_Pathname (Get_Name_String (Directory)) & "/");
if Temp_Dirname = Default_Library_Path then
AADL_Library_File := True;
end if;
end if;
if Relative_Path and then not
AADL_Library_File
then
Set_Str_To_Name_Buffer ("../..");
elsif Directory = No_Name then
Set_Str_To_Name_Buffer (".");
else
Get_Name_String (Directory);
end if;
declare
Normalized_Dir : constant String :=
Normalize_Pathname (Name_Buffer (1 .. Name_Len));
(if Relative_Path then
Format_Pathname (Name_Buffer (1 .. Name_Len))
else
Normalize_Pathname (Name_Buffer (1 .. Name_Len)));
Resolved_Filename : constant String :=
Normalize_Pathname (Get_Name_String (Filename), Normalized_Dir);
(if Relative_Path then
Format_Pathname (Normalized_Dir & "/"
& Get_Name_String (Filename))
else
Normalize_Pathname (Get_Name_String (Filename),
Normalized_Dir));
begin
Dirname := Get_String_Name (Dir_Name (Resolved_Filename));
Basename := Get_String_Name (Base_Name (Resolved_Filename));
end;
end Split_Path;
------------------
......@@ -560,7 +593,8 @@ package body Ocarina.Backends.Build_Utils is
(Implem_Name,
Loc (E).Dir_Name,
Source_Basename,
Source_Dirname);
Source_Dirname,
Relative_Path => True);
if Custom_Source_Dir /= No_Name then
Source_Dirname := Custom_Source_Dir;
......@@ -596,7 +630,8 @@ package body Ocarina.Backends.Build_Utils is
(Source_Files (J),
Loc (E).Dir_Name,
Source_Basename,
Source_Dirname);
Source_Dirname,
Relative_Path => True);
-- If the directory points to the default AADL
-- property set directory (case of PolyORB-HI/C
......@@ -740,7 +775,6 @@ package body Ocarina.Backends.Build_Utils is
Set_Name_Table_Info (S_Name, 1);
Get_Name_String (Source_Files (J));
Split_Path
(Source_Files (J),
Loc (E).Dir_Name,
......@@ -1729,11 +1763,9 @@ package body Ocarina.Backends.Build_Utils is
Write_Line ("###################################################");
Write_Eol;
-- The following syntax esapces whitespace in the path
Write_Line ("RUNTIME_PATH=$(shell echo """
& Get_Runtime_Path ("polyorb-hi-c")
& """ | sed 's/ /\\ /g')");
-- The following syntax escapes whitespace in the path
Write_Line ("RUNTIME_PATH=../polyorb-hi-c");
Write_Eol;
Write_Str ("all: build-partitions resident_sw");
......
......@@ -47,8 +47,23 @@ package Ocarina.Backends.C_Common.BA is
function Is_To_Make_Init_Sequence (S : Node_Id) return Boolean;
function Make_Specification_Of_BA_Related_Function
(S : Node_Id;
BA_Body : Boolean := False;
BA_Initialization : Boolean := False) return Node_Id;
(S : Node_Id;
BA_Body : Boolean := False;
BA_Initialization : Boolean := False;
States_Initialization : Boolean := False;
Update_Next_Complete_State : Boolean := False) return Node_Id;
function Compute_Max_Dispatch_Transitions_Per_Complete_State
(S : Node_Id) return Unsigned_Long_Long;
function Compute_Max_Dispatch_Triggers_Per_Dispatch_Transition
(S : Node_Id) return Unsigned_Long_Long;
procedure Create_Enum_Type_Of_States_Names (S : Node_Id);
function Compute_Nb_On_Dispatch_Transitions
(S : Node_Id) return Unsigned_Long_Long;
procedure Create_State_Type (S : Node_Id);
end Ocarina.Backends.C_Common.BA;
......@@ -1032,9 +1032,12 @@ package body Ocarina.Backends.C_Common.Mapping is
-----------------------
function Map_C_Define_Name
(E : Node_Id;
Nb_Ports : Boolean := False;
Nb_States : Boolean := False) return Name_Id
(E : Node_Id;
Nb_Ports : Boolean := False;
Nb_States : Boolean := False;
Max_Dispatch_Transitions_Per_Complete_State : Boolean := False;
Max_Dispatch_Triggers_Per_Dispatch_Transition : Boolean := False)
return Name_Id
is
C_Name : Name_Id;
begin
......@@ -1051,6 +1054,12 @@ package body Ocarina.Backends.C_Common.Mapping is
Add_Str_To_Name_Buffer ("_NB_PORTS");
elsif Nb_States then
Add_Str_To_Name_Buffer ("_nb_states");
elsif Max_Dispatch_Transitions_Per_Complete_State then
Add_Str_To_Name_Buffer
("_max_dispatch_transitions_per_complete_state");
elsif Max_Dispatch_Triggers_Per_Dispatch_Transition then
Add_Str_To_Name_Buffer
("_max_dispatch_triggers_per_dispatch_transition");
end if;
else
raise Program_Error with "Wrong node kind for Map_C_Enumerator_Name";
......@@ -1067,27 +1076,27 @@ package body Ocarina.Backends.C_Common.Mapping is
-------------------------
function Map_C_Variable_Name
(E : Node_Id;
Port_Variable : Boolean := False;
Port_History : Boolean := False;
Port_Woffsets : Boolean := False;
Port_Empties : Boolean := False;
Port_First : Boolean := False;
Port_Queue : Boolean := False;
Port_Recent : Boolean := False;
Port_Fifo_Size : Boolean := False;
Port_Offsets : Boolean := False;
Port_Used_Size : Boolean := False;
Port_N_Dest : Boolean := False;
Port_Local_Dest : Boolean := False;
Port_Destinations : Boolean := False;
Port_Total_Fifo : Boolean := False;
Port_Request : Boolean := False;
Request_Variable : Boolean := False;
State_Name_T : Boolean := False;
State_T : Boolean := False;
States_Array : Boolean := False;
Current_State : Boolean := False) return Name_Id
(E : Node_Id;
Port_Variable : Boolean := False;
Port_History : Boolean := False;
Port_Woffsets : Boolean := False;
Port_Empties : Boolean := False;
Port_First : Boolean := False;
Port_Queue : Boolean := False;
Port_Recent : Boolean := False;
Port_Fifo_Size : Boolean := False;
Port_Offsets : Boolean := False;
Port_Used_Size : Boolean := False;
Port_N_Dest : Boolean := False;
Port_Local_Dest : Boolean := False;
Port_Destinations : Boolean := False;
Port_Total_Fifo : Boolean := False;
Port_Request : Boolean := False;
Request_Variable : Boolean := False;
State_Name_T : Boolean := False;
State_T : Boolean := False;
States_Array : Boolean := False;
Current_State : Boolean := False) return Name_Id
is
C_Name : Name_Id;
begin
......@@ -1161,10 +1170,11 @@ package body Ocarina.Backends.C_Common.Mapping is
------------------------------------
function Map_C_BA_Related_Function_Name
(E : Node_Id;
BA_Body : Boolean := False;
States_Initialization : Boolean := False;
BA_Initialization : Boolean := False) return Name_Id
(E : Node_Id;
BA_Body : Boolean := False;
States_Initialization : Boolean := False;
BA_Initialization : Boolean := False;
Update_Next_Complete_State : Boolean := False) return Name_Id
is
C_Name : Name_Id;
begin
......@@ -1176,9 +1186,11 @@ package body Ocarina.Backends.C_Common.Mapping is
if BA_Body then
Add_Str_To_Name_Buffer ("_ba_body");
elsif States_Initialization then
Add_Str_To_Name_Buffer ("_states_initialization");
Add_Str_To_Name_Buffer ("_states_and_current_state_initialization");
elsif BA_Initialization then
Add_Str_To_Name_Buffer ("_ba_initialization");
elsif Update_Next_Complete_State then
Add_Str_To_Name_Buffer ("_update_next_complete_state");
end if;
C_Name := Name_Find;
......
......@@ -77,9 +77,12 @@ package Ocarina.Backends.C_Common.Mapping is
Port_Type : Boolean := False;
Local_Port : Boolean := False) return Name_Id;
function Map_C_Define_Name
(E : Node_Id;
Nb_Ports : Boolean := False;
Nb_States : Boolean := False) return Name_Id;
(E : Node_Id;
Nb_Ports : Boolean := False;
Nb_States : Boolean := False;
Max_Dispatch_Transitions_Per_Complete_State : Boolean := False;
Max_Dispatch_Triggers_Per_Dispatch_Transition : Boolean := False)
return Name_Id;
function Map_C_Full_Parameter_Name
(Spg : Node_Id;
P : Node_Id;
......@@ -128,33 +131,34 @@ package Ocarina.Backends.C_Common.Mapping is
function Map_C_Operation_Name (E : Node_Id) return Name_Id;
function Map_C_Port_Data_Name (E : Node_Id; P : Node_Id) return Name_Id;
function Map_C_Variable_Name
(E : Node_Id;
Port_Variable : Boolean := False;
Port_History : Boolean := False;
Port_Woffsets : Boolean := False;
Port_Empties : Boolean := False;
Port_First : Boolean := False;
Port_Queue : Boolean := False;
Port_Recent : Boolean := False;
Port_Fifo_Size : Boolean := False;
Port_Offsets : Boolean := False;
Port_Used_Size : Boolean := False;
Port_N_Dest : Boolean := False;
Port_Local_Dest : Boolean := False;
Port_Destinations : Boolean := False;
Port_Total_Fifo : Boolean := False;
Port_Request : Boolean := False;
Request_Variable : Boolean := False;
State_Name_T : Boolean := False;
State_T : Boolean := False;
States_Array : Boolean := False;
Current_State : Boolean := False) return Name_Id;
(E : Node_Id;
Port_Variable : Boolean := False;
Port_History : Boolean := False;
Port_Woffsets : Boolean := False;
Port_Empties : Boolean := False;
Port_First : Boolean := False;
Port_Queue : Boolean := False;
Port_Recent : Boolean := False;
Port_Fifo_Size : Boolean := False;
Port_Offsets : Boolean := False;
Port_Used_Size : Boolean := False;
Port_N_Dest : Boolean := False;
Port_Local_Dest : Boolean := False;
Port_Destinations : Boolean := False;
Port_Total_Fifo : Boolean := False;
Port_Request : Boolean := False;
Request_Variable : Boolean := False;
State_Name_T : Boolean := False;
State_T : Boolean := False;
States_Array : Boolean := False;
Current_State : Boolean := False) return Name_Id;
function Map_C_BA_Related_Function_Name
(E : Node_Id;
BA_Body : Boolean := False;
States_Initialization : Boolean := False;
BA_Initialization : Boolean := False) return Name_Id;
(E : Node_Id;
BA_Body : Boolean := False;
States_Initialization : Boolean := False;
BA_Initialization : Boolean := False;
Update_Next_Complete_State : Boolean := False) return Name_Id;
function Map_Port_Data_With_Virtual_Bus
(E : Node_Id;
......
......@@ -639,16 +639,37 @@ package body Ocarina.Backends.C_Common.Subprograms is
declare
BA : Node_Id;
PL : List_Id;
P : constant Supported_Thread_Dispatch_Protocol :=
Get_Thread_Dispatch_Protocol (E);
begin
BA := Get_Behavior_Specification (E);
if BANu.Length (BATN.States (BA)) > 1 then
if P = Thread_Periodic
or else (P = Thread_Sporadic and then
Compute_Nb_On_Dispatch_Transitions (E) = 1)
then
PL := No_List;
elsif P = Thread_Sporadic and then
Compute_Nb_On_Dispatch_Transitions (E) > 1
then
PL := Make_List_Id
(Make_Parameter_Specification
(Defining_Identifier =>
Make_Defining_Identifier
(VN (V_Next_Complete_State)),
Parameter_Type =>
Make_Pointer_Type
(RE (RE_Ba_Automata_State_T))));
end if;
N :=
Make_Extern_Entity_Declaration
(Make_Function_Specification
(Defining_Identifier => Make_Defining_Identifier
(Map_C_BA_Related_Function_Name
(S, States_Initialization => True)),
Parameters => No_List,
Parameters => PL,
Return_Type => New_Node (CTN.K_Void)));
Append_Node_To_List (N,
......
......@@ -75,6 +75,8 @@ package body Ocarina.Backends.Utils is
use Ocarina.Instances.Queries;
use Ocarina.Backends.Helper;
type Browsing_Kind is (By_Source, By_Destination);
-- The entered directories stack
package Directories_Stack is new GNAT.Table (Name_Id, Int, 1, 5, 10);
......
......@@ -33,8 +33,6 @@ with Ocarina.Backends.Properties; use Ocarina.Backends.Properties;
package Ocarina.Backends.Utils is
type Browsing_Kind is (By_Source, By_Destination, Default);
-----------------
-- AST visitor --
-----------------
......
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2019 ESA & ISAE. --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2020 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- --
......@@ -368,6 +368,7 @@ package body Ocarina.Backends.PO_HI_C.Activity is
N, N1 : Node_Id;
procedure Make_Wait_Event;
procedure Make_Wait_Specific_Events;
procedure Make_Call_Sequence;
procedure Make_Set_Out_Ports;
procedure Make_Send_Out_Ports (WStats : List_Id);
......@@ -484,15 +485,69 @@ package body Ocarina.Backends.PO_HI_C.Activity is
return Make_If_Statement (Condition, Then_Statements);
end Make_Get_Valid_Value;
-------------------------------
-- Make_Wait_Specific_Events --
-------------------------------
procedure Make_Wait_Specific_Events is
begin
-- __po_hi_int32_t index_transition_to_execute;
N :=
Make_Variable_Declaration
(Defining_Identifier => Make_Defining_Identifier
(VN (V_Index_Transition_To_Execute)),
Used_Type => RE (RE_Int32_T));
Append_Node_To_List (N, Declarations);
-- Make the call to
-- __po_hi_gqueue_wait_for_specific_incoming_events
Call_Parameters := New_List (CTN.K_Parameter_List);
N := Make_Defining_Identifier (Map_C_Enumerator_Name (S));
Append_Node_To_List (N, Call_Parameters);
N := Make_Defining_Identifier (VN (V_Next_Complete_State));
Append_Node_To_List (N, Call_Parameters);
N := Make_Variable_Address
(Make_Defining_Identifier (VN (V_Index_Transition_To_Execute)));
Append_Node_To_List (N, Call_Parameters);
N :=
CTU.Make_Call_Profile
(RE (RE_Gqueue_Wait_For_Specific_Incoming_Events),
Call_Parameters);
Append_Node_To_List (N, WStatements);
-- Make the call to __po_hi_compute_next_period
Call_Parameters := New_List (CTN.K_Parameter_List);
N :=
Make_Defining_Identifier
(Map_C_Enumerator_Name (S, Custom_Parent => Current_Device));
Append_Node_To_List (N, Call_Parameters);
N :=
CTU.Make_Call_Profile
(RE (RE_Compute_Next_Period),
Call_Parameters);
Append_Node_To_List (N, WStatements);
end Make_Wait_Specific_Events;
---------------------
-- Make_Wait_Event --
---------------------
procedure Make_Wait_Event is
begin
N :=
Make_Variable_Declaration
(Defining_Identifier => Make_Defining_Identifier (VN (V_Port)),
(Defining_Identifier => Make_Defining_Identifier
(VN (V_Port)),
Used_Type => RE (RE_Local_Port_T));
Append_Node_To_List (N, Declarations);
......@@ -503,7 +558,9 @@ package body Ocarina.Backends.PO_HI_C.Activity is
Append_Node_To_List (N, Call_Parameters);
N :=
Make_Variable_Address (Make_Defining_Identifier (VN (V_Port)));
Make_Variable_Address
(Make_Defining_Identifier
(VN (V_Port)));
Append_Node_To_List (N, Call_Parameters);
N :=
......@@ -1160,10 +1217,15 @@ package body Ocarina.Backends.PO_HI_C.Activity is
N := Make_Defining_Identifier (Map_C_Enumerator_Name (S));
Append_Node_To_List (N, Call_Parameters);
if P = Thread_Sporadic then
if P = Thread_Sporadic and then
Compute_Nb_On_Dispatch_Transitions (E) > 1
then
N := Make_Variable_Address
(Make_Defining_Identifier (VN (V_Port)));
N := Make_Defining_Identifier (VN (V_Next_Complete_State));
Append_Node_To_List (N, Call_Parameters);
N := Make_Defining_Identifier
(VN (V_Index_Transition_To_Execute));
Append_Node_To_List (N, Call_Parameters);
end if;
......@@ -1266,6 +1328,116 @@ package body Ocarina.Backends.PO_HI_C.Activity is
end loop;
end if;
if Impl_Kind = Thread_With_Behavior_Specification then
declare
BA : constant Node_Id := Get_Behavior_Specification (E);
begin
if P = Thread_Sporadic and then
BANu.Length (BATN.States (BA)) > 1 and then
Compute_Nb_On_Dispatch_Transitions (E) > 1
then
-- __po_hi_ba_automata_state_t *next_complete_state =
-- (__po_hi_ba_automata_state_t *)
-- malloc(sizeof(__po_hi_ba_automata_state_t));
N :=
Make_Variable_Declaration
(Defining_Identifier => Make_Defining_Identifier
(VN (V_Next_Complete_State)),
Used_Type => Make_Pointer_Type
(RE (RE_Ba_Automata_State_T)),
Value => Make_Type_Conversion
(Subtype_Mark => Make_Pointer_Type
(RE (RE_Ba_Automata_State_T)),
Expression => Make_Call_Profile
(Make_Defining_Identifier (FN (F_Malloc)),
Make_List_Id
(Make_Call_Profile
(Make_Defining_Identifier (FN (F_Sizeof)),
Make_List_Id
(RE (RE_Ba_Automata_State_T)))))));
Append_Node_To_List (N, Declarations);
-- next_complete_state
-- ->nb_dispatch_triggers_of_each_transition =
-- (__po_hi_int32_t *)
-- malloc( sizeof(__po_hi_int32_t) *
-- __po_hi_consumer_max_dispatch_transitions_
-- per_complete_state);
N := Make_Assignment_Statement
(Variable_Identifier => Make_Member_Designator
(Defining_Identifier => Make_Defining_Identifier
(MN
(M_Nb_Dispatch_Triggers_Of_Each_Transition)),
Aggregate_Name => Make_Defining_Identifier
(VN (V_Next_Complete_State)),
Is_Pointer => True),
Expression => Make_Type_Conversion
(Subtype_Mark => Make_Pointer_Type
(RE (RE_Int32_T)),
Expression => Make_Call_Profile
(Make_Defining_Identifier (FN (F_Malloc)),
Make_List_Id
(Make_Expression
(Left_Expr => Make_Call_Profile
(Make_Defining_Identifier (FN (F_Sizeof)),
Make_List_Id
(RE (RE_Int32_T))),
Operator => Op_Asterisk,
Right_Expr => Make_Defining_Identifier
(Map_C_Define_Name
(S,
Max_Dispatch_Transitions_Per_Complete_State
=> True)))))));
Append_Node_To_List (N, Statements);
-- next_complete_state->dispatch_triggers_of_all_transitions
-- = (__po_hi_int32_t *)
-- malloc( sizeof(__po_hi_int32_t) *
-- (__po_hi_consumer_max_dispatch_transitions_per_
-- complete_state*__po_hi_consumer_max_dispatch_
-- triggers_per_dispatch_transition));
N := Make_Assignment_Statement
(Variable_Identifier => Make_Member_Designator
(Defining_Identifier => Make_Defining_Identifier
(MN (M_Dispatch_Triggers_Of_All_Transitions)),
Aggregate_Name => Make_Defining_Identifier
(VN (V_Next_Complete_State)),
Is_Pointer => True),
Expression => Make_Type_Conversion
(Subtype_Mark => Make_Pointer_Type
(RE (RE_Int32_T)),
Expression => Make_Call_Profile
(Make_Defining_Identifier (FN (F_Malloc)),
Make_List_Id
(Make_Expression
(Left_Expr => Make_Call_Profile
(Make_Defining_Identifier (FN (F_Sizeof)),
Make_List_Id
(RE (RE_Int32_T))),
Operator => Op_Asterisk,
Right_Expr => Make_Expression
(Left_Expr => Make_Defining_Identifier
(Map_C_Define_Name
(S,
Max_Dispatch_Transitions_Per_Complete_State
=> True)),
Operator => Op_Asterisk,
Right_Expr => Make_Defining_Identifier
(Map_C_Define_Name
(S,
Max_Dispatch_Triggers_Per_Dispatch_Transition
=> True))))))));
Append_Node_To_List (N, Statements);
end if;
end;
end if;
if Has_Ports (E) then
-- Make the __po_hi_gqueue_init call
......@@ -1350,8 +1522,16 @@ package body Ocarina.Backends.PO_HI_C.Activity is
-- If the thread is sporadic or aperiodic, we generate the
-- call to block waiting for events.
if P = Thread_Sporadic or else P = Thread_Aperiodic then
if P = Thread_Aperiodic then
Make_Wait_Event;
elsif P = Thread_Sporadic then
if Impl_Kind = Thread_With_Behavior_Specification and then
Compute_Nb_On_Dispatch_Transitions (E) > 1
then
Make_Wait_Specific_Events;
else
Make_Wait_Event;
end if;
end if;
-- Depending on the implementation kind, call the proper
......@@ -1429,10 +1609,11 @@ package body Ocarina.Backends.PO_HI_C.Activity is
-- /** Initialize states; this function is called
-- when the BA of the thread has more than one state **/
--
-- producer_th_states_initialization ();
-- producer_states_and_current_state_initialization ();
if P = Thread_Periodic or else P = Thread_Sporadic then
declare
BA : Node_Id;
P1 : List_Id;
begin
BA := Get_Behavior_Specification (E);
if BANu.Length (BATN.States (BA)) > 1 then
......@@ -1444,21 +1625,30 @@ package body Ocarina.Backends.PO_HI_C.Activity is
-- Call <<thread_name>>_states_initialization
if P = Thread_Periodic
or else (P = Thread_Sporadic and then
Compute_Nb_On_Dispatch_Transitions (E) = 1)
then
P1 := No_List;
elsif P = Thread_Sporadic and then
Compute_Nb_On_Dispatch_Transitions (E) > 1
then
P1 := Make_List_Id
(Make_Defining_Identifier
(VN (V_Next_Complete_State)));
end if;
N := CTU.Make_Call_Profile
(Defining_Identifier => Make_Defining_Identifier
(Map_C_BA_Related_Function_Name
(S, States_Initialization => True)),
Parameters => No_List);
Parameters => P1);
Append_Node_To_List (N, Statements);
N :=
Make_Extern_Entity_Declaration
(Make_Function_Specification
(Defining_Identifier => Make_Defining_Identifier
(Map_C_BA_Related_Function_Name
(S, States_Initialization => True)),
Parameters => No_List,
Return_Type => New_Node (CTN.K_Void)));
(Make_Specification_Of_BA_Related_Function
(E, States_Initialization => True));
Append_Node_To_List (N,
CTN.Declarations (Current_File));
......@@ -1938,6 +2128,14 @@ package body Ocarina.Backends.PO_HI_C.Activity is
Nb_Dest : Unsigned_Long_Long := 0;
Has_Local_Deliver : Boolean := False;
begin
if Get_Thread_Dispatch_Protocol (E) = Thread_Sporadic and then
not Has_In_Event_Ports (E)
then
Display_Located_Error
(Loc (E),
"None of the IN ports of this sporadic thread is an event port",
Fatal => True);
end if;
if Has_Ports (E) then
F := First_Node (Features (E));
......
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2019 ESA & ISAE. --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2020 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- --
......@@ -44,6 +44,9 @@ with Ocarina.Backends.C_Common.Mapping;
with Ocarina.Backends.PO_HI_C.Runtime;
with Ocarina.Backends.Properties;
with Ocarina.Backends.Messages;
with Ocarina.Backends.C_Common.BA;
with Ocarina.ME_AADL_BA.BA_Tree.Nutils;
with Ocarina.ME_AADL_BA.BA_Tree.Nodes;
with Ocarina.Instances.Queries;
......@@ -63,6 +66,7 @@ package body Ocarina.Backends.PO_HI_C.Deployment is
use Ocarina.Backends.Properties;
use Ocarina.Backends.Messages;
use Ocarina.Instances.Queries;
use Ocarina.Backends.C_Common.BA;
use Locations;
......@@ -71,6 +75,8 @@ package body Ocarina.Backends.PO_HI_C.Deployment is
package CV renames Ocarina.Backends.C_Values;
package CTN renames Ocarina.Backends.C_Tree.Nodes;
package CTU renames Ocarina.Backends.C_Tree.Nutils;
package BATN renames Ocarina.ME_AADL_BA.BA_Tree.Nodes;
package BANu renames Ocarina.ME_AADL_BA.BA_Tree.Nutils;
Entity_Array : Node_Id;
Devices_Array : Node_Id;
......@@ -887,6 +893,7 @@ package body Ocarina.Backends.PO_HI_C.Deployment is
The_System : constant Node_Id :=
Parent_Component (Parent_Subcomponent (E));
Device_Implementation : Node_Id;
Node_Name : Name_Id;
begin
pragma Assert (AAU.Is_System (Root_Sys));
......@@ -922,6 +929,22 @@ package body Ocarina.Backends.PO_HI_C.Deployment is
(Map_C_Enumerator_Name (Parent_Subcomponent (E))));
Append_Node_To_List (N, CTN.Declarations (Current_File));
Node_Name :=
Map_C_Enumerator_Name (Parent_Subcomponent (E));
Set_Str_To_Name_Buffer ("");
Get_Name_String (Token_Image (Tok_Quote));
Get_Name_String_And_Append (Node_Name);
Get_Name_String_And_Append (Token_Image (Tok_Quote));
Node_Name := Name_Find;
N :=
Make_Define_Statement
(Defining_Identifier => RE (RE_My_Node_Name),
Value =>
Make_Defining_Identifier (Node_Name));
Append_Node_To_List (N, CTN.Declarations (Current_File));
-- Visit all devices attached to the parent system that
-- share the same processor as process E.
......@@ -1358,26 +1381,24 @@ package body Ocarina.Backends.PO_HI_C.Deployment is
Global_Port_Model_Names);
end if;
if not Is_Empty (Local_Port_List) then
if not Invalid_Local_Port_Added then
Set_Str_To_Name_Buffer ("invalid_local_port_t");
N :=
Make_Expression
(Make_Defining_Identifier (Name_Find),
Op_Equal,
(Make_Literal (CV.New_Int_Value (1, -1, 10))));
Append_Node_To_List (N, Local_Port_List);
Invalid_Local_Port_Added := True;
end if;
if not Invalid_Local_Port_Added then
Set_Str_To_Name_Buffer ("invalid_local_port_t");
N :=
Make_Full_Type_Declaration
(Defining_Identifier => RE (RE_Local_Port_T),
Type_Definition => Make_Enum_Aggregate (Local_Port_List));
Append_Node_To_List (N, CTN.Declarations (Current_File));
Make_Expression
(Make_Defining_Identifier (Name_Find),
Op_Equal,
(Make_Literal (CV.New_Int_Value (1, -1, 10))));
Append_Node_To_List (N, Local_Port_List);
Invalid_Local_Port_Added := True;
end if;
N :=
Make_Full_Type_Declaration
(Defining_Identifier => RE (RE_Local_Port_T),
Type_Definition => Make_Enum_Aggregate (Local_Port_List));
Append_Node_To_List (N, CTN.Declarations (Current_File));
N :=
Make_Define_Statement
(Defining_Identifier => RE (RE_Nb_Devices),
......@@ -1541,6 +1562,11 @@ package body Ocarina.Backends.PO_HI_C.Deployment is
Spg_Call : Node_Id;
Used_Bus : Node_Id;
Used_Device : Node_Id;
Impl_Kind : constant Supported_Thread_Implementation :=
Get_Thread_Implementation_Kind (E);
Dispatch_Protocol : constant Supported_Thread_Dispatch_Protocol :=
Get_Thread_Dispatch_Protocol (E);
BA : Node_Id;
begin
Local_Port_Identifier := 0;
......@@ -1588,6 +1614,48 @@ package body Ocarina.Backends.PO_HI_C.Deployment is
Task_Identifier := Task_Identifier + 1;
Tasks_Stack := Tasks_Stack + To_Bytes (Get_Thread_Stack_Size (E));
if Impl_Kind = Thread_With_Behavior_Specification then
BA := Get_Behavior_Specification (E);
if BANu.Length (BATN.States (BA)) > 1 then
Create_Enum_Type_Of_States_Names (E);
Create_State_Type (E);
if Dispatch_Protocol = Thread_Sporadic and then
Compute_Nb_On_Dispatch_Transitions (E) > 1
then
N :=
Make_Define_Statement
(Defining_Identifier =>
Make_Defining_Identifier
(Map_C_Define_Name
(S,
Max_Dispatch_Transitions_Per_Complete_State =>
True)),
Value =>
Make_Literal
(New_Int_Value
(Compute_Max_Dispatch_Transitions_Per_Complete_State
(E),
1,
10)));
Append_Node_To_List (N, CTN.Declarations (Current_File));
N := Make_Define_Statement
(Defining_Identifier =>
Make_Defining_Identifier
(Map_C_Define_Name
(S,
Max_Dispatch_Triggers_Per_Dispatch_Transition
=> True)),
Value =>
Make_Literal
(New_Int_Value
(Compute_Max_Dispatch_Triggers_Per_Dispatch_Transition
(E), 1, 10)));
Append_Node_To_List (N, CTN.Declarations (Current_File));
end if;
end if;
end if;
end if;
if Current_Device /= No_Node
......@@ -1890,6 +1958,7 @@ package body Ocarina.Backends.PO_HI_C.Deployment is
Call_Seq := Next_Node (Call_Seq);
end loop;
end if;
end Visit_Thread_Instance;
-------------------------------
......
......@@ -129,6 +129,8 @@ package Ocarina.Backends.PO_HI_C.Runtime is
RE_Gqueue_Get_Value, -- __po_hi_gqueue_get_value
RE_Gqueue_Next_Value, -- __po_hi_gqueue_next_value
RE_Gqueue_Wait_For_Incoming_Event, -- __po_hi_gqueue_wait_for_incoming
RE_Gqueue_Wait_For_Specific_Incoming_Events,
-- __po_hi_gqueue_wait_for_specific_incoming_events
RE_Compute_Next_Period, -- __po_hi_compute_next_period
RE_Sporadic_Wait, -- __po_hi_sporadic_wait
RE_Compute_Miss, -- __po_hi_compute_miss
......@@ -172,6 +174,7 @@ package Ocarina.Backends.PO_HI_C.Runtime is
RE_Nb_Buses, -- __PO_HI_NB_BUSES
RE_Nb_Protocols, -- __PO_HI_NB_PROTOCOLS
RE_My_Node, -- __PO_HI_MY_NODE
RE_My_Node_Name, -- __PO_HI_MY_NODE_NAME
RE_Port_Type_Content, -- __PO_HI_PORT_TYPE_CONTENT
RE_Gqueue_Fifo_Indata, -- __PO_HI_GQUEUE_FIFO_DATA
RE_Gqueue_Fifo_Out, -- __PO_HI_GQUEUE_FIFO_OUT
......@@ -270,7 +273,8 @@ package Ocarina.Backends.PO_HI_C.Runtime is
RE_Complete_Final, -- __po_hi_complete_final
RE_Final, -- __po_hi_final
RE_Execution, -- __po_hi_execution
RE_State_Kind_T -- __po_hi_state_kind_t
RE_State_Kind_T, -- __po_hi_state_kind_t
RE_Ba_Automata_State_T -- __po_hi_ba_automata_state_t
);
-- Runtime types
......@@ -280,7 +284,7 @@ package Ocarina.Backends.PO_HI_C.Runtime is
subtype RF_Id is RE_Id range RE_Null .. RE_Wait_For_Tasks;
subtype RV_Id is RE_Id range RE_Operation_Names .. RE_Port_Global_To_Local;
subtype RM_Id is RE_Id range RE_Local_Port .. RE_REQUEST_PORT;
subtype RB_Id is RE_Id range RE_Initial .. RE_State_Kind_T;
subtype RB_Id is RE_Id range RE_Initial .. RE_Ba_Automata_State_T;
RE_Header_Table : constant array (RE_Id) of RH_Id :=
(RE_Null => RH_Null,
......@@ -363,6 +367,7 @@ package Ocarina.Backends.PO_HI_C.Runtime is
RE_Gqueue_Get_Value => RH_PO_HI_Gqueue,
RE_Gqueue_Next_Value => RH_PO_HI_Gqueue,
RE_Gqueue_Wait_For_Incoming_Event => RH_PO_HI_Gqueue,
RE_Gqueue_Wait_For_Specific_Incoming_Events => RH_PO_HI_Gqueue,
RE_Sporadic_Wait => RH_PO_HI_Task,
RE_Sporadic_Wait_Release => RH_PO_HI_Task,
RE_Simulink_Find_Var => RH_PO_HI_Simulink,
......@@ -424,6 +429,7 @@ package Ocarina.Backends.PO_HI_C.Runtime is
RE_Nb_Protocols => RH_Deployment,
RE_Port_Type_Content => RH_Deployment,
RE_My_Node => RH_Deployment,
RE_My_Node_Name => RH_Deployment,
RE_Nb_Ports => RH_Deployment,
RE_Nb_Servers => RH_Deployment,
RE_Nb_Protected => RH_Deployment,
......@@ -500,7 +506,8 @@ package Ocarina.Backends.PO_HI_C.Runtime is
RE_Complete_Final => RH_Null,
RE_Final => RH_Null,
RE_Execution => RH_Null,
RE_State_Kind_T => RH_Null
RE_State_Kind_T => RH_Null,
RE_Ba_Automata_State_T => RH_Null
);
procedure Initialize;
procedure Reset;
......
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2018 ESA & ISAE. --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2020 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- --
......@@ -280,10 +280,16 @@ package body Ocarina.Backends.PO_HI_C is
Write_Eol;
end if;
-- The following syntax esapces whitespace in the path
Write_Line ("RUNTIME_PATH=$(shell echo """
& Get_Runtime_Path ("polyorb-hi-c")
& """ | sed 's/ /\\ /g')");
-- The following syntax escapes whitespace in the path
-- Write_Line ("RUNTIME_PATH=$(shell echo """
-- & Get_Runtime_Path ("polyorb-hi-c")
-- & """ | sed 's/ /\\ /g')");
Write_Line
("BUILD_DIR:=$(shell dirname " &
"$(abspath $(lastword $(MAKEFILE_LIST))))");
Write_Line ("RUNTIME_PATH=$(BUILD_DIR)/../polyorb-hi-c");
Write_Str ("USER_SOURCES_DIRS=");
if Length (User_Source_Dirs) > 0 then
......
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2017 ESA & ISAE. --
-- Copyright (C) 2008-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- --
......@@ -59,9 +59,7 @@ package body Ocarina.Property_Sets is
O_Deployment,
O_Cheddar_Properties,
O_Ocarina_Config,
O_Base_Types,
O_ASSERT_Types,
O_ASSERT_Properties);
O_Base_Types);
AADLv2_Ocarina_Property_Sets : aliased Ocarina_Property_Set_Array_Type :=
(O_Data_Model,
......@@ -71,9 +69,6 @@ package body Ocarina.Property_Sets is
O_Transformations,
O_POK_Properties,
O_Base_Types,
O_Taste_Properties,
O_ARINC653,
O_ASSERT_Properties,
O_Replication_Properties);
Ocarina_Property_Sets_Table : constant array
......@@ -86,6 +81,8 @@ package body Ocarina.Property_Sets is
Standard_Property_Set_Mask : constant Byte := 2**2;
Ocarina_Property_Set_Mask : constant Byte := 2**3;
Use_Taste_Properties : Boolean := False;
function Internal_Name (N : Name_Id) return Name_Id;
function Internal_Name (S : String) return Name_Id;
......@@ -235,7 +232,12 @@ package body Ocarina.Property_Sets is
function Ocarina_Property_Sets return Ocarina_Property_Set_Array_Type is
begin
return Ocarina_Property_Sets_Table (AADL_Version).all;
if Use_Taste_Properties then
return Ocarina_Property_Sets_Table (AADL_Version).all
& O_Taste_Properties;
else
return Ocarina_Property_Sets_Table (AADL_Version).all;
end if;
end Ocarina_Property_Sets;
-------------------------
......@@ -251,4 +253,13 @@ package body Ocarina.Property_Sets is
Set_Name_Table_Byte (N, B or User_Defined_Mask);
end Set_As_User_Defined;
-------------------------------
-- Activate_Taste_Properties --
-------------------------------
procedure Activate_Taste_Properties is
begin
Use_Taste_Properties := True;
end Activate_Taste_Properties;
end Ocarina.Property_Sets;
......@@ -96,4 +96,8 @@ package Ocarina.Property_Sets is
function Ocarina_Property_Sets return Ocarina_Property_Set_Array_Type;
procedure Activate_Taste_Properties;
-- Special case to activate TASTE property sets as additional
-- Ocarina property set
end Ocarina.Property_Sets;
......@@ -248,3 +248,54 @@ AC_MSG_RESULT($HAVE_GNATMAKE_APDIR)
AM_CONDITIONAL(HAS_GNATMAKE_APDIR, [test "x$HAVE_GNATMAKE_APDIR" = "xyes"])
AC_SUBST(HAVE_GNATMAKE_APDIR)
])
dnl AM_GPRBUILD
dnl adapted from GtkAda
AC_DEFUN(AM_GPRBUILD,
[
AC_PATH_PROG(GPRBUILD, gprbuild, no)
AC_PATH_PROG(GPRINSTALL, gprinstall, no)
if test x$GPRBUILD = xno ; then
AC_MSG_ERROR(I could not find gprbuild. .)
fi
AC_MSG_CHECKING(that your gnat compiler works with a simple example)
rm -f conftest.adb
cat << EOF > conftest.adb
with Ada.Text_IO;
procedure Conftest is
Conftest_Ok : Ada.Text_IO.File_Type;
begin
Ada.Text_IO.Create (File => Conftest_Ok,
Name => "$conftest_ok");
Ada.Text_IO.Close (Conftest_Ok);
end Conftest;
EOF
cat <<EOF > conftest.gpr
project Conftest is
for Main use ("conftest.adb");
for Source_Files use ("conftest.adb");
end Conftest;
EOF
$GPRBUILD -q -P conftest.gpr > /dev/null
rm -f auto.cgpr b__conftest.*
if ( test ! -x conftest ) then
AC_MSG_RESULT(no)
AC_MSG_ERROR($GPRBUILD test failed at compile time! Check your configuration.)
fi
./conftest
if ( test ! -f $conftest_ok ) then
AC_MSG_RESULT(no)
AC_MSG_ERROR($GPRBUILD test failed at run time! Check your configuration.)
fi
AC_MSG_RESULT(yes)
])
......@@ -409,7 +409,6 @@ virtual processor)
end POK;
package Base_Types
public
with data_model;
......@@ -521,425 +520,6 @@ public
end Base_Types;
property set Taste is
Interface_Coordinates : aadlstring
applies to (subprogram access, bus access);
Coordinates : aadlstring
applies to (system, package, device, memory, processor, process, access, subprogram access, connection, bus, virtual bus, feature group);
Fill_Color : aadlstring
applies to (system, device, processor, process, bus);
HWLibraries : list of aadlstring
applies to (package);
Data_Transport : enumeration (legacy, asn1)
applies to (device, abstract);
Importance : enumeration (low, medium, high)
applies to (system, subprogram access, access);
APLC_Binding : list of reference (
process)
applies to (process, device, system);
APLC_Properties : record (APLC : aadlstring; Coordinates : aadlstring; Source_Language : Supported_Source_Language;)
applies to (process);
ASN1_types : type enumeration (asequenceof, asequence, aenumerated, aset, asetof, ainteger, aboolean, areal, achoice, aoctetstring, astring);
ASN1_Basic_Type : Taste::ASN1_types
applies to (data);