Commit d4653207 authored by Julien's avatar Julien
Browse files

* Ability to handle a thread with a port

   connected to multiple inter-partitions ports
   Make then successive calls to queueing_send or sampling_write
parent afe3a296
......@@ -1330,11 +1330,19 @@ package body Ocarina.Backends.POK_C.Activity is
(Get_Port_By_Name (F, Current_Device))
then
Source_Port := First_Node (Destinations (F));
while Source_Port /= No_Node loop
Call_Parameters := New_List (CTN.K_Parameter_List);
if AIN.First_Node (AIN.Destinations (F)) /=
No_Node
then
Map_Virtual_Bus_Calls
(AIN.Item (AIN.First_Node (AIN.Destinations (F))),
(AIN.Item
(AIN.First_Node
(AIN.Destinations (F))),
CTN.Declarations (Current_File),
WStatements,
Sending,
......@@ -1345,7 +1353,8 @@ package body Ocarina.Backends.POK_C.Activity is
Append_Node_To_List
(Make_Defining_Identifier
(Map_Port_Var (F, Current_Device)),
(Map_Port_Var
(Item (Source_Port), Current_Device)),
Call_Parameters);
if Virtual_Bus_Data = No_Node then
......@@ -1391,11 +1400,14 @@ package body Ocarina.Backends.POK_C.Activity is
Append_Node_To_List (N, Call_Parameters);
if Use_ARINC653_API then
Add_Return_Variable_In_Parameters (Call_Parameters);
Called_Function := RE (RE_Write_Sampling_Message);
Add_Return_Variable_In_Parameters
(Call_Parameters);
Called_Function :=
RE (RE_Write_Sampling_Message);
Type_Used := RE (RE_Sampling_Port_Id_Type);
else
Called_Function := RE (RE_Pok_Port_Sampling_Write);
Called_Function :=
RE (RE_Pok_Port_Sampling_Write);
Type_Used := RE (RE_Uint8_T);
end if;
......@@ -1409,7 +1421,9 @@ package body Ocarina.Backends.POK_C.Activity is
(Make_Variable_Declaration
(Defining_Identifier =>
(Make_Defining_Identifier
(Map_Port_Var (F, Current_Device))),
(Map_Port_Var
(Item (Source_Port),
Current_Device))),
Used_Type => Type_Used)),
CTN.Declarations (Current_File));
......@@ -1417,6 +1431,8 @@ package body Ocarina.Backends.POK_C.Activity is
POK_Add_Return_Assertion (WStatements);
Source_Port := Next_Node (Source_Port);
end loop;
elsif Get_Connection_Pattern (F) = Intra_Process then
Append_Node_To_List
(Make_Defining_Identifier (Map_Port_Var (F)),
......@@ -1490,8 +1506,15 @@ package body Ocarina.Backends.POK_C.Activity is
Current_Device);
end if;
Source_Port := AIN.First_Node (AIN.Destinations (F));
while (Source_Port /= No_Node) loop
Call_Parameters := New_List (CTN.K_Parameter_List);
Append_Node_To_List
(Make_Defining_Identifier (Map_Port_Var (F)),
(Make_Defining_Identifier
(Map_Port_Var (Item (Source_Port))),
Call_Parameters);
if Get_Data_Representation
......@@ -1504,7 +1527,8 @@ package body Ocarina.Backends.POK_C.Activity is
else
Append_Node_To_List
(Make_Variable_Address
(Make_Defining_Identifier (Map_Port_Data (F))),
(Make_Defining_Identifier
(Map_Port_Data (F))),
Call_Parameters);
end if;
......@@ -1520,18 +1544,21 @@ package body Ocarina.Backends.POK_C.Activity is
N := Map_Time (Get_Timeout_Value (F));
end if;
else
N := CTU.Make_Literal (CV.New_Int_Value (0, 1, 10));
N := CTU.Make_Literal
(CV.New_Int_Value (0, 1, 10));
end if;
Append_Node_To_List (N, Call_Parameters);
if Use_ARINC653_API then
Add_Return_Variable_In_Parameters (Call_Parameters);
Add_Return_Variable_In_Parameters
(Call_Parameters);
Called_Function := RE (RE_Send_Queuing_Message);
Type_Used := RE (RE_Queuing_Port_Id_Type);
else
Called_Function := RE (RE_Pok_Port_Queueing_Send);
Called_Function := RE
(RE_Pok_Port_Queueing_Send);
Type_Used := RE (RE_Uint8_T);
end if;
......@@ -1545,14 +1572,15 @@ package body Ocarina.Backends.POK_C.Activity is
(Make_Variable_Declaration
(Defining_Identifier =>
(Make_Defining_Identifier
(Map_Port_Var (F))),
(Map_Port_Var
(Item (Source_Port)))),
Used_Type => Type_Used)),
CTN.Declarations (Current_File));
Append_Node_To_List (N, WStatements);
POK_Add_Return_Assertion (WStatements);
Source_Port := Next_Node (Source_Port);
end loop;
elsif Get_Connection_Pattern (F) = Intra_Process
and then not Is_Virtual
(Get_Port_By_Name (F, Current_Device))
......
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