Commit 3a46bcf5 authored by Julien's avatar Julien
Browse files

Improving VxWorks653 conf code generator

parent 6c44b2ef
...@@ -9,7 +9,7 @@ with Ocarina.ME_AADL.AADL_Instances.Entities; ...@@ -9,7 +9,7 @@ with Ocarina.ME_AADL.AADL_Instances.Entities;
with Ocarina.Backends.C_Common.Mapping; with Ocarina.Backends.C_Common.Mapping;
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.Vxworks653_Conf.Mapping; with Ocarina.Backends.Vxworks653_Conf.Mapping;
package body Ocarina.Backends.Vxworks653_Conf.Connections is package body Ocarina.Backends.Vxworks653_Conf.Connections is
...@@ -21,9 +21,8 @@ package body Ocarina.Backends.Vxworks653_Conf.Connections is ...@@ -21,9 +21,8 @@ package body Ocarina.Backends.Vxworks653_Conf.Connections is
use Ocarina.ME_AADL.AADL_Instances.Entities; use Ocarina.ME_AADL.AADL_Instances.Entities;
use Ocarina.Backends.XML_Tree.Nutils; use Ocarina.Backends.XML_Tree.Nutils;
-- use Ocarina.Backends.Vxworks653_Conf.Mapping; use Ocarina.Backends.Vxworks653_Conf.Mapping;
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;
package XTN renames Ocarina.Backends.XML_Tree.Nodes; package XTN renames Ocarina.Backends.XML_Tree.Nodes;
...@@ -187,10 +186,7 @@ package body Ocarina.Backends.Vxworks653_Conf.Connections is ...@@ -187,10 +186,7 @@ package body Ocarina.Backends.Vxworks653_Conf.Connections is
Source_Node := Make_XML_Node ("Source"); Source_Node := Make_XML_Node ("Source");
Add_Attribute ("PartitionNameRef", Add_Attribute ("PartitionNameRef",
Get_Name_String Get_Name_String
(AIN.Name (Map_Partition_Name (E)),
(AIN.Identifier
(Parent_Subcomponent
(E)))),
Source_Node); Source_Node);
Add_Attribute ("PortNameRef", Add_Attribute ("PortNameRef",
...@@ -211,11 +207,9 @@ package body Ocarina.Backends.Vxworks653_Conf.Connections is ...@@ -211,11 +207,9 @@ package body Ocarina.Backends.Vxworks653_Conf.Connections is
Add_Attribute ("PartitionNameRef", Add_Attribute ("PartitionNameRef",
Get_Name_String Get_Name_String
(AIN.Name (Map_Partition_Name
(AIN.Identifier
(Parent_Subcomponent
(Get_Partition_Runtime (Get_Partition_Runtime
(Partition_Destination))))), (Partition_Destination))),
Destination_Node); Destination_Node);
Append_Node_To_List (Destination_Node, Append_Node_To_List (Destination_Node,
......
...@@ -10,7 +10,7 @@ with Ocarina.ME_AADL.AADL_Instances.Entities; ...@@ -10,7 +10,7 @@ with Ocarina.ME_AADL.AADL_Instances.Entities;
-- with Ocarina.Backends.Properties; -- with Ocarina.Backends.Properties;
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.Vxworks653_Conf.Mapping; with Ocarina.Backends.Vxworks653_Conf.Mapping;
package body Ocarina.Backends.Vxworks653_Conf.Hm is package body Ocarina.Backends.Vxworks653_Conf.Hm is
...@@ -20,9 +20,8 @@ package body Ocarina.Backends.Vxworks653_Conf.Hm is ...@@ -20,9 +20,8 @@ package body Ocarina.Backends.Vxworks653_Conf.Hm is
use Ocarina.ME_AADL.AADL_Instances.Entities; use Ocarina.ME_AADL.AADL_Instances.Entities;
use Ocarina.Backends.XML_Tree.Nutils; use Ocarina.Backends.XML_Tree.Nutils;
-- use Ocarina.Backends.Properties; -- use Ocarina.Backends.Properties;
-- use Ocarina.Backends.Vxworks653_Conf.Mapping; use Ocarina.Backends.Vxworks653_Conf.Mapping;
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;
package XTN renames Ocarina.Backends.XML_Tree.Nodes; package XTN renames Ocarina.Backends.XML_Tree.Nodes;
package XTU renames Ocarina.Backends.XML_Tree.Nutils; package XTU renames Ocarina.Backends.XML_Tree.Nutils;
...@@ -384,10 +383,8 @@ package body Ocarina.Backends.Vxworks653_Conf.Hm is ...@@ -384,10 +383,8 @@ package body Ocarina.Backends.Vxworks653_Conf.Hm is
Partition_HM_Table_Node := Make_XML_Node ("PartitionHMTable"); Partition_HM_Table_Node := Make_XML_Node ("PartitionHMTable");
XTU.Add_Attribute ("Name", XTU.Add_Attribute ("Name",
Get_Name_String Get_Name_String
(AIN.Name (Map_Partition_Name (Virtual_Processor))
(Identifier & "_hm",
(Parent_Subcomponent
(Virtual_Processor)))),
Partition_HM_Table_Node); Partition_HM_Table_Node);
Settings_Node := Make_XML_Node ("Settings"); Settings_Node := Make_XML_Node ("Settings");
...@@ -408,11 +405,9 @@ package body Ocarina.Backends.Vxworks653_Conf.Hm is ...@@ -408,11 +405,9 @@ package body Ocarina.Backends.Vxworks653_Conf.Hm is
Trusted_Partition_Node := Make_XML_Node ("TrustedPartition"); Trusted_Partition_Node := Make_XML_Node ("TrustedPartition");
XTU.Add_Attribute ("NameRef", XTU.Add_Attribute ("NameRef",
Get_Name_String Get_Name_String
(AIN.Name (Map_Partition_Name
(Identifier (Virtual_Processor)),
(Parent_Subcomponent Trusted_Partition_Node);
(Virtual_Processor)))),
Settings_Node);
Append_Node_To_List (Trusted_Partition_Node, Append_Node_To_List (Trusted_Partition_Node,
XTN.Subitems (Settings_Node)); XTN.Subitems (Settings_Node));
......
...@@ -1121,7 +1121,9 @@ package body Ocarina.Backends.Vxworks653_Conf.Mapping is ...@@ -1121,7 +1121,9 @@ package body Ocarina.Backends.Vxworks653_Conf.Mapping is
Append_Node_To_List (Settings_Node, Append_Node_To_List (Settings_Node,
XTN.Subitems (Partition_Description_Node)); XTN.Subitems (Partition_Description_Node));
XTU.Add_Attribute ("RequiredMemorySize", "0x300000", Settings_Node); XTU.Add_Attribute ("RequiredMemorySize", "0x300000", Settings_Node);
XTU.Add_Attribute ("PartitionHMTable", "part1Hm", Settings_Node); XTU.Add_Attribute ("PartitionHMTable",
Get_Name_String (Map_Partition_Name (Runtime)) & "_hm",
Settings_Node);
XTU.Add_Attribute ("watchDogDuration", "0", Settings_Node); XTU.Add_Attribute ("watchDogDuration", "0", Settings_Node);
XTU.Add_Attribute ("allocDisable", "0", Settings_Node); XTU.Add_Attribute ("allocDisable", "0", Settings_Node);
XTU.Add_Attribute ("numWorkerTasks", "0", Settings_Node); XTU.Add_Attribute ("numWorkerTasks", "0", Settings_Node);
...@@ -1138,32 +1140,34 @@ package body Ocarina.Backends.Vxworks653_Conf.Mapping is ...@@ -1138,32 +1140,34 @@ package body Ocarina.Backends.Vxworks653_Conf.Mapping is
Settings_Node); Settings_Node);
Shared_Library_Region_Node := Make_XML_Node ("SharedLibraryRegion"); Shared_Library_Region_Node := Make_XML_Node ("SharedLibraryRegion");
XTU.Add_Attribute ("NamedRef", "vxSysLib", Shared_Library_Region_Node); XTU.Add_Attribute ("NameRef", "vxSysLib", Shared_Library_Region_Node);
Append_Node_To_List (Shared_Library_Region_Node, Append_Node_To_List (Shared_Library_Region_Node,
XTN.Subitems (Partition_Description_Node)); XTN.Subitems (Partition_Description_Node));
Application_Node := Make_XML_Node ("Application"); Application_Node := Make_XML_Node ("Application");
Append_Node_To_List (Application_Node,
XTN.Subitems (Partition_Description_Node));
XTU.Add_Attribute ("NameRef", XTU.Add_Attribute ("NameRef",
Get_Name_String Get_Name_String
(Map_Partition_Name (Runtime)), (Map_Partition_Name (Runtime, True)),
Partition_Node); Application_Node);
Append_Node_To_List (Application_Node,
XTN.Subitems (Partition_Description_Node));
return Partition_Node; return Partition_Node;
end Map_Partition; end Map_Partition;
function Map_Partition_Name (Runtime : Node_Id) return Name_Id is function Map_Partition_Name (Runtime : Node_Id;
Use_Source_Name : Boolean := False)
return Name_Id is
Result : Name_Id; Result : Name_Id;
begin begin
Result := Get_Source_Name (Runtime); Result := Get_Source_Name (Runtime);
if Result = No_Name then if Result /= No_Name and then Use_Source_Name then
return Result;
end if;
Result := AIN.Name Result := AIN.Name
(Identifier (Identifier
(Parent_Subcomponent (Parent_Subcomponent
(Runtime))); (Runtime)));
end if;
return Result; return Result;
end Map_Partition_Name; end Map_Partition_Name;
......
...@@ -47,6 +47,8 @@ package Ocarina.Backends.Vxworks653_Conf.Mapping is ...@@ -47,6 +47,8 @@ package Ocarina.Backends.Vxworks653_Conf.Mapping is
function Map_Queuing_Port (Port : Node_Id) return Node_Id; function Map_Queuing_Port (Port : Node_Id) return Node_Id;
function Map_Partition_Name (Runtime : Node_Id) return Name_Id; function Map_Partition_Name (Runtime : Node_Id;
Use_Source_Name : Boolean := False)
return Name_Id;
end Ocarina.Backends.Vxworks653_Conf.Mapping; end Ocarina.Backends.Vxworks653_Conf.Mapping;
...@@ -238,7 +238,7 @@ package body Ocarina.Backends.Vxworks653_Conf.Naming is ...@@ -238,7 +238,7 @@ package body Ocarina.Backends.Vxworks653_Conf.Naming is
XTU.Add_Attribute ("Name", XTU.Add_Attribute ("Name",
Get_Name_String Get_Name_String
(Map_Partition_Name (Map_Partition_Name
(AADL_Virtual_Processor)), (AADL_Virtual_Processor, True)),
Application_Node); Application_Node);
Append_Node_To_List (Application_Node, Append_Node_To_List (Application_Node,
XTN.Subitems (XML_Node)); XTN.Subitems (XML_Node));
...@@ -332,7 +332,11 @@ package body Ocarina.Backends.Vxworks653_Conf.Naming is ...@@ -332,7 +332,11 @@ package body Ocarina.Backends.Vxworks653_Conf.Naming is
Trim (Unsigned_Long_Long'Image Trim (Unsigned_Long_Long'Image
(Size), Left), (Size), Left),
Port_Node); Port_Node);
XTU.Add_Attribute ("Name", "1", Port_Node);
XTU.Add_Attribute ("Name",
Get_Name_String
(C_Common.Mapping.Map_Port_Name (Feature)),
Port_Node);
if Is_In (Feature) and then if Is_In (Feature) and then
not Is_Out (Feature) not Is_Out (Feature)
......
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