Commit f1f55451 authored by julien.delange's avatar julien.delange

* ocarina/src/backends/ocarina-backends-properties.adb

   ocarina/src/backends/ocarina-backends-properties.ads
   - Handle immediate_priority_ceiling_protocol and
     priority_inheritance proprty values

 * ocarina/src/backends/ocarina-backends-po_hi_c-deployment.adb
   - Generate variables __po_hi_protected_configuration
     and __po_hi_protected_priorities that describe protected
     variable requirements

 * ocarina/src/backends/ocarina-backends-c_common-types.adb
   - Take in account the new protected types

 * ocarina/src/backends/ocarina-backends-po_hi_c-runtime.ads
   - Add entities RE_Protected_Regular, RE_Protected_PCP,
     RE_Protected_PIP, RE_Protected_Protocol_T, RE_Protected_Configuration,
     RE_Protected_Priorities and RE_Protected_Protocol_T

 * ocarina/resources/AADLv2/aadl_project.aadl
   - Add immediate_priority_ceiling_protocol and
     priority_inheritance proprty as new values
     for Supported_Concurrency_Control_Protocol


git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/ocarina@1645 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent 558c9a0e
......@@ -30,6 +30,8 @@ property set AADL_Project is
Supported_Concurrency_Control_Protocols:
type enumeration (NoneSpecified,
Read_Only,
Priority_Inheritance,
Immediate_Priority_Ceiling_Protocol,
Protected_Access,
Priority_Ceiling_Protocol,
Priority_Ceiling);
......
......@@ -691,7 +691,17 @@ package body Ocarina.Backends.C_Common.Types is
True);
end if;
elsif Get_Concurrency_Protocol (E) =
Concurrency_Protected_Access then
Concurrency_Protected_Access
or else
Get_Concurrency_Protocol (E) =
Concurrency_Immediate_Priority_Ceiling
or else
Get_Concurrency_Protocol (E) =
Concurrency_Priority_Inheritance
or else
Get_Concurrency_Protocol (E) =
Concurrency_Priority_Ceiling
then
-- Protected type that does not have struct members.
-- This piece of code is made to handle declaration
......
......@@ -466,8 +466,8 @@ package body Ocarina.Backends.PO_HI_C.Deployment is
(Nb_Protected, 1, 10));
Bind_AADL_To_Default_Value
(Identifier (C), N);
Nb_Protected := Nb_Protected + 1;
Nb_Protected := Nb_Protected + 1;
else
-- Visit the component instance corresponding to the
-- subcomponent S.
......@@ -1259,6 +1259,10 @@ package body Ocarina.Backends.PO_HI_C.Deployment is
:= Parent_Component (Parent_Subcomponent (E));
Endiannesses : constant Node_Id := Make_Array_Values;
Execution_Platform : Supported_Execution_Platform;
Protected_Configuration : constant Node_Id := Make_Array_Values;
Protected_Priorities : constant Node_Id := Make_Array_Values;
Protected_Protocol : Node_Id;
Protected_Priority : Node_Id;
begin
Push_Entity (P);
Push_Entity (U);
......@@ -1268,11 +1272,73 @@ package body Ocarina.Backends.PO_HI_C.Deployment is
C := First_Node (Subcomponents (E));
while Present (C) loop
if AAU.Is_Data (Corresponding_Instance (C)) then
Protected_Priority :=
Make_Literal (New_Int_Value (0, 1, 10));
case Get_Concurrency_Protocol (Corresponding_Instance (C)) is
when Concurrency_Priority_Ceiling =>
Protected_Priority := Make_Literal
(New_Int_Value
(Get_Priority_Celing_Of_Data_Access
(Corresponding_Instance (C)), 1, 10));
Protected_Protocol := RE (RE_Protected_PCP);
when Concurrency_Immediate_Priority_Ceiling =>
Protected_Protocol := RE (RE_Protected_IPCP);
when Concurrency_Priority_Inheritance =>
Protected_Protocol := RE (RE_Protected_PIP);
when others =>
Protected_Protocol := RE (RE_Protected_Regular);
end case;
Append_Node_To_List
(Protected_Protocol, CTN.Values (Protected_Configuration));
Append_Node_To_List
(Protected_Priority,
CTN.Values (Protected_Priorities));
end if;
Visit (Corresponding_Instance (C));
C := Next_Node (C);
end loop;
end if;
if not Is_Empty (CTN.Values (Protected_Configuration)) then
N := Make_Expression
(Left_Expr =>
Make_Variable_Declaration
(Defining_Identifier =>
Make_Array_Declaration
(Defining_Identifier =>
RE (RE_Protected_Configuration),
Array_Size =>
RE (RE_Nb_Protected)),
Used_Type =>
RE (RE_Protected_Protocol_T)),
Operator => Op_Equal,
Right_Expr => Protected_Configuration);
Append_Node_To_List (N, CTN.Declarations (Current_File));
N := Make_Expression
(Left_Expr =>
Make_Variable_Declaration
(Defining_Identifier =>
Make_Array_Declaration
(Defining_Identifier =>
RE (RE_Protected_Priorities),
Array_Size =>
RE (RE_Nb_Protected)),
Used_Type =>
RE (RE_Uint8_T)),
Operator => Op_Equal,
Right_Expr => Protected_Priorities);
Append_Node_To_List (N, CTN.Declarations (Current_File));
end if;
if Present (Backend_Node (Identifier (S))) and then
Present (CTN.Global_Port_Node (Backend_Node (Identifier (S)))) then
N := Make_Expression
......
......@@ -152,6 +152,10 @@ package Ocarina.Backends.PO_HI_C.Runtime is
RE_No_Device, -- __PO_HI_NO_DEVICE
RE_Unused_Node, -- __PO_HI_UNUSED_NODE
RE_Nb_Protected, -- __PO_HI_NB_PROTECTED
RE_Protected_Regular, -- __PO_HI_PROTECTED_REGULAR
RE_Protected_PIP, -- __PO_HI_PROTECTED_PIP
RE_Protected_PCP, -- __PO_HI_PROTECTED_PCP
RE_Protected_IPCP, -- __PO_HI_PROTECTED_IPCP
RE_Nb_Nodes, -- __PO_HI_NB_NODES
RE_Nb_Devices, -- __PO_HI_NB_DEVICES
RE_My_Node, -- __PO_HI_MY_NODE
......@@ -175,6 +179,7 @@ package Ocarina.Backends.PO_HI_C.Runtime is
RE_Entity_Server_T, -- __po_hi_entity_server_t
RE_Operation_T, -- __po_hi_operation_t
RE_Request_T, -- __po_hi_request_t
RE_Protected_Protocol_T, -- __po_hi_protected_protocol_t
RE_Bool_T, -- __po_hi_bool_t
RE_Asn1_Pkt_T, -- __po_hi_asn1_pkt_t
RE_Asn1_Buffer_T, -- __po_hi_asn1_buffer_t
......@@ -197,6 +202,8 @@ package Ocarina.Backends.PO_HI_C.Runtime is
RE_Operation_Names, -- __po_hi_operation_names
RE_Ports_Names, -- __po_hi_port_names
RE_Devices_Naming, -- __po_hi_devices_naming
RE_Protected_Configuration, -- __po_hi_protected_configuration
RE_Protected_Priorities, -- __po_hi_protected_priorities
RE_Port_To_Device, -- __po_hi_port_to_device
RE_Port_Global_To_Entity, -- __po_hi_port_global_to_entity
RE_Port_Global_To_Device, -- __po_hi_port_global_to_device
......@@ -318,6 +325,7 @@ package Ocarina.Backends.PO_HI_C.Runtime is
RE_Float64_T => RH_PO_HI_Types,
RE_Node_T => RH_Deployment,
RE_Operation_T => RH_Request,
RE_Protected_Protocol_T => RH_PO_HI_Protected,
RE_Request_T => RH_Request,
-- Runtime Constants associations
......@@ -342,6 +350,12 @@ package Ocarina.Backends.PO_HI_C.Runtime is
RE_Gqueue_Fifo_Indata => RH_PO_HI_Gqueue,
RE_Gqueue_Fifo_Out => RH_PO_HI_Gqueue,
RE_Nb_Operations => RH_Request,
RE_Protected_Configuration => RH_PO_HI_Protected,
RE_Protected_Priorities => RH_PO_HI_Protected,
RE_Protected_Regular => RH_PO_HI_Protected,
RE_Protected_PIP => RH_PO_HI_Protected,
RE_Protected_PCP => RH_PO_HI_Protected,
RE_Protected_IPCP => RH_PO_HI_Protected,
RE_Noaddr => RH_PO_HI_Transport,
RE_No_Device => RH_Deployment,
RE_Noport => RH_PO_HI_Transport,
......
......@@ -250,7 +250,9 @@ package body Ocarina.Backends.Properties is
Concurrency_Read_Only_Name : Name_Id;
Concurrency_Protected_Access_Name : Name_Id;
Concurrency_Priority_Ceiling_Name : Name_Id;
Concurrency_Immediate_Priority_Ceiling_Name : Name_Id;
Concurrency_Priority_Ceiling_Protocol_Name : Name_Id;
Concurrency_Priority_Inheritance_Name : Name_Id;
Language_Ada_Name : Name_Id;
Language_Ada_95_Name : Name_Id;
......@@ -1282,6 +1284,16 @@ package body Ocarina.Backends.Properties is
return Concurrency_Priority_Ceiling;
elsif C_Name = Concurrency_Priority_Inheritance_Name then
return Concurrency_Priority_Inheritance;
elsif C_Name =
Concurrency_Immediate_Priority_Ceiling_Name
then
return Concurrency_Immediate_Priority_Ceiling;
else
Display_Located_Error
(AIN.Loc (D),
......@@ -2994,6 +3006,12 @@ package body Ocarina.Backends.Properties is
Concurrency_Priority_Ceiling_Name := Get_String_Name
("priority_ceiling");
Concurrency_Immediate_Priority_Ceiling_Name := Get_String_Name
("immediate_priority_ceiling_protocol");
Concurrency_Priority_Inheritance_Name := Get_String_Name
("priority_inheritance");
Concurrency_Priority_Ceiling_Protocol_Name := Get_String_Name
("priority_ceiling_protocol");
......
......@@ -256,6 +256,8 @@ package Ocarina.Backends.Properties is
(Concurrency_NoneSpecified,
Concurrency_Read_Only,
Concurrency_Protected_Access,
Concurrency_Immediate_Priority_Ceiling,
Concurrency_Priority_Inheritance,
Concurrency_Priority_Ceiling);
type Supported_IEEE754_Precision is
......
Markdown is supported
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