Commit 4f64f134 authored by Julien's avatar Julien

DEOS configuration and partition is correctly

generated.
parent a1647df7
......@@ -2986,8 +2986,8 @@ package body Ocarina.Backends.C_Common.Mapping is
end if;
Get_Name_String (Display_Name (Identifier (Parent)));
Add_Str_To_Name_Buffer ("_");
else
if Is_Out (E) then
F := Item (AIN.First_Node (Get_Destination_Ports (E)));
......@@ -3026,7 +3026,30 @@ package body Ocarina.Backends.C_Common.Mapping is
is
N : Name_Id;
begin
N := Map_Port (E, Containing_Component);
--
-- Typically, the following block of code is used
-- to prefix the port name by the parent subcomponent
-- name. For DeOS, we do not prefix by the subcomponent,
-- Port Name have to be the same.
--
if Get_Connection_Pattern (E) = Inter_Process and then
POK_Flavor = DEOS
then
if Is_In (E) then
Get_Name_String (Display_Name (Identifier (E)));
else
Get_Name_String
(Display_Name
(Identifier
(Item (AIN.First_Node (Destinations (E))))));
end if;
N := Name_Find;
else
N := Map_Port (E, Containing_Component);
end if;
if Is_Global then
Get_Name_String (N);
......
with Ada.Strings; use Ada.Strings;
with Ada.Strings.Fixed; use Ada.Strings.Fixed;
-- with Locations;
with Ocarina.ME_AADL;
with Ocarina.ME_AADL.AADL_Instances.Nodes;
with Ocarina.ME_AADL.AADL_Instances.Nutils;
......@@ -192,6 +196,7 @@ package body Ocarina.Backends.Deos_Conf.Hm is
System_Errors : Node_Id;
Multi_Partition_HM : Node_Id;
Partition_HM : Node_Id;
Partition_Identifier : Unsigned_Long_Long;
begin
U := XTN.Unit (Backend_Node (Identifier (E)));
P := XTN.Node (Backend_Node (Identifier (E)));
......@@ -201,6 +206,8 @@ package body Ocarina.Backends.Deos_Conf.Hm is
Current_XML_Node := XTN.Root_Node (XTN.XML_File (U));
Partition_Identifier := 1;
--
-- For now, just generate the default HM policy.
--
......@@ -250,21 +257,6 @@ package body Ocarina.Backends.Deos_Conf.Hm is
Add_Error_Action (Multi_Partition_HM, "9", "MODULE", "IGNORE");
Add_Error_Action (Multi_Partition_HM, "10", "MODULE", "IGNORE");
--
-- The PartitionHM
--
Partition_HM := Make_XML_Node ("PartitionHM");
Append_Node_To_List
(Partition_HM,
XTN.Subitems (HM_Node));
XTU.Add_Attribute ("TableIdentifier", "1", Partition_HM);
XTU.Add_Attribute ("TableName", "1", Partition_HM);
XTU.Add_Attribute ("MultiPartitionHMTableNameRef",
"default MultiPartitionHM",
Partition_HM);
if not AINU.Is_Empty (Subcomponents (E)) then
S := First_Node (Subcomponents (E));
while Present (S) loop
......@@ -273,6 +265,29 @@ package body Ocarina.Backends.Deos_Conf.Hm is
if AINU.Is_Virtual_Processor (Corresponding_Instance (S)) then
Visit (Corresponding_Instance (S));
--
-- The PartitionHM
--
Partition_HM := Make_XML_Node ("PartitionHM");
Append_Node_To_List
(Partition_HM,
XTN.Subitems (HM_Node));
XTU.Add_Attribute ("TableIdentifier",
Trim (Unsigned_Long_Long'Image
(Partition_Identifier), Left),
Partition_HM);
XTU.Add_Attribute ("TableName",
"Unique name for partition " &
Trim (Unsigned_Long_Long'Image
(Partition_Identifier), Left),
Partition_HM);
XTU.Add_Attribute ("MultiPartitionHMTableNameRef",
"default MultiPartitionHM",
Partition_HM);
Partition_Identifier := Partition_Identifier + 1;
end if;
S := Next_Node (S);
end loop;
......
......@@ -978,11 +978,22 @@ package body Ocarina.Backends.Deos_Conf.Mapping is
Sampling_Port := Make_XML_Node ("SamplingPort");
Size := To_Bytes (Get_Data_Size
(Corresponding_Instance (Port)));
XTU.Add_Attribute ("Name",
Get_Name_String
(AIN.Name (Identifier (Port))),
Sampling_Port);
if Is_In (Port) then
XTU.Add_Attribute ("Name",
Get_Name_String
(AIN.Name (Identifier (Port))),
Sampling_Port);
else
XTU.Add_Attribute ("Name",
Get_Name_String
(AIN.Name
(Identifier
(Item
(AIN.First_Node
(Destinations (Port)))))),
Sampling_Port);
end if;
XTU.Add_Attribute ("MaxMessageSize",
Trim (Unsigned_Long_Long'Image
(Size), Left),
......@@ -1063,14 +1074,14 @@ package body Ocarina.Backends.Deos_Conf.Mapping is
Trim
(Unsigned_Long_Long'Image
(Period_Ns),
Left) & "000000",
Left),
Partition_Node);
XTU.Add_Attribute ("Duration",
Trim
(Unsigned_Long_Long'Image
(Duration_Ns),
Left) & "000000",
Left),
Partition_Node);
XTU.Add_Attribute ("ExecutableImageName",
......
......@@ -12,6 +12,7 @@ with Ocarina.Instances.Queries;
with Ocarina.Backends.Properties.ARINC653;
-- with Ocarina.Backends.Properties;
with Ocarina.Backends.Utils;
with Ocarina.Backends.XML_Tree.Nodes;
with Ocarina.Backends.XML_Tree.Nutils;
-- with Ocarina.Backends.Deos_Conf.Mapping;
......@@ -26,6 +27,7 @@ package body Ocarina.Backends.Deos_Conf.Schedule is
use Ocarina.ME_AADL.AADL_Instances.Entities;
use Ocarina.Backends.XML_Tree.Nutils;
use Ocarina.Backends.Utils;
use Ocarina.Backends.Properties.ARINC653;
-- use Ocarina.Backends.Properties;
-- use Ocarina.Backends.Deos_Conf.Mapping;
......@@ -158,7 +160,10 @@ package body Ocarina.Backends.Deos_Conf.Schedule is
Time_Window_Node : Node_Id;
Module_Schedule : constant Schedule_Window_Record_Term_Array
:= Get_Module_Schedule_Property (Processor);
Offset : Unsigned_Long_Long;
Slot_Duration : Unsigned_Long_Long;
begin
Offset := 0;
for J in Module_Schedule'Range loop
Time_Window_Node := Make_XML_Node ("PartitionTimeWindow");
......@@ -172,13 +177,16 @@ package body Ocarina.Backends.Deos_Conf.Schedule is
-- For now, we assume the partition duration
-- is in milliseconds.
--
Slot_Duration := To_Milliseconds
(Module_Schedule (J).Duration) * 1_000_000;
XTU.Add_Attribute ("Duration",
Trim
(Module_Schedule (J).Duration.T'Img,
Left) & "000000",
Trim (Unsigned_Long_Long'Image
(Slot_Duration), Left),
Time_Window_Node);
XTU.Add_Attribute ("Offset",
Trim (Unsigned_Long_Long'Image
(Offset), Left),
Time_Window_Node);
XTU.Add_Attribute ("Offset", "0", Time_Window_Node);
XTU.Add_Attribute ("PeriodicProcessingStart",
"true", Time_Window_Node);
XTU.Add_Attribute ("RepeatWindowAtNanosecondInterval",
......@@ -189,6 +197,7 @@ package body Ocarina.Backends.Deos_Conf.Schedule is
Get_Name_String
(Module_Schedule (J).Partition),
Time_Window_Node);
Offset := Offset + Slot_Duration;
end loop;
end Fill_Scheduling_Slots;
......
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