Commit 6617ca90 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files
parents a4708757 44ffa149
...@@ -45,6 +45,7 @@ with Ocarina.Backends.Utils; ...@@ -45,6 +45,7 @@ with Ocarina.Backends.Utils;
with Ocarina.Backends.XML_Tree.Nodes; with Ocarina.Backends.XML_Tree.Nodes;
with Ocarina.Backends.XML_Tree.Nutils; with Ocarina.Backends.XML_Tree.Nutils;
with Ocarina.Backends.XML_Values; with Ocarina.Backends.XML_Values;
with Ocarina.Backends.C_Common.Mapping;
package body Ocarina.Backends.AIR_Conf.AIR_Configuration is package body Ocarina.Backends.AIR_Conf.AIR_Configuration is
...@@ -56,6 +57,7 @@ package body Ocarina.Backends.AIR_Conf.AIR_Configuration is ...@@ -56,6 +57,7 @@ package body Ocarina.Backends.AIR_Conf.AIR_Configuration is
use Ocarina.Backends.Properties.ARINC653; use Ocarina.Backends.Properties.ARINC653;
use Ocarina.Backends.Utils; use Ocarina.Backends.Utils;
use Ocarina.Backends.XML_Tree.Nutils; use Ocarina.Backends.XML_Tree.Nutils;
use Ocarina.Backends.C_Common.Mapping;
package AIN renames Ocarina.ME_AADL.AADL_Instances.Nodes; package AIN renames Ocarina.ME_AADL.AADL_Instances.Nodes;
package AINU renames Ocarina.ME_AADL.AADL_Instances.Nutils; package AINU renames Ocarina.ME_AADL.AADL_Instances.Nutils;
...@@ -150,21 +152,20 @@ package body Ocarina.Backends.AIR_Conf.AIR_Configuration is ...@@ -150,21 +152,20 @@ package body Ocarina.Backends.AIR_Conf.AIR_Configuration is
while Present (C) loop while Present (C) loop
if Kind (C) = K_Connection_Instance then if Kind (C) = K_Connection_Instance then
Source_Port_Name := Source_Port_Name :=
AIN.Name Map_C_Enumerator_Name
(AIN.Identifier
(AIN.Item (AIN.Item
(AIN.Next_Node (AIN.Next_Node
(AIN.First_Node (AIN.Path (AIN.Source (C))))))); (AIN.First_Node (AIN.Path (AIN.Source (C))))),
Fully_Qualify_Parent => True);
Destination_Port_Name := Destination_Port_Name :=
AIN.Name Map_C_Enumerator_Name
(AIN.Identifier
(AIN.Item (AIN.Item
(AIN.Next_Node (AIN.Next_Node
(AIN.First_Node (AIN.First_Node
(AIN.Path (AIN.Destination (C))))))); (AIN.Path (AIN.Destination (C))))),
Fully_Qualify_Parent => True);
Source_Partition := Source_Partition :=
AIN.Corresponding_Instance AIN.Corresponding_Instance
......
...@@ -40,6 +40,7 @@ with Ocarina.ME_AADL.AADL_Instances.Nutils; ...@@ -40,6 +40,7 @@ with Ocarina.ME_AADL.AADL_Instances.Nutils;
with Ocarina.ME_AADL.AADL_Instances.Entities; with Ocarina.ME_AADL.AADL_Instances.Entities;
with Ocarina.ME_AADL.AADL_Tree.Entities; with Ocarina.ME_AADL.AADL_Tree.Entities;
with Ocarina.Backends.C_Common.Mapping;
with Ocarina.Backends.Utils; with Ocarina.Backends.Utils;
with Ocarina.Instances.Queries; with Ocarina.Instances.Queries;
...@@ -58,6 +59,7 @@ package body Ocarina.Backends.AIR_Conf.Partitions is ...@@ -58,6 +59,7 @@ package body Ocarina.Backends.AIR_Conf.Partitions is
use Ocarina.ME_AADL.AADL_Instances.Entities; use Ocarina.ME_AADL.AADL_Instances.Entities;
use Ocarina.Instances.Queries; use Ocarina.Instances.Queries;
use Ocarina.Backends.C_Common.Mapping;
use Ocarina.Backends.Utils; use Ocarina.Backends.Utils;
use Ocarina.Backends.Messages; use Ocarina.Backends.Messages;
...@@ -269,12 +271,15 @@ package body Ocarina.Backends.AIR_Conf.Partitions is ...@@ -269,12 +271,15 @@ package body Ocarina.Backends.AIR_Conf.Partitions is
Port_Node := Make_XML_Node ("Queuing_Port"); Port_Node := Make_XML_Node ("Queuing_Port");
end if; end if;
-- Port name -- Port name: partition + port name
Set_Str_To_Name_Buffer ("Name"); Set_Str_To_Name_Buffer ("Name");
P := Make_Defining_Identifier (Name_Find); P := Make_Defining_Identifier (Name_Find);
Get_Name_String (Display_Name (Identifier (F))); Get_Name_String
(Map_C_Enumerator_Name (F,
Fully_Qualify_Parent => True));
Q := Make_Defining_Identifier (To_Lower (Name_Find)); Q := Make_Defining_Identifier (To_Lower (Name_Find));
Append_Node_To_List Append_Node_To_List
(Make_Assignement (P, Q), (Make_Assignement (P, Q),
......
...@@ -928,6 +928,7 @@ package body Ocarina.Backends.C_Common.Mapping is ...@@ -928,6 +928,7 @@ package body Ocarina.Backends.C_Common.Mapping is
function Map_C_Enumerator_Name function Map_C_Enumerator_Name
(E : Node_Id; (E : Node_Id;
Custom_Parent : Node_Id := No_Node; Custom_Parent : Node_Id := No_Node;
Fully_Qualify_Parent : Boolean := False;
Entity : Boolean := False; Entity : Boolean := False;
Server : Boolean := False; Server : Boolean := False;
Port_Type : Boolean := False; Port_Type : Boolean := False;
...@@ -939,10 +940,19 @@ package body Ocarina.Backends.C_Common.Mapping is ...@@ -939,10 +940,19 @@ package body Ocarina.Backends.C_Common.Mapping is
if Kind (E) = K_Port_Spec_Instance then if Kind (E) = K_Port_Spec_Instance then
C_Name_1 := CTU.To_C_Name (Display_Name (Identifier (E))); C_Name_1 := CTU.To_C_Name (Display_Name (Identifier (E)));
if Fully_Qualify_Parent then
Get_Name_String
(CTU.To_C_Name
(Fully_Qualified_Instance_Name
(Parent_Component ((E)))));
else
Get_Name_String Get_Name_String
(CTU.To_C_Name (CTU.To_C_Name
(Display_Name (Display_Name
(Identifier (Parent_Subcomponent (Parent_Component (E)))))); (Identifier (Parent_Subcomponent
(Parent_Component (E))))));
end if;
if Local_Port then if Local_Port then
Add_Str_To_Name_Buffer ("_local_"); Add_Str_To_Name_Buffer ("_local_");
Get_Name_String_And_Append (C_Name_1); Get_Name_String_And_Append (C_Name_1);
......
...@@ -72,10 +72,12 @@ package Ocarina.Backends.C_Common.Mapping is ...@@ -72,10 +72,12 @@ package Ocarina.Backends.C_Common.Mapping is
function Map_C_Enumerator_Name function Map_C_Enumerator_Name
(E : Node_Id; (E : Node_Id;
Custom_Parent : Node_Id := No_Node; Custom_Parent : Node_Id := No_Node;
Fully_Qualify_Parent : Boolean := False;
Entity : Boolean := False; Entity : Boolean := False;
Server : Boolean := False; Server : Boolean := False;
Port_Type : Boolean := False; Port_Type : Boolean := False;
Local_Port : Boolean := False) return Name_Id; Local_Port : Boolean := False) return Name_Id;
function Map_C_Define_Name function Map_C_Define_Name
(E : Node_Id; (E : Node_Id;
Nb_Ports : Boolean := False; Nb_Ports : Boolean := False;
...@@ -83,6 +85,7 @@ package Ocarina.Backends.C_Common.Mapping is ...@@ -83,6 +85,7 @@ package Ocarina.Backends.C_Common.Mapping is
Max_Dispatch_Transitions_Per_Complete_State : Boolean := False; Max_Dispatch_Transitions_Per_Complete_State : Boolean := False;
Max_Dispatch_Triggers_Per_Dispatch_Transition : Boolean := False) Max_Dispatch_Triggers_Per_Dispatch_Transition : Boolean := False)
return Name_Id; return Name_Id;
function Map_C_Full_Parameter_Name function Map_C_Full_Parameter_Name
(Spg : Node_Id; (Spg : Node_Id;
P : Node_Id; P : Node_Id;
......
...@@ -1772,11 +1772,29 @@ package body Ocarina.Backends.PO_HI_C.Deployment is ...@@ -1772,11 +1772,29 @@ package body Ocarina.Backends.PO_HI_C.Deployment is
(N, (N,
CTN.Values (Global_Port_To_Entity)); CTN.Values (Global_Port_To_Entity));
-- For each feature of a thread, we define a
-- global port name as the name of the process
-- port.
--
-- Note: these names are also used by some other
-- backend, e.g. as part of TSP configuration.
declare
F_L : constant List_Id :=
(if Is_In (F) then
AAN.Sources (F) else
AAN.Destinations (F));
F_N : constant Node_Id := AAN.First_Node (F_L);
begin
N := N :=
Make_Literal Make_Literal
(CV.New_Pointed_Char_Value (CV.New_Pointed_Char_Value
(Map_C_Enumerator_Name (F))); (Map_C_Enumerator_Name
Append_Node_To_List (N, CTN.Values (Global_Port_Names)); (Item (F_N),
Fully_Qualify_Parent => True)));
Append_Node_To_List
(N, CTN.Values (Global_Port_Names));
end;
N := N :=
Make_Literal Make_Literal
......
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