Commit 3a46bcf5 authored by Julien's avatar Julien

Improving VxWorks653 conf code generator

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