Commit 8ce3ebb7 authored by yoogx's avatar yoogx
Browse files

Merge branch 'master' of https://github.com/yoogx/ocarina

parents 26afb0f9 3ab97c9c
...@@ -31,12 +31,6 @@ ...@@ -31,12 +31,6 @@
-- -- -- --
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
with Ada.Text_IO; use Ada.Text_IO;
with Ocarina.Namet; use Ocarina.Namet;
with Ocarina.Backends.Properties.ARINC653;
use Ocarina.Backends.Properties.ARINC653;
-- with Locations; -- with Locations;
with Ocarina.ME_AADL; with Ocarina.ME_AADL;
with Ocarina.ME_AADL.AADL_Instances.Nodes; with Ocarina.ME_AADL.AADL_Instances.Nodes;
...@@ -254,22 +248,6 @@ package body Ocarina.Backends.Deos_Conf.Partitions is ...@@ -254,22 +248,6 @@ package body Ocarina.Backends.Deos_Conf.Partitions is
Partition_Identifier := 1; Partition_Identifier := 1;
declare
Module_Schedule : constant Schedule_Window_Record_Term_Array
:= Get_Module_Schedule_Property (E);
begin
for J in Module_Schedule'Range loop
Put_Line ("Module Schedule slot #" & J'Img);
Put_Line (" -> "
& Get_Name_String (Module_Schedule (J).Partition));
Put_Line (" -> "
& Module_Schedule (J).Duration.T'Img
& " " & Module_Schedule (J).Duration.U'Img);
Put_Line (" -> "
& Module_Schedule (J).Periodic_Processing_Start'Img);
end loop;
end;
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");
......
-- with Locations; -- with Locations;
with Ada.Strings; use Ada.Strings;
with Ada.Strings.Fixed; use Ada.Strings.Fixed;
with Ocarina.Namet; use Ocarina.Namet; 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;
with Ocarina.ME_AADL.AADL_Instances.Entities; with Ocarina.ME_AADL.AADL_Instances.Entities;
with Ocarina.Instances.Queries;
with Ocarina.Backends.Properties.ARINC653;
-- with Ocarina.Backends.Properties; -- with Ocarina.Backends.Properties;
with Ocarina.Backends.XML_Tree.Nodes; with Ocarina.Backends.XML_Tree.Nodes;
...@@ -14,14 +20,17 @@ package body Ocarina.Backends.Deos_Conf.Schedule is ...@@ -14,14 +20,17 @@ package body Ocarina.Backends.Deos_Conf.Schedule is
-- use Locations; -- use Locations;
use Ocarina.ME_AADL; use Ocarina.ME_AADL;
use Ocarina.Instances.Queries;
use Ocarina.ME_AADL.AADL_Instances.Nodes; use Ocarina.ME_AADL.AADL_Instances.Nodes;
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.ARINC653;
-- use Ocarina.Backends.Properties; -- use Ocarina.Backends.Properties;
-- 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; package XTU renames Ocarina.Backends.XML_Tree.Nutils;
...@@ -35,7 +44,7 @@ package body Ocarina.Backends.Deos_Conf.Schedule is ...@@ -35,7 +44,7 @@ package body Ocarina.Backends.Deos_Conf.Schedule is
procedure Visit_Processor_Instance (E : Node_Id); procedure Visit_Processor_Instance (E : Node_Id);
procedure Visit_Bus_Instance (E : Node_Id); procedure Visit_Bus_Instance (E : Node_Id);
procedure Visit_Virtual_Processor_Instance (E : Node_Id); procedure Visit_Virtual_Processor_Instance (E : Node_Id);
procedure Fill_Scheduling_Slots (Processor : Node_Id);
----------- -----------
-- Visit -- -- Visit --
----------- -----------
...@@ -141,14 +150,64 @@ package body Ocarina.Backends.Deos_Conf.Schedule is ...@@ -141,14 +150,64 @@ package body Ocarina.Backends.Deos_Conf.Schedule is
null; null;
end Visit_Bus_Instance; end Visit_Bus_Instance;
---------------------------
-- Fill_Scheduling_Slots --
---------------------------
procedure Fill_Scheduling_Slots (Processor : Node_Id) is
Time_Window_Node : Node_Id;
Module_Schedule : constant Schedule_Window_Record_Term_Array
:= Get_Module_Schedule_Property (Processor);
begin
for J in Module_Schedule'Range loop
-- Put_Line ("Module Schedule slot #" & J'Img);
-- Put_Line (" -> "
-- & Get_Name_String (Module_Schedule (J).Partition));
-- Put_Line (" -> "
-- & Module_Schedule (J).Duration.T'Img
-- & " " & Module_Schedule (J).Duration.U'Img);
-- Put_Line (" -> "
-- & Module_Schedule (J).Periodic_Processing_Start'Img);
Time_Window_Node := Make_XML_Node ("PartitionTimeWindow");
Append_Node_To_List
(Time_Window_Node,
XTN.Subitems (Schedule_Node));
-- XTU.Add_Attribute ("Duration", "6000000", Time_Window_Node);
--
-- For now, we assume the partition duration
-- is in milliseconds.
--
XTU.Add_Attribute ("Duration",
Trim
(Module_Schedule (J).Duration.T'Img,
Left) & "000000",
Time_Window_Node);
XTU.Add_Attribute ("Offset", "0", Time_Window_Node);
XTU.Add_Attribute ("PeriodicProcessingStart",
"true", 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
(Module_Schedule (J).Partition),
Time_Window_Node);
end loop;
end Fill_Scheduling_Slots;
------------------------------ ------------------------------
-- Visit_Processor_Instance -- -- Visit_Processor_Instance --
------------------------------ ------------------------------
procedure Visit_Processor_Instance (E : Node_Id) is procedure Visit_Processor_Instance (E : Node_Id) is
S : Node_Id; S : Node_Id;
U : Node_Id; U : Node_Id;
P : Node_Id; P : Node_Id;
begin begin
U := XTN.Unit (Backend_Node (Identifier (E))); U := XTN.Unit (Backend_Node (Identifier (E)));
P := XTN.Node (Backend_Node (Identifier (E))); P := XTN.Node (Backend_Node (Identifier (E)));
...@@ -167,6 +226,10 @@ package body Ocarina.Backends.Deos_Conf.Schedule is ...@@ -167,6 +226,10 @@ package body Ocarina.Backends.Deos_Conf.Schedule is
(Schedule_Node, (Schedule_Node,
XTN.Subitems (Current_XML_Node)); XTN.Subitems (Current_XML_Node));
if Is_Defined_Property (E, "arinc653::module_schedule") then
Fill_Scheduling_Slots (E);
end if;
if not AINU.Is_Empty (Subcomponents (E)) then if not AINU.Is_Empty (Subcomponents (E)) then
S := First_Node (Subcomponents (E)); S := First_Node (Subcomponents (E));
while Present (S) loop while Present (S) loop
...@@ -189,27 +252,9 @@ package body Ocarina.Backends.Deos_Conf.Schedule is ...@@ -189,27 +252,9 @@ 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
Time_Window_Node : Node_Id; pragma Unreferenced (E);
begin begin
Time_Window_Node := Make_XML_Node ("PartitionTimeWindow"); null;
Append_Node_To_List
(Time_Window_Node,
XTN.Subitems (Schedule_Node));
XTU.Add_Attribute ("Duration", "6000000", Time_Window_Node);
XTU.Add_Attribute ("Offset", "0", Time_Window_Node);
XTU.Add_Attribute ("PeriodicProcessingStart", "true", 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