Commit a5ceddeb authored by yoogx's avatar yoogx

* For Schedule_Window_Record_Term, use a node_id instead of a

          name_id to refer to the corresponding partition

          For issue #31
parent 7c6abef4
-- with Locations;
with Ada.Strings; use Ada.Strings;
with Ada.Strings.Fixed; use Ada.Strings.Fixed;
with Ocarina.Namet; use Ocarina.Namet;
with Ocarina.ME_AADL;
with Ocarina.ME_AADL.AADL_Tree.Nodes;
with Ocarina.ME_AADL.AADL_Instances.Nodes;
with Ocarina.ME_AADL.AADL_Instances.Nutils;
with Ocarina.ME_AADL.AADL_Instances.Entities;
......@@ -32,6 +31,7 @@ package body Ocarina.Backends.Deos_Conf.Schedule is
-- use Ocarina.Backends.Properties;
-- use Ocarina.Backends.Deos_Conf.Mapping;
package ATN renames Ocarina.ME_AADL.AADL_Tree.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;
......@@ -165,7 +165,6 @@ package body Ocarina.Backends.Deos_Conf.Schedule is
begin
Offset := 0;
for J in Module_Schedule'Range loop
Time_Window_Node := Make_XML_Node ("PartitionTimeWindow");
Append_Node_To_List
......@@ -195,7 +194,9 @@ package body Ocarina.Backends.Deos_Conf.Schedule is
"false", Time_Window_Node);
XTU.Add_Attribute ("PartitionNameRef",
Get_Name_String
(Module_Schedule (J).Partition),
(ATN.Display_Name
(ATN.Identifier
(Module_Schedule (J).Partition))),
Time_Window_Node);
Offset := Offset + Slot_Duration;
end loop;
......
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2014 ESA & ISAE. --
-- Copyright (C) 2014-2015 ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify --
-- it under terms of the GNU General Public License as published by the --
......@@ -121,17 +121,11 @@ package body Ocarina.Backends.Properties.ARINC653 is
begin
while Present (L) loop
if Name (Identifier (L)) = Partition_Name then
-- Partition is a component reference. XXX For
-- now, we do not fully resolve this part during
-- analysis or instance, we thus resort to a
-- work-around, that is to simply return the
-- name of the referenced component.
-- Partition is a component reference
Result (J).Partition :=
Display_Name
(First_Node
(List_Items
(Reference_Term (Property_Expression (L)))));
Entity
(Reference_Term (Property_Expression (L)));
elsif Name (Identifier (L)) = Duration_Name then
Result (J).Duration := Convert_Value_To_Time_Type
......
......@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 2014 ESA & ISAE. --
-- Copyright (C) 2014-2015 ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify --
-- it under terms of the GNU General Public License as published by the --
......@@ -37,7 +37,7 @@
package Ocarina.Backends.Properties.ARINC653 is
type Schedule_Window_Record_Term is record
Partition : Name_Id;
Partition : Node_Id;
Duration : Time_Type;
Periodic_Processing_Start : Boolean;
end record;
......@@ -47,7 +47,7 @@ package Ocarina.Backends.Properties.ARINC653 is
Empty_Schedule_Window_Record_Term_Array :
constant Schedule_Window_Record_Term_Array (1 .. 0)
:= (others => (No_Name, (0, Picosecond), False));
:= (others => (No_Node, (0, Picosecond), False));
function Get_Module_Schedule_Property
(E : Node_Id)
......
-- with Locations;
with Ocarina.Namet; use Ocarina.Namet;
with Ocarina.ME_AADL;
with Ocarina.ME_AADL.AADL_Instances.Nodes;
......@@ -14,6 +13,7 @@ with Ocarina.Backends.Utils;
with Ocarina.Backends.XML_Tree.Nodes;
with Ocarina.Backends.XML_Tree.Nutils;
-- with Ocarina.Backends.Vxworks653_Conf.Mapping;
with Ocarina.ME_AADL.AADL_Tree.Nodes;
package body Ocarina.Backends.Vxworks653_Conf.Schedule is
......@@ -31,6 +31,7 @@ package body Ocarina.Backends.Vxworks653_Conf.Schedule is
-- use Ocarina.Backends.Properties;
-- use Ocarina.Backends.Vxworks653_Conf.Mapping;
package ATN renames Ocarina.ME_AADL.AADL_Tree.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;
......@@ -191,7 +192,9 @@ package body Ocarina.Backends.Vxworks653_Conf.Schedule is
"1", Partition_Window_Node);
XTU.Add_Attribute ("PartitionNameRef",
Get_Name_String
(Module_Schedule (J).Partition),
(ATN.Display_Name
(ATN.Identifier
(Module_Schedule (J).Partition))),
Partition_Window_Node);
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