Commit 45ac55a3 authored by Julien's avatar Julien
Browse files

improve configuration file generation

parent 4c6893bc
...@@ -968,12 +968,67 @@ package body Ocarina.Backends.Deos_Conf.Mapping is ...@@ -968,12 +968,67 @@ package body Ocarina.Backends.Deos_Conf.Mapping is
------------------- -------------------
function Map_Partition (Process : Node_Id; function Map_Partition (Process : Node_Id;
Runtime : Node_Id) return Node_Id is Runtime : Node_Id;
Partition_Identifier : Integer)
return Node_Id is
pragma Unreferenced (Process); pragma Unreferenced (Process);
pragma Unreferenced (Runtime);
Partition_Node : Node_Id; Partition_Node : Node_Id;
begin begin
Partition_Node := Make_XML_Node ("Partition"); Partition_Node := Make_XML_Node ("Partition");
XTU.Add_Attribute ("Name",
Get_Name_String
(AIN.Name
(Identifier
(Parent_Subcomponent
(Runtime)))),
Partition_Node);
XTU.Add_Attribute ("Identifier",
Integer'Image (Partition_Identifier),
Partition_Node);
XTU.Add_Attribute ("Period", "25000000", Partition_Node);
XTU.Add_Attribute ("Duration", "6000000", Partition_Node);
XTU.Add_Attribute ("ExecutableImageName",
Get_Name_String
(AIN.Name
(Identifier
(Parent_Subcomponent
(Runtime)))) & ".exe", Partition_Node);
XTU.Add_Attribute ("MainProcessStackSizeInPages", "1", Partition_Node);
XTU.Add_Attribute ("BreakAtStartup", "no", Partition_Node);
XTU.Add_Attribute ("InDebugSet", "no", Partition_Node);
XTU.Add_Attribute ("MapConfigurationFileTo", "RAM", Partition_Node);
XTU.Add_Attribute ("ExecuteFrom", "RAM", Partition_Node);
XTU.Add_Attribute ("PartitionUsesFPU", "no", Partition_Node);
XTU.Add_Attribute ("ProcessStackSpaceInPages", "6", Partition_Node);
XTU.Add_Attribute ("MinimumProcessStackSizeInBytes",
"512", Partition_Node);
XTU.Add_Attribute ("ProcessQuota", "4", Partition_Node);
XTU.Add_Attribute ("BlackboardQuota", "1", Partition_Node);
XTU.Add_Attribute ("BlackboardMessageSpaceInBytes",
"256", Partition_Node);
XTU.Add_Attribute ("BufferQuota", "0", Partition_Node);
XTU.Add_Attribute ("BufferMessageSpaceInBytes", "0", Partition_Node);
XTU.Add_Attribute ("SemaphoreQuota", "0", Partition_Node);
XTU.Add_Attribute ("EventQuota", "1", Partition_Node);
XTU.Add_Attribute ("MaximumPartitionLockLevel", "16", Partition_Node);
XTU.Add_Attribute ("MinimumProcessPriority", "1", Partition_Node);
XTU.Add_Attribute ("MaximumProcessPriority", "239", Partition_Node);
XTU.Add_Attribute ("LoggingFunction", "", Partition_Node);
XTU.Add_Attribute ("DeosKernelAttributeAccess",
"no", Partition_Node);
XTU.Add_Attribute ("ProcessStackGapSizeInDwords",
"0", Partition_Node);
XTU.Add_Attribute ("ProcessStackTagIntervalInDwords",
"0", Partition_Node);
XTU.Add_Attribute ("SourcePortSharedMemoryType",
"DeosSharedMemory", Partition_Node);
XTU.Add_Attribute ("PlatformResourcePhysicalAddress",
"0x0", Partition_Node);
XTU.Add_Attribute ("PlatformResourceSizeInPages", "0", Partition_Node);
XTU.Add_Attribute ("PlatformResourceCachePolicy", "off", Partition_Node);
XTU.Add_Attribute ("HealthMonitorEventLogSize", "30", Partition_Node);
XTU.Add_Attribute ("EventLoggingEnabled", "yes", Partition_Node);
return Partition_Node; return Partition_Node;
end Map_Partition; end Map_Partition;
......
...@@ -17,7 +17,8 @@ package Ocarina.Backends.Deos_Conf.Mapping is ...@@ -17,7 +17,8 @@ package Ocarina.Backends.Deos_Conf.Mapping is
function Map_Virtual_Processor (E : Node_Id) return Node_Id; function Map_Virtual_Processor (E : Node_Id) return Node_Id;
function Map_Processor (E : Node_Id) return Node_Id; function Map_Processor (E : Node_Id) return Node_Id;
function Map_Partition (Process : Node_Id; function Map_Partition (Process : Node_Id;
Runtime : Node_Id) return Node_Id; Runtime : Node_Id;
Partition_Identifier : Integer) return Node_Id;
function Map_Bus (E : Node_Id) return Node_Id; function Map_Bus (E : Node_Id) return Node_Id;
function Map_Port_Connection (E : Node_Id) return Node_Id; function Map_Port_Connection (E : Node_Id) return Node_Id;
function Map_Process_Memory (Process : Node_Id) return Node_Id; function Map_Process_Memory (Process : Node_Id) return Node_Id;
......
...@@ -21,10 +21,12 @@ package body Ocarina.Backends.Deos_Conf.Partitions is ...@@ -21,10 +21,12 @@ package body Ocarina.Backends.Deos_Conf.Partitions is
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;
Root_Node : Node_Id := No_Node; Root_Node : Node_Id := No_Node;
Partitions_Node : Node_Id := No_Node; Partitions_Node : Node_Id := No_Node;
Memory_Regions : Node_Id := No_Node; Memory_Regions : Node_Id := No_Node;
Partition_Identifier : Integer := 0;
procedure Visit_Architecture_Instance (E : Node_Id); procedure Visit_Architecture_Instance (E : Node_Id);
procedure Visit_Component_Instance (E : Node_Id); procedure Visit_Component_Instance (E : Node_Id);
...@@ -47,6 +49,14 @@ package body Ocarina.Backends.Deos_Conf.Partitions is ...@@ -47,6 +49,14 @@ package body Ocarina.Backends.Deos_Conf.Partitions is
N : Node_Id; N : Node_Id;
begin begin
N := Make_XML_Node ("MemoryRegion"); N := Make_XML_Node ("MemoryRegion");
XTU.Add_Attribute ("Name", "Initial RAM Pool", N);
XTU.Add_Attribute ("Type", "Initial RAM Pool", N);
XTU.Add_Attribute ("Address", "0x0", N);
XTU.Add_Attribute ("Size", "0x19000", N);
XTU.Add_Attribute ("AccessRights", "READ_WRITE", N);
XTU.Add_Attribute ("PlatformMemoryPool", "0", N);
return N; return N;
end Make_Default_Memory_Region; end Make_Default_Memory_Region;
...@@ -203,6 +213,8 @@ package body Ocarina.Backends.Deos_Conf.Partitions is ...@@ -203,6 +213,8 @@ package body Ocarina.Backends.Deos_Conf.Partitions is
Push_Entity (P); Push_Entity (P);
Push_Entity (U); Push_Entity (U);
Partition_Identifier := 0;
Current_XML_Node := XTN.Root_Node (XTN.XML_File (U)); Current_XML_Node := XTN.Root_Node (XTN.XML_File (U));
Partitions_Node := Make_XML_Node ("Partitions"); Partitions_Node := Make_XML_Node ("Partitions");
...@@ -258,7 +270,9 @@ package body Ocarina.Backends.Deos_Conf.Partitions is ...@@ -258,7 +270,9 @@ package body Ocarina.Backends.Deos_Conf.Partitions is
if Corresponding_Process /= No_Node then if Corresponding_Process /= No_Node then
Append_Node_To_List Append_Node_To_List
(Map_Partition (Corresponding_Process, E), (Map_Partition (Corresponding_Process,
E,
Partition_Identifier),
XTN.Subitems (Partitions_Node)); XTN.Subitems (Partitions_Node));
end if; end if;
......
-- with Locations; -- with Locations;
with Ocarina.Namet; use Ocarina.Namet;
with Ocarina.ME_AADL; with Ocarina.ME_AADL;
with Ocarina.ME_AADL.AADL_Instances.Nodes; with Ocarina.ME_AADL.AADL_Instances.Nodes;
with Ocarina.ME_AADL.AADL_Instances.Nutils; with Ocarina.ME_AADL.AADL_Instances.Nutils;
...@@ -20,7 +21,9 @@ package body Ocarina.Backends.Deos_Conf.Schedule is ...@@ -20,7 +21,9 @@ package body Ocarina.Backends.Deos_Conf.Schedule is
-- use Ocarina.Backends.Deos_Conf.Mapping; -- use Ocarina.Backends.Deos_Conf.Mapping;
package AINU renames Ocarina.ME_AADL.AADL_Instances.Nutils; package AINU renames Ocarina.ME_AADL.AADL_Instances.Nutils;
package AIN renames Ocarina.ME_AADL.AADL_Instances.Nodes;
package XTN renames Ocarina.Backends.XML_Tree.Nodes; package XTN renames Ocarina.Backends.XML_Tree.Nodes;
package XTU renames Ocarina.Backends.XML_Tree.Nutils;
Root_Node : Node_Id := No_Node; Root_Node : Node_Id := No_Node;
Schedule_Node : Node_Id := No_Node; Schedule_Node : Node_Id := No_Node;
...@@ -157,6 +160,9 @@ package body Ocarina.Backends.Deos_Conf.Schedule is ...@@ -157,6 +160,9 @@ package body Ocarina.Backends.Deos_Conf.Schedule is
Schedule_Node := Make_XML_Node ("Schedule"); Schedule_Node := Make_XML_Node ("Schedule");
XTU.Add_Attribute ("MajorFrameLength",
"Automatic", Schedule_Node);
Append_Node_To_List Append_Node_To_List
(Schedule_Node, (Schedule_Node,
XTN.Subitems (Current_XML_Node)); XTN.Subitems (Current_XML_Node));
...@@ -183,16 +189,27 @@ package body Ocarina.Backends.Deos_Conf.Schedule is ...@@ -183,16 +189,27 @@ package body Ocarina.Backends.Deos_Conf.Schedule is
-------------------------------------- --------------------------------------
procedure Visit_Virtual_Processor_Instance (E : Node_Id) is procedure Visit_Virtual_Processor_Instance (E : Node_Id) is
S : Node_Id; Time_Window_Node : Node_Id;
begin begin
if not AINU.Is_Empty (Subcomponents (E)) then Time_Window_Node := Make_XML_Node ("PartitionTimeWindow");
S := First_Node (Subcomponents (E));
while Present (S) loop
Visit (Corresponding_Instance (S)); Append_Node_To_List
S := Next_Node (S); (Time_Window_Node,
end loop; XTN.Subitems (Schedule_Node));
end if;
XTU.Add_Attribute ("Duration", "6000000", Time_Window_Node);
XTU.Add_Attribute ("Offset", "0", Time_Window_Node);
XTU.Add_Attribute ("PeriodicProcessingStart", "", Time_Window_Node);
XTU.Add_Attribute ("RepeatWindowAtNanosecondInterval",
"PartitionPeriod", Time_Window_Node);
XTU.Add_Attribute ("InhibitEarlyCompletion", "false", Time_Window_Node);
XTU.Add_Attribute ("PartitionNameRef",
Get_Name_String
(AIN.Name
(Identifier
(Parent_Subcomponent
(E)))),
Time_Window_Node);
end Visit_Virtual_Processor_Instance; end Visit_Virtual_Processor_Instance;
end Ocarina.Backends.Deos_Conf.Schedule; end Ocarina.Backends.Deos_Conf.Schedule;
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